aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgtags2
-rw-r--r--AUTHORS20
-rw-r--r--CMakeLists.txt11
-rw-r--r--ChangeLog5
-rw-r--r--INSTALL.linux2
-rw-r--r--Makefile.am60
-rw-r--r--NEWS9
-rw-r--r--README10
-rw-r--r--THANKS58
-rw-r--r--bcpp.cfg109
-rw-r--r--configure.ac382
-rw-r--r--contrib/Makefile.am25
-rw-r--r--contrib/cleanup/tab2spaces.sh2
-rw-r--r--contrib/cleanup/whitespace.sh2
-rw-r--r--contrib/extractor/CMakeLists.txt26
-rw-r--r--contrib/extractor/Makefile471
-rw-r--r--contrib/extractor/README.linux12
-rw-r--r--contrib/extractor/System.cpp832
-rw-r--r--contrib/extractor/VC71_ad.vcproj10
-rw-r--r--contrib/extractor/VC80_ad.vcproj10
-rw-r--r--contrib/extractor/VC90_ad.vcproj10
-rw-r--r--contrib/extractor/ad.exebin158720 -> 163840 bytes
-rw-r--r--contrib/extractor/adt.cpp539
-rw-r--r--contrib/extractor/adt.h141
-rw-r--r--contrib/extractor/dbcfile.cpp31
-rw-r--r--contrib/extractor/dbcfile.h2
-rw-r--r--contrib/extractor/libmpq/CMakeLists.txt13
-rw-r--r--contrib/extractor/libmpq/Makefile17
-rw-r--r--contrib/extractor/libmpq/mpq.cpp2
-rw-r--r--contrib/extractor/loadlib/CMakeLists.txt13
-rw-r--r--contrib/extractor/loadlib/adt.cpp131
-rw-r--r--contrib/extractor/loadlib/adt.h289
-rw-r--r--contrib/extractor/loadlib/loadlib.cpp64
-rw-r--r--contrib/extractor/loadlib/loadlib.h57
-rw-r--r--contrib/extractor/loadlib/wdt.cpp62
-rw-r--r--contrib/extractor/loadlib/wdt.h68
-rw-r--r--contrib/extractor/mpq_libmpq.h2
-rw-r--r--contrib/vmap_debugger/ModelContainerView.cpp4
-rw-r--r--contrib/vmap_extract_assembler_bin/vmap_assembler.exebin184320 -> 293888 bytes
-rw-r--r--contrib/vmap_extract_assembler_bin/vmapextract_v2.exebin233472 -> 217088 bytes
-rw-r--r--contrib/vmap_extractor_v2/doc/MoPaQ_0.9.txt318
-rw-r--r--contrib/vmap_extractor_v2/doc/MoPaQ_1.0.txt421
-rw-r--r--contrib/vmap_extractor_v2/stormlib/Makefile58
-rw-r--r--contrib/vmap_extractor_v2/stormlib/bzip2/Makefile205
-rw-r--r--contrib/vmap_extractor_v2/stormlib/zlib/Makefile175
-rw-r--r--contrib/vmap_extractor_v2/stormlib/zlib/Makefile.in175
-rw-r--r--contrib/vmap_extractor_v2/stormlib/zlib/configure212
-rw-r--r--contrib/vmap_extractor_v2/stormlib/zlib/contrib/minizip/Makefile25
-rw-r--r--contrib/vmap_extractor_v2/stormlib/zlib/contrib/untgz/Makefile14
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/model.cpp159
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/model.h65
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/modelheaders.h344
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/vmapexport.cpp6
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/wmo.cpp402
-rw-r--r--contrib/vmap_extractor_v2/vmapextract/wmo.h8
-rw-r--r--dep/Makefile.am29
-rw-r--r--dep/include/Makefile.am263
-rw-r--r--dep/include/mersennetwister/MersenneTwister.h2
-rw-r--r--dep/include/openssl/aes.h69
-rw-r--r--dep/include/openssl/asn1.h1342
-rw-r--r--dep/include/openssl/asn1t.h658
-rw-r--r--dep/include/openssl/bio.h734
-rw-r--r--dep/include/openssl/blowfish.h43
-rw-r--r--dep/include/openssl/bn.h815
-rw-r--r--dep/include/openssl/cast.h47
-rw-r--r--dep/include/openssl/comp.h65
-rw-r--r--dep/include/openssl/conf.h154
-rw-r--r--dep/include/openssl/crypto.h404
-rw-r--r--dep/include/openssl/des.h174
-rw-r--r--dep/include/openssl/des_old.h250
-rw-r--r--dep/include/openssl/dh.h194
-rw-r--r--dep/include/openssl/dsa.h278
-rw-r--r--dep/include/openssl/dtls1.h187
-rw-r--r--dep/include/openssl/ec.h380
-rw-r--r--dep/include/openssl/engine.h377
-rw-r--r--dep/include/openssl/err.h231
-rw-r--r--dep/include/openssl/evp.h1002
-rw-r--r--dep/include/openssl/hmac.h42
-rw-r--r--dep/include/openssl/idea.h40
-rw-r--r--dep/include/openssl/md2.h32
-rw-r--r--dep/include/openssl/md4.h36
-rw-r--r--dep/include/openssl/md5.h36
-rw-r--r--dep/include/openssl/mdc2.h97
-rw-r--r--dep/include/openssl/obj_mac.h6494
-rw-r--r--dep/include/openssl/ocsp.h394
-rw-r--r--dep/include/openssl/opensslconf.h78
-rw-r--r--dep/include/openssl/opensslv.h35
-rw-r--r--dep/include/openssl/ossl_typ.h54
-rw-r--r--dep/include/openssl/pem.h758
-rw-r--r--dep/include/openssl/pkcs12.h217
-rw-r--r--dep/include/openssl/pq_compat.h16
-rw-r--r--dep/include/openssl/rand.h64
-rw-r--r--dep/include/openssl/rc2.h43
-rw-r--r--dep/include/openssl/rc4.h28
-rw-r--r--dep/include/openssl/rc5.h118
-rw-r--r--dep/include/openssl/ripemd.h37
-rw-r--r--dep/include/openssl/rsa.h496
-rw-r--r--dep/include/openssl/safestack.h527
-rw-r--r--dep/include/openssl/sha.h86
-rw-r--r--dep/include/openssl/ssl.h2458
-rw-r--r--dep/include/openssl/ssl3.h729
-rw-r--r--dep/include/openssl/symhacks.h147
-rw-r--r--dep/include/openssl/tls1.h349
-rw-r--r--dep/include/openssl/x509.h1256
-rw-r--r--dep/include/openssl/x509v3.h676
-rw-r--r--dep/lib/Makefile.am52
-rw-r--r--dep/lib/win32_debug/libeay32.dllbin1249280 -> 1251840 bytes
-rw-r--r--dep/lib/win32_debug/libeay32.libbin664514 -> 673762 bytes
-rw-r--r--dep/lib/win32_release/libeay32.dllbin1032192 -> 1011712 bytes
-rw-r--r--dep/lib/win32_release/libeay32.libbin664514 -> 673762 bytes
-rw-r--r--dep/lib/x64_Debug/libeay32.dllbin1412608 -> 1726976 bytes
-rw-r--r--dep/lib/x64_Debug/libeay32.libbin649432 -> 658480 bytes
-rw-r--r--dep/lib/x64_release/libeay32.dllbin1412608 -> 1363456 bytes
-rw-r--r--dep/lib/x64_release/libeay32.libbin649432 -> 658480 bytes
-rw-r--r--dep/src/Makefile.am25
-rw-r--r--dep/src/sockets/Makefile.am49
-rw-r--r--doc/EventAI.txt794
-rw-r--r--doc/Makefile.am51
-rw-r--r--sql/CMakeLists.txt2
-rw-r--r--sql/Makefile.am48
-rw-r--r--sql/TBC-WLK_converter/CMakeLists.txt5
-rw-r--r--sql/TBC-WLK_converter/Readme.txt10
-rw-r--r--sql/TBC-WLK_converter/TBC-WLK_characters.sql375
-rw-r--r--sql/TBC-WLK_converter/TBC-WLK_world.sql9136
-rw-r--r--sql/TBC-WLK_converter/TBC-WLK_world_run_only_once.sql189
-rw-r--r--sql/characters.sql128
-rw-r--r--sql/mangos.sql18020
-rw-r--r--sql/realmd.sql69
-rw-r--r--sql/tools/CMakeLists.txt4
-rw-r--r--sql/tools/Makefile.am38
-rw-r--r--sql/trinityscript_script_texts.sql476
-rw-r--r--sql/updates/1026_mangos_7113_01_characters_character_achievement_progress.sql3
-rw-r--r--sql/updates/1028_mangos_7141_01_world_instance_template.sql12
-rw-r--r--sql/updates/1028_mangos_7147_01_world_creature_template.sql4
-rw-r--r--sql/updates/1028_mangos_7150_01_world_playercreateinfo_spell.sql10
-rw-r--r--sql/updates/1073_world_scripts.sql2
-rw-r--r--sql/updates/1074_world_scripts.sql2
-rw-r--r--sql/updates/1084_mangos_7168_01_world_command.sql6
-rw-r--r--sql/updates/1094_mangos_7193_01_world_trinity_string.sql3
-rw-r--r--sql/updates/1108_mangos_7196_02_world_spell_bonus_data.sql233
-rw-r--r--sql/updates/1108_mangos_7198_01_characters_characters.sql27
-rw-r--r--sql/updates/1108_mangos_7199_01_world_spell_bonus_data.sql11
-rw-r--r--sql/updates/1135_mangos_7207_01_world_creature.sql4
-rw-r--r--sql/updates/1135_mangos_7207_02_world_gameobject.sql4
-rw-r--r--sql/updates/1135_mangos_7207_03_characters_corpse.sql4
-rw-r--r--sql/updates/1140_mangos_7209_01_world_spell_bonus_data.sql5
-rw-r--r--sql/updates/1185_mangos_7214_01_world_command.sql8
-rw-r--r--sql/updates/1185_mangos_7214_02_world_trinity_string.sql5
-rw-r--r--sql/updates/1185_mangos_7214_03_world_spell_proc_event.sql865
-rw-r--r--sql/updates/1206_world_scripts.sql1
-rw-r--r--sql/updates/1207_world_scripts.sql2
-rw-r--r--sql/updates/1211_world.sql4
-rw-r--r--sql/updates/1234_world.sql31
-rw-r--r--sql/updates/1236_world.sql4
-rw-r--r--sql/updates/1237_mangos_7230_01_world_spell_bonus_data.sql9
-rw-r--r--sql/updates/1248_mangos_7235_01_world_command.sql5
-rw-r--r--sql/updates/1288_mangos_7242_01_world_spell_bonus_data.sql7
-rw-r--r--sql/updates/1293_mangos_7249_01_world_spell_proc_event.sql3
-rw-r--r--sql/updates/1296_mangos_7252_01_world_command.sql6
-rw-r--r--sql/updates/1296_mangos_7252_02_world_trinity_string.sql14
-rw-r--r--sql/updates/1299_mangos_7255_01_characters_characters.sql10
-rw-r--r--sql/updates/1304_world.sql3
-rw-r--r--sql/updates/1307_world.sql1
-rw-r--r--sql/updates/1311_characters.sql1
-rw-r--r--sql/updates/1312_world.sql16
-rw-r--r--sql/updates/1327_world.sql4
-rw-r--r--sql/updates/1340_world.sql2
-rw-r--r--sql/updates/1351_world.sql784
-rw-r--r--sql/updates/1366_world.sql1
-rw-r--r--sql/updates/1396_mangos_7267_01_characters_auctionhouse.sql4
-rw-r--r--sql/updates/1414_world_scripts.sql121
-rw-r--r--sql/updates/1423_mangos_7290_01_world_command.sql5
-rw-r--r--sql/updates/1426_mangos_7292_01_world_points_of_interest.sql13
-rw-r--r--sql/updates/1426_mangos_7292_02_world_locales_points_of_interest.sql15
-rw-r--r--sql/updates/1463_mangos_7303_01_world_pools.sql39
-rw-r--r--sql/updates/1470_world_scripts.sql4
-rw-r--r--sql/updates/1484_mangos_7307_01_characters_arena_team_member.sql4
-rw-r--r--sql/updates/1495_mangos_7312_01_world_trinity_string.sql5
-rw-r--r--sql/updates/1497_mangos_7314_01_characters_guild_rank.sql3
-rw-r--r--sql/updates/1525_world_scripts.sql2
-rw-r--r--sql/updates/1531_mangos_7324_01_characters_character_spell.sql13
-rw-r--r--sql/updates/1531_mangos_7324_02_characters_character_aura.sql13
-rw-r--r--sql/updates/1555_mangos_7331_01_world_command.sql65
-rw-r--r--sql/updates/1558_world.sql5
-rw-r--r--sql/updates/1559_world.sql11
-rw-r--r--sql/updates/1576_mangos_7332_01_world_command.sql5
-rw-r--r--sql/updates/1605_mangos_7349_01_world_spell_area.sql15
-rw-r--r--sql/updates/1613_world_scripts.sql3
-rw-r--r--sql/updates/1614_characters_auctionhouse.sql24
-rw-r--r--sql/updates/1618_world.sql6
-rw-r--r--sql/updates/1646_mangos_7369_01_world_quest_template.sql7
-rw-r--r--sql/updates/1654_world.sql1
-rw-r--r--sql/updates/1657_world.sql2
-rw-r--r--sql/updates/1661_world.sql2
-rw-r--r--sql/updates/1663_mangos_7376_01_world_spell_area.sql4
-rw-r--r--sql/updates/1688_mangos_7382_01_world_creature_template.sql5
-rw-r--r--sql/updates/1693_world.sql87
-rw-r--r--sql/updates/1694_world.sql16
-rw-r--r--sql/updates/1697_mangos_7388_01_world_trinity_string.sql6
-rw-r--r--sql/updates/1703_world.sql140
-rw-r--r--sql/updates/1709_mangos_7393_01_world_game_event.sql4
-rw-r--r--sql/updates/1724_mangos_7399_01_world_trinity_string.sql7
-rw-r--r--sql/updates/1727_world.sql1
-rw-r--r--sql/updates/1727_world_script.sql3
-rw-r--r--sql/updates/1729_world.sql4
-rw-r--r--sql/updates/1730_world.sql4
-rw-r--r--sql/updates/1732_world.sql7
-rw-r--r--sql/updates/1755_world.sql12
-rw-r--r--sql/updates/1764_world.sql9
-rw-r--r--sql/updates/1766_world.sql2
-rw-r--r--sql/updates/1791_mangos_7422_01_world_trinity_string.sql9
-rw-r--r--sql/updates/1814_world.sql4
-rw-r--r--sql/updates/1825_world.sql1
-rw-r--r--sql/updates/1828_world.sql3
-rw-r--r--sql/updates/1877_mangos_7439_01_world_trinity_string.sql5
-rw-r--r--sql/updates/1884_world.sql1
-rw-r--r--sql/updates/1886_world.sql6
-rw-r--r--sql/updates/1911_world.sql4
-rw-r--r--sql/updates/1912_world.sql5
-rw-r--r--sql/updates/1927_world.sql11
-rw-r--r--sql/updates/1939_word.sql5
-rw-r--r--sql/updates/1957_word.sql5
-rw-r--r--sql/updates/1962_mangos_7472_01_world_trinity_string.sql27
-rw-r--r--sql/updates/2.4.3_updates/1018_world.sql (renamed from sql/updates/1018_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/1026_world.sql (renamed from sql/updates/1026_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/1028_world_scripts.sql (renamed from sql/updates/1028_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/102_world.sql (renamed from sql/updates/102_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/1069_world_scripts.sql (renamed from sql/updates/1069_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/1073_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/1074_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/112_world_scripts.sql (renamed from sql/updates/112_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/1138_world.sql (renamed from sql/updates/1138_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/1142_world.sql (renamed from sql/updates/1142_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/1159_world.sql (renamed from sql/updates/1159_world.sql)4
-rw-r--r--sql/updates/2.4.3_updates/1160_world.sql (renamed from sql/updates/1160_world.sql)7
-rw-r--r--sql/updates/2.4.3_updates/1164_characters.sql (renamed from sql/updates/1164_characters.sql)0
-rw-r--r--sql/updates/2.4.3_updates/116_world.sql (renamed from sql/updates/116_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/117_world_scripts.sql (renamed from sql/updates/117_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/11_characters.sql (renamed from sql/updates/11_characters.sql)3
-rw-r--r--sql/updates/2.4.3_updates/120_world.sql (renamed from sql/updates/120_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/123_world_scripts.sql (renamed from sql/updates/123_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/1247_world.sql (renamed from sql/updates/1247_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/1249_world.sql (renamed from sql/updates/1249_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/125_world_scripts.sql (renamed from sql/updates/125_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/1261_world.sql (renamed from sql/updates/1261_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/1265_world.sql (renamed from sql/updates/1265_world.sql)2
-rw-r--r--sql/updates/2.4.3_updates/1304_world.sql3
-rw-r--r--sql/updates/2.4.3_updates/133_world_scripts.sql (renamed from sql/updates/133_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/140_world.sql (renamed from sql/updates/140_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/145_world_scripts.sql (renamed from sql/updates/145_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/146_world.sql (renamed from sql/updates/146_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/147_world.sql (renamed from sql/updates/147_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/152_world.sql (renamed from sql/updates/152_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/153_world.sql (renamed from sql/updates/153_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/171_world.sql (renamed from sql/updates/171_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/172_world_scripts.sql (renamed from sql/updates/172_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/175_world_scripts.sql (renamed from sql/updates/175_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/176_world.sql (renamed from sql/updates/176_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/182_world.sql (renamed from sql/updates/182_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/212_world_scripts.sql (renamed from sql/updates/212_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/220_characters.sql (renamed from sql/updates/220_characters.sql)3
-rw-r--r--sql/updates/2.4.3_updates/230_world.sql (renamed from sql/updates/230_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/230_world_blacktemple.sql (renamed from sql/updates/230_world_blacktemple.sql)3
-rw-r--r--sql/updates/2.4.3_updates/230_world_scripts.sql (renamed from sql/updates/230_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/230_world_serpent_shrine.sql (renamed from sql/updates/230_world_serpent_shrine.sql)1
-rw-r--r--sql/updates/2.4.3_updates/231_world_scripts.sql (renamed from sql/updates/231_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/233_world.sql (renamed from sql/updates/233_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/238_world.sql1
-rw-r--r--sql/updates/2.4.3_updates/240_world.sql (renamed from sql/updates/240_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/241_world.sql (renamed from sql/updates/241_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/247_world.sql (renamed from sql/updates/247_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/262_characters.sql (renamed from sql/updates/262_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/262_realmd.sql (renamed from sql/updates/262_realmd.sql)1
-rw-r--r--sql/updates/2.4.3_updates/262_world.sql (renamed from sql/updates/262_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/273_world_scripts.sql (renamed from sql/updates/273_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/285_world.sql (renamed from sql/updates/285_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/287_world_scripts.sql (renamed from sql/updates/287_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/329_world.sql (renamed from sql/updates/329_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/332_world.sql (renamed from sql/updates/332_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/333_world.sql (renamed from sql/updates/333_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/334_world.sql (renamed from sql/updates/334_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/341_world.sql1
-rw-r--r--sql/updates/2.4.3_updates/356_world.sql (renamed from sql/updates/356_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/373_world_scripts.sql (renamed from sql/updates/373_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/377_world_scripts.sql (renamed from sql/updates/377_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/389_world.sql (renamed from sql/updates/389_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/400_world.sql (renamed from sql/updates/400_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/410_characters.sql (renamed from sql/updates/410_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/426_world_scripts.sql (renamed from sql/updates/426_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/427_world_scripts.sql (renamed from sql/updates/427_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/444_world.sql (renamed from sql/updates/444_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/452_world.sql (renamed from sql/updates/452_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/455_world.sql (renamed from sql/updates/455_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/45_characters.sql (renamed from sql/updates/45_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/471_world.sql (renamed from sql/updates/471_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/480_world_scripts.sql (renamed from sql/updates/480_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/488_world_scripts.sql (renamed from sql/updates/488_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/502_world_scripts.sql (renamed from sql/updates/502_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/505_world.sql (renamed from sql/updates/505_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/506_world.sql (renamed from sql/updates/506_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/513_world_scripts.sql (renamed from sql/updates/513_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/519_world.sql (renamed from sql/updates/519_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/537_world.sql (renamed from sql/updates/537_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/541_characters.sql (renamed from sql/updates/541_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/541_world.sql (renamed from sql/updates/541_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/542_characters.sql (renamed from sql/updates/542_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/54_world.sql (renamed from sql/updates/54_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/551_world.sql (renamed from sql/updates/551_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/566_world.sql (renamed from sql/updates/566_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/571_world.sql (renamed from sql/updates/571_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/572_world.sql (renamed from sql/updates/572_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/575_world_scripts.sql (renamed from sql/updates/575_world_scripts.sql)1
-rw-r--r--sql/updates/2.4.3_updates/57_world_scripts.sql (renamed from sql/updates/57_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/583_world_scripts.sql (renamed from sql/updates/583_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/586_world_scripts.sql (renamed from sql/updates/586_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/588_world.sql (renamed from sql/updates/588_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/608_world.sql (renamed from sql/updates/608_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/615_world.sql (renamed from sql/updates/615_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/636_world_scripts.sql (renamed from sql/updates/636_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/640_world.sql (renamed from sql/updates/640_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/645_world_scripts.sql (renamed from sql/updates/645_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/667_world_scripts.sql (renamed from sql/updates/667_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/66_world_scripts.sql (renamed from sql/updates/66_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/676_world.sql (renamed from sql/updates/676_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/679_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/683_world_scripts.sql2
-rw-r--r--sql/updates/2.4.3_updates/686_world_scripts.sql (renamed from sql/updates/686_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/68_world.sql (renamed from sql/updates/68_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/691_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/692_world.sql5
-rw-r--r--sql/updates/2.4.3_updates/708_world_scripts.sql2
-rw-r--r--sql/updates/2.4.3_updates/70_world_scripts.sql (renamed from sql/updates/70_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/722_world_script_texts.sql (renamed from sql/updates/722_world_script_texts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/724_world.sql3
-rw-r--r--sql/updates/2.4.3_updates/725_characters.sql5
-rw-r--r--sql/updates/2.4.3_updates/725_world.sql31
-rw-r--r--sql/updates/2.4.3_updates/728_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/733_characters.sql1
-rw-r--r--sql/updates/2.4.3_updates/739_characters.sql1
-rw-r--r--sql/updates/2.4.3_updates/741_characters.sql (renamed from sql/updates/741_characters.sql)1
-rw-r--r--sql/updates/2.4.3_updates/741_world.sql (renamed from sql/updates/741_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/747_world.sql (renamed from sql/updates/747_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/748_world_scripts.sql3
-rw-r--r--sql/updates/2.4.3_updates/758_world_scripts.sql6
-rw-r--r--sql/updates/2.4.3_updates/762_world.sql (renamed from sql/updates/762_world.sql)5
-rw-r--r--sql/updates/2.4.3_updates/764_world_scripts.sql123
-rw-r--r--sql/updates/2.4.3_updates/765_world_scripts.sql (renamed from sql/updates/765_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/773_world_scripts.sql (renamed from sql/updates/773_world_scripts.sql)9
-rw-r--r--sql/updates/2.4.3_updates/780_characters.sql (renamed from sql/updates/780_characters.sql)3
-rw-r--r--sql/updates/2.4.3_updates/783_world.sql (renamed from sql/updates/783_world.sql)7
-rw-r--r--sql/updates/2.4.3_updates/785_world.sql (renamed from sql/updates/785_world.sql)5
-rw-r--r--sql/updates/2.4.3_updates/789_world.sql1
-rw-r--r--sql/updates/2.4.3_updates/78_world.sql (renamed from sql/updates/78_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/79_characters.sql (renamed from sql/updates/79_characters.sql)3
-rw-r--r--sql/updates/2.4.3_updates/79_world.sql (renamed from sql/updates/79_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/807_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/817_world_scripts.sql (renamed from sql/updates/817_world_scripts.sql)9
-rw-r--r--sql/updates/2.4.3_updates/822_world_scripts.sql3
-rw-r--r--sql/updates/2.4.3_updates/826_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/82_world_scripts.sql (renamed from sql/updates/82_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/833_world_scripts.sql2
-rw-r--r--sql/updates/2.4.3_updates/834_world_scripts.sql (renamed from sql/updates/834_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/837_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/838_world_scripts.sql4
-rw-r--r--sql/updates/2.4.3_updates/839_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/83_realmd.sql (renamed from sql/updates/83_realmd.sql)3
-rw-r--r--sql/updates/2.4.3_updates/840_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/841_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/842_world.sql (renamed from sql/updates/842_world.sql)3
-rw-r--r--sql/updates/2.4.3_updates/84_world.sql (renamed from sql/updates/84_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/850_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/852_world_scripts.sql2
-rw-r--r--sql/updates/2.4.3_updates/857_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/863_world_scripts.sql (renamed from sql/updates/863_world_scripts.sql)9
-rw-r--r--sql/updates/2.4.3_updates/86_world_scripts.sql (renamed from sql/updates/86_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/871_world.sql (renamed from sql/updates/871_world.sql)5
-rw-r--r--sql/updates/2.4.3_updates/884_world.sql (renamed from sql/updates/884_world.sql)7
-rw-r--r--sql/updates/2.4.3_updates/905_world_scripts.sql (renamed from sql/updates/905_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/90_world.sql (renamed from sql/updates/90_world.sql)1
-rw-r--r--sql/updates/2.4.3_updates/917_world.sql (renamed from sql/updates/917_world.sql)7
-rw-r--r--sql/updates/2.4.3_updates/919_world.sql2
-rw-r--r--sql/updates/2.4.3_updates/927_characters.sql (renamed from sql/updates/927_characters.sql)3
-rw-r--r--sql/updates/2.4.3_updates/930_characters.sql (renamed from sql/updates/930_characters.sql)5
-rw-r--r--sql/updates/2.4.3_updates/933_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/935_world_scripts.sql6
-rw-r--r--sql/updates/2.4.3_updates/940_world_scripts.sql2
-rw-r--r--sql/updates/2.4.3_updates/945_world_scripts.sql (renamed from sql/updates/945_world_scripts.sql)22
-rw-r--r--sql/updates/2.4.3_updates/947_world_scripts.sql (renamed from sql/updates/947_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/948_world_scripts.sql (renamed from sql/updates/948_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/950_world_scripts.sql (renamed from sql/updates/950_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/951_world_scripts.sql (renamed from sql/updates/951_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/952_world_scripts.sql (renamed from sql/updates/952_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/953_world_scripts.sql (renamed from sql/updates/953_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/954_world_scripts.sql (renamed from sql/updates/954_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/955_world_scripts.sql (renamed from sql/updates/955_world_scripts.sql)15
-rw-r--r--sql/updates/2.4.3_updates/956_world_scripts.sql (renamed from sql/updates/956_world_scripts.sql)11
-rw-r--r--sql/updates/2.4.3_updates/957_world_scripts.sql (renamed from sql/updates/957_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/963_world_scripts.sql (renamed from sql/updates/963_world_scripts.sql)17
-rw-r--r--sql/updates/2.4.3_updates/965_world_scripts.sql (renamed from sql/updates/965_world_scripts.sql)3
-rw-r--r--sql/updates/2.4.3_updates/966_world_scripts.sql (renamed from sql/updates/966_world_scripts.sql)7
-rw-r--r--sql/updates/2.4.3_updates/970_world_scripts.sql (renamed from sql/updates/970_world_scripts.sql)8
-rw-r--r--sql/updates/2.4.3_updates/973_world_scripts.sql1
-rw-r--r--sql/updates/2.4.3_updates/CMakeLists.txt5
-rw-r--r--sql/updates/2013_world.sql11
-rw-r--r--sql/updates/2021_world.sql6
-rw-r--r--sql/updates/2025_mangos_7493_01_world_command.sql7
-rw-r--r--sql/updates/2025_mangos_7495_01_world_trinity_string.sql7
-rw-r--r--sql/updates/2031_realmd.sql8
-rw-r--r--sql/updates/2057_world.sql11
-rw-r--r--sql/updates/2064_world.sql7
-rw-r--r--sql/updates/2080_mangos_7503_01_world_command.sql15
-rw-r--r--sql/updates/2131_world.sql22
-rw-r--r--sql/updates/2138_world.sql6
-rw-r--r--sql/updates/2139_script_waypoint.sql49
-rw-r--r--sql/updates/2139_world.sql2
-rw-r--r--sql/updates/2139_world_script.sql13
-rw-r--r--sql/updates/2160_world.sql3
-rw-r--r--sql/updates/2161_world.sql2
-rw-r--r--sql/updates/2227_mangos_7544_01_world_uptime.sql3
-rw-r--r--sql/updates/2227_mangos_7546_02_realmd_uptime.sql15
-rw-r--r--sql/updates/2254_world.sql13
-rw-r--r--sql/updates/2274_mangos_7558_01_world_trinity_string.sql9
-rw-r--r--sql/updates/2274_mangos_7558_02_world_command.sql5
-rw-r--r--sql/updates/2276_mangos_7560_01_world_gameobject_template.sql4
-rw-r--r--sql/updates/2280_mangos_7565_01_world_trinity_string.sql9
-rw-r--r--sql/updates/2284_mangos_7568_01_world_spell_proc_event.sql49
-rw-r--r--sql/updates/2296_world.sql2
-rw-r--r--sql/updates/2339_world.sql16
-rw-r--r--sql/updates/2343_world.sql17
-rw-r--r--sql/updates/2346_world.sql2
-rw-r--r--sql/updates/238_world.sql2
-rw-r--r--sql/updates/2412_characters.sql10
-rw-r--r--sql/updates/2412_world.sql2
-rw-r--r--sql/updates/2432_mangos_7615_01_world_command.sql8
-rw-r--r--sql/updates/2433_mangos_7616_01_world_trinity_string.sql6
-rw-r--r--sql/updates/2433_mangos_7616_02_world_command.sql7
-rw-r--r--sql/updates/2444_world.sql3
-rw-r--r--sql/updates/2450_world.sql7
-rw-r--r--sql/updates/2479_world.sql2
-rw-r--r--sql/updates/2492_mangos_7622_01_world_creature_ai_scripts.sql29
-rw-r--r--sql/updates/2492_mangos_7622_02_world_creature_ai_summons.sql13
-rw-r--r--sql/updates/2492_mangos_7622_03_world_creature_ai_texts.sql21
-rw-r--r--sql/updates/2508_characters.sql1
-rw-r--r--sql/updates/2515_world_scripts.sql (renamed from sql/updates/1318_world_scripts.sql)15
-rw-r--r--sql/updates/2522_mangos_7627_01_world_achievement_criteria_data.sql10
-rw-r--r--sql/updates/2528_mangos_7633_01_world_achievement_criteria_data.sql5
-rw-r--r--sql/updates/2551_world_spell_bonus_data.sql4
-rw-r--r--sql/updates/2559_world_spell_proc_event.sql9
-rw-r--r--sql/updates/2565_world_SD2_scripts.sql343
-rw-r--r--sql/updates/2570_world_spell_linked_spell.sql9
-rw-r--r--sql/updates/2582_mangos_7644_01_characters_character_pet.sql5
-rw-r--r--sql/updates/2586_world_spell_linked_spell.sql4
-rw-r--r--sql/updates/2591_world_spell_linked_spell.sql6
-rw-r--r--sql/updates/2617_world_spell_linked_spell.sql7
-rw-r--r--sql/updates/2629_world_spell_linked_spell.sql2
-rw-r--r--sql/updates/2678_mangos_7662_01_world_spell_bonus_data.sql6
-rw-r--r--sql/updates/2682_world_SD2_scripts.sql46
-rw-r--r--sql/updates/2683_characters_gm_tickets.sql (renamed from sql/updates/1358_characters.sql)2
-rw-r--r--sql/updates/2683_world_trinity_string.sql (renamed from sql/updates/1358_world.sql)2
-rw-r--r--sql/updates/2685_world_spell_proc_event.sql5
-rw-r--r--sql/updates/2686_characters_gm_tickets.sql (renamed from sql/updates/1366_characters.sql)2
-rw-r--r--sql/updates/2686_world_command.sql3
-rw-r--r--sql/updates/2687_world_spell_proc_event.sql4
-rw-r--r--sql/updates/2689_world_spell_linked_spell.sql2
-rw-r--r--sql/updates/2702_world_spell_proc_event.sql5
-rw-r--r--sql/updates/2706_world_SD2_scripts.sql4
-rw-r--r--sql/updates/2715_TC1_1362_world_creature_linked_respawn.sql (renamed from sql/updates/1362_world.sql)2
-rw-r--r--sql/updates/2724_TC1_world_1371_script.sql (renamed from sql/updates/1371.sql)2
-rw-r--r--sql/updates/341_world.sql2
-rw-r--r--sql/updates/679_world_scripts.sql2
-rw-r--r--sql/updates/683_world_scripts.sql3
-rw-r--r--sql/updates/691_world_scripts.sql2
-rw-r--r--sql/updates/692_world.sql8
-rw-r--r--sql/updates/708_world_scripts.sql3
-rw-r--r--sql/updates/724_world.sql4
-rw-r--r--sql/updates/725_characters.sql6
-rw-r--r--sql/updates/725_world.sql31
-rw-r--r--sql/updates/728_world_scripts.sql2
-rw-r--r--sql/updates/733_characters.sql2
-rw-r--r--sql/updates/739_characters.sql2
-rw-r--r--sql/updates/748_world_scripts.sql3
-rw-r--r--sql/updates/758_world_scripts.sql6
-rw-r--r--sql/updates/764_world_scripts.sql124
-rw-r--r--sql/updates/789_world.sql2
-rw-r--r--sql/updates/805_world_scripts.sql123
-rw-r--r--sql/updates/807_world_scripts.sql2
-rw-r--r--sql/updates/822_world_scripts.sql4
-rw-r--r--sql/updates/826_world_scripts.sql2
-rw-r--r--sql/updates/833_world_scripts.sql3
-rw-r--r--sql/updates/837_world_scripts.sql2
-rw-r--r--sql/updates/838_world_scripts.sql5
-rw-r--r--sql/updates/839_world_scripts.sql2
-rw-r--r--sql/updates/840_world_scripts.sql2
-rw-r--r--sql/updates/841_world_scripts.sql2
-rw-r--r--sql/updates/850_world_scripts.sql2
-rw-r--r--sql/updates/852_world_scripts.sql3
-rw-r--r--sql/updates/857_world_scripts.sql2
-rw-r--r--sql/updates/875_mangos_7047_01_characters_character_spell.sql10
-rw-r--r--sql/updates/875_mangos_7059_01_characters_pet_spell.sql4
-rw-r--r--sql/updates/919_world.sql3
-rw-r--r--sql/updates/933_world_scripts.sql2
-rw-r--r--sql/updates/935_world_scripts.sql7
-rw-r--r--sql/updates/940_world_scripts.sql3
-rw-r--r--sql/updates/973_world_scripts.sql2
-rw-r--r--sql/updates/CMakeLists.txt2
-rw-r--r--sql/world.sql10609
-rw-r--r--sql/world_script_waypoints.sql44
-rw-r--r--sql/world_scripts_full.sql265
-rw-r--r--sql/world_scripts_structure.sql41
-rw-r--r--sql/world_spell_full.sql4
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/Makefile.am25
-rw-r--r--src/bindings/Makefile.am25
-rw-r--r--src/bindings/interface/Makefile.am55
-rw-r--r--src/bindings/interface/Readme.txt4
-rw-r--r--src/bindings/interface/ScriptMgr.cpp4
-rw-r--r--src/bindings/interface/ScriptMgr.h4
-rw-r--r--src/bindings/interface/Scripts/sc_default.cpp4
-rw-r--r--src/bindings/interface/Scripts/sc_defines.cpp4
-rw-r--r--src/bindings/interface/Scripts/sc_defines.h4
-rw-r--r--src/bindings/interface/config.h4
-rw-r--r--src/bindings/interface/system.cpp4
-rw-r--r--src/bindings/scripts/CMakeLists.txt122
-rw-r--r--src/bindings/scripts/Makefile.am445
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp623
-rw-r--r--src/bindings/scripts/ScriptMgr.h16
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj288
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj294
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj527
-rw-r--r--src/bindings/scripts/docs/EventAI.txt185
-rw-r--r--src/bindings/scripts/docs/Text-tables.txt6
-rw-r--r--src/bindings/scripts/include/precompiled.cpp2
-rw-r--r--src/bindings/scripts/include/precompiled.h3
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp111
-rw-r--r--src/bindings/scripts/include/sc_creature.h17
-rw-r--r--src/bindings/scripts/include/sc_gossip.h53
-rw-r--r--src/bindings/scripts/include/sc_instance.h2
-rw-r--r--src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp14
-rw-r--r--src/bindings/scripts/scripts/boss/boss_emeriss.cpp2
-rw-r--r--src/bindings/scripts/scripts/boss/boss_lethon.cpp2
-rw-r--r--src/bindings/scripts/scripts/boss/boss_taerar.cpp2
-rw-r--r--src/bindings/scripts/scripts/boss/boss_ysondre.cpp2
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp1430
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.h218
-rw-r--r--src/bindings/scripts/scripts/creature/mob_generic_creature.cpp2
-rw-r--r--src/bindings/scripts/scripts/creature/simple_ai.cpp55
-rw-r--r--src/bindings/scripts/scripts/creature/simple_ai.h14
-rw-r--r--src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp39
-rw-r--r--src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp116
-rw-r--r--src/bindings/scripts/scripts/examples/example_creature.cpp258
-rw-r--r--src/bindings/scripts/scripts/examples/example_escort.cpp220
-rw-r--r--src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp88
-rw-r--r--src/bindings/scripts/scripts/examples/example_misc.cpp65
-rw-r--r--src/bindings/scripts/scripts/go/go_scripts.cpp68
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.cpp18
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.h2
-rw-r--r--src/bindings/scripts/scripts/guard/guards.cpp886
-rw-r--r--src/bindings/scripts/scripts/item/item_scripts.cpp4
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.cpp38
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.h6
-rw-r--r--src/bindings/scripts/scripts/npc/npc_innkeeper.cpp6
-rw-r--r--src/bindings/scripts/scripts/npc/npc_professions.cpp4
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp645
-rw-r--r--src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp24
-rw-r--r--src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp58
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp16
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp16
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp42
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp79
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp117
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp111
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp109
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp109
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h33
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp194
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp112
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp114
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp116
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h29
-rw-r--r--src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp180
-rw-r--r--src/bindings/scripts/scripts/zone/azshara/azshara.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp263
-rw-r--r--src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp77
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains536
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu347
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp81
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h2
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp18
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp279
-rw-r--r--src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp105
-rw-r--r--src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp86
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp123
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp138
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp152
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h4
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp27
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp31
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp388
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp17
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp43
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp31
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp24
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp44
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp56
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp75
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp88
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp75
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h4
-rw-r--r--src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp54
-rw-r--r--src/bindings/scripts/scripts/zone/felwood/felwood.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/feralas/feralas.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp64
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp97
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp41
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h24
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp55
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp65
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp85
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp88
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp95
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h4
-rw-r--r--src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp54
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp22
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp77
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp17
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp114
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp39
-rw-r--r--src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp114
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp52
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp9
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp39
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp311
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h75
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp44
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp48
-rw-r--r--src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp545
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp369
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp143
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp143
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h13
-rw-r--r--src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp86
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp25
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp72
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp18
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp170
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h4
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp149
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp89
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp118
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp90
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp57
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp63
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h35
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp158
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp82
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp104
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp87
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp85
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h4
-rw-r--r--src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp300
-rw-r--r--src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h4
-rw-r--r--src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp25
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp95
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp85
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp150
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp97
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp50
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp23
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp94
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h8
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp39
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h5
-rw-r--r--src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp92
-rw-r--r--src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h2
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp68
-rw-r--r--src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp102
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp61
-rw-r--r--src/bindings/scripts/scripts/zone/silithus/silithus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp41
-rw-r--r--src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h2
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp77
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp40
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h2
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp39
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp3
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp42
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp30
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp34
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp33
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp19
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h2
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp94
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp114
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp86
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp128
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h4
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp73
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp81
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp83
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h4
-rw-r--r--src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/undercity/undercity.cpp8
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_dalronn.cpp97
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp470
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp338
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald.cpp96
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp408
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h31
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp231
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp78
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp89
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp83
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp85
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h4
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp93
-rw-r--r--src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h4
-rw-r--r--src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp82
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp82
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp81
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp52
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp50
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp82
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp82
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h4
-rw-r--r--src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/westfall/westfall.cpp59
-rw-r--r--src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp3
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp10
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h2
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp21
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp24
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h2
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp2
-rw-r--r--src/bindings/scripts/sql/WotLK/npc_taxi.sql10
-rw-r--r--src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql530
-rw-r--r--src/bindings/scripts/sql/WotLK/wotlk_bosses.sql124
-rw-r--r--src/bindings/scripts/system.cpp4
-rw-r--r--src/framework/Dynamic/FactoryHolder.h4
-rw-r--r--src/framework/Dynamic/ObjectRegistry.h4
-rw-r--r--src/framework/GameSystem/Grid.h4
-rw-r--r--src/framework/GameSystem/GridLoader.h4
-rw-r--r--src/framework/GameSystem/GridRefManager.h4
-rw-r--r--src/framework/GameSystem/GridReference.h4
-rw-r--r--src/framework/GameSystem/NGrid.h26
-rw-r--r--src/framework/GameSystem/TypeContainer.h4
-rw-r--r--src/framework/GameSystem/TypeContainerFunctions.h4
-rw-r--r--src/framework/GameSystem/TypeContainerFunctionsPtr.h4
-rw-r--r--src/framework/GameSystem/TypeContainerVisitor.h4
-rw-r--r--src/framework/Makefile.am65
-rw-r--r--src/framework/Network/SocketDefines.h4
-rw-r--r--src/framework/Platform/CompilerDefs.h4
-rw-r--r--src/framework/Platform/Define.h6
-rw-r--r--src/framework/Policies/CreationPolicy.h4
-rw-r--r--src/framework/Policies/ObjectLifeTime.cpp4
-rw-r--r--src/framework/Policies/ObjectLifeTime.h8
-rw-r--r--src/framework/Policies/Singleton.h4
-rw-r--r--src/framework/Policies/SingletonImp.h4
-rw-r--r--src/framework/Policies/ThreadingModel.h4
-rw-r--r--src/framework/Utilities/ByteConverter.h4
-rw-r--r--src/framework/Utilities/Callback.h4
-rw-r--r--src/framework/Utilities/CountedReference/Reference.h4
-rw-r--r--src/framework/Utilities/CountedReference/ReferenceHolder.h4
-rw-r--r--src/framework/Utilities/CountedReference/ReferenceImpl.h4
-rw-r--r--src/framework/Utilities/EventProcessor.cpp4
-rw-r--r--src/framework/Utilities/EventProcessor.h4
-rw-r--r--src/framework/Utilities/LinkedList.h4
-rw-r--r--src/framework/Utilities/LinkedReference/RefManager.h4
-rw-r--r--src/framework/Utilities/LinkedReference/Reference.h18
-rw-r--r--src/framework/Utilities/TypeList.h4
-rw-r--r--src/framework/Utilities/UnorderedMap.h4
-rw-r--r--src/game/AccountMgr.cpp10
-rw-r--r--src/game/AccountMgr.h4
-rw-r--r--src/game/AchievementMgr.cpp1812
-rw-r--r--src/game/AchievementMgr.h264
-rw-r--r--src/game/AddonHandler.cpp69
-rw-r--r--src/game/AddonHandler.h4
-rw-r--r--src/game/AggressorAI.cpp57
-rw-r--r--src/game/AggressorAI.h7
-rw-r--r--src/game/AnimalRandomMovementGenerator.h4
-rw-r--r--src/game/ArenaTeam.cpp70
-rw-r--r--src/game/ArenaTeam.h20
-rw-r--r--src/game/ArenaTeamHandler.cpp7
-rw-r--r--src/game/AuctionHouseBot.cpp52
-rw-r--r--src/game/AuctionHouseHandler.cpp39
-rw-r--r--src/game/AuctionHouseMgr.cpp120
-rw-r--r--src/game/Bag.cpp8
-rw-r--r--src/game/Bag.h7
-rw-r--r--src/game/BattleGround.cpp1006
-rw-r--r--src/game/BattleGround.h230
-rw-r--r--src/game/BattleGroundAA.cpp24
-rw-r--r--src/game/BattleGroundAA.h9
-rw-r--r--src/game/BattleGroundAB.cpp387
-rw-r--r--src/game/BattleGroundAB.h78
-rw-r--r--src/game/BattleGroundAV.cpp50
-rw-r--r--src/game/BattleGroundAV.h8
-rw-r--r--src/game/BattleGroundBE.cpp133
-rw-r--r--src/game/BattleGroundBE.h10
-rw-r--r--src/game/BattleGroundDS.cpp81
-rw-r--r--src/game/BattleGroundDS.h50
-rw-r--r--src/game/BattleGroundEY.cpp367
-rw-r--r--src/game/BattleGroundEY.h64
-rw-r--r--src/game/BattleGroundHandler.cpp498
-rw-r--r--src/game/BattleGroundMgr.cpp1988
-rw-r--r--src/game/BattleGroundMgr.h216
-rw-r--r--src/game/BattleGroundNA.cpp127
-rw-r--r--src/game/BattleGroundNA.h10
-rw-r--r--src/game/BattleGroundRL.cpp128
-rw-r--r--src/game/BattleGroundRL.h12
-rw-r--r--src/game/BattleGroundRV.cpp81
-rw-r--r--src/game/BattleGroundRV.h50
-rw-r--r--src/game/BattleGroundSA.cpp81
-rw-r--r--src/game/BattleGroundSA.h54
-rw-r--r--src/game/BattleGroundWS.cpp344
-rw-r--r--src/game/BattleGroundWS.h31
-rw-r--r--src/game/CMakeLists.txt38
-rw-r--r--src/game/Calendar.cpp17
-rw-r--r--src/game/Calendar.h26
-rw-r--r--src/game/CalendarHandler.cpp159
-rw-r--r--src/game/Cell.h8
-rw-r--r--src/game/CellImpl.h4
-rw-r--r--src/game/Channel.cpp12
-rw-r--r--src/game/Channel.h180
-rw-r--r--src/game/ChannelHandler.cpp4
-rw-r--r--src/game/ChannelMgr.h6
-rw-r--r--src/game/CharacterHandler.cpp397
-rw-r--r--src/game/Chat.cpp929
-rw-r--r--src/game/Chat.h358
-rw-r--r--src/game/ChatHandler.cpp227
-rw-r--r--src/game/CombatHandler.cpp5
-rw-r--r--src/game/ConfusedMovementGenerator.cpp4
-rw-r--r--src/game/ConfusedMovementGenerator.h4
-rw-r--r--src/game/Corpse.cpp67
-rw-r--r--src/game/Corpse.h11
-rw-r--r--src/game/Creature.cpp216
-rw-r--r--src/game/Creature.h122
-rw-r--r--src/game/CreatureAI.cpp47
-rw-r--r--src/game/CreatureAI.h60
-rw-r--r--src/game/CreatureAIImpl.h4
-rw-r--r--src/game/CreatureAIRegistry.cpp8
-rw-r--r--src/game/CreatureAIRegistry.h4
-rw-r--r--src/game/CreatureAISelector.cpp32
-rw-r--r--src/game/CreatureAISelector.h4
-rw-r--r--src/game/CreatureEventAI.cpp1654
-rw-r--r--src/game/CreatureEventAI.h307
-rw-r--r--src/game/CreatureEventAIMgr.cpp683
-rw-r--r--src/game/CreatureEventAIMgr.h46
-rw-r--r--src/game/DBCEnums.h331
-rw-r--r--src/game/DBCStores.cpp (renamed from src/shared/Database/DBCStores.cpp)170
-rw-r--r--src/game/DBCStores.h (renamed from src/shared/Database/DBCStores.h)114
-rw-r--r--src/game/DBCStructure.h1709
-rw-r--r--src/game/DBCfmt.h (renamed from src/shared/Database/DBCfmt.cpp)78
-rw-r--r--src/game/Debugcmds.cpp333
-rw-r--r--src/game/DestinationHolder.cpp4
-rw-r--r--src/game/DestinationHolder.h4
-rw-r--r--src/game/DestinationHolderImp.h24
-rw-r--r--src/game/DuelHandler.cpp6
-rw-r--r--src/game/DynamicObject.cpp37
-rw-r--r--src/game/DynamicObject.h9
-rw-r--r--src/game/FleeingMovementGenerator.cpp25
-rw-r--r--src/game/FleeingMovementGenerator.h5
-rw-r--r--src/game/FollowerRefManager.h4
-rw-r--r--src/game/FollowerReference.cpp4
-rw-r--r--src/game/FollowerReference.h4
-rw-r--r--src/game/Formulas.h79
-rw-r--r--src/game/GameEventMgr.cpp (renamed from src/game/GameEvent.cpp)289
-rw-r--r--src/game/GameEventMgr.h (renamed from src/game/GameEvent.h)40
-rw-r--r--src/game/GameObject.cpp314
-rw-r--r--src/game/GameObject.h66
-rw-r--r--src/game/GlobalEvents.cpp6
-rw-r--r--src/game/GlobalEvents.h4
-rw-r--r--src/game/GossipDef.cpp108
-rw-r--r--src/game/GossipDef.h43
-rw-r--r--src/game/GridDefines.h8
-rw-r--r--src/game/GridNotifiers.cpp55
-rw-r--r--src/game/GridNotifiers.h258
-rw-r--r--src/game/GridNotifiersImpl.h152
-rw-r--r--src/game/GridStates.h4
-rw-r--r--src/game/Group.cpp142
-rw-r--r--src/game/Group.h22
-rw-r--r--src/game/GroupHandler.cpp119
-rw-r--r--src/game/GroupRefManager.h4
-rw-r--r--src/game/GroupReference.cpp4
-rw-r--r--src/game/GroupReference.h4
-rw-r--r--src/game/GuardAI.cpp70
-rw-r--r--src/game/GuardAI.h7
-rw-r--r--src/game/Guild.cpp85
-rw-r--r--src/game/Guild.h26
-rw-r--r--src/game/GuildHandler.cpp27
-rw-r--r--src/game/HomeMovementGenerator.cpp10
-rw-r--r--src/game/HomeMovementGenerator.h5
-rw-r--r--src/game/HostilRefManager.cpp6
-rw-r--r--src/game/HostilRefManager.h4
-rw-r--r--src/game/IdleMovementGenerator.cpp6
-rw-r--r--src/game/IdleMovementGenerator.h4
-rw-r--r--src/game/InstanceData.cpp8
-rw-r--r--src/game/InstanceData.h8
-rw-r--r--src/game/InstanceSaveMgr.cpp34
-rw-r--r--src/game/InstanceSaveMgr.h4
-rw-r--r--src/game/Item.cpp68
-rw-r--r--src/game/Item.h58
-rw-r--r--src/game/ItemEnchantmentMgr.cpp4
-rw-r--r--src/game/ItemEnchantmentMgr.h4
-rw-r--r--src/game/ItemHandler.cpp230
-rw-r--r--src/game/ItemPrototype.h145
-rw-r--r--src/game/LFGHandler.cpp4
-rw-r--r--src/game/Language.h256
-rw-r--r--src/game/Level0.cpp14
-rw-r--r--src/game/Level1.cpp514
-rw-r--r--src/game/Level2.cpp2470
-rw-r--r--src/game/Level3.cpp1223
-rw-r--r--src/game/LootHandler.cpp30
-rw-r--r--src/game/LootMgr.cpp242
-rw-r--r--src/game/LootMgr.h69
-rw-r--r--src/game/Mail.cpp52
-rw-r--r--src/game/Mail.h4
-rw-r--r--src/game/Makefile.am847
-rw-r--r--src/game/Map.cpp1157
-rw-r--r--src/game/Map.h205
-rw-r--r--src/game/MapInstanced.cpp4
-rw-r--r--src/game/MapInstanced.h6
-rw-r--r--src/game/MapManager.cpp17
-rw-r--r--src/game/MapManager.h35
-rw-r--r--src/game/MapRefManager.h2
-rw-r--r--src/game/MapReference.h2
-rw-r--r--src/game/MiscHandler.cpp228
-rw-r--r--src/game/MotionMaster.cpp99
-rw-r--r--src/game/MotionMaster.h13
-rw-r--r--src/game/MovementGenerator.cpp4
-rw-r--r--src/game/MovementGenerator.h4
-rw-r--r--src/game/MovementGeneratorImpl.h4
-rw-r--r--src/game/MovementHandler.cpp452
-rw-r--r--src/game/NPCHandler.cpp139
-rw-r--r--src/game/NPCHandler.h5
-rw-r--r--src/game/NullCreatureAI.cpp4
-rw-r--r--src/game/NullCreatureAI.h12
-rw-r--r--src/game/Object.cpp515
-rw-r--r--src/game/Object.h64
-rw-r--r--src/game/ObjectAccessor.cpp156
-rw-r--r--src/game/ObjectAccessor.h46
-rw-r--r--src/game/ObjectDefines.h8
-rw-r--r--src/game/ObjectGridLoader.cpp34
-rw-r--r--src/game/ObjectMgr.cpp1335
-rw-r--r--src/game/ObjectMgr.h100
-rw-r--r--src/game/ObjectPosSelector.cpp157
-rw-r--r--src/game/ObjectPosSelector.h155
-rw-r--r--src/game/Opcodes.cpp2261
-rw-r--r--src/game/Opcodes.h407
-rw-r--r--src/game/OutdoorPvP.cpp27
-rw-r--r--src/game/OutdoorPvP.h2
-rw-r--r--src/game/OutdoorPvPEP.cpp2
-rw-r--r--src/game/OutdoorPvPEP.h4
-rw-r--r--src/game/OutdoorPvPHP.cpp2
-rw-r--r--src/game/OutdoorPvPHP.h2
-rw-r--r--src/game/OutdoorPvPMgr.cpp3
-rw-r--r--src/game/OutdoorPvPMgr.h2
-rw-r--r--src/game/OutdoorPvPNA.cpp2
-rw-r--r--src/game/OutdoorPvPNA.h2
-rw-r--r--src/game/OutdoorPvPObjectiveAI.cpp2
-rw-r--r--src/game/OutdoorPvPObjectiveAI.h4
-rw-r--r--src/game/OutdoorPvPSI.cpp14
-rw-r--r--src/game/OutdoorPvPSI.h2
-rw-r--r--src/game/OutdoorPvPTF.cpp2
-rw-r--r--src/game/OutdoorPvPZM.cpp2
-rw-r--r--src/game/OutdoorPvPZM.h2
-rw-r--r--src/game/Path.h4
-rw-r--r--src/game/Pet.cpp1355
-rw-r--r--src/game/Pet.h105
-rw-r--r--src/game/PetAI.cpp90
-rw-r--r--src/game/PetAI.h7
-rw-r--r--src/game/PetHandler.cpp255
-rw-r--r--src/game/PetitionsHandler.cpp23
-rw-r--r--src/game/Player.cpp6277
-rw-r--r--src/game/Player.h745
-rw-r--r--src/game/PlayerDump.cpp45
-rw-r--r--src/game/PlayerDump.h13
-rw-r--r--src/game/PointMovementGenerator.cpp12
-rw-r--r--src/game/PointMovementGenerator.h4
-rw-r--r--src/game/PoolHandler.cpp719
-rw-r--r--src/game/PoolHandler.h104
-rw-r--r--src/game/PossessedAI.cpp4
-rw-r--r--src/game/PossessedAI.h4
-rw-r--r--src/game/QueryHandler.cpp115
-rw-r--r--src/game/QuestDef.cpp115
-rw-r--r--src/game/QuestDef.h54
-rw-r--r--src/game/QuestHandler.cpp16
-rw-r--r--src/game/RandomMovementGenerator.cpp11
-rw-r--r--src/game/RandomMovementGenerator.h4
-rw-r--r--src/game/ReactorAI.cpp56
-rw-r--r--src/game/ReactorAI.h7
-rw-r--r--src/game/ReputationMgr.cpp473
-rw-r--r--src/game/ReputationMgr.h146
-rw-r--r--src/game/ScriptCalls.cpp11
-rw-r--r--src/game/ScriptCalls.h12
-rw-r--r--src/game/SharedDefines.h684
-rw-r--r--src/game/SkillDiscovery.cpp83
-rw-r--r--src/game/SkillDiscovery.h5
-rw-r--r--src/game/SkillExtraItems.cpp4
-rw-r--r--src/game/SkillExtraItems.h4
-rw-r--r--src/game/SkillHandler.cpp110
-rw-r--r--src/game/SocialMgr.cpp16
-rw-r--r--src/game/SocialMgr.h7
-rw-r--r--src/game/Spell.cpp2115
-rw-r--r--src/game/Spell.h184
-rw-r--r--src/game/SpellAuraDefines.h118
-rw-r--r--src/game/SpellAuras.cpp5062
-rw-r--r--src/game/SpellAuras.h325
-rw-r--r--src/game/SpellEffects.cpp3507
-rw-r--r--src/game/SpellHandler.cpp234
-rw-r--r--src/game/SpellMgr.cpp1288
-rw-r--r--src/game/SpellMgr.h471
-rw-r--r--src/game/StatSystem.cpp212
-rw-r--r--src/game/TargetedMovementGenerator.cpp7
-rw-r--r--src/game/TargetedMovementGenerator.h4
-rw-r--r--src/game/TaxiHandler.cpp17
-rw-r--r--src/game/TemporarySummon.cpp140
-rw-r--r--src/game/TemporarySummon.h40
-rw-r--r--src/game/ThreatManager.cpp78
-rw-r--r--src/game/ThreatManager.h53
-rw-r--r--src/game/TicketHandler.cpp4
-rw-r--r--src/game/TicketMgr.cpp4
-rw-r--r--src/game/TicketMgr.h4
-rw-r--r--src/game/Tools.cpp4
-rw-r--r--src/game/Tools.h4
-rw-r--r--src/game/Totem.cpp41
-rw-r--r--src/game/Totem.h12
-rw-r--r--src/game/TotemAI.cpp67
-rw-r--r--src/game/TotemAI.h8
-rw-r--r--src/game/TradeHandler.cpp4
-rw-r--r--src/game/Transports.cpp85
-rw-r--r--src/game/Transports.h20
-rw-r--r--src/game/Traveller.h71
-rw-r--r--src/game/Unit.cpp8960
-rw-r--r--src/game/Unit.h505
-rw-r--r--src/game/UnitEvents.h4
-rw-r--r--src/game/UpdateData.cpp6
-rw-r--r--src/game/UpdateData.h9
-rw-r--r--src/game/UpdateFields.h535
-rw-r--r--src/game/UpdateMask.h32
-rw-r--r--src/game/Vehicle.cpp347
-rw-r--r--src/game/Vehicle.h75
-rw-r--r--src/game/VoiceChatHandler.cpp5
-rw-r--r--src/game/WaypointManager.cpp4
-rw-r--r--src/game/WaypointManager.h4
-rw-r--r--src/game/WaypointMovementGenerator.cpp16
-rw-r--r--src/game/WaypointMovementGenerator.h8
-rw-r--r--src/game/Weather.cpp9
-rw-r--r--src/game/Weather.h6
-rw-r--r--src/game/World.cpp627
-rw-r--r--src/game/World.h88
-rw-r--r--src/game/WorldLog.cpp46
-rw-r--r--src/game/WorldLog.h33
-rw-r--r--src/game/WorldSession.cpp240
-rw-r--r--src/game/WorldSession.h84
-rw-r--r--src/game/WorldSocket.cpp245
-rw-r--r--src/game/WorldSocket.h24
-rw-r--r--src/game/WorldSocketMgr.cpp2
-rw-r--r--src/game/WorldSocketMgr.h4
-rw-r--r--src/shared/Auth/AuthCrypt.cpp9
-rw-r--r--src/shared/Auth/AuthCrypt.h5
-rw-r--r--src/shared/Auth/BigNumber.cpp4
-rw-r--r--src/shared/Auth/BigNumber.h4
-rw-r--r--src/shared/Auth/Hmac.cpp4
-rw-r--r--src/shared/Auth/Hmac.h4
-rw-r--r--src/shared/Auth/Makefile.am41
-rw-r--r--src/shared/Auth/Sha1.cpp4
-rw-r--r--src/shared/Auth/Sha1.h4
-rw-r--r--src/shared/Base.cpp68
-rw-r--r--src/shared/Base.h55
-rw-r--r--src/shared/ByteBuffer.h53
-rw-r--r--src/shared/CMakeLists.txt4
-rw-r--r--src/shared/Common.cpp4
-rw-r--r--src/shared/Common.h10
-rw-r--r--src/shared/Config/Config.cpp118
-rw-r--r--src/shared/Config/Config.h20
-rw-r--r--src/shared/Config/ConfigEnv.h4
-rw-r--r--src/shared/Config/Makefile.am42
-rw-r--r--src/shared/Config/dotconfpp/dotconfpp.cpp24
-rw-r--r--src/shared/Config/dotconfpp/mempool.cpp6
-rw-r--r--src/shared/Database/CMakeLists.txt9
-rw-r--r--src/shared/Database/DBCEnums.h113
-rw-r--r--src/shared/Database/DBCFileLoader.cpp (renamed from src/shared/Database/dbcfile.cpp)53
-rw-r--r--src/shared/Database/DBCFileLoader.h (renamed from src/shared/Database/dbcfile.h)21
-rw-r--r--src/shared/Database/DBCStore.h94
-rw-r--r--src/shared/Database/DBCStructure.h904
-rw-r--r--src/shared/Database/Database.cpp4
-rw-r--r--src/shared/Database/Database.h6
-rw-r--r--src/shared/Database/DatabaseEnv.h5
-rw-r--r--src/shared/Database/DatabaseImpl.h4
-rw-r--r--src/shared/Database/DatabaseMysql.cpp4
-rw-r--r--src/shared/Database/DatabaseMysql.h4
-rw-r--r--src/shared/Database/DatabasePostgre.cpp13
-rw-r--r--src/shared/Database/DatabasePostgre.h4
-rw-r--r--src/shared/Database/DatabaseSqlite.cpp4
-rw-r--r--src/shared/Database/DatabaseSqlite.h4
-rw-r--r--src/shared/Database/Field.cpp4
-rw-r--r--src/shared/Database/Field.h4
-rw-r--r--src/shared/Database/Makefile.am63
-rw-r--r--src/shared/Database/MySQLDelayThread.h4
-rw-r--r--src/shared/Database/PGSQLDelayThread.h4
-rw-r--r--src/shared/Database/QueryResult.h4
-rw-r--r--src/shared/Database/QueryResultMysql.cpp4
-rw-r--r--src/shared/Database/QueryResultMysql.h4
-rw-r--r--src/shared/Database/QueryResultPostgre.cpp4
-rw-r--r--src/shared/Database/QueryResultPostgre.h4
-rw-r--r--src/shared/Database/QueryResultSqlite.cpp4
-rw-r--r--src/shared/Database/QueryResultSqlite.h4
-rw-r--r--src/shared/Database/SQLStorage.cpp22
-rw-r--r--src/shared/Database/SQLStorage.h4
-rw-r--r--src/shared/Database/SQLStorageImpl.h12
-rw-r--r--src/shared/Database/SqlDelayThread.cpp4
-rw-r--r--src/shared/Database/SqlDelayThread.h6
-rw-r--r--src/shared/Database/SqlOperations.cpp6
-rw-r--r--src/shared/Database/SqlOperations.h4
-rw-r--r--src/shared/Errors.h4
-rw-r--r--src/shared/Log.cpp582
-rw-r--r--src/shared/Log.h155
-rw-r--r--src/shared/Makefile.am82
-rw-r--r--src/shared/MemoryLeaks.cpp32
-rw-r--r--src/shared/MemoryLeaks.h48
-rw-r--r--src/shared/Mthread.cpp206
-rw-r--r--src/shared/Mthread.h63
-rw-r--r--src/shared/PacketLog.cpp4
-rw-r--r--src/shared/PacketLog.h4
-rw-r--r--src/shared/ProgressBar.cpp4
-rw-r--r--src/shared/ProgressBar.h4
-rw-r--r--src/shared/ServiceWin32.cpp4
-rw-r--r--src/shared/ServiceWin32.h4
-rw-r--r--src/shared/SystemConfig.h6
-rw-r--r--src/shared/SystemConfig.h.in79
-rw-r--r--src/shared/Timer.h4
-rw-r--r--src/shared/Util.cpp20
-rw-r--r--src/shared/Util.h256
-rw-r--r--src/shared/WorldPacket.h4
-rw-r--r--src/shared/vmap/BaseModel.cpp4
-rw-r--r--src/shared/vmap/BaseModel.h4
-rw-r--r--src/shared/vmap/CoordModelMapping.cpp4
-rw-r--r--src/shared/vmap/CoordModelMapping.h4
-rw-r--r--src/shared/vmap/DebugCmdLogger.cpp4
-rw-r--r--src/shared/vmap/DebugCmdLogger.h4
-rw-r--r--src/shared/vmap/IVMapManager.h4
-rw-r--r--src/shared/vmap/Makefile.am58
-rw-r--r--src/shared/vmap/ManagedModelContainer.cpp4
-rw-r--r--src/shared/vmap/ManagedModelContainer.h4
-rw-r--r--src/shared/vmap/ModelContainer.cpp4
-rw-r--r--src/shared/vmap/ModelContainer.h4
-rw-r--r--src/shared/vmap/NodeValueAccess.h4
-rw-r--r--src/shared/vmap/ShortBox.h4
-rw-r--r--src/shared/vmap/ShortVector.h4
-rw-r--r--src/shared/vmap/SubModel.cpp4
-rw-r--r--src/shared/vmap/SubModel.h4
-rw-r--r--src/shared/vmap/TileAssembler.cpp7
-rw-r--r--src/shared/vmap/TileAssembler.h4
-rw-r--r--src/shared/vmap/TreeNode.cpp4
-rw-r--r--src/shared/vmap/TreeNode.h4
-rw-r--r--src/shared/vmap/VMapDefinitions.h4
-rw-r--r--src/shared/vmap/VMapFactory.cpp4
-rw-r--r--src/shared/vmap/VMapFactory.h4
-rw-r--r--src/shared/vmap/VMapManager.cpp4
-rw-r--r--src/shared/vmap/VMapManager.h4
-rw-r--r--src/shared/vmap/VMapTools.h4
-rw-r--r--src/tools/Makefile.am23
-rw-r--r--src/tools/genrevision/Makefile.am35
-rw-r--r--src/trinitycore/CMakeLists.txt16
-rw-r--r--src/trinitycore/CliRunnable.cpp49
-rw-r--r--src/trinitycore/CliRunnable.h5
-rw-r--r--src/trinitycore/Main.cpp20
-rw-r--r--src/trinitycore/Makefile.am62
-rw-r--r--src/trinitycore/Master.cpp194
-rw-r--r--src/trinitycore/Master.h5
-rw-r--r--src/trinitycore/RASocket.cpp21
-rw-r--r--src/trinitycore/RASocket.h5
-rw-r--r--src/trinitycore/TrinityCore.rc2
-rw-r--r--src/trinitycore/WorldRunnable.cpp27
-rw-r--r--src/trinitycore/WorldRunnable.h5
-rw-r--r--src/trinitycore/resource.h1
-rw-r--r--src/trinitycore/run-mangosd2
-rw-r--r--src/trinitycore/trinitycore.conf.dist421
-rw-r--r--src/trinityrealm/AuthCodes.h9
-rw-r--r--src/trinityrealm/AuthSocket.cpp5
-rw-r--r--src/trinityrealm/AuthSocket.h5
-rw-r--r--src/trinityrealm/CMakeLists.txt17
-rw-r--r--src/trinityrealm/Main.cpp58
-rw-r--r--src/trinityrealm/Makefile.am59
-rw-r--r--src/trinityrealm/RealmList.cpp5
-rw-r--r--src/trinityrealm/RealmList.h7
-rw-r--r--src/trinityrealm/TrinityRealm.rc2
-rw-r--r--src/trinityrealm/resource.h1
-rw-r--r--src/trinityrealm/trinityrealm.conf.dist32
-rw-r--r--win/TrinityCore&Script VC90.sln48
-rw-r--r--win/VC71/ACE_vc71.vcproj2
-rw-r--r--win/VC71/game.vcproj895
-rw-r--r--win/VC71/mangosd.vcproj229
-rw-r--r--win/VC71/realmd.vcproj188
-rw-r--r--win/VC71/shared.vcproj43
-rw-r--r--win/VC80/ACE_vc8.vcproj4
-rw-r--r--win/VC80/game.vcproj661
-rw-r--r--win/VC80/mangosd.vcproj523
-rw-r--r--win/VC80/realmd.vcproj459
-rw-r--r--win/VC80/shared.vcproj74
-rw-r--r--win/VC90/ACE_vc9.vcproj17
-rw-r--r--win/VC90/TrinityCore.vcproj4
-rw-r--r--win/VC90/TrinityRealm.vcproj4
-rw-r--r--win/VC90/g3dlite.vcproj32
-rw-r--r--win/VC90/game.vcproj715
-rw-r--r--win/VC90/genrevision.vcproj652
-rw-r--r--win/VC90/mangosd.vcproj495
-rw-r--r--win/VC90/realmd.vcproj460
-rw-r--r--win/VC90/shared.vcproj78
1461 files changed, 127677 insertions, 51155 deletions
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 00000000000..e391e35e004
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,2 @@
+17d730e2e03476f2633294f0b0554654949adb85 3.0.3 Lots of Bugs
+3d0d20ee3c824ff523218f2e38d84d3801c373aa 3.0.8 Crash like Hell
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 480a09f913c..00000000000
--- a/AUTHORS
+++ /dev/null
@@ -1,20 +0,0 @@
-The AUTHORS file:
-
-This file should collect a trace of all the legal paperwork that you have
-exchanged with contributors for your particular package. This information is
-very useful for registering the copyright of your package. The file might
-have an introductory blurb similar to this one:
-
- Authors of Trinity Core
-
- The following contributions warranted legal paper exchanges
- with [the Free Software Foundation | Your Name].
- Also see files ChangeLog and THANKS
-
-Then, list who the contributors are and what files they have worked on.
-Indicate whether they created the file, or whether they modified it. For
-example:
-
- Random J. Hacker:
- entire files -> foo1.c , foo2.c , foo3.c
- modifications -> foo4.c , foo5.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 352f5aa450d..57ed5684f5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@ OPTION(DO_SCRIPTS "With trinityscripts" 1)
OPTION(DO_CLI "With CLI" 1)
OPTION(DO_RA "With RA" 0)
OPTION(DO_DEBUG "Debug mode" 0)
+OPTION(DO_WARN "Enable all compile warnings" 0)
OPTION(LARGE_CELL "Large cell size" 0)
OPTION(SHORT_SLEEP "Short sleep" 0)
@@ -39,7 +40,7 @@ EXECUTE_PROCESS(
OUTPUT_VARIABLE HG_REVISION
)
-message("* Trinity Core revision: ${HG_REVISION}")
+message("* TrinityCore2 revision: ${HG_REVISION}")
IF (PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
@@ -50,11 +51,12 @@ if(CONF_DIR)
else(CONF_DIR)
SET(CONF_DIR ${PREFIX}/etc)
endif(CONF_DIR)
+SET(LIBSDIR ${CMAKE_INSTALL_PREFIX}/lib)
message("* Will install to: ${CMAKE_INSTALL_PREFIX}")
message("* With config dir at: ${CONF_DIR}")
+message("* Libs install dir at: ${LIBSDIR}")
-SET(LIBSDIR "/usr/lib /usr/local/lib /lib")
FIND_LIBRARY(SSLLIB NAMES ssl DOC "SSL library")
FIND_LIBRARY(ZLIB z "Zlib library")
@@ -104,6 +106,11 @@ message("* Debug mode ON")
add_definitions(-g -DTRINITY_DEBUG)
endif(DO_DEBUG)
+if(DO_WARN)
+ message("* All warnings mode")
+ add_definitions(-Wall -Wfatal-errors -Wextra)
+endif(DO_WARN)
+
if(LARGE_CELL)
message("* Large cell size")
add_definitions(-DLARGE_CELL)
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 137d2e4e6a3..00000000000
--- a/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-= Trinity Core -- General information =
-
-Copyright (C) Trinity Core (http://www.trinitycore.org)
-
-A complete changelog can be found at : https://www.bitbucket.org/KingPin/trinitycore/changesets/ \ No newline at end of file
diff --git a/INSTALL.linux b/INSTALL.linux
index 143121af043..6f4ceff66f8 100644
--- a/INSTALL.linux
+++ b/INSTALL.linux
@@ -1,4 +1,4 @@
-= Trinity Core -- Linux installation instructions =
+= TrinityCore -- Linux installation =
Copyright (C) Trinity Core (http://www.trinitycore.org)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000000..c7da2a438ef
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,60 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = dep doc src
+
+## Additional files to include when running 'make dist'
+# Win32 project workspace for Visual Studio .NET 2003
+EXTRA_DIST = \
+ win/mangosdVC71.sln \
+ win/VC71/framework.vcproj \
+ win/VC71/game.vcproj \
+ win/VC71/mangosd.vcproj \
+ win/VC71/realmd.vcproj \
+ win/VC71/shared.vcproj \
+ win/VC71/zlib.vcproj \
+ win/VC71/g3dlite.vcproj \
+ win/VC71/zthread.vcproj
+
+# Win32 project workspace for Visual Studio .NET 2005
+EXTRA_DIST += \
+ win/mangosdVC80.sln \
+ win/VC80/framework.vcproj \
+ win/VC80/game.vcproj \
+ win/VC80/mangosd.vcproj \
+ win/VC80/realmd.vcproj \
+ win/VC80/shared.vcproj \
+ win/VC80/zlib.vcproj \
+ win/VC80/g3dlite.vcproj \
+ win/VC80/zthread.vcproj
+
+# Win32 project workspace for Visual Studio .NET 2008
+EXTRA_DIST += \
+ win/mangosdVC90.sln \
+ win/VC90/framework.vcproj \
+ win/VC90/game.vcproj \
+ win/VC90/mangosd.vcproj \
+ win/VC90/realmd.vcproj \
+ win/VC90/shared.vcproj \
+ win/VC90/zlib.vcproj \
+ win/VC90/g3dlite.vcproj \
+ win/VC90/zthread.vcproj
+
diff --git a/NEWS b/NEWS
deleted file mode 100644
index c6f862d5206..00000000000
--- a/NEWS
+++ /dev/null
@@ -1,9 +0,0 @@
-= Trinity Core -- History of visible changes =
-
-Copyright (C) Trinity Core (http://www.trinitycore.org)
-
-See the COPYING file for copying conditions.
-
-Please visit the Trinity Core website for bug reports, patch
-submissions, suggestions, and support:
-http://www.trinitycore.org/ \ No newline at end of file
diff --git a/README b/README
index a5bc5b18fd7..4263f79f7ff 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-= Trinity Core -- General information =
+= TrinityCore -- General information =
-Copyright (C) Trinity Core (http://www.trinitycore.org)
+Copyright (C) TrinityCore (http://www.trinitycore.org)
Trinity Core is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,11 +26,11 @@ Copyright (C) Trinity Core (http://www.trinitycore.org)
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version.
-Trinity Core is a World of Warcraft game server emulator. It is derived
+TrinityCore is a World of Warcraft game server emulator. It is derived
from MaNGOS, the Massive Network Game Object Server, and is based on the
code of that project.
-For further information on the Trinity Core project, please visit our
+For further information on the TrinityCore project, please visit our
project website at http://www.trinitycore.org.
API documentation can be obtained by running the "make doc" command inside
@@ -40,4 +40,4 @@ SQL files to create the database can be found in the sql directory. Files
to update your database from an older revision/version can be found in the
sql/updates directory.
-See the INSTALL.Linux file for installation instructions under Linux. \ No newline at end of file
+See the INSTALL.linux file for installation instructions on Linux.
diff --git a/THANKS b/THANKS
index 396ebbceb7f..800a90c4e4b 100644
--- a/THANKS
+++ b/THANKS
@@ -1,34 +1,24 @@
-The THANKS file:
-
-All distributions should contain a `THANKS' file containing a two column list
-of the contributors, one per line, alphabetically sorted. The left column gives
-the contributor's name, while the right column gives the last known good email
-address for this contributor. This list should be introduced with a wording
-similar to this one:
-
- Trinity Core THANKS file
-
- Trinity Core is a derivation/rewrite of MaNGOS, which was originally written
- by Team Python and the WoW Daemon Team. Many people further helped Trinity Core
- by submitting bug reports, code patches, and suggestions. Thanks to the
- community!
-
- Special thanks should go out to the WowwoW team. We have gained help from
- them many times in the creation of this project. Keep up the good work guys.
-
- Thanks to the ImpConfig developer (dythzer) for the custom configuration patch.
-
- Thanks to the ScriptDev2 team (http://www.scriptdev2.com) for scripts.
-
-The easiest policy with this file is to thank everyone who contributes to the
-project, without judging the value of the contribution.
-
-Unlike `AUTHORS', the `THANKS' file is not maintained for legal reasons. It is
-maintained to thank all the contributors that helped you out in your project.
-The `AUTHORS' file can not be used for this purpose because certain
-contributions, like bug reports or ideas and suggestions do not require legal
-paper exchanges.
-
-You can also decide to send some kind of special greeting when you initially
-add a name to your `THANKS' file. The mere presense of a name in `THANKS' is
-then a flag to you that the initial greeting has been sent.
+= TrinityCore -- Thanks/credits file =
+
+TrinityCore is a derivation/rewrite of MaNGOS, which was originally written
+by Team Python and the WoW Daemon Team. Many people further helped Trinity Core
+by submitting bug reports, code patches, and suggestions. Thanks to the
+community!
+
+Special thanks should go out to the WowwoW team. We have gained help from
+them many times in the creation of this project. Keep up the good work guys.
+
+Thanks to the ScriptDev2 team (http://www.scriptdev2.com) for scripts.
+
+Thanks to the WCell team (especially Ralek) for research on realm reconnect
+sequence, item scaling stats algorithm, gameobject rotation issues.
+
+Thanks go out to the following people for various patches/code (listed in the
+order they were added): w12x, dythzer, XEQT, death420, balrok, TOM_RUS,
+runningnak3d, Seline, KingPin, raczman, bogie, Neo2003, NoFantasy, Derex,
+freghar, toilet1, megamage, MadJack, WarHead, gvcoman, Ntsc, arrai, jrkpote,
+Seraphim, vagoth, KerchumA222, Rognar, Blaymoira, DragonHunter, Molius, apoc,
+SeT, hunuza, Wyk3d, VladimirMangos, rj686, Arthorius, QAston, Muhaha, dereka,
+Kaldorei, NuRRi, Biglad, Machiavelli, Nivelo, Paradox, Aokromes, EleGoS,
+Visagalis, reno, Cybrax, GriffonHeart, fgenesis, rilex, XTElite1, Anubisss, eL,
+Iskander, arclite, Bladex, EIFEL, Klaimmore.
diff --git a/bcpp.cfg b/bcpp.cfg
deleted file mode 100644
index f567d7f5d90..00000000000
--- a/bcpp.cfg
+++ /dev/null
@@ -1,109 +0,0 @@
-; This file contains configuration parameters that are used
-; within the bcpp program.
-
-; There are two types of parameter types : Boolean, and Integer.
-; Boolean types can have only two valid values [On, Yes, or Off, No].
-; Integer types can have a valid range of 0 - 5000.
-
-;------------------------------------------------------------------------
-; This parameter specifies how many lines separate between two
-; functions.
-;------------------------------------------------------------------------
-function_spacing = 1 ; Integer
-
-;------------------------------------------------------------------------
-; Specifies whether to use tabs in indenting code.
-;------------------------------------------------------------------------
-use_tabs = no ; Boolean
-
-;------------------------------------------------------------------------
-; Specifies how many spaces to indent. This parameter is also used
-; for tab indenting, as 1 tab may be worth 8 spaces if so desired.
-; This parameter is used to position comments in TAB mode, and expanding
-; of tabs within code!
-;------------------------------------------------------------------------
-indent_spacing = 4 ; Integer
-
-;------------------------------------------------------------------------
-; Specifies whether to indent preprocessor controls to match the code
-;------------------------------------------------------------------------
-indent_preprocessor = yes ; Boolean
-
-;------------------------------------------------------------------------
-; Specifies whether to indent embedded SQL statements
-;------------------------------------------------------------------------
-indent_exec_sql = yes ; Boolean
-
-;------------------------------------------------------------------------
-; Defines at what start position comments that have code on the
-; same line to be placed.
-;------------------------------------------------------------------------
-comments_with_code = 60 ; Integer
-
-;------------------------------------------------------------------------
-; Defines at what start position comments with no code start.
-;------------------------------------------------------------------------
-comments_with_nocode = 0 ; Integer
-
-;------------------------------------------------------------------------
-; Set this option to ON turns off setting indentation position of parameter
-; "comments_with_nocode". Indentation is then set according to code
-; position.
-;------------------------------------------------------------------------
-leave_comments_nocode = On ; Boolean
-
-;------------------------------------------------------------------------
-; Use this option is used to change non-ascii (non-printable) chars to
-; octal notation if they lie within quotes. Either
-; Ascii_Chars_Only, XOR Leave_Graphic_Chars parameters need to be set
-; as a True value for this parameter to take effect.
-;------------------------------------------------------------------------
-NonAscii_Quotes_to_Octal = yes ; Boolean
-
-;------------------------------------------------------------------------
-; Setting this parameter to yes will strip non-printable characters
-; from the source files, but leave any character that are IBM
-; graphics alone. Any non-printable characters that lie within
-; quotes will be transformed into octal/character notation, if
-; NonAscii_Quotes_To_Octal parameter is set to True.
-;------------------------------------------------------------------------
-; leave_graphic_chars = yes ; Boolean
-
-;------------------------------------------------------------------------
-; Setting this parameter to yes will strip any non-printable,
-; non-ascii characters from the input file. Any non-printable
-; octal/character notation if NonAscii_Quotes_To_Octal is set to
-; True. Comment out this parameter if you are using
-; Leave_Graphic_Chars parameter, as this parameter will override
-; it.
-;------------------------------------------------------------------------
-ascii_chars_only = no ; Boolean
-
-;------------------------------------------------------------------------
-; This parameter will place open braces on a new line after it's
-; associated code if set on/yes. Else the brace will be place on
-; next above line if possible, with it's code.
-;------------------------------------------------------------------------
-place_brace_on_new_line = yes ; Boolean
-
-;------------------------------------------------------------------------
-; This parameter will stop output from the program corrupting output
-; that may exit from the program via the standard output.
-; If this parameter is set to off/no then no output is generated from
-; the program, unless an error is encountered
-;------------------------------------------------------------------------
-program_output = yes ; Boolean
-
-;------------------------------------------------------------------------
-; Specifies what the internal memory requirements will be in size of the
-; line processing buffer. This essentially is used only for open brace
-; relocation in kernighan/ritchie style.
-;------------------------------------------------------------------------
-Queue_Buffer = 100 ; Integer
-
-;------------------------------------------------------------------------
-; If this option is set to true then the input file will be backup into a
-; another file with a ".bac" extension added to the end of the file
-; name.
-;------------------------------------------------------------------------
-Backup_File = yes ; Boolean
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 00000000000..ede1118be95
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,382 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <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.
+
+## Process this file with autoconf to produce a configure script.
+
+# TODO: create m4 directory and put the checks there, because this file got realy poluted ( by Derex )
+
+## Prelude, basic settings for Autoconf
+# PACKAGE: trinity
+# VERSION: 0.0.1 (trunk)
+# BUG-REPORT-ADDRESS: devs@trinitycore.org
+AC_INIT( [trinitycore], [0.0.1], [devs@trinitycore.org])
+AC_CONFIG_SRCDIR([src/shared/Base.cpp])
+
+## Prelude, basic settings for Automake
+# Turn on all warnings and error messages, and enforce GNU
+# standards for the package.
+AM_INIT_AUTOMAKE([-Wall -Werror gnu tar-pax])
+AM_MAINTAINER_MODE
+
+## Prevent the configure script from continuing any further if
+# configuration is being performed in the top-level directory.
+# The idea is to prevent this ,because some maintainers tend
+# to break parallel build trees (a.k.a. VPATH builds).
+if test "$srcdir" = "." && test "$enable_maintainer_mode" != "yes"; then
+ AC_MSG_ERROR(
+ [
+ Please configure and build in a directory other than the
+ top-level source directory. This is needed because a lot
+ of maintainers tend to break parallel build trees
+ (a.k.a. VPATH builds). This is kinda real ensurance they
+ will not do it (by enforcing everybody to do VPATH builds).
+
+ For example, try the following from the top-level source
+ directory:
+
+ mkdir objdir
+ cd objdir
+ ../configure
+ make
+
+ This will create a build space in the directory `objdir' and
+ start a build in that directory.
+
+ If however you realy want to disable this error,
+ use --enable-maintainer-mode switch.
+ ])
+fi
+
+## Disable building of static libraries by default
+AC_DISABLE_STATIC
+
+## Check for required dependencies.
+
+## Check for a valid build environment.
+# Valid equals having:
+# - a C++ compiler compliant with the ISO98 C++ specification.
+# - a working library tool for creating convenience libraries.
+# - a working linker for creating static and shared libraries.
+AC_PROG_CC
+AC_PROG_CXX
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_PROG_INSTALL
+
+
+# Check if enable scripts
+AC_ARG_ENABLE([scripts], AC_HELP_STRING([--enable-scripts], [Enable TrinityScripts (default: check) ]), [], [enable_scripts=yes])
+
+AC_MSG_CHECKING(whether to build scripting module)
+if test X$enable_scripts = Xyes -a -d $srcdir/src/bindings/scripts/scripts; then
+ tri_build_scripts=yes
+ AC_MSG_RESULT(yes)
+else
+ tri_build_scripts=no
+ AC_MSG_RESULT(no)
+ if test X$enable_scripts = Xyes; then
+ AC_MSG_WARN([src/bindings/scripts/scripts folder does not exist, scripts will be disabled])
+ fi
+fi
+
+AM_CONDITIONAL([USE_TSCRIPTS], [test X$tri_build_scripts = Xyes])
+
+# Check for doxygen
+AC_ARG_ENABLE(doxygen, AC_HELP_STRING([--enable-doxygen], [turn on generating documentation]))
+
+enable_doxygen_support=no
+
+if test "x$enable_doxygen" = "xyes";
+then
+ AC_PATH_PROG(DOXYGEN, doxygen, no)
+ if test "x$DOXYGEN" = "xno"; then
+ AC_MSG_ERROR([You need to install the doxygen package])
+ fi
+ enable_doxygen_support=yes
+fi
+AM_CONDITIONAL(DOXYGEN_ENABLED, test x$enable_doxygen_support = xyes)
+
+## Check for required libraries.
+AC_CHECK_LIB( pthread, pthread_create, [],
+ [LDFLAGS="-pthread $LDFLAGS"
+ AC_TRY_LINK([char pthread_create();],
+ pthread_create();,
+ [], [AC_MSG_ERROR([Missing pthread])])
+ ])
+AC_CHECK_LIB( z, compress, [ZLIB=-lz],[AC_MSG_ERROR([Missing zlib])] )
+AC_CHECK_LIB( compat, ftime, [COMPATLIB=-lcompat] )
+AC_CHECK_LIB( crypto, SHA1_Init, [SSLLIB=-lssl], [AC_MSG_ERROR([Missing openssl])])
+
+AC_ARG_WITH(postgresql,
+[ --with-postgresql Use PostgreSQL as a backend (default: no)],
+[case "${withval}" in
+ yes) DO_POSTGRESQL=yes ;;
+ no) DO_POSTGRESQL=no ;;
+ maybe) DO_POSTGRESQL=maybe ;;
+ *) AC_MSG_ERROR(Bad value ${withval} for --with-postgresql) ;;
+ esac],
+[DO_POSTGRESQL=no])
+
+AC_ARG_WITH(mysql,
+[ --with-mysql Use MySQL as a backend (default: yes)],
+[case "${withval}" in
+ yes) DO_MYSQL=yes ;;
+ no) DO_MYSQL=no ;;
+ maybe) DO_MYSQL=maybe ;;
+ *) AC_MSG_ERROR(Bad value ${withval} for --with-mysql) ;;
+ esac],
+[DO_MYSQL=yes])
+
+# here Postgre
+AC_MSG_CHECKING(whether to build/link POSTGRESQL)
+if test "x$DO_POSTGRESQL" = "xyes"; then
+DO_MYSQL=no
+POSTGRE_INCLUDES="-I/usr/include/postgresql $POSTGRE_INCLUDES"
+POSTGRE_LIBS="-L/usr/lib/postresql -lpq -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto $POSTGRE_LIBS "
+CXXFLAGS="-DDO_POSTGRESQL $CXXFLAGS"
+fi
+AC_MSG_RESULT($DO_POSTGRESQL)
+
+# here mysql
+AC_MSG_CHECKING(whether to build/link MYSQL)
+if test "x$DO_MYSQL" = "xyes"; then
+AC_MSG_RESULT($DO_MYSQL)
+AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, mysql_config, $PATH)
+ if test -x "$MYSQL_CONFIG"
+ then
+ # MySQL v4 uses --include while v3 uses --cflags
+ MYSQL_INCLUDES="`$MYSQL_CONFIG --include`" || \
+ MYSQL_INCLUDES="`$MYSQL_CONFIG --cflags`"
+ MYSQL_LIBS="`$MYSQL_CONFIG --libs_r`"
+ CXXFLAGS="-DDO_MYSQL $CXXFLAGS"
+ fi
+else
+AC_MSG_RESULT($DO_MYSQL)
+fi
+
+## Check for options
+# Include debug info in library?
+AC_MSG_CHECKING(whether to include debug info in library)
+TRINITYD_DEBUG_INFO=no
+AC_ARG_WITH(debug-info,
+[
+Debugging options:
+
+ --with-debug-info Include debug info in library],
+[
+ if test "$withval" = "yes" ; then
+ CFLAGS="-g -DTRINITY_DEBUG $CFLAGS"
+ CXXFLAGS="-g -DTRINITY_DEBUG $CXXFLAGS"
+ TRINITYD_DEBUG_INFO=yes
+ elif test "$withval" != "no" ; then
+ AC_MSG_ERROR(Please choose yes or no)
+ fi
+])
+AC_MSG_RESULT($TRINITYD_DEBUG_INFO)
+
+
+# Enable CLI console?
+AC_MSG_CHECKING(whether cli console is enabled)
+TRINITYD_ENABLE_CLI=no
+AC_ARG_ENABLE(cli,
+[ --enable-cli Turn on command console system],
+[
+ if test "$enableval" = "yes" ; then
+ CFLAGS="-DENABLE_CLI $CFLAGS"
+ CXXFLAGS="-DENABLE_CLI $CXXFLAGS"
+ TRINITYD_ENABLE_CLI=yes
+ elif test "$withval" != "no" ; then
+ AC_MSG_ERROR(Please choose yes or no)
+ fi
+])
+AC_MSG_RESULT($TRINITYD_ENABLE_CLI)
+
+# Enable remote console?
+AC_MSG_CHECKING(whether remote console is enabled)
+TRINITYD_ENABLE_RA=no
+AC_ARG_ENABLE(ra,
+[ --enable-ra Turn on remote console system],
+[
+ if test "$enableval" = "yes" ; then
+ CFLAGS="-DENABLE_RA $CFLAGS"
+ CXXFLAGS="-DENABLE_RA $CXXFLAGS"
+ TRINITYD_ENABLE_RA=yes
+ elif test "$withval" != "no" ; then
+ AC_MSG_ERROR(Please choose yes or no)
+ fi
+])
+AC_MSG_RESULT($TRINITYD_ENABLE_RA)
+
+# Enable large cells?
+AC_MSG_CHECKING(whether we use large cells)
+TRINITYD_ENABLE_LC=no
+AC_ARG_ENABLE(lc,
+[ --enable-lc Enable large cells (more CPU usage)],
+[
+ if test "$enableval" = "yes" ; then
+ CFLAGS="-DLARGE_CELL $CFLAGS"
+ CXXFLAGS="-DLARGE_CELL $CXXFLAGS"
+ TRINITYD_ENABLE_LC=yes
+ elif test "$withval" != "no" ; then
+ AC_MSG_ERROR(Please choose yes or no)
+ fi
+])
+AC_MSG_RESULT($TRINITYD_ENABLE_LC)
+
+# Enable short world sleep?
+AC_MSG_CHECKING(whether we use short world sleep)
+TRINITYD_ENABLE_SS=no
+AC_ARG_ENABLE(ss,
+[ --enable-ss Enable short world sleep],
+[
+ if test "$enableval" = "yes" ; then
+ CFLAGS="-DSHORT_SLEEP $CFLAGS"
+ CXXFLAGS="-DSHORT_SLEEP $CXXFLAGS"
+ TRINITYD_ENABLE_SS=yes
+ elif test "$withval" != "no" ; then
+ AC_MSG_ERROR(Please choose yes or no)
+ fi
+])
+AC_MSG_RESULT($TRINITYD_ENABLE_SS)
+
+## Check for required header files.
+AC_HEADER_STDC
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS([ arpa/inet.h fcntl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/timeb.h sys/time.h termios.h unistd.h ])
+
+AC_CHECK_HEADERS([pthread.h])
+AC_CHECK_HEADERS([openssl/md5.h openssl/rand.h openssl/ssl.h openssl/sha.h openssl/bn.h])
+AC_CHECK_HEADERS([mysql.h mysql/mysql.h])
+AC_CHECK_HEADERS([libpq-fe.h])
+AC_CHECK_HEADERS([zlib.h])
+
+## Check for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_TYPE_UINT64_T
+AC_C_VOLATILE
+AC_CHECK_TYPES([ptrdiff_t])
+
+## Check for required library functions.
+AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_REALLOC
+AC_FUNC_SELECT_ARGTYPES
+AC_TYPE_SIGNAL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([atexit ftime gethostbyaddr gethostbyname gethostname gettimeofday memmove memset pow realpath select socket sqrt strchr strdup strerror strstr])
+
+## Check what to do with ACE library
+AC_LANG_PUSH([C++])
+AC_CHECK_HEADER([ace/Reactor.h], [tri_have_ace_headers=yes], [tri_have_ace_headers=no])
+AC_CHECK_LIB([ACE], [main], [tri_have_ace_lib=yes], [tri_have_ace_lib=no])
+AC_LANG_POP([C++])
+
+AC_MSG_CHECKING([whether to build ACE])
+if test X$tri_have_ace_headers = Xyes -a X$tri_have_ace_lib = Xyes;
+then
+ tri_need_to_build_ace=no
+ AC_MSG_RESULT([no])
+else
+ if test X$tri_have_ace_headers = Xno -a X$tri_have_ace_lib = Xno; then
+ tri_need_to_build_ace=yes
+ AC_MSG_RESULT([yes])
+ else
+ if test X$tri_have_ace_headers = Xyes; then
+ AC_MSG_ERROR([looks like you have ACE headers, but you do not have ACE libs installed])
+ else
+ tri_need_to_build_ace=yes
+ AC_MSG_RESULT([yes, over-install])
+ fi
+ fi
+fi
+
+if test X$tri_need_to_build_ace = Xyes; then
+ TRINI_INCLUDES="-I\$(top_srcdir)/dep/ACE_wrappers -I\$(top_builddir)/dep/ACE_wrappers $TRINI_INCLUDES"
+ TRINI_LIBS="\$(top_builddir)/dep/ACE_wrappers/ace/libACE.la $TRINI_LIBS"
+else
+ TRINI_LIBS="-lACE $TRINI_LIBS"
+fi
+
+AM_CONDITIONAL([TRI_BUILD_ACE], [test X$tri_need_to_build_ace = Xyes])
+
+
+## Unify all additional includes/libs in one variable.
+# TODO this looks kinda ugly, but when we add m4 folder I will make it look very pritey ( by Derex ).
+TRINI_INCLUDES="$POSTGRE_INCLUDES $MYSQL_INCLUDES $TRINI_INCLUDES"
+TRINI_LIBS="$POSTGRE_LIBS $MYSQL_LIBS $ZLIB $COMPATLIB $SSLLIB $TRINI_LIBS"
+
+## Export defined variables
+AC_SUBST(DOXYGEN)
+AC_SUBST(TRINITYD_DEBUG_INFO)
+AC_SUBST(TRINITYD_ENABLE_CLI)
+AC_SUBST(TRINITYD_ENABLE_RA)
+
+## Additional CPPFLAGS and LDFLAGS.
+AC_SUBST(TRINI_INCLUDES)
+AC_SUBST(TRINI_LIBS)
+
+## Set output files.
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([
+ dep/include/Makefile
+ dep/lib/Makefile
+ dep/src/Makefile
+ dep/src/g3dlite/Makefile
+ dep/src/sockets/Makefile
+ dep/src/zlib/Makefile
+ dep/src/zthread/Makefile
+ dep/Makefile
+ doc/Doxyfile
+ doc/Makefile
+ Makefile
+ src/Makefile
+ src/tools/Makefile
+ src/tools/genrevision/Makefile
+ src/framework/Makefile
+ src/shared/Makefile
+ src/shared/Auth/Makefile
+ src/shared/Config/Makefile
+ src/shared/Database/Makefile
+ src/shared/vmap/Makefile
+ src/shared/SystemConfig.h
+ src/game/Makefile
+ src/realmd/Makefile
+ src/realmd/realmd.conf.dist
+ src/mangosd/Makefile
+ src/mangosd/mangosd.conf.dist
+ src/bindings/Makefile
+ src/bindings/scripts/Makefile
+])
+
+## Configure ACE, if needed
+if test X$tri_need_to_build_ace = Xyes; then
+ AC_CONFIG_SUBDIRS([dep/ACE_wrappers])
+fi
+
+AC_CONFIG_COMMANDS([default],[
+ echo ""
+ echo "Configuration of TrinityCore $PACKAGE_VERSION is now complete."
+ echo ""
+ ],[PACKAGE_VERSION=$PACKAGE_VERSION])
+
+## Disabled Makefiles, until they are ready for a successful make and
+# make dist run.
+
+## Output files.
+AC_OUTPUT
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 00000000000..d89f48418db
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,25 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = extractor
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/contrib/cleanup/tab2spaces.sh b/contrib/cleanup/tab2spaces.sh
new file mode 100644
index 00000000000..1022be7905c
--- /dev/null
+++ b/contrib/cleanup/tab2spaces.sh
@@ -0,0 +1,2 @@
+# Be sure to specify files instead of * when running the script.
+perl -p -i -e "s/\t/ /g" *
diff --git a/contrib/cleanup/whitespace.sh b/contrib/cleanup/whitespace.sh
new file mode 100644
index 00000000000..a351e25359b
--- /dev/null
+++ b/contrib/cleanup/whitespace.sh
@@ -0,0 +1,2 @@
+# Be sure to specify files instead of * when running the script.
+perl -p -i -e "s/ +$//g" *
diff --git a/contrib/extractor/CMakeLists.txt b/contrib/extractor/CMakeLists.txt
new file mode 100644
index 00000000000..9052903b1ed
--- /dev/null
+++ b/contrib/extractor/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
+#
+# 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.
+
+cmake_minimum_required (VERSION 2.6)
+project (MANGOS_MAP_EXTRACTOR)
+
+add_subdirectory (libmpq)
+add_subdirectory (loadlib)
+
+include_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/libmpq)
+include_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/loadlib)
+
+link_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/libmpq)
+link_directories (${MANGOS_MAP_EXTRACTOR_SOURCE_DIR}/loadlib)
+
+add_executable (ad dbcfile.cpp mpq_libmpq.cpp System.cpp)
+
+target_link_libraries (ad libmpq)
+target_link_libraries (ad loadlib)
diff --git a/contrib/extractor/Makefile b/contrib/extractor/Makefile
deleted file mode 100644
index 55eb35f336a..00000000000
--- a/contrib/extractor/Makefile
+++ /dev/null
@@ -1,471 +0,0 @@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# 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.
-
-
-# Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
-#
-# Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-SOURCES = $(ad_SOURCES)
-
-srcdir = .
-top_srcdir = .
-
-pkgdatadir = $(datadir)/mangos
-pkglibdir = $(libdir)/mangos
-pkgincludedir = $(includedir)/mangos
-top_builddir = ../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = /usr/bin/ginstall -c
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = i686-pc-linux-gnu
-host_triplet = i686-pc-linux-gnu
-bin_PROGRAMS = ad$(EXEEXT)
-subdir = contrib/extractor
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
-am_ad_OBJECTS = System.$(OBJEXT) adt.$(OBJEXT) dbcfile.$(OBJEXT) \
- mpq_libmpq.$(OBJEXT)
-ad_OBJECTS = $(am_ad_OBJECTS)
-ad_DEPENDENCIES =
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(ad_SOURCES)
-DIST_SOURCES = $(ad_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL =
-ALLOCA =
-AMDEP_FALSE = #
-AMDEP_TRUE =
-AMTAR = ${SHELL} /home/wow/MaNGOS/trunk/missing --run tar
-AR = ar
-AUTOCONF = ${SHELL} /home/wow/MaNGOS/trunk/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/wow/MaNGOS/trunk/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/wow/MaNGOS/trunk/missing --run automake-1.9
-AWK = gawk
-CC = gcc
-CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O3
-COMPILER_OPTIONS = -g -O3
-CPP = gcc -E
-CPPFLAGS =
-CXX = g++
-CXXCPP = g++ -E
-CXXDEPMODE = depmode=gcc3
-CXXFLAGS = -g -O3
-CYGPATH_W = echo
-DEFS = -DHAVE_CONFIG_H
-DEPDIR = .deps
-ECHO = echo
-ECHO_C =
-ECHO_N = -n
-ECHO_T =
-EGREP = grep -E
-EXEEXT =
-EXTRA_COMPILER_OPTIONS =
-EXTRA_LINKER_OPTIONS =
-F77 =
-FFLAGS =
-INCLUDES = -I$(srcdir)
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-LDFLAGS =
-LIBOBJS =
-LIBS = -lz -lpthread
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LINKER_OPTIONS = -static
-LN_S = ln -s
-LTLIBOBJS =
-LT_AGE = 2
-LT_CURRENT = 2
-LT_RELEASE = 2.3.2
-LT_REVISION = 3
-MAINT = #
-MAINTAINER_MODE_FALSE =
-MAINTAINER_MODE_TRUE = #
-MAKEINFO =
-MANGOSD_CONFIG = /home/wow/server/etc/mangosd.conf
-MANGOSD_CONFIGDIR = /home/wow/server/etc
-MANGOSD_DATA = /home/wow/server/share/mangos
-OBJEXT = o
-PACKAGE = mangos
-PACKAGE_BUGREPORT = http://www.mangosproject.org/
-PACKAGE_NAME = MaNGOS
-PACKAGE_STRING = MaNGOS 0.2-SVN
-PACKAGE_TARNAME = mangos
-PACKAGE_VERSION = 0.2-SVN
-PATH_SEPARATOR = :
-RANLIB = ranlib
-SET_MAKE =
-SHELL = /bin/sh
-STRIP = strip
-VERSION = 0.2-SVN
-ac_ct_AR = ar
-ac_ct_CC = gcc
-ac_ct_CXX = g++
-ac_ct_F77 =
-ac_ct_RANLIB = ranlib
-ac_ct_STRIP = strip
-am__fastdepCC_FALSE = #
-am__fastdepCC_TRUE =
-am__fastdepCXX_FALSE = #
-am__fastdepCXX_TRUE =
-am__include = include
-am__leading_dot = .
-am__quote =
-am__tar = ${AMTAR} chof - "$$tardir"
-am__untar = ${AMTAR} xf -
-bindir = ${exec_prefix}/bin
-build = i686-pc-linux-gnu
-build_alias =
-build_cpu = i686
-build_os = linux-gnu
-build_vendor = pc
-datadir = ${prefix}/share
-exec_prefix = ${prefix}
-host = i686-pc-linux-gnu
-host_alias =
-host_cpu = i686
-host_os = linux-gnu
-host_vendor = pc
-includedir = ${prefix}/include
-infodir = ${prefix}/info
-install_sh = /home/wow/MaNGOS/trunk/install-sh
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-localstatedir = ${prefix}/var
-mandir = ${prefix}/man
-mkdir_p = mkdir -p --
-oldincludedir = /usr/include
-prefix = /home/wow/server
-program_transform_name = s,x,x,
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-
-# use our configured sysconfdir
-sysconfdir = /home/wow/server/etc
-target_alias =
-ad_SOURCES = \
- System.cpp \
- adt.h \
- adt.cpp \
- dbcfile.cpp \
- dbcfile.h \
- mpq_libmpq.cpp \
- mpq_libmpq.h
-
-ad_LDADD = libmpq/libmpq.a
-add_LDFLAGS = -L$(srcdir) -L$(srcdir)/libmpq
-
-all: create-dir all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-
-.PRECIOUS: Makefile
-
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-ad$(EXEEXT): $(ad_OBJECTS) $(ad_DEPENDENCIES)
- @rm -f ad$(EXEEXT)
- $(CXXLINK) $(ad_LDFLAGS) $(ad_OBJECTS) $(ad_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.cpp.o:
- if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-# source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-# $(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-# source='$<' object='$@' libtool=no \
-# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-# source='$<' object='$@' libtool=yes \
-# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-# $(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
- -rm .deps/*
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS);
-installdirs:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-info-am
-
-create-dir:
- mkdir -p ".deps"
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic clean-libtool ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/contrib/extractor/README.linux b/contrib/extractor/README.linux
index 52b907391b8..1986831e751 100644
--- a/contrib/extractor/README.linux
+++ b/contrib/extractor/README.linux
@@ -1,7 +1,7 @@
-= Trinity Core -- Linux instructions for extractor =
+Linux instructions
+------------------
-Copyright (C) Trinity Core (http://www.trinitycore.org)
-
-1: Configure and build MaNGOS.
-2: cd contrib/extractor/libmpq && make && cd .. && make
-3: run ad \ No newline at end of file
+1. install cmake
+2. cmake -i
+3. make
+4. ./ad
diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp
index a1641699163..b656a6ab535 100644
--- a/contrib/extractor/System.cpp
+++ b/contrib/extractor/System.cpp
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <deque>
#include <set>
+#include <cstdlib>
#ifdef WIN32
#include "direct.h"
@@ -13,37 +14,78 @@
#include "dbcfile.h"
#include "mpq_libmpq.h"
-extern unsigned int iRes;
-extern ArchiveSet gOpenArchives;
+#include "loadlib/adt.h"
+#include "loadlib/wdt.h"
+#include <fcntl.h>
-bool ConvertADT(char*,char*);
+#if defined( __GNUC__ )
+ #define _open open
+ #define _close close
+ #ifndef O_BINARY
+ #define O_BINARY 0
+ #endif
+#else
+ #include <io.h>
+#endif
-typedef struct{
- char name[64];
- unsigned int id;
-}map_id;
+#ifdef O_LARGEFILE
+ #define OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE)
+#else
+ #define OPEN_FLAGS (O_RDONLY | O_BINARY)
+#endif
+extern ArchiveSet gOpenArchives;
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
+typedef struct
+{
+ char name[64];
+ uint32 id;
+} map_id;
-map_id * map_ids;
-uint16 * areas;
-char output_path[128]=".";
-char input_path[128]=".";
+map_id *map_ids;
+uint16 *areas;
+uint16 *LiqType;
+char output_path[128] = ".";
+char input_path[128] = ".";
+uint32 maxAreaId = 0;
+//**************************************************
+// Extractor options
+//**************************************************
enum Extract
{
EXTRACT_MAP = 1,
EXTRACT_DBC = 2
};
-int extract = EXTRACT_MAP | EXTRACT_DBC;
+
+// Select data for extract
+int CONF_extract = EXTRACT_MAP | EXTRACT_DBC;
+// 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;
+
+// This option allow use float to int conversion
+bool CONF_allow_float_to_int = true;
+float CONF_float_to_int8_limit = 2.0f; // Max accuracy = val/256
+float CONF_float_to_int16_limit = 2048.0f; // Max accuracy = val/65536
+float CONF_flat_height_delta_limit = 0.005f; // If max - min less this value - surface is flat
+float CONF_flat_liquid_delta_limit = 0.001f; // If max - min less this value - liquid surface is flat
+
+// List MPQ for extract from
+char *CONF_mpq_list[]={
+ "common.MPQ",
+ "common-2.MPQ",
+ "lichking.MPQ",
+ "expansion.MPQ",
+ "patch.MPQ",
+ "patch-2.MPQ",
+ "patch-3.MPQ",
+ "patch-4.MPQ",
+ "patch-5.MPQ",
+};
static char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" };
#define LANG_COUNT 12
-#define ADT_RES 64
-
void CreateDir( const std::string& Path )
{
#ifdef WIN32
@@ -55,9 +97,10 @@ void CreateDir( const std::string& Path )
bool FileExists( const char* FileName )
{
- if(FILE* fp = fopen( FileName, "rb" ))
+ int fp = _open(FileName, OPEN_FLAGS);
+ if(fp != -1)
{
- fclose(fp);
+ _close(fp);
return true;
}
@@ -66,47 +109,54 @@ bool FileExists( const char* FileName )
void Usage(char* prg)
{
- printf("Usage:\n%s -[var] [value]\n-i set input path\n-o set output path\n-r set resolution\n-e extract only MAP(1)/DBC(2) - standard: both(3)\nExample: %s -r 256 -i \"c:\\games\\game\"",
- prg,prg);
+ printf(
+ "Usage:\n"\
+ "%s -[var] [value]\n"\
+ "-i set input path\n"\
+ "-o set output path\n"\
+ "-e extract only MAP(1)/DBC(2) - standard: both(3)\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, prg);
exit(1);
}
void HandleArgs(int argc, char * arg[])
{
- for(int c=1;c<argc;c++)
+ for(int c = 1; c < argc; ++c)
{
- //i - input path
- //o - output path
- //r - resolution, array of (r * r) heights will be created
- //e - extract only MAP(1)/DBC(2) - standard both(3)
+ // i - input path
+ // o - output path
+ // e - extract only MAP(1)/DBC(2) - standard both(3)
+ // f - use float to int conversion
+ // h - limit minimum height
if(arg[c][0] != '-')
Usage(arg[0]);
switch(arg[c][1])
{
case 'i':
- if(c+1<argc)//all ok
- strcpy(input_path,arg[(c++) +1]);
+ if(c + 1 < argc) // all ok
+ strcpy(input_path, arg[(c++) + 1]);
else
Usage(arg[0]);
break;
case 'o':
- if(c+1<argc)//all ok
- strcpy(output_path,arg[(c++) +1]);
+ if(c + 1 < argc) // all ok
+ strcpy(output_path, arg[(c++) + 1]);
else
Usage(arg[0]);
break;
- case 'r':
- if(c+1<argc)//all ok
- iRes=atoi(arg[(c++) +1]);
+ case 'f':
+ if(c + 1 < argc) // all ok
+ CONF_allow_float_to_int=atoi(arg[(c++) + 1])!=0;
else
Usage(arg[0]);
break;
case 'e':
- if(c+1<argc)//all ok
+ if(c + 1 < argc) // all ok
{
- extract=atoi(arg[(c++) +1]);
- if(!(extract > 0 && extract < 4))
+ CONF_extract=atoi(arg[(c++) + 1]);
+ if(!(CONF_extract > 0 && CONF_extract < 4))
Usage(arg[0]);
}
else
@@ -120,14 +170,19 @@ uint32 ReadMapDBC()
{
printf("Read Map.dbc file... ");
DBCFile dbc("DBFilesClient\\Map.dbc");
- dbc.open();
- uint32 map_count=dbc.getRecordCount();
- map_ids=new map_id[map_count];
- for(unsigned int x=0;x<map_count;x++)
+ if(!dbc.open())
{
- map_ids[x].id=dbc.getRecord(x).getUInt(0);
- strcpy(map_ids[x].name,dbc.getRecord(x).getString(1));
+ printf("Fatal error: Invalid Map.dbc file format!\n");
+ exit(1);
+ }
+
+ size_t map_count = dbc.getRecordCount();
+ map_ids = new map_id[map_count];
+ for(uint32 x = 0; x < map_count; ++x)
+ {
+ map_ids[x].id = dbc.getRecord(x).getUInt(0);
+ strcpy(map_ids[x].name, dbc.getRecord(x).getString(1));
}
printf("Done! (%u maps loaded)\n", map_count);
return map_count;
@@ -135,60 +190,689 @@ uint32 ReadMapDBC()
void ReadAreaTableDBC()
{
- printf("Read AreaTable.dbc file... ");
+ printf("Read AreaTable.dbc file...");
DBCFile dbc("DBFilesClient\\AreaTable.dbc");
- dbc.open();
- unsigned int area_count=dbc.getRecordCount();
- uint32 maxid = dbc.getMaxId();
- areas=new uint16[maxid + 1];
- memset(areas, 0xff, sizeof(areas));
- for(unsigned int x=0; x<area_count;++x)
+ if(!dbc.open())
+ {
+ printf("Fatal error: Invalid AreaTable.dbc file format!\n");
+ exit(1);
+ }
+
+ size_t area_count = dbc.getRecordCount();
+ size_t maxid = dbc.getMaxId();
+ areas = new uint16[maxid + 1];
+ memset(areas, 0xff, (maxid + 1) * sizeof(uint16));
+
+ for(uint32 x = 0; x < area_count; ++x)
areas[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
+ maxAreaId = dbc.getMaxId();
+
printf("Done! (%u areas loaded)\n", area_count);
}
+void ReadLiquidTypeTableDBC()
+{
+ printf("Read LiquidType.dbc file...");
+ DBCFile dbc("DBFilesClient\\LiquidType.dbc");
+ if(!dbc.open())
+ {
+ printf("Fatal error: Invalid LiquidType.dbc file format!\n");
+ exit(1);
+ }
+
+ size_t LiqType_count = dbc.getRecordCount();
+ size_t LiqType_maxid = dbc.getMaxId();
+ LiqType = new uint16[LiqType_maxid + 1];
+ memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16));
+
+ for(uint32 x = 0; x < LiqType_count; ++x)
+ LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
+
+ printf("Done! (%u LiqTypes loaded)\n", LiqType_count);
+}
+
+//
+// Adt file convertor function and data
+//
+
+// Map file format data
+#define MAP_MAGIC 'SPAM'
+#define MAP_VERSION_MAGIC '0.1w'
+#define MAP_AREA_MAGIC 'AERA'
+#define MAP_HEIGTH_MAGIC 'TGHM'
+#define MAP_LIQUID_MAGIC 'QILM'
+
+struct map_fileheader{
+ uint32 mapMagic;
+ uint32 versionMagic;
+ uint32 areaMapOffset;
+ uint32 areaMapSize;
+ uint32 heightMapOffset;
+ uint32 heightMapSize;
+ uint32 liquidMapOffset;
+ uint32 liquidMapSize;
+};
+
+#define MAP_AREA_NO_AREA 0x0001
+struct map_areaHeader{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 gridArea;
+};
+
+#define MAP_HEIGHT_NO_HIGHT 0x0001
+#define MAP_HEIGHT_AS_INT16 0x0002
+#define MAP_HEIGHT_AS_INT8 0x0004
+
+struct map_heightHeader{
+ uint32 fourcc;
+ uint32 flags;
+ float gridHeight;
+ float gridMaxHeight;
+};
+
+#define MAP_LIQUID_TYPE_NO_WATER 0x00
+#define MAP_LIQUID_TYPE_WATER 0x01
+#define MAP_LIQUID_TYPE_OCEAN 0x02
+#define MAP_LIQUID_TYPE_MAGMA 0x04
+#define MAP_LIQUID_TYPE_SLIME 0x08
+
+#define MAP_LIQUID_TYPE_DARK_WATER 0x10
+#define MAP_LIQUID_TYPE_WMO_WATER 0x20
+
+
+#define MAP_LIQUID_NO_TYPE 0x0001
+#define MAP_LIQUID_NO_HIGHT 0x0002
+
+struct map_liquidHeader{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 liquidType;
+ uint8 offsetX;
+ uint8 offsetY;
+ uint8 width;
+ uint8 height;
+ float liquidLevel;
+};
+
+float selectUInt8StepStore(float maxDiff)
+{
+ return 255 / maxDiff;
+}
+
+float selectUInt16StepStore(float maxDiff)
+{
+ return 65535 / maxDiff;
+}
+// Temporary grid data store
+uint16 area_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
+
+float V8[ADT_GRID_SIZE][ADT_GRID_SIZE];
+float V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1];
+uint16 uint16_V8[ADT_GRID_SIZE][ADT_GRID_SIZE];
+uint16 uint16_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1];
+uint8 uint8_V8[ADT_GRID_SIZE][ADT_GRID_SIZE];
+uint8 uint8_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1];
+
+uint8 liquid_type[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
+bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE];
+float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1];
+
+bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x)
+{
+ ADT_file adt;
+
+ if (!adt.loadFile(filename))
+ return false;
+
+ adt_MCIN *cells = adt.a_grid->getMCIN();
+ if (!cells)
+ {
+ printf("Can't find cells in '%s'\n", filename);
+ return false;
+ }
+
+ memset(liquid_show, 0, sizeof(liquid_show));
+ memset(liquid_type, 0, sizeof(liquid_type));
+
+ // Prepare map header
+ map_fileheader map;
+ map.mapMagic = MAP_MAGIC;
+ map.versionMagic = MAP_VERSION_MAGIC;
+
+ // Get area flags data
+ for (int i=0;i<ADT_CELLS_PER_GRID;i++)
+ {
+ for(int j=0;j<ADT_CELLS_PER_GRID;j++)
+ {
+ adt_MCNK * cell = cells->getMCNK(i,j);
+ uint32 areaid = cell->areaid;
+ if(areaid && areaid <= maxAreaId)
+ {
+ if(areas[areaid] != 0xffff)
+ {
+ area_flags[i][j] = areas[areaid];
+ continue;
+ }
+ printf("File: filename\nCan't find area flag for areaid %u [%d, %d].\n", filename, areaid, cell->ix, cell->iy);
+ }
+ area_flags[i][j] = 0xffff;
+ }
+ }
+ //============================================
+ // Try pack area data
+ //============================================
+ bool fullAreaData = false;
+ uint32 areaflag = area_flags[0][0];
+ for (int y=0;y<ADT_CELLS_PER_GRID;y++)
+ {
+ for(int x=0;x<ADT_CELLS_PER_GRID;x++)
+ {
+ if(area_flags[y][x]!=areaflag)
+ {
+ fullAreaData = true;
+ break;
+ }
+ }
+ }
+
+ map.areaMapOffset = sizeof(map);
+ map.areaMapSize = sizeof(map_areaHeader);
+
+ map_areaHeader areaHeader;
+ areaHeader.fourcc = MAP_AREA_MAGIC;
+ areaHeader.flags = 0;
+ if (fullAreaData)
+ {
+ areaHeader.gridArea = 0;
+ map.areaMapSize+=sizeof(area_flags);
+ }
+ else
+ {
+ areaHeader.flags |= MAP_AREA_NO_AREA;
+ areaHeader.gridArea = (uint16)areaflag;
+ }
+
+ //
+ // Get Height map from grid
+ //
+ for (int i=0;i<ADT_CELLS_PER_GRID;i++)
+ {
+ for(int j=0;j<ADT_CELLS_PER_GRID;j++)
+ {
+ adt_MCNK * cell = cells->getMCNK(i,j);
+ if (!cell)
+ continue;
+ // Height values for triangles stored in order:
+ // 1 2 3 4 5 6 7 8 9
+ // 10 11 12 13 14 15 16 17
+ // 18 19 20 21 22 23 24 25 26
+ // 27 28 29 30 31 32 33 34
+ // . . . . . . . .
+ // For better get height values merge it to V9 and V8 map
+ // V9 height map:
+ // 1 2 3 4 5 6 7 8 9
+ // 18 19 20 21 22 23 24 25 26
+ // . . . . . . . .
+ // V8 height map:
+ // 10 11 12 13 14 15 16 17
+ // 27 28 29 30 31 32 33 34
+ // . . . . . . . .
+
+ // Set map height as grid height
+ for (int y=0; y <= ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x <= ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ V9[cy][cx]=cell->ypos;
+ }
+ }
+ for (int y=0; y < ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x < ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ V8[cy][cx]=cell->ypos;
+ }
+ }
+ // Get custom height
+ adt_MCVT *v = cell->getMCVT();
+ if (!v)
+ continue;
+ // get V9 height map
+ for (int y=0; y <= ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x <= ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ V9[cy][cx]+=v->height_map[y*(ADT_CELL_SIZE*2+1)+x];
+ }
+ }
+ // get V8 height map
+ for (int y=0; y < ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x < ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ V8[cy][cx]+=v->height_map[y*(ADT_CELL_SIZE*2+1)+ADT_CELL_SIZE+1+x];
+ }
+ }
+ }
+ }
+ //============================================
+ // Try pack height data
+ //============================================
+ float maxHeight = -20000;
+ float minHeight = 20000;
+ for (int y=0; y<ADT_GRID_SIZE; y++)
+ {
+ for(int x=0;x<ADT_GRID_SIZE;x++)
+ {
+ float h = V8[y][x];
+ if (maxHeight < h) maxHeight = h;
+ if (minHeight > h) minHeight = h;
+ }
+ }
+ for (int y=0; y<=ADT_GRID_SIZE; y++)
+ {
+ for(int x=0;x<=ADT_GRID_SIZE;x++)
+ {
+ float h = V9[y][x];
+ if (maxHeight < h) maxHeight = h;
+ if (minHeight > h) minHeight = h;
+ }
+ }
+
+ // Check for allow limit minimum height (not store height in deep ochean - allow save some memory)
+ if (CONF_allow_height_limit && minHeight < CONF_use_minHeight)
+ {
+ for (int y=0; y<ADT_GRID_SIZE; y++)
+ for(int x=0;x<ADT_GRID_SIZE;x++)
+ if (V8[y][x] < CONF_use_minHeight)
+ V8[y][x] = CONF_use_minHeight;
+ for (int y=0; y<=ADT_GRID_SIZE; y++)
+ for(int x=0;x<=ADT_GRID_SIZE;x++)
+ if (V9[y][x] < CONF_use_minHeight)
+ V9[y][x] = CONF_use_minHeight;
+ if (minHeight < CONF_use_minHeight)
+ minHeight = CONF_use_minHeight;
+ if (maxHeight < CONF_use_minHeight)
+ maxHeight = CONF_use_minHeight;
+ }
+
+ map.heightMapOffset = map.areaMapOffset + map.areaMapSize;
+ map.heightMapSize = sizeof(map_heightHeader);
+
+ map_heightHeader heightHeader;
+ heightHeader.fourcc = MAP_HEIGTH_MAGIC;
+ heightHeader.flags = 0;
+ heightHeader.gridHeight = minHeight;
+ heightHeader.gridMaxHeight = maxHeight;
+
+ if (maxHeight == minHeight)
+ heightHeader.flags |=MAP_HEIGHT_NO_HIGHT;
+
+ // Not need store if flat surface
+ if (CONF_allow_float_to_int && (maxHeight - minHeight) < CONF_flat_height_delta_limit)
+ heightHeader.flags |=MAP_HEIGHT_NO_HIGHT;
+
+ // Try store as packed in uint16 or uint8 values
+ if (!(heightHeader.flags&MAP_HEIGHT_NO_HIGHT))
+ {
+ float step;
+ // Try Store as uint values
+ if (CONF_allow_float_to_int)
+ {
+ float diff = maxHeight - minHeight;
+ if (diff < CONF_float_to_int8_limit) // As uint8 (max accuracy = CONF_float_to_int8_limit/256)
+ {
+ heightHeader.flags|=MAP_HEIGHT_AS_INT8;
+ step = selectUInt8StepStore(diff);
+ }
+ else if (diff<CONF_float_to_int16_limit) // As uint16 (max accuracy = CONF_float_to_int16_limit/65536)
+ {
+ heightHeader.flags|=MAP_HEIGHT_AS_INT16;
+ step = selectUInt16StepStore(diff);
+ }
+ }
+
+ // Pack it to int values if need
+ if (heightHeader.flags&MAP_HEIGHT_AS_INT8)
+ {
+ for (int y=0; y<ADT_GRID_SIZE; y++)
+ for(int x=0;x<ADT_GRID_SIZE;x++)
+ uint8_V8[y][x] = uint8((V8[y][x] - minHeight) * step + 0.5f);
+ for (int y=0; y<=ADT_GRID_SIZE; y++)
+ for(int x=0;x<=ADT_GRID_SIZE;x++)
+ uint8_V9[y][x] = uint8((V9[y][x] - minHeight) * step + 0.5f);
+ map.heightMapSize+= sizeof(uint8_V9) + sizeof(uint8_V8);
+ }
+ else if (heightHeader.flags&MAP_HEIGHT_AS_INT16)
+ {
+ for (int y=0; y<ADT_GRID_SIZE; y++)
+ for(int x=0;x<ADT_GRID_SIZE;x++)
+ uint16_V8[y][x] = uint16((V8[y][x] - minHeight) * step + 0.5f);
+ for (int y=0; y<=ADT_GRID_SIZE; y++)
+ for(int x=0;x<=ADT_GRID_SIZE;x++)
+ uint16_V9[y][x] = uint16((V9[y][x] - minHeight) * step + 0.5f);
+ map.heightMapSize+= sizeof(uint16_V9) + sizeof(uint16_V8);
+ }
+ else
+ map.heightMapSize+= sizeof(V9) + sizeof(V8);
+ }
+
+ // Get liquid map for grid (in WOTLK used MH2O chunk)
+ adt_MH2O * h2o = adt.a_grid->getMH2O();
+ if (h2o)
+ {
+ for (int i=0;i<ADT_CELLS_PER_GRID;i++)
+ {
+ for(int j=0;j<ADT_CELLS_PER_GRID;j++)
+ {
+ adt_liquid_header *h = h2o->getLiquidData(i,j);
+ if (!h)
+ continue;
+
+ int count = 0;
+ uint64 show = h2o->getLiquidShowMap(h);
+ for (int y=0; y < h->height;y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y + h->yOffset;
+ for (int x=0; x < h->width; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x + h->xOffset;
+ if (show & 1)
+ {
+ liquid_show[cy][cx] = true;
+ ++count;
+ }
+ show>>=1;
+ }
+ }
+
+ uint32 type = LiqType[h->liquidType];
+ switch (type)
+ {
+ case LIQUID_TYPE_WATER: liquid_type[i][j] |= MAP_LIQUID_TYPE_WATER; break;
+ case LIQUID_TYPE_OCEAN: liquid_type[i][j] |= MAP_LIQUID_TYPE_OCEAN; break;
+ case LIQUID_TYPE_MAGMA: liquid_type[i][j] |= MAP_LIQUID_TYPE_MAGMA; break;
+ case LIQUID_TYPE_SLIME: liquid_type[i][j] |= MAP_LIQUID_TYPE_SLIME; break;
+ default:
+ printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j);
+ break;
+ }
+ // Dark water detect
+ if (type == LIQUID_TYPE_OCEAN)
+ {
+ uint8 *lm = h2o->getLiquidLightMap(h);
+ if (!lm)
+ liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER;
+ }
+
+ if (!count && liquid_type[i][j])
+ printf("Wrong liquid detect in MH2O chunk");
+
+ float *height = h2o->getLiquidHeightMap(h);
+ int pos = 0;
+ for (int y=0; y<=h->height;y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y + h->yOffset;
+ for (int x=0; x<= h->width; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x + h->xOffset;
+ if (height)
+ liquid_height[cy][cx] = height[pos];
+ else
+ liquid_height[cy][cx] = h->heightLevel1;
+ pos++;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Get from MCLQ chunk (old)
+ for (int i=0;i<ADT_CELLS_PER_GRID;i++)
+ {
+ for(int j=0;j<ADT_CELLS_PER_GRID;j++)
+ {
+ adt_MCNK *cell = cells->getMCNK(i, j);
+ if (!cell)
+ continue;
+
+ adt_MCLQ *liquid = cell->getMCLQ();
+ int count = 0;
+ if (!liquid || cell->sizeMCLQ <= 8)
+ continue;
+
+ for (int y=0; y < ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x < ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ if (liquid->flags[y][x] != 0x0F)
+ {
+ liquid_show[cy][cx] = true;
+ if (liquid->flags[y][x]&(1<<7))
+ liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER;
+ ++count;
+ }
+ }
+ }
+
+ uint32 c_flag = cell->flags;
+ if(c_flag & (1<<2))
+ liquid_type[i][j]|=MAP_LIQUID_TYPE_WATER; // water
+ if(c_flag & (1<<3))
+ liquid_type[i][j]|=MAP_LIQUID_TYPE_OCEAN; // ochean
+ if(c_flag & (1<<4))
+ liquid_type[i][j]|=MAP_LIQUID_TYPE_MAGMA; // magma/slime
+
+ if (!count && liquid_type[i][j])
+ printf("Wrong liquid detect in MCLQ chunk");
+
+ for (int y=0; y <= ADT_CELL_SIZE; y++)
+ {
+ int cy = i*ADT_CELL_SIZE + y;
+ for (int x=0; x<= ADT_CELL_SIZE; x++)
+ {
+ int cx = j*ADT_CELL_SIZE + x;
+ liquid_height[cy][cx] = liquid->liquid[y][x].height;
+ }
+ }
+ }
+ }
+ }
+
+ //============================================
+ // Pack liquid data
+ //============================================
+ uint8 type = liquid_type[0][0];
+ bool fullType = false;
+ for (int y=0;y<ADT_CELLS_PER_GRID;y++)
+ {
+ for(int x=0;x<ADT_CELLS_PER_GRID;x++)
+ {
+ if (liquid_type[y][x]!=type)
+ {
+ fullType = true;
+ y = ADT_CELLS_PER_GRID;
+ break;
+ }
+ }
+ }
+
+ map_liquidHeader liquidHeader;
+
+ // no water data (if all grid have 0 liquid type)
+ if (type == 0 && !fullType)
+ {
+ // No liquid data
+ map.liquidMapOffset = 0;
+ map.liquidMapSize = 0;
+ }
+ else
+ {
+ int minX = 255, minY = 255;
+ int maxX = 0, maxY = 0;
+ maxHeight = -20000;
+ minHeight = 20000;
+ for (int y=0; y<ADT_GRID_SIZE; y++)
+ {
+ for(int x=0; x<ADT_GRID_SIZE; x++)
+ {
+ if (liquid_show[y][x])
+ {
+ if (minX > x) minX = x;
+ if (maxX < x) maxX = x;
+ if (minY > y) minY = y;
+ if (maxY < y) maxY = y;
+ float h = liquid_height[y][x];
+ if (maxHeight < h) maxHeight = h;
+ if (minHeight > h) minHeight = h;
+ }
+ else
+ liquid_height[y][x] = CONF_use_minHeight;
+ }
+ }
+ map.liquidMapOffset = map.heightMapOffset + map.heightMapSize;
+ map.liquidMapSize = sizeof(map_liquidHeader);
+ liquidHeader.fourcc = MAP_LIQUID_MAGIC;
+ liquidHeader.flags = 0;
+ liquidHeader.liquidType = 0;
+ liquidHeader.offsetX = minX;
+ liquidHeader.offsetY = minY;
+ liquidHeader.width = maxX - minX + 1;
+ liquidHeader.height = maxY - minY + 1;
+ liquidHeader.liquidLevel = minHeight;
+
+ if (maxHeight == minHeight)
+ liquidHeader.flags|=MAP_LIQUID_NO_HIGHT;
+
+ // Not need store if flat surface
+ if (CONF_allow_float_to_int && (maxHeight - minHeight) < CONF_flat_liquid_delta_limit)
+ liquidHeader.flags|=MAP_LIQUID_NO_HIGHT;
+
+ if (!fullType)
+ liquidHeader.flags|=MAP_LIQUID_NO_TYPE;
+
+ if (liquidHeader.flags&MAP_LIQUID_NO_TYPE)
+ liquidHeader.liquidType = type;
+ else
+ map.liquidMapSize+=sizeof(liquid_type);
+
+ if (!(liquidHeader.flags&MAP_LIQUID_NO_HIGHT))
+ map.liquidMapSize+=sizeof(float)*liquidHeader.width*liquidHeader.height;
+ }
+
+ // Ok all data prepared - store it
+ FILE *output=fopen(filename2, "wb");
+ if(!output)
+ {
+ printf("Can't create the output file '%s'\n", filename2);
+ return false;
+ }
+ fwrite(&map, sizeof(map), 1, output);
+ // Store area data
+ fwrite(&areaHeader, sizeof(areaHeader), 1, output);
+ if (!(areaHeader.flags&MAP_AREA_NO_AREA))
+ fwrite(area_flags, sizeof(area_flags), 1, output);
+
+ // Store height data
+ fwrite(&heightHeader, sizeof(heightHeader), 1, output);
+ if (!(heightHeader.flags&MAP_HEIGHT_NO_HIGHT))
+ {
+ if (heightHeader.flags&MAP_HEIGHT_AS_INT16)
+ {
+ fwrite(uint16_V9, sizeof(uint16_V9), 1, output);
+ fwrite(uint16_V8, sizeof(uint16_V8), 1, output);
+ }
+ else if (heightHeader.flags&MAP_HEIGHT_AS_INT8)
+ {
+ fwrite(uint8_V9, sizeof(uint8_V9), 1, output);
+ fwrite(uint8_V8, sizeof(uint8_V8), 1, output);
+ }
+ else
+ {
+ fwrite(V9, sizeof(V9), 1, output);
+ fwrite(V8, sizeof(V8), 1, output);
+ }
+ }
+
+ // Store liquid data if need
+ if (map.liquidMapOffset)
+ {
+ fwrite(&liquidHeader, sizeof(liquidHeader), 1, output);
+ if (!(liquidHeader.flags&MAP_LIQUID_NO_TYPE))
+ fwrite(liquid_type, sizeof(liquid_type), 1, output);
+ if (!(liquidHeader.flags&MAP_LIQUID_NO_HIGHT))
+ {
+ for (int y=0; y<liquidHeader.height;y++)
+ fwrite(&liquid_height[y+liquidHeader.offsetY][liquidHeader.offsetX], sizeof(float), liquidHeader.width, output);
+ }
+ }
+ fclose(output);
+
+ return true;
+}
+
void ExtractMapsFromMpq()
{
char mpq_filename[1024];
char output_filename[1024];
+ char mpq_map_name[1024];
printf("Extracting maps...\n");
uint32 map_count = ReadMapDBC();
ReadAreaTableDBC();
-
- unsigned int total=map_count*ADT_RES*ADT_RES;
- unsigned int done=0;
+ ReadLiquidTypeTableDBC();
std::string path = output_path;
path += "/maps/";
CreateDir(path);
- for(unsigned int x = 0; x < ADT_RES; ++x)
+ printf("Convert map files\n");
+ for(uint32 z = 0; z < map_count; ++z)
{
- for(unsigned int y = 0; y < ADT_RES; ++y)
+ printf("Extract %s (%d/%d) \n", map_ids[z].name, z+1, map_count);
+ // Loadup map grid data
+ sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name);
+ WDT_file wdt;
+ if (!wdt.loadFile(mpq_map_name, false))
{
- for(unsigned int z = 0; z < map_count; ++z)
+// printf("Error loading %s map wdt data\n", map_ids[z].name);
+ continue;
+ }
+
+ for(uint32 y = 0; y < WDT_MAP_SIZE; ++y)
+ {
+ for(uint32 x = 0; x < WDT_MAP_SIZE; ++x)
{
- sprintf(mpq_filename,"World\\Maps\\%s\\%s_%u_%u.adt",map_ids[z].name,map_ids[z].name,x,y);
- sprintf(output_filename,"%s/maps/%03u%02u%02u.map",output_path,map_ids[z].id,y,x);
- ConvertADT(mpq_filename,output_filename);
- done++;
+ if (!wdt.main->adt_list[y][x].exist)
+ continue;
+ sprintf(mpq_filename, "World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y);
+ sprintf(output_filename, "%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x);
+ ConvertADT(mpq_filename, output_filename, y, x);
}
- //draw progess bar
- printf("Processing........................%d%%\r",(100*done)/total);
+ // draw progress bar
+ printf("Processing........................%d%%\r", (100 * (y+1)) / WDT_MAP_SIZE);
}
}
-
delete [] areas;
delete [] map_ids;
}
-//bool WMO(char* filename);
-
void ExtractDBCFiles(int locale, bool basicLocale)
{
printf("Extracting dbc files...\n");
@@ -222,7 +906,7 @@ void ExtractDBCFiles(int locale, bool basicLocale)
string filename = path;
filename += (iter->c_str() + strlen("DBFilesClient\\"));
- FILE *output=fopen(filename.c_str(), "wb");
+ FILE *output = fopen(filename.c_str(), "wb");
if(!output)
{
printf("Can't create the output file '%s'\n", filename.c_str());
@@ -260,18 +944,10 @@ void LoadLocaleMPQFiles(int const locale)
void LoadCommonMPQFiles()
{
char filename[512];
-
- sprintf(filename,"%s/Data/common.MPQ", input_path);
- new MPQArchive(filename);
- sprintf(filename,"%s/Data/expansion.MPQ", input_path);
- new MPQArchive(filename);
- for(int i = 1; i < 5; ++i)
+ int count = sizeof(CONF_mpq_list)/sizeof(char*);
+ for(int i = 0; i < count; ++i)
{
- char ext[3] = "";
- if(i > 1)
- sprintf(ext, "-%i", i);
-
- sprintf(filename,"%s/Data/patch%s.MPQ", input_path, ext);
+ sprintf(filename, "%s/Data/%s", input_path, CONF_mpq_list[i]);
if(FileExists(filename))
new MPQArchive(filename);
}
@@ -303,7 +979,7 @@ int main(int argc, char * arg[])
//Open MPQs
LoadLocaleMPQFiles(i);
- if((extract & EXTRACT_DBC) == 0)
+ if((CONF_extract & EXTRACT_DBC) == 0)
{
FirstLocale = i;
break;
@@ -329,7 +1005,7 @@ int main(int argc, char * arg[])
return 0;
}
- if (extract & EXTRACT_MAP)
+ if (CONF_extract & EXTRACT_MAP)
{
printf("Using locale: %s\n", langs[FirstLocale]);
diff --git a/contrib/extractor/VC71_ad.vcproj b/contrib/extractor/VC71_ad.vcproj
index fd2d16120e8..541540ceaa2 100644
--- a/contrib/extractor/VC71_ad.vcproj
+++ b/contrib/extractor/VC71_ad.vcproj
@@ -213,7 +213,15 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath=".\adt.cpp"
+ RelativePath=".\loadlib\loadlib.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\loadlib\adt.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\loadlib\wdt.cpp"
>
</File>
<File
diff --git a/contrib/extractor/VC80_ad.vcproj b/contrib/extractor/VC80_ad.vcproj
index fedab5b89eb..a20ff016ca8 100644
--- a/contrib/extractor/VC80_ad.vcproj
+++ b/contrib/extractor/VC80_ad.vcproj
@@ -218,7 +218,7 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath=".\adt.cpp"
+ RelativePath=".\loadlib\adt.cpp"
>
</File>
<File
@@ -226,6 +226,10 @@
>
</File>
<File
+ RelativePath=".\loadlib\loadlib.cpp"
+ >
+ </File>
+ <File
RelativePath=".\mpq_libmpq.cpp"
>
</File>
@@ -253,6 +257,10 @@
/>
</FileConfiguration>
</File>
+ <File
+ RelativePath=".\loadlib\wdt.cpp"
+ >
+ </File>
<Filter
Name="libmpq"
>
diff --git a/contrib/extractor/VC90_ad.vcproj b/contrib/extractor/VC90_ad.vcproj
index 59fdf6d21f1..9a039a0fbb0 100644
--- a/contrib/extractor/VC90_ad.vcproj
+++ b/contrib/extractor/VC90_ad.vcproj
@@ -216,7 +216,15 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath=".\adt.cpp"
+ RelativePath=".\loadlib\loadlib.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\loadlib\adt.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\loadlib\wdt.cpp"
>
</File>
<File
diff --git a/contrib/extractor/ad.exe b/contrib/extractor/ad.exe
index f0a7e4408ce..208eb2da030 100644
--- a/contrib/extractor/ad.exe
+++ b/contrib/extractor/ad.exe
Binary files differ
diff --git a/contrib/extractor/adt.cpp b/contrib/extractor/adt.cpp
index a8f640a63bc..fcbfc95a072 100644
--- a/contrib/extractor/adt.cpp
+++ b/contrib/extractor/adt.cpp
@@ -15,16 +15,14 @@
#include "adt.h"
#include "mpq_libmpq.h"
-//#include <windows.h>
-unsigned int iRes=256;
-extern uint16*areas;
+extern uint16 *areas;
+extern uint16 *LiqType;
+extern uint32 maxAreaId;
vec wmoc;
-Cell * cell;
-uint32 wmo_count;
+Cell *cell;
mcell *mcells;
-
int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888};
int holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000};
@@ -35,168 +33,154 @@ bool LoadADT(char* filename)
if(mf.isEof())
{
- //printf("No such file.\n");
+ //printf("No such file %s\n", filename);
return false;
}
- mcells=new mcell;
- wmoc.x =65*TILESIZE;
- wmoc.z =65*TILESIZE;
+ MapLiqFlag = new uint8[256];
+ for(uint32 j = 0; j < 256; ++j)
+ MapLiqFlag[j] = 0; // no water
+
+ MapLiqHeight = new float[16384];
+ for(uint32 j = 0; j < 16384; ++j)
+ MapLiqHeight[j] = -999999; // no water
+
+ mcells = new mcell;
+
+ wmoc.x = 65 * TILESIZE;
+ wmoc.z = 65 * TILESIZE;
size_t mcnk_offsets[256], mcnk_sizes[256];
- wmo_count=0;
- bool found=false;
- //uint32 fs=mf.getSize()-3;
- //while (mf.getPos()<fs)
+ chunk_num = 0;
+ k = 0;
+ m = 0;
while (!mf.isEof())
{
uint32 fourcc;
- mf.read(&fourcc,4);
+ mf.read(&fourcc, 4);
mf.read(&size, 4);
size_t nextpos = mf.getPos() + size;
- switch(fourcc)
+
+ //if(fourcc==0x4d484452) // MHDR header
+ //if(fourcc==0x4d564552) // MVER
+ if(fourcc == 0x4d43494e) // MCIN
{
- case 0x4d43494e: // MCIN
+ for (uint32 i = 0; i < 256; ++i)
{
- //printf("Found chunks info\n");
- // mapchunk offsets/sizes
- for (int i=0; i<256; i++)
- {
- mf.read(&mcnk_offsets[i],4);
- mf.read(&mcnk_sizes[i],4);
- mf.seekRelative(8);
- }
- break;
+ mf.read(&mcnk_offsets[i], 4);
+ mf.read(&mcnk_sizes[i], 4);
+ mf.seekRelative(8);
}
- case 0x4d4f4446: // MODF
+ }
+ //if(fourcc == 0x4d544558) // MTEX textures (strings)
+ //if(fourcc == 0x4d4d4458) // MMDX m2 models (strings)
+ //if(fourcc == 0x4d4d4944) // MMID offsets for strings in MMDX
+ //if(fourcc == 0x4d574d4f) // MWMO
+ //if(fourcc == 0x4d574944) // MWID offsets for strings in MWMO
+ //if(fourcc == 0x4d444446) // MDDF
+ //if(fourcc == 0x4d4f4446) // MODF
+ if(fourcc == 0x4d48324f) // MH2O new in WotLK
+ {
+ // çäåñ?íàäî çàïîìíèò?áàçîâó?ïîçèöè??ôàéë?òê âñ?ñìåùåí? áóäó?îò íåãî
+ uint32 base_pos = mf.getPos();
+ uint32 header_pos = 0;
+ MH2O_offsData *LiqOffsData = new MH2O_offsData;
+ MH2O_Data1 *LiqChunkData1 = new MH2O_Data1;
+ float *ChunkLiqHeight = new float[81];
+ for(chunk_num = 0; chunk_num < 256; ++chunk_num)
{
- /*
- if(size)
+ mf.read(LiqOffsData, 0x0C);
+ header_pos = mf.getPos();
+ if(LiqOffsData->offsData1 != 0) // åñëè äàííûå ?Data1 ?âîäå åñòü, òî èõ íàäî êîíâåðòèðîâàòü
{
- //printf("\nwmo count %d\n",size/64);
- wmo_count =size/64;
- for (int i=0; i<wmo_count; i++)
+ // ïåðåõî?ïî ñìåùåíèþ èç offsData1 ÎÒ ×À?êóñê?
+ mf.seek(base_pos + LiqOffsData->offsData1);
+ mf.read(LiqChunkData1, 0x18); // ñ÷èòûâàå?ñàìè äàííûå ?ñòðóêòóð?òèïà MH2O_Data1
+ // çàíîñè?äàííûå ôëàã?äëÿ êóñê?
+ if(LiqType[LiqChunkData1->LiquidTypeId] == 0xffff)
+ printf("\nCan't find Liquid type for map %s\nchunk %d\n", filename, chunk_num);
+ else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_WATER || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_OCEAN)
+ MapLiqFlag[chunk_num] |= 1; // water/ocean
+ else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_MAGMA || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_SLIME)
+ MapLiqFlag[chunk_num] |= 2; // magma/slime
+ // ïðåäâàðèòåëüíî çàïîëíÿåì âåñü êóñî?äàííûì?- íå?âîäû
+ for(int j = 0; j < 81; ++j)
+ {
+ ChunkLiqHeight[j] = -999999; // no liquid/water
+ }
+ // òåïåðü âû÷èñëÿåì òå ÷ò??âîäî??ïåðåçàïèñûâàåì èõ ?êóñê?
+ for(int b = 0; b <= LiqChunkData1->height; ++b)
{
- int id;
- mf.read(&id, 4);
- WMO *wmo = (WMO*)wmomanager.items[wmomanager.get(wmos[id])];
- WMOInstance inst(wmo, mf);
- wmois.push_back(inst);
+ for(int c = LiqChunkData1->xOffset; c <= (LiqChunkData1->xOffset + LiqChunkData1->width); ++c)
+ {
+ int n = (9 * (LiqChunkData1->yOffset + b)) + c;
+ ChunkLiqHeight[n] = LiqChunkData1->heightLevel1;
+ }
}
+ mf.seek(header_pos); // ?íå çàáûòü âåðíóòüñÿ íà èñõîäíóþ ïîçèöè?èìåííî ?ÕÈÄÅÐÅ
+ }
+ else // åñëè äàííûõ ?Data1 íå? òî íàäî çàïîëíèò?âåñü êóñî? íî äàííûì?- íå?âîäû
+ {
+ for(int j = 0; j < 81; ++j)
+ ChunkLiqHeight[j] = -999999; // no liquid/water
+ }
- }*/
- break;
- }
- case 0x4d574d4f: // MWMO
- {
- /*
- if (size)
+ if(!(chunk_num % 16))
+ m = 1024 * (chunk_num / 16); // ñìåùåíèå ïî ?äà?êóñêîâ ?ïåðåêðûòèå?= 1024
+ k = m + (chunk_num % 16) * 8; // óñòàíàâëèâàåìñÿ íà íà÷àëüíû?èíäåêñ äëÿ çàïîëíåí? ?äà
+ // çàíîñè?äàííûå êóñê??ìàññèâ äëÿ êàðò? ?ïåðåêðûòèå??îáðåçàíèåì êóñêîâ òê äàííûõ 81
+ // ýò?àíàëîã ñòàðîã?îáðåçàíèÿ ãðàíè÷íû?ïðàâûõ-áîêîâû??íèæíèõ äàííûõ
+ for(int p = 0; p < 72; p += 9) // íèæíèå 8 íå çàíîñè?òê îí?äóáëèðóåòñÿ ñëåä êóñêîì
{
- char *buf = new char[size];
- mf.read(buf, size);
- char *p=buf;
- while (p<buf+size)
+ for(int s = 0; s < 8; ++s) // 9 çíà÷åíèå ?ñòðîêå íå çàíîñè?òê îí?äóáëèðóåòñÿ ñëåä êóñêîì, ??ïðâû?áîêîâû?îáðåçàåò? äëÿ 128?28
{
- std::string path(p);
- p+=strlen(p)+1;
- fixname(path);
-
- wmomanager.add(path);
- wmos.push_back(path);
+ MapLiqHeight[k] = ChunkLiqHeight[p + s];
+ ++k;
}
- delete[] buf;
- }*/
- break;
- }
- case 0x4d564552: // MVER
- case 0x4d484452: // MHDR header
- case 0x4d434e4b: // MCNK
- case 0x4d544558: // MTEX textures (strings)
- case 0x4d4d4458: // MMDX m2 models (strings)
- case 0x4d4d4944: // MMID offsets for strings in MMDX
- case 0x4d574944: // MWID offsets for strings in MWMO
- case 0x4d444446: // MDDF
- case 0x4d46424f: // MFBO new in BC
- case 0x4d48324f: // MH2O new in WotLK
- break;
- default:
- {
- // mf.seekRelative(-3);
- printf("Unhandled map chunk: %u\n",fourcc);
- break;
+ k = k + 120;
+ }
}
+ delete LiqOffsData;
+ delete LiqChunkData1;
+ delete []ChunkLiqHeight;
+
}
+ //case 0x4d434e4b: // MCNK
+ //case 0x4d46424f: // MFBO new in BC
+ //case 0x4d545846: // MTXF new in WotLK
mf.seek(nextpos);
}
//printf("Loading chunks info\n");
// read individual map chunks
- for (int j=0; j<16; j++)
- for (int i=0; i<16; i++)
+ chunk_num = 0;
+ k = 0;
+ m = 0;
+ for (int j = 0; j < 16; ++j)
+ {
+ for (int i = 0; i < 16; ++i)
{
- mf.seek((int)mcnk_offsets[j*16+i]);
- LoadMapChunk(mf,&(mcells->ch[i][j]));
+ mf.seek((int)mcnk_offsets[j * 16 + i]);
+ LoadMapChunk(mf, &(mcells->ch[i][j]));
+ ++chunk_num;
}
-
- /*
- for(uint32 t=0;t<wmo_count ;t++)
- {
- wmois[t].draw();
- }*/
-
+ }
mf.close();
return true;
}
-struct MapChunkHeader {
- uint32 flags;
- uint32 ix;
- uint32 iy;
- uint32 nLayers;
- uint32 nDoodadRefs;
- uint32 ofsHeight;
- uint32 ofsNormal;
- uint32 ofsLayer;
- uint32 ofsRefs;
- uint32 ofsAlpha;
- uint32 sizeAlpha;
- uint32 ofsShadow;
- uint32 sizeShadow;
- uint32 areaid;
- uint32 nMapObjRefs;
- uint32 holes;
- uint16 s1;
- uint16 s2;
- uint32 d1;
- uint32 d2;
- uint32 d3;
- uint32 predTex;
- uint32 nEffectDoodad;
- uint32 ofsSndEmitters;
- uint32 nSndEmitters;
- uint32 ofsLiquid;
- uint32 sizeLiquid;
- float zpos;
- float xpos;
- float ypos;
- uint32 textureId;
- uint32 props;
- uint32 effectId;
-};
-
bool isHole(int holes, int i, int j)
{
- int testi = i/2;
- int testj = j/4;
- if(testi>3) testi = 3;
- if(testj>3) testj = 3;
- return (holes & holetab_h[testi] & holetab_v[testj])!=0;
+ int testi = i / 2;
+ int testj = j / 4;
+ if(testi > 3) testi = 3;
+ if(testj > 3) testj = 3;
+ return (holes & holetab_h[testi] & holetab_v[testj]) != 0;
}
-inline
-void LoadMapChunk(MPQFile & mf, chunk*_chunk)
+inline void LoadMapChunk(MPQFile &mf, chunk *_chunk)
{
float h;
uint32 fourcc;
@@ -207,298 +191,191 @@ void LoadMapChunk(MPQFile & mf, chunk*_chunk)
mf.read(&size, 4);
size_t lastpos = mf.getPos() + size;
- mf.read(&header, 0x80);
- _chunk->area_id =header.areaid ;
- _chunk->flag =0;
+ mf.read(&header, 0x80); // what if header size got changed?
+ _chunk->area_id = header.areaid;
float xbase = header.xpos;
float ybase = header.ypos;
float zbase = header.zpos;
- zbase = TILESIZE*32-zbase;
- xbase = TILESIZE*32-xbase;
- if(wmoc.x >xbase)wmoc.x =xbase;
- if(wmoc.z >zbase)wmoc.z =zbase;
+ zbase = TILESIZE * 32 - zbase;
+ xbase = TILESIZE * 32 - xbase;
+ if(wmoc.x > xbase) wmoc.x = xbase;
+ if(wmoc.z > zbase) wmoc.z = zbase;
int chunkflags = header.flags;
- float zmin=999999999.0f;
- float zmax=-999999999.0f;
- //must be there, bl!zz uses some crazy format
- int nTextures;
+ //printf("LMC: flags %X\n", chunkflags);
+ float zmin = 999999999.0f;
+ float zmax = -999999999.0f;
+ // must be there, bl!zz uses some crazy format
while (mf.getPos() < lastpos)
{
- mf.read(&fourcc,4);
+ mf.read(&fourcc, 4);
mf.read(&size, 4);
- //if(size!=580)
- // printf("\n sz=%d",size);
- size_t nextpos = mf.getPos() + size;
- if(fourcc==0x4d435654) // MCVT
+ size_t nextpos = mf.getPos() + size;
+ if(fourcc == 0x4d435654) // MCVT
{
- for (int j=0; j<17; j++)
- for (int i=0; i<((j%2)?8:9); i++)
+ for (int j = 0; j < 17; ++j)
+ {
+ for (int i = 0; i < ((j % 2) ? 8 : 9); ++i)
{
- mf.read(&h,4);
- float z=h+ybase;
- if (j%2)
+ mf.read(&h, 4);
+ float z = h + ybase;
+ if (j % 2)
{
- if(isHole(header.holes,i,j))
- _chunk->v8[i][j/2] = -1000;
+ if(isHole(header.holes, i, j))
+ _chunk->v8[i][j / 2] = -1000;
else
- _chunk->v8[i][j/2] = z;
+ _chunk->v8[i][j / 2] = z;
}
else
{
- if(isHole(header.holes,i,j))
- _chunk->v9[i][j/2] = -1000;
+ if(isHole(header.holes, i, j))
+ _chunk->v9[i][j / 2] = -1000;
else
- _chunk->v9[i][j/2] = z;
+ _chunk->v9[i][j / 2] = z;
}
- if(z>zmax)zmax=z;
- //if(z<zmin)zmin=z;
+ if(z > zmax) zmax = z;
+ //if(z < zmin) zmin = z;
}
+ }
}
- else if(fourcc==0x4d434e52) // MCNR
+ else if(fourcc == 0x4d434e52) // MCNR
{
- nextpos = mf.getPos() + 0x1C0; // size fix
+ nextpos = mf.getPos() + 0x1C0; // size fix
}
- else if(fourcc==0x4d434c51) // MCLQ
+ else if(fourcc == 0x4d434c51) // íå áóäå?ó÷èòûâàò?åñëè óæ?áûëè äàííûå ?MH2O, ïåðåñòðàõîâê?:) // MCLQ
{
// liquid / water level
- //bool haswater;
char fcc1[5];
- mf.read(fcc1,4);
+ mf.read(fcc1, 4);
flipcc(fcc1);
- fcc1[4]=0;
+ fcc1[4] = 0;
+ float *ChunkLiqHeight = new float[81];
- if (!strcmp(fcc1,"MCSE"))
+ if (!strcmp(fcc1, "MCSE"))
{
- for(int i=0;i<9;i++)
- for(int j=0;j<9;j++)
- _chunk->waterlevel[i][j]=-999999; // no liquid/water
+ for(int j = 0; j < 81; ++j)
+ {
+ ChunkLiqHeight[j] = -999999; // no liquid/water
+ }
}
else
{
float maxheight;
mf.read(&maxheight, 4);
+ for(int j = 0; j < 81; ++j)
+ {
+ LiqData liq;
+ mf.read(&liq, 8);
- for(int j=0;j<9;j++)
- for(int i=0;i<9;i++)
- {
- mf.read(&h, 4);
- mf.read(&h, 4);
- if(h > maxheight)
- _chunk->waterlevel[i][j]=-999999;
- else
- _chunk->waterlevel[i][j]=h;
- }
+ if(liq.height > maxheight)
+ ChunkLiqHeight[j] = -999999;
+ else
+ ChunkLiqHeight[j] = h;
+ }
if(chunkflags & 4 || chunkflags & 8)
- _chunk->flag |=1;
+ MapLiqFlag[chunk_num] |= 1; // water
if(chunkflags & 16)
- _chunk->flag |=2;
-
+ MapLiqFlag[chunk_num] |= 2; // magma/slime
+ }
+ // àïîëíå?òà?æå êà??MH2O
+ if(!(chunk_num % 16))
+ m = 1024 * (chunk_num / 16);
+ k = m + (chunk_num % 16) * 8;
+
+ for(int p = 0; p < 72; p += 9)
+ {
+ for(int s = 0; s < 8; ++s)
+ {
+ MapLiqHeight[k] = ChunkLiqHeight[p + s];
+ ++k;
+ }
+ k = k + 120;
}
+ delete []ChunkLiqHeight;
break;
}
- else if (fourcc==0x4d434c59) // MCLY
- {
- // texture info
- nTextures = (int)size;
- }
- else if (fourcc==0x4d43414c) // MCAL
- {
- if (nTextures<=0)
- continue;
- }
-
mf.seek(nextpos);
}
}
-double solve (vec *v,vec *p)
+inline void TransformData()
{
- double a = v[0].y *(v[1].z - v[2].z) + v[1].y *(v[2].z - v[0].z) + v[2].y *(v[0].z - v[1].z);
- double b = v[0].z *(v[1].x - v[2].x) + v[1].z *(v[2].x - v[0].x) + v[2].z *(v[0].x - v[1].x);
- double c = v[0].x *(v[1].y - v[2].y) + v[1].x *(v[2].y - v[0].y) + v[2].x *(v[0].y - v[1].y);
- double d = v[0].x *(v[1].y*v[2].z - v[2].y*v[1].z) + v[1].x* (v[2].y*v[0].z - v[0].y*v[2].z) + v[2].x* (v[0].y*v[1].z - v[1].y*v[0].z);
- //-d
-
- //plane equation ax+by+cz+d=0
- return ((a*p->x+c*p->z-d)/b);
-}
-
-inline
-double GetZ(double x,double z)
-{
- vec v[3];
- vec p;
-
- //bool inWMO=false;
+ cell = new Cell;
- //if(!inWMO)
+ for(uint32 x = 0; x < 128; ++x)
{
- //find out quadrant
- int xc=(int)(x/UNITSIZE);
- int zc=(int)(z/UNITSIZE);
- if(xc>127)xc=127;
- if(zc>127)zc=127;
-
- double lx=x-xc*UNITSIZE;
- double lz=z-zc*UNITSIZE;
- p.x=lx;
- p.z=lz;
-
- v[0].x=UNITSIZE/2;
- v[0].y =cell->v8[xc][zc];
- v[0].z=UNITSIZE/2;
-
- if(lx>lz)
+ for(uint32 y = 0; y < 128; ++y)
{
- v[1].x=UNITSIZE;
- v[1].y =cell->v9[xc+1][zc];
- v[1].z=0;
- }
- else
- {
- v[1].x=0.0;
- v[1].y =cell->v9[xc][zc+1];
- v[1].z=UNITSIZE;
- }
-
- if(lz>UNITSIZE-lx)
- {
- v[2].x=UNITSIZE;
- v[2].y =cell->v9[xc+1][zc+1];
- v[2].z=UNITSIZE;
- }
- else
- {
- v[2].x=0;
- v[2].y=cell->v9[xc][zc];
- v[2].z=0;
+ cell->v8[y][x] = (float)mcells->ch[x / 8][y / 8].v8[x % 8][y % 8];
+ cell->v9[y][x] = (float)mcells->ch[x / 8][y / 8].v9[x % 8][y % 8];
}
- return -solve(v,&p);
+ // extra 1 point on bounds
+ cell->v9[128][x] = (float)mcells->ch[x / 8][15].v9[x % 8][8];
+ // x == y
+ cell->v9[x][128] = (float)mcells->ch[15][x / 8].v9[8][x % 8];
}
-}
-
-inline
-void TransformWaterData()
-{
- cell= new Cell;
- for(int x=0;x<128;x++)
- for(int y=0;y<128;y++)
- cell->v9[x][y] = mcells->ch[x/8][y/8].waterlevel[x%8][y%8];
-
- //and the last 1
- cell->v9[128][128] = mcells->ch[15][15].waterlevel[8][8];
-}
-
-inline
-void TransformData()
-{
- cell= new Cell;
-
- for(int x=0;x<128;x++)
- {
- for(int y=0;y<128;y++)
- {
- cell->v8[y][x] = (float)mcells->ch[x/8][y/8].v8[x%8][y%8];
- cell->v9[y][x] = (float)mcells->ch[x/8][y/8].v9[x%8][y%8];
- }
-
- //extra 1 point on bounds
- cell->v9[128][x] = (float)mcells->ch[x/8][15].v9[x%8][8];
- //x==y
- cell->v9[x][128] = (float)mcells->ch[15][x/8].v9[8][x%8];
- }
-
- //and the last 1
+ // and the last 1
cell->v9[128][128] = (float)mcells->ch[15][15].v9[8][8];
delete mcells;
}
-const char MAP_MAGIC[] = "MAP_2.50";
+const char MAP_MAGIC[] = "MAP_3.00";
-bool ConvertADT(char * filename,char * filename2)
+bool ConvertADT(char *filename, char *filename2)
{
- //if(!strstr(filename,"oth_32_48"))return false;
if(!LoadADT(filename))
return false;
- FILE *output=fopen(filename2,"wb");
+ FILE *output=fopen(filename2, "wb");
if(!output)
{
- printf("Can't create the output file '%s'\n",filename2);
+ printf("Can't create the output file '%s'\n", filename2);
+ delete [] MapLiqHeight;
+ delete [] MapLiqFlag;
return false;
}
// write magic header
- fwrite(MAP_MAGIC,1,8,output);
+ fwrite(MAP_MAGIC, 1, 8, output);
- for(unsigned int x=0;x<16;x++)
+ for(uint32 x = 0; x < 16; ++x)
{
- for(unsigned int y=0;y<16;y++)
+ for(uint32 y = 0; y < 16; ++y)
{
- if(mcells->ch[y][x].area_id && mcells->ch[y][x].area_id < 0x102D)
+ if(mcells->ch[y][x].area_id && mcells->ch[y][x].area_id <= maxAreaId)
{
- if(areas[mcells->ch[y][x].area_id]==0xffff)
- printf("\nCan't find area flag for areaid %u.\n",mcells->ch[y][x].area_id);
+ if(areas[mcells->ch[y][x].area_id] == 0xffff)
+ printf("\nCan't find area flag for areaid %u.\n", mcells->ch[y][x].area_id);
- fwrite(&areas[mcells->ch[y][x].area_id],1,2,output);
+ fwrite(&areas[mcells->ch[y][x].area_id], 1, 2, output);
}
else
{
- uint16 flag=0xffff;
- fwrite(&flag,1,2,output);
+ uint16 flag = 0xffff;
+ fwrite(&flag, 1, 2, output);
}
}
}
- for(unsigned int x=0;x<16;x++)
- for(unsigned int y=0;y<16;y++)
- fwrite(&mcells->ch[y][x].flag,1,1,output);
-
- TransformWaterData();
+ fwrite(MapLiqFlag, 1, 256, output);
+ delete [] MapLiqFlag;
- for(unsigned int x=0;x<128;x++)
- for(unsigned int y=0;y<128;y++)
- fwrite(&cell->v9[y][x],1,sizeof(float),output);
+ fwrite(MapLiqHeight, sizeof(float), 16384, output);
+ delete [] MapLiqHeight;
- delete cell;
TransformData();
- /*
- for(unsigned int x=0;x<iRes;x++)
- for(unsigned int y=0;y<iRes;y++)
- {
- float z=(float)GetZ(
- (((double)(y))*TILESIZE)/((double)(iRes-1)),
- (((double)(x))*TILESIZE)/((double)(iRes-1)));
-
- fwrite(&z,1,sizeof(z),output);
- }*/
fwrite(&cell->v9, 1, sizeof(cell->v9), output);
fwrite(&cell->v8, 1, sizeof(cell->v8), output);
fclose(output);
delete cell;
-/*
- for (std::vector<std::string>::iterator it = wmos.begin(); it != wmos.end(); ++it)
- wmomanager.delbyname(*it);
-
- wmos.clear();
- wmois.clear();
-
- for (std::vector<model>::iterator it = wmomodel.begin(); it != wmomodel.end(); ++it)
- {
- it->tr.clear();
-
- }
- //printf("\n %d \n",in);
- wmomodel.clear();
- //polygons.clear();*/
+
return true;
}
diff --git a/contrib/extractor/adt.h b/contrib/extractor/adt.h
index 9af85b14d8c..516ed88a86e 100644
--- a/contrib/extractor/adt.h
+++ b/contrib/extractor/adt.h
@@ -9,47 +9,122 @@ typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
class Liquid;
-typedef struct {
-float x;
-float y;
-float z;
-}svec;
-
-typedef struct {
-double x;
-double y;
-double z;
-}vec;
-
-typedef struct{
+typedef struct
+{
+ float x;
+ float y;
+ float z;
+} svec;
+
+typedef struct
+{
+ double x;
+ double y;
+ double z;
+} vec;
+
+typedef struct
+{
vec v[3];
-}triangle;
+} triangle;
+
+typedef struct
+{
+ float v9[16 * 8 + 1][16 * 8 + 1];
+ float v8[16 * 8][16 * 8];
+} Cell;
+
+typedef struct
+{
+ double v9[9][9];
+ double v8[8][8];
+ uint16 area_id;
+} chunk;
-typedef struct{
-float v9[16*8+1][16*8+1];
-float v8[16*8][16*8];
-}Cell;
+typedef struct
+{
+ chunk ch[16][16];
+} mcell;
-typedef struct{
-double v9[9][9];
-double v8[8][8];
-uint16 area_id;
-//Liquid *lq;
-float waterlevel[9][9];
-uint8 flag;
-}chunk;
+struct MapChunkHeader
+{
+ uint32 flags;
+ uint32 ix;
+ uint32 iy;
+ uint32 nLayers;
+ uint32 nDoodadRefs;
+ uint32 ofsHeight;
+ uint32 ofsNormal;
+ uint32 ofsLayer;
+ uint32 ofsRefs;
+ uint32 ofsAlpha;
+ uint32 sizeAlpha;
+ uint32 ofsShadow;
+ uint32 sizeShadow;
+ uint32 areaid;
+ uint32 nMapObjRefs;
+ uint32 holes;
+ uint16 s1;
+ uint16 s2;
+ uint32 d1;
+ uint32 d2;
+ uint32 d3;
+ uint32 predTex;
+ uint32 nEffectDoodad;
+ uint32 ofsSndEmitters;
+ uint32 nSndEmitters;
+ uint32 ofsLiquid; // not use in WotLK
+ uint32 sizeLiquid; // not use in WotLK
+ float zpos;
+ float xpos;
+ float ypos;
+ uint32 textureId; // new offsColorValues in WotLK
+ uint32 props;
+ uint32 effectId;
+};
-class WMO;
-class WMOManager;
-void fixname(std::string &name);
+typedef struct
+{
+ uint32 offsData1;
+ uint32 used;
+ uint32 offsData2;
+} MH2O_offsData;
typedef struct
{
-chunk ch[16][16];
-}mcell;
+ uint16 LiquidTypeId;
+ uint16 type;
+ float heightLevel1;
+ float heightLevel2;
+ uint8 xOffset;
+ uint8 yOffset;
+ uint8 width;
+ uint8 height;
+ uint32 ofsData2a;
+ uint32 ofsData2b;
+} MH2O_Data1;
+
+typedef struct
+{
+ uint16 unk1;
+ uint16 unk2;
+ float height;
+} LiqData;
+
+enum LiquidType
+{
+ LIQUID_TYPE_WATER = 0,
+ LIQUID_TYPE_OCEAN = 1,
+ LIQUID_TYPE_MAGMA = 2,
+ LIQUID_TYPE_SLIME = 3
+};
+
class MPQFile;
-void LoadMapChunk(MPQFile &,chunk*);
-bool LoadWMO(char* filename);
+
+float *MapLiqHeight;
+uint8 *MapLiqFlag;
+uint32 k, m, chunk_num;
+void LoadMapChunk(MPQFile &, chunk*);
#endif
diff --git a/contrib/extractor/dbcfile.cpp b/contrib/extractor/dbcfile.cpp
index dbe379d27f7..dd58ac1b4a6 100644
--- a/contrib/extractor/dbcfile.cpp
+++ b/contrib/extractor/dbcfile.cpp
@@ -9,29 +9,42 @@ DBCFile::DBCFile(const std::string &filename):
{
}
-void DBCFile::open()
+bool DBCFile::open()
{
MPQFile f(filename.c_str());
char header[4];
unsigned int na,nb,es,ss;
- f.read(header,4); // Number of records
- assert(header[0]=='W' && header[1]=='D' && header[2]=='B' && header[3] == 'C');
- f.read(&na,4); // Number of records
- f.read(&nb,4); // Number of fields
- f.read(&es,4); // Size of a record
- f.read(&ss,4); // String size
+ if(f.read(header,4)!=4) // Number of records
+ return false;
+
+ if(header[0]!='W' || header[1]!='D' || header[2]!='B' || header[3]!='C')
+ return false;
+
+ if(f.read(&na,4)!=4) // Number of records
+ return false;
+ if(f.read(&nb,4)!=4) // Number of fields
+ return false;
+ if(f.read(&es,4)!=4) // Size of a record
+ return false;
+ if(f.read(&ss,4)!=4) // String size
+ return false;
recordSize = es;
recordCount = na;
fieldCount = nb;
stringSize = ss;
- assert(fieldCount*4 == recordSize);
+ if(fieldCount*4 != recordSize)
+ return false;
data = new unsigned char[recordSize*recordCount+stringSize];
stringTable = data + recordSize*recordCount;
- f.read(data,recordSize*recordCount+stringSize);
+
+ size_t data_size = recordSize*recordCount+stringSize;
+ if(f.read(data,data_size)!=data_size)
+ return false;
f.close();
+ return true;
}
DBCFile::~DBCFile()
{
diff --git a/contrib/extractor/dbcfile.h b/contrib/extractor/dbcfile.h
index 7d709e80948..aef61df7aaa 100644
--- a/contrib/extractor/dbcfile.h
+++ b/contrib/extractor/dbcfile.h
@@ -10,7 +10,7 @@ public:
~DBCFile();
// Open database. It must be openened before it can be used.
- void open();
+ bool open();
// Database exceptions
class Exception
diff --git a/contrib/extractor/libmpq/CMakeLists.txt b/contrib/extractor/libmpq/CMakeLists.txt
new file mode 100644
index 00000000000..c00120c6e48
--- /dev/null
+++ b/contrib/extractor/libmpq/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
+#
+# 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 (libmpq common.cpp explode.cpp extract.cpp huffman.cpp mpq.cpp parser.cpp wave.cpp )
+# link libmpq with zlib
+target_link_libraries (libmpq z)
diff --git a/contrib/extractor/libmpq/Makefile b/contrib/extractor/libmpq/Makefile
deleted file mode 100644
index eb1965e29f1..00000000000
--- a/contrib/extractor/libmpq/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-CC = g++
-AR = ar
-objects = common.o explode.o extract.o huffman.o wave.o mpq.o parser.o
-zlib_objects = ../../../dep/src/zlib/*.o #adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o inftrees.o inffast.o
-
-all: libmpq.a libmpq.so
-
-clean:
- rm -f libmpq.a libmpq.so *.o
-
-libmpq.a: $(objects) $(zlib_objects)
- $(AR) cru $@ $+
-libmpq.so: $(objects) $(zlib_objects)
- $(CC) -fPIC -o $@ $+
-
-%.o:%.cpp
- $(CC) -I../ -c $+
diff --git a/contrib/extractor/libmpq/mpq.cpp b/contrib/extractor/libmpq/mpq.cpp
index eddd92ac483..a59d3dff2f1 100644
--- a/contrib/extractor/libmpq/mpq.cpp
+++ b/contrib/extractor/libmpq/mpq.cpp
@@ -199,7 +199,7 @@ int libmpq_archive_info(mpq_archive *mpq_a, unsigned int infotype) {
/*
* This function returns some useful file information.
*/
-int libmpq_file_info(mpq_archive *mpq_a, unsigned int infotype, const int unsigned number) {
+int libmpq_file_info(mpq_archive *mpq_a, unsigned int infotype, const unsigned int number) {
int blockindex = number; //-1;
int i = 0;
mpq_block *mpq_b = NULL;
diff --git a/contrib/extractor/loadlib/CMakeLists.txt b/contrib/extractor/loadlib/CMakeLists.txt
new file mode 100644
index 00000000000..5680c61d424
--- /dev/null
+++ b/contrib/extractor/loadlib/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
+#
+# 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 (loadlib loadlib.cpp adt.cpp wdt.cpp)
+# link loadlib with zlib
+target_link_libraries (loadlib z)
diff --git a/contrib/extractor/loadlib/adt.cpp b/contrib/extractor/loadlib/adt.cpp
new file mode 100644
index 00000000000..fde70681113
--- /dev/null
+++ b/contrib/extractor/loadlib/adt.cpp
@@ -0,0 +1,131 @@
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "adt.h"
+
+// Helper
+int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888};
+int holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000};
+
+bool isHole(int holes, int i, int j)
+{
+ int testi = i / 2;
+ int testj = j / 4;
+ if(testi > 3) testi = 3;
+ if(testj > 3) testj = 3;
+ return (holes & holetab_h[testi] & holetab_v[testj]) != 0;
+}
+
+//
+// Adt file loader class
+//
+ADT_file::ADT_file()
+{
+ a_grid = 0;
+}
+
+ADT_file::~ADT_file()
+{
+ free();
+}
+
+void ADT_file::free()
+{
+ a_grid = 0;
+ FileLoader::free();
+}
+
+//
+// Adt file check function
+//
+bool ADT_file::prepareLoadedData()
+{
+ // Check parent
+ if (!FileLoader::prepareLoadedData())
+ return false;
+
+ // Check and prepare MHDR
+ a_grid = (adt_MHDR *)(GetData()+8+version->size);
+ if (!a_grid->prepareLoadedData())
+ return false;
+
+ return true;
+}
+
+bool adt_MHDR::prepareLoadedData()
+{
+ if (fcc != 'MHDR')
+ return false;
+
+ if (size!=sizeof(adt_MHDR)-8)
+ return false;
+
+ // Check and prepare MCIN
+ if (offsMCIN && !getMCIN()->prepareLoadedData())
+ return false;
+
+ // Check and prepare MH2O
+ if (offsMH2O && !getMH2O()->prepareLoadedData())
+ return false;
+
+ return true;
+}
+
+bool adt_MCIN::prepareLoadedData()
+{
+ if (fcc != 'MCIN')
+ return false;
+
+ // Check cells data
+ for (int i=0; i<ADT_CELLS_PER_GRID;i++)
+ for (int j=0; j<ADT_CELLS_PER_GRID;j++)
+ if (cells[i][j].offsMCNK && !getMCNK(i,j)->prepareLoadedData())
+ return false;
+
+ return true;
+}
+
+bool adt_MH2O::prepareLoadedData()
+{
+ if (fcc != 'MH2O')
+ return false;
+
+ // Check liquid data
+// for (int i=0; i<ADT_CELLS_PER_GRID;i++)
+// for (int j=0; j<ADT_CELLS_PER_GRID;j++)
+
+ return true;
+}
+
+bool adt_MCNK::prepareLoadedData()
+{
+ if (fcc != 'MCNK')
+ return false;
+
+ // Check height map
+ if (offsMCVT && !getMCVT()->prepareLoadedData())
+ return false;
+ // Check liquid data
+ if (offsMCLQ && !getMCLQ()->prepareLoadedData())
+ return false;
+
+ return true;
+}
+
+bool adt_MCVT::prepareLoadedData()
+{
+ if (fcc != 'MCVT')
+ return false;
+
+ if (size != sizeof(adt_MCVT)-8)
+ return false;
+
+ return true;
+}
+
+bool adt_MCLQ::prepareLoadedData()
+{
+ if (fcc != 'MCLQ')
+ return false;
+
+ return true;
+} \ No newline at end of file
diff --git a/contrib/extractor/loadlib/adt.h b/contrib/extractor/loadlib/adt.h
new file mode 100644
index 00000000000..725c5b994ee
--- /dev/null
+++ b/contrib/extractor/loadlib/adt.h
@@ -0,0 +1,289 @@
+#ifndef ADT_H
+#define ADT_H
+
+#include "loadlib.h"
+
+#define TILESIZE (533.33333f)
+#define CHUNKSIZE ((TILESIZE) / 16.0f)
+#define UNITSIZE (CHUNKSIZE / 8.0f)
+
+enum LiquidType
+{
+ LIQUID_TYPE_WATER = 0,
+ LIQUID_TYPE_OCEAN = 1,
+ LIQUID_TYPE_MAGMA = 2,
+ LIQUID_TYPE_SLIME = 3
+};
+
+//**************************************************************************************
+// ADT file class
+//**************************************************************************************
+#define ADT_CELLS_PER_GRID 16
+#define ADT_CELL_SIZE 8
+#define ADT_GRID_SIZE (ADT_CELLS_PER_GRID*ADT_CELL_SIZE)
+
+//
+// Adt file height map chunk
+//
+class adt_MCVT
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+public:
+ float height_map[(ADT_CELL_SIZE+1)*(ADT_CELL_SIZE+1)+ADT_CELL_SIZE*ADT_CELL_SIZE];
+
+ bool prepareLoadedData();
+};
+
+//
+// Adt file liquid map chunk (old)
+//
+class adt_MCLQ
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+public:
+ float height1;
+ float height2;
+ struct liquid_data{
+ uint32 light;
+ float height;
+ } liquid[ADT_CELL_SIZE+1][ADT_CELL_SIZE+1];
+
+ // 1<<0 - ochen
+ // 1<<1 - lava/slime
+ // 1<<2 - water
+ // 1<<6 - all water
+ // 1<<7 - dark water
+ // == 0x0F - not show liquid
+ uint8 flags[ADT_CELL_SIZE][ADT_CELL_SIZE];
+ uint8 data[84];
+ bool prepareLoadedData();
+};
+
+//
+// Adt file cell chunk
+//
+class adt_MCNK
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+public:
+ uint32 flags;
+ uint32 ix;
+ uint32 iy;
+ uint32 nLayers;
+ uint32 nDoodadRefs;
+ uint32 offsMCVT; // height map
+ uint32 offsMCNR; // Normal vectors for each vertex
+ uint32 offsMCLY; // Texture layer definitions
+ uint32 offsMCRF; // A list of indices into the parent file's MDDF chunk
+ uint32 offsMCAL; // Alpha maps for additional texture layers
+ uint32 sizeMCAL;
+ uint32 offsMCSH; // Shadow map for static shadows on the terrain
+ uint32 sizeMCSH;
+ uint32 areaid;
+ uint32 nMapObjRefs;
+ uint32 holes;
+ uint16 s[2];
+ uint32 data1;
+ uint32 data2;
+ uint32 data3;
+ uint32 predTex;
+ uint32 nEffectDoodad;
+ uint32 offsMCSE;
+ uint32 nSndEmitters;
+ uint32 offsMCLQ; // Liqid level (old)
+ uint32 sizeMCLQ; //
+ float zpos;
+ float xpos;
+ float ypos;
+ uint32 offsMCCV; // offsColorValues in WotLK
+ uint32 props;
+ uint32 effectId;
+
+ bool prepareLoadedData();
+ adt_MCVT *getMCVT()
+ {
+ if (offsMCVT)
+ return (adt_MCVT *)((uint8 *)this + offsMCVT);
+ return 0;
+ }
+ adt_MCLQ *getMCLQ()
+ {
+ if (offsMCLQ)
+ return (adt_MCLQ *)((uint8 *)this + offsMCLQ);
+ return 0;
+ }
+};
+
+//
+// Adt file grid chunk
+//
+class adt_MCIN
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+public:
+ struct adt_CELLS{
+ uint32 offsMCNK;
+ uint32 size;
+ uint32 flags;
+ uint32 asyncId;
+ } cells[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
+
+ bool prepareLoadedData();
+ // offset from begin file (used this-84)
+ adt_MCNK *getMCNK(int x, int y)
+ {
+ if (cells[x][y].offsMCNK)
+ return (adt_MCNK *)((uint8 *)this + cells[x][y].offsMCNK - 84);
+ return 0;
+ }
+};
+
+#define ADT_LIQUID_HEADER_FULL_LIGHT 0x01
+#define ADT_LIQUID_HEADER_NO_HIGHT 0x02
+
+struct adt_liquid_header{
+ uint16 liquidType; // Index from LiquidType.dbc
+ uint16 formatFlags;
+ float heightLevel1;
+ float heightLevel2;
+ uint8 xOffset;
+ uint8 yOffset;
+ uint8 width;
+ uint8 height;
+ uint32 offsData2a;
+ uint32 offsData2b;
+};
+
+//
+// Adt file liquid data chunk (new)
+//
+class adt_MH2O
+{
+public:
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+
+ struct adt_LIQUID{
+ uint32 offsData1;
+ uint32 used;
+ uint32 offsData2;
+ } liquid[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
+
+ bool prepareLoadedData();
+
+ adt_liquid_header *getLiquidData(int x, int y)
+ {
+ if (liquid[x][y].used && liquid[x][y].offsData1)
+ return (adt_liquid_header *)((uint8*)this + 8 + liquid[x][y].offsData1);
+ return 0;
+ }
+
+ float *getLiquidHeightMap(adt_liquid_header *h)
+ {
+ if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
+ return 0;
+ if (h->offsData2b)
+ return (float *)((uint8*)this + 8 + h->offsData2b);
+ return 0;
+ }
+
+ uint8 *getLiquidLightMap(adt_liquid_header *h)
+ {
+ if (h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT)
+ return 0;
+ if (h->offsData2b)
+ {
+ if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
+ return (uint8 *)((uint8*)this + 8 + h->offsData2b);
+ return (uint8 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4);
+ }
+ return 0;
+ }
+
+ uint32 *getLiquidFullLightMap(adt_liquid_header *h)
+ {
+ if (!(h->formatFlags&ADT_LIQUID_HEADER_FULL_LIGHT))
+ return 0;
+ if (h->offsData2b)
+ {
+ if (h->formatFlags & ADT_LIQUID_HEADER_NO_HIGHT)
+ return (uint32 *)((uint8*)this + 8 + h->offsData2b);
+ return (uint32 *)((uint8*)this + 8 + h->offsData2b + (h->width+1)*(h->height+1)*4);
+ }
+ return 0;
+ }
+
+ uint64 getLiquidShowMap(adt_liquid_header *h)
+ {
+ if (h->offsData2a)
+ return *((uint64 *)((uint8*)this + 8 + h->offsData2a));
+ else
+ return 0xFFFFFFFFFFFFFFFFLL;
+ }
+
+};
+
+//
+// Adt file header chunk
+//
+class adt_MHDR
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+
+ uint32 pad;
+ uint32 offsMCIN; // MCIN
+ uint32 offsTex; // MTEX
+ uint32 offsModels; // MMDX
+ uint32 offsModelsIds; // MMID
+ uint32 offsMapObejcts; // MWMO
+ uint32 offsMapObejctsIds; // MWID
+ uint32 offsDoodsDef; // MDDF
+ uint32 offsObjectsDef; // MODF
+ uint32 offsMFBO; // MFBO
+ uint32 offsMH2O; // MH2O
+ uint32 data1;
+ uint32 data2;
+ uint32 data3;
+ uint32 data4;
+ uint32 data5;
+public:
+ bool prepareLoadedData();
+ adt_MCIN *getMCIN(){ return (adt_MCIN *)((uint8 *)&pad+offsMCIN);}
+ adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : 0;}
+
+};
+
+class ADT_file : public FileLoader{
+public:
+ bool prepareLoadedData();
+ ADT_file();
+ ~ADT_file();
+ void free();
+
+ adt_MHDR *a_grid;
+};
+
+#endif
diff --git a/contrib/extractor/loadlib/loadlib.cpp b/contrib/extractor/loadlib/loadlib.cpp
new file mode 100644
index 00000000000..ed5bd9acb71
--- /dev/null
+++ b/contrib/extractor/loadlib/loadlib.cpp
@@ -0,0 +1,64 @@
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "loadlib.h"
+#include "../mpq_libmpq.h"
+
+class MPQFile;
+
+FileLoader::FileLoader()
+{
+ data = 0;
+ data_size = 0;
+ version = 0;
+}
+
+FileLoader::~FileLoader()
+{
+ free();
+}
+
+bool FileLoader::loadFile(char *filename, bool log)
+{
+ free();
+ MPQFile mf(filename);
+ if(mf.isEof())
+ {
+ if (log)
+ printf("No such file %s\n", filename);
+ return false;
+ }
+
+ data_size = mf.getSize();
+
+ data = new uint8 [data_size];
+ if (data)
+ {
+ mf.read(data, data_size);
+ mf.close();
+ if (prepareLoadedData())
+ return true;
+ }
+ printf("Error loading %s", filename);
+ mf.close();
+ free();
+ return false;
+}
+
+bool FileLoader::prepareLoadedData()
+{
+ // Check version
+ version = (file_MVER *) data;
+ if (version->fcc != 'MVER')
+ return false;
+ if (version->ver != FILE_FORMAT_VERSION)
+ return false;
+ return true;
+}
+
+void FileLoader::free()
+{
+ if (data) delete[] data;
+ data = 0;
+ data_size = 0;
+ version = 0;
+} \ No newline at end of file
diff --git a/contrib/extractor/loadlib/loadlib.h b/contrib/extractor/loadlib/loadlib.h
new file mode 100644
index 00000000000..6acfd107ec7
--- /dev/null
+++ b/contrib/extractor/loadlib/loadlib.h
@@ -0,0 +1,57 @@
+#ifndef LOAD_LIB_H
+#define LOAD_LIB_H
+
+#ifdef WIN32
+typedef __int64 int64;
+typedef long int32;
+typedef short int16;
+typedef char int8;
+typedef unsigned __int64 uint64;
+typedef unsigned long uint32;
+typedef unsigned short uint16;
+typedef unsigned char uint8;
+#else
+#include <stdint.h>
+#ifndef uint64_t
+#include <linux/types.h>
+#endif
+typedef int64_t int64;
+typedef long int32;
+typedef short int16;
+typedef char int8;
+typedef uint64_t uint64;
+typedef unsigned long uint32;
+typedef unsigned short uint16;
+typedef unsigned char uint8;
+#endif
+
+#define FILE_FORMAT_VERSION 18
+
+//
+// File version chunk
+//
+struct file_MVER
+{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+ uint32 size;
+ uint32 ver;
+};
+
+class FileLoader{
+ uint8 *data;
+ uint32 data_size;
+public:
+ virtual bool prepareLoadedData();
+ uint8 *GetData() {return data;}
+ uint32 GetDataSize() {return data_size;}
+
+ file_MVER *version;
+ FileLoader();
+ ~FileLoader();
+ bool loadFile(char *filename, bool log = true);
+ virtual void free();
+};
+#endif
diff --git a/contrib/extractor/loadlib/wdt.cpp b/contrib/extractor/loadlib/wdt.cpp
new file mode 100644
index 00000000000..dedefbb64e5
--- /dev/null
+++ b/contrib/extractor/loadlib/wdt.cpp
@@ -0,0 +1,62 @@
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "wdt.h"
+
+bool wdt_MWMO::prepareLoadedData()
+{
+ if (fcc != 'MWMO')
+ return false;
+ return true;
+}
+
+bool wdt_MPHD::prepareLoadedData()
+{
+ if (fcc != 'MPHD')
+ return false;
+ return true;
+}
+
+bool wdt_MAIN::prepareLoadedData()
+{
+ if (fcc != 'MAIN')
+ return false;
+ return true;
+}
+
+WDT_file::WDT_file()
+{
+ mphd = 0;
+ main = 0;
+ wmo = 0;
+}
+
+WDT_file::~WDT_file()
+{
+ free();
+}
+
+void WDT_file::free()
+{
+ mphd = 0;
+ main = 0;
+ wmo = 0;
+ FileLoader::free();
+}
+
+bool WDT_file::prepareLoadedData()
+{
+ // Check parent
+ if (!FileLoader::prepareLoadedData())
+ return false;
+
+ mphd = (wdt_MPHD *)((uint8*)version+version->size+8);
+ if (!mphd->prepareLoadedData())
+ return false;
+ main = (wdt_MAIN *)((uint8*)mphd + mphd->size+8);
+ if (!main->prepareLoadedData())
+ return false;
+ wmo = (wdt_MWMO *)((uint8*)main+ main->size+8);
+ if (!wmo->prepareLoadedData())
+ return false;
+ return true;
+} \ No newline at end of file
diff --git a/contrib/extractor/loadlib/wdt.h b/contrib/extractor/loadlib/wdt.h
new file mode 100644
index 00000000000..fcee8ac64f2
--- /dev/null
+++ b/contrib/extractor/loadlib/wdt.h
@@ -0,0 +1,68 @@
+#ifndef WDT_H
+#define WDT_H
+#include "loadlib.h"
+
+//**************************************************************************************
+// WDT file class and structures
+//**************************************************************************************
+#define WDT_MAP_SIZE 64
+
+class wdt_MWMO{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+public:
+ uint32 size;
+ bool prepareLoadedData();
+};
+
+class wdt_MPHD{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+public:
+ uint32 size;
+
+ uint32 data1;
+ uint32 data2;
+ uint32 data3;
+ uint32 data4;
+ uint32 data5;
+ uint32 data6;
+ uint32 data7;
+ uint32 data8;
+ bool prepareLoadedData();
+};
+
+class wdt_MAIN{
+ union{
+ uint32 fcc;
+ char fcc_txt[4];
+ };
+public:
+ uint32 size;
+
+ struct adtData{
+ uint32 exist;
+ uint32 data1;
+ } adt_list[64][64];
+
+ bool prepareLoadedData();
+};
+
+class WDT_file : public FileLoader{
+public:
+ bool prepareLoadedData();
+
+ WDT_file();
+ ~WDT_file();
+ void free();
+
+ wdt_MPHD *mphd;
+ wdt_MAIN *main;
+ wdt_MWMO *wmo;
+};
+
+#endif \ No newline at end of file
diff --git a/contrib/extractor/mpq_libmpq.h b/contrib/extractor/mpq_libmpq.h
index 97b7b75035b..d61cda7f919 100644
--- a/contrib/extractor/mpq_libmpq.h
+++ b/contrib/extractor/mpq_libmpq.h
@@ -4,6 +4,7 @@
#ifndef MPQ_H
#define MPQ_H
+#include "loadlib/loadlib.h"
#include "libmpq/mpq.h"
#include <string.h>
#include <ctype.h>
@@ -13,7 +14,6 @@
using namespace std;
-typedef unsigned int uint32;
class MPQArchive
{
diff --git a/contrib/vmap_debugger/ModelContainerView.cpp b/contrib/vmap_debugger/ModelContainerView.cpp
index f9b19c2a1fd..fbfa565696f 100644
--- a/contrib/vmap_debugger/ModelContainerView.cpp
+++ b/contrib/vmap_debugger/ModelContainerView.cpp
@@ -451,7 +451,7 @@ namespace VMAP
//====================================================================
- Vector3 ModelContainerView::convertPositionToTrinityRep(float x, float y, float z) const {
+ Vector3 ModelContainerView::convertPositionToMangosRep(float x, float y, float z) const {
float pos[3];
pos[0] = z;
pos[1] = x;
@@ -490,7 +490,7 @@ namespace VMAP
#if 0
i_App->defaultController.getPosition();
Vector3 pos = i_App->defaultController.getPosition();
- Vector3 pos2 = convertPositionToTrinityRep(pos.x, pos.y, pos.z);
+ Vector3 pos2 = convertPositionToMangosRep(pos.x, pos.y, pos.z);
//Vector3 pos3 = iVMapManager->convertPositionToInternalRep(pos2.x, pos2.y, pos2.z);
//pos3 = iVMapManager->convertPositionToInternalRep(pos2.x, pos2.y, pos2.z);
diff --git a/contrib/vmap_extract_assembler_bin/vmap_assembler.exe b/contrib/vmap_extract_assembler_bin/vmap_assembler.exe
index 5cb08f770aa..a6ef74dc086 100644
--- a/contrib/vmap_extract_assembler_bin/vmap_assembler.exe
+++ b/contrib/vmap_extract_assembler_bin/vmap_assembler.exe
Binary files differ
diff --git a/contrib/vmap_extract_assembler_bin/vmapextract_v2.exe b/contrib/vmap_extract_assembler_bin/vmapextract_v2.exe
index c38b6e64f64..a1e982f0cba 100644
--- a/contrib/vmap_extract_assembler_bin/vmapextract_v2.exe
+++ b/contrib/vmap_extract_assembler_bin/vmapextract_v2.exe
Binary files differ
diff --git a/contrib/vmap_extractor_v2/doc/MoPaQ_0.9.txt b/contrib/vmap_extractor_v2/doc/MoPaQ_0.9.txt
deleted file mode 100644
index ce8d8f70166..00000000000
--- a/contrib/vmap_extractor_v2/doc/MoPaQ_0.9.txt
+++ /dev/null
@@ -1,318 +0,0 @@
-THE MOPAQ ARCHIVE FORMAT
-v0.9 (Thursday, June 30, 2005)
-by Justin Olbrantz(Quantam)
-
-Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quoting
-in other works is freely allowed, as long as the source and author of the quote is stated.
-
-TABLE OF CONTENTS
-1. Introduction to the MoPaQ Format
-2. The MoPaQ Format
- 2.1 General Archive Layout
- 2.2 Archive Header
- 2.3 Block Table
- 2.4 Hash Table
- 2.5 File Data
- 2.6 Listfile
- 2.7 Extended Attributes
- 2.8 Weak (Old) Digital Signature
- 2.9 Strong (New) Digital Signature
-3. Algorithm Source Code
- 3.1 Encryption/Decryption
- 3.2 Hashing
- 3.3 Conversion of FILETIME and time_t
-
-1. INTRODUCTION TO THE MOPAQ FORMAT
-The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard
-Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be
-a read-only game archive format, and excels at this role.
-
-The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked.
-The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
-
-2. THE MOPAQ FORMAT
-All numbers in the MoPaQ format are in little endian. Data types are listed either as int (integer, the number of bits specified),
-byte (8 bits), and char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise.
-Structure members are listed in the following general form:
-offset from the beginning of the structure: data type(array size) member name : member description
-
-2.1 GENERAL ARCHIVE LAYOUT
-- Archive Header
-- File Data
-- File Data - Special Files
-- Hash Table
-- Block Table
-- Strong Digital signature
-
-This is the usual archive format, and is not absolutely essential. Some archives have been observed placing the hash table
-and file table after the archive header, and before the file data.
-
-2.2 ARCHIVE HEADER
-00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
-04h: int32 HeaderSize : Size of the archive header. Should be 32.
-08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present.
-This size is used, among other things, for determining the region to hash in computing the digital signature.
-0Ch: int16 Unknown : Unknown
-0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector
-in the archive. The size of each logical sector the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate
-that this should always be 3 (4096 byte sectors).
-10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
-14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
-18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16.
-1Ch: int32 BlockTableEntries : Number of entries in the block table.
-
-The archive header is the first structure in the archive, at archive offset 0, but the archive does not need to be at offset
-0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not
-at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the
-archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer
-versions (due to the strong digital signature not being considered a part of the archive).
-
-2.3 BLOCK TABLE
-The block table contains entries for each region in the archive. Regions may be either files or empty space, which may be
-overwritten by new files (typically this space is from deleted file data). The block table is encrypted, using the hash
-of "(block table)" as the key. Each entry is structured as follows:
-
-00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. Meaningless if the block size is 0.
-04h: int32 BlockSize : Size of the block in the archive.
-08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file, otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data.
-0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
- 80000000h: Block is a file, and follows the file data format; otherwise, block is free space, and may be overwritten. If the block is not a file, all other flags should be cleared.
- 01000000h: File is stored as a single unit, rather than split into sectors.
- 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
- 00010000h: File is encrypted.
- 00000200h: File is compressed. Mutually exclusive to file imploded.
- 00000100h: File is imploded. Mutually exclusive to file compressed.
-
-2.4 HASH TABLE
-Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
-
-00h: int32 FilePathHashA : The hash of the file path, using method A.
-04h: int32 FilePathHashB : The hash of the file path, using method B.
-08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral.
-0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
-0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values:
- FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file.
- FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file.
-
-2.5 FILE DATA
-00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector's data, relative to the beginning of the file data. Not present if this information is calculatable (see details below).
-immediately following SectorOffsetTable: SectorData : Data of each sector in the file, packed end to end (see details below).
-
-Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may be smaller than this, depending on the size of the file data. This sector size is the size of the raw file data; if the file is compressed, the compressed sector will be smaller or the same size as the uncompressed sector size. Individual sectors in a compressed file may be stored uncompressed; this occurs if and only if the sector could not be compressed by the algorithm used (if the compressed sector size was greater than or equal to the size of the raw data), and is indicated by the sector's compressed size in SectorOffsetTable being equal to the uncompressed size of the sector (which may be calculated from the FileSize).
-
-If the sector is compressed (but not imploded), a bit mask byte of the compression algorithm(s) used to compress the sector is appended to the beginning of the compressed sector data. This additional byte counts towards the total size of the sector; if the size of the sector (including this byte) exceeds or matches the uncompressed size of the sector data, the sector will be stored uncompressed, and this byte omitted. Multiple compression algorithms may be used on the same sector; in this case, successive compression occurs in the order the algorithms are listed below, and decompression occurs in the opposite order. For implimentations of all of these algorithms, see StormLib.
- 40h: IMA ADPCM mono
- 80h: IMA ADPCM stereo
- 01h: Huffman encoded
- 02h: Deflated (see ZLib)
- 08h: Imploded (see PKWare Data Compression Library)
- 10h: BZip2 compressed (see BZip2)
-
-If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which
-contains the entire file.
-
-If the file is encrypted, each sector (after compression and appendage of the compression type byte, if applicable)
-is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the
-directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is
-adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset)
-XOR FileSize) (StormLib - an open-source implementation of the MoPaQ reading and writing functions,
-by Ladislav Zezula - incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the
-0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
-
-The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize.
-This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors
-is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the
-SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously.
-Note that the SectorOffsetTable will always be present if the file is compressed/imploded and the file is not stored as
-a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the
-archive's sector size).
-
-2.6 LISTFILE
-The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive.
-The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)",
-and is simply a non-Unix-style text file with one file path on each line, lines terminated with the bytes 0Dh 0Ah. The file
-"(listfile)" may not be listed in the listfile.
-
-2.7 EXTENDED ATTRIBUTES
-The extended attributes are optional file attributes for files in the block table. These attributes were added at times after
-the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes.
-If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although
-the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the
-blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file,
-in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other
-structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some
-archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This
-file is structured as follows:
-
-00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
-04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
- 00000001h: File CRC32s.
- 00000002h: File timestamps.
- 00000004h: File MD5s.
-08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the
-archive does not have CRC32s. immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block
-in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
-immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive.
-Omitted if the archive does not have MD5s.
-
-2.8 WEAK DIGITAL SIGNATURE
-The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5
-digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this
-protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature
-is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the
-archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature
-file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during
-signing/verification. This file is structured as follows:
-
-00h: int32 Unknown : Must be 0.
-04h: int32 Unknown : must be 0.
-08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order.
-
-2.9 STRONG DIGITAL SIGNATURE
-The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and
-a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well.
-The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize
-bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
-
-00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
-04h: int2048 Signature : The digital signature, stored in little-endian format.
-
-When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows:
-
-00h: byte Padding : Must be 0Bh.
-01h: byte(235) Padding : Must be BBh.
-ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format.
-
-3. ALGORITHM SOURCE CODE
-3.1 ENCRYPTION/DECRYPTION
-I believe this was derived at some point from code in StormLib. Assumes the long type to be 32 bits, and the machine to be little endian order.
-
-unsigned long dwCryptTable[0x500];
-
-void InitializeCryptTable()
-{
- unsigned long seed = 0x00100001;
- unsigned long index1 = 0;
- unsigned long index2 = 0;
- int i;
-
- for (index1 = 0; index1 < 0x100; index1++)
- {
- for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
- {
- unsigned long temp1, temp2;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp1 = (seed & 0xFFFF) << 0x10;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp2 = (seed & 0xFFFF);
-
- dwCryptTable[index2] = (temp1 | temp2);
- }
- }
-}
-
-void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEE;
- unsigned long ch;
-
- assert(lpbyBuffer);
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
- seed = *lpdwBuffer + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEE;
- unsigned long ch;
-
- assert(lpbyBuffer);
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
- seed = ch + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-3.2 HASHING
-Based on code from StormLib.
-
-// Different types of hashes to make with HashString
-#define MPQ_HASH_TABLE_OFFSET 0
-#define MPQ_HASH_NAME_A 1
-#define MPQ_HASH_NAME_B 2
-#define MPQ_HASH_FILE_KEY 3
-
-unsigned long HashString(const char *lpszString, unsigned long dwHashType)
-{
- unsigned long seed1 = 0x7FED7FED;
- unsigned long seed2 = 0xEEEEEEEE;
- int ch;
-
- while (*lpszString != 0)
- {
- ch = toupper(*lpszString++);
-
- seed1 = dwCryptTable[(dwHashType * 0xFF) + ch] ^ (seed1 + seed2);
- seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
- }
- return seed1;
-}
-
-3.3 CONVERSION OF FILETIME AND time_t
-
-#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
-
-bool GetTimeFromFileTime(FILETIME &fileTime, time_t &time)
-{
- // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
- unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
-
- if (nTime < EPOCH_OFFSET)
- return false;
-
- nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
- nTime /= 10000000ULL; // Convert 100 ns to sec
-
- time = (time_t)nTime;
-
- // Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
- if ((nTime - (unsigned long long)time) > 0)
- return false;
-
- return true;
-}
-
-void GetFileTimeFromTime(time_t &time, FILETIME &fileTime)
-{
- unsigned long long nTime = (unsigned long long)time;
-
- nTime *= 10000000ULL;
- nTime += EPOCH_OFFSET;
-
- fileTime.dwLowDateTime = (DWORD)nTime;
- fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
-}
diff --git a/contrib/vmap_extractor_v2/doc/MoPaQ_1.0.txt b/contrib/vmap_extractor_v2/doc/MoPaQ_1.0.txt
deleted file mode 100644
index 6a21eca5472..00000000000
--- a/contrib/vmap_extractor_v2/doc/MoPaQ_1.0.txt
+++ /dev/null
@@ -1,421 +0,0 @@
-THE MOPAQ ARCHIVE FORMAT
-v1.0 (Friday, September 1, 2006)
-by Justin Olbrantz(Quantam)
-
-Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quotation in other works is freely allowed, as long as the source and author of the quote are stated.
-
-TABLE OF CONTENTS
-1. Introduction to the MoPaQ Format
-2. The MoPaQ Format
- 2.1 General Archive Layout
- 2.2 Archive Header
- 2.3 Block Table
- 2.4 Extended Block Table
- 2.5 Hash Table
- 2.6 File Data
- 2.7 Listfile
- 2.8 Extended Attributes
- 2.9 Weak (Old) Digital Signature
- 2.10 Strong (New) Digital Signature
-3. Algorithm Source Code
- 3.1 Encryption/Decryption
- 3.2 Hashing and File Key Computation
- 3.3 Finding Files
- 3.4 Deleting Files
- 3.5 Conversion of FILETIME and time_t
- 3.6 Forming a 64-bit Large Archive Offset from 32-bit and 16-bit Components
-4. Revision History
-
-1. INTRODUCTION TO THE MOPAQ FORMAT
-The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be a read-only game archive format, and excels at this role.
-
-The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked. The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
-
-StormLib - mentioned several times in this specification - is an open-source MoPaQ reading and writing library written by Ladislav Zezula (no affiliation with Blizzard Entertainment). While it's a bit dated, and does not support all of the newer MoPaQ features, it contains source code to the more exotic compression methods used by MoPaQ, such as the PKWare implode algorithm, MoPaQ's huffman compression algorithm, and the IMA ADPCM compression used by MoPaQ.
-
-2. THE MOPAQ FORMAT
-All numbers in the MoPaQ format are in little endian byte order; signed numbers use the two's complement system. Data types are listed either as int (integer, the number of bits specified), byte (8 bits), or char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise. Structure members are listed in the following general form:
-offset from the beginning of the structure: data type(array size) member name : member description
-
-2.1 GENERAL ARCHIVE LAYOUT
-- Archive Header
-- File Data
-- File Data - Special Files
-- Hash Table
-- Block Table
-- Extended Block Table
-- Strong Digital signature
-
-This is the usual archive format, but it is not mandatory. Some archives have been observed placing the hash table and file table after the archive header, and before the file data.
-
-2.2 ARCHIVE HEADER
-00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
-04h: int32 HeaderSize : Size of the archive header.
-08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present. This size is used, among other things, for determining the region to hash in computing the digital signature. This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive is calculated as the size from the beginning of the archive to the end of the hash table, block table, or extended block table (whichever is largest).
-0Ch: int16 FormatVersion : MoPaQ format version. MPQAPI will not open archives where this is negative. Known versions:
- 0000h: Original format. HeaderSize should be 20h, and large archives are not supported.
- 0001h: Burning Crusade format. Header size should be 2Ch, and large archives are supported.
-0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector in the archive. The size of each logical sector in the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate that this should always be 3 (4096 byte sectors).
-10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
-14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
-18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for the original MoPaQ format, or less than 2^20 for the Burning Crusade format.
-1Ch: int32 BlockTableEntries : Number of entries in the block table.
-Fields only present in the Burning Crusade format and later:
-20h: int64 ExtendedBlockTableOffset : Offset to the beginning of the extended block table, relative to the beginning of the archive.
-28h: int16 HashTableOffsetHigh : High 16 bits of the hash table offset for large archives.
-2Ah: int16 BlockTableOffsetHigh : High 16 bits of the block table offset for large archives.
-
-The archive header is the first structure in the archive, at archive offset 0; however, the archive does not need to be at offset 0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer versions (due to the strong digital signature not being considered a part of the archive).
-
-2.3 BLOCK TABLE
-The block table contains entries for each region in the archive. Regions may be either files, empty space, which may be overwritten by new files (typically this space is from deleted file data), or unused block table entries. Empty space entries should have BlockOffset and BlockSize nonzero, and FileSize and Flags zero; unused block table entries should have BlockSize, FileSize, and Flags zero. The block table is encrypted, using the hash of "(block table)" as the key. Each entry is structured as follows:
-
-00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive.
-04h: int32 BlockSize : Size of the block in the archive.
-08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file; otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data.
-0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
- 80000000h: Block is a file, and follows the file data format; otherwise, block is free space or unused. If the block is not a file, all other flags should be cleared, and FileSize should be 0.
- 01000000h: File is stored as a single unit, rather than split into sectors.
- 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
- 00010000h: File is encrypted.
- 00000200h: File is compressed. File cannot be imploded.
- 00000100h: File is imploded. File cannot be compressed.
-
-2.4 EXTENDED BLOCK TABLE
-The extended block table was added to support archives larger than 4 gigabytes (2^32 bytes). The table contains the upper bits of the archive offsets for each block in the block table. It is simply an array of int16s, which become bits 32-47 of the archive offsets for each block, with bits 48-63 being zero. Individual blocks in the archive are still limited to 4 gigabytes in size. This table is only present in Burning Crusade format archives that exceed 4 gigabytes size.
-
-As of the Burning Crusade Friends and Family beta, this table is not encrypted.
-
-2.5 HASH TABLE
-Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
-
-00h: int32 FilePathHashA : The hash of the file path, using method A.
-04h: int32 FilePathHashB : The hash of the file path, using method B.
-08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral.
-0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
-0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values:
- FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file.
- FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file.
-
-2.6 FILE DATA
-The data for each file is composed of the following structure:
-00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector, relative to the beginning of the file data. The last entry contains the file size, making it possible to easily calculate the size of any given sector. This table is not present if this information can be calculated (see details below).
-immediately following SectorOffsetTable: SECTOR Sectors(SectorsInFile) : Data of each sector in the file, packed end to end (see details below).
-
-Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may contain less than this, depending on the size of the entire file's data. If the file is compressed or imploded, the sector will be smaller or the same size as the file data it contains. Individual sectors in a compressed or imploded file may be stored uncompressed; this occurs if and only if the file data the sector contains could not be compressed by the algorithm(s) used (if the compressed sector size was greater than or equal to the size of the file data), and is indicated by the sector's size in SectorOffsetTable being equal to the size of the file data in the sector (which may be calculated from the FileSize).
-
-The format of each sector depends on the kind of sector it is. Uncompressed sectors are simply the the raw file data contained in the sector. Imploded sectors are the raw compressed data following compression with the implode algorithm (these sectors can only be in imploded files). Compressed sectors (only found in compressed - not imploded - files) are compressed with one or more compression algorithms, and have the following structure:
-00h: byte CompressionMask : Mask of the compression types applied to this sector. If multiple compression types are used, they are applied in the order listed below, and decompression is performed in the opposite order. This byte counts towards the total sector size, meaning that the sector will be stored uncompressed if the data cannot be compressed by at least two bytes; as well, this byte is encrypted with the sector data, if applicable. The following compression types are defined (for implementations of these algorithms, see StormLib):
- 40h: IMA ADPCM mono
- 80h: IMA ADPCM stereo
- 01h: Huffman encoded
- 02h: Deflated (see ZLib)
- 08h: Imploded (see PKWare Data Compression Library)
- 10h: BZip2 compressed (see BZip2)
-01h: byte(SectorSize - 1) SectorData : The compressed data for the sector.
-
-If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which contains the entire file data.
-
-If the file is encrypted, each sector (after compression/implosion, if applicable) is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset) XOR FileSize) (StormLib incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the 0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
-
-The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize. This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously. However, the SectorOffsetTable will be present if the file is compressed/imploded and the file is not stored as a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the archive's sector size).
-
-2.7 LISTFILE
-The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive. The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)" (default language and platform), and is simply a text file with file paths separated by ';', 0Dh, 0Ah, or some combination of these. The file "(listfile)" may not be listed in the listfile.
-
-2.8 EXTENDED ATTRIBUTES
-The extended attributes are optional file attributes for files in the block table. These attributes were added at times after the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes. If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file (default language and platform), in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This file is structured as follows:
-
-00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
-04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
- 00000001h: File CRC32s.
- 00000002h: File timestamps.
- 00000004h: File MD5s.
-08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have CRC32s.
-immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
-immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have MD5s.
-
-2.9 WEAK DIGITAL SIGNATURE
-The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5 digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm, the private key is stored in a separate file, whose filename is passed to MPQAPI (the private key is not stored in MPQAPI). The signature is stored uncompressed, unencrypted in the file "(signature)" (default language and platform) in the archive. The archive is hashed from the beginning of the archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize, or calculated in the Burning Crusade MoPaQ format); the signature file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during signing/verification. This file is structured as follows:
-
-00h: int32 Unknown : Must be 0.
-04h: int32 Unknown : Must be 0.
-08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order. The structure of this, when decrypted, follows the RSASSA-PKCS1-v1_5 specification; this format is rather icky to work with (I wrote a program to verify this signature using nothing but an MD5 function and huge integer functions; it wasn't pleasant), and best left to an encryption library such as Cryto++.
-
-2.10 STRONG DIGITAL SIGNATURE
-The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well. The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
-
-00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
-04h: int2048 Signature : The digital signature, stored in little-endian format.
-
-When the Signature field is decrypted with the public key and exponent, and the resulting large integer is stored in little-endian order, it is structured as follows:
-
-00h: byte Padding : Must be 0Bh.
-01h: byte(235) Padding : Must be BBh.
-ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 byte order.
-
-3. ALGORITHM SOURCE CODE
-All of the sample code here assumes little endian machine byte order, that the short type is 16 bits, that the long type is 32 bits, and that the long long type is 64 bits. Adjustments must be made if these assumptions are not correct on a given platform. All code not credited otherwise was written by myself in the writing of this specification.
-
-3.1 ENCRYPTION/DECRYPTION
-Based on code from StormLib.
-
-unsigned long dwCryptTable[0x500];
-
-// The encryption and hashing functions use a number table in their procedures. This table must be initialized before the functions are called the first time.
-void InitializeCryptTable()
-{
- unsigned long seed = 0x00100001;
- unsigned long index1 = 0;
- unsigned long index2 = 0;
- int i;
-
- for (index1 = 0; index1 < 0x100; index1++)
- {
- for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
- {
- unsigned long temp1, temp2;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp1 = (seed & 0xFFFF) << 0x10;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp2 = (seed & 0xFFFF);
-
- dwCryptTable[index2] = (temp1 | temp2);
- }
- }
-}
-
-void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- assert(lpbyBuffer);
-
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEE;
- unsigned long ch;
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
- seed = *lpdwBuffer + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- assert(lpbyBuffer);
-
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEEL;
- unsigned long ch;
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111L) | (dwKey >> 0x0B);
- seed = ch + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-3.2 HASHING AND FILE KEY COMPUTATION
-These functions may have been derived from StormLib code at some point in the very distant past. It was so long ago that I don't remember for certain.
-
-// Different types of hashes to make with HashString
-#define MPQ_HASH_TABLE_OFFSET 0
-#define MPQ_HASH_NAME_A 1
-#define MPQ_HASH_NAME_B 2
-#define MPQ_HASH_FILE_KEY 3
-
-// Based on code from StormLib.
-unsigned long HashString(const char *lpszString, unsigned long dwHashType)
-{
- assert(lpszString);
- assert(dwHashType <= MPQ_HASH_FILE_KEY);
-
- unsigned long seed1 = 0x7FED7FEDL;
- unsigned long seed2 = 0xEEEEEEEEL;
- int ch;
-
- while (*lpszString != 0)
- {
- ch = toupper(*lpszString++);
-
- seed1 = dwCryptTable[(dwHashType * 0x100) + ch] ^ (seed1 + seed2);
- seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
- }
- return seed1;
-}
-
-#define BLOCK_OFFSET_ADJUSTED_KEY 0x00020000L
-
-unsigned long ComputeFileKey(const char *lpszFilePath, const BlockTableEntry &blockEntry, unsigned long nArchiveOffset)
-{
- assert(lpszFilePath);
-
- // Find the file name part of the path
- const char *lpszFileName = strrchr(lpszFilePath, '\\');
- if (lpszFileName)
- lpszFileName++; // Skip the \
- else
- lpszFileName = lpszFilePath;
-
- // Hash the name to get the base key
- unsigned long nFileKey = HashString(lpszFileName, MPQ_HASH_FILE_KEY);
-
- // Offset-adjust the key if necessary
- if (blockEntry.Flags & BLOCK_OFFSET_ADJUSTED_KEY)
- nFileKey = (nFileKey + blockEntry.BlockOffset) ^ blockEntry.FileSize;
-
- return nFileKey;
-}
-
-3.3 FINDING FILES
-
-#define MPQ_HASH_ENTRY_EMPTY 0xFFFFFFFFL
-#define MPQ_HASH_ENTRY_DELETED 0xFFFFFFFEL
-
-bool FindFileInHashTable(const HashTableEntry *lpHashTable, unsigned long nHashTableSize, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform, unsigned long &iFileHashEntry)
-{
- assert(lpHashTable);
- assert(nHashTableSize);
- assert(lpszFilePath);
-
- // Find the home entry in the hash table for the file
- unsigned long iInitEntry = HashString(lpszFilePath, MPQ_HASH_TABLE_OFFSET) & (nHashTableSize - 1);
-
- // Is there anything there at all?
- if (lpHashTable[iInitEntry].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY)
- return false;
-
- // Compute the hashes to compare the hash table entry against
- unsigned long nNameHashA = HashString(lpszFilePath, MPQ_HASH_NAME_A),
- nNameHashB = HashString(lpszFilePath, MPQ_HASH_NAME_B),
- iCurEntry = iInitEntry;
-
- // Check each entry in the hash table till a termination point is reached
- do
- {
- if (lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_DELETED)
- {
- if (lpHashTable[iCurEntry].FilePathHashA == nNameHashA
- && lpHashTable[iCurEntry].FilePathHashB == nNameHashB
- && lpHashTable[iCurEntry].Language == nLang
- && lpHashTable[iCurEntry].Platform == nPlatform)
- {
- iFileHashEntry = iCurEntry;
-
- return true;
- }
- }
-
- iCurEntry = (iCurEntry + 1) & (nHashTableSize - 1);
- } while (iCurEntry != iInitEntry && lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_EMPTY);
-
- return false;
-}
-
-3.4 DELETING FILES
-
-bool DeleteFile(HashTableEntry *lpHashTable, unsigned long nHashTableSize, BlockTableEntry *lpBlockTable, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform)
-{
- assert(lpHashTable);
- assert(nHashTableSize);
- assert(lpBlockTable);
-
- // Find the file in the hash table
- unsigned long iFileHashEntry;
-
- if (!FindFileInHashTable(lpHashTable, nHashTableSize, lpszFilePath, nLang, nPlatform, iFileHashEntry))
- return false;
-
- // Get the block table index before we nuke the hash table entry
- unsigned long iFileBlockEntry = lpHashTable[iFileHashEntry].FileBlockIndex;
-
- // Delete the file's entry in the hash table
- memset(&lpHashTable[iFileHashEntry], 0xFF, sizeof(HashTableEntry));
-
- // If the next entry is empty, mark this one as empty; otherwise, mark this as deleted.
- if (lpHashTable[(iFileHashEntry + 1) & (nHashTableSize - 1)].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY)
- lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_EMPTY;
- else
- lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_DELETED;
-
- // If the block occupies space, mark the block as free space; otherwise, clear the block table entry.
- if (lpBlockTable[iFileBlockEntry].BlockSize > 0)
- {
- lpBlockTable[iFileBlockEntry].FileSize = 0;
- lpBlockTable[iFileBlockEntry].Flags = 0;
- }
- else
- memset(&lpBlockTable[iFileBlockEntry], 0, sizeof(BlockTableEntry);
-
- return true;
-}
-
-3.5 CONVERSION OF FILETIME AND time_t
-This code assumes that the base ("zero") date for time_t is 01/01/1970. This is true on Windows, Unix System V systems, and Mac OS X. It is unknown whether this is true on all other platforms. You'll need to research this yourself, if you plan on porting it somewhere else.
-
-#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
-
-bool GetTimeFromFileTime(const FILETIME &fileTime, time_t &time)
-{
- // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
- unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
-
- if (nTime < EPOCH_OFFSET)
- return false;
-
- nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
- nTime /= 10000000ULL; // Convert 100 ns to sec
-
- time = (time_t)nTime;
-
- // Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
- if ((nTime - (unsigned long long)time) > 0)
- return false;
-
- return true;
-}
-
-void GetFileTimeFromTime(const time_t &time, FILETIME &fileTime)
-{
- unsigned long long nTime = (unsigned long long)time;
-
- nTime *= 10000000ULL;
- nTime += EPOCH_OFFSET;
-
- fileTime.dwLowDateTime = (DWORD)nTime;
- fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
-}
-
-3.6 FORMING A 64-BIT LARGE ARCHIVE OFFSET FROM 32-BIT AND 16-BIT COMPONENTS
-unsigned long long MakeLargeArchiveOffset(unsigned long nOffsetLow, unsigned short nOffsetHigh)
-{
- return ((unsigned long long)nOffsetHigh << 32) + (unsigned long long)nOffsetLow;
-}
-
-4. REVISION HISTORY
-1.0
- - Updated to include most of the changes found in the Burning Crusade Friends and Family beta
-
-0.91.
- - Updated several structure member descriptions
- - Listed the full set of characters that can separate list file entries
- - Noted that (attributes), (listfile), and (signature) use the default language and platform codes
- - Redid part of the file data specs to clarify the format of sectors
- - Enhanced descriptions of the different kinds of block table entries
- - Added ComputeFileKey, FindFileInHashTable, and DeleteFile source \ No newline at end of file
diff --git a/contrib/vmap_extractor_v2/stormlib/Makefile b/contrib/vmap_extractor_v2/stormlib/Makefile
deleted file mode 100644
index e3b19e36d6f..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-########################################################################
-#
-# Makefile for compiling StormLib under linux
-#
-# Author: Marko Friedemann <marko.friedemann@bmx-chemnitz.de>
-# Created at: Mon Jan 29 18:26:01 CEST 2001
-# Computer: whiplash.flachland-chemnitz.de
-# System: Linux 2.4.0 on i686
-#
-# Copyright (c) 2001 BMX-Chemnitz.DE All rights reserved.
-#
-########################################################################
-
-FILES.cpp = SCommon.cpp SCompression.cpp SFileCompactArchive.cpp \
- SFileCreateArchiveEx.cpp SFileExtractFile.cpp SFileFindFile.cpp \
- SListFile.cpp SFileOpenArchive.cpp SFileOpenFileEx.cpp SFileReadFile.cpp \
- StormPortLinux.cpp wave/wave.cpp huffman/huff.cpp \
- pklib/crc32.cpp pklib/explode.cpp pklib/implode.cpp
-FILES.o = $(FILES.cpp:.cpp=.o)
-
-LIB = libStorm.so
-
-CXX = g++
-CFLAGS = -Wall -s -D__SYS_ZLIB
-I_FLAGS =
-LDFLAGS = -lz -lbz2
-
-all: $(LIB)
-
-$(LIB): $(FILES.o)
- $(LD) -shared $(LDFLAGS) -o $(LIB) $(FILES.o)
-
-%.o: %.cpp
- $(CXX) $(CFLAGS) -c $< -o $@
-
-clean:
- $(RM) $(FILES.o) $(LIB)
-
-new: clean all
-
-mrproper: clean
- $(RM) Makefile.deps
-
-mrnew: mrproper new
-
-install: $(LIB)
- install $(I_FLAGS) $(LIB) /usr/local/lib
- mkdir -p /usr/local/include/StormLib
- cp Storm.h /usr/local/include/StormLib
- cp StormPort.h /usr/local/include/StormLib
- ldconfig
-
-deps:
- $(CXX) -MM $(CFLAGS) $(FILES.cpp) > Makefile.deps
-
--include Makefile.deps
-
-.PHONY: all clean new mrpoper mrnew install deps
diff --git a/contrib/vmap_extractor_v2/stormlib/bzip2/Makefile b/contrib/vmap_extractor_v2/stormlib/bzip2/Makefile
deleted file mode 100644
index eea329a626e..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/bzip2/Makefile
+++ /dev/null
@@ -1,205 +0,0 @@
-
-SHELL=/bin/sh
-
-# To assist in cross-compiling
-CC=gcc
-AR=ar
-RANLIB=ranlib
-LDFLAGS=
-
-BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O -g $(BIGFILES)
-
-# Where you want it installed when you do 'make install'
-PREFIX=/usr
-
-
-OBJS= blocksort.o \
- huffman.o \
- crctable.o \
- randtable.o \
- compress.o \
- decompress.o \
- bzlib.o
-
-all: libbz2.a bzip2 bzip2recover test
-
-bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
-
-bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
-
-libbz2.a: $(OBJS)
- rm -f libbz2.a
- $(AR) cq libbz2.a $(OBJS)
- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
- echo $(RANLIB) libbz2.a ; \
- $(RANLIB) libbz2.a ; \
- fi
-
-check: test
-test: bzip2
- @cat words1
- ./bzip2 -1 < sample1.ref > sample1.rb2
- ./bzip2 -2 < sample2.ref > sample2.rb2
- ./bzip2 -3 < sample3.ref > sample3.rb2
- ./bzip2 -d < sample1.bz2 > sample1.tst
- ./bzip2 -d < sample2.bz2 > sample2.tst
- ./bzip2 -ds < sample3.bz2 > sample3.tst
- cmp sample1.bz2 sample1.rb2
- cmp sample2.bz2 sample2.rb2
- cmp sample3.bz2 sample3.rb2
- cmp sample1.tst sample1.ref
- cmp sample2.tst sample2.ref
- cmp sample3.tst sample3.ref
- @cat words3
-
-install: bzip2 bzip2recover
- if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
- if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
- if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
- cp -f bzip2 $(PREFIX)/bin/bzip2
- cp -f bzip2 $(PREFIX)/bin/bunzip2
- cp -f bzip2 $(PREFIX)/bin/bzcat
- cp -f bzip2recover $(PREFIX)/bin/bzip2recover
- chmod a+x $(PREFIX)/bin/bzip2
- chmod a+x $(PREFIX)/bin/bunzip2
- chmod a+x $(PREFIX)/bin/bzcat
- chmod a+x $(PREFIX)/bin/bzip2recover
- cp -f bzip2.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzip2.1
- cp -f bzlib.h $(PREFIX)/include
- chmod a+r $(PREFIX)/include/bzlib.h
- cp -f libbz2.a $(PREFIX)/lib
- chmod a+r $(PREFIX)/lib/libbz2.a
- cp -f bzgrep $(PREFIX)/bin/bzgrep
- ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
- ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
- chmod a+x $(PREFIX)/bin/bzgrep
- cp -f bzmore $(PREFIX)/bin/bzmore
- ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
- chmod a+x $(PREFIX)/bin/bzmore
- cp -f bzdiff $(PREFIX)/bin/bzdiff
- ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
- chmod a+x $(PREFIX)/bin/bzdiff
- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
- chmod a+r $(PREFIX)/man/man1/bzgrep.1
- chmod a+r $(PREFIX)/man/man1/bzmore.1
- chmod a+r $(PREFIX)/man/man1/bzdiff.1
- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
-
-clean:
- rm -f *.o libbz2.a bzip2 bzip2recover \
- sample1.rb2 sample2.rb2 sample3.rb2 \
- sample1.tst sample2.tst sample3.tst
-
-blocksort.o: blocksort.c
- @cat words0
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
-bzip2.o: bzip2.c
- $(CC) $(CFLAGS) -c bzip2.c
-bzip2recover.o: bzip2recover.c
- $(CC) $(CFLAGS) -c bzip2recover.c
-
-
-distclean: clean
- rm -f manual.ps manual.html manual.pdf
-
-DISTNAME=bzip2-1.0.3
-dist: check manual
- rm -f $(DISTNAME)
- ln -sf . $(DISTNAME)
- tar cvf $(DISTNAME).tar \
- $(DISTNAME)/blocksort.c \
- $(DISTNAME)/huffman.c \
- $(DISTNAME)/crctable.c \
- $(DISTNAME)/randtable.c \
- $(DISTNAME)/compress.c \
- $(DISTNAME)/decompress.c \
- $(DISTNAME)/bzlib.c \
- $(DISTNAME)/bzip2.c \
- $(DISTNAME)/bzip2recover.c \
- $(DISTNAME)/bzlib.h \
- $(DISTNAME)/bzlib_private.h \
- $(DISTNAME)/Makefile \
- $(DISTNAME)/LICENSE \
- $(DISTNAME)/bzip2.1 \
- $(DISTNAME)/bzip2.1.preformatted \
- $(DISTNAME)/bzip2.txt \
- $(DISTNAME)/words0 \
- $(DISTNAME)/words1 \
- $(DISTNAME)/words2 \
- $(DISTNAME)/words3 \
- $(DISTNAME)/sample1.ref \
- $(DISTNAME)/sample2.ref \
- $(DISTNAME)/sample3.ref \
- $(DISTNAME)/sample1.bz2 \
- $(DISTNAME)/sample2.bz2 \
- $(DISTNAME)/sample3.bz2 \
- $(DISTNAME)/dlltest.c \
- $(DISTNAME)/manual.html \
- $(DISTNAME)/manual.pdf \
- $(DISTNAME)/manual.ps \
- $(DISTNAME)/README \
- $(DISTNAME)/README.COMPILATION.PROBLEMS \
- $(DISTNAME)/README.XML.STUFF \
- $(DISTNAME)/CHANGES \
- $(DISTNAME)/libbz2.def \
- $(DISTNAME)/libbz2.dsp \
- $(DISTNAME)/dlltest.dsp \
- $(DISTNAME)/makefile.msc \
- $(DISTNAME)/Y2K_INFO \
- $(DISTNAME)/unzcrash.c \
- $(DISTNAME)/spewG.c \
- $(DISTNAME)/mk251.c \
- $(DISTNAME)/bzdiff \
- $(DISTNAME)/bzdiff.1 \
- $(DISTNAME)/bzmore \
- $(DISTNAME)/bzmore.1 \
- $(DISTNAME)/bzgrep \
- $(DISTNAME)/bzgrep.1 \
- $(DISTNAME)/Makefile-libbz2_so \
- $(DISTNAME)/bz-common.xsl \
- $(DISTNAME)/bz-fo.xsl \
- $(DISTNAME)/bz-html.xsl \
- $(DISTNAME)/bzip.css \
- $(DISTNAME)/entities.xml \
- $(DISTNAME)/manual.xml \
- $(DISTNAME)/format.pl \
- $(DISTNAME)/xmlproc.sh
- gzip -v $(DISTNAME).tar
-
-# For rebuilding the manual from sources on my SuSE 9.1 box
-
-MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
- entities.xml manual.xml
-
-manual: manual.html manual.ps manual.pdf
-
-manual.ps: $(MANUAL_SRCS)
- ./xmlproc.sh -ps manual.xml
-
-manual.pdf: $(MANUAL_SRCS)
- ./xmlproc.sh -pdf manual.xml
-
-manual.html: $(MANUAL_SRCS)
- ./xmlproc.sh -html manual.xml
diff --git a/contrib/vmap_extractor_v2/stormlib/zlib/Makefile b/contrib/vmap_extractor_v2/stormlib/zlib/Makefile
deleted file mode 100644
index 531562b2ef1..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/zlib/Makefile
+++ /dev/null
@@ -1,175 +0,0 @@
-# Makefile for zlib
-# Copyright (C) 1995-2002 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h
-
-# To compile and test, type:
-# ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
-
-# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
-# make install
-# To install in $HOME instead of /usr/local, use:
-# make install prefix=$HOME
-
-CC=cc
-
-CFLAGS=-O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-# -Wstrict-prototypes -Wmissing-prototypes
-
-LDFLAGS=-L. -lz
-LDSHARED=$(CC)
-CPP=$(CC) -E
-
-VER=1.1.4
-LIBS=libz.a
-SHAREDLIB=libz.so
-
-AR=ar rc
-RANLIB=ranlib
-TAR=tar
-SHELL=/bin/sh
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
- zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-OBJA =
-# to use the asm code: make OBJA=match.o
-
-TEST_OBJS = example.o minigzip.o
-
-DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
- algorithm.txt zlib.3 zlib.html \
- msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
- nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
- contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
- contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
- contrib/asm[56]86/*.S contrib/iostream/*.cpp \
- contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
- contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
- contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
- contrib/delphi*/*.???
-
-all: example minigzip
-
-test: all
- @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
- echo hello world | ./minigzip | ./minigzip -d || \
- echo ' *** minigzip test FAILED ***' ; \
- if ./example; then \
- echo ' *** zlib test OK ***'; \
- else \
- echo ' *** zlib test FAILED ***'; \
- fi
-
-libz.a: $(OBJS) $(OBJA)
- $(AR) $@ $(OBJS) $(OBJA)
- -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-match.o: match.S
- $(CPP) match.S > _match.s
- $(CC) -c _match.s
- mv _match.o match.o
- rm -f _match.s
-
-$(SHAREDLIB).$(VER): $(OBJS)
- $(LDSHARED) -o $@ $(OBJS)
- rm -f $(SHAREDLIB) $(SHAREDLIB).1
- ln -s $@ $(SHAREDLIB)
- ln -s $@ $(SHAREDLIB).1
-
-example: example.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip: minigzip.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
- -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
- -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
- cp zlib.h zconf.h $(includedir)
- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
- cp $(LIBS) $(libdir)
- cd $(libdir); chmod 755 $(LIBS)
- -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
- cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
- rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
- ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
- ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
- (ldconfig || true) >/dev/null 2>&1; \
- fi
-# The ranlib in install is needed on NeXTSTEP which checks file times
-# ldconfig is for Linux
-
-uninstall:
- cd $(includedir); \
- v=$(VER); \
- if test -f zlib.h; then \
- v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
- rm -f zlib.h zconf.h; \
- fi; \
- cd $(libdir); rm -f libz.a; \
- if test -f $(SHAREDLIB).$$v; then \
- rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
- fi
-
-clean:
- rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
- _match.s maketree
-
-distclean: clean
-
-zip:
- mv Makefile Makefile~; cp -p Makefile.in Makefile
- rm -f test.c ztest*.c contrib/minizip/test.zip
- v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
- zip -ul9 zlib$$v $(DISTFILES)
- mv Makefile~ Makefile
-
-dist:
- mv Makefile Makefile~; cp -p Makefile.in Makefile
- rm -f test.c ztest*.c contrib/minizip/test.zip
- d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
- rm -f $$d.tar.gz; \
- if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
- files=""; \
- for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
- cd ..; \
- GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
- if test ! -d $$d; then rm -f $$d; fi
- mv Makefile~ Makefile
-
-tags:
- etags *.[ch]
-
-depend:
- makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
-infcodes.o: zutil.h zlib.h zconf.h
-infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h
-inffast.o: infblock.h infcodes.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
diff --git a/contrib/vmap_extractor_v2/stormlib/zlib/Makefile.in b/contrib/vmap_extractor_v2/stormlib/zlib/Makefile.in
deleted file mode 100644
index 531562b2ef1..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/zlib/Makefile.in
+++ /dev/null
@@ -1,175 +0,0 @@
-# Makefile for zlib
-# Copyright (C) 1995-2002 Jean-loup Gailly.
-# For conditions of distribution and use, see copyright notice in zlib.h
-
-# To compile and test, type:
-# ./configure; make test
-# The call of configure is optional if you don't have special requirements
-# If you wish to build zlib as a shared library, use: ./configure -s
-
-# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
-# make install
-# To install in $HOME instead of /usr/local, use:
-# make install prefix=$HOME
-
-CC=cc
-
-CFLAGS=-O
-#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
-#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
-# -Wstrict-prototypes -Wmissing-prototypes
-
-LDFLAGS=-L. -lz
-LDSHARED=$(CC)
-CPP=$(CC) -E
-
-VER=1.1.4
-LIBS=libz.a
-SHAREDLIB=libz.so
-
-AR=ar rc
-RANLIB=ranlib
-TAR=tar
-SHELL=/bin/sh
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-libdir = ${exec_prefix}/lib
-includedir = ${prefix}/include
-
-OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
- zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
-
-OBJA =
-# to use the asm code: make OBJA=match.o
-
-TEST_OBJS = example.o minigzip.o
-
-DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
- algorithm.txt zlib.3 zlib.html \
- msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
- nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
- contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
- contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
- contrib/asm[56]86/*.S contrib/iostream/*.cpp \
- contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
- contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
- contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
- contrib/delphi*/*.???
-
-all: example minigzip
-
-test: all
- @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
- echo hello world | ./minigzip | ./minigzip -d || \
- echo ' *** minigzip test FAILED ***' ; \
- if ./example; then \
- echo ' *** zlib test OK ***'; \
- else \
- echo ' *** zlib test FAILED ***'; \
- fi
-
-libz.a: $(OBJS) $(OBJA)
- $(AR) $@ $(OBJS) $(OBJA)
- -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-match.o: match.S
- $(CPP) match.S > _match.s
- $(CC) -c _match.s
- mv _match.o match.o
- rm -f _match.s
-
-$(SHAREDLIB).$(VER): $(OBJS)
- $(LDSHARED) -o $@ $(OBJS)
- rm -f $(SHAREDLIB) $(SHAREDLIB).1
- ln -s $@ $(SHAREDLIB)
- ln -s $@ $(SHAREDLIB).1
-
-example: example.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
-
-minigzip: minigzip.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
-
-install: $(LIBS)
- -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
- -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
- cp zlib.h zconf.h $(includedir)
- chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
- cp $(LIBS) $(libdir)
- cd $(libdir); chmod 755 $(LIBS)
- -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
- cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
- rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
- ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
- ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
- (ldconfig || true) >/dev/null 2>&1; \
- fi
-# The ranlib in install is needed on NeXTSTEP which checks file times
-# ldconfig is for Linux
-
-uninstall:
- cd $(includedir); \
- v=$(VER); \
- if test -f zlib.h; then \
- v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
- rm -f zlib.h zconf.h; \
- fi; \
- cd $(libdir); rm -f libz.a; \
- if test -f $(SHAREDLIB).$$v; then \
- rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
- fi
-
-clean:
- rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
- _match.s maketree
-
-distclean: clean
-
-zip:
- mv Makefile Makefile~; cp -p Makefile.in Makefile
- rm -f test.c ztest*.c contrib/minizip/test.zip
- v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
- zip -ul9 zlib$$v $(DISTFILES)
- mv Makefile~ Makefile
-
-dist:
- mv Makefile Makefile~; cp -p Makefile.in Makefile
- rm -f test.c ztest*.c contrib/minizip/test.zip
- d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
- rm -f $$d.tar.gz; \
- if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
- files=""; \
- for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
- cd ..; \
- GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
- if test ! -d $$d; then rm -f $$d; fi
- mv Makefile~ Makefile
-
-tags:
- etags *.[ch]
-
-depend:
- makedepend -- $(CFLAGS) -- *.[ch]
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-adler32.o: zlib.h zconf.h
-compress.o: zlib.h zconf.h
-crc32.o: zlib.h zconf.h
-deflate.o: deflate.h zutil.h zlib.h zconf.h
-example.o: zlib.h zconf.h
-gzio.o: zutil.h zlib.h zconf.h
-infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
-infcodes.o: zutil.h zlib.h zconf.h
-infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
-inffast.o: zutil.h zlib.h zconf.h inftrees.h
-inffast.o: infblock.h infcodes.h infutil.h inffast.h
-inflate.o: zutil.h zlib.h zconf.h infblock.h
-inftrees.o: zutil.h zlib.h zconf.h inftrees.h
-infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
-minigzip.o: zlib.h zconf.h
-trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-uncompr.o: zlib.h zconf.h
-zutil.o: zutil.h zlib.h zconf.h
diff --git a/contrib/vmap_extractor_v2/stormlib/zlib/configure b/contrib/vmap_extractor_v2/stormlib/zlib/configure
deleted file mode 100644
index e8942359bc1..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/zlib/configure
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/bin/sh
-# configure script for zlib. This script is needed only if
-# you wish to build a shared library and your system supports them,
-# of if you need special compiler, flags or install directory.
-# Otherwise, you can just use directly "make test; make install"
-#
-# To create a shared library, use "configure --shared"; by default a static
-# library is created. If the primitive shared library support provided here
-# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
-#
-# To impose specific compiler or flags or install directory, use for example:
-# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
-# or for csh/tcsh users:
-# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
-# LDSHARED is the command to be used to create a shared library
-
-# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
-# If you have problems, try without defining CC and CFLAGS before reporting
-# an error.
-
-LIBS=libz.a
-SHAREDLIB=libz.so
-VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
-AR=${AR-"ar rc"}
-RANLIB=${RANLIB-"ranlib"}
-prefix=${prefix-/usr/local}
-exec_prefix=${exec_prefix-'${prefix}'}
-libdir=${libdir-'${exec_prefix}/lib'}
-includedir=${includedir-'${prefix}/include'}
-shared_ext='.so'
-shared=0
-gcc=0
-old_cc="$CC"
-old_cflags="$CFLAGS"
-
-while test $# -ge 1
-do
-case "$1" in
- -h* | --h*)
- echo 'usage:'
- echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
- echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
- exit 0;;
- -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
- -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
- -p* | --p*) prefix="$2"; shift; shift;;
- -e* | --e*) exec_prefix="$2"; shift; shift;;
- -l* | --l*) libdir="$2"; shift; shift;;
- -i* | --i*) includedir="$2"; shift; shift;;
- -s* | --s*) shared=1; shift;;
- esac
-done
-
-test=ztest$$
-cat > $test.c <<EOF
-extern int getchar();
-int hello() {return getchar();}
-EOF
-
-test -z "$CC" && echo Checking for gcc...
-cc=${CC-gcc}
-cflags=${CFLAGS-"-O3"}
-# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
-case "$cc" in
- *gcc*) gcc=1;;
-esac
-
-if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
- CC="$cc"
- SFLAGS=${CFLAGS-"-fPIC -O3"}
- CFLAGS="$cflags"
- case `(uname -s || echo unknown) 2>/dev/null` in
- Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
- *) LDSHARED=${LDSHARED-"gcc -shared"};;
- esac
-else
- # find system name and corresponding cc options
- CC=${CC-cc}
- case `(uname -sr || echo unknown) 2>/dev/null` in
- HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
- CFLAGS=${CFLAGS-"-O"}
-# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
- LDSHARED=${LDSHARED-"ld -b"}
- shared_ext='.sl'
- SHAREDLIB='libz.sl';;
- IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
- CFLAGS=${CFLAGS-"-ansi -O2"}
- LDSHARED=${LDSHARED-"cc -shared"};;
- OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
- CFLAGS=${CFLAGS-"-O -std1"}
- LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
- OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
- CFLAGS=${CFLAGS-"-O -std1"}
- LDSHARED=${LDSHARED-"cc -shared"};;
- QNX*) SFLAGS=${CFLAGS-"-4 -O"}
- CFLAGS=${CFLAGS-"-4 -O"}
- LDSHARED=${LDSHARED-"cc"}
- RANLIB=${RANLIB-"true"}
- AR="cc -A";;
- SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
- CFLAGS=${CFLAGS-"-O3"}
- LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
- SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
- CFLAGS=${CFLAGS-"-fast -xcg89"}
- LDSHARED=${LDSHARED-"cc -G"};;
- SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
- CFLAGS=${CFLAGS-"-O2"}
- LDSHARED=${LDSHARED-"ld"};;
- UNIX_System_V\ 4.2.0)
- SFLAGS=${CFLAGS-"-KPIC -O"}
- CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -G"};;
- UNIX_SV\ 4.2MP)
- SFLAGS=${CFLAGS-"-Kconform_pic -O"}
- CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -G"};;
- # send working options for other systems to support@gzip.org
- *) SFLAGS=${CFLAGS-"-O"}
- CFLAGS=${CFLAGS-"-O"}
- LDSHARED=${LDSHARED-"cc -shared"};;
- esac
-fi
-
-if test $shared -eq 1; then
- echo Checking for shared library support...
- # we must test in two steps (cc then ld), required at least on SunOS 4.x
- if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
- test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
- CFLAGS="$SFLAGS"
- LIBS="$SHAREDLIB.$VER"
- echo Building shared library $SHAREDLIB.$VER with $CC.
- elif test -z "$old_cc" -a -z "$old_cflags"; then
- echo No shared library suppport.
- shared=0;
- else
- echo 'No shared library suppport; try without defining CC and CFLAGS'
- shared=0;
- fi
-fi
-if test $shared -eq 0; then
- LDSHARED="$CC"
- echo Building static library $LIBS version $VER with $CC.
-fi
-
-cat > $test.c <<EOF
-#include <unistd.h>
-int main() { return 0; }
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
- echo "Checking for unistd.h... Yes."
-else
- echo "Checking for unistd.h... No."
-fi
-
-cat > $test.c <<EOF
-#include <errno.h>
-int main() { return 0; }
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- echo "Checking for errno.h... Yes."
-else
- echo "Checking for errno.h... No."
- CFLAGS="$CFLAGS -DNO_ERRNO_H"
-fi
-
-cat > $test.c <<EOF
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-caddr_t hello() {
- return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
-}
-EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
- CFLAGS="$CFLAGS -DUSE_MMAP"
- echo Checking for mmap support... Yes.
-else
- echo Checking for mmap support... No.
-fi
-
-CPP=${CPP-"$CC -E"}
-case $CFLAGS in
- *ASMV*)
- if test "`nm $test.o | grep _hello`" = ""; then
- CPP="$CPP -DNO_UNDERLINE"
- echo Checking for underline in external names... No.
- else
- echo Checking for underline in external names... Yes.
- fi;;
-esac
-
-rm -f $test.[co] $test$shared_ext
-
-# udpate Makefile
-sed < Makefile.in "
-/^CC *=/s%=.*%=$CC%
-/^CFLAGS *=/s%=.*%=$CFLAGS%
-/^CPP *=/s%=.*%=$CPP%
-/^LDSHARED *=/s%=.*%=$LDSHARED%
-/^LIBS *=/s%=.*%=$LIBS%
-/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
-/^AR *=/s%=.*%=$AR%
-/^RANLIB *=/s%=.*%=$RANLIB%
-/^VER *=/s%=.*%=$VER%
-/^prefix *=/s%=.*%=$prefix%
-/^exec_prefix *=/s%=.*%=$exec_prefix%
-/^libdir *=/s%=.*%=$libdir%
-/^includedir *=/s%=.*%=$includedir%
-" > Makefile
diff --git a/contrib/vmap_extractor_v2/stormlib/zlib/contrib/minizip/Makefile b/contrib/vmap_extractor_v2/stormlib/zlib/contrib/minizip/Makefile
deleted file mode 100644
index a1dfc161437..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/zlib/contrib/minizip/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-CC=cc
-CFLAGS=-O -I../..
-
-UNZ_OBJS = miniunz.o unzip.o ../../libz.a
-ZIP_OBJS = minizip.o zip.o ../../libz.a
-
-.c.o:
- $(CC) -c $(CFLAGS) $*.c
-
-all: miniunz minizip
-
-miniunz: $(UNZ_OBJS)
- $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
-
-minizip: $(ZIP_OBJS)
- $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
-
-test: miniunz minizip
- ./minizip test readme.txt
- ./miniunz -l test.zip
- mv readme.txt readme.old
- ./miniunz test.zip
-
-clean:
- /bin/rm -f *.o *~ minizip miniunz
diff --git a/contrib/vmap_extractor_v2/stormlib/zlib/contrib/untgz/Makefile b/contrib/vmap_extractor_v2/stormlib/zlib/contrib/untgz/Makefile
deleted file mode 100644
index 409b4bdeaae..00000000000
--- a/contrib/vmap_extractor_v2/stormlib/zlib/contrib/untgz/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-CC=cc
-CFLAGS=-g
-
-untgz: untgz.o ../../libz.a
- $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz
-
-untgz.o: untgz.c ../../zlib.h
- $(CC) $(CFLAGS) -c -I../.. untgz.c
-
-../../libz.a:
- cd ../..; make
-
-clean:
- rm -f untgz untgz.o *~
diff --git a/contrib/vmap_extractor_v2/vmapextract/model.cpp b/contrib/vmap_extractor_v2/vmapextract/model.cpp
index 2bf5e8b5200..e5106dca65a 100644
--- a/contrib/vmap_extractor_v2/vmapextract/model.cpp
+++ b/contrib/vmap_extractor_v2/vmapextract/model.cpp
@@ -1,11 +1,7 @@
-//#include "common.h"
#include "model.h"
-//#include "world.h"
#include <cassert>
#include <algorithm>
-//int globalTime = 0;
-
Model::Model(std::string &filename) : filename(filename)
{
}
@@ -16,7 +12,7 @@ bool Model::open()
ok = !f.isEof();
- if (!ok)
+ if (!ok)
{
f.close();
printf("Error loading model %s\n", filename.c_str());
@@ -24,121 +20,31 @@ bool Model::open()
}
memcpy(&header, f.getBuffer(), sizeof(ModelHeader));
- if(header.nBoundingTriangles > 0) {
-
-#if 0
- animated = isAnimated(f);
- if(animated)
- {
- f.close();
- return false;
- }
-#endif
- trans = 1.0f;
- origVertices = (ModelVertex*)(f.getBuffer() + header.ofsVertices);
-
- vertices = new Vec3D[header.nVertices];
- normals = new Vec3D[header.nVertices];
-
- for (size_t i=0; i<header.nVertices; i++)
- {
- origVertices[i].pos = fixCoordSystem(origVertices[i].pos);
- origVertices[i].normal = fixCoordSystem(origVertices[i].normal);
- vertices[i] = origVertices[i].pos;
- normals[i] = origVertices[i].normal.normalize();
- }
-
- ModelView *view = (ModelView*)(f.getBuffer() + header.ofsViews);
-
- uint16 *indexLookup = (uint16*)(f.getBuffer() + view->ofsIndex);
- uint16 *triangles = (uint16*)(f.getBuffer() + view->ofsTris);
-
- nIndices = view->nTris;
- indices = new uint16[nIndices];
- for (size_t i = 0; i<nIndices; i++)
+ if(header.nBoundingTriangles > 0)
+ {
+ f.seek(0);
+ f.seekRelative(header.ofsBoundingVertices);
+ vertices = new Vec3D[header.nBoundingVertices];
+ f.read(vertices,header.nBoundingVertices*12);
+ for (uint32 i=0; i<header.nBoundingVertices; i++)
{
- indices[i] = indexLookup[triangles[i]];
+ vertices[i] = fixCoordSystem(vertices[i]);
}
+ f.seek(0);
+ f.seekRelative(header.ofsBoundingTriangles);
+ indices = new uint16[header.nBoundingTriangles];
+ f.read(indices,header.nBoundingTriangles*2);
f.close();
- } else {
+ }
+ else
+ {
//printf("not included %s\n", filename.c_str());
+ f.close();
return false;
}
return true;
-
}
-bool Model::isAnimated(MPQFile &f)
-{
- // see if we have any animated bones
- ModelBoneDef *bo = (ModelBoneDef*)(f.getBuffer() + header.ofsBones);
-
- animGeometry = false;
- animBones = false;
- ind = false;
-
- ModelVertex *verts = (ModelVertex*)(f.getBuffer() + header.ofsVertices);
- for (size_t i=0; i<header.nVertices && !animGeometry; i++) {
- for (size_t b=0; b<4; b++) {
- if (verts[i].weights[b]>0) {
- ModelBoneDef &bb = bo[verts[i].bones[b]];
- if (bb.translation.type || bb.rotation.type || bb.scaling.type || (bb.flags&8)) {
- if (bb.flags&8) {
- // if we have billboarding, the model will need per-instance animation
- ind = true;
- }
- animGeometry = true;
- break;
- }
- }
- }
- }
-
- if (animGeometry) animBones = true;
- else {
- for (size_t i=0; i<header.nBones; i++) {
- ModelBoneDef &bb = bo[i];
- if (bb.translation.type || bb.rotation.type || bb.scaling.type) {
- animBones = true;
- break;
- }
- }
- }
-
- animTextures = header.nTexAnims > 0;
-
- bool animMisc = header.nCameras>0 || // why waste time, pretty much all models with cameras need animation
- header.nLights>0 || // same here
- header.nParticleEmitters>0 ||
- header.nRibbonEmitters>0;
-
- if (animMisc) animBones = true;
-
- // animated colors
- if (header.nColors) {
- ModelColorDef *cols = (ModelColorDef*)(f.getBuffer() + header.ofsColors);
- for (size_t i=0; i<header.nColors; i++) {
- if (cols[i].color.type!=0 || cols[i].opacity.type!=0) {
- animMisc = true;
- break;
- }
- }
- }
-
- // animated opacity
- if (header.nTransparency && !animMisc) {
- ModelTransDef *trs = (ModelTransDef*)(f.getBuffer() + header.ofsTransparency);
- for (size_t i=0; i<header.nTransparency; i++) {
- if (trs[i].trans.type!=0) {
- animMisc = true;
- break;
- }
- }
- }
-
- // guess not...
- return animGeometry || animTextures || animMisc;
-}
bool Model::ConvertToVMAPModel(char * outfilename)
{
@@ -151,7 +57,8 @@ bool Model::ConvertToVMAPModel(char * outfilename)
return false;
}
fwrite("VMAP002",8,1,output);
- int nVertices = header.nVertices;
+ uint32 nVertices = 0;
+ nVertices = header.nBoundingVertices;
fwrite(&nVertices, sizeof(int), 1, output);
uint32 nofgroups = 1;
fwrite(&nofgroups,sizeof(uint32), 1, output);
@@ -162,23 +69,24 @@ bool Model::ConvertToVMAPModel(char * outfilename)
wsize = sizeof(branches) + sizeof(uint32) * branches;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&branches,sizeof(branches), 1, output);
- uint32 nIdexes = (uint32) nIndices;
- fwrite(&nIndices,sizeof(uint32), 1, output);
+ uint32 nIndexes = 0;
+ nIndexes = header.nBoundingTriangles;
+ fwrite(&nIndexes,sizeof(uint32), 1, output);
fwrite("INDX",4, 1, output);
- wsize = sizeof(uint32) + sizeof(unsigned short) * nIdexes;
+ wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes;
fwrite(&wsize, sizeof(int), 1, output);
- fwrite(&nIdexes, sizeof(uint32), 1, output);
- if(nIdexes >0)
+ fwrite(&nIndexes, sizeof(uint32), 1, output);
+ if(nIndexes >0)
{
- fwrite(indices, sizeof(unsigned short), nIdexes, output);
+ fwrite(indices, sizeof(unsigned short), nIndexes, output);
}
fwrite("VERT",4, 1, output);
wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&nVertices, sizeof(int), 1, output);
- if(nVertices >0)
+ if(nVertices >0)
{
- for(int vpos=0; vpos <nVertices; ++vpos)
+ for(uint32 vpos=0; vpos <nVertices; ++vpos)
{
float sy = vertices[vpos].y;
vertices[vpos].y = vertices[vpos].z;
@@ -189,7 +97,6 @@ bool Model::ConvertToVMAPModel(char * outfilename)
delete[] vertices;
delete[] indices;
- delete[] normals;
fclose(output);
@@ -231,15 +138,15 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName,const char*Map
return;
}
fseek(input, 8, SEEK_SET); // get the correct no of vertices
- int nVertices;
- fread(&nVertices, sizeof (int), 1, input);
- fclose(input);
+ int nVertices;
+ fread(&nVertices, sizeof (int), 1, input);
+ fclose(input);
if(nVertices == 0)
{
return;
}
- if(pDirfile)
+ if(pDirfile)
{
int realx1 = (int) ((float) pos.x / 533.333333f);
int realy1 = (int) ((float) pos.z / 533.333333f);
@@ -256,7 +163,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName,const char*Map
nVertices,
realx1, realy1,
realx2, realy2
- );
+ );
}
}
diff --git a/contrib/vmap_extractor_v2/vmapextract/model.h b/contrib/vmap_extractor_v2/vmapextract/model.h
index d655587bfab..4e1a37328f3 100644
--- a/contrib/vmap_extractor_v2/vmapextract/model.h
+++ b/contrib/vmap_extractor_v2/vmapextract/model.h
@@ -4,7 +4,6 @@
#include "vec3d.h"
#include "mpq.h"
#include "modelheaders.h"
-//#include "quaternion.h"
#include <vector>
class Model;
@@ -16,61 +15,45 @@ Vec3D fixCoordSystem(Vec3D v);
class Model
-{
+{
public:
- ModelHeader header;
- ModelAnimation *anims;
- int *globalSequences;
+ ModelHeader header;
+
public:
- bool animGeometry,animTextures,animBones;
- bool animated;
-
- bool isAnimated(MPQFile &f);
- ModelVertex *origVertices;
- Vec3D *vertices, *normals;
- uint16 *indices;
- size_t nIndices;
- bool open();
- bool ConvertToVMAPModel(char * outfilename);
+ uint32 offsBB_vertices, offsBB_indices;
+ Vec3D *BB_vertices, *vertices;
+ uint16 *BB_indices, *indices;
+ size_t nIndices;
+
+ bool open();
+ bool ConvertToVMAPModel(char * outfilename);
public:
- bool ok;
- bool ind;
-
- float rad;
- float trans;
- bool animcalc;
- int anim, animtime;
-
- Model(std::string &filename);
- ~Model();
+ bool ok;
+ Model(std::string &filename);
+ ~Model();
+
private:
- std::string filename;
- char outfilename;
+ std::string filename;
+ char outfilename;
};
-class ModelInstance
+class ModelInstance
{
public:
- Model *model;
-
- int id;
-
- Vec3D pos, rot;
- unsigned int d1, scale;
-
- float frot,w,sc;
+ Model *model;
- int light;
- Vec3D ldir;
- Vec3D lcol;
+ int id;
+ Vec3D pos, rot;
+ unsigned int d1, scale;
+ float w,sc;
- ModelInstance() {}
- ModelInstance(MPQFile &f,const char* ModelInstName,const char*MapName, FILE *pDirfile);
+ ModelInstance() {}
+ ModelInstance(MPQFile &f,const char* ModelInstName,const char*MapName, FILE *pDirfile);
};
diff --git a/contrib/vmap_extractor_v2/vmapextract/modelheaders.h b/contrib/vmap_extractor_v2/vmapextract/modelheaders.h
index 09dc24f14ab..30adf61801f 100644
--- a/contrib/vmap_extractor_v2/vmapextract/modelheaders.h
+++ b/contrib/vmap_extractor_v2/vmapextract/modelheaders.h
@@ -11,293 +11,71 @@ typedef int int32;
#pragma pack(push,1)
struct ModelHeader {
- char id[4];
- uint8 version[4];
- uint32 nameLength;
- uint32 nameOfs;
- uint32 type;
-
- uint32 nGlobalSequences;
- uint32 ofsGlobalSequences;
- uint32 nAnimations;
- uint32 ofsAnimations;
- uint32 nC;
- uint32 ofsC;
- uint32 nD;
- uint32 ofsD;
+ char id[4];
+ uint8 version[4];
+ uint32 nameLength;
+ uint32 nameOfs;
+ uint32 type;
+ uint32 nGlobalSequences;
+ uint32 ofsGlobalSequences;
+ uint32 nAnimations;
+ uint32 ofsAnimations;
+ uint32 nAnimationLookup;
+ uint32 ofsAnimationLookup;
uint32 nBones;
uint32 ofsBones;
- uint32 nF;
- uint32 ofsF;
-
- uint32 nVertices;
- uint32 ofsVertices;
- uint32 nViews;
- uint32 ofsViews;
-
- uint32 nColors;
- uint32 ofsColors;
-
- uint32 nTextures;
- uint32 ofsTextures;
-
- uint32 nTransparency; // H
- uint32 ofsTransparency;
- uint32 nI; // always unused ?
- uint32 ofsI;
- uint32 nTexAnims; // J
- uint32 ofsTexAnims;
- uint32 nK;
- uint32 ofsK;
-
- uint32 nTexFlags;
- uint32 ofsTexFlags;
- uint32 nY;
- uint32 ofsY;
-
- uint32 nTexLookup;
- uint32 ofsTexLookup;
-
- uint32 nTexUnitLookup; // L
- uint32 ofsTexUnitLookup;
- uint32 nTransparencyLookup; // M
- uint32 ofsTransparencyLookup;
- uint32 nTexAnimLookup;
- uint32 ofsTexAnimLookup;
-
- float floats[14];
-
- uint32 nBoundingTriangles;
- uint32 ofsBoundingTriangles;
- uint32 nBoundingVertices;
- uint32 ofsBoundingVertices;
- uint32 nBoundingNormals;
- uint32 ofsBoundingNormals;
-
- uint32 nO;
- uint32 ofsO;
- uint32 nP;
- uint32 ofsP;
- uint32 nQ;
- uint32 ofsQ;
- uint32 nLights; // R
- uint32 ofsLights;
- uint32 nCameras; // S
- uint32 ofsCameras;
- uint32 nT;
- uint32 ofsT;
- uint32 nRibbonEmitters; // U
- uint32 ofsRibbonEmitters;
- uint32 nParticleEmitters; // V
- uint32 ofsParticleEmitters;
-
-};
-
-// block B - animations
-struct ModelAnimation {
- uint32 animID;
- uint32 timeStart;
- uint32 timeEnd;
-
- float moveSpeed;
-
- uint32 loopType;
- uint32 flags;
- uint32 d1;
- uint32 d2;
- uint32 playSpeed; // note: this can't be play speed because it's 0 for some models
-
- Vec3D boxA, boxB;
- float rad;
-
- int16 s[2];
-};
-
-
-// sub-block in block E - animation data
-struct AnimationBlock {
- int16 type; // interpolation type (0=none, 1=linear, 2=hermite)
- int16 seq; // global sequence id or -1
- uint32 nRanges;
- uint32 ofsRanges;
- uint32 nTimes;
- uint32 ofsTimes;
- uint32 nKeys;
- uint32 ofsKeys;
+ uint32 nKeyBoneLookup;
+ uint32 ofsKeyBoneLookup;
+ uint32 nVertices;
+ uint32 ofsVertices;
+ uint32 nViews;
+ uint32 nColors;
+ uint32 ofsColors;
+ uint32 nTextures;
+ uint32 ofsTextures;
+ uint32 nTransparency;
+ uint32 ofsTransparency;
+ uint32 nTextureanimations;
+ uint32 ofsTextureanimations;
+ uint32 nTexReplace;
+ uint32 ofsTexReplace;
+ uint32 nRenderFlags;
+ uint32 ofsRenderFlags;
+ uint32 nBoneLookupTable;
+ uint32 ofsBoneLookupTable;
+ uint32 nTexLookup;
+ uint32 ofsTexLookup;
+ uint32 nTexUnits;
+ uint32 ofsTexUnits;
+ uint32 nTransLookup;
+ uint32 ofsTransLookup;
+ uint32 nTexAnimLookup;
+ uint32 ofsTexAnimLookup;
+ float floats[14];
+ uint32 nBoundingTriangles;
+ uint32 ofsBoundingTriangles;
+ uint32 nBoundingVertices;
+ uint32 ofsBoundingVertices;
+ uint32 nBoundingNormals;
+ uint32 ofsBoundingNormals;
+ uint32 nAttachments;
+ uint32 ofsAttachments;
+ uint32 nAttachLookup;
+ uint32 ofsAttachLookup;
+ uint32 nAttachments_2;
+ uint32 ofsAttachments_2;
+ uint32 nLights;
+ uint32 ofsLights;
+ uint32 nCameras;
+ uint32 ofsCameras;
+ uint32 nCameraLookup;
+ uint32 ofsCameraLookup;
+ uint32 nRibbonEmitters;
+ uint32 ofsRibbonEmitters;
+ uint32 nParticleEmitters;
+ uint32 ofsParticleEmitters;
};
-// block E - bones
-struct ModelBoneDef {
- int32 animid;
- int32 flags;
- int16 parent; // parent bone index
- int16 geoid;
- // new int added to the bone definitions. Added in WoW 2.0
- int32 unknown;
- AnimationBlock translation;
- AnimationBlock rotation;
- AnimationBlock scaling;
- Vec3D pivot;
-};
-
-struct ModelTexAnimDef {
- AnimationBlock trans, rot, scale;
-};
-
-struct ModelVertex {
- Vec3D pos;
- uint8 weights[4];
- uint8 bones[4];
- Vec3D normal;
- Vec2D texcoords;
- int unk1, unk2; // always 0,0 so this is probably unused
-};
-
-struct ModelView {
- uint32 nIndex, ofsIndex; // Vertices in this model (index into vertices[])
- uint32 nTris, ofsTris; // indices
- uint32 nProps, ofsProps; // additional vtx properties
- uint32 nSub, ofsSub; // materials/renderops/submeshes
- uint32 nTex, ofsTex; // material properties/textures
- int32 lod; // LOD bias?
-};
-
-
-/// One material + render operation
-struct ModelGeoset {
- uint16 d1; // mesh part id?
- uint16 d2; // ?
- uint16 vstart; // first vertex
- uint16 vcount; // num vertices
- uint16 istart; // first index
- uint16 icount; // num indices
- uint16 d3; // number of bone indices
- uint16 d4; // offset into bone index list
- uint16 d5; // ?
- uint16 d6; // root bone?
- Vec3D v;
- float unknown[4]; // Added in WoW 2.0?
-};
-
-/// A texture unit (sub of material)
-struct ModelTexUnit{
- // probably the texture units
- // size always >=number of materials it seems
- uint16 flags; // Flags
- uint16 order; // ?
- uint16 op; // Material this texture is part of (index into mat)
- uint16 op2; // Always same as above?
- int16 colorIndex; // color or -1
- uint16 flagsIndex; // more flags...
- uint16 texunit; // Texture unit (0 or 1)
- uint16 d4; // ? (seems to be always 1)
- uint16 textureid; // Texture id (index into global texture list)
- uint16 texunit2; // copy of texture unit value?
- uint16 transid; // transparency id (index into transparency list)
- uint16 texanimid; // texture animation id
-};
-
-// block X - render flags
-struct ModelRenderFlags {
- uint16 flags;
- uint16 blend;
-};
-
-// block G - color defs
-struct ModelColorDef {
- AnimationBlock color;
- AnimationBlock opacity;
-};
-
-// block H - transp defs
-struct ModelTransDef {
- AnimationBlock trans;
-};
-
-struct ModelTextureDef {
- uint32 type;
- uint32 flags;
- uint32 nameLen;
- uint32 nameOfs;
-};
-
-struct ModelLightDef {
- int16 type;
- int16 bone;
- Vec3D pos;
- AnimationBlock ambColor;
- AnimationBlock ambIntensity;
- AnimationBlock color;
- AnimationBlock intensity;
- AnimationBlock attStart;
- AnimationBlock attEnd;
- AnimationBlock unk1;
-};
-
-struct ModelCameraDef {
- int32 id;
- float fov, farclip, nearclip;
- AnimationBlock transPos;
- Vec3D pos;
- AnimationBlock transTarget;
- Vec3D target;
- AnimationBlock rot;
-};
-
-
-struct ModelParticleParams {
- float mid;
- uint32 colors[3];
- float sizes[3];
- int16 d[10];
- float unk[3];
- float scales[3];
- float slowdown;
- float rotation;
- float f2[16];
-};
-
-struct ModelParticleEmitterDef {
- int32 id;
- int32 flags;
- Vec3D pos;
- int16 bone;
- int16 texture;
- int32 nZero1;
- int32 ofsZero1;
- int32 nZero2;
- int32 ofsZero2;
- int16 blend;
- int16 type;
- int16 s1;
- int16 s2;
- int16 cols;
- int16 rows;
- AnimationBlock params[10];
- ModelParticleParams p;
- AnimationBlock unk;
-};
-
-
-struct ModelRibbonEmitterDef {
- int32 id;
- int32 bone;
- Vec3D pos;
- int32 nTextures;
- int32 ofsTextures;
- int32 nUnknown;
- int32 ofsUnknown;
- AnimationBlock color;
- AnimationBlock opacity;
- AnimationBlock above;
- AnimationBlock below;
- float res, length, unk;
- int16 s1, s2;
- AnimationBlock unk1;
- AnimationBlock unk2;
-};
-
-
#pragma pack(pop)
diff --git a/contrib/vmap_extractor_v2/vmapextract/vmapexport.cpp b/contrib/vmap_extractor_v2/vmapextract/vmapexport.cpp
index cc16c9a7176..3dd58a4e3d5 100644
--- a/contrib/vmap_extractor_v2/vmapextract/vmapexport.cpp
+++ b/contrib/vmap_extractor_v2/vmapextract/vmapexport.cpp
@@ -421,6 +421,10 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) {
// open expansion and common files
printf("Opening data files from data directory.\n");
+ sprintf(path, "%slichking.mpq", input_path);
+ pArchiveNames.push_back(path);
+ sprintf(path, "%scommon-2.mpq", input_path);
+ pArchiveNames.push_back(path);
sprintf(path, "%sexpansion.mpq", input_path);
pArchiveNames.push_back(path);
sprintf(path, "%scommon.mpq", input_path);
@@ -432,6 +436,8 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) {
for (std::vector<std::string>::iterator i = locales.begin(); i != locales.end(); i++)
{
printf("Locale: %s\n", i->c_str());
+ sprintf(path, "%s%s\\lichking-locale-%s.mpq", input_path, i->c_str(), i->c_str());
+ pArchiveNames.push_back(path);
sprintf(path, "%s%s\\expansion-locale-%s.mpq", input_path, i->c_str(), i->c_str());
pArchiveNames.push_back(path);
sprintf(path, "%s%s\\locale-%s.mpq", input_path, i->c_str(), i->c_str());
diff --git a/contrib/vmap_extractor_v2/vmapextract/wmo.cpp b/contrib/vmap_extractor_v2/vmapextract/wmo.cpp
index f1868ccf64a..9d8b8f79770 100644
--- a/contrib/vmap_extractor_v2/vmapextract/wmo.cpp
+++ b/contrib/vmap_extractor_v2/vmapextract/wmo.cpp
@@ -241,205 +241,209 @@ bool WMOGroup::open()
//----------------------------------------------------------------------------
int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData)
{
- if(pPreciseVectorData) {
- fwrite(&liquflags,sizeof(uint32),1,output);
- char GRP[] = "GRP ";
- fwrite(GRP,1,4,output);
-
- int k = 0;
- int moba_batch = moba_size/12;
- MobaEx = new int[moba_batch*4];
- for(int i=8; i<moba_size; i+=12)
- {
- MobaEx[k++] = MOBA[i];
- }
- delete [] MOBA;
- int moba_size_grp = moba_batch*4+4;
- fwrite(&moba_size_grp,4,1,output);
- fwrite(&moba_batch,4,1,output);
- fwrite(MobaEx,4,k,output);
- delete [] MobaEx;
-
- uint32 nIdexes = nTriangles * 3;
-
- if(fwrite("INDX",4, 1, output) != 1) { printf("Error while writing file nbraches ID"); exit(0); }
- int wsize = sizeof(uint32) + sizeof(unsigned short) * nIdexes;
- if(fwrite(&wsize, sizeof(int), 1, output) != 1) { printf("Error while writing file wsize"); }
- if(fwrite(&nIdexes, sizeof(uint32), 1, output) != 1) { printf("Error while writing file nIndexes"); exit(0); }
- if(nIdexes >0) {
- if(fwrite(MOVI, sizeof(unsigned short), nIdexes, output) != nIdexes) { printf("Error while writing file indexarray"); exit(0); }
- }
-
- if(fwrite("VERT",4, 1, output) != 1) { printf("Error while writing file nbraches ID"); exit(0); }
- wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
- if(fwrite(&wsize, sizeof(int), 1, output) != 1) { printf("Error while writing file wsize"); }
- if(fwrite(&nVertices, sizeof(int), 1, output) != 1) { printf("Error while writing file nVertices"); exit(0); }
- if(nVertices >0) {
- if(fwrite(MOVT, sizeof(float)*3, nVertices, output) != nVertices) { printf("Error while writing file vectors"); exit(0); }
- }
-
- if(LiquEx_size != 0)
- {
- int LIQU_h[] = {0x5551494C,LiquEx_size+8,hlq_xverts,hlq_yverts};// "LIQU"
- fwrite(LIQU_h,4,4,output);
- fwrite(LiquEx,4,LiquEx_size/4,output);
- delete [] LiquEx;
- }
-
- return nTriangles;
- } else {
- //printf("Convert GroupWmo...\n");
- //-------GRP -------------------------------------
- fwrite(&liquflags,sizeof(uint32),1,output);
- char GRP[] = "GRP ";
- fwrite(GRP,1,4,output);
- int k = 0;
- int moba_batch = moba_size/12;
- MobaEx = new int[moba_batch*4];
- for(int i=8; i<moba_size; i+=12)
- {
- MobaEx[k++] = MOBA[i];
- }
- delete [] MOBA;
- int moba_size_grp = moba_batch*4+4;
- fwrite(&moba_size_grp,4,1,output);
- fwrite(&moba_batch,4,1,output);
- fwrite(MobaEx,4,k,output);
- delete [] MobaEx;
-
- //-------INDX------------------------------------
- //-------MOPY--------
- int n = 0;
- int j = 0;
- MopyEx = new char[mopy_size];
- IndexExTr = new int[mopy_size];
- for (int i=0; i<mopy_size; i+=2)
- {
- if ((int)MOPY[i]==0x00000008 ||(int)MOPY[i]==0x00000009 ||(int)MOPY[i]==0x00000020 ||(int)MOPY[i]==0x00000021 ||(int)MOPY[i]==0x00000022 ||(int)MOPY[i]==0x00000048 ||(int)MOPY[i]==0x00000049 ||(int)MOPY[i]==0x00000060 ||(int)MOPY[i]==0x00000061 ||(int)MOPY[i]==0x00000062 ||(int)MOPY[i]==0x0000000A ||(int)MOPY[i]==0x0000004A)
- {
- MopyEx[n] = MOPY[i];
- MopyEx[(n+1)] = MOPY[(i+1)];
- IndexExTr[j] = i/2;
- j+=1;
- n+=2;
- }
- }
- MopyEx_size = n;
- IndexExTr_size = j;
- delete [] MOPY;
- delete [] MopyEx;
-
- //---------MOVI-----------
- MoviEx = new uint16[IndexExTr_size*3];
- int m = 0;
- for (int i=0; i<IndexExTr_size; i++)
- {
- int n = 0;
- n = IndexExTr[i]*3;
- for (int x=0; x<3; x++)
- {
- MoviEx[m] = MOVI[n];
- n++;
- m++;
- }
- }
- delete [] MOVI;
-
- MoviExSort = new uint16[IndexExTr_size*3];
- for(int y=0; y<IndexExTr_size*3; y++)
- {
- MoviExSort[y]=MoviEx[y];
- }
-
- uint16 hold;
- for (int pass = 1; pass < IndexExTr_size*3; pass++)
- {
- for (int i=0; i < IndexExTr_size*3-1; i++)
- {
- if (MoviExSort[i] > MoviExSort[i+1])
- {
- hold = MoviExSort[i];
- MoviExSort[i] = MoviExSort[i+1];
- MoviExSort[i+1] = hold;
- }
- //double = 65535
- else
- if (MoviExSort[i] == MoviExSort[i+1])
- MoviExSort[i+1] = 65535;
- }
- }
- // double delet
- uint16 s = 0;
- for (int i=0; i < IndexExTr_size*3; i++)
- {
- if (MoviExSort[i]!=65535)
- {
- MoviExSort[s] = MoviExSort[i];
- s++;
- }
- }
- MovtExSort = new uint16[s];
- for (int i=0; i < s; i++)
- {
- MovtExSort[i] = MoviExSort[i];
- }
-
- for (int i=0; i < IndexExTr_size*3; i++)
- {
- uint16 b = MoviEx[i];
- for (uint16 x = 0; x < s; x++)
- {
- if(MoviExSort[x] == b)
- {
-
- MoviEx[i] = x;
- break;
- }
- }
-
- }
- int INDX[] = {0x58444E49,IndexExTr_size*6+4,IndexExTr_size*3};
- fwrite(INDX,4,3,output);
- fwrite(MoviEx,2,IndexExTr_size*3,output);
-
- delete [] MoviEx;
- delete [] MoviExSort;
- delete [] IndexExTr;
-
- //----------VERT---------
- //-----MOVT----------
- int d = 0;
- MovtEx = new float[s*3];
- for (uint16 i=0; i<s; i++)
- {
- int c=0;//!!!!data in MovtExSort[i] more uint16 in great group wmo files!!!!
- c = MovtExSort[i]*3;
- for (int y=0; y<3; y++)
- {
- MovtEx[d] = MOVT[c];
- c++;
- d++;
- }
- }
- int VERT[] = {0x54524556,d*4+4,d*4/12};// "VERT"
- fwrite(VERT,4,3,output);
- fwrite(MovtEx,4,d,output);
- //------LIQU------------------------
- if(LiquEx_size != 0)
- {
- int LIQU_h[] = {0x5551494C,LiquEx_size+8,hlq_xverts,hlq_yverts};// "LIQU"
- fwrite(LIQU_h,4,4,output);
- fwrite(LiquEx,4,LiquEx_size/4,output);
- delete [] LiquEx;
- }
-
- delete [] MOVT;
- delete [] MovtEx;
- delete [] MovtExSort;
-
- //---------------------------------------------
- return IndexExTr_size;
- }
+ if(pPreciseVectorData) {
+ fwrite(&liquflags,sizeof(uint32),1,output);
+ char GRP[] = "GRP ";
+ fwrite(GRP,1,4,output);
+
+ int k = 0;
+ int moba_batch = moba_size/12;
+ MobaEx = new int[moba_batch*4];
+ for(int i=8; i<moba_size; i+=12)
+ {
+ MobaEx[k++] = MOBA[i];
+ }
+ delete [] MOBA;
+ int moba_size_grp = moba_batch*4+4;
+ fwrite(&moba_size_grp,4,1,output);
+ fwrite(&moba_batch,4,1,output);
+ fwrite(MobaEx,4,k,output);
+ delete [] MobaEx;
+
+ uint32 nIdexes = nTriangles * 3;
+
+ if(fwrite("INDX",4, 1, output) != 1) { printf("Error while writing file nbraches ID"); exit(0); }
+ int wsize = sizeof(uint32) + sizeof(unsigned short) * nIdexes;
+ if(fwrite(&wsize, sizeof(int), 1, output) != 1) { printf("Error while writing file wsize"); }
+ if(fwrite(&nIdexes, sizeof(uint32), 1, output) != 1) { printf("Error while writing file nIndexes"); exit(0); }
+ if(nIdexes >0) {
+ if(fwrite(MOVI, sizeof(unsigned short), nIdexes, output) != nIdexes) { printf("Error while writing file indexarray"); exit(0); }
+ }
+
+ if(fwrite("VERT",4, 1, output) != 1) { printf("Error while writing file nbraches ID"); exit(0); }
+ wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
+ if(fwrite(&wsize, sizeof(int), 1, output) != 1) { printf("Error while writing file wsize"); }
+ if(fwrite(&nVertices, sizeof(int), 1, output) != 1) { printf("Error while writing file nVertices"); exit(0); }
+ if(nVertices >0) {
+ if(fwrite(MOVT, sizeof(float)*3, nVertices, output) != nVertices) { printf("Error while writing file vectors"); exit(0); }
+ }
+
+ if(LiquEx_size != 0)
+ {
+ int LIQU_h[] = {0x5551494C,LiquEx_size+8,hlq_xverts,hlq_yverts};// "LIQU"
+ fwrite(LIQU_h,4,4,output);
+ fwrite(LiquEx,4,LiquEx_size/4,output);
+ delete [] LiquEx;
+ }
+
+ return nTriangles;
+ } else {
+ //printf("Convert GroupWmo...\n");
+ //-------GRP -------------------------------------
+ fwrite(&liquflags,sizeof(uint32),1,output);
+ char GRP[] = "GRP ";
+ fwrite(GRP,1,4,output);
+ int k = 0;
+ int moba_batch = moba_size/12;
+ MobaEx = new int[moba_batch*4];
+ for(int i=8; i<moba_size; i+=12)
+ {
+ MobaEx[k++] = MOBA[i];
+ }
+ delete [] MOBA;
+ int moba_size_grp = moba_batch*4+4;
+ fwrite(&moba_size_grp,4,1,output);
+ fwrite(&moba_batch,4,1,output);
+ fwrite(MobaEx,4,k,output);
+ delete [] MobaEx;
+
+ //-------INDX------------------------------------
+ //-------MOPY--------
+ int n = 0;
+ int j = 0;
+ MopyEx = new char[mopy_size];
+ IndexExTr = new int[mopy_size];
+ for (int i=0; i<mopy_size; i+=2)
+ {
+ // Skip no collision triangles
+ if ((int)MOPY[i]&WMO_MATERIAL_NO_COLLISION)
+ continue;
+ // Use only this triangles
+ if ((int)MOPY[i]&(WMO_MATERIAL_HINT|WMO_MATERIAL_COLLIDE_HIT))
+ {
+ MopyEx[n] = MOPY[i];
+ MopyEx[(n+1)] = MOPY[(i+1)];
+ IndexExTr[j] = i/2;
+ j+=1;
+ n+=2;
+ }
+ }
+ MopyEx_size = n;
+ IndexExTr_size = j;
+ delete [] MOPY;
+ delete [] MopyEx;
+
+ //---------MOVI-----------
+ MoviEx = new uint16[IndexExTr_size*3];
+ int m = 0;
+ for (int i=0; i<IndexExTr_size; i++)
+ {
+ int n = 0;
+ n = IndexExTr[i]*3;
+ for (int x=0; x<3; x++)
+ {
+ MoviEx[m] = MOVI[n];
+ n++;
+ m++;
+ }
+ }
+ delete [] MOVI;
+
+ MoviExSort = new uint16[IndexExTr_size*3];
+ for(int y=0; y<IndexExTr_size*3; y++)
+ {
+ MoviExSort[y]=MoviEx[y];
+ }
+
+ uint16 hold;
+ for (int pass = 1; pass < IndexExTr_size*3; pass++)
+ {
+ for (int i=0; i < IndexExTr_size*3-1; i++)
+ {
+ if (MoviExSort[i] > MoviExSort[i+1])
+ {
+ hold = MoviExSort[i];
+ MoviExSort[i] = MoviExSort[i+1];
+ MoviExSort[i+1] = hold;
+ }
+ //double = 65535
+ else
+ if (MoviExSort[i] == MoviExSort[i+1])
+ MoviExSort[i+1] = 65535;
+ }
+ }
+ // double delet
+ uint16 s = 0;
+ for (int i=0; i < IndexExTr_size*3; i++)
+ {
+ if (MoviExSort[i]!=65535)
+ {
+ MoviExSort[s] = MoviExSort[i];
+ s++;
+ }
+ }
+ MovtExSort = new uint16[s];
+ for (int i=0; i < s; i++)
+ {
+ MovtExSort[i] = MoviExSort[i];
+ }
+
+ for (int i=0; i < IndexExTr_size*3; i++)
+ {
+ uint16 b = MoviEx[i];
+ for (uint16 x = 0; x < s; x++)
+ {
+ if(MoviExSort[x] == b)
+ {
+
+ MoviEx[i] = x;
+ break;
+ }
+ }
+
+ }
+ int INDX[] = {0x58444E49,IndexExTr_size*6+4,IndexExTr_size*3};
+ fwrite(INDX,4,3,output);
+ fwrite(MoviEx,2,IndexExTr_size*3,output);
+
+ delete [] MoviEx;
+ delete [] MoviExSort;
+ delete [] IndexExTr;
+
+ //----------VERT---------
+ //-----MOVT----------
+ int d = 0;
+ MovtEx = new float[s*3];
+ for (uint16 i=0; i<s; i++)
+ {
+ int c=0;//!!!!data in MovtExSort[i] more uint16 in great group wmo files!!!!
+ c = MovtExSort[i]*3;
+ for (int y=0; y<3; y++)
+ {
+ MovtEx[d] = MOVT[c];
+ c++;
+ d++;
+ }
+ }
+ int VERT[] = {0x54524556,d*4+4,d*4/12};// "VERT"
+ fwrite(VERT,4,3,output);
+ fwrite(MovtEx,4,d,output);
+ //------LIQU------------------------
+ if(LiquEx_size != 0)
+ {
+ int LIQU_h[] = {0x5551494C,LiquEx_size+8,hlq_xverts,hlq_yverts};// "LIQU"
+ fwrite(LIQU_h,4,4,output);
+ fwrite(LiquEx,4,LiquEx_size/4,output);
+ delete [] LiquEx;
+ }
+
+ delete [] MOVT;
+ delete [] MovtEx;
+ delete [] MovtExSort;
+
+ //---------------------------------------------
+ return IndexExTr_size;
+ }
}
WMOGroup::~WMOGroup()
diff --git a/contrib/vmap_extractor_v2/vmapextract/wmo.h b/contrib/vmap_extractor_v2/vmapextract/wmo.h
index 832f9265434..436aa1ac60e 100644
--- a/contrib/vmap_extractor_v2/vmapextract/wmo.h
+++ b/contrib/vmap_extractor_v2/vmapextract/wmo.h
@@ -10,6 +10,14 @@
#include <set>
#include "mpq.h"
+// MOPY flags
+#define WMO_MATERIAL_NOCAMCOLLIDE 0x01
+#define WMO_MATERIAL_DETAIL 0x02
+#define WMO_MATERIAL_NO_COLLISION 0x04
+#define WMO_MATERIAL_HINT 0x08
+#define WMO_MATERIAL_RENDER 0x10
+#define WMO_MATERIAL_COLLIDE_HIT 0x20
+#define WMO_MATERIAL_WALL_SURFACE 0x40
class WMOInstance;
class WMOManager;
diff --git a/dep/Makefile.am b/dep/Makefile.am
new file mode 100644
index 00000000000..481af87b9e4
--- /dev/null
+++ b/dep/Makefile.am
@@ -0,0 +1,29 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = include lib src
+
+if TRI_BUILD_ACE
+SUBDIRS += ACE_wrappers
+endif
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/dep/include/Makefile.am b/dep/include/Makefile.am
new file mode 100644
index 00000000000..2259d115d2d
--- /dev/null
+++ b/dep/include/Makefile.am
@@ -0,0 +1,263 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## Additional files to include when running 'make dist'
+# G3DLite header files
+EXTRA_DIST = \
+ g3dlite/G3D/AABox.h \
+ g3dlite/G3D/Array.h \
+ g3dlite/G3D/Box.h \
+ g3dlite/G3D/CollisionDetection.h \
+ g3dlite/G3D/CoordinateFrame.h \
+ g3dlite/G3D/Crypto.h \
+ g3dlite/G3D/debug.h \
+ g3dlite/G3D/format.h \
+ g3dlite/G3D/g3dmath.h \
+ g3dlite/G3D/g3dmath.inl \
+ g3dlite/G3D/GCamera.h \
+ g3dlite/G3D/Line.h \
+ g3dlite/G3D/Matrix3.h \
+ g3dlite/G3D/Plane.h \
+ g3dlite/G3D/platform.h \
+ g3dlite/G3D/Quat.h \
+ g3dlite/G3D/Quat.inl \
+ g3dlite/G3D/Ray.h \
+ g3dlite/G3D/RegistryUtil.h \
+ g3dlite/G3D/Sphere.h \
+ g3dlite/G3D/stringutils.h \
+ g3dlite/G3D/System.h \
+ g3dlite/G3D/Table.h \
+ g3dlite/G3D/Triangle.h \
+ g3dlite/G3D/Vector2.h \
+ g3dlite/G3D/Vector2.inl \
+ g3dlite/G3D/Vector2int16.h \
+ g3dlite/G3D/Vector3.h \
+ g3dlite/G3D/Vector3.inl \
+ g3dlite/G3D/Vector3int16.h \
+ g3dlite/G3D/Vector4.h \
+ g3dlite/G3D/Vector4.inl
+
+# MySQL header files for Win32 builds
+EXTRA_DIST += \
+ mysql/config-netware.h \
+ mysql/config-os2.h \
+ mysql/config-win.h \
+ mysql/errmsg.h \
+ mysql/libmysqld.def \
+ mysql/Libmysql.def \
+ mysql/m_ctype.h \
+ mysql/m_string.h \
+ mysql/my_alloc.h \
+ mysql/my_dbug.h \
+ mysql/my_getopt.h \
+ mysql/my_global.h \
+ mysql/my_list.h \
+ mysql/my_pthread.h \
+ mysql/mysql_com.h \
+ mysql/mysqld_error.h \
+ mysql/mysql_embed.h \
+ mysql/mysql.h \
+ mysql/mysql_time.h \
+ mysql/mysql_version.h \
+ mysql/my_sys.h \
+ mysql/raid.h \
+ mysql/typelib.h
+
+# OpenSSL header files for Win32 builds
+EXTRA_DIST += \
+ openssl/aes.h \
+ openssl/asn1.h \
+ openssl/asn1_mac.h \
+ openssl/asn1t.h \
+ openssl/bio.h \
+ openssl/blowfish.h \
+ openssl/bn.h \
+ openssl/buffer.h \
+ openssl/cast.h \
+ openssl/comp.h \
+ openssl/conf_api.h \
+ openssl/conf.h \
+ openssl/crypto.h \
+ openssl/des.h \
+ openssl/des_old.h \
+ openssl/dh.h \
+ openssl/dsa.h \
+ openssl/dso.h \
+ openssl/dtls1.h \
+ openssl/ebcdic.h \
+ openssl/ecdh.h \
+ openssl/ecdsa.h \
+ openssl/ec.h \
+ openssl/engine.h \
+ openssl/e_os2.h \
+ openssl/err.h \
+ openssl/evp.h \
+ openssl/hmac.h \
+ openssl/idea.h \
+ openssl/krb5_asn.h \
+ openssl/kssl.h \
+ openssl/lhash.h \
+ openssl/md2.h \
+ openssl/md4.h \
+ openssl/md5.h \
+ openssl/mdc2.h \
+ openssl/objects.h \
+ openssl/obj_mac.h \
+ openssl/ocsp.h \
+ openssl/opensslconf.h \
+ openssl/opensslv.h \
+ openssl/ossl_typ.h \
+ openssl/pem2.h \
+ openssl/pem.h \
+ openssl/pkcs12.h \
+ openssl/pkcs7.h \
+ openssl/pq_compat.h \
+ openssl/pqueue.h \
+ openssl/rand.h \
+ openssl/rc2.h \
+ openssl/rc4.h \
+ openssl/rc5.h \
+ openssl/ripemd.h \
+ openssl/rsa.h \
+ openssl/safestack.h \
+ openssl/sha.h \
+ openssl/ssl23.h \
+ openssl/ssl2.h \
+ openssl/ssl3.h \
+ openssl/ssl.h \
+ openssl/stack.h \
+ openssl/store.h \
+ openssl/symhacks.h \
+ openssl/tls1.h \
+ openssl/tmdiff.h \
+ openssl/txt_db.h \
+ openssl/ui_compat.h \
+ openssl/ui.h \
+ openssl/x509.h \
+ openssl/x509v3.h \
+ openssl/x509_vfy.h
+
+# PostgreSQL header files for Win32 builds
+EXTRA_DIST += \
+ postgre/libpq-fe.h \
+ postgre/pg_type.h \
+ postgre/postgres_ext.h
+
+# SQLite header files for Win32 builds
+EXTRA_DIST += \
+ sqlite/sqlite.h
+
+# Sockets header files for Win32 builds
+EXTRA_DIST += \
+ sockets\Base64.h \
+ sockets\CircularBuffer.h \
+ sockets\IFile.h \
+ sockets\Ipv4Address.h \
+ sockets\Ipv6Address.h \
+ sockets\ISocketHandler.h \
+ sockets\ListenSocket.h \
+ sockets\Mutex.h \
+ sockets\Parse.h \
+ sockets\RandomNumber.h \
+ sockets\ResolvServer.h \
+ sockets\ResolvSocket.h \
+ sockets\SctpSocket.h \
+ sockets\Socket.h \
+ sockets\socket_include.h \
+ sockets\SocketAddress.h \
+ sockets\SocketHandler.h \
+ sockets\sockets-config.h \
+ sockets\StdLog.h \
+ sockets\StdoutLog.h \
+ sockets\TcpSocket.h \
+ sockets\Thread.h \
+ sockets\UdpSocket.h \
+ sockets\Uid.h \
+ sockets\Utility.h
+
+# VLD header files for Win32 builds
+EXTRA_DIST += \
+ vld/vld.h
+
+# Zlib header files for Win32 builds
+EXTRA_DIST += \
+ zlib/zconf.h \
+ zlib/zlib.h
+
+# ZThread header files for Win32 builds
+EXTRA_DIST += \
+ zthread/AtomicCount.h \
+ zthread/Barrier.h \
+ zthread/BiasedReadWriteLock.h \
+ zthread/BlockingQueue.h \
+ zthread/BoundedQueue.h \
+ zthread/Cancelable.h \
+ zthread/ClassLockable.h \
+ zthread/ConcurrentExecutor.h \
+ zthread/Condition.h \
+ zthread/Config.h \
+ zthread/CountedPtr.h \
+ zthread/CountingSemaphore.h \
+ zthread/Exceptions.h \
+ zthread/Executor.h \
+ zthread/FairReadWriteLock.h \
+ zthread/FastMutex.h \
+ zthread/FastRecursiveMutex.h \
+ zthread/Guard.h \
+ zthread/GuardedClass.h \
+ zthread/Lockable.h \
+ zthread/LockedQueue.h \
+ zthread/MonitoredQueue.h \
+ zthread/Mutex.h \
+ zthread/NonCopyable.h \
+ zthread/PoolExecutor.h \
+ zthread/Priority.h \
+ zthread/PriorityCondition.h \
+ zthread/PriorityInheritanceMutex.h \
+ zthread/PriorityMutex.h \
+ zthread/PrioritySemaphore.h \
+ zthread/Queue.h \
+ zthread/ReadWriteLock.h \
+ zthread/RecursiveMutex.h \
+ zthread/Runnable.h \
+ zthread/Semaphore.h \
+ zthread/Singleton.h \
+ zthread/SynchronousExecutor.h \
+ zthread/Task.h \
+ zthread/Thread.h \
+ zthread/ThreadLocal.h \
+ zthread/ThreadLocalImpl.h \
+ zthread/ThreadedExecutor.h \
+ zthread/Time.h \
+ zthread/Waitable.h \
+ zthread/ZThread.h
+
+# Mersenne Twister random number generator header files
+EXTRA_DIST += \
+ mersennetwister/MersenneTwister.h
+
+# UTF8-CPP header files
+EXTRA_DIST += \
+ utf8cpp/utf8.h \
+ utf8cpp/utf8/checked.h \
+ utf8cpp/utf8/core.h \
+ utf8cpp/utf8/unchecked.h
diff --git a/dep/include/mersennetwister/MersenneTwister.h b/dep/include/mersennetwister/MersenneTwister.h
index 708b675eed4..0fbd9242e45 100644
--- a/dep/include/mersennetwister/MersenneTwister.h
+++ b/dep/include/mersennetwister/MersenneTwister.h
@@ -238,7 +238,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength )
initialize(19650218UL);
register int i = 1;
register uint32 j = 0;
- register int k = ( N > seedLength ? N : seedLength );
+ register int k = ( N > int(seedLength) ? N : int(seedLength) );
for( ; k; --k )
{
state[i] =
diff --git a/dep/include/openssl/aes.h b/dep/include/openssl/aes.h
index c9198db7dd3..450f2b4051b 100644
--- a/dep/include/openssl/aes.h
+++ b/dep/include/openssl/aes.h
@@ -7,7 +7,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -58,14 +58,18 @@
#error AES is disabled.
#endif
-#define AES_ENCRYPT 1
-#define AES_DECRYPT 0
+#define AES_ENCRYPT 1
+#define AES_DECRYPT 0
/* Because array size can't be a const in C, the following two are macros.
Both sizes are in bytes. */
#define AES_MAXNR 14
#define AES_BLOCK_SIZE 16
+#ifdef OPENSSL_FIPS
+#define FIPS_AES_SIZE_T int
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -84,56 +88,61 @@ typedef struct aes_key_st AES_KEY;
const char *AES_options(void);
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
- AES_KEY *key);
+ AES_KEY *key);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
- AES_KEY *key);
+ AES_KEY *key);
void AES_encrypt(const unsigned char *in, unsigned char *out,
- const AES_KEY *key);
+ const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
- const AES_KEY *key);
+ const AES_KEY *key);
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
- const AES_KEY *key, const int enc);
+ const AES_KEY *key, const int enc);
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, const int enc);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, int *num, const int enc);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, int *num, const int enc);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, int *num, const int enc);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
- const int nbits,const AES_KEY *key,
- unsigned char *ivec,const int enc);
+ const int nbits,const AES_KEY *key,
+ unsigned char *ivec,const int enc);
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, int *num);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, int *num);
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char ivec[AES_BLOCK_SIZE],
- unsigned char ecount_buf[AES_BLOCK_SIZE],
- unsigned int *num);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char ivec[AES_BLOCK_SIZE],
+ unsigned char ecount_buf[AES_BLOCK_SIZE],
+ unsigned int *num);
/* For IGE, see also http://www.links.org/files/openssl-ige.pdf */
/* NB: the IV is _two_ blocks long */
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- unsigned char *ivec, const int enc);
+ const unsigned long length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
/* NB: the IV is _four_ blocks long */
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
- const unsigned long length, const AES_KEY *key,
- const AES_KEY *key2, const unsigned char *ivec,
- const int enc);
+ const unsigned long length, const AES_KEY *key,
+ const AES_KEY *key2, const unsigned char *ivec,
+ const int enc);
+int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
#ifdef __cplusplus
}
#endif
#endif /* !HEADER_AES_H */
-
diff --git a/dep/include/openssl/asn1.h b/dep/include/openssl/asn1.h
index 759b8a590e0..424cd348bb5 100644
--- a/dep/include/openssl/asn1.h
+++ b/dep/include/openssl/asn1.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -83,82 +83,87 @@
extern "C" {
#endif
-#define V_ASN1_UNIVERSAL 0x00
-#define V_ASN1_APPLICATION 0x40
-#define V_ASN1_CONTEXT_SPECIFIC 0x80
-#define V_ASN1_PRIVATE 0xc0
-
-#define V_ASN1_CONSTRUCTED 0x20
-#define V_ASN1_PRIMITIVE_TAG 0x1f
-#define V_ASN1_PRIMATIVE_TAG 0x1f
-
-#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
-#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
-#define V_ASN1_ANY -4 /* used in ASN1 template code */
-
-#define V_ASN1_NEG 0x100 /* negative flag */
-
-#define V_ASN1_UNDEF -1
-#define V_ASN1_EOC 0
-#define V_ASN1_BOOLEAN 1 /**/
-#define V_ASN1_INTEGER 2
-#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
-#define V_ASN1_BIT_STRING 3
-#define V_ASN1_OCTET_STRING 4
-#define V_ASN1_NULL 5
-#define V_ASN1_OBJECT 6
-#define V_ASN1_OBJECT_DESCRIPTOR 7
-#define V_ASN1_EXTERNAL 8
-#define V_ASN1_REAL 9
-#define V_ASN1_ENUMERATED 10
-#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
-#define V_ASN1_UTF8STRING 12
-#define V_ASN1_SEQUENCE 16
-#define V_ASN1_SET 17
-#define V_ASN1_NUMERICSTRING 18 /**/
-#define V_ASN1_PRINTABLESTRING 19
-#define V_ASN1_T61STRING 20
-#define V_ASN1_TELETEXSTRING 20 /* alias */
-#define V_ASN1_VIDEOTEXSTRING 21 /**/
-#define V_ASN1_IA5STRING 22
-#define V_ASN1_UTCTIME 23
-#define V_ASN1_GENERALIZEDTIME 24 /**/
-#define V_ASN1_GRAPHICSTRING 25 /**/
-#define V_ASN1_ISO64STRING 26 /**/
-#define V_ASN1_VISIBLESTRING 26 /* alias */
-#define V_ASN1_GENERALSTRING 27 /**/
-#define V_ASN1_UNIVERSALSTRING 28 /**/
-#define V_ASN1_BMPSTRING 30
+#define V_ASN1_UNIVERSAL 0x00
+#define V_ASN1_APPLICATION 0x40
+#define V_ASN1_CONTEXT_SPECIFIC 0x80
+#define V_ASN1_PRIVATE 0xc0
+
+#define V_ASN1_CONSTRUCTED 0x20
+#define V_ASN1_PRIMITIVE_TAG 0x1f
+#define V_ASN1_PRIMATIVE_TAG 0x1f
+
+#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
+#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
+#define V_ASN1_ANY -4 /* used in ASN1 template code */
+
+#define V_ASN1_NEG 0x100 /* negative flag */
+
+#define V_ASN1_UNDEF -1
+#define V_ASN1_EOC 0
+#define V_ASN1_BOOLEAN 1 /**/
+#define V_ASN1_INTEGER 2
+#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
+#define V_ASN1_BIT_STRING 3
+#define V_ASN1_OCTET_STRING 4
+#define V_ASN1_NULL 5
+#define V_ASN1_OBJECT 6
+#define V_ASN1_OBJECT_DESCRIPTOR 7
+#define V_ASN1_EXTERNAL 8
+#define V_ASN1_REAL 9
+#define V_ASN1_ENUMERATED 10
+#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
+#define V_ASN1_UTF8STRING 12
+#define V_ASN1_SEQUENCE 16
+#define V_ASN1_SET 17
+#define V_ASN1_NUMERICSTRING 18 /**/
+#define V_ASN1_PRINTABLESTRING 19
+#define V_ASN1_T61STRING 20
+#define V_ASN1_TELETEXSTRING 20 /* alias */
+#define V_ASN1_VIDEOTEXSTRING 21 /**/
+#define V_ASN1_IA5STRING 22
+#define V_ASN1_UTCTIME 23
+#define V_ASN1_GENERALIZEDTIME 24 /**/
+#define V_ASN1_GRAPHICSTRING 25 /**/
+#define V_ASN1_ISO64STRING 26 /**/
+#define V_ASN1_VISIBLESTRING 26 /* alias */
+#define V_ASN1_GENERALSTRING 27 /**/
+#define V_ASN1_UNIVERSALSTRING 28 /**/
+#define V_ASN1_BMPSTRING 30
/* For use with d2i_ASN1_type_bytes() */
-#define B_ASN1_NUMERICSTRING 0x0001
-#define B_ASN1_PRINTABLESTRING 0x0002
-#define B_ASN1_T61STRING 0x0004
-#define B_ASN1_TELETEXSTRING 0x0004
-#define B_ASN1_VIDEOTEXSTRING 0x0008
-#define B_ASN1_IA5STRING 0x0010
-#define B_ASN1_GRAPHICSTRING 0x0020
-#define B_ASN1_ISO64STRING 0x0040
-#define B_ASN1_VISIBLESTRING 0x0040
-#define B_ASN1_GENERALSTRING 0x0080
-#define B_ASN1_UNIVERSALSTRING 0x0100
-#define B_ASN1_OCTET_STRING 0x0200
-#define B_ASN1_BIT_STRING 0x0400
-#define B_ASN1_BMPSTRING 0x0800
-#define B_ASN1_UNKNOWN 0x1000
-#define B_ASN1_UTF8STRING 0x2000
-#define B_ASN1_UTCTIME 0x4000
-#define B_ASN1_GENERALIZEDTIME 0x8000
-#define B_ASN1_SEQUENCE 0x10000
+#define B_ASN1_NUMERICSTRING 0x0001
+#define B_ASN1_PRINTABLESTRING 0x0002
+#define B_ASN1_T61STRING 0x0004
+#define B_ASN1_TELETEXSTRING 0x0004
+#define B_ASN1_VIDEOTEXSTRING 0x0008
+#define B_ASN1_IA5STRING 0x0010
+#define B_ASN1_GRAPHICSTRING 0x0020
+#define B_ASN1_ISO64STRING 0x0040
+#define B_ASN1_VISIBLESTRING 0x0040
+#define B_ASN1_GENERALSTRING 0x0080
+#define B_ASN1_UNIVERSALSTRING 0x0100
+#define B_ASN1_OCTET_STRING 0x0200
+#define B_ASN1_BIT_STRING 0x0400
+#define B_ASN1_BMPSTRING 0x0800
+#define B_ASN1_UNKNOWN 0x1000
+#define B_ASN1_UTF8STRING 0x2000
+#define B_ASN1_UTCTIME 0x4000
+#define B_ASN1_GENERALIZEDTIME 0x8000
+#define B_ASN1_SEQUENCE 0x10000
/* For use with ASN1_mbstring_copy() */
-#define MBSTRING_FLAG 0x1000
-#define MBSTRING_UTF8 (MBSTRING_FLAG)
-#define MBSTRING_ASC (MBSTRING_FLAG|1)
-#define MBSTRING_BMP (MBSTRING_FLAG|2)
-#define MBSTRING_UNIV (MBSTRING_FLAG|4)
+#define MBSTRING_FLAG 0x1000
+#define MBSTRING_UTF8 (MBSTRING_FLAG)
+#define MBSTRING_ASC (MBSTRING_FLAG|1)
+#define MBSTRING_BMP (MBSTRING_FLAG|2)
+#define MBSTRING_UNIV (MBSTRING_FLAG|4)
+
+#define SMIME_OLDMIME 0x400
+#define SMIME_CRLFEOL 0x800
+#define SMIME_STREAM 0x1000
struct X509_algor_st;
+DECLARE_STACK_OF(X509_ALGOR)
#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
@@ -168,68 +173,75 @@ struct X509_algor_st;
the old ASN1 parsing macros are gone, we can throw this away
as well... */
typedef struct asn1_ctx_st
- {
- unsigned char *p;/* work char pointer */
- int eos; /* end of sequence read for indefinite encoding */
- int error; /* error code to use when returning an error */
- int inf; /* constructed if 0x20, indefinite is 0x21 */
- int tag; /* tag from last 'get object' */
- int xclass; /* class from last 'get object' */
- long slen; /* length of last 'get object' */
- unsigned char *max; /* largest value of p allowed */
- unsigned char *q;/* temporary variable */
- unsigned char **pp;/* variable */
- int line; /* used in error processing */
- } ASN1_CTX;
+ {
+ unsigned char *p;/* work char pointer */
+ int eos; /* end of sequence read for indefinite encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ unsigned char *max; /* largest value of p allowed */
+ unsigned char *q;/* temporary variable */
+ unsigned char **pp;/* variable */
+ int line; /* used in error processing */
+ } ASN1_CTX;
typedef struct asn1_const_ctx_st
- {
- const unsigned char *p;/* work char pointer */
- int eos; /* end of sequence read for indefinite encoding */
- int error; /* error code to use when returning an error */
- int inf; /* constructed if 0x20, indefinite is 0x21 */
- int tag; /* tag from last 'get object' */
- int xclass; /* class from last 'get object' */
- long slen; /* length of last 'get object' */
- const unsigned char *max; /* largest value of p allowed */
- const unsigned char *q;/* temporary variable */
- const unsigned char **pp;/* variable */
- int line; /* used in error processing */
- } ASN1_const_CTX;
+ {
+ const unsigned char *p;/* work char pointer */
+ int eos; /* end of sequence read for indefinite encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ const unsigned char *max; /* largest value of p allowed */
+ const unsigned char *q;/* temporary variable */
+ const unsigned char **pp;/* variable */
+ int line; /* used in error processing */
+ } ASN1_const_CTX;
/* These are used internally in the ASN1_OBJECT to keep track of
* whether the names and data need to be free()ed */
-#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
-#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */
-#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
-#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
+#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
+#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */
+#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
+#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
typedef struct asn1_object_st
- {
- const char *sn,*ln;
- int nid;
- int length;
- unsigned char *data;
- int flags; /* Should we free this one */
- } ASN1_OBJECT;
+ {
+ const char *sn,*ln;
+ int nid;
+ int length;
+ unsigned char *data;
+ int flags; /* Should we free this one */
+ } ASN1_OBJECT;
#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
/* This indicates that the ASN1_STRING is not a real value but just a place
* holder for the location where indefinite length constructed data should
- * be inserted in the memory buffer
+ * be inserted in the memory buffer
+ */
+#define ASN1_STRING_FLAG_NDEF 0x010
+
+/* This flag is used by the CMS code to indicate that a string is not
+ * complete and is a place holder for content when it had all been
+ * accessed. The flag will be reset when content has been written to it.
*/
-#define ASN1_STRING_FLAG_NDEF 0x010
+#define ASN1_STRING_FLAG_CONT 0x020
+
/* This is the base type that holds just about everything :-) */
typedef struct asn1_string_st
- {
- int length;
- int type;
- unsigned char *data;
- /* The value of the following field depends on the type being
- * held. It is mostly being used for BIT_STRING so if the
- * input data has a non-zero 'unused bits' value, it will be
- * handled correctly */
- long flags;
- } ASN1_STRING;
+ {
+ int length;
+ int type;
+ unsigned char *data;
+ /* The value of the following field depends on the type being
+ * held. It is mostly being used for BIT_STRING so if the
+ * input data has a non-zero 'unused bits' value, it will be
+ * handled correctly */
+ long flags;
+ } ASN1_STRING;
/* ASN1_ENCODING structure: this is used to save the received
* encoding of an ASN1 type. This is useful to get round
@@ -237,41 +249,41 @@ typedef struct asn1_string_st
*/
typedef struct ASN1_ENCODING_st
- {
- unsigned char *enc; /* DER encoding */
- long len; /* Length of encoding */
- int modified; /* set to 1 if 'enc' is invalid */
- } ASN1_ENCODING;
+ {
+ unsigned char *enc; /* DER encoding */
+ long len; /* Length of encoding */
+ int modified; /* set to 1 if 'enc' is invalid */
+ } ASN1_ENCODING;
/* Used with ASN1 LONG type: if a long is set to this it is omitted */
-#define ASN1_LONG_UNDEF 0x7fffffffL
+#define ASN1_LONG_UNDEF 0x7fffffffL
-#define STABLE_FLAGS_MALLOC 0x01
-#define STABLE_NO_MASK 0x02
-#define DIRSTRING_TYPE \
+#define STABLE_FLAGS_MALLOC 0x01
+#define STABLE_NO_MASK 0x02
+#define DIRSTRING_TYPE \
(B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
typedef struct asn1_string_table_st {
- int nid;
- long minsize;
- long maxsize;
- unsigned long mask;
- unsigned long flags;
+ int nid;
+ long minsize;
+ long maxsize;
+ unsigned long mask;
+ unsigned long flags;
} ASN1_STRING_TABLE;
DECLARE_STACK_OF(ASN1_STRING_TABLE)
/* size limits: this stuff is taken straight from RFC2459 */
-#define ub_name 32768
-#define ub_common_name 64
-#define ub_locality_name 128
-#define ub_state_name 128
-#define ub_organization_name 64
-#define ub_organization_unit_name 64
-#define ub_title 64
-#define ub_email_address 128
+#define ub_name 32768
+#define ub_common_name 64
+#define ub_locality_name 128
+#define ub_state_name 128
+#define ub_organization_name 64
+#define ub_organization_unit_name 64
+#define ub_title 64
+#define ub_email_address 128
/* Declarations for template structures: for full definitions
* see asn1t.h
@@ -287,41 +299,52 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
#define DECLARE_ASN1_FUNCTIONS_name(type, name) \
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
- DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
- DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
-#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
- int i2d_##name(type *a, unsigned char **out); \
- DECLARE_ASN1_ITEM(itname)
+#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(itname)
-#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
- int i2d_##name(const type *a, unsigned char **out); \
- DECLARE_ASN1_ITEM(name)
+#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(const type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(name)
-#define DECLARE_ASN1_NDEF_FUNCTION(name) \
- int i2d_##name##_NDEF(name *a, unsigned char **out);
+#define DECLARE_ASN1_NDEF_FUNCTION(name) \
+ int i2d_##name##_NDEF(name *a, unsigned char **out);
#define DECLARE_ASN1_FUNCTIONS_const(name) \
- name *name##_new(void); \
- void name##_free(name *a);
+ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
- type *name##_new(void); \
- void name##_free(type *a);
+ type *name##_new(void); \
+ void name##_free(type *a);
#define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
#define I2D_OF(type) int (*)(type *,unsigned char **)
#define I2D_OF_const(type) int (*)(const type *,unsigned char **)
+#define CHECKED_D2I_OF(type, d2i) \
+ ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
+#define CHECKED_I2D_OF(type, i2d) \
+ ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
+#define CHECKED_NEW_OF(type, xnew) \
+ ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
+#define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+#define CHECKED_PPTR_OF(type, p) \
+ ((void**) (1 ? p : (type**)0))
+
#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
@@ -347,7 +370,7 @@ TYPEDEF_D2I2D_OF(void);
* ...
* ASN1_ITEM_EXP *iptr;
* ...
- * } SOMETHING;
+ * } SOMETHING;
*
* It would be initialised as e.g.:
*
@@ -377,7 +400,7 @@ typedef const ASN1_ITEM ASN1_ITEM_EXP;
#define ASN1_ITEM_rptr(ref) (&(ref##_it))
#define DECLARE_ASN1_ITEM(name) \
- OPENSSL_EXTERN const ASN1_ITEM name##_it;
+ OPENSSL_EXTERN const ASN1_ITEM name##_it;
#else
@@ -397,7 +420,7 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
#define ASN1_ITEM_rptr(ref) (ref##_it())
#define DECLARE_ASN1_ITEM(name) \
- const ASN1_ITEM * name##_it(void);
+ const ASN1_ITEM * name##_it(void);
#endif
@@ -408,9 +431,9 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
* MSB set characters
*/
-#define ASN1_STRFLGS_ESC_2253 1
-#define ASN1_STRFLGS_ESC_CTRL 2
-#define ASN1_STRFLGS_ESC_MSB 4
+#define ASN1_STRFLGS_ESC_2253 1
+#define ASN1_STRFLGS_ESC_CTRL 2
+#define ASN1_STRFLGS_ESC_MSB 4
/* This flag determines how we do escaping: normally
@@ -418,37 +441,37 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
* quote.
*/
-#define ASN1_STRFLGS_ESC_QUOTE 8
+#define ASN1_STRFLGS_ESC_QUOTE 8
/* These three flags are internal use only. */
/* Character is a valid PrintableString character */
-#define CHARTYPE_PRINTABLESTRING 0x10
+#define CHARTYPE_PRINTABLESTRING 0x10
/* Character needs escaping if it is the first character */
-#define CHARTYPE_FIRST_ESC_2253 0x20
+#define CHARTYPE_FIRST_ESC_2253 0x20
/* Character needs escaping if it is the last character */
-#define CHARTYPE_LAST_ESC_2253 0x40
+#define CHARTYPE_LAST_ESC_2253 0x40
/* NB the internal flags are safely reused below by flags
* handled at the top level.
*/
/* If this is set we convert all character strings
- * to UTF8 first
+ * to UTF8 first
*/
-#define ASN1_STRFLGS_UTF8_CONVERT 0x10
+#define ASN1_STRFLGS_UTF8_CONVERT 0x10
/* If this is set we don't attempt to interpret content:
* just assume all strings are 1 byte per character. This
* will produce some pretty odd looking output!
*/
-#define ASN1_STRFLGS_IGNORE_TYPE 0x20
+#define ASN1_STRFLGS_IGNORE_TYPE 0x20
/* If this is set we include the string type in the output */
-#define ASN1_STRFLGS_SHOW_TYPE 0x40
+#define ASN1_STRFLGS_SHOW_TYPE 0x40
/* This determines which strings to display and which to
* 'dump' (hex dump of content octets or DER encoding). We can
@@ -458,27 +481,27 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
* the usual escaping options.
*/
-#define ASN1_STRFLGS_DUMP_ALL 0x80
-#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
+#define ASN1_STRFLGS_DUMP_ALL 0x80
+#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
/* These determine what 'dumping' does, we can dump the
* content octets or the DER encoding: both use the
* RFC2253 #XXXXX notation.
*/
-#define ASN1_STRFLGS_DUMP_DER 0x200
+#define ASN1_STRFLGS_DUMP_DER 0x200
/* All the string flags consistent with RFC2253,
* escaping control characters isn't essential in
* RFC2253 but it is advisable anyway.
*/
-#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
- ASN1_STRFLGS_ESC_CTRL | \
- ASN1_STRFLGS_ESC_MSB | \
- ASN1_STRFLGS_UTF8_CONVERT | \
- ASN1_STRFLGS_DUMP_UNKNOWN | \
- ASN1_STRFLGS_DUMP_DER)
+#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
+ ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB | \
+ ASN1_STRFLGS_UTF8_CONVERT | \
+ ASN1_STRFLGS_DUMP_UNKNOWN | \
+ ASN1_STRFLGS_DUMP_DER)
DECLARE_STACK_OF(ASN1_INTEGER)
DECLARE_ASN1_SET_OF(ASN1_INTEGER)
@@ -486,315 +509,318 @@ DECLARE_ASN1_SET_OF(ASN1_INTEGER)
DECLARE_STACK_OF(ASN1_GENERALSTRING)
typedef struct asn1_type_st
- {
- int type;
- union {
- char *ptr;
- ASN1_BOOLEAN boolean;
- ASN1_STRING * asn1_string;
- ASN1_OBJECT * object;
- ASN1_INTEGER * integer;
- ASN1_ENUMERATED * enumerated;
- ASN1_BIT_STRING * bit_string;
- ASN1_OCTET_STRING * octet_string;
- ASN1_PRINTABLESTRING * printablestring;
- ASN1_T61STRING * t61string;
- ASN1_IA5STRING * ia5string;
- ASN1_GENERALSTRING * generalstring;
- ASN1_BMPSTRING * bmpstring;
- ASN1_UNIVERSALSTRING * universalstring;
- ASN1_UTCTIME * utctime;
- ASN1_GENERALIZEDTIME * generalizedtime;
- ASN1_VISIBLESTRING * visiblestring;
- ASN1_UTF8STRING * utf8string;
- /* set and sequence are left complete and still
- * contain the set or sequence bytes */
- ASN1_STRING * set;
- ASN1_STRING * sequence;
- } value;
- } ASN1_TYPE;
+ {
+ int type;
+ union {
+ char *ptr;
+ ASN1_BOOLEAN boolean;
+ ASN1_STRING * asn1_string;
+ ASN1_OBJECT * object;
+ ASN1_INTEGER * integer;
+ ASN1_ENUMERATED * enumerated;
+ ASN1_BIT_STRING * bit_string;
+ ASN1_OCTET_STRING * octet_string;
+ ASN1_PRINTABLESTRING * printablestring;
+ ASN1_T61STRING * t61string;
+ ASN1_IA5STRING * ia5string;
+ ASN1_GENERALSTRING * generalstring;
+ ASN1_BMPSTRING * bmpstring;
+ ASN1_UNIVERSALSTRING * universalstring;
+ ASN1_UTCTIME * utctime;
+ ASN1_GENERALIZEDTIME * generalizedtime;
+ ASN1_VISIBLESTRING * visiblestring;
+ ASN1_UTF8STRING * utf8string;
+ /* set and sequence are left complete and still
+ * contain the set or sequence bytes */
+ ASN1_STRING * set;
+ ASN1_STRING * sequence;
+ ASN1_VALUE * asn1_value;
+ } value;
+ } ASN1_TYPE;
DECLARE_STACK_OF(ASN1_TYPE)
DECLARE_ASN1_SET_OF(ASN1_TYPE)
typedef struct asn1_method_st
- {
- i2d_of_void *i2d;
- d2i_of_void *d2i;
- void *(*create)(void);
- void (*destroy)(void *);
- } ASN1_METHOD;
+ {
+ i2d_of_void *i2d;
+ d2i_of_void *d2i;
+ void *(*create)(void);
+ void (*destroy)(void *);
+ } ASN1_METHOD;
/* This is used when parsing some Netscape objects */
typedef struct asn1_header_st
- {
- ASN1_OCTET_STRING *header;
- void *data;
- ASN1_METHOD *meth;
- } ASN1_HEADER;
+ {
+ ASN1_OCTET_STRING *header;
+ void *data;
+ ASN1_METHOD *meth;
+ } ASN1_HEADER;
/* This is used to contain a list of bit names */
typedef struct BIT_STRING_BITNAME_st {
- int bitnum;
- const char *lname;
- const char *sname;
+ int bitnum;
+ const char *lname;
+ const char *sname;
} BIT_STRING_BITNAME;
-#define M_ASN1_STRING_length(x) ((x)->length)
-#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
-#define M_ASN1_STRING_type(x) ((x)->type)
-#define M_ASN1_STRING_data(x) ((x)->data)
+#define M_ASN1_STRING_length(x) ((x)->length)
+#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
+#define M_ASN1_STRING_type(x) ((x)->type)
+#define M_ASN1_STRING_data(x) ((x)->data)
/* Macros for string operations */
-#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
- ASN1_STRING_type_new(V_ASN1_BIT_STRING)
-#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_BIT_STRING)
+#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
- ASN1_STRING_dup((ASN1_STRING *)a)
+ ASN1_STRING_dup((ASN1_STRING *)a)
#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
- (ASN1_STRING *)a,(ASN1_STRING *)b)
+ (ASN1_STRING *)a,(ASN1_STRING *)b)
#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
-#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
- ASN1_STRING_type_new(V_ASN1_INTEGER)
-#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
+ ASN1_STRING_type_new(V_ASN1_INTEGER)
+#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
- (ASN1_STRING *)a,(ASN1_STRING *)b)
+#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
+ (ASN1_STRING *)a,(ASN1_STRING *)b)
-#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
- ASN1_STRING_type_new(V_ASN1_ENUMERATED)
-#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
+ ASN1_STRING_type_new(V_ASN1_ENUMERATED)
+#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
- (ASN1_STRING *)a,(ASN1_STRING *)b)
+#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
+ (ASN1_STRING *)a,(ASN1_STRING *)b)
-#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
- ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
-#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
+#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
- ASN1_STRING_dup((ASN1_STRING *)a)
+ ASN1_STRING_dup((ASN1_STRING *)a)
#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
- (ASN1_STRING *)a,(ASN1_STRING *)b)
-#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
-#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
+ (ASN1_STRING *)a,(ASN1_STRING *)b)
+#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
#define M_i2d_ASN1_OCTET_STRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
+ V_ASN1_UNIVERSAL)
#define B_ASN1_TIME \
- B_ASN1_UTCTIME | \
- B_ASN1_GENERALIZEDTIME
+ B_ASN1_UTCTIME | \
+ B_ASN1_GENERALIZEDTIME
#define B_ASN1_PRINTABLE \
- B_ASN1_PRINTABLESTRING| \
- B_ASN1_T61STRING| \
- B_ASN1_IA5STRING| \
- B_ASN1_BIT_STRING| \
- B_ASN1_UNIVERSALSTRING|\
- B_ASN1_BMPSTRING|\
- B_ASN1_UTF8STRING|\
- B_ASN1_SEQUENCE|\
- B_ASN1_UNKNOWN
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_T61STRING| \
+ B_ASN1_IA5STRING| \
+ B_ASN1_BIT_STRING| \
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING|\
+ B_ASN1_SEQUENCE|\
+ B_ASN1_UNKNOWN
#define B_ASN1_DIRECTORYSTRING \
- B_ASN1_PRINTABLESTRING| \
- B_ASN1_TELETEXSTRING|\
- B_ASN1_BMPSTRING|\
- B_ASN1_UNIVERSALSTRING|\
- B_ASN1_UTF8STRING
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_TELETEXSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_UTF8STRING
#define B_ASN1_DISPLAYTEXT \
- B_ASN1_IA5STRING| \
- B_ASN1_VISIBLESTRING| \
- B_ASN1_BMPSTRING|\
- B_ASN1_UTF8STRING
+ B_ASN1_IA5STRING| \
+ B_ASN1_VISIBLESTRING| \
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING
-#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
-#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
+#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
- pp,a->type,V_ASN1_UNIVERSAL)
+ pp,a->type,V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_PRINTABLE(a,pp,l) \
- d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
- B_ASN1_PRINTABLE)
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_PRINTABLE)
#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
-#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
- pp,a->type,V_ASN1_UNIVERSAL)
+ pp,a->type,V_ASN1_UNIVERSAL)
#define M_d2i_DIRECTORYSTRING(a,pp,l) \
- d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
- B_ASN1_DIRECTORYSTRING)
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DIRECTORYSTRING)
#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
- pp,a->type,V_ASN1_UNIVERSAL)
+ pp,a->type,V_ASN1_UNIVERSAL)
#define M_d2i_DISPLAYTEXT(a,pp,l) \
- d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
- B_ASN1_DISPLAYTEXT)
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DISPLAYTEXT)
#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
- ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
-#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+ ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
- (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
+ (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
-#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
- ASN1_STRING_type_new(V_ASN1_T61STRING)
-#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
+ ASN1_STRING_type_new(V_ASN1_T61STRING)
+#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_T61STRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_T61STRING(a,pp,l) \
- (ASN1_T61STRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
-
-#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
- ASN1_STRING_type_new(V_ASN1_IA5STRING)
-#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
-#define M_ASN1_IA5STRING_dup(a) \
- (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
+ (ASN1_T61STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
+
+#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
+ ASN1_STRING_type_new(V_ASN1_IA5STRING)
+#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_IA5STRING_dup(a) \
+ (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
#define M_i2d_ASN1_IA5STRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_IA5STRING(a,pp,l) \
- (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
- B_ASN1_IA5STRING)
+ (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
+ B_ASN1_IA5STRING)
-#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
- ASN1_STRING_type_new(V_ASN1_UTCTIME)
-#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
- ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
-#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
+#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
- (ASN1_STRING *)a)
+ (ASN1_STRING *)a)
-#define M_ASN1_TIME_new() (ASN1_TIME *)\
- ASN1_STRING_type_new(V_ASN1_UTCTIME)
-#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_TIME_new() (ASN1_TIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
-#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
- ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
-#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
+#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_GENERALSTRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
- (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
+ (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
-#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
- ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
-#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
+#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
- (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
+ (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
-#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
- ASN1_STRING_type_new(V_ASN1_BMPSTRING)
-#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_BMPSTRING)
+#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_BMPSTRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_BMPSTRING(a,pp,l) \
- (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
+ (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
-#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
- ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
-#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
+ ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_VISIBLESTRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
- (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
+ (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
-#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
- ASN1_STRING_type_new(V_ASN1_UTF8STRING)
-#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
+ ASN1_STRING_type_new(V_ASN1_UTF8STRING)
+#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_UTF8STRING(a,pp) \
- i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
- V_ASN1_UNIVERSAL)
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
+ V_ASN1_UNIVERSAL)
#define M_d2i_ASN1_UTF8STRING(a,pp,l) \
- (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
- ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
+ (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
/* for the is_set parameter to i2d_ASN1_SET */
-#define IS_SEQUENCE 0
-#define IS_SET 1
+#define IS_SEQUENCE 0
+#define IS_SET 1
DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
int ASN1_TYPE_get(ASN1_TYPE *a);
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
+int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
-ASN1_OBJECT * ASN1_OBJECT_new(void );
-void ASN1_OBJECT_free(ASN1_OBJECT *a);
-int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
-ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
- long length);
-ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
- long length);
+ASN1_OBJECT * ASN1_OBJECT_new(void );
+void ASN1_OBJECT_free(ASN1_OBJECT *a);
+int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
+ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
+ long length);
+ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
+ long length);
DECLARE_ASN1_ITEM(ASN1_OBJECT)
DECLARE_STACK_OF(ASN1_OBJECT)
DECLARE_ASN1_SET_OF(ASN1_OBJECT)
-ASN1_STRING * ASN1_STRING_new(void);
-void ASN1_STRING_free(ASN1_STRING *a);
-ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a);
-ASN1_STRING * ASN1_STRING_type_new(int type );
-int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
+ASN1_STRING * ASN1_STRING_new(void);
+void ASN1_STRING_free(ASN1_STRING *a);
+ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a);
+ASN1_STRING * ASN1_STRING_type_new(int type );
+int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
/* Since this is used to store all sorts of things, via macros, for now, make
its data void * */
-int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
+int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
+void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
int ASN1_STRING_length(ASN1_STRING *x);
void ASN1_STRING_length_set(ASN1_STRING *x, int n);
int ASN1_STRING_type(ASN1_STRING *x);
unsigned char * ASN1_STRING_data(ASN1_STRING *x);
DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
-int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
+int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp,
- long length);
-int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
- int length );
-int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
-int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
+ long length);
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
+ int length );
+int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
+int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
#ifndef OPENSSL_NO_BIO
int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
- BIT_STRING_BITNAME *tbl, int indent);
+ BIT_STRING_BITNAME *tbl, int indent);
#endif
int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
- BIT_STRING_BITNAME *tbl);
+ BIT_STRING_BITNAME *tbl);
-int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
-int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
+int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
+int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
-int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
+int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp,
- long length);
+ long length);
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp,
- long length);
-ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
+ long length);
+ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y);
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
@@ -812,9 +838,9 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t)
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
-ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
-int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
-int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len);
+ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
+int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
+int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len);
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
@@ -844,10 +870,10 @@ int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
int i2d_ASN1_SET(STACK *a, unsigned char **pp,
- i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
-STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
- d2i_of_void *d2i, void (*free_func)(void *),
- int ex_tag, int ex_class);
+ i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
+STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
+ d2i_of_void *d2i, void (*free_func)(void *),
+ int ex_tag, int ex_class);
#ifndef OPENSSL_NO_BIO
int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
@@ -862,7 +888,7 @@ int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
- const char *sn, const char *ln);
+ const char *sn, const char *ln);
int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
long ASN1_INTEGER_get(ASN1_INTEGER *a);
@@ -880,11 +906,11 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int max);
int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
- long length, int Ptag, int Pclass);
+ long length, int Ptag, int Pclass);
unsigned long ASN1_tag2bit(int tag);
/* type is one or more of the B_ASN1_ values. */
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp,
- long length,int type);
+ long length,int type);
/* PARSING */
int asn1_Finish(ASN1_CTX *c);
@@ -892,33 +918,57 @@ int asn1_const_Finish(ASN1_const_CTX *c);
/* SPECIALS */
int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
- int *pclass, long omax);
+ int *pclass, long omax);
int ASN1_check_infinite_end(unsigned char **p,long len);
int ASN1_const_check_infinite_end(const unsigned char **p,long len);
void ASN1_put_object(unsigned char **pp, int constructed, int length,
- int tag, int xclass);
+ int tag, int xclass);
int ASN1_put_eoc(unsigned char **pp);
int ASN1_object_size(int constructed, int length, int tag);
/* Used to implement other functions */
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
+
#define ASN1_dup_of(type,i2d,d2i,x) \
- ((type *(*)(I2D_OF(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
+ ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(type, x)))
+
#define ASN1_dup_of_const(type,i2d,d2i,x) \
- ((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
+ ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(const type, x)))
void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
+/* ASN1 alloc/free macros for when a type is only used internally */
+
+#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))
+#define M_ASN1_free_of(x, type) \
+ ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
+
#ifndef OPENSSL_NO_FP_API
void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
+
#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
- ((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))openssl_fcast(ASN1_d2i_fp))(xnew,d2i,in,x)
+ ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x);
+
#define ASN1_i2d_fp_of(type,i2d,out,x) \
- ((int (*)(I2D_OF(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
+ (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
#define ASN1_i2d_fp_of_const(type,i2d,out,x) \
- ((int (*)(I2D_OF_const(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
+ (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
#endif
@@ -927,14 +977,26 @@ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
#ifndef OPENSSL_NO_BIO
void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
+
#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
- ((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))openssl_fcast(ASN1_d2i_bio))(xnew,d2i,in,x)
+ ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
+
#define ASN1_i2d_bio_of(type,i2d,out,x) \
- ((int (*)(I2D_OF(type),BIO *,type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
+ (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
#define ASN1_i2d_bio_of_const(type,i2d,out,x) \
- ((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
+ (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
@@ -961,37 +1023,41 @@ ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void);
ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void);
int ASN1_TYPE_set_octetstring(ASN1_TYPE *a,
- unsigned char *data, int len);
+ unsigned char *data, int len);
int ASN1_TYPE_get_octetstring(ASN1_TYPE *a,
- unsigned char *data, int max_len);
+ unsigned char *data, int max_len);
int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
- unsigned char *data, int len);
+ unsigned char *data, int len);
int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
- unsigned char *data, int max_len);
+ unsigned char *data, int max_len);
STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
- d2i_of_void *d2i, void (*free_func)(void *));
+ d2i_of_void *d2i, void (*free_func)(void *));
unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
- unsigned char **buf, int *len );
+ unsigned char **buf, int *len );
void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
- ASN1_OCTET_STRING **oct);
+ ASN1_OCTET_STRING **oct);
+
#define ASN1_pack_string_of(type,obj,i2d,oct) \
- ((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))openssl_fcast(ASN1_pack_string))(obj,i2d,oct)
+ (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \
+ CHECKED_I2D_OF(type, i2d), \
+ oct))
+
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
void ASN1_STRING_set_default_mask(unsigned long mask);
int ASN1_STRING_set_default_mask_asc(char *p);
unsigned long ASN1_STRING_get_default_mask(void);
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
- int inform, unsigned long mask);
+ int inform, unsigned long mask);
int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
- int inform, unsigned long mask,
- long minsize, long maxsize);
+ int inform, unsigned long mask,
+ long minsize, long maxsize);
-ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
- const unsigned char *in, int inlen, int inform, int nid);
+ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
+ const unsigned char *in, int inlen, int inform, int nid);
ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
void ASN1_STRING_TABLE_cleanup(void);
@@ -1010,6 +1076,16 @@ void ASN1_add_oid_module(void);
ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
+typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags,
+ const ASN1_ITEM *it);
+
+int int_smime_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
+ int ctype_nid, int econt_nid,
+ STACK_OF(X509_ALGOR) *mdalgs,
+ asn1_output_data_fn *data_fn,
+ const ASN1_ITEM *it);
+ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
+
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
@@ -1019,216 +1095,232 @@ void ERR_load_ASN1_strings(void);
/* Error codes for the ASN1 functions. */
/* Function codes. */
-#define ASN1_F_A2D_ASN1_OBJECT 100
-#define ASN1_F_A2I_ASN1_ENUMERATED 101
-#define ASN1_F_A2I_ASN1_INTEGER 102
-#define ASN1_F_A2I_ASN1_STRING 103
-#define ASN1_F_APPEND_EXP 176
-#define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
-#define ASN1_F_ASN1_CB 177
-#define ASN1_F_ASN1_CHECK_TLEN 104
-#define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
-#define ASN1_F_ASN1_COLLECT 106
-#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
-#define ASN1_F_ASN1_D2I_FP 109
-#define ASN1_F_ASN1_D2I_READ_BIO 107
-#define ASN1_F_ASN1_DIGEST 184
-#define ASN1_F_ASN1_DO_ADB 110
-#define ASN1_F_ASN1_DUP 111
-#define ASN1_F_ASN1_ENUMERATED_SET 112
-#define ASN1_F_ASN1_ENUMERATED_TO_BN 113
-#define ASN1_F_ASN1_EX_C2I 204
-#define ASN1_F_ASN1_FIND_END 190
-#define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
-#define ASN1_F_ASN1_GENERATE_V3 178
-#define ASN1_F_ASN1_GET_OBJECT 114
-#define ASN1_F_ASN1_HEADER_NEW 115
-#define ASN1_F_ASN1_I2D_BIO 116
-#define ASN1_F_ASN1_I2D_FP 117
-#define ASN1_F_ASN1_INTEGER_SET 118
-#define ASN1_F_ASN1_INTEGER_TO_BN 119
-#define ASN1_F_ASN1_ITEM_D2I_FP 206
-#define ASN1_F_ASN1_ITEM_DUP 191
-#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
-#define ASN1_F_ASN1_ITEM_EX_D2I 120
-#define ASN1_F_ASN1_ITEM_I2D_BIO 192
-#define ASN1_F_ASN1_ITEM_I2D_FP 193
-#define ASN1_F_ASN1_ITEM_PACK 198
-#define ASN1_F_ASN1_ITEM_SIGN 195
-#define ASN1_F_ASN1_ITEM_UNPACK 199
-#define ASN1_F_ASN1_ITEM_VERIFY 197
-#define ASN1_F_ASN1_MBSTRING_NCOPY 122
-#define ASN1_F_ASN1_OBJECT_NEW 123
-#define ASN1_F_ASN1_PACK_STRING 124
-#define ASN1_F_ASN1_PCTX_NEW 205
-#define ASN1_F_ASN1_PKCS5_PBE_SET 125
-#define ASN1_F_ASN1_SEQ_PACK 126
-#define ASN1_F_ASN1_SEQ_UNPACK 127
-#define ASN1_F_ASN1_SIGN 128
-#define ASN1_F_ASN1_STR2TYPE 179
-#define ASN1_F_ASN1_STRING_SET 186
-#define ASN1_F_ASN1_STRING_TABLE_ADD 129
-#define ASN1_F_ASN1_STRING_TYPE_NEW 130
-#define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
-#define ASN1_F_ASN1_TEMPLATE_NEW 133
-#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
-#define ASN1_F_ASN1_TIME_SET 175
-#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
-#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
-#define ASN1_F_ASN1_UNPACK_STRING 136
-#define ASN1_F_ASN1_UTCTIME_SET 187
-#define ASN1_F_ASN1_VERIFY 137
-#define ASN1_F_BITSTR_CB 180
-#define ASN1_F_BN_TO_ASN1_ENUMERATED 138
-#define ASN1_F_BN_TO_ASN1_INTEGER 139
-#define ASN1_F_C2I_ASN1_BIT_STRING 189
-#define ASN1_F_C2I_ASN1_INTEGER 194
-#define ASN1_F_C2I_ASN1_OBJECT 196
-#define ASN1_F_COLLECT_DATA 140
-#define ASN1_F_D2I_ASN1_BIT_STRING 141
-#define ASN1_F_D2I_ASN1_BOOLEAN 142
-#define ASN1_F_D2I_ASN1_BYTES 143
-#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
-#define ASN1_F_D2I_ASN1_HEADER 145
-#define ASN1_F_D2I_ASN1_INTEGER 146
-#define ASN1_F_D2I_ASN1_OBJECT 147
-#define ASN1_F_D2I_ASN1_SET 148
-#define ASN1_F_D2I_ASN1_TYPE_BYTES 149
-#define ASN1_F_D2I_ASN1_UINTEGER 150
-#define ASN1_F_D2I_ASN1_UTCTIME 151
-#define ASN1_F_D2I_NETSCAPE_RSA 152
-#define ASN1_F_D2I_NETSCAPE_RSA_2 153
-#define ASN1_F_D2I_PRIVATEKEY 154
-#define ASN1_F_D2I_PUBLICKEY 155
-#define ASN1_F_D2I_RSA_NET 200
-#define ASN1_F_D2I_RSA_NET_2 201
-#define ASN1_F_D2I_X509 156
-#define ASN1_F_D2I_X509_CINF 157
-#define ASN1_F_D2I_X509_PKEY 159
-#define ASN1_F_I2D_ASN1_SET 188
-#define ASN1_F_I2D_ASN1_TIME 160
-#define ASN1_F_I2D_DSA_PUBKEY 161
-#define ASN1_F_I2D_EC_PUBKEY 181
-#define ASN1_F_I2D_PRIVATEKEY 163
-#define ASN1_F_I2D_PUBLICKEY 164
-#define ASN1_F_I2D_RSA_NET 162
-#define ASN1_F_I2D_RSA_PUBKEY 165
-#define ASN1_F_LONG_C2I 166
-#define ASN1_F_OID_MODULE_INIT 174
-#define ASN1_F_PARSE_TAGGING 182
-#define ASN1_F_PKCS5_PBE2_SET 167
-#define ASN1_F_PKCS5_PBE_SET 202
-#define ASN1_F_X509_CINF_NEW 168
-#define ASN1_F_X509_CRL_ADD0_REVOKED 169
-#define ASN1_F_X509_INFO_NEW 170
-#define ASN1_F_X509_NAME_ENCODE 203
-#define ASN1_F_X509_NAME_EX_D2I 158
-#define ASN1_F_X509_NAME_EX_NEW 171
-#define ASN1_F_X509_NEW 172
-#define ASN1_F_X509_PKEY_NEW 173
+#define ASN1_F_A2D_ASN1_OBJECT 100
+#define ASN1_F_A2I_ASN1_ENUMERATED 101
+#define ASN1_F_A2I_ASN1_INTEGER 102
+#define ASN1_F_A2I_ASN1_STRING 103
+#define ASN1_F_APPEND_EXP 176
+#define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
+#define ASN1_F_ASN1_CB 177
+#define ASN1_F_ASN1_CHECK_TLEN 104
+#define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
+#define ASN1_F_ASN1_COLLECT 106
+#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
+#define ASN1_F_ASN1_D2I_FP 109
+#define ASN1_F_ASN1_D2I_READ_BIO 107
+#define ASN1_F_ASN1_DIGEST 184
+#define ASN1_F_ASN1_DO_ADB 110
+#define ASN1_F_ASN1_DUP 111
+#define ASN1_F_ASN1_ENUMERATED_SET 112
+#define ASN1_F_ASN1_ENUMERATED_TO_BN 113
+#define ASN1_F_ASN1_EX_C2I 204
+#define ASN1_F_ASN1_FIND_END 190
+#define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
+#define ASN1_F_ASN1_GENERATE_V3 178
+#define ASN1_F_ASN1_GET_OBJECT 114
+#define ASN1_F_ASN1_HEADER_NEW 115
+#define ASN1_F_ASN1_I2D_BIO 116
+#define ASN1_F_ASN1_I2D_FP 117
+#define ASN1_F_ASN1_INTEGER_SET 118
+#define ASN1_F_ASN1_INTEGER_TO_BN 119
+#define ASN1_F_ASN1_ITEM_D2I_FP 206
+#define ASN1_F_ASN1_ITEM_DUP 191
+#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
+#define ASN1_F_ASN1_ITEM_EX_D2I 120
+#define ASN1_F_ASN1_ITEM_I2D_BIO 192
+#define ASN1_F_ASN1_ITEM_I2D_FP 193
+#define ASN1_F_ASN1_ITEM_PACK 198
+#define ASN1_F_ASN1_ITEM_SIGN 195
+#define ASN1_F_ASN1_ITEM_UNPACK 199
+#define ASN1_F_ASN1_ITEM_VERIFY 197
+#define ASN1_F_ASN1_MBSTRING_NCOPY 122
+#define ASN1_F_ASN1_OBJECT_NEW 123
+#define ASN1_F_ASN1_OUTPUT_DATA 207
+#define ASN1_F_ASN1_PACK_STRING 124
+#define ASN1_F_ASN1_PCTX_NEW 205
+#define ASN1_F_ASN1_PKCS5_PBE_SET 125
+#define ASN1_F_ASN1_SEQ_PACK 126
+#define ASN1_F_ASN1_SEQ_UNPACK 127
+#define ASN1_F_ASN1_SIGN 128
+#define ASN1_F_ASN1_STR2TYPE 179
+#define ASN1_F_ASN1_STRING_SET 186
+#define ASN1_F_ASN1_STRING_TABLE_ADD 129
+#define ASN1_F_ASN1_STRING_TYPE_NEW 130
+#define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
+#define ASN1_F_ASN1_TEMPLATE_NEW 133
+#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
+#define ASN1_F_ASN1_TIME_SET 175
+#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
+#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
+#define ASN1_F_ASN1_UNPACK_STRING 136
+#define ASN1_F_ASN1_UTCTIME_SET 187
+#define ASN1_F_ASN1_VERIFY 137
+#define ASN1_F_B64_READ_ASN1 208
+#define ASN1_F_B64_WRITE_ASN1 209
+#define ASN1_F_BITSTR_CB 180
+#define ASN1_F_BN_TO_ASN1_ENUMERATED 138
+#define ASN1_F_BN_TO_ASN1_INTEGER 139
+#define ASN1_F_C2I_ASN1_BIT_STRING 189
+#define ASN1_F_C2I_ASN1_INTEGER 194
+#define ASN1_F_C2I_ASN1_OBJECT 196
+#define ASN1_F_COLLECT_DATA 140
+#define ASN1_F_D2I_ASN1_BIT_STRING 141
+#define ASN1_F_D2I_ASN1_BOOLEAN 142
+#define ASN1_F_D2I_ASN1_BYTES 143
+#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
+#define ASN1_F_D2I_ASN1_HEADER 145
+#define ASN1_F_D2I_ASN1_INTEGER 146
+#define ASN1_F_D2I_ASN1_OBJECT 147
+#define ASN1_F_D2I_ASN1_SET 148
+#define ASN1_F_D2I_ASN1_TYPE_BYTES 149
+#define ASN1_F_D2I_ASN1_UINTEGER 150
+#define ASN1_F_D2I_ASN1_UTCTIME 151
+#define ASN1_F_D2I_NETSCAPE_RSA 152
+#define ASN1_F_D2I_NETSCAPE_RSA_2 153
+#define ASN1_F_D2I_PRIVATEKEY 154
+#define ASN1_F_D2I_PUBLICKEY 155
+#define ASN1_F_D2I_RSA_NET 200
+#define ASN1_F_D2I_RSA_NET_2 201
+#define ASN1_F_D2I_X509 156
+#define ASN1_F_D2I_X509_CINF 157
+#define ASN1_F_D2I_X509_PKEY 159
+#define ASN1_F_I2D_ASN1_SET 188
+#define ASN1_F_I2D_ASN1_TIME 160
+#define ASN1_F_I2D_DSA_PUBKEY 161
+#define ASN1_F_I2D_EC_PUBKEY 181
+#define ASN1_F_I2D_PRIVATEKEY 163
+#define ASN1_F_I2D_PUBLICKEY 164
+#define ASN1_F_I2D_RSA_NET 162
+#define ASN1_F_I2D_RSA_PUBKEY 165
+#define ASN1_F_LONG_C2I 166
+#define ASN1_F_OID_MODULE_INIT 174
+#define ASN1_F_PARSE_TAGGING 182
+#define ASN1_F_PKCS5_PBE2_SET 167
+#define ASN1_F_PKCS5_PBE_SET 202
+#define ASN1_F_SMIME_READ_ASN1 210
+#define ASN1_F_SMIME_TEXT 211
+#define ASN1_F_X509_CINF_NEW 168
+#define ASN1_F_X509_CRL_ADD0_REVOKED 169
+#define ASN1_F_X509_INFO_NEW 170
+#define ASN1_F_X509_NAME_ENCODE 203
+#define ASN1_F_X509_NAME_EX_D2I 158
+#define ASN1_F_X509_NAME_EX_NEW 171
+#define ASN1_F_X509_NEW 172
+#define ASN1_F_X509_PKEY_NEW 173
/* Reason codes. */
-#define ASN1_R_ADDING_OBJECT 171
-#define ASN1_R_AUX_ERROR 100
-#define ASN1_R_BAD_CLASS 101
-#define ASN1_R_BAD_OBJECT_HEADER 102
-#define ASN1_R_BAD_PASSWORD_READ 103
-#define ASN1_R_BAD_TAG 104
-#define ASN1_R_BN_LIB 105
-#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
-#define ASN1_R_BUFFER_TOO_SMALL 107
-#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
-#define ASN1_R_DATA_IS_WRONG 109
-#define ASN1_R_DECODE_ERROR 110
-#define ASN1_R_DECODING_ERROR 111
-#define ASN1_R_DEPTH_EXCEEDED 174
-#define ASN1_R_ENCODE_ERROR 112
-#define ASN1_R_ERROR_GETTING_TIME 173
-#define ASN1_R_ERROR_LOADING_SECTION 172
-#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
-#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
-#define ASN1_R_EXPECTING_AN_INTEGER 115
-#define ASN1_R_EXPECTING_AN_OBJECT 116
-#define ASN1_R_EXPECTING_A_BOOLEAN 117
-#define ASN1_R_EXPECTING_A_TIME 118
-#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
-#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
-#define ASN1_R_FIELD_MISSING 121
-#define ASN1_R_FIRST_NUM_TOO_LARGE 122
-#define ASN1_R_HEADER_TOO_LONG 123
-#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
-#define ASN1_R_ILLEGAL_BOOLEAN 176
-#define ASN1_R_ILLEGAL_CHARACTERS 124
-#define ASN1_R_ILLEGAL_FORMAT 177
-#define ASN1_R_ILLEGAL_HEX 178
-#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
-#define ASN1_R_ILLEGAL_INTEGER 180
-#define ASN1_R_ILLEGAL_NESTED_TAGGING 181
-#define ASN1_R_ILLEGAL_NULL 125
-#define ASN1_R_ILLEGAL_NULL_VALUE 182
-#define ASN1_R_ILLEGAL_OBJECT 183
-#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
-#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
-#define ASN1_R_ILLEGAL_TAGGED_ANY 127
-#define ASN1_R_ILLEGAL_TIME_VALUE 184
-#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
-#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
-#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
-#define ASN1_R_INVALID_DIGIT 130
-#define ASN1_R_INVALID_MODIFIER 186
-#define ASN1_R_INVALID_NUMBER 187
-#define ASN1_R_INVALID_SEPARATOR 131
-#define ASN1_R_INVALID_TIME_FORMAT 132
-#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
-#define ASN1_R_INVALID_UTF8STRING 134
-#define ASN1_R_IV_TOO_LARGE 135
-#define ASN1_R_LENGTH_ERROR 136
-#define ASN1_R_LIST_ERROR 188
-#define ASN1_R_MISSING_EOC 137
-#define ASN1_R_MISSING_SECOND_NUMBER 138
-#define ASN1_R_MISSING_VALUE 189
-#define ASN1_R_MSTRING_NOT_UNIVERSAL 139
-#define ASN1_R_MSTRING_WRONG_TAG 140
-#define ASN1_R_NESTED_ASN1_STRING 197
-#define ASN1_R_NON_HEX_CHARACTERS 141
-#define ASN1_R_NOT_ASCII_FORMAT 190
-#define ASN1_R_NOT_ENOUGH_DATA 142
-#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
-#define ASN1_R_NULL_IS_WRONG_LENGTH 144
-#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
-#define ASN1_R_ODD_NUMBER_OF_CHARS 145
-#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
-#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
-#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
-#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
-#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
-#define ASN1_R_SHORT_LINE 150
-#define ASN1_R_STRING_TOO_LONG 151
-#define ASN1_R_STRING_TOO_SHORT 152
-#define ASN1_R_TAG_VALUE_TOO_HIGH 153
+#define ASN1_R_ADDING_OBJECT 171
+#define ASN1_R_ASN1_PARSE_ERROR 198
+#define ASN1_R_ASN1_SIG_PARSE_ERROR 199
+#define ASN1_R_AUX_ERROR 100
+#define ASN1_R_BAD_CLASS 101
+#define ASN1_R_BAD_OBJECT_HEADER 102
+#define ASN1_R_BAD_PASSWORD_READ 103
+#define ASN1_R_BAD_TAG 104
+#define ASN1_R_BN_LIB 105
+#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
+#define ASN1_R_BUFFER_TOO_SMALL 107
+#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
+#define ASN1_R_DATA_IS_WRONG 109
+#define ASN1_R_DECODE_ERROR 110
+#define ASN1_R_DECODING_ERROR 111
+#define ASN1_R_DEPTH_EXCEEDED 174
+#define ASN1_R_ENCODE_ERROR 112
+#define ASN1_R_ERROR_GETTING_TIME 173
+#define ASN1_R_ERROR_LOADING_SECTION 172
+#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
+#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
+#define ASN1_R_EXPECTING_AN_INTEGER 115
+#define ASN1_R_EXPECTING_AN_OBJECT 116
+#define ASN1_R_EXPECTING_A_BOOLEAN 117
+#define ASN1_R_EXPECTING_A_TIME 118
+#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
+#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
+#define ASN1_R_FIELD_MISSING 121
+#define ASN1_R_FIRST_NUM_TOO_LARGE 122
+#define ASN1_R_HEADER_TOO_LONG 123
+#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
+#define ASN1_R_ILLEGAL_BOOLEAN 176
+#define ASN1_R_ILLEGAL_CHARACTERS 124
+#define ASN1_R_ILLEGAL_FORMAT 177
+#define ASN1_R_ILLEGAL_HEX 178
+#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
+#define ASN1_R_ILLEGAL_INTEGER 180
+#define ASN1_R_ILLEGAL_NESTED_TAGGING 181
+#define ASN1_R_ILLEGAL_NULL 125
+#define ASN1_R_ILLEGAL_NULL_VALUE 182
+#define ASN1_R_ILLEGAL_OBJECT 183
+#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
+#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
+#define ASN1_R_ILLEGAL_TAGGED_ANY 127
+#define ASN1_R_ILLEGAL_TIME_VALUE 184
+#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
+#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
+#define ASN1_R_INVALID_BMPSTRING_LENGTH 129
+#define ASN1_R_INVALID_DIGIT 130
+#define ASN1_R_INVALID_MIME_TYPE 200
+#define ASN1_R_INVALID_MODIFIER 186
+#define ASN1_R_INVALID_NUMBER 187
+#define ASN1_R_INVALID_SEPARATOR 131
+#define ASN1_R_INVALID_TIME_FORMAT 132
+#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
+#define ASN1_R_INVALID_UTF8STRING 134
+#define ASN1_R_IV_TOO_LARGE 135
+#define ASN1_R_LENGTH_ERROR 136
+#define ASN1_R_LIST_ERROR 188
+#define ASN1_R_MIME_NO_CONTENT_TYPE 201
+#define ASN1_R_MIME_PARSE_ERROR 202
+#define ASN1_R_MIME_SIG_PARSE_ERROR 203
+#define ASN1_R_MISSING_EOC 137
+#define ASN1_R_MISSING_SECOND_NUMBER 138
+#define ASN1_R_MISSING_VALUE 189
+#define ASN1_R_MSTRING_NOT_UNIVERSAL 139
+#define ASN1_R_MSTRING_WRONG_TAG 140
+#define ASN1_R_NESTED_ASN1_STRING 197
+#define ASN1_R_NON_HEX_CHARACTERS 141
+#define ASN1_R_NOT_ASCII_FORMAT 190
+#define ASN1_R_NOT_ENOUGH_DATA 142
+#define ASN1_R_NO_CONTENT_TYPE 204
+#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
+#define ASN1_R_NO_MULTIPART_BODY_FAILURE 205
+#define ASN1_R_NO_MULTIPART_BOUNDARY 206
+#define ASN1_R_NO_SIG_CONTENT_TYPE 207
+#define ASN1_R_NULL_IS_WRONG_LENGTH 144
+#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
+#define ASN1_R_ODD_NUMBER_OF_CHARS 145
+#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
+#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
+#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
+#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
+#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
+#define ASN1_R_SHORT_LINE 150
+#define ASN1_R_SIG_INVALID_MIME_TYPE 208
+#define ASN1_R_STREAMING_NOT_SUPPORTED 209
+#define ASN1_R_STRING_TOO_LONG 151
+#define ASN1_R_STRING_TOO_SHORT 152
+#define ASN1_R_TAG_VALUE_TOO_HIGH 153
#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
-#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
-#define ASN1_R_TOO_LONG 155
-#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
-#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
-#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
-#define ASN1_R_UNEXPECTED_EOC 159
-#define ASN1_R_UNKNOWN_FORMAT 160
-#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
-#define ASN1_R_UNKNOWN_OBJECT_TYPE 162
-#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
-#define ASN1_R_UNKNOWN_TAG 194
-#define ASN1_R_UNKOWN_FORMAT 195
-#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
-#define ASN1_R_UNSUPPORTED_CIPHER 165
-#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
-#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
-#define ASN1_R_UNSUPPORTED_TYPE 196
-#define ASN1_R_WRONG_TAG 168
-#define ASN1_R_WRONG_TYPE 169
+#define ASN1_R_TIME_NOT_ASCII_FORMAT 193
+#define ASN1_R_TOO_LONG 155
+#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
+#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
+#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
+#define ASN1_R_UNEXPECTED_EOC 159
+#define ASN1_R_UNKNOWN_FORMAT 160
+#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
+#define ASN1_R_UNKNOWN_OBJECT_TYPE 162
+#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
+#define ASN1_R_UNKNOWN_TAG 194
+#define ASN1_R_UNKOWN_FORMAT 195
+#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
+#define ASN1_R_UNSUPPORTED_CIPHER 165
+#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
+#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
+#define ASN1_R_UNSUPPORTED_TYPE 196
+#define ASN1_R_WRONG_TAG 168
+#define ASN1_R_WRONG_TYPE 169
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/asn1t.h b/dep/include/openssl/asn1t.h
index bf4ea43fb8e..ac14f9415b8 100644
--- a/dep/include/openssl/asn1t.h
+++ b/dep/include/openssl/asn1t.h
@@ -1,5 +1,5 @@
/* asn1t.h */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
/* ====================================================================
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -83,10 +83,10 @@ extern "C" {
/* Macros for start and end of ASN1_ITEM definition */
#define ASN1_ITEM_start(itname) \
- OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
+ OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
#define ASN1_ITEM_end(itname) \
- };
+ };
#else
@@ -97,14 +97,14 @@ extern "C" {
/* Macros for start and end of ASN1_ITEM definition */
#define ASN1_ITEM_start(itname) \
- const ASN1_ITEM * itname##_it(void) \
- { \
- static const ASN1_ITEM local_it = {
+ const ASN1_ITEM * itname##_it(void) \
+ { \
+ static const ASN1_ITEM local_it = {
#define ASN1_ITEM_end(itname) \
- }; \
- return &local_it; \
- }
+ }; \
+ return &local_it; \
+ }
#endif
@@ -112,90 +112,93 @@ extern "C" {
/* Macros to aid ASN1 template writing */
#define ASN1_ITEM_TEMPLATE(tname) \
- static const ASN1_TEMPLATE tname##_item_tt
+ static const ASN1_TEMPLATE tname##_item_tt
#define ASN1_ITEM_TEMPLATE_END(tname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_PRIMITIVE,\
- -1,\
- &tname##_item_tt,\
- 0,\
- NULL,\
- 0,\
- #tname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_PRIMITIVE,\
+ -1,\
+ &tname##_item_tt,\
+ 0,\
+ NULL,\
+ 0,\
+ #tname \
+ ASN1_ITEM_end(tname)
/* This is a ASN1 type which just embeds a template */
-
+
/* This pair helps declare a SEQUENCE. We can do:
*
- * ASN1_SEQUENCE(stname) = {
- * ... SEQUENCE components ...
- * } ASN1_SEQUENCE_END(stname)
+ * ASN1_SEQUENCE(stname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END(stname)
*
- * This will produce an ASN1_ITEM called stname_it
- * for a structure called stname.
+ * This will produce an ASN1_ITEM called stname_it
+ * for a structure called stname.
*
- * If you want the same structure but a different
- * name then use:
+ * If you want the same structure but a different
+ * name then use:
*
- * ASN1_SEQUENCE(itname) = {
- * ... SEQUENCE components ...
- * } ASN1_SEQUENCE_END_name(stname, itname)
+ * ASN1_SEQUENCE(itname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END_name(stname, itname)
*
- * This will create an item called itname_it using
- * a structure called stname.
+ * This will create an item called itname_it using
+ * a structure called stname.
*/
#define ASN1_SEQUENCE(tname) \
- static const ASN1_TEMPLATE tname##_seq_tt[]
+ static const ASN1_TEMPLATE tname##_seq_tt[]
#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
#define ASN1_SEQUENCE_END_name(stname, tname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_SEQUENCE,\
- V_ASN1_SEQUENCE,\
- tname##_seq_tt,\
- sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
- NULL,\
- sizeof(stname),\
- #stname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
#define ASN1_NDEF_SEQUENCE(tname) \
- ASN1_SEQUENCE(tname)
+ ASN1_SEQUENCE(tname)
+
+#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
+ ASN1_SEQUENCE_cb(tname, cb)
#define ASN1_SEQUENCE_cb(tname, cb) \
- static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
- ASN1_SEQUENCE(tname)
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_SEQUENCE(tname)
#define ASN1_BROKEN_SEQUENCE(tname) \
- static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
- ASN1_SEQUENCE(tname)
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
+ ASN1_SEQUENCE(tname)
#define ASN1_SEQUENCE_ref(tname, cb, lck) \
- static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
- ASN1_SEQUENCE(tname)
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
+ ASN1_SEQUENCE(tname)
#define ASN1_SEQUENCE_enc(tname, enc, cb) \
- static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
- ASN1_SEQUENCE(tname)
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
+ ASN1_SEQUENCE(tname)
#define ASN1_NDEF_SEQUENCE_END(tname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_NDEF_SEQUENCE,\
- V_ASN1_SEQUENCE,\
- tname##_seq_tt,\
- sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
- NULL,\
- sizeof(tname),\
- #tname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_NDEF_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(tname),\
+ #tname \
+ ASN1_ITEM_end(tname)
#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
@@ -204,101 +207,101 @@ extern "C" {
#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
#define ASN1_SEQUENCE_END_ref(stname, tname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_SEQUENCE,\
- V_ASN1_SEQUENCE,\
- tname##_seq_tt,\
- sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
- &tname##_aux,\
- sizeof(stname),\
- #stname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
/* This pair helps declare a CHOICE type. We can do:
*
- * ASN1_CHOICE(chname) = {
- * ... CHOICE options ...
- * ASN1_CHOICE_END(chname)
- *
- * This will produce an ASN1_ITEM called chname_it
- * for a structure called chname. The structure
- * definition must look like this:
- * typedef struct {
- * int type;
- * union {
- * ASN1_SOMETHING *opt1;
- * ASN1_SOMEOTHER *opt2;
- * } value;
- * } chname;
+ * ASN1_CHOICE(chname) = {
+ * ... CHOICE options ...
+ * ASN1_CHOICE_END(chname)
*
- * the name of the selector must be 'type'.
- * to use an alternative selector name use the
+ * This will produce an ASN1_ITEM called chname_it
+ * for a structure called chname. The structure
+ * definition must look like this:
+ * typedef struct {
+ * int type;
+ * union {
+ * ASN1_SOMETHING *opt1;
+ * ASN1_SOMEOTHER *opt2;
+ * } value;
+ * } chname;
+ *
+ * the name of the selector must be 'type'.
+ * to use an alternative selector name use the
* ASN1_CHOICE_END_selector() version.
*/
#define ASN1_CHOICE(tname) \
- static const ASN1_TEMPLATE tname##_ch_tt[]
+ static const ASN1_TEMPLATE tname##_ch_tt[]
#define ASN1_CHOICE_cb(tname, cb) \
- static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
- ASN1_CHOICE(tname)
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_CHOICE(tname)
#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
#define ASN1_CHOICE_END_selector(stname, tname, selname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_CHOICE,\
- offsetof(stname,selname) ,\
- tname##_ch_tt,\
- sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
- NULL,\
- sizeof(stname),\
- #stname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
#define ASN1_CHOICE_END_cb(stname, tname, selname) \
- ;\
- ASN1_ITEM_start(tname) \
- ASN1_ITYPE_CHOICE,\
- offsetof(stname,selname) ,\
- tname##_ch_tt,\
- sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
- &tname##_aux,\
- sizeof(stname),\
- #stname \
- ASN1_ITEM_end(tname)
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
/* This helps with the template wrapper form of ASN1_ITEM */
#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
- (flags), (tag), 0,\
- #name, ASN1_ITEM_ref(type) }
+ (flags), (tag), 0,\
+ #name, ASN1_ITEM_ref(type) }
/* These help with SEQUENCE or CHOICE components */
/* used to declare other types */
#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
- (flags), (tag), offsetof(stname, field),\
- #field, ASN1_ITEM_ref(type) }
+ (flags), (tag), offsetof(stname, field),\
+ #field, ASN1_ITEM_ref(type) }
/* used when the structure is combined with the parent */
#define ASN1_EX_COMBINE(flags, tag, type) { \
- (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
+ (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
/* implicit and explicit helper macros */
#define ASN1_IMP_EX(stname, field, type, tag, ex) \
- ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
#define ASN1_EXP_EX(stname, field, type, tag, ex) \
- ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
/* Any defined by macros: the field used is in the table itself */
@@ -328,95 +331,99 @@ extern "C" {
/* SEQUENCE OF type */
#define ASN1_SEQUENCE_OF(stname, field, type) \
- ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
/* OPTIONAL SEQUENCE OF */
#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
- ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
/* Same as above but for SET OF */
#define ASN1_SET_OF(stname, field, type) \
- ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
#define ASN1_SET_OF_OPT(stname, field, type) \
- ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
#define ASN1_IMP_SET_OF(stname, field, type, tag) \
- ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
#define ASN1_EXP_SET_OF(stname, field, type, tag) \
- ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
- ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
- ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
- ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
- ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
- ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
- ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+/* EXPLICIT using indefinite length constructed form */
+#define ASN1_NDEF_EXP(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
/* EXPLICIT OPTIONAL using indefinite length constructed form */
#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
- ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
/* Macros for the ASN1_ADB structure */
#define ASN1_ADB(name) \
- static const ASN1_ADB_TABLE name##_adbtbl[]
+ static const ASN1_ADB_TABLE name##_adbtbl[]
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
#define ASN1_ADB_END(name, flags, field, app_table, def, none) \
- ;\
- static const ASN1_ADB name##_adb = {\
- flags,\
- offsetof(name, field),\
- app_table,\
- name##_adbtbl,\
- sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
- def,\
- none\
- }
+ ;\
+ static const ASN1_ADB name##_adb = {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }
#else
#define ASN1_ADB_END(name, flags, field, app_table, def, none) \
- ;\
- static const ASN1_ITEM *name##_adb(void) \
- { \
- static const ASN1_ADB internal_adb = \
- {\
- flags,\
- offsetof(name, field),\
- app_table,\
- name##_adbtbl,\
- sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
- def,\
- none\
- }; \
- return (const ASN1_ITEM *) &internal_adb; \
- } \
- void dummy_function(void)
+ ;\
+ static const ASN1_ITEM *name##_adb(void) \
+ { \
+ static const ASN1_ADB internal_adb = \
+ {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }; \
+ return (const ASN1_ITEM *) &internal_adb; \
+ } \
+ void dummy_function(void)
#endif
#define ADB_ENTRY(val, template) {val, template}
#define ASN1_ADB_TEMPLATE(name) \
- static const ASN1_TEMPLATE name##_tt
+ static const ASN1_TEMPLATE name##_tt
/* This is the ASN1 template structure that defines
* a wrapper round the actual type. It determines the
@@ -425,13 +432,13 @@ extern "C" {
*/
struct ASN1_TEMPLATE_st {
-unsigned long flags; /* Various flags */
-long tag; /* tag, not used if no tagging */
-unsigned long offset; /* Offset of this field in structure */
+unsigned long flags; /* Various flags */
+long tag; /* tag, not used if no tagging */
+unsigned long offset; /* Offset of this field in structure */
#ifndef NO_ASN1_FIELD_NAMES
-const char *field_name; /* Field name */
+const char *field_name; /* Field name */
#endif
-ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
+ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
};
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
@@ -443,40 +450,40 @@ typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
typedef struct ASN1_ADB_st ASN1_ADB;
struct ASN1_ADB_st {
- unsigned long flags; /* Various flags */
- unsigned long offset; /* Offset of selector field */
- STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
- const ASN1_ADB_TABLE *tbl; /* Table of possible types */
- long tblcount; /* Number of entries in tbl */
- const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
- const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
+ unsigned long flags; /* Various flags */
+ unsigned long offset; /* Offset of selector field */
+ STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
+ const ASN1_ADB_TABLE *tbl; /* Table of possible types */
+ long tblcount; /* Number of entries in tbl */
+ const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
+ const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
};
struct ASN1_ADB_TABLE_st {
- long value; /* NID for an object or value for an int */
- const ASN1_TEMPLATE tt; /* item for this value */
+ long value; /* NID for an object or value for an int */
+ const ASN1_TEMPLATE tt; /* item for this value */
};
/* template flags */
/* Field is optional */
-#define ASN1_TFLG_OPTIONAL (0x1)
+#define ASN1_TFLG_OPTIONAL (0x1)
/* Field is a SET OF */
-#define ASN1_TFLG_SET_OF (0x1 << 1)
+#define ASN1_TFLG_SET_OF (0x1 << 1)
/* Field is a SEQUENCE OF */
-#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
+#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
/* Special case: this refers to a SET OF that
* will be sorted into DER order when encoded *and*
* the corresponding STACK will be modified to match
* the new order.
*/
-#define ASN1_TFLG_SET_ORDER (0x3 << 1)
+#define ASN1_TFLG_SET_ORDER (0x3 << 1)
/* Mask for SET OF or SEQUENCE OF */
-#define ASN1_TFLG_SK_MASK (0x3 << 1)
+#define ASN1_TFLG_SK_MASK (0x3 << 1)
/* These flags mean the tag should be taken from the
* tag field. If EXPLICIT then the underlying type
@@ -484,36 +491,36 @@ struct ASN1_ADB_TABLE_st {
*/
/* IMPLICIT tagging */
-#define ASN1_TFLG_IMPTAG (0x1 << 3)
+#define ASN1_TFLG_IMPTAG (0x1 << 3)
/* EXPLICIT tagging, inner tag from underlying type */
-#define ASN1_TFLG_EXPTAG (0x2 << 3)
+#define ASN1_TFLG_EXPTAG (0x2 << 3)
-#define ASN1_TFLG_TAG_MASK (0x3 << 3)
+#define ASN1_TFLG_TAG_MASK (0x3 << 3)
/* context specific IMPLICIT */
-#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
+#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
/* context specific EXPLICIT */
-#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
+#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
/* If tagging is in force these determine the
* type of tag to use. Otherwise the tag is
- * determined by the underlying type. These
+ * determined by the underlying type. These
* values reflect the actual octet format.
*/
-/* Universal tag */
-#define ASN1_TFLG_UNIVERSAL (0x0<<6)
-/* Application tag */
-#define ASN1_TFLG_APPLICATION (0x1<<6)
-/* Context specific tag */
-#define ASN1_TFLG_CONTEXT (0x2<<6)
-/* Private tag */
-#define ASN1_TFLG_PRIVATE (0x3<<6)
+/* Universal tag */
+#define ASN1_TFLG_UNIVERSAL (0x0<<6)
+/* Application tag */
+#define ASN1_TFLG_APPLICATION (0x1<<6)
+/* Context specific tag */
+#define ASN1_TFLG_CONTEXT (0x2<<6)
+/* Private tag */
+#define ASN1_TFLG_PRIVATE (0x3<<6)
-#define ASN1_TFLG_TAG_CLASS (0x3<<6)
+#define ASN1_TFLG_TAG_CLASS (0x3<<6)
/* These are for ANY DEFINED BY type. In this case
* the 'item' field points to an ASN1_ADB structure
@@ -521,11 +528,11 @@ struct ASN1_ADB_TABLE_st {
* relevant type
*/
-#define ASN1_TFLG_ADB_MASK (0x3<<8)
+#define ASN1_TFLG_ADB_MASK (0x3<<8)
-#define ASN1_TFLG_ADB_OID (0x1<<8)
+#define ASN1_TFLG_ADB_OID (0x1<<8)
-#define ASN1_TFLG_ADB_INT (0x1<<9)
+#define ASN1_TFLG_ADB_INT (0x1<<9)
/* This flag means a parent structure is passed
* instead of the field: this is useful is a
@@ -535,26 +542,26 @@ struct ASN1_ADB_TABLE_st {
* ASN1_CHOICE_END_name() macro for example.
*/
-#define ASN1_TFLG_COMBINE (0x1<<10)
+#define ASN1_TFLG_COMBINE (0x1<<10)
/* This flag when present in a SEQUENCE OF, SET OF
* or EXPLICIT causes indefinite length constructed
* encoding to be used if required.
*/
-#define ASN1_TFLG_NDEF (0x1<<11)
+#define ASN1_TFLG_NDEF (0x1<<11)
/* This is the actual ASN1 item itself */
struct ASN1_ITEM_st {
-char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */
-long utype; /* underlying type */
-const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */
-long tcount; /* Number of templates if SEQUENCE or CHOICE */
-const void *funcs; /* functions that handle this type */
-long size; /* Structure size (usually)*/
+char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */
+long utype; /* underlying type */
+const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */
+long tcount; /* Number of templates if SEQUENCE or CHOICE */
+const void *funcs; /* functions that handle this type */
+long size; /* Structure size (usually)*/
#ifndef NO_ASN1_FIELD_NAMES
-const char *sname; /* Structure name */
+const char *sname; /* Structure name */
#endif
};
@@ -564,7 +571,7 @@ const char *sname; /* Structure name */
* For PRIMITIVE types the underlying type
* determines the behaviour if items is NULL.
*
- * Otherwise templates must contain a single
+ * Otherwise templates must contain a single
* template and the type is treated in the
* same way as the type specified in the template.
*
@@ -578,7 +585,7 @@ const char *sname; /* Structure name */
* selector.
*
* The 'funcs' field is used for application
- * specific functions.
+ * specific functions.
*
* For COMPAT types the funcs field gives a
* set of functions that handle this type, this
@@ -602,19 +609,19 @@ const char *sname; /* Structure name */
*
*/
-#define ASN1_ITYPE_PRIMITIVE 0x0
+#define ASN1_ITYPE_PRIMITIVE 0x0
-#define ASN1_ITYPE_SEQUENCE 0x1
+#define ASN1_ITYPE_SEQUENCE 0x1
-#define ASN1_ITYPE_CHOICE 0x2
+#define ASN1_ITYPE_CHOICE 0x2
-#define ASN1_ITYPE_COMPAT 0x3
+#define ASN1_ITYPE_COMPAT 0x3
-#define ASN1_ITYPE_EXTERN 0x4
+#define ASN1_ITYPE_EXTERN 0x4
-#define ASN1_ITYPE_MSTRING 0x5
+#define ASN1_ITYPE_MSTRING 0x5
-#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
+#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
/* Cache for ASN1 tag and length, so we
* don't keep re-reading it for things
@@ -622,12 +629,12 @@ const char *sname; /* Structure name */
*/
struct ASN1_TLC_st{
- char valid; /* Values below are valid */
- int ret; /* return value */
- long plen; /* length */
- int ptag; /* class value */
- int pclass; /* class value */
- int hdrlen; /* header length */
+ char valid; /* Values below are valid */
+ int ret; /* return value */
+ long plen; /* length */
+ int ptag; /* class value */
+ int pclass; /* class value */
+ int hdrlen; /* header length */
};
/* Typedefs for ASN1 function pointers */
@@ -638,7 +645,7 @@ typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, lo
typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in);
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it,
- int tag, int aclass, char opt, ASN1_TLC *ctx);
+ int tag, int aclass, char opt, ASN1_TLC *ctx);
typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass);
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
@@ -648,29 +655,29 @@ typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *puty
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
typedef struct ASN1_COMPAT_FUNCS_st {
- ASN1_new_func *asn1_new;
- ASN1_free_func *asn1_free;
- ASN1_d2i_func *asn1_d2i;
- ASN1_i2d_func *asn1_i2d;
+ ASN1_new_func *asn1_new;
+ ASN1_free_func *asn1_free;
+ ASN1_d2i_func *asn1_d2i;
+ ASN1_i2d_func *asn1_i2d;
} ASN1_COMPAT_FUNCS;
typedef struct ASN1_EXTERN_FUNCS_st {
- void *app_data;
- ASN1_ex_new_func *asn1_ex_new;
- ASN1_ex_free_func *asn1_ex_free;
- ASN1_ex_free_func *asn1_ex_clear;
- ASN1_ex_d2i *asn1_ex_d2i;
- ASN1_ex_i2d *asn1_ex_i2d;
+ void *app_data;
+ ASN1_ex_new_func *asn1_ex_new;
+ ASN1_ex_free_func *asn1_ex_free;
+ ASN1_ex_free_func *asn1_ex_clear;
+ ASN1_ex_d2i *asn1_ex_d2i;
+ ASN1_ex_i2d *asn1_ex_i2d;
} ASN1_EXTERN_FUNCS;
typedef struct ASN1_PRIMITIVE_FUNCS_st {
- void *app_data;
- unsigned long flags;
- ASN1_ex_new_func *prim_new;
- ASN1_ex_free_func *prim_free;
- ASN1_ex_free_func *prim_clear;
- ASN1_primitive_c2i *prim_c2i;
- ASN1_primitive_i2c *prim_i2c;
+ void *app_data;
+ unsigned long flags;
+ ASN1_ex_new_func *prim_new;
+ ASN1_ex_free_func *prim_free;
+ ASN1_ex_free_func *prim_clear;
+ ASN1_primitive_c2i *prim_c2i;
+ ASN1_primitive_i2c *prim_i2c;
} ASN1_PRIMITIVE_FUNCS;
/* This is the ASN1_AUX structure: it handles various
@@ -683,7 +690,7 @@ typedef struct ASN1_PRIMITIVE_FUNCS_st {
* used. This is most useful where the supplied routines
* *almost* do the right thing but need some extra help
* at a few points. If the callback returns zero then
- * it is assumed a fatal error has occurred and the
+ * it is assumed a fatal error has occurred and the
* main operation should be abandoned.
*
* If major changes in the default behaviour are required
@@ -693,78 +700,78 @@ typedef struct ASN1_PRIMITIVE_FUNCS_st {
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it);
typedef struct ASN1_AUX_st {
- void *app_data;
- int flags;
- int ref_offset; /* Offset of reference value */
- int ref_lock; /* Lock type to use */
- ASN1_aux_cb *asn1_cb;
- int enc_offset; /* Offset of ASN1_ENCODING structure */
+ void *app_data;
+ int flags;
+ int ref_offset; /* Offset of reference value */
+ int ref_lock; /* Lock type to use */
+ ASN1_aux_cb *asn1_cb;
+ int enc_offset; /* Offset of ASN1_ENCODING structure */
} ASN1_AUX;
/* Flags in ASN1_AUX */
/* Use a reference count */
-#define ASN1_AFLG_REFCOUNT 1
+#define ASN1_AFLG_REFCOUNT 1
/* Save the encoding of structure (useful for signatures) */
-#define ASN1_AFLG_ENCODING 2
+#define ASN1_AFLG_ENCODING 2
/* The Sequence length is invalid */
-#define ASN1_AFLG_BROKEN 4
+#define ASN1_AFLG_BROKEN 4
/* operation values for asn1_cb */
-#define ASN1_OP_NEW_PRE 0
-#define ASN1_OP_NEW_POST 1
-#define ASN1_OP_FREE_PRE 2
-#define ASN1_OP_FREE_POST 3
-#define ASN1_OP_D2I_PRE 4
-#define ASN1_OP_D2I_POST 5
-#define ASN1_OP_I2D_PRE 6
-#define ASN1_OP_I2D_POST 7
+#define ASN1_OP_NEW_PRE 0
+#define ASN1_OP_NEW_POST 1
+#define ASN1_OP_FREE_PRE 2
+#define ASN1_OP_FREE_POST 3
+#define ASN1_OP_D2I_PRE 4
+#define ASN1_OP_D2I_POST 5
+#define ASN1_OP_I2D_PRE 6
+#define ASN1_OP_I2D_POST 7
/* Macro to implement a primitive type */
#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
- ASN1_ITEM_start(itname) \
- ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
- ASN1_ITEM_end(itname)
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
+ ASN1_ITEM_end(itname)
/* Macro to implement a multi string type */
#define IMPLEMENT_ASN1_MSTRING(itname, mask) \
- ASN1_ITEM_start(itname) \
- ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
- ASN1_ITEM_end(itname)
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
+ ASN1_ITEM_end(itname)
/* Macro to implement an ASN1_ITEM in terms of old style funcs */
#define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)
#define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \
- static const ASN1_COMPAT_FUNCS sname##_ff = { \
- (ASN1_new_func *)sname##_new, \
- (ASN1_free_func *)sname##_free, \
- (ASN1_d2i_func *)d2i_##sname, \
- (ASN1_i2d_func *)i2d_##sname, \
- }; \
- ASN1_ITEM_start(sname) \
- ASN1_ITYPE_COMPAT, \
- tag, \
- NULL, \
- 0, \
- &sname##_ff, \
- 0, \
- #sname \
- ASN1_ITEM_end(sname)
+ static const ASN1_COMPAT_FUNCS sname##_ff = { \
+ (ASN1_new_func *)sname##_new, \
+ (ASN1_free_func *)sname##_free, \
+ (ASN1_d2i_func *)d2i_##sname, \
+ (ASN1_i2d_func *)i2d_##sname, \
+ }; \
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_COMPAT, \
+ tag, \
+ NULL, \
+ 0, \
+ &sname##_ff, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
- ASN1_ITEM_start(sname) \
- ASN1_ITYPE_EXTERN, \
- tag, \
- NULL, \
- 0, \
- &fptrs, \
- 0, \
- #sname \
- ASN1_ITEM_end(sname)
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_EXTERN, \
+ tag, \
+ NULL, \
+ 0, \
+ &fptrs, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
@@ -773,66 +780,66 @@ typedef struct ASN1_AUX_st {
#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
- IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
+ IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
- IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
- stname *fname##_new(void) \
- { \
- return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
- } \
- void fname##_free(stname *a) \
- { \
- ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
- }
+ stname *fname##_new(void) \
+ { \
+ return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+ } \
+ void fname##_free(stname *a) \
+ { \
+ ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+ }
#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
- IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
- IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
- { \
- return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
- } \
- int i2d_##fname(stname *a, unsigned char **out) \
- { \
- return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
- }
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
- int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
- { \
- return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
- }
+ int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
+ }
/* This includes evil casts to remove const: they will go away when full
* ASN1 constification is done.
*/
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
- { \
- return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
- } \
- int i2d_##fname(const stname *a, unsigned char **out) \
- { \
- return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
- }
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(const stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
- stname * stname##_dup(stname *x) \
+ stname * stname##_dup(stname *x) \
{ \
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
}
#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
- IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
+ IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
- IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
- IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
/* external definitions for primitive types */
@@ -857,7 +864,7 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt);
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it,
- int tag, int aclass, char opt, ASN1_TLC *ctx);
+ int tag, int aclass, char opt, ASN1_TLC *ctx);
int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass);
int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt);
@@ -884,4 +891,3 @@ int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const A
}
#endif
#endif
-
diff --git a/dep/include/openssl/bio.h b/dep/include/openssl/bio.h
index 960b77ba101..cecb6a72077 100644
--- a/dep/include/openssl/bio.h
+++ b/dep/include/openssl/bio.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -73,64 +73,65 @@ extern "C" {
#endif
/* These are the 'types' of BIOs */
-#define BIO_TYPE_NONE 0
-#define BIO_TYPE_MEM (1|0x0400)
-#define BIO_TYPE_FILE (2|0x0400)
-
-#define BIO_TYPE_FD (4|0x0400|0x0100)
-#define BIO_TYPE_SOCKET (5|0x0400|0x0100)
-#define BIO_TYPE_NULL (6|0x0400)
-#define BIO_TYPE_SSL (7|0x0200)
-#define BIO_TYPE_MD (8|0x0200) /* passive filter */
-#define BIO_TYPE_BUFFER (9|0x0200) /* filter */
-#define BIO_TYPE_CIPHER (10|0x0200) /* filter */
-#define BIO_TYPE_BASE64 (11|0x0200) /* filter */
-#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */
-#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */
-#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */
-#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */
-#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */
-#define BIO_TYPE_NULL_FILTER (17|0x0200)
-#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */
-#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
-#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
-#define BIO_TYPE_DGRAM (21|0x0400|0x0100)
-
-#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
-#define BIO_TYPE_FILTER 0x0200
-#define BIO_TYPE_SOURCE_SINK 0x0400
+#define BIO_TYPE_NONE 0
+#define BIO_TYPE_MEM (1|0x0400)
+#define BIO_TYPE_FILE (2|0x0400)
+
+#define BIO_TYPE_FD (4|0x0400|0x0100)
+#define BIO_TYPE_SOCKET (5|0x0400|0x0100)
+#define BIO_TYPE_NULL (6|0x0400)
+#define BIO_TYPE_SSL (7|0x0200)
+#define BIO_TYPE_MD (8|0x0200) /* passive filter */
+#define BIO_TYPE_BUFFER (9|0x0200) /* filter */
+#define BIO_TYPE_CIPHER (10|0x0200) /* filter */
+#define BIO_TYPE_BASE64 (11|0x0200) /* filter */
+#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */
+#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */
+#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */
+#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */
+#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */
+#define BIO_TYPE_NULL_FILTER (17|0x0200)
+#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */
+#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
+#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
+#define BIO_TYPE_DGRAM (21|0x0400|0x0100)
+#define BIO_TYPE_COMP (23|0x0200) /* filter */
+
+#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
+#define BIO_TYPE_FILTER 0x0200
+#define BIO_TYPE_SOURCE_SINK 0x0400
/* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
* BIO_set_fp(in,stdin,BIO_NOCLOSE); */
-#define BIO_NOCLOSE 0x00
-#define BIO_CLOSE 0x01
+#define BIO_NOCLOSE 0x00
+#define BIO_CLOSE 0x01
/* These are used in the following macros and are passed to
* BIO_ctrl() */
-#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
-#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
-#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
-#define BIO_CTRL_SET 4 /* man - set the 'IO' type */
-#define BIO_CTRL_GET 5 /* man - get the 'IO' type */
-#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
-#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
-#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */
-#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
-#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
-#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
-#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
-#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
+#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
+#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
+#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
+#define BIO_CTRL_SET 4 /* man - set the 'IO' type */
+#define BIO_CTRL_GET 5 /* man - get the 'IO' type */
+#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
+#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
+#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */
+#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
+#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
+#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
+#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
+#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
/* callback is int cb(BIO *bio,state,ret); */
-#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */
-#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */
+#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */
+#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */
-#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */
+#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */
/* dgram BIO stuff */
#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */
#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally
- * connected socket to be
- * passed in */
+ * connected socket to be
+ * passed in */
#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */
#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */
#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */
@@ -138,7 +139,7 @@ extern "C" {
#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */
#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */
-
+
/* #ifdef IP_MTU_DISCOVER */
#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */
/* #endif */
@@ -146,55 +147,55 @@ extern "C" {
#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */
#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */
#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for
- * MTU. want to use this
- * if asking the kernel
- * fails */
+ * MTU. want to use this
+ * if asking the kernel
+ * fails */
#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU
- * was exceed in the
- * previous write
- * operation */
+ * was exceed in the
+ * previous write
+ * operation */
#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */
/* modifiers */
-#define BIO_FP_READ 0x02
-#define BIO_FP_WRITE 0x04
-#define BIO_FP_APPEND 0x08
-#define BIO_FP_TEXT 0x10
-
-#define BIO_FLAGS_READ 0x01
-#define BIO_FLAGS_WRITE 0x02
-#define BIO_FLAGS_IO_SPECIAL 0x04
+#define BIO_FP_READ 0x02
+#define BIO_FP_WRITE 0x04
+#define BIO_FP_APPEND 0x08
+#define BIO_FP_TEXT 0x10
+
+#define BIO_FLAGS_READ 0x01
+#define BIO_FLAGS_WRITE 0x02
+#define BIO_FLAGS_IO_SPECIAL 0x04
#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
-#define BIO_FLAGS_SHOULD_RETRY 0x08
-#ifndef BIO_FLAGS_UPLINK
+#define BIO_FLAGS_SHOULD_RETRY 0x08
+#ifndef BIO_FLAGS_UPLINK
/* "UPLINK" flag denotes file descriptors provided by application.
It defaults to 0, as most platforms don't require UPLINK interface. */
-#define BIO_FLAGS_UPLINK 0
+#define BIO_FLAGS_UPLINK 0
#endif
/* Used in BIO_gethostbyname() */
-#define BIO_GHBN_CTRL_HITS 1
-#define BIO_GHBN_CTRL_MISSES 2
-#define BIO_GHBN_CTRL_CACHE_SIZE 3
-#define BIO_GHBN_CTRL_GET_ENTRY 4
-#define BIO_GHBN_CTRL_FLUSH 5
+#define BIO_GHBN_CTRL_HITS 1
+#define BIO_GHBN_CTRL_MISSES 2
+#define BIO_GHBN_CTRL_CACHE_SIZE 3
+#define BIO_GHBN_CTRL_GET_ENTRY 4
+#define BIO_GHBN_CTRL_FLUSH 5
/* Mostly used in the SSL BIO */
/* Not used anymore
* #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
* #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
- * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
+ * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
*/
-#define BIO_FLAGS_BASE64_NO_NL 0x100
+#define BIO_FLAGS_BASE64_NO_NL 0x100
/* This is used with memory BIOs: it means we shouldn't free up or change the
* data in any way.
*/
-#define BIO_FLAGS_MEM_RDONLY 0x200
+#define BIO_FLAGS_MEM_RDONLY 0x200
typedef struct bio_st BIO;
@@ -204,55 +205,55 @@ void BIO_clear_flags(BIO *b, int flags);
#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
#define BIO_set_retry_special(b) \
- BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
+ BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
#define BIO_set_retry_read(b) \
- BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
+ BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
#define BIO_set_retry_write(b) \
- BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
+ BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
/* These are normally used internally in BIOs */
#define BIO_clear_retry_flags(b) \
- BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+ BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
#define BIO_get_retry_flags(b) \
- BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+ BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
/* These should be used by the application to tell why we should retry */
-#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
-#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
-#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
-#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
-#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
+#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
+#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
+#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
+#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
+#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
/* The next three are used in conjunction with the
* BIO_should_io_special() condition. After this returns true,
- * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO
+ * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO
* stack and return the 'reason' for the special and the offending BIO.
* Given a BIO, BIO_get_retry_reason(bio) will return the code. */
/* Returned from the SSL bio when the certificate retrieval code had an error */
-#define BIO_RR_SSL_X509_LOOKUP 0x01
+#define BIO_RR_SSL_X509_LOOKUP 0x01
/* Returned from the connect BIO when a connect would have blocked */
-#define BIO_RR_CONNECT 0x02
+#define BIO_RR_CONNECT 0x02
/* Returned from the accept BIO when an accept would have blocked */
-#define BIO_RR_ACCEPT 0x03
+#define BIO_RR_ACCEPT 0x03
/* These are passed by the BIO callback */
-#define BIO_CB_FREE 0x01
-#define BIO_CB_READ 0x02
-#define BIO_CB_WRITE 0x03
-#define BIO_CB_PUTS 0x04
-#define BIO_CB_GETS 0x05
-#define BIO_CB_CTRL 0x06
+#define BIO_CB_FREE 0x01
+#define BIO_CB_READ 0x02
+#define BIO_CB_WRITE 0x03
+#define BIO_CB_PUTS 0x04
+#define BIO_CB_GETS 0x05
+#define BIO_CB_CTRL 0x06
/* The callback is called before and after the underling operation,
* The BIO_CB_RETURN flag indicates if it is after the call */
-#define BIO_CB_RETURN 0x80
+#define BIO_CB_RETURN 0x80
#define BIO_CB_return(a) ((a)|BIO_CB_RETURN))
-#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
-#define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
+#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
+#define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
long (*BIO_get_callback(const BIO *b)) (struct bio_st *,int,const char *,int, long,long);
-void BIO_set_callback(BIO *b,
- long (*callback)(struct bio_st *,int,const char *,int, long,long));
+void BIO_set_callback(BIO *b,
+ long (*callback)(struct bio_st *,int,const char *,int, long,long));
char *BIO_get_callback_arg(const BIO *b);
void BIO_set_callback_arg(BIO *b, char *arg);
@@ -263,172 +264,172 @@ typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
#ifndef OPENSSL_SYS_WIN16
typedef struct bio_method_st
- {
- int type;
- const char *name;
- int (*bwrite)(BIO *, const char *, int);
- int (*bread)(BIO *, char *, int);
- int (*bputs)(BIO *, const char *);
- int (*bgets)(BIO *, char *, int);
- long (*ctrl)(BIO *, int, long, void *);
- int (*create)(BIO *);
- int (*destroy)(BIO *);
+ {
+ int type;
+ const char *name;
+ int (*bwrite)(BIO *, const char *, int);
+ int (*bread)(BIO *, char *, int);
+ int (*bputs)(BIO *, const char *);
+ int (*bgets)(BIO *, char *, int);
+ long (*ctrl)(BIO *, int, long, void *);
+ int (*create)(BIO *);
+ int (*destroy)(BIO *);
long (*callback_ctrl)(BIO *, int, bio_info_cb *);
- } BIO_METHOD;
+ } BIO_METHOD;
#else
typedef struct bio_method_st
- {
- int type;
- const char *name;
- int (_far *bwrite)();
- int (_far *bread)();
- int (_far *bputs)();
- int (_far *bgets)();
- long (_far *ctrl)();
- int (_far *create)();
- int (_far *destroy)();
- long (_far *callback_ctrl)();
- } BIO_METHOD;
+ {
+ int type;
+ const char *name;
+ int (_far *bwrite)();
+ int (_far *bread)();
+ int (_far *bputs)();
+ int (_far *bgets)();
+ long (_far *ctrl)();
+ int (_far *create)();
+ int (_far *destroy)();
+ long (_far *callback_ctrl)();
+ } BIO_METHOD;
#endif
struct bio_st
- {
- BIO_METHOD *method;
- /* bio, mode, argp, argi, argl, ret */
- long (*callback)(struct bio_st *,int,const char *,int, long,long);
- char *cb_arg; /* first argument for the callback */
-
- int init;
- int shutdown;
- int flags; /* extra storage */
- int retry_reason;
- int num;
- void *ptr;
- struct bio_st *next_bio; /* used by filter BIOs */
- struct bio_st *prev_bio; /* used by filter BIOs */
- int references;
- unsigned long num_read;
- unsigned long num_write;
-
- CRYPTO_EX_DATA ex_data;
- };
+ {
+ BIO_METHOD *method;
+ /* bio, mode, argp, argi, argl, ret */
+ long (*callback)(struct bio_st *,int,const char *,int, long,long);
+ char *cb_arg; /* first argument for the callback */
+
+ int init;
+ int shutdown;
+ int flags; /* extra storage */
+ int retry_reason;
+ int num;
+ void *ptr;
+ struct bio_st *next_bio; /* used by filter BIOs */
+ struct bio_st *prev_bio; /* used by filter BIOs */
+ int references;
+ unsigned long num_read;
+ unsigned long num_write;
+
+ CRYPTO_EX_DATA ex_data;
+ };
DECLARE_STACK_OF(BIO)
typedef struct bio_f_buffer_ctx_struct
- {
- /* BIO *bio; */ /* this is now in the BIO struct */
- int ibuf_size; /* how big is the input buffer */
- int obuf_size; /* how big is the output buffer */
+ {
+ /* BIO *bio; */ /* this is now in the BIO struct */
+ int ibuf_size; /* how big is the input buffer */
+ int obuf_size; /* how big is the output buffer */
- char *ibuf; /* the char array */
- int ibuf_len; /* how many bytes are in it */
- int ibuf_off; /* write/read offset */
+ char *ibuf; /* the char array */
+ int ibuf_len; /* how many bytes are in it */
+ int ibuf_off; /* write/read offset */
- char *obuf; /* the char array */
- int obuf_len; /* how many bytes are in it */
- int obuf_off; /* write/read offset */
- } BIO_F_BUFFER_CTX;
+ char *obuf; /* the char array */
+ int obuf_len; /* how many bytes are in it */
+ int obuf_off; /* write/read offset */
+ } BIO_F_BUFFER_CTX;
/* connect BIO stuff */
-#define BIO_CONN_S_BEFORE 1
-#define BIO_CONN_S_GET_IP 2
-#define BIO_CONN_S_GET_PORT 3
-#define BIO_CONN_S_CREATE_SOCKET 4
-#define BIO_CONN_S_CONNECT 5
-#define BIO_CONN_S_OK 6
-#define BIO_CONN_S_BLOCKED_CONNECT 7
-#define BIO_CONN_S_NBIO 8
-/*#define BIO_CONN_get_param_hostname BIO_ctrl */
-
-#define BIO_C_SET_CONNECT 100
-#define BIO_C_DO_STATE_MACHINE 101
-#define BIO_C_SET_NBIO 102
-#define BIO_C_SET_PROXY_PARAM 103
-#define BIO_C_SET_FD 104
-#define BIO_C_GET_FD 105
-#define BIO_C_SET_FILE_PTR 106
-#define BIO_C_GET_FILE_PTR 107
-#define BIO_C_SET_FILENAME 108
-#define BIO_C_SET_SSL 109
-#define BIO_C_GET_SSL 110
-#define BIO_C_SET_MD 111
-#define BIO_C_GET_MD 112
-#define BIO_C_GET_CIPHER_STATUS 113
-#define BIO_C_SET_BUF_MEM 114
-#define BIO_C_GET_BUF_MEM_PTR 115
-#define BIO_C_GET_BUFF_NUM_LINES 116
-#define BIO_C_SET_BUFF_SIZE 117
-#define BIO_C_SET_ACCEPT 118
-#define BIO_C_SSL_MODE 119
-#define BIO_C_GET_MD_CTX 120
-#define BIO_C_GET_PROXY_PARAM 121
-#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */
-#define BIO_C_GET_CONNECT 123
-#define BIO_C_GET_ACCEPT 124
-#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
-#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
-#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
-#define BIO_C_FILE_SEEK 128
-#define BIO_C_GET_CIPHER_CTX 129
-#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/
-#define BIO_C_SET_BIND_MODE 131
-#define BIO_C_GET_BIND_MODE 132
-#define BIO_C_FILE_TELL 133
-#define BIO_C_GET_SOCKS 134
-#define BIO_C_SET_SOCKS 135
-
-#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
-#define BIO_C_GET_WRITE_BUF_SIZE 137
-#define BIO_C_MAKE_BIO_PAIR 138
-#define BIO_C_DESTROY_BIO_PAIR 139
-#define BIO_C_GET_WRITE_GUARANTEE 140
-#define BIO_C_GET_READ_REQUEST 141
-#define BIO_C_SHUTDOWN_WR 142
-#define BIO_C_NREAD0 143
-#define BIO_C_NREAD 144
-#define BIO_C_NWRITE0 145
-#define BIO_C_NWRITE 146
-#define BIO_C_RESET_READ_REQUEST 147
-#define BIO_C_SET_MD_CTX 148
-
-
-#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
-#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
+#define BIO_CONN_S_BEFORE 1
+#define BIO_CONN_S_GET_IP 2
+#define BIO_CONN_S_GET_PORT 3
+#define BIO_CONN_S_CREATE_SOCKET 4
+#define BIO_CONN_S_CONNECT 5
+#define BIO_CONN_S_OK 6
+#define BIO_CONN_S_BLOCKED_CONNECT 7
+#define BIO_CONN_S_NBIO 8
+/*#define BIO_CONN_get_param_hostname BIO_ctrl */
+
+#define BIO_C_SET_CONNECT 100
+#define BIO_C_DO_STATE_MACHINE 101
+#define BIO_C_SET_NBIO 102
+#define BIO_C_SET_PROXY_PARAM 103
+#define BIO_C_SET_FD 104
+#define BIO_C_GET_FD 105
+#define BIO_C_SET_FILE_PTR 106
+#define BIO_C_GET_FILE_PTR 107
+#define BIO_C_SET_FILENAME 108
+#define BIO_C_SET_SSL 109
+#define BIO_C_GET_SSL 110
+#define BIO_C_SET_MD 111
+#define BIO_C_GET_MD 112
+#define BIO_C_GET_CIPHER_STATUS 113
+#define BIO_C_SET_BUF_MEM 114
+#define BIO_C_GET_BUF_MEM_PTR 115
+#define BIO_C_GET_BUFF_NUM_LINES 116
+#define BIO_C_SET_BUFF_SIZE 117
+#define BIO_C_SET_ACCEPT 118
+#define BIO_C_SSL_MODE 119
+#define BIO_C_GET_MD_CTX 120
+#define BIO_C_GET_PROXY_PARAM 121
+#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */
+#define BIO_C_GET_CONNECT 123
+#define BIO_C_GET_ACCEPT 124
+#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
+#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
+#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
+#define BIO_C_FILE_SEEK 128
+#define BIO_C_GET_CIPHER_CTX 129
+#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/
+#define BIO_C_SET_BIND_MODE 131
+#define BIO_C_GET_BIND_MODE 132
+#define BIO_C_FILE_TELL 133
+#define BIO_C_GET_SOCKS 134
+#define BIO_C_SET_SOCKS 135
+
+#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
+#define BIO_C_GET_WRITE_BUF_SIZE 137
+#define BIO_C_MAKE_BIO_PAIR 138
+#define BIO_C_DESTROY_BIO_PAIR 139
+#define BIO_C_GET_WRITE_GUARANTEE 140
+#define BIO_C_GET_READ_REQUEST 141
+#define BIO_C_SHUTDOWN_WR 142
+#define BIO_C_NREAD0 143
+#define BIO_C_NREAD 144
+#define BIO_C_NWRITE0 145
+#define BIO_C_NWRITE 146
+#define BIO_C_RESET_READ_REQUEST 147
+#define BIO_C_SET_MD_CTX 148
+
+
+#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
+#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
/* BIO_s_connect() and BIO_s_socks4a_connect() */
#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
-#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
+#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
-#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
+#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3)
-#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
+#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
/* BIO_s_accept_socket() */
#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
-#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
-/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
+#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
+/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL)
#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
-#define BIO_BIND_NORMAL 0
-#define BIO_BIND_REUSEADDR_IF_UNUSED 1
-#define BIO_BIND_REUSEADDR 2
+#define BIO_BIND_NORMAL 0
+#define BIO_BIND_REUSEADDR_IF_UNUSED 1
+#define BIO_BIND_REUSEADDR 2
#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
#define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
-#define BIO_do_connect(b) BIO_do_handshake(b)
-#define BIO_do_accept(b) BIO_do_handshake(b)
-#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
+#define BIO_do_connect(b) BIO_do_handshake(b)
+#define BIO_do_accept(b) BIO_do_handshake(b)
+#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
/* BIO_s_proxy_client() */
-#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
-#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
+#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
+#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
/* BIO_set_nbio(b,n) */
#define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
/* BIO *BIO_get_filter_bio(BIO *bio); */
@@ -438,17 +439,17 @@ typedef struct bio_f_buffer_ctx_struct
#define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
#define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
-#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
-#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
+#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
+#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
-#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
-#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
+#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
+#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
-#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
-#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
+#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
+#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
-#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
-#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
+#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
+#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
/* name is cast to lose const, but might be better to route through a function
so we can do it safely */
@@ -459,60 +460,60 @@ typedef struct bio_f_buffer_ctx_struct
int BIO_read_filename(BIO *b,const char *name);
#else
#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
- BIO_CLOSE|BIO_FP_READ,(char *)name)
+ BIO_CLOSE|BIO_FP_READ,(char *)name)
#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
- BIO_CLOSE|BIO_FP_WRITE,name)
+ BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
- BIO_CLOSE|BIO_FP_APPEND,name)
+ BIO_CLOSE|BIO_FP_APPEND,name)
#define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
- BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
+ BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
/* WARNING WARNING, this ups the reference count on the read bio of the
* SSL structure. This is because the ssl read BIO is now pointed to by
* the next_bio field in the bio. So when you free the BIO, make sure
* you are doing a BIO_free_all() to catch the underlying BIO. */
-#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
-#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
-#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
+#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
+#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
+#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
#define BIO_set_ssl_renegotiate_bytes(b,num) \
- BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
#define BIO_get_num_renegotiates(b) \
- BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
+ BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
#define BIO_set_ssl_renegotiate_timeout(b,seconds) \
- BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
/* defined in evp.h */
-/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
+/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
-#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
-#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
-#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
+#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
+#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
+#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
#define BIO_set_mem_eof_return(b,v) \
- BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
+ BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
/* For the BIO_f_buffer() type */
-#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
-#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
+#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
+#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
/* Don't use the next one unless you know what you are doing :-) */
-#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
-
-#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
-#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
-#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
-#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
-#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
-#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
+#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
+
+#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
+#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
+#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
+#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
+#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
+#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
/* ...pending macros have inappropriate return type */
size_t BIO_ctrl_pending(BIO *b);
size_t BIO_ctrl_wpending(BIO *b);
-#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
+#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
- cbp)
+ cbp)
#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
/* For the BIO_f_buffer() type */
@@ -549,7 +550,7 @@ int BIO_ctrl_reset_read_request(BIO *b);
int BIO_set_ex_data(BIO *bio,int idx,void *data);
void *BIO_get_ex_data(BIO *bio,int idx);
int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
unsigned long BIO_number_read(BIO *bio);
unsigned long BIO_number_written(BIO *bio);
@@ -558,39 +559,39 @@ unsigned long BIO_number_written(BIO *bio);
BIO_METHOD *BIO_s_file_internal(void);
BIO *BIO_new_file_internal(char *filename, char *mode);
BIO *BIO_new_fp_internal(FILE *stream, int close_flag);
-# define BIO_s_file BIO_s_file_internal
-# define BIO_new_file BIO_new_file_internal
-# define BIO_new_fp BIO_new_fp_internal
+# define BIO_s_file BIO_s_file_internal
+# define BIO_new_file BIO_new_file_internal
+# define BIO_new_fp BIO_new_fp_internal
# else /* FP_API */
BIO_METHOD *BIO_s_file(void );
BIO *BIO_new_file(const char *filename, const char *mode);
BIO *BIO_new_fp(FILE *stream, int close_flag);
-# define BIO_s_file_internal BIO_s_file
-# define BIO_new_file_internal BIO_new_file
-# define BIO_new_fp_internal BIO_s_file
+# define BIO_s_file_internal BIO_s_file
+# define BIO_new_file_internal BIO_new_file
+# define BIO_new_fp_internal BIO_s_file
# endif /* FP_API */
# endif
-BIO * BIO_new(BIO_METHOD *type);
-int BIO_set(BIO *a,BIO_METHOD *type);
-int BIO_free(BIO *a);
-void BIO_vfree(BIO *a);
-int BIO_read(BIO *b, void *data, int len);
-int BIO_gets(BIO *bp,char *buf, int size);
-int BIO_write(BIO *b, const void *data, int len);
-int BIO_puts(BIO *bp,const char *buf);
-int BIO_indent(BIO *b,int indent,int max);
-long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
+BIO * BIO_new(BIO_METHOD *type);
+int BIO_set(BIO *a,BIO_METHOD *type);
+int BIO_free(BIO *a);
+void BIO_vfree(BIO *a);
+int BIO_read(BIO *b, void *data, int len);
+int BIO_gets(BIO *bp,char *buf, int size);
+int BIO_write(BIO *b, const void *data, int len);
+int BIO_puts(BIO *bp,const char *buf);
+int BIO_indent(BIO *b,int indent,int max);
+long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long));
-char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
-long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
-BIO * BIO_push(BIO *b,BIO *append);
-BIO * BIO_pop(BIO *b);
-void BIO_free_all(BIO *a);
-BIO * BIO_find_type(BIO *b,int bio_type);
-BIO * BIO_next(BIO *b);
-BIO * BIO_get_retry_BIO(BIO *bio, int *reason);
-int BIO_get_retry_reason(BIO *bio);
-BIO * BIO_dup_chain(BIO *in);
+char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
+long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
+BIO * BIO_push(BIO *b,BIO *append);
+BIO * BIO_pop(BIO *b);
+void BIO_free_all(BIO *a);
+BIO * BIO_find_type(BIO *b,int bio_type);
+BIO * BIO_next(BIO *b);
+BIO * BIO_get_retry_BIO(BIO *bio, int *reason);
+int BIO_get_retry_reason(BIO *bio);
+BIO * BIO_dup_chain(BIO *in);
int BIO_nread0(BIO *bio, char **buf);
int BIO_nread(BIO *bio, char **buf, int num);
@@ -599,10 +600,10 @@ int BIO_nwrite(BIO *bio, char **buf, int num);
#ifndef OPENSSL_SYS_WIN16
long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
- long argl,long ret);
+ long argl,long ret);
#else
long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
- long argl,long ret);
+ long argl,long ret);
#endif
BIO_METHOD *BIO_s_mem(void);
@@ -635,9 +636,9 @@ int BIO_dgram_non_fatal_error(int error);
int BIO_fd_should_retry(int i);
int BIO_fd_non_fatal_error(int error);
int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u),
- void *u, const char *s, int len);
+ void *u, const char *s, int len);
int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
- void *u, const char *s, int len, int indent);
+ void *u, const char *s, int len, int indent);
int BIO_dump(BIO *b,const char *bytes,int len);
int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent);
#ifndef OPENSSL_NO_FP_API
@@ -671,7 +672,7 @@ BIO *BIO_new_connect(char *host_port);
BIO *BIO_new_accept(char *host_port);
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
- BIO **bio2, size_t writebuf2);
+ BIO **bio2, size_t writebuf2);
/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL.
* Size 0 uses default value.
@@ -687,13 +688,13 @@ void BIO_copy_next_retry(BIO *b);
# define __bio_h__attr__(x)
#endif
int BIO_printf(BIO *bio, const char *format, ...)
- __bio_h__attr__((__format__(__printf__,2,3)));
+ __bio_h__attr__((__format__(__printf__,2,3)));
int BIO_vprintf(BIO *bio, const char *format, va_list args)
- __bio_h__attr__((__format__(__printf__,2,0)));
+ __bio_h__attr__((__format__(__printf__,2,0)));
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
- __bio_h__attr__((__format__(__printf__,3,4)));
+ __bio_h__attr__((__format__(__printf__,3,4)));
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
- __bio_h__attr__((__format__(__printf__,3,0)));
+ __bio_h__attr__((__format__(__printf__,3,0)));
#undef __bio_h__attr__
/* BEGIN ERROR CODES */
@@ -705,72 +706,71 @@ void ERR_load_BIO_strings(void);
/* Error codes for the BIO functions. */
/* Function codes. */
-#define BIO_F_ACPT_STATE 100
-#define BIO_F_BIO_ACCEPT 101
-#define BIO_F_BIO_BER_GET_HEADER 102
-#define BIO_F_BIO_CALLBACK_CTRL 131
-#define BIO_F_BIO_CTRL 103
-#define BIO_F_BIO_GETHOSTBYNAME 120
-#define BIO_F_BIO_GETS 104
-#define BIO_F_BIO_GET_ACCEPT_SOCKET 105
-#define BIO_F_BIO_GET_HOST_IP 106
-#define BIO_F_BIO_GET_PORT 107
-#define BIO_F_BIO_MAKE_PAIR 121
-#define BIO_F_BIO_NEW 108
-#define BIO_F_BIO_NEW_FILE 109
-#define BIO_F_BIO_NEW_MEM_BUF 126
-#define BIO_F_BIO_NREAD 123
-#define BIO_F_BIO_NREAD0 124
-#define BIO_F_BIO_NWRITE 125
-#define BIO_F_BIO_NWRITE0 122
-#define BIO_F_BIO_PUTS 110
-#define BIO_F_BIO_READ 111
-#define BIO_F_BIO_SOCK_INIT 112
-#define BIO_F_BIO_WRITE 113
-#define BIO_F_BUFFER_CTRL 114
-#define BIO_F_CONN_CTRL 127
-#define BIO_F_CONN_STATE 115
-#define BIO_F_FILE_CTRL 116
-#define BIO_F_FILE_READ 130
-#define BIO_F_LINEBUFFER_CTRL 129
-#define BIO_F_MEM_READ 128
-#define BIO_F_MEM_WRITE 117
-#define BIO_F_SSL_NEW 118
-#define BIO_F_WSASTARTUP 119
+#define BIO_F_ACPT_STATE 100
+#define BIO_F_BIO_ACCEPT 101
+#define BIO_F_BIO_BER_GET_HEADER 102
+#define BIO_F_BIO_CALLBACK_CTRL 131
+#define BIO_F_BIO_CTRL 103
+#define BIO_F_BIO_GETHOSTBYNAME 120
+#define BIO_F_BIO_GETS 104
+#define BIO_F_BIO_GET_ACCEPT_SOCKET 105
+#define BIO_F_BIO_GET_HOST_IP 106
+#define BIO_F_BIO_GET_PORT 107
+#define BIO_F_BIO_MAKE_PAIR 121
+#define BIO_F_BIO_NEW 108
+#define BIO_F_BIO_NEW_FILE 109
+#define BIO_F_BIO_NEW_MEM_BUF 126
+#define BIO_F_BIO_NREAD 123
+#define BIO_F_BIO_NREAD0 124
+#define BIO_F_BIO_NWRITE 125
+#define BIO_F_BIO_NWRITE0 122
+#define BIO_F_BIO_PUTS 110
+#define BIO_F_BIO_READ 111
+#define BIO_F_BIO_SOCK_INIT 112
+#define BIO_F_BIO_WRITE 113
+#define BIO_F_BUFFER_CTRL 114
+#define BIO_F_CONN_CTRL 127
+#define BIO_F_CONN_STATE 115
+#define BIO_F_FILE_CTRL 116
+#define BIO_F_FILE_READ 130
+#define BIO_F_LINEBUFFER_CTRL 129
+#define BIO_F_MEM_READ 128
+#define BIO_F_MEM_WRITE 117
+#define BIO_F_SSL_NEW 118
+#define BIO_F_WSASTARTUP 119
/* Reason codes. */
-#define BIO_R_ACCEPT_ERROR 100
-#define BIO_R_BAD_FOPEN_MODE 101
-#define BIO_R_BAD_HOSTNAME_LOOKUP 102
-#define BIO_R_BROKEN_PIPE 124
-#define BIO_R_CONNECT_ERROR 103
-#define BIO_R_EOF_ON_MEMORY_BIO 127
-#define BIO_R_ERROR_SETTING_NBIO 104
-#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
-#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
-#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
-#define BIO_R_INVALID_ARGUMENT 125
-#define BIO_R_INVALID_IP_ADDRESS 108
-#define BIO_R_IN_USE 123
-#define BIO_R_KEEPALIVE 109
-#define BIO_R_NBIO_CONNECT_ERROR 110
-#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
-#define BIO_R_NO_HOSTNAME_SPECIFIED 112
-#define BIO_R_NO_PORT_DEFINED 113
-#define BIO_R_NO_PORT_SPECIFIED 114
-#define BIO_R_NO_SUCH_FILE 128
-#define BIO_R_NULL_PARAMETER 115
-#define BIO_R_TAG_MISMATCH 116
-#define BIO_R_UNABLE_TO_BIND_SOCKET 117
-#define BIO_R_UNABLE_TO_CREATE_SOCKET 118
-#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
-#define BIO_R_UNINITIALIZED 120
-#define BIO_R_UNSUPPORTED_METHOD 121
-#define BIO_R_WRITE_TO_READ_ONLY_BIO 126
-#define BIO_R_WSASTARTUP 122
+#define BIO_R_ACCEPT_ERROR 100
+#define BIO_R_BAD_FOPEN_MODE 101
+#define BIO_R_BAD_HOSTNAME_LOOKUP 102
+#define BIO_R_BROKEN_PIPE 124
+#define BIO_R_CONNECT_ERROR 103
+#define BIO_R_EOF_ON_MEMORY_BIO 127
+#define BIO_R_ERROR_SETTING_NBIO 104
+#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
+#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
+#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
+#define BIO_R_INVALID_ARGUMENT 125
+#define BIO_R_INVALID_IP_ADDRESS 108
+#define BIO_R_IN_USE 123
+#define BIO_R_KEEPALIVE 109
+#define BIO_R_NBIO_CONNECT_ERROR 110
+#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
+#define BIO_R_NO_HOSTNAME_SPECIFIED 112
+#define BIO_R_NO_PORT_DEFINED 113
+#define BIO_R_NO_PORT_SPECIFIED 114
+#define BIO_R_NO_SUCH_FILE 128
+#define BIO_R_NULL_PARAMETER 115
+#define BIO_R_TAG_MISMATCH 116
+#define BIO_R_UNABLE_TO_BIND_SOCKET 117
+#define BIO_R_UNABLE_TO_CREATE_SOCKET 118
+#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
+#define BIO_R_UNINITIALIZED 120
+#define BIO_R_UNSUPPORTED_METHOD 121
+#define BIO_R_WRITE_TO_READ_ONLY_BIO 126
+#define BIO_R_WSASTARTUP 122
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/blowfish.h b/dep/include/openssl/blowfish.h
index f57474eb60b..d24ffccb65f 100644
--- a/dep/include/openssl/blowfish.h
+++ b/dep/include/openssl/blowfish.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -69,8 +69,8 @@ extern "C" {
#error BF is disabled.
#endif
-#define BF_ENCRYPT 1
-#define BF_DECRYPT 0
+#define BF_ENCRYPT 1
+#define BF_DECRYPT 0
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -89,35 +89,37 @@ extern "C" {
* does it have on performance on none-T3E machines. I could declare
* int, but at least on C90 sizeof(int) can be chosen at compile time.
* So I've chosen long...
- * <appro@fy.chalmers.se>
+ * <appro@fy.chalmers.se>
*/
#else
#define BF_LONG unsigned int
#endif
-#define BF_ROUNDS 16
-#define BF_BLOCK 8
+#define BF_ROUNDS 16
+#define BF_BLOCK 8
typedef struct bf_key_st
- {
- BF_LONG P[BF_ROUNDS+2];
- BF_LONG S[4*256];
- } BF_KEY;
-
+ {
+ BF_LONG P[BF_ROUNDS+2];
+ BF_LONG S[4*256];
+ } BF_KEY;
+#ifdef OPENSSL_FIPS
+void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+#endif
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
void BF_decrypt(BF_LONG *data,const BF_KEY *key);
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
- const BF_KEY *key, int enc);
+ const BF_KEY *key, int enc);
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
- const BF_KEY *schedule, unsigned char *ivec, int enc);
+ const BF_KEY *schedule, unsigned char *ivec, int enc);
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length,
- const BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
+ const BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length,
- const BF_KEY *schedule, unsigned char *ivec, int *num);
+ const BF_KEY *schedule, unsigned char *ivec, int *num);
const char *BF_options(void);
#ifdef __cplusplus
@@ -125,4 +127,3 @@ const char *BF_options(void);
#endif
#endif
-
diff --git a/dep/include/openssl/bn.h b/dep/include/openssl/bn.h
index 08962f7df00..f1719a5877f 100644
--- a/dep/include/openssl/bn.h
+++ b/dep/include/openssl/bn.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -58,13 +58,13 @@
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
- * Portions of the attached software ("Contribution") are developed by
+ * Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the Eric Young open source
* license provided above.
*
- * The binary polynomial arithmetic software is originally written by
+ * The binary polynomial arithmetic software is originally written by
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
*
*/
@@ -120,23 +120,23 @@ extern "C" {
* unsigned long long is only 64 bits :-(, don't define
* BN_LLONG for the DEC Alpha */
#ifdef SIXTY_FOUR_BIT_LONG
-#define BN_ULLONG unsigned long long
-#define BN_ULONG unsigned long
-#define BN_LONG long
-#define BN_BITS 128
-#define BN_BYTES 8
-#define BN_BITS2 64
-#define BN_BITS4 32
-#define BN_MASK (0xffffffffffffffffffffffffffffffffLL)
-#define BN_MASK2 (0xffffffffffffffffL)
-#define BN_MASK2l (0xffffffffL)
-#define BN_MASK2h (0xffffffff00000000L)
-#define BN_MASK2h1 (0xffffffff80000000L)
-#define BN_TBIT (0x8000000000000000L)
-#define BN_DEC_CONV (10000000000000000000UL)
-#define BN_DEC_FMT1 "%lu"
-#define BN_DEC_FMT2 "%019lu"
-#define BN_DEC_NUM 19
+#define BN_ULLONG unsigned long long
+#define BN_ULONG unsigned long
+#define BN_LONG long
+#define BN_BITS 128
+#define BN_BYTES 8
+#define BN_BITS2 64
+#define BN_BITS4 32
+#define BN_MASK (0xffffffffffffffffffffffffffffffffLL)
+#define BN_MASK2 (0xffffffffffffffffL)
+#define BN_MASK2l (0xffffffffL)
+#define BN_MASK2h (0xffffffff00000000L)
+#define BN_MASK2h1 (0xffffffff80000000L)
+#define BN_TBIT (0x8000000000000000L)
+#define BN_DEC_CONV (10000000000000000000UL)
+#define BN_DEC_FMT1 "%lu"
+#define BN_DEC_FMT2 "%019lu"
+#define BN_DEC_NUM 19
#endif
/* This is where the long long data type is 64 bits, but long is 32.
@@ -147,111 +147,121 @@ extern "C" {
#ifdef SIXTY_FOUR_BIT
#undef BN_LLONG
#undef BN_ULLONG
-#define BN_ULONG unsigned long long
-#define BN_LONG long long
-#define BN_BITS 128
-#define BN_BYTES 8
-#define BN_BITS2 64
-#define BN_BITS4 32
-#define BN_MASK2 (0xffffffffffffffffLL)
-#define BN_MASK2l (0xffffffffL)
-#define BN_MASK2h (0xffffffff00000000LL)
-#define BN_MASK2h1 (0xffffffff80000000LL)
-#define BN_TBIT (0x8000000000000000LL)
-#define BN_DEC_CONV (10000000000000000000ULL)
-#define BN_DEC_FMT1 "%llu"
-#define BN_DEC_FMT2 "%019llu"
-#define BN_DEC_NUM 19
+#define BN_ULONG unsigned long long
+#define BN_LONG long long
+#define BN_BITS 128
+#define BN_BYTES 8
+#define BN_BITS2 64
+#define BN_BITS4 32
+#define BN_MASK2 (0xffffffffffffffffLL)
+#define BN_MASK2l (0xffffffffL)
+#define BN_MASK2h (0xffffffff00000000LL)
+#define BN_MASK2h1 (0xffffffff80000000LL)
+#define BN_TBIT (0x8000000000000000LL)
+#define BN_DEC_CONV (10000000000000000000ULL)
+#define BN_DEC_FMT1 "%llu"
+#define BN_DEC_FMT2 "%019llu"
+#define BN_DEC_NUM 19
#endif
#ifdef THIRTY_TWO_BIT
#ifdef BN_LLONG
# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__)
-# define BN_ULLONG unsigned __int64
+# define BN_ULLONG unsigned __int64
# else
-# define BN_ULLONG unsigned long long
+# define BN_ULLONG unsigned long long
# endif
#endif
-#define BN_ULONG unsigned long
-#define BN_LONG long
-#define BN_BITS 64
-#define BN_BYTES 4
-#define BN_BITS2 32
-#define BN_BITS4 16
+#define BN_ULONG unsigned long
+#define BN_LONG long
+#define BN_BITS 64
+#define BN_BYTES 4
+#define BN_BITS2 32
+#define BN_BITS4 16
#ifdef OPENSSL_SYS_WIN32
/* VC++ doesn't like the LL suffix */
-#define BN_MASK (0xffffffffffffffffL)
+#define BN_MASK (0xffffffffffffffffL)
#else
-#define BN_MASK (0xffffffffffffffffLL)
+#define BN_MASK (0xffffffffffffffffLL)
#endif
-#define BN_MASK2 (0xffffffffL)
-#define BN_MASK2l (0xffff)
-#define BN_MASK2h1 (0xffff8000L)
-#define BN_MASK2h (0xffff0000L)
-#define BN_TBIT (0x80000000L)
-#define BN_DEC_CONV (1000000000L)
-#define BN_DEC_FMT1 "%lu"
-#define BN_DEC_FMT2 "%09lu"
-#define BN_DEC_NUM 9
+#define BN_MASK2 (0xffffffffL)
+#define BN_MASK2l (0xffff)
+#define BN_MASK2h1 (0xffff8000L)
+#define BN_MASK2h (0xffff0000L)
+#define BN_TBIT (0x80000000L)
+#define BN_DEC_CONV (1000000000L)
+#define BN_DEC_FMT1 "%lu"
+#define BN_DEC_FMT2 "%09lu"
+#define BN_DEC_NUM 9
#endif
#ifdef SIXTEEN_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
-#define BN_ULLONG unsigned long
-#define BN_ULONG unsigned short
-#define BN_LONG short
-#define BN_BITS 32
-#define BN_BYTES 2
-#define BN_BITS2 16
-#define BN_BITS4 8
-#define BN_MASK (0xffffffff)
-#define BN_MASK2 (0xffff)
-#define BN_MASK2l (0xff)
-#define BN_MASK2h1 (0xff80)
-#define BN_MASK2h (0xff00)
-#define BN_TBIT (0x8000)
-#define BN_DEC_CONV (100000)
-#define BN_DEC_FMT1 "%u"
-#define BN_DEC_FMT2 "%05u"
-#define BN_DEC_NUM 5
+#define BN_ULLONG unsigned long
+#define BN_ULONG unsigned short
+#define BN_LONG short
+#define BN_BITS 32
+#define BN_BYTES 2
+#define BN_BITS2 16
+#define BN_BITS4 8
+#define BN_MASK (0xffffffff)
+#define BN_MASK2 (0xffff)
+#define BN_MASK2l (0xff)
+#define BN_MASK2h1 (0xff80)
+#define BN_MASK2h (0xff00)
+#define BN_TBIT (0x8000)
+#define BN_DEC_CONV (100000)
+#define BN_DEC_FMT1 "%u"
+#define BN_DEC_FMT2 "%05u"
+#define BN_DEC_NUM 5
#endif
#ifdef EIGHT_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
-#define BN_ULLONG unsigned short
-#define BN_ULONG unsigned char
-#define BN_LONG char
-#define BN_BITS 16
-#define BN_BYTES 1
-#define BN_BITS2 8
-#define BN_BITS4 4
-#define BN_MASK (0xffff)
-#define BN_MASK2 (0xff)
-#define BN_MASK2l (0xf)
-#define BN_MASK2h1 (0xf8)
-#define BN_MASK2h (0xf0)
-#define BN_TBIT (0x80)
-#define BN_DEC_CONV (100)
-#define BN_DEC_FMT1 "%u"
-#define BN_DEC_FMT2 "%02u"
-#define BN_DEC_NUM 2
+#define BN_ULLONG unsigned short
+#define BN_ULONG unsigned char
+#define BN_LONG char
+#define BN_BITS 16
+#define BN_BYTES 1
+#define BN_BITS2 8
+#define BN_BITS4 4
+#define BN_MASK (0xffff)
+#define BN_MASK2 (0xff)
+#define BN_MASK2l (0xf)
+#define BN_MASK2h1 (0xf8)
+#define BN_MASK2h (0xf0)
+#define BN_TBIT (0x80)
+#define BN_DEC_CONV (100)
+#define BN_DEC_FMT1 "%u"
+#define BN_DEC_FMT2 "%02u"
+#define BN_DEC_NUM 2
#endif
-#define BN_DEFAULT_BITS 1280
+#define BN_DEFAULT_BITS 1280
+
+#define BN_FLG_MALLOCED 0x01
+#define BN_FLG_STATIC_DATA 0x02
+#define BN_FLG_CONSTTIME 0x04 /* avoid leaking exponent information through timing,
+ * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
+ * BN_div() will call BN_div_no_branch,
+ * BN_mod_inverse() will call BN_mod_inverse_no_branch.
+ */
-#define BN_FLG_MALLOCED 0x01
-#define BN_FLG_STATIC_DATA 0x02
-#define BN_FLG_EXP_CONSTTIME 0x04 /* avoid leaking exponent information through timings
+#ifndef OPENSSL_NO_DEPRECATED
+#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */
+ /* avoid leaking exponent information through timings
* (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
+#endif
+
#ifndef OPENSSL_NO_DEPRECATED
-#define BN_FLG_FREE 0x8000 /* used for debuging */
+#define BN_FLG_FREE 0x8000 /* used for debuging */
#endif
-#define BN_set_flags(b,n) ((b)->flags|=(n))
-#define BN_get_flags(b,n) ((b)->flags&(n))
+#define BN_set_flags(b,n) ((b)->flags|=(n))
+#define BN_get_flags(b,n) ((b)->flags&(n))
/* get a clone of a BIGNUM with changed flags, for *temporary* use only
* (the two BIGNUMs cannot not be used in parallel!) */
@@ -276,69 +286,74 @@ typedef struct bn_gencb_st BN_GENCB;
#endif
struct bignum_st
- {
- BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
- int top; /* Index of last used d +1. */
- /* The next are internal book keeping for bn_expand. */
- int dmax; /* Size of the d array. */
- int neg; /* one if the number is negative */
- int flags;
- };
+ {
+ BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
+ int top; /* Index of last used d +1. */
+ /* The next are internal book keeping for bn_expand. */
+ int dmax; /* Size of the d array. */
+ int neg; /* one if the number is negative */
+ int flags;
+ };
/* Used for montgomery multiplication */
struct bn_mont_ctx_st
- {
- int ri; /* number of bits in R */
- BIGNUM RR; /* used to convert to montgomery form */
- BIGNUM N; /* The modulus */
- BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
- * (Ni is only stored for bignum algorithm) */
- BN_ULONG n0; /* least significant word of Ni */
- int flags;
- };
+ {
+ int ri; /* number of bits in R */
+ BIGNUM RR; /* used to convert to montgomery form */
+ BIGNUM N; /* The modulus */
+ BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
+ * (Ni is only stored for bignum algorithm) */
+#if 0
+ /* OpenSSL 0.9.9 preview: */
+ BN_ULONG n0[2];/* least significant word(s) of Ni */
+#else
+ BN_ULONG n0; /* least significant word of Ni */
+#endif
+ int flags;
+ };
/* Used for reciprocal division/mod functions
* It cannot be shared between threads
*/
struct bn_recp_ctx_st
- {
- BIGNUM N; /* the divisor */
- BIGNUM Nr; /* the reciprocal */
- int num_bits;
- int shift;
- int flags;
- };
+ {
+ BIGNUM N; /* the divisor */
+ BIGNUM Nr; /* the reciprocal */
+ int num_bits;
+ int shift;
+ int flags;
+ };
/* Used for slow "generation" functions. */
struct bn_gencb_st
- {
- unsigned int ver; /* To handle binary (in)compatibility */
- void *arg; /* callback-specific data */
- union
- {
- /* if(ver==1) - handles old style callbacks */
- void (*cb_1)(int, int, void *);
- /* if(ver==2) - new callback style */
- int (*cb_2)(int, int, BN_GENCB *);
- } cb;
- };
+ {
+ unsigned int ver; /* To handle binary (in)compatibility */
+ void *arg; /* callback-specific data */
+ union
+ {
+ /* if(ver==1) - handles old style callbacks */
+ void (*cb_1)(int, int, void *);
+ /* if(ver==2) - new callback style */
+ int (*cb_2)(int, int, BN_GENCB *);
+ } cb;
+ };
/* Wrapper function to make using BN_GENCB easier, */
int BN_GENCB_call(BN_GENCB *cb, int a, int b);
/* Macro to populate a BN_GENCB structure with an "old"-style callback */
#define BN_GENCB_set_old(gencb, callback, cb_arg) { \
- BN_GENCB *tmp_gencb = (gencb); \
- tmp_gencb->ver = 1; \
- tmp_gencb->arg = (cb_arg); \
- tmp_gencb->cb.cb_1 = (callback); }
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 1; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_1 = (callback); }
/* Macro to populate a BN_GENCB structure with a "new"-style callback */
#define BN_GENCB_set(gencb, callback, cb_arg) { \
- BN_GENCB *tmp_gencb = (gencb); \
- tmp_gencb->ver = 2; \
- tmp_gencb->arg = (cb_arg); \
- tmp_gencb->cb.cb_2 = (callback); }
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 2; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_2 = (callback); }
#define BN_prime_checks 0 /* default: select number of iterations
- based on the size of the number */
+ based on the size of the number */
/* number of Miller-Rabin iterations for an error rate of less than 2^-80
* for random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook
@@ -358,183 +373,194 @@ int BN_GENCB_call(BN_GENCB *cb, int a, int b);
(b) >= 150 ? 18 : \
/* b >= 100 */ 27)
-#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
+#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */
#define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \
- (((w) == 0) && ((a)->top == 0)))
+ (((w) == 0) && ((a)->top == 0)))
#define BN_is_zero(a) ((a)->top == 0)
#define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg)
#define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg))
-#define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1))
+#define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1))
-#define BN_one(a) (BN_set_word((a),1))
+#define BN_one(a) (BN_set_word((a),1))
#define BN_zero_ex(a) \
- do { \
- BIGNUM *_tmp_bn = (a); \
- _tmp_bn->top = 0; \
- _tmp_bn->neg = 0; \
- } while(0)
+ do { \
+ BIGNUM *_tmp_bn = (a); \
+ _tmp_bn->top = 0; \
+ _tmp_bn->neg = 0; \
+ } while(0)
#ifdef OPENSSL_NO_DEPRECATED
-#define BN_zero(a) BN_zero_ex(a)
+#define BN_zero(a) BN_zero_ex(a)
#else
-#define BN_zero(a) (BN_set_word((a),0))
+#define BN_zero(a) (BN_set_word((a),0))
#endif
const BIGNUM *BN_value_one(void);
-char * BN_options(void);
+char * BN_options(void);
BN_CTX *BN_CTX_new(void);
#ifndef OPENSSL_NO_DEPRECATED
-void BN_CTX_init(BN_CTX *c);
+void BN_CTX_init(BN_CTX *c);
#endif
-void BN_CTX_free(BN_CTX *c);
-void BN_CTX_start(BN_CTX *ctx);
+void BN_CTX_free(BN_CTX *c);
+void BN_CTX_start(BN_CTX *ctx);
BIGNUM *BN_CTX_get(BN_CTX *ctx);
-void BN_CTX_end(BN_CTX *ctx);
+void BN_CTX_end(BN_CTX *ctx);
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
-int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
-int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
-int BN_num_bits(const BIGNUM *a);
-int BN_num_bits_word(BN_ULONG);
+int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_num_bits(const BIGNUM *a);
+int BN_num_bits_word(BN_ULONG);
BIGNUM *BN_new(void);
-void BN_init(BIGNUM *);
-void BN_clear_free(BIGNUM *a);
+void BN_init(BIGNUM *);
+void BN_clear_free(BIGNUM *a);
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
-void BN_swap(BIGNUM *a, BIGNUM *b);
+void BN_swap(BIGNUM *a, BIGNUM *b);
BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret);
-int BN_bn2bin(const BIGNUM *a, unsigned char *to);
+int BN_bn2bin(const BIGNUM *a, unsigned char *to);
BIGNUM *BN_mpi2bn(const unsigned char *s,int len,BIGNUM *ret);
-int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
-int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
-int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
-int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
-int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
-int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
-int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx);
+int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
+int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx);
/** BN_set_negative sets sign of a BIGNUM
* \param b pointer to the BIGNUM object
- * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
+ * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
*/
-void BN_set_negative(BIGNUM *b, int n);
+void BN_set_negative(BIGNUM *b, int n);
/** BN_is_negative returns 1 if the BIGNUM is negative
* \param a pointer to the BIGNUM object
* \return 1 if a < 0 and 0 otherwise
*/
#define BN_is_negative(a) ((a)->neg != 0)
-int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
- BN_CTX *ctx);
+int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
+ BN_CTX *ctx);
#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
-int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
-int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
-int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
-int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
-int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
+int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
+int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
+int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
+int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
+int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
-int BN_mul_word(BIGNUM *a, BN_ULONG w);
-int BN_add_word(BIGNUM *a, BN_ULONG w);
-int BN_sub_word(BIGNUM *a, BN_ULONG w);
-int BN_set_word(BIGNUM *a, BN_ULONG w);
+int BN_mul_word(BIGNUM *a, BN_ULONG w);
+int BN_add_word(BIGNUM *a, BN_ULONG w);
+int BN_sub_word(BIGNUM *a, BN_ULONG w);
+int BN_set_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_get_word(const BIGNUM *a);
-int BN_cmp(const BIGNUM *a, const BIGNUM *b);
-void BN_free(BIGNUM *a);
-int BN_is_bit_set(const BIGNUM *a, int n);
-int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
-int BN_lshift1(BIGNUM *r, const BIGNUM *a);
-int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx);
-
-int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m,BN_CTX *ctx);
-int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_cmp(const BIGNUM *a, const BIGNUM *b);
+void BN_free(BIGNUM *a);
+int BN_is_bit_set(const BIGNUM *a, int n);
+int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_lshift1(BIGNUM *r, const BIGNUM *a);
+int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx);
+
+int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m,BN_CTX *ctx);
+int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
-int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
- const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m,
- BN_CTX *ctx,BN_MONT_CTX *m_ctx);
-int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m,BN_CTX *ctx);
-
-int BN_mask_bits(BIGNUM *a,int n);
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
+int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
+ const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m,
+ BN_CTX *ctx,BN_MONT_CTX *m_ctx);
+int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m,BN_CTX *ctx);
+
+int BN_mask_bits(BIGNUM *a,int n);
#ifndef OPENSSL_NO_FP_API
-int BN_print_fp(FILE *fp, const BIGNUM *a);
+int BN_print_fp(FILE *fp, const BIGNUM *a);
#endif
#ifdef HEADER_BIO_H
-int BN_print(BIO *fp, const BIGNUM *a);
+int BN_print(BIO *fp, const BIGNUM *a);
#else
-int BN_print(void *fp, const BIGNUM *a);
+int BN_print(void *fp, const BIGNUM *a);
#endif
-int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
-int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
-int BN_rshift1(BIGNUM *r, const BIGNUM *a);
-void BN_clear(BIGNUM *a);
+int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
+int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_rshift1(BIGNUM *r, const BIGNUM *a);
+void BN_clear(BIGNUM *a);
BIGNUM *BN_dup(const BIGNUM *a);
-int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
-int BN_set_bit(BIGNUM *a, int n);
-int BN_clear_bit(BIGNUM *a, int n);
-char * BN_bn2hex(const BIGNUM *a);
-char * BN_bn2dec(const BIGNUM *a);
-int BN_hex2bn(BIGNUM **a, const char *str);
-int BN_dec2bn(BIGNUM **a, const char *str);
-int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx);
-int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */
+int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
+int BN_set_bit(BIGNUM *a, int n);
+int BN_clear_bit(BIGNUM *a, int n);
+char * BN_bn2hex(const BIGNUM *a);
+char * BN_bn2dec(const BIGNUM *a);
+int BN_hex2bn(BIGNUM **a, const char *str);
+int BN_dec2bn(BIGNUM **a, const char *str);
+int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx);
+int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */
BIGNUM *BN_mod_inverse(BIGNUM *ret,
- const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
+ const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
- const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
+ const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
/* Deprecated versions */
#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
- const BIGNUM *add, const BIGNUM *rem,
- void (*callback)(int,int,void *),void *cb_arg);
-int BN_is_prime(const BIGNUM *p,int nchecks,
- void (*callback)(int,int,void *),
- BN_CTX *ctx,void *cb_arg);
-int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
- void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
- int do_trial_division);
+ const BIGNUM *add, const BIGNUM *rem,
+ void (*callback)(int,int,void *),void *cb_arg);
+int BN_is_prime(const BIGNUM *p,int nchecks,
+ void (*callback)(int,int,void *),
+ BN_CTX *ctx,void *cb_arg);
+int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
+ void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
+ int do_trial_division);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* Newer versions */
-int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add,
- const BIGNUM *rem, BN_GENCB *cb);
-int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
-int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
- int do_trial_division, BN_GENCB *cb);
+int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add,
+ const BIGNUM *rem, BN_GENCB *cb);
+int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
+int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
+ int do_trial_division, BN_GENCB *cb);
+
+int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
+
+int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
+ const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
+ const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
+int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
+ BIGNUM *Xp1, BIGNUM *Xp2,
+ const BIGNUM *Xp,
+ const BIGNUM *e, BN_CTX *ctx,
+ BN_GENCB *cb);
BN_MONT_CTX *BN_MONT_CTX_new(void );
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
- BN_MONT_CTX *mont, BN_CTX *ctx);
-#define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
- (r),(a),&((mont)->RR),(mont),(ctx))
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+#define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
+ (r),(a),&((mont)->RR),(mont),(ctx))
int BN_from_montgomery(BIGNUM *r,const BIGNUM *a,
- BN_MONT_CTX *mont, BN_CTX *ctx);
+ BN_MONT_CTX *mont, BN_CTX *ctx);
void BN_MONT_CTX_free(BN_MONT_CTX *mont);
int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx);
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from);
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
- const BIGNUM *mod, BN_CTX *ctx);
+ const BIGNUM *mod, BN_CTX *ctx);
/* BN_BLINDING flags */
-#define BN_BLINDING_NO_UPDATE 0x00000001
-#define BN_BLINDING_NO_RECREATE 0x00000002
+#define BN_BLINDING_NO_UPDATE 0x00000001
+#define BN_BLINDING_NO_RECREATE 0x00000002
-BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
+BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod);
void BN_BLINDING_free(BN_BLINDING *b);
int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
@@ -546,28 +572,28 @@ void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
- const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
- int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
- BN_MONT_CTX *m_ctx);
+ const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx,
+ int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
+ BN_MONT_CTX *m_ctx);
#ifndef OPENSSL_NO_DEPRECATED
void BN_set_params(int mul,int high,int low,int mont);
int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
#endif
-void BN_RECP_CTX_init(BN_RECP_CTX *recp);
+void BN_RECP_CTX_init(BN_RECP_CTX *recp);
BN_RECP_CTX *BN_RECP_CTX_new(void);
-void BN_RECP_CTX_free(BN_RECP_CTX *recp);
-int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx);
-int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
- BN_RECP_CTX *recp,BN_CTX *ctx);
-int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx);
-int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
- BN_RECP_CTX *recp, BN_CTX *ctx);
-
-/* Functions for arithmetic over binary polynomials represented by BIGNUMs.
+void BN_RECP_CTX_free(BN_RECP_CTX *recp);
+int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx);
+int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
+ BN_RECP_CTX *recp,BN_CTX *ctx);
+int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
+ BN_RECP_CTX *recp, BN_CTX *ctx);
+
+/* Functions for arithmetic over binary polynomials represented by BIGNUMs.
*
* The BIGNUM::neg property of BIGNUMs representing binary polynomials is
* ignored.
@@ -576,49 +602,49 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
* be expanded to the appropriate size if needed.
*/
-int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/
+int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/
#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)
-int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/
-int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */
-int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- BN_CTX *ctx); /* r = (a * a) mod p */
-int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p,
- BN_CTX *ctx); /* r = (1 / b) mod p */
-int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */
-int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */
-int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- BN_CTX *ctx); /* r = sqrt(a) mod p */
-int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- BN_CTX *ctx); /* r^2 + r = a mod p */
+int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/
+int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */
+int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx); /* r = (a * a) mod p */
+int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p,
+ BN_CTX *ctx); /* r = (1 / b) mod p */
+int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */
+int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */
+int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx); /* r = sqrt(a) mod p */
+int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx); /* r^2 + r = a mod p */
#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
/* Some functions allow for representation of the irreducible polynomials
* as an unsigned int[], say p. The irreducible f(t) is then of the form:
* t^p[0] + t^p[1] + ... + t^p[k]
* where m = p[0] > p[1] > ... > p[k] = 0.
*/
-int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[]);
- /* r = a mod p */
-int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const unsigned int p[], BN_CTX *ctx); /* r = (a * b) mod p */
-int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[],
- BN_CTX *ctx); /* r = (a * a) mod p */
-int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const unsigned int p[],
- BN_CTX *ctx); /* r = (1 / b) mod p */
-int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const unsigned int p[], BN_CTX *ctx); /* r = (a / b) mod p */
-int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
- const unsigned int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */
-int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
- const unsigned int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */
-int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
- const unsigned int p[], BN_CTX *ctx); /* r^2 + r = a mod p */
-int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max);
-int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a);
-
-/* faster mod functions for the 'NIST primes'
+int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[]);
+ /* r = a mod p */
+int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const unsigned int p[], BN_CTX *ctx); /* r = (a * b) mod p */
+int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[],
+ BN_CTX *ctx); /* r = (a * a) mod p */
+int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const unsigned int p[],
+ BN_CTX *ctx); /* r = (1 / b) mod p */
+int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const unsigned int p[], BN_CTX *ctx); /* r = (a / b) mod p */
+int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const unsigned int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */
+int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
+ const unsigned int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */
+int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
+ const unsigned int p[], BN_CTX *ctx); /* r^2 + r = a mod p */
+int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max);
+int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a);
+
+/* faster mod functions for the 'NIST primes'
* 0 <= a < p^2 */
int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
@@ -635,7 +661,7 @@ const BIGNUM *BN_get0_nist_prime_521(void);
/* library internal functions */
#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\
- (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2))
+ (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2))
#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
BIGNUM *bn_expand2(BIGNUM *a, int words);
#ifndef OPENSSL_NO_DEPRECATED
@@ -682,20 +708,20 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
#define BN_DEBUG_TRIX
#endif
#define bn_pollute(a) \
- do { \
- const BIGNUM *_bnum1 = (a); \
- if(_bnum1->top < _bnum1->dmax) { \
- unsigned char _tmp_char; \
- /* We cast away const without the compiler knowing, any \
- * *genuinely* constant variables that aren't mutable \
- * wouldn't be constructed with top!=dmax. */ \
- BN_ULONG *_not_const; \
- memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
- RAND_pseudo_bytes(&_tmp_char, 1); \
- memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
- (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
- } \
- } while(0)
+ do { \
+ const BIGNUM *_bnum1 = (a); \
+ if(_bnum1->top < _bnum1->dmax) { \
+ unsigned char _tmp_char; \
+ /* We cast away const without the compiler knowing, any \
+ * *genuinely* constant variables that aren't mutable \
+ * wouldn't be constructed with top!=dmax. */ \
+ BN_ULONG *_not_const; \
+ memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
+ RAND_pseudo_bytes(&_tmp_char, 1); \
+ memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
+ (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
+ } \
+ } while(0)
#ifdef BN_DEBUG_TRIX
#undef RAND_pseudo_bytes
#endif
@@ -703,35 +729,35 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
#define bn_pollute(a)
#endif
#define bn_check_top(a) \
- do { \
- const BIGNUM *_bnum2 = (a); \
- if (_bnum2 != NULL) { \
- assert((_bnum2->top == 0) || \
- (_bnum2->d[_bnum2->top - 1] != 0)); \
- bn_pollute(_bnum2); \
- } \
- } while(0)
+ do { \
+ const BIGNUM *_bnum2 = (a); \
+ if (_bnum2 != NULL) { \
+ assert((_bnum2->top == 0) || \
+ (_bnum2->d[_bnum2->top - 1] != 0)); \
+ bn_pollute(_bnum2); \
+ } \
+ } while(0)
-#define bn_fix_top(a) bn_check_top(a)
+#define bn_fix_top(a) bn_check_top(a)
#else /* !BN_DEBUG */
#define bn_pollute(a)
#define bn_check_top(a)
-#define bn_fix_top(a) bn_correct_top(a)
+#define bn_fix_top(a) bn_correct_top(a)
#endif
#define bn_correct_top(a) \
{ \
BN_ULONG *ftl; \
- if ((a)->top > 0) \
- { \
- for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \
- if (*(ftl--)) break; \
- } \
- bn_pollute(a); \
- }
+ if ((a)->top > 0) \
+ { \
+ for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \
+ if (*(ftl--)) break; \
+ } \
+ bn_pollute(a); \
+ }
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
@@ -763,66 +789,67 @@ void ERR_load_BN_strings(void);
/* Error codes for the BN functions. */
/* Function codes. */
-#define BN_F_BNRAND 127
-#define BN_F_BN_BLINDING_CONVERT_EX 100
-#define BN_F_BN_BLINDING_CREATE_PARAM 128
-#define BN_F_BN_BLINDING_INVERT_EX 101
-#define BN_F_BN_BLINDING_NEW 102
-#define BN_F_BN_BLINDING_UPDATE 103
-#define BN_F_BN_BN2DEC 104
-#define BN_F_BN_BN2HEX 105
-#define BN_F_BN_CTX_GET 116
-#define BN_F_BN_CTX_NEW 106
-#define BN_F_BN_CTX_START 129
-#define BN_F_BN_DIV 107
-#define BN_F_BN_DIV_RECP 130
-#define BN_F_BN_EXP 123
-#define BN_F_BN_EXPAND2 108
-#define BN_F_BN_EXPAND_INTERNAL 120
-#define BN_F_BN_GF2M_MOD 131
-#define BN_F_BN_GF2M_MOD_EXP 132
-#define BN_F_BN_GF2M_MOD_MUL 133
-#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
-#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
-#define BN_F_BN_GF2M_MOD_SQR 136
-#define BN_F_BN_GF2M_MOD_SQRT 137
-#define BN_F_BN_MOD_EXP2_MONT 118
-#define BN_F_BN_MOD_EXP_MONT 109
-#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
-#define BN_F_BN_MOD_EXP_MONT_WORD 117
-#define BN_F_BN_MOD_EXP_RECP 125
-#define BN_F_BN_MOD_EXP_SIMPLE 126
-#define BN_F_BN_MOD_INVERSE 110
-#define BN_F_BN_MOD_LSHIFT_QUICK 119
-#define BN_F_BN_MOD_MUL_RECIPROCAL 111
-#define BN_F_BN_MOD_SQRT 121
-#define BN_F_BN_MPI2BN 112
-#define BN_F_BN_NEW 113
-#define BN_F_BN_RAND 114
-#define BN_F_BN_RAND_RANGE 122
-#define BN_F_BN_USUB 115
+#define BN_F_BNRAND 127
+#define BN_F_BN_BLINDING_CONVERT_EX 100
+#define BN_F_BN_BLINDING_CREATE_PARAM 128
+#define BN_F_BN_BLINDING_INVERT_EX 101
+#define BN_F_BN_BLINDING_NEW 102
+#define BN_F_BN_BLINDING_UPDATE 103
+#define BN_F_BN_BN2DEC 104
+#define BN_F_BN_BN2HEX 105
+#define BN_F_BN_CTX_GET 116
+#define BN_F_BN_CTX_NEW 106
+#define BN_F_BN_CTX_START 129
+#define BN_F_BN_DIV 107
+#define BN_F_BN_DIV_NO_BRANCH 138
+#define BN_F_BN_DIV_RECP 130
+#define BN_F_BN_EXP 123
+#define BN_F_BN_EXPAND2 108
+#define BN_F_BN_EXPAND_INTERNAL 120
+#define BN_F_BN_GF2M_MOD 131
+#define BN_F_BN_GF2M_MOD_EXP 132
+#define BN_F_BN_GF2M_MOD_MUL 133
+#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
+#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
+#define BN_F_BN_GF2M_MOD_SQR 136
+#define BN_F_BN_GF2M_MOD_SQRT 137
+#define BN_F_BN_MOD_EXP2_MONT 118
+#define BN_F_BN_MOD_EXP_MONT 109
+#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
+#define BN_F_BN_MOD_EXP_MONT_WORD 117
+#define BN_F_BN_MOD_EXP_RECP 125
+#define BN_F_BN_MOD_EXP_SIMPLE 126
+#define BN_F_BN_MOD_INVERSE 110
+#define BN_F_BN_MOD_INVERSE_NO_BRANCH 139
+#define BN_F_BN_MOD_LSHIFT_QUICK 119
+#define BN_F_BN_MOD_MUL_RECIPROCAL 111
+#define BN_F_BN_MOD_SQRT 121
+#define BN_F_BN_MPI2BN 112
+#define BN_F_BN_NEW 113
+#define BN_F_BN_RAND 114
+#define BN_F_BN_RAND_RANGE 122
+#define BN_F_BN_USUB 115
/* Reason codes. */
-#define BN_R_ARG2_LT_ARG3 100
-#define BN_R_BAD_RECIPROCAL 101
-#define BN_R_BIGNUM_TOO_LONG 114
-#define BN_R_CALLED_WITH_EVEN_MODULUS 102
-#define BN_R_DIV_BY_ZERO 103
-#define BN_R_ENCODING_ERROR 104
-#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
-#define BN_R_INPUT_NOT_REDUCED 110
-#define BN_R_INVALID_LENGTH 106
-#define BN_R_INVALID_RANGE 115
-#define BN_R_NOT_A_SQUARE 111
-#define BN_R_NOT_INITIALIZED 107
-#define BN_R_NO_INVERSE 108
-#define BN_R_NO_SOLUTION 116
-#define BN_R_P_IS_NOT_PRIME 112
-#define BN_R_TOO_MANY_ITERATIONS 113
-#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
+#define BN_R_ARG2_LT_ARG3 100
+#define BN_R_BAD_RECIPROCAL 101
+#define BN_R_BIGNUM_TOO_LONG 114
+#define BN_R_CALLED_WITH_EVEN_MODULUS 102
+#define BN_R_DIV_BY_ZERO 103
+#define BN_R_ENCODING_ERROR 104
+#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
+#define BN_R_INPUT_NOT_REDUCED 110
+#define BN_R_INVALID_LENGTH 106
+#define BN_R_INVALID_RANGE 115
+#define BN_R_NOT_A_SQUARE 111
+#define BN_R_NOT_INITIALIZED 107
+#define BN_R_NO_INVERSE 108
+#define BN_R_NO_SOLUTION 116
+#define BN_R_P_IS_NOT_PRIME 112
+#define BN_R_TOO_MANY_ITERATIONS 113
+#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/cast.h b/dep/include/openssl/cast.h
index ba2bc25047c..1faf5806aac 100644
--- a/dep/include/openssl/cast.h
+++ b/dep/include/openssl/cast.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -69,38 +69,39 @@ extern "C" {
#error CAST is disabled.
#endif
-#define CAST_ENCRYPT 1
-#define CAST_DECRYPT 0
+#define CAST_ENCRYPT 1
+#define CAST_DECRYPT 0
#define CAST_LONG unsigned long
-#define CAST_BLOCK 8
-#define CAST_KEY_LENGTH 16
+#define CAST_BLOCK 8
+#define CAST_KEY_LENGTH 16
typedef struct cast_key_st
- {
- CAST_LONG data[32];
- int short_key; /* Use reduced rounds for short key */
- } CAST_KEY;
-
+ {
+ CAST_LONG data[32];
+ int short_key; /* Use reduced rounds for short key */
+ } CAST_KEY;
+#ifdef OPENSSL_FIPS
+void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+#endif
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key,
- int enc);
+ int enc);
void CAST_encrypt(CAST_LONG *data,CAST_KEY *key);
void CAST_decrypt(CAST_LONG *data,CAST_KEY *key);
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
- CAST_KEY *ks, unsigned char *iv, int enc);
+ CAST_KEY *ks, unsigned char *iv, int enc);
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, CAST_KEY *schedule, unsigned char *ivec,
- int *num, int enc);
-void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, CAST_KEY *schedule, unsigned char *ivec,
- int *num);
+ long length, CAST_KEY *schedule, unsigned char *ivec,
+ int *num, int enc);
+void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, CAST_KEY *schedule, unsigned char *ivec,
+ int *num);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/comp.h b/dep/include/openssl/comp.h
index e99c87b238b..4b405c7d49e 100644
--- a/dep/include/openssl/comp.h
+++ b/dep/include/openssl/comp.h
@@ -11,42 +11,49 @@ extern "C" {
typedef struct comp_ctx_st COMP_CTX;
typedef struct comp_method_st
- {
- int type; /* NID for compression library */
- const char *name; /* A text string to identify the library */
- int (*init)(COMP_CTX *ctx);
- void (*finish)(COMP_CTX *ctx);
- int (*compress)(COMP_CTX *ctx,
- unsigned char *out, unsigned int olen,
- unsigned char *in, unsigned int ilen);
- int (*expand)(COMP_CTX *ctx,
- unsigned char *out, unsigned int olen,
- unsigned char *in, unsigned int ilen);
- /* The following two do NOTHING, but are kept for backward compatibility */
- long (*ctrl)(void);
- long (*callback_ctrl)(void);
- } COMP_METHOD;
+ {
+ int type; /* NID for compression library */
+ const char *name; /* A text string to identify the library */
+ int (*init)(COMP_CTX *ctx);
+ void (*finish)(COMP_CTX *ctx);
+ int (*compress)(COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ int (*expand)(COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ /* The following two do NOTHING, but are kept for backward compatibility */
+ long (*ctrl)(void);
+ long (*callback_ctrl)(void);
+ } COMP_METHOD;
struct comp_ctx_st
- {
- COMP_METHOD *meth;
- unsigned long compress_in;
- unsigned long compress_out;
- unsigned long expand_in;
- unsigned long expand_out;
+ {
+ COMP_METHOD *meth;
+ unsigned long compress_in;
+ unsigned long compress_out;
+ unsigned long expand_in;
+ unsigned long expand_out;
- CRYPTO_EX_DATA ex_data;
- };
+ CRYPTO_EX_DATA ex_data;
+ };
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
void COMP_CTX_free(COMP_CTX *ctx);
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
- unsigned char *in, int ilen);
+ unsigned char *in, int ilen);
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
- unsigned char *in, int ilen);
+ unsigned char *in, int ilen);
COMP_METHOD *COMP_rle(void );
COMP_METHOD *COMP_zlib(void );
+void COMP_zlib_cleanup(void);
+
+#ifdef HEADER_BIO_H
+#ifdef ZLIB
+BIO_METHOD *BIO_f_zlib(void);
+#endif
+#endif
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -57,11 +64,17 @@ void ERR_load_COMP_strings(void);
/* Error codes for the COMP functions. */
/* Function codes. */
+#define COMP_F_BIO_ZLIB_FLUSH 99
+#define COMP_F_BIO_ZLIB_NEW 100
+#define COMP_F_BIO_ZLIB_READ 101
+#define COMP_F_BIO_ZLIB_WRITE 102
/* Reason codes. */
+#define COMP_R_ZLIB_DEFLATE_ERROR 99
+#define COMP_R_ZLIB_INFLATE_ERROR 100
+#define COMP_R_ZLIB_NOT_SUPPORTED 101
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/conf.h b/dep/include/openssl/conf.h
index ac59b96f93d..8aa06bc5ecb 100644
--- a/dep/include/openssl/conf.h
+++ b/dep/include/openssl/conf.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -72,11 +72,11 @@ extern "C" {
#endif
typedef struct
- {
- char *section;
- char *name;
- char *value;
- } CONF_VALUE;
+ {
+ char *section;
+ char *name;
+ char *value;
+ } CONF_VALUE;
DECLARE_STACK_OF(CONF_VALUE)
DECLARE_STACK_OF(CONF_MODULE)
@@ -87,18 +87,18 @@ struct conf_method_st;
typedef struct conf_method_st CONF_METHOD;
struct conf_method_st
- {
- const char *name;
- CONF *(*create)(CONF_METHOD *meth);
- int (*init)(CONF *conf);
- int (*destroy)(CONF *conf);
- int (*destroy_data)(CONF *conf);
- int (*load_bio)(CONF *conf, BIO *bp, long *eline);
- int (*dump)(const CONF *conf, BIO *bp);
- int (*is_number)(const CONF *conf, char c);
- int (*to_int)(const CONF *conf, char c);
- int (*load)(CONF *conf, const char *name, long *eline);
- };
+ {
+ const char *name;
+ CONF *(*create)(CONF_METHOD *meth);
+ int (*init)(CONF *conf);
+ int (*destroy)(CONF *conf);
+ int (*destroy_data)(CONF *conf);
+ int (*load_bio)(CONF *conf, BIO *bp, long *eline);
+ int (*dump)(const CONF *conf, BIO *bp);
+ int (*is_number)(const CONF *conf, char c);
+ int (*to_int)(const CONF *conf, char c);
+ int (*load)(CONF *conf, const char *name, long *eline);
+ };
/* Module definitions */
@@ -109,11 +109,12 @@ typedef struct conf_module_st CONF_MODULE;
typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf);
typedef void conf_finish_func(CONF_IMODULE *md);
-#define CONF_MFLAGS_IGNORE_ERRORS 0x1
-#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
-#define CONF_MFLAGS_SILENT 0x4
-#define CONF_MFLAGS_NO_DSO 0x8
-#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
+#define CONF_MFLAGS_IGNORE_ERRORS 0x1
+#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
+#define CONF_MFLAGS_SILENT 0x4
+#define CONF_MFLAGS_NO_DSO 0x8
+#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
+#define CONF_MFLAGS_DEFAULT_SECTION 0x20
int CONF_set_default_method(CONF_METHOD *meth);
void CONF_set_nconf(CONF *conf,LHASH *hash);
@@ -136,11 +137,11 @@ void OPENSSL_no_config(void);
If that wasn't the case, the above functions would have been replaced */
struct conf_st
- {
- CONF_METHOD *meth;
- void *meth_data;
- LHASH *data;
- };
+ {
+ CONF_METHOD *meth;
+ void *meth_data;
+ LHASH *data;
+ };
CONF *NCONF_new(CONF_METHOD *meth);
CONF_METHOD *NCONF_default(void);
@@ -159,28 +160,28 @@ int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section);
char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
- long *result);
+ long *result);
int NCONF_dump_fp(const CONF *conf, FILE *out);
int NCONF_dump_bio(const CONF *conf, BIO *out);
#if 0 /* The following function has no error checking,
- and should therefore be avoided */
+ and should therefore be avoided */
long NCONF_get_number(CONF *conf,char *group,char *name);
#else
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
#endif
-
+
/* Module functions */
int CONF_modules_load(const CONF *cnf, const char *appname,
- unsigned long flags);
+ unsigned long flags);
int CONF_modules_load_file(const char *filename, const char *appname,
- unsigned long flags);
+ unsigned long flags);
void CONF_modules_unload(int all);
void CONF_modules_finish(void);
void CONF_modules_free(void);
int CONF_module_add(const char *name, conf_init_func *ifunc,
- conf_finish_func *ffunc);
+ conf_finish_func *ffunc);
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
@@ -195,7 +196,7 @@ void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
char *CONF_get1_default_config_file(void);
int CONF_parse_list(const char *list, int sep, int nospc,
- int (*list_cb)(const char *elem, int len, void *usr), void *arg);
+ int (*list_cb)(const char *elem, int len, void *usr), void *arg);
void OPENSSL_load_builtin_modules(void);
@@ -208,47 +209,46 @@ void ERR_load_CONF_strings(void);
/* Error codes for the CONF functions. */
/* Function codes. */
-#define CONF_F_CONF_DUMP_FP 104
-#define CONF_F_CONF_LOAD 100
-#define CONF_F_CONF_LOAD_BIO 102
-#define CONF_F_CONF_LOAD_FP 103
-#define CONF_F_CONF_MODULES_LOAD 116
-#define CONF_F_DEF_LOAD 120
-#define CONF_F_DEF_LOAD_BIO 121
-#define CONF_F_MODULE_INIT 115
-#define CONF_F_MODULE_LOAD_DSO 117
-#define CONF_F_MODULE_RUN 118
-#define CONF_F_NCONF_DUMP_BIO 105
-#define CONF_F_NCONF_DUMP_FP 106
-#define CONF_F_NCONF_GET_NUMBER 107
-#define CONF_F_NCONF_GET_NUMBER_E 112
-#define CONF_F_NCONF_GET_SECTION 108
-#define CONF_F_NCONF_GET_STRING 109
-#define CONF_F_NCONF_LOAD 113
-#define CONF_F_NCONF_LOAD_BIO 110
-#define CONF_F_NCONF_LOAD_FP 114
-#define CONF_F_NCONF_NEW 111
-#define CONF_F_STR_COPY 101
+#define CONF_F_CONF_DUMP_FP 104
+#define CONF_F_CONF_LOAD 100
+#define CONF_F_CONF_LOAD_BIO 102
+#define CONF_F_CONF_LOAD_FP 103
+#define CONF_F_CONF_MODULES_LOAD 116
+#define CONF_F_DEF_LOAD 120
+#define CONF_F_DEF_LOAD_BIO 121
+#define CONF_F_MODULE_INIT 115
+#define CONF_F_MODULE_LOAD_DSO 117
+#define CONF_F_MODULE_RUN 118
+#define CONF_F_NCONF_DUMP_BIO 105
+#define CONF_F_NCONF_DUMP_FP 106
+#define CONF_F_NCONF_GET_NUMBER 107
+#define CONF_F_NCONF_GET_NUMBER_E 112
+#define CONF_F_NCONF_GET_SECTION 108
+#define CONF_F_NCONF_GET_STRING 109
+#define CONF_F_NCONF_LOAD 113
+#define CONF_F_NCONF_LOAD_BIO 110
+#define CONF_F_NCONF_LOAD_FP 114
+#define CONF_F_NCONF_NEW 111
+#define CONF_F_STR_COPY 101
/* Reason codes. */
-#define CONF_R_ERROR_LOADING_DSO 110
-#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
-#define CONF_R_MISSING_EQUAL_SIGN 101
-#define CONF_R_MISSING_FINISH_FUNCTION 111
-#define CONF_R_MISSING_INIT_FUNCTION 112
-#define CONF_R_MODULE_INITIALIZATION_ERROR 109
-#define CONF_R_NO_CLOSE_BRACE 102
-#define CONF_R_NO_CONF 105
-#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
-#define CONF_R_NO_SECTION 107
-#define CONF_R_NO_SUCH_FILE 114
-#define CONF_R_NO_VALUE 108
-#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
-#define CONF_R_UNKNOWN_MODULE_NAME 113
-#define CONF_R_VARIABLE_HAS_NO_VALUE 104
+#define CONF_R_ERROR_LOADING_DSO 110
+#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
+#define CONF_R_MISSING_EQUAL_SIGN 101
+#define CONF_R_MISSING_FINISH_FUNCTION 111
+#define CONF_R_MISSING_INIT_FUNCTION 112
+#define CONF_R_MODULE_INITIALIZATION_ERROR 109
+#define CONF_R_NO_CLOSE_BRACE 102
+#define CONF_R_NO_CONF 105
+#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
+#define CONF_R_NO_SECTION 107
+#define CONF_R_NO_SUCH_FILE 114
+#define CONF_R_NO_VALUE 108
+#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
+#define CONF_R_UNKNOWN_MODULE_NAME 113
+#define CONF_R_VARIABLE_HAS_NO_VALUE 104
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/crypto.h b/dep/include/openssl/crypto.h
index af624679b93..0e4fb0723ce 100644
--- a/dep/include/openssl/crypto.h
+++ b/dep/include/openssl/crypto.h
@@ -7,7 +7,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -58,21 +58,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -87,10 +87,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -102,7 +102,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -110,7 +110,7 @@
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECDH support in OpenSSL originally developed by
+ * ECDH support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
@@ -145,106 +145,112 @@ extern "C" {
/* Backward compatibility to SSLeay */
/* This is more to be used to check the correct DLL is being used
* in the MS world. */
-#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
-#define SSLEAY_VERSION 0
-/* #define SSLEAY_OPTIONS 1 no longer supported */
-#define SSLEAY_CFLAGS 2
-#define SSLEAY_BUILT_ON 3
-#define SSLEAY_PLATFORM 4
-#define SSLEAY_DIR 5
+#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
+#define SSLEAY_VERSION 0
+/* #define SSLEAY_OPTIONS 1 no longer supported */
+#define SSLEAY_CFLAGS 2
+#define SSLEAY_BUILT_ON 3
+#define SSLEAY_PLATFORM 4
+#define SSLEAY_DIR 5
/* Already declared in ossl_typ.h */
#if 0
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
/* Called when a new object is created */
typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp);
+ int idx, long argl, void *argp);
/* Called when an object is free()ed */
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp);
+ int idx, long argl, void *argp);
/* Called when we need to dup an object */
-typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
- int idx, long argl, void *argp);
+typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
+ int idx, long argl, void *argp);
#endif
/* A generic structure to pass assorted data in a expandable way */
typedef struct openssl_item_st
- {
- int code;
- void *value; /* Not used for flag attributes */
- size_t value_size; /* Max size of value for output, length for input */
- size_t *value_length; /* Returned length of value for output */
- } OPENSSL_ITEM;
+ {
+ int code;
+ void *value; /* Not used for flag attributes */
+ size_t value_size; /* Max size of value for output, length for input */
+ size_t *value_length; /* Returned length of value for output */
+ } OPENSSL_ITEM;
/* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock
* names in cryptlib.c
*/
-#define CRYPTO_LOCK_ERR 1
-#define CRYPTO_LOCK_EX_DATA 2
-#define CRYPTO_LOCK_X509 3
-#define CRYPTO_LOCK_X509_INFO 4
-#define CRYPTO_LOCK_X509_PKEY 5
-#define CRYPTO_LOCK_X509_CRL 6
-#define CRYPTO_LOCK_X509_REQ 7
-#define CRYPTO_LOCK_DSA 8
-#define CRYPTO_LOCK_RSA 9
-#define CRYPTO_LOCK_EVP_PKEY 10
-#define CRYPTO_LOCK_X509_STORE 11
-#define CRYPTO_LOCK_SSL_CTX 12
-#define CRYPTO_LOCK_SSL_CERT 13
-#define CRYPTO_LOCK_SSL_SESSION 14
-#define CRYPTO_LOCK_SSL_SESS_CERT 15
-#define CRYPTO_LOCK_SSL 16
-#define CRYPTO_LOCK_SSL_METHOD 17
-#define CRYPTO_LOCK_RAND 18
-#define CRYPTO_LOCK_RAND2 19
-#define CRYPTO_LOCK_MALLOC 20
-#define CRYPTO_LOCK_BIO 21
-#define CRYPTO_LOCK_GETHOSTBYNAME 22
-#define CRYPTO_LOCK_GETSERVBYNAME 23
-#define CRYPTO_LOCK_READDIR 24
-#define CRYPTO_LOCK_RSA_BLINDING 25
-#define CRYPTO_LOCK_DH 26
-#define CRYPTO_LOCK_MALLOC2 27
-#define CRYPTO_LOCK_DSO 28
-#define CRYPTO_LOCK_DYNLOCK 29
-#define CRYPTO_LOCK_ENGINE 30
-#define CRYPTO_LOCK_UI 31
+#define CRYPTO_LOCK_ERR 1
+#define CRYPTO_LOCK_EX_DATA 2
+#define CRYPTO_LOCK_X509 3
+#define CRYPTO_LOCK_X509_INFO 4
+#define CRYPTO_LOCK_X509_PKEY 5
+#define CRYPTO_LOCK_X509_CRL 6
+#define CRYPTO_LOCK_X509_REQ 7
+#define CRYPTO_LOCK_DSA 8
+#define CRYPTO_LOCK_RSA 9
+#define CRYPTO_LOCK_EVP_PKEY 10
+#define CRYPTO_LOCK_X509_STORE 11
+#define CRYPTO_LOCK_SSL_CTX 12
+#define CRYPTO_LOCK_SSL_CERT 13
+#define CRYPTO_LOCK_SSL_SESSION 14
+#define CRYPTO_LOCK_SSL_SESS_CERT 15
+#define CRYPTO_LOCK_SSL 16
+#define CRYPTO_LOCK_SSL_METHOD 17
+#define CRYPTO_LOCK_RAND 18
+#define CRYPTO_LOCK_RAND2 19
+#define CRYPTO_LOCK_MALLOC 20
+#define CRYPTO_LOCK_BIO 21
+#define CRYPTO_LOCK_GETHOSTBYNAME 22
+#define CRYPTO_LOCK_GETSERVBYNAME 23
+#define CRYPTO_LOCK_READDIR 24
+#define CRYPTO_LOCK_RSA_BLINDING 25
+#define CRYPTO_LOCK_DH 26
+#define CRYPTO_LOCK_MALLOC2 27
+#define CRYPTO_LOCK_DSO 28
+#define CRYPTO_LOCK_DYNLOCK 29
+#define CRYPTO_LOCK_ENGINE 30
+#define CRYPTO_LOCK_UI 31
#define CRYPTO_LOCK_ECDSA 32
-#define CRYPTO_LOCK_EC 33
-#define CRYPTO_LOCK_ECDH 34
-#define CRYPTO_LOCK_BN 35
-#define CRYPTO_LOCK_EC_PRE_COMP 36
-#define CRYPTO_LOCK_STORE 37
-#define CRYPTO_LOCK_COMP 38
-#define CRYPTO_NUM_LOCKS 39
-
-#define CRYPTO_LOCK 1
-#define CRYPTO_UNLOCK 2
-#define CRYPTO_READ 4
-#define CRYPTO_WRITE 8
+#define CRYPTO_LOCK_EC 33
+#define CRYPTO_LOCK_ECDH 34
+#define CRYPTO_LOCK_BN 35
+#define CRYPTO_LOCK_EC_PRE_COMP 36
+#define CRYPTO_LOCK_STORE 37
+#define CRYPTO_LOCK_COMP 38
+#ifndef OPENSSL_FIPS
+#define CRYPTO_NUM_LOCKS 39
+#else
+#define CRYPTO_LOCK_FIPS 39
+#define CRYPTO_LOCK_FIPS2 40
+#define CRYPTO_NUM_LOCKS 41
+#endif
+
+#define CRYPTO_LOCK 1
+#define CRYPTO_UNLOCK 2
+#define CRYPTO_READ 4
+#define CRYPTO_WRITE 8
#ifndef OPENSSL_NO_LOCKING
#ifndef CRYPTO_w_lock
-#define CRYPTO_w_lock(type) \
- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
-#define CRYPTO_w_unlock(type) \
- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
-#define CRYPTO_r_lock(type) \
- CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
-#define CRYPTO_r_unlock(type) \
- CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
-#define CRYPTO_add(addr,amount,type) \
- CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
+#define CRYPTO_w_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+#define CRYPTO_w_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+#define CRYPTO_r_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+#define CRYPTO_r_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+#define CRYPTO_add(addr,amount,type) \
+ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
#endif
#else
#define CRYPTO_w_lock(a)
#define CRYPTO_w_unlock(a)
#define CRYPTO_r_lock(a)
#define CRYPTO_r_unlock(a)
-#define CRYPTO_add(a,b,c) ((*(a))+=(b))
+#define CRYPTO_add(a,b,c) ((*(a))+=(b))
#endif
/* Some applications as well as some parts of OpenSSL need to allocate
@@ -252,27 +258,27 @@ typedef struct openssl_item_st
makes this possible in a type-safe manner. */
/* struct CRYPTO_dynlock_value has to be defined by the application. */
typedef struct
- {
- int references;
- struct CRYPTO_dynlock_value *data;
- } CRYPTO_dynlock;
+ {
+ int references;
+ struct CRYPTO_dynlock_value *data;
+ } CRYPTO_dynlock;
/* The following can be used to detect memory leaks in the SSLeay library.
* It used, it turns on malloc checking */
-#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */
-#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */
-#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */
-#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */
+#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */
+#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */
+#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */
+#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */
/* The following are bit values to turn on or off options connected to the
* malloc checking functionality */
/* Adds time to the memory checking information */
-#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */
+#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */
/* Adds thread number to the memory checking information */
-#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */
+#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */
#define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD)
@@ -281,22 +287,22 @@ typedef struct
typedef struct bio_st BIO_dummy;
struct crypto_ex_data_st
- {
- STACK *sk;
- int dummy; /* gcc is screwing up this data structure :-( */
- };
+ {
+ STACK *sk;
+ int dummy; /* gcc is screwing up this data structure :-( */
+ };
/* This stuff is basically class callback functions
* The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */
typedef struct crypto_ex_data_func_st
- {
- long argl; /* Arbitary long */
- void *argp; /* Arbitary void * */
- CRYPTO_EX_new *new_func;
- CRYPTO_EX_free *free_func;
- CRYPTO_EX_dup *dup_func;
- } CRYPTO_EX_DATA_FUNCS;
+ {
+ long argl; /* Arbitary long */
+ void *argp; /* Arbitary void * */
+ CRYPTO_EX_new *new_func;
+ CRYPTO_EX_free *free_func;
+ CRYPTO_EX_dup *dup_func;
+ } CRYPTO_EX_DATA_FUNCS;
DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
@@ -304,34 +310,34 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
* entry.
*/
-#define CRYPTO_EX_INDEX_BIO 0
-#define CRYPTO_EX_INDEX_SSL 1
-#define CRYPTO_EX_INDEX_SSL_CTX 2
-#define CRYPTO_EX_INDEX_SSL_SESSION 3
-#define CRYPTO_EX_INDEX_X509_STORE 4
-#define CRYPTO_EX_INDEX_X509_STORE_CTX 5
-#define CRYPTO_EX_INDEX_RSA 6
-#define CRYPTO_EX_INDEX_DSA 7
-#define CRYPTO_EX_INDEX_DH 8
-#define CRYPTO_EX_INDEX_ENGINE 9
-#define CRYPTO_EX_INDEX_X509 10
-#define CRYPTO_EX_INDEX_UI 11
-#define CRYPTO_EX_INDEX_ECDSA 12
-#define CRYPTO_EX_INDEX_ECDH 13
-#define CRYPTO_EX_INDEX_COMP 14
-#define CRYPTO_EX_INDEX_STORE 15
+#define CRYPTO_EX_INDEX_BIO 0
+#define CRYPTO_EX_INDEX_SSL 1
+#define CRYPTO_EX_INDEX_SSL_CTX 2
+#define CRYPTO_EX_INDEX_SSL_SESSION 3
+#define CRYPTO_EX_INDEX_X509_STORE 4
+#define CRYPTO_EX_INDEX_X509_STORE_CTX 5
+#define CRYPTO_EX_INDEX_RSA 6
+#define CRYPTO_EX_INDEX_DSA 7
+#define CRYPTO_EX_INDEX_DH 8
+#define CRYPTO_EX_INDEX_ENGINE 9
+#define CRYPTO_EX_INDEX_X509 10
+#define CRYPTO_EX_INDEX_UI 11
+#define CRYPTO_EX_INDEX_ECDSA 12
+#define CRYPTO_EX_INDEX_ECDH 13
+#define CRYPTO_EX_INDEX_COMP 14
+#define CRYPTO_EX_INDEX_STORE 15
/* Dynamically assigned indexes start from this value (don't use directly, use
* via CRYPTO_ex_data_new_class). */
-#define CRYPTO_EX_INDEX_USER 100
+#define CRYPTO_EX_INDEX_USER 100
/* This is the default callbacks, but we can have others as well:
* this is needed in Win32 where the application malloc and the
* library malloc may not be the same.
*/
-#define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\
- malloc, realloc, free)
+#define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\
+ malloc, realloc, free)
#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
@@ -341,39 +347,33 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
/* Set standard debugging functions (not done by default
* unless CRYPTO_MDEBUG is defined) */
-#define CRYPTO_malloc_debug_init() do {\
- CRYPTO_set_mem_debug_functions(\
- CRYPTO_dbg_malloc,\
- CRYPTO_dbg_realloc,\
- CRYPTO_dbg_free,\
- CRYPTO_dbg_set_options,\
- CRYPTO_dbg_get_options);\
- } while(0)
+void CRYPTO_malloc_debug_init(void);
int CRYPTO_mem_ctrl(int mode);
int CRYPTO_is_mem_check_on(void);
/* for applications */
#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
-#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
+#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
/* for library-internal use */
-#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
-#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
+#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
+#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
#define is_MemCheck_on() CRYPTO_is_mem_check_on()
-#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
+#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
+#define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
#define OPENSSL_realloc(addr,num) \
- CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
+ CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
#define OPENSSL_realloc_clean(addr,old_num,num) \
- CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
+ CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
#define OPENSSL_remalloc(addr,num) \
- CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
-#define OPENSSL_freeFunc CRYPTO_free
-#define OPENSSL_free(addr) CRYPTO_free(addr)
+ CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
+#define OPENSSL_freeFunc CRYPTO_free
+#define OPENSSL_free(addr) CRYPTO_free(addr)
#define OPENSSL_malloc_locked(num) \
- CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
+ CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
@@ -383,7 +383,7 @@ unsigned long SSLeay(void);
int OPENSSL_issetugid(void);
/* An opaque type representing an implementation of "ex_data" support */
-typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
+typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
/* Return an opaque pointer to the current "ex_data" implementation */
const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void);
/* Sets the "ex_data" implementation to be used (if it's not too late) */
@@ -392,13 +392,13 @@ int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i);
int CRYPTO_ex_data_new_class(void);
/* Within a given class, get/register a new index */
int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
- CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
- CRYPTO_EX_free *free_func);
+ CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
/* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given
* class (invokes whatever per-class callbacks are applicable) */
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
- CRYPTO_EX_DATA *from);
+ CRYPTO_EX_DATA *from);
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
/* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index
* (relative to the class type involved) */
@@ -413,19 +413,22 @@ int CRYPTO_get_new_lockid(char *name);
int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
void CRYPTO_lock(int mode, int type,const char *file,int line);
void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
- const char *file,int line));
+ const char *file,int line));
void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
- int line);
+ int line);
void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
- const char *file, int line));
+ const char *file, int line));
int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
- const char *file,int line);
+ const char *file,int line);
void CRYPTO_set_id_callback(unsigned long (*func)(void));
unsigned long (*CRYPTO_get_id_callback(void))(void);
unsigned long CRYPTO_thread_id(void);
const char *CRYPTO_get_lock_name(int type);
int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file,
- int line);
+ int line);
+
+void int_CRYPTO_set_do_dynlock_callback(
+ void (*do_dynlock_cb)(int mode, int type, const char *file, int line));
int CRYPTO_get_new_dynlockid(void);
void CRYPTO_destroy_dynlockid(int i);
@@ -447,10 +450,14 @@ int CRYPTO_set_mem_ex_functions(void *(*m)(size_t,const char *,int),
int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t,const char *,int),
void (*free_func)(void *));
int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
- void (*r)(void *,void *,int,const char *,int,int),
- void (*f)(void *,int),
- void (*so)(long),
- long (*go)(void));
+ void (*r)(void *,void *,int,const char *,int,int),
+ void (*f)(void *,int),
+ void (*so)(long),
+ long (*go)(void));
+void CRYPTO_set_mem_info_functions(
+ int (*push_info_fn)(const char *info, const char *file, int line),
+ int (*pop_info_fn)(void),
+ int (*remove_all_info_fn)(void));
void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *));
void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *));
void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int),
@@ -459,18 +466,19 @@ void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int),
void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t,const char *,int),
void (**f)(void *));
void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
- void (**r)(void *,void *,int,const char *,int,int),
- void (**f)(void *,int),
- void (**so)(long),
- long (**go)(void));
+ void (**r)(void *,void *,int,const char *,int,int),
+ void (**f)(void *,int),
+ void (**so)(long),
+ long (**go)(void));
void *CRYPTO_malloc_locked(int num, const char *file, int line);
void CRYPTO_free_locked(void *);
void *CRYPTO_malloc(int num, const char *file, int line);
+char *CRYPTO_strdup(const char *str, const char *file, int line);
void CRYPTO_free(void *);
void *CRYPTO_realloc(void *addr,int num, const char *file, int line);
void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file,
- int line);
+ int line);
void *CRYPTO_remalloc(void *addr,int num, const char *file, int line);
void OPENSSL_cleanse(void *ptr, size_t len);
@@ -489,8 +497,8 @@ int CRYPTO_remove_all_info(void);
* used as default in CRYPTO_MDEBUG compilations): */
/* The last argument has the following significance:
*
- * 0: called before the actual memory allocation has taken place
- * 1: called after the actual memory allocation has taken place
+ * 0: called before the actual memory allocation has taken place
+ * 1: called after the actual memory allocation has taken place
*/
void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p);
void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p);
@@ -506,6 +514,9 @@ void CRYPTO_dbg_free(void *addr,int before_p);
void CRYPTO_dbg_set_options(long bits);
long CRYPTO_dbg_get_options(void);
+int CRYPTO_dbg_push_info(const char *info, const char *file, int line);
+int CRYPTO_dbg_pop_info(void);
+int CRYPTO_dbg_remove_all_info(void);
#ifndef OPENSSL_NO_FP_API
void CRYPTO_mem_leaks_fp(FILE *);
@@ -521,6 +532,61 @@ void OpenSSLDie(const char *file,int line,const char *assertion);
unsigned long *OPENSSL_ia32cap_loc(void);
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
+int OPENSSL_isservice(void);
+
+#ifdef OPENSSL_FIPS
+#define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \
+ alg " previous FIPS forbidden algorithm error ignored");
+
+#define FIPS_BAD_ABORT(alg) OpenSSLDie(__FILE__, __LINE__, \
+ #alg " Algorithm forbidden in FIPS mode");
+
+#ifdef OPENSSL_FIPS_STRICT
+#define FIPS_BAD_ALGORITHM(alg) FIPS_BAD_ABORT(alg)
+#else
+#define FIPS_BAD_ALGORITHM(alg) \
+ { \
+ FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD); \
+ ERR_add_error_data(2, "Algorithm=", #alg); \
+ return 0; \
+ }
+#endif
+
+/* Low level digest API blocking macro */
+
+#define FIPS_NON_FIPS_MD_Init(alg) \
+ int alg##_Init(alg##_CTX *c) \
+ { \
+ if (FIPS_mode()) \
+ FIPS_BAD_ALGORITHM(alg) \
+ return private_##alg##_Init(c); \
+ } \
+ int private_##alg##_Init(alg##_CTX *c)
+
+/* For ciphers the API often varies from cipher to cipher and each needs to
+ * be treated as a special case. Variable key length ciphers (Blowfish, RC4,
+ * CAST) however are very similar and can use a blocking macro.
+ */
+
+#define FIPS_NON_FIPS_VCIPHER_Init(alg) \
+ void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) \
+ { \
+ if (FIPS_mode()) \
+ FIPS_BAD_ABORT(alg) \
+ private_##alg##_set_key(key, len, data); \
+ } \
+ void private_##alg##_set_key(alg##_KEY *key, int len, \
+ const unsigned char *data)
+
+#else
+
+#define FIPS_NON_FIPS_VCIPHER_Init(alg) \
+ void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data)
+
+#define FIPS_NON_FIPS_MD_Init(alg) \
+ int alg##_Init(alg##_CTX *c)
+
+#endif /* def OPENSSL_FIPS */
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -528,24 +594,26 @@ unsigned long *OPENSSL_ia32cap_loc(void);
*/
void ERR_load_CRYPTO_strings(void);
+#define OPENSSL_HAVE_INIT 1
+void OPENSSL_init(void);
+
/* Error codes for the CRYPTO functions. */
/* Function codes. */
-#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
-#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
-#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
-#define CRYPTO_F_CRYPTO_SET_EX_DATA 102
-#define CRYPTO_F_DEF_ADD_INDEX 104
-#define CRYPTO_F_DEF_GET_CLASS 105
-#define CRYPTO_F_INT_DUP_EX_DATA 106
-#define CRYPTO_F_INT_FREE_EX_DATA 107
-#define CRYPTO_F_INT_NEW_EX_DATA 108
+#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
+#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
+#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
+#define CRYPTO_F_CRYPTO_SET_EX_DATA 102
+#define CRYPTO_F_DEF_ADD_INDEX 104
+#define CRYPTO_F_DEF_GET_CLASS 105
+#define CRYPTO_F_INT_DUP_EX_DATA 106
+#define CRYPTO_F_INT_FREE_EX_DATA 107
+#define CRYPTO_F_INT_NEW_EX_DATA 108
/* Reason codes. */
-#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
+#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/des.h b/dep/include/openssl/des.h
index 31ec76509ee..92b66635998 100644
--- a/dep/include/openssl/des.h
+++ b/dep/include/openssl/des.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -59,8 +59,8 @@
#ifndef HEADER_NEW_DES_H
#define HEADER_NEW_DES_H
-#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES,
- DES_LONG (via openssl/opensslconf.h */
+#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES,
+ DES_LONG (via openssl/opensslconf.h */
#ifdef OPENSSL_NO_DES
#error DES is disabled.
@@ -83,12 +83,12 @@ typedef /* const */ unsigned char const_DES_cblock[8];
typedef struct DES_ks
{
union
- {
- DES_cblock cblock;
- /* make sure things are correct size on machines with
- * 8 byte longs */
- DES_LONG deslong[2];
- } ks[16];
+ {
+ DES_cblock cblock;
+ /* make sure things are correct size on machines with
+ * 8 byte longs */
+ DES_LONG deslong[2];
+ } ks[16];
} DES_key_schedule;
#ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT
@@ -101,117 +101,118 @@ typedef struct DES_ks
# include <openssl/des_old.h>
#endif
-#define DES_KEY_SZ (sizeof(DES_cblock))
+#define DES_KEY_SZ (sizeof(DES_cblock))
#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
-#define DES_ENCRYPT 1
-#define DES_DECRYPT 0
+#define DES_ENCRYPT 1
+#define DES_DECRYPT 0
-#define DES_CBC_MODE 0
-#define DES_PCBC_MODE 1
+#define DES_CBC_MODE 0
+#define DES_PCBC_MODE 1
#define DES_ecb2_encrypt(i,o,k1,k2,e) \
- DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+ DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
- DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+ DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
- DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+ DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
- DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
-OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */
+OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */
#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
-OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */
+OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */
#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode)
const char *DES_options(void);
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
- DES_key_schedule *ks1,DES_key_schedule *ks2,
- DES_key_schedule *ks3, int enc);
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3, int enc);
DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output,
- long length,DES_key_schedule *schedule,
- const_DES_cblock *ivec);
+ long length,DES_key_schedule *schedule,
+ const_DES_cblock *ivec);
/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
void DES_cbc_encrypt(const unsigned char *input,unsigned char *output,
- long length,DES_key_schedule *schedule,DES_cblock *ivec,
- int enc);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output,
- long length,DES_key_schedule *schedule,DES_cblock *ivec,
- int enc);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output,
- long length,DES_key_schedule *schedule,DES_cblock *ivec,
- const_DES_cblock *inw,const_DES_cblock *outw,int enc);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ const_DES_cblock *inw,const_DES_cblock *outw,int enc);
void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
- long length,DES_key_schedule *schedule,DES_cblock *ivec,
- int enc);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output,
- DES_key_schedule *ks,int enc);
-
-/* This is the DES encryption function that gets called by just about
- every other DES routine in the library. You should not use this
- function except to implement 'modes' of DES. I say this because the
- functions that call this routine do the conversion from 'char *' to
- long, and this needs to be done to make sure 'non-aligned' memory
- access do not occur. The characters are loaded 'little endian'.
- Data is a pointer to 2 unsigned long's and ks is the
- DES_key_schedule to use. enc, is non zero specifies encryption,
- zero if decryption. */
+ DES_key_schedule *ks,int enc);
+
+/* This is the DES encryption function that gets called by just about
+ every other DES routine in the library. You should not use this
+ function except to implement 'modes' of DES. I say this because the
+ functions that call this routine do the conversion from 'char *' to
+ long, and this needs to be done to make sure 'non-aligned' memory
+ access do not occur. The characters are loaded 'little endian'.
+ Data is a pointer to 2 unsigned long's and ks is the
+ DES_key_schedule to use. enc, is non zero specifies encryption,
+ zero if decryption. */
void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc);
-/* This functions is the same as DES_encrypt1() except that the DES
- initial permutation (IP) and final permutation (FP) have been left
- out. As for DES_encrypt1(), you should not use this function.
- It is used by the routines in the library that implement triple DES.
- IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same
- as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */
+/* This functions is the same as DES_encrypt1() except that the DES
+ initial permutation (IP) and final permutation (FP) have been left
+ out. As for DES_encrypt1(), you should not use this function.
+ It is used by the routines in the library that implement triple DES.
+ IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same
+ as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */
void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc);
void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
- DES_key_schedule *ks2, DES_key_schedule *ks3);
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
- DES_key_schedule *ks2, DES_key_schedule *ks3);
-void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output,
- long length,
- DES_key_schedule *ks1,DES_key_schedule *ks2,
- DES_key_schedule *ks3,DES_cblock *ivec,int enc);
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output,
+ long length,
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3,DES_cblock *ivec,int enc);
void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out,
- long length,
- DES_key_schedule *ks1,DES_key_schedule *ks2,
- DES_key_schedule *ks3,
- DES_cblock *ivec1,DES_cblock *ivec2,
- int enc);
+ long length,
+ DES_key_schedule *ks1,DES_key_schedule *ks2,
+ DES_key_schedule *ks3,
+ DES_cblock *ivec1,DES_cblock *ivec2,
+ int enc);
void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out,
- long length,DES_key_schedule *ks1,
- DES_key_schedule *ks2,DES_key_schedule *ks3,
- DES_cblock *ivec,int *num,int enc);
+ long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int *num,int enc);
void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out,
- int numbits,long length,DES_key_schedule *ks1,
- DES_key_schedule *ks2,DES_key_schedule *ks3,
- DES_cblock *ivec,int enc);
+ int numbits,long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int enc);
void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out,
- long length,DES_key_schedule *ks1,
- DES_key_schedule *ks2,DES_key_schedule *ks3,
- DES_cblock *ivec,int *num);
-
+ long length,DES_key_schedule *ks1,
+ DES_key_schedule *ks2,DES_key_schedule *ks3,
+ DES_cblock *ivec,int *num);
+#if 0
void DES_xwhite_in2out(const_DES_cblock *DES_key,const_DES_cblock *in_white,
- DES_cblock *out_white);
+ DES_cblock *out_white);
+#endif
int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched,
- DES_cblock *iv);
+ DES_cblock *iv);
int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched,
- DES_cblock *iv);
+ DES_cblock *iv);
char *DES_fcrypt(const char *buf,const char *salt, char *ret);
char *DES_crypt(const char *buf,const char *salt);
void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits,
- long length,DES_key_schedule *schedule,DES_cblock *ivec);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec);
void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output,
- long length,DES_key_schedule *schedule,DES_cblock *ivec,
- int enc);
+ long length,DES_key_schedule *schedule,DES_cblock *ivec,
+ int enc);
DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[],
- long length,int out_count,DES_cblock *seed);
+ long length,int out_count,DES_cblock *seed);
int DES_random_key(DES_cblock *ret);
void DES_set_odd_parity(DES_cblock *key);
int DES_check_key_parity(const_DES_cblock *key);
@@ -226,14 +227,14 @@ void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
void DES_string_to_key(const char *str,DES_cblock *key);
void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2);
void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length,
- DES_key_schedule *schedule,DES_cblock *ivec,int *num,
- int enc);
+ DES_key_schedule *schedule,DES_cblock *ivec,int *num,
+ int enc);
void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length,
- DES_key_schedule *schedule,DES_cblock *ivec,int *num);
+ DES_key_schedule *schedule,DES_cblock *ivec,int *num);
int DES_read_password(DES_cblock *key, const char *prompt, int verify);
int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt,
- int verify);
+ int verify);
#define DES_fixup_key_parity DES_set_odd_parity
@@ -242,4 +243,3 @@ int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt,
#endif
#endif
-
diff --git a/dep/include/openssl/des_old.h b/dep/include/openssl/des_old.h
index 5961dae089d..2b2c3723549 100644
--- a/dep/include/openssl/des_old.h
+++ b/dep/include/openssl/des_old.h
@@ -42,7 +42,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -91,7 +91,7 @@
#ifndef HEADER_DES_H
#define HEADER_DES_H
-#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
+#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
#ifdef OPENSSL_NO_DES
#error DES is disabled.
@@ -122,116 +122,116 @@ extern "C" {
typedef unsigned char _ossl_old_des_cblock[8];
typedef struct _ossl_old_des_ks_struct
- {
- union {
- _ossl_old_des_cblock _;
- /* make sure things are correct size on machines with
- * 8 byte longs */
- DES_LONG pad[2];
- } ks;
- } _ossl_old_des_key_schedule[16];
+ {
+ union {
+ _ossl_old_des_cblock _;
+ /* make sure things are correct size on machines with
+ * 8 byte longs */
+ DES_LONG pad[2];
+ } ks;
+ } _ossl_old_des_key_schedule[16];
#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
#define des_cblock DES_cblock
#define const_des_cblock const_DES_cblock
#define des_key_schedule DES_key_schedule
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
- DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
+ DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
- DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
+ DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
- DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
+ DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
- DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
+ DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
- DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
+ DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
#define des_options()\
- DES_options()
+ DES_options()
#define des_cbc_cksum(i,o,l,k,iv)\
- DES_cbc_cksum((i),(o),(l),&(k),(iv))
+ DES_cbc_cksum((i),(o),(l),&(k),(iv))
#define des_cbc_encrypt(i,o,l,k,iv,e)\
- DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
+ DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
- DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
+ DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
- DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
+ DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
- DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
+ DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
#define des_ecb_encrypt(i,o,k,e)\
- DES_ecb_encrypt((i),(o),&(k),(e))
+ DES_ecb_encrypt((i),(o),&(k),(e))
#define des_encrypt1(d,k,e)\
- DES_encrypt1((d),&(k),(e))
+ DES_encrypt1((d),&(k),(e))
#define des_encrypt2(d,k,e)\
- DES_encrypt2((d),&(k),(e))
+ DES_encrypt2((d),&(k),(e))
#define des_encrypt3(d,k1,k2,k3)\
- DES_encrypt3((d),&(k1),&(k2),&(k3))
+ DES_encrypt3((d),&(k1),&(k2),&(k3))
#define des_decrypt3(d,k1,k2,k3)\
- DES_decrypt3((d),&(k1),&(k2),&(k3))
+ DES_decrypt3((d),&(k1),&(k2),&(k3))
#define des_xwhite_in2out(k,i,o)\
- DES_xwhite_in2out((k),(i),(o))
+ DES_xwhite_in2out((k),(i),(o))
#define des_enc_read(f,b,l,k,iv)\
- DES_enc_read((f),(b),(l),&(k),(iv))
+ DES_enc_read((f),(b),(l),&(k),(iv))
#define des_enc_write(f,b,l,k,iv)\
- DES_enc_write((f),(b),(l),&(k),(iv))
+ DES_enc_write((f),(b),(l),&(k),(iv))
#define des_fcrypt(b,s,r)\
- DES_fcrypt((b),(s),(r))
+ DES_fcrypt((b),(s),(r))
#if 0
#define des_crypt(b,s)\
- DES_crypt((b),(s))
+ DES_crypt((b),(s))
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
#define crypt(b,s)\
- DES_crypt((b),(s))
+ DES_crypt((b),(s))
#endif
#endif
#define des_ofb_encrypt(i,o,n,l,k,iv)\
- DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
+ DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
- DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
+ DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
#define des_quad_cksum(i,o,l,c,s)\
- DES_quad_cksum((i),(o),(l),(c),(s))
+ DES_quad_cksum((i),(o),(l),(c),(s))
#define des_random_seed(k)\
- _ossl_096_des_random_seed((k))
+ _ossl_096_des_random_seed((k))
#define des_random_key(r)\
- DES_random_key((r))
+ DES_random_key((r))
#define des_read_password(k,p,v) \
- DES_read_password((k),(p),(v))
+ DES_read_password((k),(p),(v))
#define des_read_2passwords(k1,k2,p,v) \
- DES_read_2passwords((k1),(k2),(p),(v))
+ DES_read_2passwords((k1),(k2),(p),(v))
#define des_set_odd_parity(k)\
- DES_set_odd_parity((k))
+ DES_set_odd_parity((k))
#define des_check_key_parity(k)\
- DES_check_key_parity((k))
+ DES_check_key_parity((k))
#define des_is_weak_key(k)\
- DES_is_weak_key((k))
+ DES_is_weak_key((k))
#define des_set_key(k,ks)\
- DES_set_key((k),&(ks))
+ DES_set_key((k),&(ks))
#define des_key_sched(k,ks)\
- DES_key_sched((k),&(ks))
+ DES_key_sched((k),&(ks))
#define des_set_key_checked(k,ks)\
- DES_set_key_checked((k),&(ks))
+ DES_set_key_checked((k),&(ks))
#define des_set_key_unchecked(k,ks)\
- DES_set_key_unchecked((k),&(ks))
+ DES_set_key_unchecked((k),&(ks))
#define des_string_to_key(s,k)\
- DES_string_to_key((s),(k))
+ DES_string_to_key((s),(k))
#define des_string_to_2keys(s,k1,k2)\
- DES_string_to_2keys((s),(k1),(k2))
+ DES_string_to_2keys((s),(k1),(k2))
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
- DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
+ DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
- DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
-
+ DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
+
#define des_ecb2_encrypt(i,o,k1,k2,e) \
- des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
- des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
- des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
- des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
#define des_check_key DES_check_key
#define des_rw_mode DES_rw_mode
@@ -241,92 +241,92 @@ typedef struct _ossl_old_des_ks_struct
#define des_cblock _ossl_old_des_cblock
#define des_key_schedule _ossl_old_des_key_schedule
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
- _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
+ _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
- _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
+ _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
- _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
+ _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
- _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
+ _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
#define des_options()\
- _ossl_old_des_options()
+ _ossl_old_des_options()
#define des_cbc_cksum(i,o,l,k,iv)\
- _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
+ _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
#define des_cbc_encrypt(i,o,l,k,iv,e)\
- _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
+ _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
- _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
+ _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
- _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
+ _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
- _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
+ _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
#define des_ecb_encrypt(i,o,k,e)\
- _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
+ _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
#define des_encrypt(d,k,e)\
- _ossl_old_des_encrypt((d),(k),(e))
+ _ossl_old_des_encrypt((d),(k),(e))
#define des_encrypt2(d,k,e)\
- _ossl_old_des_encrypt2((d),(k),(e))
+ _ossl_old_des_encrypt2((d),(k),(e))
#define des_encrypt3(d,k1,k2,k3)\
- _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
+ _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
#define des_decrypt3(d,k1,k2,k3)\
- _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
+ _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
#define des_xwhite_in2out(k,i,o)\
- _ossl_old_des_xwhite_in2out((k),(i),(o))
+ _ossl_old_des_xwhite_in2out((k),(i),(o))
#define des_enc_read(f,b,l,k,iv)\
- _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
+ _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
#define des_enc_write(f,b,l,k,iv)\
- _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
+ _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
#define des_fcrypt(b,s,r)\
- _ossl_old_des_fcrypt((b),(s),(r))
+ _ossl_old_des_fcrypt((b),(s),(r))
#define des_crypt(b,s)\
- _ossl_old_des_crypt((b),(s))
+ _ossl_old_des_crypt((b),(s))
#if 0
#define crypt(b,s)\
- _ossl_old_crypt((b),(s))
+ _ossl_old_crypt((b),(s))
#endif
#define des_ofb_encrypt(i,o,n,l,k,iv)\
- _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
+ _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
- _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
+ _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
#define des_quad_cksum(i,o,l,c,s)\
- _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
+ _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
#define des_random_seed(k)\
- _ossl_old_des_random_seed((k))
+ _ossl_old_des_random_seed((k))
#define des_random_key(r)\
- _ossl_old_des_random_key((r))
+ _ossl_old_des_random_key((r))
#define des_read_password(k,p,v) \
- _ossl_old_des_read_password((k),(p),(v))
+ _ossl_old_des_read_password((k),(p),(v))
#define des_read_2passwords(k1,k2,p,v) \
- _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
+ _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
#define des_set_odd_parity(k)\
- _ossl_old_des_set_odd_parity((k))
+ _ossl_old_des_set_odd_parity((k))
#define des_is_weak_key(k)\
- _ossl_old_des_is_weak_key((k))
+ _ossl_old_des_is_weak_key((k))
#define des_set_key(k,ks)\
- _ossl_old_des_set_key((k),(ks))
+ _ossl_old_des_set_key((k),(ks))
#define des_key_sched(k,ks)\
- _ossl_old_des_key_sched((k),(ks))
+ _ossl_old_des_key_sched((k),(ks))
#define des_string_to_key(s,k)\
- _ossl_old_des_string_to_key((s),(k))
+ _ossl_old_des_string_to_key((s),(k))
#define des_string_to_2keys(s,k1,k2)\
- _ossl_old_des_string_to_2keys((s),(k1),(k2))
+ _ossl_old_des_string_to_2keys((s),(k1),(k2))
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
- _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
+ _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
- _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
-
+ _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
+
#define des_ecb2_encrypt(i,o,k1,k2,e) \
- des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
- des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
- des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
- des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
#define des_check_key DES_check_key
#define des_rw_mode DES_rw_mode
@@ -334,60 +334,61 @@ typedef struct _ossl_old_des_ks_struct
const char *_ossl_old_des_options(void);
void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
- _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
- _ossl_old_des_key_schedule ks3, int enc);
+ _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, int enc);
DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
- long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
+ long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
- _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
+ _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
- _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
+ _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
- _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
- _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
+ _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
+ _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
- long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
+ long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
- _ossl_old_des_key_schedule ks,int enc);
+ _ossl_old_des_key_schedule ks,int enc);
void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
- _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
+ _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
- _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
-void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
- long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
- _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
+ _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
+void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
+ long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
- long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
- _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
+ long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
- long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
- _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
-
+ long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
+#if 0
void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
- _ossl_old_des_cblock (*out_white));
+ _ossl_old_des_cblock (*out_white));
+#endif
int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
- _ossl_old_des_cblock *iv);
+ _ossl_old_des_cblock *iv);
int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
- _ossl_old_des_cblock *iv);
+ _ossl_old_des_cblock *iv);
char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
char *_ossl_old_des_crypt(const char *buf,const char *salt);
#if !defined(PERL5) && !defined(NeXT)
char *_ossl_old_crypt(const char *buf,const char *salt);
#endif
void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
- int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
+ int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
- _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
+ _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
- long length,int out_count,_ossl_old_des_cblock *seed);
+ long length,int out_count,_ossl_old_des_cblock *seed);
void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
- const char *prompt,int verify);
+ const char *prompt,int verify);
void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
@@ -395,9 +396,9 @@ int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule
void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
- _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
+ _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
- _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
+ _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
void _ossl_096_des_random_seed(des_cblock *key);
@@ -443,4 +444,3 @@ void _ossl_096_des_random_seed(des_cblock *key);
#include <openssl/ui_compat.h>
#endif
-
diff --git a/dep/include/openssl/dh.h b/dep/include/openssl/dh.h
index 9913b4d41c1..10475ac4b3c 100644
--- a/dep/include/openssl/dh.h
+++ b/dep/include/openssl/dh.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -72,11 +72,13 @@
#ifndef OPENSSL_NO_DEPRECATED
#include <openssl/bn.h>
#endif
-
+
#ifndef OPENSSL_DH_MAX_MODULUS_BITS
-# define OPENSSL_DH_MAX_MODULUS_BITS 10000
+# define OPENSSL_DH_MAX_MODULUS_BITS 10000
#endif
+#define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
+
#define DH_FLAG_CACHE_MONT_P 0x01
#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH
* implementation now uses constant time
@@ -95,114 +97,119 @@ extern "C" {
/* typedef struct dh_method DH_METHOD; */
struct dh_method
- {
- const char *name;
- /* Methods here */
- int (*generate_key)(DH *dh);
- int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh);
- int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a,
- const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
- BN_MONT_CTX *m_ctx); /* Can be null */
-
- int (*init)(DH *dh);
- int (*finish)(DH *dh);
- int flags;
- char *app_data;
- /* If this is non-NULL, it will be used to generate parameters */
- int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb);
- };
+ {
+ const char *name;
+ /* Methods here */
+ int (*generate_key)(DH *dh);
+ int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh);
+ int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a,
+ const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx); /* Can be null */
+
+ int (*init)(DH *dh);
+ int (*finish)(DH *dh);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it will be used to generate parameters */
+ int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb);
+ };
struct dh_st
- {
- /* This first argument is used to pick up errors when
- * a DH is passed instead of a EVP_PKEY */
- int pad;
- int version;
- BIGNUM *p;
- BIGNUM *g;
- long length; /* optional */
- BIGNUM *pub_key; /* g^x */
- BIGNUM *priv_key; /* x */
-
- int flags;
- BN_MONT_CTX *method_mont_p;
- /* Place holders if we want to do X9.42 DH */
- BIGNUM *q;
- BIGNUM *j;
- unsigned char *seed;
- int seedlen;
- BIGNUM *counter;
-
- int references;
- CRYPTO_EX_DATA ex_data;
- const DH_METHOD *meth;
- ENGINE *engine;
- };
-
-#define DH_GENERATOR_2 2
-/* #define DH_GENERATOR_3 3 */
-#define DH_GENERATOR_5 5
+ {
+ /* This first argument is used to pick up errors when
+ * a DH is passed instead of a EVP_PKEY */
+ int pad;
+ int version;
+ BIGNUM *p;
+ BIGNUM *g;
+ long length; /* optional */
+ BIGNUM *pub_key; /* g^x */
+ BIGNUM *priv_key; /* x */
+
+ int flags;
+ BN_MONT_CTX *method_mont_p;
+ /* Place holders if we want to do X9.42 DH */
+ BIGNUM *q;
+ BIGNUM *j;
+ unsigned char *seed;
+ int seedlen;
+ BIGNUM *counter;
+
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DH_METHOD *meth;
+ ENGINE *engine;
+ };
+
+#define DH_GENERATOR_2 2
+/* #define DH_GENERATOR_3 3 */
+#define DH_GENERATOR_5 5
/* DH_check error codes */
-#define DH_CHECK_P_NOT_PRIME 0x01
-#define DH_CHECK_P_NOT_SAFE_PRIME 0x02
-#define DH_UNABLE_TO_CHECK_GENERATOR 0x04
-#define DH_NOT_SUITABLE_GENERATOR 0x08
+#define DH_CHECK_P_NOT_PRIME 0x01
+#define DH_CHECK_P_NOT_SAFE_PRIME 0x02
+#define DH_UNABLE_TO_CHECK_GENERATOR 0x04
+#define DH_NOT_SUITABLE_GENERATOR 0x08
/* DH_check_pub_key error codes */
-#define DH_CHECK_PUBKEY_TOO_SMALL 0x01
-#define DH_CHECK_PUBKEY_TOO_LARGE 0x02
+#define DH_CHECK_PUBKEY_TOO_SMALL 0x01
+#define DH_CHECK_PUBKEY_TOO_LARGE 0x02
/* primes p where (p-1)/2 is prime too are called "safe"; we define
this for backward compatibility: */
-#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
+#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
#define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x)
#define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
- (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
+ (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
- (unsigned char *)(x))
+ (unsigned char *)(x))
#define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
const DH_METHOD *DH_OpenSSL(void);
+#ifdef OPENSSL_FIPS
+DH * FIPS_dh_new(void);
+void FIPS_dh_free(DH *dh);
+#endif
+
void DH_set_default_method(const DH_METHOD *meth);
const DH_METHOD *DH_get_default_method(void);
int DH_set_method(DH *dh, const DH_METHOD *meth);
DH *DH_new_method(ENGINE *engine);
-DH * DH_new(void);
-void DH_free(DH *dh);
-int DH_up_ref(DH *dh);
-int DH_size(const DH *dh);
+DH * DH_new(void);
+void DH_free(DH *dh);
+int DH_up_ref(DH *dh);
+int DH_size(const DH *dh);
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int DH_set_ex_data(DH *d, int idx, void *arg);
void *DH_get_ex_data(DH *d, int idx);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
-DH * DH_generate_parameters(int prime_len,int generator,
- void (*callback)(int,int,void *),void *cb_arg);
+DH * DH_generate_parameters(int prime_len,int generator,
+ void (*callback)(int,int,void *),void *cb_arg);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
-int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb);
-
-int DH_check(const DH *dh,int *codes);
-int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
-int DH_generate_key(DH *dh);
-int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
-DH * d2i_DHparams(DH **a,const unsigned char **pp, long length);
-int i2d_DHparams(const DH *a,unsigned char **pp);
+int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb);
+
+int DH_check(const DH *dh,int *codes);
+int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
+int DH_generate_key(DH *dh);
+int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
+DH * d2i_DHparams(DH **a,const unsigned char **pp, long length);
+int i2d_DHparams(const DH *a,unsigned char **pp);
#ifndef OPENSSL_NO_FP_API
-int DHparams_print_fp(FILE *fp, const DH *x);
+int DHparams_print_fp(FILE *fp, const DH *x);
#endif
#ifndef OPENSSL_NO_BIO
-int DHparams_print(BIO *bp, const DH *x);
+int DHparams_print(BIO *bp, const DH *x);
#else
-int DHparams_print(char *bp, const DH *x);
+int DHparams_print(char *bp, const DH *x);
#endif
/* BEGIN ERROR CODES */
@@ -214,22 +221,25 @@ void ERR_load_DH_strings(void);
/* Error codes for the DH functions. */
/* Function codes. */
-#define DH_F_COMPUTE_KEY 102
-#define DH_F_DHPARAMS_PRINT 100
-#define DH_F_DHPARAMS_PRINT_FP 101
-#define DH_F_DH_BUILTIN_GENPARAMS 106
-#define DH_F_DH_NEW_METHOD 105
-#define DH_F_GENERATE_KEY 103
-#define DH_F_GENERATE_PARAMETERS 104
+#define DH_F_COMPUTE_KEY 102
+#define DH_F_DHPARAMS_PRINT 100
+#define DH_F_DHPARAMS_PRINT_FP 101
+#define DH_F_DH_BUILTIN_GENPARAMS 106
+#define DH_F_DH_COMPUTE_KEY 107
+#define DH_F_DH_GENERATE_KEY 108
+#define DH_F_DH_GENERATE_PARAMETERS 109
+#define DH_F_DH_NEW_METHOD 105
+#define DH_F_GENERATE_KEY 103
+#define DH_F_GENERATE_PARAMETERS 104
/* Reason codes. */
-#define DH_R_BAD_GENERATOR 101
-#define DH_R_INVALID_PUBKEY 102
-#define DH_R_MODULUS_TOO_LARGE 103
-#define DH_R_NO_PRIVATE_VALUE 100
+#define DH_R_BAD_GENERATOR 101
+#define DH_R_INVALID_PUBKEY 102
+#define DH_R_KEY_SIZE_TOO_SMALL 104
+#define DH_R_MODULUS_TOO_LARGE 103
+#define DH_R_NO_PRIVATE_VALUE 100
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/dsa.h b/dep/include/openssl/dsa.h
index 6341a71cd0e..702c50d6dc8 100644
--- a/dep/include/openssl/dsa.h
+++ b/dep/include/openssl/dsa.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -85,10 +85,12 @@
#endif
#ifndef OPENSSL_DSA_MAX_MODULUS_BITS
-# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
+# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
#endif
-#define DSA_FLAG_CACHE_MONT_P 0x01
+#define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024
+
+#define DSA_FLAG_CACHE_MONT_P 0x01
#define DSA_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DSA
* implementation now uses constant time
* modular exponentiation for secret exponents
@@ -97,6 +99,25 @@
* be used for all exponents.
*/
+/* If this flag is set the DSA method is FIPS compliant and can be used
+ * in FIPS mode. This is set in the validated module method. If an
+ * application sets this flag in its own methods it is its reposibility
+ * to ensure the result is compliant.
+ */
+
+#define DSA_FLAG_FIPS_METHOD 0x0400
+
+/* If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+#define DSA_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef OPENSSL_FIPS
+#define FIPS_DSA_SIZE_T int
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -106,142 +127,147 @@ extern "C" {
/* typedef struct dsa_method DSA_METHOD; */
typedef struct DSA_SIG_st
- {
- BIGNUM *r;
- BIGNUM *s;
- } DSA_SIG;
+ {
+ BIGNUM *r;
+ BIGNUM *s;
+ } DSA_SIG;
struct dsa_method
- {
- const char *name;
- DSA_SIG * (*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa);
- int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
- BIGNUM **rp);
- int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
- DSA_SIG *sig, DSA *dsa);
- int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
- BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
- BN_MONT_CTX *in_mont);
- int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx,
- BN_MONT_CTX *m_ctx); /* Can be null */
- int (*init)(DSA *dsa);
- int (*finish)(DSA *dsa);
- int flags;
- char *app_data;
- /* If this is non-NULL, it is used to generate DSA parameters */
- int (*dsa_paramgen)(DSA *dsa, int bits,
- unsigned char *seed, int seed_len,
- int *counter_ret, unsigned long *h_ret,
- BN_GENCB *cb);
- /* If this is non-NULL, it is used to generate DSA keys */
- int (*dsa_keygen)(DSA *dsa);
- };
+ {
+ const char *name;
+ DSA_SIG * (*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa);
+ int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
+ BIGNUM **rp);
+ int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
+ DSA_SIG *sig, DSA *dsa);
+ int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
+ BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *in_mont);
+ int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx); /* Can be null */
+ int (*init)(DSA *dsa);
+ int (*finish)(DSA *dsa);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it is used to generate DSA parameters */
+ int (*dsa_paramgen)(DSA *dsa, int bits,
+ unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret,
+ BN_GENCB *cb);
+ /* If this is non-NULL, it is used to generate DSA keys */
+ int (*dsa_keygen)(DSA *dsa);
+ };
struct dsa_st
- {
- /* This first variable is used to pick up errors where
- * a DSA is passed instead of of a EVP_PKEY */
- int pad;
- long version;
- int write_params;
- BIGNUM *p;
- BIGNUM *q; /* == 20 */
- BIGNUM *g;
-
- BIGNUM *pub_key; /* y public key */
- BIGNUM *priv_key; /* x private key */
-
- BIGNUM *kinv; /* Signing pre-calc */
- BIGNUM *r; /* Signing pre-calc */
-
- int flags;
- /* Normally used to cache montgomery values */
- BN_MONT_CTX *method_mont_p;
- int references;
- CRYPTO_EX_DATA ex_data;
- const DSA_METHOD *meth;
- /* functional reference if 'meth' is ENGINE-provided */
- ENGINE *engine;
- };
+ {
+ /* This first variable is used to pick up errors where
+ * a DSA is passed instead of of a EVP_PKEY */
+ int pad;
+ long version;
+ int write_params;
+ BIGNUM *p;
+ BIGNUM *q; /* == 20 */
+ BIGNUM *g;
+
+ BIGNUM *pub_key; /* y public key */
+ BIGNUM *priv_key; /* x private key */
+
+ BIGNUM *kinv; /* Signing pre-calc */
+ BIGNUM *r; /* Signing pre-calc */
+
+ int flags;
+ /* Normally used to cache montgomery values */
+ BN_MONT_CTX *method_mont_p;
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+ };
#define DSAparams_dup(x) ASN1_dup_of_const(DSA,i2d_DSAparams,d2i_DSAparams,x)
#define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
- (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
+ (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
#define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \
- (unsigned char *)(x))
+ (unsigned char *)(x))
#define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
DSA_SIG * DSA_SIG_new(void);
-void DSA_SIG_free(DSA_SIG *a);
-int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
+void DSA_SIG_free(DSA_SIG *a);
+int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa);
-int DSA_do_verify(const unsigned char *dgst,int dgst_len,
- DSA_SIG *sig,DSA *dsa);
+int DSA_do_verify(const unsigned char *dgst,int dgst_len,
+ DSA_SIG *sig,DSA *dsa);
const DSA_METHOD *DSA_OpenSSL(void);
-void DSA_set_default_method(const DSA_METHOD *);
+void DSA_set_default_method(const DSA_METHOD *);
const DSA_METHOD *DSA_get_default_method(void);
-int DSA_set_method(DSA *dsa, const DSA_METHOD *);
+int DSA_set_method(DSA *dsa, const DSA_METHOD *);
-DSA * DSA_new(void);
-DSA * DSA_new_method(ENGINE *engine);
-void DSA_free (DSA *r);
+#ifdef OPENSSL_FIPS
+DSA * FIPS_dsa_new(void);
+void FIPS_dsa_free (DSA *r);
+#endif
+
+DSA * DSA_new(void);
+DSA * DSA_new_method(ENGINE *engine);
+void DSA_free (DSA *r);
/* "up" the DSA object's reference count */
-int DSA_up_ref(DSA *r);
-int DSA_size(const DSA *);
- /* next 4 return -1 on error */
-int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);
-int DSA_sign(int type,const unsigned char *dgst,int dlen,
- unsigned char *sig, unsigned int *siglen, DSA *dsa);
-int DSA_verify(int type,const unsigned char *dgst,int dgst_len,
- const unsigned char *sigbuf, int siglen, DSA *dsa);
+int DSA_up_ref(DSA *r);
+int DSA_size(const DSA *);
+ /* next 4 return -1 on error */
+int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);
+int DSA_sign(int type,const unsigned char *dgst,int dlen,
+ unsigned char *sig, unsigned int *siglen, DSA *dsa);
+int DSA_verify(int type,const unsigned char *dgst,int dgst_len,
+ const unsigned char *sigbuf, int siglen, DSA *dsa);
int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int DSA_set_ex_data(DSA *d, int idx, void *arg);
void *DSA_get_ex_data(DSA *d, int idx);
-DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
+DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
+DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
+DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
-DSA * DSA_generate_parameters(int bits,
- unsigned char *seed,int seed_len,
- int *counter_ret, unsigned long *h_ret,void
- (*callback)(int, int, void *),void *cb_arg);
+DSA * DSA_generate_parameters(int bits,
+ unsigned char *seed,int seed_len,
+ int *counter_ret, unsigned long *h_ret,void
+ (*callback)(int, int, void *),void *cb_arg);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
-int DSA_generate_parameters_ex(DSA *dsa, int bits,
- unsigned char *seed,int seed_len,
- int *counter_ret, unsigned long *h_ret, BN_GENCB *cb);
+int DSA_generate_parameters_ex(DSA *dsa, int bits,
+ unsigned char *seed,int seed_len,
+ int *counter_ret, unsigned long *h_ret, BN_GENCB *cb);
-int DSA_generate_key(DSA *a);
-int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
-int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
-int i2d_DSAparams(const DSA *a,unsigned char **pp);
+int DSA_generate_key(DSA *a);
+int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
+int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
+int i2d_DSAparams(const DSA *a,unsigned char **pp);
#ifndef OPENSSL_NO_BIO
-int DSAparams_print(BIO *bp, const DSA *x);
-int DSA_print(BIO *bp, const DSA *x, int off);
+int DSAparams_print(BIO *bp, const DSA *x);
+int DSA_print(BIO *bp, const DSA *x, int off);
#endif
#ifndef OPENSSL_NO_FP_API
-int DSAparams_print_fp(FILE *fp, const DSA *x);
-int DSA_print_fp(FILE *bp, const DSA *x, int off);
+int DSAparams_print_fp(FILE *fp, const DSA *x);
+int DSA_print_fp(FILE *bp, const DSA *x, int off);
#endif
#define DSS_prime_checks 50
/* Primality test according to FIPS PUB 186[-1], Appendix 2.1:
* 50 rounds of Rabin-Miller */
#define DSA_is_prime(n, callback, cb_arg) \
- BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
+ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
#ifndef OPENSSL_NO_DH
/* Convert DSA structure (key or just parameters) into DH structure
@@ -249,6 +275,11 @@ int DSA_print_fp(FILE *bp, const DSA *x, int off);
DH *DSA_dup_DH(const DSA *r);
#endif
+#ifdef OPENSSL_FIPS
+int FIPS_dsa_sig_encode(unsigned char *out, DSA_SIG *sig);
+int FIPS_dsa_sig_decode(DSA_SIG *sig, const unsigned char *in, int inlen);
+#endif
+
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
@@ -258,29 +289,36 @@ void ERR_load_DSA_strings(void);
/* Error codes for the DSA functions. */
/* Function codes. */
-#define DSA_F_D2I_DSA_SIG 110
-#define DSA_F_DSAPARAMS_PRINT 100
-#define DSA_F_DSAPARAMS_PRINT_FP 101
-#define DSA_F_DSA_DO_SIGN 112
-#define DSA_F_DSA_DO_VERIFY 113
-#define DSA_F_DSA_NEW_METHOD 103
-#define DSA_F_DSA_PRINT 104
-#define DSA_F_DSA_PRINT_FP 105
-#define DSA_F_DSA_SIGN 106
-#define DSA_F_DSA_SIGN_SETUP 107
-#define DSA_F_DSA_SIG_NEW 109
-#define DSA_F_DSA_VERIFY 108
-#define DSA_F_I2D_DSA_SIG 111
-#define DSA_F_SIG_CB 114
+#define DSA_F_D2I_DSA_SIG 110
+#define DSA_F_DSAPARAMS_PRINT 100
+#define DSA_F_DSAPARAMS_PRINT_FP 101
+#define DSA_F_DSA_BUILTIN_KEYGEN 119
+#define DSA_F_DSA_BUILTIN_PARAMGEN 118
+#define DSA_F_DSA_DO_SIGN 112
+#define DSA_F_DSA_DO_VERIFY 113
+#define DSA_F_DSA_GENERATE_PARAMETERS 117
+#define DSA_F_DSA_NEW_METHOD 103
+#define DSA_F_DSA_PRINT 104
+#define DSA_F_DSA_PRINT_FP 105
+#define DSA_F_DSA_SET_DEFAULT_METHOD 115
+#define DSA_F_DSA_SET_METHOD 116
+#define DSA_F_DSA_SIGN 106
+#define DSA_F_DSA_SIGN_SETUP 107
+#define DSA_F_DSA_SIG_NEW 109
+#define DSA_F_DSA_VERIFY 108
+#define DSA_F_I2D_DSA_SIG 111
+#define DSA_F_SIG_CB 114
/* Reason codes. */
-#define DSA_R_BAD_Q_VALUE 102
-#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
-#define DSA_R_MISSING_PARAMETERS 101
-#define DSA_R_MODULUS_TOO_LARGE 103
+#define DSA_R_BAD_Q_VALUE 102
+#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
+#define DSA_R_KEY_SIZE_TOO_SMALL 106
+#define DSA_R_MISSING_PARAMETERS 101
+#define DSA_R_MODULUS_TOO_LARGE 103
+#define DSA_R_NON_FIPS_METHOD 104
+#define DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 105
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/dtls1.h b/dep/include/openssl/dtls1.h
index dbeceab9453..f159d371102 100644
--- a/dep/include/openssl/dtls1.h
+++ b/dep/include/openssl/dtls1.h
@@ -1,7 +1,7 @@
/* ssl/dtls1.h */
-/*
+/*
* DTLS implementation written by Nagendra Modadugu
- * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
*/
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
@@ -11,7 +11,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -57,8 +57,8 @@
*
*/
-#ifndef HEADER_DTLS1_H
-#define HEADER_DTLS1_H
+#ifndef HEADER_DTLS1_H
+#define HEADER_DTLS1_H
#include <openssl/buffer.h>
#include <openssl/pqueue.h>
@@ -67,11 +67,13 @@
extern "C" {
#endif
-#define DTLS1_VERSION 0x0100
-#define DTLS1_VERSION_MAJOR 0x01
-#define DTLS1_VERSION_MINOR 0x00
+#define DTLS1_VERSION 0xFEFF
+#define DTLS1_BAD_VER 0x0100
+#if 0
+/* this alert description is not specified anywhere... */
#define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110
+#endif
/* lengths of messages */
#define DTLS1_COOKIE_LENGTH 32
@@ -83,120 +85,124 @@ extern "C" {
#define DTLS1_HM_BAD_FRAGMENT -2
#define DTLS1_HM_FRAGMENT_RETRY -3
-#define DTLS1_CCS_HEADER_LENGTH 3
+#define DTLS1_CCS_HEADER_LENGTH 1
+#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
#define DTLS1_AL_HEADER_LENGTH 7
+#else
+#define DTLS1_AL_HEADER_LENGTH 2
+#endif
typedef struct dtls1_bitmap_st
- {
- PQ_64BIT map;
- unsigned long length; /* sizeof the bitmap in bits */
- PQ_64BIT max_seq_num; /* max record number seen so far */
- } DTLS1_BITMAP;
+ {
+ PQ_64BIT map;
+ unsigned long length; /* sizeof the bitmap in bits */
+ PQ_64BIT max_seq_num; /* max record number seen so far */
+ } DTLS1_BITMAP;
struct hm_header_st
- {
- unsigned char type;
- unsigned long msg_len;
- unsigned short seq;
- unsigned long frag_off;
- unsigned long frag_len;
- unsigned int is_ccs;
- };
+ {
+ unsigned char type;
+ unsigned long msg_len;
+ unsigned short seq;
+ unsigned long frag_off;
+ unsigned long frag_len;
+ unsigned int is_ccs;
+ };
struct ccs_header_st
- {
- unsigned char type;
- unsigned short seq;
- };
+ {
+ unsigned char type;
+ unsigned short seq;
+ };
struct dtls1_timeout_st
- {
- /* Number of read timeouts so far */
- unsigned int read_timeouts;
-
- /* Number of write timeouts so far */
- unsigned int write_timeouts;
-
- /* Number of alerts received so far */
- unsigned int num_alerts;
- };
+ {
+ /* Number of read timeouts so far */
+ unsigned int read_timeouts;
+
+ /* Number of write timeouts so far */
+ unsigned int write_timeouts;
+
+ /* Number of alerts received so far */
+ unsigned int num_alerts;
+ };
typedef struct record_pqueue_st
- {
- unsigned short epoch;
- pqueue q;
- } record_pqueue;
+ {
+ unsigned short epoch;
+ pqueue q;
+ } record_pqueue;
typedef struct hm_fragment_st
- {
- struct hm_header_st msg_header;
- unsigned char *fragment;
- } hm_fragment;
+ {
+ struct hm_header_st msg_header;
+ unsigned char *fragment;
+ } hm_fragment;
typedef struct dtls1_state_st
- {
- unsigned int send_cookie;
- unsigned char cookie[DTLS1_COOKIE_LENGTH];
- unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH];
- unsigned int cookie_len;
-
- /*
- * The current data and handshake epoch. This is initially
- * undefined, and starts at zero once the initial handshake is
- * completed
- */
- unsigned short r_epoch;
- unsigned short w_epoch;
+ {
+ unsigned int send_cookie;
+ unsigned char cookie[DTLS1_COOKIE_LENGTH];
+ unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH];
+ unsigned int cookie_len;
- /* records being received in the current epoch */
- DTLS1_BITMAP bitmap;
+ /*
+ * The current data and handshake epoch. This is initially
+ * undefined, and starts at zero once the initial handshake is
+ * completed
+ */
+ unsigned short r_epoch;
+ unsigned short w_epoch;
- /* renegotiation starts a new set of sequence numbers */
- DTLS1_BITMAP next_bitmap;
+ /* records being received in the current epoch */
+ DTLS1_BITMAP bitmap;
- /* handshake message numbers */
- unsigned short handshake_write_seq;
- unsigned short next_handshake_write_seq;
+ /* renegotiation starts a new set of sequence numbers */
+ DTLS1_BITMAP next_bitmap;
- unsigned short handshake_read_seq;
+ /* handshake message numbers */
+ unsigned short handshake_write_seq;
+ unsigned short next_handshake_write_seq;
- /* Received handshake records (processed and unprocessed) */
- record_pqueue unprocessed_rcds;
- record_pqueue processed_rcds;
+ unsigned short handshake_read_seq;
- /* Buffered handshake messages */
- pqueue buffered_messages;
+ /* Received handshake records (processed and unprocessed) */
+ record_pqueue unprocessed_rcds;
+ record_pqueue processed_rcds;
- /* Buffered (sent) handshake records */
- pqueue sent_messages;
+ /* Buffered handshake messages */
+ pqueue buffered_messages;
- unsigned int mtu; /* max wire packet size */
+ /* Buffered (sent) handshake records */
+ pqueue sent_messages;
- struct hm_header_st w_msg_hdr;
- struct hm_header_st r_msg_hdr;
+ unsigned int mtu; /* max wire packet size */
- struct dtls1_timeout_st timeout;
+ struct hm_header_st w_msg_hdr;
+ struct hm_header_st r_msg_hdr;
- /* storage for Alert/Handshake protocol data received but not
- * yet processed by ssl3_read_bytes: */
- unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH];
- unsigned int alert_fragment_len;
- unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH];
- unsigned int handshake_fragment_len;
+ struct dtls1_timeout_st timeout;
+
+ /* storage for Alert/Handshake protocol data received but not
+ * yet processed by ssl3_read_bytes: */
+ unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH];
+ unsigned int handshake_fragment_len;
- unsigned int retransmitting;
+ unsigned int retransmitting;
- } DTLS1_STATE;
+ } DTLS1_STATE;
typedef struct dtls1_record_data_st
- {
- unsigned char *packet;
- unsigned int packet_length;
- SSL3_BUFFER rbuf;
- SSL3_RECORD rrec;
- } DTLS1_RECORD_DATA;
+ {
+ unsigned char *packet;
+ unsigned int packet_length;
+ SSL3_BUFFER rbuf;
+ SSL3_RECORD rrec;
+ } DTLS1_RECORD_DATA;
/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
@@ -210,4 +216,3 @@ typedef struct dtls1_record_data_st
#endif
#endif
-
diff --git a/dep/include/openssl/ec.h b/dep/include/openssl/ec.h
index 6952d9739a1..8bc2a235b1a 100644
--- a/dep/include/openssl/ec.h
+++ b/dep/include/openssl/ec.h
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -58,13 +58,13 @@
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
- * Portions of the attached software ("Contribution") are developed by
+ * Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the OpenSSL open source
* license provided above.
*
- * The elliptic curve binary polynomial software is originally written by
+ * The elliptic curve binary polynomial software is originally written by
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
*
*/
@@ -98,25 +98,25 @@ extern "C" {
#endif
typedef enum {
- /* values as defined in X9.62 (ECDSA) and elsewhere */
- POINT_CONVERSION_COMPRESSED = 2,
- POINT_CONVERSION_UNCOMPRESSED = 4,
- POINT_CONVERSION_HYBRID = 6
+ /* values as defined in X9.62 (ECDSA) and elsewhere */
+ POINT_CONVERSION_COMPRESSED = 2,
+ POINT_CONVERSION_UNCOMPRESSED = 4,
+ POINT_CONVERSION_HYBRID = 6
} point_conversion_form_t;
typedef struct ec_method_st EC_METHOD;
typedef struct ec_group_st
- /*
- EC_METHOD *meth;
- -- field definition
- -- curve coefficients
- -- optional generator with associated information (order, cofactor)
- -- optional extra data (precomputed table for fast computation of multiples of generator)
- -- ASN1 stuff
- */
- EC_GROUP;
+ /*
+ EC_METHOD *meth;
+ -- field definition
+ -- curve coefficients
+ -- optional generator with associated information (order, cofactor)
+ -- optional extra data (precomputed table for fast computation of multiples of generator)
+ -- ASN1 stuff
+ */
+ EC_GROUP;
typedef struct ec_point_st EC_POINT;
@@ -186,13 +186,13 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM
* specified by a curve name (in form of a NID) */
EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
/* handling of internal curves */
-typedef struct {
- int nid;
- const char *comment;
- } EC_builtin_curve;
-/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number
- * of all available curves or zero if a error occurred.
- * In case r ist not zero nitems EC_builtin_curve structures
+typedef struct {
+ int nid;
+ const char *comment;
+ } EC_builtin_curve;
+/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number
+ * of all available curves or zero if a error occurred.
+ * In case r ist not zero nitems EC_builtin_curve structures
* are filled with the data of the first nitems internal groups */
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
@@ -204,27 +204,27 @@ void EC_POINT_free(EC_POINT *);
void EC_POINT_clear_free(EC_POINT *);
int EC_POINT_copy(EC_POINT *, const EC_POINT *);
EC_POINT *EC_POINT_dup(const EC_POINT *, const EC_GROUP *);
-
+
const EC_METHOD *EC_POINT_method_of(const EC_POINT *);
int EC_POINT_set_to_infinity(const EC_GROUP *, EC_POINT *);
int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *);
int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
- BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
+ BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *);
int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, const BIGNUM *y, BN_CTX *);
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *);
int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *,
- BIGNUM *x, BIGNUM *y, BN_CTX *);
+ BIGNUM *x, BIGNUM *y, BN_CTX *);
int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, int y_bit, BN_CTX *);
+ const BIGNUM *x, int y_bit, BN_CTX *);
int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, const BIGNUM *y, BN_CTX *);
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *);
int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *,
- BIGNUM *x, BIGNUM *y, BN_CTX *);
+ BIGNUM *x, BIGNUM *y, BN_CTX *);
int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *, EC_POINT *,
- const BIGNUM *x, int y_bit, BN_CTX *);
+ const BIGNUM *x, int y_bit, BN_CTX *);
size_t EC_POINT_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form,
unsigned char *buf, size_t len, BN_CTX *);
@@ -233,13 +233,13 @@ int EC_POINT_oct2point(const EC_GROUP *, EC_POINT *,
/* other interfaces to point2oct/oct2point: */
BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
- point_conversion_form_t form, BIGNUM *, BN_CTX *);
+ point_conversion_form_t form, BIGNUM *, BN_CTX *);
EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
- EC_POINT *, BN_CTX *);
+ EC_POINT *, BN_CTX *);
char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
- point_conversion_form_t form, BN_CTX *);
+ point_conversion_form_t form, BN_CTX *);
EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
- EC_POINT *, BN_CTX *);
+ EC_POINT *, BN_CTX *);
int EC_POINT_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *);
int EC_POINT_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *);
@@ -269,10 +269,10 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *);
* used to represent the field elements */
int EC_GROUP_get_basis_type(const EC_GROUP *);
int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
-int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
- unsigned int *k2, unsigned int *k3);
+int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
+ unsigned int *k2, unsigned int *k3);
-#define OPENSSL_EC_NAMED_CURVE 0x001
+#define OPENSSL_EC_NAMED_CURVE 0x001
typedef struct ecpk_parameters_st ECPKPARAMETERS;
@@ -284,7 +284,7 @@ int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
(char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
- (unsigned char *)(x))
+ (unsigned char *)(x))
#ifndef OPENSSL_NO_BIO
int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
@@ -297,8 +297,8 @@ int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
typedef struct ec_key_st EC_KEY;
/* some values for the encoding_flag */
-#define EC_PKEY_NO_PARAMETERS 0x001
-#define EC_PKEY_NO_PUBKEY 0x002
+#define EC_PKEY_NO_PARAMETERS 0x001
+#define EC_PKEY_NO_PUBKEY 0x002
EC_KEY *EC_KEY_new(void);
EC_KEY *EC_KEY_new_by_curve_name(int nid);
@@ -319,10 +319,10 @@ void EC_KEY_set_enc_flags(EC_KEY *, unsigned int);
point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *);
void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t);
/* functions to set/get method specific data */
-void *EC_KEY_get_key_method_data(EC_KEY *,
- void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
+void *EC_KEY_get_key_method_data(EC_KEY *,
+ void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
void EC_KEY_insert_key_method_data(EC_KEY *, void *data,
- void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
+ void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *));
/* wrapper functions for the underlying EC_GROUP object */
void EC_KEY_set_asn1_flag(EC_KEY *, int);
int EC_KEY_precompute_mult(EC_KEY *, BN_CTX *ctx);
@@ -344,12 +344,12 @@ EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len);
int i2o_ECPublicKey(EC_KEY *a, unsigned char **out);
#ifndef OPENSSL_NO_BIO
-int ECParameters_print(BIO *bp, const EC_KEY *x);
-int EC_KEY_print(BIO *bp, const EC_KEY *x, int off);
+int ECParameters_print(BIO *bp, const EC_KEY *x);
+int EC_KEY_print(BIO *bp, const EC_KEY *x, int off);
#endif
#ifndef OPENSSL_NO_FP_API
-int ECParameters_print_fp(FILE *fp, const EC_KEY *x);
-int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off);
+int ECParameters_print_fp(FILE *fp, const EC_KEY *x);
+int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off);
#endif
#define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
@@ -371,156 +371,156 @@ void ERR_load_EC_strings(void);
/* Error codes for the EC functions. */
/* Function codes. */
-#define EC_F_COMPUTE_WNAF 143
-#define EC_F_D2I_ECPARAMETERS 144
-#define EC_F_D2I_ECPKPARAMETERS 145
-#define EC_F_D2I_ECPRIVATEKEY 146
-#define EC_F_ECPARAMETERS_PRINT 147
-#define EC_F_ECPARAMETERS_PRINT_FP 148
-#define EC_F_ECPKPARAMETERS_PRINT 149
-#define EC_F_ECPKPARAMETERS_PRINT_FP 150
-#define EC_F_ECP_NIST_MOD_192 203
-#define EC_F_ECP_NIST_MOD_224 204
-#define EC_F_ECP_NIST_MOD_256 205
-#define EC_F_ECP_NIST_MOD_521 206
-#define EC_F_EC_ASN1_GROUP2CURVE 153
-#define EC_F_EC_ASN1_GROUP2FIELDID 154
-#define EC_F_EC_ASN1_GROUP2PARAMETERS 155
-#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
-#define EC_F_EC_ASN1_PARAMETERS2GROUP 157
-#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
-#define EC_F_EC_EX_DATA_SET_DATA 211
-#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
-#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
-#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
-#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
-#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
+#define EC_F_COMPUTE_WNAF 143
+#define EC_F_D2I_ECPARAMETERS 144
+#define EC_F_D2I_ECPKPARAMETERS 145
+#define EC_F_D2I_ECPRIVATEKEY 146
+#define EC_F_ECPARAMETERS_PRINT 147
+#define EC_F_ECPARAMETERS_PRINT_FP 148
+#define EC_F_ECPKPARAMETERS_PRINT 149
+#define EC_F_ECPKPARAMETERS_PRINT_FP 150
+#define EC_F_ECP_NIST_MOD_192 203
+#define EC_F_ECP_NIST_MOD_224 204
+#define EC_F_ECP_NIST_MOD_256 205
+#define EC_F_ECP_NIST_MOD_521 206
+#define EC_F_EC_ASN1_GROUP2CURVE 153
+#define EC_F_EC_ASN1_GROUP2FIELDID 154
+#define EC_F_EC_ASN1_GROUP2PARAMETERS 155
+#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
+#define EC_F_EC_ASN1_PARAMETERS2GROUP 157
+#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
+#define EC_F_EC_EX_DATA_SET_DATA 211
+#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
+#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
+#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
+#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
+#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
-#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
-#define EC_F_EC_GFP_MONT_FIELD_DECODE 133
-#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
-#define EC_F_EC_GFP_MONT_FIELD_MUL 131
-#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
-#define EC_F_EC_GFP_MONT_FIELD_SQR 132
-#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
-#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
-#define EC_F_EC_GFP_NIST_FIELD_MUL 200
-#define EC_F_EC_GFP_NIST_FIELD_SQR 201
-#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
-#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
-#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
-#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
-#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
-#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
-#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
-#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
-#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
-#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
+#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
+#define EC_F_EC_GFP_MONT_FIELD_DECODE 133
+#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
+#define EC_F_EC_GFP_MONT_FIELD_MUL 131
+#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
+#define EC_F_EC_GFP_MONT_FIELD_SQR 132
+#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
+#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
+#define EC_F_EC_GFP_NIST_FIELD_MUL 200
+#define EC_F_EC_GFP_NIST_FIELD_SQR 201
+#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
+#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
+#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
+#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
+#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
+#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
+#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
+#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
+#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
+#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
-#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
+#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
-#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
+#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
-#define EC_F_EC_GROUP_CHECK 170
-#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
-#define EC_F_EC_GROUP_COPY 106
-#define EC_F_EC_GROUP_GET0_GENERATOR 139
-#define EC_F_EC_GROUP_GET_COFACTOR 140
-#define EC_F_EC_GROUP_GET_CURVE_GF2M 172
-#define EC_F_EC_GROUP_GET_CURVE_GFP 130
-#define EC_F_EC_GROUP_GET_DEGREE 173
-#define EC_F_EC_GROUP_GET_ORDER 141
-#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
-#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
-#define EC_F_EC_GROUP_NEW 108
-#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
-#define EC_F_EC_GROUP_NEW_FROM_DATA 175
-#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
-#define EC_F_EC_GROUP_SET_CURVE_GF2M 176
-#define EC_F_EC_GROUP_SET_CURVE_GFP 109
-#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
-#define EC_F_EC_GROUP_SET_GENERATOR 111
-#define EC_F_EC_KEY_CHECK_KEY 177
-#define EC_F_EC_KEY_COPY 178
-#define EC_F_EC_KEY_GENERATE_KEY 179
-#define EC_F_EC_KEY_NEW 182
-#define EC_F_EC_KEY_PRINT 180
-#define EC_F_EC_KEY_PRINT_FP 181
-#define EC_F_EC_POINTS_MAKE_AFFINE 136
-#define EC_F_EC_POINTS_MUL 138
-#define EC_F_EC_POINT_ADD 112
-#define EC_F_EC_POINT_CMP 113
-#define EC_F_EC_POINT_COPY 114
-#define EC_F_EC_POINT_DBL 115
-#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
-#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
-#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
-#define EC_F_EC_POINT_INVERT 210
-#define EC_F_EC_POINT_IS_AT_INFINITY 118
-#define EC_F_EC_POINT_IS_ON_CURVE 119
-#define EC_F_EC_POINT_MAKE_AFFINE 120
-#define EC_F_EC_POINT_MUL 184
-#define EC_F_EC_POINT_NEW 121
-#define EC_F_EC_POINT_OCT2POINT 122
-#define EC_F_EC_POINT_POINT2OCT 123
-#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
-#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
-#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
-#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
-#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
-#define EC_F_EC_POINT_SET_TO_INFINITY 127
-#define EC_F_EC_PRE_COMP_DUP 207
-#define EC_F_EC_WNAF_MUL 187
-#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
-#define EC_F_I2D_ECPARAMETERS 190
-#define EC_F_I2D_ECPKPARAMETERS 191
-#define EC_F_I2D_ECPRIVATEKEY 192
-#define EC_F_I2O_ECPUBLICKEY 151
-#define EC_F_O2I_ECPUBLICKEY 152
+#define EC_F_EC_GROUP_CHECK 170
+#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
+#define EC_F_EC_GROUP_COPY 106
+#define EC_F_EC_GROUP_GET0_GENERATOR 139
+#define EC_F_EC_GROUP_GET_COFACTOR 140
+#define EC_F_EC_GROUP_GET_CURVE_GF2M 172
+#define EC_F_EC_GROUP_GET_CURVE_GFP 130
+#define EC_F_EC_GROUP_GET_DEGREE 173
+#define EC_F_EC_GROUP_GET_ORDER 141
+#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
+#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
+#define EC_F_EC_GROUP_NEW 108
+#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
+#define EC_F_EC_GROUP_NEW_FROM_DATA 175
+#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
+#define EC_F_EC_GROUP_SET_CURVE_GF2M 176
+#define EC_F_EC_GROUP_SET_CURVE_GFP 109
+#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
+#define EC_F_EC_GROUP_SET_GENERATOR 111
+#define EC_F_EC_KEY_CHECK_KEY 177
+#define EC_F_EC_KEY_COPY 178
+#define EC_F_EC_KEY_GENERATE_KEY 179
+#define EC_F_EC_KEY_NEW 182
+#define EC_F_EC_KEY_PRINT 180
+#define EC_F_EC_KEY_PRINT_FP 181
+#define EC_F_EC_POINTS_MAKE_AFFINE 136
+#define EC_F_EC_POINTS_MUL 138
+#define EC_F_EC_POINT_ADD 112
+#define EC_F_EC_POINT_CMP 113
+#define EC_F_EC_POINT_COPY 114
+#define EC_F_EC_POINT_DBL 115
+#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
+#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
+#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
+#define EC_F_EC_POINT_INVERT 210
+#define EC_F_EC_POINT_IS_AT_INFINITY 118
+#define EC_F_EC_POINT_IS_ON_CURVE 119
+#define EC_F_EC_POINT_MAKE_AFFINE 120
+#define EC_F_EC_POINT_MUL 184
+#define EC_F_EC_POINT_NEW 121
+#define EC_F_EC_POINT_OCT2POINT 122
+#define EC_F_EC_POINT_POINT2OCT 123
+#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
+#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
+#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
+#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
+#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
+#define EC_F_EC_POINT_SET_TO_INFINITY 127
+#define EC_F_EC_PRE_COMP_DUP 207
+#define EC_F_EC_PRE_COMP_NEW 196
+#define EC_F_EC_WNAF_MUL 187
+#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
+#define EC_F_I2D_ECPARAMETERS 190
+#define EC_F_I2D_ECPKPARAMETERS 191
+#define EC_F_I2D_ECPRIVATEKEY 192
+#define EC_F_I2O_ECPUBLICKEY 151
+#define EC_F_O2I_ECPUBLICKEY 152
/* Reason codes. */
-#define EC_R_ASN1_ERROR 115
-#define EC_R_ASN1_UNKNOWN_FIELD 116
-#define EC_R_BUFFER_TOO_SMALL 100
-#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
-#define EC_R_DISCRIMINANT_IS_ZERO 118
-#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
-#define EC_R_FIELD_TOO_LARGE 138
-#define EC_R_GROUP2PKPARAMETERS_FAILURE 120
-#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
-#define EC_R_INCOMPATIBLE_OBJECTS 101
-#define EC_R_INVALID_ARGUMENT 112
-#define EC_R_INVALID_COMPRESSED_POINT 110
-#define EC_R_INVALID_COMPRESSION_BIT 109
-#define EC_R_INVALID_ENCODING 102
-#define EC_R_INVALID_FIELD 103
-#define EC_R_INVALID_FORM 104
-#define EC_R_INVALID_GROUP_ORDER 122
-#define EC_R_INVALID_PENTANOMIAL_BASIS 132
-#define EC_R_INVALID_PRIVATE_KEY 123
-#define EC_R_INVALID_TRINOMIAL_BASIS 137
-#define EC_R_MISSING_PARAMETERS 124
-#define EC_R_MISSING_PRIVATE_KEY 125
-#define EC_R_NOT_A_NIST_PRIME 135
-#define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136
-#define EC_R_NOT_IMPLEMENTED 126
-#define EC_R_NOT_INITIALIZED 111
-#define EC_R_NO_FIELD_MOD 133
-#define EC_R_PASSED_NULL_PARAMETER 134
-#define EC_R_PKPARAMETERS2GROUP_FAILURE 127
-#define EC_R_POINT_AT_INFINITY 106
-#define EC_R_POINT_IS_NOT_ON_CURVE 107
-#define EC_R_SLOT_FULL 108
-#define EC_R_UNDEFINED_GENERATOR 113
-#define EC_R_UNDEFINED_ORDER 128
-#define EC_R_UNKNOWN_GROUP 129
-#define EC_R_UNKNOWN_ORDER 114
-#define EC_R_UNSUPPORTED_FIELD 131
-#define EC_R_WRONG_ORDER 130
+#define EC_R_ASN1_ERROR 115
+#define EC_R_ASN1_UNKNOWN_FIELD 116
+#define EC_R_BUFFER_TOO_SMALL 100
+#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
+#define EC_R_DISCRIMINANT_IS_ZERO 118
+#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
+#define EC_R_FIELD_TOO_LARGE 138
+#define EC_R_GROUP2PKPARAMETERS_FAILURE 120
+#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
+#define EC_R_INCOMPATIBLE_OBJECTS 101
+#define EC_R_INVALID_ARGUMENT 112
+#define EC_R_INVALID_COMPRESSED_POINT 110
+#define EC_R_INVALID_COMPRESSION_BIT 109
+#define EC_R_INVALID_ENCODING 102
+#define EC_R_INVALID_FIELD 103
+#define EC_R_INVALID_FORM 104
+#define EC_R_INVALID_GROUP_ORDER 122
+#define EC_R_INVALID_PENTANOMIAL_BASIS 132
+#define EC_R_INVALID_PRIVATE_KEY 123
+#define EC_R_INVALID_TRINOMIAL_BASIS 137
+#define EC_R_MISSING_PARAMETERS 124
+#define EC_R_MISSING_PRIVATE_KEY 125
+#define EC_R_NOT_A_NIST_PRIME 135
+#define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136
+#define EC_R_NOT_IMPLEMENTED 126
+#define EC_R_NOT_INITIALIZED 111
+#define EC_R_NO_FIELD_MOD 133
+#define EC_R_PASSED_NULL_PARAMETER 134
+#define EC_R_PKPARAMETERS2GROUP_FAILURE 127
+#define EC_R_POINT_AT_INFINITY 106
+#define EC_R_POINT_IS_NOT_ON_CURVE 107
+#define EC_R_SLOT_FULL 108
+#define EC_R_UNDEFINED_GENERATOR 113
+#define EC_R_UNDEFINED_ORDER 128
+#define EC_R_UNKNOWN_GROUP 129
+#define EC_R_UNKNOWN_ORDER 114
+#define EC_R_UNSUPPORTED_FIELD 131
+#define EC_R_WRONG_ORDER 130
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/engine.h b/dep/include/openssl/engine.h
index a0dc2d08fd4..f503595eceb 100644
--- a/dep/include/openssl/engine.h
+++ b/dep/include/openssl/engine.h
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -57,7 +57,7 @@
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECDH support in OpenSSL originally developed by
+ * ECDH support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
@@ -93,6 +93,8 @@
#include <openssl/err.h>
#endif
+#include <openssl/x509.h>
+
#include <openssl/ossl_typ.h>
#include <openssl/symhacks.h>
@@ -102,32 +104,32 @@ extern "C" {
/* These flags are used to control combinations of algorithm (methods)
* by bitwise "OR"ing. */
-#define ENGINE_METHOD_RSA (unsigned int)0x0001
-#define ENGINE_METHOD_DSA (unsigned int)0x0002
-#define ENGINE_METHOD_DH (unsigned int)0x0004
-#define ENGINE_METHOD_RAND (unsigned int)0x0008
-#define ENGINE_METHOD_ECDH (unsigned int)0x0010
-#define ENGINE_METHOD_ECDSA (unsigned int)0x0020
-#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
-#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
-#define ENGINE_METHOD_STORE (unsigned int)0x0100
+#define ENGINE_METHOD_RSA (unsigned int)0x0001
+#define ENGINE_METHOD_DSA (unsigned int)0x0002
+#define ENGINE_METHOD_DH (unsigned int)0x0004
+#define ENGINE_METHOD_RAND (unsigned int)0x0008
+#define ENGINE_METHOD_ECDH (unsigned int)0x0010
+#define ENGINE_METHOD_ECDSA (unsigned int)0x0020
+#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
+#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
+#define ENGINE_METHOD_STORE (unsigned int)0x0100
/* Obvious all-or-nothing cases. */
-#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
-#define ENGINE_METHOD_NONE (unsigned int)0x0000
+#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
+#define ENGINE_METHOD_NONE (unsigned int)0x0000
/* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
* internally to control registration of ENGINE implementations, and can be set
* by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
* initialise registered ENGINEs if they are not already initialised. */
-#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
+#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
/* ENGINE flags that can be set by ENGINE_set_flags(). */
-/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ /* Not used */
+/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ /* Not used */
/* This flag is for ENGINEs that wish to handle the various 'CMD'-related
* control commands on their own. Without this flag, ENGINE_ctrl() handles these
* control commands on behalf of the ENGINE using their "cmd_defns" data. */
-#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
+#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
/* This flag is for ENGINEs who return new duplicate structures when found via
* "ENGINE_by_id()". When an ENGINE must store state (eg. if ENGINE_ctrl()
@@ -136,7 +138,7 @@ extern "C" {
* to obtain the ENGINE will result in it being copied into a new structure.
* Normally, ENGINEs don't declare this flag so ENGINE_by_id() just increments
* the existing ENGINE's structural reference count. */
-#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
+#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
/* ENGINEs can support their own command types, and these flags are used in
* ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each
@@ -149,17 +151,17 @@ extern "C" {
* ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). */
/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
-#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
+#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
/* accepts string input (cast from 'void*' to 'const char *', 4th parameter to
* ENGINE_ctrl) */
-#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
+#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
/* Indicates that the control command takes *no* input. Ie. the control command
* is unparameterised. */
-#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
+#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
/* Indicates that the control command is internal. This control command won't
* be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
* function. */
-#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
+#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
/* NB: These 3 control commands are deprecated and should not be used. ENGINEs
* relying on these commands should compile conditional support for
@@ -174,21 +176,21 @@ extern "C" {
* All command numbers are shared between all engines, even if some don't
* make sense to some engines. In such a case, they do nothing but return
* the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */
-#define ENGINE_CTRL_SET_LOGSTREAM 1
-#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
-#define ENGINE_CTRL_HUP 3 /* Close and reinitialise any
- handles/connections etc. */
+#define ENGINE_CTRL_SET_LOGSTREAM 1
+#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
+#define ENGINE_CTRL_HUP 3 /* Close and reinitialise any
+ handles/connections etc. */
#define ENGINE_CTRL_SET_USER_INTERFACE 4 /* Alternative to callback */
#define ENGINE_CTRL_SET_CALLBACK_DATA 5 /* User-specific data, used
- when calling the password
- callback and the user
- interface */
-#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, given
- a string that represents a
- file name or so */
-#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given
- section in the already loaded
- configuration */
+ when calling the password
+ callback and the user
+ interface */
+#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, given
+ a string that represents a
+ file name or so */
+#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given
+ section in the already loaded
+ configuration */
/* These control commands allow an application to deal with an arbitrary engine
* in a dynamic way. Warn: Negative return values indicate errors FOR THESE
@@ -207,35 +209,35 @@ extern "C" {
* all the remaining control commands will return failure, so it is worth
* checking this first if the caller is trying to "discover" the engine's
* capabilities and doesn't want errors generated unnecessarily. */
-#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
+#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
/* Returns a positive command number for the first command supported by the
* engine. Returns zero if no ctrl commands are supported. */
-#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
+#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
/* The 'long' argument specifies a command implemented by the engine, and the
* return value is the next command supported, or zero if there are no more. */
-#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
+#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
/* The 'void*' argument is a command name (cast from 'const char *'), and the
* return value is the command that corresponds to it. */
-#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
+#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
/* The next two allow a command to be converted into its corresponding string
* form. In each case, the 'long' argument supplies the command. In the NAME_LEN
* case, the return value is the length of the command name (not counting a
* trailing EOL). In the NAME case, the 'void*' argument must be a string buffer
* large enough, and it will be populated with the name of the command (WITH a
* trailing EOL). */
-#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
-#define ENGINE_CTRL_GET_NAME_FROM_CMD 15
+#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
+#define ENGINE_CTRL_GET_NAME_FROM_CMD 15
/* The next two are similar but give a "short description" of a command. */
-#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
-#define ENGINE_CTRL_GET_DESC_FROM_CMD 17
+#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
+#define ENGINE_CTRL_GET_DESC_FROM_CMD 17
/* With this command, the return value is the OR'd combination of
* ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
* engine-specific ctrl command expects. */
-#define ENGINE_CTRL_GET_CMD_FLAGS 18
+#define ENGINE_CTRL_GET_CMD_FLAGS 18
/* ENGINE implementations should start the numbering of their own control
* commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */
-#define ENGINE_CMD_BASE 200
+#define ENGINE_CMD_BASE 200
/* NB: These 2 nCipher "chil" control commands are deprecated, and their
* functionality is now available through ENGINE-specific control commands
@@ -244,14 +246,14 @@ extern "C" {
* are removed. */
/* Flags specific to the nCipher "chil" engine */
-#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
- /* Depending on the value of the (long)i argument, this sets or
- * unsets the SimpleForkCheck flag in the CHIL API to enable or
- * disable checking and workarounds for applications that fork().
- */
-#define ENGINE_CTRL_CHIL_NO_LOCKING 101
- /* This prevents the initialisation function from providing mutex
- * callbacks to the nCipher library. */
+#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
+ /* Depending on the value of the (long)i argument, this sets or
+ * unsets the SimpleForkCheck flag in the CHIL API to enable or
+ * disable checking and workarounds for applications that fork().
+ */
+#define ENGINE_CTRL_CHIL_NO_LOCKING 101
+ /* This prevents the initialisation function from providing mutex
+ * callbacks to the nCipher library. */
/* If an ENGINE supports its own specific control commands and wishes the
* framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its
@@ -262,12 +264,12 @@ extern "C" {
* "null-terminated" means that the last ENGINE_CMD_DEFN element has cmd_num set
* to zero and/or cmd_name set to NULL. */
typedef struct ENGINE_CMD_DEFN_st
- {
- unsigned int cmd_num; /* The command number */
- const char *cmd_name; /* The command name itself */
- const char *cmd_desc; /* A short description of the command */
- unsigned int cmd_flags; /* The input the command expects */
- } ENGINE_CMD_DEFN;
+ {
+ unsigned int cmd_num; /* The command number */
+ const char *cmd_name; /* The command name itself */
+ const char *cmd_desc; /* A short description of the command */
+ unsigned int cmd_flags; /* The input the command expects */
+ } ENGINE_CMD_DEFN;
/* Generic function pointer */
typedef int (*ENGINE_GEN_FUNC_PTR)(void);
@@ -277,7 +279,10 @@ typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *);
typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void));
/* Generic load_key function pointer */
typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
- UI_METHOD *ui_method, void *callback_data);
+ UI_METHOD *ui_method, void *callback_data);
+typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl,
+ STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey,
+ STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data);
/* These callback types are for an ENGINE's handler for cipher and digest logic.
* These handlers have these prototypes;
* int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
@@ -334,6 +339,9 @@ void ENGINE_load_ubsec(void);
void ENGINE_load_cryptodev(void);
void ENGINE_load_padlock(void);
void ENGINE_load_builtin_engines(void);
+#ifndef OPENSSL_NO_CAPIENG
+void ENGINE_load_capi(void);
+#endif
/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
* "registry" handling. */
@@ -433,7 +441,7 @@ int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
* compliant ENGINE-based applications can work consistently with the same
* configuration for the same ENGINE-enabled devices, across applications. */
int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
- int cmd_optional);
+ int cmd_optional);
/* These functions are useful for manufacturing new ENGINE structures. They
* don't address reference counting at all - one uses them to populate an ENGINE
@@ -459,13 +467,15 @@ int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
+int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
+ ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
int ENGINE_set_flags(ENGINE *e, int flags);
int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
/* These functions allow control over any per-structure ENGINE data. */
int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
void *ENGINE_get_ex_data(const ENGINE *e, int idx);
@@ -494,6 +504,7 @@ ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
+ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
@@ -526,9 +537,13 @@ int ENGINE_finish(ENGINE *e);
* location, handled by the engine. The storage may be on a card or
* whatever. */
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
- UI_METHOD *ui_method, void *callback_data);
+ UI_METHOD *ui_method, void *callback_data);
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
- UI_METHOD *ui_method, void *callback_data);
+ UI_METHOD *ui_method, void *callback_data);
+int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
+ STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey,
+ STACK_OF(X509) **pother,
+ UI_METHOD *ui_method, void *callback_data);
/* This returns a pointer for the current ENGINE structure that
* is (by default) performing any RSA operations. The value returned
@@ -578,10 +593,10 @@ void ENGINE_add_conf_module(void);
/**************************/
/* Binary/behaviour compatibility levels */
-#define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000
+#define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000
/* Binary versions older than this are too old for us (whether we're a loader or
* a loadee) */
-#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000
+#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000
/* When compiling an ENGINE entirely as an external shared library, loadable by
* the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure
@@ -596,35 +611,35 @@ typedef void *(*dyn_MEM_malloc_cb)(size_t);
typedef void *(*dyn_MEM_realloc_cb)(void *, size_t);
typedef void (*dyn_MEM_free_cb)(void *);
typedef struct st_dynamic_MEM_fns {
- dyn_MEM_malloc_cb malloc_cb;
- dyn_MEM_realloc_cb realloc_cb;
- dyn_MEM_free_cb free_cb;
- } dynamic_MEM_fns;
+ dyn_MEM_malloc_cb malloc_cb;
+ dyn_MEM_realloc_cb realloc_cb;
+ dyn_MEM_free_cb free_cb;
+ } dynamic_MEM_fns;
/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use
* these types so we (and any other dependant code) can simplify a bit?? */
typedef void (*dyn_lock_locking_cb)(int,int,const char *,int);
typedef int (*dyn_lock_add_lock_cb)(int*,int,int,const char *,int);
typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)(
- const char *,int);
+ const char *,int);
typedef void (*dyn_dynlock_lock_cb)(int,struct CRYPTO_dynlock_value *,
- const char *,int);
+ const char *,int);
typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *,
- const char *,int);
+ const char *,int);
typedef struct st_dynamic_LOCK_fns {
- dyn_lock_locking_cb lock_locking_cb;
- dyn_lock_add_lock_cb lock_add_lock_cb;
- dyn_dynlock_create_cb dynlock_create_cb;
- dyn_dynlock_lock_cb dynlock_lock_cb;
- dyn_dynlock_destroy_cb dynlock_destroy_cb;
- } dynamic_LOCK_fns;
+ dyn_lock_locking_cb lock_locking_cb;
+ dyn_lock_add_lock_cb lock_add_lock_cb;
+ dyn_dynlock_create_cb dynlock_create_cb;
+ dyn_dynlock_lock_cb dynlock_lock_cb;
+ dyn_dynlock_destroy_cb dynlock_destroy_cb;
+ } dynamic_LOCK_fns;
/* The top-level structure */
typedef struct st_dynamic_fns {
- void *static_state;
- const ERR_FNS *err_fns;
- const CRYPTO_EX_DATA_IMPL *ex_data_fns;
- dynamic_MEM_fns mem_fns;
- dynamic_LOCK_fns lock_fns;
- } dynamic_fns;
+ void *static_state;
+ const ERR_FNS *err_fns;
+ const CRYPTO_EX_DATA_IMPL *ex_data_fns;
+ dynamic_MEM_fns mem_fns;
+ dynamic_LOCK_fns lock_fns;
+ } dynamic_fns;
/* The version checking function should be of this prototype. NB: The
* ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code.
@@ -637,9 +652,9 @@ typedef struct st_dynamic_fns {
* can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */
typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
#define IMPLEMENT_DYNAMIC_CHECK_FN() \
- OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
- if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
- return 0; }
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
+ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
+ return 0; }
/* This function is passed the ENGINE structure to initialise with its own
* function and command settings. It should not adjust the structural or
@@ -657,25 +672,25 @@ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
* and returns an int value (zero for failure). 'fn' should have prototype;
* [static] int fn(ENGINE *e, const char *id); */
typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
- const dynamic_fns *fns);
+ const dynamic_fns *fns);
#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
- OPENSSL_EXPORT \
- int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
- if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
- if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
- fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
- return 0; \
- CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
- CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
- CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
- CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
- CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
- if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
- return 0; \
- if(!ERR_set_implementation(fns->err_fns)) return 0; \
- skip_cbs: \
- if(!fn(e,id)) return 0; \
- return 1; }
+ OPENSSL_EXPORT \
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
+ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
+ if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
+ fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
+ return 0; \
+ CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
+ CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
+ CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
+ CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
+ CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
+ if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
+ return 0; \
+ if(!ERR_set_implementation(fns->err_fns)) return 0; \
+ skip_cbs: \
+ if(!fn(e,id)) return 0; \
+ return 1; }
/* If the loading application (or library) and the loaded ENGINE library share
* the same static data (eg. they're both dynamically linked to the same
@@ -701,86 +716,86 @@ void ERR_load_ENGINE_strings(void);
/* Error codes for the ENGINE functions. */
/* Function codes. */
-#define ENGINE_F_DYNAMIC_CTRL 180
-#define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
-#define ENGINE_F_DYNAMIC_LOAD 182
-#define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
-#define ENGINE_F_ENGINE_ADD 105
-#define ENGINE_F_ENGINE_BY_ID 106
-#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
-#define ENGINE_F_ENGINE_CTRL 142
-#define ENGINE_F_ENGINE_CTRL_CMD 178
-#define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
-#define ENGINE_F_ENGINE_FINISH 107
-#define ENGINE_F_ENGINE_FREE_UTIL 108
-#define ENGINE_F_ENGINE_GET_CIPHER 185
-#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
-#define ENGINE_F_ENGINE_GET_DIGEST 186
-#define ENGINE_F_ENGINE_GET_NEXT 115
-#define ENGINE_F_ENGINE_GET_PREV 116
-#define ENGINE_F_ENGINE_INIT 119
-#define ENGINE_F_ENGINE_LIST_ADD 120
-#define ENGINE_F_ENGINE_LIST_REMOVE 121
-#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
-#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
-#define ENGINE_F_ENGINE_NEW 122
-#define ENGINE_F_ENGINE_REMOVE 123
-#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
-#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
-#define ENGINE_F_ENGINE_SET_ID 129
-#define ENGINE_F_ENGINE_SET_NAME 130
-#define ENGINE_F_ENGINE_TABLE_REGISTER 184
-#define ENGINE_F_ENGINE_UNLOAD_KEY 152
-#define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
-#define ENGINE_F_ENGINE_UP_REF 190
-#define ENGINE_F_INT_CTRL_HELPER 172
-#define ENGINE_F_INT_ENGINE_CONFIGURE 188
-#define ENGINE_F_INT_ENGINE_MODULE_INIT 187
-#define ENGINE_F_LOG_MESSAGE 141
+#define ENGINE_F_DYNAMIC_CTRL 180
+#define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
+#define ENGINE_F_DYNAMIC_LOAD 182
+#define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
+#define ENGINE_F_ENGINE_ADD 105
+#define ENGINE_F_ENGINE_BY_ID 106
+#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
+#define ENGINE_F_ENGINE_CTRL 142
+#define ENGINE_F_ENGINE_CTRL_CMD 178
+#define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
+#define ENGINE_F_ENGINE_FINISH 107
+#define ENGINE_F_ENGINE_FREE_UTIL 108
+#define ENGINE_F_ENGINE_GET_CIPHER 185
+#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
+#define ENGINE_F_ENGINE_GET_DIGEST 186
+#define ENGINE_F_ENGINE_GET_NEXT 115
+#define ENGINE_F_ENGINE_GET_PREV 116
+#define ENGINE_F_ENGINE_INIT 119
+#define ENGINE_F_ENGINE_LIST_ADD 120
+#define ENGINE_F_ENGINE_LIST_REMOVE 121
+#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
+#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
+#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 192
+#define ENGINE_F_ENGINE_NEW 122
+#define ENGINE_F_ENGINE_REMOVE 123
+#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
+#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
+#define ENGINE_F_ENGINE_SET_ID 129
+#define ENGINE_F_ENGINE_SET_NAME 130
+#define ENGINE_F_ENGINE_TABLE_REGISTER 184
+#define ENGINE_F_ENGINE_UNLOAD_KEY 152
+#define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
+#define ENGINE_F_ENGINE_UP_REF 190
+#define ENGINE_F_INT_CTRL_HELPER 172
+#define ENGINE_F_INT_ENGINE_CONFIGURE 188
+#define ENGINE_F_INT_ENGINE_MODULE_INIT 187
+#define ENGINE_F_LOG_MESSAGE 141
/* Reason codes. */
-#define ENGINE_R_ALREADY_LOADED 100
-#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
-#define ENGINE_R_CMD_NOT_EXECUTABLE 134
-#define ENGINE_R_COMMAND_TAKES_INPUT 135
-#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
-#define ENGINE_R_CONFLICTING_ENGINE_ID 103
-#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
-#define ENGINE_R_DH_NOT_IMPLEMENTED 139
-#define ENGINE_R_DSA_NOT_IMPLEMENTED 140
-#define ENGINE_R_DSO_FAILURE 104
-#define ENGINE_R_DSO_NOT_FOUND 132
-#define ENGINE_R_ENGINES_SECTION_ERROR 148
-#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
-#define ENGINE_R_ENGINE_SECTION_ERROR 149
-#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
-#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
-#define ENGINE_R_FINISH_FAILED 106
-#define ENGINE_R_GET_HANDLE_FAILED 107
-#define ENGINE_R_ID_OR_NAME_MISSING 108
-#define ENGINE_R_INIT_FAILED 109
-#define ENGINE_R_INTERNAL_LIST_ERROR 110
-#define ENGINE_R_INVALID_ARGUMENT 143
-#define ENGINE_R_INVALID_CMD_NAME 137
-#define ENGINE_R_INVALID_CMD_NUMBER 138
-#define ENGINE_R_INVALID_INIT_VALUE 151
-#define ENGINE_R_INVALID_STRING 150
-#define ENGINE_R_NOT_INITIALISED 117
-#define ENGINE_R_NOT_LOADED 112
-#define ENGINE_R_NO_CONTROL_FUNCTION 120
-#define ENGINE_R_NO_INDEX 144
-#define ENGINE_R_NO_LOAD_FUNCTION 125
-#define ENGINE_R_NO_REFERENCE 130
-#define ENGINE_R_NO_SUCH_ENGINE 116
-#define ENGINE_R_NO_UNLOAD_FUNCTION 126
-#define ENGINE_R_PROVIDE_PARAMETERS 113
-#define ENGINE_R_RSA_NOT_IMPLEMENTED 141
-#define ENGINE_R_UNIMPLEMENTED_CIPHER 146
-#define ENGINE_R_UNIMPLEMENTED_DIGEST 147
-#define ENGINE_R_VERSION_INCOMPATIBILITY 145
+#define ENGINE_R_ALREADY_LOADED 100
+#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
+#define ENGINE_R_CMD_NOT_EXECUTABLE 134
+#define ENGINE_R_COMMAND_TAKES_INPUT 135
+#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
+#define ENGINE_R_CONFLICTING_ENGINE_ID 103
+#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
+#define ENGINE_R_DH_NOT_IMPLEMENTED 139
+#define ENGINE_R_DSA_NOT_IMPLEMENTED 140
+#define ENGINE_R_DSO_FAILURE 104
+#define ENGINE_R_DSO_NOT_FOUND 132
+#define ENGINE_R_ENGINES_SECTION_ERROR 148
+#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
+#define ENGINE_R_ENGINE_SECTION_ERROR 149
+#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
+#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
+#define ENGINE_R_FINISH_FAILED 106
+#define ENGINE_R_GET_HANDLE_FAILED 107
+#define ENGINE_R_ID_OR_NAME_MISSING 108
+#define ENGINE_R_INIT_FAILED 109
+#define ENGINE_R_INTERNAL_LIST_ERROR 110
+#define ENGINE_R_INVALID_ARGUMENT 143
+#define ENGINE_R_INVALID_CMD_NAME 137
+#define ENGINE_R_INVALID_CMD_NUMBER 138
+#define ENGINE_R_INVALID_INIT_VALUE 151
+#define ENGINE_R_INVALID_STRING 150
+#define ENGINE_R_NOT_INITIALISED 117
+#define ENGINE_R_NOT_LOADED 112
+#define ENGINE_R_NO_CONTROL_FUNCTION 120
+#define ENGINE_R_NO_INDEX 144
+#define ENGINE_R_NO_LOAD_FUNCTION 125
+#define ENGINE_R_NO_REFERENCE 130
+#define ENGINE_R_NO_SUCH_ENGINE 116
+#define ENGINE_R_NO_UNLOAD_FUNCTION 126
+#define ENGINE_R_PROVIDE_PARAMETERS 113
+#define ENGINE_R_RSA_NOT_IMPLEMENTED 141
+#define ENGINE_R_UNIMPLEMENTED_CIPHER 146
+#define ENGINE_R_UNIMPLEMENTED_DIGEST 147
+#define ENGINE_R_VERSION_INCOMPATIBILITY 145
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/err.h b/dep/include/openssl/err.h
index b0329919484..dcac4152310 100644
--- a/dep/include/openssl/err.h
+++ b/dep/include/openssl/err.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -74,74 +74,77 @@
#include <openssl/lhash.h>
#endif
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
#ifndef OPENSSL_NO_ERR
-#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
+#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
#else
-#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0)
+#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0)
#endif
#include <errno.h>
-#define ERR_TXT_MALLOCED 0x01
-#define ERR_TXT_STRING 0x02
+#define ERR_TXT_MALLOCED 0x01
+#define ERR_TXT_STRING 0x02
-#define ERR_FLAG_MARK 0x01
+#define ERR_FLAG_MARK 0x01
-#define ERR_NUM_ERRORS 16
+#define ERR_NUM_ERRORS 16
typedef struct err_state_st
- {
- unsigned long pid;
- int err_flags[ERR_NUM_ERRORS];
- unsigned long err_buffer[ERR_NUM_ERRORS];
- char *err_data[ERR_NUM_ERRORS];
- int err_data_flags[ERR_NUM_ERRORS];
- const char *err_file[ERR_NUM_ERRORS];
- int err_line[ERR_NUM_ERRORS];
- int top,bottom;
- } ERR_STATE;
+ {
+ unsigned long pid;
+ int err_flags[ERR_NUM_ERRORS];
+ unsigned long err_buffer[ERR_NUM_ERRORS];
+ char *err_data[ERR_NUM_ERRORS];
+ int err_data_flags[ERR_NUM_ERRORS];
+ const char *err_file[ERR_NUM_ERRORS];
+ int err_line[ERR_NUM_ERRORS];
+ int top,bottom;
+ } ERR_STATE;
/* library */
-#define ERR_LIB_NONE 1
-#define ERR_LIB_SYS 2
-#define ERR_LIB_BN 3
-#define ERR_LIB_RSA 4
-#define ERR_LIB_DH 5
-#define ERR_LIB_EVP 6
-#define ERR_LIB_BUF 7
-#define ERR_LIB_OBJ 8
-#define ERR_LIB_PEM 9
-#define ERR_LIB_DSA 10
-#define ERR_LIB_X509 11
+#define ERR_LIB_NONE 1
+#define ERR_LIB_SYS 2
+#define ERR_LIB_BN 3
+#define ERR_LIB_RSA 4
+#define ERR_LIB_DH 5
+#define ERR_LIB_EVP 6
+#define ERR_LIB_BUF 7
+#define ERR_LIB_OBJ 8
+#define ERR_LIB_PEM 9
+#define ERR_LIB_DSA 10
+#define ERR_LIB_X509 11
/* #define ERR_LIB_METH 12 */
-#define ERR_LIB_ASN1 13
-#define ERR_LIB_CONF 14
-#define ERR_LIB_CRYPTO 15
-#define ERR_LIB_EC 16
-#define ERR_LIB_SSL 20
+#define ERR_LIB_ASN1 13
+#define ERR_LIB_CONF 14
+#define ERR_LIB_CRYPTO 15
+#define ERR_LIB_EC 16
+#define ERR_LIB_SSL 20
/* #define ERR_LIB_SSL23 21 */
/* #define ERR_LIB_SSL2 22 */
/* #define ERR_LIB_SSL3 23 */
/* #define ERR_LIB_RSAREF 30 */
/* #define ERR_LIB_PROXY 31 */
-#define ERR_LIB_BIO 32
-#define ERR_LIB_PKCS7 33
-#define ERR_LIB_X509V3 34
-#define ERR_LIB_PKCS12 35
-#define ERR_LIB_RAND 36
-#define ERR_LIB_DSO 37
-#define ERR_LIB_ENGINE 38
+#define ERR_LIB_BIO 32
+#define ERR_LIB_PKCS7 33
+#define ERR_LIB_X509V3 34
+#define ERR_LIB_PKCS12 35
+#define ERR_LIB_RAND 36
+#define ERR_LIB_DSO 37
+#define ERR_LIB_ENGINE 38
#define ERR_LIB_OCSP 39
#define ERR_LIB_UI 40
#define ERR_LIB_COMP 41
-#define ERR_LIB_ECDSA 42
-#define ERR_LIB_ECDH 43
+#define ERR_LIB_ECDSA 42
+#define ERR_LIB_ECDH 43
#define ERR_LIB_STORE 44
+#define ERR_LIB_FIPS 45
+#define ERR_LIB_CMS 46
+#define ERR_LIB_JPAKE 47
-#define ERR_LIB_USER 128
+#define ERR_LIB_USER 128
#define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__)
#define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__)
@@ -171,86 +174,89 @@ typedef struct err_state_st
#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
+#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
+#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
+#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
/* Borland C seems too stupid to be able to shift and do longs in
* the pre-processor :-( */
-#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \
- ((((unsigned long)f)&0xfffL)*0x1000)| \
- ((((unsigned long)r)&0xfffL)))
-#define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL)
-#define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL)
-#define ERR_GET_REASON(l) (int)((l)&0xfffL)
-#define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL)
+#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \
+ ((((unsigned long)f)&0xfffL)*0x1000)| \
+ ((((unsigned long)r)&0xfffL)))
+#define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL)
+#define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL)
+#define ERR_GET_REASON(l) (int)((l)&0xfffL)
+#define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL)
/* OS functions */
-#define SYS_F_FOPEN 1
-#define SYS_F_CONNECT 2
-#define SYS_F_GETSERVBYNAME 3
-#define SYS_F_SOCKET 4
-#define SYS_F_IOCTLSOCKET 5
-#define SYS_F_BIND 6
-#define SYS_F_LISTEN 7
-#define SYS_F_ACCEPT 8
-#define SYS_F_WSASTARTUP 9 /* Winsock stuff */
-#define SYS_F_OPENDIR 10
-#define SYS_F_FREAD 11
+#define SYS_F_FOPEN 1
+#define SYS_F_CONNECT 2
+#define SYS_F_GETSERVBYNAME 3
+#define SYS_F_SOCKET 4
+#define SYS_F_IOCTLSOCKET 5
+#define SYS_F_BIND 6
+#define SYS_F_LISTEN 7
+#define SYS_F_ACCEPT 8
+#define SYS_F_WSASTARTUP 9 /* Winsock stuff */
+#define SYS_F_OPENDIR 10
+#define SYS_F_FREAD 11
/* reasons */
-#define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */
-#define ERR_R_BN_LIB ERR_LIB_BN /* 3 */
-#define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */
-#define ERR_R_DH_LIB ERR_LIB_DH /* 5 */
-#define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */
-#define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */
-#define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */
-#define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */
-#define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */
-#define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */
-#define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */
-#define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */
+#define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */
+#define ERR_R_BN_LIB ERR_LIB_BN /* 3 */
+#define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */
+#define ERR_R_DH_LIB ERR_LIB_DH /* 5 */
+#define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */
+#define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */
+#define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */
+#define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */
+#define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */
+#define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */
+#define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */
+#define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */
#define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */
-#define ERR_R_EC_LIB ERR_LIB_EC /* 16 */
-#define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */
-#define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */
-#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */
+#define ERR_R_EC_LIB ERR_LIB_EC /* 16 */
+#define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */
+#define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */
+#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */
#define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */
#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */
-#define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */
-#define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */
+#define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */
+#define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */
#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */
#define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */
#define ERR_R_UI_LIB ERR_LIB_UI /* 40 */
-#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */
-#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */
-#define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */
+#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */
+#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */
+#define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */
#define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */
-#define ERR_R_NESTED_ASN1_ERROR 58
-#define ERR_R_BAD_ASN1_OBJECT_HEADER 59
-#define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60
-#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61
-#define ERR_R_ASN1_LENGTH_MISMATCH 62
-#define ERR_R_MISSING_ASN1_EOS 63
+#define ERR_R_NESTED_ASN1_ERROR 58
+#define ERR_R_BAD_ASN1_OBJECT_HEADER 59
+#define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60
+#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61
+#define ERR_R_ASN1_LENGTH_MISMATCH 62
+#define ERR_R_MISSING_ASN1_EOS 63
/* fatal error */
-#define ERR_R_FATAL 64
-#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
-#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
-#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
-#define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
-#define ERR_R_DISABLED (5|ERR_R_FATAL)
+#define ERR_R_FATAL 64
+#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
+#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
+#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
+#define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
+#define ERR_R_DISABLED (5|ERR_R_FATAL)
/* 99 is the maximum possible ERR_R_... code, higher values
* are reserved for the individual libraries */
typedef struct ERR_string_data_st
- {
- unsigned long error;
- const char *string;
- } ERR_STRING_DATA;
+ {
+ unsigned long error;
+ const char *string;
+ } ERR_STRING_DATA;
void ERR_put_error(int lib, int func,int reason,const char *file,int line);
void ERR_set_error_data(char *data,int flags);
@@ -258,15 +264,15 @@ void ERR_set_error_data(char *data,int flags);
unsigned long ERR_get_error(void);
unsigned long ERR_get_error_line(const char **file,int *line);
unsigned long ERR_get_error_line_data(const char **file,int *line,
- const char **data, int *flags);
+ const char **data, int *flags);
unsigned long ERR_peek_error(void);
unsigned long ERR_peek_error_line(const char **file,int *line);
unsigned long ERR_peek_error_line_data(const char **file,int *line,
- const char **data,int *flags);
+ const char **data,int *flags);
unsigned long ERR_peek_last_error(void);
unsigned long ERR_peek_last_error_line(const char **file,int *line);
unsigned long ERR_peek_last_error_line_data(const char **file,int *line,
- const char **data,int *flags);
+ const char **data,int *flags);
void ERR_clear_error(void );
char *ERR_error_string(unsigned long e,char *buf);
void ERR_error_string_n(unsigned long e, char *buf, size_t len);
@@ -274,7 +280,7 @@ const char *ERR_lib_error_string(unsigned long e);
const char *ERR_func_error_string(unsigned long e);
const char *ERR_reason_error_string(unsigned long e);
void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
- void *u);
+ void *u);
#ifndef OPENSSL_NO_FP_API
void ERR_print_errors_fp(FILE *fp);
#endif
@@ -302,6 +308,12 @@ int ERR_get_next_error_library(void);
int ERR_set_mark(void);
int ERR_pop_to_mark(void);
+#ifdef OPENSSL_FIPS
+void int_ERR_set_state_func(ERR_STATE *(*get_func)(void),
+ void (*remove_func)(unsigned long pid));
+void int_ERR_lib_init(void);
+#endif
+
/* Already defined in ossl_typ.h */
/* typedef struct st_ERR_FNS ERR_FNS; */
/* An application can use this function and provide the return value to loaded
@@ -311,9 +323,8 @@ const ERR_FNS *ERR_get_implementation(void);
* the application's "ERR_FNS". */
int ERR_set_implementation(const ERR_FNS *fns);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/evp.h b/dep/include/openssl/evp.h
index 66838b36323..79c097181f4 100644
--- a/dep/include/openssl/evp.h
+++ b/dep/include/openssl/evp.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -75,48 +75,52 @@
#include <openssl/bio.h>
#endif
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
+
/*
-#define EVP_RC2_KEY_SIZE 16
-#define EVP_RC4_KEY_SIZE 16
-#define EVP_BLOWFISH_KEY_SIZE 16
-#define EVP_CAST5_KEY_SIZE 16
-#define EVP_RC5_32_12_16_KEY_SIZE 16
+#define EVP_RC2_KEY_SIZE 16
+#define EVP_RC4_KEY_SIZE 16
+#define EVP_BLOWFISH_KEY_SIZE 16
+#define EVP_CAST5_KEY_SIZE 16
+#define EVP_RC5_32_12_16_KEY_SIZE 16
*/
-#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */
-#define EVP_MAX_KEY_LENGTH 32
-#define EVP_MAX_IV_LENGTH 16
-#define EVP_MAX_BLOCK_LENGTH 32
+#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */
+#define EVP_MAX_KEY_LENGTH 32
+#define EVP_MAX_IV_LENGTH 16
+#define EVP_MAX_BLOCK_LENGTH 32
-#define PKCS5_SALT_LEN 8
+#define PKCS5_SALT_LEN 8
/* Default PKCS#5 iteration count */
-#define PKCS5_DEFAULT_ITER 2048
+#define PKCS5_DEFAULT_ITER 2048
#include <openssl/objects.h>
-#define EVP_PK_RSA 0x0001
-#define EVP_PK_DSA 0x0002
-#define EVP_PK_DH 0x0004
-#define EVP_PK_EC 0x0008
-#define EVP_PKT_SIGN 0x0010
-#define EVP_PKT_ENC 0x0020
-#define EVP_PKT_EXCH 0x0040
-#define EVP_PKS_RSA 0x0100
-#define EVP_PKS_DSA 0x0200
-#define EVP_PKS_EC 0x0400
-#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */
-
-#define EVP_PKEY_NONE NID_undef
-#define EVP_PKEY_RSA NID_rsaEncryption
-#define EVP_PKEY_RSA2 NID_rsa
-#define EVP_PKEY_DSA NID_dsa
-#define EVP_PKEY_DSA1 NID_dsa_2
-#define EVP_PKEY_DSA2 NID_dsaWithSHA
-#define EVP_PKEY_DSA3 NID_dsaWithSHA1
-#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
-#define EVP_PKEY_DH NID_dhKeyAgreement
-#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
-
-#ifdef __cplusplus
+#define EVP_PK_RSA 0x0001
+#define EVP_PK_DSA 0x0002
+#define EVP_PK_DH 0x0004
+#define EVP_PK_EC 0x0008
+#define EVP_PKT_SIGN 0x0010
+#define EVP_PKT_ENC 0x0020
+#define EVP_PKT_EXCH 0x0040
+#define EVP_PKS_RSA 0x0100
+#define EVP_PKS_DSA 0x0200
+#define EVP_PKS_EC 0x0400
+#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */
+
+#define EVP_PKEY_NONE NID_undef
+#define EVP_PKEY_RSA NID_rsaEncryption
+#define EVP_PKEY_RSA2 NID_rsa
+#define EVP_PKEY_DSA NID_dsa
+#define EVP_PKEY_DSA1 NID_dsa_2
+#define EVP_PKEY_DSA2 NID_dsaWithSHA
+#define EVP_PKEY_DSA3 NID_dsaWithSHA1
+#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
+#define EVP_PKEY_DH NID_dhKeyAgreement
+#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
+
+#ifdef __cplusplus
extern "C" {
#endif
@@ -124,33 +128,33 @@ extern "C" {
* Sub-type needs to be for variations on the method, as in, can it do
* arbitrary encryption.... */
struct evp_pkey_st
- {
- int type;
- int save_type;
- int references;
- union {
- char *ptr;
+ {
+ int type;
+ int save_type;
+ int references;
+ union {
+ char *ptr;
#ifndef OPENSSL_NO_RSA
- struct rsa_st *rsa; /* RSA */
+ struct rsa_st *rsa; /* RSA */
#endif
#ifndef OPENSSL_NO_DSA
- struct dsa_st *dsa; /* DSA */
+ struct dsa_st *dsa; /* DSA */
#endif
#ifndef OPENSSL_NO_DH
- struct dh_st *dh; /* DH */
+ struct dh_st *dh; /* DH */
#endif
#ifndef OPENSSL_NO_EC
- struct ec_key_st *ec; /* ECC */
+ struct ec_key_st *ec; /* ECC */
#endif
- } pkey;
- int save_parameters;
- STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
- } /* EVP_PKEY */;
+ } pkey;
+ int save_parameters;
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+ } /* EVP_PKEY */;
-#define EVP_PKEY_MO_SIGN 0x0001
-#define EVP_PKEY_MO_VERIFY 0x0002
-#define EVP_PKEY_MO_ENCRYPT 0x0004
-#define EVP_PKEY_MO_DECRYPT 0x0008
+#define EVP_PKEY_MO_SIGN 0x0001
+#define EVP_PKEY_MO_VERIFY 0x0002
+#define EVP_PKEY_MO_ENCRYPT 0x0004
+#define EVP_PKEY_MO_DECRYPT 0x0008
#if 0
/* This structure is required to tie the message digest and signing together.
@@ -164,258 +168,287 @@ struct evp_pkey_st
* routines.
*/
typedef struct evp_pkey_md_st
- {
- int oid;
- EVP_MD *md;
- EVP_PKEY_METHOD *pkey;
- } EVP_PKEY_MD;
+ {
+ int oid;
+ EVP_MD *md;
+ EVP_PKEY_METHOD *pkey;
+ } EVP_PKEY_MD;
#define EVP_rsa_md2() \
- EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\
- EVP_rsa_pkcs1(),EVP_md2())
+ EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\
+ EVP_rsa_pkcs1(),EVP_md2())
#define EVP_rsa_md5() \
- EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\
- EVP_rsa_pkcs1(),EVP_md5())
+ EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\
+ EVP_rsa_pkcs1(),EVP_md5())
#define EVP_rsa_sha0() \
- EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\
- EVP_rsa_pkcs1(),EVP_sha())
+ EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\
+ EVP_rsa_pkcs1(),EVP_sha())
#define EVP_rsa_sha1() \
- EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\
- EVP_rsa_pkcs1(),EVP_sha1())
+ EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\
+ EVP_rsa_pkcs1(),EVP_sha1())
#define EVP_rsa_ripemd160() \
- EVP_PKEY_MD_add(NID_ripemd160WithRSA,\
- EVP_rsa_pkcs1(),EVP_ripemd160())
+ EVP_PKEY_MD_add(NID_ripemd160WithRSA,\
+ EVP_rsa_pkcs1(),EVP_ripemd160())
#define EVP_rsa_mdc2() \
- EVP_PKEY_MD_add(NID_mdc2WithRSA,\
- EVP_rsa_octet_string(),EVP_mdc2())
+ EVP_PKEY_MD_add(NID_mdc2WithRSA,\
+ EVP_rsa_octet_string(),EVP_mdc2())
#define EVP_dsa_sha() \
- EVP_PKEY_MD_add(NID_dsaWithSHA,\
- EVP_dsa(),EVP_sha())
+ EVP_PKEY_MD_add(NID_dsaWithSHA,\
+ EVP_dsa(),EVP_sha())
#define EVP_dsa_sha1() \
- EVP_PKEY_MD_add(NID_dsaWithSHA1,\
- EVP_dsa(),EVP_sha1())
+ EVP_PKEY_MD_add(NID_dsaWithSHA1,\
+ EVP_dsa(),EVP_sha1())
typedef struct evp_pkey_method_st
- {
- char *name;
- int flags;
- int type; /* RSA, DSA, an SSLeay specific constant */
- int oid; /* For the pub-key type */
- int encrypt_oid; /* pub/priv key encryption */
-
- int (*sign)();
- int (*verify)();
- struct {
- int (*set)(); /* get and/or set the underlying type */
- int (*get)();
- int (*encrypt)();
- int (*decrypt)();
- int (*i2d)();
- int (*d2i)();
- int (*dup)();
- } pub,priv;
- int (*set_asn1_parameters)();
- int (*get_asn1_parameters)();
- } EVP_PKEY_METHOD;
+ {
+ char *name;
+ int flags;
+ int type; /* RSA, DSA, an SSLeay specific constant */
+ int oid; /* For the pub-key type */
+ int encrypt_oid; /* pub/priv key encryption */
+
+ int (*sign)();
+ int (*verify)();
+ struct {
+ int (*set)(); /* get and/or set the underlying type */
+ int (*get)();
+ int (*encrypt)();
+ int (*decrypt)();
+ int (*i2d)();
+ int (*d2i)();
+ int (*dup)();
+ } pub,priv;
+ int (*set_asn1_parameters)();
+ int (*get_asn1_parameters)();
+ } EVP_PKEY_METHOD;
#endif
#ifndef EVP_MD
struct env_md_st
- {
- int type;
- int pkey_type;
- int md_size;
- unsigned long flags;
- int (*init)(EVP_MD_CTX *ctx);
- int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count);
- int (*final)(EVP_MD_CTX *ctx,unsigned char *md);
- int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from);
- int (*cleanup)(EVP_MD_CTX *ctx);
-
- /* FIXME: prototype these some day */
- int (*sign)(int type, const unsigned char *m, unsigned int m_length,
- unsigned char *sigret, unsigned int *siglen, void *key);
- int (*verify)(int type, const unsigned char *m, unsigned int m_length,
- const unsigned char *sigbuf, unsigned int siglen,
- void *key);
- int required_pkey_type[5]; /*EVP_PKEY_xxx */
- int block_size;
- int ctx_size; /* how big does the ctx->md_data need to be */
- } /* EVP_MD */;
+ {
+ int type;
+ int pkey_type;
+ int md_size;
+ unsigned long flags;
+ int (*init)(EVP_MD_CTX *ctx);
+ int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count);
+ int (*final)(EVP_MD_CTX *ctx,unsigned char *md);
+ int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from);
+ int (*cleanup)(EVP_MD_CTX *ctx);
+
+ /* FIXME: prototype these some day */
+ int (*sign)(int type, const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, void *key);
+ int (*verify)(int type, const unsigned char *m, unsigned int m_length,
+ const unsigned char *sigbuf, unsigned int siglen,
+ void *key);
+ int required_pkey_type[5]; /*EVP_PKEY_xxx */
+ int block_size;
+ int ctx_size; /* how big does the ctx->md_data need to be */
+ } /* EVP_MD */;
typedef int evp_sign_method(int type,const unsigned char *m,
- unsigned int m_length,unsigned char *sigret,
- unsigned int *siglen, void *key);
+ unsigned int m_length,unsigned char *sigret,
+ unsigned int *siglen, void *key);
typedef int evp_verify_method(int type,const unsigned char *m,
- unsigned int m_length,const unsigned char *sigbuf,
- unsigned int siglen, void *key);
+ unsigned int m_length,const unsigned char *sigbuf,
+ unsigned int siglen, void *key);
+
+typedef struct
+ {
+ EVP_MD_CTX *mctx;
+ void *key;
+ } EVP_MD_SVCTX;
+
+#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
+ * block */
-#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
- * block */
+#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */
-#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
+#define EVP_MD_FLAG_SVCTX 0x0800 /* pass EVP_MD_SVCTX to sign/verify */
+
+#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
#ifndef OPENSSL_NO_DSA
-#define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \
- (evp_verify_method *)DSA_verify, \
- {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
- EVP_PKEY_DSA4,0}
+#define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \
+ (evp_verify_method *)DSA_verify, \
+ {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
+ EVP_PKEY_DSA4,0}
#else
-#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
+#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
#endif
#ifndef OPENSSL_NO_ECDSA
#define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \
- (evp_verify_method *)ECDSA_verify, \
+ (evp_verify_method *)ECDSA_verify, \
{EVP_PKEY_EC,0,0,0}
-#else
+#else
#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
#endif
#ifndef OPENSSL_NO_RSA
-#define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \
- (evp_verify_method *)RSA_verify, \
- {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+#define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \
+ (evp_verify_method *)RSA_verify, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \
- (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \
- (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \
- {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+ (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \
+ (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
#else
-#define EVP_PKEY_RSA_method EVP_PKEY_NULL_method
+#define EVP_PKEY_RSA_method EVP_PKEY_NULL_method
#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method
#endif
#endif /* !EVP_MD */
struct env_md_ctx_st
- {
- const EVP_MD *digest;
- ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */
- unsigned long flags;
- void *md_data;
- } /* EVP_MD_CTX */;
+ {
+ const EVP_MD *digest;
+ ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */
+ unsigned long flags;
+ void *md_data;
+ } /* EVP_MD_CTX */;
/* values for EVP_MD_CTX flags */
-#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called
- * once only */
-#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been
- * cleaned */
-#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
- * in EVP_MD_CTX_cleanup */
+#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called
+ * once only */
+#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been
+ * cleaned */
+#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
+ * in EVP_MD_CTX_cleanup */
+#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
+ * in FIPS mode */
+
+#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */
+#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */
+#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */
+#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */
+#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \
+ ((ctx->flags>>16) &0xFFFF) /* seed length */
+#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */
+#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */
struct evp_cipher_st
- {
- int nid;
- int block_size;
- int key_len; /* Default value for variable length ciphers */
- int iv_len;
- unsigned long flags; /* Various flags */
- int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
- const unsigned char *iv, int enc); /* init key */
- int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */
- int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
- int ctx_size; /* how big ctx->cipher_data needs to be */
- int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
- int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */
- int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */
- void *app_data; /* Application data */
- } /* EVP_CIPHER */;
+ {
+ int nid;
+ int block_size;
+ int key_len; /* Default value for variable length ciphers */
+ int iv_len;
+ unsigned long flags; /* Various flags */
+ int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
+ const unsigned char *iv, int enc); /* init key */
+ int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */
+ int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
+ int ctx_size; /* how big ctx->cipher_data needs to be */
+ int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
+ int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */
+ int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */
+ void *app_data; /* Application data */
+ } /* EVP_CIPHER */;
/* Values for cipher flags */
/* Modes for ciphers */
-#define EVP_CIPH_STREAM_CIPHER 0x0
-#define EVP_CIPH_ECB_MODE 0x1
-#define EVP_CIPH_CBC_MODE 0x2
-#define EVP_CIPH_CFB_MODE 0x3
-#define EVP_CIPH_OFB_MODE 0x4
-#define EVP_CIPH_MODE 0x7
+#define EVP_CIPH_STREAM_CIPHER 0x0
+#define EVP_CIPH_ECB_MODE 0x1
+#define EVP_CIPH_CBC_MODE 0x2
+#define EVP_CIPH_CFB_MODE 0x3
+#define EVP_CIPH_OFB_MODE 0x4
+#define EVP_CIPH_MODE 0x7
/* Set if variable length cipher */
-#define EVP_CIPH_VARIABLE_LENGTH 0x8
+#define EVP_CIPH_VARIABLE_LENGTH 0x8
/* Set if the iv handling should be done by the cipher itself */
-#define EVP_CIPH_CUSTOM_IV 0x10
+#define EVP_CIPH_CUSTOM_IV 0x10
/* Set if the cipher's init() function should be called if key is NULL */
-#define EVP_CIPH_ALWAYS_CALL_INIT 0x20
+#define EVP_CIPH_ALWAYS_CALL_INIT 0x20
/* Call ctrl() to init cipher parameters */
-#define EVP_CIPH_CTRL_INIT 0x40
+#define EVP_CIPH_CTRL_INIT 0x40
/* Don't use standard key length function */
-#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
+#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
/* Don't use standard block padding */
-#define EVP_CIPH_NO_PADDING 0x100
+#define EVP_CIPH_NO_PADDING 0x100
/* cipher handles random key generation */
-#define EVP_CIPH_RAND_KEY 0x200
+#define EVP_CIPH_RAND_KEY 0x200
+/* Note if suitable for use in FIPS mode */
+#define EVP_CIPH_FLAG_FIPS 0x400
+/* Allow non FIPS cipher in FIPS mode */
+#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800
+/* Allow use default ASN1 get/set iv */
+#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
+/* Buffer length in bits not bytes: CFB1 mode only */
+#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
/* ctrl() values */
-#define EVP_CTRL_INIT 0x0
-#define EVP_CTRL_SET_KEY_LENGTH 0x1
-#define EVP_CTRL_GET_RC2_KEY_BITS 0x2
-#define EVP_CTRL_SET_RC2_KEY_BITS 0x3
-#define EVP_CTRL_GET_RC5_ROUNDS 0x4
-#define EVP_CTRL_SET_RC5_ROUNDS 0x5
-#define EVP_CTRL_RAND_KEY 0x6
+#define EVP_CTRL_INIT 0x0
+#define EVP_CTRL_SET_KEY_LENGTH 0x1
+#define EVP_CTRL_GET_RC2_KEY_BITS 0x2
+#define EVP_CTRL_SET_RC2_KEY_BITS 0x3
+#define EVP_CTRL_GET_RC5_ROUNDS 0x4
+#define EVP_CTRL_SET_RC5_ROUNDS 0x5
+#define EVP_CTRL_RAND_KEY 0x6
typedef struct evp_cipher_info_st
- {
- const EVP_CIPHER *cipher;
- unsigned char iv[EVP_MAX_IV_LENGTH];
- } EVP_CIPHER_INFO;
+ {
+ const EVP_CIPHER *cipher;
+ unsigned char iv[EVP_MAX_IV_LENGTH];
+ } EVP_CIPHER_INFO;
struct evp_cipher_ctx_st
- {
- const EVP_CIPHER *cipher;
- ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */
- int encrypt; /* encrypt or decrypt */
- int buf_len; /* number we have left */
-
- unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
- unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
- unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */
- int num; /* used by cfb/ofb mode */
-
- void *app_data; /* application stuff */
- int key_len; /* May change for variable length cipher */
- unsigned long flags; /* Various flags */
- void *cipher_data; /* per EVP data */
- int final_used;
- int block_mask;
- unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */
- } /* EVP_CIPHER_CTX */;
+ {
+ const EVP_CIPHER *cipher;
+ ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */
+ int encrypt; /* encrypt or decrypt */
+ int buf_len; /* number we have left */
+
+ unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
+ unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
+ unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */
+ int num; /* used by cfb/ofb mode */
+
+ void *app_data; /* application stuff */
+ int key_len; /* May change for variable length cipher */
+ unsigned long flags; /* Various flags */
+ void *cipher_data; /* per EVP data */
+ int final_used;
+ int block_mask;
+ unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */
+ } /* EVP_CIPHER_CTX */;
typedef struct evp_Encode_Ctx_st
- {
- int num; /* number saved in a partial encode/decode */
- int length; /* The length is either the output line length
- * (in input bytes) or the shortest input line
- * length that is ok. Once decoding begins,
- * the length is adjusted up each time a longer
- * line is decoded */
- unsigned char enc_data[80]; /* data to encode */
- int line_num; /* number read on current line */
- int expect_nl;
- } EVP_ENCODE_CTX;
+ {
+ int num; /* number saved in a partial encode/decode */
+ int length; /* The length is either the output line length
+ * (in input bytes) or the shortest input line
+ * length that is ok. Once decoding begins,
+ * the length is adjusted up each time a longer
+ * line is decoded */
+ unsigned char enc_data[80]; /* data to encode */
+ int line_num; /* number read on current line */
+ int expect_nl;
+ } EVP_ENCODE_CTX;
/* Password based encryption function */
typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
- ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
const EVP_MD *md, int en_de);
#ifndef OPENSSL_NO_RSA
#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
- (char *)(rsa))
+ (char *)(rsa))
#endif
#ifndef OPENSSL_NO_DSA
#define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
- (char *)(dsa))
+ (char *)(dsa))
#endif
#ifndef OPENSSL_NO_DH
#define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\
- (char *)(dh))
+ (char *)(dh))
#endif
#ifndef OPENSSL_NO_EC
@@ -429,25 +462,37 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
+/* Macros to reduce FIPS dependencies: do NOT use in applications */
+#define M_EVP_MD_size(e) ((e)->md_size)
+#define M_EVP_MD_block_size(e) ((e)->block_size)
+#define M_EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
+#define M_EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs))
+#define M_EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
+#define M_EVP_MD_type(e) ((e)->type)
+#define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e))
+#define M_EVP_MD_CTX_md(e) ((e)->digest)
+
+#define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
+
int EVP_MD_type(const EVP_MD *md);
-#define EVP_MD_nid(e) EVP_MD_type(e)
-#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
-int EVP_MD_pkey_type(const EVP_MD *md);
+#define EVP_MD_nid(e) EVP_MD_type(e)
+#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
+int EVP_MD_pkey_type(const EVP_MD *md);
int EVP_MD_size(const EVP_MD *md);
int EVP_MD_block_size(const EVP_MD *md);
const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
-#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
-#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
-#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
+#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
+#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
+#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
int EVP_CIPHER_nid(const EVP_CIPHER *cipher);
-#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
+#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
-#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
+#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
@@ -458,129 +503,133 @@ void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
-#define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)
+#define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)
-#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
-#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80)
+#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
+#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80)
-#define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
-#define EVP_SignInit(a,b) EVP_DigestInit(a,b)
-#define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
-#define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
-#define EVP_VerifyInit(a,b) EVP_DigestInit(a,b)
-#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
-#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
-#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
+#define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+#define EVP_SignInit(a,b) EVP_DigestInit(a,b)
+#define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+#define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+#define EVP_VerifyInit(a,b) EVP_DigestInit(a,b)
+#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
+#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
#ifdef CONST_STRICT
void BIO_set_md(BIO *,const EVP_MD *md);
#else
-# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
+# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
#endif
-#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
+#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
-#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
-#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
+#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
+#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
int EVP_Cipher(EVP_CIPHER_CTX *c,
- unsigned char *out,
- const unsigned char *in,
- unsigned int inl);
+ unsigned char *out,
+ const unsigned char *in,
+ unsigned int inl);
#define EVP_add_cipher_alias(n,alias) \
- OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
#define EVP_add_digest_alias(n,alias) \
- OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
#define EVP_delete_cipher_alias(alias) \
- OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS);
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS);
#define EVP_delete_digest_alias(alias) \
- OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
-void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
-int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
EVP_MD_CTX *EVP_MD_CTX_create(void);
-void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
-int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in);
-void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
-void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
-int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx,int flags);
-int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
-int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d,
- size_t cnt);
-int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
-int EVP_Digest(const void *data, size_t count,
- unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl);
-
-int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in);
-int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
-int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
-
-int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
-void EVP_set_pw_prompt(const char *prompt);
-char * EVP_get_pw_prompt(void);
-
-int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md,
- const unsigned char *salt, const unsigned char *data,
- int datal, int count, unsigned char *key,unsigned char *iv);
-
-int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
- const unsigned char *key, const unsigned char *iv);
-int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key, const unsigned char *iv);
-int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
-int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
-int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
-
-int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
- const unsigned char *key, const unsigned char *iv);
-int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key, const unsigned char *iv);
-int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
-int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
-int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
-
-int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
- const unsigned char *key,const unsigned char *iv,
- int enc);
-int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key,const unsigned char *iv,
- int enc);
-int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
-int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
-int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
-
-int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s,
- EVP_PKEY *pkey);
-
-int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf,
- unsigned int siglen,EVP_PKEY *pkey);
-
-int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
- const unsigned char *ek, int ekl, const unsigned char *iv,
- EVP_PKEY *priv);
-int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
-
-int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
- unsigned char **ek, int *ekl, unsigned char *iv,
- EVP_PKEY **pubk, int npubk);
-int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl);
-
-void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
-void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
- const unsigned char *in,int inl);
-void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl);
-int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
-
-void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
-int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
- const unsigned char *in, int inl);
-int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
- char *out, int *outl);
-int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in);
+void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
+void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
+int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx,int flags);
+int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
+int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d,
+ size_t cnt);
+int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
+int EVP_Digest(const void *data, size_t count,
+ unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl);
+
+int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in);
+int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
+int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
+
+int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
+void EVP_set_pw_prompt(const char *prompt);
+char * EVP_get_pw_prompt(void);
+
+int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md,
+ const unsigned char *salt, const unsigned char *data,
+ int datal, int count, unsigned char *key,unsigned char *iv);
+
+void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
+void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
+int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags);
+
+int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ int *outl, const unsigned char *in, int inl);
+int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ int *outl, const unsigned char *in, int inl);
+int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
+ const unsigned char *key,const unsigned char *iv,
+ int enc);
+int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
+ const unsigned char *key,const unsigned char *iv,
+ int enc);
+int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ int *outl, const unsigned char *in, int inl);
+int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s,
+ EVP_PKEY *pkey);
+
+int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf,
+ unsigned int siglen,EVP_PKEY *pkey);
+
+int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
+ const unsigned char *ek, int ekl, const unsigned char *iv,
+ EVP_PKEY *priv);
+int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
+ unsigned char **ek, int *ekl, unsigned char *iv,
+ EVP_PKEY **pubk, int npubk);
+int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl);
+
+void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
+void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
+ const unsigned char *in,int inl);
+void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl);
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
+
+void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
+int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
+ const unsigned char *in, int inl);
+int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
+ char *out, int *outl);
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
@@ -597,7 +646,7 @@ BIO_METHOD *BIO_f_base64(void);
BIO_METHOD *BIO_f_cipher(void);
BIO_METHOD *BIO_f_reliable(void);
void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,const unsigned char *k,
- const unsigned char *i, int enc);
+ const unsigned char *i, int enc);
#endif
const EVP_MD *EVP_md_null(void);
@@ -631,7 +680,7 @@ const EVP_MD *EVP_mdc2(void);
#ifndef OPENSSL_NO_RIPEMD
const EVP_MD *EVP_ripemd160(void);
#endif
-const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
+const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
#ifndef OPENSSL_NO_DES
const EVP_CIPHER *EVP_des_ecb(void);
const EVP_CIPHER *EVP_des_ede(void);
@@ -766,15 +815,23 @@ const EVP_CIPHER *EVP_camellia_256_cfb128(void);
const EVP_CIPHER *EVP_camellia_256_ofb(void);
#endif
+#ifndef OPENSSL_NO_SEED
+const EVP_CIPHER *EVP_seed_ecb(void);
+const EVP_CIPHER *EVP_seed_cbc(void);
+const EVP_CIPHER *EVP_seed_cfb128(void);
+# define EVP_seed_cfb EVP_seed_cfb128
+const EVP_CIPHER *EVP_seed_ofb(void);
+#endif
+
void OPENSSL_add_all_algorithms_noconf(void);
void OPENSSL_add_all_algorithms_conf(void);
#ifdef OPENSSL_LOAD_CONF
#define OpenSSL_add_all_algorithms() \
- OPENSSL_add_all_algorithms_conf()
+ OPENSSL_add_all_algorithms_conf()
#else
#define OpenSSL_add_all_algorithms() \
- OPENSSL_add_all_algorithms_noconf()
+ OPENSSL_add_all_algorithms_noconf()
#endif
void OpenSSL_add_all_ciphers(void);
@@ -790,16 +847,16 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
const EVP_MD *EVP_get_digestbyname(const char *name);
void EVP_cleanup(void);
-int EVP_PKEY_decrypt(unsigned char *dec_key,
- const unsigned char *enc_key,int enc_key_len,
- EVP_PKEY *private_key);
-int EVP_PKEY_encrypt(unsigned char *enc_key,
- const unsigned char *key,int key_len,
- EVP_PKEY *pub_key);
-int EVP_PKEY_type(int type);
-int EVP_PKEY_bits(EVP_PKEY *pkey);
-int EVP_PKEY_size(EVP_PKEY *pkey);
-int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key);
+int EVP_PKEY_decrypt(unsigned char *dec_key,
+ const unsigned char *enc_key,int enc_key_len,
+ EVP_PKEY *private_key);
+int EVP_PKEY_encrypt(unsigned char *enc_key,
+ const unsigned char *key,int key_len,
+ EVP_PKEY *pub_key);
+int EVP_PKEY_type(int type);
+int EVP_PKEY_bits(EVP_PKEY *pkey);
+int EVP_PKEY_size(EVP_PKEY *pkey);
+int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key);
#ifndef OPENSSL_NO_RSA
struct rsa_st;
@@ -822,18 +879,18 @@ int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,struct ec_key_st *key);
struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
#endif
-EVP_PKEY * EVP_PKEY_new(void);
-void EVP_PKEY_free(EVP_PKEY *pkey);
+EVP_PKEY * EVP_PKEY_new(void);
+void EVP_PKEY_free(EVP_PKEY *pkey);
-EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp,
- long length);
-int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
+EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
-EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp,
- long length);
-EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
- long length);
-int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
+EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp,
+ long length);
+EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
@@ -854,23 +911,41 @@ int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type);
/* PKCS5 password based encryption */
int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
- ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md,
- int en_de);
+ ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md,
+ int en_de);
int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
- const unsigned char *salt, int saltlen, int iter,
- int keylen, unsigned char *out);
+ const unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out);
int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
- ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md,
- int en_de);
+ ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md,
+ int en_de);
void PKCS5_PBE_add(void);
int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
- ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
+ ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
- EVP_PBE_KEYGEN *keygen);
+ EVP_PBE_KEYGEN *keygen);
void EVP_PBE_cleanup(void);
+#ifdef OPENSSL_FIPS
+#ifndef OPENSSL_NO_ENGINE
+void int_EVP_MD_set_engine_callbacks(
+ int (*eng_md_init)(ENGINE *impl),
+ int (*eng_md_fin)(ENGINE *impl),
+ int (*eng_md_evp)
+ (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl));
+void int_EVP_MD_init_engine_callbacks(void);
+void int_EVP_CIPHER_set_engine_callbacks(
+ int (*eng_ciph_fin)(ENGINE *impl),
+ int (*eng_ciph_evp)
+ (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl));
+void int_EVP_CIPHER_init_engine_callbacks(void);
+#endif
+#endif
+
+void EVP_add_alg_module(void);
+
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
@@ -880,92 +955,105 @@ void ERR_load_EVP_strings(void);
/* Error codes for the EVP functions. */
/* Function codes. */
-#define EVP_F_AES_INIT_KEY 133
-#define EVP_F_CAMELLIA_INIT_KEY 159
-#define EVP_F_D2I_PKEY 100
-#define EVP_F_DSAPKEY2PKCS8 134
-#define EVP_F_DSA_PKEY2PKCS8 135
-#define EVP_F_ECDSA_PKEY2PKCS8 129
-#define EVP_F_ECKEY_PKEY2PKCS8 132
-#define EVP_F_EVP_CIPHERINIT_EX 123
-#define EVP_F_EVP_CIPHER_CTX_CTRL 124
-#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
-#define EVP_F_EVP_DECRYPTFINAL_EX 101
-#define EVP_F_EVP_DIGESTINIT_EX 128
-#define EVP_F_EVP_ENCRYPTFINAL_EX 127
-#define EVP_F_EVP_MD_CTX_COPY_EX 110
-#define EVP_F_EVP_OPENINIT 102
-#define EVP_F_EVP_PBE_ALG_ADD 115
-#define EVP_F_EVP_PBE_CIPHERINIT 116
-#define EVP_F_EVP_PKCS82PKEY 111
-#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
-#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
-#define EVP_F_EVP_PKEY_DECRYPT 104
-#define EVP_F_EVP_PKEY_ENCRYPT 105
-#define EVP_F_EVP_PKEY_GET1_DH 119
-#define EVP_F_EVP_PKEY_GET1_DSA 120
-#define EVP_F_EVP_PKEY_GET1_ECDSA 130
-#define EVP_F_EVP_PKEY_GET1_EC_KEY 131
-#define EVP_F_EVP_PKEY_GET1_RSA 121
-#define EVP_F_EVP_PKEY_NEW 106
-#define EVP_F_EVP_RIJNDAEL 126
-#define EVP_F_EVP_SIGNFINAL 107
-#define EVP_F_EVP_VERIFYFINAL 108
-#define EVP_F_PKCS5_PBE_KEYIVGEN 117
-#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
-#define EVP_F_PKCS8_SET_BROKEN 112
-#define EVP_F_RC2_MAGIC_TO_METH 109
-#define EVP_F_RC5_CTRL 125
+#define EVP_F_AES_INIT_KEY 133
+#define EVP_F_ALG_MODULE_INIT 138
+#define EVP_F_CAMELLIA_INIT_KEY 159
+#define EVP_F_D2I_PKEY 100
+#define EVP_F_DO_EVP_ENC_ENGINE 140
+#define EVP_F_DO_EVP_ENC_ENGINE_FULL 141
+#define EVP_F_DO_EVP_MD_ENGINE 139
+#define EVP_F_DO_EVP_MD_ENGINE_FULL 142
+#define EVP_F_DSAPKEY2PKCS8 134
+#define EVP_F_DSA_PKEY2PKCS8 135
+#define EVP_F_ECDSA_PKEY2PKCS8 129
+#define EVP_F_ECKEY_PKEY2PKCS8 132
+#define EVP_F_EVP_CIPHERINIT 137
+#define EVP_F_EVP_CIPHERINIT_EX 123
+#define EVP_F_EVP_CIPHER_CTX_CTRL 124
+#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
+#define EVP_F_EVP_DECRYPTFINAL_EX 101
+#define EVP_F_EVP_DIGESTINIT 136
+#define EVP_F_EVP_DIGESTINIT_EX 128
+#define EVP_F_EVP_ENCRYPTFINAL_EX 127
+#define EVP_F_EVP_MD_CTX_COPY_EX 110
+#define EVP_F_EVP_OPENINIT 102
+#define EVP_F_EVP_PBE_ALG_ADD 115
+#define EVP_F_EVP_PBE_CIPHERINIT 116
+#define EVP_F_EVP_PKCS82PKEY 111
+#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
+#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
+#define EVP_F_EVP_PKEY_DECRYPT 104
+#define EVP_F_EVP_PKEY_ENCRYPT 105
+#define EVP_F_EVP_PKEY_GET1_DH 119
+#define EVP_F_EVP_PKEY_GET1_DSA 120
+#define EVP_F_EVP_PKEY_GET1_ECDSA 130
+#define EVP_F_EVP_PKEY_GET1_EC_KEY 131
+#define EVP_F_EVP_PKEY_GET1_RSA 121
+#define EVP_F_EVP_PKEY_NEW 106
+#define EVP_F_EVP_RIJNDAEL 126
+#define EVP_F_EVP_SIGNFINAL 107
+#define EVP_F_EVP_VERIFYFINAL 108
+#define EVP_F_PKCS5_PBE_KEYIVGEN 117
+#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
+#define EVP_F_PKCS8_SET_BROKEN 112
+#define EVP_F_RC2_MAGIC_TO_METH 109
+#define EVP_F_RC5_CTRL 125
/* Reason codes. */
-#define EVP_R_AES_KEY_SETUP_FAILED 143
-#define EVP_R_ASN1_LIB 140
-#define EVP_R_BAD_BLOCK_LENGTH 136
-#define EVP_R_BAD_DECRYPT 100
-#define EVP_R_BAD_KEY_LENGTH 137
-#define EVP_R_BN_DECODE_ERROR 112
-#define EVP_R_BN_PUBKEY_ERROR 113
-#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
-#define EVP_R_CIPHER_PARAMETER_ERROR 122
-#define EVP_R_CTRL_NOT_IMPLEMENTED 132
-#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
-#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
-#define EVP_R_DECODE_ERROR 114
-#define EVP_R_DIFFERENT_KEY_TYPES 101
-#define EVP_R_ENCODE_ERROR 115
-#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
-#define EVP_R_EXPECTING_AN_RSA_KEY 127
-#define EVP_R_EXPECTING_A_DH_KEY 128
-#define EVP_R_EXPECTING_A_DSA_KEY 129
-#define EVP_R_EXPECTING_A_ECDSA_KEY 141
-#define EVP_R_EXPECTING_A_EC_KEY 142
-#define EVP_R_INITIALIZATION_ERROR 134
-#define EVP_R_INPUT_NOT_INITIALIZED 111
-#define EVP_R_INVALID_KEY_LENGTH 130
-#define EVP_R_IV_TOO_LARGE 102
-#define EVP_R_KEYGEN_FAILURE 120
-#define EVP_R_MISSING_PARAMETERS 103
-#define EVP_R_NO_CIPHER_SET 131
-#define EVP_R_NO_DIGEST_SET 139
-#define EVP_R_NO_DSA_PARAMETERS 116
-#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
-#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
-#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
-#define EVP_R_PUBLIC_KEY_NOT_RSA 106
-#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
-#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
-#define EVP_R_UNSUPPORTED_CIPHER 107
-#define EVP_R_UNSUPPORTED_KEYLENGTH 123
-#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
-#define EVP_R_UNSUPPORTED_KEY_SIZE 108
-#define EVP_R_UNSUPPORTED_PRF 125
-#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
-#define EVP_R_UNSUPPORTED_SALT_TYPE 126
-#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
-#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
+#define EVP_R_AES_KEY_SETUP_FAILED 143
+#define EVP_R_ASN1_LIB 140
+#define EVP_R_BAD_BLOCK_LENGTH 136
+#define EVP_R_BAD_DECRYPT 100
+#define EVP_R_BAD_KEY_LENGTH 137
+#define EVP_R_BN_DECODE_ERROR 112
+#define EVP_R_BN_PUBKEY_ERROR 113
+#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
+#define EVP_R_CIPHER_PARAMETER_ERROR 122
+#define EVP_R_CTRL_NOT_IMPLEMENTED 132
+#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
+#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
+#define EVP_R_DECODE_ERROR 114
+#define EVP_R_DIFFERENT_KEY_TYPES 101
+#define EVP_R_DISABLED_FOR_FIPS 144
+#define EVP_R_ENCODE_ERROR 115
+#define EVP_R_ERROR_LOADING_SECTION 145
+#define EVP_R_ERROR_SETTING_FIPS_MODE 146
+#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
+#define EVP_R_EXPECTING_AN_RSA_KEY 127
+#define EVP_R_EXPECTING_A_DH_KEY 128
+#define EVP_R_EXPECTING_A_DSA_KEY 129
+#define EVP_R_EXPECTING_A_ECDSA_KEY 141
+#define EVP_R_EXPECTING_A_EC_KEY 142
+#define EVP_R_FIPS_MODE_NOT_SUPPORTED 147
+#define EVP_R_INITIALIZATION_ERROR 134
+#define EVP_R_INPUT_NOT_INITIALIZED 111
+#define EVP_R_INVALID_FIPS_MODE 148
+#define EVP_R_INVALID_KEY_LENGTH 130
+#define EVP_R_IV_TOO_LARGE 102
+#define EVP_R_KEYGEN_FAILURE 120
+#define EVP_R_MISSING_PARAMETERS 103
+#define EVP_R_NO_CIPHER_SET 131
+#define EVP_R_NO_DIGEST_SET 139
+#define EVP_R_NO_DSA_PARAMETERS 116
+#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
+#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
+#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
+#define EVP_R_PUBLIC_KEY_NOT_RSA 106
+#define EVP_R_UNKNOWN_OPTION 149
+#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
+#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
+#define EVP_R_UNSUPPORTED_CIPHER 107
+#define EVP_R_UNSUPPORTED_KEYLENGTH 123
+#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
+#define EVP_R_UNSUPPORTED_KEY_SIZE 108
+#define EVP_R_UNSUPPORTED_PRF 125
+#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
+#define EVP_R_UNSUPPORTED_SALT_TYPE 126
+#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
+#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
+#define EVP_R_SEED_KEY_SETUP_FAILED 162
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/hmac.h b/dep/include/openssl/hmac.h
index 2387f704cee..fc38ffb52b3 100644
--- a/dep/include/openssl/hmac.h
+++ b/dep/include/openssl/hmac.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -66,23 +66,23 @@
#include <openssl/evp.h>
-#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */
+#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct hmac_ctx_st
- {
- const EVP_MD *md;
- EVP_MD_CTX md_ctx;
- EVP_MD_CTX i_ctx;
- EVP_MD_CTX o_ctx;
- unsigned int key_length;
- unsigned char key[HMAC_MAX_MD_CBLOCK];
- } HMAC_CTX;
+ {
+ const EVP_MD *md;
+ EVP_MD_CTX md_ctx;
+ EVP_MD_CTX i_ctx;
+ EVP_MD_CTX o_ctx;
+ unsigned int key_length;
+ unsigned char key[HMAC_MAX_MD_CBLOCK];
+ } HMAC_CTX;
-#define HMAC_size(e) (EVP_MD_size((e)->md))
+#define HMAC_size(e) (EVP_MD_size((e)->md))
void HMAC_CTX_init(HMAC_CTX *ctx);
@@ -91,19 +91,19 @@ void HMAC_CTX_cleanup(HMAC_CTX *ctx);
#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */
void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md); /* deprecated */
+ const EVP_MD *md); /* deprecated */
void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md, ENGINE *impl);
+ const EVP_MD *md, ENGINE *impl);
void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
- const unsigned char *d, size_t n, unsigned char *md,
- unsigned int *md_len);
+ const unsigned char *d, size_t n, unsigned char *md,
+ unsigned int *md_len);
+void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/idea.h b/dep/include/openssl/idea.h
index 6b7cabb1c48..a137d4cbce2 100644
--- a/dep/include/openssl/idea.h
+++ b/dep/include/openssl/idea.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -65,37 +65,39 @@
#error IDEA is disabled.
#endif
-#define IDEA_ENCRYPT 1
-#define IDEA_DECRYPT 0
+#define IDEA_ENCRYPT 1
+#define IDEA_DECRYPT 0
-#define IDEA_BLOCK 8
-#define IDEA_KEY_LENGTH 16
+#define IDEA_BLOCK 8
+#define IDEA_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct idea_key_st
- {
- IDEA_INT data[9][6];
- } IDEA_KEY_SCHEDULE;
+ {
+ IDEA_INT data[9][6];
+ } IDEA_KEY_SCHEDULE;
const char *idea_options(void);
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
- IDEA_KEY_SCHEDULE *ks);
+ IDEA_KEY_SCHEDULE *ks);
+#ifdef OPENSSL_FIPS
+void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
+#endif
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
void idea_set_decrypt_key(const IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
- long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc);
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc);
void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
- int *num,int enc);
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int *num,int enc);
void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/md2.h b/dep/include/openssl/md2.h
index cd58a8cca55..d59c9f25931 100644
--- a/dep/include/openssl/md2.h
+++ b/dep/include/openssl/md2.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -65,22 +65,25 @@
#endif
#include <stddef.h>
-#define MD2_DIGEST_LENGTH 16
-#define MD2_BLOCK 16
+#define MD2_DIGEST_LENGTH 16
+#define MD2_BLOCK 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MD2state_st
- {
- unsigned int num;
- unsigned char data[MD2_BLOCK];
- MD2_INT cksm[MD2_BLOCK];
- MD2_INT state[MD2_BLOCK];
- } MD2_CTX;
+ {
+ unsigned int num;
+ unsigned char data[MD2_BLOCK];
+ MD2_INT cksm[MD2_BLOCK];
+ MD2_INT state[MD2_BLOCK];
+ } MD2_CTX;
const char *MD2_options(void);
+#ifdef OPENSSL_FIPS
+int private_MD2_Init(MD2_CTX *c);
+#endif
int MD2_Init(MD2_CTX *c);
int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
int MD2_Final(unsigned char *md, MD2_CTX *c);
@@ -90,4 +93,3 @@ unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md);
#endif
#endif
-
diff --git a/dep/include/openssl/md4.h b/dep/include/openssl/md4.h
index 89209898b67..ba1fe4a6ee8 100644
--- a/dep/include/openssl/md4.h
+++ b/dep/include/openssl/md4.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -73,7 +73,7 @@ extern "C" {
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
- * ! MD4_LONG_LOG2 has to be defined along. !
+ * ! MD4_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
@@ -87,24 +87,27 @@ extern "C" {
* does it have on performance on none-T3E machines. I could declare
* int, but at least on C90 sizeof(int) can be chosen at compile time.
* So I've chosen long...
- * <appro@fy.chalmers.se>
+ * <appro@fy.chalmers.se>
*/
#else
#define MD4_LONG unsigned int
#endif
-#define MD4_CBLOCK 64
-#define MD4_LBLOCK (MD4_CBLOCK/4)
+#define MD4_CBLOCK 64
+#define MD4_LBLOCK (MD4_CBLOCK/4)
#define MD4_DIGEST_LENGTH 16
typedef struct MD4state_st
- {
- MD4_LONG A,B,C,D;
- MD4_LONG Nl,Nh;
- MD4_LONG data[MD4_LBLOCK];
- unsigned int num;
- } MD4_CTX;
+ {
+ MD4_LONG A,B,C,D;
+ MD4_LONG Nl,Nh;
+ MD4_LONG data[MD4_LBLOCK];
+ unsigned int num;
+ } MD4_CTX;
+#ifdef OPENSSL_FIPS
+int private_MD4_Init(MD4_CTX *c);
+#endif
int MD4_Init(MD4_CTX *c);
int MD4_Update(MD4_CTX *c, const void *data, size_t len);
int MD4_Final(unsigned char *md, MD4_CTX *c);
@@ -115,4 +118,3 @@ void MD4_Transform(MD4_CTX *c, const unsigned char *b);
#endif
#endif
-
diff --git a/dep/include/openssl/md5.h b/dep/include/openssl/md5.h
index 29989eb1c4b..0761f84a27b 100644
--- a/dep/include/openssl/md5.h
+++ b/dep/include/openssl/md5.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -73,7 +73,7 @@ extern "C" {
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
- * ! MD5_LONG_LOG2 has to be defined along. !
+ * ! MD5_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
@@ -87,24 +87,27 @@ extern "C" {
* does it have on performance on none-T3E machines. I could declare
* int, but at least on C90 sizeof(int) can be chosen at compile time.
* So I've chosen long...
- * <appro@fy.chalmers.se>
+ * <appro@fy.chalmers.se>
*/
#else
#define MD5_LONG unsigned int
#endif
-#define MD5_CBLOCK 64
-#define MD5_LBLOCK (MD5_CBLOCK/4)
+#define MD5_CBLOCK 64
+#define MD5_LBLOCK (MD5_CBLOCK/4)
#define MD5_DIGEST_LENGTH 16
typedef struct MD5state_st
- {
- MD5_LONG A,B,C,D;
- MD5_LONG Nl,Nh;
- MD5_LONG data[MD5_LBLOCK];
- unsigned int num;
- } MD5_CTX;
+ {
+ MD5_LONG A,B,C,D;
+ MD5_LONG Nl,Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+ } MD5_CTX;
+#ifdef OPENSSL_FIPS
+int private_MD5_Init(MD5_CTX *c);
+#endif
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
int MD5_Final(unsigned char *md, MD5_CTX *c);
@@ -115,4 +118,3 @@ void MD5_Transform(MD5_CTX *c, const unsigned char *b);
#endif
#endif
-
diff --git a/dep/include/openssl/mdc2.h b/dep/include/openssl/mdc2.h
deleted file mode 100644
index b6203882a93..00000000000
--- a/dep/include/openssl/mdc2.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* crypto/mdc2/mdc2.h */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef HEADER_MDC2_H
-#define HEADER_MDC2_H
-
-#include <openssl/des.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef OPENSSL_NO_MDC2
-#error MDC2 is disabled.
-#endif
-
-#define MDC2_BLOCK 8
-#define MDC2_DIGEST_LENGTH 16
-
-typedef struct mdc2_ctx_st
- {
- int num;
- unsigned char data[MDC2_BLOCK];
- DES_cblock h,hh;
- int pad_type; /* either 1 or 2, default 1 */
- } MDC2_CTX;
-
-
-int MDC2_Init(MDC2_CTX *c);
-int MDC2_Update(MDC2_CTX *c, const unsigned char *data, unsigned long len);
-int MDC2_Final(unsigned char *md, MDC2_CTX *c);
-unsigned char *MDC2(const unsigned char *d, unsigned long n,
- unsigned char *md);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
diff --git a/dep/include/openssl/obj_mac.h b/dep/include/openssl/obj_mac.h
index 52aa57b25c3..ad5f7cfc104 100644
--- a/dep/include/openssl/obj_mac.h
+++ b/dep/include/openssl/obj_mac.h
@@ -11,21 +11,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -40,10 +40,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -55,3355 +55,3721 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
-#define SN_undef "UNDEF"
-#define LN_undef "undefined"
-#define NID_undef 0
-#define OBJ_undef 0L
-
-#define SN_itu_t "ITU-T"
-#define LN_itu_t "itu-t"
-#define NID_itu_t 645
-#define OBJ_itu_t 0L
-
-#define NID_ccitt 404
-#define OBJ_ccitt OBJ_itu_t
-
-#define SN_iso "ISO"
-#define LN_iso "iso"
-#define NID_iso 181
-#define OBJ_iso 1L
-
-#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T"
-#define LN_joint_iso_itu_t "joint-iso-itu-t"
-#define NID_joint_iso_itu_t 646
-#define OBJ_joint_iso_itu_t 2L
-
-#define NID_joint_iso_ccitt 393
-#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t
+#define SN_undef "UNDEF"
+#define LN_undef "undefined"
+#define NID_undef 0
+#define OBJ_undef 0L
+
+#define SN_itu_t "ITU-T"
+#define LN_itu_t "itu-t"
+#define NID_itu_t 645
+#define OBJ_itu_t 0L
+
+#define NID_ccitt 404
+#define OBJ_ccitt OBJ_itu_t
+
+#define SN_iso "ISO"
+#define LN_iso "iso"
+#define NID_iso 181
+#define OBJ_iso 1L
+
+#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T"
+#define LN_joint_iso_itu_t "joint-iso-itu-t"
+#define NID_joint_iso_itu_t 646
+#define OBJ_joint_iso_itu_t 2L
+
+#define NID_joint_iso_ccitt 393
+#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t
+
+#define SN_member_body "member-body"
+#define LN_member_body "ISO Member Body"
+#define NID_member_body 182
+#define OBJ_member_body OBJ_iso,2L
+
+#define SN_identified_organization "identified-organization"
+#define NID_identified_organization 676
+#define OBJ_identified_organization OBJ_iso,3L
+
+#define SN_hmac_md5 "HMAC-MD5"
+#define LN_hmac_md5 "hmac-md5"
+#define NID_hmac_md5 780
+#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L
+
+#define SN_hmac_sha1 "HMAC-SHA1"
+#define LN_hmac_sha1 "hmac-sha1"
+#define NID_hmac_sha1 781
+#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L
+
+#define SN_certicom_arc "certicom-arc"
+#define NID_certicom_arc 677
+#define OBJ_certicom_arc OBJ_identified_organization,132L
+
+#define SN_international_organizations "international-organizations"
+#define LN_international_organizations "International Organizations"
+#define NID_international_organizations 647
+#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L
+
+#define SN_wap "wap"
+#define NID_wap 678
+#define OBJ_wap OBJ_international_organizations,43L
-#define SN_member_body "member-body"
-#define LN_member_body "ISO Member Body"
-#define NID_member_body 182
-#define OBJ_member_body OBJ_iso,2L
+#define SN_wap_wsg "wap-wsg"
+#define NID_wap_wsg 679
+#define OBJ_wap_wsg OBJ_wap,13L
-#define SN_identified_organization "identified-organization"
-#define NID_identified_organization 676
-#define OBJ_identified_organization OBJ_iso,3L
+#define SN_selected_attribute_types "selected-attribute-types"
+#define LN_selected_attribute_types "Selected Attribute Types"
+#define NID_selected_attribute_types 394
+#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L
+
+#define SN_clearance "clearance"
+#define NID_clearance 395
+#define OBJ_clearance OBJ_selected_attribute_types,55L
+
+#define SN_ISO_US "ISO-US"
+#define LN_ISO_US "ISO US Member Body"
+#define NID_ISO_US 183
+#define OBJ_ISO_US OBJ_member_body,840L
+
+#define SN_X9_57 "X9-57"
+#define LN_X9_57 "X9.57"
+#define NID_X9_57 184
+#define OBJ_X9_57 OBJ_ISO_US,10040L
-#define SN_certicom_arc "certicom-arc"
-#define NID_certicom_arc 677
-#define OBJ_certicom_arc OBJ_identified_organization,132L
+#define SN_X9cm "X9cm"
+#define LN_X9cm "X9.57 CM ?"
+#define NID_X9cm 185
+#define OBJ_X9cm OBJ_X9_57,4L
-#define SN_international_organizations "international-organizations"
-#define LN_international_organizations "International Organizations"
-#define NID_international_organizations 647
-#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L
+#define SN_dsa "DSA"
+#define LN_dsa "dsaEncryption"
+#define NID_dsa 116
+#define OBJ_dsa OBJ_X9cm,1L
+
+#define SN_dsaWithSHA1 "DSA-SHA1"
+#define LN_dsaWithSHA1 "dsaWithSHA1"
+#define NID_dsaWithSHA1 113
+#define OBJ_dsaWithSHA1 OBJ_X9cm,3L
+
+#define SN_ansi_X9_62 "ansi-X9-62"
+#define LN_ansi_X9_62 "ANSI X9.62"
+#define NID_ansi_X9_62 405
+#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L
+
+#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L
+
+#define SN_X9_62_prime_field "prime-field"
+#define NID_X9_62_prime_field 406
+#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L
+
+#define SN_X9_62_characteristic_two_field "characteristic-two-field"
+#define NID_X9_62_characteristic_two_field 407
+#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L
+
+#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis"
+#define NID_X9_62_id_characteristic_two_basis 680
+#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L
+
+#define SN_X9_62_onBasis "onBasis"
+#define NID_X9_62_onBasis 681
+#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L
-#define SN_wap "wap"
-#define NID_wap 678
-#define OBJ_wap OBJ_international_organizations,43L
+#define SN_X9_62_tpBasis "tpBasis"
+#define NID_X9_62_tpBasis 682
+#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L
-#define SN_wap_wsg "wap-wsg"
-#define NID_wap_wsg 679
-#define OBJ_wap_wsg OBJ_wap,13L
+#define SN_X9_62_ppBasis "ppBasis"
+#define NID_X9_62_ppBasis 683
+#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L
-#define SN_selected_attribute_types "selected-attribute-types"
-#define LN_selected_attribute_types "Selected Attribute Types"
-#define NID_selected_attribute_types 394
-#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L
+#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L
-#define SN_clearance "clearance"
-#define NID_clearance 395
-#define OBJ_clearance OBJ_selected_attribute_types,55L
+#define SN_X9_62_id_ecPublicKey "id-ecPublicKey"
+#define NID_X9_62_id_ecPublicKey 408
+#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L
-#define SN_ISO_US "ISO-US"
-#define LN_ISO_US "ISO US Member Body"
-#define NID_ISO_US 183
-#define OBJ_ISO_US OBJ_member_body,840L
+#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L
-#define SN_X9_57 "X9-57"
-#define LN_X9_57 "X9.57"
-#define NID_X9_57 184
-#define OBJ_X9_57 OBJ_ISO_US,10040L
+#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L
-#define SN_X9cm "X9cm"
-#define LN_X9cm "X9.57 CM ?"
-#define NID_X9cm 185
-#define OBJ_X9cm OBJ_X9_57,4L
+#define SN_X9_62_c2pnb163v1 "c2pnb163v1"
+#define NID_X9_62_c2pnb163v1 684
+#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L
-#define SN_dsa "DSA"
-#define LN_dsa "dsaEncryption"
-#define NID_dsa 116
-#define OBJ_dsa OBJ_X9cm,1L
+#define SN_X9_62_c2pnb163v2 "c2pnb163v2"
+#define NID_X9_62_c2pnb163v2 685
+#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L
-#define SN_dsaWithSHA1 "DSA-SHA1"
-#define LN_dsaWithSHA1 "dsaWithSHA1"
-#define NID_dsaWithSHA1 113
-#define OBJ_dsaWithSHA1 OBJ_X9cm,3L
+#define SN_X9_62_c2pnb163v3 "c2pnb163v3"
+#define NID_X9_62_c2pnb163v3 686
+#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L
-#define SN_ansi_X9_62 "ansi-X9-62"
-#define LN_ansi_X9_62 "ANSI X9.62"
-#define NID_ansi_X9_62 405
-#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L
+#define SN_X9_62_c2pnb176v1 "c2pnb176v1"
+#define NID_X9_62_c2pnb176v1 687
+#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L
-#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L
+#define SN_X9_62_c2tnb191v1 "c2tnb191v1"
+#define NID_X9_62_c2tnb191v1 688
+#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L
-#define SN_X9_62_prime_field "prime-field"
-#define NID_X9_62_prime_field 406
-#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L
+#define SN_X9_62_c2tnb191v2 "c2tnb191v2"
+#define NID_X9_62_c2tnb191v2 689
+#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L
-#define SN_X9_62_characteristic_two_field "characteristic-two-field"
-#define NID_X9_62_characteristic_two_field 407
-#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L
-
-#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis"
-#define NID_X9_62_id_characteristic_two_basis 680
-#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L
+#define SN_X9_62_c2tnb191v3 "c2tnb191v3"
+#define NID_X9_62_c2tnb191v3 690
+#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L
-#define SN_X9_62_onBasis "onBasis"
-#define NID_X9_62_onBasis 681
-#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L
+#define SN_X9_62_c2onb191v4 "c2onb191v4"
+#define NID_X9_62_c2onb191v4 691
+#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L
-#define SN_X9_62_tpBasis "tpBasis"
-#define NID_X9_62_tpBasis 682
-#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L
+#define SN_X9_62_c2onb191v5 "c2onb191v5"
+#define NID_X9_62_c2onb191v5 692
+#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L
-#define SN_X9_62_ppBasis "ppBasis"
-#define NID_X9_62_ppBasis 683
-#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L
+#define SN_X9_62_c2pnb208w1 "c2pnb208w1"
+#define NID_X9_62_c2pnb208w1 693
+#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L
-#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L
+#define SN_X9_62_c2tnb239v1 "c2tnb239v1"
+#define NID_X9_62_c2tnb239v1 694
+#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L
-#define SN_X9_62_id_ecPublicKey "id-ecPublicKey"
-#define NID_X9_62_id_ecPublicKey 408
-#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L
+#define SN_X9_62_c2tnb239v2 "c2tnb239v2"
+#define NID_X9_62_c2tnb239v2 695
+#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L
-#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L
+#define SN_X9_62_c2tnb239v3 "c2tnb239v3"
+#define NID_X9_62_c2tnb239v3 696
+#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L
-#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L
+#define SN_X9_62_c2onb239v4 "c2onb239v4"
+#define NID_X9_62_c2onb239v4 697
+#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L
-#define SN_X9_62_c2pnb163v1 "c2pnb163v1"
-#define NID_X9_62_c2pnb163v1 684
-#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L
+#define SN_X9_62_c2onb239v5 "c2onb239v5"
+#define NID_X9_62_c2onb239v5 698
+#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L
-#define SN_X9_62_c2pnb163v2 "c2pnb163v2"
-#define NID_X9_62_c2pnb163v2 685
-#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L
+#define SN_X9_62_c2pnb272w1 "c2pnb272w1"
+#define NID_X9_62_c2pnb272w1 699
+#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L
-#define SN_X9_62_c2pnb163v3 "c2pnb163v3"
-#define NID_X9_62_c2pnb163v3 686
-#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L
+#define SN_X9_62_c2pnb304w1 "c2pnb304w1"
+#define NID_X9_62_c2pnb304w1 700
+#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L
-#define SN_X9_62_c2pnb176v1 "c2pnb176v1"
-#define NID_X9_62_c2pnb176v1 687
-#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L
+#define SN_X9_62_c2tnb359v1 "c2tnb359v1"
+#define NID_X9_62_c2tnb359v1 701
+#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L
-#define SN_X9_62_c2tnb191v1 "c2tnb191v1"
-#define NID_X9_62_c2tnb191v1 688
-#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L
+#define SN_X9_62_c2pnb368w1 "c2pnb368w1"
+#define NID_X9_62_c2pnb368w1 702
+#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L
-#define SN_X9_62_c2tnb191v2 "c2tnb191v2"
-#define NID_X9_62_c2tnb191v2 689
-#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L
+#define SN_X9_62_c2tnb431r1 "c2tnb431r1"
+#define NID_X9_62_c2tnb431r1 703
+#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L
-#define SN_X9_62_c2tnb191v3 "c2tnb191v3"
-#define NID_X9_62_c2tnb191v3 690
-#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L
+#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L
-#define SN_X9_62_c2onb191v4 "c2onb191v4"
-#define NID_X9_62_c2onb191v4 691
-#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L
+#define SN_X9_62_prime192v1 "prime192v1"
+#define NID_X9_62_prime192v1 409
+#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L
-#define SN_X9_62_c2onb191v5 "c2onb191v5"
-#define NID_X9_62_c2onb191v5 692
-#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L
+#define SN_X9_62_prime192v2 "prime192v2"
+#define NID_X9_62_prime192v2 410
+#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L
-#define SN_X9_62_c2pnb208w1 "c2pnb208w1"
-#define NID_X9_62_c2pnb208w1 693
-#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L
+#define SN_X9_62_prime192v3 "prime192v3"
+#define NID_X9_62_prime192v3 411
+#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L
-#define SN_X9_62_c2tnb239v1 "c2tnb239v1"
-#define NID_X9_62_c2tnb239v1 694
-#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L
+#define SN_X9_62_prime239v1 "prime239v1"
+#define NID_X9_62_prime239v1 412
+#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L
-#define SN_X9_62_c2tnb239v2 "c2tnb239v2"
-#define NID_X9_62_c2tnb239v2 695
-#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L
+#define SN_X9_62_prime239v2 "prime239v2"
+#define NID_X9_62_prime239v2 413
+#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L
-#define SN_X9_62_c2tnb239v3 "c2tnb239v3"
-#define NID_X9_62_c2tnb239v3 696
-#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L
+#define SN_X9_62_prime239v3 "prime239v3"
+#define NID_X9_62_prime239v3 414
+#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L
-#define SN_X9_62_c2onb239v4 "c2onb239v4"
-#define NID_X9_62_c2onb239v4 697
-#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L
+#define SN_X9_62_prime256v1 "prime256v1"
+#define NID_X9_62_prime256v1 415
+#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L
-#define SN_X9_62_c2onb239v5 "c2onb239v5"
-#define NID_X9_62_c2onb239v5 698
-#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L
+#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L
-#define SN_X9_62_c2pnb272w1 "c2pnb272w1"
-#define NID_X9_62_c2pnb272w1 699
-#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L
+#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1"
+#define NID_ecdsa_with_SHA1 416
+#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L
-#define SN_X9_62_c2pnb304w1 "c2pnb304w1"
-#define NID_X9_62_c2pnb304w1 700
-#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L
+#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended"
+#define NID_ecdsa_with_Recommended 791
+#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L
-#define SN_X9_62_c2tnb359v1 "c2tnb359v1"
-#define NID_X9_62_c2tnb359v1 701
-#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L
+#define SN_ecdsa_with_Specified "ecdsa-with-Specified"
+#define NID_ecdsa_with_Specified 792
+#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L
-#define SN_X9_62_c2pnb368w1 "c2pnb368w1"
-#define NID_X9_62_c2pnb368w1 702
-#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L
+#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224"
+#define NID_ecdsa_with_SHA224 793
+#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L
-#define SN_X9_62_c2tnb431r1 "c2tnb431r1"
-#define NID_X9_62_c2tnb431r1 703
-#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L
+#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256"
+#define NID_ecdsa_with_SHA256 794
+#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L
-#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L
+#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384"
+#define NID_ecdsa_with_SHA384 795
+#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L
-#define SN_X9_62_prime192v1 "prime192v1"
-#define NID_X9_62_prime192v1 409
-#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L
+#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512"
+#define NID_ecdsa_with_SHA512 796
+#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L
-#define SN_X9_62_prime192v2 "prime192v2"
-#define NID_X9_62_prime192v2 410
-#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L
+#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L
-#define SN_X9_62_prime192v3 "prime192v3"
-#define NID_X9_62_prime192v3 411
-#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L
+#define SN_secp112r1 "secp112r1"
+#define NID_secp112r1 704
+#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L
-#define SN_X9_62_prime239v1 "prime239v1"
-#define NID_X9_62_prime239v1 412
-#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L
+#define SN_secp112r2 "secp112r2"
+#define NID_secp112r2 705
+#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L
-#define SN_X9_62_prime239v2 "prime239v2"
-#define NID_X9_62_prime239v2 413
-#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L
+#define SN_secp128r1 "secp128r1"
+#define NID_secp128r1 706
+#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L
-#define SN_X9_62_prime239v3 "prime239v3"
-#define NID_X9_62_prime239v3 414
-#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L
+#define SN_secp128r2 "secp128r2"
+#define NID_secp128r2 707
+#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L
-#define SN_X9_62_prime256v1 "prime256v1"
-#define NID_X9_62_prime256v1 415
-#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L
+#define SN_secp160k1 "secp160k1"
+#define NID_secp160k1 708
+#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L
-#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L
+#define SN_secp160r1 "secp160r1"
+#define NID_secp160r1 709
+#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L
-#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1"
-#define NID_ecdsa_with_SHA1 416
-#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L
+#define SN_secp160r2 "secp160r2"
+#define NID_secp160r2 710
+#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L
-#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L
+#define SN_secp192k1 "secp192k1"
+#define NID_secp192k1 711
+#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L
-#define SN_secp112r1 "secp112r1"
-#define NID_secp112r1 704
-#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L
+#define SN_secp224k1 "secp224k1"
+#define NID_secp224k1 712
+#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L
-#define SN_secp112r2 "secp112r2"
-#define NID_secp112r2 705
-#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L
+#define SN_secp224r1 "secp224r1"
+#define NID_secp224r1 713
+#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L
-#define SN_secp128r1 "secp128r1"
-#define NID_secp128r1 706
-#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L
+#define SN_secp256k1 "secp256k1"
+#define NID_secp256k1 714
+#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L
-#define SN_secp128r2 "secp128r2"
-#define NID_secp128r2 707
-#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L
+#define SN_secp384r1 "secp384r1"
+#define NID_secp384r1 715
+#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L
-#define SN_secp160k1 "secp160k1"
-#define NID_secp160k1 708
-#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L
+#define SN_secp521r1 "secp521r1"
+#define NID_secp521r1 716
+#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L
-#define SN_secp160r1 "secp160r1"
-#define NID_secp160r1 709
-#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L
+#define SN_sect113r1 "sect113r1"
+#define NID_sect113r1 717
+#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L
-#define SN_secp160r2 "secp160r2"
-#define NID_secp160r2 710
-#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L
+#define SN_sect113r2 "sect113r2"
+#define NID_sect113r2 718
+#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L
-#define SN_secp192k1 "secp192k1"
-#define NID_secp192k1 711
-#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L
+#define SN_sect131r1 "sect131r1"
+#define NID_sect131r1 719
+#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L
-#define SN_secp224k1 "secp224k1"
-#define NID_secp224k1 712
-#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L
+#define SN_sect131r2 "sect131r2"
+#define NID_sect131r2 720
+#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L
-#define SN_secp224r1 "secp224r1"
-#define NID_secp224r1 713
-#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L
+#define SN_sect163k1 "sect163k1"
+#define NID_sect163k1 721
+#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L
-#define SN_secp256k1 "secp256k1"
-#define NID_secp256k1 714
-#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L
+#define SN_sect163r1 "sect163r1"
+#define NID_sect163r1 722
+#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L
-#define SN_secp384r1 "secp384r1"
-#define NID_secp384r1 715
-#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L
+#define SN_sect163r2 "sect163r2"
+#define NID_sect163r2 723
+#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L
-#define SN_secp521r1 "secp521r1"
-#define NID_secp521r1 716
-#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L
+#define SN_sect193r1 "sect193r1"
+#define NID_sect193r1 724
+#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L
-#define SN_sect113r1 "sect113r1"
-#define NID_sect113r1 717
-#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L
+#define SN_sect193r2 "sect193r2"
+#define NID_sect193r2 725
+#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L
-#define SN_sect113r2 "sect113r2"
-#define NID_sect113r2 718
-#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L
+#define SN_sect233k1 "sect233k1"
+#define NID_sect233k1 726
+#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L
-#define SN_sect131r1 "sect131r1"
-#define NID_sect131r1 719
-#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L
+#define SN_sect233r1 "sect233r1"
+#define NID_sect233r1 727
+#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L
-#define SN_sect131r2 "sect131r2"
-#define NID_sect131r2 720
-#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L
+#define SN_sect239k1 "sect239k1"
+#define NID_sect239k1 728
+#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L
-#define SN_sect163k1 "sect163k1"
-#define NID_sect163k1 721
-#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L
+#define SN_sect283k1 "sect283k1"
+#define NID_sect283k1 729
+#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L
-#define SN_sect163r1 "sect163r1"
-#define NID_sect163r1 722
-#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L
+#define SN_sect283r1 "sect283r1"
+#define NID_sect283r1 730
+#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L
-#define SN_sect163r2 "sect163r2"
-#define NID_sect163r2 723
-#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L
+#define SN_sect409k1 "sect409k1"
+#define NID_sect409k1 731
+#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L
-#define SN_sect193r1 "sect193r1"
-#define NID_sect193r1 724
-#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L
+#define SN_sect409r1 "sect409r1"
+#define NID_sect409r1 732
+#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L
-#define SN_sect193r2 "sect193r2"
-#define NID_sect193r2 725
-#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L
+#define SN_sect571k1 "sect571k1"
+#define NID_sect571k1 733
+#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L
-#define SN_sect233k1 "sect233k1"
-#define NID_sect233k1 726
-#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L
+#define SN_sect571r1 "sect571r1"
+#define NID_sect571r1 734
+#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L
-#define SN_sect233r1 "sect233r1"
-#define NID_sect233r1 727
-#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L
+#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L
+
+#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1"
+#define NID_wap_wsg_idm_ecid_wtls1 735
+#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L
+
+#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3"
+#define NID_wap_wsg_idm_ecid_wtls3 736
+#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L
+
+#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4"
+#define NID_wap_wsg_idm_ecid_wtls4 737
+#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L
+
+#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5"
+#define NID_wap_wsg_idm_ecid_wtls5 738
+#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L
+
+#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6"
+#define NID_wap_wsg_idm_ecid_wtls6 739
+#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L
+
+#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7"
+#define NID_wap_wsg_idm_ecid_wtls7 740
+#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L
+
+#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8"
+#define NID_wap_wsg_idm_ecid_wtls8 741
+#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L
+
+#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9"
+#define NID_wap_wsg_idm_ecid_wtls9 742
+#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L
+
+#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10"
+#define NID_wap_wsg_idm_ecid_wtls10 743
+#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L
+
+#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11"
+#define NID_wap_wsg_idm_ecid_wtls11 744
+#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L
+
+#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12"
+#define NID_wap_wsg_idm_ecid_wtls12 745
+#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L
+
+#define SN_cast5_cbc "CAST5-CBC"
+#define LN_cast5_cbc "cast5-cbc"
+#define NID_cast5_cbc 108
+#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L
+
+#define SN_cast5_ecb "CAST5-ECB"
+#define LN_cast5_ecb "cast5-ecb"
+#define NID_cast5_ecb 109
+
+#define SN_cast5_cfb64 "CAST5-CFB"
+#define LN_cast5_cfb64 "cast5-cfb"
+#define NID_cast5_cfb64 110
+
+#define SN_cast5_ofb64 "CAST5-OFB"
+#define LN_cast5_ofb64 "cast5-ofb"
+#define NID_cast5_ofb64 111
+
+#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
+#define NID_pbeWithMD5AndCast5_CBC 112
+#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L
+
+#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC"
+#define LN_id_PasswordBasedMAC "password based MAC"
+#define NID_id_PasswordBasedMAC 782
+#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L
+
+#define SN_id_DHBasedMac "id-DHBasedMac"
+#define LN_id_DHBasedMac "Diffie-Hellman based MAC"
+#define NID_id_DHBasedMac 783
+#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L
+
+#define SN_rsadsi "rsadsi"
+#define LN_rsadsi "RSA Data Security, Inc."
+#define NID_rsadsi 1
+#define OBJ_rsadsi OBJ_ISO_US,113549L
+
+#define SN_pkcs "pkcs"
+#define LN_pkcs "RSA Data Security, Inc. PKCS"
+#define NID_pkcs 2
+#define OBJ_pkcs OBJ_rsadsi,1L
+
+#define SN_pkcs1 "pkcs1"
+#define NID_pkcs1 186
+#define OBJ_pkcs1 OBJ_pkcs,1L
+
+#define LN_rsaEncryption "rsaEncryption"
+#define NID_rsaEncryption 6
+#define OBJ_rsaEncryption OBJ_pkcs1,1L
+
+#define SN_md2WithRSAEncryption "RSA-MD2"
+#define LN_md2WithRSAEncryption "md2WithRSAEncryption"
+#define NID_md2WithRSAEncryption 7
+#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
+
+#define SN_md4WithRSAEncryption "RSA-MD4"
+#define LN_md4WithRSAEncryption "md4WithRSAEncryption"
+#define NID_md4WithRSAEncryption 396
+#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L
+
+#define SN_md5WithRSAEncryption "RSA-MD5"
+#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
+#define NID_md5WithRSAEncryption 8
+#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L
+
+#define SN_sha1WithRSAEncryption "RSA-SHA1"
+#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
+#define NID_sha1WithRSAEncryption 65
+#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
+
+#define SN_sha256WithRSAEncryption "RSA-SHA256"
+#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption"
+#define NID_sha256WithRSAEncryption 668
+#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L
+
+#define SN_sha384WithRSAEncryption "RSA-SHA384"
+#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption"
+#define NID_sha384WithRSAEncryption 669
+#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L
+
+#define SN_sha512WithRSAEncryption "RSA-SHA512"
+#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption"
+#define NID_sha512WithRSAEncryption 670
+#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L
+
+#define SN_sha224WithRSAEncryption "RSA-SHA224"
+#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption"
+#define NID_sha224WithRSAEncryption 671
+#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L
+
+#define SN_pkcs3 "pkcs3"
+#define NID_pkcs3 27
+#define OBJ_pkcs3 OBJ_pkcs,3L
+
+#define LN_dhKeyAgreement "dhKeyAgreement"
+#define NID_dhKeyAgreement 28
+#define OBJ_dhKeyAgreement OBJ_pkcs3,1L
+
+#define SN_pkcs5 "pkcs5"
+#define NID_pkcs5 187
+#define OBJ_pkcs5 OBJ_pkcs,5L
+
+#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
+#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
+#define NID_pbeWithMD2AndDES_CBC 9
+#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L
+
+#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
+#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
+#define NID_pbeWithMD5AndDES_CBC 10
+#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L
+
+#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
+#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
+#define NID_pbeWithMD2AndRC2_CBC 168
+#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L
+
+#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
+#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
+#define NID_pbeWithMD5AndRC2_CBC 169
+#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L
+
+#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
+#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
+#define NID_pbeWithSHA1AndDES_CBC 170
+#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L
+
+#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
+#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
+#define NID_pbeWithSHA1AndRC2_CBC 68
+#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L
+
+#define LN_id_pbkdf2 "PBKDF2"
+#define NID_id_pbkdf2 69
+#define OBJ_id_pbkdf2 OBJ_pkcs5,12L
+
+#define LN_pbes2 "PBES2"
+#define NID_pbes2 161
+#define OBJ_pbes2 OBJ_pkcs5,13L
+
+#define LN_pbmac1 "PBMAC1"
+#define NID_pbmac1 162
+#define OBJ_pbmac1 OBJ_pkcs5,14L
+
+#define SN_pkcs7 "pkcs7"
+#define NID_pkcs7 20
+#define OBJ_pkcs7 OBJ_pkcs,7L
+
+#define LN_pkcs7_data "pkcs7-data"
+#define NID_pkcs7_data 21
+#define OBJ_pkcs7_data OBJ_pkcs7,1L
+
+#define LN_pkcs7_signed "pkcs7-signedData"
+#define NID_pkcs7_signed 22
+#define OBJ_pkcs7_signed OBJ_pkcs7,2L
+
+#define LN_pkcs7_enveloped "pkcs7-envelopedData"
+#define NID_pkcs7_enveloped 23
+#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
+
+#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
+#define NID_pkcs7_signedAndEnveloped 24
+#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
+
+#define LN_pkcs7_digest "pkcs7-digestData"
+#define NID_pkcs7_digest 25
+#define OBJ_pkcs7_digest OBJ_pkcs7,5L
+
+#define LN_pkcs7_encrypted "pkcs7-encryptedData"
+#define NID_pkcs7_encrypted 26
+#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
+
+#define SN_pkcs9 "pkcs9"
+#define NID_pkcs9 47
+#define OBJ_pkcs9 OBJ_pkcs,9L
+
+#define LN_pkcs9_emailAddress "emailAddress"
+#define NID_pkcs9_emailAddress 48
+#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
+
+#define LN_pkcs9_unstructuredName "unstructuredName"
+#define NID_pkcs9_unstructuredName 49
+#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
+
+#define LN_pkcs9_contentType "contentType"
+#define NID_pkcs9_contentType 50
+#define OBJ_pkcs9_contentType OBJ_pkcs9,3L
+
+#define LN_pkcs9_messageDigest "messageDigest"
+#define NID_pkcs9_messageDigest 51
+#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
+
+#define LN_pkcs9_signingTime "signingTime"
+#define NID_pkcs9_signingTime 52
+#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
+
+#define LN_pkcs9_countersignature "countersignature"
+#define NID_pkcs9_countersignature 53
+#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
+
+#define LN_pkcs9_challengePassword "challengePassword"
+#define NID_pkcs9_challengePassword 54
+#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
+
+#define LN_pkcs9_unstructuredAddress "unstructuredAddress"
+#define NID_pkcs9_unstructuredAddress 55
+#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
+
+#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
+#define NID_pkcs9_extCertAttributes 56
+#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
+
+#define SN_ext_req "extReq"
+#define LN_ext_req "Extension Request"
+#define NID_ext_req 172
+#define OBJ_ext_req OBJ_pkcs9,14L
+
+#define SN_SMIMECapabilities "SMIME-CAPS"
+#define LN_SMIMECapabilities "S/MIME Capabilities"
+#define NID_SMIMECapabilities 167
+#define OBJ_SMIMECapabilities OBJ_pkcs9,15L
+
+#define SN_SMIME "SMIME"
+#define LN_SMIME "S/MIME"
+#define NID_SMIME 188
+#define OBJ_SMIME OBJ_pkcs9,16L
-#define SN_sect239k1 "sect239k1"
-#define NID_sect239k1 728
-#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L
+#define SN_id_smime_mod "id-smime-mod"
+#define NID_id_smime_mod 189
+#define OBJ_id_smime_mod OBJ_SMIME,0L
-#define SN_sect283k1 "sect283k1"
-#define NID_sect283k1 729
-#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L
+#define SN_id_smime_ct "id-smime-ct"
+#define NID_id_smime_ct 190
+#define OBJ_id_smime_ct OBJ_SMIME,1L
-#define SN_sect283r1 "sect283r1"
-#define NID_sect283r1 730
-#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L
+#define SN_id_smime_aa "id-smime-aa"
+#define NID_id_smime_aa 191
+#define OBJ_id_smime_aa OBJ_SMIME,2L
-#define SN_sect409k1 "sect409k1"
-#define NID_sect409k1 731
-#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L
+#define SN_id_smime_alg "id-smime-alg"
+#define NID_id_smime_alg 192
+#define OBJ_id_smime_alg OBJ_SMIME,3L
-#define SN_sect409r1 "sect409r1"
-#define NID_sect409r1 732
-#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L
+#define SN_id_smime_cd "id-smime-cd"
+#define NID_id_smime_cd 193
+#define OBJ_id_smime_cd OBJ_SMIME,4L
-#define SN_sect571k1 "sect571k1"
-#define NID_sect571k1 733
-#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L
+#define SN_id_smime_spq "id-smime-spq"
+#define NID_id_smime_spq 194
+#define OBJ_id_smime_spq OBJ_SMIME,5L
-#define SN_sect571r1 "sect571r1"
-#define NID_sect571r1 734
-#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L
+#define SN_id_smime_cti "id-smime-cti"
+#define NID_id_smime_cti 195
+#define OBJ_id_smime_cti OBJ_SMIME,6L
-#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L
-
-#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1"
-#define NID_wap_wsg_idm_ecid_wtls1 735
-#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L
-
-#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3"
-#define NID_wap_wsg_idm_ecid_wtls3 736
-#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L
-
-#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4"
-#define NID_wap_wsg_idm_ecid_wtls4 737
-#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L
-
-#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5"
-#define NID_wap_wsg_idm_ecid_wtls5 738
-#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L
-
-#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6"
-#define NID_wap_wsg_idm_ecid_wtls6 739
-#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L
-
-#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7"
-#define NID_wap_wsg_idm_ecid_wtls7 740
-#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L
-
-#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8"
-#define NID_wap_wsg_idm_ecid_wtls8 741
-#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L
-
-#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9"
-#define NID_wap_wsg_idm_ecid_wtls9 742
-#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L
-
-#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10"
-#define NID_wap_wsg_idm_ecid_wtls10 743
-#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L
-
-#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11"
-#define NID_wap_wsg_idm_ecid_wtls11 744
-#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L
-
-#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12"
-#define NID_wap_wsg_idm_ecid_wtls12 745
-#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L
-
-#define SN_cast5_cbc "CAST5-CBC"
-#define LN_cast5_cbc "cast5-cbc"
-#define NID_cast5_cbc 108
-#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L
-
-#define SN_cast5_ecb "CAST5-ECB"
-#define LN_cast5_ecb "cast5-ecb"
-#define NID_cast5_ecb 109
-
-#define SN_cast5_cfb64 "CAST5-CFB"
-#define LN_cast5_cfb64 "cast5-cfb"
-#define NID_cast5_cfb64 110
-
-#define SN_cast5_ofb64 "CAST5-OFB"
-#define LN_cast5_ofb64 "cast5-ofb"
-#define NID_cast5_ofb64 111
-
-#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
-#define NID_pbeWithMD5AndCast5_CBC 112
-#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L
-
-#define SN_rsadsi "rsadsi"
-#define LN_rsadsi "RSA Data Security, Inc."
-#define NID_rsadsi 1
-#define OBJ_rsadsi OBJ_ISO_US,113549L
-
-#define SN_pkcs "pkcs"
-#define LN_pkcs "RSA Data Security, Inc. PKCS"
-#define NID_pkcs 2
-#define OBJ_pkcs OBJ_rsadsi,1L
-
-#define SN_pkcs1 "pkcs1"
-#define NID_pkcs1 186
-#define OBJ_pkcs1 OBJ_pkcs,1L
-
-#define LN_rsaEncryption "rsaEncryption"
-#define NID_rsaEncryption 6
-#define OBJ_rsaEncryption OBJ_pkcs1,1L
-
-#define SN_md2WithRSAEncryption "RSA-MD2"
-#define LN_md2WithRSAEncryption "md2WithRSAEncryption"
-#define NID_md2WithRSAEncryption 7
-#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
-
-#define SN_md4WithRSAEncryption "RSA-MD4"
-#define LN_md4WithRSAEncryption "md4WithRSAEncryption"
-#define NID_md4WithRSAEncryption 396
-#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L
-
-#define SN_md5WithRSAEncryption "RSA-MD5"
-#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
-#define NID_md5WithRSAEncryption 8
-#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L
-
-#define SN_sha1WithRSAEncryption "RSA-SHA1"
-#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
-#define NID_sha1WithRSAEncryption 65
-#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
-
-#define SN_sha256WithRSAEncryption "RSA-SHA256"
-#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption"
-#define NID_sha256WithRSAEncryption 668
-#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L
-
-#define SN_sha384WithRSAEncryption "RSA-SHA384"
-#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption"
-#define NID_sha384WithRSAEncryption 669
-#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L
-
-#define SN_sha512WithRSAEncryption "RSA-SHA512"
-#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption"
-#define NID_sha512WithRSAEncryption 670
-#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L
-
-#define SN_sha224WithRSAEncryption "RSA-SHA224"
-#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption"
-#define NID_sha224WithRSAEncryption 671
-#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L
-
-#define SN_pkcs3 "pkcs3"
-#define NID_pkcs3 27
-#define OBJ_pkcs3 OBJ_pkcs,3L
-
-#define LN_dhKeyAgreement "dhKeyAgreement"
-#define NID_dhKeyAgreement 28
-#define OBJ_dhKeyAgreement OBJ_pkcs3,1L
-
-#define SN_pkcs5 "pkcs5"
-#define NID_pkcs5 187
-#define OBJ_pkcs5 OBJ_pkcs,5L
-
-#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
-#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
-#define NID_pbeWithMD2AndDES_CBC 9
-#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L
-
-#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
-#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
-#define NID_pbeWithMD5AndDES_CBC 10
-#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L
-
-#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
-#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
-#define NID_pbeWithMD2AndRC2_CBC 168
-#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L
-
-#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
-#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
-#define NID_pbeWithMD5AndRC2_CBC 169
-#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L
-
-#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
-#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
-#define NID_pbeWithSHA1AndDES_CBC 170
-#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L
-
-#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
-#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
-#define NID_pbeWithSHA1AndRC2_CBC 68
-#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L
-
-#define LN_id_pbkdf2 "PBKDF2"
-#define NID_id_pbkdf2 69
-#define OBJ_id_pbkdf2 OBJ_pkcs5,12L
-
-#define LN_pbes2 "PBES2"
-#define NID_pbes2 161
-#define OBJ_pbes2 OBJ_pkcs5,13L
-
-#define LN_pbmac1 "PBMAC1"
-#define NID_pbmac1 162
-#define OBJ_pbmac1 OBJ_pkcs5,14L
-
-#define SN_pkcs7 "pkcs7"
-#define NID_pkcs7 20
-#define OBJ_pkcs7 OBJ_pkcs,7L
-
-#define LN_pkcs7_data "pkcs7-data"
-#define NID_pkcs7_data 21
-#define OBJ_pkcs7_data OBJ_pkcs7,1L
-
-#define LN_pkcs7_signed "pkcs7-signedData"
-#define NID_pkcs7_signed 22
-#define OBJ_pkcs7_signed OBJ_pkcs7,2L
-
-#define LN_pkcs7_enveloped "pkcs7-envelopedData"
-#define NID_pkcs7_enveloped 23
-#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
-
-#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
-#define NID_pkcs7_signedAndEnveloped 24
-#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
-
-#define LN_pkcs7_digest "pkcs7-digestData"
-#define NID_pkcs7_digest 25
-#define OBJ_pkcs7_digest OBJ_pkcs7,5L
-
-#define LN_pkcs7_encrypted "pkcs7-encryptedData"
-#define NID_pkcs7_encrypted 26
-#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
-
-#define SN_pkcs9 "pkcs9"
-#define NID_pkcs9 47
-#define OBJ_pkcs9 OBJ_pkcs,9L
-
-#define LN_pkcs9_emailAddress "emailAddress"
-#define NID_pkcs9_emailAddress 48
-#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
-
-#define LN_pkcs9_unstructuredName "unstructuredName"
-#define NID_pkcs9_unstructuredName 49
-#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
-
-#define LN_pkcs9_contentType "contentType"
-#define NID_pkcs9_contentType 50
-#define OBJ_pkcs9_contentType OBJ_pkcs9,3L
-
-#define LN_pkcs9_messageDigest "messageDigest"
-#define NID_pkcs9_messageDigest 51
-#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
-
-#define LN_pkcs9_signingTime "signingTime"
-#define NID_pkcs9_signingTime 52
-#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
-
-#define LN_pkcs9_countersignature "countersignature"
-#define NID_pkcs9_countersignature 53
-#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
-
-#define LN_pkcs9_challengePassword "challengePassword"
-#define NID_pkcs9_challengePassword 54
-#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
-
-#define LN_pkcs9_unstructuredAddress "unstructuredAddress"
-#define NID_pkcs9_unstructuredAddress 55
-#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
-
-#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
-#define NID_pkcs9_extCertAttributes 56
-#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
-
-#define SN_ext_req "extReq"
-#define LN_ext_req "Extension Request"
-#define NID_ext_req 172
-#define OBJ_ext_req OBJ_pkcs9,14L
-
-#define SN_SMIMECapabilities "SMIME-CAPS"
-#define LN_SMIMECapabilities "S/MIME Capabilities"
-#define NID_SMIMECapabilities 167
-#define OBJ_SMIMECapabilities OBJ_pkcs9,15L
-
-#define SN_SMIME "SMIME"
-#define LN_SMIME "S/MIME"
-#define NID_SMIME 188
-#define OBJ_SMIME OBJ_pkcs9,16L
+#define SN_id_smime_mod_cms "id-smime-mod-cms"
+#define NID_id_smime_mod_cms 196
+#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L
-#define SN_id_smime_mod "id-smime-mod"
-#define NID_id_smime_mod 189
-#define OBJ_id_smime_mod OBJ_SMIME,0L
+#define SN_id_smime_mod_ess "id-smime-mod-ess"
+#define NID_id_smime_mod_ess 197
+#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L
-#define SN_id_smime_ct "id-smime-ct"
-#define NID_id_smime_ct 190
-#define OBJ_id_smime_ct OBJ_SMIME,1L
+#define SN_id_smime_mod_oid "id-smime-mod-oid"
+#define NID_id_smime_mod_oid 198
+#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L
-#define SN_id_smime_aa "id-smime-aa"
-#define NID_id_smime_aa 191
-#define OBJ_id_smime_aa OBJ_SMIME,2L
+#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3"
+#define NID_id_smime_mod_msg_v3 199
+#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L
-#define SN_id_smime_alg "id-smime-alg"
-#define NID_id_smime_alg 192
-#define OBJ_id_smime_alg OBJ_SMIME,3L
+#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88"
+#define NID_id_smime_mod_ets_eSignature_88 200
+#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L
-#define SN_id_smime_cd "id-smime-cd"
-#define NID_id_smime_cd 193
-#define OBJ_id_smime_cd OBJ_SMIME,4L
+#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97"
+#define NID_id_smime_mod_ets_eSignature_97 201
+#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L
-#define SN_id_smime_spq "id-smime-spq"
-#define NID_id_smime_spq 194
-#define OBJ_id_smime_spq OBJ_SMIME,5L
+#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88"
+#define NID_id_smime_mod_ets_eSigPolicy_88 202
+#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L
-#define SN_id_smime_cti "id-smime-cti"
-#define NID_id_smime_cti 195
-#define OBJ_id_smime_cti OBJ_SMIME,6L
+#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97"
+#define NID_id_smime_mod_ets_eSigPolicy_97 203
+#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L
-#define SN_id_smime_mod_cms "id-smime-mod-cms"
-#define NID_id_smime_mod_cms 196
-#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L
+#define SN_id_smime_ct_receipt "id-smime-ct-receipt"
+#define NID_id_smime_ct_receipt 204
+#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L
-#define SN_id_smime_mod_ess "id-smime-mod-ess"
-#define NID_id_smime_mod_ess 197
-#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L
+#define SN_id_smime_ct_authData "id-smime-ct-authData"
+#define NID_id_smime_ct_authData 205
+#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L
-#define SN_id_smime_mod_oid "id-smime-mod-oid"
-#define NID_id_smime_mod_oid 198
-#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L
+#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert"
+#define NID_id_smime_ct_publishCert 206
+#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L
-#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3"
-#define NID_id_smime_mod_msg_v3 199
-#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L
+#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo"
+#define NID_id_smime_ct_TSTInfo 207
+#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L
-#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88"
-#define NID_id_smime_mod_ets_eSignature_88 200
-#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L
+#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo"
+#define NID_id_smime_ct_TDTInfo 208
+#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L
-#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97"
-#define NID_id_smime_mod_ets_eSignature_97 201
-#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L
+#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo"
+#define NID_id_smime_ct_contentInfo 209
+#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L
-#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88"
-#define NID_id_smime_mod_ets_eSigPolicy_88 202
-#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L
+#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData"
+#define NID_id_smime_ct_DVCSRequestData 210
+#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L
-#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97"
-#define NID_id_smime_mod_ets_eSigPolicy_97 203
-#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L
+#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData"
+#define NID_id_smime_ct_DVCSResponseData 211
+#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L
-#define SN_id_smime_ct_receipt "id-smime-ct-receipt"
-#define NID_id_smime_ct_receipt 204
-#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L
+#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData"
+#define NID_id_smime_ct_compressedData 786
+#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L
-#define SN_id_smime_ct_authData "id-smime-ct-authData"
-#define NID_id_smime_ct_authData 205
-#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L
+#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF"
+#define NID_id_ct_asciiTextWithCRLF 787
+#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L
-#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert"
-#define NID_id_smime_ct_publishCert 206
-#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L
+#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest"
+#define NID_id_smime_aa_receiptRequest 212
+#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L
-#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo"
-#define NID_id_smime_ct_TSTInfo 207
-#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L
+#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel"
+#define NID_id_smime_aa_securityLabel 213
+#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L
-#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo"
-#define NID_id_smime_ct_TDTInfo 208
-#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L
+#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory"
+#define NID_id_smime_aa_mlExpandHistory 214
+#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L
-#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo"
-#define NID_id_smime_ct_contentInfo 209
-#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L
+#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint"
+#define NID_id_smime_aa_contentHint 215
+#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L
-#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData"
-#define NID_id_smime_ct_DVCSRequestData 210
-#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L
+#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest"
+#define NID_id_smime_aa_msgSigDigest 216
+#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L
-#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData"
-#define NID_id_smime_ct_DVCSResponseData 211
-#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L
+#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType"
+#define NID_id_smime_aa_encapContentType 217
+#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L
-#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest"
-#define NID_id_smime_aa_receiptRequest 212
-#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L
+#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier"
+#define NID_id_smime_aa_contentIdentifier 218
+#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L
-#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel"
-#define NID_id_smime_aa_securityLabel 213
-#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L
+#define SN_id_smime_aa_macValue "id-smime-aa-macValue"
+#define NID_id_smime_aa_macValue 219
+#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L
-#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory"
-#define NID_id_smime_aa_mlExpandHistory 214
-#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L
+#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels"
+#define NID_id_smime_aa_equivalentLabels 220
+#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L
-#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint"
-#define NID_id_smime_aa_contentHint 215
-#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L
+#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference"
+#define NID_id_smime_aa_contentReference 221
+#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L
-#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest"
-#define NID_id_smime_aa_msgSigDigest 216
-#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L
+#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref"
+#define NID_id_smime_aa_encrypKeyPref 222
+#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L
-#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType"
-#define NID_id_smime_aa_encapContentType 217
-#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L
+#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate"
+#define NID_id_smime_aa_signingCertificate 223
+#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L
-#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier"
-#define NID_id_smime_aa_contentIdentifier 218
-#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L
+#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts"
+#define NID_id_smime_aa_smimeEncryptCerts 224
+#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L
-#define SN_id_smime_aa_macValue "id-smime-aa-macValue"
-#define NID_id_smime_aa_macValue 219
-#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L
+#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken"
+#define NID_id_smime_aa_timeStampToken 225
+#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L
-#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels"
-#define NID_id_smime_aa_equivalentLabels 220
-#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L
+#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId"
+#define NID_id_smime_aa_ets_sigPolicyId 226
+#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L
-#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference"
-#define NID_id_smime_aa_contentReference 221
-#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L
+#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType"
+#define NID_id_smime_aa_ets_commitmentType 227
+#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L
-#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref"
-#define NID_id_smime_aa_encrypKeyPref 222
-#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L
+#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation"
+#define NID_id_smime_aa_ets_signerLocation 228
+#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L
-#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate"
-#define NID_id_smime_aa_signingCertificate 223
-#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L
+#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr"
+#define NID_id_smime_aa_ets_signerAttr 229
+#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L
-#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts"
-#define NID_id_smime_aa_smimeEncryptCerts 224
-#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L
+#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert"
+#define NID_id_smime_aa_ets_otherSigCert 230
+#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L
-#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken"
-#define NID_id_smime_aa_timeStampToken 225
-#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L
+#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp"
+#define NID_id_smime_aa_ets_contentTimestamp 231
+#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L
-#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId"
-#define NID_id_smime_aa_ets_sigPolicyId 226
-#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L
+#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs"
+#define NID_id_smime_aa_ets_CertificateRefs 232
+#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L
-#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType"
-#define NID_id_smime_aa_ets_commitmentType 227
-#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L
+#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs"
+#define NID_id_smime_aa_ets_RevocationRefs 233
+#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L
-#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation"
-#define NID_id_smime_aa_ets_signerLocation 228
-#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L
+#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues"
+#define NID_id_smime_aa_ets_certValues 234
+#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L
-#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr"
-#define NID_id_smime_aa_ets_signerAttr 229
-#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L
+#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues"
+#define NID_id_smime_aa_ets_revocationValues 235
+#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L
-#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert"
-#define NID_id_smime_aa_ets_otherSigCert 230
-#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L
+#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp"
+#define NID_id_smime_aa_ets_escTimeStamp 236
+#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L
-#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp"
-#define NID_id_smime_aa_ets_contentTimestamp 231
-#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L
+#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp"
+#define NID_id_smime_aa_ets_certCRLTimestamp 237
+#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L
-#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs"
-#define NID_id_smime_aa_ets_CertificateRefs 232
-#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L
+#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp"
+#define NID_id_smime_aa_ets_archiveTimeStamp 238
+#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L
-#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs"
-#define NID_id_smime_aa_ets_RevocationRefs 233
-#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L
+#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType"
+#define NID_id_smime_aa_signatureType 239
+#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L
-#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues"
-#define NID_id_smime_aa_ets_certValues 234
-#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L
+#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc"
+#define NID_id_smime_aa_dvcs_dvc 240
+#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
-#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues"
-#define NID_id_smime_aa_ets_revocationValues 235
-#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L
+#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES"
+#define NID_id_smime_alg_ESDHwith3DES 241
+#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L
-#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp"
-#define NID_id_smime_aa_ets_escTimeStamp 236
-#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L
+#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2"
+#define NID_id_smime_alg_ESDHwithRC2 242
+#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L
-#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp"
-#define NID_id_smime_aa_ets_certCRLTimestamp 237
-#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L
+#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap"
+#define NID_id_smime_alg_3DESwrap 243
+#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L
-#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp"
-#define NID_id_smime_aa_ets_archiveTimeStamp 238
-#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L
+#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap"
+#define NID_id_smime_alg_RC2wrap 244
+#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L
-#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType"
-#define NID_id_smime_aa_signatureType 239
-#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L
+#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH"
+#define NID_id_smime_alg_ESDH 245
+#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L
-#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc"
-#define NID_id_smime_aa_dvcs_dvc 240
-#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
+#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap"
+#define NID_id_smime_alg_CMS3DESwrap 246
+#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L
-#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES"
-#define NID_id_smime_alg_ESDHwith3DES 241
-#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L
+#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap"
+#define NID_id_smime_alg_CMSRC2wrap 247
+#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
-#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2"
-#define NID_id_smime_alg_ESDHwithRC2 242
-#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L
+#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
+#define NID_id_smime_cd_ldap 248
+#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
-#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap"
-#define NID_id_smime_alg_3DESwrap 243
-#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L
+#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri"
+#define NID_id_smime_spq_ets_sqt_uri 249
+#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L
-#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap"
-#define NID_id_smime_alg_RC2wrap 244
-#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L
+#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice"
+#define NID_id_smime_spq_ets_sqt_unotice 250
+#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L
-#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH"
-#define NID_id_smime_alg_ESDH 245
-#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L
+#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin"
+#define NID_id_smime_cti_ets_proofOfOrigin 251
+#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L
-#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap"
-#define NID_id_smime_alg_CMS3DESwrap 246
-#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L
+#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt"
+#define NID_id_smime_cti_ets_proofOfReceipt 252
+#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L
-#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap"
-#define NID_id_smime_alg_CMSRC2wrap 247
-#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
+#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery"
+#define NID_id_smime_cti_ets_proofOfDelivery 253
+#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L
-#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
-#define NID_id_smime_cd_ldap 248
-#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
+#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender"
+#define NID_id_smime_cti_ets_proofOfSender 254
+#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L
-#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri"
-#define NID_id_smime_spq_ets_sqt_uri 249
-#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L
+#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval"
+#define NID_id_smime_cti_ets_proofOfApproval 255
+#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L
-#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice"
-#define NID_id_smime_spq_ets_sqt_unotice 250
-#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L
+#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation"
+#define NID_id_smime_cti_ets_proofOfCreation 256
+#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L
-#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin"
-#define NID_id_smime_cti_ets_proofOfOrigin 251
-#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L
+#define LN_friendlyName "friendlyName"
+#define NID_friendlyName 156
+#define OBJ_friendlyName OBJ_pkcs9,20L
-#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt"
-#define NID_id_smime_cti_ets_proofOfReceipt 252
-#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L
+#define LN_localKeyID "localKeyID"
+#define NID_localKeyID 157
+#define OBJ_localKeyID OBJ_pkcs9,21L
-#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery"
-#define NID_id_smime_cti_ets_proofOfDelivery 253
-#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L
+#define SN_ms_csp_name "CSPName"
+#define LN_ms_csp_name "Microsoft CSP Name"
+#define NID_ms_csp_name 417
+#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L
-#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender"
-#define NID_id_smime_cti_ets_proofOfSender 254
-#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L
+#define SN_LocalKeySet "LocalKeySet"
+#define LN_LocalKeySet "Microsoft Local Key set"
+#define NID_LocalKeySet 856
+#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L
-#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval"
-#define NID_id_smime_cti_ets_proofOfApproval 255
-#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L
+#define OBJ_certTypes OBJ_pkcs9,22L
-#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation"
-#define NID_id_smime_cti_ets_proofOfCreation 256
-#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L
+#define LN_x509Certificate "x509Certificate"
+#define NID_x509Certificate 158
+#define OBJ_x509Certificate OBJ_certTypes,1L
-#define LN_friendlyName "friendlyName"
-#define NID_friendlyName 156
-#define OBJ_friendlyName OBJ_pkcs9,20L
+#define LN_sdsiCertificate "sdsiCertificate"
+#define NID_sdsiCertificate 159
+#define OBJ_sdsiCertificate OBJ_certTypes,2L
-#define LN_localKeyID "localKeyID"
-#define NID_localKeyID 157
-#define OBJ_localKeyID OBJ_pkcs9,21L
+#define OBJ_crlTypes OBJ_pkcs9,23L
-#define SN_ms_csp_name "CSPName"
-#define LN_ms_csp_name "Microsoft CSP Name"
-#define NID_ms_csp_name 417
-#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L
+#define LN_x509Crl "x509Crl"
+#define NID_x509Crl 160
+#define OBJ_x509Crl OBJ_crlTypes,1L
-#define OBJ_certTypes OBJ_pkcs9,22L
+#define OBJ_pkcs12 OBJ_pkcs,12L
-#define LN_x509Certificate "x509Certificate"
-#define NID_x509Certificate 158
-#define OBJ_x509Certificate OBJ_certTypes,1L
+#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L
-#define LN_sdsiCertificate "sdsiCertificate"
-#define NID_sdsiCertificate 159
-#define OBJ_sdsiCertificate OBJ_certTypes,2L
+#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
+#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
+#define NID_pbe_WithSHA1And128BitRC4 144
+#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L
-#define OBJ_crlTypes OBJ_pkcs9,23L
+#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
+#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
+#define NID_pbe_WithSHA1And40BitRC4 145
+#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L
-#define LN_x509Crl "x509Crl"
-#define NID_x509Crl 160
-#define OBJ_x509Crl OBJ_crlTypes,1L
+#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
+#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
+#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L
-#define OBJ_pkcs12 OBJ_pkcs,12L
+#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
+#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
+#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L
-#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L
+#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
+#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
+#define NID_pbe_WithSHA1And128BitRC2_CBC 148
+#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L
-#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
-#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
-#define NID_pbe_WithSHA1And128BitRC4 144
-#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L
+#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
+#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
+#define NID_pbe_WithSHA1And40BitRC2_CBC 149
+#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L
-#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
-#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
-#define NID_pbe_WithSHA1And40BitRC4 145
-#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L
+#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L
-#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
-#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
-#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
-#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L
+#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L
-#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
-#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
-#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
-#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L
+#define LN_keyBag "keyBag"
+#define NID_keyBag 150
+#define OBJ_keyBag OBJ_pkcs12_BagIds,1L
-#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
-#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
-#define NID_pbe_WithSHA1And128BitRC2_CBC 148
-#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L
+#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
+#define NID_pkcs8ShroudedKeyBag 151
+#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L
-#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
-#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
-#define NID_pbe_WithSHA1And40BitRC2_CBC 149
-#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L
+#define LN_certBag "certBag"
+#define NID_certBag 152
+#define OBJ_certBag OBJ_pkcs12_BagIds,3L
-#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L
-
-#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L
+#define LN_crlBag "crlBag"
+#define NID_crlBag 153
+#define OBJ_crlBag OBJ_pkcs12_BagIds,4L
-#define LN_keyBag "keyBag"
-#define NID_keyBag 150
-#define OBJ_keyBag OBJ_pkcs12_BagIds,1L
+#define LN_secretBag "secretBag"
+#define NID_secretBag 154
+#define OBJ_secretBag OBJ_pkcs12_BagIds,5L
-#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
-#define NID_pkcs8ShroudedKeyBag 151
-#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L
+#define LN_safeContentsBag "safeContentsBag"
+#define NID_safeContentsBag 155
+#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L
-#define LN_certBag "certBag"
-#define NID_certBag 152
-#define OBJ_certBag OBJ_pkcs12_BagIds,3L
-
-#define LN_crlBag "crlBag"
-#define NID_crlBag 153
-#define OBJ_crlBag OBJ_pkcs12_BagIds,4L
-
-#define LN_secretBag "secretBag"
-#define NID_secretBag 154
-#define OBJ_secretBag OBJ_pkcs12_BagIds,5L
-
-#define LN_safeContentsBag "safeContentsBag"
-#define NID_safeContentsBag 155
-#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L
-
-#define SN_md2 "MD2"
-#define LN_md2 "md2"
-#define NID_md2 3
-#define OBJ_md2 OBJ_rsadsi,2L,2L
-
-#define SN_md4 "MD4"
-#define LN_md4 "md4"
-#define NID_md4 257
-#define OBJ_md4 OBJ_rsadsi,2L,4L
-
-#define SN_md5 "MD5"
-#define LN_md5 "md5"
-#define NID_md5 4
-#define OBJ_md5 OBJ_rsadsi,2L,5L
-
-#define SN_md5_sha1 "MD5-SHA1"
-#define LN_md5_sha1 "md5-sha1"
-#define NID_md5_sha1 114
-
-#define LN_hmacWithSHA1 "hmacWithSHA1"
-#define NID_hmacWithSHA1 163
-#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
-
-#define SN_rc2_cbc "RC2-CBC"
-#define LN_rc2_cbc "rc2-cbc"
-#define NID_rc2_cbc 37
-#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
-
-#define SN_rc2_ecb "RC2-ECB"
-#define LN_rc2_ecb "rc2-ecb"
-#define NID_rc2_ecb 38
-
-#define SN_rc2_cfb64 "RC2-CFB"
-#define LN_rc2_cfb64 "rc2-cfb"
-#define NID_rc2_cfb64 39
-
-#define SN_rc2_ofb64 "RC2-OFB"
-#define LN_rc2_ofb64 "rc2-ofb"
-#define NID_rc2_ofb64 40
-
-#define SN_rc2_40_cbc "RC2-40-CBC"
-#define LN_rc2_40_cbc "rc2-40-cbc"
-#define NID_rc2_40_cbc 98
-
-#define SN_rc2_64_cbc "RC2-64-CBC"
-#define LN_rc2_64_cbc "rc2-64-cbc"
-#define NID_rc2_64_cbc 166
-
-#define SN_rc4 "RC4"
-#define LN_rc4 "rc4"
-#define NID_rc4 5
-#define OBJ_rc4 OBJ_rsadsi,3L,4L
-
-#define SN_rc4_40 "RC4-40"
-#define LN_rc4_40 "rc4-40"
-#define NID_rc4_40 97
-
-#define SN_des_ede3_cbc "DES-EDE3-CBC"
-#define LN_des_ede3_cbc "des-ede3-cbc"
-#define NID_des_ede3_cbc 44
-#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
-
-#define SN_rc5_cbc "RC5-CBC"
-#define LN_rc5_cbc "rc5-cbc"
-#define NID_rc5_cbc 120
-#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
-
-#define SN_rc5_ecb "RC5-ECB"
-#define LN_rc5_ecb "rc5-ecb"
-#define NID_rc5_ecb 121
-
-#define SN_rc5_cfb64 "RC5-CFB"
-#define LN_rc5_cfb64 "rc5-cfb"
-#define NID_rc5_cfb64 122
-
-#define SN_rc5_ofb64 "RC5-OFB"
-#define LN_rc5_ofb64 "rc5-ofb"
-#define NID_rc5_ofb64 123
-
-#define SN_ms_ext_req "msExtReq"
-#define LN_ms_ext_req "Microsoft Extension Request"
-#define NID_ms_ext_req 171
-#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
-
-#define SN_ms_code_ind "msCodeInd"
-#define LN_ms_code_ind "Microsoft Individual Code Signing"
-#define NID_ms_code_ind 134
-#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
-
-#define SN_ms_code_com "msCodeCom"
-#define LN_ms_code_com "Microsoft Commercial Code Signing"
-#define NID_ms_code_com 135
-#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
-
-#define SN_ms_ctl_sign "msCTLSign"
-#define LN_ms_ctl_sign "Microsoft Trust List Signing"
-#define NID_ms_ctl_sign 136
-#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
-
-#define SN_ms_sgc "msSGC"
-#define LN_ms_sgc "Microsoft Server Gated Crypto"
-#define NID_ms_sgc 137
-#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
-
-#define SN_ms_efs "msEFS"
-#define LN_ms_efs "Microsoft Encrypted File System"
-#define NID_ms_efs 138
-#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
-
-#define SN_ms_smartcard_login "msSmartcardLogin"
-#define LN_ms_smartcard_login "Microsoft Smartcardlogin"
-#define NID_ms_smartcard_login 648
-#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L
-
-#define SN_ms_upn "msUPN"
-#define LN_ms_upn "Microsoft Universal Principal Name"
-#define NID_ms_upn 649
-#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L
-
-#define SN_idea_cbc "IDEA-CBC"
-#define LN_idea_cbc "idea-cbc"
-#define NID_idea_cbc 34
-#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
-
-#define SN_idea_ecb "IDEA-ECB"
-#define LN_idea_ecb "idea-ecb"
-#define NID_idea_ecb 36
-
-#define SN_idea_cfb64 "IDEA-CFB"
-#define LN_idea_cfb64 "idea-cfb"
-#define NID_idea_cfb64 35
-
-#define SN_idea_ofb64 "IDEA-OFB"
-#define LN_idea_ofb64 "idea-ofb"
-#define NID_idea_ofb64 46
-
-#define SN_bf_cbc "BF-CBC"
-#define LN_bf_cbc "bf-cbc"
-#define NID_bf_cbc 91
-#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
-
-#define SN_bf_ecb "BF-ECB"
-#define LN_bf_ecb "bf-ecb"
-#define NID_bf_ecb 92
-
-#define SN_bf_cfb64 "BF-CFB"
-#define LN_bf_cfb64 "bf-cfb"
-#define NID_bf_cfb64 93
-
-#define SN_bf_ofb64 "BF-OFB"
-#define LN_bf_ofb64 "bf-ofb"
-#define NID_bf_ofb64 94
-
-#define SN_id_pkix "PKIX"
-#define NID_id_pkix 127
-#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
-
-#define SN_id_pkix_mod "id-pkix-mod"
-#define NID_id_pkix_mod 258
-#define OBJ_id_pkix_mod OBJ_id_pkix,0L
-
-#define SN_id_pe "id-pe"
-#define NID_id_pe 175
-#define OBJ_id_pe OBJ_id_pkix,1L
-
-#define SN_id_qt "id-qt"
-#define NID_id_qt 259
-#define OBJ_id_qt OBJ_id_pkix,2L
-
-#define SN_id_kp "id-kp"
-#define NID_id_kp 128
-#define OBJ_id_kp OBJ_id_pkix,3L
-
-#define SN_id_it "id-it"
-#define NID_id_it 260
-#define OBJ_id_it OBJ_id_pkix,4L
-
-#define SN_id_pkip "id-pkip"
-#define NID_id_pkip 261
-#define OBJ_id_pkip OBJ_id_pkix,5L
-
-#define SN_id_alg "id-alg"
-#define NID_id_alg 262
-#define OBJ_id_alg OBJ_id_pkix,6L
-
-#define SN_id_cmc "id-cmc"
-#define NID_id_cmc 263
-#define OBJ_id_cmc OBJ_id_pkix,7L
-
-#define SN_id_on "id-on"
-#define NID_id_on 264
-#define OBJ_id_on OBJ_id_pkix,8L
-
-#define SN_id_pda "id-pda"
-#define NID_id_pda 265
-#define OBJ_id_pda OBJ_id_pkix,9L
-
-#define SN_id_aca "id-aca"
-#define NID_id_aca 266
-#define OBJ_id_aca OBJ_id_pkix,10L
-
-#define SN_id_qcs "id-qcs"
-#define NID_id_qcs 267
-#define OBJ_id_qcs OBJ_id_pkix,11L
-
-#define SN_id_cct "id-cct"
-#define NID_id_cct 268
-#define OBJ_id_cct OBJ_id_pkix,12L
-
-#define SN_id_ppl "id-ppl"
-#define NID_id_ppl 662
-#define OBJ_id_ppl OBJ_id_pkix,21L
-
-#define SN_id_ad "id-ad"
-#define NID_id_ad 176
-#define OBJ_id_ad OBJ_id_pkix,48L
-
-#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88"
-#define NID_id_pkix1_explicit_88 269
-#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L
-
-#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88"
-#define NID_id_pkix1_implicit_88 270
-#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L
-
-#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93"
-#define NID_id_pkix1_explicit_93 271
-#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L
-
-#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93"
-#define NID_id_pkix1_implicit_93 272
-#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L
-
-#define SN_id_mod_crmf "id-mod-crmf"
-#define NID_id_mod_crmf 273
-#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L
-
-#define SN_id_mod_cmc "id-mod-cmc"
-#define NID_id_mod_cmc 274
-#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L
-
-#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88"
-#define NID_id_mod_kea_profile_88 275
-#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L
-
-#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93"
-#define NID_id_mod_kea_profile_93 276
-#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L
-
-#define SN_id_mod_cmp "id-mod-cmp"
-#define NID_id_mod_cmp 277
-#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L
-
-#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88"
-#define NID_id_mod_qualified_cert_88 278
-#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L
-
-#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93"
-#define NID_id_mod_qualified_cert_93 279
-#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L
-
-#define SN_id_mod_attribute_cert "id-mod-attribute-cert"
-#define NID_id_mod_attribute_cert 280
-#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L
-
-#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol"
-#define NID_id_mod_timestamp_protocol 281
-#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L
-
-#define SN_id_mod_ocsp "id-mod-ocsp"
-#define NID_id_mod_ocsp 282
-#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L
-
-#define SN_id_mod_dvcs "id-mod-dvcs"
-#define NID_id_mod_dvcs 283
-#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L
-
-#define SN_id_mod_cmp2000 "id-mod-cmp2000"
-#define NID_id_mod_cmp2000 284
-#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L
-
-#define SN_info_access "authorityInfoAccess"
-#define LN_info_access "Authority Information Access"
-#define NID_info_access 177
-#define OBJ_info_access OBJ_id_pe,1L
-
-#define SN_biometricInfo "biometricInfo"
-#define LN_biometricInfo "Biometric Info"
-#define NID_biometricInfo 285
-#define OBJ_biometricInfo OBJ_id_pe,2L
-
-#define SN_qcStatements "qcStatements"
-#define NID_qcStatements 286
-#define OBJ_qcStatements OBJ_id_pe,3L
-
-#define SN_ac_auditEntity "ac-auditEntity"
-#define NID_ac_auditEntity 287
-#define OBJ_ac_auditEntity OBJ_id_pe,4L
-
-#define SN_ac_targeting "ac-targeting"
-#define NID_ac_targeting 288
-#define OBJ_ac_targeting OBJ_id_pe,5L
-
-#define SN_aaControls "aaControls"
-#define NID_aaControls 289
-#define OBJ_aaControls OBJ_id_pe,6L
-
-#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock"
-#define NID_sbgp_ipAddrBlock 290
-#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L
-
-#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum"
-#define NID_sbgp_autonomousSysNum 291
-#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L
-
-#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier"
-#define NID_sbgp_routerIdentifier 292
-#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L
-
-#define SN_ac_proxying "ac-proxying"
-#define NID_ac_proxying 397
-#define OBJ_ac_proxying OBJ_id_pe,10L
-
-#define SN_sinfo_access "subjectInfoAccess"
-#define LN_sinfo_access "Subject Information Access"
-#define NID_sinfo_access 398
-#define OBJ_sinfo_access OBJ_id_pe,11L
-
-#define SN_proxyCertInfo "proxyCertInfo"
-#define LN_proxyCertInfo "Proxy Certificate Information"
-#define NID_proxyCertInfo 663
-#define OBJ_proxyCertInfo OBJ_id_pe,14L
-
-#define SN_id_qt_cps "id-qt-cps"
-#define LN_id_qt_cps "Policy Qualifier CPS"
-#define NID_id_qt_cps 164
-#define OBJ_id_qt_cps OBJ_id_qt,1L
-
-#define SN_id_qt_unotice "id-qt-unotice"
-#define LN_id_qt_unotice "Policy Qualifier User Notice"
-#define NID_id_qt_unotice 165
-#define OBJ_id_qt_unotice OBJ_id_qt,2L
-
-#define SN_textNotice "textNotice"
-#define NID_textNotice 293
-#define OBJ_textNotice OBJ_id_qt,3L
-
-#define SN_server_auth "serverAuth"
-#define LN_server_auth "TLS Web Server Authentication"
-#define NID_server_auth 129
-#define OBJ_server_auth OBJ_id_kp,1L
-
-#define SN_client_auth "clientAuth"
-#define LN_client_auth "TLS Web Client Authentication"
-#define NID_client_auth 130
-#define OBJ_client_auth OBJ_id_kp,2L
-
-#define SN_code_sign "codeSigning"
-#define LN_code_sign "Code Signing"
-#define NID_code_sign 131
-#define OBJ_code_sign OBJ_id_kp,3L
-
-#define SN_email_protect "emailProtection"
-#define LN_email_protect "E-mail Protection"
-#define NID_email_protect 132
-#define OBJ_email_protect OBJ_id_kp,4L
-
-#define SN_ipsecEndSystem "ipsecEndSystem"
-#define LN_ipsecEndSystem "IPSec End System"
-#define NID_ipsecEndSystem 294
-#define OBJ_ipsecEndSystem OBJ_id_kp,5L
-
-#define SN_ipsecTunnel "ipsecTunnel"
-#define LN_ipsecTunnel "IPSec Tunnel"
-#define NID_ipsecTunnel 295
-#define OBJ_ipsecTunnel OBJ_id_kp,6L
-
-#define SN_ipsecUser "ipsecUser"
-#define LN_ipsecUser "IPSec User"
-#define NID_ipsecUser 296
-#define OBJ_ipsecUser OBJ_id_kp,7L
-
-#define SN_time_stamp "timeStamping"
-#define LN_time_stamp "Time Stamping"
-#define NID_time_stamp 133
-#define OBJ_time_stamp OBJ_id_kp,8L
-
-#define SN_OCSP_sign "OCSPSigning"
-#define LN_OCSP_sign "OCSP Signing"
-#define NID_OCSP_sign 180
-#define OBJ_OCSP_sign OBJ_id_kp,9L
-
-#define SN_dvcs "DVCS"
-#define LN_dvcs "dvcs"
-#define NID_dvcs 297
-#define OBJ_dvcs OBJ_id_kp,10L
-
-#define SN_id_it_caProtEncCert "id-it-caProtEncCert"
-#define NID_id_it_caProtEncCert 298
-#define OBJ_id_it_caProtEncCert OBJ_id_it,1L
-
-#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes"
-#define NID_id_it_signKeyPairTypes 299
-#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L
-
-#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes"
-#define NID_id_it_encKeyPairTypes 300
-#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L
-
-#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg"
-#define NID_id_it_preferredSymmAlg 301
-#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L
-
-#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo"
-#define NID_id_it_caKeyUpdateInfo 302
-#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L
-
-#define SN_id_it_currentCRL "id-it-currentCRL"
-#define NID_id_it_currentCRL 303
-#define OBJ_id_it_currentCRL OBJ_id_it,6L
-
-#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs"
-#define NID_id_it_unsupportedOIDs 304
-#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L
-
-#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest"
-#define NID_id_it_subscriptionRequest 305
-#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L
-
-#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse"
-#define NID_id_it_subscriptionResponse 306
-#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L
-
-#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq"
-#define NID_id_it_keyPairParamReq 307
-#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L
-
-#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep"
-#define NID_id_it_keyPairParamRep 308
-#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L
-
-#define SN_id_it_revPassphrase "id-it-revPassphrase"
-#define NID_id_it_revPassphrase 309
-#define OBJ_id_it_revPassphrase OBJ_id_it,12L
-
-#define SN_id_it_implicitConfirm "id-it-implicitConfirm"
-#define NID_id_it_implicitConfirm 310
-#define OBJ_id_it_implicitConfirm OBJ_id_it,13L
-
-#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime"
-#define NID_id_it_confirmWaitTime 311
-#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L
-
-#define SN_id_it_origPKIMessage "id-it-origPKIMessage"
-#define NID_id_it_origPKIMessage 312
-#define OBJ_id_it_origPKIMessage OBJ_id_it,15L
-
-#define SN_id_regCtrl "id-regCtrl"
-#define NID_id_regCtrl 313
-#define OBJ_id_regCtrl OBJ_id_pkip,1L
-
-#define SN_id_regInfo "id-regInfo"
-#define NID_id_regInfo 314
-#define OBJ_id_regInfo OBJ_id_pkip,2L
-
-#define SN_id_regCtrl_regToken "id-regCtrl-regToken"
-#define NID_id_regCtrl_regToken 315
-#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L
-
-#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator"
-#define NID_id_regCtrl_authenticator 316
-#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L
-
-#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo"
-#define NID_id_regCtrl_pkiPublicationInfo 317
-#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L
+#define SN_md2 "MD2"
+#define LN_md2 "md2"
+#define NID_md2 3
+#define OBJ_md2 OBJ_rsadsi,2L,2L
+
+#define SN_md4 "MD4"
+#define LN_md4 "md4"
+#define NID_md4 257
+#define OBJ_md4 OBJ_rsadsi,2L,4L
+
+#define SN_md5 "MD5"
+#define LN_md5 "md5"
+#define NID_md5 4
+#define OBJ_md5 OBJ_rsadsi,2L,5L
+
+#define SN_md5_sha1 "MD5-SHA1"
+#define LN_md5_sha1 "md5-sha1"
+#define NID_md5_sha1 114
+
+#define LN_hmacWithMD5 "hmacWithMD5"
+#define NID_hmacWithMD5 797
+#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L
+
+#define LN_hmacWithSHA1 "hmacWithSHA1"
+#define NID_hmacWithSHA1 163
+#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
+
+#define LN_hmacWithSHA224 "hmacWithSHA224"
+#define NID_hmacWithSHA224 798
+#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L
+
+#define LN_hmacWithSHA256 "hmacWithSHA256"
+#define NID_hmacWithSHA256 799
+#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L
+
+#define LN_hmacWithSHA384 "hmacWithSHA384"
+#define NID_hmacWithSHA384 800
+#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L
+
+#define LN_hmacWithSHA512 "hmacWithSHA512"
+#define NID_hmacWithSHA512 801
+#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L
+
+#define SN_rc2_cbc "RC2-CBC"
+#define LN_rc2_cbc "rc2-cbc"
+#define NID_rc2_cbc 37
+#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
+
+#define SN_rc2_ecb "RC2-ECB"
+#define LN_rc2_ecb "rc2-ecb"
+#define NID_rc2_ecb 38
+
+#define SN_rc2_cfb64 "RC2-CFB"
+#define LN_rc2_cfb64 "rc2-cfb"
+#define NID_rc2_cfb64 39
+
+#define SN_rc2_ofb64 "RC2-OFB"
+#define LN_rc2_ofb64 "rc2-ofb"
+#define NID_rc2_ofb64 40
+
+#define SN_rc2_40_cbc "RC2-40-CBC"
+#define LN_rc2_40_cbc "rc2-40-cbc"
+#define NID_rc2_40_cbc 98
+
+#define SN_rc2_64_cbc "RC2-64-CBC"
+#define LN_rc2_64_cbc "rc2-64-cbc"
+#define NID_rc2_64_cbc 166
+
+#define SN_rc4 "RC4"
+#define LN_rc4 "rc4"
+#define NID_rc4 5
+#define OBJ_rc4 OBJ_rsadsi,3L,4L
+
+#define SN_rc4_40 "RC4-40"
+#define LN_rc4_40 "rc4-40"
+#define NID_rc4_40 97
+
+#define SN_des_ede3_cbc "DES-EDE3-CBC"
+#define LN_des_ede3_cbc "des-ede3-cbc"
+#define NID_des_ede3_cbc 44
+#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
+
+#define SN_rc5_cbc "RC5-CBC"
+#define LN_rc5_cbc "rc5-cbc"
+#define NID_rc5_cbc 120
+#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
+
+#define SN_rc5_ecb "RC5-ECB"
+#define LN_rc5_ecb "rc5-ecb"
+#define NID_rc5_ecb 121
+
+#define SN_rc5_cfb64 "RC5-CFB"
+#define LN_rc5_cfb64 "rc5-cfb"
+#define NID_rc5_cfb64 122
+
+#define SN_rc5_ofb64 "RC5-OFB"
+#define LN_rc5_ofb64 "rc5-ofb"
+#define NID_rc5_ofb64 123
+
+#define SN_ms_ext_req "msExtReq"
+#define LN_ms_ext_req "Microsoft Extension Request"
+#define NID_ms_ext_req 171
+#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
+
+#define SN_ms_code_ind "msCodeInd"
+#define LN_ms_code_ind "Microsoft Individual Code Signing"
+#define NID_ms_code_ind 134
+#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
+
+#define SN_ms_code_com "msCodeCom"
+#define LN_ms_code_com "Microsoft Commercial Code Signing"
+#define NID_ms_code_com 135
+#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
+
+#define SN_ms_ctl_sign "msCTLSign"
+#define LN_ms_ctl_sign "Microsoft Trust List Signing"
+#define NID_ms_ctl_sign 136
+#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
+
+#define SN_ms_sgc "msSGC"
+#define LN_ms_sgc "Microsoft Server Gated Crypto"
+#define NID_ms_sgc 137
+#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
+
+#define SN_ms_efs "msEFS"
+#define LN_ms_efs "Microsoft Encrypted File System"
+#define NID_ms_efs 138
+#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
+
+#define SN_ms_smartcard_login "msSmartcardLogin"
+#define LN_ms_smartcard_login "Microsoft Smartcardlogin"
+#define NID_ms_smartcard_login 648
+#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L
+
+#define SN_ms_upn "msUPN"
+#define LN_ms_upn "Microsoft Universal Principal Name"
+#define NID_ms_upn 649
+#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L
+
+#define SN_idea_cbc "IDEA-CBC"
+#define LN_idea_cbc "idea-cbc"
+#define NID_idea_cbc 34
+#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
+
+#define SN_idea_ecb "IDEA-ECB"
+#define LN_idea_ecb "idea-ecb"
+#define NID_idea_ecb 36
+
+#define SN_idea_cfb64 "IDEA-CFB"
+#define LN_idea_cfb64 "idea-cfb"
+#define NID_idea_cfb64 35
+
+#define SN_idea_ofb64 "IDEA-OFB"
+#define LN_idea_ofb64 "idea-ofb"
+#define NID_idea_ofb64 46
+
+#define SN_bf_cbc "BF-CBC"
+#define LN_bf_cbc "bf-cbc"
+#define NID_bf_cbc 91
+#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
+
+#define SN_bf_ecb "BF-ECB"
+#define LN_bf_ecb "bf-ecb"
+#define NID_bf_ecb 92
+
+#define SN_bf_cfb64 "BF-CFB"
+#define LN_bf_cfb64 "bf-cfb"
+#define NID_bf_cfb64 93
+
+#define SN_bf_ofb64 "BF-OFB"
+#define LN_bf_ofb64 "bf-ofb"
+#define NID_bf_ofb64 94
+
+#define SN_id_pkix "PKIX"
+#define NID_id_pkix 127
+#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
+
+#define SN_id_pkix_mod "id-pkix-mod"
+#define NID_id_pkix_mod 258
+#define OBJ_id_pkix_mod OBJ_id_pkix,0L
+
+#define SN_id_pe "id-pe"
+#define NID_id_pe 175
+#define OBJ_id_pe OBJ_id_pkix,1L
+
+#define SN_id_qt "id-qt"
+#define NID_id_qt 259
+#define OBJ_id_qt OBJ_id_pkix,2L
+
+#define SN_id_kp "id-kp"
+#define NID_id_kp 128
+#define OBJ_id_kp OBJ_id_pkix,3L
+
+#define SN_id_it "id-it"
+#define NID_id_it 260
+#define OBJ_id_it OBJ_id_pkix,4L
+
+#define SN_id_pkip "id-pkip"
+#define NID_id_pkip 261
+#define OBJ_id_pkip OBJ_id_pkix,5L
+
+#define SN_id_alg "id-alg"
+#define NID_id_alg 262
+#define OBJ_id_alg OBJ_id_pkix,6L
+
+#define SN_id_cmc "id-cmc"
+#define NID_id_cmc 263
+#define OBJ_id_cmc OBJ_id_pkix,7L
+
+#define SN_id_on "id-on"
+#define NID_id_on 264
+#define OBJ_id_on OBJ_id_pkix,8L
+
+#define SN_id_pda "id-pda"
+#define NID_id_pda 265
+#define OBJ_id_pda OBJ_id_pkix,9L
+
+#define SN_id_aca "id-aca"
+#define NID_id_aca 266
+#define OBJ_id_aca OBJ_id_pkix,10L
+
+#define SN_id_qcs "id-qcs"
+#define NID_id_qcs 267
+#define OBJ_id_qcs OBJ_id_pkix,11L
+
+#define SN_id_cct "id-cct"
+#define NID_id_cct 268
+#define OBJ_id_cct OBJ_id_pkix,12L
+
+#define SN_id_ppl "id-ppl"
+#define NID_id_ppl 662
+#define OBJ_id_ppl OBJ_id_pkix,21L
+
+#define SN_id_ad "id-ad"
+#define NID_id_ad 176
+#define OBJ_id_ad OBJ_id_pkix,48L
+
+#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88"
+#define NID_id_pkix1_explicit_88 269
+#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L
+
+#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88"
+#define NID_id_pkix1_implicit_88 270
+#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L
+
+#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93"
+#define NID_id_pkix1_explicit_93 271
+#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L
+
+#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93"
+#define NID_id_pkix1_implicit_93 272
+#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L
+
+#define SN_id_mod_crmf "id-mod-crmf"
+#define NID_id_mod_crmf 273
+#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L
+
+#define SN_id_mod_cmc "id-mod-cmc"
+#define NID_id_mod_cmc 274
+#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L
+
+#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88"
+#define NID_id_mod_kea_profile_88 275
+#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L
+
+#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93"
+#define NID_id_mod_kea_profile_93 276
+#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L
+
+#define SN_id_mod_cmp "id-mod-cmp"
+#define NID_id_mod_cmp 277
+#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L
+
+#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88"
+#define NID_id_mod_qualified_cert_88 278
+#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L
+
+#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93"
+#define NID_id_mod_qualified_cert_93 279
+#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L
+
+#define SN_id_mod_attribute_cert "id-mod-attribute-cert"
+#define NID_id_mod_attribute_cert 280
+#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L
+
+#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol"
+#define NID_id_mod_timestamp_protocol 281
+#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L
+
+#define SN_id_mod_ocsp "id-mod-ocsp"
+#define NID_id_mod_ocsp 282
+#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L
+
+#define SN_id_mod_dvcs "id-mod-dvcs"
+#define NID_id_mod_dvcs 283
+#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L
+
+#define SN_id_mod_cmp2000 "id-mod-cmp2000"
+#define NID_id_mod_cmp2000 284
+#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L
+
+#define SN_info_access "authorityInfoAccess"
+#define LN_info_access "Authority Information Access"
+#define NID_info_access 177
+#define OBJ_info_access OBJ_id_pe,1L
+
+#define SN_biometricInfo "biometricInfo"
+#define LN_biometricInfo "Biometric Info"
+#define NID_biometricInfo 285
+#define OBJ_biometricInfo OBJ_id_pe,2L
+
+#define SN_qcStatements "qcStatements"
+#define NID_qcStatements 286
+#define OBJ_qcStatements OBJ_id_pe,3L
+
+#define SN_ac_auditEntity "ac-auditEntity"
+#define NID_ac_auditEntity 287
+#define OBJ_ac_auditEntity OBJ_id_pe,4L
+
+#define SN_ac_targeting "ac-targeting"
+#define NID_ac_targeting 288
+#define OBJ_ac_targeting OBJ_id_pe,5L
+
+#define SN_aaControls "aaControls"
+#define NID_aaControls 289
+#define OBJ_aaControls OBJ_id_pe,6L
+
+#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock"
+#define NID_sbgp_ipAddrBlock 290
+#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L
+
+#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum"
+#define NID_sbgp_autonomousSysNum 291
+#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L
+
+#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier"
+#define NID_sbgp_routerIdentifier 292
+#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L
+
+#define SN_ac_proxying "ac-proxying"
+#define NID_ac_proxying 397
+#define OBJ_ac_proxying OBJ_id_pe,10L
+
+#define SN_sinfo_access "subjectInfoAccess"
+#define LN_sinfo_access "Subject Information Access"
+#define NID_sinfo_access 398
+#define OBJ_sinfo_access OBJ_id_pe,11L
+
+#define SN_proxyCertInfo "proxyCertInfo"
+#define LN_proxyCertInfo "Proxy Certificate Information"
+#define NID_proxyCertInfo 663
+#define OBJ_proxyCertInfo OBJ_id_pe,14L
+
+#define SN_id_qt_cps "id-qt-cps"
+#define LN_id_qt_cps "Policy Qualifier CPS"
+#define NID_id_qt_cps 164
+#define OBJ_id_qt_cps OBJ_id_qt,1L
+
+#define SN_id_qt_unotice "id-qt-unotice"
+#define LN_id_qt_unotice "Policy Qualifier User Notice"
+#define NID_id_qt_unotice 165
+#define OBJ_id_qt_unotice OBJ_id_qt,2L
+
+#define SN_textNotice "textNotice"
+#define NID_textNotice 293
+#define OBJ_textNotice OBJ_id_qt,3L
+
+#define SN_server_auth "serverAuth"
+#define LN_server_auth "TLS Web Server Authentication"
+#define NID_server_auth 129
+#define OBJ_server_auth OBJ_id_kp,1L
+
+#define SN_client_auth "clientAuth"
+#define LN_client_auth "TLS Web Client Authentication"
+#define NID_client_auth 130
+#define OBJ_client_auth OBJ_id_kp,2L
+
+#define SN_code_sign "codeSigning"
+#define LN_code_sign "Code Signing"
+#define NID_code_sign 131
+#define OBJ_code_sign OBJ_id_kp,3L
+
+#define SN_email_protect "emailProtection"
+#define LN_email_protect "E-mail Protection"
+#define NID_email_protect 132
+#define OBJ_email_protect OBJ_id_kp,4L
+
+#define SN_ipsecEndSystem "ipsecEndSystem"
+#define LN_ipsecEndSystem "IPSec End System"
+#define NID_ipsecEndSystem 294
+#define OBJ_ipsecEndSystem OBJ_id_kp,5L
+
+#define SN_ipsecTunnel "ipsecTunnel"
+#define LN_ipsecTunnel "IPSec Tunnel"
+#define NID_ipsecTunnel 295
+#define OBJ_ipsecTunnel OBJ_id_kp,6L
+
+#define SN_ipsecUser "ipsecUser"
+#define LN_ipsecUser "IPSec User"
+#define NID_ipsecUser 296
+#define OBJ_ipsecUser OBJ_id_kp,7L
+
+#define SN_time_stamp "timeStamping"
+#define LN_time_stamp "Time Stamping"
+#define NID_time_stamp 133
+#define OBJ_time_stamp OBJ_id_kp,8L
+
+#define SN_OCSP_sign "OCSPSigning"
+#define LN_OCSP_sign "OCSP Signing"
+#define NID_OCSP_sign 180
+#define OBJ_OCSP_sign OBJ_id_kp,9L
+
+#define SN_dvcs "DVCS"
+#define LN_dvcs "dvcs"
+#define NID_dvcs 297
+#define OBJ_dvcs OBJ_id_kp,10L
+
+#define SN_id_it_caProtEncCert "id-it-caProtEncCert"
+#define NID_id_it_caProtEncCert 298
+#define OBJ_id_it_caProtEncCert OBJ_id_it,1L
+
+#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes"
+#define NID_id_it_signKeyPairTypes 299
+#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L
+
+#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes"
+#define NID_id_it_encKeyPairTypes 300
+#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L
+
+#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg"
+#define NID_id_it_preferredSymmAlg 301
+#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L
+
+#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo"
+#define NID_id_it_caKeyUpdateInfo 302
+#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L
+
+#define SN_id_it_currentCRL "id-it-currentCRL"
+#define NID_id_it_currentCRL 303
+#define OBJ_id_it_currentCRL OBJ_id_it,6L
+
+#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs"
+#define NID_id_it_unsupportedOIDs 304
+#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L
+
+#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest"
+#define NID_id_it_subscriptionRequest 305
+#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L
+
+#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse"
+#define NID_id_it_subscriptionResponse 306
+#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L
+
+#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq"
+#define NID_id_it_keyPairParamReq 307
+#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L
+
+#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep"
+#define NID_id_it_keyPairParamRep 308
+#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L
+
+#define SN_id_it_revPassphrase "id-it-revPassphrase"
+#define NID_id_it_revPassphrase 309
+#define OBJ_id_it_revPassphrase OBJ_id_it,12L
+
+#define SN_id_it_implicitConfirm "id-it-implicitConfirm"
+#define NID_id_it_implicitConfirm 310
+#define OBJ_id_it_implicitConfirm OBJ_id_it,13L
+
+#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime"
+#define NID_id_it_confirmWaitTime 311
+#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L
+
+#define SN_id_it_origPKIMessage "id-it-origPKIMessage"
+#define NID_id_it_origPKIMessage 312
+#define OBJ_id_it_origPKIMessage OBJ_id_it,15L
+
+#define SN_id_it_suppLangTags "id-it-suppLangTags"
+#define NID_id_it_suppLangTags 784
+#define OBJ_id_it_suppLangTags OBJ_id_it,16L
+
+#define SN_id_regCtrl "id-regCtrl"
+#define NID_id_regCtrl 313
+#define OBJ_id_regCtrl OBJ_id_pkip,1L
+
+#define SN_id_regInfo "id-regInfo"
+#define NID_id_regInfo 314
+#define OBJ_id_regInfo OBJ_id_pkip,2L
+
+#define SN_id_regCtrl_regToken "id-regCtrl-regToken"
+#define NID_id_regCtrl_regToken 315
+#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L
+
+#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator"
+#define NID_id_regCtrl_authenticator 316
+#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L
-#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions"
-#define NID_id_regCtrl_pkiArchiveOptions 318
-#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L
+#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo"
+#define NID_id_regCtrl_pkiPublicationInfo 317
+#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L
-#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID"
-#define NID_id_regCtrl_oldCertID 319
-#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L
+#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions"
+#define NID_id_regCtrl_pkiArchiveOptions 318
+#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L
-#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey"
-#define NID_id_regCtrl_protocolEncrKey 320
-#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L
+#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID"
+#define NID_id_regCtrl_oldCertID 319
+#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L
-#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs"
-#define NID_id_regInfo_utf8Pairs 321
-#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L
+#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey"
+#define NID_id_regCtrl_protocolEncrKey 320
+#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L
-#define SN_id_regInfo_certReq "id-regInfo-certReq"
-#define NID_id_regInfo_certReq 322
-#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L
+#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs"
+#define NID_id_regInfo_utf8Pairs 321
+#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L
-#define SN_id_alg_des40 "id-alg-des40"
-#define NID_id_alg_des40 323
-#define OBJ_id_alg_des40 OBJ_id_alg,1L
+#define SN_id_regInfo_certReq "id-regInfo-certReq"
+#define NID_id_regInfo_certReq 322
+#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L
-#define SN_id_alg_noSignature "id-alg-noSignature"
-#define NID_id_alg_noSignature 324
-#define OBJ_id_alg_noSignature OBJ_id_alg,2L
+#define SN_id_alg_des40 "id-alg-des40"
+#define NID_id_alg_des40 323
+#define OBJ_id_alg_des40 OBJ_id_alg,1L
-#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1"
-#define NID_id_alg_dh_sig_hmac_sha1 325
-#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L
+#define SN_id_alg_noSignature "id-alg-noSignature"
+#define NID_id_alg_noSignature 324
+#define OBJ_id_alg_noSignature OBJ_id_alg,2L
-#define SN_id_alg_dh_pop "id-alg-dh-pop"
-#define NID_id_alg_dh_pop 326
-#define OBJ_id_alg_dh_pop OBJ_id_alg,4L
+#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1"
+#define NID_id_alg_dh_sig_hmac_sha1 325
+#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L
-#define SN_id_cmc_statusInfo "id-cmc-statusInfo"
-#define NID_id_cmc_statusInfo 327
-#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L
+#define SN_id_alg_dh_pop "id-alg-dh-pop"
+#define NID_id_alg_dh_pop 326
+#define OBJ_id_alg_dh_pop OBJ_id_alg,4L
-#define SN_id_cmc_identification "id-cmc-identification"
-#define NID_id_cmc_identification 328
-#define OBJ_id_cmc_identification OBJ_id_cmc,2L
+#define SN_id_cmc_statusInfo "id-cmc-statusInfo"
+#define NID_id_cmc_statusInfo 327
+#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L
-#define SN_id_cmc_identityProof "id-cmc-identityProof"
-#define NID_id_cmc_identityProof 329
-#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L
+#define SN_id_cmc_identification "id-cmc-identification"
+#define NID_id_cmc_identification 328
+#define OBJ_id_cmc_identification OBJ_id_cmc,2L
-#define SN_id_cmc_dataReturn "id-cmc-dataReturn"
-#define NID_id_cmc_dataReturn 330
-#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L
+#define SN_id_cmc_identityProof "id-cmc-identityProof"
+#define NID_id_cmc_identityProof 329
+#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L
-#define SN_id_cmc_transactionId "id-cmc-transactionId"
-#define NID_id_cmc_transactionId 331
-#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L
+#define SN_id_cmc_dataReturn "id-cmc-dataReturn"
+#define NID_id_cmc_dataReturn 330
+#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L
-#define SN_id_cmc_senderNonce "id-cmc-senderNonce"
-#define NID_id_cmc_senderNonce 332
-#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L
+#define SN_id_cmc_transactionId "id-cmc-transactionId"
+#define NID_id_cmc_transactionId 331
+#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L
-#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce"
-#define NID_id_cmc_recipientNonce 333
-#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L
+#define SN_id_cmc_senderNonce "id-cmc-senderNonce"
+#define NID_id_cmc_senderNonce 332
+#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L
-#define SN_id_cmc_addExtensions "id-cmc-addExtensions"
-#define NID_id_cmc_addExtensions 334
-#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L
+#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce"
+#define NID_id_cmc_recipientNonce 333
+#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L
-#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP"
-#define NID_id_cmc_encryptedPOP 335
-#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L
+#define SN_id_cmc_addExtensions "id-cmc-addExtensions"
+#define NID_id_cmc_addExtensions 334
+#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L
-#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP"
-#define NID_id_cmc_decryptedPOP 336
-#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L
+#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP"
+#define NID_id_cmc_encryptedPOP 335
+#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L
-#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness"
-#define NID_id_cmc_lraPOPWitness 337
-#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L
+#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP"
+#define NID_id_cmc_decryptedPOP 336
+#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L
-#define SN_id_cmc_getCert "id-cmc-getCert"
-#define NID_id_cmc_getCert 338
-#define OBJ_id_cmc_getCert OBJ_id_cmc,15L
+#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness"
+#define NID_id_cmc_lraPOPWitness 337
+#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L
-#define SN_id_cmc_getCRL "id-cmc-getCRL"
-#define NID_id_cmc_getCRL 339
-#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L
+#define SN_id_cmc_getCert "id-cmc-getCert"
+#define NID_id_cmc_getCert 338
+#define OBJ_id_cmc_getCert OBJ_id_cmc,15L
-#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest"
-#define NID_id_cmc_revokeRequest 340
-#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L
+#define SN_id_cmc_getCRL "id-cmc-getCRL"
+#define NID_id_cmc_getCRL 339
+#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L
-#define SN_id_cmc_regInfo "id-cmc-regInfo"
-#define NID_id_cmc_regInfo 341
-#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L
+#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest"
+#define NID_id_cmc_revokeRequest 340
+#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L
-#define SN_id_cmc_responseInfo "id-cmc-responseInfo"
-#define NID_id_cmc_responseInfo 342
-#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L
+#define SN_id_cmc_regInfo "id-cmc-regInfo"
+#define NID_id_cmc_regInfo 341
+#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L
-#define SN_id_cmc_queryPending "id-cmc-queryPending"
-#define NID_id_cmc_queryPending 343
-#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L
-
-#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom"
-#define NID_id_cmc_popLinkRandom 344
-#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L
-
-#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness"
-#define NID_id_cmc_popLinkWitness 345
-#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L
-
-#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance"
-#define NID_id_cmc_confirmCertAcceptance 346
-#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L
-
-#define SN_id_on_personalData "id-on-personalData"
-#define NID_id_on_personalData 347
-#define OBJ_id_on_personalData OBJ_id_on,1L
-
-#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
-#define NID_id_pda_dateOfBirth 348
-#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
-
-#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth"
-#define NID_id_pda_placeOfBirth 349
-#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L
-
-#define SN_id_pda_gender "id-pda-gender"
-#define NID_id_pda_gender 351
-#define OBJ_id_pda_gender OBJ_id_pda,3L
-
-#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship"
-#define NID_id_pda_countryOfCitizenship 352
-#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L
-
-#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence"
-#define NID_id_pda_countryOfResidence 353
-#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L
-
-#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo"
-#define NID_id_aca_authenticationInfo 354
-#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L
-
-#define SN_id_aca_accessIdentity "id-aca-accessIdentity"
-#define NID_id_aca_accessIdentity 355
-#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L
-
-#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity"
-#define NID_id_aca_chargingIdentity 356
-#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L
-
-#define SN_id_aca_group "id-aca-group"
-#define NID_id_aca_group 357
-#define OBJ_id_aca_group OBJ_id_aca,4L
-
-#define SN_id_aca_role "id-aca-role"
-#define NID_id_aca_role 358
-#define OBJ_id_aca_role OBJ_id_aca,5L
-
-#define SN_id_aca_encAttrs "id-aca-encAttrs"
-#define NID_id_aca_encAttrs 399
-#define OBJ_id_aca_encAttrs OBJ_id_aca,6L
-
-#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
-#define NID_id_qcs_pkixQCSyntax_v1 359
-#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
-
-#define SN_id_cct_crs "id-cct-crs"
-#define NID_id_cct_crs 360
-#define OBJ_id_cct_crs OBJ_id_cct,1L
-
-#define SN_id_cct_PKIData "id-cct-PKIData"
-#define NID_id_cct_PKIData 361
-#define OBJ_id_cct_PKIData OBJ_id_cct,2L
-
-#define SN_id_cct_PKIResponse "id-cct-PKIResponse"
-#define NID_id_cct_PKIResponse 362
-#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L
-
-#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage"
-#define LN_id_ppl_anyLanguage "Any language"
-#define NID_id_ppl_anyLanguage 664
-#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L
-
-#define SN_id_ppl_inheritAll "id-ppl-inheritAll"
-#define LN_id_ppl_inheritAll "Inherit all"
-#define NID_id_ppl_inheritAll 665
-#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L
-
-#define SN_Independent "id-ppl-independent"
-#define LN_Independent "Independent"
-#define NID_Independent 667
-#define OBJ_Independent OBJ_id_ppl,2L
-
-#define SN_ad_OCSP "OCSP"
-#define LN_ad_OCSP "OCSP"
-#define NID_ad_OCSP 178
-#define OBJ_ad_OCSP OBJ_id_ad,1L
-
-#define SN_ad_ca_issuers "caIssuers"
-#define LN_ad_ca_issuers "CA Issuers"
-#define NID_ad_ca_issuers 179
-#define OBJ_ad_ca_issuers OBJ_id_ad,2L
-
-#define SN_ad_timeStamping "ad_timestamping"
-#define LN_ad_timeStamping "AD Time Stamping"
-#define NID_ad_timeStamping 363
-#define OBJ_ad_timeStamping OBJ_id_ad,3L
-
-#define SN_ad_dvcs "AD_DVCS"
-#define LN_ad_dvcs "ad dvcs"
-#define NID_ad_dvcs 364
-#define OBJ_ad_dvcs OBJ_id_ad,4L
-
-#define OBJ_id_pkix_OCSP OBJ_ad_OCSP
-
-#define SN_id_pkix_OCSP_basic "basicOCSPResponse"
-#define LN_id_pkix_OCSP_basic "Basic OCSP Response"
-#define NID_id_pkix_OCSP_basic 365
-#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L
-
-#define SN_id_pkix_OCSP_Nonce "Nonce"
-#define LN_id_pkix_OCSP_Nonce "OCSP Nonce"
-#define NID_id_pkix_OCSP_Nonce 366
-#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L
-
-#define SN_id_pkix_OCSP_CrlID "CrlID"
-#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID"
-#define NID_id_pkix_OCSP_CrlID 367
-#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L
-
-#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses"
-#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses"
-#define NID_id_pkix_OCSP_acceptableResponses 368
-#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L
-
-#define SN_id_pkix_OCSP_noCheck "noCheck"
-#define LN_id_pkix_OCSP_noCheck "OCSP No Check"
-#define NID_id_pkix_OCSP_noCheck 369
-#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L
-
-#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff"
-#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff"
-#define NID_id_pkix_OCSP_archiveCutoff 370
-#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L
-
-#define SN_id_pkix_OCSP_serviceLocator "serviceLocator"
-#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator"
-#define NID_id_pkix_OCSP_serviceLocator 371
-#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L
-
-#define SN_id_pkix_OCSP_extendedStatus "extendedStatus"
-#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status"
-#define NID_id_pkix_OCSP_extendedStatus 372
-#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L
-
-#define SN_id_pkix_OCSP_valid "valid"
-#define NID_id_pkix_OCSP_valid 373
-#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L
-
-#define SN_id_pkix_OCSP_path "path"
-#define NID_id_pkix_OCSP_path 374
-#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L
-
-#define SN_id_pkix_OCSP_trustRoot "trustRoot"
-#define LN_id_pkix_OCSP_trustRoot "Trust Root"
-#define NID_id_pkix_OCSP_trustRoot 375
-#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L
-
-#define SN_algorithm "algorithm"
-#define LN_algorithm "algorithm"
-#define NID_algorithm 376
-#define OBJ_algorithm 1L,3L,14L,3L,2L
-
-#define SN_md5WithRSA "RSA-NP-MD5"
-#define LN_md5WithRSA "md5WithRSA"
-#define NID_md5WithRSA 104
-#define OBJ_md5WithRSA OBJ_algorithm,3L
-
-#define SN_des_ecb "DES-ECB"
-#define LN_des_ecb "des-ecb"
-#define NID_des_ecb 29
-#define OBJ_des_ecb OBJ_algorithm,6L
-
-#define SN_des_cbc "DES-CBC"
-#define LN_des_cbc "des-cbc"
-#define NID_des_cbc 31
-#define OBJ_des_cbc OBJ_algorithm,7L
-
-#define SN_des_ofb64 "DES-OFB"
-#define LN_des_ofb64 "des-ofb"
-#define NID_des_ofb64 45
-#define OBJ_des_ofb64 OBJ_algorithm,8L
-
-#define SN_des_cfb64 "DES-CFB"
-#define LN_des_cfb64 "des-cfb"
-#define NID_des_cfb64 30
-#define OBJ_des_cfb64 OBJ_algorithm,9L
-
-#define SN_rsaSignature "rsaSignature"
-#define NID_rsaSignature 377
-#define OBJ_rsaSignature OBJ_algorithm,11L
-
-#define SN_dsa_2 "DSA-old"
-#define LN_dsa_2 "dsaEncryption-old"
-#define NID_dsa_2 67
-#define OBJ_dsa_2 OBJ_algorithm,12L
-
-#define SN_dsaWithSHA "DSA-SHA"
-#define LN_dsaWithSHA "dsaWithSHA"
-#define NID_dsaWithSHA 66
-#define OBJ_dsaWithSHA OBJ_algorithm,13L
-
-#define SN_shaWithRSAEncryption "RSA-SHA"
-#define LN_shaWithRSAEncryption "shaWithRSAEncryption"
-#define NID_shaWithRSAEncryption 42
-#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
-
-#define SN_des_ede_ecb "DES-EDE"
-#define LN_des_ede_ecb "des-ede"
-#define NID_des_ede_ecb 32
-#define OBJ_des_ede_ecb OBJ_algorithm,17L
-
-#define SN_des_ede3_ecb "DES-EDE3"
-#define LN_des_ede3_ecb "des-ede3"
-#define NID_des_ede3_ecb 33
-
-#define SN_des_ede_cbc "DES-EDE-CBC"
-#define LN_des_ede_cbc "des-ede-cbc"
-#define NID_des_ede_cbc 43
-
-#define SN_des_ede_cfb64 "DES-EDE-CFB"
-#define LN_des_ede_cfb64 "des-ede-cfb"
-#define NID_des_ede_cfb64 60
-
-#define SN_des_ede3_cfb64 "DES-EDE3-CFB"
-#define LN_des_ede3_cfb64 "des-ede3-cfb"
-#define NID_des_ede3_cfb64 61
-
-#define SN_des_ede_ofb64 "DES-EDE-OFB"
-#define LN_des_ede_ofb64 "des-ede-ofb"
-#define NID_des_ede_ofb64 62
-
-#define SN_des_ede3_ofb64 "DES-EDE3-OFB"
-#define LN_des_ede3_ofb64 "des-ede3-ofb"
-#define NID_des_ede3_ofb64 63
-
-#define SN_desx_cbc "DESX-CBC"
-#define LN_desx_cbc "desx-cbc"
-#define NID_desx_cbc 80
-
-#define SN_sha "SHA"
-#define LN_sha "sha"
-#define NID_sha 41
-#define OBJ_sha OBJ_algorithm,18L
-
-#define SN_sha1 "SHA1"
-#define LN_sha1 "sha1"
-#define NID_sha1 64
-#define OBJ_sha1 OBJ_algorithm,26L
-
-#define SN_dsaWithSHA1_2 "DSA-SHA1-old"
-#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
-#define NID_dsaWithSHA1_2 70
-#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
-
-#define SN_sha1WithRSA "RSA-SHA1-2"
-#define LN_sha1WithRSA "sha1WithRSA"
-#define NID_sha1WithRSA 115
-#define OBJ_sha1WithRSA OBJ_algorithm,29L
-
-#define SN_ripemd160 "RIPEMD160"
-#define LN_ripemd160 "ripemd160"
-#define NID_ripemd160 117
-#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
-
-#define SN_ripemd160WithRSA "RSA-RIPEMD160"
-#define LN_ripemd160WithRSA "ripemd160WithRSA"
-#define NID_ripemd160WithRSA 119
-#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
-
-#define SN_sxnet "SXNetID"
-#define LN_sxnet "Strong Extranet ID"
-#define NID_sxnet 143
-#define OBJ_sxnet 1L,3L,101L,1L,4L,1L
-
-#define SN_X500 "X500"
-#define LN_X500 "directory services (X.500)"
-#define NID_X500 11
-#define OBJ_X500 2L,5L
-
-#define SN_X509 "X509"
-#define NID_X509 12
-#define OBJ_X509 OBJ_X500,4L
-
-#define SN_commonName "CN"
-#define LN_commonName "commonName"
-#define NID_commonName 13
-#define OBJ_commonName OBJ_X509,3L
-
-#define SN_surname "SN"
-#define LN_surname "surname"
-#define NID_surname 100
-#define OBJ_surname OBJ_X509,4L
-
-#define LN_serialNumber "serialNumber"
-#define NID_serialNumber 105
-#define OBJ_serialNumber OBJ_X509,5L
-
-#define SN_countryName "C"
-#define LN_countryName "countryName"
-#define NID_countryName 14
-#define OBJ_countryName OBJ_X509,6L
-
-#define SN_localityName "L"
-#define LN_localityName "localityName"
-#define NID_localityName 15
-#define OBJ_localityName OBJ_X509,7L
-
-#define SN_stateOrProvinceName "ST"
-#define LN_stateOrProvinceName "stateOrProvinceName"
-#define NID_stateOrProvinceName 16
-#define OBJ_stateOrProvinceName OBJ_X509,8L
-
-#define LN_streetAddress "streetAddress"
-#define NID_streetAddress 660
-#define OBJ_streetAddress OBJ_X509,9L
-
-#define SN_organizationName "O"
-#define LN_organizationName "organizationName"
-#define NID_organizationName 17
-#define OBJ_organizationName OBJ_X509,10L
-
-#define SN_organizationalUnitName "OU"
-#define LN_organizationalUnitName "organizationalUnitName"
-#define NID_organizationalUnitName 18
-#define OBJ_organizationalUnitName OBJ_X509,11L
-
-#define LN_title "title"
-#define NID_title 106
-#define OBJ_title OBJ_X509,12L
-
-#define LN_description "description"
-#define NID_description 107
-#define OBJ_description OBJ_X509,13L
-
-#define LN_postalCode "postalCode"
-#define NID_postalCode 661
-#define OBJ_postalCode OBJ_X509,17L
-
-#define SN_name "name"
-#define LN_name "name"
-#define NID_name 173
-#define OBJ_name OBJ_X509,41L
-
-#define SN_givenName "GN"
-#define LN_givenName "givenName"
-#define NID_givenName 99
-#define OBJ_givenName OBJ_X509,42L
-
-#define LN_initials "initials"
-#define NID_initials 101
-#define OBJ_initials OBJ_X509,43L
-
-#define LN_generationQualifier "generationQualifier"
-#define NID_generationQualifier 509
-#define OBJ_generationQualifier OBJ_X509,44L
-
-#define LN_x500UniqueIdentifier "x500UniqueIdentifier"
-#define NID_x500UniqueIdentifier 503
-#define OBJ_x500UniqueIdentifier OBJ_X509,45L
-
-#define SN_dnQualifier "dnQualifier"
-#define LN_dnQualifier "dnQualifier"
-#define NID_dnQualifier 174
-#define OBJ_dnQualifier OBJ_X509,46L
-
-#define LN_pseudonym "pseudonym"
-#define NID_pseudonym 510
-#define OBJ_pseudonym OBJ_X509,65L
-
-#define SN_role "role"
-#define LN_role "role"
-#define NID_role 400
-#define OBJ_role OBJ_X509,72L
-
-#define SN_X500algorithms "X500algorithms"
-#define LN_X500algorithms "directory services - algorithms"
-#define NID_X500algorithms 378
-#define OBJ_X500algorithms OBJ_X500,8L
-
-#define SN_rsa "RSA"
-#define LN_rsa "rsa"
-#define NID_rsa 19
-#define OBJ_rsa OBJ_X500algorithms,1L,1L
-
-#define SN_mdc2WithRSA "RSA-MDC2"
-#define LN_mdc2WithRSA "mdc2WithRSA"
-#define NID_mdc2WithRSA 96
-#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L
-
-#define SN_mdc2 "MDC2"
-#define LN_mdc2 "mdc2"
-#define NID_mdc2 95
-#define OBJ_mdc2 OBJ_X500algorithms,3L,101L
-
-#define SN_id_ce "id-ce"
-#define NID_id_ce 81
-#define OBJ_id_ce OBJ_X500,29L
-
-#define SN_subject_directory_attributes "subjectDirectoryAttributes"
-#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes"
-#define NID_subject_directory_attributes 769
-#define OBJ_subject_directory_attributes OBJ_id_ce,9L
-
-#define SN_subject_key_identifier "subjectKeyIdentifier"
-#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
-#define NID_subject_key_identifier 82
-#define OBJ_subject_key_identifier OBJ_id_ce,14L
-
-#define SN_key_usage "keyUsage"
-#define LN_key_usage "X509v3 Key Usage"
-#define NID_key_usage 83
-#define OBJ_key_usage OBJ_id_ce,15L
-
-#define SN_private_key_usage_period "privateKeyUsagePeriod"
-#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
-#define NID_private_key_usage_period 84
-#define OBJ_private_key_usage_period OBJ_id_ce,16L
-
-#define SN_subject_alt_name "subjectAltName"
-#define LN_subject_alt_name "X509v3 Subject Alternative Name"
-#define NID_subject_alt_name 85
-#define OBJ_subject_alt_name OBJ_id_ce,17L
-
-#define SN_issuer_alt_name "issuerAltName"
-#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
-#define NID_issuer_alt_name 86
-#define OBJ_issuer_alt_name OBJ_id_ce,18L
-
-#define SN_basic_constraints "basicConstraints"
-#define LN_basic_constraints "X509v3 Basic Constraints"
-#define NID_basic_constraints 87
-#define OBJ_basic_constraints OBJ_id_ce,19L
-
-#define SN_crl_number "crlNumber"
-#define LN_crl_number "X509v3 CRL Number"
-#define NID_crl_number 88
-#define OBJ_crl_number OBJ_id_ce,20L
-
-#define SN_crl_reason "CRLReason"
-#define LN_crl_reason "X509v3 CRL Reason Code"
-#define NID_crl_reason 141
-#define OBJ_crl_reason OBJ_id_ce,21L
-
-#define SN_invalidity_date "invalidityDate"
-#define LN_invalidity_date "Invalidity Date"
-#define NID_invalidity_date 142
-#define OBJ_invalidity_date OBJ_id_ce,24L
-
-#define SN_delta_crl "deltaCRL"
-#define LN_delta_crl "X509v3 Delta CRL Indicator"
-#define NID_delta_crl 140
-#define OBJ_delta_crl OBJ_id_ce,27L
-
-#define SN_issuing_distribution_point "issuingDistributionPoint"
-#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point"
-#define NID_issuing_distribution_point 770
-#define OBJ_issuing_distribution_point OBJ_id_ce,28L
-
-#define SN_certificate_issuer "certificateIssuer"
-#define LN_certificate_issuer "X509v3 Certificate Issuer"
-#define NID_certificate_issuer 771
-#define OBJ_certificate_issuer OBJ_id_ce,29L
-
-#define SN_name_constraints "nameConstraints"
-#define LN_name_constraints "X509v3 Name Constraints"
-#define NID_name_constraints 666
-#define OBJ_name_constraints OBJ_id_ce,30L
-
-#define SN_crl_distribution_points "crlDistributionPoints"
-#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
-#define NID_crl_distribution_points 103
-#define OBJ_crl_distribution_points OBJ_id_ce,31L
-
-#define SN_certificate_policies "certificatePolicies"
-#define LN_certificate_policies "X509v3 Certificate Policies"
-#define NID_certificate_policies 89
-#define OBJ_certificate_policies OBJ_id_ce,32L
-
-#define SN_any_policy "anyPolicy"
-#define LN_any_policy "X509v3 Any Policy"
-#define NID_any_policy 746
-#define OBJ_any_policy OBJ_certificate_policies,0L
-
-#define SN_policy_mappings "policyMappings"
-#define LN_policy_mappings "X509v3 Policy Mappings"
-#define NID_policy_mappings 747
-#define OBJ_policy_mappings OBJ_id_ce,33L
-
-#define SN_authority_key_identifier "authorityKeyIdentifier"
-#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
-#define NID_authority_key_identifier 90
-#define OBJ_authority_key_identifier OBJ_id_ce,35L
-
-#define SN_policy_constraints "policyConstraints"
-#define LN_policy_constraints "X509v3 Policy Constraints"
-#define NID_policy_constraints 401
-#define OBJ_policy_constraints OBJ_id_ce,36L
-
-#define SN_ext_key_usage "extendedKeyUsage"
-#define LN_ext_key_usage "X509v3 Extended Key Usage"
-#define NID_ext_key_usage 126
-#define OBJ_ext_key_usage OBJ_id_ce,37L
-
-#define SN_inhibit_any_policy "inhibitAnyPolicy"
-#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy"
-#define NID_inhibit_any_policy 748
-#define OBJ_inhibit_any_policy OBJ_id_ce,54L
-
-#define SN_target_information "targetInformation"
-#define LN_target_information "X509v3 AC Targeting"
-#define NID_target_information 402
-#define OBJ_target_information OBJ_id_ce,55L
-
-#define SN_no_rev_avail "noRevAvail"
-#define LN_no_rev_avail "X509v3 No Revocation Available"
-#define NID_no_rev_avail 403
-#define OBJ_no_rev_avail OBJ_id_ce,56L
-
-#define SN_netscape "Netscape"
-#define LN_netscape "Netscape Communications Corp."
-#define NID_netscape 57
-#define OBJ_netscape 2L,16L,840L,1L,113730L
-
-#define SN_netscape_cert_extension "nsCertExt"
-#define LN_netscape_cert_extension "Netscape Certificate Extension"
-#define NID_netscape_cert_extension 58
-#define OBJ_netscape_cert_extension OBJ_netscape,1L
-
-#define SN_netscape_data_type "nsDataType"
-#define LN_netscape_data_type "Netscape Data Type"
-#define NID_netscape_data_type 59
-#define OBJ_netscape_data_type OBJ_netscape,2L
-
-#define SN_netscape_cert_type "nsCertType"
-#define LN_netscape_cert_type "Netscape Cert Type"
-#define NID_netscape_cert_type 71
-#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
-
-#define SN_netscape_base_url "nsBaseUrl"
-#define LN_netscape_base_url "Netscape Base Url"
-#define NID_netscape_base_url 72
-#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
-
-#define SN_netscape_revocation_url "nsRevocationUrl"
-#define LN_netscape_revocation_url "Netscape Revocation Url"
-#define NID_netscape_revocation_url 73
-#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
-
-#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
-#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
-#define NID_netscape_ca_revocation_url 74
-#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
-
-#define SN_netscape_renewal_url "nsRenewalUrl"
-#define LN_netscape_renewal_url "Netscape Renewal Url"
-#define NID_netscape_renewal_url 75
-#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
-
-#define SN_netscape_ca_policy_url "nsCaPolicyUrl"
-#define LN_netscape_ca_policy_url "Netscape CA Policy Url"
-#define NID_netscape_ca_policy_url 76
-#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
-
-#define SN_netscape_ssl_server_name "nsSslServerName"
-#define LN_netscape_ssl_server_name "Netscape SSL Server Name"
-#define NID_netscape_ssl_server_name 77
-#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
-
-#define SN_netscape_comment "nsComment"
-#define LN_netscape_comment "Netscape Comment"
-#define NID_netscape_comment 78
-#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
-
-#define SN_netscape_cert_sequence "nsCertSequence"
-#define LN_netscape_cert_sequence "Netscape Certificate Sequence"
-#define NID_netscape_cert_sequence 79
-#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
-
-#define SN_ns_sgc "nsSGC"
-#define LN_ns_sgc "Netscape Server Gated Crypto"
-#define NID_ns_sgc 139
-#define OBJ_ns_sgc OBJ_netscape,4L,1L
-
-#define SN_org "ORG"
-#define LN_org "org"
-#define NID_org 379
-#define OBJ_org OBJ_iso,3L
-
-#define SN_dod "DOD"
-#define LN_dod "dod"
-#define NID_dod 380
-#define OBJ_dod OBJ_org,6L
-
-#define SN_iana "IANA"
-#define LN_iana "iana"
-#define NID_iana 381
-#define OBJ_iana OBJ_dod,1L
-
-#define OBJ_internet OBJ_iana
-
-#define SN_Directory "directory"
-#define LN_Directory "Directory"
-#define NID_Directory 382
-#define OBJ_Directory OBJ_internet,1L
-
-#define SN_Management "mgmt"
-#define LN_Management "Management"
-#define NID_Management 383
-#define OBJ_Management OBJ_internet,2L
-
-#define SN_Experimental "experimental"
-#define LN_Experimental "Experimental"
-#define NID_Experimental 384
-#define OBJ_Experimental OBJ_internet,3L
-
-#define SN_Private "private"
-#define LN_Private "Private"
-#define NID_Private 385
-#define OBJ_Private OBJ_internet,4L
-
-#define SN_Security "security"
-#define LN_Security "Security"
-#define NID_Security 386
-#define OBJ_Security OBJ_internet,5L
-
-#define SN_SNMPv2 "snmpv2"
-#define LN_SNMPv2 "SNMPv2"
-#define NID_SNMPv2 387
-#define OBJ_SNMPv2 OBJ_internet,6L
-
-#define LN_Mail "Mail"
-#define NID_Mail 388
-#define OBJ_Mail OBJ_internet,7L
-
-#define SN_Enterprises "enterprises"
-#define LN_Enterprises "Enterprises"
-#define NID_Enterprises 389
-#define OBJ_Enterprises OBJ_Private,1L
-
-#define SN_dcObject "dcobject"
-#define LN_dcObject "dcObject"
-#define NID_dcObject 390
-#define OBJ_dcObject OBJ_Enterprises,1466L,344L
-
-#define SN_mime_mhs "mime-mhs"
-#define LN_mime_mhs "MIME MHS"
-#define NID_mime_mhs 504
-#define OBJ_mime_mhs OBJ_Mail,1L
-
-#define SN_mime_mhs_headings "mime-mhs-headings"
-#define LN_mime_mhs_headings "mime-mhs-headings"
-#define NID_mime_mhs_headings 505
-#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L
-
-#define SN_mime_mhs_bodies "mime-mhs-bodies"
-#define LN_mime_mhs_bodies "mime-mhs-bodies"
-#define NID_mime_mhs_bodies 506
-#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L
-
-#define SN_id_hex_partial_message "id-hex-partial-message"
-#define LN_id_hex_partial_message "id-hex-partial-message"
-#define NID_id_hex_partial_message 507
-#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L
-
-#define SN_id_hex_multipart_message "id-hex-multipart-message"
-#define LN_id_hex_multipart_message "id-hex-multipart-message"
-#define NID_id_hex_multipart_message 508
-#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L
-
-#define SN_rle_compression "RLE"
-#define LN_rle_compression "run length compression"
-#define NID_rle_compression 124
-#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
-
-#define SN_zlib_compression "ZLIB"
-#define LN_zlib_compression "zlib compression"
-#define NID_zlib_compression 125
-#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L
-
-#define OBJ_csor 2L,16L,840L,1L,101L,3L
-
-#define OBJ_nistAlgorithms OBJ_csor,4L
-
-#define OBJ_aes OBJ_nistAlgorithms,1L
-
-#define SN_aes_128_ecb "AES-128-ECB"
-#define LN_aes_128_ecb "aes-128-ecb"
-#define NID_aes_128_ecb 418
-#define OBJ_aes_128_ecb OBJ_aes,1L
-
-#define SN_aes_128_cbc "AES-128-CBC"
-#define LN_aes_128_cbc "aes-128-cbc"
-#define NID_aes_128_cbc 419
-#define OBJ_aes_128_cbc OBJ_aes,2L
-
-#define SN_aes_128_ofb128 "AES-128-OFB"
-#define LN_aes_128_ofb128 "aes-128-ofb"
-#define NID_aes_128_ofb128 420
-#define OBJ_aes_128_ofb128 OBJ_aes,3L
-
-#define SN_aes_128_cfb128 "AES-128-CFB"
-#define LN_aes_128_cfb128 "aes-128-cfb"
-#define NID_aes_128_cfb128 421
-#define OBJ_aes_128_cfb128 OBJ_aes,4L
-
-#define SN_aes_192_ecb "AES-192-ECB"
-#define LN_aes_192_ecb "aes-192-ecb"
-#define NID_aes_192_ecb 422
-#define OBJ_aes_192_ecb OBJ_aes,21L
-
-#define SN_aes_192_cbc "AES-192-CBC"
-#define LN_aes_192_cbc "aes-192-cbc"
-#define NID_aes_192_cbc 423
-#define OBJ_aes_192_cbc OBJ_aes,22L
-
-#define SN_aes_192_ofb128 "AES-192-OFB"
-#define LN_aes_192_ofb128 "aes-192-ofb"
-#define NID_aes_192_ofb128 424
-#define OBJ_aes_192_ofb128 OBJ_aes,23L
-
-#define SN_aes_192_cfb128 "AES-192-CFB"
-#define LN_aes_192_cfb128 "aes-192-cfb"
-#define NID_aes_192_cfb128 425
-#define OBJ_aes_192_cfb128 OBJ_aes,24L
-
-#define SN_aes_256_ecb "AES-256-ECB"
-#define LN_aes_256_ecb "aes-256-ecb"
-#define NID_aes_256_ecb 426
-#define OBJ_aes_256_ecb OBJ_aes,41L
-
-#define SN_aes_256_cbc "AES-256-CBC"
-#define LN_aes_256_cbc "aes-256-cbc"
-#define NID_aes_256_cbc 427
-#define OBJ_aes_256_cbc OBJ_aes,42L
-
-#define SN_aes_256_ofb128 "AES-256-OFB"
-#define LN_aes_256_ofb128 "aes-256-ofb"
-#define NID_aes_256_ofb128 428
-#define OBJ_aes_256_ofb128 OBJ_aes,43L
-
-#define SN_aes_256_cfb128 "AES-256-CFB"
-#define LN_aes_256_cfb128 "aes-256-cfb"
-#define NID_aes_256_cfb128 429
-#define OBJ_aes_256_cfb128 OBJ_aes,44L
-
-#define SN_aes_128_cfb1 "AES-128-CFB1"
-#define LN_aes_128_cfb1 "aes-128-cfb1"
-#define NID_aes_128_cfb1 650
-
-#define SN_aes_192_cfb1 "AES-192-CFB1"
-#define LN_aes_192_cfb1 "aes-192-cfb1"
-#define NID_aes_192_cfb1 651
-
-#define SN_aes_256_cfb1 "AES-256-CFB1"
-#define LN_aes_256_cfb1 "aes-256-cfb1"
-#define NID_aes_256_cfb1 652
-
-#define SN_aes_128_cfb8 "AES-128-CFB8"
-#define LN_aes_128_cfb8 "aes-128-cfb8"
-#define NID_aes_128_cfb8 653
-
-#define SN_aes_192_cfb8 "AES-192-CFB8"
-#define LN_aes_192_cfb8 "aes-192-cfb8"
-#define NID_aes_192_cfb8 654
-
-#define SN_aes_256_cfb8 "AES-256-CFB8"
-#define LN_aes_256_cfb8 "aes-256-cfb8"
-#define NID_aes_256_cfb8 655
-
-#define SN_des_cfb1 "DES-CFB1"
-#define LN_des_cfb1 "des-cfb1"
-#define NID_des_cfb1 656
-
-#define SN_des_cfb8 "DES-CFB8"
-#define LN_des_cfb8 "des-cfb8"
-#define NID_des_cfb8 657
-
-#define SN_des_ede3_cfb1 "DES-EDE3-CFB1"
-#define LN_des_ede3_cfb1 "des-ede3-cfb1"
-#define NID_des_ede3_cfb1 658
-
-#define SN_des_ede3_cfb8 "DES-EDE3-CFB8"
-#define LN_des_ede3_cfb8 "des-ede3-cfb8"
-#define NID_des_ede3_cfb8 659
-
-#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L
-
-#define SN_sha256 "SHA256"
-#define LN_sha256 "sha256"
-#define NID_sha256 672
-#define OBJ_sha256 OBJ_nist_hashalgs,1L
-
-#define SN_sha384 "SHA384"
-#define LN_sha384 "sha384"
-#define NID_sha384 673
-#define OBJ_sha384 OBJ_nist_hashalgs,2L
-
-#define SN_sha512 "SHA512"
-#define LN_sha512 "sha512"
-#define NID_sha512 674
-#define OBJ_sha512 OBJ_nist_hashalgs,3L
-
-#define SN_sha224 "SHA224"
-#define LN_sha224 "sha224"
-#define NID_sha224 675
-#define OBJ_sha224 OBJ_nist_hashalgs,4L
-
-#define SN_hold_instruction_code "holdInstructionCode"
-#define LN_hold_instruction_code "Hold Instruction Code"
-#define NID_hold_instruction_code 430
-#define OBJ_hold_instruction_code OBJ_id_ce,23L
-
-#define OBJ_holdInstruction OBJ_X9_57,2L
-
-#define SN_hold_instruction_none "holdInstructionNone"
-#define LN_hold_instruction_none "Hold Instruction None"
-#define NID_hold_instruction_none 431
-#define OBJ_hold_instruction_none OBJ_holdInstruction,1L
-
-#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer"
-#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer"
-#define NID_hold_instruction_call_issuer 432
-#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L
-
-#define SN_hold_instruction_reject "holdInstructionReject"
-#define LN_hold_instruction_reject "Hold Instruction Reject"
-#define NID_hold_instruction_reject 433
-#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L
-
-#define SN_data "data"
-#define NID_data 434
-#define OBJ_data OBJ_itu_t,9L
-
-#define SN_pss "pss"
-#define NID_pss 435
-#define OBJ_pss OBJ_data,2342L
-
-#define SN_ucl "ucl"
-#define NID_ucl 436
-#define OBJ_ucl OBJ_pss,19200300L
-
-#define SN_pilot "pilot"
-#define NID_pilot 437
-#define OBJ_pilot OBJ_ucl,100L
-
-#define LN_pilotAttributeType "pilotAttributeType"
-#define NID_pilotAttributeType 438
-#define OBJ_pilotAttributeType OBJ_pilot,1L
-
-#define LN_pilotAttributeSyntax "pilotAttributeSyntax"
-#define NID_pilotAttributeSyntax 439
-#define OBJ_pilotAttributeSyntax OBJ_pilot,3L
-
-#define LN_pilotObjectClass "pilotObjectClass"
-#define NID_pilotObjectClass 440
-#define OBJ_pilotObjectClass OBJ_pilot,4L
-
-#define LN_pilotGroups "pilotGroups"
-#define NID_pilotGroups 441
-#define OBJ_pilotGroups OBJ_pilot,10L
-
-#define LN_iA5StringSyntax "iA5StringSyntax"
-#define NID_iA5StringSyntax 442
-#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L
-
-#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax"
-#define NID_caseIgnoreIA5StringSyntax 443
-#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L
-
-#define LN_pilotObject "pilotObject"
-#define NID_pilotObject 444
-#define OBJ_pilotObject OBJ_pilotObjectClass,3L
-
-#define LN_pilotPerson "pilotPerson"
-#define NID_pilotPerson 445
-#define OBJ_pilotPerson OBJ_pilotObjectClass,4L
-
-#define SN_account "account"
-#define NID_account 446
-#define OBJ_account OBJ_pilotObjectClass,5L
-
-#define SN_document "document"
-#define NID_document 447
-#define OBJ_document OBJ_pilotObjectClass,6L
-
-#define SN_room "room"
-#define NID_room 448
-#define OBJ_room OBJ_pilotObjectClass,7L
-
-#define LN_documentSeries "documentSeries"
-#define NID_documentSeries 449
-#define OBJ_documentSeries OBJ_pilotObjectClass,9L
-
-#define SN_Domain "domain"
-#define LN_Domain "Domain"
-#define NID_Domain 392
-#define OBJ_Domain OBJ_pilotObjectClass,13L
-
-#define LN_rFC822localPart "rFC822localPart"
-#define NID_rFC822localPart 450
-#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L
-
-#define LN_dNSDomain "dNSDomain"
-#define NID_dNSDomain 451
-#define OBJ_dNSDomain OBJ_pilotObjectClass,15L
-
-#define LN_domainRelatedObject "domainRelatedObject"
-#define NID_domainRelatedObject 452
-#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L
-
-#define LN_friendlyCountry "friendlyCountry"
-#define NID_friendlyCountry 453
-#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L
-
-#define LN_simpleSecurityObject "simpleSecurityObject"
-#define NID_simpleSecurityObject 454
-#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L
-
-#define LN_pilotOrganization "pilotOrganization"
-#define NID_pilotOrganization 455
-#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L
-
-#define LN_pilotDSA "pilotDSA"
-#define NID_pilotDSA 456
-#define OBJ_pilotDSA OBJ_pilotObjectClass,21L
-
-#define LN_qualityLabelledData "qualityLabelledData"
-#define NID_qualityLabelledData 457
-#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L
-
-#define SN_userId "UID"
-#define LN_userId "userId"
-#define NID_userId 458
-#define OBJ_userId OBJ_pilotAttributeType,1L
-
-#define LN_textEncodedORAddress "textEncodedORAddress"
-#define NID_textEncodedORAddress 459
-#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L
-
-#define SN_rfc822Mailbox "mail"
-#define LN_rfc822Mailbox "rfc822Mailbox"
-#define NID_rfc822Mailbox 460
-#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L
-
-#define SN_info "info"
-#define NID_info 461
-#define OBJ_info OBJ_pilotAttributeType,4L
-
-#define LN_favouriteDrink "favouriteDrink"
-#define NID_favouriteDrink 462
-#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L
-
-#define LN_roomNumber "roomNumber"
-#define NID_roomNumber 463
-#define OBJ_roomNumber OBJ_pilotAttributeType,6L
-
-#define SN_photo "photo"
-#define NID_photo 464
-#define OBJ_photo OBJ_pilotAttributeType,7L
-
-#define LN_userClass "userClass"
-#define NID_userClass 465
-#define OBJ_userClass OBJ_pilotAttributeType,8L
-
-#define SN_host "host"
-#define NID_host 466
-#define OBJ_host OBJ_pilotAttributeType,9L
-
-#define SN_manager "manager"
-#define NID_manager 467
-#define OBJ_manager OBJ_pilotAttributeType,10L
-
-#define LN_documentIdentifier "documentIdentifier"
-#define NID_documentIdentifier 468
-#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L
-
-#define LN_documentTitle "documentTitle"
-#define NID_documentTitle 469
-#define OBJ_documentTitle OBJ_pilotAttributeType,12L
-
-#define LN_documentVersion "documentVersion"
-#define NID_documentVersion 470
-#define OBJ_documentVersion OBJ_pilotAttributeType,13L
-
-#define LN_documentAuthor "documentAuthor"
-#define NID_documentAuthor 471
-#define OBJ_documentAuthor OBJ_pilotAttributeType,14L
-
-#define LN_documentLocation "documentLocation"
-#define NID_documentLocation 472
-#define OBJ_documentLocation OBJ_pilotAttributeType,15L
-
-#define LN_homeTelephoneNumber "homeTelephoneNumber"
-#define NID_homeTelephoneNumber 473
-#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L
-
-#define SN_secretary "secretary"
-#define NID_secretary 474
-#define OBJ_secretary OBJ_pilotAttributeType,21L
-
-#define LN_otherMailbox "otherMailbox"
-#define NID_otherMailbox 475
-#define OBJ_otherMailbox OBJ_pilotAttributeType,22L
-
-#define LN_lastModifiedTime "lastModifiedTime"
-#define NID_lastModifiedTime 476
-#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L
-
-#define LN_lastModifiedBy "lastModifiedBy"
-#define NID_lastModifiedBy 477
-#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L
-
-#define SN_domainComponent "DC"
-#define LN_domainComponent "domainComponent"
-#define NID_domainComponent 391
-#define OBJ_domainComponent OBJ_pilotAttributeType,25L
+#define SN_id_cmc_responseInfo "id-cmc-responseInfo"
+#define NID_id_cmc_responseInfo 342
+#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L
-#define LN_aRecord "aRecord"
-#define NID_aRecord 478
-#define OBJ_aRecord OBJ_pilotAttributeType,26L
-
-#define LN_pilotAttributeType27 "pilotAttributeType27"
-#define NID_pilotAttributeType27 479
-#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L
-
-#define LN_mXRecord "mXRecord"
-#define NID_mXRecord 480
-#define OBJ_mXRecord OBJ_pilotAttributeType,28L
-
-#define LN_nSRecord "nSRecord"
-#define NID_nSRecord 481
-#define OBJ_nSRecord OBJ_pilotAttributeType,29L
-
-#define LN_sOARecord "sOARecord"
-#define NID_sOARecord 482
-#define OBJ_sOARecord OBJ_pilotAttributeType,30L
-
-#define LN_cNAMERecord "cNAMERecord"
-#define NID_cNAMERecord 483
-#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L
-
-#define LN_associatedDomain "associatedDomain"
-#define NID_associatedDomain 484
-#define OBJ_associatedDomain OBJ_pilotAttributeType,37L
-
-#define LN_associatedName "associatedName"
-#define NID_associatedName 485
-#define OBJ_associatedName OBJ_pilotAttributeType,38L
-
-#define LN_homePostalAddress "homePostalAddress"
-#define NID_homePostalAddress 486
-#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L
-
-#define LN_personalTitle "personalTitle"
-#define NID_personalTitle 487
-#define OBJ_personalTitle OBJ_pilotAttributeType,40L
-
-#define LN_mobileTelephoneNumber "mobileTelephoneNumber"
-#define NID_mobileTelephoneNumber 488
-#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L
-
-#define LN_pagerTelephoneNumber "pagerTelephoneNumber"
-#define NID_pagerTelephoneNumber 489
-#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L
-
-#define LN_friendlyCountryName "friendlyCountryName"
-#define NID_friendlyCountryName 490
-#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L
-
-#define LN_organizationalStatus "organizationalStatus"
-#define NID_organizationalStatus 491
-#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L
-
-#define LN_janetMailbox "janetMailbox"
-#define NID_janetMailbox 492
-#define OBJ_janetMailbox OBJ_pilotAttributeType,46L
-
-#define LN_mailPreferenceOption "mailPreferenceOption"
-#define NID_mailPreferenceOption 493
-#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L
-
-#define LN_buildingName "buildingName"
-#define NID_buildingName 494
-#define OBJ_buildingName OBJ_pilotAttributeType,48L
-
-#define LN_dSAQuality "dSAQuality"
-#define NID_dSAQuality 495
-#define OBJ_dSAQuality OBJ_pilotAttributeType,49L
-
-#define LN_singleLevelQuality "singleLevelQuality"
-#define NID_singleLevelQuality 496
-#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L
-
-#define LN_subtreeMinimumQuality "subtreeMinimumQuality"
-#define NID_subtreeMinimumQuality 497
-#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L
-
-#define LN_subtreeMaximumQuality "subtreeMaximumQuality"
-#define NID_subtreeMaximumQuality 498
-#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L
-
-#define LN_personalSignature "personalSignature"
-#define NID_personalSignature 499
-#define OBJ_personalSignature OBJ_pilotAttributeType,53L
-
-#define LN_dITRedirect "dITRedirect"
-#define NID_dITRedirect 500
-#define OBJ_dITRedirect OBJ_pilotAttributeType,54L
-
-#define SN_audio "audio"
-#define NID_audio 501
-#define OBJ_audio OBJ_pilotAttributeType,55L
-
-#define LN_documentPublisher "documentPublisher"
-#define NID_documentPublisher 502
-#define OBJ_documentPublisher OBJ_pilotAttributeType,56L
+#define SN_id_cmc_queryPending "id-cmc-queryPending"
+#define NID_id_cmc_queryPending 343
+#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L
+
+#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom"
+#define NID_id_cmc_popLinkRandom 344
+#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L
+
+#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness"
+#define NID_id_cmc_popLinkWitness 345
+#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L
+
+#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance"
+#define NID_id_cmc_confirmCertAcceptance 346
+#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L
+
+#define SN_id_on_personalData "id-on-personalData"
+#define NID_id_on_personalData 347
+#define OBJ_id_on_personalData OBJ_id_on,1L
+
+#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier"
+#define LN_id_on_permanentIdentifier "Permanent Identifier"
+#define NID_id_on_permanentIdentifier 858
+#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L
+
+#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
+#define NID_id_pda_dateOfBirth 348
+#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
+
+#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth"
+#define NID_id_pda_placeOfBirth 349
+#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L
+
+#define SN_id_pda_gender "id-pda-gender"
+#define NID_id_pda_gender 351
+#define OBJ_id_pda_gender OBJ_id_pda,3L
+
+#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship"
+#define NID_id_pda_countryOfCitizenship 352
+#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L
+
+#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence"
+#define NID_id_pda_countryOfResidence 353
+#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L
+
+#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo"
+#define NID_id_aca_authenticationInfo 354
+#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L
+
+#define SN_id_aca_accessIdentity "id-aca-accessIdentity"
+#define NID_id_aca_accessIdentity 355
+#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L
+
+#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity"
+#define NID_id_aca_chargingIdentity 356
+#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L
+
+#define SN_id_aca_group "id-aca-group"
+#define NID_id_aca_group 357
+#define OBJ_id_aca_group OBJ_id_aca,4L
+
+#define SN_id_aca_role "id-aca-role"
+#define NID_id_aca_role 358
+#define OBJ_id_aca_role OBJ_id_aca,5L
+
+#define SN_id_aca_encAttrs "id-aca-encAttrs"
+#define NID_id_aca_encAttrs 399
+#define OBJ_id_aca_encAttrs OBJ_id_aca,6L
+
+#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
+#define NID_id_qcs_pkixQCSyntax_v1 359
+#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
+
+#define SN_id_cct_crs "id-cct-crs"
+#define NID_id_cct_crs 360
+#define OBJ_id_cct_crs OBJ_id_cct,1L
+
+#define SN_id_cct_PKIData "id-cct-PKIData"
+#define NID_id_cct_PKIData 361
+#define OBJ_id_cct_PKIData OBJ_id_cct,2L
+
+#define SN_id_cct_PKIResponse "id-cct-PKIResponse"
+#define NID_id_cct_PKIResponse 362
+#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L
+
+#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage"
+#define LN_id_ppl_anyLanguage "Any language"
+#define NID_id_ppl_anyLanguage 664
+#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L
+
+#define SN_id_ppl_inheritAll "id-ppl-inheritAll"
+#define LN_id_ppl_inheritAll "Inherit all"
+#define NID_id_ppl_inheritAll 665
+#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L
+
+#define SN_Independent "id-ppl-independent"
+#define LN_Independent "Independent"
+#define NID_Independent 667
+#define OBJ_Independent OBJ_id_ppl,2L
+
+#define SN_ad_OCSP "OCSP"
+#define LN_ad_OCSP "OCSP"
+#define NID_ad_OCSP 178
+#define OBJ_ad_OCSP OBJ_id_ad,1L
+
+#define SN_ad_ca_issuers "caIssuers"
+#define LN_ad_ca_issuers "CA Issuers"
+#define NID_ad_ca_issuers 179
+#define OBJ_ad_ca_issuers OBJ_id_ad,2L
+
+#define SN_ad_timeStamping "ad_timestamping"
+#define LN_ad_timeStamping "AD Time Stamping"
+#define NID_ad_timeStamping 363
+#define OBJ_ad_timeStamping OBJ_id_ad,3L
+
+#define SN_ad_dvcs "AD_DVCS"
+#define LN_ad_dvcs "ad dvcs"
+#define NID_ad_dvcs 364
+#define OBJ_ad_dvcs OBJ_id_ad,4L
+
+#define SN_caRepository "caRepository"
+#define LN_caRepository "CA Repository"
+#define NID_caRepository 785
+#define OBJ_caRepository OBJ_id_ad,5L
+
+#define OBJ_id_pkix_OCSP OBJ_ad_OCSP
+
+#define SN_id_pkix_OCSP_basic "basicOCSPResponse"
+#define LN_id_pkix_OCSP_basic "Basic OCSP Response"
+#define NID_id_pkix_OCSP_basic 365
+#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L
+
+#define SN_id_pkix_OCSP_Nonce "Nonce"
+#define LN_id_pkix_OCSP_Nonce "OCSP Nonce"
+#define NID_id_pkix_OCSP_Nonce 366
+#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L
+
+#define SN_id_pkix_OCSP_CrlID "CrlID"
+#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID"
+#define NID_id_pkix_OCSP_CrlID 367
+#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L
+
+#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses"
+#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses"
+#define NID_id_pkix_OCSP_acceptableResponses 368
+#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L
+
+#define SN_id_pkix_OCSP_noCheck "noCheck"
+#define LN_id_pkix_OCSP_noCheck "OCSP No Check"
+#define NID_id_pkix_OCSP_noCheck 369
+#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L
+
+#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff"
+#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff"
+#define NID_id_pkix_OCSP_archiveCutoff 370
+#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L
+
+#define SN_id_pkix_OCSP_serviceLocator "serviceLocator"
+#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator"
+#define NID_id_pkix_OCSP_serviceLocator 371
+#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L
+
+#define SN_id_pkix_OCSP_extendedStatus "extendedStatus"
+#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status"
+#define NID_id_pkix_OCSP_extendedStatus 372
+#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L
+
+#define SN_id_pkix_OCSP_valid "valid"
+#define NID_id_pkix_OCSP_valid 373
+#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L
+
+#define SN_id_pkix_OCSP_path "path"
+#define NID_id_pkix_OCSP_path 374
+#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L
+
+#define SN_id_pkix_OCSP_trustRoot "trustRoot"
+#define LN_id_pkix_OCSP_trustRoot "Trust Root"
+#define NID_id_pkix_OCSP_trustRoot 375
+#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L
+
+#define SN_algorithm "algorithm"
+#define LN_algorithm "algorithm"
+#define NID_algorithm 376
+#define OBJ_algorithm 1L,3L,14L,3L,2L
+
+#define SN_md5WithRSA "RSA-NP-MD5"
+#define LN_md5WithRSA "md5WithRSA"
+#define NID_md5WithRSA 104
+#define OBJ_md5WithRSA OBJ_algorithm,3L
+
+#define SN_des_ecb "DES-ECB"
+#define LN_des_ecb "des-ecb"
+#define NID_des_ecb 29
+#define OBJ_des_ecb OBJ_algorithm,6L
+
+#define SN_des_cbc "DES-CBC"
+#define LN_des_cbc "des-cbc"
+#define NID_des_cbc 31
+#define OBJ_des_cbc OBJ_algorithm,7L
+
+#define SN_des_ofb64 "DES-OFB"
+#define LN_des_ofb64 "des-ofb"
+#define NID_des_ofb64 45
+#define OBJ_des_ofb64 OBJ_algorithm,8L
+
+#define SN_des_cfb64 "DES-CFB"
+#define LN_des_cfb64 "des-cfb"
+#define NID_des_cfb64 30
+#define OBJ_des_cfb64 OBJ_algorithm,9L
+
+#define SN_rsaSignature "rsaSignature"
+#define NID_rsaSignature 377
+#define OBJ_rsaSignature OBJ_algorithm,11L
+
+#define SN_dsa_2 "DSA-old"
+#define LN_dsa_2 "dsaEncryption-old"
+#define NID_dsa_2 67
+#define OBJ_dsa_2 OBJ_algorithm,12L
+
+#define SN_dsaWithSHA "DSA-SHA"
+#define LN_dsaWithSHA "dsaWithSHA"
+#define NID_dsaWithSHA 66
+#define OBJ_dsaWithSHA OBJ_algorithm,13L
+
+#define SN_shaWithRSAEncryption "RSA-SHA"
+#define LN_shaWithRSAEncryption "shaWithRSAEncryption"
+#define NID_shaWithRSAEncryption 42
+#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
+
+#define SN_des_ede_ecb "DES-EDE"
+#define LN_des_ede_ecb "des-ede"
+#define NID_des_ede_ecb 32
+#define OBJ_des_ede_ecb OBJ_algorithm,17L
+
+#define SN_des_ede3_ecb "DES-EDE3"
+#define LN_des_ede3_ecb "des-ede3"
+#define NID_des_ede3_ecb 33
+
+#define SN_des_ede_cbc "DES-EDE-CBC"
+#define LN_des_ede_cbc "des-ede-cbc"
+#define NID_des_ede_cbc 43
+
+#define SN_des_ede_cfb64 "DES-EDE-CFB"
+#define LN_des_ede_cfb64 "des-ede-cfb"
+#define NID_des_ede_cfb64 60
+
+#define SN_des_ede3_cfb64 "DES-EDE3-CFB"
+#define LN_des_ede3_cfb64 "des-ede3-cfb"
+#define NID_des_ede3_cfb64 61
+
+#define SN_des_ede_ofb64 "DES-EDE-OFB"
+#define LN_des_ede_ofb64 "des-ede-ofb"
+#define NID_des_ede_ofb64 62
+
+#define SN_des_ede3_ofb64 "DES-EDE3-OFB"
+#define LN_des_ede3_ofb64 "des-ede3-ofb"
+#define NID_des_ede3_ofb64 63
+
+#define SN_desx_cbc "DESX-CBC"
+#define LN_desx_cbc "desx-cbc"
+#define NID_desx_cbc 80
+
+#define SN_sha "SHA"
+#define LN_sha "sha"
+#define NID_sha 41
+#define OBJ_sha OBJ_algorithm,18L
+
+#define SN_sha1 "SHA1"
+#define LN_sha1 "sha1"
+#define NID_sha1 64
+#define OBJ_sha1 OBJ_algorithm,26L
+
+#define SN_dsaWithSHA1_2 "DSA-SHA1-old"
+#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
+#define NID_dsaWithSHA1_2 70
+#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
+
+#define SN_sha1WithRSA "RSA-SHA1-2"
+#define LN_sha1WithRSA "sha1WithRSA"
+#define NID_sha1WithRSA 115
+#define OBJ_sha1WithRSA OBJ_algorithm,29L
+
+#define SN_ripemd160 "RIPEMD160"
+#define LN_ripemd160 "ripemd160"
+#define NID_ripemd160 117
+#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
+
+#define SN_ripemd160WithRSA "RSA-RIPEMD160"
+#define LN_ripemd160WithRSA "ripemd160WithRSA"
+#define NID_ripemd160WithRSA 119
+#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
+
+#define SN_sxnet "SXNetID"
+#define LN_sxnet "Strong Extranet ID"
+#define NID_sxnet 143
+#define OBJ_sxnet 1L,3L,101L,1L,4L,1L
+
+#define SN_X500 "X500"
+#define LN_X500 "directory services (X.500)"
+#define NID_X500 11
+#define OBJ_X500 2L,5L
+
+#define SN_X509 "X509"
+#define NID_X509 12
+#define OBJ_X509 OBJ_X500,4L
+
+#define SN_commonName "CN"
+#define LN_commonName "commonName"
+#define NID_commonName 13
+#define OBJ_commonName OBJ_X509,3L
+
+#define SN_surname "SN"
+#define LN_surname "surname"
+#define NID_surname 100
+#define OBJ_surname OBJ_X509,4L
+
+#define LN_serialNumber "serialNumber"
+#define NID_serialNumber 105
+#define OBJ_serialNumber OBJ_X509,5L
+
+#define SN_countryName "C"
+#define LN_countryName "countryName"
+#define NID_countryName 14
+#define OBJ_countryName OBJ_X509,6L
+
+#define SN_localityName "L"
+#define LN_localityName "localityName"
+#define NID_localityName 15
+#define OBJ_localityName OBJ_X509,7L
+
+#define SN_stateOrProvinceName "ST"
+#define LN_stateOrProvinceName "stateOrProvinceName"
+#define NID_stateOrProvinceName 16
+#define OBJ_stateOrProvinceName OBJ_X509,8L
+
+#define LN_streetAddress "streetAddress"
+#define NID_streetAddress 660
+#define OBJ_streetAddress OBJ_X509,9L
+
+#define SN_organizationName "O"
+#define LN_organizationName "organizationName"
+#define NID_organizationName 17
+#define OBJ_organizationName OBJ_X509,10L
+
+#define SN_organizationalUnitName "OU"
+#define LN_organizationalUnitName "organizationalUnitName"
+#define NID_organizationalUnitName 18
+#define OBJ_organizationalUnitName OBJ_X509,11L
+
+#define LN_title "title"
+#define NID_title 106
+#define OBJ_title OBJ_X509,12L
+
+#define LN_description "description"
+#define NID_description 107
+#define OBJ_description OBJ_X509,13L
+
+#define LN_postalCode "postalCode"
+#define NID_postalCode 661
+#define OBJ_postalCode OBJ_X509,17L
+
+#define SN_name "name"
+#define LN_name "name"
+#define NID_name 173
+#define OBJ_name OBJ_X509,41L
+
+#define SN_givenName "GN"
+#define LN_givenName "givenName"
+#define NID_givenName 99
+#define OBJ_givenName OBJ_X509,42L
+
+#define LN_initials "initials"
+#define NID_initials 101
+#define OBJ_initials OBJ_X509,43L
+
+#define LN_generationQualifier "generationQualifier"
+#define NID_generationQualifier 509
+#define OBJ_generationQualifier OBJ_X509,44L
+
+#define LN_x500UniqueIdentifier "x500UniqueIdentifier"
+#define NID_x500UniqueIdentifier 503
+#define OBJ_x500UniqueIdentifier OBJ_X509,45L
+
+#define SN_dnQualifier "dnQualifier"
+#define LN_dnQualifier "dnQualifier"
+#define NID_dnQualifier 174
+#define OBJ_dnQualifier OBJ_X509,46L
+
+#define LN_pseudonym "pseudonym"
+#define NID_pseudonym 510
+#define OBJ_pseudonym OBJ_X509,65L
+
+#define SN_role "role"
+#define LN_role "role"
+#define NID_role 400
+#define OBJ_role OBJ_X509,72L
+
+#define SN_X500algorithms "X500algorithms"
+#define LN_X500algorithms "directory services - algorithms"
+#define NID_X500algorithms 378
+#define OBJ_X500algorithms OBJ_X500,8L
+
+#define SN_rsa "RSA"
+#define LN_rsa "rsa"
+#define NID_rsa 19
+#define OBJ_rsa OBJ_X500algorithms,1L,1L
+
+#define SN_mdc2WithRSA "RSA-MDC2"
+#define LN_mdc2WithRSA "mdc2WithRSA"
+#define NID_mdc2WithRSA 96
+#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L
+
+#define SN_mdc2 "MDC2"
+#define LN_mdc2 "mdc2"
+#define NID_mdc2 95
+#define OBJ_mdc2 OBJ_X500algorithms,3L,101L
+
+#define SN_id_ce "id-ce"
+#define NID_id_ce 81
+#define OBJ_id_ce OBJ_X500,29L
+
+#define SN_subject_directory_attributes "subjectDirectoryAttributes"
+#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes"
+#define NID_subject_directory_attributes 769
+#define OBJ_subject_directory_attributes OBJ_id_ce,9L
+
+#define SN_subject_key_identifier "subjectKeyIdentifier"
+#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
+#define NID_subject_key_identifier 82
+#define OBJ_subject_key_identifier OBJ_id_ce,14L
+
+#define SN_key_usage "keyUsage"
+#define LN_key_usage "X509v3 Key Usage"
+#define NID_key_usage 83
+#define OBJ_key_usage OBJ_id_ce,15L
+
+#define SN_private_key_usage_period "privateKeyUsagePeriod"
+#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
+#define NID_private_key_usage_period 84
+#define OBJ_private_key_usage_period OBJ_id_ce,16L
+
+#define SN_subject_alt_name "subjectAltName"
+#define LN_subject_alt_name "X509v3 Subject Alternative Name"
+#define NID_subject_alt_name 85
+#define OBJ_subject_alt_name OBJ_id_ce,17L
+
+#define SN_issuer_alt_name "issuerAltName"
+#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
+#define NID_issuer_alt_name 86
+#define OBJ_issuer_alt_name OBJ_id_ce,18L
+
+#define SN_basic_constraints "basicConstraints"
+#define LN_basic_constraints "X509v3 Basic Constraints"
+#define NID_basic_constraints 87
+#define OBJ_basic_constraints OBJ_id_ce,19L
+
+#define SN_crl_number "crlNumber"
+#define LN_crl_number "X509v3 CRL Number"
+#define NID_crl_number 88
+#define OBJ_crl_number OBJ_id_ce,20L
+
+#define SN_crl_reason "CRLReason"
+#define LN_crl_reason "X509v3 CRL Reason Code"
+#define NID_crl_reason 141
+#define OBJ_crl_reason OBJ_id_ce,21L
+
+#define SN_invalidity_date "invalidityDate"
+#define LN_invalidity_date "Invalidity Date"
+#define NID_invalidity_date 142
+#define OBJ_invalidity_date OBJ_id_ce,24L
+
+#define SN_delta_crl "deltaCRL"
+#define LN_delta_crl "X509v3 Delta CRL Indicator"
+#define NID_delta_crl 140
+#define OBJ_delta_crl OBJ_id_ce,27L
+
+#define SN_issuing_distribution_point "issuingDistributionPoint"
+#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point"
+#define NID_issuing_distribution_point 770
+#define OBJ_issuing_distribution_point OBJ_id_ce,28L
+
+#define SN_certificate_issuer "certificateIssuer"
+#define LN_certificate_issuer "X509v3 Certificate Issuer"
+#define NID_certificate_issuer 771
+#define OBJ_certificate_issuer OBJ_id_ce,29L
+
+#define SN_name_constraints "nameConstraints"
+#define LN_name_constraints "X509v3 Name Constraints"
+#define NID_name_constraints 666
+#define OBJ_name_constraints OBJ_id_ce,30L
+
+#define SN_crl_distribution_points "crlDistributionPoints"
+#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
+#define NID_crl_distribution_points 103
+#define OBJ_crl_distribution_points OBJ_id_ce,31L
+
+#define SN_certificate_policies "certificatePolicies"
+#define LN_certificate_policies "X509v3 Certificate Policies"
+#define NID_certificate_policies 89
+#define OBJ_certificate_policies OBJ_id_ce,32L
+
+#define SN_any_policy "anyPolicy"
+#define LN_any_policy "X509v3 Any Policy"
+#define NID_any_policy 746
+#define OBJ_any_policy OBJ_certificate_policies,0L
+
+#define SN_policy_mappings "policyMappings"
+#define LN_policy_mappings "X509v3 Policy Mappings"
+#define NID_policy_mappings 747
+#define OBJ_policy_mappings OBJ_id_ce,33L
+
+#define SN_authority_key_identifier "authorityKeyIdentifier"
+#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
+#define NID_authority_key_identifier 90
+#define OBJ_authority_key_identifier OBJ_id_ce,35L
+
+#define SN_policy_constraints "policyConstraints"
+#define LN_policy_constraints "X509v3 Policy Constraints"
+#define NID_policy_constraints 401
+#define OBJ_policy_constraints OBJ_id_ce,36L
+
+#define SN_ext_key_usage "extendedKeyUsage"
+#define LN_ext_key_usage "X509v3 Extended Key Usage"
+#define NID_ext_key_usage 126
+#define OBJ_ext_key_usage OBJ_id_ce,37L
+
+#define SN_freshest_crl "freshestCRL"
+#define LN_freshest_crl "X509v3 Freshest CRL"
+#define NID_freshest_crl 857
+#define OBJ_freshest_crl OBJ_id_ce,46L
+
+#define SN_inhibit_any_policy "inhibitAnyPolicy"
+#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy"
+#define NID_inhibit_any_policy 748
+#define OBJ_inhibit_any_policy OBJ_id_ce,54L
+
+#define SN_target_information "targetInformation"
+#define LN_target_information "X509v3 AC Targeting"
+#define NID_target_information 402
+#define OBJ_target_information OBJ_id_ce,55L
+
+#define SN_no_rev_avail "noRevAvail"
+#define LN_no_rev_avail "X509v3 No Revocation Available"
+#define NID_no_rev_avail 403
+#define OBJ_no_rev_avail OBJ_id_ce,56L
+
+#define SN_netscape "Netscape"
+#define LN_netscape "Netscape Communications Corp."
+#define NID_netscape 57
+#define OBJ_netscape 2L,16L,840L,1L,113730L
+
+#define SN_netscape_cert_extension "nsCertExt"
+#define LN_netscape_cert_extension "Netscape Certificate Extension"
+#define NID_netscape_cert_extension 58
+#define OBJ_netscape_cert_extension OBJ_netscape,1L
+
+#define SN_netscape_data_type "nsDataType"
+#define LN_netscape_data_type "Netscape Data Type"
+#define NID_netscape_data_type 59
+#define OBJ_netscape_data_type OBJ_netscape,2L
+
+#define SN_netscape_cert_type "nsCertType"
+#define LN_netscape_cert_type "Netscape Cert Type"
+#define NID_netscape_cert_type 71
+#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
+
+#define SN_netscape_base_url "nsBaseUrl"
+#define LN_netscape_base_url "Netscape Base Url"
+#define NID_netscape_base_url 72
+#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
+
+#define SN_netscape_revocation_url "nsRevocationUrl"
+#define LN_netscape_revocation_url "Netscape Revocation Url"
+#define NID_netscape_revocation_url 73
+#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
+
+#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
+#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
+#define NID_netscape_ca_revocation_url 74
+#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
+
+#define SN_netscape_renewal_url "nsRenewalUrl"
+#define LN_netscape_renewal_url "Netscape Renewal Url"
+#define NID_netscape_renewal_url 75
+#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
+
+#define SN_netscape_ca_policy_url "nsCaPolicyUrl"
+#define LN_netscape_ca_policy_url "Netscape CA Policy Url"
+#define NID_netscape_ca_policy_url 76
+#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
+
+#define SN_netscape_ssl_server_name "nsSslServerName"
+#define LN_netscape_ssl_server_name "Netscape SSL Server Name"
+#define NID_netscape_ssl_server_name 77
+#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
+
+#define SN_netscape_comment "nsComment"
+#define LN_netscape_comment "Netscape Comment"
+#define NID_netscape_comment 78
+#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
+
+#define SN_netscape_cert_sequence "nsCertSequence"
+#define LN_netscape_cert_sequence "Netscape Certificate Sequence"
+#define NID_netscape_cert_sequence 79
+#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
+
+#define SN_ns_sgc "nsSGC"
+#define LN_ns_sgc "Netscape Server Gated Crypto"
+#define NID_ns_sgc 139
+#define OBJ_ns_sgc OBJ_netscape,4L,1L
+
+#define SN_org "ORG"
+#define LN_org "org"
+#define NID_org 379
+#define OBJ_org OBJ_iso,3L
+
+#define SN_dod "DOD"
+#define LN_dod "dod"
+#define NID_dod 380
+#define OBJ_dod OBJ_org,6L
+
+#define SN_iana "IANA"
+#define LN_iana "iana"
+#define NID_iana 381
+#define OBJ_iana OBJ_dod,1L
+
+#define OBJ_internet OBJ_iana
+
+#define SN_Directory "directory"
+#define LN_Directory "Directory"
+#define NID_Directory 382
+#define OBJ_Directory OBJ_internet,1L
+
+#define SN_Management "mgmt"
+#define LN_Management "Management"
+#define NID_Management 383
+#define OBJ_Management OBJ_internet,2L
+
+#define SN_Experimental "experimental"
+#define LN_Experimental "Experimental"
+#define NID_Experimental 384
+#define OBJ_Experimental OBJ_internet,3L
+
+#define SN_Private "private"
+#define LN_Private "Private"
+#define NID_Private 385
+#define OBJ_Private OBJ_internet,4L
+
+#define SN_Security "security"
+#define LN_Security "Security"
+#define NID_Security 386
+#define OBJ_Security OBJ_internet,5L
+
+#define SN_SNMPv2 "snmpv2"
+#define LN_SNMPv2 "SNMPv2"
+#define NID_SNMPv2 387
+#define OBJ_SNMPv2 OBJ_internet,6L
+
+#define LN_Mail "Mail"
+#define NID_Mail 388
+#define OBJ_Mail OBJ_internet,7L
+
+#define SN_Enterprises "enterprises"
+#define LN_Enterprises "Enterprises"
+#define NID_Enterprises 389
+#define OBJ_Enterprises OBJ_Private,1L
+
+#define SN_dcObject "dcobject"
+#define LN_dcObject "dcObject"
+#define NID_dcObject 390
+#define OBJ_dcObject OBJ_Enterprises,1466L,344L
+
+#define SN_mime_mhs "mime-mhs"
+#define LN_mime_mhs "MIME MHS"
+#define NID_mime_mhs 504
+#define OBJ_mime_mhs OBJ_Mail,1L
+
+#define SN_mime_mhs_headings "mime-mhs-headings"
+#define LN_mime_mhs_headings "mime-mhs-headings"
+#define NID_mime_mhs_headings 505
+#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L
+
+#define SN_mime_mhs_bodies "mime-mhs-bodies"
+#define LN_mime_mhs_bodies "mime-mhs-bodies"
+#define NID_mime_mhs_bodies 506
+#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L
+
+#define SN_id_hex_partial_message "id-hex-partial-message"
+#define LN_id_hex_partial_message "id-hex-partial-message"
+#define NID_id_hex_partial_message 507
+#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L
+
+#define SN_id_hex_multipart_message "id-hex-multipart-message"
+#define LN_id_hex_multipart_message "id-hex-multipart-message"
+#define NID_id_hex_multipart_message 508
+#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L
+
+#define SN_rle_compression "RLE"
+#define LN_rle_compression "run length compression"
+#define NID_rle_compression 124
+#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
+
+#define SN_zlib_compression "ZLIB"
+#define LN_zlib_compression "zlib compression"
+#define NID_zlib_compression 125
+#define OBJ_zlib_compression OBJ_id_smime_alg,8L
+
+#define OBJ_csor 2L,16L,840L,1L,101L,3L
+
+#define OBJ_nistAlgorithms OBJ_csor,4L
+
+#define OBJ_aes OBJ_nistAlgorithms,1L
+
+#define SN_aes_128_ecb "AES-128-ECB"
+#define LN_aes_128_ecb "aes-128-ecb"
+#define NID_aes_128_ecb 418
+#define OBJ_aes_128_ecb OBJ_aes,1L
+
+#define SN_aes_128_cbc "AES-128-CBC"
+#define LN_aes_128_cbc "aes-128-cbc"
+#define NID_aes_128_cbc 419
+#define OBJ_aes_128_cbc OBJ_aes,2L
+
+#define SN_aes_128_ofb128 "AES-128-OFB"
+#define LN_aes_128_ofb128 "aes-128-ofb"
+#define NID_aes_128_ofb128 420
+#define OBJ_aes_128_ofb128 OBJ_aes,3L
+
+#define SN_aes_128_cfb128 "AES-128-CFB"
+#define LN_aes_128_cfb128 "aes-128-cfb"
+#define NID_aes_128_cfb128 421
+#define OBJ_aes_128_cfb128 OBJ_aes,4L
+
+#define SN_aes_192_ecb "AES-192-ECB"
+#define LN_aes_192_ecb "aes-192-ecb"
+#define NID_aes_192_ecb 422
+#define OBJ_aes_192_ecb OBJ_aes,21L
+
+#define SN_aes_192_cbc "AES-192-CBC"
+#define LN_aes_192_cbc "aes-192-cbc"
+#define NID_aes_192_cbc 423
+#define OBJ_aes_192_cbc OBJ_aes,22L
+
+#define SN_aes_192_ofb128 "AES-192-OFB"
+#define LN_aes_192_ofb128 "aes-192-ofb"
+#define NID_aes_192_ofb128 424
+#define OBJ_aes_192_ofb128 OBJ_aes,23L
+
+#define SN_aes_192_cfb128 "AES-192-CFB"
+#define LN_aes_192_cfb128 "aes-192-cfb"
+#define NID_aes_192_cfb128 425
+#define OBJ_aes_192_cfb128 OBJ_aes,24L
+
+#define SN_aes_256_ecb "AES-256-ECB"
+#define LN_aes_256_ecb "aes-256-ecb"
+#define NID_aes_256_ecb 426
+#define OBJ_aes_256_ecb OBJ_aes,41L
+
+#define SN_aes_256_cbc "AES-256-CBC"
+#define LN_aes_256_cbc "aes-256-cbc"
+#define NID_aes_256_cbc 427
+#define OBJ_aes_256_cbc OBJ_aes,42L
+
+#define SN_aes_256_ofb128 "AES-256-OFB"
+#define LN_aes_256_ofb128 "aes-256-ofb"
+#define NID_aes_256_ofb128 428
+#define OBJ_aes_256_ofb128 OBJ_aes,43L
+
+#define SN_aes_256_cfb128 "AES-256-CFB"
+#define LN_aes_256_cfb128 "aes-256-cfb"
+#define NID_aes_256_cfb128 429
+#define OBJ_aes_256_cfb128 OBJ_aes,44L
+
+#define SN_aes_128_cfb1 "AES-128-CFB1"
+#define LN_aes_128_cfb1 "aes-128-cfb1"
+#define NID_aes_128_cfb1 650
+
+#define SN_aes_192_cfb1 "AES-192-CFB1"
+#define LN_aes_192_cfb1 "aes-192-cfb1"
+#define NID_aes_192_cfb1 651
+
+#define SN_aes_256_cfb1 "AES-256-CFB1"
+#define LN_aes_256_cfb1 "aes-256-cfb1"
+#define NID_aes_256_cfb1 652
+
+#define SN_aes_128_cfb8 "AES-128-CFB8"
+#define LN_aes_128_cfb8 "aes-128-cfb8"
+#define NID_aes_128_cfb8 653
+
+#define SN_aes_192_cfb8 "AES-192-CFB8"
+#define LN_aes_192_cfb8 "aes-192-cfb8"
+#define NID_aes_192_cfb8 654
+
+#define SN_aes_256_cfb8 "AES-256-CFB8"
+#define LN_aes_256_cfb8 "aes-256-cfb8"
+#define NID_aes_256_cfb8 655
+
+#define SN_des_cfb1 "DES-CFB1"
+#define LN_des_cfb1 "des-cfb1"
+#define NID_des_cfb1 656
+
+#define SN_des_cfb8 "DES-CFB8"
+#define LN_des_cfb8 "des-cfb8"
+#define NID_des_cfb8 657
+
+#define SN_des_ede3_cfb1 "DES-EDE3-CFB1"
+#define LN_des_ede3_cfb1 "des-ede3-cfb1"
+#define NID_des_ede3_cfb1 658
+
+#define SN_des_ede3_cfb8 "DES-EDE3-CFB8"
+#define LN_des_ede3_cfb8 "des-ede3-cfb8"
+#define NID_des_ede3_cfb8 659
+
+#define SN_id_aes128_wrap "id-aes128-wrap"
+#define NID_id_aes128_wrap 788
+#define OBJ_id_aes128_wrap OBJ_aes,5L
+
+#define SN_id_aes192_wrap "id-aes192-wrap"
+#define NID_id_aes192_wrap 789
+#define OBJ_id_aes192_wrap OBJ_aes,25L
+
+#define SN_id_aes256_wrap "id-aes256-wrap"
+#define NID_id_aes256_wrap 790
+#define OBJ_id_aes256_wrap OBJ_aes,45L
+
+#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L
+
+#define SN_sha256 "SHA256"
+#define LN_sha256 "sha256"
+#define NID_sha256 672
+#define OBJ_sha256 OBJ_nist_hashalgs,1L
+
+#define SN_sha384 "SHA384"
+#define LN_sha384 "sha384"
+#define NID_sha384 673
+#define OBJ_sha384 OBJ_nist_hashalgs,2L
+
+#define SN_sha512 "SHA512"
+#define LN_sha512 "sha512"
+#define NID_sha512 674
+#define OBJ_sha512 OBJ_nist_hashalgs,3L
+
+#define SN_sha224 "SHA224"
+#define LN_sha224 "sha224"
+#define NID_sha224 675
+#define OBJ_sha224 OBJ_nist_hashalgs,4L
+
+#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L
+
+#define SN_dsa_with_SHA224 "dsa_with_SHA224"
+#define NID_dsa_with_SHA224 802
+#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L
+
+#define SN_dsa_with_SHA256 "dsa_with_SHA256"
+#define NID_dsa_with_SHA256 803
+#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L
+
+#define SN_hold_instruction_code "holdInstructionCode"
+#define LN_hold_instruction_code "Hold Instruction Code"
+#define NID_hold_instruction_code 430
+#define OBJ_hold_instruction_code OBJ_id_ce,23L
+
+#define OBJ_holdInstruction OBJ_X9_57,2L
+
+#define SN_hold_instruction_none "holdInstructionNone"
+#define LN_hold_instruction_none "Hold Instruction None"
+#define NID_hold_instruction_none 431
+#define OBJ_hold_instruction_none OBJ_holdInstruction,1L
+
+#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer"
+#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer"
+#define NID_hold_instruction_call_issuer 432
+#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L
+
+#define SN_hold_instruction_reject "holdInstructionReject"
+#define LN_hold_instruction_reject "Hold Instruction Reject"
+#define NID_hold_instruction_reject 433
+#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L
+
+#define SN_data "data"
+#define NID_data 434
+#define OBJ_data OBJ_itu_t,9L
+
+#define SN_pss "pss"
+#define NID_pss 435
+#define OBJ_pss OBJ_data,2342L
+
+#define SN_ucl "ucl"
+#define NID_ucl 436
+#define OBJ_ucl OBJ_pss,19200300L
+
+#define SN_pilot "pilot"
+#define NID_pilot 437
+#define OBJ_pilot OBJ_ucl,100L
+
+#define LN_pilotAttributeType "pilotAttributeType"
+#define NID_pilotAttributeType 438
+#define OBJ_pilotAttributeType OBJ_pilot,1L
+
+#define LN_pilotAttributeSyntax "pilotAttributeSyntax"
+#define NID_pilotAttributeSyntax 439
+#define OBJ_pilotAttributeSyntax OBJ_pilot,3L
+
+#define LN_pilotObjectClass "pilotObjectClass"
+#define NID_pilotObjectClass 440
+#define OBJ_pilotObjectClass OBJ_pilot,4L
+
+#define LN_pilotGroups "pilotGroups"
+#define NID_pilotGroups 441
+#define OBJ_pilotGroups OBJ_pilot,10L
+
+#define LN_iA5StringSyntax "iA5StringSyntax"
+#define NID_iA5StringSyntax 442
+#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L
+
+#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax"
+#define NID_caseIgnoreIA5StringSyntax 443
+#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L
+
+#define LN_pilotObject "pilotObject"
+#define NID_pilotObject 444
+#define OBJ_pilotObject OBJ_pilotObjectClass,3L
+
+#define LN_pilotPerson "pilotPerson"
+#define NID_pilotPerson 445
+#define OBJ_pilotPerson OBJ_pilotObjectClass,4L
+
+#define SN_account "account"
+#define NID_account 446
+#define OBJ_account OBJ_pilotObjectClass,5L
+
+#define SN_document "document"
+#define NID_document 447
+#define OBJ_document OBJ_pilotObjectClass,6L
+
+#define SN_room "room"
+#define NID_room 448
+#define OBJ_room OBJ_pilotObjectClass,7L
+
+#define LN_documentSeries "documentSeries"
+#define NID_documentSeries 449
+#define OBJ_documentSeries OBJ_pilotObjectClass,9L
+
+#define SN_Domain "domain"
+#define LN_Domain "Domain"
+#define NID_Domain 392
+#define OBJ_Domain OBJ_pilotObjectClass,13L
+
+#define LN_rFC822localPart "rFC822localPart"
+#define NID_rFC822localPart 450
+#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L
+
+#define LN_dNSDomain "dNSDomain"
+#define NID_dNSDomain 451
+#define OBJ_dNSDomain OBJ_pilotObjectClass,15L
+
+#define LN_domainRelatedObject "domainRelatedObject"
+#define NID_domainRelatedObject 452
+#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L
+
+#define LN_friendlyCountry "friendlyCountry"
+#define NID_friendlyCountry 453
+#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L
+
+#define LN_simpleSecurityObject "simpleSecurityObject"
+#define NID_simpleSecurityObject 454
+#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L
+
+#define LN_pilotOrganization "pilotOrganization"
+#define NID_pilotOrganization 455
+#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L
+
+#define LN_pilotDSA "pilotDSA"
+#define NID_pilotDSA 456
+#define OBJ_pilotDSA OBJ_pilotObjectClass,21L
+
+#define LN_qualityLabelledData "qualityLabelledData"
+#define NID_qualityLabelledData 457
+#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L
+
+#define SN_userId "UID"
+#define LN_userId "userId"
+#define NID_userId 458
+#define OBJ_userId OBJ_pilotAttributeType,1L
+
+#define LN_textEncodedORAddress "textEncodedORAddress"
+#define NID_textEncodedORAddress 459
+#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L
+
+#define SN_rfc822Mailbox "mail"
+#define LN_rfc822Mailbox "rfc822Mailbox"
+#define NID_rfc822Mailbox 460
+#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L
+
+#define SN_info "info"
+#define NID_info 461
+#define OBJ_info OBJ_pilotAttributeType,4L
+
+#define LN_favouriteDrink "favouriteDrink"
+#define NID_favouriteDrink 462
+#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L
+
+#define LN_roomNumber "roomNumber"
+#define NID_roomNumber 463
+#define OBJ_roomNumber OBJ_pilotAttributeType,6L
+
+#define SN_photo "photo"
+#define NID_photo 464
+#define OBJ_photo OBJ_pilotAttributeType,7L
+
+#define LN_userClass "userClass"
+#define NID_userClass 465
+#define OBJ_userClass OBJ_pilotAttributeType,8L
+
+#define SN_host "host"
+#define NID_host 466
+#define OBJ_host OBJ_pilotAttributeType,9L
+
+#define SN_manager "manager"
+#define NID_manager 467
+#define OBJ_manager OBJ_pilotAttributeType,10L
+
+#define LN_documentIdentifier "documentIdentifier"
+#define NID_documentIdentifier 468
+#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L
+
+#define LN_documentTitle "documentTitle"
+#define NID_documentTitle 469
+#define OBJ_documentTitle OBJ_pilotAttributeType,12L
+
+#define LN_documentVersion "documentVersion"
+#define NID_documentVersion 470
+#define OBJ_documentVersion OBJ_pilotAttributeType,13L
+
+#define LN_documentAuthor "documentAuthor"
+#define NID_documentAuthor 471
+#define OBJ_documentAuthor OBJ_pilotAttributeType,14L
+
+#define LN_documentLocation "documentLocation"
+#define NID_documentLocation 472
+#define OBJ_documentLocation OBJ_pilotAttributeType,15L
+
+#define LN_homeTelephoneNumber "homeTelephoneNumber"
+#define NID_homeTelephoneNumber 473
+#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L
+
+#define SN_secretary "secretary"
+#define NID_secretary 474
+#define OBJ_secretary OBJ_pilotAttributeType,21L
+
+#define LN_otherMailbox "otherMailbox"
+#define NID_otherMailbox 475
+#define OBJ_otherMailbox OBJ_pilotAttributeType,22L
+
+#define LN_lastModifiedTime "lastModifiedTime"
+#define NID_lastModifiedTime 476
+#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L
+
+#define LN_lastModifiedBy "lastModifiedBy"
+#define NID_lastModifiedBy 477
+#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L
+
+#define SN_domainComponent "DC"
+#define LN_domainComponent "domainComponent"
+#define NID_domainComponent 391
+#define OBJ_domainComponent OBJ_pilotAttributeType,25L
-#define SN_id_set "id-set"
-#define LN_id_set "Secure Electronic Transactions"
-#define NID_id_set 512
-#define OBJ_id_set OBJ_international_organizations,42L
-
-#define SN_set_ctype "set-ctype"
-#define LN_set_ctype "content types"
-#define NID_set_ctype 513
-#define OBJ_set_ctype OBJ_id_set,0L
-
-#define SN_set_msgExt "set-msgExt"
-#define LN_set_msgExt "message extensions"
-#define NID_set_msgExt 514
-#define OBJ_set_msgExt OBJ_id_set,1L
-
-#define SN_set_attr "set-attr"
-#define NID_set_attr 515
-#define OBJ_set_attr OBJ_id_set,3L
-
-#define SN_set_policy "set-policy"
-#define NID_set_policy 516
-#define OBJ_set_policy OBJ_id_set,5L
-
-#define SN_set_certExt "set-certExt"
-#define LN_set_certExt "certificate extensions"
-#define NID_set_certExt 517
-#define OBJ_set_certExt OBJ_id_set,7L
+#define LN_aRecord "aRecord"
+#define NID_aRecord 478
+#define OBJ_aRecord OBJ_pilotAttributeType,26L
+
+#define LN_pilotAttributeType27 "pilotAttributeType27"
+#define NID_pilotAttributeType27 479
+#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L
+
+#define LN_mXRecord "mXRecord"
+#define NID_mXRecord 480
+#define OBJ_mXRecord OBJ_pilotAttributeType,28L
+
+#define LN_nSRecord "nSRecord"
+#define NID_nSRecord 481
+#define OBJ_nSRecord OBJ_pilotAttributeType,29L
+
+#define LN_sOARecord "sOARecord"
+#define NID_sOARecord 482
+#define OBJ_sOARecord OBJ_pilotAttributeType,30L
+
+#define LN_cNAMERecord "cNAMERecord"
+#define NID_cNAMERecord 483
+#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L
+
+#define LN_associatedDomain "associatedDomain"
+#define NID_associatedDomain 484
+#define OBJ_associatedDomain OBJ_pilotAttributeType,37L
+
+#define LN_associatedName "associatedName"
+#define NID_associatedName 485
+#define OBJ_associatedName OBJ_pilotAttributeType,38L
+
+#define LN_homePostalAddress "homePostalAddress"
+#define NID_homePostalAddress 486
+#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L
+
+#define LN_personalTitle "personalTitle"
+#define NID_personalTitle 487
+#define OBJ_personalTitle OBJ_pilotAttributeType,40L
+
+#define LN_mobileTelephoneNumber "mobileTelephoneNumber"
+#define NID_mobileTelephoneNumber 488
+#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L
+
+#define LN_pagerTelephoneNumber "pagerTelephoneNumber"
+#define NID_pagerTelephoneNumber 489
+#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L
+
+#define LN_friendlyCountryName "friendlyCountryName"
+#define NID_friendlyCountryName 490
+#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L
+
+#define LN_organizationalStatus "organizationalStatus"
+#define NID_organizationalStatus 491
+#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L
+
+#define LN_janetMailbox "janetMailbox"
+#define NID_janetMailbox 492
+#define OBJ_janetMailbox OBJ_pilotAttributeType,46L
+
+#define LN_mailPreferenceOption "mailPreferenceOption"
+#define NID_mailPreferenceOption 493
+#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L
+
+#define LN_buildingName "buildingName"
+#define NID_buildingName 494
+#define OBJ_buildingName OBJ_pilotAttributeType,48L
+
+#define LN_dSAQuality "dSAQuality"
+#define NID_dSAQuality 495
+#define OBJ_dSAQuality OBJ_pilotAttributeType,49L
+
+#define LN_singleLevelQuality "singleLevelQuality"
+#define NID_singleLevelQuality 496
+#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L
+
+#define LN_subtreeMinimumQuality "subtreeMinimumQuality"
+#define NID_subtreeMinimumQuality 497
+#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L
+
+#define LN_subtreeMaximumQuality "subtreeMaximumQuality"
+#define NID_subtreeMaximumQuality 498
+#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L
+
+#define LN_personalSignature "personalSignature"
+#define NID_personalSignature 499
+#define OBJ_personalSignature OBJ_pilotAttributeType,53L
+
+#define LN_dITRedirect "dITRedirect"
+#define NID_dITRedirect 500
+#define OBJ_dITRedirect OBJ_pilotAttributeType,54L
+
+#define SN_audio "audio"
+#define NID_audio 501
+#define OBJ_audio OBJ_pilotAttributeType,55L
+
+#define LN_documentPublisher "documentPublisher"
+#define NID_documentPublisher 502
+#define OBJ_documentPublisher OBJ_pilotAttributeType,56L
-#define SN_set_brand "set-brand"
-#define NID_set_brand 518
-#define OBJ_set_brand OBJ_id_set,8L
+#define SN_id_set "id-set"
+#define LN_id_set "Secure Electronic Transactions"
+#define NID_id_set 512
+#define OBJ_id_set OBJ_international_organizations,42L
+
+#define SN_set_ctype "set-ctype"
+#define LN_set_ctype "content types"
+#define NID_set_ctype 513
+#define OBJ_set_ctype OBJ_id_set,0L
+
+#define SN_set_msgExt "set-msgExt"
+#define LN_set_msgExt "message extensions"
+#define NID_set_msgExt 514
+#define OBJ_set_msgExt OBJ_id_set,1L
+
+#define SN_set_attr "set-attr"
+#define NID_set_attr 515
+#define OBJ_set_attr OBJ_id_set,3L
+
+#define SN_set_policy "set-policy"
+#define NID_set_policy 516
+#define OBJ_set_policy OBJ_id_set,5L
+
+#define SN_set_certExt "set-certExt"
+#define LN_set_certExt "certificate extensions"
+#define NID_set_certExt 517
+#define OBJ_set_certExt OBJ_id_set,7L
-#define SN_setct_PANData "setct-PANData"
-#define NID_setct_PANData 519
-#define OBJ_setct_PANData OBJ_set_ctype,0L
+#define SN_set_brand "set-brand"
+#define NID_set_brand 518
+#define OBJ_set_brand OBJ_id_set,8L
-#define SN_setct_PANToken "setct-PANToken"
-#define NID_setct_PANToken 520
-#define OBJ_setct_PANToken OBJ_set_ctype,1L
+#define SN_setct_PANData "setct-PANData"
+#define NID_setct_PANData 519
+#define OBJ_setct_PANData OBJ_set_ctype,0L
-#define SN_setct_PANOnly "setct-PANOnly"
-#define NID_setct_PANOnly 521
-#define OBJ_setct_PANOnly OBJ_set_ctype,2L
+#define SN_setct_PANToken "setct-PANToken"
+#define NID_setct_PANToken 520
+#define OBJ_setct_PANToken OBJ_set_ctype,1L
-#define SN_setct_OIData "setct-OIData"
-#define NID_setct_OIData 522
-#define OBJ_setct_OIData OBJ_set_ctype,3L
+#define SN_setct_PANOnly "setct-PANOnly"
+#define NID_setct_PANOnly 521
+#define OBJ_setct_PANOnly OBJ_set_ctype,2L
-#define SN_setct_PI "setct-PI"
-#define NID_setct_PI 523
-#define OBJ_setct_PI OBJ_set_ctype,4L
+#define SN_setct_OIData "setct-OIData"
+#define NID_setct_OIData 522
+#define OBJ_setct_OIData OBJ_set_ctype,3L
-#define SN_setct_PIData "setct-PIData"
-#define NID_setct_PIData 524
-#define OBJ_setct_PIData OBJ_set_ctype,5L
+#define SN_setct_PI "setct-PI"
+#define NID_setct_PI 523
+#define OBJ_setct_PI OBJ_set_ctype,4L
-#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned"
-#define NID_setct_PIDataUnsigned 525
-#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L
+#define SN_setct_PIData "setct-PIData"
+#define NID_setct_PIData 524
+#define OBJ_setct_PIData OBJ_set_ctype,5L
-#define SN_setct_HODInput "setct-HODInput"
-#define NID_setct_HODInput 526
-#define OBJ_setct_HODInput OBJ_set_ctype,7L
+#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned"
+#define NID_setct_PIDataUnsigned 525
+#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L
-#define SN_setct_AuthResBaggage "setct-AuthResBaggage"
-#define NID_setct_AuthResBaggage 527
-#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L
+#define SN_setct_HODInput "setct-HODInput"
+#define NID_setct_HODInput 526
+#define OBJ_setct_HODInput OBJ_set_ctype,7L
-#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage"
-#define NID_setct_AuthRevReqBaggage 528
-#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L
+#define SN_setct_AuthResBaggage "setct-AuthResBaggage"
+#define NID_setct_AuthResBaggage 527
+#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L
-#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage"
-#define NID_setct_AuthRevResBaggage 529
-#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L
+#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage"
+#define NID_setct_AuthRevReqBaggage 528
+#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L
-#define SN_setct_CapTokenSeq "setct-CapTokenSeq"
-#define NID_setct_CapTokenSeq 530
-#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L
+#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage"
+#define NID_setct_AuthRevResBaggage 529
+#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L
-#define SN_setct_PInitResData "setct-PInitResData"
-#define NID_setct_PInitResData 531
-#define OBJ_setct_PInitResData OBJ_set_ctype,12L
+#define SN_setct_CapTokenSeq "setct-CapTokenSeq"
+#define NID_setct_CapTokenSeq 530
+#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L
-#define SN_setct_PI_TBS "setct-PI-TBS"
-#define NID_setct_PI_TBS 532
-#define OBJ_setct_PI_TBS OBJ_set_ctype,13L
+#define SN_setct_PInitResData "setct-PInitResData"
+#define NID_setct_PInitResData 531
+#define OBJ_setct_PInitResData OBJ_set_ctype,12L
-#define SN_setct_PResData "setct-PResData"
-#define NID_setct_PResData 533
-#define OBJ_setct_PResData OBJ_set_ctype,14L
+#define SN_setct_PI_TBS "setct-PI-TBS"
+#define NID_setct_PI_TBS 532
+#define OBJ_setct_PI_TBS OBJ_set_ctype,13L
-#define SN_setct_AuthReqTBS "setct-AuthReqTBS"
-#define NID_setct_AuthReqTBS 534
-#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L
+#define SN_setct_PResData "setct-PResData"
+#define NID_setct_PResData 533
+#define OBJ_setct_PResData OBJ_set_ctype,14L
-#define SN_setct_AuthResTBS "setct-AuthResTBS"
-#define NID_setct_AuthResTBS 535
-#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L
+#define SN_setct_AuthReqTBS "setct-AuthReqTBS"
+#define NID_setct_AuthReqTBS 534
+#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L
-#define SN_setct_AuthResTBSX "setct-AuthResTBSX"
-#define NID_setct_AuthResTBSX 536
-#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L
+#define SN_setct_AuthResTBS "setct-AuthResTBS"
+#define NID_setct_AuthResTBS 535
+#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L
-#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS"
-#define NID_setct_AuthTokenTBS 537
-#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L
+#define SN_setct_AuthResTBSX "setct-AuthResTBSX"
+#define NID_setct_AuthResTBSX 536
+#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L
-#define SN_setct_CapTokenData "setct-CapTokenData"
-#define NID_setct_CapTokenData 538
-#define OBJ_setct_CapTokenData OBJ_set_ctype,20L
+#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS"
+#define NID_setct_AuthTokenTBS 537
+#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L
-#define SN_setct_CapTokenTBS "setct-CapTokenTBS"
-#define NID_setct_CapTokenTBS 539
-#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L
+#define SN_setct_CapTokenData "setct-CapTokenData"
+#define NID_setct_CapTokenData 538
+#define OBJ_setct_CapTokenData OBJ_set_ctype,20L
-#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg"
-#define NID_setct_AcqCardCodeMsg 540
-#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L
+#define SN_setct_CapTokenTBS "setct-CapTokenTBS"
+#define NID_setct_CapTokenTBS 539
+#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L
-#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS"
-#define NID_setct_AuthRevReqTBS 541
-#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L
+#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg"
+#define NID_setct_AcqCardCodeMsg 540
+#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L
-#define SN_setct_AuthRevResData "setct-AuthRevResData"
-#define NID_setct_AuthRevResData 542
-#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L
+#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS"
+#define NID_setct_AuthRevReqTBS 541
+#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L
-#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS"
-#define NID_setct_AuthRevResTBS 543
-#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L
+#define SN_setct_AuthRevResData "setct-AuthRevResData"
+#define NID_setct_AuthRevResData 542
+#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L
-#define SN_setct_CapReqTBS "setct-CapReqTBS"
-#define NID_setct_CapReqTBS 544
-#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L
+#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS"
+#define NID_setct_AuthRevResTBS 543
+#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L
-#define SN_setct_CapReqTBSX "setct-CapReqTBSX"
-#define NID_setct_CapReqTBSX 545
-#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L
+#define SN_setct_CapReqTBS "setct-CapReqTBS"
+#define NID_setct_CapReqTBS 544
+#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L
-#define SN_setct_CapResData "setct-CapResData"
-#define NID_setct_CapResData 546
-#define OBJ_setct_CapResData OBJ_set_ctype,28L
+#define SN_setct_CapReqTBSX "setct-CapReqTBSX"
+#define NID_setct_CapReqTBSX 545
+#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L
-#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS"
-#define NID_setct_CapRevReqTBS 547
-#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L
+#define SN_setct_CapResData "setct-CapResData"
+#define NID_setct_CapResData 546
+#define OBJ_setct_CapResData OBJ_set_ctype,28L
-#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX"
-#define NID_setct_CapRevReqTBSX 548
-#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L
+#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS"
+#define NID_setct_CapRevReqTBS 547
+#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L
-#define SN_setct_CapRevResData "setct-CapRevResData"
-#define NID_setct_CapRevResData 549
-#define OBJ_setct_CapRevResData OBJ_set_ctype,31L
+#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX"
+#define NID_setct_CapRevReqTBSX 548
+#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L
-#define SN_setct_CredReqTBS "setct-CredReqTBS"
-#define NID_setct_CredReqTBS 550
-#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L
+#define SN_setct_CapRevResData "setct-CapRevResData"
+#define NID_setct_CapRevResData 549
+#define OBJ_setct_CapRevResData OBJ_set_ctype,31L
-#define SN_setct_CredReqTBSX "setct-CredReqTBSX"
-#define NID_setct_CredReqTBSX 551
-#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L
+#define SN_setct_CredReqTBS "setct-CredReqTBS"
+#define NID_setct_CredReqTBS 550
+#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L
-#define SN_setct_CredResData "setct-CredResData"
-#define NID_setct_CredResData 552
-#define OBJ_setct_CredResData OBJ_set_ctype,34L
+#define SN_setct_CredReqTBSX "setct-CredReqTBSX"
+#define NID_setct_CredReqTBSX 551
+#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L
-#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS"
-#define NID_setct_CredRevReqTBS 553
-#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L
+#define SN_setct_CredResData "setct-CredResData"
+#define NID_setct_CredResData 552
+#define OBJ_setct_CredResData OBJ_set_ctype,34L
-#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX"
-#define NID_setct_CredRevReqTBSX 554
-#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L
+#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS"
+#define NID_setct_CredRevReqTBS 553
+#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L
-#define SN_setct_CredRevResData "setct-CredRevResData"
-#define NID_setct_CredRevResData 555
-#define OBJ_setct_CredRevResData OBJ_set_ctype,37L
+#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX"
+#define NID_setct_CredRevReqTBSX 554
+#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L
-#define SN_setct_PCertReqData "setct-PCertReqData"
-#define NID_setct_PCertReqData 556
-#define OBJ_setct_PCertReqData OBJ_set_ctype,38L
+#define SN_setct_CredRevResData "setct-CredRevResData"
+#define NID_setct_CredRevResData 555
+#define OBJ_setct_CredRevResData OBJ_set_ctype,37L
-#define SN_setct_PCertResTBS "setct-PCertResTBS"
-#define NID_setct_PCertResTBS 557
-#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L
+#define SN_setct_PCertReqData "setct-PCertReqData"
+#define NID_setct_PCertReqData 556
+#define OBJ_setct_PCertReqData OBJ_set_ctype,38L
-#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData"
-#define NID_setct_BatchAdminReqData 558
-#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L
+#define SN_setct_PCertResTBS "setct-PCertResTBS"
+#define NID_setct_PCertResTBS 557
+#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L
-#define SN_setct_BatchAdminResData "setct-BatchAdminResData"
-#define NID_setct_BatchAdminResData 559
-#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L
+#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData"
+#define NID_setct_BatchAdminReqData 558
+#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L
-#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS"
-#define NID_setct_CardCInitResTBS 560
-#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L
+#define SN_setct_BatchAdminResData "setct-BatchAdminResData"
+#define NID_setct_BatchAdminResData 559
+#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L
-#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS"
-#define NID_setct_MeAqCInitResTBS 561
-#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L
+#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS"
+#define NID_setct_CardCInitResTBS 560
+#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L
-#define SN_setct_RegFormResTBS "setct-RegFormResTBS"
-#define NID_setct_RegFormResTBS 562
-#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L
+#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS"
+#define NID_setct_MeAqCInitResTBS 561
+#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L
-#define SN_setct_CertReqData "setct-CertReqData"
-#define NID_setct_CertReqData 563
-#define OBJ_setct_CertReqData OBJ_set_ctype,45L
+#define SN_setct_RegFormResTBS "setct-RegFormResTBS"
+#define NID_setct_RegFormResTBS 562
+#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L
-#define SN_setct_CertReqTBS "setct-CertReqTBS"
-#define NID_setct_CertReqTBS 564
-#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L
+#define SN_setct_CertReqData "setct-CertReqData"
+#define NID_setct_CertReqData 563
+#define OBJ_setct_CertReqData OBJ_set_ctype,45L
-#define SN_setct_CertResData "setct-CertResData"
-#define NID_setct_CertResData 565
-#define OBJ_setct_CertResData OBJ_set_ctype,47L
+#define SN_setct_CertReqTBS "setct-CertReqTBS"
+#define NID_setct_CertReqTBS 564
+#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L
-#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS"
-#define NID_setct_CertInqReqTBS 566
-#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L
+#define SN_setct_CertResData "setct-CertResData"
+#define NID_setct_CertResData 565
+#define OBJ_setct_CertResData OBJ_set_ctype,47L
-#define SN_setct_ErrorTBS "setct-ErrorTBS"
-#define NID_setct_ErrorTBS 567
-#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L
+#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS"
+#define NID_setct_CertInqReqTBS 566
+#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L
-#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE"
-#define NID_setct_PIDualSignedTBE 568
-#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L
+#define SN_setct_ErrorTBS "setct-ErrorTBS"
+#define NID_setct_ErrorTBS 567
+#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L
-#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE"
-#define NID_setct_PIUnsignedTBE 569
-#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L
+#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE"
+#define NID_setct_PIDualSignedTBE 568
+#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L
-#define SN_setct_AuthReqTBE "setct-AuthReqTBE"
-#define NID_setct_AuthReqTBE 570
-#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L
+#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE"
+#define NID_setct_PIUnsignedTBE 569
+#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L
-#define SN_setct_AuthResTBE "setct-AuthResTBE"
-#define NID_setct_AuthResTBE 571
-#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L
+#define SN_setct_AuthReqTBE "setct-AuthReqTBE"
+#define NID_setct_AuthReqTBE 570
+#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L
-#define SN_setct_AuthResTBEX "setct-AuthResTBEX"
-#define NID_setct_AuthResTBEX 572
-#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L
+#define SN_setct_AuthResTBE "setct-AuthResTBE"
+#define NID_setct_AuthResTBE 571
+#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L
-#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE"
-#define NID_setct_AuthTokenTBE 573
-#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L
+#define SN_setct_AuthResTBEX "setct-AuthResTBEX"
+#define NID_setct_AuthResTBEX 572
+#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L
-#define SN_setct_CapTokenTBE "setct-CapTokenTBE"
-#define NID_setct_CapTokenTBE 574
-#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L
+#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE"
+#define NID_setct_AuthTokenTBE 573
+#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L
-#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX"
-#define NID_setct_CapTokenTBEX 575
-#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L
+#define SN_setct_CapTokenTBE "setct-CapTokenTBE"
+#define NID_setct_CapTokenTBE 574
+#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L
-#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE"
-#define NID_setct_AcqCardCodeMsgTBE 576
-#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L
+#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX"
+#define NID_setct_CapTokenTBEX 575
+#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L
-#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE"
-#define NID_setct_AuthRevReqTBE 577
-#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L
+#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE"
+#define NID_setct_AcqCardCodeMsgTBE 576
+#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L
-#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE"
-#define NID_setct_AuthRevResTBE 578
-#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L
+#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE"
+#define NID_setct_AuthRevReqTBE 577
+#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L
-#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB"
-#define NID_setct_AuthRevResTBEB 579
-#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L
+#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE"
+#define NID_setct_AuthRevResTBE 578
+#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L
-#define SN_setct_CapReqTBE "setct-CapReqTBE"
-#define NID_setct_CapReqTBE 580
-#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L
+#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB"
+#define NID_setct_AuthRevResTBEB 579
+#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L
-#define SN_setct_CapReqTBEX "setct-CapReqTBEX"
-#define NID_setct_CapReqTBEX 581
-#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L
+#define SN_setct_CapReqTBE "setct-CapReqTBE"
+#define NID_setct_CapReqTBE 580
+#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L
-#define SN_setct_CapResTBE "setct-CapResTBE"
-#define NID_setct_CapResTBE 582
-#define OBJ_setct_CapResTBE OBJ_set_ctype,64L
+#define SN_setct_CapReqTBEX "setct-CapReqTBEX"
+#define NID_setct_CapReqTBEX 581
+#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L
-#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE"
-#define NID_setct_CapRevReqTBE 583
-#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L
+#define SN_setct_CapResTBE "setct-CapResTBE"
+#define NID_setct_CapResTBE 582
+#define OBJ_setct_CapResTBE OBJ_set_ctype,64L
-#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX"
-#define NID_setct_CapRevReqTBEX 584
-#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L
+#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE"
+#define NID_setct_CapRevReqTBE 583
+#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L
-#define SN_setct_CapRevResTBE "setct-CapRevResTBE"
-#define NID_setct_CapRevResTBE 585
-#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L
+#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX"
+#define NID_setct_CapRevReqTBEX 584
+#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L
-#define SN_setct_CredReqTBE "setct-CredReqTBE"
-#define NID_setct_CredReqTBE 586
-#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L
+#define SN_setct_CapRevResTBE "setct-CapRevResTBE"
+#define NID_setct_CapRevResTBE 585
+#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L
-#define SN_setct_CredReqTBEX "setct-CredReqTBEX"
-#define NID_setct_CredReqTBEX 587
-#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L
+#define SN_setct_CredReqTBE "setct-CredReqTBE"
+#define NID_setct_CredReqTBE 586
+#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L
-#define SN_setct_CredResTBE "setct-CredResTBE"
-#define NID_setct_CredResTBE 588
-#define OBJ_setct_CredResTBE OBJ_set_ctype,70L
+#define SN_setct_CredReqTBEX "setct-CredReqTBEX"
+#define NID_setct_CredReqTBEX 587
+#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L
-#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE"
-#define NID_setct_CredRevReqTBE 589
-#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L
+#define SN_setct_CredResTBE "setct-CredResTBE"
+#define NID_setct_CredResTBE 588
+#define OBJ_setct_CredResTBE OBJ_set_ctype,70L
-#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX"
-#define NID_setct_CredRevReqTBEX 590
-#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L
+#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE"
+#define NID_setct_CredRevReqTBE 589
+#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L
-#define SN_setct_CredRevResTBE "setct-CredRevResTBE"
-#define NID_setct_CredRevResTBE 591
-#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L
+#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX"
+#define NID_setct_CredRevReqTBEX 590
+#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L
-#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE"
-#define NID_setct_BatchAdminReqTBE 592
-#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L
+#define SN_setct_CredRevResTBE "setct-CredRevResTBE"
+#define NID_setct_CredRevResTBE 591
+#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L
-#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE"
-#define NID_setct_BatchAdminResTBE 593
-#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L
+#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE"
+#define NID_setct_BatchAdminReqTBE 592
+#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L
-#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE"
-#define NID_setct_RegFormReqTBE 594
-#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L
+#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE"
+#define NID_setct_BatchAdminResTBE 593
+#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L
-#define SN_setct_CertReqTBE "setct-CertReqTBE"
-#define NID_setct_CertReqTBE 595
-#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L
+#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE"
+#define NID_setct_RegFormReqTBE 594
+#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L
-#define SN_setct_CertReqTBEX "setct-CertReqTBEX"
-#define NID_setct_CertReqTBEX 596
-#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L
+#define SN_setct_CertReqTBE "setct-CertReqTBE"
+#define NID_setct_CertReqTBE 595
+#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L
-#define SN_setct_CertResTBE "setct-CertResTBE"
-#define NID_setct_CertResTBE 597
-#define OBJ_setct_CertResTBE OBJ_set_ctype,79L
+#define SN_setct_CertReqTBEX "setct-CertReqTBEX"
+#define NID_setct_CertReqTBEX 596
+#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L
-#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS"
-#define NID_setct_CRLNotificationTBS 598
-#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L
+#define SN_setct_CertResTBE "setct-CertResTBE"
+#define NID_setct_CertResTBE 597
+#define OBJ_setct_CertResTBE OBJ_set_ctype,79L
-#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS"
-#define NID_setct_CRLNotificationResTBS 599
-#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L
-
-#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS"
-#define NID_setct_BCIDistributionTBS 600
-#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L
-
-#define SN_setext_genCrypt "setext-genCrypt"
-#define LN_setext_genCrypt "generic cryptogram"
-#define NID_setext_genCrypt 601
-#define OBJ_setext_genCrypt OBJ_set_msgExt,1L
-
-#define SN_setext_miAuth "setext-miAuth"
-#define LN_setext_miAuth "merchant initiated auth"
-#define NID_setext_miAuth 602
-#define OBJ_setext_miAuth OBJ_set_msgExt,3L
-
-#define SN_setext_pinSecure "setext-pinSecure"
-#define NID_setext_pinSecure 603
-#define OBJ_setext_pinSecure OBJ_set_msgExt,4L
-
-#define SN_setext_pinAny "setext-pinAny"
-#define NID_setext_pinAny 604
-#define OBJ_setext_pinAny OBJ_set_msgExt,5L
-
-#define SN_setext_track2 "setext-track2"
-#define NID_setext_track2 605
-#define OBJ_setext_track2 OBJ_set_msgExt,7L
-
-#define SN_setext_cv "setext-cv"
-#define LN_setext_cv "additional verification"
-#define NID_setext_cv 606
-#define OBJ_setext_cv OBJ_set_msgExt,8L
-
-#define SN_set_policy_root "set-policy-root"
-#define NID_set_policy_root 607
-#define OBJ_set_policy_root OBJ_set_policy,0L
-
-#define SN_setCext_hashedRoot "setCext-hashedRoot"
-#define NID_setCext_hashedRoot 608
-#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L
-
-#define SN_setCext_certType "setCext-certType"
-#define NID_setCext_certType 609
-#define OBJ_setCext_certType OBJ_set_certExt,1L
-
-#define SN_setCext_merchData "setCext-merchData"
-#define NID_setCext_merchData 610
-#define OBJ_setCext_merchData OBJ_set_certExt,2L
-
-#define SN_setCext_cCertRequired "setCext-cCertRequired"
-#define NID_setCext_cCertRequired 611
-#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L
-
-#define SN_setCext_tunneling "setCext-tunneling"
-#define NID_setCext_tunneling 612
-#define OBJ_setCext_tunneling OBJ_set_certExt,4L
-
-#define SN_setCext_setExt "setCext-setExt"
-#define NID_setCext_setExt 613
-#define OBJ_setCext_setExt OBJ_set_certExt,5L
-
-#define SN_setCext_setQualf "setCext-setQualf"
-#define NID_setCext_setQualf 614
-#define OBJ_setCext_setQualf OBJ_set_certExt,6L
-
-#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities"
-#define NID_setCext_PGWYcapabilities 615
-#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L
-
-#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier"
-#define NID_setCext_TokenIdentifier 616
-#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L
-
-#define SN_setCext_Track2Data "setCext-Track2Data"
-#define NID_setCext_Track2Data 617
-#define OBJ_setCext_Track2Data OBJ_set_certExt,9L
-
-#define SN_setCext_TokenType "setCext-TokenType"
-#define NID_setCext_TokenType 618
-#define OBJ_setCext_TokenType OBJ_set_certExt,10L
-
-#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities"
-#define NID_setCext_IssuerCapabilities 619
-#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L
-
-#define SN_setAttr_Cert "setAttr-Cert"
-#define NID_setAttr_Cert 620
-#define OBJ_setAttr_Cert OBJ_set_attr,0L
-
-#define SN_setAttr_PGWYcap "setAttr-PGWYcap"
-#define LN_setAttr_PGWYcap "payment gateway capabilities"
-#define NID_setAttr_PGWYcap 621
-#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L
-
-#define SN_setAttr_TokenType "setAttr-TokenType"
-#define NID_setAttr_TokenType 622
-#define OBJ_setAttr_TokenType OBJ_set_attr,2L
-
-#define SN_setAttr_IssCap "setAttr-IssCap"
-#define LN_setAttr_IssCap "issuer capabilities"
-#define NID_setAttr_IssCap 623
-#define OBJ_setAttr_IssCap OBJ_set_attr,3L
-
-#define SN_set_rootKeyThumb "set-rootKeyThumb"
-#define NID_set_rootKeyThumb 624
-#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L
-
-#define SN_set_addPolicy "set-addPolicy"
-#define NID_set_addPolicy 625
-#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L
-
-#define SN_setAttr_Token_EMV "setAttr-Token-EMV"
-#define NID_setAttr_Token_EMV 626
-#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L
-
-#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime"
-#define NID_setAttr_Token_B0Prime 627
-#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L
-
-#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM"
-#define NID_setAttr_IssCap_CVM 628
-#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L
-
-#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2"
-#define NID_setAttr_IssCap_T2 629
-#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L
-
-#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig"
-#define NID_setAttr_IssCap_Sig 630
-#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L
-
-#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm"
-#define LN_setAttr_GenCryptgrm "generate cryptogram"
-#define NID_setAttr_GenCryptgrm 631
-#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L
-
-#define SN_setAttr_T2Enc "setAttr-T2Enc"
-#define LN_setAttr_T2Enc "encrypted track 2"
-#define NID_setAttr_T2Enc 632
-#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L
-
-#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt"
-#define LN_setAttr_T2cleartxt "cleartext track 2"
-#define NID_setAttr_T2cleartxt 633
-#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L
-
-#define SN_setAttr_TokICCsig "setAttr-TokICCsig"
-#define LN_setAttr_TokICCsig "ICC or token signature"
-#define NID_setAttr_TokICCsig 634
-#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L
-
-#define SN_setAttr_SecDevSig "setAttr-SecDevSig"
-#define LN_setAttr_SecDevSig "secure device signature"
-#define NID_setAttr_SecDevSig 635
-#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L
-
-#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA"
-#define NID_set_brand_IATA_ATA 636
-#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L
-
-#define SN_set_brand_Diners "set-brand-Diners"
-#define NID_set_brand_Diners 637
-#define OBJ_set_brand_Diners OBJ_set_brand,30L
-
-#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress"
-#define NID_set_brand_AmericanExpress 638
-#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L
-
-#define SN_set_brand_JCB "set-brand-JCB"
-#define NID_set_brand_JCB 639
-#define OBJ_set_brand_JCB OBJ_set_brand,35L
-
-#define SN_set_brand_Visa "set-brand-Visa"
-#define NID_set_brand_Visa 640
-#define OBJ_set_brand_Visa OBJ_set_brand,4L
-
-#define SN_set_brand_MasterCard "set-brand-MasterCard"
-#define NID_set_brand_MasterCard 641
-#define OBJ_set_brand_MasterCard OBJ_set_brand,5L
-
-#define SN_set_brand_Novus "set-brand-Novus"
-#define NID_set_brand_Novus 642
-#define OBJ_set_brand_Novus OBJ_set_brand,6011L
-
-#define SN_des_cdmf "DES-CDMF"
-#define LN_des_cdmf "des-cdmf"
-#define NID_des_cdmf 643
-#define OBJ_des_cdmf OBJ_rsadsi,3L,10L
-
-#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET"
-#define NID_rsaOAEPEncryptionSET 644
-#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L
-
-#define SN_ipsec3 "Oakley-EC2N-3"
-#define LN_ipsec3 "ipsec3"
-#define NID_ipsec3 749
-
-#define SN_ipsec4 "Oakley-EC2N-4"
-#define LN_ipsec4 "ipsec4"
-#define NID_ipsec4 750
-
-#define SN_camellia_128_cbc "CAMELLIA-128-CBC"
-#define LN_camellia_128_cbc "camellia-128-cbc"
-#define NID_camellia_128_cbc 751
-#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L
-
-#define SN_camellia_192_cbc "CAMELLIA-192-CBC"
-#define LN_camellia_192_cbc "camellia-192-cbc"
-#define NID_camellia_192_cbc 752
-#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L
-
-#define SN_camellia_256_cbc "CAMELLIA-256-CBC"
-#define LN_camellia_256_cbc "camellia-256-cbc"
-#define NID_camellia_256_cbc 753
-#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L
-
-#define OBJ_ntt_ds 0L,3L,4401L,5L
-
-#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L
-
-#define SN_camellia_128_ecb "CAMELLIA-128-ECB"
-#define LN_camellia_128_ecb "camellia-128-ecb"
-#define NID_camellia_128_ecb 754
-#define OBJ_camellia_128_ecb OBJ_camellia,1L
-
-#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB"
-#define LN_camellia_128_ofb128 "camellia-128-ofb"
-#define NID_camellia_128_ofb128 766
-#define OBJ_camellia_128_ofb128 OBJ_camellia,3L
-
-#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB"
-#define LN_camellia_128_cfb128 "camellia-128-cfb"
-#define NID_camellia_128_cfb128 757
-#define OBJ_camellia_128_cfb128 OBJ_camellia,4L
-
-#define SN_camellia_192_ecb "CAMELLIA-192-ECB"
-#define LN_camellia_192_ecb "camellia-192-ecb"
-#define NID_camellia_192_ecb 755
-#define OBJ_camellia_192_ecb OBJ_camellia,21L
-
-#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB"
-#define LN_camellia_192_ofb128 "camellia-192-ofb"
-#define NID_camellia_192_ofb128 767
-#define OBJ_camellia_192_ofb128 OBJ_camellia,23L
-
-#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB"
-#define LN_camellia_192_cfb128 "camellia-192-cfb"
-#define NID_camellia_192_cfb128 758
-#define OBJ_camellia_192_cfb128 OBJ_camellia,24L
-
-#define SN_camellia_256_ecb "CAMELLIA-256-ECB"
-#define LN_camellia_256_ecb "camellia-256-ecb"
-#define NID_camellia_256_ecb 756
-#define OBJ_camellia_256_ecb OBJ_camellia,41L
-
-#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB"
-#define LN_camellia_256_ofb128 "camellia-256-ofb"
-#define NID_camellia_256_ofb128 768
-#define OBJ_camellia_256_ofb128 OBJ_camellia,43L
-
-#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB"
-#define LN_camellia_256_cfb128 "camellia-256-cfb"
-#define NID_camellia_256_cfb128 759
-#define OBJ_camellia_256_cfb128 OBJ_camellia,44L
-
-#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1"
-#define LN_camellia_128_cfb1 "camellia-128-cfb1"
-#define NID_camellia_128_cfb1 760
-
-#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1"
-#define LN_camellia_192_cfb1 "camellia-192-cfb1"
-#define NID_camellia_192_cfb1 761
-
-#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1"
-#define LN_camellia_256_cfb1 "camellia-256-cfb1"
-#define NID_camellia_256_cfb1 762
-
-#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8"
-#define LN_camellia_128_cfb8 "camellia-128-cfb8"
-#define NID_camellia_128_cfb8 763
-
-#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8"
-#define LN_camellia_192_cfb8 "camellia-192-cfb8"
-#define NID_camellia_192_cfb8 764
-
-#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8"
-#define LN_camellia_256_cfb8 "camellia-256-cfb8"
-#define NID_camellia_256_cfb8 765
+#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS"
+#define NID_setct_CRLNotificationTBS 598
+#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L
+#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS"
+#define NID_setct_CRLNotificationResTBS 599
+#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L
+
+#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS"
+#define NID_setct_BCIDistributionTBS 600
+#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L
+
+#define SN_setext_genCrypt "setext-genCrypt"
+#define LN_setext_genCrypt "generic cryptogram"
+#define NID_setext_genCrypt 601
+#define OBJ_setext_genCrypt OBJ_set_msgExt,1L
+
+#define SN_setext_miAuth "setext-miAuth"
+#define LN_setext_miAuth "merchant initiated auth"
+#define NID_setext_miAuth 602
+#define OBJ_setext_miAuth OBJ_set_msgExt,3L
+
+#define SN_setext_pinSecure "setext-pinSecure"
+#define NID_setext_pinSecure 603
+#define OBJ_setext_pinSecure OBJ_set_msgExt,4L
+
+#define SN_setext_pinAny "setext-pinAny"
+#define NID_setext_pinAny 604
+#define OBJ_setext_pinAny OBJ_set_msgExt,5L
+
+#define SN_setext_track2 "setext-track2"
+#define NID_setext_track2 605
+#define OBJ_setext_track2 OBJ_set_msgExt,7L
+
+#define SN_setext_cv "setext-cv"
+#define LN_setext_cv "additional verification"
+#define NID_setext_cv 606
+#define OBJ_setext_cv OBJ_set_msgExt,8L
+
+#define SN_set_policy_root "set-policy-root"
+#define NID_set_policy_root 607
+#define OBJ_set_policy_root OBJ_set_policy,0L
+
+#define SN_setCext_hashedRoot "setCext-hashedRoot"
+#define NID_setCext_hashedRoot 608
+#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L
+
+#define SN_setCext_certType "setCext-certType"
+#define NID_setCext_certType 609
+#define OBJ_setCext_certType OBJ_set_certExt,1L
+
+#define SN_setCext_merchData "setCext-merchData"
+#define NID_setCext_merchData 610
+#define OBJ_setCext_merchData OBJ_set_certExt,2L
+
+#define SN_setCext_cCertRequired "setCext-cCertRequired"
+#define NID_setCext_cCertRequired 611
+#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L
+
+#define SN_setCext_tunneling "setCext-tunneling"
+#define NID_setCext_tunneling 612
+#define OBJ_setCext_tunneling OBJ_set_certExt,4L
+
+#define SN_setCext_setExt "setCext-setExt"
+#define NID_setCext_setExt 613
+#define OBJ_setCext_setExt OBJ_set_certExt,5L
+
+#define SN_setCext_setQualf "setCext-setQualf"
+#define NID_setCext_setQualf 614
+#define OBJ_setCext_setQualf OBJ_set_certExt,6L
+
+#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities"
+#define NID_setCext_PGWYcapabilities 615
+#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L
+
+#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier"
+#define NID_setCext_TokenIdentifier 616
+#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L
+
+#define SN_setCext_Track2Data "setCext-Track2Data"
+#define NID_setCext_Track2Data 617
+#define OBJ_setCext_Track2Data OBJ_set_certExt,9L
+
+#define SN_setCext_TokenType "setCext-TokenType"
+#define NID_setCext_TokenType 618
+#define OBJ_setCext_TokenType OBJ_set_certExt,10L
+
+#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities"
+#define NID_setCext_IssuerCapabilities 619
+#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L
+
+#define SN_setAttr_Cert "setAttr-Cert"
+#define NID_setAttr_Cert 620
+#define OBJ_setAttr_Cert OBJ_set_attr,0L
+
+#define SN_setAttr_PGWYcap "setAttr-PGWYcap"
+#define LN_setAttr_PGWYcap "payment gateway capabilities"
+#define NID_setAttr_PGWYcap 621
+#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L
+
+#define SN_setAttr_TokenType "setAttr-TokenType"
+#define NID_setAttr_TokenType 622
+#define OBJ_setAttr_TokenType OBJ_set_attr,2L
+
+#define SN_setAttr_IssCap "setAttr-IssCap"
+#define LN_setAttr_IssCap "issuer capabilities"
+#define NID_setAttr_IssCap 623
+#define OBJ_setAttr_IssCap OBJ_set_attr,3L
+
+#define SN_set_rootKeyThumb "set-rootKeyThumb"
+#define NID_set_rootKeyThumb 624
+#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L
+
+#define SN_set_addPolicy "set-addPolicy"
+#define NID_set_addPolicy 625
+#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L
+
+#define SN_setAttr_Token_EMV "setAttr-Token-EMV"
+#define NID_setAttr_Token_EMV 626
+#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L
+
+#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime"
+#define NID_setAttr_Token_B0Prime 627
+#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L
+
+#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM"
+#define NID_setAttr_IssCap_CVM 628
+#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L
+
+#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2"
+#define NID_setAttr_IssCap_T2 629
+#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L
+
+#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig"
+#define NID_setAttr_IssCap_Sig 630
+#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L
+
+#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm"
+#define LN_setAttr_GenCryptgrm "generate cryptogram"
+#define NID_setAttr_GenCryptgrm 631
+#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L
+
+#define SN_setAttr_T2Enc "setAttr-T2Enc"
+#define LN_setAttr_T2Enc "encrypted track 2"
+#define NID_setAttr_T2Enc 632
+#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L
+
+#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt"
+#define LN_setAttr_T2cleartxt "cleartext track 2"
+#define NID_setAttr_T2cleartxt 633
+#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L
+
+#define SN_setAttr_TokICCsig "setAttr-TokICCsig"
+#define LN_setAttr_TokICCsig "ICC or token signature"
+#define NID_setAttr_TokICCsig 634
+#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L
+
+#define SN_setAttr_SecDevSig "setAttr-SecDevSig"
+#define LN_setAttr_SecDevSig "secure device signature"
+#define NID_setAttr_SecDevSig 635
+#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L
+
+#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA"
+#define NID_set_brand_IATA_ATA 636
+#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L
+
+#define SN_set_brand_Diners "set-brand-Diners"
+#define NID_set_brand_Diners 637
+#define OBJ_set_brand_Diners OBJ_set_brand,30L
+
+#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress"
+#define NID_set_brand_AmericanExpress 638
+#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L
+
+#define SN_set_brand_JCB "set-brand-JCB"
+#define NID_set_brand_JCB 639
+#define OBJ_set_brand_JCB OBJ_set_brand,35L
+
+#define SN_set_brand_Visa "set-brand-Visa"
+#define NID_set_brand_Visa 640
+#define OBJ_set_brand_Visa OBJ_set_brand,4L
+
+#define SN_set_brand_MasterCard "set-brand-MasterCard"
+#define NID_set_brand_MasterCard 641
+#define OBJ_set_brand_MasterCard OBJ_set_brand,5L
+
+#define SN_set_brand_Novus "set-brand-Novus"
+#define NID_set_brand_Novus 642
+#define OBJ_set_brand_Novus OBJ_set_brand,6011L
+
+#define SN_des_cdmf "DES-CDMF"
+#define LN_des_cdmf "des-cdmf"
+#define NID_des_cdmf 643
+#define OBJ_des_cdmf OBJ_rsadsi,3L,10L
+
+#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET"
+#define NID_rsaOAEPEncryptionSET 644
+#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L
+
+#define SN_ipsec3 "Oakley-EC2N-3"
+#define LN_ipsec3 "ipsec3"
+#define NID_ipsec3 749
+
+#define SN_ipsec4 "Oakley-EC2N-4"
+#define LN_ipsec4 "ipsec4"
+#define NID_ipsec4 750
+
+#define SN_whirlpool "whirlpool"
+#define NID_whirlpool 804
+#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L
+
+#define SN_cryptopro "cryptopro"
+#define NID_cryptopro 805
+#define OBJ_cryptopro OBJ_member_body,643L,2L,2L
+
+#define SN_cryptocom "cryptocom"
+#define NID_cryptocom 806
+#define OBJ_cryptocom OBJ_member_body,643L,2L,9L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001"
+#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001"
+#define NID_id_GostR3411_94_with_GostR3410_2001 807
+#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94"
+#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94"
+#define NID_id_GostR3411_94_with_GostR3410_94 808
+#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L
+
+#define SN_id_GostR3411_94 "md_gost94"
+#define LN_id_GostR3411_94 "GOST R 34.11-94"
+#define NID_id_GostR3411_94 809
+#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L
+
+#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94"
+#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94"
+#define NID_id_HMACGostR3411_94 810
+#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L
+
+#define SN_id_GostR3410_2001 "gost2001"
+#define LN_id_GostR3410_2001 "GOST R 34.10-2001"
+#define NID_id_GostR3410_2001 811
+#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L
+
+#define SN_id_GostR3410_94 "gost94"
+#define LN_id_GostR3410_94 "GOST R 34.10-94"
+#define NID_id_GostR3410_94 812
+#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L
+
+#define SN_id_Gost28147_89 "gost89"
+#define LN_id_Gost28147_89 "GOST 28147-89"
+#define NID_id_Gost28147_89 813
+#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L
+
+#define SN_gost89_cnt "gost89-cnt"
+#define NID_gost89_cnt 814
+
+#define SN_id_Gost28147_89_MAC "gost-mac"
+#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC"
+#define NID_id_Gost28147_89_MAC 815
+#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L
+
+#define SN_id_GostR3411_94_prf "prf-gostr3411-94"
+#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF"
+#define NID_id_GostR3411_94_prf 816
+#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L
+
+#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH"
+#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH"
+#define NID_id_GostR3410_2001DH 817
+#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L
+
+#define SN_id_GostR3410_94DH "id-GostR3410-94DH"
+#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH"
+#define NID_id_GostR3410_94DH 818
+#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L
+
+#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing"
+#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819
+#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L
+
+#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing"
+#define NID_id_Gost28147_89_None_KeyMeshing 820
+#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L
+
+#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet"
+#define NID_id_GostR3411_94_TestParamSet 821
+#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L
+
+#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet"
+#define NID_id_GostR3411_94_CryptoProParamSet 822
+#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L
+
+#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet"
+#define NID_id_Gost28147_89_TestParamSet 823
+#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L
+
+#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824
+#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L
+
+#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825
+#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L
+
+#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826
+#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L
+
+#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827
+#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L
+
+#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830
+#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L
+
+#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet"
+#define NID_id_GostR3410_94_TestParamSet 831
+#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L
+
+#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832
+#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833
+#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L
+
+#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834
+#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L
+
+#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835
+#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L
+
+#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836
+#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L
+
+#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837
+#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838
+#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L
+
+#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet"
+#define NID_id_GostR3410_2001_TestParamSet 839
+#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840
+#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L
+
+#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841
+#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L
+
+#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842
+#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843
+#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844
+#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L
+
+#define SN_id_GostR3410_94_a "id-GostR3410-94-a"
+#define NID_id_GostR3410_94_a 845
+#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L
+
+#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis"
+#define NID_id_GostR3410_94_aBis 846
+#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L
+
+#define SN_id_GostR3410_94_b "id-GostR3410-94-b"
+#define NID_id_GostR3410_94_b 847
+#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L
+
+#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis"
+#define NID_id_GostR3410_94_bBis 848
+#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L
+
+#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc"
+#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet"
+#define NID_id_Gost28147_89_cc 849
+#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L
+
+#define SN_id_GostR3410_94_cc "gost94cc"
+#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom"
+#define NID_id_GostR3410_94_cc 850
+#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L
+
+#define SN_id_GostR3410_2001_cc "gost2001cc"
+#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom"
+#define NID_id_GostR3410_2001_cc 851
+#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L
+
+#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc"
+#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_94_cc 852
+#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc"
+#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853
+#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L
+
+#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc"
+#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom"
+#define NID_id_GostR3410_2001_ParamSet_cc 854
+#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L
+
+#define SN_camellia_128_cbc "CAMELLIA-128-CBC"
+#define LN_camellia_128_cbc "camellia-128-cbc"
+#define NID_camellia_128_cbc 751
+#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L
+
+#define SN_camellia_192_cbc "CAMELLIA-192-CBC"
+#define LN_camellia_192_cbc "camellia-192-cbc"
+#define NID_camellia_192_cbc 752
+#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L
+
+#define SN_camellia_256_cbc "CAMELLIA-256-CBC"
+#define LN_camellia_256_cbc "camellia-256-cbc"
+#define NID_camellia_256_cbc 753
+#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L
+
+#define OBJ_ntt_ds 0L,3L,4401L,5L
+
+#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L
+
+#define SN_camellia_128_ecb "CAMELLIA-128-ECB"
+#define LN_camellia_128_ecb "camellia-128-ecb"
+#define NID_camellia_128_ecb 754
+#define OBJ_camellia_128_ecb OBJ_camellia,1L
+
+#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB"
+#define LN_camellia_128_ofb128 "camellia-128-ofb"
+#define NID_camellia_128_ofb128 766
+#define OBJ_camellia_128_ofb128 OBJ_camellia,3L
+
+#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB"
+#define LN_camellia_128_cfb128 "camellia-128-cfb"
+#define NID_camellia_128_cfb128 757
+#define OBJ_camellia_128_cfb128 OBJ_camellia,4L
+
+#define SN_camellia_192_ecb "CAMELLIA-192-ECB"
+#define LN_camellia_192_ecb "camellia-192-ecb"
+#define NID_camellia_192_ecb 755
+#define OBJ_camellia_192_ecb OBJ_camellia,21L
+
+#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB"
+#define LN_camellia_192_ofb128 "camellia-192-ofb"
+#define NID_camellia_192_ofb128 767
+#define OBJ_camellia_192_ofb128 OBJ_camellia,23L
+
+#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB"
+#define LN_camellia_192_cfb128 "camellia-192-cfb"
+#define NID_camellia_192_cfb128 758
+#define OBJ_camellia_192_cfb128 OBJ_camellia,24L
+
+#define SN_camellia_256_ecb "CAMELLIA-256-ECB"
+#define LN_camellia_256_ecb "camellia-256-ecb"
+#define NID_camellia_256_ecb 756
+#define OBJ_camellia_256_ecb OBJ_camellia,41L
+
+#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB"
+#define LN_camellia_256_ofb128 "camellia-256-ofb"
+#define NID_camellia_256_ofb128 768
+#define OBJ_camellia_256_ofb128 OBJ_camellia,43L
+
+#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB"
+#define LN_camellia_256_cfb128 "camellia-256-cfb"
+#define NID_camellia_256_cfb128 759
+#define OBJ_camellia_256_cfb128 OBJ_camellia,44L
+
+#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1"
+#define LN_camellia_128_cfb1 "camellia-128-cfb1"
+#define NID_camellia_128_cfb1 760
+
+#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1"
+#define LN_camellia_192_cfb1 "camellia-192-cfb1"
+#define NID_camellia_192_cfb1 761
+
+#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1"
+#define LN_camellia_256_cfb1 "camellia-256-cfb1"
+#define NID_camellia_256_cfb1 762
+
+#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8"
+#define LN_camellia_128_cfb8 "camellia-128-cfb8"
+#define NID_camellia_128_cfb8 763
+
+#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8"
+#define LN_camellia_192_cfb8 "camellia-192-cfb8"
+#define NID_camellia_192_cfb8 764
+
+#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8"
+#define LN_camellia_256_cfb8 "camellia-256-cfb8"
+#define NID_camellia_256_cfb8 765
+
+#define SN_kisa "KISA"
+#define LN_kisa "kisa"
+#define NID_kisa 773
+#define OBJ_kisa OBJ_member_body,410L,200004L
+
+#define SN_seed_ecb "SEED-ECB"
+#define LN_seed_ecb "seed-ecb"
+#define NID_seed_ecb 776
+#define OBJ_seed_ecb OBJ_kisa,1L,3L
+
+#define SN_seed_cbc "SEED-CBC"
+#define LN_seed_cbc "seed-cbc"
+#define NID_seed_cbc 777
+#define OBJ_seed_cbc OBJ_kisa,1L,4L
+
+#define SN_seed_cfb128 "SEED-CFB"
+#define LN_seed_cfb128 "seed-cfb"
+#define NID_seed_cfb128 779
+#define OBJ_seed_cfb128 OBJ_kisa,1L,5L
+
+#define SN_seed_ofb128 "SEED-OFB"
+#define LN_seed_ofb128 "seed-ofb"
+#define NID_seed_ofb128 778
+#define OBJ_seed_ofb128 OBJ_kisa,1L,6L
+
+#define SN_hmac "HMAC"
+#define LN_hmac "hmac"
+#define NID_hmac 855
diff --git a/dep/include/openssl/ocsp.h b/dep/include/openssl/ocsp.h
index 1cbaa64b274..a0577a717ef 100644
--- a/dep/include/openssl/ocsp.h
+++ b/dep/include/openssl/ocsp.h
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -74,20 +74,20 @@ extern "C" {
/* Various flags and values */
-#define OCSP_DEFAULT_NONCE_LENGTH 16
-
-#define OCSP_NOCERTS 0x1
-#define OCSP_NOINTERN 0x2
-#define OCSP_NOSIGS 0x4
-#define OCSP_NOCHAIN 0x8
-#define OCSP_NOVERIFY 0x10
-#define OCSP_NOEXPLICIT 0x20
-#define OCSP_NOCASIGN 0x40
-#define OCSP_NODELEGATED 0x80
-#define OCSP_NOCHECKS 0x100
-#define OCSP_TRUSTOTHER 0x200
-#define OCSP_RESPID_KEY 0x400
-#define OCSP_NOTIME 0x800
+#define OCSP_DEFAULT_NONCE_LENGTH 16
+
+#define OCSP_NOCERTS 0x1
+#define OCSP_NOINTERN 0x2
+#define OCSP_NOSIGS 0x4
+#define OCSP_NOCHAIN 0x8
+#define OCSP_NOVERIFY 0x10
+#define OCSP_NOEXPLICIT 0x20
+#define OCSP_NOCASIGN 0x40
+#define OCSP_NODELEGATED 0x80
+#define OCSP_NOCHECKS 0x100
+#define OCSP_TRUSTOTHER 0x200
+#define OCSP_RESPID_KEY 0x400
+#define OCSP_NOTIME 0x800
/* CertID ::= SEQUENCE {
* hashAlgorithm AlgorithmIdentifier,
@@ -96,12 +96,12 @@ extern "C" {
* serialNumber CertificateSerialNumber }
*/
typedef struct ocsp_cert_id_st
- {
- X509_ALGOR *hashAlgorithm;
- ASN1_OCTET_STRING *issuerNameHash;
- ASN1_OCTET_STRING *issuerKeyHash;
- ASN1_INTEGER *serialNumber;
- } OCSP_CERTID;
+ {
+ X509_ALGOR *hashAlgorithm;
+ ASN1_OCTET_STRING *issuerNameHash;
+ ASN1_OCTET_STRING *issuerKeyHash;
+ ASN1_INTEGER *serialNumber;
+ } OCSP_CERTID;
DECLARE_STACK_OF(OCSP_CERTID)
@@ -110,10 +110,10 @@ DECLARE_STACK_OF(OCSP_CERTID)
* singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
*/
typedef struct ocsp_one_request_st
- {
- OCSP_CERTID *reqCert;
- STACK_OF(X509_EXTENSION) *singleRequestExtensions;
- } OCSP_ONEREQ;
+ {
+ OCSP_CERTID *reqCert;
+ STACK_OF(X509_EXTENSION) *singleRequestExtensions;
+ } OCSP_ONEREQ;
DECLARE_STACK_OF(OCSP_ONEREQ)
DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
@@ -126,12 +126,12 @@ DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
* requestExtensions [2] EXPLICIT Extensions OPTIONAL }
*/
typedef struct ocsp_req_info_st
- {
- ASN1_INTEGER *version;
- GENERAL_NAME *requestorName;
- STACK_OF(OCSP_ONEREQ) *requestList;
- STACK_OF(X509_EXTENSION) *requestExtensions;
- } OCSP_REQINFO;
+ {
+ ASN1_INTEGER *version;
+ GENERAL_NAME *requestorName;
+ STACK_OF(OCSP_ONEREQ) *requestList;
+ STACK_OF(X509_EXTENSION) *requestExtensions;
+ } OCSP_REQINFO;
/* Signature ::= SEQUENCE {
* signatureAlgorithm AlgorithmIdentifier,
@@ -139,21 +139,21 @@ typedef struct ocsp_req_info_st
* certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
*/
typedef struct ocsp_signature_st
- {
- X509_ALGOR *signatureAlgorithm;
- ASN1_BIT_STRING *signature;
- STACK_OF(X509) *certs;
- } OCSP_SIGNATURE;
+ {
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+ } OCSP_SIGNATURE;
/* OCSPRequest ::= SEQUENCE {
* tbsRequest TBSRequest,
* optionalSignature [0] EXPLICIT Signature OPTIONAL }
*/
typedef struct ocsp_request_st
- {
- OCSP_REQINFO *tbsRequest;
- OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
- } OCSP_REQUEST;
+ {
+ OCSP_REQINFO *tbsRequest;
+ OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
+ } OCSP_REQUEST;
/* OCSPResponseStatus ::= ENUMERATED {
* successful (0), --Response has valid confirmations
@@ -177,20 +177,20 @@ typedef struct ocsp_request_st
* response OCTET STRING }
*/
typedef struct ocsp_resp_bytes_st
- {
- ASN1_OBJECT *responseType;
- ASN1_OCTET_STRING *response;
- } OCSP_RESPBYTES;
+ {
+ ASN1_OBJECT *responseType;
+ ASN1_OCTET_STRING *response;
+ } OCSP_RESPBYTES;
/* OCSPResponse ::= SEQUENCE {
* responseStatus OCSPResponseStatus,
* responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
*/
-typedef struct ocsp_response_st
- {
- ASN1_ENUMERATED *responseStatus;
- OCSP_RESPBYTES *responseBytes;
- } OCSP_RESPONSE;
+struct ocsp_response_st
+ {
+ ASN1_ENUMERATED *responseStatus;
+ OCSP_RESPBYTES *responseBytes;
+ };
/* ResponderID ::= CHOICE {
* byName [1] Name,
@@ -198,14 +198,18 @@ typedef struct ocsp_response_st
*/
#define V_OCSP_RESPID_NAME 0
#define V_OCSP_RESPID_KEY 1
-typedef struct ocsp_responder_id_st
- {
- int type;
- union {
- X509_NAME* byName;
- ASN1_OCTET_STRING *byKey;
- } value;
- } OCSP_RESPID;
+struct ocsp_responder_id_st
+ {
+ int type;
+ union {
+ X509_NAME* byName;
+ ASN1_OCTET_STRING *byKey;
+ } value;
+ };
+
+DECLARE_STACK_OF(OCSP_RESPID)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
+
/* KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
* --(excluding the tag and length fields)
*/
@@ -215,10 +219,10 @@ typedef struct ocsp_responder_id_st
* revocationReason [0] EXPLICIT CRLReason OPTIONAL }
*/
typedef struct ocsp_revoked_info_st
- {
- ASN1_GENERALIZEDTIME *revocationTime;
- ASN1_ENUMERATED *revocationReason;
- } OCSP_REVOKEDINFO;
+ {
+ ASN1_GENERALIZEDTIME *revocationTime;
+ ASN1_ENUMERATED *revocationReason;
+ } OCSP_REVOKEDINFO;
/* CertStatus ::= CHOICE {
* good [0] IMPLICIT NULL,
@@ -229,14 +233,14 @@ typedef struct ocsp_revoked_info_st
#define V_OCSP_CERTSTATUS_REVOKED 1
#define V_OCSP_CERTSTATUS_UNKNOWN 2
typedef struct ocsp_cert_status_st
- {
- int type;
- union {
- ASN1_NULL *good;
- OCSP_REVOKEDINFO *revoked;
- ASN1_NULL *unknown;
- } value;
- } OCSP_CERTSTATUS;
+ {
+ int type;
+ union {
+ ASN1_NULL *good;
+ OCSP_REVOKEDINFO *revoked;
+ ASN1_NULL *unknown;
+ } value;
+ } OCSP_CERTSTATUS;
/* SingleResponse ::= SEQUENCE {
* certID CertID,
@@ -246,13 +250,13 @@ typedef struct ocsp_cert_status_st
* singleExtensions [1] EXPLICIT Extensions OPTIONAL }
*/
typedef struct ocsp_single_response_st
- {
- OCSP_CERTID *certId;
- OCSP_CERTSTATUS *certStatus;
- ASN1_GENERALIZEDTIME *thisUpdate;
- ASN1_GENERALIZEDTIME *nextUpdate;
- STACK_OF(X509_EXTENSION) *singleExtensions;
- } OCSP_SINGLERESP;
+ {
+ OCSP_CERTID *certId;
+ OCSP_CERTSTATUS *certStatus;
+ ASN1_GENERALIZEDTIME *thisUpdate;
+ ASN1_GENERALIZEDTIME *nextUpdate;
+ STACK_OF(X509_EXTENSION) *singleExtensions;
+ } OCSP_SINGLERESP;
DECLARE_STACK_OF(OCSP_SINGLERESP)
DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
@@ -265,13 +269,13 @@ DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
* responseExtensions [1] EXPLICIT Extensions OPTIONAL }
*/
typedef struct ocsp_response_data_st
- {
- ASN1_INTEGER *version;
- OCSP_RESPID *responderId;
- ASN1_GENERALIZEDTIME *producedAt;
- STACK_OF(OCSP_SINGLERESP) *responses;
- STACK_OF(X509_EXTENSION) *responseExtensions;
- } OCSP_RESPDATA;
+ {
+ ASN1_INTEGER *version;
+ OCSP_RESPID *responderId;
+ ASN1_GENERALIZEDTIME *producedAt;
+ STACK_OF(OCSP_SINGLERESP) *responses;
+ STACK_OF(X509_EXTENSION) *responseExtensions;
+ } OCSP_RESPDATA;
/* BasicOCSPResponse ::= SEQUENCE {
* tbsResponseData ResponseData,
@@ -288,20 +292,20 @@ typedef struct ocsp_response_data_st
a bit odd, but that's the spec. Also note that the data structures do not
leave anywhere to independently specify the algorithm used for the initial
hash. So, we look at the signature-specification algorithm, and try to do
- something intelligent. -- Kathy Weinhold, CertCo */
+ something intelligent. -- Kathy Weinhold, CertCo */
/* Note 2:
It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open
for interpretation. I've done tests against another responder, and found
that it doesn't do the double hashing that the RFC seems to say one
should. Therefore, all relevant functions take a flag saying which
- variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */
+ variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */
typedef struct ocsp_basic_response_st
- {
- OCSP_RESPDATA *tbsResponseData;
- X509_ALGOR *signatureAlgorithm;
- ASN1_BIT_STRING *signature;
- STACK_OF(X509) *certs;
- } OCSP_BASICRESP;
+ {
+ OCSP_RESPDATA *tbsResponseData;
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+ } OCSP_BASICRESP;
/*
* CRLReason ::= ENUMERATED {
@@ -331,9 +335,9 @@ typedef struct ocsp_basic_response_st
*/
typedef struct ocsp_crl_id_st
{
- ASN1_IA5STRING *crlUrl;
- ASN1_INTEGER *crlNum;
- ASN1_GENERALIZEDTIME *crlTime;
+ ASN1_IA5STRING *crlUrl;
+ ASN1_INTEGER *crlNum;
+ ASN1_GENERALIZEDTIME *crlTime;
} OCSP_CRLID;
/* ServiceLocator ::= SEQUENCE {
@@ -342,68 +346,72 @@ typedef struct ocsp_crl_id_st
*/
typedef struct ocsp_service_locator_st
{
- X509_NAME* issuer;
- STACK_OF(ACCESS_DESCRIPTION) *locator;
+ X509_NAME* issuer;
+ STACK_OF(ACCESS_DESCRIPTION) *locator;
} OCSP_SERVICELOC;
-
-#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
+
+#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
#define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
#define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
-#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
+#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
(char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
-#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
+#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
(char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
#define PEM_write_bio_OCSP_REQUEST(bp,o) \
PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
- bp,(char *)o, NULL,NULL,0,NULL,NULL)
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_OCSP_RESPONSE(bp,o) \
PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
- bp,(char *)o, NULL,NULL,0,NULL,NULL)
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
#define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
#define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
#define OCSP_REQUEST_sign(o,pkey,md) \
- ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
- o->optionalSignature->signatureAlgorithm,NULL,\
- o->optionalSignature->signature,o->tbsRequest,pkey,md)
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
+ o->optionalSignature->signatureAlgorithm,NULL,\
+ o->optionalSignature->signature,o->tbsRequest,pkey,md)
#define OCSP_BASICRESP_sign(o,pkey,md,d) \
- ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
- o->signature,o->tbsResponseData,pkey,md)
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
+ o->signature,o->tbsResponseData,pkey,md)
#define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
a->optionalSignature->signatureAlgorithm,\
- a->optionalSignature->signature,a->tbsRequest,r)
+ a->optionalSignature->signature,a->tbsRequest,r)
#define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
- a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
+ a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
#define ASN1_BIT_STRING_digest(data,type,md,len) \
- ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
+ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
#define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid)
#define OCSP_CERTSTATUS_dup(cs)\
(OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
- (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
+ (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
+OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
+ int maxline);
+int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
+void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
-OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
- X509_NAME *issuerName,
- ASN1_BIT_STRING* issuerKey,
- ASN1_INTEGER *serialNumber);
+OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
+ X509_NAME *issuerName,
+ ASN1_BIT_STRING* issuerKey,
+ ASN1_INTEGER *serialNumber);
OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
@@ -416,11 +424,11 @@ int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
int OCSP_request_sign(OCSP_REQUEST *req,
- X509 *signer,
- EVP_PKEY *key,
- const EVP_MD *dgst,
- STACK_OF(X509) *certs,
- unsigned long flags);
+ X509 *signer,
+ EVP_PKEY *key,
+ const EVP_MD *dgst,
+ STACK_OF(X509) *certs,
+ unsigned long flags);
int OCSP_response_status(OCSP_RESPONSE *resp);
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
@@ -429,17 +437,17 @@ int OCSP_resp_count(OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
- ASN1_GENERALIZEDTIME **revtime,
- ASN1_GENERALIZEDTIME **thisupd,
- ASN1_GENERALIZEDTIME **nextupd);
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
- int *reason,
- ASN1_GENERALIZEDTIME **revtime,
- ASN1_GENERALIZEDTIME **thisupd,
- ASN1_GENERALIZEDTIME **nextupd);
+ int *reason,
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
- ASN1_GENERALIZEDTIME *nextupd,
- long sec, long maxsec);
+ ASN1_GENERALIZEDTIME *nextupd,
+ long sec, long maxsec);
int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags);
@@ -452,24 +460,24 @@ int OCSP_request_onereq_count(OCSP_REQUEST *req);
OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
- ASN1_OCTET_STRING **pikeyHash,
- ASN1_INTEGER **pserial, OCSP_CERTID *cid);
+ ASN1_OCTET_STRING **pikeyHash,
+ ASN1_INTEGER **pserial, OCSP_CERTID *cid);
int OCSP_request_is_signed(OCSP_REQUEST *req);
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
- OCSP_CERTID *cid,
- int status, int reason,
- ASN1_TIME *revtime,
- ASN1_TIME *thisupd, ASN1_TIME *nextupd);
+ OCSP_CERTID *cid,
+ int status, int reason,
+ ASN1_TIME *revtime,
+ ASN1_TIME *thisupd, ASN1_TIME *nextupd);
int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
-int OCSP_basic_sign(OCSP_BASICRESP *brsp,
- X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
- STACK_OF(X509) *certs, unsigned long flags);
+int OCSP_basic_sign(OCSP_BASICRESP *brsp,
+ X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
+ STACK_OF(X509) *certs, unsigned long flags);
ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
- void *data, STACK_OF(ASN1_OBJECT) *sk);
+ void *data, STACK_OF(ASN1_OBJECT) *sk);
#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
-((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
+ ASN1_STRING_encode(s, CHECKED_I2D_OF(type, i2d), data, sk)
X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
@@ -487,7 +495,7 @@ X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
- unsigned long flags);
+ unsigned long flags);
int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
@@ -498,7 +506,7 @@ X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
- unsigned long flags);
+ unsigned long flags);
int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
@@ -509,7 +517,7 @@ X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx);
int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit,
- unsigned long flags);
+ unsigned long flags);
int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
@@ -520,7 +528,7 @@ X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx);
int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit,
- unsigned long flags);
+ unsigned long flags);
int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
@@ -547,7 +555,7 @@ int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
- X509_STORE *st, unsigned long flags);
+ X509_STORE *st, unsigned long flags);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -558,58 +566,58 @@ void ERR_load_OCSP_strings(void);
/* Error codes for the OCSP functions. */
/* Function codes. */
-#define OCSP_F_ASN1_STRING_ENCODE 100
-#define OCSP_F_D2I_OCSP_NONCE 102
-#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
-#define OCSP_F_OCSP_BASIC_SIGN 104
-#define OCSP_F_OCSP_BASIC_VERIFY 105
-#define OCSP_F_OCSP_CERT_ID_NEW 101
-#define OCSP_F_OCSP_CHECK_DELEGATED 106
-#define OCSP_F_OCSP_CHECK_IDS 107
-#define OCSP_F_OCSP_CHECK_ISSUER 108
-#define OCSP_F_OCSP_CHECK_VALIDITY 115
-#define OCSP_F_OCSP_MATCH_ISSUERID 109
-#define OCSP_F_OCSP_PARSE_URL 114
-#define OCSP_F_OCSP_REQUEST_SIGN 110
-#define OCSP_F_OCSP_REQUEST_VERIFY 116
-#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
-#define OCSP_F_OCSP_SENDREQ_BIO 112
-#define OCSP_F_REQUEST_VERIFY 113
+#define OCSP_F_ASN1_STRING_ENCODE 100
+#define OCSP_F_D2I_OCSP_NONCE 102
+#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
+#define OCSP_F_OCSP_BASIC_SIGN 104
+#define OCSP_F_OCSP_BASIC_VERIFY 105
+#define OCSP_F_OCSP_CERT_ID_NEW 101
+#define OCSP_F_OCSP_CHECK_DELEGATED 106
+#define OCSP_F_OCSP_CHECK_IDS 107
+#define OCSP_F_OCSP_CHECK_ISSUER 108
+#define OCSP_F_OCSP_CHECK_VALIDITY 115
+#define OCSP_F_OCSP_MATCH_ISSUERID 109
+#define OCSP_F_OCSP_PARSE_URL 114
+#define OCSP_F_OCSP_REQUEST_SIGN 110
+#define OCSP_F_OCSP_REQUEST_VERIFY 116
+#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
+#define OCSP_F_OCSP_SENDREQ_BIO 112
+#define OCSP_F_PARSE_HTTP_LINE1 117
+#define OCSP_F_REQUEST_VERIFY 113
/* Reason codes. */
-#define OCSP_R_BAD_DATA 100
-#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
-#define OCSP_R_DIGEST_ERR 102
-#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
-#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
-#define OCSP_R_ERROR_PARSING_URL 121
-#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
-#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
-#define OCSP_R_NOT_BASIC_RESPONSE 104
-#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
-#define OCSP_R_NO_CONTENT 106
-#define OCSP_R_NO_PUBLIC_KEY 107
-#define OCSP_R_NO_RESPONSE_DATA 108
-#define OCSP_R_NO_REVOKED_TIME 109
-#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
-#define OCSP_R_REQUEST_NOT_SIGNED 128
-#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
-#define OCSP_R_ROOT_CA_NOT_TRUSTED 112
-#define OCSP_R_SERVER_READ_ERROR 113
-#define OCSP_R_SERVER_RESPONSE_ERROR 114
-#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
-#define OCSP_R_SERVER_WRITE_ERROR 116
-#define OCSP_R_SIGNATURE_FAILURE 117
-#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
-#define OCSP_R_STATUS_EXPIRED 125
-#define OCSP_R_STATUS_NOT_YET_VALID 126
-#define OCSP_R_STATUS_TOO_OLD 127
-#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
-#define OCSP_R_UNKNOWN_NID 120
-#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
+#define OCSP_R_BAD_DATA 100
+#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
+#define OCSP_R_DIGEST_ERR 102
+#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
+#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
+#define OCSP_R_ERROR_PARSING_URL 121
+#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
+#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
+#define OCSP_R_NOT_BASIC_RESPONSE 104
+#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
+#define OCSP_R_NO_CONTENT 106
+#define OCSP_R_NO_PUBLIC_KEY 107
+#define OCSP_R_NO_RESPONSE_DATA 108
+#define OCSP_R_NO_REVOKED_TIME 109
+#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
+#define OCSP_R_REQUEST_NOT_SIGNED 128
+#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
+#define OCSP_R_ROOT_CA_NOT_TRUSTED 112
+#define OCSP_R_SERVER_READ_ERROR 113
+#define OCSP_R_SERVER_RESPONSE_ERROR 114
+#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
+#define OCSP_R_SERVER_WRITE_ERROR 116
+#define OCSP_R_SIGNATURE_FAILURE 117
+#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
+#define OCSP_R_STATUS_EXPIRED 125
+#define OCSP_R_STATUS_NOT_YET_VALID 126
+#define OCSP_R_STATUS_TOO_OLD 127
+#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
+#define OCSP_R_UNKNOWN_NID 120
+#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/opensslconf.h b/dep/include/openssl/opensslconf.h
index 4b8bfffefc3..231bf7bfdbe 100644
--- a/dep/include/openssl/opensslconf.h
+++ b/dep/include/openssl/opensslconf.h
@@ -2,14 +2,27 @@
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
/* OpenSSL was configured with the following options: */
+#ifndef OPENSSL_SYSNAME_WIN32
+# define OPENSSL_SYSNAME_WIN32
+#endif
#ifndef OPENSSL_DOING_MAKEDEPEND
+
#ifndef OPENSSL_NO_CAMELLIA
# define OPENSSL_NO_CAMELLIA
#endif
+#ifndef OPENSSL_NO_CAPIENG
+# define OPENSSL_NO_CAPIENG
+#endif
+#ifndef OPENSSL_NO_CMS
+# define OPENSSL_NO_CMS
+#endif
#ifndef OPENSSL_NO_GMP
# define OPENSSL_NO_GMP
#endif
+#ifndef OPENSSL_NO_JPAKE
+# define OPENSSL_NO_JPAKE
+#endif
#ifndef OPENSSL_NO_KRB5
# define OPENSSL_NO_KRB5
#endif
@@ -22,10 +35,14 @@
#ifndef OPENSSL_NO_RFC3779
# define OPENSSL_NO_RFC3779
#endif
+#ifndef OPENSSL_NO_SEED
+# define OPENSSL_NO_SEED
+#endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
-#ifndef OPENSSL_NO_DYNAMIC_ENGINE
-# define OPENSSL_NO_DYNAMIC_ENGINE
+
+#ifndef OPENSSL_THREADS
+# define OPENSSL_THREADS
#endif
/* The OPENSSL_NO_* macros are also defined as NO_* if the application
@@ -36,9 +53,18 @@
# if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA)
# define NO_CAMELLIA
# endif
+# if defined(OPENSSL_NO_CAPIENG) && !defined(NO_CAPIENG)
+# define NO_CAPIENG
+# endif
+# if defined(OPENSSL_NO_CMS) && !defined(NO_CMS)
+# define NO_CMS
+# endif
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
# define NO_GMP
# endif
+# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
+# define NO_JPAKE
+# endif
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
# define NO_KRB5
# endif
@@ -51,17 +77,35 @@
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
# define NO_RFC3779
# endif
+# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
+# define NO_SEED
+# endif
#endif
/* crypto/opensslconf.h.in */
+#ifdef OPENSSL_DOING_MAKEDEPEND
+
+/* Include any symbols here that have to be explicitly set to enable a feature
+ * that should be visible to makedepend.
+ *
+ * [Our "make depend" doesn't actually look at this, we use actual build settings
+ * instead; we want to make it easy to remove subdirectories with disabled algorithms.]
+ */
+
+#ifndef OPENSSL_FIPS
+#define OPENSSL_FIPS
+#endif
+
+#endif
+
/* Generate 80386 code? */
#undef I386_ONLY
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
-#define ENGINESDIR "/usr/local/ssl/lib/engines"
-#define OPENSSLDIR "/usr/local/ssl"
+#define ENGINESDIR "G:\openssl_build/lib/engines"
+#define OPENSSLDIR "G:\openssl_build/ssl"
#endif
#endif
@@ -69,6 +113,7 @@
#define OPENSSL_UNISTD <unistd.h>
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
+#define OPENSSL_EXPORT_VAR_AS_FUNCTION
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
#define IDEA_INT unsigned int
@@ -113,7 +158,7 @@
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
#define CONFIG_HEADER_BN_H
-#undef BN_LLONG
+#define BN_LLONG
/* Should we define BN_DIV2W here? */
@@ -132,7 +177,7 @@
#define CONFIG_HEADER_RC4_LOCL_H
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
-#undef RC4_INDEX
+#define RC4_INDEX
#endif
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
@@ -179,31 +224,31 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
-#if defined( sun ) /* Newer Sparc's */
+
+#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
-#elif defined( __ultrix ) /* Older MIPS */
+#elif defined( __ultrix ) /* Older MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
-#elif defined( __osf1__ ) /* Alpha */
+#elif defined( __osf1__ ) /* Alpha */
# define DES_PTR
# define DES_RISC2
-#elif defined ( _AIX ) /* RS6000 */
+#elif defined ( _AIX ) /* RS6000 */
/* Unknown */
-#elif defined( __hpux ) /* HP-PA */
+#elif defined( __hpux ) /* HP-PA */
/* Unknown */
-#elif defined( __aux ) /* 68K */
+#elif defined( __aux ) /* 68K */
/* Unknown */
-#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
+#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
# define DES_UNROLL
-#elif defined( __sgi ) /* Newer MIPS */
+#elif defined( __sgi ) /* Newer MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
-#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
+#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
@@ -212,4 +257,3 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif /* DES_DEFAULT_OPTIONS */
#endif /* HEADER_DES_LOCL_H */
-
diff --git a/dep/include/openssl/opensslv.h b/dep/include/openssl/opensslv.h
index 1e32c6809dd..09687b5136a 100644
--- a/dep/include/openssl/opensslv.h
+++ b/dep/include/openssl/opensslv.h
@@ -6,14 +6,14 @@
* The status nibble has one of the values 0 for development, 1 to e for betas
* 1 to 14, and f for release. The patch level is exactly that.
* For example:
- * 0.9.3-dev 0x00903000
- * 0.9.3-beta1 0x00903001
+ * 0.9.3-dev 0x00903000
+ * 0.9.3-beta1 0x00903001
* 0.9.3-beta2-dev 0x00903002
* 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
- * 0.9.3 0x0090300f
- * 0.9.3a 0x0090301f
- * 0.9.4 0x0090400f
- * 1.2.3z 0x102031af
+ * 0.9.3 0x0090300f
+ * 0.9.3a 0x0090301f
+ * 0.9.4 0x0090400f
+ * 1.2.3z 0x102031af
*
* For continuity reasons (because 0.9.5 is already out, and is coded
* 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
@@ -25,13 +25,13 @@
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-#define OPENSSL_VERSION_NUMBER 0x0090805fL
+#define OPENSSL_VERSION_NUMBER 0x009080afL
#ifdef OPENSSL_FIPS
-#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8e-fips 23 Feb 2007"
+#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8j-fips 07 Jan 2009"
#else
-#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8e 23 Feb 2007"
+#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8j 07 Jan 2009"
#endif
-#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
+#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
/* The macros below are to be used for shared library (.so, .dll, ...)
@@ -42,11 +42,11 @@
* be greater or equal to what it was at application link time. With this
* scheme, the version number is usually part of the file name, like this:
*
- * libcrypto.so.0.9
+ * libcrypto.so.0.9
*
* Some unixen also make a softlink with the major verson number only:
*
- * libcrypto.so.0
+ * libcrypto.so.0
*
* On Tru64 and IRIX 6.x it works a little bit differently. There, the
* shared library version is stored in the file, and is actually a series
@@ -61,11 +61,11 @@
* to highest, should be part of the string. Consecutive builds would
* give the following versions strings:
*
- * 3.0
- * 3.0:3.1
- * 3.0:3.1:3.2
- * 4.0
- * 4.0:4.1
+ * 3.0
+ * 3.0:3.1
+ * 3.0:3.1:3.2
+ * 4.0
+ * 4.0:4.1
*
* Notice how version 4 is completely incompatible with version, and
* therefore give the breach you can see.
@@ -87,4 +87,3 @@
#endif /* HEADER_OPENSSLV_H */
-
diff --git a/dep/include/openssl/ossl_typ.h b/dep/include/openssl/ossl_typ.h
index ca61b2fc864..0e7a3808803 100644
--- a/dep/include/openssl/ossl_typ.h
+++ b/dep/include/openssl/ossl_typ.h
@@ -6,7 +6,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -58,23 +58,23 @@
#include <openssl/e_os2.h>
#ifdef NO_ASN1_TYPEDEFS
-#define ASN1_INTEGER ASN1_STRING
-#define ASN1_ENUMERATED ASN1_STRING
-#define ASN1_BIT_STRING ASN1_STRING
-#define ASN1_OCTET_STRING ASN1_STRING
-#define ASN1_PRINTABLESTRING ASN1_STRING
-#define ASN1_T61STRING ASN1_STRING
-#define ASN1_IA5STRING ASN1_STRING
-#define ASN1_UTCTIME ASN1_STRING
-#define ASN1_GENERALIZEDTIME ASN1_STRING
-#define ASN1_TIME ASN1_STRING
-#define ASN1_GENERALSTRING ASN1_STRING
-#define ASN1_UNIVERSALSTRING ASN1_STRING
-#define ASN1_BMPSTRING ASN1_STRING
-#define ASN1_VISIBLESTRING ASN1_STRING
-#define ASN1_UTF8STRING ASN1_STRING
-#define ASN1_BOOLEAN int
-#define ASN1_NULL int
+#define ASN1_INTEGER ASN1_STRING
+#define ASN1_ENUMERATED ASN1_STRING
+#define ASN1_BIT_STRING ASN1_STRING
+#define ASN1_OCTET_STRING ASN1_STRING
+#define ASN1_PRINTABLESTRING ASN1_STRING
+#define ASN1_T61STRING ASN1_STRING
+#define ASN1_IA5STRING ASN1_STRING
+#define ASN1_UTCTIME ASN1_STRING
+#define ASN1_GENERALIZEDTIME ASN1_STRING
+#define ASN1_TIME ASN1_STRING
+#define ASN1_GENERALSTRING ASN1_STRING
+#define ASN1_UNIVERSALSTRING ASN1_STRING
+#define ASN1_BMPSTRING ASN1_STRING
+#define ASN1_VISIBLESTRING ASN1_STRING
+#define ASN1_UTF8STRING ASN1_STRING
+#define ASN1_BOOLEAN int
+#define ASN1_NULL int
#else
typedef struct asn1_string_st ASN1_INTEGER;
typedef struct asn1_string_st ASN1_ENUMERATED;
@@ -97,8 +97,11 @@ typedef int ASN1_NULL;
#ifdef OPENSSL_SYS_WIN32
#undef X509_NAME
+#undef X509_EXTENSIONS
#undef X509_CERT_PAIR
#undef PKCS7_ISSUER_AND_SERIAL
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
#endif
#ifdef BIGNUM
@@ -139,6 +142,8 @@ typedef struct X509_crl_st X509_CRL;
typedef struct X509_name_st X509_NAME;
typedef struct x509_store_st X509_STORE;
typedef struct x509_store_ctx_st X509_STORE_CTX;
+typedef struct ssl_st SSL;
+typedef struct ssl_ctx_st SSL_CTX;
typedef struct v3_ext_ctx X509V3_CTX;
typedef struct conf_st CONF;
@@ -165,11 +170,14 @@ typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
/* Callback types for crypto.h */
typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp);
+ int idx, long argl, void *argp);
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
- int idx, long argl, void *argp);
-typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
- int idx, long argl, void *argp);
+ int idx, long argl, void *argp);
+typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
+ int idx, long argl, void *argp);
-#endif /* def HEADER_OPENSSL_TYPES_H */
+typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
+typedef struct ocsp_response_st OCSP_RESPONSE;
+typedef struct ocsp_responder_id_st OCSP_RESPID;
+#endif /* def HEADER_OPENSSL_TYPES_H */
diff --git a/dep/include/openssl/pem.h b/dep/include/openssl/pem.h
index 7924e75da3f..6f8e01544bb 100644
--- a/dep/include/openssl/pem.h
+++ b/dep/include/openssl/pem.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -74,28 +74,28 @@
extern "C" {
#endif
-#define PEM_BUFSIZE 1024
-
-#define PEM_OBJ_UNDEF 0
-#define PEM_OBJ_X509 1
-#define PEM_OBJ_X509_REQ 2
-#define PEM_OBJ_CRL 3
-#define PEM_OBJ_SSL_SESSION 4
-#define PEM_OBJ_PRIV_KEY 10
-#define PEM_OBJ_PRIV_RSA 11
-#define PEM_OBJ_PRIV_DSA 12
-#define PEM_OBJ_PRIV_DH 13
-#define PEM_OBJ_PUB_RSA 14
-#define PEM_OBJ_PUB_DSA 15
-#define PEM_OBJ_PUB_DH 16
-#define PEM_OBJ_DHPARAMS 17
-#define PEM_OBJ_DSAPARAMS 18
-#define PEM_OBJ_PRIV_RSA_PUBLIC 19
-#define PEM_OBJ_PRIV_ECDSA 20
-#define PEM_OBJ_PUB_ECDSA 21
-#define PEM_OBJ_ECPARAMETERS 22
-
-#define PEM_ERROR 30
+#define PEM_BUFSIZE 1024
+
+#define PEM_OBJ_UNDEF 0
+#define PEM_OBJ_X509 1
+#define PEM_OBJ_X509_REQ 2
+#define PEM_OBJ_CRL 3
+#define PEM_OBJ_SSL_SESSION 4
+#define PEM_OBJ_PRIV_KEY 10
+#define PEM_OBJ_PRIV_RSA 11
+#define PEM_OBJ_PRIV_DSA 12
+#define PEM_OBJ_PRIV_DH 13
+#define PEM_OBJ_PUB_RSA 14
+#define PEM_OBJ_PUB_DSA 15
+#define PEM_OBJ_PUB_DH 16
+#define PEM_OBJ_DHPARAMS 17
+#define PEM_OBJ_DSAPARAMS 18
+#define PEM_OBJ_PRIV_RSA_PUBLIC 19
+#define PEM_OBJ_PRIV_ECDSA 20
+#define PEM_OBJ_PUB_ECDSA 21
+#define PEM_OBJ_ECPARAMETERS 22
+
+#define PEM_ERROR 30
#define PEM_DEK_DES_CBC 40
#define PEM_DEK_IDEA_CBC 45
#define PEM_DEK_DES_EDE 50
@@ -104,105 +104,107 @@ extern "C" {
#define PEM_DEK_RSA_MD2 80
#define PEM_DEK_RSA_MD5 90
-#define PEM_MD_MD2 NID_md2
-#define PEM_MD_MD5 NID_md5
-#define PEM_MD_SHA NID_sha
-#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
-#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
-#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
-
-#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
-#define PEM_STRING_X509 "CERTIFICATE"
-#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
-#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
-#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
-#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
-#define PEM_STRING_X509_CRL "X509 CRL"
-#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
-#define PEM_STRING_PUBLIC "PUBLIC KEY"
-#define PEM_STRING_RSA "RSA PRIVATE KEY"
-#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
-#define PEM_STRING_DSA "DSA PRIVATE KEY"
-#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
-#define PEM_STRING_PKCS7 "PKCS7"
-#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
-#define PEM_STRING_PKCS8INF "PRIVATE KEY"
-#define PEM_STRING_DHPARAMS "DH PARAMETERS"
-#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
-#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
+#define PEM_MD_MD2 NID_md2
+#define PEM_MD_MD5 NID_md5
+#define PEM_MD_SHA NID_sha
+#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
+#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
+#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
+
+#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
+#define PEM_STRING_X509 "CERTIFICATE"
+#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
+#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
+#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
+#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
+#define PEM_STRING_X509_CRL "X509 CRL"
+#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
+#define PEM_STRING_PUBLIC "PUBLIC KEY"
+#define PEM_STRING_RSA "RSA PRIVATE KEY"
+#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
+#define PEM_STRING_DSA "DSA PRIVATE KEY"
+#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
+#define PEM_STRING_PKCS7 "PKCS7"
+#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
+#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
+#define PEM_STRING_PKCS8INF "PRIVATE KEY"
+#define PEM_STRING_DHPARAMS "DH PARAMETERS"
+#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
+#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
#define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
-#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
+#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
+#define PEM_STRING_CMS "CMS"
/* Note that this structure is initialised by PEM_SealInit and cleaned up
by PEM_SealFinal (at least for now) */
typedef struct PEM_Encode_Seal_st
- {
- EVP_ENCODE_CTX encode;
- EVP_MD_CTX md;
- EVP_CIPHER_CTX cipher;
- } PEM_ENCODE_SEAL_CTX;
+ {
+ EVP_ENCODE_CTX encode;
+ EVP_MD_CTX md;
+ EVP_CIPHER_CTX cipher;
+ } PEM_ENCODE_SEAL_CTX;
/* enc_type is one off */
#define PEM_TYPE_ENCRYPTED 10
#define PEM_TYPE_MIC_ONLY 20
#define PEM_TYPE_MIC_CLEAR 30
-#define PEM_TYPE_CLEAR 40
+#define PEM_TYPE_CLEAR 40
typedef struct pem_recip_st
- {
- char *name;
- X509_NAME *dn;
+ {
+ char *name;
+ X509_NAME *dn;
- int cipher;
- int key_enc;
- /* char iv[8]; unused and wrong size */
- } PEM_USER;
+ int cipher;
+ int key_enc;
+ /* char iv[8]; unused and wrong size */
+ } PEM_USER;
typedef struct pem_ctx_st
- {
- int type; /* what type of object */
-
- struct {
- int version;
- int mode;
- } proc_type;
+ {
+ int type; /* what type of object */
- char *domain;
+ struct {
+ int version;
+ int mode;
+ } proc_type;
- struct {
- int cipher;
- /* unused, and wrong size
- unsigned char iv[8]; */
- } DEK_info;
+ char *domain;
- PEM_USER *originator;
+ struct {
+ int cipher;
+ /* unused, and wrong size
+ unsigned char iv[8]; */
+ } DEK_info;
+
+ PEM_USER *originator;
- int num_recipient;
- PEM_USER **recipient;
+ int num_recipient;
+ PEM_USER **recipient;
#ifndef OPENSSL_NO_STACK
- STACK *x509_chain; /* certificate chain */
+ STACK *x509_chain; /* certificate chain */
#else
- char *x509_chain; /* certificate chain */
+ char *x509_chain; /* certificate chain */
#endif
- EVP_MD *md; /* signature type */
-
- int md_enc; /* is the md encrypted or not? */
- int md_len; /* length of md_data */
- char *md_data; /* message digest, could be pkey encrypted */
+ EVP_MD *md; /* signature type */
- EVP_CIPHER *dec; /* date encryption cipher */
- int key_len; /* key length */
- unsigned char *key; /* key */
- /* unused, and wrong size
- unsigned char iv[8]; */
+ int md_enc; /* is the md encrypted or not? */
+ int md_len; /* length of md_data */
+ char *md_data; /* message digest, could be pkey encrypted */
+ EVP_CIPHER *dec; /* date encryption cipher */
+ int key_len; /* key length */
+ unsigned char *key; /* key */
+ /* unused, and wrong size
+ unsigned char iv[8]; */
- int data_enc; /* is the data encrypted */
- int data_len;
- unsigned char *data;
- } PEM_CTX;
+
+ int data_enc; /* is the data encrypted */
+ int data_len;
+ unsigned char *data;
+ } PEM_CTX;
/* These macros make the PEM_read/PEM_write functions easier to maintain and
* write. Now they are all implemented with either:
@@ -220,102 +222,132 @@ typedef struct pem_ctx_st
#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
{ \
-return(((type *(*)(D2I_OF(type),char *,FILE *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read))(d2i_##asn1, str,fp,x,cb,u)); \
-}
+ return (type*)PEM_ASN1_read(CHECKED_D2I_OF(type, d2i_##asn1), \
+ str, fp, \
+ CHECKED_PPTR_OF(type, x), \
+ cb, u); \
+}
#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
int PEM_write_##name(FILE *fp, type *x) \
{ \
-return(((int (*)(I2D_OF(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL)); \
+ return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \
+ str, fp, \
+ CHECKED_PTR_OF(type, x), \
+ NULL, NULL, 0, NULL, NULL); \
}
#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
int PEM_write_##name(FILE *fp, const type *x) \
{ \
-return(((int (*)(I2D_OF_const(type),const char *,FILE *, const type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL)); \
+ return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \
+ str, fp, \
+ CHECKED_PTR_OF(const type, x), \
+ NULL, NULL, 0, NULL, NULL); \
}
#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, \
- void *u) \
- { \
- return(((int (*)(I2D_OF(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u)); \
- }
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \
+ str, fp, \
+ CHECKED_PTR_OF(type, x), \
+ enc, kstr, klen, cb, u); \
+ }
#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, \
- void *u) \
- { \
- return(((int (*)(I2D_OF_const(type),const char *,FILE *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write))(i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u)); \
- }
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \
+ str, fp, \
+ CHECKED_PTR_OF(const type, x), \
+ enc, kstr, klen, cb, u); \
+ }
#endif
#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
{ \
-return(((type *(*)(D2I_OF(type),const char *,BIO *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read_bio))(d2i_##asn1, str,bp,x,cb,u)); \
+ return (type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i_##asn1), \
+ str, bp, \
+ CHECKED_PPTR_OF(type, x), \
+ cb, u); \
}
#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, type *x) \
{ \
-return(((int (*)(I2D_OF(type),const char *,BIO *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL)); \
+ return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \
+ str, bp, \
+ CHECKED_PTR_OF(type, x), \
+ NULL, NULL, 0, NULL, NULL); \
}
#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, const type *x) \
{ \
-return(((int (*)(I2D_OF_const(type),const char *,BIO *,const type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL)); \
+ return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \
+ str, bp, \
+ CHECKED_PTR_OF(const type, x), \
+ NULL, NULL, 0, NULL, NULL); \
}
#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
- { \
- return(((int (*)(I2D_OF(type),const char *,BIO *,type *,const EVP_CIPHER *,unsigned char *,int,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u)); \
- }
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \
+ str, bp, \
+ CHECKED_PTR_OF(type, x), \
+ enc, kstr, klen, cb, u); \
+ }
#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
- { \
- return(((int (*)(I2D_OF_const(type),const char *,BIO *,type *,const EVP_CIPHER *,unsigned char *,int,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u)); \
- }
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \
+ str, bp, \
+ CHECKED_PTR_OF(const type, x), \
+ enc, kstr, klen, cb, u); \
+ }
#define IMPLEMENT_PEM_write(name, type, str, asn1) \
- IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
- IMPLEMENT_PEM_write_fp(name, type, str, asn1)
+ IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp(name, type, str, asn1)
#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
- IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
- IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
+ IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
- IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
- IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
+ IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
- IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
- IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
+ IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
#define IMPLEMENT_PEM_read(name, type, str, asn1) \
- IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
- IMPLEMENT_PEM_read_fp(name, type, str, asn1)
+ IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_read_fp(name, type, str, asn1)
#define IMPLEMENT_PEM_rw(name, type, str, asn1) \
- IMPLEMENT_PEM_read(name, type, str, asn1) \
- IMPLEMENT_PEM_write(name, type, str, asn1)
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write(name, type, str, asn1)
#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
- IMPLEMENT_PEM_read(name, type, str, asn1) \
- IMPLEMENT_PEM_write_const(name, type, str, asn1)
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_const(name, type, str, asn1)
#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
- IMPLEMENT_PEM_read(name, type, str, asn1) \
- IMPLEMENT_PEM_write_cb(name, type, str, asn1)
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb(name, type, str, asn1)
/* These are the same except they are for the declarations */
@@ -328,33 +360,33 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
#else
#define DECLARE_PEM_read_fp(name, type) \
- type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
+ type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
#define DECLARE_PEM_write_fp(name, type) \
- int PEM_write_##name(FILE *fp, type *x);
+ int PEM_write_##name(FILE *fp, type *x);
#define DECLARE_PEM_write_fp_const(name, type) \
- int PEM_write_##name(FILE *fp, const type *x);
+ int PEM_write_##name(FILE *fp, const type *x);
#define DECLARE_PEM_write_cb_fp(name, type) \
- int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
#endif
#ifndef OPENSSL_NO_BIO
#define DECLARE_PEM_read_bio(name, type) \
- type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
+ type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
#define DECLARE_PEM_write_bio(name, type) \
- int PEM_write_bio_##name(BIO *bp, type *x);
+ int PEM_write_bio_##name(BIO *bp, type *x);
#define DECLARE_PEM_write_bio_const(name, type) \
- int PEM_write_bio_##name(BIO *bp, const type *x);
+ int PEM_write_bio_##name(BIO *bp, const type *x);
#define DECLARE_PEM_write_cb_bio(name, type) \
- int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
- unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
#else
@@ -365,162 +397,162 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
#endif
#define DECLARE_PEM_write(name, type) \
- DECLARE_PEM_write_bio(name, type) \
- DECLARE_PEM_write_fp(name, type)
+ DECLARE_PEM_write_bio(name, type) \
+ DECLARE_PEM_write_fp(name, type)
#define DECLARE_PEM_write_const(name, type) \
- DECLARE_PEM_write_bio_const(name, type) \
- DECLARE_PEM_write_fp_const(name, type)
+ DECLARE_PEM_write_bio_const(name, type) \
+ DECLARE_PEM_write_fp_const(name, type)
#define DECLARE_PEM_write_cb(name, type) \
- DECLARE_PEM_write_cb_bio(name, type) \
- DECLARE_PEM_write_cb_fp(name, type)
+ DECLARE_PEM_write_cb_bio(name, type) \
+ DECLARE_PEM_write_cb_fp(name, type)
#define DECLARE_PEM_read(name, type) \
- DECLARE_PEM_read_bio(name, type) \
- DECLARE_PEM_read_fp(name, type)
+ DECLARE_PEM_read_bio(name, type) \
+ DECLARE_PEM_read_fp(name, type)
#define DECLARE_PEM_rw(name, type) \
- DECLARE_PEM_read(name, type) \
- DECLARE_PEM_write(name, type)
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write(name, type)
#define DECLARE_PEM_rw_const(name, type) \
- DECLARE_PEM_read(name, type) \
- DECLARE_PEM_write_const(name, type)
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_const(name, type)
#define DECLARE_PEM_rw_cb(name, type) \
- DECLARE_PEM_read(name, type) \
- DECLARE_PEM_write_cb(name, type)
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_cb(name, type)
#ifdef SSLEAY_MACROS
#define PEM_write_SSL_SESSION(fp,x) \
- PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
- PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
+ PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_X509(fp,x) \
- PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \
- (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \
+ (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_X509_REQ(fp,x) PEM_ASN1_write( \
- (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \
- NULL,NULL,0,NULL,NULL)
+ (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \
+ NULL,NULL,0,NULL,NULL)
#define PEM_write_X509_CRL(fp,x) \
- PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \
- fp,(char *)x, NULL,NULL,0,NULL,NULL)
-#define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\
- (char *)x,enc,kstr,klen,cb,u)
-#define PEM_write_RSAPublicKey(fp,x) \
- PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\
- PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL)
-#define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\
- (char *)x,enc,kstr,klen,cb,u)
-#define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write((int (*)())i2d_PrivateKey,\
- (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
- bp,(char *)x,enc,kstr,klen,cb,u)
+ PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \
+ fp,(char *)x, NULL,NULL,0,NULL,NULL)
+#define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\
+ (char *)x,enc,kstr,klen,cb,u)
+#define PEM_write_RSAPublicKey(fp,x) \
+ PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\
+ PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL)
+#define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\
+ (char *)x,enc,kstr,klen,cb,u)
+#define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write((int (*)())i2d_PrivateKey,\
+ (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
+ bp,(char *)x,enc,kstr,klen,cb,u)
#define PEM_write_PKCS7(fp,x) \
- PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \
- (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \
+ (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_DHparams(fp,x) \
- PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\
- (char *)x,NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\
+ (char *)x,NULL,NULL,0,NULL,NULL)
#define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \
PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
- PEM_STRING_X509,fp, \
+ PEM_STRING_X509,fp, \
(char *)x, NULL,NULL,0,NULL,NULL)
-#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
- (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
-#define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \
- (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u)
-#define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \
- (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u)
-#define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \
- (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u)
-#define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
- (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u)
-#define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
- (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u)
-#define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \
- (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u)
-#define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \
- (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u)
-#define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \
- (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u)
-#define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \
- (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u)
+#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
+ (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
+#define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \
+ (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u)
+#define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \
+ (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u)
+#define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \
+ (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u)
+#define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
+ (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u)
+#define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
+ (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u)
+#define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \
+ (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u)
+#define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \
+ (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u)
+#define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \
+ (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u)
+#define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \
+ (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u)
#define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb,u) \
- (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \
+ (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \
(char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\
- (char **)x,cb,u)
+ (char **)x,cb,u)
#define PEM_write_bio_X509(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \
- (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \
+ (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_X509_REQ(bp,x) PEM_ASN1_write_bio( \
- (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \
- NULL,NULL,0,NULL,NULL)
+ (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \
+ NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_X509_CRL(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\
- bp,(char *)x, NULL,NULL,0,NULL,NULL)
-#define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\
- bp,(char *)x,enc,kstr,klen,cb,u)
-#define PEM_write_bio_RSAPublicKey(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \
- PEM_STRING_RSA_PUBLIC,\
- bp,(char *)x,NULL,NULL,0,NULL,NULL)
-#define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\
- bp,(char *)x,enc,kstr,klen,cb,u)
-#define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
- PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\
- (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
- bp,(char *)x,enc,kstr,klen,cb,u)
+ PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\
+ bp,(char *)x, NULL,NULL,0,NULL,NULL)
+#define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\
+ bp,(char *)x,enc,kstr,klen,cb,u)
+#define PEM_write_bio_RSAPublicKey(bp,x) \
+ PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \
+ PEM_STRING_RSA_PUBLIC,\
+ bp,(char *)x,NULL,NULL,0,NULL,NULL)
+#define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\
+ bp,(char *)x,enc,kstr,klen,cb,u)
+#define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
+ PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\
+ (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
+ bp,(char *)x,enc,kstr,klen,cb,u)
#define PEM_write_bio_PKCS7(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \
- (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \
+ (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_DHparams(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\
- bp,(char *)x,NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\
+ bp,(char *)x,NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_DSAparams(bp,x) \
- PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \
- PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \
+ PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \
PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
- PEM_STRING_X509,bp, \
+ PEM_STRING_X509,bp, \
(char *)x, NULL,NULL,0,NULL,NULL)
-#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u)
-#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u)
-#define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u)
-#define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u)
-#define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u)
-#define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u)
-#define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u)
-
-#define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u)
-#define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u)
-#define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
- (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u)
+#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u)
+#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u)
+#define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u)
+#define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u)
+#define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u)
+#define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u)
+#define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u)
+
+#define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u)
+#define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u)
+#define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u)
#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb,u) \
- (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \
+ (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \
(char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\
- (char **)x,cb,u)
+ (char **)x,cb,u)
#endif
@@ -532,61 +564,70 @@ typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata);
typedef int pem_password_cb(char *buf, int size, int rwflag);
#endif
-int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
-int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len,
- pem_password_cb *callback,void *u);
+int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
+int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len,
+ pem_password_cb *callback,void *u);
#ifndef OPENSSL_NO_BIO
-int PEM_read_bio(BIO *bp, char **name, char **header,
- unsigned char **data,long *len);
-int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,
- long len);
+int PEM_read_bio(BIO *bp, char **name, char **header,
+ unsigned char **data,long *len);
+int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,
+ long len);
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp,
- pem_password_cb *cb, void *u);
-void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp,
- void **x, pem_password_cb *cb, void *u);
+ pem_password_cb *cb, void *u);
+void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp,
+ void **x, pem_password_cb *cb, void *u);
+
#define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \
-((type *(*)(D2I_OF(type),const char *,BIO *,type **,pem_password_cb *,void *))openssl_fcast(PEM_ASN1_read_bio))(d2i,name,bp,x,cb,u)
-int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x,
- const EVP_CIPHER *enc,unsigned char *kstr,int klen,
- pem_password_cb *cb, void *u);
-#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \
- ((int (*)(I2D_OF(type),const char *,BIO *,type *, const EVP_CIPHER *,unsigned char *,int, pem_password_cb *,void *))openssl_fcast(PEM_ASN1_write_bio))(i2d,name,bp,x,enc,kstr,klen,cb,u)
+ ((type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i), \
+ name, bp, \
+ CHECKED_PPTR_OF(type, x), \
+ cb, u))
-STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
-int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
- unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
+int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x,
+ const EVP_CIPHER *enc,unsigned char *kstr,int klen,
+ pem_password_cb *cb, void *u);
+
+#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \
+ (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \
+ name, bp, \
+ CHECKED_PTR_OF(type, x), \
+ enc, kstr, klen, cb, u))
+
+STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
+int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
+ unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
#endif
#ifndef OPENSSL_SYS_WIN16
-int PEM_read(FILE *fp, char **name, char **header,
- unsigned char **data,long *len);
-int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len);
+int PEM_read(FILE *fp, char **name, char **header,
+ unsigned char **data,long *len);
+int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len);
void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
- pem_password_cb *cb, void *u);
-int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp,
- char *x,const EVP_CIPHER *enc,unsigned char *kstr,
- int klen,pem_password_cb *callback, void *u);
-STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
- pem_password_cb *cb, void *u);
+ pem_password_cb *cb, void *u);
+int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp,
+ char *x,const EVP_CIPHER *enc,unsigned char *kstr,
+ int klen,pem_password_cb *callback, void *u);
+STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u);
#endif
-int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
- EVP_MD *md_type, unsigned char **ek, int *ekl,
- unsigned char *iv, EVP_PKEY **pubk, int npubk);
-void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
- unsigned char *in, int inl);
-int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl,
- unsigned char *out, int *outl, EVP_PKEY *priv);
+int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
+ EVP_MD *md_type, unsigned char **ek, int *ekl,
+ unsigned char *iv, EVP_PKEY **pubk, int npubk);
+void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
+ unsigned char *in, int inl);
+int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl,
+ unsigned char *out, int *outl, EVP_PKEY *priv);
void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
-int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
- unsigned int *siglen, EVP_PKEY *pkey);
+int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
+ unsigned int *siglen, EVP_PKEY *pkey);
-int PEM_def_callback(char *buf, int num, int w, void *key);
-void PEM_proc_type(char *buf, int type);
-void PEM_dek_info(char *buf, const char *type, int len, char *str);
+int PEM_def_callback(char *buf, int num, int w, void *key);
+void PEM_proc_type(char *buf, int type);
+void PEM_dek_info(char *buf, const char *type, int len, char *str);
#ifndef SSLEAY_MACROS
@@ -647,32 +688,32 @@ DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
char *, int, pem_password_cb *, void *);
int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
- char *kstr, int klen,
- pem_password_cb *cb, void *u);
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u);
int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
- char *kstr,int klen, pem_password_cb *cd, void *u);
+ char *kstr,int klen, pem_password_cb *cd, void *u);
#endif /* SSLEAY_MACROS */
@@ -686,53 +727,52 @@ void ERR_load_PEM_strings(void);
/* Error codes for the PEM functions. */
/* Function codes. */
-#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
-#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
-#define PEM_F_DO_PK8PKEY 126
-#define PEM_F_DO_PK8PKEY_FP 125
-#define PEM_F_LOAD_IV 101
-#define PEM_F_PEM_ASN1_READ 102
-#define PEM_F_PEM_ASN1_READ_BIO 103
-#define PEM_F_PEM_ASN1_WRITE 104
-#define PEM_F_PEM_ASN1_WRITE_BIO 105
-#define PEM_F_PEM_DEF_CALLBACK 100
-#define PEM_F_PEM_DO_HEADER 106
-#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
-#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
-#define PEM_F_PEM_PK8PKEY 119
-#define PEM_F_PEM_READ 108
-#define PEM_F_PEM_READ_BIO 109
-#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
-#define PEM_F_PEM_READ_PRIVATEKEY 124
-#define PEM_F_PEM_SEALFINAL 110
-#define PEM_F_PEM_SEALINIT 111
-#define PEM_F_PEM_SIGNFINAL 112
-#define PEM_F_PEM_WRITE 113
-#define PEM_F_PEM_WRITE_BIO 114
-#define PEM_F_PEM_X509_INFO_READ 115
-#define PEM_F_PEM_X509_INFO_READ_BIO 116
-#define PEM_F_PEM_X509_INFO_WRITE_BIO 117
+#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
+#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
+#define PEM_F_DO_PK8PKEY 126
+#define PEM_F_DO_PK8PKEY_FP 125
+#define PEM_F_LOAD_IV 101
+#define PEM_F_PEM_ASN1_READ 102
+#define PEM_F_PEM_ASN1_READ_BIO 103
+#define PEM_F_PEM_ASN1_WRITE 104
+#define PEM_F_PEM_ASN1_WRITE_BIO 105
+#define PEM_F_PEM_DEF_CALLBACK 100
+#define PEM_F_PEM_DO_HEADER 106
+#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
+#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
+#define PEM_F_PEM_PK8PKEY 119
+#define PEM_F_PEM_READ 108
+#define PEM_F_PEM_READ_BIO 109
+#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
+#define PEM_F_PEM_READ_PRIVATEKEY 124
+#define PEM_F_PEM_SEALFINAL 110
+#define PEM_F_PEM_SEALINIT 111
+#define PEM_F_PEM_SIGNFINAL 112
+#define PEM_F_PEM_WRITE 113
+#define PEM_F_PEM_WRITE_BIO 114
+#define PEM_F_PEM_X509_INFO_READ 115
+#define PEM_F_PEM_X509_INFO_READ_BIO 116
+#define PEM_F_PEM_X509_INFO_WRITE_BIO 117
/* Reason codes. */
-#define PEM_R_BAD_BASE64_DECODE 100
-#define PEM_R_BAD_DECRYPT 101
-#define PEM_R_BAD_END_LINE 102
-#define PEM_R_BAD_IV_CHARS 103
-#define PEM_R_BAD_PASSWORD_READ 104
-#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
-#define PEM_R_NOT_DEK_INFO 105
-#define PEM_R_NOT_ENCRYPTED 106
-#define PEM_R_NOT_PROC_TYPE 107
-#define PEM_R_NO_START_LINE 108
-#define PEM_R_PROBLEMS_GETTING_PASSWORD 109
-#define PEM_R_PUBLIC_KEY_NO_RSA 110
-#define PEM_R_READ_KEY 111
-#define PEM_R_SHORT_HEADER 112
-#define PEM_R_UNSUPPORTED_CIPHER 113
-#define PEM_R_UNSUPPORTED_ENCRYPTION 114
+#define PEM_R_BAD_BASE64_DECODE 100
+#define PEM_R_BAD_DECRYPT 101
+#define PEM_R_BAD_END_LINE 102
+#define PEM_R_BAD_IV_CHARS 103
+#define PEM_R_BAD_PASSWORD_READ 104
+#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
+#define PEM_R_NOT_DEK_INFO 105
+#define PEM_R_NOT_ENCRYPTED 106
+#define PEM_R_NOT_PROC_TYPE 107
+#define PEM_R_NO_START_LINE 108
+#define PEM_R_PROBLEMS_GETTING_PASSWORD 109
+#define PEM_R_PUBLIC_KEY_NO_RSA 110
+#define PEM_R_READ_KEY 111
+#define PEM_R_SHORT_HEADER 112
+#define PEM_R_UNSUPPORTED_CIPHER 113
+#define PEM_R_UNSUPPORTED_ENCRYPTION 114
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/pkcs12.h b/dep/include/openssl/pkcs12.h
index c20eff06baf..4bee605dc0d 100644
--- a/dep/include/openssl/pkcs12.h
+++ b/dep/include/openssl/pkcs12.h
@@ -1,5 +1,5 @@
/* pkcs12.h */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
/* ====================================================================
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -66,18 +66,18 @@
extern "C" {
#endif
-#define PKCS12_KEY_ID 1
-#define PKCS12_IV_ID 2
-#define PKCS12_MAC_ID 3
+#define PKCS12_KEY_ID 1
+#define PKCS12_IV_ID 2
+#define PKCS12_MAC_ID 3
/* Default iteration count */
#ifndef PKCS12_DEFAULT_ITER
-#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
+#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
#endif
#define PKCS12_MAC_KEY_LENGTH 20
-#define PKCS12_SALT_LEN 8
+#define PKCS12_SALT_LEN 8
/* Uncomment out next line for unicode password and names, otherwise ASCII */
@@ -93,13 +93,13 @@ extern "C" {
/* MS key usage constants */
-#define KEY_EX 0x10
+#define KEY_EX 0x10
#define KEY_SIG 0x80
typedef struct {
X509_SIG *dinfo;
ASN1_OCTET_STRING *salt;
-ASN1_INTEGER *iter; /* defaults to 1 */
+ASN1_INTEGER *iter; /* defaults to 1 */
} PKCS12_MAC_DATA;
typedef struct {
@@ -113,11 +113,11 @@ PREDECLARE_STACK_OF(PKCS12_SAFEBAG)
typedef struct {
ASN1_OBJECT *type;
union {
- struct pkcs12_bag_st *bag; /* secret, crl and certbag */
- struct pkcs8_priv_key_info_st *keybag; /* keybag */
- X509_SIG *shkeybag; /* shrouded key bag */
- STACK_OF(PKCS12_SAFEBAG) *safes;
- ASN1_TYPE *other;
+ struct pkcs12_bag_st *bag; /* secret, crl and certbag */
+ struct pkcs8_priv_key_info_st *keybag; /* keybag */
+ X509_SIG *shkeybag; /* shrouded key bag */
+ STACK_OF(PKCS12_SAFEBAG) *safes;
+ ASN1_TYPE *other;
}value;
STACK_OF(X509_ATTRIBUTE) *attrib;
} PKCS12_SAFEBAG;
@@ -129,16 +129,16 @@ DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)
typedef struct pkcs12_bag_st {
ASN1_OBJECT *type;
union {
- ASN1_OCTET_STRING *x509cert;
- ASN1_OCTET_STRING *x509crl;
- ASN1_OCTET_STRING *octet;
- ASN1_IA5STRING *sdsicert;
- ASN1_TYPE *other; /* Secret or other bag */
+ ASN1_OCTET_STRING *x509cert;
+ ASN1_OCTET_STRING *x509crl;
+ ASN1_OCTET_STRING *octet;
+ ASN1_IA5STRING *sdsicert;
+ ASN1_TYPE *other; /* Secret or other bag */
}value;
} PKCS12_BAGS;
-#define PKCS12_ERROR 0
-#define PKCS12_OK 1
+#define PKCS12_ERROR 0
+#define PKCS12_OK 1
/* Compatibility macros */
@@ -146,7 +146,7 @@ union {
#define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag
#define M_PKCS12_certbag2x509 PKCS12_certbag2x509
-#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl
+#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl
#define M_PKCS12_unpack_p7data PKCS12_unpack_p7data
#define M_PKCS12_pack_authsafes PKCS12_pack_authsafes
@@ -161,10 +161,10 @@ union {
#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
#define PKCS12_get_attr(bag, attr_nid) \
- PKCS12_get_attr_gen(bag->attrib, attr_nid)
+ PKCS12_get_attr_gen(bag->attrib, attr_nid)
#define PKCS8_get_attr(p8, attr_nid) \
- PKCS12_get_attr_gen(p8->attributes, attr_nid)
+ PKCS12_get_attr_gen(p8->attributes, attr_nid)
#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)
@@ -175,24 +175,24 @@ X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);
PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1,
- int nid2);
+ int nid2);
PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen);
PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass,
- int passlen);
-X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
- const char *pass, int passlen,
- unsigned char *salt, int saltlen, int iter,
- PKCS8_PRIV_KEY_INFO *p8);
+ int passlen);
+X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
+ const char *pass, int passlen,
+ unsigned char *salt, int saltlen, int iter,
+ PKCS8_PRIV_KEY_INFO *p8);
PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
- int passlen, unsigned char *salt,
- int saltlen, int iter,
- PKCS8_PRIV_KEY_INFO *p8);
+ int passlen, unsigned char *salt,
+ int saltlen, int iter,
+ PKCS8_PRIV_KEY_INFO *p8);
PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
- unsigned char *salt, int saltlen, int iter,
- STACK_OF(PKCS12_SAFEBAG) *bags);
+ unsigned char *salt, int saltlen, int iter,
+ STACK_OF(PKCS12_SAFEBAG) *bags);
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen);
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
@@ -200,38 +200,38 @@ STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen);
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
- int namelen);
+ int namelen);
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
- int namelen);
+ int namelen);
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name,
- int namelen);
+ int namelen);
int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
- int passlen, unsigned char *in, int inlen,
- unsigned char **data, int *datalen, int en_de);
+ int passlen, unsigned char *in, int inlen,
+ unsigned char **data, int *datalen, int en_de);
void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
- const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf);
+ const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it,
- const char *pass, int passlen,
- void *obj, int zbuf);
+ const char *pass, int passlen,
+ void *obj, int zbuf);
PKCS12 *PKCS12_init(int mode);
int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
- int saltlen, int id, int iter, int n,
- unsigned char *out, const EVP_MD *md_type);
+ int saltlen, int id, int iter, int n,
+ unsigned char *out, const EVP_MD *md_type);
int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type);
int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
- ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type,
- int en_de);
+ ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type,
+ int en_de);
int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
- unsigned char *mac, unsigned int *maclen);
+ unsigned char *mac, unsigned int *maclen);
int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
- unsigned char *salt, int saltlen, int iter,
- const EVP_MD *md_type);
+ unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *md_type);
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
- int saltlen, const EVP_MD *md_type);
+ int saltlen, const EVP_MD *md_type);
unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
char *uni2asc(unsigned char *uni, int unilen);
@@ -245,17 +245,17 @@ DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
void PKCS12_PBE_add(void);
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
- STACK_OF(X509) **ca);
+ STACK_OF(X509) **ca);
PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
- STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
- int mac_iter, int keytype);
+ STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
+ int mac_iter, int keytype);
PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key,
- int key_usage, int iter,
- int key_nid, char *pass);
+ int key_usage, int iter,
+ int key_nid, char *pass);
int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
- int safe_nid, int iter, char *pass);
+ int safe_nid, int iter, char *pass);
PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
@@ -273,62 +273,61 @@ void ERR_load_PKCS12_strings(void);
/* Error codes for the PKCS12 functions. */
/* Function codes. */
-#define PKCS12_F_PARSE_BAG 129
-#define PKCS12_F_PARSE_BAGS 103
-#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
-#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
-#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
-#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
-#define PKCS12_F_PKCS12_CREATE 105
-#define PKCS12_F_PKCS12_GEN_MAC 107
-#define PKCS12_F_PKCS12_INIT 109
-#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
-#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
-#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
-#define PKCS12_F_PKCS12_KEY_GEN_ASC 110
-#define PKCS12_F_PKCS12_KEY_GEN_UNI 111
-#define PKCS12_F_PKCS12_MAKE_KEYBAG 112
-#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
-#define PKCS12_F_PKCS12_NEWPASS 128
-#define PKCS12_F_PKCS12_PACK_P7DATA 114
-#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
-#define PKCS12_F_PKCS12_PARSE 118
-#define PKCS12_F_PKCS12_PBE_CRYPT 119
-#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
-#define PKCS12_F_PKCS12_SETUP_MAC 122
-#define PKCS12_F_PKCS12_SET_MAC 123
-#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
-#define PKCS12_F_PKCS12_UNPACK_P7DATA 131
-#define PKCS12_F_PKCS12_VERIFY_MAC 126
-#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
-#define PKCS12_F_PKCS8_ENCRYPT 125
+#define PKCS12_F_PARSE_BAG 129
+#define PKCS12_F_PARSE_BAGS 103
+#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
+#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
+#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
+#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
+#define PKCS12_F_PKCS12_CREATE 105
+#define PKCS12_F_PKCS12_GEN_MAC 107
+#define PKCS12_F_PKCS12_INIT 109
+#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
+#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
+#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
+#define PKCS12_F_PKCS12_KEY_GEN_ASC 110
+#define PKCS12_F_PKCS12_KEY_GEN_UNI 111
+#define PKCS12_F_PKCS12_MAKE_KEYBAG 112
+#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
+#define PKCS12_F_PKCS12_NEWPASS 128
+#define PKCS12_F_PKCS12_PACK_P7DATA 114
+#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
+#define PKCS12_F_PKCS12_PARSE 118
+#define PKCS12_F_PKCS12_PBE_CRYPT 119
+#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
+#define PKCS12_F_PKCS12_SETUP_MAC 122
+#define PKCS12_F_PKCS12_SET_MAC 123
+#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
+#define PKCS12_F_PKCS12_UNPACK_P7DATA 131
+#define PKCS12_F_PKCS12_VERIFY_MAC 126
+#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
+#define PKCS12_F_PKCS8_ENCRYPT 125
/* Reason codes. */
-#define PKCS12_R_CANT_PACK_STRUCTURE 100
-#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
-#define PKCS12_R_DECODE_ERROR 101
-#define PKCS12_R_ENCODE_ERROR 102
-#define PKCS12_R_ENCRYPT_ERROR 103
-#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
-#define PKCS12_R_INVALID_NULL_ARGUMENT 104
-#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
-#define PKCS12_R_IV_GEN_ERROR 106
-#define PKCS12_R_KEY_GEN_ERROR 107
-#define PKCS12_R_MAC_ABSENT 108
-#define PKCS12_R_MAC_GENERATION_ERROR 109
-#define PKCS12_R_MAC_SETUP_ERROR 110
-#define PKCS12_R_MAC_STRING_SET_ERROR 111
-#define PKCS12_R_MAC_VERIFY_ERROR 112
-#define PKCS12_R_MAC_VERIFY_FAILURE 113
-#define PKCS12_R_PARSE_ERROR 114
-#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
-#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
-#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
-#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
-#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
+#define PKCS12_R_CANT_PACK_STRUCTURE 100
+#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
+#define PKCS12_R_DECODE_ERROR 101
+#define PKCS12_R_ENCODE_ERROR 102
+#define PKCS12_R_ENCRYPT_ERROR 103
+#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
+#define PKCS12_R_INVALID_NULL_ARGUMENT 104
+#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
+#define PKCS12_R_IV_GEN_ERROR 106
+#define PKCS12_R_KEY_GEN_ERROR 107
+#define PKCS12_R_MAC_ABSENT 108
+#define PKCS12_R_MAC_GENERATION_ERROR 109
+#define PKCS12_R_MAC_SETUP_ERROR 110
+#define PKCS12_R_MAC_STRING_SET_ERROR 111
+#define PKCS12_R_MAC_VERIFY_ERROR 112
+#define PKCS12_R_MAC_VERIFY_FAILURE 113
+#define PKCS12_R_PARSE_ERROR 114
+#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
+#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
+#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
+#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
+#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/pq_compat.h b/dep/include/openssl/pq_compat.h
index bd8928dc0e9..7b2c32725cd 100644
--- a/dep/include/openssl/pq_compat.h
+++ b/dep/include/openssl/pq_compat.h
@@ -1,7 +1,7 @@
/* crypto/pqueue/pqueue_compat.h */
-/*
+/*
* DTLS implementation written by Nagendra Modadugu
- * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
*/
/* ====================================================================
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
@@ -11,7 +11,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -57,10 +57,13 @@
*
*/
-#include "opensslconf.h"
+#ifndef HEADER_PQ_COMPAT_H
+#define HEADER_PQ_COMPAT_H
+
+#include <openssl/opensslconf.h>
#include <openssl/bn.h>
-/*
+/*
* The purpose of this header file is for supporting 64-bit integer
* manipulation on 32-bit (and lower) machines. Currently the only
* such environment is VMS, Utrix and those with smaller default integer
@@ -128,7 +131,7 @@
#define pq_64bit_assign(x, y) (*(x) = *(y))
#define pq_64bit_assign_word(x, y) (*(x) = y)
-#define pq_64bit_gt(x, y) (*(x) > *(y))
+#define pq_64bit_gt(x, y) (*(x) > *(y))
#define pq_64bit_eq(x, y) (*(x) == *(y))
#define pq_64bit_add_word(x, w) (*(x) = (*(x) + (w)))
#define pq_64bit_sub(r, x, y) (*(r) = (*(x) - *(y)))
@@ -146,3 +149,4 @@
} while(0)
#endif /* OPENSSL_SYS_VMS */
+#endif
diff --git a/dep/include/openssl/rand.h b/dep/include/openssl/rand.h
index ca1361dcf0b..ea89153cba3 100644
--- a/dep/include/openssl/rand.h
+++ b/dep/include/openssl/rand.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -72,21 +72,21 @@ extern "C" {
#endif
#if defined(OPENSSL_FIPS)
-#define FIPS_RAND_SIZE_T size_t
+#define FIPS_RAND_SIZE_T int
#endif
/* Already defined in ossl_typ.h */
/* typedef struct rand_meth_st RAND_METHOD; */
struct rand_meth_st
- {
- void (*seed)(const void *buf, int num);
- int (*bytes)(unsigned char *buf, int num);
- void (*cleanup)(void);
- void (*add)(const void *buf, int num, double entropy);
- int (*pseudorand)(unsigned char *buf, int num);
- int (*status)(void);
- };
+ {
+ void (*seed)(const void *buf, int num);
+ int (*bytes)(unsigned char *buf, int num);
+ void (*cleanup)(void);
+ void (*add)(const void *buf, int num, double entropy);
+ int (*pseudorand)(unsigned char *buf, int num);
+ int (*status)(void);
+ };
#ifdef BN_DEBUG
extern int rand_predictable;
@@ -111,6 +111,15 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
int RAND_egd(const char *path);
int RAND_egd_bytes(const char *path,int bytes);
int RAND_poll(void);
+#ifndef OPENSSL_NO_ENGINE
+#ifdef OPENSSL_FIPS
+void int_RAND_init_engine_callbacks(void);
+void int_RAND_set_callbacks(
+ int (*set_rand_func)(const RAND_METHOD *meth,
+ const RAND_METHOD **pmeth),
+ const RAND_METHOD *(*get_rand_func)(const RAND_METHOD **pmeth));
+#endif
+#endif
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
@@ -128,14 +137,31 @@ void ERR_load_RAND_strings(void);
/* Error codes for the RAND functions. */
/* Function codes. */
-#define RAND_F_RAND_GET_RAND_METHOD 101
-#define RAND_F_SSLEAY_RAND_BYTES 100
+#define RAND_F_ENG_RAND_GET_RAND_METHOD 108
+#define RAND_F_FIPS_RAND 103
+#define RAND_F_FIPS_RAND_BYTES 102
+#define RAND_F_FIPS_RAND_GET_RAND_METHOD 109
+#define RAND_F_FIPS_RAND_SET_DT 106
+#define RAND_F_FIPS_SET_DT 104
+#define RAND_F_FIPS_SET_PRNG_SEED 107
+#define RAND_F_FIPS_SET_TEST_MODE 105
+#define RAND_F_RAND_GET_RAND_METHOD 101
+#define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
-#define RAND_R_PRNG_NOT_SEEDED 100
+#define RAND_R_NON_FIPS_METHOD 105
+#define RAND_R_NOT_IN_TEST_MODE 106
+#define RAND_R_NO_KEY_SET 107
+#define RAND_R_PRNG_ASKING_FOR_TOO_MUCH 101
+#define RAND_R_PRNG_ERROR 108
+#define RAND_R_PRNG_KEYED 109
+#define RAND_R_PRNG_NOT_REKEYED 102
+#define RAND_R_PRNG_NOT_RESEEDED 103
+#define RAND_R_PRNG_NOT_SEEDED 100
+#define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 110
+#define RAND_R_PRNG_STUCK 104
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/rc2.h b/dep/include/openssl/rc2.h
index 194948e62fa..e542ec94ffb 100644
--- a/dep/include/openssl/rc2.h
+++ b/dep/include/openssl/rc2.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -64,39 +64,40 @@
#error RC2 is disabled.
#endif
-#define RC2_ENCRYPT 1
-#define RC2_DECRYPT 0
+#define RC2_ENCRYPT 1
+#define RC2_DECRYPT 0
-#define RC2_BLOCK 8
-#define RC2_KEY_LENGTH 16
+#define RC2_BLOCK 8
+#define RC2_KEY_LENGTH 16
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rc2_key_st
- {
- RC2_INT data[64];
- } RC2_KEY;
-
+ {
+ RC2_INT data[64];
+ } RC2_KEY;
+#ifdef OPENSSL_FIPS
+void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
+#endif
void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
- int enc);
+ int enc);
void RC2_encrypt(unsigned long *data,RC2_KEY *key);
void RC2_decrypt(unsigned long *data,RC2_KEY *key);
void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
- RC2_KEY *ks, unsigned char *iv, int enc);
+ RC2_KEY *ks, unsigned char *iv, int enc);
void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, RC2_KEY *schedule, unsigned char *ivec,
- int *num, int enc);
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num, int enc);
void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, RC2_KEY *schedule, unsigned char *ivec,
- int *num);
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/rc4.h b/dep/include/openssl/rc4.h
index 7a08e80b07a..2d8620d33b9 100644
--- a/dep/include/openssl/rc4.h
+++ b/dep/include/openssl/rc4.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -69,20 +69,22 @@ extern "C" {
#endif
typedef struct rc4_key_st
- {
- RC4_INT x,y;
- RC4_INT data[256];
- } RC4_KEY;
-
+ {
+ RC4_INT x,y;
+ RC4_INT data[256];
+ } RC4_KEY;
+
const char *RC4_options(void);
+#ifdef OPENSSL_FIPS
+void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
+#endif
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
- unsigned char *outdata);
+ unsigned char *outdata);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/rc5.h b/dep/include/openssl/rc5.h
deleted file mode 100644
index e242657121f..00000000000
--- a/dep/include/openssl/rc5.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* crypto/rc5/rc5.h */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef HEADER_RC5_H
-#define HEADER_RC5_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef OPENSSL_NO_RC5
-#error RC5 is disabled.
-#endif
-
-#define RC5_ENCRYPT 1
-#define RC5_DECRYPT 0
-
-/* 32 bit. For Alpha, things may get weird */
-#define RC5_32_INT unsigned long
-
-#define RC5_32_BLOCK 8
-#define RC5_32_KEY_LENGTH 16 /* This is a default, max is 255 */
-
-/* This are the only values supported. Tweak the code if you want more
- * The most supported modes will be
- * RC5-32/12/16
- * RC5-32/16/8
- */
-#define RC5_8_ROUNDS 8
-#define RC5_12_ROUNDS 12
-#define RC5_16_ROUNDS 16
-
-typedef struct rc5_key_st
- {
- /* Number of rounds */
- int rounds;
- RC5_32_INT data[2*(RC5_16_ROUNDS+1)];
- } RC5_32_KEY;
-
-
-void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
- int rounds);
-void RC5_32_ecb_encrypt(const unsigned char *in,unsigned char *out,RC5_32_KEY *key,
- int enc);
-void RC5_32_encrypt(unsigned long *data,RC5_32_KEY *key);
-void RC5_32_decrypt(unsigned long *data,RC5_32_KEY *key);
-void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
- long length, RC5_32_KEY *ks, unsigned char *iv,
- int enc);
-void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, RC5_32_KEY *schedule,
- unsigned char *ivec, int *num, int enc);
-void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
- long length, RC5_32_KEY *schedule,
- unsigned char *ivec, int *num);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/dep/include/openssl/ripemd.h b/dep/include/openssl/ripemd.h
index 74a715a5db5..3b6d04386d4 100644
--- a/dep/include/openssl/ripemd.h
+++ b/dep/include/openssl/ripemd.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -79,27 +79,28 @@ extern "C" {
#define RIPEMD160_LONG unsigned int
#endif
-#define RIPEMD160_CBLOCK 64
-#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
-#define RIPEMD160_DIGEST_LENGTH 20
+#define RIPEMD160_CBLOCK 64
+#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
+#define RIPEMD160_DIGEST_LENGTH 20
typedef struct RIPEMD160state_st
- {
- RIPEMD160_LONG A,B,C,D,E;
- RIPEMD160_LONG Nl,Nh;
- RIPEMD160_LONG data[RIPEMD160_LBLOCK];
- unsigned int num;
- } RIPEMD160_CTX;
-
+ {
+ RIPEMD160_LONG A,B,C,D,E;
+ RIPEMD160_LONG Nl,Nh;
+ RIPEMD160_LONG data[RIPEMD160_LBLOCK];
+ unsigned int num;
+ } RIPEMD160_CTX;
+#ifdef OPENSSL_FIPS
+int private_RIPEMD160_Init(RIPEMD160_CTX *c);
+#endif
int RIPEMD160_Init(RIPEMD160_CTX *c);
int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
unsigned char *RIPEMD160(const unsigned char *d, size_t n,
- unsigned char *md);
+ unsigned char *md);
void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/rsa.h b/dep/include/openssl/rsa.h
index 91b21260732..5bb932ae15f 100644
--- a/dep/include/openssl/rsa.h
+++ b/dep/include/openssl/rsa.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -74,6 +74,25 @@
#error RSA is disabled.
#endif
+/* If this flag is set the RSA method is FIPS compliant and can be used
+ * in FIPS mode. This is set in the validated module method. If an
+ * application sets this flag in its own methods it is its reposibility
+ * to ensure the result is compliant.
+ */
+
+#define RSA_FLAG_FIPS_METHOD 0x0400
+
+/* If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef OPENSSL_FIPS
+#define FIPS_RSA_SIZE_T int
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -83,28 +102,28 @@ extern "C" {
/* typedef struct rsa_meth_st RSA_METHOD; */
struct rsa_meth_st
- {
- const char *name;
- int (*rsa_pub_enc)(int flen,const unsigned char *from,
- unsigned char *to,
- RSA *rsa,int padding);
- int (*rsa_pub_dec)(int flen,const unsigned char *from,
- unsigned char *to,
- RSA *rsa,int padding);
- int (*rsa_priv_enc)(int flen,const unsigned char *from,
- unsigned char *to,
- RSA *rsa,int padding);
- int (*rsa_priv_dec)(int flen,const unsigned char *from,
- unsigned char *to,
- RSA *rsa,int padding);
- int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
- int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx,
- BN_MONT_CTX *m_ctx); /* Can be null */
- int (*init)(RSA *rsa); /* called at new */
- int (*finish)(RSA *rsa); /* called at free */
- int flags; /* RSA_METHOD_FLAG_* things */
- char *app_data; /* may be needed! */
+ {
+ const char *name;
+ int (*rsa_pub_enc)(int flen,const unsigned char *from,
+ unsigned char *to,
+ RSA *rsa,int padding);
+ int (*rsa_pub_dec)(int flen,const unsigned char *from,
+ unsigned char *to,
+ RSA *rsa,int padding);
+ int (*rsa_priv_enc)(int flen,const unsigned char *from,
+ unsigned char *to,
+ RSA *rsa,int padding);
+ int (*rsa_priv_dec)(int flen,const unsigned char *from,
+ unsigned char *to,
+ RSA *rsa,int padding);
+ int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
+ int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx); /* Can be null */
+ int (*init)(RSA *rsa); /* called at new */
+ int (*finish)(RSA *rsa); /* called at free */
+ int flags; /* RSA_METHOD_FLAG_* things */
+ char *app_data; /* may be needed! */
/* New sign and verify functions: some libraries don't allow arbitrary data
* to be signed/verified: this allows them to be used. Note: for this to work
* the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used
@@ -112,136 +131,162 @@ struct rsa_meth_st
* compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
* option is set in 'flags'.
*/
- int (*rsa_sign)(int type,
- const unsigned char *m, unsigned int m_length,
- unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
- int (*rsa_verify)(int dtype,
- const unsigned char *m, unsigned int m_length,
- unsigned char *sigbuf, unsigned int siglen, const RSA *rsa);
+ int (*rsa_sign)(int type,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
+ int (*rsa_verify)(int dtype,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigbuf, unsigned int siglen, const RSA *rsa);
/* If this callback is NULL, the builtin software RSA key-gen will be used. This
* is for behavioural compatibility whilst the code gets rewired, but one day
* it would be nice to assume there are no such things as "builtin software"
* implementations. */
- int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
- };
+ int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+ };
struct rsa_st
- {
- /* The first parameter is used to pickup errors where
- * this is passed instead of aEVP_PKEY, it is set to 0 */
- int pad;
- long version;
- const RSA_METHOD *meth;
- /* functional reference if 'meth' is ENGINE-provided */
- ENGINE *engine;
- BIGNUM *n;
- BIGNUM *e;
- BIGNUM *d;
- BIGNUM *p;
- BIGNUM *q;
- BIGNUM *dmp1;
- BIGNUM *dmq1;
- BIGNUM *iqmp;
- /* be careful using this if the RSA structure is shared */
- CRYPTO_EX_DATA ex_data;
- int references;
- int flags;
-
- /* Used to cache montgomery values */
- BN_MONT_CTX *_method_mod_n;
- BN_MONT_CTX *_method_mod_p;
- BN_MONT_CTX *_method_mod_q;
-
- /* all BIGNUM values are actually in the following data, if it is not
- * NULL */
- char *bignum_data;
- BN_BLINDING *blinding;
- BN_BLINDING *mt_blinding;
- };
+ {
+ /* The first parameter is used to pickup errors where
+ * this is passed instead of aEVP_PKEY, it is set to 0 */
+ int pad;
+ long version;
+ const RSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+ BIGNUM *n;
+ BIGNUM *e;
+ BIGNUM *d;
+ BIGNUM *p;
+ BIGNUM *q;
+ BIGNUM *dmp1;
+ BIGNUM *dmq1;
+ BIGNUM *iqmp;
+ /* be careful using this if the RSA structure is shared */
+ CRYPTO_EX_DATA ex_data;
+ int references;
+ int flags;
+
+ /* Used to cache montgomery values */
+ BN_MONT_CTX *_method_mod_n;
+ BN_MONT_CTX *_method_mod_p;
+ BN_MONT_CTX *_method_mod_q;
+
+ /* all BIGNUM values are actually in the following data, if it is not
+ * NULL */
+ char *bignum_data;
+ BN_BLINDING *blinding;
+ BN_BLINDING *mt_blinding;
+ };
#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
-# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
+# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
#endif
+#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 1024
+
#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
-# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
+# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
#endif
#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
-# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */
+# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */
#endif
-#define RSA_3 0x3L
-#define RSA_F4 0x10001L
+#define RSA_3 0x3L
+#define RSA_F4 0x10001L
-#define RSA_METHOD_FLAG_NO_CHECK 0x0001 /* don't check pub/private match */
+#define RSA_METHOD_FLAG_NO_CHECK 0x0001 /* don't check pub/private match */
-#define RSA_FLAG_CACHE_PUBLIC 0x0002
-#define RSA_FLAG_CACHE_PRIVATE 0x0004
-#define RSA_FLAG_BLINDING 0x0008
-#define RSA_FLAG_THREAD_SAFE 0x0010
+#define RSA_FLAG_CACHE_PUBLIC 0x0002
+#define RSA_FLAG_CACHE_PRIVATE 0x0004
+#define RSA_FLAG_BLINDING 0x0008
+#define RSA_FLAG_THREAD_SAFE 0x0010
/* This flag means the private key operations will be handled by rsa_mod_exp
* and that they do not depend on the private key components being present:
* for example a key stored in external hardware. Without this flag bn_mod_exp
* gets called when private key components are absent.
*/
-#define RSA_FLAG_EXT_PKEY 0x0020
+#define RSA_FLAG_EXT_PKEY 0x0020
/* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions.
*/
-#define RSA_FLAG_SIGN_VER 0x0040
+#define RSA_FLAG_SIGN_VER 0x0040
-#define RSA_FLAG_NO_BLINDING 0x0080 /* new with 0.9.6j and 0.9.7b; the built-in
+#define RSA_FLAG_NO_BLINDING 0x0080 /* new with 0.9.6j and 0.9.7b; the built-in
* RSA implementation now uses blinding by
* default (ignoring RSA_FLAG_BLINDING),
* but other engines might not need it
*/
-#define RSA_FLAG_NO_EXP_CONSTTIME 0x0100 /* new with 0.9.7h; the built-in RSA
+#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA
+ * implementation now uses constant time
+ * operations by default in private key operations,
+ * e.g., constant time modular exponentiation,
+ * modular inverse without leaking branches,
+ * division without leaking branches. This
+ * flag disables these constant time
+ * operations and results in faster RSA
+ * private key operations.
+ */
+#ifndef OPENSSL_NO_DEPRECATED
+#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/
+ /* new with 0.9.7h; the built-in RSA
* implementation now uses constant time
* modular exponentiation for secret exponents
* by default. This flag causes the
* faster variable sliding window method to
* be used for all exponents.
*/
+#endif
-#define RSA_PKCS1_PADDING 1
-#define RSA_SSLV23_PADDING 2
-#define RSA_NO_PADDING 3
-#define RSA_PKCS1_OAEP_PADDING 4
-#define RSA_X931_PADDING 5
-#define RSA_PKCS1_PADDING_SIZE 11
+#define RSA_PKCS1_PADDING 1
+#define RSA_SSLV23_PADDING 2
+#define RSA_NO_PADDING 3
+#define RSA_PKCS1_OAEP_PADDING 4
+#define RSA_X931_PADDING 5
+
+#define RSA_PKCS1_PADDING_SIZE 11
#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
-RSA * RSA_new(void);
-RSA * RSA_new_method(ENGINE *engine);
-int RSA_size(const RSA *);
+RSA * RSA_new(void);
+RSA * RSA_new_method(ENGINE *engine);
+int RSA_size(const RSA *);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
-RSA * RSA_generate_key(int bits, unsigned long e,void
- (*callback)(int,int,void *),void *cb_arg);
+RSA * RSA_generate_key(int bits, unsigned long e,void
+ (*callback)(int,int,void *),void *cb_arg);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* New version */
-int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
-
-int RSA_check_key(const RSA *);
- /* next 4 return -1 on error */
-int RSA_public_encrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa,int padding);
-int RSA_private_encrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa,int padding);
-int RSA_public_decrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa,int padding);
-int RSA_private_decrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa,int padding);
-void RSA_free (RSA *r);
+int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, BIGNUM *q2,
+ const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *Xp,
+ const BIGNUM *Xq1, const BIGNUM *Xq2, const BIGNUM *Xq,
+ const BIGNUM *e, BN_GENCB *cb);
+int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb);
+
+int RSA_check_key(const RSA *);
+ /* next 4 return -1 on error */
+int RSA_public_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa,int padding);
+int RSA_private_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa,int padding);
+int RSA_public_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa,int padding);
+int RSA_private_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa,int padding);
+void RSA_free (RSA *r);
/* "up" the RSA object's reference count */
-int RSA_up_ref(RSA *r);
+int RSA_up_ref(RSA *r);
+
+int RSA_flags(const RSA *r);
-int RSA_flags(const RSA *r);
+#ifdef OPENSSL_FIPS
+RSA *FIPS_rsa_new(void);
+void FIPS_rsa_free(RSA *r);
+#endif
void RSA_set_default_method(const RSA_METHOD *meth);
const RSA_METHOD *RSA_get_default_method(void);
@@ -260,85 +305,87 @@ DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
#ifndef OPENSSL_NO_FP_API
-int RSA_print_fp(FILE *fp, const RSA *r,int offset);
+int RSA_print_fp(FILE *fp, const RSA *r,int offset);
#endif
#ifndef OPENSSL_NO_BIO
-int RSA_print(BIO *bp, const RSA *r,int offset);
+int RSA_print(BIO *bp, const RSA *r,int offset);
#endif
+#ifndef OPENSSL_NO_RC4
int i2d_RSA_NET(const RSA *a, unsigned char **pp,
- int (*cb)(char *buf, int len, const char *prompt, int verify),
- int sgckey);
+ int (*cb)(char *buf, int len, const char *prompt, int verify),
+ int sgckey);
RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
- int (*cb)(char *buf, int len, const char *prompt, int verify),
- int sgckey);
+ int (*cb)(char *buf, int len, const char *prompt, int verify),
+ int sgckey);
int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
- int (*cb)(char *buf, int len, const char *prompt,
- int verify));
+ int (*cb)(char *buf, int len, const char *prompt,
+ int verify));
RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
- int (*cb)(char *buf, int len, const char *prompt,
- int verify));
+ int (*cb)(char *buf, int len, const char *prompt,
+ int verify));
+#endif
/* The following 2 functions sign and verify a X509_SIG ASN1 object
* inside PKCS#1 padded RSA encryption */
int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
- unsigned char *sigret, unsigned int *siglen, RSA *rsa);
+ unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
- unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
+ unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
/* The following 2 function sign and verify a ASN1_OCTET_STRING
* object inside PKCS#1 padded RSA encryption */
int RSA_sign_ASN1_OCTET_STRING(int type,
- const unsigned char *m, unsigned int m_length,
- unsigned char *sigret, unsigned int *siglen, RSA *rsa);
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify_ASN1_OCTET_STRING(int type,
- const unsigned char *m, unsigned int m_length,
- unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
void RSA_blinding_off(RSA *rsa);
BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen,
- const unsigned char *f,int fl);
+ const unsigned char *f,int fl);
int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len);
+ const unsigned char *f,int fl,int rsa_len);
int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen,
- const unsigned char *f,int fl);
+ const unsigned char *f,int fl);
int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len);
+ const unsigned char *f,int fl,int rsa_len);
int PKCS1_MGF1(unsigned char *mask, long len,
- const unsigned char *seed, long seedlen, const EVP_MD *dgst);
+ const unsigned char *seed, long seedlen, const EVP_MD *dgst);
int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen,
- const unsigned char *f,int fl,
- const unsigned char *p,int pl);
+ const unsigned char *f,int fl,
+ const unsigned char *p,int pl);
int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len,
- const unsigned char *p,int pl);
+ const unsigned char *f,int fl,int rsa_len,
+ const unsigned char *p,int pl);
int RSA_padding_add_SSLv23(unsigned char *to,int tlen,
- const unsigned char *f,int fl);
+ const unsigned char *f,int fl);
int RSA_padding_check_SSLv23(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len);
+ const unsigned char *f,int fl,int rsa_len);
int RSA_padding_add_none(unsigned char *to,int tlen,
- const unsigned char *f,int fl);
+ const unsigned char *f,int fl);
int RSA_padding_check_none(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len);
+ const unsigned char *f,int fl,int rsa_len);
int RSA_padding_add_X931(unsigned char *to,int tlen,
- const unsigned char *f,int fl);
+ const unsigned char *f,int fl);
int RSA_padding_check_X931(unsigned char *to,int tlen,
- const unsigned char *f,int fl,int rsa_len);
+ const unsigned char *f,int fl,int rsa_len);
int RSA_X931_hash_id(int nid);
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
- const EVP_MD *Hash, const unsigned char *EM, int sLen);
+ const EVP_MD *Hash, const unsigned char *EM, int sLen);
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
- const unsigned char *mHash,
- const EVP_MD *Hash, int sLen);
+ const unsigned char *mHash,
+ const EVP_MD *Hash, int sLen);
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int RSA_set_ex_data(RSA *r,int idx,void *arg);
void *RSA_get_ex_data(const RSA *r, int idx);
@@ -354,89 +401,96 @@ void ERR_load_RSA_strings(void);
/* Error codes for the RSA functions. */
/* Function codes. */
-#define RSA_F_MEMORY_LOCK 100
-#define RSA_F_RSA_BUILTIN_KEYGEN 129
-#define RSA_F_RSA_CHECK_KEY 123
-#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101
-#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102
-#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
-#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
-#define RSA_F_RSA_GENERATE_KEY 105
-#define RSA_F_RSA_MEMORY_LOCK 130
-#define RSA_F_RSA_NEW_METHOD 106
-#define RSA_F_RSA_NULL 124
-#define RSA_F_RSA_NULL_MOD_EXP 131
-#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
-#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
-#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
-#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
-#define RSA_F_RSA_PADDING_ADD_NONE 107
-#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
-#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
-#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
-#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
-#define RSA_F_RSA_PADDING_ADD_SSLV23 110
-#define RSA_F_RSA_PADDING_ADD_X931 127
-#define RSA_F_RSA_PADDING_CHECK_NONE 111
-#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
-#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
-#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
-#define RSA_F_RSA_PADDING_CHECK_SSLV23 114
-#define RSA_F_RSA_PADDING_CHECK_X931 128
-#define RSA_F_RSA_PRINT 115
-#define RSA_F_RSA_PRINT_FP 116
-#define RSA_F_RSA_SETUP_BLINDING 136
-#define RSA_F_RSA_SIGN 117
-#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
-#define RSA_F_RSA_VERIFY 119
-#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
-#define RSA_F_RSA_VERIFY_PKCS1_PSS 126
+#define RSA_F_FIPS_RSA_SIGN 140
+#define RSA_F_FIPS_RSA_VERIFY 141
+#define RSA_F_MEMORY_LOCK 100
+#define RSA_F_RSA_BUILTIN_KEYGEN 129
+#define RSA_F_RSA_CHECK_KEY 123
+#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101
+#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102
+#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
+#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
+#define RSA_F_RSA_GENERATE_KEY 105
+#define RSA_F_RSA_MEMORY_LOCK 130
+#define RSA_F_RSA_NEW_METHOD 106
+#define RSA_F_RSA_NULL 124
+#define RSA_F_RSA_NULL_MOD_EXP 131
+#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
+#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
+#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
+#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
+#define RSA_F_RSA_PADDING_ADD_NONE 107
+#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
+#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
+#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
+#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
+#define RSA_F_RSA_PADDING_ADD_SSLV23 110
+#define RSA_F_RSA_PADDING_ADD_X931 127
+#define RSA_F_RSA_PADDING_CHECK_NONE 111
+#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
+#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
+#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
+#define RSA_F_RSA_PADDING_CHECK_SSLV23 114
+#define RSA_F_RSA_PADDING_CHECK_X931 128
+#define RSA_F_RSA_PRINT 115
+#define RSA_F_RSA_PRINT_FP 116
+#define RSA_F_RSA_PRIVATE_ENCRYPT 137
+#define RSA_F_RSA_PUBLIC_DECRYPT 138
+#define RSA_F_RSA_SETUP_BLINDING 136
+#define RSA_F_RSA_SET_DEFAULT_METHOD 139
+#define RSA_F_RSA_SET_METHOD 142
+#define RSA_F_RSA_SIGN 117
+#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
+#define RSA_F_RSA_VERIFY 119
+#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
+#define RSA_F_RSA_VERIFY_PKCS1_PSS 126
/* Reason codes. */
-#define RSA_R_ALGORITHM_MISMATCH 100
-#define RSA_R_BAD_E_VALUE 101
-#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
-#define RSA_R_BAD_PAD_BYTE_COUNT 103
-#define RSA_R_BAD_SIGNATURE 104
-#define RSA_R_BLOCK_TYPE_IS_NOT_01 106
-#define RSA_R_BLOCK_TYPE_IS_NOT_02 107
-#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
-#define RSA_R_DATA_TOO_LARGE 109
-#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
-#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
-#define RSA_R_DATA_TOO_SMALL 111
-#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
-#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
-#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
-#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
-#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
-#define RSA_R_FIRST_OCTET_INVALID 133
-#define RSA_R_INVALID_HEADER 137
-#define RSA_R_INVALID_MESSAGE_LENGTH 131
-#define RSA_R_INVALID_PADDING 138
-#define RSA_R_INVALID_TRAILER 139
-#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
-#define RSA_R_KEY_SIZE_TOO_SMALL 120
-#define RSA_R_LAST_OCTET_INVALID 134
-#define RSA_R_MODULUS_TOO_LARGE 105
-#define RSA_R_NO_PUBLIC_EXPONENT 140
-#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
-#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
-#define RSA_R_OAEP_DECODING_ERROR 121
-#define RSA_R_PADDING_CHECK_FAILED 114
-#define RSA_R_P_NOT_PRIME 128
-#define RSA_R_Q_NOT_PRIME 129
-#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
-#define RSA_R_SLEN_CHECK_FAILED 136
-#define RSA_R_SLEN_RECOVERY_FAILED 135
-#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
+#define RSA_R_ALGORITHM_MISMATCH 100
+#define RSA_R_BAD_E_VALUE 101
+#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
+#define RSA_R_BAD_PAD_BYTE_COUNT 103
+#define RSA_R_BAD_SIGNATURE 104
+#define RSA_R_BLOCK_TYPE_IS_NOT_01 106
+#define RSA_R_BLOCK_TYPE_IS_NOT_02 107
+#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
+#define RSA_R_DATA_TOO_LARGE 109
+#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
+#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
+#define RSA_R_DATA_TOO_SMALL 111
+#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
+#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
+#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
+#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
+#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
+#define RSA_R_FIRST_OCTET_INVALID 133
+#define RSA_R_INVALID_HEADER 137
+#define RSA_R_INVALID_MESSAGE_LENGTH 131
+#define RSA_R_INVALID_PADDING 138
+#define RSA_R_INVALID_TRAILER 139
+#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
+#define RSA_R_KEY_SIZE_TOO_SMALL 120
+#define RSA_R_LAST_OCTET_INVALID 134
+#define RSA_R_MODULUS_TOO_LARGE 105
+#define RSA_R_NON_FIPS_METHOD 141
+#define RSA_R_NO_PUBLIC_EXPONENT 140
+#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
+#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
+#define RSA_R_OAEP_DECODING_ERROR 121
+#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 142
+#define RSA_R_PADDING_CHECK_FAILED 114
+#define RSA_R_P_NOT_PRIME 128
+#define RSA_R_Q_NOT_PRIME 129
+#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
+#define RSA_R_SLEN_CHECK_FAILED 136
+#define RSA_R_SLEN_RECOVERY_FAILED 135
+#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
-#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
-#define RSA_R_UNKNOWN_PADDING_TYPE 118
-#define RSA_R_WRONG_SIGNATURE_LENGTH 119
+#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
+#define RSA_R_UNKNOWN_PADDING_TYPE 118
+#define RSA_R_WRONG_SIGNATURE_LENGTH 119
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/safestack.h b/dep/include/openssl/safestack.h
index 7cd19b229e9..40b17902e07 100644
--- a/dep/include/openssl/safestack.h
+++ b/dep/include/openssl/safestack.h
@@ -6,7 +6,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -57,11 +57,20 @@
#include <openssl/stack.h>
-typedef void (*openssl_fptr)(void);
-#define openssl_fcast(f) ((openssl_fptr)f)
-
#ifdef DEBUG_SAFESTACK
+#ifndef CHECKED_PTR_OF
+#define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+#endif
+
+#define CHECKED_SK_FREE_FUNC(type, p) \
+ ((void (*)(void *)) ((1 ? p : (void (*)(type *))0)))
+
+#define CHECKED_SK_CMP_FUNC(type, p) \
+ ((int (*)(const char * const *, const char * const *)) \
+ ((1 ? p : (int (*)(const type * const *, const type * const *))0)))
+
#define STACK_OF(type) struct stack_st_##type
#define PREDECLARE_STACK_OF(type) STACK_OF(type);
@@ -76,76 +85,71 @@ STACK_OF(type) \
/* SKM_sk_... stack macros are internal to safestack.h:
* never use them directly, use sk_<type>_... instead */
#define SKM_sk_new(type, cmp) \
- ((STACK_OF(type) * (*)(int (*)(const type * const *, const type * const *)))openssl_fcast(sk_new))(cmp)
+ ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp)))
#define SKM_sk_new_null(type) \
- ((STACK_OF(type) * (*)(void))openssl_fcast(sk_new_null))()
+ ((STACK_OF(type) *)sk_new_null())
#define SKM_sk_free(type, st) \
- ((void (*)(STACK_OF(type) *))openssl_fcast(sk_free))(st)
+ sk_free(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_num(type, st) \
- ((int (*)(const STACK_OF(type) *))openssl_fcast(sk_num))(st)
+ sk_num(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_value(type, st,i) \
- ((type * (*)(const STACK_OF(type) *, int))openssl_fcast(sk_value))(st, i)
+ ((type *)sk_value(CHECKED_PTR_OF(STACK_OF(type), st), i))
#define SKM_sk_set(type, st,i,val) \
- ((type * (*)(STACK_OF(type) *, int, type *))openssl_fcast(sk_set))(st, i, val)
+ sk_set(CHECKED_PTR_OF(STACK_OF(type), st), i, CHECKED_PTR_OF(type, val))
#define SKM_sk_zero(type, st) \
- ((void (*)(STACK_OF(type) *))openssl_fcast(sk_zero))(st)
+ sk_zero(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_push(type, st,val) \
- ((int (*)(STACK_OF(type) *, type *))openssl_fcast(sk_push))(st, val)
+ sk_push(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val))
#define SKM_sk_unshift(type, st,val) \
- ((int (*)(STACK_OF(type) *, type *))openssl_fcast(sk_unshift))(st, val)
+ sk_unshift(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val))
#define SKM_sk_find(type, st,val) \
- ((int (*)(STACK_OF(type) *, type *))openssl_fcast(sk_find))(st, val)
+ sk_find(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val))
#define SKM_sk_delete(type, st,i) \
- ((type * (*)(STACK_OF(type) *, int))openssl_fcast(sk_delete))(st, i)
+ (type *)sk_delete(CHECKED_PTR_OF(STACK_OF(type), st), i)
#define SKM_sk_delete_ptr(type, st,ptr) \
- ((type * (*)(STACK_OF(type) *, type *))openssl_fcast(sk_delete_ptr))(st, ptr)
+ (type *)sk_delete_ptr(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, ptr))
#define SKM_sk_insert(type, st,val,i) \
- ((int (*)(STACK_OF(type) *, type *, int))openssl_fcast(sk_insert))(st, val, i)
+ sk_insert(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val), i)
#define SKM_sk_set_cmp_func(type, st,cmp) \
- ((int (*(*)(STACK_OF(type) *, int (*)(const type * const *, const type * const *))) \
- (const type * const *, const type * const *))openssl_fcast(sk_set_cmp_func))\
- (st, cmp)
+ ((int (*)(const type * const *,const type * const *)) \
+ sk_set_cmp_func(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_CMP_FUNC(type, cmp)))
#define SKM_sk_dup(type, st) \
- ((STACK_OF(type) *(*)(STACK_OF(type) *))openssl_fcast(sk_dup))(st)
+ (STACK_OF(type) *)sk_dup(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_pop_free(type, st,free_func) \
- ((void (*)(STACK_OF(type) *, void (*)(type *)))openssl_fcast(sk_pop_free))\
- (st, free_func)
+ sk_pop_free(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_FREE_FUNC(type, free_func))
#define SKM_sk_shift(type, st) \
- ((type * (*)(STACK_OF(type) *))openssl_fcast(sk_shift))(st)
+ (type *)sk_shift(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_pop(type, st) \
- ((type * (*)(STACK_OF(type) *))openssl_fcast(sk_pop))(st)
+ (type *)sk_pop(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_sort(type, st) \
- ((void (*)(STACK_OF(type) *))openssl_fcast(sk_sort))(st)
+ sk_sort(CHECKED_PTR_OF(STACK_OF(type), st))
#define SKM_sk_is_sorted(type, st) \
- ((int (*)(const STACK_OF(type) *))openssl_fcast(sk_is_sorted))(st)
-
-#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
-((STACK_OF(type) * (*) (STACK_OF(type) **,const unsigned char **, long , \
- type *(*)(type **, const unsigned char **,long), \
- void (*)(type *), int ,int )) openssl_fcast(d2i_ASN1_SET)) \
- (st,pp,length, d2i_func, free_func, ex_tag,ex_class)
-#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
- ((int (*)(STACK_OF(type) *,unsigned char **, \
- int (*)(type *,unsigned char **), int , int , int)) openssl_fcast(i2d_ASN1_SET)) \
- (st,pp,i2d_func,ex_tag,ex_class,is_set)
-
-#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
- ((unsigned char *(*)(STACK_OF(type) *, \
- int (*)(type *,unsigned char **), unsigned char **,int *)) openssl_fcast(ASN1_seq_pack)) \
- (st, i2d_func, buf, len)
-#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
- ((STACK_OF(type) * (*)(const unsigned char *,int, \
- type *(*)(type **,const unsigned char **, long), \
- void (*)(type *)))openssl_fcast(ASN1_seq_unpack)) \
- (buf,len,d2i_func, free_func)
+ sk_is_sorted(CHECKED_PTR_OF(STACK_OF(type), st))
+
+#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ (STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), \
+ pp, length, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ ex_tag, ex_class)
+
+#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ i2d_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), pp, \
+ CHECKED_I2D_OF(type, i2d_func), \
+ ex_tag, ex_class, is_set)
+
+#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
+ ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \
+ CHECKED_I2D_OF(type, i2d_func), buf, len)
+
+#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
+ (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func))
#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
- ((STACK_OF(type) * (*)(X509_ALGOR *, \
- type *(*)(type **, const unsigned char **, long), \
- void (*)(type *), \
- const char *, int, \
- ASN1_STRING *, int))PKCS12_decrypt_d2i) \
- (algor,d2i_func,free_func,pass,passlen,oct,seq)
+ (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ pass, passlen, oct, seq)
#else
@@ -155,59 +159,59 @@ STACK_OF(type) \
#define IMPLEMENT_STACK_OF(type) /* nada */
#define SKM_sk_new(type, cmp) \
- sk_new((int (*)(const char * const *, const char * const *))(cmp))
+ sk_new((int (*)(const char * const *, const char * const *))(cmp))
#define SKM_sk_new_null(type) \
- sk_new_null()
+ sk_new_null()
#define SKM_sk_free(type, st) \
- sk_free(st)
+ sk_free(st)
#define SKM_sk_num(type, st) \
- sk_num(st)
+ sk_num(st)
#define SKM_sk_value(type, st,i) \
- ((type *)sk_value(st, i))
+ ((type *)sk_value(st, i))
#define SKM_sk_set(type, st,i,val) \
- ((type *)sk_set(st, i,(char *)val))
+ ((type *)sk_set(st, i,(char *)val))
#define SKM_sk_zero(type, st) \
- sk_zero(st)
+ sk_zero(st)
#define SKM_sk_push(type, st,val) \
- sk_push(st, (char *)val)
+ sk_push(st, (char *)val)
#define SKM_sk_unshift(type, st,val) \
- sk_unshift(st, val)
+ sk_unshift(st, (char *)val)
#define SKM_sk_find(type, st,val) \
- sk_find(st, (char *)val)
+ sk_find(st, (char *)val)
#define SKM_sk_delete(type, st,i) \
- ((type *)sk_delete(st, i))
+ ((type *)sk_delete(st, i))
#define SKM_sk_delete_ptr(type, st,ptr) \
- ((type *)sk_delete_ptr(st,(char *)ptr))
+ ((type *)sk_delete_ptr(st,(char *)ptr))
#define SKM_sk_insert(type, st,val,i) \
- sk_insert(st, (char *)val, i)
+ sk_insert(st, (char *)val, i)
#define SKM_sk_set_cmp_func(type, st,cmp) \
- ((int (*)(const type * const *,const type * const *)) \
- sk_set_cmp_func(st, (int (*)(const char * const *, const char * const *))(cmp)))
+ ((int (*)(const type * const *,const type * const *)) \
+ sk_set_cmp_func(st, (int (*)(const char * const *, const char * const *))(cmp)))
#define SKM_sk_dup(type, st) \
- sk_dup(st)
+ sk_dup(st)
#define SKM_sk_pop_free(type, st,free_func) \
- sk_pop_free(st, (void (*)(void *))free_func)
+ sk_pop_free(st, (void (*)(void *))free_func)
#define SKM_sk_shift(type, st) \
- ((type *)sk_shift(st))
+ ((type *)sk_shift(st))
#define SKM_sk_pop(type, st) \
- ((type *)sk_pop(st))
+ ((type *)sk_pop(st))
#define SKM_sk_sort(type, st) \
- sk_sort(st)
+ sk_sort(st)
#define SKM_sk_is_sorted(type, st) \
- sk_is_sorted(st)
+ sk_is_sorted(st)
-#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- d2i_ASN1_SET(st,pp,length, (void *(*)(void ** ,const unsigned char ** ,long))d2i_func, (void (*)(void *))free_func, ex_tag,ex_class)
-#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
- i2d_ASN1_SET(st,pp,(int (*)(void *, unsigned char **))i2d_func,ex_tag,ex_class,is_set)
+#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ d2i_ASN1_SET(st,pp,length, (void *(*)(void ** ,const unsigned char ** ,long))d2i_func, (void (*)(void *))free_func, ex_tag,ex_class)
+#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ i2d_ASN1_SET(st,pp,(int (*)(void *, unsigned char **))i2d_func,ex_tag,ex_class,is_set)
-#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
- ASN1_seq_pack(st, (int (*)(void *, unsigned char **))i2d_func, buf, len)
-#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
- ASN1_seq_unpack(buf,len,(void *(*)(void **,const unsigned char **,long))d2i_func, (void(*)(void *))free_func)
+#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
+ ASN1_seq_pack(st, (int (*)(void *, unsigned char **))i2d_func, buf, len)
+#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
+ ASN1_seq_unpack(buf,len,(void *(*)(void **,const unsigned char **,long))d2i_func, (void(*)(void *))free_func)
#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
- ((STACK *)PKCS12_decrypt_d2i(algor,(char *(*)())d2i_func, (void(*)(void *))free_func,pass,passlen,oct,seq))
+ ((STACK *)PKCS12_decrypt_d2i(algor,(char *(*)())d2i_func, (void(*)(void *))free_func,pass,passlen,oct,seq))
#endif
@@ -410,6 +414,94 @@ STACK_OF(type) \
#define sk_BIO_sort(st) SKM_sk_sort(BIO, (st))
#define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st))
+#define sk_CMS_CertificateChoices_new(st) SKM_sk_new(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices)
+#define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i))
+#define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val))
+#define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val))
+#define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val))
+#define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val))
+#define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val))
+#define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i))
+#define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr))
+#define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i))
+#define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp))
+#define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st)
+#define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func))
+#define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st))
+#define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st))
+
+#define sk_CMS_RecipientInfo_new(st) SKM_sk_new(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo)
+#define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i))
+#define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val))
+#define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val))
+#define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val))
+#define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val))
+#define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val))
+#define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i))
+#define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr))
+#define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i))
+#define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp))
+#define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st)
+#define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func))
+#define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st))
+#define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st))
+
+#define sk_CMS_RevocationInfoChoice_new(st) SKM_sk_new(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice)
+#define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i))
+#define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val))
+#define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val))
+#define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val))
+#define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val))
+#define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val))
+#define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i))
+#define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr))
+#define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i))
+#define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp))
+#define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st)
+#define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func))
+#define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st))
+#define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st))
+
+#define sk_CMS_SignerInfo_new(st) SKM_sk_new(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo)
+#define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i))
+#define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val))
+#define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val))
+#define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val))
+#define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val))
+#define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val))
+#define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i))
+#define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr))
+#define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i))
+#define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp))
+#define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st)
+#define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func))
+#define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st))
+#define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st))
+
#define sk_CONF_IMODULE_new(st) SKM_sk_new(CONF_IMODULE, (st))
#define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE)
#define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st))
@@ -608,6 +700,28 @@ STACK_OF(type) \
#define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st))
#define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st))
+#define sk_GENERAL_NAMES_new(st) SKM_sk_new(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES)
+#define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i))
+#define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val))
+#define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val))
+#define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val))
+#define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val))
+#define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val))
+#define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i))
+#define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr))
+#define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i))
+#define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp))
+#define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st)
+#define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func))
+#define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st))
+#define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st))
+
#define sk_GENERAL_SUBTREE_new(st) SKM_sk_new(GENERAL_SUBTREE, (st))
#define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE)
#define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st))
@@ -872,6 +986,50 @@ STACK_OF(type) \
#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
+#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st))
+#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)
+#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))
+#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))
+#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))
+#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))
+#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))
+#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))
+#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))
+#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))
+#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val))
+#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))
+#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))
+#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))
+#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))
+#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)
+#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))
+#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))
+#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))
+#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
+#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
+
+#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st))
+#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
+#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
+#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))
+#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))
+#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))
+#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))
+#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))
+#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))
+#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))
+#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val))
+#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))
+#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))
+#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))
+#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))
+#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)
+#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))
+#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))
+#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))
+#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))
+#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st))
+
#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st))
#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
@@ -960,6 +1118,28 @@ STACK_OF(type) \
#define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st))
#define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st))
+#define sk_OCSP_RESPID_new(st) SKM_sk_new(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID)
+#define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i))
+#define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val))
+#define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val))
+#define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val))
+#define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val))
+#define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val))
+#define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i))
+#define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr))
+#define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i))
+#define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp))
+#define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st)
+#define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func))
+#define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st))
+#define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st))
+
#define sk_OCSP_SINGLERESP_new(st) SKM_sk_new(OCSP_SINGLERESP, (st))
#define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP)
#define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st))
@@ -1643,209 +1823,208 @@ STACK_OF(type) \
#define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st))
#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))
#define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
- SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+ SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \
- SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+ SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \
- SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))
+ SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \
- SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))
+ SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))
#define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \
- SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+ SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
#define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \
- SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+ SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
/* End of util/mkstack.pl block, you may now edit :-) */
#endif /* !defined HEADER_SAFESTACK_H */
-
diff --git a/dep/include/openssl/sha.h b/dep/include/openssl/sha.h
index 299de706761..47a2c29f662 100644
--- a/dep/include/openssl/sha.h
+++ b/dep/include/openssl/sha.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -90,22 +90,25 @@ extern "C" {
#define SHA_LONG unsigned int
#endif
-#define SHA_LBLOCK 16
-#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a
- * contiguous array of 32 bit
- * wide big-endian values. */
+#define SHA_LBLOCK 16
+#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
#define SHA_LAST_BLOCK (SHA_CBLOCK-8)
#define SHA_DIGEST_LENGTH 20
typedef struct SHAstate_st
- {
- SHA_LONG h0,h1,h2,h3,h4;
- SHA_LONG Nl,Nh;
- SHA_LONG data[SHA_LBLOCK];
- unsigned int num;
- } SHA_CTX;
+ {
+ SHA_LONG h0,h1,h2,h3,h4;
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num;
+ } SHA_CTX;
#ifndef OPENSSL_NO_SHA0
+#ifdef OPENSSL_FIPS
+int private_SHA_Init(SHA_CTX *c);
+#endif
int SHA_Init(SHA_CTX *c);
int SHA_Update(SHA_CTX *c, const void *data, size_t len);
int SHA_Final(unsigned char *md, SHA_CTX *c);
@@ -120,19 +123,19 @@ unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
#endif
-#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a
- * contiguous array of 32 bit
- * wide big-endian values. */
-#define SHA224_DIGEST_LENGTH 28
-#define SHA256_DIGEST_LENGTH 32
+#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a
+ * contiguous array of 32 bit
+ * wide big-endian values. */
+#define SHA224_DIGEST_LENGTH 28
+#define SHA256_DIGEST_LENGTH 32
typedef struct SHA256state_st
- {
- SHA_LONG h[8];
- SHA_LONG Nl,Nh;
- SHA_LONG data[SHA_LBLOCK];
- unsigned int num,md_len;
- } SHA256_CTX;
+ {
+ SHA_LONG h[8];
+ SHA_LONG Nl,Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num,md_len;
+ } SHA256_CTX;
#ifndef OPENSSL_NO_SHA256
int SHA224_Init(SHA256_CTX *c);
@@ -146,8 +149,8 @@ unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md);
void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
#endif
-#define SHA384_DIGEST_LENGTH 48
-#define SHA512_DIGEST_LENGTH 64
+#define SHA384_DIGEST_LENGTH 48
+#define SHA512_DIGEST_LENGTH 64
#ifndef OPENSSL_NO_SHA512
/*
@@ -155,9 +158,9 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
* being exactly 64-bit wide. See Implementation Notes in sha512.c
* for further details.
*/
-#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a
- * contiguous array of 64 bit
- * wide big-endian values. */
+#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values. */
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
#define SHA_LONG64 unsigned __int64
#define U64(C) C##UI64
@@ -170,15 +173,15 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
#endif
typedef struct SHA512state_st
- {
- SHA_LONG64 h[8];
- SHA_LONG64 Nl,Nh;
- union {
- SHA_LONG64 d[SHA_LBLOCK];
- unsigned char p[SHA512_CBLOCK];
- } u;
- unsigned int num,md_len;
- } SHA512_CTX;
+ {
+ SHA_LONG64 h[8];
+ SHA_LONG64 Nl,Nh;
+ union {
+ SHA_LONG64 d[SHA_LBLOCK];
+ unsigned char p[SHA512_CBLOCK];
+ } u;
+ unsigned int num,md_len;
+ } SHA512_CTX;
#endif
#ifndef OPENSSL_NO_SHA512
@@ -198,4 +201,3 @@ void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
#endif
#endif
-
diff --git a/dep/include/openssl/ssl.h b/dep/include/openssl/ssl.h
index b461dcdb8ae..ff8a128d3c2 100644
--- a/dep/include/openssl/ssl.h
+++ b/dep/include/openssl/ssl.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -63,7 +63,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -116,7 +116,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -163,12 +163,12 @@
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECC cipher suite support in OpenSSL originally developed by
+ * ECC cipher suite support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
-#ifndef HEADER_SSL_H
-#define HEADER_SSL_H
+#ifndef HEADER_SSL_H
+#define HEADER_SSL_H
#include <openssl/e_os2.h>
@@ -187,6 +187,7 @@
#include <openssl/buffer.h>
#endif
#include <openssl/pem.h>
+#include <openssl/hmac.h>
#include <openssl/kssl.h>
#include <openssl/safestack.h>
@@ -203,16 +204,16 @@ extern "C" {
#define SSL_SESSION_ASN1_VERSION 0x0001
/* text strings for the ciphers */
-#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5
-#define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5
-#define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
-#define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5
-#define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
-#define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5
-#define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5
-#define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA
-#define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
-#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
+#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5
+#define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5
+#define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
+#define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5
+#define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
+#define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5
+#define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5
+#define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA
+#define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
+#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
/* VRS Additional Kerberos5 entries
*/
@@ -220,17 +221,17 @@ extern "C" {
#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
#define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA
#define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA
-#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
-#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
+#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
#define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5
-#define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
+#define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
-#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
-#define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA
-#define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA
-#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
-#define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5
-#define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5
+#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
+#define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA
+#define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA
+#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
+#define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5
+#define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5
#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
@@ -240,61 +241,63 @@ extern "C" {
#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
#define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256
-#define SSL_MAX_SSL_SESSION_ID_LENGTH 32
-#define SSL_MAX_SID_CTX_LENGTH 32
+#define SSL_MAX_SSL_SESSION_ID_LENGTH 32
+#define SSL_MAX_SID_CTX_LENGTH 32
-#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8)
-#define SSL_MAX_KEY_ARG_LENGTH 8
-#define SSL_MAX_MASTER_KEY_LENGTH 48
+#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8)
+#define SSL_MAX_KEY_ARG_LENGTH 8
+#define SSL_MAX_MASTER_KEY_LENGTH 48
/* These are used to specify which ciphers to use and not to use */
-#define SSL_TXT_LOW "LOW"
-#define SSL_TXT_MEDIUM "MEDIUM"
-#define SSL_TXT_HIGH "HIGH"
-#define SSL_TXT_kFZA "kFZA"
-#define SSL_TXT_aFZA "aFZA"
-#define SSL_TXT_eFZA "eFZA"
-#define SSL_TXT_FZA "FZA"
-
-#define SSL_TXT_aNULL "aNULL"
-#define SSL_TXT_eNULL "eNULL"
-#define SSL_TXT_NULL "NULL"
-
-#define SSL_TXT_kKRB5 "kKRB5"
-#define SSL_TXT_aKRB5 "aKRB5"
-#define SSL_TXT_KRB5 "KRB5"
-
-#define SSL_TXT_kRSA "kRSA"
-#define SSL_TXT_kDHr "kDHr"
-#define SSL_TXT_kDHd "kDHd"
-#define SSL_TXT_kEDH "kEDH"
-#define SSL_TXT_aRSA "aRSA"
-#define SSL_TXT_aDSS "aDSS"
-#define SSL_TXT_aDH "aDH"
-#define SSL_TXT_DSS "DSS"
-#define SSL_TXT_DH "DH"
-#define SSL_TXT_EDH "EDH"
-#define SSL_TXT_ADH "ADH"
-#define SSL_TXT_RSA "RSA"
-#define SSL_TXT_DES "DES"
-#define SSL_TXT_3DES "3DES"
-#define SSL_TXT_RC4 "RC4"
-#define SSL_TXT_RC2 "RC2"
-#define SSL_TXT_IDEA "IDEA"
-#define SSL_TXT_AES "AES"
-#define SSL_TXT_CAMELLIA "CAMELLIA"
-#define SSL_TXT_MD5 "MD5"
-#define SSL_TXT_SHA1 "SHA1"
-#define SSL_TXT_SHA "SHA"
-#define SSL_TXT_EXP "EXP"
-#define SSL_TXT_EXPORT "EXPORT"
-#define SSL_TXT_EXP40 "EXPORT40"
-#define SSL_TXT_EXP56 "EXPORT56"
-#define SSL_TXT_SSLV2 "SSLv2"
-#define SSL_TXT_SSLV3 "SSLv3"
-#define SSL_TXT_TLSV1 "TLSv1"
-#define SSL_TXT_ALL "ALL"
-#define SSL_TXT_ECC "ECCdraft" /* ECC ciphersuites are not yet official */
+#define SSL_TXT_LOW "LOW"
+#define SSL_TXT_MEDIUM "MEDIUM"
+#define SSL_TXT_HIGH "HIGH"
+#define SSL_TXT_FIPS "FIPS"
+#define SSL_TXT_kFZA "kFZA"
+#define SSL_TXT_aFZA "aFZA"
+#define SSL_TXT_eFZA "eFZA"
+#define SSL_TXT_FZA "FZA"
+
+#define SSL_TXT_aNULL "aNULL"
+#define SSL_TXT_eNULL "eNULL"
+#define SSL_TXT_NULL "NULL"
+
+#define SSL_TXT_kKRB5 "kKRB5"
+#define SSL_TXT_aKRB5 "aKRB5"
+#define SSL_TXT_KRB5 "KRB5"
+
+#define SSL_TXT_kRSA "kRSA"
+#define SSL_TXT_kDHr "kDHr"
+#define SSL_TXT_kDHd "kDHd"
+#define SSL_TXT_kEDH "kEDH"
+#define SSL_TXT_aRSA "aRSA"
+#define SSL_TXT_aDSS "aDSS"
+#define SSL_TXT_aDH "aDH"
+#define SSL_TXT_DSS "DSS"
+#define SSL_TXT_DH "DH"
+#define SSL_TXT_EDH "EDH"
+#define SSL_TXT_ADH "ADH"
+#define SSL_TXT_RSA "RSA"
+#define SSL_TXT_DES "DES"
+#define SSL_TXT_3DES "3DES"
+#define SSL_TXT_RC4 "RC4"
+#define SSL_TXT_RC2 "RC2"
+#define SSL_TXT_IDEA "IDEA"
+#define SSL_TXT_SEED "SEED"
+#define SSL_TXT_AES "AES"
+#define SSL_TXT_CAMELLIA "CAMELLIA"
+#define SSL_TXT_MD5 "MD5"
+#define SSL_TXT_SHA1 "SHA1"
+#define SSL_TXT_SHA "SHA"
+#define SSL_TXT_EXP "EXP"
+#define SSL_TXT_EXPORT "EXPORT"
+#define SSL_TXT_EXP40 "EXPORT40"
+#define SSL_TXT_EXP56 "EXPORT56"
+#define SSL_TXT_SSLV2 "SSLv2"
+#define SSL_TXT_SSLV3 "SSLv3"
+#define SSL_TXT_TLSV1 "TLSv1"
+#define SSL_TXT_ALL "ALL"
+#define SSL_TXT_ECC "ECCdraft" /* ECC ciphersuites are not yet official */
/*
* COMPLEMENTOF* definitions. These identifiers are used to (de-select)
@@ -310,21 +313,17 @@ extern "C" {
* DEFAULT gets, as only selection is being done and no sorting as needed
* for DEFAULT.
*/
-#define SSL_TXT_CMPALL "COMPLEMENTOFALL"
-#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT"
+#define SSL_TXT_CMPALL "COMPLEMENTOFALL"
+#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT"
/* The following cipher list is used by default.
* It also is substituted when an application-defined cipher list string
* starts with 'DEFAULT'. */
-#ifdef OPENSSL_NO_CAMELLIA
-# define SSL_DEFAULT_CIPHER_LIST "ALL:!ADH:+RC4:@STRENGTH" /* low priority for RC4 */
-#else
-# define SSL_DEFAULT_CIPHER_LIST "AES:CAMELLIA:ALL:!ADH:+RC4:@STRENGTH" /* low priority for RC4 */
-#endif
+#define SSL_DEFAULT_CIPHER_LIST "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH" /* low priority for RC4 */
/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
-#define SSL_SENT_SHUTDOWN 1
-#define SSL_RECEIVED_SHUTDOWN 2
+#define SSL_SENT_SHUTDOWN 1
+#define SSL_RECEIVED_SHUTDOWN 2
#ifdef __cplusplus
}
@@ -338,8 +337,8 @@ extern "C" {
#define OPENSSL_NO_SSL2
#endif
-#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
-#define SSL_FILETYPE_PEM X509_FILETYPE_PEM
+#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
+#define SSL_FILETYPE_PEM X509_FILETYPE_PEM
/* This is needed to stop compilers complaining about the
* 'struct ssl_st *' function parameters used to prototype callbacks
@@ -348,147 +347,151 @@ typedef struct ssl_st *ssl_crock_st;
/* used to hold info on the particular ciphers used */
typedef struct ssl_cipher_st
- {
- int valid;
- const char *name; /* text name */
- unsigned long id; /* id, 4 bytes, first is version */
- unsigned long algorithms; /* what ciphers are used */
- unsigned long algo_strength; /* strength and export flags */
- unsigned long algorithm2; /* Extra flags */
- int strength_bits; /* Number of bits really used */
- int alg_bits; /* Number of bits for algorithm */
- unsigned long mask; /* used for matching */
- unsigned long mask_strength; /* also used for matching */
- } SSL_CIPHER;
+ {
+ int valid;
+ const char *name; /* text name */
+ unsigned long id; /* id, 4 bytes, first is version */
+ unsigned long algorithms; /* what ciphers are used */
+ unsigned long algo_strength; /* strength and export flags */
+ unsigned long algorithm2; /* Extra flags */
+ int strength_bits; /* Number of bits really used */
+ int alg_bits; /* Number of bits for algorithm */
+ unsigned long mask; /* used for matching */
+ unsigned long mask_strength; /* also used for matching */
+ } SSL_CIPHER;
DECLARE_STACK_OF(SSL_CIPHER)
-typedef struct ssl_st SSL;
-typedef struct ssl_ctx_st SSL_CTX;
-
/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
typedef struct ssl_method_st
- {
- int version;
- int (*ssl_new)(SSL *s);
- void (*ssl_clear)(SSL *s);
- void (*ssl_free)(SSL *s);
- int (*ssl_accept)(SSL *s);
- int (*ssl_connect)(SSL *s);
- int (*ssl_read)(SSL *s,void *buf,int len);
- int (*ssl_peek)(SSL *s,void *buf,int len);
- int (*ssl_write)(SSL *s,const void *buf,int len);
- int (*ssl_shutdown)(SSL *s);
- int (*ssl_renegotiate)(SSL *s);
- int (*ssl_renegotiate_check)(SSL *s);
- long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long
- max, int *ok);
- int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len,
- int peek);
- int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len);
- int (*ssl_dispatch_alert)(SSL *s);
- long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg);
- long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg);
- SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr);
- int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr);
- int (*ssl_pending)(const SSL *s);
- int (*num_ciphers)(void);
- SSL_CIPHER *(*get_cipher)(unsigned ncipher);
- struct ssl_method_st *(*get_ssl_method)(int version);
- long (*get_timeout)(void);
- struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
- int (*ssl_version)(void);
- long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void));
- long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void));
- } SSL_METHOD;
+ {
+ int version;
+ int (*ssl_new)(SSL *s);
+ void (*ssl_clear)(SSL *s);
+ void (*ssl_free)(SSL *s);
+ int (*ssl_accept)(SSL *s);
+ int (*ssl_connect)(SSL *s);
+ int (*ssl_read)(SSL *s,void *buf,int len);
+ int (*ssl_peek)(SSL *s,void *buf,int len);
+ int (*ssl_write)(SSL *s,const void *buf,int len);
+ int (*ssl_shutdown)(SSL *s);
+ int (*ssl_renegotiate)(SSL *s);
+ int (*ssl_renegotiate_check)(SSL *s);
+ long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long
+ max, int *ok);
+ int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len,
+ int peek);
+ int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len);
+ int (*ssl_dispatch_alert)(SSL *s);
+ long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg);
+ long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg);
+ SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr);
+ int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr);
+ int (*ssl_pending)(const SSL *s);
+ int (*num_ciphers)(void);
+ SSL_CIPHER *(*get_cipher)(unsigned ncipher);
+ struct ssl_method_st *(*get_ssl_method)(int version);
+ long (*get_timeout)(void);
+ struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
+ int (*ssl_version)(void);
+ long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void));
+ long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void));
+ } SSL_METHOD;
/* Lets make this into an ASN.1 type structure as follows
* SSL_SESSION_ID ::= SEQUENCE {
- * version INTEGER, -- structure version number
- * SSLversion INTEGER, -- SSL version number
- * Cipher OCTET_STRING, -- the 3 byte cipher ID
- * Session_ID OCTET_STRING, -- the Session ID
- * Master_key OCTET_STRING, -- the master key
- * KRB5_principal OCTET_STRING -- optional Kerberos principal
- * Key_Arg [ 0 ] IMPLICIT OCTET_STRING, -- the optional Key argument
- * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time
- * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds
- * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate
- * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context
- * Verify_result [ 5 ] EXPLICIT INTEGER -- X509_V_... code for `Peer'
- * Compression [6] IMPLICIT ASN1_OBJECT -- compression OID XXXXX
- * }
+ * version INTEGER, -- structure version number
+ * SSLversion INTEGER, -- SSL version number
+ * Cipher OCTET_STRING, -- the 3 byte cipher ID
+ * Session_ID OCTET_STRING, -- the Session ID
+ * Master_key OCTET_STRING, -- the master key
+ * KRB5_principal OCTET_STRING -- optional Kerberos principal
+ * Key_Arg [ 0 ] IMPLICIT OCTET_STRING, -- the optional Key argument
+ * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time
+ * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds
+ * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate
+ * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context
+ * Verify_result [ 5 ] EXPLICIT INTEGER -- X509_V_... code for `Peer'
+ * Compression [6] IMPLICIT ASN1_OBJECT -- compression OID XXXXX
+ * }
* Look in ssl/ssl_asn1.c for more details
* I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
*/
typedef struct ssl_session_st
- {
- int ssl_version; /* what ssl version session info is
- * being kept in here? */
-
- /* only really used in SSLv2 */
- unsigned int key_arg_length;
- unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
- int master_key_length;
- unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
- /* session_id - valid? */
- unsigned int session_id_length;
- unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
- /* this is used to determine whether the session is being reused in
- * the appropriate context. It is up to the application to set this,
- * via SSL_new */
- unsigned int sid_ctx_length;
- unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ {
+ int ssl_version; /* what ssl version session info is
+ * being kept in here? */
+
+ /* only really used in SSLv2 */
+ unsigned int key_arg_length;
+ unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
+ int master_key_length;
+ unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
+ /* session_id - valid? */
+ unsigned int session_id_length;
+ unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
+ /* this is used to determine whether the session is being reused in
+ * the appropriate context. It is up to the application to set this,
+ * via SSL_new */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
#ifndef OPENSSL_NO_KRB5
unsigned int krb5_client_princ_len;
unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
#endif /* OPENSSL_NO_KRB5 */
- int not_resumable;
+ int not_resumable;
- /* The cert is the certificate used to establish this connection */
- struct sess_cert_st /* SESS_CERT */ *sess_cert;
+ /* The cert is the certificate used to establish this connection */
+ struct sess_cert_st /* SESS_CERT */ *sess_cert;
- /* This is the cert for the other end.
- * On clients, it will be the same as sess_cert->peer_key->x509
- * (the latter is not enough as sess_cert is not retained
- * in the external representation of sessions, see ssl_asn1.c). */
- X509 *peer;
- /* when app_verify_callback accepts a session where the peer's certificate
- * is not ok, we must remember the error for session reuse: */
- long verify_result; /* only for servers */
+ /* This is the cert for the other end.
+ * On clients, it will be the same as sess_cert->peer_key->x509
+ * (the latter is not enough as sess_cert is not retained
+ * in the external representation of sessions, see ssl_asn1.c). */
+ X509 *peer;
+ /* when app_verify_callback accepts a session where the peer's certificate
+ * is not ok, we must remember the error for session reuse: */
+ long verify_result; /* only for servers */
- int references;
- long timeout;
- long time;
+ int references;
+ long timeout;
+ long time;
- int compress_meth; /* Need to lookup the method */
+ int compress_meth; /* Need to lookup the method */
- SSL_CIPHER *cipher;
- unsigned long cipher_id; /* when ASN.1 loaded, this
- * needs to be used to load
- * the 'cipher' structure */
+ SSL_CIPHER *cipher;
+ unsigned long cipher_id; /* when ASN.1 loaded, this
+ * needs to be used to load
+ * the 'cipher' structure */
- STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
+ STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
- CRYPTO_EX_DATA ex_data; /* application specific data */
+ CRYPTO_EX_DATA ex_data; /* application specific data */
- /* These are used to make removal of session-ids more
- * efficient and to implement a maximum cache size. */
- struct ssl_session_st *prev,*next;
- } SSL_SESSION;
+ /* These are used to make removal of session-ids more
+ * efficient and to implement a maximum cache size. */
+ struct ssl_session_st *prev,*next;
+#ifndef OPENSSL_NO_TLSEXT
+ char *tlsext_hostname;
+ /* RFC4507 info */
+ unsigned char *tlsext_tick; /* Session ticket */
+ size_t tlsext_ticklen; /* Session ticket length */
+ long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */
+#endif
+ } SSL_SESSION;
-#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L
-#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L
-#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L
-#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x00000010L
-#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L
-#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */
-#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L
-#define SSL_OP_TLS_D5_BUG 0x00000100L
-#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L
+#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L
+#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L
+#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L
+#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x00000010L
+#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L
+#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */
+#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L
+#define SSL_OP_TLS_D5_BUG 0x00000100L
+#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L
/* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added
* in OpenSSL 0.9.6d. Usually (depending on the application protocol)
@@ -499,41 +502,43 @@ typedef struct ssl_session_st
/* SSL_OP_ALL: various bug workarounds that should be rather harmless.
* This used to be 0x000FFFFFL before 0.9.7. */
-#define SSL_OP_ALL 0x00000FFFL
+#define SSL_OP_ALL 0x00000FFFL
/* DTLS options */
#define SSL_OP_NO_QUERY_MTU 0x00001000L
/* Turn on Cookie Exchange (on relevant for servers) */
#define SSL_OP_COOKIE_EXCHANGE 0x00002000L
+/* Don't use RFC4507 ticket extension */
+#define SSL_OP_NO_TICKET 0x00004000L
/* As server, disallow session resumption on renegotiation */
-#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L
+#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L
/* If set, always create a new key when using tmp_ecdh parameters */
-#define SSL_OP_SINGLE_ECDH_USE 0x00080000L
+#define SSL_OP_SINGLE_ECDH_USE 0x00080000L
/* If set, always create a new key when using tmp_dh parameters */
-#define SSL_OP_SINGLE_DH_USE 0x00100000L
+#define SSL_OP_SINGLE_DH_USE 0x00100000L
/* Set to always use the tmp_rsa key when doing RSA operations,
* even when this violates protocol specs */
-#define SSL_OP_EPHEMERAL_RSA 0x00200000L
+#define SSL_OP_EPHEMERAL_RSA 0x00200000L
/* Set on servers to choose the cipher according to the server's
* preferences */
-#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
+#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
/* If set, a server will allow a client to issue a SSLv3.0 version number
* as latest version supported in the premaster secret, even when TLSv1.0
* (version 3.1) was announced in the client hello. Normally this is
* forbidden to prevent version rollback attacks. */
-#define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L
+#define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L
-#define SSL_OP_NO_SSLv2 0x01000000L
-#define SSL_OP_NO_SSLv3 0x02000000L
-#define SSL_OP_NO_TLSv1 0x04000000L
+#define SSL_OP_NO_SSLv2 0x01000000L
+#define SSL_OP_NO_SSLv3 0x02000000L
+#define SSL_OP_NO_TLSv1 0x04000000L
/* The next flag deliberately changes the ciphertest, this is a check
* for the PKCS#1 attack */
-#define SSL_OP_PKCS1_CHECK_1 0x08000000L
-#define SSL_OP_PKCS1_CHECK_2 0x10000000L
-#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
-#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
+#define SSL_OP_PKCS1_CHECK_1 0x08000000L
+#define SSL_OP_PKCS1_CHECK_2 0x10000000L
+#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
+#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
@@ -555,20 +560,20 @@ typedef struct ssl_session_st
* they cannot be used to clear bits. */
#define SSL_CTX_set_options(ctx,op) \
- SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
#define SSL_CTX_get_options(ctx) \
- SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
#define SSL_set_options(ssl,op) \
- SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
+ SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
#define SSL_get_options(ssl) \
SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)
#define SSL_CTX_set_mode(ctx,op) \
- SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
#define SSL_CTX_get_mode(ctx) \
- SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
#define SSL_set_mode(ssl,op) \
- SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
+ SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
#define SSL_get_mode(ssl) \
SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
#define SSL_set_mtu(ssl, mtu) \
@@ -588,7 +593,7 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int con
#define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */
#endif
-#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
+#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
/* This callback type is used inside SSL_CTX, SSL, and in the functions that set
* them. It is used to override the generation of SSL/TLS session IDs in a
@@ -604,192 +609,219 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int con
* returns in this case. It is also an error for the callback to set the size to
* zero. */
typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,
- unsigned int *id_len);
+ unsigned int *id_len);
typedef struct ssl_comp_st
- {
- int id;
- const char *name;
+ {
+ int id;
+ const char *name;
#ifndef OPENSSL_NO_COMP
- COMP_METHOD *method;
+ COMP_METHOD *method;
#else
- char *method;
+ char *method;
#endif
- } SSL_COMP;
+ } SSL_COMP;
DECLARE_STACK_OF(SSL_COMP)
struct ssl_ctx_st
- {
- SSL_METHOD *method;
-
- STACK_OF(SSL_CIPHER) *cipher_list;
- /* same as above but sorted for lookup */
- STACK_OF(SSL_CIPHER) *cipher_list_by_id;
-
- struct x509_store_st /* X509_STORE */ *cert_store;
- struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSIONs */
- /* Most session-ids that will be cached, default is
- * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */
- unsigned long session_cache_size;
- struct ssl_session_st *session_cache_head;
- struct ssl_session_st *session_cache_tail;
-
- /* This can have one of 2 values, ored together,
- * SSL_SESS_CACHE_CLIENT,
- * SSL_SESS_CACHE_SERVER,
- * Default is SSL_SESSION_CACHE_SERVER, which means only
- * SSL_accept which cache SSL_SESSIONS. */
- int session_cache_mode;
-
- /* If timeout is not 0, it is the default timeout value set
- * when SSL_new() is called. This has been put in to make
- * life easier to set things up */
- long session_timeout;
-
- /* If this callback is not null, it will be called each
- * time a session id is added to the cache. If this function
- * returns 1, it means that the callback will do a
- * SSL_SESSION_free() when it has finished using it. Otherwise,
- * on 0, it means the callback has finished with it.
- * If remove_session_cb is not null, it will be called when
- * a session-id is removed from the cache. After the call,
- * OpenSSL will SSL_SESSION_free() it. */
- int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess);
- void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess);
- SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl,
- unsigned char *data,int len,int *copy);
-
- struct
- {
- int sess_connect; /* SSL new conn - started */
- int sess_connect_renegotiate;/* SSL reneg - requested */
- int sess_connect_good; /* SSL new conne/reneg - finished */
- int sess_accept; /* SSL new accept - started */
- int sess_accept_renegotiate;/* SSL reneg - requested */
- int sess_accept_good; /* SSL accept/reneg - finished */
- int sess_miss; /* session lookup misses */
- int sess_timeout; /* reuse attempt on timeouted session */
- int sess_cache_full; /* session removed due to full cache */
- int sess_hit; /* session reuse actually done */
- int sess_cb_hit; /* session-id that was not
- * in the cache was
- * passed back via the callback. This
- * indicates that the application is
- * supplying session-id's from other
- * processes - spooky :-) */
- } stats;
-
- int references;
-
- /* if defined, these override the X509_verify_cert() calls */
- int (*app_verify_callback)(X509_STORE_CTX *, void *);
- void *app_verify_arg;
- /* before OpenSSL 0.9.7, 'app_verify_arg' was ignored
- * ('app_verify_callback' was called with just one argument) */
-
- /* Default password callback. */
- pem_password_cb *default_passwd_callback;
-
- /* Default password callback user data. */
- void *default_passwd_callback_userdata;
-
- /* get client cert callback */
- int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
+ {
+ SSL_METHOD *method;
+
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ /* same as above but sorted for lookup */
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+
+ struct x509_store_st /* X509_STORE */ *cert_store;
+ struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSIONs */
+ /* Most session-ids that will be cached, default is
+ * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */
+ unsigned long session_cache_size;
+ struct ssl_session_st *session_cache_head;
+ struct ssl_session_st *session_cache_tail;
+
+ /* This can have one of 2 values, ored together,
+ * SSL_SESS_CACHE_CLIENT,
+ * SSL_SESS_CACHE_SERVER,
+ * Default is SSL_SESSION_CACHE_SERVER, which means only
+ * SSL_accept which cache SSL_SESSIONS. */
+ int session_cache_mode;
+
+ /* If timeout is not 0, it is the default timeout value set
+ * when SSL_new() is called. This has been put in to make
+ * life easier to set things up */
+ long session_timeout;
+
+ /* If this callback is not null, it will be called each
+ * time a session id is added to the cache. If this function
+ * returns 1, it means that the callback will do a
+ * SSL_SESSION_free() when it has finished using it. Otherwise,
+ * on 0, it means the callback has finished with it.
+ * If remove_session_cb is not null, it will be called when
+ * a session-id is removed from the cache. After the call,
+ * OpenSSL will SSL_SESSION_free() it. */
+ int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess);
+ void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess);
+ SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl,
+ unsigned char *data,int len,int *copy);
+
+ struct
+ {
+ int sess_connect; /* SSL new conn - started */
+ int sess_connect_renegotiate;/* SSL reneg - requested */
+ int sess_connect_good; /* SSL new conne/reneg - finished */
+ int sess_accept; /* SSL new accept - started */
+ int sess_accept_renegotiate;/* SSL reneg - requested */
+ int sess_accept_good; /* SSL accept/reneg - finished */
+ int sess_miss; /* session lookup misses */
+ int sess_timeout; /* reuse attempt on timeouted session */
+ int sess_cache_full; /* session removed due to full cache */
+ int sess_hit; /* session reuse actually done */
+ int sess_cb_hit; /* session-id that was not
+ * in the cache was
+ * passed back via the callback. This
+ * indicates that the application is
+ * supplying session-id's from other
+ * processes - spooky :-) */
+ } stats;
+
+ int references;
+
+ /* if defined, these override the X509_verify_cert() calls */
+ int (*app_verify_callback)(X509_STORE_CTX *, void *);
+ void *app_verify_arg;
+ /* before OpenSSL 0.9.7, 'app_verify_arg' was ignored
+ * ('app_verify_callback' was called with just one argument) */
+
+ /* Default password callback. */
+ pem_password_cb *default_passwd_callback;
+
+ /* Default password callback user data. */
+ void *default_passwd_callback_userdata;
+
+ /* get client cert callback */
+ int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
/* cookie generate callback */
- int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie,
+ int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie,
unsigned int *cookie_len);
/* verify cookie callback */
- int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie,
+ int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie,
unsigned int cookie_len);
- CRYPTO_EX_DATA ex_data;
+ CRYPTO_EX_DATA ex_data;
- const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
- const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
- const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
+ const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
+ const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
+ const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
- STACK_OF(X509) *extra_certs;
- STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
+ STACK_OF(X509) *extra_certs;
+ STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
- /* Default values used when no per-SSL value is defined follow */
+ /* Default values used when no per-SSL value is defined follow */
- void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */
+ void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */
- /* what we put in client cert requests */
- STACK_OF(X509_NAME) *client_CA;
+ /* what we put in client cert requests */
+ STACK_OF(X509_NAME) *client_CA;
- /* Default values to use in SSL structures follow (these are copied by SSL_new) */
+ /* Default values to use in SSL structures follow (these are copied by SSL_new) */
- unsigned long options;
- unsigned long mode;
- long max_cert_list;
+ unsigned long options;
+ unsigned long mode;
+ long max_cert_list;
- struct cert_st /* CERT */ *cert;
- int read_ahead;
+ struct cert_st /* CERT */ *cert;
+ int read_ahead;
- /* callback that allows applications to peek at protocol messages */
- void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
- void *msg_callback_arg;
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
- int verify_mode;
- unsigned int sid_ctx_length;
- unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
- int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */
+ int verify_mode;
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */
- /* Default generate session ID callback. */
- GEN_SESSION_CB generate_session_id;
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
- X509_VERIFY_PARAM *param;
+ X509_VERIFY_PARAM *param;
#if 0
- int purpose; /* Purpose setting */
- int trust; /* Trust setting */
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
+#endif
+
+ int quiet_shutdown;
+
+#ifndef OPENSSL_ENGINE
+ /* Engine to pass requests for client certs to
+ */
+ ENGINE *client_cert_engine;
+#endif
+
+#ifndef OPENSSL_NO_TLSEXT
+ /* TLS extensions servername callback */
+ int (*tlsext_servername_callback)(SSL*, int *, void *);
+ void *tlsext_servername_arg;
+ /* RFC 4507 session ticket keys */
+ unsigned char tlsext_tick_key_name[16];
+ unsigned char tlsext_tick_hmac_key[16];
+ unsigned char tlsext_tick_aes_key[16];
+ /* Callback to support customisation of ticket key setting */
+ int (*tlsext_ticket_key_cb)(SSL *ssl,
+ unsigned char *name, unsigned char *iv,
+ EVP_CIPHER_CTX *ectx,
+ HMAC_CTX *hctx, int enc);
+
+ /* certificate status request info */
+ /* Callback for status request */
+ int (*tlsext_status_cb)(SSL *ssl, void *arg);
+ void *tlsext_status_arg;
#endif
- int quiet_shutdown;
- };
+ };
-#define SSL_SESS_CACHE_OFF 0x0000
-#define SSL_SESS_CACHE_CLIENT 0x0001
-#define SSL_SESS_CACHE_SERVER 0x0002
-#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
-#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080
+#define SSL_SESS_CACHE_OFF 0x0000
+#define SSL_SESS_CACHE_CLIENT 0x0001
+#define SSL_SESS_CACHE_SERVER 0x0002
+#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
+#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080
/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */
-#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100
-#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200
+#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100
+#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200
#define SSL_SESS_CACHE_NO_INTERNAL \
- (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
+ (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
struct lhash_st *SSL_CTX_sessions(SSL_CTX *ctx);
#define SSL_CTX_sess_number(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
#define SSL_CTX_sess_connect(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
#define SSL_CTX_sess_connect_good(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
#define SSL_CTX_sess_connect_renegotiate(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
#define SSL_CTX_sess_accept(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
#define SSL_CTX_sess_accept_renegotiate(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
#define SSL_CTX_sess_accept_good(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
#define SSL_CTX_sess_hits(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
#define SSL_CTX_sess_cb_hits(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
#define SSL_CTX_sess_misses(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
#define SSL_CTX_sess_timeouts(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
#define SSL_CTX_sess_cache_full(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess));
int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, SSL_SESSION *sess);
@@ -801,179 +833,213 @@ void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(const SSL *ssl,int type,
void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl,int type,int val);
void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey));
int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
+#ifndef OPENSSL_NO_ENGINE
+int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
+#endif
void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len));
void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len));
-#define SSL_NOTHING 1
-#define SSL_WRITING 2
-#define SSL_READING 3
-#define SSL_X509_LOOKUP 4
+#define SSL_NOTHING 1
+#define SSL_WRITING 2
+#define SSL_READING 3
+#define SSL_X509_LOOKUP 4
/* These will only be used when doing non-blocking IO */
-#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING)
-#define SSL_want_read(s) (SSL_want(s) == SSL_READING)
-#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
-#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
+#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING)
+#define SSL_want_read(s) (SSL_want(s) == SSL_READING)
+#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
+#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
struct ssl_st
- {
- /* protocol version
- * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION)
- */
- int version;
- int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
+ {
+ /* protocol version
+ * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION)
+ */
+ int version;
+ int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
- SSL_METHOD *method; /* SSLv3 */
+ SSL_METHOD *method; /* SSLv3 */
- /* There are 2 BIO's even though they are normally both the
- * same. This is so data can be read and written to different
- * handlers */
+ /* There are 2 BIO's even though they are normally both the
+ * same. This is so data can be read and written to different
+ * handlers */
#ifndef OPENSSL_NO_BIO
- BIO *rbio; /* used by SSL_read */
- BIO *wbio; /* used by SSL_write */
- BIO *bbio; /* used during session-id reuse to concatenate
- * messages */
+ BIO *rbio; /* used by SSL_read */
+ BIO *wbio; /* used by SSL_write */
+ BIO *bbio; /* used during session-id reuse to concatenate
+ * messages */
#else
- char *rbio; /* used by SSL_read */
- char *wbio; /* used by SSL_write */
- char *bbio;
+ char *rbio; /* used by SSL_read */
+ char *wbio; /* used by SSL_write */
+ char *bbio;
#endif
- /* This holds a variable that indicates what we were doing
- * when a 0 or -1 is returned. This is needed for
- * non-blocking IO so we know what request needs re-doing when
- * in SSL_accept or SSL_connect */
- int rwstate;
-
- /* true when we are actually in SSL_accept() or SSL_connect() */
- int in_handshake;
- int (*handshake_func)(SSL *);
-
- /* Imagine that here's a boolean member "init" that is
- * switched as soon as SSL_set_{accept/connect}_state
- * is called for the first time, so that "state" and
- * "handshake_func" are properly initialized. But as
- * handshake_func is == 0 until then, we use this
- * test instead of an "init" member.
- */
-
- int server; /* are we the server side? - mostly used by SSL_clear*/
-
- int new_session;/* 1 if we are to use a new session.
- * 2 if we are a server and are inside a handshake
- * (i.e. not just sending a HelloRequest)
- * NB: For servers, the 'new' session may actually be a previously
- * cached session or even the previous session unless
- * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */
- int quiet_shutdown;/* don't send shutdown packets */
- int shutdown; /* we have shut things down, 0x01 sent, 0x02
- * for received */
- int state; /* where we are */
- int rstate; /* where we are when reading */
-
- BUF_MEM *init_buf; /* buffer used during init */
- void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */
- int init_num; /* amount read/written */
- int init_off; /* amount read/written */
-
- /* used internally to point at a raw packet */
- unsigned char *packet;
- unsigned int packet_length;
-
- struct ssl2_state_st *s2; /* SSLv2 variables */
- struct ssl3_state_st *s3; /* SSLv3 variables */
- struct dtls1_state_st *d1; /* DTLSv1 variables */
-
- int read_ahead; /* Read as many input bytes as possible
- * (for non-blocking reads) */
-
- /* callback that allows applications to peek at protocol messages */
- void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
- void *msg_callback_arg;
-
- int hit; /* reusing a previous session */
-
- X509_VERIFY_PARAM *param;
+ /* This holds a variable that indicates what we were doing
+ * when a 0 or -1 is returned. This is needed for
+ * non-blocking IO so we know what request needs re-doing when
+ * in SSL_accept or SSL_connect */
+ int rwstate;
+
+ /* true when we are actually in SSL_accept() or SSL_connect() */
+ int in_handshake;
+ int (*handshake_func)(SSL *);
+
+ /* Imagine that here's a boolean member "init" that is
+ * switched as soon as SSL_set_{accept/connect}_state
+ * is called for the first time, so that "state" and
+ * "handshake_func" are properly initialized. But as
+ * handshake_func is == 0 until then, we use this
+ * test instead of an "init" member.
+ */
+
+ int server; /* are we the server side? - mostly used by SSL_clear*/
+
+ int new_session;/* 1 if we are to use a new session.
+ * 2 if we are a server and are inside a handshake
+ * (i.e. not just sending a HelloRequest)
+ * NB: For servers, the 'new' session may actually be a previously
+ * cached session or even the previous session unless
+ * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */
+ int quiet_shutdown;/* don't send shutdown packets */
+ int shutdown; /* we have shut things down, 0x01 sent, 0x02
+ * for received */
+ int state; /* where we are */
+ int rstate; /* where we are when reading */
+
+ BUF_MEM *init_buf; /* buffer used during init */
+ void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */
+ int init_num; /* amount read/written */
+ int init_off; /* amount read/written */
+
+ /* used internally to point at a raw packet */
+ unsigned char *packet;
+ unsigned int packet_length;
+
+ struct ssl2_state_st *s2; /* SSLv2 variables */
+ struct ssl3_state_st *s3; /* SSLv3 variables */
+ struct dtls1_state_st *d1; /* DTLSv1 variables */
+
+ int read_ahead; /* Read as many input bytes as possible
+ * (for non-blocking reads) */
+
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
+
+ int hit; /* reusing a previous session */
+
+ X509_VERIFY_PARAM *param;
#if 0
- int purpose; /* Purpose setting */
- int trust; /* Trust setting */
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
#endif
- /* crypto */
- STACK_OF(SSL_CIPHER) *cipher_list;
- STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+ /* crypto */
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
- /* These are the ones being used, the ones in SSL_SESSION are
- * the ones to be 'copied' into these ones */
+ /* These are the ones being used, the ones in SSL_SESSION are
+ * the ones to be 'copied' into these ones */
- EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
- const EVP_MD *read_hash; /* used for mac generation */
+ EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
+ const EVP_MD *read_hash; /* used for mac generation */
#ifndef OPENSSL_NO_COMP
- COMP_CTX *expand; /* uncompress */
+ COMP_CTX *expand; /* uncompress */
#else
- char *expand;
+ char *expand;
#endif
- EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
- const EVP_MD *write_hash; /* used for mac generation */
+ EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
+ const EVP_MD *write_hash; /* used for mac generation */
#ifndef OPENSSL_NO_COMP
- COMP_CTX *compress; /* compression */
+ COMP_CTX *compress; /* compression */
#else
- char *compress;
+ char *compress;
#endif
- /* session info */
+ /* session info */
- /* client cert? */
- /* This is used to hold the server certificate used */
- struct cert_st /* CERT */ *cert;
+ /* client cert? */
+ /* This is used to hold the server certificate used */
+ struct cert_st /* CERT */ *cert;
- /* the session_id_context is used to ensure sessions are only reused
- * in the appropriate context */
- unsigned int sid_ctx_length;
- unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ /* the session_id_context is used to ensure sessions are only reused
+ * in the appropriate context */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
- /* This can also be in the session once a session is established */
- SSL_SESSION *session;
+ /* This can also be in the session once a session is established */
+ SSL_SESSION *session;
- /* Default generate session ID callback. */
- GEN_SESSION_CB generate_session_id;
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
- /* Used in SSL2 and SSL3 */
- int verify_mode; /* 0 don't care about verify failure.
- * 1 fail if verify fails */
- int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */
+ /* Used in SSL2 and SSL3 */
+ int verify_mode; /* 0 don't care about verify failure.
+ * 1 fail if verify fails */
+ int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */
- void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */
+ void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */
- int error; /* error bytes to be written */
- int error_code; /* actual code */
+ int error; /* error bytes to be written */
+ int error_code; /* actual code */
#ifndef OPENSSL_NO_KRB5
- KSSL_CTX *kssl_ctx; /* Kerberos 5 context */
-#endif /* OPENSSL_NO_KRB5 */
-
- SSL_CTX *ctx;
- /* set this flag to 1 and a sleep(1) is put into all SSL_read()
- * and SSL_write() calls, good for nbio debuging :-) */
- int debug;
-
- /* extra application data */
- long verify_result;
- CRYPTO_EX_DATA ex_data;
-
- /* for server side, keep the list of CA_dn we can use */
- STACK_OF(X509_NAME) *client_CA;
-
- int references;
- unsigned long options; /* protocol behaviour */
- unsigned long mode; /* API behaviour */
- long max_cert_list;
- int first_packet;
- int client_version; /* what was passed, used for
- * SSLv3/TLS rollback check */
- };
+ KSSL_CTX *kssl_ctx; /* Kerberos 5 context */
+#endif /* OPENSSL_NO_KRB5 */
+
+ SSL_CTX *ctx;
+ /* set this flag to 1 and a sleep(1) is put into all SSL_read()
+ * and SSL_write() calls, good for nbio debuging :-) */
+ int debug;
+
+ /* extra application data */
+ long verify_result;
+ CRYPTO_EX_DATA ex_data;
+
+ /* for server side, keep the list of CA_dn we can use */
+ STACK_OF(X509_NAME) *client_CA;
+
+ int references;
+ unsigned long options; /* protocol behaviour */
+ unsigned long mode; /* API behaviour */
+ long max_cert_list;
+ int first_packet;
+ int client_version; /* what was passed, used for
+ * SSLv3/TLS rollback check */
+#ifndef OPENSSL_NO_TLSEXT
+ /* TLS extension debug callback */
+ void (*tlsext_debug_cb)(SSL *s, int client_server, int type,
+ unsigned char *data, int len,
+ void *arg);
+ void *tlsext_debug_arg;
+ char *tlsext_hostname;
+ int servername_done; /* no further mod of servername
+ 0 : call the servername extension callback.
+ 1 : prepare 2, allow last ack just after in server callback.
+ 2 : don't call servername callback, no ack in server hello
+ */
+ /* certificate status request info */
+ /* Status type or -1 if no status type */
+ int tlsext_status_type;
+ /* Expect OCSP CertificateStatus message */
+ int tlsext_status_expected;
+ /* OCSP status request only */
+ STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids;
+ X509_EXTENSIONS *tlsext_ocsp_exts;
+ /* OCSP response received or to be sent */
+ unsigned char *tlsext_ocsp_resp;
+ int tlsext_ocsp_resplen;
+
+ /* RFC4507 session ticket expected to be received or sent */
+ int tlsext_ticket_expected;
+ SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */
+#define session_ctx initial_ctx
+#else
+#define session_ctx ctx
+#endif
+ };
#ifdef __cplusplus
}
@@ -990,12 +1056,12 @@ extern "C" {
#endif
/* compatibility */
-#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
-#define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
-#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
-#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
-#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
-#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
+#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
+#define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
+#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
+#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
+#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
+#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
/* The following are the possible values for ssl->state are are
* used to indicate where we are up to in the SSL connection establishment.
@@ -1004,41 +1070,41 @@ extern "C" {
* It can also be useful to work out where you were when the connection
* failed */
-#define SSL_ST_CONNECT 0x1000
-#define SSL_ST_ACCEPT 0x2000
-#define SSL_ST_MASK 0x0FFF
-#define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT)
-#define SSL_ST_BEFORE 0x4000
-#define SSL_ST_OK 0x03
-#define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
-
-#define SSL_CB_LOOP 0x01
-#define SSL_CB_EXIT 0x02
-#define SSL_CB_READ 0x04
-#define SSL_CB_WRITE 0x08
-#define SSL_CB_ALERT 0x4000 /* used in callback */
-#define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ)
-#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE)
-#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP)
-#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT)
-#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP)
-#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT)
-#define SSL_CB_HANDSHAKE_START 0x10
-#define SSL_CB_HANDSHAKE_DONE 0x20
+#define SSL_ST_CONNECT 0x1000
+#define SSL_ST_ACCEPT 0x2000
+#define SSL_ST_MASK 0x0FFF
+#define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT)
+#define SSL_ST_BEFORE 0x4000
+#define SSL_ST_OK 0x03
+#define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
+
+#define SSL_CB_LOOP 0x01
+#define SSL_CB_EXIT 0x02
+#define SSL_CB_READ 0x04
+#define SSL_CB_WRITE 0x08
+#define SSL_CB_ALERT 0x4000 /* used in callback */
+#define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ)
+#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE)
+#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP)
+#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT)
+#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP)
+#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT)
+#define SSL_CB_HANDSHAKE_START 0x10
+#define SSL_CB_HANDSHAKE_DONE 0x20
/* Is the SSL_connection established? */
-#define SSL_get_state(a) SSL_state(a)
-#define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK)
-#define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT)
-#define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE)
-#define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT)
-#define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT)
+#define SSL_get_state(a) SSL_state(a)
+#define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK)
+#define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT)
+#define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE)
+#define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT)
+#define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT)
/* The following 2 states are kept in ssl->rstate when reads fail,
* you should not need these */
-#define SSL_ST_READ_HEADER 0xF0
-#define SSL_ST_READ_BODY 0xF1
-#define SSL_ST_READ_DONE 0xF2
+#define SSL_ST_READ_HEADER 0xF0
+#define SSL_ST_READ_BODY 0xF1
+#define SSL_ST_READ_DONE 0xF2
/* Obtain latest Finished message
* -- that we sent (SSL_get_finished)
@@ -1049,101 +1115,105 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
/* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options
* are 'ored' with SSL_VERIFY_PEER if they are desired */
-#define SSL_VERIFY_NONE 0x00
-#define SSL_VERIFY_PEER 0x01
-#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
-#define SSL_VERIFY_CLIENT_ONCE 0x04
+#define SSL_VERIFY_NONE 0x00
+#define SSL_VERIFY_PEER 0x01
+#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
+#define SSL_VERIFY_CLIENT_ONCE 0x04
-#define OpenSSL_add_ssl_algorithms() SSL_library_init()
-#define SSLeay_add_ssl_algorithms() SSL_library_init()
+#define OpenSSL_add_ssl_algorithms() SSL_library_init()
+#define SSLeay_add_ssl_algorithms() SSL_library_init()
/* this is for backward compatibility */
#if 0 /* NEW_SSLEAY */
#define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
-#define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n)
+#define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n)
#define SSL_add_session(a,b) SSL_CTX_add_session((a),(b))
-#define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b))
-#define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b))
+#define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b))
+#define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b))
#endif
/* More backward compatibility */
#define SSL_get_cipher(s) \
- SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
#define SSL_get_cipher_bits(s,np) \
- SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
+ SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
#define SSL_get_cipher_version(s) \
- SSL_CIPHER_get_version(SSL_get_current_cipher(s))
+ SSL_CIPHER_get_version(SSL_get_current_cipher(s))
#define SSL_get_cipher_name(s) \
- SSL_CIPHER_get_name(SSL_get_current_cipher(s))
-#define SSL_get_time(a) SSL_SESSION_get_time(a)
-#define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b))
-#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a)
-#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b))
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+#define SSL_get_time(a) SSL_SESSION_get_time(a)
+#define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b))
+#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a)
+#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b))
#if 1 /*SSLEAY_MACROS*/
#define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)
#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)
#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
- (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
+ (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) PEM_ASN1_read_bio_of(SSL_SESSION,d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,cb,u)
#define PEM_write_SSL_SESSION(fp,x) \
- PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
- PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
+ PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
#define PEM_write_bio_SSL_SESSION(bp,x) \
- PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL)
+ PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL)
#endif
-#define SSL_AD_REASON_OFFSET 1000
+#define SSL_AD_REASON_OFFSET 1000
/* These alert types are for SSLv3 and TLSv1 */
-#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
-#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */
-#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC /* fatal */
-#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED
-#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW
-#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE/* fatal */
-#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE/* fatal */
-#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE /* Not for TLS */
-#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
-#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE
-#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED
-#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED
-#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN
-#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER /* fatal */
-#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA /* fatal */
-#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED /* fatal */
-#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR /* fatal */
-#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR
-#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION/* fatal */
-#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION /* fatal */
-#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY/* fatal */
-#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR /* fatal */
-#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
-#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
-
-#define SSL_ERROR_NONE 0
-#define SSL_ERROR_SSL 1
-#define SSL_ERROR_WANT_READ 2
-#define SSL_ERROR_WANT_WRITE 3
-#define SSL_ERROR_WANT_X509_LOOKUP 4
-#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */
-#define SSL_ERROR_ZERO_RETURN 6
-#define SSL_ERROR_WANT_CONNECT 7
-#define SSL_ERROR_WANT_ACCEPT 8
-
-#define SSL_CTRL_NEED_TMP_RSA 1
-#define SSL_CTRL_SET_TMP_RSA 2
-#define SSL_CTRL_SET_TMP_DH 3
-#define SSL_CTRL_SET_TMP_ECDH 4
-#define SSL_CTRL_SET_TMP_RSA_CB 5
-#define SSL_CTRL_SET_TMP_DH_CB 6
-#define SSL_CTRL_SET_TMP_ECDH_CB 7
-
-#define SSL_CTRL_GET_SESSION_REUSED 8
-#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
-#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
-#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
-#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
-#define SSL_CTRL_GET_FLAGS 13
-#define SSL_CTRL_EXTRA_CHAIN_CERT 14
+#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
+#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */
+#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC /* fatal */
+#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED
+#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW
+#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE/* fatal */
+#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE/* fatal */
+#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE /* Not for TLS */
+#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
+#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE
+#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED
+#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED
+#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN
+#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER /* fatal */
+#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA /* fatal */
+#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED /* fatal */
+#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR /* fatal */
+#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR
+#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION/* fatal */
+#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION /* fatal */
+#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY/* fatal */
+#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR /* fatal */
+#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
+#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
+#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION
+#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
+#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
+#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
+
+#define SSL_ERROR_NONE 0
+#define SSL_ERROR_SSL 1
+#define SSL_ERROR_WANT_READ 2
+#define SSL_ERROR_WANT_WRITE 3
+#define SSL_ERROR_WANT_X509_LOOKUP 4
+#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */
+#define SSL_ERROR_ZERO_RETURN 6
+#define SSL_ERROR_WANT_CONNECT 7
+#define SSL_ERROR_WANT_ACCEPT 8
+
+#define SSL_CTRL_NEED_TMP_RSA 1
+#define SSL_CTRL_SET_TMP_RSA 2
+#define SSL_CTRL_SET_TMP_DH 3
+#define SSL_CTRL_SET_TMP_ECDH 4
+#define SSL_CTRL_SET_TMP_RSA_CB 5
+#define SSL_CTRL_SET_TMP_DH_CB 6
+#define SSL_CTRL_SET_TMP_ECDH_CB 7
+
+#define SSL_CTRL_GET_SESSION_REUSED 8
+#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
+#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
+#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
+#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
+#define SSL_CTRL_GET_FLAGS 13
+#define SSL_CTRL_EXTRA_CHAIN_CERT 14
#define SSL_CTRL_SET_MSG_CALLBACK 15
#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16
@@ -1151,60 +1221,83 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
/* only applies to datagram connections */
#define SSL_CTRL_SET_MTU 17
/* Stats */
-#define SSL_CTRL_SESS_NUMBER 20
-#define SSL_CTRL_SESS_CONNECT 21
-#define SSL_CTRL_SESS_CONNECT_GOOD 22
-#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
-#define SSL_CTRL_SESS_ACCEPT 24
-#define SSL_CTRL_SESS_ACCEPT_GOOD 25
-#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
-#define SSL_CTRL_SESS_HIT 27
-#define SSL_CTRL_SESS_CB_HIT 28
-#define SSL_CTRL_SESS_MISSES 29
-#define SSL_CTRL_SESS_TIMEOUTS 30
-#define SSL_CTRL_SESS_CACHE_FULL 31
-#define SSL_CTRL_OPTIONS 32
-#define SSL_CTRL_MODE 33
-
-#define SSL_CTRL_GET_READ_AHEAD 40
-#define SSL_CTRL_SET_READ_AHEAD 41
-#define SSL_CTRL_SET_SESS_CACHE_SIZE 42
-#define SSL_CTRL_GET_SESS_CACHE_SIZE 43
-#define SSL_CTRL_SET_SESS_CACHE_MODE 44
-#define SSL_CTRL_GET_SESS_CACHE_MODE 45
-
-#define SSL_CTRL_GET_MAX_CERT_LIST 50
-#define SSL_CTRL_SET_MAX_CERT_LIST 51
+#define SSL_CTRL_SESS_NUMBER 20
+#define SSL_CTRL_SESS_CONNECT 21
+#define SSL_CTRL_SESS_CONNECT_GOOD 22
+#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
+#define SSL_CTRL_SESS_ACCEPT 24
+#define SSL_CTRL_SESS_ACCEPT_GOOD 25
+#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
+#define SSL_CTRL_SESS_HIT 27
+#define SSL_CTRL_SESS_CB_HIT 28
+#define SSL_CTRL_SESS_MISSES 29
+#define SSL_CTRL_SESS_TIMEOUTS 30
+#define SSL_CTRL_SESS_CACHE_FULL 31
+#define SSL_CTRL_OPTIONS 32
+#define SSL_CTRL_MODE 33
+
+#define SSL_CTRL_GET_READ_AHEAD 40
+#define SSL_CTRL_SET_READ_AHEAD 41
+#define SSL_CTRL_SET_SESS_CACHE_SIZE 42
+#define SSL_CTRL_GET_SESS_CACHE_SIZE 43
+#define SSL_CTRL_SET_SESS_CACHE_MODE 44
+#define SSL_CTRL_GET_SESS_CACHE_MODE 45
+
+#define SSL_CTRL_GET_MAX_CERT_LIST 50
+#define SSL_CTRL_SET_MAX_CERT_LIST 51
+
+/* see tls1.h for macros based on these */
+#ifndef OPENSSL_NO_TLSEXT
+#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53
+#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54
+#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
+#define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56
+#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
+#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58
+#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59
+
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
+#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
+
+#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
+#endif
#define SSL_session_reused(ssl) \
- SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
+ SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
#define SSL_num_renegotiations(ssl) \
- SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
+ SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
#define SSL_clear_num_renegotiations(ssl) \
- SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
#define SSL_total_renegotiations(ssl) \
- SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
+ SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
#define SSL_CTX_need_tmp_RSA(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
#define SSL_CTX_set_tmp_rsa(ctx,rsa) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
#define SSL_CTX_set_tmp_dh(ctx,dh) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
#define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
#define SSL_need_tmp_RSA(ssl) \
- SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+ SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
#define SSL_set_tmp_rsa(ssl,rsa) \
- SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
#define SSL_set_tmp_dh(ssl,dh) \
- SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
#define SSL_set_tmp_ecdh(ssl,ecdh) \
- SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
#define SSL_CTX_add_extra_chain_cert(ctx,x509) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
#ifndef OPENSSL_NO_BIO
BIO_METHOD *BIO_f_ssl(void);
@@ -1216,112 +1309,112 @@ void BIO_ssl_shutdown(BIO *ssl_bio);
#endif
-int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str);
+int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str);
SSL_CTX *SSL_CTX_new(SSL_METHOD *meth);
-void SSL_CTX_free(SSL_CTX *);
+void SSL_CTX_free(SSL_CTX *);
long SSL_CTX_set_timeout(SSL_CTX *ctx,long t);
long SSL_CTX_get_timeout(const SSL_CTX *ctx);
X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *);
int SSL_want(const SSL *s);
-int SSL_clear(SSL *s);
+int SSL_clear(SSL *s);
-void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm);
+void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm);
SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
-int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits);
-char * SSL_CIPHER_get_version(const SSL_CIPHER *c);
-const char * SSL_CIPHER_get_name(const SSL_CIPHER *c);
+int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits);
+char * SSL_CIPHER_get_version(const SSL_CIPHER *c);
+const char * SSL_CIPHER_get_name(const SSL_CIPHER *c);
-int SSL_get_fd(const SSL *s);
-int SSL_get_rfd(const SSL *s);
-int SSL_get_wfd(const SSL *s);
+int SSL_get_fd(const SSL *s);
+int SSL_get_rfd(const SSL *s);
+int SSL_get_wfd(const SSL *s);
const char * SSL_get_cipher_list(const SSL *s,int n);
-char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
-int SSL_get_read_ahead(const SSL * s);
-int SSL_pending(const SSL *s);
+char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
+int SSL_get_read_ahead(const SSL * s);
+int SSL_pending(const SSL *s);
#ifndef OPENSSL_NO_SOCK
-int SSL_set_fd(SSL *s, int fd);
-int SSL_set_rfd(SSL *s, int fd);
-int SSL_set_wfd(SSL *s, int fd);
+int SSL_set_fd(SSL *s, int fd);
+int SSL_set_rfd(SSL *s, int fd);
+int SSL_set_wfd(SSL *s, int fd);
#endif
#ifndef OPENSSL_NO_BIO
-void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
-BIO * SSL_get_rbio(const SSL *s);
-BIO * SSL_get_wbio(const SSL *s);
+void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
+BIO * SSL_get_rbio(const SSL *s);
+BIO * SSL_get_wbio(const SSL *s);
#endif
-int SSL_set_cipher_list(SSL *s, const char *str);
-void SSL_set_read_ahead(SSL *s, int yes);
-int SSL_get_verify_mode(const SSL *s);
-int SSL_get_verify_depth(const SSL *s);
-int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *);
-void SSL_set_verify(SSL *s, int mode,
- int (*callback)(int ok,X509_STORE_CTX *ctx));
-void SSL_set_verify_depth(SSL *s, int depth);
+int SSL_set_cipher_list(SSL *s, const char *str);
+void SSL_set_read_ahead(SSL *s, int yes);
+int SSL_get_verify_mode(const SSL *s);
+int SSL_get_verify_depth(const SSL *s);
+int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *);
+void SSL_set_verify(SSL *s, int mode,
+ int (*callback)(int ok,X509_STORE_CTX *ctx));
+void SSL_set_verify_depth(SSL *s, int depth);
#ifndef OPENSSL_NO_RSA
-int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
+int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
#endif
-int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
-int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
-int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len);
-int SSL_use_certificate(SSL *ssl, X509 *x);
-int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
+int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
+int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
+int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len);
+int SSL_use_certificate(SSL *ssl, X509 *x);
+int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
#ifndef OPENSSL_NO_STDIO
-int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
-int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
-int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
-int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
-int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
-int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
-int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */
+int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
+int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */
STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
-int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
- const char *file);
+int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *file);
#ifndef OPENSSL_SYS_VMS
#ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */
-int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
- const char *dir);
+int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *dir);
#endif
#endif
#endif
-void SSL_load_error_strings(void );
+void SSL_load_error_strings(void );
const char *SSL_state_string(const SSL *s);
const char *SSL_rstate_string(const SSL *s);
const char *SSL_state_string_long(const SSL *s);
const char *SSL_rstate_string_long(const SSL *s);
-long SSL_SESSION_get_time(const SSL_SESSION *s);
-long SSL_SESSION_set_time(SSL_SESSION *s, long t);
-long SSL_SESSION_get_timeout(const SSL_SESSION *s);
-long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
-void SSL_copy_session_id(SSL *to,const SSL *from);
+long SSL_SESSION_get_time(const SSL_SESSION *s);
+long SSL_SESSION_set_time(SSL_SESSION *s, long t);
+long SSL_SESSION_get_timeout(const SSL_SESSION *s);
+long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
+void SSL_copy_session_id(SSL *to,const SSL *from);
SSL_SESSION *SSL_SESSION_new(void);
unsigned long SSL_SESSION_hash(const SSL_SESSION *a);
-int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b);
+int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b);
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len);
#ifndef OPENSSL_NO_FP_API
-int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses);
+int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses);
#endif
#ifndef OPENSSL_NO_BIO
-int SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses);
+int SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses);
#endif
-void SSL_SESSION_free(SSL_SESSION *ses);
-int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp);
-int SSL_set_session(SSL *to, SSL_SESSION *session);
-int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
-int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
-int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
-int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
-int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
- unsigned int id_len);
+void SSL_SESSION_free(SSL_SESSION *ses);
+int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp);
+int SSL_set_session(SSL *to, SSL_SESSION *session);
+int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
+int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
+int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
+int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
+int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
+ unsigned int id_len);
SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp,
- long length);
+ long length);
#ifdef HEADER_X509_H
-X509 * SSL_get_peer_certificate(const SSL *s);
+X509 * SSL_get_peer_certificate(const SSL *s);
#endif
STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
@@ -1330,7 +1423,7 @@ int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int,X509_STORE_CTX *);
void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,
- int (*callback)(int, X509_STORE_CTX *));
+ int (*callback)(int, X509_STORE_CTX *));
void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth);
void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *,void *), void *arg);
#ifndef OPENSSL_NO_RSA
@@ -1339,7 +1432,7 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len);
int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx,
- const unsigned char *d, long len);
+ const unsigned char *d, long len);
int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d);
@@ -1349,54 +1442,54 @@ void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
int SSL_CTX_check_private_key(const SSL_CTX *ctx);
int SSL_check_private_key(const SSL *ctx);
-int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
- unsigned int sid_ctx_len);
+int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
-SSL * SSL_new(SSL_CTX *ctx);
-int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
- unsigned int sid_ctx_len);
+SSL * SSL_new(SSL_CTX *ctx);
+int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
int SSL_set_purpose(SSL *s, int purpose);
int SSL_CTX_set_trust(SSL_CTX *s, int trust);
int SSL_set_trust(SSL *s, int trust);
-void SSL_free(SSL *ssl);
-int SSL_accept(SSL *ssl);
-int SSL_connect(SSL *ssl);
-int SSL_read(SSL *ssl,void *buf,int num);
-int SSL_peek(SSL *ssl,void *buf,int num);
-int SSL_write(SSL *ssl,const void *buf,int num);
-long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
-long SSL_callback_ctrl(SSL *, int, void (*)(void));
-long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg);
-long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
-
-int SSL_get_error(const SSL *s,int ret_code);
+void SSL_free(SSL *ssl);
+int SSL_accept(SSL *ssl);
+int SSL_connect(SSL *ssl);
+int SSL_read(SSL *ssl,void *buf,int num);
+int SSL_peek(SSL *ssl,void *buf,int num);
+int SSL_write(SSL *ssl,const void *buf,int num);
+long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
+long SSL_callback_ctrl(SSL *, int, void (*)(void));
+long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg);
+long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
+
+int SSL_get_error(const SSL *s,int ret_code);
const char *SSL_get_version(const SSL *s);
/* This sets the 'default' SSL version that SSL_new() will create */
int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth);
-SSL_METHOD *SSLv2_method(void); /* SSLv2 */
-SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
-SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
+SSL_METHOD *SSLv2_method(void); /* SSLv2 */
+SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
+SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
-SSL_METHOD *SSLv3_method(void); /* SSLv3 */
-SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
-SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
+SSL_METHOD *SSLv3_method(void); /* SSLv3 */
+SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
+SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
-SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */
-SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */
-SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */
+SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */
+SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */
+SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */
-SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
-SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
-SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
+SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
+SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
+SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
-SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
-SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
-SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
+SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
+SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
+SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
@@ -1443,13 +1536,14 @@ int SSL_get_shutdown(const SSL *ssl);
int SSL_version(const SSL *ssl);
int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
- const char *CApath);
+ const char *CApath);
#define SSL_get0_session SSL_get_session /* just peek at pointer */
SSL_SESSION *SSL_get_session(const SSL *ssl);
SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */
SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);
+SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx);
void SSL_set_info_callback(SSL *ssl,
- void (*cb)(const SSL *ssl,int type,int val));
+ void (*cb)(const SSL *ssl,int type,int val));
void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val);
int SSL_state(const SSL *ssl);
@@ -1459,69 +1553,69 @@ long SSL_get_verify_result(const SSL *ssl);
int SSL_set_ex_data(SSL *ssl,int idx,void *data);
void *SSL_get_ex_data(const SSL *ssl,int idx);
int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data);
void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss,int idx);
int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data);
void *SSL_CTX_get_ex_data(const SSL_CTX *ssl,int idx);
int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int SSL_get_ex_data_X509_STORE_CTX_idx(void );
#define SSL_CTX_sess_set_cache_size(ctx,t) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
#define SSL_CTX_sess_get_cache_size(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
#define SSL_CTX_set_session_cache_mode(ctx,m) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
#define SSL_CTX_get_session_cache_mode(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
#define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
#define SSL_CTX_get_read_ahead(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
#define SSL_CTX_set_read_ahead(ctx,m) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
#define SSL_CTX_get_max_cert_list(ctx) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
#define SSL_CTX_set_max_cert_list(ctx,m) \
- SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
#define SSL_get_max_cert_list(ssl) \
- SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+ SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
#define SSL_set_max_cert_list(ssl,m) \
- SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+ SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
/* NB: the keylength is only applicable when is_export is true */
#ifndef OPENSSL_NO_RSA
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
- RSA *(*cb)(SSL *ssl,int is_export,
- int keylength));
+ RSA *(*cb)(SSL *ssl,int is_export,
+ int keylength));
void SSL_set_tmp_rsa_callback(SSL *ssl,
- RSA *(*cb)(SSL *ssl,int is_export,
- int keylength));
+ RSA *(*cb)(SSL *ssl,int is_export,
+ int keylength));
#endif
#ifndef OPENSSL_NO_DH
void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
- DH *(*dh)(SSL *ssl,int is_export,
- int keylength));
+ DH *(*dh)(SSL *ssl,int is_export,
+ int keylength));
void SSL_set_tmp_dh_callback(SSL *ssl,
- DH *(*dh)(SSL *ssl,int is_export,
- int keylength));
+ DH *(*dh)(SSL *ssl,int is_export,
+ int keylength));
#endif
#ifndef OPENSSL_NO_ECDH
void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
- EC_KEY *(*ecdh)(SSL *ssl,int is_export,
- int keylength));
+ EC_KEY *(*ecdh)(SSL *ssl,int is_export,
+ int keylength));
void SSL_set_tmp_ecdh_callback(SSL *ssl,
- EC_KEY *(*ecdh)(SSL *ssl,int is_export,
- int keylength));
+ EC_KEY *(*ecdh)(SSL *ssl,int is_export,
+ int keylength));
#endif
#ifndef OPENSSL_NO_COMP
@@ -1547,415 +1641,435 @@ void ERR_load_SSL_strings(void);
/* Error codes for the SSL functions. */
/* Function codes. */
-#define SSL_F_CLIENT_CERTIFICATE 100
-#define SSL_F_CLIENT_FINISHED 167
-#define SSL_F_CLIENT_HELLO 101
-#define SSL_F_CLIENT_MASTER_KEY 102
-#define SSL_F_D2I_SSL_SESSION 103
-#define SSL_F_DO_DTLS1_WRITE 245
-#define SSL_F_DO_SSL3_WRITE 104
-#define SSL_F_DTLS1_ACCEPT 246
-#define SSL_F_DTLS1_BUFFER_RECORD 247
-#define SSL_F_DTLS1_CLIENT_HELLO 248
-#define SSL_F_DTLS1_CONNECT 249
-#define SSL_F_DTLS1_ENC 250
-#define SSL_F_DTLS1_GET_HELLO_VERIFY 251
-#define SSL_F_DTLS1_GET_MESSAGE 252
-#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253
-#define SSL_F_DTLS1_GET_RECORD 254
-#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
-#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
-#define SSL_F_DTLS1_PROCESS_RECORD 257
-#define SSL_F_DTLS1_READ_BYTES 258
-#define SSL_F_DTLS1_READ_FAILED 259
-#define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260
-#define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261
-#define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262
-#define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263
-#define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264
-#define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265
-#define SSL_F_DTLS1_SEND_SERVER_HELLO 266
-#define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267
-#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268
-#define SSL_F_GET_CLIENT_FINISHED 105
-#define SSL_F_GET_CLIENT_HELLO 106
-#define SSL_F_GET_CLIENT_MASTER_KEY 107
-#define SSL_F_GET_SERVER_FINISHED 108
-#define SSL_F_GET_SERVER_HELLO 109
-#define SSL_F_GET_SERVER_VERIFY 110
-#define SSL_F_I2D_SSL_SESSION 111
-#define SSL_F_READ_N 112
-#define SSL_F_REQUEST_CERTIFICATE 113
-#define SSL_F_SERVER_FINISH 239
-#define SSL_F_SERVER_HELLO 114
-#define SSL_F_SERVER_VERIFY 240
-#define SSL_F_SSL23_ACCEPT 115
-#define SSL_F_SSL23_CLIENT_HELLO 116
-#define SSL_F_SSL23_CONNECT 117
-#define SSL_F_SSL23_GET_CLIENT_HELLO 118
-#define SSL_F_SSL23_GET_SERVER_HELLO 119
-#define SSL_F_SSL23_PEEK 237
-#define SSL_F_SSL23_READ 120
-#define SSL_F_SSL23_WRITE 121
-#define SSL_F_SSL2_ACCEPT 122
-#define SSL_F_SSL2_CONNECT 123
-#define SSL_F_SSL2_ENC_INIT 124
-#define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241
-#define SSL_F_SSL2_PEEK 234
-#define SSL_F_SSL2_READ 125
-#define SSL_F_SSL2_READ_INTERNAL 236
-#define SSL_F_SSL2_SET_CERTIFICATE 126
-#define SSL_F_SSL2_WRITE 127
-#define SSL_F_SSL3_ACCEPT 128
-#define SSL_F_SSL3_CALLBACK_CTRL 233
-#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
-#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
-#define SSL_F_SSL3_CLIENT_HELLO 131
-#define SSL_F_SSL3_CONNECT 132
-#define SSL_F_SSL3_CTRL 213
-#define SSL_F_SSL3_CTX_CTRL 133
-#define SSL_F_SSL3_ENC 134
-#define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
-#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
-#define SSL_F_SSL3_GET_CERT_VERIFY 136
-#define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137
-#define SSL_F_SSL3_GET_CLIENT_HELLO 138
-#define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139
-#define SSL_F_SSL3_GET_FINISHED 140
-#define SSL_F_SSL3_GET_KEY_EXCHANGE 141
-#define SSL_F_SSL3_GET_MESSAGE 142
-#define SSL_F_SSL3_GET_RECORD 143
-#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144
-#define SSL_F_SSL3_GET_SERVER_DONE 145
-#define SSL_F_SSL3_GET_SERVER_HELLO 146
-#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
-#define SSL_F_SSL3_PEEK 235
-#define SSL_F_SSL3_READ_BYTES 148
-#define SSL_F_SSL3_READ_N 149
-#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150
-#define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151
-#define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152
-#define SSL_F_SSL3_SEND_CLIENT_VERIFY 153
-#define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154
-#define SSL_F_SSL3_SEND_SERVER_HELLO 242
-#define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155
-#define SSL_F_SSL3_SETUP_BUFFERS 156
-#define SSL_F_SSL3_SETUP_KEY_BLOCK 157
-#define SSL_F_SSL3_WRITE_BYTES 158
-#define SSL_F_SSL3_WRITE_PENDING 159
-#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
-#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
-#define SSL_F_SSL_BAD_METHOD 160
-#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
-#define SSL_F_SSL_CERT_DUP 221
-#define SSL_F_SSL_CERT_INST 222
-#define SSL_F_SSL_CERT_INSTANTIATE 214
-#define SSL_F_SSL_CERT_NEW 162
-#define SSL_F_SSL_CHECK_PRIVATE_KEY 163
-#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230
-#define SSL_F_SSL_CIPHER_STRENGTH_SORT 231
-#define SSL_F_SSL_CLEAR 164
-#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
-#define SSL_F_SSL_CREATE_CIPHER_LIST 166
-#define SSL_F_SSL_CTRL 232
-#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
-#define SSL_F_SSL_CTX_NEW 169
-#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
-#define SSL_F_SSL_CTX_SET_PURPOSE 226
-#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
-#define SSL_F_SSL_CTX_SET_SSL_VERSION 170
-#define SSL_F_SSL_CTX_SET_TRUST 229
-#define SSL_F_SSL_CTX_USE_CERTIFICATE 171
-#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
-#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220
-#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
-#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
-#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
-#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
-#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
-#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
-#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
-#define SSL_F_SSL_DO_HANDSHAKE 180
-#define SSL_F_SSL_GET_NEW_SESSION 181
-#define SSL_F_SSL_GET_PREV_SESSION 217
-#define SSL_F_SSL_GET_SERVER_SEND_CERT 182
-#define SSL_F_SSL_GET_SIGN_PKEY 183
-#define SSL_F_SSL_INIT_WBIO_BUFFER 184
-#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
-#define SSL_F_SSL_NEW 186
-#define SSL_F_SSL_PEEK 270
-#define SSL_F_SSL_READ 223
-#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
-#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
-#define SSL_F_SSL_SESSION_NEW 189
-#define SSL_F_SSL_SESSION_PRINT_FP 190
-#define SSL_F_SSL_SESS_CERT_NEW 225
-#define SSL_F_SSL_SET_CERT 191
-#define SSL_F_SSL_SET_CIPHER_LIST 271
-#define SSL_F_SSL_SET_FD 192
-#define SSL_F_SSL_SET_PKEY 193
-#define SSL_F_SSL_SET_PURPOSE 227
-#define SSL_F_SSL_SET_RFD 194
-#define SSL_F_SSL_SET_SESSION 195
-#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
-#define SSL_F_SSL_SET_TRUST 228
-#define SSL_F_SSL_SET_WFD 196
-#define SSL_F_SSL_SHUTDOWN 224
-#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243
-#define SSL_F_SSL_UNDEFINED_FUNCTION 197
-#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
-#define SSL_F_SSL_USE_CERTIFICATE 198
-#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
-#define SSL_F_SSL_USE_CERTIFICATE_FILE 200
-#define SSL_F_SSL_USE_PRIVATEKEY 201
-#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
-#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
-#define SSL_F_SSL_USE_RSAPRIVATEKEY 204
-#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
-#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
-#define SSL_F_SSL_VERIFY_CERT_CHAIN 207
-#define SSL_F_SSL_WRITE 208
-#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
-#define SSL_F_TLS1_ENC 210
-#define SSL_F_TLS1_SETUP_KEY_BLOCK 211
-#define SSL_F_WRITE_PENDING 212
+#define SSL_F_CLIENT_CERTIFICATE 100
+#define SSL_F_CLIENT_FINISHED 167
+#define SSL_F_CLIENT_HELLO 101
+#define SSL_F_CLIENT_MASTER_KEY 102
+#define SSL_F_D2I_SSL_SESSION 103
+#define SSL_F_DO_DTLS1_WRITE 245
+#define SSL_F_DO_SSL3_WRITE 104
+#define SSL_F_DTLS1_ACCEPT 246
+#define SSL_F_DTLS1_BUFFER_RECORD 247
+#define SSL_F_DTLS1_CLIENT_HELLO 248
+#define SSL_F_DTLS1_CONNECT 249
+#define SSL_F_DTLS1_ENC 250
+#define SSL_F_DTLS1_GET_HELLO_VERIFY 251
+#define SSL_F_DTLS1_GET_MESSAGE 252
+#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253
+#define SSL_F_DTLS1_GET_RECORD 254
+#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
+#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 277
+#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
+#define SSL_F_DTLS1_PROCESS_RECORD 257
+#define SSL_F_DTLS1_READ_BYTES 258
+#define SSL_F_DTLS1_READ_FAILED 259
+#define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260
+#define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261
+#define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262
+#define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263
+#define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264
+#define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265
+#define SSL_F_DTLS1_SEND_SERVER_HELLO 266
+#define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267
+#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268
+#define SSL_F_GET_CLIENT_FINISHED 105
+#define SSL_F_GET_CLIENT_HELLO 106
+#define SSL_F_GET_CLIENT_MASTER_KEY 107
+#define SSL_F_GET_SERVER_FINISHED 108
+#define SSL_F_GET_SERVER_HELLO 109
+#define SSL_F_GET_SERVER_VERIFY 110
+#define SSL_F_I2D_SSL_SESSION 111
+#define SSL_F_READ_N 112
+#define SSL_F_REQUEST_CERTIFICATE 113
+#define SSL_F_SERVER_FINISH 239
+#define SSL_F_SERVER_HELLO 114
+#define SSL_F_SERVER_VERIFY 240
+#define SSL_F_SSL23_ACCEPT 115
+#define SSL_F_SSL23_CLIENT_HELLO 116
+#define SSL_F_SSL23_CONNECT 117
+#define SSL_F_SSL23_GET_CLIENT_HELLO 118
+#define SSL_F_SSL23_GET_SERVER_HELLO 119
+#define SSL_F_SSL23_PEEK 237
+#define SSL_F_SSL23_READ 120
+#define SSL_F_SSL23_WRITE 121
+#define SSL_F_SSL2_ACCEPT 122
+#define SSL_F_SSL2_CONNECT 123
+#define SSL_F_SSL2_ENC_INIT 124
+#define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241
+#define SSL_F_SSL2_PEEK 234
+#define SSL_F_SSL2_READ 125
+#define SSL_F_SSL2_READ_INTERNAL 236
+#define SSL_F_SSL2_SET_CERTIFICATE 126
+#define SSL_F_SSL2_WRITE 127
+#define SSL_F_SSL3_ACCEPT 128
+#define SSL_F_SSL3_CALLBACK_CTRL 233
+#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
+#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
+#define SSL_F_SSL3_CLIENT_HELLO 131
+#define SSL_F_SSL3_CONNECT 132
+#define SSL_F_SSL3_CTRL 213
+#define SSL_F_SSL3_CTX_CTRL 133
+#define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 279
+#define SSL_F_SSL3_ENC 134
+#define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
+#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
+#define SSL_F_SSL3_GET_CERT_STATUS 288
+#define SSL_F_SSL3_GET_CERT_VERIFY 136
+#define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137
+#define SSL_F_SSL3_GET_CLIENT_HELLO 138
+#define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139
+#define SSL_F_SSL3_GET_FINISHED 140
+#define SSL_F_SSL3_GET_KEY_EXCHANGE 141
+#define SSL_F_SSL3_GET_MESSAGE 142
+#define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283
+#define SSL_F_SSL3_GET_RECORD 143
+#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144
+#define SSL_F_SSL3_GET_SERVER_DONE 145
+#define SSL_F_SSL3_GET_SERVER_HELLO 146
+#define SSL_F_SSL3_NEW_SESSION_TICKET 284
+#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
+#define SSL_F_SSL3_PEEK 235
+#define SSL_F_SSL3_READ_BYTES 148
+#define SSL_F_SSL3_READ_N 149
+#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150
+#define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151
+#define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152
+#define SSL_F_SSL3_SEND_CLIENT_VERIFY 153
+#define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154
+#define SSL_F_SSL3_SEND_SERVER_HELLO 242
+#define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155
+#define SSL_F_SSL3_SETUP_BUFFERS 156
+#define SSL_F_SSL3_SETUP_KEY_BLOCK 157
+#define SSL_F_SSL3_WRITE_BYTES 158
+#define SSL_F_SSL3_WRITE_PENDING 159
+#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 272
+#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
+#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
+#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 273
+#define SSL_F_SSL_BAD_METHOD 160
+#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
+#define SSL_F_SSL_CERT_DUP 221
+#define SSL_F_SSL_CERT_INST 222
+#define SSL_F_SSL_CERT_INSTANTIATE 214
+#define SSL_F_SSL_CERT_NEW 162
+#define SSL_F_SSL_CHECK_PRIVATE_KEY 163
+#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 274
+#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230
+#define SSL_F_SSL_CIPHER_STRENGTH_SORT 231
+#define SSL_F_SSL_CLEAR 164
+#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
+#define SSL_F_SSL_CREATE_CIPHER_LIST 166
+#define SSL_F_SSL_CTRL 232
+#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
+#define SSL_F_SSL_CTX_NEW 169
+#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
+#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 278
+#define SSL_F_SSL_CTX_SET_PURPOSE 226
+#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
+#define SSL_F_SSL_CTX_SET_SSL_VERSION 170
+#define SSL_F_SSL_CTX_SET_TRUST 229
+#define SSL_F_SSL_CTX_USE_CERTIFICATE 171
+#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
+#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220
+#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
+#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
+#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
+#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
+#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
+#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
+#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
+#define SSL_F_SSL_DO_HANDSHAKE 180
+#define SSL_F_SSL_GET_NEW_SESSION 181
+#define SSL_F_SSL_GET_PREV_SESSION 217
+#define SSL_F_SSL_GET_SERVER_SEND_CERT 182
+#define SSL_F_SSL_GET_SIGN_PKEY 183
+#define SSL_F_SSL_INIT_WBIO_BUFFER 184
+#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
+#define SSL_F_SSL_NEW 186
+#define SSL_F_SSL_PEEK 270
+#define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 275
+#define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 276
+#define SSL_F_SSL_READ 223
+#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
+#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
+#define SSL_F_SSL_SESSION_NEW 189
+#define SSL_F_SSL_SESSION_PRINT_FP 190
+#define SSL_F_SSL_SESS_CERT_NEW 225
+#define SSL_F_SSL_SET_CERT 191
+#define SSL_F_SSL_SET_CIPHER_LIST 271
+#define SSL_F_SSL_SET_FD 192
+#define SSL_F_SSL_SET_PKEY 193
+#define SSL_F_SSL_SET_PURPOSE 227
+#define SSL_F_SSL_SET_RFD 194
+#define SSL_F_SSL_SET_SESSION 195
+#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
+#define SSL_F_SSL_SET_TRUST 228
+#define SSL_F_SSL_SET_WFD 196
+#define SSL_F_SSL_SHUTDOWN 224
+#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243
+#define SSL_F_SSL_UNDEFINED_FUNCTION 197
+#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
+#define SSL_F_SSL_USE_CERTIFICATE 198
+#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
+#define SSL_F_SSL_USE_CERTIFICATE_FILE 200
+#define SSL_F_SSL_USE_PRIVATEKEY 201
+#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
+#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
+#define SSL_F_SSL_USE_RSAPRIVATEKEY 204
+#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
+#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
+#define SSL_F_SSL_VERIFY_CERT_CHAIN 207
+#define SSL_F_SSL_WRITE 208
+#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
+#define SSL_F_TLS1_ENC 210
+#define SSL_F_TLS1_SETUP_KEY_BLOCK 211
+#define SSL_F_WRITE_PENDING 212
/* Reason codes. */
-#define SSL_R_APP_DATA_IN_HANDSHAKE 100
+#define SSL_R_APP_DATA_IN_HANDSHAKE 100
#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
-#define SSL_R_BAD_ALERT_RECORD 101
-#define SSL_R_BAD_AUTHENTICATION_TYPE 102
-#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
-#define SSL_R_BAD_CHECKSUM 104
-#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
-#define SSL_R_BAD_DECOMPRESSION 107
-#define SSL_R_BAD_DH_G_LENGTH 108
-#define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
-#define SSL_R_BAD_DH_P_LENGTH 110
-#define SSL_R_BAD_DIGEST_LENGTH 111
-#define SSL_R_BAD_DSA_SIGNATURE 112
-#define SSL_R_BAD_ECC_CERT 304
-#define SSL_R_BAD_ECDSA_SIGNATURE 305
-#define SSL_R_BAD_ECPOINT 306
-#define SSL_R_BAD_HELLO_REQUEST 105
-#define SSL_R_BAD_LENGTH 271
-#define SSL_R_BAD_MAC_DECODE 113
-#define SSL_R_BAD_MESSAGE_TYPE 114
-#define SSL_R_BAD_PACKET_LENGTH 115
-#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
-#define SSL_R_BAD_RESPONSE_ARGUMENT 117
-#define SSL_R_BAD_RSA_DECRYPT 118
-#define SSL_R_BAD_RSA_ENCRYPT 119
-#define SSL_R_BAD_RSA_E_LENGTH 120
-#define SSL_R_BAD_RSA_MODULUS_LENGTH 121
-#define SSL_R_BAD_RSA_SIGNATURE 122
-#define SSL_R_BAD_SIGNATURE 123
-#define SSL_R_BAD_SSL_FILETYPE 124
-#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125
-#define SSL_R_BAD_STATE 126
-#define SSL_R_BAD_WRITE_RETRY 127
-#define SSL_R_BIO_NOT_SET 128
-#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
-#define SSL_R_BN_LIB 130
-#define SSL_R_CA_DN_LENGTH_MISMATCH 131
-#define SSL_R_CA_DN_TOO_LONG 132
-#define SSL_R_CCS_RECEIVED_EARLY 133
-#define SSL_R_CERTIFICATE_VERIFY_FAILED 134
-#define SSL_R_CERT_LENGTH_MISMATCH 135
-#define SSL_R_CHALLENGE_IS_DIFFERENT 136
-#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
-#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138
-#define SSL_R_CIPHER_TABLE_SRC_ERROR 139
-#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
-#define SSL_R_COMPRESSION_FAILURE 141
-#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
-#define SSL_R_COMPRESSION_LIBRARY_ERROR 142
-#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
-#define SSL_R_CONNECTION_TYPE_NOT_SET 144
-#define SSL_R_COOKIE_MISMATCH 308
-#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
-#define SSL_R_DATA_LENGTH_TOO_LONG 146
-#define SSL_R_DECRYPTION_FAILED 147
-#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
-#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
-#define SSL_R_DIGEST_CHECK_FAILED 149
-#define SSL_R_DUPLICATE_COMPRESSION_ID 309
-#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310
-#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
-#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282
-#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
-#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
-#define SSL_R_EXTRA_DATA_IN_MESSAGE 153
-#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
-#define SSL_R_HTTPS_PROXY_REQUEST 155
-#define SSL_R_HTTP_REQUEST 156
-#define SSL_R_ILLEGAL_PADDING 283
-#define SSL_R_INVALID_CHALLENGE_LENGTH 158
-#define SSL_R_INVALID_COMMAND 280
-#define SSL_R_INVALID_PURPOSE 278
-#define SSL_R_INVALID_TRUST 279
-#define SSL_R_KEY_ARG_TOO_LONG 284
-#define SSL_R_KRB5 285
-#define SSL_R_KRB5_C_CC_PRINC 286
-#define SSL_R_KRB5_C_GET_CRED 287
-#define SSL_R_KRB5_C_INIT 288
-#define SSL_R_KRB5_C_MK_REQ 289
-#define SSL_R_KRB5_S_BAD_TICKET 290
-#define SSL_R_KRB5_S_INIT 291
-#define SSL_R_KRB5_S_RD_REQ 292
-#define SSL_R_KRB5_S_TKT_EXPIRED 293
-#define SSL_R_KRB5_S_TKT_NYV 294
-#define SSL_R_KRB5_S_TKT_SKEW 295
-#define SSL_R_LENGTH_MISMATCH 159
-#define SSL_R_LENGTH_TOO_SHORT 160
-#define SSL_R_LIBRARY_BUG 274
-#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
-#define SSL_R_MESSAGE_TOO_LONG 296
-#define SSL_R_MISSING_DH_DSA_CERT 162
-#define SSL_R_MISSING_DH_KEY 163
-#define SSL_R_MISSING_DH_RSA_CERT 164
-#define SSL_R_MISSING_DSA_SIGNING_CERT 165
-#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166
-#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167
-#define SSL_R_MISSING_RSA_CERTIFICATE 168
-#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
-#define SSL_R_MISSING_RSA_SIGNING_CERT 170
-#define SSL_R_MISSING_TMP_DH_KEY 171
-#define SSL_R_MISSING_TMP_ECDH_KEY 311
-#define SSL_R_MISSING_TMP_RSA_KEY 172
-#define SSL_R_MISSING_TMP_RSA_PKEY 173
-#define SSL_R_MISSING_VERIFY_MESSAGE 174
-#define SSL_R_NON_SSLV2_INITIAL_PACKET 175
-#define SSL_R_NO_CERTIFICATES_RETURNED 176
-#define SSL_R_NO_CERTIFICATE_ASSIGNED 177
-#define SSL_R_NO_CERTIFICATE_RETURNED 178
-#define SSL_R_NO_CERTIFICATE_SET 179
-#define SSL_R_NO_CERTIFICATE_SPECIFIED 180
-#define SSL_R_NO_CIPHERS_AVAILABLE 181
-#define SSL_R_NO_CIPHERS_PASSED 182
-#define SSL_R_NO_CIPHERS_SPECIFIED 183
-#define SSL_R_NO_CIPHER_LIST 184
-#define SSL_R_NO_CIPHER_MATCH 185
-#define SSL_R_NO_CLIENT_CERT_RECEIVED 186
-#define SSL_R_NO_COMPRESSION_SPECIFIED 187
-#define SSL_R_NO_METHOD_SPECIFIED 188
-#define SSL_R_NO_PRIVATEKEY 189
-#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
-#define SSL_R_NO_PROTOCOLS_AVAILABLE 191
-#define SSL_R_NO_PUBLICKEY 192
-#define SSL_R_NO_SHARED_CIPHER 193
-#define SSL_R_NO_VERIFY_CALLBACK 194
-#define SSL_R_NULL_SSL_CTX 195
-#define SSL_R_NULL_SSL_METHOD_PASSED 196
-#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
-#define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297
-#define SSL_R_PACKET_LENGTH_TOO_LONG 198
-#define SSL_R_PATH_TOO_LONG 270
-#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
-#define SSL_R_PEER_ERROR 200
-#define SSL_R_PEER_ERROR_CERTIFICATE 201
-#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202
-#define SSL_R_PEER_ERROR_NO_CIPHER 203
-#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204
-#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205
-#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206
-#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
-#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
-#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
-#define SSL_R_PUBLIC_KEY_NOT_RSA 210
-#define SSL_R_READ_BIO_NOT_SET 211
-#define SSL_R_READ_TIMEOUT_EXPIRED 312
-#define SSL_R_READ_WRONG_PACKET_TYPE 212
-#define SSL_R_RECORD_LENGTH_MISMATCH 213
-#define SSL_R_RECORD_TOO_LARGE 214
-#define SSL_R_RECORD_TOO_SMALL 298
-#define SSL_R_REQUIRED_CIPHER_MISSING 215
-#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
-#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
-#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
-#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
-#define SSL_R_SHORT_READ 219
-#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
-#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
-#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299
-#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
-#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222
-#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
-#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
-#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
-#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
-#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
-#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
-#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
-#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
-#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
-#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
-#define SSL_R_SSL_HANDSHAKE_FAILURE 229
-#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
-#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
-#define SSL_R_SSL_SESSION_ID_CONFLICT 302
-#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
-#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
-#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231
-#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
-#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
-#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
-#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
-#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
-#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
-#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
-#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
-#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
-#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
-#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
-#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
-#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
+#define SSL_R_BAD_ALERT_RECORD 101
+#define SSL_R_BAD_AUTHENTICATION_TYPE 102
+#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
+#define SSL_R_BAD_CHECKSUM 104
+#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
+#define SSL_R_BAD_DECOMPRESSION 107
+#define SSL_R_BAD_DH_G_LENGTH 108
+#define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
+#define SSL_R_BAD_DH_P_LENGTH 110
+#define SSL_R_BAD_DIGEST_LENGTH 111
+#define SSL_R_BAD_DSA_SIGNATURE 112
+#define SSL_R_BAD_ECC_CERT 304
+#define SSL_R_BAD_ECDSA_SIGNATURE 305
+#define SSL_R_BAD_ECPOINT 306
+#define SSL_R_BAD_HELLO_REQUEST 105
+#define SSL_R_BAD_LENGTH 271
+#define SSL_R_BAD_MAC_DECODE 113
+#define SSL_R_BAD_MESSAGE_TYPE 114
+#define SSL_R_BAD_PACKET_LENGTH 115
+#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
+#define SSL_R_BAD_RESPONSE_ARGUMENT 117
+#define SSL_R_BAD_RSA_DECRYPT 118
+#define SSL_R_BAD_RSA_ENCRYPT 119
+#define SSL_R_BAD_RSA_E_LENGTH 120
+#define SSL_R_BAD_RSA_MODULUS_LENGTH 121
+#define SSL_R_BAD_RSA_SIGNATURE 122
+#define SSL_R_BAD_SIGNATURE 123
+#define SSL_R_BAD_SSL_FILETYPE 124
+#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125
+#define SSL_R_BAD_STATE 126
+#define SSL_R_BAD_WRITE_RETRY 127
+#define SSL_R_BIO_NOT_SET 128
+#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
+#define SSL_R_BN_LIB 130
+#define SSL_R_CA_DN_LENGTH_MISMATCH 131
+#define SSL_R_CA_DN_TOO_LONG 132
+#define SSL_R_CCS_RECEIVED_EARLY 133
+#define SSL_R_CERTIFICATE_VERIFY_FAILED 134
+#define SSL_R_CERT_LENGTH_MISMATCH 135
+#define SSL_R_CHALLENGE_IS_DIFFERENT 136
+#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
+#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138
+#define SSL_R_CIPHER_TABLE_SRC_ERROR 139
+#define SSL_R_CLIENTHELLO_TLSEXT 157
+#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
+#define SSL_R_COMPRESSION_FAILURE 141
+#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
+#define SSL_R_COMPRESSION_LIBRARY_ERROR 142
+#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
+#define SSL_R_CONNECTION_TYPE_NOT_SET 144
+#define SSL_R_COOKIE_MISMATCH 308
+#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
+#define SSL_R_DATA_LENGTH_TOO_LONG 146
+#define SSL_R_DECRYPTION_FAILED 147
+#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
+#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
+#define SSL_R_DIGEST_CHECK_FAILED 149
+#define SSL_R_DUPLICATE_COMPRESSION_ID 309
+#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310
+#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
+#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282
+#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
+#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
+#define SSL_R_EXTRA_DATA_IN_MESSAGE 153
+#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
+#define SSL_R_HTTPS_PROXY_REQUEST 155
+#define SSL_R_HTTP_REQUEST 156
+#define SSL_R_ILLEGAL_PADDING 283
+#define SSL_R_INVALID_CHALLENGE_LENGTH 158
+#define SSL_R_INVALID_COMMAND 280
+#define SSL_R_INVALID_PURPOSE 278
+#define SSL_R_INVALID_STATUS_RESPONSE 316
+#define SSL_R_INVALID_TICKET_KEYS_LENGTH 275
+#define SSL_R_INVALID_TRUST 279
+#define SSL_R_KEY_ARG_TOO_LONG 284
+#define SSL_R_KRB5 285
+#define SSL_R_KRB5_C_CC_PRINC 286
+#define SSL_R_KRB5_C_GET_CRED 287
+#define SSL_R_KRB5_C_INIT 288
+#define SSL_R_KRB5_C_MK_REQ 289
+#define SSL_R_KRB5_S_BAD_TICKET 290
+#define SSL_R_KRB5_S_INIT 291
+#define SSL_R_KRB5_S_RD_REQ 292
+#define SSL_R_KRB5_S_TKT_EXPIRED 293
+#define SSL_R_KRB5_S_TKT_NYV 294
+#define SSL_R_KRB5_S_TKT_SKEW 295
+#define SSL_R_LENGTH_MISMATCH 159
+#define SSL_R_LENGTH_TOO_SHORT 160
+#define SSL_R_LIBRARY_BUG 274
+#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
+#define SSL_R_MESSAGE_TOO_LONG 296
+#define SSL_R_MISSING_DH_DSA_CERT 162
+#define SSL_R_MISSING_DH_KEY 163
+#define SSL_R_MISSING_DH_RSA_CERT 164
+#define SSL_R_MISSING_DSA_SIGNING_CERT 165
+#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166
+#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167
+#define SSL_R_MISSING_RSA_CERTIFICATE 168
+#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
+#define SSL_R_MISSING_RSA_SIGNING_CERT 170
+#define SSL_R_MISSING_TMP_DH_KEY 171
+#define SSL_R_MISSING_TMP_ECDH_KEY 311
+#define SSL_R_MISSING_TMP_RSA_KEY 172
+#define SSL_R_MISSING_TMP_RSA_PKEY 173
+#define SSL_R_MISSING_VERIFY_MESSAGE 174
+#define SSL_R_NON_SSLV2_INITIAL_PACKET 175
+#define SSL_R_NO_CERTIFICATES_RETURNED 176
+#define SSL_R_NO_CERTIFICATE_ASSIGNED 177
+#define SSL_R_NO_CERTIFICATE_RETURNED 178
+#define SSL_R_NO_CERTIFICATE_SET 179
+#define SSL_R_NO_CERTIFICATE_SPECIFIED 180
+#define SSL_R_NO_CIPHERS_AVAILABLE 181
+#define SSL_R_NO_CIPHERS_PASSED 182
+#define SSL_R_NO_CIPHERS_SPECIFIED 183
+#define SSL_R_NO_CIPHER_LIST 184
+#define SSL_R_NO_CIPHER_MATCH 185
+#define SSL_R_NO_CLIENT_CERT_METHOD 317
+#define SSL_R_NO_CLIENT_CERT_RECEIVED 186
+#define SSL_R_NO_COMPRESSION_SPECIFIED 187
+#define SSL_R_NO_METHOD_SPECIFIED 188
+#define SSL_R_NO_PRIVATEKEY 189
+#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
+#define SSL_R_NO_PROTOCOLS_AVAILABLE 191
+#define SSL_R_NO_PUBLICKEY 192
+#define SSL_R_NO_SHARED_CIPHER 193
+#define SSL_R_NO_VERIFY_CALLBACK 194
+#define SSL_R_NULL_SSL_CTX 195
+#define SSL_R_NULL_SSL_METHOD_PASSED 196
+#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
+#define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297
+#define SSL_R_PACKET_LENGTH_TOO_LONG 198
+#define SSL_R_PARSE_TLSEXT 223
+#define SSL_R_PATH_TOO_LONG 270
+#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
+#define SSL_R_PEER_ERROR 200
+#define SSL_R_PEER_ERROR_CERTIFICATE 201
+#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202
+#define SSL_R_PEER_ERROR_NO_CIPHER 203
+#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204
+#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205
+#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206
+#define SSL_R_PROTOCOL_IS_SHUTDOWN 207
+#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
+#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
+#define SSL_R_PUBLIC_KEY_NOT_RSA 210
+#define SSL_R_READ_BIO_NOT_SET 211
+#define SSL_R_READ_TIMEOUT_EXPIRED 312
+#define SSL_R_READ_WRONG_PACKET_TYPE 212
+#define SSL_R_RECORD_LENGTH_MISMATCH 213
+#define SSL_R_RECORD_TOO_LARGE 214
+#define SSL_R_RECORD_TOO_SMALL 298
+#define SSL_R_REQUIRED_CIPHER_MISSING 215
+#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
+#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
+#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
+#define SSL_R_SERVERHELLO_TLSEXT 224
+#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
+#define SSL_R_SHORT_READ 219
+#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
+#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
+#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299
+#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 225
+#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 226
+#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
+#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222
+#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
+#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
+#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
+#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
+#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
+#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
+#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
+#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
+#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
+#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
+#define SSL_R_SSL_HANDSHAKE_FAILURE 229
+#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
+#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
+#define SSL_R_SSL_SESSION_ID_CONFLICT 302
+#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
+#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
+#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231
+#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
+#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
+#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
+#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
+#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
+#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
+#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
+#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
+#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
+#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
+#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
+#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
+#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
+#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 227
#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
-#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
-#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
-#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
-#define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313
-#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237
-#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238
-#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
-#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
-#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240
-#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241
-#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
-#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
-#define SSL_R_UNEXPECTED_MESSAGE 244
-#define SSL_R_UNEXPECTED_RECORD 245
-#define SSL_R_UNINITIALIZED 276
-#define SSL_R_UNKNOWN_ALERT_TYPE 246
-#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
-#define SSL_R_UNKNOWN_CIPHER_RETURNED 248
-#define SSL_R_UNKNOWN_CIPHER_TYPE 249
-#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
-#define SSL_R_UNKNOWN_PKEY_TYPE 251
-#define SSL_R_UNKNOWN_PROTOCOL 252
-#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253
-#define SSL_R_UNKNOWN_SSL_VERSION 254
-#define SSL_R_UNKNOWN_STATE 255
-#define SSL_R_UNSUPPORTED_CIPHER 256
-#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
-#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
-#define SSL_R_UNSUPPORTED_PROTOCOL 258
-#define SSL_R_UNSUPPORTED_SSL_VERSION 259
-#define SSL_R_WRITE_BIO_NOT_SET 260
-#define SSL_R_WRONG_CIPHER_RETURNED 261
-#define SSL_R_WRONG_MESSAGE_TYPE 262
-#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
-#define SSL_R_WRONG_SIGNATURE_LENGTH 264
-#define SSL_R_WRONG_SIGNATURE_SIZE 265
-#define SSL_R_WRONG_SSL_VERSION 266
-#define SSL_R_WRONG_VERSION_NUMBER 267
-#define SSL_R_X509_LIB 268
-#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
+#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
+#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
+#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
+#define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313
+#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237
+#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238
+#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
+#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
+#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240
+#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241
+#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
+#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
+#define SSL_R_UNEXPECTED_MESSAGE 244
+#define SSL_R_UNEXPECTED_RECORD 245
+#define SSL_R_UNINITIALIZED 276
+#define SSL_R_UNKNOWN_ALERT_TYPE 246
+#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
+#define SSL_R_UNKNOWN_CIPHER_RETURNED 248
+#define SSL_R_UNKNOWN_CIPHER_TYPE 249
+#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
+#define SSL_R_UNKNOWN_PKEY_TYPE 251
+#define SSL_R_UNKNOWN_PROTOCOL 252
+#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253
+#define SSL_R_UNKNOWN_SSL_VERSION 254
+#define SSL_R_UNKNOWN_STATE 255
+#define SSL_R_UNSUPPORTED_CIPHER 256
+#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
+#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
+#define SSL_R_UNSUPPORTED_PROTOCOL 258
+#define SSL_R_UNSUPPORTED_SSL_VERSION 259
+#define SSL_R_UNSUPPORTED_STATUS_TYPE 329
+#define SSL_R_WRITE_BIO_NOT_SET 260
+#define SSL_R_WRONG_CIPHER_RETURNED 261
+#define SSL_R_WRONG_MESSAGE_TYPE 262
+#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
+#define SSL_R_WRONG_SIGNATURE_LENGTH 264
+#define SSL_R_WRONG_SIGNATURE_SIZE 265
+#define SSL_R_WRONG_SSL_VERSION 266
+#define SSL_R_WRONG_VERSION_NUMBER 267
+#define SSL_R_X509_LIB 268
+#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/ssl3.h b/dep/include/openssl/ssl3.h
index d7687ec8266..4b1e2e98347 100644
--- a/dep/include/openssl/ssl3.h
+++ b/dep/include/openssl/ssl3.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -63,7 +63,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -110,12 +110,12 @@
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECC cipher suite support in OpenSSL originally developed by
+ * ECC cipher suite support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
-#ifndef HEADER_SSL3_H
-#define HEADER_SSL3_H
+#ifndef HEADER_SSL3_H
+#define HEADER_SSL3_H
#ifndef OPENSSL_NO_COMP
#include <openssl/comp.h>
@@ -129,428 +129,437 @@
extern "C" {
#endif
-#define SSL3_CK_RSA_NULL_MD5 0x03000001
-#define SSL3_CK_RSA_NULL_SHA 0x03000002
-#define SSL3_CK_RSA_RC4_40_MD5 0x03000003
-#define SSL3_CK_RSA_RC4_128_MD5 0x03000004
-#define SSL3_CK_RSA_RC4_128_SHA 0x03000005
-#define SSL3_CK_RSA_RC2_40_MD5 0x03000006
-#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
-#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
-#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
-#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
-
-#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
-#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
-#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
-#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
-#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
-#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
-
-#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011
-#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012
-#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013
-#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014
-#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015
-#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016
-
-#define SSL3_CK_ADH_RC4_40_MD5 0x03000017
-#define SSL3_CK_ADH_RC4_128_MD5 0x03000018
-#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
-#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
-#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
-
-#define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C
-#define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D
+#define SSL3_CK_RSA_NULL_MD5 0x03000001
+#define SSL3_CK_RSA_NULL_SHA 0x03000002
+#define SSL3_CK_RSA_RC4_40_MD5 0x03000003
+#define SSL3_CK_RSA_RC4_128_MD5 0x03000004
+#define SSL3_CK_RSA_RC4_128_SHA 0x03000005
+#define SSL3_CK_RSA_RC2_40_MD5 0x03000006
+#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
+#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
+#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
+#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
+
+#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
+#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
+#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
+#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
+#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
+#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
+
+#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011
+#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012
+#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013
+#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014
+#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015
+#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016
+
+#define SSL3_CK_ADH_RC4_40_MD5 0x03000017
+#define SSL3_CK_ADH_RC4_128_MD5 0x03000018
+#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
+#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
+#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
+
+#define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C
+#define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D
#if 0 /* Because it clashes with KRB5, is never used any more, and is safe
- to remove according to David Hopwood <david.hopwood@zetnet.co.uk>
- of the ietf-tls list */
-#define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E
+ to remove according to David Hopwood <david.hopwood@zetnet.co.uk>
+ of the ietf-tls list */
+#define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E
#endif
/* VRS Additional Kerberos5 entries
*/
-#define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E
-#define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F
-#define SSL3_CK_KRB5_RC4_128_SHA 0x03000020
-#define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021
-#define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022
-#define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023
-#define SSL3_CK_KRB5_RC4_128_MD5 0x03000024
-#define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025
-
-#define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026
-#define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027
-#define SSL3_CK_KRB5_RC4_40_SHA 0x03000028
-#define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029
-#define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A
-#define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B
-
-#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
-#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
-#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
-#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
-#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
-#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
-#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
-#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
-#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
-#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
-
-#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
-#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
-#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
-#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
-#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
-#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
-
-#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
-#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
-#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
-#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
-#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
-#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
-
-#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
-#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
-#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
-#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
-#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
-
-#define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA"
-#define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA"
-#define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA"
-
-#define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA"
-#define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA"
-#define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA"
-#define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA"
-#define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5"
-#define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5"
-#define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5"
-#define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5"
-
-#define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA"
-#define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA"
-#define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA"
-#define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5"
-#define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5"
-#define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5"
-
-#define SSL3_SSL_SESSION_ID_LENGTH 32
-#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
-
-#define SSL3_MASTER_SECRET_SIZE 48
-#define SSL3_RANDOM_SIZE 32
-#define SSL3_SESSION_ID_SIZE 32
-#define SSL3_RT_HEADER_LENGTH 5
+#define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E
+#define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F
+#define SSL3_CK_KRB5_RC4_128_SHA 0x03000020
+#define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021
+#define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022
+#define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023
+#define SSL3_CK_KRB5_RC4_128_MD5 0x03000024
+#define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025
+
+#define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026
+#define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027
+#define SSL3_CK_KRB5_RC4_40_SHA 0x03000028
+#define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029
+#define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A
+#define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B
+
+#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
+#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
+#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
+#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
+#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
+#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
+#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
+#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
+#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
+#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
+
+#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
+#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
+#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
+#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
+#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
+#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
+
+#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
+#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
+#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
+#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
+#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
+#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
+
+#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
+#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
+#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
+#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
+#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
+
+#define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA"
+#define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA"
+#define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA"
+
+#define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA"
+#define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA"
+#define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA"
+#define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA"
+#define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5"
+#define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5"
+#define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5"
+#define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5"
+
+#define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA"
+#define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA"
+#define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA"
+#define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5"
+#define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5"
+#define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5"
+
+#define SSL3_SSL_SESSION_ID_LENGTH 32
+#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
+
+#define SSL3_MASTER_SECRET_SIZE 48
+#define SSL3_RANDOM_SIZE 32
+#define SSL3_SESSION_ID_SIZE 32
+#define SSL3_RT_HEADER_LENGTH 5
/* Due to MS stuffing up, this can change.... */
#if defined(OPENSSL_SYS_WIN16) || \
- (defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32))
-#define SSL3_RT_MAX_EXTRA (14000)
+ (defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32))
+#define SSL3_RT_MAX_EXTRA (14000)
#else
-#define SSL3_RT_MAX_EXTRA (16384)
+#define SSL3_RT_MAX_EXTRA (16384)
#endif
-#define SSL3_RT_MAX_PLAIN_LENGTH 16384
+#define SSL3_RT_MAX_PLAIN_LENGTH 16384
#ifdef OPENSSL_NO_COMP
-#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
+#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
#else
-#define SSL3_RT_MAX_COMPRESSED_LENGTH (1024+SSL3_RT_MAX_PLAIN_LENGTH)
+#define SSL3_RT_MAX_COMPRESSED_LENGTH (1024+SSL3_RT_MAX_PLAIN_LENGTH)
#endif
-#define SSL3_RT_MAX_ENCRYPTED_LENGTH (1024+SSL3_RT_MAX_COMPRESSED_LENGTH)
-#define SSL3_RT_MAX_PACKET_SIZE (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)
-#define SSL3_RT_MAX_DATA_SIZE (1024*1024)
-
-#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
-#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
-
-#define SSL3_VERSION 0x0300
-#define SSL3_VERSION_MAJOR 0x03
-#define SSL3_VERSION_MINOR 0x00
-
-#define SSL3_RT_CHANGE_CIPHER_SPEC 20
-#define SSL3_RT_ALERT 21
-#define SSL3_RT_HANDSHAKE 22
-#define SSL3_RT_APPLICATION_DATA 23
-
-#define SSL3_AL_WARNING 1
-#define SSL3_AL_FATAL 2
-
-#define SSL3_AD_CLOSE_NOTIFY 0
-#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */
-#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */
-#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */
-#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
-#define SSL3_AD_NO_CERTIFICATE 41
-#define SSL3_AD_BAD_CERTIFICATE 42
-#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
-#define SSL3_AD_CERTIFICATE_REVOKED 44
-#define SSL3_AD_CERTIFICATE_EXPIRED 45
-#define SSL3_AD_CERTIFICATE_UNKNOWN 46
-#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
+#define SSL3_RT_MAX_ENCRYPTED_LENGTH (1024+SSL3_RT_MAX_COMPRESSED_LENGTH)
+#define SSL3_RT_MAX_PACKET_SIZE (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)
+#define SSL3_RT_MAX_DATA_SIZE (1024*1024)
+
+#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
+#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
+
+#define SSL3_VERSION 0x0300
+#define SSL3_VERSION_MAJOR 0x03
+#define SSL3_VERSION_MINOR 0x00
+
+#define SSL3_RT_CHANGE_CIPHER_SPEC 20
+#define SSL3_RT_ALERT 21
+#define SSL3_RT_HANDSHAKE 22
+#define SSL3_RT_APPLICATION_DATA 23
+
+#define SSL3_AL_WARNING 1
+#define SSL3_AL_FATAL 2
+
+#define SSL3_AD_CLOSE_NOTIFY 0
+#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */
+#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */
+#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */
+#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
+#define SSL3_AD_NO_CERTIFICATE 41
+#define SSL3_AD_BAD_CERTIFICATE 42
+#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
+#define SSL3_AD_CERTIFICATE_REVOKED 44
+#define SSL3_AD_CERTIFICATE_EXPIRED 45
+#define SSL3_AD_CERTIFICATE_UNKNOWN 46
+#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
typedef struct ssl3_record_st
- {
-/*r */ int type; /* type of record */
-/*rw*/ unsigned int length; /* How many bytes available */
-/*r */ unsigned int off; /* read/write offset into 'buf' */
-/*rw*/ unsigned char *data; /* pointer to the record data */
-/*rw*/ unsigned char *input; /* where the decode bytes are */
-/*r */ unsigned char *comp; /* only used with decompression - malloc()ed */
+ {
+/*r */ int type; /* type of record */
+/*rw*/ unsigned int length; /* How many bytes available */
+/*r */ unsigned int off; /* read/write offset into 'buf' */
+/*rw*/ unsigned char *data; /* pointer to the record data */
+/*rw*/ unsigned char *input; /* where the decode bytes are */
+/*r */ unsigned char *comp; /* only used with decompression - malloc()ed */
/*r */ unsigned long epoch; /* epoch number, needed by DTLS1 */
/*r */ PQ_64BIT seq_num; /* sequence number, needed by DTLS1 */
- } SSL3_RECORD;
+ } SSL3_RECORD;
typedef struct ssl3_buffer_st
- {
- unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes,
- * see ssl3_setup_buffers() */
- size_t len; /* buffer size */
- int offset; /* where to 'copy from' */
- int left; /* how many bytes left */
- } SSL3_BUFFER;
-
-#define SSL3_CT_RSA_SIGN 1
-#define SSL3_CT_DSS_SIGN 2
-#define SSL3_CT_RSA_FIXED_DH 3
-#define SSL3_CT_DSS_FIXED_DH 4
-#define SSL3_CT_RSA_EPHEMERAL_DH 5
-#define SSL3_CT_DSS_EPHEMERAL_DH 6
-#define SSL3_CT_FORTEZZA_DMS 20
+ {
+ unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes,
+ * see ssl3_setup_buffers() */
+ size_t len; /* buffer size */
+ int offset; /* where to 'copy from' */
+ int left; /* how many bytes left */
+ } SSL3_BUFFER;
+
+#define SSL3_CT_RSA_SIGN 1
+#define SSL3_CT_DSS_SIGN 2
+#define SSL3_CT_RSA_FIXED_DH 3
+#define SSL3_CT_DSS_FIXED_DH 4
+#define SSL3_CT_RSA_EPHEMERAL_DH 5
+#define SSL3_CT_DSS_EPHEMERAL_DH 6
+#define SSL3_CT_FORTEZZA_DMS 20
/* SSL3_CT_NUMBER is used to size arrays and it must be large
* enough to contain all of the cert types defined either for
* SSLv3 and TLSv1.
*/
-#define SSL3_CT_NUMBER 7
+#define SSL3_CT_NUMBER 7
-#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
-#define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002
-#define SSL3_FLAGS_POP_BUFFER 0x0004
-#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
+#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
+#define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002
+#define SSL3_FLAGS_POP_BUFFER 0x0004
+#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
typedef struct ssl3_state_st
- {
- long flags;
- int delay_buf_pop_ret;
-
- unsigned char read_sequence[8];
- unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
- unsigned char write_sequence[8];
- unsigned char write_mac_secret[EVP_MAX_MD_SIZE];
-
- unsigned char server_random[SSL3_RANDOM_SIZE];
- unsigned char client_random[SSL3_RANDOM_SIZE];
-
- /* flags for countermeasure against known-IV weakness */
- int need_empty_fragments;
- int empty_fragment_done;
-
- SSL3_BUFFER rbuf; /* read IO goes into here */
- SSL3_BUFFER wbuf; /* write IO goes into here */
-
- SSL3_RECORD rrec; /* each decoded record goes in here */
- SSL3_RECORD wrec; /* goes out from here */
-
- /* storage for Alert/Handshake protocol data received but not
- * yet processed by ssl3_read_bytes: */
- unsigned char alert_fragment[2];
- unsigned int alert_fragment_len;
- unsigned char handshake_fragment[4];
- unsigned int handshake_fragment_len;
-
- /* partial write - check the numbers match */
- unsigned int wnum; /* number of bytes sent so far */
- int wpend_tot; /* number bytes written */
- int wpend_type;
- int wpend_ret; /* number of bytes submitted */
- const unsigned char *wpend_buf;
-
- /* used during startup, digest all incoming/outgoing packets */
- EVP_MD_CTX finish_dgst1;
- EVP_MD_CTX finish_dgst2;
-
- /* this is set whenerver we see a change_cipher_spec message
- * come in when we are not looking for one */
- int change_cipher_spec;
-
- int warn_alert;
- int fatal_alert;
- /* we allow one fatal and one warning alert to be outstanding,
- * send close alert via the warning alert */
- int alert_dispatch;
- unsigned char send_alert[2];
-
- /* This flag is set when we should renegotiate ASAP, basically when
- * there is no more data in the read or write buffers */
- int renegotiate;
- int total_renegotiations;
- int num_renegotiations;
-
- int in_read_app_data;
-
- struct {
- /* actually only needs to be 16+20 */
- unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2];
-
- /* actually only need to be 16+20 for SSLv3 and 12 for TLS */
- unsigned char finish_md[EVP_MAX_MD_SIZE*2];
- int finish_md_len;
- unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2];
- int peer_finish_md_len;
-
- unsigned long message_size;
- int message_type;
-
- /* used to hold the new cipher we are going to use */
- SSL_CIPHER *new_cipher;
+ {
+ long flags;
+ int delay_buf_pop_ret;
+
+ unsigned char read_sequence[8];
+ unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
+ unsigned char write_sequence[8];
+ unsigned char write_mac_secret[EVP_MAX_MD_SIZE];
+
+ unsigned char server_random[SSL3_RANDOM_SIZE];
+ unsigned char client_random[SSL3_RANDOM_SIZE];
+
+ /* flags for countermeasure against known-IV weakness */
+ int need_empty_fragments;
+ int empty_fragment_done;
+
+ SSL3_BUFFER rbuf; /* read IO goes into here */
+ SSL3_BUFFER wbuf; /* write IO goes into here */
+
+ SSL3_RECORD rrec; /* each decoded record goes in here */
+ SSL3_RECORD wrec; /* goes out from here */
+
+ /* storage for Alert/Handshake protocol data received but not
+ * yet processed by ssl3_read_bytes: */
+ unsigned char alert_fragment[2];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[4];
+ unsigned int handshake_fragment_len;
+
+ /* partial write - check the numbers match */
+ unsigned int wnum; /* number of bytes sent so far */
+ int wpend_tot; /* number bytes written */
+ int wpend_type;
+ int wpend_ret; /* number of bytes submitted */
+ const unsigned char *wpend_buf;
+
+ /* used during startup, digest all incoming/outgoing packets */
+ EVP_MD_CTX finish_dgst1;
+ EVP_MD_CTX finish_dgst2;
+
+ /* this is set whenerver we see a change_cipher_spec message
+ * come in when we are not looking for one */
+ int change_cipher_spec;
+
+ int warn_alert;
+ int fatal_alert;
+ /* we allow one fatal and one warning alert to be outstanding,
+ * send close alert via the warning alert */
+ int alert_dispatch;
+ unsigned char send_alert[2];
+
+ /* This flag is set when we should renegotiate ASAP, basically when
+ * there is no more data in the read or write buffers */
+ int renegotiate;
+ int total_renegotiations;
+ int num_renegotiations;
+
+ int in_read_app_data;
+
+ struct {
+ /* actually only needs to be 16+20 */
+ unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2];
+
+ /* actually only need to be 16+20 for SSLv3 and 12 for TLS */
+ unsigned char finish_md[EVP_MAX_MD_SIZE*2];
+ int finish_md_len;
+ unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2];
+ int peer_finish_md_len;
+
+ unsigned long message_size;
+ int message_type;
+
+ /* used to hold the new cipher we are going to use */
+ SSL_CIPHER *new_cipher;
#ifndef OPENSSL_NO_DH
- DH *dh;
+ DH *dh;
#endif
#ifndef OPENSSL_NO_ECDH
- EC_KEY *ecdh; /* holds short lived ECDH key */
+ EC_KEY *ecdh; /* holds short lived ECDH key */
#endif
- /* used when SSL_ST_FLUSH_DATA is entered */
- int next_state;
+ /* used when SSL_ST_FLUSH_DATA is entered */
+ int next_state;
- int reuse_message;
+ int reuse_message;
- /* used for certificate requests */
- int cert_req;
- int ctype_num;
- char ctype[SSL3_CT_NUMBER];
- STACK_OF(X509_NAME) *ca_names;
+ /* used for certificate requests */
+ int cert_req;
+ int ctype_num;
+ char ctype[SSL3_CT_NUMBER];
+ STACK_OF(X509_NAME) *ca_names;
- int use_rsa_tmp;
+ int use_rsa_tmp;
- int key_block_length;
- unsigned char *key_block;
+ int key_block_length;
+ unsigned char *key_block;
- const EVP_CIPHER *new_sym_enc;
- const EVP_MD *new_hash;
+ const EVP_CIPHER *new_sym_enc;
+ const EVP_MD *new_hash;
#ifndef OPENSSL_NO_COMP
- const SSL_COMP *new_compression;
+ const SSL_COMP *new_compression;
#else
- char *new_compression;
+ char *new_compression;
#endif
- int cert_request;
- } tmp;
+ int cert_request;
+ } tmp;
- } SSL3_STATE;
+ } SSL3_STATE;
/* SSLv3 */
/*client */
/* extra state */
-#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT)
+#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT)
/* write to server */
-#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT)
/* read from server */
-#define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT)
-#define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT)
#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT)
#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT)
-#define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT)
-#define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT)
-#define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT)
-#define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT)
-#define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT)
-#define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT)
-#define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT)
-#define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT)
+#define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT)
+#define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT)
/* write to server */
-#define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT)
-#define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT)
-#define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT)
-#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT)
-#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT)
-#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT)
+#define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT)
+#define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT)
+#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT)
+#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT)
+#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT)
/* read from server */
-#define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT)
-#define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT)
-#define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT)
-#define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT)
+#define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT)
+#define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT)
+#define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT)
+#define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT)
/* server */
/* extra state */
-#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT)
/* read from client */
/* Do not change the number values, they do matter */
-#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT)
/* write to client */
#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT)
#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT)
/* read from client */
-#define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT)
-#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT)
+#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT)
/* write to client */
-#define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT)
-#define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT)
-
-#define SSL3_MT_HELLO_REQUEST 0
-#define SSL3_MT_CLIENT_HELLO 1
-#define SSL3_MT_SERVER_HELLO 2
-#define SSL3_MT_CERTIFICATE 11
-#define SSL3_MT_SERVER_KEY_EXCHANGE 12
-#define SSL3_MT_CERTIFICATE_REQUEST 13
-#define SSL3_MT_SERVER_DONE 14
-#define SSL3_MT_CERTIFICATE_VERIFY 15
-#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
-#define SSL3_MT_FINISHED 20
+#define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT)
+#define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT)
+
+#define SSL3_MT_HELLO_REQUEST 0
+#define SSL3_MT_CLIENT_HELLO 1
+#define SSL3_MT_SERVER_HELLO 2
+#define SSL3_MT_NEWSESSION_TICKET 4
+#define SSL3_MT_CERTIFICATE 11
+#define SSL3_MT_SERVER_KEY_EXCHANGE 12
+#define SSL3_MT_CERTIFICATE_REQUEST 13
+#define SSL3_MT_SERVER_DONE 14
+#define SSL3_MT_CERTIFICATE_VERIFY 15
+#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
+#define SSL3_MT_FINISHED 20
+#define SSL3_MT_CERTIFICATE_STATUS 22
#define DTLS1_MT_HELLO_VERIFY_REQUEST 3
-#define SSL3_MT_CCS 1
+#define SSL3_MT_CCS 1
/* These are used when changing over to a new cipher */
-#define SSL3_CC_READ 0x01
-#define SSL3_CC_WRITE 0x02
-#define SSL3_CC_CLIENT 0x10
-#define SSL3_CC_SERVER 0x20
-#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)
-#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ)
-#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ)
-#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)
+#define SSL3_CC_READ 0x01
+#define SSL3_CC_WRITE 0x02
+#define SSL3_CC_CLIENT 0x10
+#define SSL3_CC_SERVER 0x20
+#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)
+#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ)
+#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ)
+#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/symhacks.h b/dep/include/openssl/symhacks.h
index 5ef15139deb..6cfb5fe4794 100644
--- a/dep/include/openssl/symhacks.h
+++ b/dep/include/openssl/symhacks.h
@@ -6,7 +6,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -64,75 +64,75 @@
/* Hack a long name in crypto/ex_data.c */
#undef CRYPTO_get_ex_data_implementation
-#define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl
+#define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl
#undef CRYPTO_set_ex_data_implementation
-#define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl
+#define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl
/* Hack a long name in crypto/asn1/a_mbstr.c */
#undef ASN1_STRING_set_default_mask_asc
-#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
+#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
#if 0 /* No longer needed, since safestack macro magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
#undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO
-#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
+#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
#undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO
-#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
+#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
#endif
#if 0 /* No longer needed, since safestack macro magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
#undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO
-#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
+#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
#undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO
-#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
+#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
#endif
#if 0 /* No longer needed, since safestack macro magic does the job */
/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
#undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION
-#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
+#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
#undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION
-#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
+#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
#endif
/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
#undef PEM_read_NETSCAPE_CERT_SEQUENCE
-#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
+#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
#undef PEM_write_NETSCAPE_CERT_SEQUENCE
-#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
+#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
#undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE
-#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
+#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
#undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE
-#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
+#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
#undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE
-#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
+#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
#undef PEM_read_PKCS8_PRIV_KEY_INFO
-#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
+#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
#undef PEM_write_PKCS8_PRIV_KEY_INFO
-#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
+#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
#undef PEM_read_bio_PKCS8_PRIV_KEY_INFO
-#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
+#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
#undef PEM_write_bio_PKCS8_PRIV_KEY_INFO
-#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
+#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
#undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO
-#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
+#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
/* Hack other PEM names */
#undef PEM_write_bio_PKCS8PrivateKey_nid
-#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
+#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
/* Hack some long X509 names */
#undef X509_REVOKED_get_ext_by_critical
-#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
+#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
#undef X509_policy_tree_get0_user_policies
-#define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies
+#define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies
#undef X509_policy_node_get0_qualifiers
-#define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers
+#define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers
#undef X509_STORE_CTX_get_explicit_policy
-#define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy
+#define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy
/* Hack some long CRYPTO names */
#undef CRYPTO_set_dynlock_destroy_callback
@@ -168,17 +168,22 @@
#undef SSL_CTX_set_default_passwd_cb_userdata
#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
#undef SSL_COMP_get_compression_methods
-#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
+#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
/* Hack some long ENGINE names */
#undef ENGINE_get_default_BN_mod_exp_crt
-#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
+#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
#undef ENGINE_set_default_BN_mod_exp_crt
-#define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
+#define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
#undef ENGINE_set_load_privkey_function
#define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn
#undef ENGINE_get_load_privkey_function
#define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn
+#undef ENGINE_set_load_ssl_client_cert_function
+#define ENGINE_set_load_ssl_client_cert_function \
+ ENGINE_set_ld_ssl_clnt_cert_fn
+#undef ENGINE_get_ssl_client_cert_function
+#define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn
/* Hack some long OCSP names */
#undef OCSP_REQUEST_get_ext_by_critical
@@ -190,23 +195,23 @@
/* Hack some long DES names */
#undef _ossl_old_des_ede3_cfb64_encrypt
-#define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt
+#define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt
#undef _ossl_old_des_ede3_ofb64_encrypt
-#define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt
+#define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt
/* Hack some long EVP names */
#undef OPENSSL_add_all_algorithms_noconf
-#define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf
+#define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf
#undef OPENSSL_add_all_algorithms_conf
-#define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf
+#define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf
/* Hack some long EC names */
#undef EC_GROUP_set_point_conversion_form
-#define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form
+#define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form
#undef EC_GROUP_get_point_conversion_form
-#define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
+#define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
#undef EC_GROUP_clear_free_all_extra_data
-#define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
+#define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
#undef EC_POINT_set_Jprojective_coordinates_GFp
#define EC_POINT_set_Jprojective_coordinates_GFp \
EC_POINT_set_Jproj_coords_GFp
@@ -229,7 +234,7 @@
#undef ec_GF2m_simple_group_clear_finish
#define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish
#undef ec_GF2m_simple_group_check_discriminant
-#define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim
+#define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim
#undef ec_GF2m_simple_point_clear_finish
#define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish
#undef ec_GF2m_simple_point_set_to_infinity
@@ -290,57 +295,71 @@
#define ec_GFp_simple_set_compressed_coordinates \
ec_GFp_smp_set_compr_coords
#undef ec_GFp_simple_group_check_discriminant
-#define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim
+#define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim
/* Hack som long STORE names */
#undef STORE_method_set_initialise_function
-#define STORE_method_set_initialise_function STORE_meth_set_initialise_fn
+#define STORE_method_set_initialise_function STORE_meth_set_initialise_fn
#undef STORE_method_set_cleanup_function
-#define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn
+#define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn
#undef STORE_method_set_generate_function
-#define STORE_method_set_generate_function STORE_meth_set_generate_fn
+#define STORE_method_set_generate_function STORE_meth_set_generate_fn
#undef STORE_method_set_modify_function
-#define STORE_method_set_modify_function STORE_meth_set_modify_fn
+#define STORE_method_set_modify_function STORE_meth_set_modify_fn
#undef STORE_method_set_revoke_function
-#define STORE_method_set_revoke_function STORE_meth_set_revoke_fn
+#define STORE_method_set_revoke_function STORE_meth_set_revoke_fn
#undef STORE_method_set_delete_function
-#define STORE_method_set_delete_function STORE_meth_set_delete_fn
+#define STORE_method_set_delete_function STORE_meth_set_delete_fn
#undef STORE_method_set_list_start_function
-#define STORE_method_set_list_start_function STORE_meth_set_list_start_fn
+#define STORE_method_set_list_start_function STORE_meth_set_list_start_fn
#undef STORE_method_set_list_next_function
-#define STORE_method_set_list_next_function STORE_meth_set_list_next_fn
+#define STORE_method_set_list_next_function STORE_meth_set_list_next_fn
#undef STORE_method_set_list_end_function
-#define STORE_method_set_list_end_function STORE_meth_set_list_end_fn
+#define STORE_method_set_list_end_function STORE_meth_set_list_end_fn
#undef STORE_method_set_update_store_function
-#define STORE_method_set_update_store_function STORE_meth_set_update_store_fn
+#define STORE_method_set_update_store_function STORE_meth_set_update_store_fn
#undef STORE_method_set_lock_store_function
-#define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn
+#define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn
#undef STORE_method_set_unlock_store_function
-#define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn
+#define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn
#undef STORE_method_get_initialise_function
-#define STORE_method_get_initialise_function STORE_meth_get_initialise_fn
+#define STORE_method_get_initialise_function STORE_meth_get_initialise_fn
#undef STORE_method_get_cleanup_function
-#define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn
+#define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn
#undef STORE_method_get_generate_function
-#define STORE_method_get_generate_function STORE_meth_get_generate_fn
+#define STORE_method_get_generate_function STORE_meth_get_generate_fn
#undef STORE_method_get_modify_function
-#define STORE_method_get_modify_function STORE_meth_get_modify_fn
+#define STORE_method_get_modify_function STORE_meth_get_modify_fn
#undef STORE_method_get_revoke_function
-#define STORE_method_get_revoke_function STORE_meth_get_revoke_fn
+#define STORE_method_get_revoke_function STORE_meth_get_revoke_fn
#undef STORE_method_get_delete_function
-#define STORE_method_get_delete_function STORE_meth_get_delete_fn
+#define STORE_method_get_delete_function STORE_meth_get_delete_fn
#undef STORE_method_get_list_start_function
-#define STORE_method_get_list_start_function STORE_meth_get_list_start_fn
+#define STORE_method_get_list_start_function STORE_meth_get_list_start_fn
#undef STORE_method_get_list_next_function
-#define STORE_method_get_list_next_function STORE_meth_get_list_next_fn
+#define STORE_method_get_list_next_function STORE_meth_get_list_next_fn
#undef STORE_method_get_list_end_function
-#define STORE_method_get_list_end_function STORE_meth_get_list_end_fn
+#define STORE_method_get_list_end_function STORE_meth_get_list_end_fn
#undef STORE_method_get_update_store_function
-#define STORE_method_get_update_store_function STORE_meth_get_update_store_fn
+#define STORE_method_get_update_store_function STORE_meth_get_update_store_fn
#undef STORE_method_get_lock_store_function
-#define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn
+#define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn
#undef STORE_method_get_unlock_store_function
-#define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn
+#define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn
+
+/* Hack some long CMS names */
+#undef CMS_RecipientInfo_ktri_get0_algs
+#define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs
+#undef CMS_RecipientInfo_ktri_get0_signer_id
+#define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id
+#undef CMS_OtherRevocationInfoFormat_it
+#define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it
+#undef CMS_KeyAgreeRecipientIdentifier_it
+#define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it
+#undef CMS_OriginatorIdentifierOrKey_it
+#define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it
+#undef cms_SignerIdentifier_get0_signer_id
+#define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id
#endif /* defined OPENSSL_SYS_VMS */
@@ -348,7 +367,7 @@
/* Case insensiteve linking causes problems.... */
#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2)
#undef ERR_load_CRYPTO_strings
-#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
+#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
#undef OCSP_crlID_new
#define OCSP_crlID_new OCSP_crlID2_new
@@ -381,4 +400,6 @@
#endif /* ! defined HEADER_VMS_IDHACKS_H */
-
+/* This one clashes with CMS_data_create */
+#undef cms_Data_create
+#define cms_Data_create priv_cms_Data_create
diff --git a/dep/include/openssl/tls1.h b/dep/include/openssl/tls1.h
index c3b53bfd4a1..2d1d293e1a4 100644
--- a/dep/include/openssl/tls1.h
+++ b/dep/include/openssl/tls1.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -58,7 +58,7 @@
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
- * Portions of the attached software ("Contribution") are developed by
+ * Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the OpenSSL open source
@@ -69,8 +69,8 @@
*
*/
-#ifndef HEADER_TLS1_H
-#define HEADER_TLS1_H
+#ifndef HEADER_TLS1_H
+#define HEADER_TLS1_H
#include <openssl/buffer.h>
@@ -78,67 +78,162 @@
extern "C" {
#endif
-#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
-
-#define TLS1_VERSION 0x0301
-#define TLS1_VERSION_MAJOR 0x03
-#define TLS1_VERSION_MINOR 0x01
-
-#define TLS1_AD_DECRYPTION_FAILED 21
-#define TLS1_AD_RECORD_OVERFLOW 22
-#define TLS1_AD_UNKNOWN_CA 48 /* fatal */
-#define TLS1_AD_ACCESS_DENIED 49 /* fatal */
-#define TLS1_AD_DECODE_ERROR 50 /* fatal */
-#define TLS1_AD_DECRYPT_ERROR 51
-#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */
-#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
-#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
-#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
-#define TLS1_AD_USER_CANCELLED 90
-#define TLS1_AD_NO_RENEGOTIATION 100
+#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
+
+#define TLS1_VERSION 0x0301
+#define TLS1_VERSION_MAJOR 0x03
+#define TLS1_VERSION_MINOR 0x01
+
+#define TLS1_AD_DECRYPTION_FAILED 21
+#define TLS1_AD_RECORD_OVERFLOW 22
+#define TLS1_AD_UNKNOWN_CA 48 /* fatal */
+#define TLS1_AD_ACCESS_DENIED 49 /* fatal */
+#define TLS1_AD_DECODE_ERROR 50 /* fatal */
+#define TLS1_AD_DECRYPT_ERROR 51
+#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */
+#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
+#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
+#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
+#define TLS1_AD_USER_CANCELLED 90
+#define TLS1_AD_NO_RENEGOTIATION 100
+/* codes 110-114 are from RFC3546 */
+#define TLS1_AD_UNSUPPORTED_EXTENSION 110
+#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
+#define TLS1_AD_UNRECOGNIZED_NAME 112
+#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
+#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
+#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */
+
+/* ExtensionType values from RFC 3546 */
+#define TLSEXT_TYPE_server_name 0
+#define TLSEXT_TYPE_max_fragment_length 1
+#define TLSEXT_TYPE_client_certificate_url 2
+#define TLSEXT_TYPE_trusted_ca_keys 3
+#define TLSEXT_TYPE_truncated_hmac 4
+#define TLSEXT_TYPE_status_request 5
+#define TLSEXT_TYPE_elliptic_curves 10
+#define TLSEXT_TYPE_ec_point_formats 11
+#define TLSEXT_TYPE_session_ticket 35
+
+/* NameType value from RFC 3546 */
+#define TLSEXT_NAMETYPE_host_name 0
+/* status request value from RFC 3546 */
+#define TLSEXT_STATUSTYPE_ocsp 1
+
+#ifndef OPENSSL_NO_TLSEXT
+
+#define TLSEXT_MAXLEN_host_name 255
+
+const char *SSL_get_servername(const SSL *s, const int type) ;
+int SSL_get_servername_type(const SSL *s) ;
+
+#define SSL_set_tlsext_host_name(s,name) \
+SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
+
+#define SSL_set_tlsext_debug_callback(ssl, cb) \
+SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)
+
+#define SSL_set_tlsext_debug_arg(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)
+
+#define SSL_set_tlsext_status_type(ssl, type) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)
+
+#define SSL_get_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+#define SSL_set_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+#define SSL_get_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+#define SSL_set_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+#define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg)
+
+#define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg)
+
+#define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb)
+
+#define SSL_TLSEXT_ERR_OK 0
+#define SSL_TLSEXT_ERR_ALERT_WARNING 1
+#define SSL_TLSEXT_ERR_ALERT_FATAL 2
+#define SSL_TLSEXT_ERR_NOACK 3
+
+#define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg)
+
+#define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLXEXT_TICKET_KEYS,(keylen),(keys))
+#define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLXEXT_TICKET_KEYS,(keylen),(keys))
+
+#define SSL_CTX_set_tlsext_status_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb)
+
+#define SSL_CTX_set_tlsext_status_arg(ssl, arg) \
+SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg)
+
+#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
+
+#endif
/* Additional TLS ciphersuites from draft-ietf-tls-56-bit-ciphersuites-00.txt
* (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see
* s3_lib.c). We actually treat them like SSL 3.0 ciphers, which we probably
* shouldn't. */
-#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060
-#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061
-#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062
-#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063
-#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064
-#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065
-#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066
+#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060
+#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061
+#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062
+#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063
+#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064
+#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065
+#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066
/* AES ciphersuites from RFC3268 */
-#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F
-#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030
-#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031
-#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032
-#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033
-#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034
+#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F
+#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030
+#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031
+#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032
+#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033
+#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034
-#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035
-#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036
-#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037
-#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038
-#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039
-#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A
+#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035
+#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036
+#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037
+#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038
+#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039
+#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A
/* Camellia ciphersuites from RFC4132 */
-#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041
-#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042
-#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043
-#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044
-#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045
-#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046
-
-#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084
-#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085
-#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086
-#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087
-#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088
-#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089
+#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041
+#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042
+#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043
+#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044
+#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045
+#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046
+
+#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084
+#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085
+#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086
+#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087
+#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088
+#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089
+
+/* SEED ciphersuites from RFC4162 */
+#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096
+#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097
+#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098
+#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099
+#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A
+#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B
/* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */
#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001
@@ -178,28 +273,28 @@ extern "C" {
* (The alias for the list of all such ciphers also is "EDH".)
* The specifications speak of "EDH"; maybe we should allow both forms
* for everything. */
-#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5"
-#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5"
-#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA"
-#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA"
-#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA"
-#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA"
-#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA"
+#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5"
+#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5"
+#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA"
+#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA"
+#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA"
+#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA"
/* AES ciphersuites from RFC3268 */
-#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA"
-#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA"
-#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA"
-#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA"
-#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA"
-#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA"
-
-#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA"
-#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA"
-#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA"
-#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA"
-#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA"
-#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA"
+#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA"
+#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA"
+#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA"
+#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA"
+#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA"
+
+#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA"
+#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA"
+#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA"
+#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA"
+#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA"
/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */
#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA"
@@ -232,50 +327,57 @@ extern "C" {
#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA"
#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA"
-/* Camellia ciphersuites form RFC4132 */
-#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA"
-#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA"
-#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA"
-#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA"
-#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA"
-#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA"
-
-#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA"
-#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA"
-#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA"
-#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA"
-#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA"
-#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA"
-
-
-#define TLS_CT_RSA_SIGN 1
-#define TLS_CT_DSS_SIGN 2
-#define TLS_CT_RSA_FIXED_DH 3
-#define TLS_CT_DSS_FIXED_DH 4
-#define TLS_CT_ECDSA_SIGN 64
-#define TLS_CT_RSA_FIXED_ECDH 65
-#define TLS_CT_ECDSA_FIXED_ECDH 66
-#define TLS_CT_NUMBER 7
-
-#define TLS1_FINISH_MAC_LENGTH 12
-
-#define TLS_MD_MAX_CONST_SIZE 20
-#define TLS_MD_CLIENT_FINISH_CONST "client finished"
-#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15
-#define TLS_MD_SERVER_FINISH_CONST "server finished"
-#define TLS_MD_SERVER_FINISH_CONST_SIZE 15
-#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
-#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
-#define TLS_MD_KEY_EXPANSION_CONST "key expansion"
-#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13
-#define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key"
-#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16
-#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
-#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
-#define TLS_MD_IV_BLOCK_CONST "IV block"
-#define TLS_MD_IV_BLOCK_CONST_SIZE 8
-#define TLS_MD_MASTER_SECRET_CONST "master secret"
-#define TLS_MD_MASTER_SECRET_CONST_SIZE 13
+/* Camellia ciphersuites from RFC4132 */
+#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA"
+#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA"
+#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA"
+#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA"
+#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA"
+
+#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA"
+#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA"
+#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA"
+#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA"
+#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA"
+
+/* SEED ciphersuites from RFC4162 */
+#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA"
+#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA"
+#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA"
+#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA"
+#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA"
+#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA"
+
+#define TLS_CT_RSA_SIGN 1
+#define TLS_CT_DSS_SIGN 2
+#define TLS_CT_RSA_FIXED_DH 3
+#define TLS_CT_DSS_FIXED_DH 4
+#define TLS_CT_ECDSA_SIGN 64
+#define TLS_CT_RSA_FIXED_ECDH 65
+#define TLS_CT_ECDSA_FIXED_ECDH 66
+#define TLS_CT_NUMBER 7
+
+#define TLS1_FINISH_MAC_LENGTH 12
+
+#define TLS_MD_MAX_CONST_SIZE 20
+#define TLS_MD_CLIENT_FINISH_CONST "client finished"
+#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15
+#define TLS_MD_SERVER_FINISH_CONST "server finished"
+#define TLS_MD_SERVER_FINISH_CONST_SIZE 15
+#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+#define TLS_MD_KEY_EXPANSION_CONST "key expansion"
+#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13
+#define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key"
+#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16
+#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+#define TLS_MD_IV_BLOCK_CONST "IV block"
+#define TLS_MD_IV_BLOCK_CONST_SIZE 8
+#define TLS_MD_MASTER_SECRET_CONST "master secret"
+#define TLS_MD_MASTER_SECRET_CONST_SIZE 13
#ifdef CHARSET_EBCDIC
#undef TLS_MD_CLIENT_FINISH_CONST
@@ -303,4 +405,3 @@ extern "C" {
-
diff --git a/dep/include/openssl/x509.h b/dep/include/openssl/x509.h
index 3dec0b822c4..e71b5257e57 100644
--- a/dep/include/openssl/x509.h
+++ b/dep/include/openssl/x509.h
@@ -5,21 +5,21 @@
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
- *
+ *
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
+ *
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -34,10 +34,10 @@
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
+ * 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
+ *
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
+ *
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
@@ -57,7 +57,7 @@
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECDH support in OpenSSL originally developed by
+ * ECDH support in OpenSSL originally developed by
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
@@ -118,141 +118,144 @@ extern "C" {
#undef X509_CERT_PAIR
#endif
-#define X509_FILETYPE_PEM 1
-#define X509_FILETYPE_ASN1 2
-#define X509_FILETYPE_DEFAULT 3
-
-#define X509v3_KU_DIGITAL_SIGNATURE 0x0080
-#define X509v3_KU_NON_REPUDIATION 0x0040
-#define X509v3_KU_KEY_ENCIPHERMENT 0x0020
-#define X509v3_KU_DATA_ENCIPHERMENT 0x0010
-#define X509v3_KU_KEY_AGREEMENT 0x0008
-#define X509v3_KU_KEY_CERT_SIGN 0x0004
-#define X509v3_KU_CRL_SIGN 0x0002
-#define X509v3_KU_ENCIPHER_ONLY 0x0001
-#define X509v3_KU_DECIPHER_ONLY 0x8000
-#define X509v3_KU_UNDEF 0xffff
+#define X509_FILETYPE_PEM 1
+#define X509_FILETYPE_ASN1 2
+#define X509_FILETYPE_DEFAULT 3
+
+#define X509v3_KU_DIGITAL_SIGNATURE 0x0080
+#define X509v3_KU_NON_REPUDIATION 0x0040
+#define X509v3_KU_KEY_ENCIPHERMENT 0x0020
+#define X509v3_KU_DATA_ENCIPHERMENT 0x0010
+#define X509v3_KU_KEY_AGREEMENT 0x0008
+#define X509v3_KU_KEY_CERT_SIGN 0x0004
+#define X509v3_KU_CRL_SIGN 0x0002
+#define X509v3_KU_ENCIPHER_ONLY 0x0001
+#define X509v3_KU_DECIPHER_ONLY 0x8000
+#define X509v3_KU_UNDEF 0xffff
typedef struct X509_objects_st
- {
- int nid;
- int (*a2i)(void);
- int (*i2a)(void);
- } X509_OBJECTS;
+ {
+ int nid;
+ int (*a2i)(void);
+ int (*i2a)(void);
+ } X509_OBJECTS;
struct X509_algor_st
- {
- ASN1_OBJECT *algorithm;
- ASN1_TYPE *parameter;
- } /* X509_ALGOR */;
+ {
+ ASN1_OBJECT *algorithm;
+ ASN1_TYPE *parameter;
+ } /* X509_ALGOR */;
-DECLARE_STACK_OF(X509_ALGOR)
DECLARE_ASN1_SET_OF(X509_ALGOR)
+typedef STACK_OF(X509_ALGOR) X509_ALGORS;
+
typedef struct X509_val_st
- {
- ASN1_TIME *notBefore;
- ASN1_TIME *notAfter;
- } X509_VAL;
+ {
+ ASN1_TIME *notBefore;
+ ASN1_TIME *notAfter;
+ } X509_VAL;
typedef struct X509_pubkey_st
- {
- X509_ALGOR *algor;
- ASN1_BIT_STRING *public_key;
- EVP_PKEY *pkey;
- } X509_PUBKEY;
+ {
+ X509_ALGOR *algor;
+ ASN1_BIT_STRING *public_key;
+ EVP_PKEY *pkey;
+ } X509_PUBKEY;
typedef struct X509_sig_st
- {
- X509_ALGOR *algor;
- ASN1_OCTET_STRING *digest;
- } X509_SIG;
+ {
+ X509_ALGOR *algor;
+ ASN1_OCTET_STRING *digest;
+ } X509_SIG;
typedef struct X509_name_entry_st
- {
- ASN1_OBJECT *object;
- ASN1_STRING *value;
- int set;
- int size; /* temp variable */
- } X509_NAME_ENTRY;
+ {
+ ASN1_OBJECT *object;
+ ASN1_STRING *value;
+ int set;
+ int size; /* temp variable */
+ } X509_NAME_ENTRY;
DECLARE_STACK_OF(X509_NAME_ENTRY)
DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
/* we always keep X509_NAMEs in 2 forms. */
struct X509_name_st
- {
- STACK_OF(X509_NAME_ENTRY) *entries;
- int modified; /* true if 'bytes' needs to be built */
+ {
+ STACK_OF(X509_NAME_ENTRY) *entries;
+ int modified; /* true if 'bytes' needs to be built */
#ifndef OPENSSL_NO_BUFFER
- BUF_MEM *bytes;
+ BUF_MEM *bytes;
#else
- char *bytes;
+ char *bytes;
#endif
- unsigned long hash; /* Keep the hash around for lookups */
- } /* X509_NAME */;
+ unsigned long hash; /* Keep the hash around for lookups */
+ } /* X509_NAME */;
DECLARE_STACK_OF(X509_NAME)
-#define X509_EX_V_NETSCAPE_HACK 0x8000
-#define X509_EX_V_INIT 0x0001
+#define X509_EX_V_NETSCAPE_HACK 0x8000
+#define X509_EX_V_INIT 0x0001
typedef struct X509_extension_st
- {
- ASN1_OBJECT *object;
- ASN1_BOOLEAN critical;
- ASN1_OCTET_STRING *value;
- } X509_EXTENSION;
+ {
+ ASN1_OBJECT *object;
+ ASN1_BOOLEAN critical;
+ ASN1_OCTET_STRING *value;
+ } X509_EXTENSION;
+
+typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
DECLARE_STACK_OF(X509_EXTENSION)
DECLARE_ASN1_SET_OF(X509_EXTENSION)
/* a sequence of these are used */
typedef struct x509_attributes_st
- {
- ASN1_OBJECT *object;
- int single; /* 0 for a set, 1 for a single item (which is wrong) */
- union {
- char *ptr;
-/* 0 */ STACK_OF(ASN1_TYPE) *set;
-/* 1 */ ASN1_TYPE *single;
- } value;
- } X509_ATTRIBUTE;
+ {
+ ASN1_OBJECT *object;
+ int single; /* 0 for a set, 1 for a single item (which is wrong) */
+ union {
+ char *ptr;
+/* 0 */ STACK_OF(ASN1_TYPE) *set;
+/* 1 */ ASN1_TYPE *single;
+ } value;
+ } X509_ATTRIBUTE;
DECLARE_STACK_OF(X509_ATTRIBUTE)
DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
typedef struct X509_req_info_st
- {
- ASN1_ENCODING enc;
- ASN1_INTEGER *version;
- X509_NAME *subject;
- X509_PUBKEY *pubkey;
- /* d=2 hl=2 l= 0 cons: cont: 00 */
- STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
- } X509_REQ_INFO;
+ {
+ ASN1_ENCODING enc;
+ ASN1_INTEGER *version;
+ X509_NAME *subject;
+ X509_PUBKEY *pubkey;
+ /* d=2 hl=2 l= 0 cons: cont: 00 */
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+ } X509_REQ_INFO;
typedef struct X509_req_st
- {
- X509_REQ_INFO *req_info;
- X509_ALGOR *sig_alg;
- ASN1_BIT_STRING *signature;
- int references;
- } X509_REQ;
+ {
+ X509_REQ_INFO *req_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+ } X509_REQ;
typedef struct x509_cinf_st
- {
- ASN1_INTEGER *version; /* [ 0 ] default of v1 */
- ASN1_INTEGER *serialNumber;
- X509_ALGOR *signature;
- X509_NAME *issuer;
- X509_VAL *validity;
- X509_NAME *subject;
- X509_PUBKEY *key;
- ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */
- ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */
- STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */
- } X509_CINF;
+ {
+ ASN1_INTEGER *version; /* [ 0 ] default of v1 */
+ ASN1_INTEGER *serialNumber;
+ X509_ALGOR *signature;
+ X509_NAME *issuer;
+ X509_VAL *validity;
+ X509_NAME *subject;
+ X509_PUBKEY *key;
+ ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */
+ ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */
+ STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */
+ } X509_CINF;
/* This stuff is certificate "auxiliary info"
* it contains details which are useful in certificate
@@ -261,42 +264,42 @@ typedef struct x509_cinf_st
*/
typedef struct x509_cert_aux_st
- {
- STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
- STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
- ASN1_UTF8STRING *alias; /* "friendly name" */
- ASN1_OCTET_STRING *keyid; /* key id of private key */
- STACK_OF(X509_ALGOR) *other; /* other unspecified info */
- } X509_CERT_AUX;
+ {
+ STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
+ STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
+ ASN1_UTF8STRING *alias; /* "friendly name" */
+ ASN1_OCTET_STRING *keyid; /* key id of private key */
+ STACK_OF(X509_ALGOR) *other; /* other unspecified info */
+ } X509_CERT_AUX;
struct x509_st
- {
- X509_CINF *cert_info;
- X509_ALGOR *sig_alg;
- ASN1_BIT_STRING *signature;
- int valid;
- int references;
- char *name;
- CRYPTO_EX_DATA ex_data;
- /* These contain copies of various extension values */
- long ex_pathlen;
- long ex_pcpathlen;
- unsigned long ex_flags;
- unsigned long ex_kusage;
- unsigned long ex_xkusage;
- unsigned long ex_nscert;
- ASN1_OCTET_STRING *skid;
- struct AUTHORITY_KEYID_st *akid;
- X509_POLICY_CACHE *policy_cache;
+ {
+ X509_CINF *cert_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int valid;
+ int references;
+ char *name;
+ CRYPTO_EX_DATA ex_data;
+ /* These contain copies of various extension values */
+ long ex_pathlen;
+ long ex_pcpathlen;
+ unsigned long ex_flags;
+ unsigned long ex_kusage;
+ unsigned long ex_xkusage;
+ unsigned long ex_nscert;
+ ASN1_OCTET_STRING *skid;
+ struct AUTHORITY_KEYID_st *akid;
+ X509_POLICY_CACHE *policy_cache;
#ifndef OPENSSL_NO_RFC3779
- STACK_OF(IPAddressFamily) *rfc3779_addr;
- struct ASIdentifiers_st *rfc3779_asid;
+ STACK_OF(IPAddressFamily) *rfc3779_addr;
+ struct ASIdentifiers_st *rfc3779_asid;
#endif
#ifndef OPENSSL_NO_SHA
- unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
#endif
- X509_CERT_AUX *aux;
- } /* X509 */;
+ X509_CERT_AUX *aux;
+ } /* X509 */;
DECLARE_STACK_OF(X509)
DECLARE_ASN1_SET_OF(X509)
@@ -304,88 +307,88 @@ DECLARE_ASN1_SET_OF(X509)
/* This is used for a table of trust checking functions */
typedef struct x509_trust_st {
- int trust;
- int flags;
- int (*check_trust)(struct x509_trust_st *, X509 *, int);
- char *name;
- int arg1;
- void *arg2;
+ int trust;
+ int flags;
+ int (*check_trust)(struct x509_trust_st *, X509 *, int);
+ char *name;
+ int arg1;
+ void *arg2;
} X509_TRUST;
DECLARE_STACK_OF(X509_TRUST)
typedef struct x509_cert_pair_st {
- X509 *forward;
- X509 *reverse;
+ X509 *forward;
+ X509 *reverse;
} X509_CERT_PAIR;
/* standard trust ids */
-#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */
+#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */
-#define X509_TRUST_COMPAT 1
-#define X509_TRUST_SSL_CLIENT 2
-#define X509_TRUST_SSL_SERVER 3
-#define X509_TRUST_EMAIL 4
-#define X509_TRUST_OBJECT_SIGN 5
-#define X509_TRUST_OCSP_SIGN 6
-#define X509_TRUST_OCSP_REQUEST 7
+#define X509_TRUST_COMPAT 1
+#define X509_TRUST_SSL_CLIENT 2
+#define X509_TRUST_SSL_SERVER 3
+#define X509_TRUST_EMAIL 4
+#define X509_TRUST_OBJECT_SIGN 5
+#define X509_TRUST_OCSP_SIGN 6
+#define X509_TRUST_OCSP_REQUEST 7
/* Keep these up to date! */
-#define X509_TRUST_MIN 1
-#define X509_TRUST_MAX 7
+#define X509_TRUST_MIN 1
+#define X509_TRUST_MAX 7
/* trust_flags values */
-#define X509_TRUST_DYNAMIC 1
-#define X509_TRUST_DYNAMIC_NAME 2
+#define X509_TRUST_DYNAMIC 1
+#define X509_TRUST_DYNAMIC_NAME 2
/* check_trust return codes */
-#define X509_TRUST_TRUSTED 1
-#define X509_TRUST_REJECTED 2
-#define X509_TRUST_UNTRUSTED 3
+#define X509_TRUST_TRUSTED 1
+#define X509_TRUST_REJECTED 2
+#define X509_TRUST_UNTRUSTED 3
/* Flags for X509_print_ex() */
-#define X509_FLAG_COMPAT 0
-#define X509_FLAG_NO_HEADER 1L
-#define X509_FLAG_NO_VERSION (1L << 1)
-#define X509_FLAG_NO_SERIAL (1L << 2)
-#define X509_FLAG_NO_SIGNAME (1L << 3)
-#define X509_FLAG_NO_ISSUER (1L << 4)
-#define X509_FLAG_NO_VALIDITY (1L << 5)
-#define X509_FLAG_NO_SUBJECT (1L << 6)
-#define X509_FLAG_NO_PUBKEY (1L << 7)
-#define X509_FLAG_NO_EXTENSIONS (1L << 8)
-#define X509_FLAG_NO_SIGDUMP (1L << 9)
-#define X509_FLAG_NO_AUX (1L << 10)
-#define X509_FLAG_NO_ATTRIBUTES (1L << 11)
-
-/* Flags specific to X509_NAME_print_ex() */
+#define X509_FLAG_COMPAT 0
+#define X509_FLAG_NO_HEADER 1L
+#define X509_FLAG_NO_VERSION (1L << 1)
+#define X509_FLAG_NO_SERIAL (1L << 2)
+#define X509_FLAG_NO_SIGNAME (1L << 3)
+#define X509_FLAG_NO_ISSUER (1L << 4)
+#define X509_FLAG_NO_VALIDITY (1L << 5)
+#define X509_FLAG_NO_SUBJECT (1L << 6)
+#define X509_FLAG_NO_PUBKEY (1L << 7)
+#define X509_FLAG_NO_EXTENSIONS (1L << 8)
+#define X509_FLAG_NO_SIGDUMP (1L << 9)
+#define X509_FLAG_NO_AUX (1L << 10)
+#define X509_FLAG_NO_ATTRIBUTES (1L << 11)
+
+/* Flags specific to X509_NAME_print_ex() */
/* The field separator information */
-#define XN_FLAG_SEP_MASK (0xf << 16)
+#define XN_FLAG_SEP_MASK (0xf << 16)
-#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */
-#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */
-#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */
-#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */
-#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */
+#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */
+#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */
+#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */
+#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */
+#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */
-#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */
+#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */
/* How the field name is shown */
-#define XN_FLAG_FN_MASK (0x3 << 21)
+#define XN_FLAG_FN_MASK (0x3 << 21)
-#define XN_FLAG_FN_SN 0 /* Object short name */
-#define XN_FLAG_FN_LN (1 << 21) /* Object long name */
-#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */
-#define XN_FLAG_FN_NONE (3 << 21) /* No field names */
+#define XN_FLAG_FN_SN 0 /* Object short name */
+#define XN_FLAG_FN_LN (1 << 21) /* Object long name */
+#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */
+#define XN_FLAG_FN_NONE (3 << 21) /* No field names */
-#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */
+#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */
/* This determines if we dump fields we don't recognise:
* RFC2253 requires this.
@@ -393,102 +396,102 @@ typedef struct x509_cert_pair_st {
#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
-#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */
+#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */
/* Complete set of RFC2253 flags */
#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
- XN_FLAG_SEP_COMMA_PLUS | \
- XN_FLAG_DN_REV | \
- XN_FLAG_FN_SN | \
- XN_FLAG_DUMP_UNKNOWN_FIELDS)
+ XN_FLAG_SEP_COMMA_PLUS | \
+ XN_FLAG_DN_REV | \
+ XN_FLAG_FN_SN | \
+ XN_FLAG_DUMP_UNKNOWN_FIELDS)
/* readable oneline form */
#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
- ASN1_STRFLGS_ESC_QUOTE | \
- XN_FLAG_SEP_CPLUS_SPC | \
- XN_FLAG_SPC_EQ | \
- XN_FLAG_FN_SN)
+ ASN1_STRFLGS_ESC_QUOTE | \
+ XN_FLAG_SEP_CPLUS_SPC | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_SN)
/* readable multiline form */
#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
- ASN1_STRFLGS_ESC_MSB | \
- XN_FLAG_SEP_MULTILINE | \
- XN_FLAG_SPC_EQ | \
- XN_FLAG_FN_LN | \
- XN_FLAG_FN_ALIGN)
+ ASN1_STRFLGS_ESC_MSB | \
+ XN_FLAG_SEP_MULTILINE | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_LN | \
+ XN_FLAG_FN_ALIGN)
typedef struct X509_revoked_st
- {
- ASN1_INTEGER *serialNumber;
- ASN1_TIME *revocationDate;
- STACK_OF(X509_EXTENSION) /* optional */ *extensions;
- int sequence; /* load sequence */
- } X509_REVOKED;
+ {
+ ASN1_INTEGER *serialNumber;
+ ASN1_TIME *revocationDate;
+ STACK_OF(X509_EXTENSION) /* optional */ *extensions;
+ int sequence; /* load sequence */
+ } X509_REVOKED;
DECLARE_STACK_OF(X509_REVOKED)
DECLARE_ASN1_SET_OF(X509_REVOKED)
typedef struct X509_crl_info_st
- {
- ASN1_INTEGER *version;
- X509_ALGOR *sig_alg;
- X509_NAME *issuer;
- ASN1_TIME *lastUpdate;
- ASN1_TIME *nextUpdate;
- STACK_OF(X509_REVOKED) *revoked;
- STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
- ASN1_ENCODING enc;
- } X509_CRL_INFO;
+ {
+ ASN1_INTEGER *version;
+ X509_ALGOR *sig_alg;
+ X509_NAME *issuer;
+ ASN1_TIME *lastUpdate;
+ ASN1_TIME *nextUpdate;
+ STACK_OF(X509_REVOKED) *revoked;
+ STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
+ ASN1_ENCODING enc;
+ } X509_CRL_INFO;
struct X509_crl_st
- {
- /* actual signature */
- X509_CRL_INFO *crl;
- X509_ALGOR *sig_alg;
- ASN1_BIT_STRING *signature;
- int references;
- } /* X509_CRL */;
+ {
+ /* actual signature */
+ X509_CRL_INFO *crl;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+ } /* X509_CRL */;
DECLARE_STACK_OF(X509_CRL)
DECLARE_ASN1_SET_OF(X509_CRL)
typedef struct private_key_st
- {
- int version;
- /* The PKCS#8 data types */
- X509_ALGOR *enc_algor;
- ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
+ {
+ int version;
+ /* The PKCS#8 data types */
+ X509_ALGOR *enc_algor;
+ ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
- /* When decrypted, the following will not be NULL */
- EVP_PKEY *dec_pkey;
+ /* When decrypted, the following will not be NULL */
+ EVP_PKEY *dec_pkey;
- /* used to encrypt and decrypt */
- int key_length;
- char *key_data;
- int key_free; /* true if we should auto free key_data */
+ /* used to encrypt and decrypt */
+ int key_length;
+ char *key_data;
+ int key_free; /* true if we should auto free key_data */
- /* expanded version of 'enc_algor' */
- EVP_CIPHER_INFO cipher;
+ /* expanded version of 'enc_algor' */
+ EVP_CIPHER_INFO cipher;
- int references;
- } X509_PKEY;
+ int references;
+ } X509_PKEY;
#ifndef OPENSSL_NO_EVP
typedef struct X509_info_st
- {
- X509 *x509;
- X509_CRL *crl;
- X509_PKEY *x_pkey;
+ {
+ X509 *x509;
+ X509_CRL *crl;
+ X509_PKEY *x_pkey;
- EVP_CIPHER_INFO enc_cipher;
- int enc_len;
- char *enc_data;
+ EVP_CIPHER_INFO enc_cipher;
+ int enc_len;
+ char *enc_data;
- int references;
- } X509_INFO;
+ int references;
+ } X509_INFO;
DECLARE_STACK_OF(X509_INFO)
#endif
@@ -498,30 +501,30 @@ DECLARE_STACK_OF(X509_INFO)
* Netscapes spki structures - useful if you are writing a CA web page
*/
typedef struct Netscape_spkac_st
- {
- X509_PUBKEY *pubkey;
- ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
- } NETSCAPE_SPKAC;
+ {
+ X509_PUBKEY *pubkey;
+ ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
+ } NETSCAPE_SPKAC;
typedef struct Netscape_spki_st
- {
- NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
- X509_ALGOR *sig_algor;
- ASN1_BIT_STRING *signature;
- } NETSCAPE_SPKI;
+ {
+ NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
+ X509_ALGOR *sig_algor;
+ ASN1_BIT_STRING *signature;
+ } NETSCAPE_SPKI;
/* Netscape certificate sequence structure */
typedef struct Netscape_certificate_sequence
- {
- ASN1_OBJECT *type;
- STACK_OF(X509) *certs;
- } NETSCAPE_CERT_SEQUENCE;
+ {
+ ASN1_OBJECT *type;
+ STACK_OF(X509) *certs;
+ } NETSCAPE_CERT_SEQUENCE;
/* Unused (and iv length is wrong)
typedef struct CBCParameter_st
- {
- unsigned char iv[8];
- } CBC_PARAM;
+ {
+ unsigned char iv[8];
+ } CBC_PARAM;
*/
/* Password based encryption structure */
@@ -539,7 +542,7 @@ X509_ALGOR *encryption;
} PBE2PARAM;
typedef struct PBKDF2PARAM_st {
-ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */
+ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */
ASN1_INTEGER *iter;
ASN1_INTEGER *keylength;
X509_ALGOR *prf;
@@ -551,10 +554,10 @@ X509_ALGOR *prf;
typedef struct pkcs8_priv_key_info_st
{
int broken; /* Flag for various broken formats */
-#define PKCS8_OK 0
-#define PKCS8_NO_OCTET 1
-#define PKCS8_EMBEDDED_PARAM 2
-#define PKCS8_NS_DB 3
+#define PKCS8_OK 0
+#define PKCS8_NO_OCTET 1
+#define PKCS8_EMBEDDED_PARAM 2
+#define PKCS8_NS_DB 3
ASN1_INTEGER *version;
X509_ALGOR *pkeyalg;
ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
@@ -574,172 +577,172 @@ extern "C" {
#ifdef SSLEAY_MACROS
#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\
- a->signature,(char *)a->cert_info,r)
+ a->signature,(char *)a->cert_info,r)
#define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \
- a->sig_alg,a->signature,(char *)a->req_info,r)
+ a->sig_alg,a->signature,(char *)a->req_info,r)
#define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \
- a->sig_alg, a->signature,(char *)a->crl,r)
+ a->sig_alg, a->signature,(char *)a->crl,r)
#define X509_sign(x,pkey,md) \
- ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \
- x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)
+ ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \
+ x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)
#define X509_REQ_sign(x,pkey,md) \
- ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \
- x->signature, (char *)x->req_info,pkey,md)
+ ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \
+ x->signature, (char *)x->req_info,pkey,md)
#define X509_CRL_sign(x,pkey,md) \
- ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \
- x->signature, (char *)x->crl,pkey,md)
+ ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \
+ x->signature, (char *)x->crl,pkey,md)
#define NETSCAPE_SPKI_sign(x,pkey,md) \
- ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \
- x->signature, (char *)x->spkac,pkey,md)
+ ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \
+ x->signature, (char *)x->spkac,pkey,md)
#define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \
- (char *(*)())d2i_X509,(char *)x509)
+ (char *(*)())d2i_X509,(char *)x509)
#define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\
- (int (*)())i2d_X509_ATTRIBUTE, \
- (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa)
+ (int (*)())i2d_X509_ATTRIBUTE, \
+ (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa)
#define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \
- (int (*)())i2d_X509_EXTENSION, \
- (char *(*)())d2i_X509_EXTENSION,(char *)ex)
+ (int (*)())i2d_X509_EXTENSION, \
+ (char *(*)())d2i_X509_EXTENSION,(char *)ex)
#define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \
- (char *(*)())d2i_X509, (fp),(unsigned char **)(x509))
+ (char *(*)())d2i_X509, (fp),(unsigned char **)(x509))
#define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)
#define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \
- (char *(*)())d2i_X509, (bp),(unsigned char **)(x509))
+ (char *(*)())d2i_X509, (bp),(unsigned char **)(x509))
#define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)
#define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \
- (char *(*)())d2i_X509_CRL,(char *)crl)
+ (char *(*)())d2i_X509_CRL,(char *)crl)
#define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \
- X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\
- (unsigned char **)(crl))
+ X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\
+ (unsigned char **)(crl))
#define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\
- (unsigned char *)crl)
+ (unsigned char *)crl)
#define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \
- X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\
- (unsigned char **)(crl))
+ X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\
+ (unsigned char **)(crl))
#define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\
- (unsigned char *)crl)
+ (unsigned char *)crl)
#define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \
- (char *(*)())d2i_PKCS7,(char *)p7)
+ (char *(*)())d2i_PKCS7,(char *)p7)
#define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \
- PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\
- (unsigned char **)(p7))
+ PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\
+ (unsigned char **)(p7))
#define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\
- (unsigned char *)p7)
+ (unsigned char *)p7)
#define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \
- PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\
- (unsigned char **)(p7))
+ PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\
+ (unsigned char **)(p7))
#define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\
- (unsigned char *)p7)
+ (unsigned char *)p7)
#define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \
- (char *(*)())d2i_X509_REQ,(char *)req)
+ (char *(*)())d2i_X509_REQ,(char *)req)
#define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\
- X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\
- (unsigned char **)(req))
+ X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\
+ (unsigned char **)(req))
#define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\
- (unsigned char *)req)
+ (unsigned char *)req)
#define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\
- X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\
- (unsigned char **)(req))
+ X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\
+ (unsigned char **)(req))
#define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\
- (unsigned char *)req)
+ (unsigned char *)req)
#define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \
- (char *(*)())d2i_RSAPublicKey,(char *)rsa)
+ (char *(*)())d2i_RSAPublicKey,(char *)rsa)
#define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \
- (char *(*)())d2i_RSAPrivateKey,(char *)rsa)
+ (char *(*)())d2i_RSAPrivateKey,(char *)rsa)
#define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
- RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \
- (unsigned char **)(rsa))
+ RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \
+ (unsigned char **)(rsa))
#define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \
- (unsigned char *)rsa)
+ (unsigned char *)rsa)
#define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
- RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \
- (unsigned char **)(rsa))
+ RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \
+ (unsigned char **)(rsa))
#define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \
- (unsigned char *)rsa)
+ (unsigned char *)rsa)
#define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\
- RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \
- (unsigned char **)(rsa))
+ RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \
+ (unsigned char **)(rsa))
#define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \
- (unsigned char *)rsa)
+ (unsigned char *)rsa)
#define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\
- RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \
- (unsigned char **)(rsa))
+ RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \
+ (unsigned char **)(rsa))
#define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \
- (unsigned char *)rsa)
+ (unsigned char *)rsa)
#define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\
- DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \
- (unsigned char **)(dsa))
+ DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \
+ (unsigned char **)(dsa))
#define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \
- (unsigned char *)dsa)
+ (unsigned char *)dsa)
#define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\
- DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \
- (unsigned char **)(dsa))
+ DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \
+ (unsigned char **)(dsa))
#define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \
- (unsigned char *)dsa)
+ (unsigned char *)dsa)
#define d2i_ECPrivateKey_fp(fp,ecdsa) (EC_KEY *)ASN1_d2i_fp((char *(*)())\
- EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), \
- (unsigned char **)(ecdsa))
+ EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), \
+ (unsigned char **)(ecdsa))
#define i2d_ECPrivateKey_fp(fp,ecdsa) ASN1_i2d_fp(i2d_ECPrivateKey,fp, \
- (unsigned char *)ecdsa)
+ (unsigned char *)ecdsa)
#define d2i_ECPrivateKey_bio(bp,ecdsa) (EC_KEY *)ASN1_d2i_bio((char *(*)())\
- EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), \
- (unsigned char **)(ecdsa))
+ EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), \
+ (unsigned char **)(ecdsa))
#define i2d_ECPrivateKey_bio(bp,ecdsa) ASN1_i2d_bio(i2d_ECPrivateKey,bp, \
- (unsigned char *)ecdsa)
+ (unsigned char *)ecdsa)
#define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\
- (char *(*)())d2i_X509_ALGOR,(char *)xn)
+ (char *(*)())d2i_X509_ALGOR,(char *)xn)
#define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \
- (char *(*)())d2i_X509_NAME,(char *)xn)
+ (char *(*)())d2i_X509_NAME,(char *)xn)
#define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \
- (int (*)())i2d_X509_NAME_ENTRY, \
- (char *(*)())d2i_X509_NAME_ENTRY,\
- (char *)ne)
+ (int (*)())i2d_X509_NAME_ENTRY, \
+ (char *(*)())d2i_X509_NAME_ENTRY,\
+ (char *)ne)
#define X509_digest(data,type,md,len) \
- ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)
+ ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)
#define X509_NAME_digest(data,type,md,len) \
- ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)
+ ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)
#ifndef PKCS7_ISSUER_AND_SERIAL_digest
#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \
- ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
- (char *)data,md,len)
+ ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
+ (char *)data,md,len)
#endif
#endif
-#define X509_EXT_PACK_UNKNOWN 1
-#define X509_EXT_PACK_STRING 2
-
-#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
-/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
-#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
-#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
-#define X509_extract_key(x) X509_get_pubkey(x) /*****/
-#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
-#define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
-#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
-#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
-#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
-
-#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
-#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
-#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
-#define X509_CRL_get_issuer(x) ((x)->crl->issuer)
-#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
+#define X509_EXT_PACK_UNKNOWN 1
+#define X509_EXT_PACK_STRING 2
+
+#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
+/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
+#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
+#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
+#define X509_extract_key(x) X509_get_pubkey(x) /*****/
+#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
+#define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
+#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
+#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
+#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
+
+#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
+#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
+#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
+#define X509_CRL_get_issuer(x) ((x)->crl->issuer)
+#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
/* This one is only used so that a binary form can output, as in
* i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */
-#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
+#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
const char *X509_verify_cert_error_string(long n);
@@ -767,15 +770,15 @@ int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
int X509_pubkey_digest(const X509 *data,const EVP_MD *type,
- unsigned char *md, unsigned int *len);
+ unsigned char *md, unsigned int *len);
int X509_digest(const X509 *data,const EVP_MD *type,
- unsigned char *md, unsigned int *len);
+ unsigned char *md, unsigned int *len);
int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
- unsigned char *md, unsigned int *len);
+ unsigned char *md, unsigned int *len);
int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type,
- unsigned char *md, unsigned int *len);
+ unsigned char *md, unsigned int *len);
int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
- unsigned char *md, unsigned int *len);
+ unsigned char *md, unsigned int *len);
#endif
#ifndef OPENSSL_NO_FP_API
@@ -808,7 +811,7 @@ int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8);
int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
- PKCS8_PRIV_KEY_INFO **p8inf);
+ PKCS8_PRIV_KEY_INFO **p8inf);
int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
@@ -847,7 +850,7 @@ int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8);
int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8);
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
- PKCS8_PRIV_KEY_INFO **p8inf);
+ PKCS8_PRIV_KEY_INFO **p8inf);
int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf);
int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
@@ -862,52 +865,57 @@ X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
X509_CRL *X509_CRL_dup(X509_CRL *crl);
X509_REQ *X509_REQ_dup(X509_REQ *req);
X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
+int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
+void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
+ X509_ALGOR *algor);
+
X509_NAME *X509_NAME_dup(X509_NAME *xn);
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
#endif /* !SSLEAY_MACROS */
-int X509_cmp_time(ASN1_TIME *s, time_t *t);
-int X509_cmp_current_time(ASN1_TIME *s);
-ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
-ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj);
+int X509_cmp_time(ASN1_TIME *s, time_t *t);
+int X509_cmp_current_time(ASN1_TIME *s);
+ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
+ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj);
-const char * X509_get_default_cert_area(void );
-const char * X509_get_default_cert_dir(void );
-const char * X509_get_default_cert_file(void );
-const char * X509_get_default_cert_dir_env(void );
-const char * X509_get_default_cert_file_env(void );
-const char * X509_get_default_private_dir(void );
+const char * X509_get_default_cert_area(void );
+const char * X509_get_default_cert_dir(void );
+const char * X509_get_default_cert_file(void );
+const char * X509_get_default_cert_dir_env(void );
+const char * X509_get_default_cert_file_env(void );
+const char * X509_get_default_private_dir(void );
-X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
-X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
+X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
DECLARE_ASN1_FUNCTIONS(X509_VAL)
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
-int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
-EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key);
-int X509_get_pubkey_parameters(EVP_PKEY *pkey,
- STACK_OF(X509) *chain);
-int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
-EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
- long length);
+int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
+EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key);
+int X509_get_pubkey_parameters(EVP_PKEY *pkey,
+ STACK_OF(X509) *chain);
+int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
+EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
+ long length);
#ifndef OPENSSL_NO_RSA
-int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
-RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
- long length);
+int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
+RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
+ long length);
#endif
#ifndef OPENSSL_NO_DSA
-int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
-DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
- long length);
+int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
+DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
+ long length);
#endif
#ifndef OPENSSL_NO_EC
-int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
-EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
- long length);
+int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
+EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
+ long length);
#endif
DECLARE_ASN1_FUNCTIONS(X509_SIG)
@@ -918,12 +926,13 @@ DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
DECLARE_ASN1_FUNCTIONS(X509_NAME)
-int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
+int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
DECLARE_ASN1_FUNCTIONS(X509_CINF)
@@ -933,11 +942,11 @@ DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
- CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int X509_set_ex_data(X509 *r, int idx, void *arg);
void *X509_get_ex_data(X509 *r, int idx);
-int i2d_X509_AUX(X509 *a,unsigned char **pp);
-X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
+int i2d_X509_AUX(X509 *a,unsigned char **pp);
+X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length);
int X509_alias_set1(X509 *x, unsigned char *name, int len);
int X509_keyid_set1(X509 *x, unsigned char *id, int len);
@@ -956,83 +965,83 @@ DECLARE_ASN1_FUNCTIONS(X509_CRL)
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
-X509_PKEY * X509_PKEY_new(void );
-void X509_PKEY_free(X509_PKEY *a);
-int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
-X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
+X509_PKEY * X509_PKEY_new(void );
+void X509_PKEY_free(X509_PKEY *a);
+int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
+X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
#ifndef OPENSSL_NO_EVP
-X509_INFO * X509_INFO_new(void);
-void X509_INFO_free(X509_INFO *a);
-char * X509_NAME_oneline(X509_NAME *a,char *buf,int size);
+X509_INFO * X509_INFO_new(void);
+void X509_INFO_free(X509_INFO *a);
+char * X509_NAME_oneline(X509_NAME *a,char *buf,int size);
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
- ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey);
+ ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey);
int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data,
- unsigned char *md,unsigned int *len);
+ unsigned char *md,unsigned int *len);
int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
- X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
- char *data,EVP_PKEY *pkey, const EVP_MD *type);
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
+ char *data,EVP_PKEY *pkey, const EVP_MD *type);
int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
- unsigned char *md,unsigned int *len);
+ unsigned char *md,unsigned int *len);
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
- ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
+ ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
- ASN1_BIT_STRING *signature,
- void *data, EVP_PKEY *pkey, const EVP_MD *type);
+ ASN1_BIT_STRING *signature,
+ void *data, EVP_PKEY *pkey, const EVP_MD *type);
#endif
-int X509_set_version(X509 *x,long version);
-int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
-ASN1_INTEGER * X509_get_serialNumber(X509 *x);
-int X509_set_issuer_name(X509 *x, X509_NAME *name);
-X509_NAME * X509_get_issuer_name(X509 *a);
-int X509_set_subject_name(X509 *x, X509_NAME *name);
-X509_NAME * X509_get_subject_name(X509 *a);
-int X509_set_notBefore(X509 *x, ASN1_TIME *tm);
-int X509_set_notAfter(X509 *x, ASN1_TIME *tm);
-int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
-EVP_PKEY * X509_get_pubkey(X509 *x);
+int X509_set_version(X509 *x,long version);
+int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
+ASN1_INTEGER * X509_get_serialNumber(X509 *x);
+int X509_set_issuer_name(X509 *x, X509_NAME *name);
+X509_NAME * X509_get_issuer_name(X509 *a);
+int X509_set_subject_name(X509 *x, X509_NAME *name);
+X509_NAME * X509_get_subject_name(X509 *a);
+int X509_set_notBefore(X509 *x, ASN1_TIME *tm);
+int X509_set_notAfter(X509 *x, ASN1_TIME *tm);
+int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
+EVP_PKEY * X509_get_pubkey(X509 *x);
ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
-int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
-
-int X509_REQ_set_version(X509_REQ *x,long version);
-int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);
-int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
-EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req);
-int X509_REQ_extension_nid(int nid);
-int * X509_REQ_get_extension_nids(void);
-void X509_REQ_set_extension_nids(int *nids);
+int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
+
+int X509_REQ_set_version(X509_REQ *x,long version);
+int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name);
+int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
+EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req);
+int X509_REQ_extension_nid(int nid);
+int * X509_REQ_get_extension_nids(void);
+void X509_REQ_set_extension_nids(int *nids);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
- int nid);
+ int nid);
int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
int X509_REQ_get_attr_count(const X509_REQ *req);
int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid,
- int lastpos);
+ int lastpos);
int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
- int lastpos);
+ int lastpos);
X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
- const ASN1_OBJECT *obj, int type,
- const unsigned char *bytes, int len);
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
int X509_REQ_add1_attr_by_NID(X509_REQ *req,
- int nid, int type,
- const unsigned char *bytes, int len);
+ int nid, int type,
+ const unsigned char *bytes, int len);
int X509_REQ_add1_attr_by_txt(X509_REQ *req,
- const char *attrname, int type,
- const unsigned char *bytes, int len);
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
int X509_CRL_set_version(X509_CRL *x, long version);
int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
@@ -1043,191 +1052,193 @@ int X509_CRL_sort(X509_CRL *crl);
int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
-int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey);
+int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey);
-int X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
+int X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
-int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
-unsigned long X509_issuer_and_serial_hash(X509 *a);
+int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_and_serial_hash(X509 *a);
-int X509_issuer_name_cmp(const X509 *a, const X509 *b);
-unsigned long X509_issuer_name_hash(X509 *a);
+int X509_issuer_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_name_hash(X509 *a);
-int X509_subject_name_cmp(const X509 *a, const X509 *b);
-unsigned long X509_subject_name_hash(X509 *x);
+int X509_subject_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_subject_name_hash(X509 *x);
-int X509_cmp(const X509 *a, const X509 *b);
-int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
-unsigned long X509_NAME_hash(X509_NAME *x);
+int X509_cmp(const X509 *a, const X509 *b);
+int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
+unsigned long X509_NAME_hash(X509_NAME *x);
-int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
+int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
#ifndef OPENSSL_NO_FP_API
-int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
-int X509_print_fp(FILE *bp,X509 *x);
-int X509_CRL_print_fp(FILE *bp,X509_CRL *x);
-int X509_REQ_print_fp(FILE *bp,X509_REQ *req);
+int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
+int X509_print_fp(FILE *bp,X509 *x);
+int X509_CRL_print_fp(FILE *bp,X509_CRL *x);
+int X509_REQ_print_fp(FILE *bp,X509_REQ *req);
int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags);
#endif
#ifndef OPENSSL_NO_BIO
-int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
+int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags);
-int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
-int X509_print(BIO *bp,X509 *x);
-int X509_ocspid_print(BIO *bp,X509 *x);
-int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
-int X509_CRL_print(BIO *bp,X509_CRL *x);
-int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
-int X509_REQ_print(BIO *bp,X509_REQ *req);
+int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
+int X509_print(BIO *bp,X509 *x);
+int X509_ocspid_print(BIO *bp,X509 *x);
+int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
+int X509_CRL_print(BIO *bp,X509_CRL *x);
+int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);
+int X509_REQ_print(BIO *bp,X509_REQ *req);
#endif
-int X509_NAME_entry_count(X509_NAME *name);
-int X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
- char *buf,int len);
-int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
- char *buf,int len);
+int X509_NAME_entry_count(X509_NAME *name);
+int X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
+ char *buf,int len);
+int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
+ char *buf,int len);
/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
* lastpos, search after that position on. */
-int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
-int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj,
- int lastpos);
+int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
+int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj,
+ int lastpos);
X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
-int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne,
- int loc, int set);
+int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne,
+ int loc, int set);
int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
- unsigned char *bytes, int len, int loc, int set);
+ unsigned char *bytes, int len, int loc, int set);
int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
- unsigned char *bytes, int len, int loc, int set);
+ unsigned char *bytes, int len, int loc, int set);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
- const char *field, int type, const unsigned char *bytes, int len);
+ const char *field, int type, const unsigned char *bytes, int len);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
- int type,unsigned char *bytes, int len);
+ int type,unsigned char *bytes, int len);
int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
- const unsigned char *bytes, int len, int loc, int set);
+ const unsigned char *bytes, int len, int loc, int set);
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
- ASN1_OBJECT *obj, int type,const unsigned char *bytes,
- int len);
-int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
- ASN1_OBJECT *obj);
-int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
- const unsigned char *bytes, int len);
-ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
-ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
-
-int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
-int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
- int nid, int lastpos);
-int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
- ASN1_OBJECT *obj,int lastpos);
-int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
- int crit, int lastpos);
+ ASN1_OBJECT *obj, int type,const unsigned char *bytes,
+ int len);
+int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
+ ASN1_OBJECT *obj);
+int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
+ const unsigned char *bytes, int len);
+ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
+ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
+
+int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
+int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
+ int nid, int lastpos);
+int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
+ ASN1_OBJECT *obj,int lastpos);
+int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
+ int crit, int lastpos);
X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
- X509_EXTENSION *ex, int loc);
+ X509_EXTENSION *ex, int loc);
-int X509_get_ext_count(X509 *x);
-int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
-int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos);
-int X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
+int X509_get_ext_count(X509 *x);
+int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
+int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos);
+int X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
X509_EXTENSION *X509_get_ext(X509 *x, int loc);
X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
-int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
-void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
-int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
- unsigned long flags);
-
-int X509_CRL_get_ext_count(X509_CRL *x);
-int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
-int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos);
-int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
+int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
+void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
+int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_CRL_get_ext_count(X509_CRL *x);
+int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
+int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos);
+int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
-int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
-void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
-int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
- unsigned long flags);
-
-int X509_REVOKED_get_ext_count(X509_REVOKED *x);
-int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
-int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos);
-int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
+int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
+void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
+int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_REVOKED_get_ext_count(X509_REVOKED *x);
+int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
+int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos);
+int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
-int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
-void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
-int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
- unsigned long flags);
+int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
+void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
+int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
+ unsigned long flags);
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
- int nid, int crit, ASN1_OCTET_STRING *data);
+ int nid, int crit, ASN1_OCTET_STRING *data);
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
- ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data);
-int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj);
-int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
-int X509_EXTENSION_set_data(X509_EXTENSION *ex,
- ASN1_OCTET_STRING *data);
-ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex);
+ ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data);
+int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj);
+int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
+int X509_EXTENSION_set_data(X509_EXTENSION *ex,
+ ASN1_OCTET_STRING *data);
+ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex);
ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
-int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
+int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
- int lastpos);
+ int lastpos);
int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj,
- int lastpos);
+ int lastpos);
X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
- X509_ATTRIBUTE *attr);
+ X509_ATTRIBUTE *attr);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
- const ASN1_OBJECT *obj, int type,
- const unsigned char *bytes, int len);
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
- int nid, int type,
- const unsigned char *bytes, int len);
+ int nid, int type,
+ const unsigned char *bytes, int len);
STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
- const char *attrname, int type,
- const unsigned char *bytes, int len);
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
+void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
+ ASN1_OBJECT *obj, int lastpos, int type);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
- int atrtype, const void *data, int len);
+ int atrtype, const void *data, int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
- const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
+ const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
- const char *atrname, int type, const unsigned char *bytes, int len);
+ const char *atrname, int type, const unsigned char *bytes, int len);
int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len);
void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
- int atrtype, void *data);
+ int atrtype, void *data);
int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid,
- int lastpos);
+ int lastpos);
int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
- int lastpos);
+ int lastpos);
X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
- const ASN1_OBJECT *obj, int type,
- const unsigned char *bytes, int len);
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
- int nid, int type,
- const unsigned char *bytes, int len);
+ int nid, int type,
+ const unsigned char *bytes, int len);
int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
- const char *attrname, int type,
- const unsigned char *bytes, int len);
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
-int X509_verify_cert(X509_STORE_CTX *ctx);
+int X509_verify_cert(X509_STORE_CTX *ctx);
/* lookup a cert from a X509 STACK */
X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
- ASN1_INTEGER *serial);
+ ASN1_INTEGER *serial);
X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
DECLARE_ASN1_FUNCTIONS(PBEPARAM)
@@ -1236,7 +1247,7 @@ DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen);
X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
- unsigned char *salt, int saltlen);
+ unsigned char *salt, int saltlen);
/* PKCS#8 utilities */
@@ -1252,7 +1263,7 @@ int X509_TRUST_get_count(void);
X509_TRUST * X509_TRUST_get0(int idx);
int X509_TRUST_get_by_id(int id);
int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
- char *name, int arg1, void *arg2);
+ char *name, int arg1, void *arg2);
void X509_TRUST_cleanup(void);
int X509_TRUST_get_flags(X509_TRUST *xp);
char *X509_TRUST_get0_name(X509_TRUST *xp);
@@ -1267,79 +1278,78 @@ void ERR_load_X509_strings(void);
/* Error codes for the X509 functions. */
/* Function codes. */
-#define X509_F_ADD_CERT_DIR 100
-#define X509_F_BY_FILE_CTRL 101
-#define X509_F_CHECK_POLICY 145
-#define X509_F_DIR_CTRL 102
-#define X509_F_GET_CERT_BY_SUBJECT 103
-#define X509_F_NETSCAPE_SPKI_B64_DECODE 129
-#define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
-#define X509_F_X509AT_ADD1_ATTR 135
-#define X509_F_X509V3_ADD_EXT 104
-#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
-#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
-#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
-#define X509_F_X509_ATTRIBUTE_GET0_DATA 139
-#define X509_F_X509_ATTRIBUTE_SET1_DATA 138
-#define X509_F_X509_CHECK_PRIVATE_KEY 128
-#define X509_F_X509_CRL_PRINT_FP 147
-#define X509_F_X509_EXTENSION_CREATE_BY_NID 108
-#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
-#define X509_F_X509_GET_PUBKEY_PARAMETERS 110
-#define X509_F_X509_LOAD_CERT_CRL_FILE 132
-#define X509_F_X509_LOAD_CERT_FILE 111
-#define X509_F_X509_LOAD_CRL_FILE 112
-#define X509_F_X509_NAME_ADD_ENTRY 113
-#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
-#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
-#define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
-#define X509_F_X509_NAME_ONELINE 116
-#define X509_F_X509_NAME_PRINT 117
-#define X509_F_X509_PRINT_EX_FP 118
-#define X509_F_X509_PUBKEY_GET 119
-#define X509_F_X509_PUBKEY_SET 120
-#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
-#define X509_F_X509_REQ_PRINT_EX 121
-#define X509_F_X509_REQ_PRINT_FP 122
-#define X509_F_X509_REQ_TO_X509 123
-#define X509_F_X509_STORE_ADD_CERT 124
-#define X509_F_X509_STORE_ADD_CRL 125
-#define X509_F_X509_STORE_CTX_GET1_ISSUER 146
-#define X509_F_X509_STORE_CTX_INIT 143
-#define X509_F_X509_STORE_CTX_NEW 142
-#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
-#define X509_F_X509_TO_X509_REQ 126
-#define X509_F_X509_TRUST_ADD 133
-#define X509_F_X509_TRUST_SET 141
-#define X509_F_X509_VERIFY_CERT 127
+#define X509_F_ADD_CERT_DIR 100
+#define X509_F_BY_FILE_CTRL 101
+#define X509_F_CHECK_POLICY 145
+#define X509_F_DIR_CTRL 102
+#define X509_F_GET_CERT_BY_SUBJECT 103
+#define X509_F_NETSCAPE_SPKI_B64_DECODE 129
+#define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
+#define X509_F_X509AT_ADD1_ATTR 135
+#define X509_F_X509V3_ADD_EXT 104
+#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
+#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
+#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
+#define X509_F_X509_ATTRIBUTE_GET0_DATA 139
+#define X509_F_X509_ATTRIBUTE_SET1_DATA 138
+#define X509_F_X509_CHECK_PRIVATE_KEY 128
+#define X509_F_X509_CRL_PRINT_FP 147
+#define X509_F_X509_EXTENSION_CREATE_BY_NID 108
+#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
+#define X509_F_X509_GET_PUBKEY_PARAMETERS 110
+#define X509_F_X509_LOAD_CERT_CRL_FILE 132
+#define X509_F_X509_LOAD_CERT_FILE 111
+#define X509_F_X509_LOAD_CRL_FILE 112
+#define X509_F_X509_NAME_ADD_ENTRY 113
+#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
+#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
+#define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
+#define X509_F_X509_NAME_ONELINE 116
+#define X509_F_X509_NAME_PRINT 117
+#define X509_F_X509_PRINT_EX_FP 118
+#define X509_F_X509_PUBKEY_GET 119
+#define X509_F_X509_PUBKEY_SET 120
+#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
+#define X509_F_X509_REQ_PRINT_EX 121
+#define X509_F_X509_REQ_PRINT_FP 122
+#define X509_F_X509_REQ_TO_X509 123
+#define X509_F_X509_STORE_ADD_CERT 124
+#define X509_F_X509_STORE_ADD_CRL 125
+#define X509_F_X509_STORE_CTX_GET1_ISSUER 146
+#define X509_F_X509_STORE_CTX_INIT 143
+#define X509_F_X509_STORE_CTX_NEW 142
+#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
+#define X509_F_X509_TO_X509_REQ 126
+#define X509_F_X509_TRUST_ADD 133
+#define X509_F_X509_TRUST_SET 141
+#define X509_F_X509_VERIFY_CERT 127
/* Reason codes. */
-#define X509_R_BAD_X509_FILETYPE 100
-#define X509_R_BASE64_DECODE_ERROR 118
-#define X509_R_CANT_CHECK_DH_KEY 114
-#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
-#define X509_R_ERR_ASN1_LIB 102
-#define X509_R_INVALID_DIRECTORY 113
-#define X509_R_INVALID_FIELD_NAME 119
-#define X509_R_INVALID_TRUST 123
-#define X509_R_KEY_TYPE_MISMATCH 115
-#define X509_R_KEY_VALUES_MISMATCH 116
-#define X509_R_LOADING_CERT_DIR 103
-#define X509_R_LOADING_DEFAULTS 104
-#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
-#define X509_R_SHOULD_RETRY 106
-#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
-#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
-#define X509_R_UNKNOWN_KEY_TYPE 117
-#define X509_R_UNKNOWN_NID 109
-#define X509_R_UNKNOWN_PURPOSE_ID 121
-#define X509_R_UNKNOWN_TRUST_ID 120
-#define X509_R_UNSUPPORTED_ALGORITHM 111
-#define X509_R_WRONG_LOOKUP_TYPE 112
-#define X509_R_WRONG_TYPE 122
+#define X509_R_BAD_X509_FILETYPE 100
+#define X509_R_BASE64_DECODE_ERROR 118
+#define X509_R_CANT_CHECK_DH_KEY 114
+#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
+#define X509_R_ERR_ASN1_LIB 102
+#define X509_R_INVALID_DIRECTORY 113
+#define X509_R_INVALID_FIELD_NAME 119
+#define X509_R_INVALID_TRUST 123
+#define X509_R_KEY_TYPE_MISMATCH 115
+#define X509_R_KEY_VALUES_MISMATCH 116
+#define X509_R_LOADING_CERT_DIR 103
+#define X509_R_LOADING_DEFAULTS 104
+#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
+#define X509_R_SHOULD_RETRY 106
+#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
+#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
+#define X509_R_UNKNOWN_KEY_TYPE 117
+#define X509_R_UNKNOWN_NID 109
+#define X509_R_UNKNOWN_PURPOSE_ID 121
+#define X509_R_UNKNOWN_TRUST_ID 120
+#define X509_R_UNSUPPORTED_ALGORITHM 111
+#define X509_R_WRONG_LOOKUP_TYPE 112
+#define X509_R_WRONG_TYPE 122
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/include/openssl/x509v3.h b/dep/include/openssl/x509v3.h
index 6b3a2ff64de..9ef83da755e 100644
--- a/dep/include/openssl/x509v3.h
+++ b/dep/include/openssl/x509v3.h
@@ -1,5 +1,5 @@
/* x509v3.h */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
/* ====================================================================
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -108,7 +108,7 @@ X509V3_EXT_V2I v2i;
X509V3_EXT_I2R i2r;
X509V3_EXT_R2I r2i;
-void *usr_data; /* Any extension specific data */
+void *usr_data; /* Any extension specific data */
};
typedef struct X509V3_CONF_METHOD_st {
@@ -136,9 +136,9 @@ typedef struct v3_ext_method X509V3_EXT_METHOD;
DECLARE_STACK_OF(X509V3_EXT_METHOD)
/* ext_flags values */
-#define X509V3_EXT_DYNAMIC 0x1
-#define X509V3_EXT_CTX_DEP 0x2
-#define X509V3_EXT_MULTILINE 0x4
+#define X509V3_EXT_DYNAMIC 0x1
+#define X509V3_EXT_CTX_DEP 0x2
+#define X509V3_EXT_MULTILINE 0x4
typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
@@ -159,49 +159,49 @@ ASN1_TYPE *value;
} OTHERNAME;
typedef struct EDIPartyName_st {
- ASN1_STRING *nameAssigner;
- ASN1_STRING *partyName;
+ ASN1_STRING *nameAssigner;
+ ASN1_STRING *partyName;
} EDIPARTYNAME;
typedef struct GENERAL_NAME_st {
-#define GEN_OTHERNAME 0
-#define GEN_EMAIL 1
-#define GEN_DNS 2
-#define GEN_X400 3
-#define GEN_DIRNAME 4
-#define GEN_EDIPARTY 5
-#define GEN_URI 6
-#define GEN_IPADD 7
-#define GEN_RID 8
+#define GEN_OTHERNAME 0
+#define GEN_EMAIL 1
+#define GEN_DNS 2
+#define GEN_X400 3
+#define GEN_DIRNAME 4
+#define GEN_EDIPARTY 5
+#define GEN_URI 6
+#define GEN_IPADD 7
+#define GEN_RID 8
int type;
union {
- char *ptr;
- OTHERNAME *otherName; /* otherName */
- ASN1_IA5STRING *rfc822Name;
- ASN1_IA5STRING *dNSName;
- ASN1_TYPE *x400Address;
- X509_NAME *directoryName;
- EDIPARTYNAME *ediPartyName;
- ASN1_IA5STRING *uniformResourceIdentifier;
- ASN1_OCTET_STRING *iPAddress;
- ASN1_OBJECT *registeredID;
-
- /* Old names */
- ASN1_OCTET_STRING *ip; /* iPAddress */
- X509_NAME *dirn; /* dirn */
- ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */
- ASN1_OBJECT *rid; /* registeredID */
- ASN1_TYPE *other; /* x400Address */
+ char *ptr;
+ OTHERNAME *otherName; /* otherName */
+ ASN1_IA5STRING *rfc822Name;
+ ASN1_IA5STRING *dNSName;
+ ASN1_TYPE *x400Address;
+ X509_NAME *directoryName;
+ EDIPARTYNAME *ediPartyName;
+ ASN1_IA5STRING *uniformResourceIdentifier;
+ ASN1_OCTET_STRING *iPAddress;
+ ASN1_OBJECT *registeredID;
+
+ /* Old names */
+ ASN1_OCTET_STRING *ip; /* iPAddress */
+ X509_NAME *dirn; /* dirn */
+ ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */
+ ASN1_OBJECT *rid; /* registeredID */
+ ASN1_TYPE *other; /* x400Address */
} d;
} GENERAL_NAME;
typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
typedef struct ACCESS_DESCRIPTION_st {
- ASN1_OBJECT *method;
- GENERAL_NAME *location;
+ ASN1_OBJECT *method;
+ GENERAL_NAME *location;
} ACCESS_DESCRIPTION;
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
@@ -217,13 +217,13 @@ DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
typedef struct DIST_POINT_NAME_st {
int type;
union {
- GENERAL_NAMES *fullname;
- STACK_OF(X509_NAME_ENTRY) *relativename;
+ GENERAL_NAMES *fullname;
+ STACK_OF(X509_NAME_ENTRY) *relativename;
} name;
} DIST_POINT_NAME;
typedef struct DIST_POINT_st {
-DIST_POINT_NAME *distpoint;
+DIST_POINT_NAME *distpoint;
ASN1_BIT_STRING *reasons;
GENERAL_NAMES *CRLissuer;
} DIST_POINT;
@@ -242,43 +242,43 @@ ASN1_INTEGER *serial;
/* Strong extranet structures */
typedef struct SXNET_ID_st {
- ASN1_INTEGER *zone;
- ASN1_OCTET_STRING *user;
+ ASN1_INTEGER *zone;
+ ASN1_OCTET_STRING *user;
} SXNETID;
DECLARE_STACK_OF(SXNETID)
DECLARE_ASN1_SET_OF(SXNETID)
typedef struct SXNET_st {
- ASN1_INTEGER *version;
- STACK_OF(SXNETID) *ids;
+ ASN1_INTEGER *version;
+ STACK_OF(SXNETID) *ids;
} SXNET;
typedef struct NOTICEREF_st {
- ASN1_STRING *organization;
- STACK_OF(ASN1_INTEGER) *noticenos;
+ ASN1_STRING *organization;
+ STACK_OF(ASN1_INTEGER) *noticenos;
} NOTICEREF;
typedef struct USERNOTICE_st {
- NOTICEREF *noticeref;
- ASN1_STRING *exptext;
+ NOTICEREF *noticeref;
+ ASN1_STRING *exptext;
} USERNOTICE;
typedef struct POLICYQUALINFO_st {
- ASN1_OBJECT *pqualid;
- union {
- ASN1_IA5STRING *cpsuri;
- USERNOTICE *usernotice;
- ASN1_TYPE *other;
- } d;
+ ASN1_OBJECT *pqualid;
+ union {
+ ASN1_IA5STRING *cpsuri;
+ USERNOTICE *usernotice;
+ ASN1_TYPE *other;
+ } d;
} POLICYQUALINFO;
DECLARE_STACK_OF(POLICYQUALINFO)
DECLARE_ASN1_SET_OF(POLICYQUALINFO)
typedef struct POLICYINFO_st {
- ASN1_OBJECT *policyid;
- STACK_OF(POLICYQUALINFO) *qualifiers;
+ ASN1_OBJECT *policyid;
+ STACK_OF(POLICYQUALINFO) *qualifiers;
} POLICYINFO;
typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
@@ -287,8 +287,8 @@ DECLARE_STACK_OF(POLICYINFO)
DECLARE_ASN1_SET_OF(POLICYINFO)
typedef struct POLICY_MAPPING_st {
- ASN1_OBJECT *issuerDomainPolicy;
- ASN1_OBJECT *subjectDomainPolicy;
+ ASN1_OBJECT *issuerDomainPolicy;
+ ASN1_OBJECT *subjectDomainPolicy;
} POLICY_MAPPING;
DECLARE_STACK_OF(POLICY_MAPPING)
@@ -296,35 +296,35 @@ DECLARE_STACK_OF(POLICY_MAPPING)
typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
typedef struct GENERAL_SUBTREE_st {
- GENERAL_NAME *base;
- ASN1_INTEGER *minimum;
- ASN1_INTEGER *maximum;
+ GENERAL_NAME *base;
+ ASN1_INTEGER *minimum;
+ ASN1_INTEGER *maximum;
} GENERAL_SUBTREE;
DECLARE_STACK_OF(GENERAL_SUBTREE)
typedef struct NAME_CONSTRAINTS_st {
- STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
- STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
+ STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
+ STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
} NAME_CONSTRAINTS;
typedef struct POLICY_CONSTRAINTS_st {
- ASN1_INTEGER *requireExplicitPolicy;
- ASN1_INTEGER *inhibitPolicyMapping;
+ ASN1_INTEGER *requireExplicitPolicy;
+ ASN1_INTEGER *inhibitPolicyMapping;
} POLICY_CONSTRAINTS;
/* Proxy certificate structures, see RFC 3820 */
typedef struct PROXY_POLICY_st
- {
- ASN1_OBJECT *policyLanguage;
- ASN1_OCTET_STRING *policy;
- } PROXY_POLICY;
+ {
+ ASN1_OBJECT *policyLanguage;
+ ASN1_OCTET_STRING *policy;
+ } PROXY_POLICY;
typedef struct PROXY_CERT_INFO_EXTENSION_st
- {
- ASN1_INTEGER *pcPathLengthConstraint;
- PROXY_POLICY *proxyPolicy;
- } PROXY_CERT_INFO_EXTENSION;
+ {
+ ASN1_INTEGER *pcPathLengthConstraint;
+ PROXY_POLICY *proxyPolicy;
+ } PROXY_CERT_INFO_EXTENSION;
DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
@@ -334,120 +334,122 @@ DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
",name:", val->name, ",value:", val->value);
#define X509V3_set_ctx_test(ctx) \
- X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
+ X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
- 0,0,0,0, \
- 0,0, \
- (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
- (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
- NULL, NULL, \
- table}
+ 0,0,0,0, \
+ 0,0, \
+ (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
+ (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
+ NULL, NULL, \
+ table}
#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
- 0,0,0,0, \
- (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
- (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
- 0,0,0,0, \
- NULL}
+ 0,0,0,0, \
+ (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
+ (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
+ 0,0,0,0, \
+ NULL}
#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/* X509_PURPOSE stuff */
-#define EXFLAG_BCONS 0x1
-#define EXFLAG_KUSAGE 0x2
-#define EXFLAG_XKUSAGE 0x4
-#define EXFLAG_NSCERT 0x8
-
-#define EXFLAG_CA 0x10
-#define EXFLAG_SS 0x20
-#define EXFLAG_V1 0x40
-#define EXFLAG_INVALID 0x80
-#define EXFLAG_SET 0x100
-#define EXFLAG_CRITICAL 0x200
-#define EXFLAG_PROXY 0x400
-
-#define EXFLAG_INVALID_POLICY 0x400
-
-#define KU_DIGITAL_SIGNATURE 0x0080
-#define KU_NON_REPUDIATION 0x0040
-#define KU_KEY_ENCIPHERMENT 0x0020
-#define KU_DATA_ENCIPHERMENT 0x0010
-#define KU_KEY_AGREEMENT 0x0008
-#define KU_KEY_CERT_SIGN 0x0004
-#define KU_CRL_SIGN 0x0002
-#define KU_ENCIPHER_ONLY 0x0001
-#define KU_DECIPHER_ONLY 0x8000
-
-#define NS_SSL_CLIENT 0x80
-#define NS_SSL_SERVER 0x40
-#define NS_SMIME 0x20
-#define NS_OBJSIGN 0x10
-#define NS_SSL_CA 0x04
-#define NS_SMIME_CA 0x02
-#define NS_OBJSIGN_CA 0x01
-#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
-
-#define XKU_SSL_SERVER 0x1
-#define XKU_SSL_CLIENT 0x2
-#define XKU_SMIME 0x4
-#define XKU_CODE_SIGN 0x8
-#define XKU_SGC 0x10
-#define XKU_OCSP_SIGN 0x20
-#define XKU_TIMESTAMP 0x40
-#define XKU_DVCS 0x80
-
-#define X509_PURPOSE_DYNAMIC 0x1
-#define X509_PURPOSE_DYNAMIC_NAME 0x2
+#define EXFLAG_BCONS 0x1
+#define EXFLAG_KUSAGE 0x2
+#define EXFLAG_XKUSAGE 0x4
+#define EXFLAG_NSCERT 0x8
+
+#define EXFLAG_CA 0x10
+/* Really self issued not necessarily self signed */
+#define EXFLAG_SI 0x20
+#define EXFLAG_SS 0x20
+#define EXFLAG_V1 0x40
+#define EXFLAG_INVALID 0x80
+#define EXFLAG_SET 0x100
+#define EXFLAG_CRITICAL 0x200
+#define EXFLAG_PROXY 0x400
+
+#define EXFLAG_INVALID_POLICY 0x800
+
+#define KU_DIGITAL_SIGNATURE 0x0080
+#define KU_NON_REPUDIATION 0x0040
+#define KU_KEY_ENCIPHERMENT 0x0020
+#define KU_DATA_ENCIPHERMENT 0x0010
+#define KU_KEY_AGREEMENT 0x0008
+#define KU_KEY_CERT_SIGN 0x0004
+#define KU_CRL_SIGN 0x0002
+#define KU_ENCIPHER_ONLY 0x0001
+#define KU_DECIPHER_ONLY 0x8000
+
+#define NS_SSL_CLIENT 0x80
+#define NS_SSL_SERVER 0x40
+#define NS_SMIME 0x20
+#define NS_OBJSIGN 0x10
+#define NS_SSL_CA 0x04
+#define NS_SMIME_CA 0x02
+#define NS_OBJSIGN_CA 0x01
+#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
+
+#define XKU_SSL_SERVER 0x1
+#define XKU_SSL_CLIENT 0x2
+#define XKU_SMIME 0x4
+#define XKU_CODE_SIGN 0x8
+#define XKU_SGC 0x10
+#define XKU_OCSP_SIGN 0x20
+#define XKU_TIMESTAMP 0x40
+#define XKU_DVCS 0x80
+
+#define X509_PURPOSE_DYNAMIC 0x1
+#define X509_PURPOSE_DYNAMIC_NAME 0x2
typedef struct x509_purpose_st {
- int purpose;
- int trust; /* Default trust ID */
- int flags;
- int (*check_purpose)(const struct x509_purpose_st *,
- const X509 *, int);
- char *name;
- char *sname;
- void *usr_data;
+ int purpose;
+ int trust; /* Default trust ID */
+ int flags;
+ int (*check_purpose)(const struct x509_purpose_st *,
+ const X509 *, int);
+ char *name;
+ char *sname;
+ void *usr_data;
} X509_PURPOSE;
-#define X509_PURPOSE_SSL_CLIENT 1
-#define X509_PURPOSE_SSL_SERVER 2
-#define X509_PURPOSE_NS_SSL_SERVER 3
-#define X509_PURPOSE_SMIME_SIGN 4
-#define X509_PURPOSE_SMIME_ENCRYPT 5
-#define X509_PURPOSE_CRL_SIGN 6
-#define X509_PURPOSE_ANY 7
-#define X509_PURPOSE_OCSP_HELPER 8
+#define X509_PURPOSE_SSL_CLIENT 1
+#define X509_PURPOSE_SSL_SERVER 2
+#define X509_PURPOSE_NS_SSL_SERVER 3
+#define X509_PURPOSE_SMIME_SIGN 4
+#define X509_PURPOSE_SMIME_ENCRYPT 5
+#define X509_PURPOSE_CRL_SIGN 6
+#define X509_PURPOSE_ANY 7
+#define X509_PURPOSE_OCSP_HELPER 8
-#define X509_PURPOSE_MIN 1
-#define X509_PURPOSE_MAX 8
+#define X509_PURPOSE_MIN 1
+#define X509_PURPOSE_MAX 8
/* Flags for X509V3_EXT_print() */
-#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
+#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
/* Return error for unknown extensions */
-#define X509V3_EXT_DEFAULT 0
+#define X509V3_EXT_DEFAULT 0
/* Print error for unknown extensions */
-#define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
+#define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
/* ASN1 parse unknown extensions */
-#define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
+#define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
/* BIO_dump unknown extensions */
-#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
+#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
/* Flags for X509V3_add1_i2d */
-#define X509V3_ADD_OP_MASK 0xfL
-#define X509V3_ADD_DEFAULT 0L
-#define X509V3_ADD_APPEND 1L
-#define X509V3_ADD_REPLACE 2L
-#define X509V3_ADD_REPLACE_EXISTING 3L
-#define X509V3_ADD_KEEP_EXISTING 4L
-#define X509V3_ADD_DELETE 5L
-#define X509V3_ADD_SILENT 0x10
+#define X509V3_ADD_OP_MASK 0xfL
+#define X509V3_ADD_DEFAULT 0L
+#define X509V3_ADD_APPEND 1L
+#define X509V3_ADD_REPLACE 2L
+#define X509V3_ADD_REPLACE_EXISTING 3L
+#define X509V3_ADD_KEEP_EXISTING 4L
+#define X509V3_ADD_DELETE 5L
+#define X509V3_ADD_SILENT 0x10
DECLARE_STACK_OF(X509_PURPOSE)
@@ -456,9 +458,9 @@ DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
DECLARE_ASN1_FUNCTIONS(SXNET)
DECLARE_ASN1_FUNCTIONS(SXNETID)
-int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
-int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
-int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen);
+int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
+int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
+int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen);
ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
@@ -472,10 +474,10 @@ DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
- X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+ X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
- ASN1_BIT_STRING *bits,
- STACK_OF(CONF_VALUE) *extlist);
+ ASN1_BIT_STRING *bits,
+ STACK_OF(CONF_VALUE) *extlist);
STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
@@ -483,9 +485,9 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
- GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist);
+ GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist);
GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
- X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+ X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
DECLARE_ASN1_FUNCTIONS(OTHERNAME)
DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
@@ -524,9 +526,9 @@ DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
#ifdef HEADER_CONF_H
GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
- CONF_VALUE *cnf);
+ CONF_VALUE *cnf);
GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_EXT_METHOD *method,
- X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc);
+ X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc);
void X509V3_conf_free(CONF_VALUE *val);
X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value);
@@ -543,7 +545,7 @@ int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_RE
int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
int X509V3_add_value_bool_nf(char *name, int asn1_bool,
- STACK_OF(CONF_VALUE) **extlist);
+ STACK_OF(CONF_VALUE) **extlist);
int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
@@ -555,16 +557,16 @@ STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section);
void X509V3_string_free(X509V3_CTX *ctx, char *str);
void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section);
void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
- X509_REQ *req, X509_CRL *crl, int flags);
+ X509_REQ *req, X509_CRL *crl, int flags);
int X509V3_add_value(const char *name, const char *value,
- STACK_OF(CONF_VALUE) **extlist);
+ STACK_OF(CONF_VALUE) **extlist);
int X509V3_add_value_uchar(const char *name, const unsigned char *value,
- STACK_OF(CONF_VALUE) **extlist);
+ STACK_OF(CONF_VALUE) **extlist);
int X509V3_add_value_bool(const char *name, int asn1_bool,
- STACK_OF(CONF_VALUE) **extlist);
+ STACK_OF(CONF_VALUE) **extlist);
int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
- STACK_OF(CONF_VALUE) **extlist);
+ STACK_OF(CONF_VALUE) **extlist);
char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);
char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
@@ -590,7 +592,7 @@ unsigned char *string_to_hex(char *str, long *len);
int name_cmp(const char *name, const char *cmp);
void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
- int ml);
+ int ml);
int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
@@ -606,8 +608,8 @@ X509_PURPOSE * X509_PURPOSE_get0(int idx);
int X509_PURPOSE_get_by_sname(char *sname);
int X509_PURPOSE_get_by_id(int id);
int X509_PURPOSE_add(int id, int trust, int flags,
- int (*ck)(const X509_PURPOSE *, const X509 *, int),
- char *name, char *sname, void *arg);
+ int (*ck)(const X509_PURPOSE *, const X509 *, int),
+ char *name, char *sname, void *arg);
char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
@@ -617,12 +619,13 @@ int X509_PURPOSE_get_id(X509_PURPOSE *);
STACK *X509_get1_email(X509 *x);
STACK *X509_REQ_get1_email(X509_REQ *x);
void X509_email_free(STACK *sk);
+STACK *X509_get1_ocsp(X509 *x);
ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
int a2i_ipadd(unsigned char *ipout, const char *ipasc);
int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
- unsigned long chtype);
+ unsigned long chtype);
void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
@@ -632,8 +635,8 @@ typedef struct ASRange_st {
ASN1_INTEGER *min, *max;
} ASRange;
-#define ASIdOrRange_id 0
-#define ASIdOrRange_range 1
+#define ASIdOrRange_id 0
+#define ASIdOrRange_range 1
typedef struct ASIdOrRange_st {
int type;
@@ -646,8 +649,8 @@ typedef struct ASIdOrRange_st {
typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
DECLARE_STACK_OF(ASIdOrRange)
-#define ASIdentifierChoice_inherit 0
-#define ASIdentifierChoice_asIdsOrRanges 1
+#define ASIdentifierChoice_inherit 0
+#define ASIdentifierChoice_asIdsOrRanges 1
typedef struct ASIdentifierChoice_st {
int type;
@@ -668,37 +671,37 @@ DECLARE_ASN1_FUNCTIONS(ASIdentifiers)
typedef struct IPAddressRange_st {
- ASN1_BIT_STRING *min, *max;
+ ASN1_BIT_STRING *min, *max;
} IPAddressRange;
-#define IPAddressOrRange_addressPrefix 0
-#define IPAddressOrRange_addressRange 1
+#define IPAddressOrRange_addressPrefix 0
+#define IPAddressOrRange_addressRange 1
typedef struct IPAddressOrRange_st {
int type;
union {
- ASN1_BIT_STRING *addressPrefix;
- IPAddressRange *addressRange;
+ ASN1_BIT_STRING *addressPrefix;
+ IPAddressRange *addressRange;
} u;
} IPAddressOrRange;
typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
DECLARE_STACK_OF(IPAddressOrRange)
-#define IPAddressChoice_inherit 0
-#define IPAddressChoice_addressesOrRanges 1
+#define IPAddressChoice_inherit 0
+#define IPAddressChoice_addressesOrRanges 1
typedef struct IPAddressChoice_st {
int type;
union {
- ASN1_NULL *inherit;
- IPAddressOrRanges *addressesOrRanges;
+ ASN1_NULL *inherit;
+ IPAddressOrRanges *addressesOrRanges;
} u;
} IPAddressChoice;
typedef struct IPAddressFamily_st {
- ASN1_OCTET_STRING *addressFamily;
- IPAddressChoice *ipAddressChoice;
+ ASN1_OCTET_STRING *addressFamily;
+ IPAddressChoice *ipAddressChoice;
} IPAddressFamily;
typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
@@ -712,8 +715,8 @@ DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
/*
* API tag for elements of the ASIdentifer SEQUENCE.
*/
-#define V3_ASID_ASNUM 0
-#define V3_ASID_RDI 1
+#define V3_ASID_ASNUM 0
+#define V3_ASID_RDI 1
/*
* AFI values, assigned by IANA. It'd be nice to make the AFI
@@ -721,8 +724,8 @@ DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
* that would need to be defined for other address families for it to
* be worth the trouble.
*/
-#define IANA_AFI_IPV4 1
-#define IANA_AFI_IPV6 2
+#define IANA_AFI_IPV4 1
+#define IANA_AFI_IPV6 2
/*
* Utilities to construct and extract values from RFC3779 extensions,
@@ -731,19 +734,19 @@ DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
*/
int v3_asid_add_inherit(ASIdentifiers *asid, int which);
int v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
- ASN1_INTEGER *min, ASN1_INTEGER *max);
+ ASN1_INTEGER *min, ASN1_INTEGER *max);
int v3_addr_add_inherit(IPAddrBlocks *addr,
- const unsigned afi, const unsigned *safi);
+ const unsigned afi, const unsigned *safi);
int v3_addr_add_prefix(IPAddrBlocks *addr,
- const unsigned afi, const unsigned *safi,
- unsigned char *a, const int prefixlen);
+ const unsigned afi, const unsigned *safi,
+ unsigned char *a, const int prefixlen);
int v3_addr_add_range(IPAddrBlocks *addr,
- const unsigned afi, const unsigned *safi,
- unsigned char *min, unsigned char *max);
+ const unsigned afi, const unsigned *safi,
+ unsigned char *min, unsigned char *max);
unsigned v3_addr_get_afi(const IPAddressFamily *f);
int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
- unsigned char *min, unsigned char *max,
- const int length);
+ unsigned char *min, unsigned char *max,
+ const int length);
/*
* Canonical forms.
@@ -767,11 +770,11 @@ int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
int v3_asid_validate_path(X509_STORE_CTX *);
int v3_addr_validate_path(X509_STORE_CTX *);
int v3_asid_validate_resource_set(STACK_OF(X509) *chain,
- ASIdentifiers *ext,
- int allow_inheritance);
+ ASIdentifiers *ext,
+ int allow_inheritance);
int v3_addr_validate_resource_set(STACK_OF(X509) *chain,
- IPAddrBlocks *ext,
- int allow_inheritance);
+ IPAddrBlocks *ext,
+ int allow_inheritance);
#endif /* OPENSSL_NO_RFC3779 */
@@ -784,137 +787,136 @@ void ERR_load_X509V3_strings(void);
/* Error codes for the X509V3 functions. */
/* Function codes. */
-#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156
-#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157
-#define X509V3_F_COPY_EMAIL 122
-#define X509V3_F_COPY_ISSUER 123
-#define X509V3_F_DO_DIRNAME 144
-#define X509V3_F_DO_EXT_CONF 124
-#define X509V3_F_DO_EXT_I2D 135
-#define X509V3_F_DO_EXT_NCONF 151
-#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148
-#define X509V3_F_HEX_TO_STRING 111
-#define X509V3_F_I2S_ASN1_ENUMERATED 121
-#define X509V3_F_I2S_ASN1_IA5STRING 149
-#define X509V3_F_I2S_ASN1_INTEGER 120
-#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
-#define X509V3_F_NOTICE_SECTION 132
-#define X509V3_F_NREF_NOS 133
-#define X509V3_F_POLICY_SECTION 131
-#define X509V3_F_PROCESS_PCI_VALUE 150
-#define X509V3_F_R2I_CERTPOL 130
-#define X509V3_F_R2I_PCI 155
-#define X509V3_F_S2I_ASN1_IA5STRING 100
-#define X509V3_F_S2I_ASN1_INTEGER 108
-#define X509V3_F_S2I_ASN1_OCTET_STRING 112
-#define X509V3_F_S2I_ASN1_SKEY_ID 114
-#define X509V3_F_S2I_SKEY_ID 115
-#define X509V3_F_STRING_TO_HEX 113
-#define X509V3_F_SXNET_ADD_ID_ASC 125
-#define X509V3_F_SXNET_ADD_ID_INTEGER 126
-#define X509V3_F_SXNET_ADD_ID_ULONG 127
-#define X509V3_F_SXNET_GET_ID_ASC 128
-#define X509V3_F_SXNET_GET_ID_ULONG 129
-#define X509V3_F_V2I_ASIDENTIFIERS 158
-#define X509V3_F_V2I_ASN1_BIT_STRING 101
-#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
-#define X509V3_F_V2I_AUTHORITY_KEYID 119
-#define X509V3_F_V2I_BASIC_CONSTRAINTS 102
-#define X509V3_F_V2I_CRLD 134
-#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
-#define X509V3_F_V2I_GENERAL_NAMES 118
-#define X509V3_F_V2I_GENERAL_NAME_EX 117
-#define X509V3_F_V2I_IPADDRBLOCKS 159
-#define X509V3_F_V2I_ISSUER_ALT 153
-#define X509V3_F_V2I_NAME_CONSTRAINTS 147
-#define X509V3_F_V2I_POLICY_CONSTRAINTS 146
-#define X509V3_F_V2I_POLICY_MAPPINGS 145
-#define X509V3_F_V2I_SUBJECT_ALT 154
-#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160
-#define X509V3_F_V3_GENERIC_EXTENSION 116
-#define X509V3_F_X509V3_ADD1_I2D 140
-#define X509V3_F_X509V3_ADD_VALUE 105
-#define X509V3_F_X509V3_EXT_ADD 104
-#define X509V3_F_X509V3_EXT_ADD_ALIAS 106
-#define X509V3_F_X509V3_EXT_CONF 107
-#define X509V3_F_X509V3_EXT_I2D 136
-#define X509V3_F_X509V3_EXT_NCONF 152
-#define X509V3_F_X509V3_GET_SECTION 142
-#define X509V3_F_X509V3_GET_STRING 143
-#define X509V3_F_X509V3_GET_VALUE_BOOL 110
-#define X509V3_F_X509V3_PARSE_LIST 109
-#define X509V3_F_X509_PURPOSE_ADD 137
-#define X509V3_F_X509_PURPOSE_SET 141
+#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156
+#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157
+#define X509V3_F_COPY_EMAIL 122
+#define X509V3_F_COPY_ISSUER 123
+#define X509V3_F_DO_DIRNAME 144
+#define X509V3_F_DO_EXT_CONF 124
+#define X509V3_F_DO_EXT_I2D 135
+#define X509V3_F_DO_EXT_NCONF 151
+#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148
+#define X509V3_F_HEX_TO_STRING 111
+#define X509V3_F_I2S_ASN1_ENUMERATED 121
+#define X509V3_F_I2S_ASN1_IA5STRING 149
+#define X509V3_F_I2S_ASN1_INTEGER 120
+#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
+#define X509V3_F_NOTICE_SECTION 132
+#define X509V3_F_NREF_NOS 133
+#define X509V3_F_POLICY_SECTION 131
+#define X509V3_F_PROCESS_PCI_VALUE 150
+#define X509V3_F_R2I_CERTPOL 130
+#define X509V3_F_R2I_PCI 155
+#define X509V3_F_S2I_ASN1_IA5STRING 100
+#define X509V3_F_S2I_ASN1_INTEGER 108
+#define X509V3_F_S2I_ASN1_OCTET_STRING 112
+#define X509V3_F_S2I_ASN1_SKEY_ID 114
+#define X509V3_F_S2I_SKEY_ID 115
+#define X509V3_F_STRING_TO_HEX 113
+#define X509V3_F_SXNET_ADD_ID_ASC 125
+#define X509V3_F_SXNET_ADD_ID_INTEGER 126
+#define X509V3_F_SXNET_ADD_ID_ULONG 127
+#define X509V3_F_SXNET_GET_ID_ASC 128
+#define X509V3_F_SXNET_GET_ID_ULONG 129
+#define X509V3_F_V2I_ASIDENTIFIERS 158
+#define X509V3_F_V2I_ASN1_BIT_STRING 101
+#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
+#define X509V3_F_V2I_AUTHORITY_KEYID 119
+#define X509V3_F_V2I_BASIC_CONSTRAINTS 102
+#define X509V3_F_V2I_CRLD 134
+#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
+#define X509V3_F_V2I_GENERAL_NAMES 118
+#define X509V3_F_V2I_GENERAL_NAME_EX 117
+#define X509V3_F_V2I_IPADDRBLOCKS 159
+#define X509V3_F_V2I_ISSUER_ALT 153
+#define X509V3_F_V2I_NAME_CONSTRAINTS 147
+#define X509V3_F_V2I_POLICY_CONSTRAINTS 146
+#define X509V3_F_V2I_POLICY_MAPPINGS 145
+#define X509V3_F_V2I_SUBJECT_ALT 154
+#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160
+#define X509V3_F_V3_GENERIC_EXTENSION 116
+#define X509V3_F_X509V3_ADD1_I2D 140
+#define X509V3_F_X509V3_ADD_VALUE 105
+#define X509V3_F_X509V3_EXT_ADD 104
+#define X509V3_F_X509V3_EXT_ADD_ALIAS 106
+#define X509V3_F_X509V3_EXT_CONF 107
+#define X509V3_F_X509V3_EXT_I2D 136
+#define X509V3_F_X509V3_EXT_NCONF 152
+#define X509V3_F_X509V3_GET_SECTION 142
+#define X509V3_F_X509V3_GET_STRING 143
+#define X509V3_F_X509V3_GET_VALUE_BOOL 110
+#define X509V3_F_X509V3_PARSE_LIST 109
+#define X509V3_F_X509_PURPOSE_ADD 137
+#define X509V3_F_X509_PURPOSE_SET 141
/* Reason codes. */
-#define X509V3_R_BAD_IP_ADDRESS 118
-#define X509V3_R_BAD_OBJECT 119
-#define X509V3_R_BN_DEC2BN_ERROR 100
-#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
-#define X509V3_R_DIRNAME_ERROR 149
-#define X509V3_R_DUPLICATE_ZONE_ID 133
-#define X509V3_R_ERROR_CONVERTING_ZONE 131
-#define X509V3_R_ERROR_CREATING_EXTENSION 144
-#define X509V3_R_ERROR_IN_EXTENSION 128
-#define X509V3_R_EXPECTED_A_SECTION_NAME 137
-#define X509V3_R_EXTENSION_EXISTS 145
-#define X509V3_R_EXTENSION_NAME_ERROR 115
-#define X509V3_R_EXTENSION_NOT_FOUND 102
-#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
-#define X509V3_R_EXTENSION_VALUE_ERROR 116
-#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
-#define X509V3_R_ILLEGAL_HEX_DIGIT 113
-#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
-#define X509V3_R_INVALID_ASNUMBER 160
-#define X509V3_R_INVALID_ASRANGE 161
-#define X509V3_R_INVALID_BOOLEAN_STRING 104
-#define X509V3_R_INVALID_EXTENSION_STRING 105
-#define X509V3_R_INVALID_INHERITANCE 162
-#define X509V3_R_INVALID_IPADDRESS 163
-#define X509V3_R_INVALID_NAME 106
-#define X509V3_R_INVALID_NULL_ARGUMENT 107
-#define X509V3_R_INVALID_NULL_NAME 108
-#define X509V3_R_INVALID_NULL_VALUE 109
-#define X509V3_R_INVALID_NUMBER 140
-#define X509V3_R_INVALID_NUMBERS 141
-#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
-#define X509V3_R_INVALID_OPTION 138
-#define X509V3_R_INVALID_POLICY_IDENTIFIER 134
-#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
-#define X509V3_R_INVALID_PURPOSE 146
-#define X509V3_R_INVALID_SAFI 164
-#define X509V3_R_INVALID_SECTION 135
-#define X509V3_R_INVALID_SYNTAX 143
-#define X509V3_R_ISSUER_DECODE_ERROR 126
-#define X509V3_R_MISSING_VALUE 124
-#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
-#define X509V3_R_NO_CONFIG_DATABASE 136
-#define X509V3_R_NO_ISSUER_CERTIFICATE 121
-#define X509V3_R_NO_ISSUER_DETAILS 127
-#define X509V3_R_NO_POLICY_IDENTIFIER 139
-#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
-#define X509V3_R_NO_PUBLIC_KEY 114
-#define X509V3_R_NO_SUBJECT_DETAILS 125
-#define X509V3_R_ODD_NUMBER_OF_DIGITS 112
-#define X509V3_R_OPERATION_NOT_DEFINED 148
-#define X509V3_R_OTHERNAME_ERROR 147
-#define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155
-#define X509V3_R_POLICY_PATH_LENGTH 156
-#define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157
-#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158
+#define X509V3_R_BAD_IP_ADDRESS 118
+#define X509V3_R_BAD_OBJECT 119
+#define X509V3_R_BN_DEC2BN_ERROR 100
+#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
+#define X509V3_R_DIRNAME_ERROR 149
+#define X509V3_R_DUPLICATE_ZONE_ID 133
+#define X509V3_R_ERROR_CONVERTING_ZONE 131
+#define X509V3_R_ERROR_CREATING_EXTENSION 144
+#define X509V3_R_ERROR_IN_EXTENSION 128
+#define X509V3_R_EXPECTED_A_SECTION_NAME 137
+#define X509V3_R_EXTENSION_EXISTS 145
+#define X509V3_R_EXTENSION_NAME_ERROR 115
+#define X509V3_R_EXTENSION_NOT_FOUND 102
+#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
+#define X509V3_R_EXTENSION_VALUE_ERROR 116
+#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
+#define X509V3_R_ILLEGAL_HEX_DIGIT 113
+#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
+#define X509V3_R_INVALID_ASNUMBER 160
+#define X509V3_R_INVALID_ASRANGE 161
+#define X509V3_R_INVALID_BOOLEAN_STRING 104
+#define X509V3_R_INVALID_EXTENSION_STRING 105
+#define X509V3_R_INVALID_INHERITANCE 162
+#define X509V3_R_INVALID_IPADDRESS 163
+#define X509V3_R_INVALID_NAME 106
+#define X509V3_R_INVALID_NULL_ARGUMENT 107
+#define X509V3_R_INVALID_NULL_NAME 108
+#define X509V3_R_INVALID_NULL_VALUE 109
+#define X509V3_R_INVALID_NUMBER 140
+#define X509V3_R_INVALID_NUMBERS 141
+#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
+#define X509V3_R_INVALID_OPTION 138
+#define X509V3_R_INVALID_POLICY_IDENTIFIER 134
+#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
+#define X509V3_R_INVALID_PURPOSE 146
+#define X509V3_R_INVALID_SAFI 164
+#define X509V3_R_INVALID_SECTION 135
+#define X509V3_R_INVALID_SYNTAX 143
+#define X509V3_R_ISSUER_DECODE_ERROR 126
+#define X509V3_R_MISSING_VALUE 124
+#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
+#define X509V3_R_NO_CONFIG_DATABASE 136
+#define X509V3_R_NO_ISSUER_CERTIFICATE 121
+#define X509V3_R_NO_ISSUER_DETAILS 127
+#define X509V3_R_NO_POLICY_IDENTIFIER 139
+#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
+#define X509V3_R_NO_PUBLIC_KEY 114
+#define X509V3_R_NO_SUBJECT_DETAILS 125
+#define X509V3_R_ODD_NUMBER_OF_DIGITS 112
+#define X509V3_R_OPERATION_NOT_DEFINED 148
+#define X509V3_R_OTHERNAME_ERROR 147
+#define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155
+#define X509V3_R_POLICY_PATH_LENGTH 156
+#define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157
+#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158
#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
-#define X509V3_R_SECTION_NOT_FOUND 150
-#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
-#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
-#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
-#define X509V3_R_UNKNOWN_EXTENSION 129
-#define X509V3_R_UNKNOWN_EXTENSION_NAME 130
-#define X509V3_R_UNKNOWN_OPTION 120
-#define X509V3_R_UNSUPPORTED_OPTION 117
-#define X509V3_R_USER_TOO_LONG 132
+#define X509V3_R_SECTION_NOT_FOUND 150
+#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
+#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
+#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
+#define X509V3_R_UNKNOWN_EXTENSION 129
+#define X509V3_R_UNKNOWN_EXTENSION_NAME 130
+#define X509V3_R_UNKNOWN_OPTION 120
+#define X509V3_R_UNSUPPORTED_OPTION 117
+#define X509V3_R_USER_TOO_LONG 132
#ifdef __cplusplus
}
#endif
#endif
-
diff --git a/dep/lib/Makefile.am b/dep/lib/Makefile.am
new file mode 100644
index 00000000000..b762667b01e
--- /dev/null
+++ b/dep/lib/Makefile.am
@@ -0,0 +1,52 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## Additional files to include when running 'make dist'
+# Debug libraries for Win32 builds.
+EXTRA_DIST = \
+ win32_debug/libeay32.dll \
+ win32_debug/libeay32.lib \
+ win32_debug/libmySQL.dll \
+ win32_debug/libmySQL.lib \
+ win32_debug/sqlite.lib
+
+# Release libraries for Win32 builds.
+EXTRA_DIST += \
+ win32_release/libeay32.dll \
+ win32_release/libeay32.lib \
+ win32_release/libmySQL.dll \
+ win32_release/libmySQL.lib \
+ win32_release/sqlite.lib
+
+# Debug libraries for Win64 builds.
+EXTRA_DIST += \
+ x64_Debug/libeay32.dll \
+ x64_Debug/libeay32.lib \
+ x64_Debug/libmySQL.dll \
+ x64_Debug/libmySQL.lib
+
+# Release libraries for Win64 builds.
+EXTRA_DIST += \
+ x64_release/libeay32.dll \
+ x64_release/libeay32.lib \
+ x64_release/libmySQL.dll \
+ x64_release/libmySQL.lib
diff --git a/dep/lib/win32_debug/libeay32.dll b/dep/lib/win32_debug/libeay32.dll
index f62b057bb23..1cbc5dfc23d 100644
--- a/dep/lib/win32_debug/libeay32.dll
+++ b/dep/lib/win32_debug/libeay32.dll
Binary files differ
diff --git a/dep/lib/win32_debug/libeay32.lib b/dep/lib/win32_debug/libeay32.lib
index 7f89f68e413..70407d3e070 100644
--- a/dep/lib/win32_debug/libeay32.lib
+++ b/dep/lib/win32_debug/libeay32.lib
Binary files differ
diff --git a/dep/lib/win32_release/libeay32.dll b/dep/lib/win32_release/libeay32.dll
index e078a35487a..ed6543efefa 100644
--- a/dep/lib/win32_release/libeay32.dll
+++ b/dep/lib/win32_release/libeay32.dll
Binary files differ
diff --git a/dep/lib/win32_release/libeay32.lib b/dep/lib/win32_release/libeay32.lib
index b5ad42ae274..2796163595d 100644
--- a/dep/lib/win32_release/libeay32.lib
+++ b/dep/lib/win32_release/libeay32.lib
Binary files differ
diff --git a/dep/lib/x64_Debug/libeay32.dll b/dep/lib/x64_Debug/libeay32.dll
index 75058bd0cc0..1a6952eeadb 100644
--- a/dep/lib/x64_Debug/libeay32.dll
+++ b/dep/lib/x64_Debug/libeay32.dll
Binary files differ
diff --git a/dep/lib/x64_Debug/libeay32.lib b/dep/lib/x64_Debug/libeay32.lib
index 679578e78e8..e27b6ccde09 100644
--- a/dep/lib/x64_Debug/libeay32.lib
+++ b/dep/lib/x64_Debug/libeay32.lib
Binary files differ
diff --git a/dep/lib/x64_release/libeay32.dll b/dep/lib/x64_release/libeay32.dll
index 75058bd0cc0..e2d98bea828 100644
--- a/dep/lib/x64_release/libeay32.dll
+++ b/dep/lib/x64_release/libeay32.dll
Binary files differ
diff --git a/dep/lib/x64_release/libeay32.lib b/dep/lib/x64_release/libeay32.lib
index 679578e78e8..d004d975adb 100644
--- a/dep/lib/x64_release/libeay32.lib
+++ b/dep/lib/x64_release/libeay32.lib
Binary files differ
diff --git a/dep/src/Makefile.am b/dep/src/Makefile.am
new file mode 100644
index 00000000000..6ae2808895c
--- /dev/null
+++ b/dep/src/Makefile.am
@@ -0,0 +1,25 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = g3dlite sockets zlib zthread
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/dep/src/sockets/Makefile.am b/dep/src/sockets/Makefile.am
new file mode 100644
index 00000000000..5cd6eaf4307
--- /dev/null
+++ b/dep/src/sockets/Makefile.am
@@ -0,0 +1,49 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../../include/sockets
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangossockets.a
+
+libmangossockets_a_SOURCES = \
+ Base64.cpp \
+ Exception.cpp \
+ Ipv4Address.cpp \
+ Ipv6Address.cpp \
+ Lock.cpp \
+ Mutex.cpp \
+ Parse.cpp \
+ ResolvServer.cpp \
+ ResolvSocket.cpp \
+ Socket.cpp \
+ SocketHandler.cpp \
+ StdoutLog.cpp \
+ StreamSocket.cpp \
+ TcpSocket.cpp \
+ Thread.cpp \
+ UdpSocket.cpp \
+ Utility.cpp \
+ socket_include.cpp
diff --git a/doc/EventAI.txt b/doc/EventAI.txt
new file mode 100644
index 00000000000..0cb27885328
--- /dev/null
+++ b/doc/EventAI.txt
@@ -0,0 +1,794 @@
+=========================================
+EventAI documentation
+=========================================
+
+EventAI allows users to create new creature scripts entierly within the database.
+
+For the AI to be used, you must first make sure to set AIname for each creature that should use this AI.
+
+UPDATE creature_template SET AIName = 'EventAI' WHERE entry IN (...);
+
+=========================================
+Basic Structure of EventAI
+=========================================
+EventAI follows a basic if (Event) then do (Action) format.
+Below is a the list of current fields within the creature_ai_scripts table.
+
+(Field_Name Discription)
+id This value is mearly an incrementing counter of the current Event number. Required for sql queries.
+creature_id Creature id which this event should occur on.
+
+event_type Type of event (See Event Types below)
+event_inverse_phase_mask Mask which phases this event should NOT trigger in*
+event_chance Percent chance of this event occuring (1 - 100)
+event_flags Event flags such as if the event is repeatable (see below)
+event_param1 Variable for event (dependant on Event type)
+event_param2
+event_param3
+event_param4
+
+action1_type First Type of Action to take when event occurs (See Action Types below)
+action1_param1 Variables used for Action1 (dependant on Action type)
+action1_param2
+action1_param3
+
+action2_type Second Type of Action to take when event occurs (See Action Types below)
+action2_param1 Variables used for Action2 (dependant on Action type)
+action2_param2
+action2_param3
+
+action3_type Third Type of Action to take when event occurs (See Action Types below)
+action3_param1 Variables used for Action3 (dependant on Action type)
+action3_param2
+action3_param3
+
+All params are signed 32 bit values (+/- 2147483647). If param specifies time then time is in milliseconds.
+If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%)
+
+*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100)
+would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase).
+
+=========================================
+Event Types
+=========================================
+Below is the list of current Event types that EventAI can handle.
+Each event type has its own specific interpretation of the params that accompany it.
+Params are always read from Param1, then Param2, then Param3.
+Events will not repeat until the creature exits combat unless EFLAG_REPEATABLE is set.
+Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat.
+
+# Internal Name Pamarm usage Description
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only in combat.
+1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only out of combat.
+2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat).
+5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between every (Param1) and (Param2).
+6 EVENT_T_DEATH NONE Expires upon Death of the Creature.
+7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode().
+8 EVENT_T_SPELLHIT SpellID, School, RepeatMin, RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school (-1 for all). Will repeat every (Param3) and (Param4) .
+9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) .
+10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a Unit moves within distance(MaxAllowedRange) to creature. If Param1=0 it will expire if Unit are Hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction). Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat.
+11 EVENT_T_SPAWNED NONE Expires at initial spawn and at creature respawn (useful for setting ranged movement type)
+12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) .
+13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) .
+14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (param1) hp missing. Will repeat every (Param3) and (Param4) .
+15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) .
+16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) .
+17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3).
+18 EVENT_T_TARGET_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax
+21 EVENT_T_REACHED_HOME NONE Expires when creature reach it's home(spawn) location after Evade.
+22 EVENT_T_RECEIVE_EMOTE EmoteId, Condition, CondValue1, CondValue2 Expires when creature receive emote with text emote id(enum TextEmotes). Condition can be defined. If set, then most conditions has additional value (see enum ConditionType)
+
+=========================================
+Action Types
+=========================================
+Below is the list of current Action types that EventAI can handle.
+Each event type has its own specific interpretation of the params that accompany it.
+Params are always read from Param1, then Param2, then Param3.
+
+(# Internal Name Param usage Discription)
+0 ACTION_T_NONE No Action Does Nothing
+1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the text table itself(say, yell, whisper, etc) along with other options for the text. All values are required to be negative.
+2 ACTION_T_SET_FACTION FactionId Change faction for creature. If param1==0, creature will revert to default faction.
+3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set model from creature_template.entry(param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature.
+4 ACTION_T_SOUND SoundId Plays Sound
+5 ACTION_T_EMOTE EmoteId Does emote
+6 ACTION_T_RANDOM_SAY UNUSED
+7 ACTION_T_RANDOM_YELL UNUSED
+8 ACTION_T_RANDOM_TEXTEMOTE UNUSED
+9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays random sound between 3 params*
+10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes random emote between 3 params
+11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types)
+12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature.
+13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies threat by (param1) on target type (param2)
+14 ACTION_T_THREAT_ALL_PCT Threat% Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump)
+15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (param1) for target type (Param2)
+16 ACTION_T_QUEST_CASTCREATUREGO CreatureID, SpellId, Target Sends CastCreatureOrGo for CreatureId (param1) with SpellId (param2) for target (param3)
+17 ACTION_T_SET_UNIT_FIELD Field_Number, Value, Target Sets Unit Field (param1) to Value (param2) on target type (param3)
+18 ACTION_T_SET_UNIT_FLAG Flags, Target Sets flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2)
+19 ACTION_T_REMOVE_UNIT_FLAG Flags, Target Removes flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2)
+20 ACTION_T_AUTO_ATTACK AllowAutoAttack 0 = stop melee attack, anything else means continue attacking/allow melee attacking
+21 ACTION_T_COMBAT_MOVEMENT AllowCombatMovement 0 = stop combat based movement, anything else continue/allow combat based movement (targeted movement generator)
+22 ACTION_T_SET_PHASE Phase Sets the current phase to (param1)
+23 ACTION_T_INC_PHASE Value Increments the phase by (param1). May be negative to decrement phase but should not be 0.
+24 ACTION_T_EVADE No Params Forces the creature to evade. Wiping all threat and dropping combat.
+25 ACTION_T_FLEE No Params Causes the .creature to flee. Please use this action instead of directly casting this spell so we may change this when a more correct approach is found.
+26 ACTION_T_QUEST_EVENT_ALL QuestId Calls GroupEventHappens with (param1). Only used if it's _expected_ event should complete for all players in current party
+27 ACTION_T_CASTCREATUREGO_ALL QuestId, SpellId Calls CastedCreatureOrGo for all players on the threat list with QuestID(Param1) and SpellId(Param2)
+28 ACTION_T_REMOVEAURASFROMSPELL Target, Spellid Removes all auras on Target caused by Spellid
+29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance.
+30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets the phase to the id between 3 params*
+31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin.
+32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
+33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (param1) for target of type (param2)
+34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (param1) and data (param2)
+35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
+36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
+37 ACTION_T_DIE No Params Kills the creature
+38 ACTION_T_ZONE_COMBAT_PULSE No Params Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
+
+* = Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2)
+
+=========================================
+Event Types
+=========================================
+Note:
+COMBAT ONLY - Means that this event will only trigger durring combat.
+OUT OF COMBAT ONLY - Means that this event will only trigger while out of combat.
+BOTH - This event can trigger both in and out of combat.
+
+Events that do not have lables on them are events that are directly involved with the in and out of combat state.
+
+------------------
+0 = EVENT_T_TIMER:
+------------------
+Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
+Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
+This is commonly used for spells that repeat cast during combat (Simulate Spell Cooldown).
+
+----------------------
+1 = EVENT_T_TIMER_OOC:
+----------------------
+Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
+Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
+This is commonly used for events that occur and repeat outside of combat.
+
+---------------
+2 = EVENT_T_HP:
+---------------
+Parameter 1: HPMax% - Maximum HP% That this Event will Expire
+Parameter 2: HPMin% - Minimum HP% That this Event will Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee).
+
+-----------------
+3 = EVENT_T_MANA:
+-----------------
+Parameter 1: ManaMax% - Maximum Mana% That this Event will Expire
+Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee).
+
+------------------
+4 = EVENT_T_AGGRO:
+------------------
+This Event Expires upon initial aggro (does not repeat).
+
+-----------------
+5 = EVENT_T_KILL:
+-----------------
+Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2).
+This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player.
+
+------------------
+6 = EVENT_T_DEATH:
+------------------
+This Event Expires upon Death of the Scripted NPC.
+This is commonly used for NPC's who have a yell on death or cast some kind if summon spell when they die.
+
+------------------
+7 = EVENT_T_EVADE:
+------------------
+This Event Expires upon the creature EnterEvadeMode().
+This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior.
+
+---------------------
+8 = EVENT_T_SPELLHIT:
+---------------------
+Parameter 1: SpellID - The Spell ID that will trigger the event to occur (NOTE: If you use Spell School as the trigger set this value to 0)
+Parameter 2: School - Spell School to trigger the event (NOTE: If you use a SpellID then set this value to -1) - *See Below for Spell School Bitmask Values*
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+BOTH - Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school. Will repeat every (Param3) and (Param4).
+This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them.
+
+------------------
+9 = EVENT_T_RANGE:
+------------------
+Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and it's target to allow this Event to Expire
+Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and it's target to allow this Event to Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
+This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance.
+
+---------------------
+10 = EVENT_T_OOC_LOS:
+---------------------
+Parameter 1: Hostile-or-Not - This will expire if Unit are hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction)
+Parameter 2: MaxAllowedRange - Expires when a Unit moves within this distance to creature
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+OUT OF COMBAT!
+This Event is commonly used for NPC's who do something or say something to you when you walk past them Out of Combat.
+
+---------------------
+11 = EVENT_T_SPAWNED:
+---------------------
+Expires at initial spawn and at creature respawn.
+This Event is commonly used for setting ranged movement type or Summoning a Pet on Spawn
+
+-----------------------
+12 = EVENT_T_TARGET_HP:
+-----------------------
+Parameter 1: HPMax% - Maximum HP% That this Event will Expire
+Parameter 2: HPMin% - Minimum HP% That this Event will Expire
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low.
+
+----------------------------
+13 = EVENT_T_TARGET_CASTING:
+----------------------------
+Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
+This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell.
+
+-------------------------
+14 = EVENT_T_FRIENDLY_HP:
+-------------------------
+Parameter 1: HPDeficit - This is the Amount of HP Missing from Full HP to trigger this event (You would need to calculate the amount of HP the event happens and subtract that from Full HP Value to get this number)
+Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing amount of HP in Param1.
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4).
+This is commonly used when an NPC in Combat will heal a nearby Friendly NPC in Combat with a Heal/Renew Spell.
+
+----------------------------
+15 = EVENT_T_FRIENDLY_IS_CC:
+----------------------------
+Parameter 1: DispelType - Dispel Type to trigger the event - *See Below for Dispel Bitmask Values*
+Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies being Crowd Controlled
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
+This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled
+
+--------------------------
+16 = EVENT_T_MISSING_BUFF:
+--------------------------
+Parameter 1: SpellId - This is the SpellID That the Aura Check will look for (If it is missing this Aura)
+Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing Aura.
+Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+BOTH - Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4).
+This is commonly used for NPC's who watch friendly units for a debuff to end so they can recast it on them again.
+
+---------------------------
+17 = EVENT_T_SUMMONED_UNIT:
+---------------------------
+Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to trigger this event
+Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
+Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
+
+BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
+This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events.
+
+---------------------------
+21 = EVENT_T_REACHED_HOME:
+---------------------------
+Expires only when creature has returned to it's home location after Evade. Out of combat event.
+Most commonly used to cast spells that can not be casted in EVENT_T_EVADE and other effects that does not fit in while still running back to spawn/home location.
+
+---------------------------
+22 = EVENT_T_RECEIVE_EMOTE:
+---------------------------
+Expires only when creature receive emote from player. Valid text emote id's are in Mangos source (enum TextEmotes)
+Event does not require any conditions to process, however many are ecpected to have condition.
+
+EventAI use conditions from available in Mangos (enum ConditionType)
+Current implemented conditions:
+CONDITION_NONE (0) 0 0
+CONDITION_AURA (1) spell_id effindex
+CONDITION_ITEM (2) item_id count
+CONDITION_ITEM_EQUIPPED (3) item_id count
+CONDITION_ZONEID (4) zone_id 0
+CONDITION_REPUTATION_RANK (5) faction_id min_rank
+CONDITION_TEAM (6) player_team 0 (469-Alliance / 67-Horde)
+CONDITION_SKILL (7) skill_id min_skill_value
+CONDITION_QUESTREWARDED (8) quest_id 0, if quest are rewarded
+CONDITION_QUESTTAKEN (9) quest_id 0, while quest active(incomplete)
+CONDITION_ACTIVE_EVENT (12) event_id 0, note this is id from dbc, also defined in Mangos source(enum HolidayIds) NOT id of game_event in database
+
+=========================================
+Action Types
+=========================================
+
+-----------------
+1 = ACTION_T_TEXT:
+-----------------
+Parameter 1: The entry of the text that the NPC should use from eventai_texts table. Optionally a entry from other tables can be used (such as custom_texts).
+ Entry are required to be negative and exist in a *_texts-table. The type text to be displayed are defined in the texts-table itself (Say, Yell, Whisper, Emote Text, Boss Whisper, Boss Emote)
+ Other options are also to be defined in the texts-table, such as a sound to be heard with the text and the language used in output (common, dwarvish, etc).
+ In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
+
+Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
+Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
+
+Read at bottom for documentation of creature_ai_texts-table.
+
+------------------
+2 = ACTION_T_SET_FACTION:
+------------------
+Parameter 1: FactionId from Faction.dbc OR 0. Changes faction for creature. If 0, creature will revert to it's default faction if previously changed.
+
+-----------------------
+3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
+-----------------------
+Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using.
+Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used)
+
+If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model.
+
+-------------------
+4 = ACTION_T_SOUND:
+-------------------
+Parameter 1: The Sound ID to be played. (Sound IDs are contained in the DBC files.)
+
+The creature will play the specified sound.
+This is commonly used for Bosses who Yell and then also have a Voice for the same thing.
+
+-------------------
+5 = ACTION_T_EMOTE:
+-------------------
+Parameter 1: The Emote ID that the creature should perform. (Emote IDs are also contained in the DBC but they can be found in the mangos source as well).
+
+The creature will perform a visual emote. Unlike a text emote, a visual emote is one where the creature will actually move or perform a gesture.
+This is commonly used for NPC's who may perform a special action (Salute, Roar, ect...). Not all player emotes work for creature models.
+
+------------------------
+6 = ACTION_T_RANDOM_SAY:
+------------------------
+UNUSED Can be reused to create new action type
+
+-------------------------
+7 = ACTION_T_RANDOM_YELL:
+-------------------------
+UNUSED Can be reused to create new action type
+
+------------------------------
+8 = ACTION_T_RANDOM_TEXTEMOTE:
+------------------------------
+UNUSED Can be reused to create new action type
+
+--------------------------
+9 = ACTION_T_RANDOM_SOUND:
+--------------------------
+Parameter 1: The Sound ID to be played as Random Choice #1.
+Parameter 2: The Sound ID to be played as Random Choice #2.
+Parameter 3: The Sound ID to be played as Random Choice #3.
+
+Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
+
+---------------------------
+10 = ACTION_T_RANDOM_EMOTE:
+---------------------------
+Parameter 1: The Emote ID to be played as Random Choice #1.
+Parameter 2: The Emote ID to be played as Random Choice #2.
+Parameter 3: The Emote ID to be played as Random Choice #3.
+
+Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform.
+
+-------------------
+11 = ACTION_T_CAST:
+-------------------
+Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used in this field needs to be a valid Spell ID.
+Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0.
+
+The creature will cast a spell specified by a spell ID on a target specified by the target type.
+This is commonly used for NPC's who cast spells.
+
+---------------------
+12 = ACTION_T_SUMMON:
+---------------------
+Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
+Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0.
+
+The NPC will Summon another creature at the same spot as itself that will attack the specified target.
+NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works.
+NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone.
+NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
+This is used as a manual way to force an NPC to Summon.
+--------------------------------
+13 = ACTION_T_THREAT_SINGLE_PCT:
+--------------------------------
+Parameter 1: Threat% - Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added.
+Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+This action will modify the threat of a target in the creature's threat list by the specified percent.
+This is commonly used to allow an NPC to adjust the Threat to a single player.
+
+-----------------------------
+14 = ACTION_T_THREAT_ALL_PCT:
+-----------------------------
+Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100.
+
+This action will modify the threat for everyone in the creature's threat list by the specified percent.
+NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list.
+This is commonly used to allow an NPC to drop threat for all players to zero.
+
+--------------------------
+15 = ACTION_T_QUEST_EVENT:
+--------------------------
+Parameter 1: QuestID - The Quest Template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action.
+Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
+NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
+This is commonly used for Quests where only ONE player will gain credit for the quest.
+
+-----------------------------
+16 = ACTION_T_CASTCREATUREGO:
+-----------------------------
+Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
+Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID.
+Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
+This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest.
+
+-----------------------------
+17 = ACTION_T_SET_UNIT_FIELD:
+-----------------------------
+Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields.
+Parameter 2: Value - The new value to be put in the field.
+Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data)
+
+----------------------------
+18 = ACTION_T_SET_UNIT_FLAG:
+----------------------------
+Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
+Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+
+When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used.
+
+-------------------------------
+19 = ACTION_T_REMOVE_UNIT_FLAG:
+-------------------------------
+Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
+Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+
+When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used.
+
+--------------------------
+20 = ACTION_T_AUTO_ATTACK:
+--------------------------
+Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped.
+
+This action controls whether or not the creature should stop or start the auto melee attack.
+NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee).
+This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters.
+
+------------------------------
+21 = ACTION_T_COMBAT_MOVEMENT:
+------------------------------
+Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
+
+This action controls whether or not the creature will always move towards its target.
+NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
+This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who engage in Ranged Comabt (Either Spells or Ranged Attacks)
+
+------------------------
+22 = ACTION_T_SET_PHASE:
+------------------------
+Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error.
+
+When activated, this action sets the creature's event to the specified value.
+NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET.
+NOTE: The value used for the Param is the actual Phase Number (Not The Event_Inverse_Phase_Mask)
+This is commonly used for complex scripts with several phases and you need to switch to a different phase.
+
+------------------------
+23 = ACTION_T_INC_PHASE:
+------------------------
+Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
+
+When activated, this action will increase (or decrease) the current creature's phase.
+NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
+This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases.
+
+--------------------
+24 = ACTION_T_EVADE:
+--------------------
+When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter.
+NOTE: All Param Values Are 0 for this Action.
+
+-------------------
+25 = ACTION_T_FLEE:
+-------------------
+When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away".
+A Better Flee system is in Development.
+NOTE: All Param Values Are 0 for this Action.
+
+------------------------------
+26 = ACTION_T_QUEST_EVENT_ALL:
+------------------------------
+Parameter 1: QuestId - The quest ID to finish for everyone.
+
+This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list.
+NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
+
+---------------------------------
+27 = ACTION_T_CASTCREATUREGO_ALL:
+---------------------------------
+Parameter 1: QuestId - The quest template ID.
+Parameter 2: SpellId - The spell ID used to simulate the cast.
+
+This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list.
+NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
+
+-----------------------------------
+28 = ACTION_T_REMOVEAURASFROMSPELL:
+-----------------------------------
+Parameter 1: Target - The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 2: SpellId - The spell ID whose auras will be removed.
+
+This action will remove all auras from a specific spell from the target.
+This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift)
+
+------------------------------
+29 = ACTION_T_RANGED_MOVEMENT:
+------------------------------
+Parameter 1: Distance - The distance the mob should keep between it and its target.
+Parameter 2: Angle - The angle the mob should use.
+
+This action changes the movement type generator to ranged type using the specified values for angle and distance.
+NOTE: Specifying zero angle and distance will make it just melee instead.
+This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
+
+---------------------------
+30 = ACTION_T_RANDOM_PHASE:
+---------------------------
+Parameter 1: PhaseId1 - A possible random phase choice.
+Parameter 2: PhaseId2 - A possible random phase choice.
+Parameter 3: PhaseId3 - A possible random phase choice.
+
+Randomly sets the phase to one from the three parameter choices.
+NOTE: Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2)
+NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
+This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases.
+
+---------------------------------
+31 = ACTION_T_RANDOM_PHASE_RANGE:
+---------------------------------
+Parameter 1: PhaseMin - The minimum of the phase range.
+Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
+
+Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax).
+NOTE: PhaseMax must be greater than PhaseMin.
+NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
+This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30.
+
+---------------------
+32 = ACTION_T_SUMMON:
+---------------------
+Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID.
+Parameter 2: Target - The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone.
+Parameter 3: SummonID - The summon ID from the creature_ai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at.
+
+Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3).
+NOTE: Param3 Value is the ID Value used for the entry used in creature_ai_summons for this action. You MUST have an creature_ai_summons entry to use this action.
+This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events)
+
+-----------------------------
+33 = ACTION_T_KILLED_MONSTER:
+-----------------------------
+Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID.
+Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates).
+NOTE: It can be ANY creature including certain quest specific triggers
+This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit)
+
+----------------------------
+34 = ACTION_T_SET_INST_DATA:
+----------------------------
+Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
+Parameter 2: Data - The value to put at that field index.
+
+Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
+This is commonly used to link an EventAI script with a existing Script Library C++ Script. You make make things happen like opening doors on specific events that happen.
+
+------------------------------
+35 = ACTION_T_SET_INST_DATA64:
+------------------------------
+Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
+Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below.
+
+Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
+Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
+
+------------------------------
+36 = ACTION_T_UPDATE_TEMPLATE:
+------------------------------
+Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID.
+Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
+
+This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry.
+Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
+
+------------------
+37 = ACTION_T_DIE:
+------------------
+Kills the creature
+This is commonly used if you need to Instakill the creature for one reason or another.
+
+--------------------------------
+38 = ACTION_T_ZONE_COMBAT_PULSE:
+--------------------------------
+Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
+
+
+=========================================
+Target Types
+=========================================
+Below is the list of current Target types that EventAI can handle.
+Target types are used by certain actions and may effect actions differently
+
+(# Internal Name Discription)
+0 TARGET_T_SELF Self cast
+1 TARGET_T_HOSTILE Our current target (ie: highest aggro)
+2 TARGET_T_HOSTILE_SECOND_AGGRO Second highest aggro (generaly used for cleaves and some special attacks)
+3 TARGET_T_HOSTILE_LAST_AGGRO Dead last on aggro (no idea what this could be used for)
+4 TARGET_T_HOSTILE_RANDOM Just any random target on our threat list
+5 TARGET_T_HOSTILE_RANDOM_NOT_TOP Any random target except top threat
+6 TARGET_T_ACTION_INVOKER Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP)
+
+=========================================
+Cast Flags
+=========================================
+Below is the list of current Cast Flags that EventAI's spell casting can handle.
+Cast flags are handled bitwise. Bit 0 is Interrupt Previous, bit 1 is triggered, etc.
+So for example the number "3" (11 in Binary, selecting first 2 options) would mean that this cast has both CAST_INTURRUPT_PREVIOUS and CAST_TRIGGERED.
+Another example: the number "5" (101 in Binary, selecting first and third options) would mean that this cast has CAST_INTURRUPT_PREVIOUS and CAST_FORCE_CAST.
+
+(bit# Decimal Internal Name Discription)
+0 1 CAST_INTURRUPT_PREVIOUS Interrupts any previous spell casting (basicaly makes sure that this spell goes off)
+1 2 CAST_TRIGGERED Forces the spell to be instant cast and require no mana/reagents.
+2 4 CAST_FORCE_CAST Forces spell to cast even if the target is possibly out of range or the creature is possibly out of mana
+3 8 CAST_NO_MELEE_IF_OOM Prevents creature from entering melee if out of mana or out of range
+4 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself
+5 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already.
+
+NOTE: You can add the numbers in the decimal column to combine flags.
+ For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10).
+
+=========================================
+Event Flags
+=========================================
+Below is the list of current Event Flags that EventAI can handle. Event flags are handled bitwise.
+
+(bit# Decimal Internal Name Discription)
+0 1 EFLAG_REPEATABLE Event repeats (Does not repeat if this flag is not set)
+1 2 EFLAG_NORMAL Event occurs in Normal instance difficulty (will not occur in Normal if not set)
+2 4 EFLAG_HEROIC Event occurs in Heroic instance difficulty (will not occur in Heroic if not set)
+3 8
+4 16
+5 32
+6 64
+7 128 EFLAG_DEBUG_ONLY Prevents events from occuring on Release builds. Useful for testing new features.
+
+NOTE: You can add the numbers in the decimal column to combine flags.
+
+
+=========================================
+Basic Structure of creature_ai_texts
+=========================================
+Below is a the list of current fields within the texts tables.
+
+Field_Name Description
+-----------------------------------------------------------
+entry This value is mearly an NEGATIVE identifier of the current text number. Required for sql queries. Valid range are -1 to -999999
+content_default This is the actual text presented in the default language (English).
+
+content_loc1 This is the actual text presented in the Localization #1 Clients (Korean)
+content_loc2 This is the actual text presented in the Localization #2 Clients (French)
+content_loc3 This is the actual text presented in the Localization #3 Clients (German)
+content_loc4 This is the actual text presented in the Localization #4 Clients (Chinese)
+content_loc5 This is the actual text presented in the Localization #5 Clients (Taiwanese)
+content_loc6 This is the actual text presented in the Localization #6 Clients (Spanish)
+content_loc7 This is the actual text presented in the Localization #7 Clients (Spanish Mexico)
+content_loc8 This is the actual text presented in the Localization #8 Clients (Russian)
+
+sound This value is the Sound ID that corresponds to the actual text used.
+type Variables used to define type of text (Say/Yell/Textemote/Whisper).
+language This value is the Language that the text is native in.
+emote Value from enum Emote. Only source of text will play this emote (not target, if target are defined in DoScriptText)
+comment This is a comment regarding the text entry
+
+Note: Fields `content_loc1` to `content_loc8` are NULL values by default and are normally handled by seperate localization projects.
+
+=========================================
+Text Types (type)
+=========================================
+Below is the list of current Text types that texts tables can handle. These were previously seperate Actions in ACID.
+
+# Internal Name Description
+-----------------------------------------------------------
+0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble).
+1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID.
+2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log.
+3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses).
+4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log.
+5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses).
+6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone.
+
+=========================================
+Language Types (language)
+=========================================
+Below is the list of current Language types that are allowed.
+This is the Race Language that the text is native to (So it will display properly)
+
+# Internal Name Description
+-----------------------------------------------------------
+0 UNIVERSAL Text in this language is understood by ALL Races.
+1 ORCISH Text in this language is understood ONLY by Horde Races.
+2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race.
+3 TAURAHE Text in this language is understood ONLY by the Tauren Race.
+6 DWARVISH Text in this language is understood ONLY by the Dwarf Race.
+7 COMMON Text in this language is understood ONLY by Alliance Races.
+8 DEMONIC Text in this language is understood ONLY by the Demon Race (Not Implimented).
+9 TITAN This language was used by Sargeras to speak with other Titians (Not Implemented).
+10 THALASSIAN Text in this language is understood ONLY by the Blood Elf Race.
+11 DRACONIC Text in this language is understood ONLY by the Dragon Race.
+12 KALIMAG Text will display as Kalimag (not readable by players, language of all elementals)
+13 GNOMISH Text in this language is understood ONLY by the Gnome Race.
+14 TROLL Text in this language is understood ONLY by the Troll Race.
+33 GUTTERSPEAK Text in this language is understood ONLY by the Undead Race.
+35 DRAENEI Text in this language is understood ONLY by the Draenai Race.
+36 ZOMBIE (not currently used?)
+37 GNOMISH BINARY Binary language used by Alliance when drinking Binary Brew
+38 GOBLIN BINARY Binary language used by Horce when drinking Binary Brew
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 00000000000..66230b083b6
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,51 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
+# Doxygen configuration files.
+EXTRA_DIST = \
+ DocStructure.dox \
+ Doxyfile
+
+DOC_DIR = .
+DOXYFILE = $(DOC_DIR)/Doxyfile
+DOC_HTML = $(DOC_OUT)/index.html
+DOC_OUT_HTML = $(DOC_DIR)/html
+DOXYGEN = @DOXYGEN@
+
+if DOXYGEN_ENABLED
+doc: $(DOC_HTML)
+ @echo ""
+ @echo "Type \"firefox $(DOC_OUT_HTML)/index.html\" to see the html document."
+ @echo ""
+
+$(DOC_HTML): $(DOXYFILE)
+ $(DOXYGEN) $(DOXYFILE)
+else
+.PHONY: doc
+doc:
+ @echo "You must enable at configure time: ./configure --enable-doxygen"
+endif
+
+clean-local:
+ rm -rf $(DOC_OUT_HTML)
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index d7be8da6962..d8461bf3df2 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -1,7 +1,7 @@
+add_subdirectory(TBC-WLK_converter)
add_subdirectory(updates)
add_subdirectory(tools)
-
########### install files ###############
FILE(GLOB _SQL *.sql)
diff --git a/sql/Makefile.am b/sql/Makefile.am
new file mode 100644
index 00000000000..6cd08497aab
--- /dev/null
+++ b/sql/Makefile.am
@@ -0,0 +1,48 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = updates tools
+
+## Change installation location
+# datadir = trinity/sql
+pkgdatadir = $(datadir)/trinity/sql
+
+## Files to be installed
+# Install basic SQL files to datadir
+pkgdata_DATA = \
+ world.sql \
+ realmd.sql \
+ characters.sql \
+ create_mysql.sql \
+ world_scripts_full.sql \
+ world_scripts_structure.sql \
+ drop_mysql.sql
+
+## Additional files to include when running 'make dist'
+# SQL files for MaNGOS database
+EXTRA_DIST = \
+ create_mysql.sql \
+ drop_mysql.sql \
+ characters.sql \
+ world.sql \
+ world_scripts_full.sql \
+ world_scripts_structure.sql \
+ realmd.sql
diff --git a/sql/TBC-WLK_converter/CMakeLists.txt b/sql/TBC-WLK_converter/CMakeLists.txt
new file mode 100644
index 00000000000..9862f23cef3
--- /dev/null
+++ b/sql/TBC-WLK_converter/CMakeLists.txt
@@ -0,0 +1,5 @@
+########### install files ###############
+
+FILE(GLOB _SQL_TBC_WLK *.sql)
+
+install(FILES ${_SQL_TBC_WLK} Readme.txt DESTINATION share/trinity/sql/TBC-WLK_converter)
diff --git a/sql/TBC-WLK_converter/Readme.txt b/sql/TBC-WLK_converter/Readme.txt
new file mode 100644
index 00000000000..c9f3bec5a9a
--- /dev/null
+++ b/sql/TBC-WLK_converter/Readme.txt
@@ -0,0 +1,10 @@
+Convert DB from 2.4.3 to 3.0.x:
+
+1. BACKUP your old db!
+2. Run TBC-WLK_characters.sql in "characters" database.
+3. Run TBC-WLK_world_run_only_once.sql in "world" database.
+4. Run TBC-WLK_world.sql in "world" database.
+
+After that you need to manually apply all sqls starting from 805_world_scripts.sql (in sql/updates)
+!IMPORTANT! If your professions' tools aren't detected in inventory after upgrade to 3.0.x, please delete your "Cache" directory in client's one.
+Ask your testers to do so no matter what, too. !IMPORTANT!
diff --git a/sql/TBC-WLK_converter/TBC-WLK_characters.sql b/sql/TBC-WLK_converter/TBC-WLK_characters.sql
new file mode 100644
index 00000000000..214c19fef14
--- /dev/null
+++ b/sql/TBC-WLK_converter/TBC-WLK_characters.sql
@@ -0,0 +1,375 @@
+ALTER TABLE character_spell
+ DROP slot;
+DELETE FROM `character_spell` WHERE `spell` IN (28880, 59542, 59543, 59544, 59545, 59547, 59548);
+DELETE FROM `character_spell` WHERE `spell` IN (7376,3025,5419,5421,21156,7381,1178,21178,9635,21178,24905,5420,34123,33948,34090,34764,40121,40122);
+DELETE FROM character_spell WHERE `spell` IN (
+ 20580, /*old Shadowmeld*/
+ 20600, /*Perception*/
+ 21009, /*old Shadowmeld Passive and new Elusiveness (learned as racial passive)*/
+ 21184 /*old Seal of Righteousness*/
+);
+/*old Shadow Resistance, leaned as racial passive of race 5 */
+DELETE FROM character_spell USING character_spell INNER JOIN characters ON character_spell.guid = characters.guid
+WHERE character_spell.spell = 20579 AND characters.race <> 5;
+
+UPDATE IGNORE character_spell SET spell = 2018 WHERE spell = 2020;
+DELETE FROM character_spell WHERE spell = 2020;
+
+UPDATE IGNORE character_spell SET spell = 2018 WHERE spell = 2020;
+DELETE FROM character_spell WHERE spell = 2020;
+
+UPDATE IGNORE character_spell SET spell = 3100 WHERE spell = 2021;
+DELETE FROM character_spell WHERE spell = 2021;
+
+UPDATE IGNORE character_spell SET spell = 3104 WHERE spell = 2154;
+DELETE FROM character_spell WHERE spell = 2154;
+
+UPDATE IGNORE character_spell SET spell = 2108 WHERE spell = 2155;
+DELETE FROM character_spell WHERE spell = 2155;
+
+UPDATE IGNORE character_spell SET spell = 2259 WHERE spell = 2275;
+DELETE FROM character_spell WHERE spell = 2275;
+
+UPDATE IGNORE character_spell SET spell = 3101 WHERE spell = 2280;
+DELETE FROM character_spell WHERE spell = 2280;
+
+UPDATE IGNORE character_spell SET spell = 2366 WHERE spell = 2372;
+DELETE FROM character_spell WHERE spell = 2372;
+
+UPDATE IGNORE character_spell SET spell = 2368 WHERE spell = 2373;
+DELETE FROM character_spell WHERE spell = 2373;
+
+UPDATE IGNORE character_spell SET spell = 2550 WHERE spell = 2551;
+DELETE FROM character_spell WHERE spell = 2551;
+
+UPDATE IGNORE character_spell SET spell = 2575 WHERE spell = 2581;
+DELETE FROM character_spell WHERE spell = 2581;
+
+UPDATE IGNORE character_spell SET spell = 2576 WHERE spell = 2582;
+DELETE FROM character_spell WHERE spell = 2582;
+
+UPDATE IGNORE character_spell SET spell = 3273 WHERE spell = 3279;
+DELETE FROM character_spell WHERE spell = 3279;
+
+UPDATE IGNORE character_spell SET spell = 3274 WHERE spell = 3280;
+DELETE FROM character_spell WHERE spell = 3280;
+
+UPDATE IGNORE character_spell SET spell = 3102 WHERE spell = 3412;
+DELETE FROM character_spell WHERE spell = 3412;
+
+UPDATE IGNORE character_spell SET spell = 3464 WHERE spell = 3465;
+DELETE FROM character_spell WHERE spell = 3465;
+
+UPDATE IGNORE character_spell SET spell = 3538 WHERE spell = 3539;
+DELETE FROM character_spell WHERE spell = 3539;
+
+UPDATE IGNORE character_spell SET spell = 3564 WHERE spell = 3568;
+DELETE FROM character_spell WHERE spell = 3568;
+
+UPDATE IGNORE character_spell SET spell = 3570 WHERE spell = 3571;
+DELETE FROM character_spell WHERE spell = 3571;
+
+UPDATE IGNORE character_spell SET spell = 3811 WHERE spell = 3812;
+DELETE FROM character_spell WHERE spell = 3812;
+
+UPDATE IGNORE character_spell SET spell = 3908 WHERE spell = 3911;
+DELETE FROM character_spell WHERE spell = 3911;
+
+UPDATE IGNORE character_spell SET spell = 3909 WHERE spell = 3912;
+DELETE FROM character_spell WHERE spell = 3912;
+
+UPDATE IGNORE character_spell SET spell = 3910 WHERE spell = 3913;
+DELETE FROM character_spell WHERE spell = 3913;
+
+UPDATE IGNORE character_spell SET spell = 4036 WHERE spell = 4039;
+DELETE FROM character_spell WHERE spell = 4039;
+
+UPDATE IGNORE character_spell SET spell = 4037 WHERE spell = 4040;
+DELETE FROM character_spell WHERE spell = 4040;
+
+UPDATE IGNORE character_spell SET spell = 4038 WHERE spell = 4041;
+DELETE FROM character_spell WHERE spell = 4041;
+
+UPDATE IGNORE character_spell SET spell = 7620 WHERE spell = 7733;
+DELETE FROM character_spell WHERE spell = 7733;
+
+UPDATE IGNORE character_spell SET spell = 7731 WHERE spell = 7734;
+DELETE FROM character_spell WHERE spell = 7734;
+
+UPDATE IGNORE character_spell SET spell = 8613 WHERE spell = 8615;
+DELETE FROM character_spell WHERE spell = 8615;
+
+UPDATE IGNORE character_spell SET spell = 8617 WHERE spell = 8619;
+DELETE FROM character_spell WHERE spell = 8619;
+
+UPDATE IGNORE character_spell SET spell = 8618 WHERE spell = 8620;
+DELETE FROM character_spell WHERE spell = 8620;
+
+UPDATE IGNORE character_spell SET spell = 9785 WHERE spell = 9786;
+DELETE FROM character_spell WHERE spell = 9786;
+
+UPDATE IGNORE character_spell SET spell = 10248 WHERE spell = 10249;
+DELETE FROM character_spell WHERE spell = 10249;
+
+UPDATE IGNORE character_spell SET spell = 10662 WHERE spell = 10663;
+DELETE FROM character_spell WHERE spell = 10663;
+
+UPDATE IGNORE character_spell SET spell = 10768 WHERE spell = 10769;
+DELETE FROM character_spell WHERE spell = 10769;
+
+UPDATE IGNORE character_spell SET spell = 11611 WHERE spell = 11612;
+DELETE FROM character_spell WHERE spell = 11612;
+
+UPDATE IGNORE character_spell SET spell = 11993 WHERE spell = 11994;
+DELETE FROM character_spell WHERE spell = 11994;
+
+UPDATE IGNORE character_spell SET spell = 12180 WHERE spell = 12181;
+DELETE FROM character_spell WHERE spell = 12181;
+
+UPDATE IGNORE character_spell SET spell = 12656 WHERE spell = 12657;
+DELETE FROM character_spell WHERE spell = 12657;
+
+UPDATE IGNORE character_spell SET spell = 25229 WHERE spell = 25245;
+DELETE FROM character_spell WHERE spell = 25245;
+
+UPDATE IGNORE character_spell SET spell = 25230 WHERE spell = 25246;
+DELETE FROM character_spell WHERE spell = 25246;
+
+UPDATE IGNORE character_spell SET spell = 26790 WHERE spell = 26791;
+DELETE FROM character_spell WHERE spell = 26791;
+
+UPDATE IGNORE character_spell SET spell = 28596 WHERE spell = 28597;
+DELETE FROM character_spell WHERE spell = 28597;
+
+UPDATE IGNORE character_spell SET spell = 28695 WHERE spell = 28696;
+DELETE FROM character_spell WHERE spell = 28696;
+
+UPDATE IGNORE character_spell SET spell = 28894 WHERE spell = 28896;
+DELETE FROM character_spell WHERE spell = 28896;
+
+UPDATE IGNORE character_spell SET spell = 28895 WHERE spell = 28899;
+DELETE FROM character_spell WHERE spell = 28899;
+
+UPDATE IGNORE character_spell SET spell = 28897 WHERE spell = 28901;
+DELETE FROM character_spell WHERE spell = 28901;
+
+UPDATE IGNORE character_spell SET spell = 29354 WHERE spell = 29355;
+DELETE FROM character_spell WHERE spell = 29355;
+
+UPDATE IGNORE character_spell SET spell = 29844 WHERE spell = 29845;
+DELETE FROM character_spell WHERE spell = 29845;
+
+UPDATE IGNORE character_spell SET spell = 30350 WHERE spell = 30351;
+DELETE FROM character_spell WHERE spell = 30351;
+
+UPDATE IGNORE character_spell SET spell = 32549 WHERE spell = 32550;
+DELETE FROM character_spell WHERE spell = 32550;
+
+UPDATE IGNORE character_spell SET spell = 32678 WHERE spell = 32679;
+DELETE FROM character_spell WHERE spell = 32679;
+
+UPDATE IGNORE character_spell SET spell = 45357 WHERE spell = 45375;
+DELETE FROM character_spell WHERE spell = 45375;
+
+UPDATE IGNORE character_spell SET spell = 45358 WHERE spell = 45376;
+DELETE FROM character_spell WHERE spell = 45376;
+
+UPDATE IGNORE character_spell SET spell = 45359 WHERE spell = 45377;
+DELETE FROM character_spell WHERE spell = 45377;
+
+UPDATE IGNORE character_spell SET spell = 45360 WHERE spell = 45378;
+DELETE FROM character_spell WHERE spell = 45378;
+
+UPDATE IGNORE character_spell SET spell = 45361 WHERE spell = 45379;
+DELETE FROM character_spell WHERE spell = 45379;
+
+UPDATE IGNORE character_spell SET spell = 45363 WHERE spell = 45380;
+DELETE FROM character_spell WHERE spell = 45380;
+
+UPDATE IGNORE character_spell SET spell = 45542 WHERE spell = 50299;
+DELETE FROM character_spell WHERE spell = 50299;
+
+UPDATE IGNORE character_spell SET spell = 50305 WHERE spell = 50307;
+DELETE FROM character_spell WHERE spell = 50307;
+
+UPDATE IGNORE character_spell SET spell = 50310 WHERE spell = 50309;
+DELETE FROM character_spell WHERE spell = 50309;
+
+UPDATE IGNORE character_spell SET spell = 51294 WHERE spell = 51293;
+DELETE FROM character_spell WHERE spell = 51293;
+
+UPDATE IGNORE character_spell SET spell = 51296 WHERE spell = 51295;
+DELETE FROM character_spell WHERE spell = 51295;
+
+UPDATE IGNORE character_spell SET spell = 51300 WHERE spell = 51298;
+DELETE FROM character_spell WHERE spell = 51298;
+
+UPDATE IGNORE character_spell SET spell = 51302 WHERE spell = 51301;
+DELETE FROM character_spell WHERE spell = 51301;
+
+UPDATE IGNORE character_spell SET spell = 51304 WHERE spell = 51303;
+DELETE FROM character_spell WHERE spell = 51303;
+
+UPDATE IGNORE character_spell SET spell = 51306 WHERE spell = 51305;
+DELETE FROM character_spell WHERE spell = 51305;
+
+UPDATE IGNORE character_spell SET spell = 51309 WHERE spell = 51308;
+DELETE FROM character_spell WHERE spell = 51308;
+
+UPDATE IGNORE character_spell SET spell = 51311 WHERE spell = 51310;
+DELETE FROM character_spell WHERE spell = 51310;
+
+UPDATE IGNORE character_spell SET spell = 51313 WHERE spell = 51312;
+DELETE FROM character_spell WHERE spell = 51312;
+
+UPDATE IGNORE character_spell SET spell = 33095 WHERE spell = 54084;
+DELETE FROM character_spell WHERE spell = 54084;
+
+/* Warrior cleanup */
+DELETE FROM `character_spell` WHERE `spell` IN (1715,7372,7373); /* Hamstring old */
+DELETE FROM `character_spell` WHERE `spell` IN (72,17671,1672); /* Mortar Disturb old */
+DELETE FROM `character_spell` WHERE `spell` IN (7384,7887,11584,11586); /* Overpower old */
+DELETE FROM `character_spell` WHERE `spell`=23881; /* Bloodthirst old */
+DELETE FROM `character_spell` WHERE `spell` IN (6552,6554); /* Pummel old */
+DELETE FROM `character_spell` WHERE `spell` IN (694,7400,7402,20559,20560,25266); /* Mocking Blow old */
+/* Druid cleanup */
+DELETE FROM `character_spell` WHERE `spell`=22842; /* Frenzied Regeneration old */
+/* Hunter cleanup */
+DELETE FROM `character_spell` WHERE `spell`=14268; /* Wing Clip r1 old */
+DELETE FROM `character_spell` WHERE `spell`=14267; /* Wing Clip r2 old */
+/* Rogue */
+DELETE FROM `character_spell` WHERE `spell` IN (1766,1767,1768,1769,38768); /* Kick old */
+DELETE FROM `character_spell` WHERE `spell` IN (1776,1777,8629,11285,11286,38764);/* Gouge old */
+DELETE FROM `character_spell` WHERE `spell`=2842; /* Poisons old */
+
+/* Hunter's training spells for pets */
+DELETE FROM `character_spell` WHERE `spell` IN (2949,2975,2976,2977,2980,2981,2982,3666,3667,4630,6327,6359,6362,
+ 7370,7832,7833,7834,7835,7871,7872,7873,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,8318,8319,11764,
+ 11765,11768,11769,11772,11773,11776,11777,11781,11782,11783,11786,11787,17254,17262,17263,17264,17265,17266,
+ 17267,17268,17736,17753,17754,17755,17776,17855,17856,17857,17859,17860,19439,19444,19445,19446,19447,19481,
+ 19577,19648,19650,19661,19662,19663,19664,19737,19738,19739,20270,20312,20313,20314,20315,20316,20317,20318,
+ 20319,20320,20321,20322,20323,20324,20326,20327,20329,20377,20378,20379,20380,20381,20382,20383,20384,20385,
+ 20386,20387,20388,20389,20390,20391,20392,20393,20394,20395,20396,20397,20398,20399,20400,20401,20402,20403,
+ 20404,20405,20406,20407,20408,20426,20427,20428,20429,20430,20431,20432,20433,20434,20435,23100,23111,23112,
+ 23146,23149,23150,24424,24440,24441,24451,24454,24455,24463,24464,24475,24476,24477,24580,24581,24582,24584,
+ 24588,24589,24599,24607,24608,24609,24641,26065,26094,26184,26185,26186,26189,26190,26202,27347,27348,27349,
+ 27361,27366,27484,27485,27486,27487,27488,27489,27490,27491,27492,27493,27494,27495,27496,27497,27500,28343,
+ 33703,35299,35300,35302,35303,35304,35305,35306,35307,35308);
+DELETE FROM `character_spell` WHERE `spell` IN (1853,14922,14923,14924,14925,14926,14927,27344);
+DELETE FROM `character_spell` WHERE `spell` IN (27353,24516,24515,24514,24490);
+DELETE FROM `character_spell` WHERE `spell` IN (27354,24513,24512,24511,24494,2119);
+UPDATE IGNORE character_spell SET spell = 2108 WHERE spell = 3104;
+DELETE FROM character_spell WHERE spell = 3104;
+
+/* This cleanup character_action. This is like delete from character_action where type=0 and action not in character_spell for same player */
+DELETE FROM ca,cs USING `character_action` ca LEFT JOIN `character_spell` cs ON ca.`guid`=cs.`guid` AND ca.`action`=cs.`spell` WHERE ca.`type`=0 AND cs.`guid` IS NULL;
+
+ALTER TABLE `character_pet`
+ DROP COLUMN `trainpoint`,
+ DROP COLUMN `loyaltypoints`,
+ DROP COLUMN `loyalty`,
+ ADD `talentpoints` int(11) UNSIGNED default '0' NOT NULL after `Reactstate`;
+
+DROP TABLE IF EXISTS `account_data`;
+CREATE TABLE `account_data` (
+ `account` int(11) unsigned NOT NULL default '0',
+ `type` int(11) unsigned NOT NULL default '0',
+ `time` bigint(11) unsigned NOT NULL default '0',
+ `data` longtext NOT NULL,
+ PRIMARY KEY (`account`,`type`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `character_achievement`;
+CREATE TABLE `character_achievement` (
+ `guid` int(11) NOT NULL,
+ `achievement` int(11) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`guid`,`achievement`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `character_achievement_progress`;
+CREATE TABLE `character_achievement_progress` (
+ `guid` int(11) NOT NULL,
+ `criteria` int(11) NOT NULL,
+ `counter` int(11) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`guid`,`criteria`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- 3.x character converting...
+UPDATE characters SET data = REPLACE(data,' ',' ');
+UPDATE characters SET data = CONCAT(TRIM(data),' ');
+UPDATE characters SET data = CONCAT(
+ SUBSTRING(data, 1, length(SUBSTRING_INDEX(data, ' ', 10))), " 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 10))+2, length(SUBSTRING_INDEX(data, ' ', 18))- length(SUBSTRING_INDEX(data, ' ', 10)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 20))+2, length(SUBSTRING_INDEX(data, ' ', 22))- length(SUBSTRING_INDEX(data, ' ', 20)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 36))+2, length(SUBSTRING_INDEX(data, ' ', 37))- length(SUBSTRING_INDEX(data, ' ', 36)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 22))+2, length(SUBSTRING_INDEX(data, ' ', 28))- length(SUBSTRING_INDEX(data, ' ', 22)) - 1), " 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 28))+2, length(SUBSTRING_INDEX(data, ' ', 34))- length(SUBSTRING_INDEX(data, ' ', 28)) - 1), " 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 1564))+2, length(SUBSTRING_INDEX(data, ' ', 1565))- length(SUBSTRING_INDEX(data, ' ', 1564)) - 1), " 0 0 0 0 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 1565))+2, length(SUBSTRING_INDEX(data, ' ', 1566))- length(SUBSTRING_INDEX(data, ' ', 1565)) - 1), " 0 0 0 0 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 34))+2, length(SUBSTRING_INDEX(data, ' ', 36))- length(SUBSTRING_INDEX(data, ' ', 34)) - 1), " 0 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 46))+2, length(SUBSTRING_INDEX(data, ' ', 48))- length(SUBSTRING_INDEX(data, ' ', 46)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 146))+2, length(SUBSTRING_INDEX(data, ' ', 170))- length(SUBSTRING_INDEX(data, ' ', 146)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 171))+2, length(SUBSTRING_INDEX(data, ' ', 209))- length(SUBSTRING_INDEX(data, ' ', 171)) - 1), " ",
+ ((SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 209))+2, length(SUBSTRING_INDEX(data, ' ', 210))- length(SUBSTRING_INDEX(data, ' ', 209)) - 1) & ~0x100) | ((SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 46))+2, length(SUBSTRING_INDEX(data, ' ', 47))- length(SUBSTRING_INDEX(data, ' ', 46)) - 1) & 0x1000) >> 4)), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 210))+2, length(SUBSTRING_INDEX(data, ' ', 233))- length(SUBSTRING_INDEX(data, ' ', 210)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 233))+2, length(SUBSTRING_INDEX(data, ' ', 358))- length(SUBSTRING_INDEX(data, ' ', 233)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 358))+2, length(SUBSTRING_INDEX(data, ' ', 359))- length(SUBSTRING_INDEX(data, ' ', 358)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 359))+2, length(SUBSTRING_INDEX(data, ' ', 374))- length(SUBSTRING_INDEX(data, ' ', 359)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 374))+2, length(SUBSTRING_INDEX(data, ' ', 375))- length(SUBSTRING_INDEX(data, ' ', 374)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 375))+2, length(SUBSTRING_INDEX(data, ' ', 390))- length(SUBSTRING_INDEX(data, ' ', 375)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 390))+2, length(SUBSTRING_INDEX(data, ' ', 391))- length(SUBSTRING_INDEX(data, ' ', 390)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 391))+2, length(SUBSTRING_INDEX(data, ' ', 406))- length(SUBSTRING_INDEX(data, ' ', 391)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 406))+2, length(SUBSTRING_INDEX(data, ' ', 407))- length(SUBSTRING_INDEX(data, ' ', 406)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 407))+2, length(SUBSTRING_INDEX(data, ' ', 422))- length(SUBSTRING_INDEX(data, ' ', 407)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 422))+2, length(SUBSTRING_INDEX(data, ' ', 423))- length(SUBSTRING_INDEX(data, ' ', 422)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 423))+2, length(SUBSTRING_INDEX(data, ' ', 438))- length(SUBSTRING_INDEX(data, ' ', 423)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 438))+2, length(SUBSTRING_INDEX(data, ' ', 439))- length(SUBSTRING_INDEX(data, ' ', 438)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 439))+2, length(SUBSTRING_INDEX(data, ' ', 454))- length(SUBSTRING_INDEX(data, ' ', 439)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 454))+2, length(SUBSTRING_INDEX(data, ' ', 455))- length(SUBSTRING_INDEX(data, ' ', 454)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 455))+2, length(SUBSTRING_INDEX(data, ' ', 470))- length(SUBSTRING_INDEX(data, ' ', 455)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 470))+2, length(SUBSTRING_INDEX(data, ' ', 471))- length(SUBSTRING_INDEX(data, ' ', 470)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 471))+2, length(SUBSTRING_INDEX(data, ' ', 486))- length(SUBSTRING_INDEX(data, ' ', 471)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 486))+2, length(SUBSTRING_INDEX(data, ' ', 487))- length(SUBSTRING_INDEX(data, ' ', 486)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 487))+2, length(SUBSTRING_INDEX(data, ' ', 502))- length(SUBSTRING_INDEX(data, ' ', 487)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 502))+2, length(SUBSTRING_INDEX(data, ' ', 503))- length(SUBSTRING_INDEX(data, ' ', 502)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 503))+2, length(SUBSTRING_INDEX(data, ' ', 518))- length(SUBSTRING_INDEX(data, ' ', 503)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 518))+2, length(SUBSTRING_INDEX(data, ' ', 519))- length(SUBSTRING_INDEX(data, ' ', 518)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 519))+2, length(SUBSTRING_INDEX(data, ' ', 534))- length(SUBSTRING_INDEX(data, ' ', 519)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 534))+2, length(SUBSTRING_INDEX(data, ' ', 535))- length(SUBSTRING_INDEX(data, ' ', 534)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 535))+2, length(SUBSTRING_INDEX(data, ' ', 550))- length(SUBSTRING_INDEX(data, ' ', 535)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 550))+2, length(SUBSTRING_INDEX(data, ' ', 551))- length(SUBSTRING_INDEX(data, ' ', 550)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 551))+2, length(SUBSTRING_INDEX(data, ' ', 566))- length(SUBSTRING_INDEX(data, ' ', 551)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 566))+2, length(SUBSTRING_INDEX(data, ' ', 567))- length(SUBSTRING_INDEX(data, ' ', 566)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 567))+2, length(SUBSTRING_INDEX(data, ' ', 582))- length(SUBSTRING_INDEX(data, ' ', 567)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 582))+2, length(SUBSTRING_INDEX(data, ' ', 583))- length(SUBSTRING_INDEX(data, ' ', 582)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 583))+2, length(SUBSTRING_INDEX(data, ' ', 598))- length(SUBSTRING_INDEX(data, ' ', 583)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 598))+2, length(SUBSTRING_INDEX(data, ' ', 599))- length(SUBSTRING_INDEX(data, ' ', 598)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 599))+2, length(SUBSTRING_INDEX(data, ' ', 614))- length(SUBSTRING_INDEX(data, ' ', 599)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 614))+2, length(SUBSTRING_INDEX(data, ' ', 615))- length(SUBSTRING_INDEX(data, ' ', 614)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 615))+2, length(SUBSTRING_INDEX(data, ' ', 630))- length(SUBSTRING_INDEX(data, ' ', 615)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 630))+2, length(SUBSTRING_INDEX(data, ' ', 631))- length(SUBSTRING_INDEX(data, ' ', 630)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 631))+2, length(SUBSTRING_INDEX(data, ' ', 646))- length(SUBSTRING_INDEX(data, ' ', 631)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 646))+2, length(SUBSTRING_INDEX(data, ' ', 647))- length(SUBSTRING_INDEX(data, ' ', 646)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 647))+2, length(SUBSTRING_INDEX(data, ' ', 922))- length(SUBSTRING_INDEX(data, ' ', 647)) - 1),
+ " 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 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 922))+2, length(SUBSTRING_INDEX(data, ' ', 926))- length(SUBSTRING_INDEX(data, ' ', 922)) - 1), " 0 0 0 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 926))+2, length(SUBSTRING_INDEX(data, ' ', 1332))- length(SUBSTRING_INDEX(data, ' ', 926)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 1332))+2, length(SUBSTRING_INDEX(data, ' ', 1544))- length(SUBSTRING_INDEX(data, ' ', 1332)) - 1), " 0 ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 1544))+2, length(SUBSTRING_INDEX(data, ' ', 1564))- length(SUBSTRING_INDEX(data, ' ', 1544)) - 1), " ",
+ SUBSTRING(data, length(SUBSTRING_INDEX(data, ' ', 1566))+2, length(SUBSTRING_INDEX(data, ' ', 1592))- length(SUBSTRING_INDEX(data, ' ', 1566)) - 1),
+ " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ")
+WHERE length(SUBSTRING_INDEX(data, ' ', 1592)) < length(data) and length(SUBSTRING_INDEX(data, ' ', 1593)) >= length(data);
+
+UPDATE item_instance SET data = REPLACE(data,' ',' ');
+UPDATE item_instance SET data = CONCAT(TRIM(data),' ');
+UPDATE item_instance SET data= CONCAT(
+ SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',54),' ',-54),' 0 0 0 ',
+ SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',60),' ',-60+54),' 0 ')
+WHERE SUBSTRING_INDEX(data,' ',60) = data AND SUBSTRING_INDEX(data,' ',60-1) <> data;
+UPDATE item_instance SET data= CONCAT(
+ SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',30),' ',-30),' 0 0 0 ',
+ SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',60),' ',-60+30),' 0 ',
+ SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',134),' ',-134+60))
+WHERE SUBSTRING_INDEX(data,' ',134) = data AND SUBSTRING_INDEX(data,' ',134-1) <> data; \ No newline at end of file
diff --git a/sql/TBC-WLK_converter/TBC-WLK_world.sql b/sql/TBC-WLK_converter/TBC-WLK_world.sql
new file mode 100644
index 00000000000..a2e3833c2e4
--- /dev/null
+++ b/sql/TBC-WLK_converter/TBC-WLK_world.sql
@@ -0,0 +1,9136 @@
+-- battleground
+DELETE FROM `battleground_template` WHERE `id` IN (9,10,11);
+INSERT INTO `battleground_template` VALUES
+(9,0,0,0,0,1367,0,1368,0),
+(10,5,5,10,80,1362,0,1363,0),
+(11,5,5,10,80,1364,0,1365,0);
+
+-- command
+DELETE FROM `command` WHERE `name` = 'reload';
+DELETE FROM `command` WHERE `name` = 'modify runicpower';
+INSERT INTO `command` VALUES
+('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.');
+-- string
+DELETE FROM `trinity_string` WHERE `entry` in (345,346);
+INSERT INTO `trinity_string` VALUES
+(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+DELETE FROM `trinity_string` WHERE `entry` in (712,717,718,719);
+INSERT INTO `trinity_string` VALUES
+(712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(717,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(718,'|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(719,'|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+DELETE FROM `trinity_string` WHERE `entry` in (720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736);
+INSERT INTO `trinity_string` VALUES
+(720,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(721,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(722,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(723,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(724,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(725,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(726,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(727,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(728,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(729,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(730,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(731,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(732,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(733,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(734,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(735,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(736,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+DELETE FROM `trinity_string` WHERE `entry` IN (1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138);
+
+DELETE FROM `trinity_string` WHERE `entry` IN (173,174);
+INSERT INTO `trinity_string` VALUES
+(173,'You changed runic power of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(174,'%s changed your runic power to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+DELETE FROM `trinity_string` WHERE `entry` IN (521,1109,1122);
+INSERT INTO `trinity_string` VALUES
+(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1109,'%d - %s %s %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1122,'(%u/%u +perm %u +temp %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+-- data from mangos.sql
+-- playercreateinfo_action
+INSERT IGNORE INTO `playercreateinfo_action` (`race`, `class`, `button`, `action`, `type`, `misc`) VALUES
+(1, 1, 1, 78, 0, 0),
+(1, 1, 0, 6603, 0, 0),
+(1, 1, 11, 117, 128, 0),
+(1, 2, 2, 635, 0, 0),
+(1, 2, 0, 6603, 0, 0),
+(1, 2, 1, 21084, 0, 0),
+(1, 2, 10, 159, 128, 0),
+(1, 2, 11, 2070, 128, 0),
+(1, 4, 1, 1752, 0, 0),
+(1, 4, 2, 2098, 0, 0),
+(1, 4, 3, 2764, 0, 0),
+(1, 4, 0, 6603, 0, 0),
+(1, 4, 11, 2070, 128, 0),
+(1, 5, 1, 585, 0, 0),
+(1, 5, 2, 2050, 0, 0),
+(1, 5, 0, 6603, 0, 0),
+(1, 5, 10, 159, 128, 0),
+(1, 5, 11, 2070, 128, 0),
+(1, 6, 0, 6603, 0, 0),
+(1, 6, 1, 49576, 0, 0),
+(1, 6, 2, 45477, 0, 0),
+(1, 6, 3, 45462, 0, 0),
+(1, 6, 4, 45902, 0, 0),
+(1, 6, 5, 47541, 0, 0),
+(1, 6, 11, 59752, 0, 0),
+(1, 8, 1, 133, 0, 0),
+(1, 8, 2, 168, 0, 0),
+(1, 8, 0, 6603, 0, 0),
+(1, 8, 10, 159, 128, 0),
+(1, 8, 11, 2070, 128, 0),
+(1, 9, 1, 686, 0, 0),
+(1, 9, 2, 687, 0, 0),
+(1, 9, 0, 6603, 0, 0),
+(1, 9, 10, 159, 128, 0),
+(1, 9, 11, 4604, 128, 0),
+(2, 1, 1, 78, 0, 0),
+(2, 1, 0, 6603, 0, 0),
+(2, 1, 11, 117, 128, 0),
+(2, 3, 2, 75, 0, 0),
+(2, 3, 1, 2973, 0, 0),
+(2, 3, 0, 6603, 0, 0),
+(2, 3, 11, 117, 128, 0),
+(2, 3, 10, 159, 128, 0),
+(2, 4, 10, 0, 128, 0),
+(2, 4, 1, 1752, 0, 0),
+(2, 4, 2, 2098, 0, 0),
+(2, 4, 0, 6603, 0, 0),
+(2, 4, 11, 117, 128, 0),
+(2, 6, 0, 6603, 0, 0),
+(2, 6, 1, 49576, 0, 0),
+(2, 6, 2, 45477, 0, 0),
+(2, 6, 3, 45462, 0, 0),
+(2, 6, 4, 45902, 0, 0),
+(2, 6, 5, 47541, 0, 0),
+(2, 6, 10, 20572, 0, 0),
+(2, 7, 2, 331, 0, 0),
+(2, 7, 1, 403, 0, 0),
+(2, 7, 0, 6603, 0, 0),
+(2, 7, 11, 117, 128, 0),
+(2, 7, 10, 159, 128, 0),
+(2, 9, 1, 686, 0, 0),
+(2, 9, 2, 687, 0, 0),
+(2, 9, 0, 6603, 0, 0),
+(2, 9, 11, 117, 128, 0),
+(2, 9, 10, 159, 128, 0),
+(3, 1, 1, 78, 0, 0),
+(3, 1, 0, 6603, 0, 0),
+(3, 1, 11, 117, 128, 0),
+(3, 2, 2, 635, 0, 0),
+(3, 2, 0, 6603, 0, 0),
+(3, 2, 1, 21084, 0, 0),
+(3, 2, 10, 159, 128, 0),
+(3, 2, 11, 4540, 128, 0),
+(3, 3, 2, 75, 0, 0),
+(3, 3, 1, 2973, 0, 0),
+(3, 3, 0, 6603, 0, 0),
+(3, 3, 11, 117, 128, 0),
+(3, 3, 10, 159, 128, 0),
+(3, 4, 1, 1752, 0, 0),
+(3, 4, 2, 2098, 0, 0),
+(3, 4, 3, 2764, 0, 0),
+(3, 4, 0, 6603, 0, 0),
+(3, 4, 11, 4540, 128, 0),
+(3, 5, 1, 585, 0, 0),
+(3, 5, 2, 2050, 0, 0),
+(3, 5, 0, 6603, 0, 0),
+(3, 5, 10, 159, 128, 0),
+(3, 5, 11, 4540, 128, 0),
+(3, 6, 0, 6603, 0, 0),
+(3, 6, 1, 49576, 0, 0),
+(3, 6, 2, 45477, 0, 0),
+(3, 6, 3, 45462, 0, 0),
+(3, 6, 4, 45902, 0, 0),
+(3, 6, 5, 47541, 0, 0),
+(3, 6, 10, 2481, 0, 0),
+(4, 1, 1, 78, 0, 0),
+(4, 1, 0, 6603, 0, 0),
+(4, 1, 11, 117, 128, 0),
+(4, 3, 2, 75, 0, 0),
+(4, 3, 1, 2973, 0, 0),
+(4, 3, 0, 6603, 0, 0),
+(4, 3, 11, 117, 128, 0),
+(4, 3, 10, 159, 128, 0),
+(4, 4, 1, 1752, 0, 0),
+(4, 4, 2, 2098, 0, 0),
+(4, 4, 3, 2764, 0, 0),
+(4, 4, 0, 6603, 0, 0),
+(4, 4, 11, 4540, 128, 0),
+(4, 5, 1, 585, 0, 0),
+(4, 5, 2, 2050, 0, 0),
+(4, 5, 0, 6603, 0, 0),
+(4, 5, 10, 159, 128, 0),
+(4, 5, 11, 2070, 128, 0),
+(4, 6, 0, 6603, 0, 0),
+(4, 6, 1, 49576, 0, 0),
+(4, 6, 2, 45477, 0, 0),
+(4, 6, 3, 45462, 0, 0),
+(4, 6, 4, 45902, 0, 0),
+(4, 6, 5, 47541, 0, 0),
+(4, 6, 10, 58984, 0, 0),
+(4, 6, 83, 58984, 0, 0),
+(4, 11, 1, 5176, 0, 0),
+(4, 11, 2, 5185, 0, 0),
+(4, 11, 0, 6603, 0, 0),
+(4, 11, 10, 159, 128, 0),
+(4, 11, 11, 4536, 128, 0),
+(5, 1, 11, 4604, 128, 0),
+(5, 1, 0, 6603, 0, 0),
+(5, 1, 1, 78, 0, 0),
+(5, 4, 11, 4604, 128, 0),
+(5, 4, 3, 2764, 0, 0),
+(5, 4, 2, 2098, 0, 0),
+(5, 4, 1, 1752, 0, 0),
+(5, 4, 0, 6603, 0, 0),
+(5, 5, 10, 159, 128, 0),
+(5, 5, 2, 2050, 0, 0),
+(5, 5, 1, 585, 0, 0),
+(5, 5, 11, 4604, 128, 0),
+(5, 5, 0, 6603, 0, 0),
+(5, 6, 0, 6603, 0, 0),
+(5, 6, 1, 49576, 0, 0),
+(5, 6, 2, 45477, 0, 0),
+(5, 6, 3, 45462, 0, 0),
+(5, 6, 4, 45902, 0, 0),
+(5, 6, 5, 47541, 0, 0),
+(5, 6, 10, 20577, 0, 0),
+(5, 8, 11, 4604, 128, 0),
+(5, 8, 10, 159, 128, 0),
+(5, 8, 2, 168, 0, 0),
+(5, 8, 1, 133, 0, 0),
+(5, 8, 0, 6603, 0, 0),
+(5, 9, 1, 686, 0, 0),
+(5, 9, 10, 159, 128, 0),
+(5, 9, 2, 687, 0, 0),
+(5, 9, 11, 4604, 128, 0),
+(5, 9, 0, 6603, 0, 0),
+(6, 1, 1, 78, 0, 0),
+(6, 1, 2, 20549, 0, 0),
+(6, 1, 11, 4540, 128, 0),
+(6, 1, 0, 6603, 0, 0),
+(6, 3, 1, 2973, 0, 0),
+(6, 3, 10, 159, 128, 0),
+(6, 3, 2, 75, 0, 0),
+(6, 3, 3, 20549, 0, 0),
+(6, 3, 11, 117, 128, 0),
+(6, 3, 0, 6603, 0, 0),
+(6, 6, 0, 6603, 0, 0),
+(6, 6, 1, 49576, 0, 0),
+(6, 6, 2, 45477, 0, 0),
+(6, 6, 3, 45462, 0, 0),
+(6, 6, 4, 45902, 0, 0),
+(6, 6, 5, 47541, 0, 0),
+(6, 6, 10, 20549, 0, 0),
+(6, 6, 75, 20549, 0, 0),
+(6, 7, 1, 403, 0, 0),
+(6, 7, 10, 159, 128, 0),
+(6, 7, 2, 331, 0, 0),
+(6, 7, 3, 20549, 0, 0),
+(6, 7, 11, 4604, 128, 0),
+(6, 7, 0, 6603, 0, 0),
+(6, 11, 1, 5176, 0, 0),
+(6, 11, 10, 159, 128, 0),
+(6, 11, 2, 5185, 0, 0),
+(6, 11, 3, 20549, 0, 0),
+(6, 11, 11, 4536, 128, 0),
+(6, 11, 0, 6603, 0, 0),
+(7, 1, 11, 117, 128, 0),
+(7, 1, 1, 78, 0, 0),
+(7, 1, 0, 6603, 0, 0),
+(7, 4, 11, 117, 128, 0),
+(7, 4, 3, 2764, 0, 0),
+(7, 4, 1, 1752, 0, 0),
+(7, 4, 2, 2098, 0, 0),
+(7, 4, 0, 6603, 0, 0),
+(7, 6, 0, 6603, 0, 0),
+(7, 6, 1, 49576, 0, 0),
+(7, 6, 2, 45477, 0, 0),
+(7, 6, 3, 45462, 0, 0),
+(7, 6, 4, 45902, 0, 0),
+(7, 6, 5, 47541, 0, 0),
+(7, 6, 10, 20589, 0, 0),
+(7, 6, 72, 6603, 0, 0),
+(7, 6, 83, 117, 128, 0),
+(7, 6, 84, 6603, 0, 0),
+(7, 6, 96, 6603, 0, 0),
+(7, 6, 108, 6603, 0, 0),
+(7, 8, 11, 4536, 128, 0),
+(7, 8, 1, 133, 0, 0),
+(7, 8, 2, 168, 0, 0),
+(7, 8, 10, 159, 128, 0),
+(7, 8, 0, 6603, 0, 0),
+(7, 9, 11, 4604, 128, 0),
+(7, 9, 1, 686, 0, 0),
+(7, 9, 2, 687, 0, 0),
+(7, 9, 10, 159, 128, 0),
+(7, 9, 0, 6603, 0, 0),
+(8, 1, 11, 117, 128, 0),
+(8, 1, 1, 78, 0, 0),
+(8, 1, 3, 2764, 0, 0),
+(8, 1, 0, 6603, 0, 0),
+(8, 3, 10, 159, 128, 0),
+(8, 3, 11, 4604, 128, 0),
+(8, 3, 1, 2973, 0, 0),
+(8, 3, 2, 75, 0, 0),
+(8, 3, 0, 6603, 0, 0),
+(8, 4, 1, 1752, 0, 0),
+(8, 4, 3, 2764, 0, 0),
+(8, 4, 2, 2098, 0, 0),
+(8, 4, 11, 117, 128, 0),
+(8, 4, 0, 6603, 0, 0),
+(8, 5, 1, 585, 0, 0),
+(8, 5, 10, 159, 128, 0),
+(8, 5, 2, 2050, 0, 0),
+(8, 5, 11, 4540, 128, 0),
+(8, 5, 0, 6603, 0, 0),
+(8, 6, 0, 6603, 0, 0),
+(8, 6, 1, 49576, 0, 0),
+(8, 6, 2, 45477, 0, 0),
+(8, 6, 3, 45462, 0, 0),
+(8, 6, 4, 45902, 0, 0),
+(8, 6, 5, 47541, 0, 0),
+(8, 6, 10, 50621, 0, 0),
+(8, 7, 1, 403, 0, 0),
+(8, 7, 10, 159, 128, 0),
+(8, 7, 2, 331, 0, 0),
+(8, 7, 11, 117, 128, 0),
+(8, 7, 0, 6603, 0, 0),
+(8, 8, 1, 133, 0, 0),
+(8, 8, 10, 159, 128, 0),
+(8, 8, 2, 168, 0, 0),
+(8, 8, 11, 117, 128, 0),
+(8, 8, 0, 6603, 0, 0),
+(10, 2, 0, 6603, 0, 0),
+(10, 2, 1, 21084, 0, 0),
+(10, 2, 2, 635, 0, 0),
+(10, 2, 3, 28734, 0, 0),
+(10, 2, 4, 28730, 0, 0),
+(10, 2, 10, 159, 128, 0),
+(10, 2, 11, 20857, 128, 0),
+(10, 3, 0, 6603, 0, 0),
+(10, 3, 1, 2973, 0, 0),
+(10, 3, 2, 75, 0, 0),
+(10, 3, 3, 28734, 0, 0),
+(10, 3, 4, 28730, 0, 0),
+(10, 3, 10, 159, 128, 0),
+(10, 3, 11, 20857, 128, 0),
+(10, 4, 0, 6603, 0, 0),
+(10, 4, 1, 1752, 0, 0),
+(10, 4, 2, 2098, 0, 0),
+(10, 4, 3, 2764, 0, 0),
+(10, 4, 4, 28734, 0, 0),
+(10, 4, 5, 25046, 0, 0),
+(10, 4, 11, 20857, 128, 0),
+(10, 5, 0, 6603, 0, 0),
+(10, 5, 1, 585, 0, 0),
+(10, 5, 2, 2050, 0, 0),
+(10, 5, 3, 28734, 0, 0),
+(10, 5, 4, 28730, 0, 0),
+(10, 5, 10, 159, 128, 0),
+(10, 5, 11, 20857, 128, 0),
+(10, 6, 0, 6603, 0, 0),
+(10, 6, 1, 49576, 0, 0),
+(10, 6, 2, 45477, 0, 0),
+(10, 6, 3, 45462, 0, 0),
+(10, 6, 4, 45902, 0, 0),
+(10, 6, 5, 47541, 0, 0),
+(10, 6, 6, 50613, 0, 0),
+(10, 8, 0, 6603, 0, 0),
+(10, 8, 1, 133, 0, 0),
+(10, 8, 2, 168, 0, 0),
+(10, 8, 3, 28734, 0, 0),
+(10, 8, 4, 28730, 0, 0),
+(10, 8, 10, 159, 128, 0),
+(10, 8, 11, 20857, 128, 0),
+(10, 9, 11, 20857, 128, 0),
+(10, 9, 10, 159, 128, 0),
+(10, 9, 4, 28730, 0, 0),
+(10, 9, 3, 28734, 0, 0),
+(10, 9, 2, 687, 0, 0),
+(10, 9, 1, 686, 0, 0),
+(10, 9, 0, 6603, 0, 0),
+(11, 1, 0, 6603, 0, 0),
+(11, 1, 72, 6603, 0, 0),
+(11, 1, 73, 78, 0, 0),
+(11, 1, 74, 28880, 0, 0),
+(11, 1, 83, 4540, 128, 0),
+(11, 1, 84, 6603, 0, 0),
+(11, 1, 96, 6603, 0, 0),
+(11, 1, 108, 6603, 0, 0),
+(11, 2, 0, 6603, 0, 0),
+(11, 2, 1, 21084, 0, 0),
+(11, 2, 2, 635, 0, 0),
+(11, 2, 3, 59542, 0, 0),
+(11, 2, 10, 159, 128, 0),
+(11, 2, 11, 4540, 128, 0),
+(11, 2, 83, 4540, 128, 0),
+(11, 3, 0, 6603, 0, 0),
+(11, 3, 1, 2973, 0, 0),
+(11, 3, 2, 75, 0, 0),
+(11, 3, 3, 59543, 0, 0),
+(11, 3, 10, 159, 128, 0),
+(11, 3, 11, 4540, 128, 0),
+(11, 3, 72, 6603, 0, 0),
+(11, 3, 73, 2973, 0, 0),
+(11, 3, 74, 75, 0, 0),
+(11, 3, 82, 159, 128, 0),
+(11, 3, 83, 4540, 128, 0),
+(11, 5, 0, 6603, 0, 0),
+(11, 5, 1, 585, 0, 0),
+(11, 5, 2, 2050, 0, 0),
+(11, 5, 3, 59544, 0, 0),
+(11, 5, 10, 159, 128, 0),
+(11, 5, 11, 4540, 128, 0),
+(11, 5, 83, 4540, 128, 0),
+(11, 6, 0, 6603, 0, 0),
+(11, 6, 1, 49576, 0, 0),
+(11, 6, 2, 45477, 0, 0),
+(11, 6, 3, 45462, 0, 0),
+(11, 6, 4, 45902, 0, 0),
+(11, 6, 5, 47541, 0, 0),
+(11, 6, 6, 59545, 0, 0),
+(11, 7, 0, 6603, 0, 0),
+(11, 7, 1, 403, 0, 0),
+(11, 7, 2, 331, 0, 0),
+(11, 7, 3, 59547, 0, 0),
+(11, 7, 10, 159, 128, 0),
+(11, 7, 11, 4540, 128, 0),
+(11, 8, 0, 6603, 0, 0),
+(11, 8, 1, 133, 0, 0),
+(11, 8, 2, 168, 0, 0),
+(11, 8, 3, 59548, 0, 0),
+(11, 8, 10, 159, 128, 0),
+(11, 8, 11, 4540, 128, 0),
+(11, 8, 83, 4540, 128, 0);
+
+-- playercreateinfo_spell
+INSERT IGNORE INTO `playercreateinfo_spell` (`race`, `class`, `Spell`, `Note`) VALUES
+(1, 1, 78, 'Heroic Strike'),
+(1, 1, 81, 'Dodge'),
+(1, 1, 107, 'Block'),
+(1, 1, 196, 'One-Handed Axes'),
+(1, 1, 198, 'One-Handed Maces'),
+(1, 1, 201, 'One-Handed Swords'),
+(1, 1, 203, 'Unarmed'),
+(1, 1, 204, 'Defense'),
+(1, 1, 522, 'SPELLDEFENSE (DND)'),
+(1, 1, 668, 'Language Common'),
+(1, 1, 1843, 'Disarm'),
+(1, 1, 2382, 'Generic'),
+(1, 1, 2457, 'Battle Stance'),
+(1, 1, 2479, 'Honorless Target'),
+(1, 1, 3050, 'Detect'),
+(1, 1, 3365, 'Opening'),
+(1, 1, 5301, 'Defensive State (DND)'),
+(1, 1, 6233, 'Closing'),
+(1, 1, 6246, 'Closing'),
+(1, 1, 6247, 'Opening'),
+(1, 1, 6477, 'Opening'),
+(1, 1, 6478, 'Opening'),
+(1, 1, 6603, 'Attack'),
+(1, 1, 7266, 'Duel'),
+(1, 1, 7267, 'Grovel'),
+(1, 1, 7355, 'Stuck'),
+(1, 1, 8386, 'Attacking'),
+(1, 1, 8737, 'Mail'),
+(1, 1, 9077, 'Leather'),
+(1, 1, 9078, 'Cloth'),
+(1, 1, 9116, 'Shield'),
+(1, 1, 9125, 'Generic'),
+(1, 1, 20597, 'Sword Specialization'),
+(1, 1, 20598, 'The Human Spirit'),
+(1, 1, 20599, 'Diplomacy'),
+(1, 1, 20864, 'Mace Specialization'),
+(1, 1, 21651, 'Opening'),
+(1, 1, 21652, 'Closing'),
+(1, 1, 22027, 'Remove Insignia'),
+(1, 1, 22810, 'Opening - No Text'),
+(1, 1, 32215, 'Victorious State'),
+(1, 1, 45927, 'Summon Friend'),
+(1, 1, 58985, 'Perception'),
+(1, 1, 59752, 'Every Man for Himself'),
+(1, 1, 61437, 'Opening'),
+(1, 2, 81, 'Dodge'),
+(1, 2, 107, 'Block'),
+(1, 2, 198, 'One-Handed Maces'),
+(1, 2, 199, 'Two-Handed Maces'),
+(1, 2, 203, 'Unarmed'),
+(1, 2, 204, 'Defense'),
+(1, 2, 522, 'SPELLDEFENSE (DND)'),
+(1, 2, 635, 'Holy Light'),
+(1, 2, 668, 'Language Common'),
+(1, 2, 1843, 'Disarm'),
+(1, 2, 2382, 'Generic'),
+(1, 2, 2479, 'Honorless Target'),
+(1, 2, 3050, 'Detect'),
+(1, 2, 3365, 'Opening'),
+(1, 2, 6233, 'Closing'),
+(1, 2, 6246, 'Closing'),
+(1, 2, 6247, 'Opening'),
+(1, 2, 6477, 'Opening'),
+(1, 2, 6478, 'Opening'),
+(1, 2, 6603, 'Attack'),
+(1, 2, 7266, 'Duel'),
+(1, 2, 7267, 'Grovel'),
+(1, 2, 7355, 'Stuck'),
+(1, 2, 8386, 'Attacking'),
+(1, 2, 8737, 'Mail'),
+(1, 2, 9077, 'Leather'),
+(1, 2, 9078, 'Cloth'),
+(1, 2, 9116, 'Shield'),
+(1, 2, 9125, 'Generic'),
+(1, 2, 20154, 'Seal of Righteousness'),
+(1, 2, 20597, 'Sword Specialization'),
+(1, 2, 20598, 'The Human Spirit'),
+(1, 2, 20599, 'Diplomacy'),
+(1, 2, 20864, 'Mace Specialization'),
+(1, 2, 21651, 'Opening'),
+(1, 2, 21652, 'Closing'),
+(1, 2, 22027, 'Remove Insignia'),
+(1, 2, 22810, 'Opening - No Text'),
+(1, 2, 27762, 'Libram'),
+(1, 2, 45927, 'Summon Friend'),
+(1, 2, 58985, 'Perception'),
+(1, 2, 59752, 'Every Man for Himself'),
+(1, 2, 61437, 'Opening'),
+(1, 4, 81, 'Dodge'),
+(1, 4, 203, 'Unarmed'),
+(1, 4, 204, 'Defense'),
+(1, 4, 522, 'SPELLDEFENSE (DND)'),
+(1, 4, 668, 'Language Common'),
+(1, 4, 1180, 'Daggers'),
+(1, 4, 1752, 'Sinister Strike'),
+(1, 4, 1843, 'Disarm'),
+(1, 4, 2098, 'Eviscerate'),
+(1, 4, 2382, 'Generic'),
+(1, 4, 2479, 'Honorless Target'),
+(1, 4, 2567, 'Thrown'),
+(1, 4, 2764, 'Throw'),
+(1, 4, 3050, 'Detect'),
+(1, 4, 3365, 'Opening'),
+(1, 4, 6233, 'Closing'),
+(1, 4, 6246, 'Closing'),
+(1, 4, 6247, 'Opening'),
+(1, 4, 6477, 'Opening'),
+(1, 4, 6478, 'Opening'),
+(1, 4, 6603, 'Attack'),
+(1, 4, 7266, 'Duel'),
+(1, 4, 7267, 'Grovel'),
+(1, 4, 7355, 'Stuck'),
+(1, 4, 8386, 'Attacking'),
+(1, 4, 9077, 'Leather'),
+(1, 4, 9078, 'Cloth'),
+(1, 4, 9125, 'Generic'),
+(1, 4, 16092, 'Defensive State (DND)'),
+(1, 4, 20597, 'Sword Specialization'),
+(1, 4, 20598, 'The Human Spirit'),
+(1, 4, 20599, 'Diplomacy'),
+(1, 4, 20864, 'Mace Specialization'),
+(1, 4, 21184, 'Rogue Passive (DND)'),
+(1, 4, 21651, 'Opening'),
+(1, 4, 21652, 'Closing'),
+(1, 4, 22027, 'Remove Insignia'),
+(1, 4, 22810, 'Opening - No Text'),
+(1, 4, 45927, 'Summon Friend'),
+(1, 4, 58985, 'Perception'),
+(1, 4, 59752, 'Every Man for Himself'),
+(1, 4, 61437, 'Opening'),
+(1, 5, 81, 'Dodge'),
+(1, 5, 198, 'One-Handed Maces'),
+(1, 5, 203, 'Unarmed'),
+(1, 5, 204, 'Defense'),
+(1, 5, 522, 'SPELLDEFENSE (DND)'),
+(1, 5, 585, 'Smite'),
+(1, 5, 668, 'Language Common'),
+(1, 5, 1843, 'Disarm'),
+(1, 5, 2050, 'Lesser Heal'),
+(1, 5, 2382, 'Generic'),
+(1, 5, 2479, 'Honorless Target'),
+(1, 5, 3050, 'Detect'),
+(1, 5, 3365, 'Opening'),
+(1, 5, 5009, 'Wands'),
+(1, 5, 5019, 'Shoot'),
+(1, 5, 6233, 'Closing'),
+(1, 5, 6246, 'Closing'),
+(1, 5, 6247, 'Opening'),
+(1, 5, 6477, 'Opening'),
+(1, 5, 6478, 'Opening'),
+(1, 5, 6603, 'Attack'),
+(1, 5, 7266, 'Duel'),
+(1, 5, 7267, 'Grovel'),
+(1, 5, 7355, 'Stuck'),
+(1, 5, 8386, 'Attacking'),
+(1, 5, 9078, 'Cloth'),
+(1, 5, 9125, 'Generic'),
+(1, 5, 20597, 'Sword Specialization'),
+(1, 5, 20598, 'The Human Spirit'),
+(1, 5, 20599, 'Diplomacy'),
+(1, 5, 20864, 'Mace Specialization'),
+(1, 5, 21651, 'Opening'),
+(1, 5, 21652, 'Closing'),
+(1, 5, 22027, 'Remove Insignia'),
+(1, 5, 22810, 'Opening - No Text'),
+(1, 5, 45927, 'Summon Friend'),
+(1, 5, 58985, 'Perception'),
+(1, 5, 59752, 'Every Man for Himself'),
+(1, 5, 61437, 'Opening'),
+(1, 6, 81, 'Dodge'),
+(1, 6, 196, 'One-Handed Axes'),
+(1, 6, 197, 'Two-Handed Axes'),
+(1, 6, 200, 'Polearms'),
+(1, 6, 201, 'One-Handed Swords'),
+(1, 6, 202, 'Two-Handed Swords'),
+(1, 6, 203, 'Unarmed'),
+(1, 6, 204, 'Defense'),
+(1, 6, 522, 'SPELLDEFENSE (DND)'),
+(1, 6, 668, 'Language Common'),
+(1, 6, 674, 'Dual Wield'),
+(1, 6, 750, 'Plate Mail'),
+(1, 6, 1843, 'Disarm'),
+(1, 6, 2382, 'Generic'),
+(1, 6, 2479, 'Honorless Target'),
+(1, 6, 3050, 'Detect'),
+(1, 6, 3127, 'Parry'),
+(1, 6, 3275, 'Linen Bandage'),
+(1, 6, 3276, 'Heavy Linen Bandage'),
+(1, 6, 3277, 'Wool Bandage'),
+(1, 6, 3278, 'Heavy Wool Bandage'),
+(1, 6, 3365, 'Opening'),
+(1, 6, 6233, 'Closing'),
+(1, 6, 6246, 'Closing'),
+(1, 6, 6247, 'Opening'),
+(1, 6, 6477, 'Opening'),
+(1, 6, 6478, 'Opening'),
+(1, 6, 6603, 'Attack'),
+(1, 6, 7266, 'Duel'),
+(1, 6, 7267, 'Grovel'),
+(1, 6, 7355, 'Stuck'),
+(1, 6, 7928, 'Silk Bandage'),
+(1, 6, 7929, 'Heavy Silk Bandage'),
+(1, 6, 7934, 'Anti-Venom'),
+(1, 6, 8386, 'Attacking'),
+(1, 6, 8737, 'Mail'),
+(1, 6, 9077, 'Leather'),
+(1, 6, 9078, 'Cloth'),
+(1, 6, 9125, 'Generic'),
+(1, 6, 10840, 'Mageweave Bandage'),
+(1, 6, 10841, 'Heavy Mageweave Bandage'),
+(1, 6, 10846, 'First Aid'),
+(1, 6, 18629, 'Runecloth Bandage'),
+(1, 6, 18630, 'Heavy Runecloth Bandage'),
+(1, 6, 20597, 'Sword Specialization'),
+(1, 6, 20598, 'The Human Spirit'),
+(1, 6, 20599, 'Diplomacy'),
+(1, 6, 20864, 'Mace Specialization'),
+(1, 6, 21651, 'Opening'),
+(1, 6, 21652, 'Closing'),
+(1, 6, 22027, 'Remove Insignia'),
+(1, 6, 22810, 'Opening - No Text'),
+(1, 6, 33391, 'Journeyman Riding'),
+(1, 6, 45462, 'Plague Strike'),
+(1, 6, 45477, 'Icy Touch'),
+(1, 6, 45902, 'Blood Strike'),
+(1, 6, 45903, 'Offensive State (DND)'),
+(1, 6, 45927, 'Summon Friend'),
+(1, 6, 47541, 'Death Coil'),
+(1, 6, 48266, 'Blood Presence'),
+(1, 6, 49410, 'Forceful Deflection'),
+(1, 6, 49576, 'Death Grip'),
+(1, 6, 52665, 'Sigil'),
+(1, 6, 58985, 'Perception'),
+(1, 6, 59752, 'Every Man for Himself'),
+(1, 6, 59879, 'Blood Plague'),
+(1, 6, 59921, 'Frost Fever'),
+(1, 6, 61437, 'Opening'),
+(1, 6, 61455, 'Runic Focus'),
+(1, 8, 81, 'Dodge'),
+(1, 8, 133, 'Fireball'),
+(1, 8, 168, 'Frost Armor'),
+(1, 8, 203, 'Unarmed'),
+(1, 8, 204, 'Defense'),
+(1, 8, 227, 'Staves'),
+(1, 8, 522, 'SPELLDEFENSE (DND)'),
+(1, 8, 668, 'Language Common'),
+(1, 8, 1843, 'Disarm'),
+(1, 8, 2382, 'Generic'),
+(1, 8, 2479, 'Honorless Target'),
+(1, 8, 3050, 'Detect'),
+(1, 8, 3365, 'Opening'),
+(1, 8, 5009, 'Wands'),
+(1, 8, 5019, 'Shoot'),
+(1, 8, 6233, 'Closing'),
+(1, 8, 6246, 'Closing'),
+(1, 8, 6247, 'Opening'),
+(1, 8, 6477, 'Opening'),
+(1, 8, 6478, 'Opening'),
+(1, 8, 6603, 'Attack'),
+(1, 8, 7266, 'Duel'),
+(1, 8, 7267, 'Grovel'),
+(1, 8, 7355, 'Stuck'),
+(1, 8, 8386, 'Attacking'),
+(1, 8, 9078, 'Cloth'),
+(1, 8, 9125, 'Generic'),
+(1, 8, 20597, 'Sword Specialization'),
+(1, 8, 20598, 'The Human Spirit'),
+(1, 8, 20599, 'Diplomacy'),
+(1, 8, 20864, 'Mace Specialization'),
+(1, 8, 21651, 'Opening'),
+(1, 8, 21652, 'Closing'),
+(1, 8, 22027, 'Remove Insignia'),
+(1, 8, 22810, 'Opening - No Text'),
+(1, 8, 45927, 'Summon Friend'),
+(1, 8, 58985, 'Perception'),
+(1, 8, 59752, 'Every Man for Himself'),
+(1, 8, 61437, 'Opening'),
+(1, 9, 81, 'Dodge'),
+(1, 9, 203, 'Unarmed'),
+(1, 9, 204, 'Defense'),
+(1, 9, 522, 'SPELLDEFENSE (DND)'),
+(1, 9, 668, 'Language Common'),
+(1, 9, 686, 'Shadow Bolt'),
+(1, 9, 687, 'Demon Skin'),
+(1, 9, 1180, 'Daggers'),
+(1, 9, 1843, 'Disarm'),
+(1, 9, 2382, 'Generic'),
+(1, 9, 2479, 'Honorless Target'),
+(1, 9, 3050, 'Detect'),
+(1, 9, 3365, 'Opening'),
+(1, 9, 5009, 'Wands'),
+(1, 9, 5019, 'Shoot'),
+(1, 9, 6233, 'Closing'),
+(1, 9, 6246, 'Closing'),
+(1, 9, 6247, 'Opening'),
+(1, 9, 6477, 'Opening'),
+(1, 9, 6478, 'Opening'),
+(1, 9, 6603, 'Attack'),
+(1, 9, 7266, 'Duel'),
+(1, 9, 7267, 'Grovel'),
+(1, 9, 7355, 'Stuck'),
+(1, 9, 8386, 'Attacking'),
+(1, 9, 9078, 'Cloth'),
+(1, 9, 9125, 'Generic'),
+(1, 9, 20597, 'Sword Specialization'),
+(1, 9, 20598, 'The Human Spirit'),
+(1, 9, 20599, 'Diplomacy'),
+(1, 9, 20864, 'Mace Specialization'),
+(1, 9, 21651, 'Opening'),
+(1, 9, 21652, 'Closing'),
+(1, 9, 22027, 'Remove Insignia'),
+(1, 9, 22810, 'Opening - No Text'),
+(1, 9, 45927, 'Summon Friend'),
+(1, 9, 58284, 'Chaos Bolt Passive'),
+(1, 9, 58985, 'Perception'),
+(1, 9, 59752, 'Every Man for Himself'),
+(1, 9, 61437, 'Opening'),
+(2, 1, 78, 'Heroic Strike'),
+(2, 1, 81, 'Dodge'),
+(2, 1, 107, 'Block'),
+(2, 1, 196, 'One-Handed Axes'),
+(2, 1, 197, 'Two-Handed Axes'),
+(2, 1, 201, 'One-Handed Swords'),
+(2, 1, 203, 'Unarmed'),
+(2, 1, 204, 'Defense'),
+(2, 1, 522, 'SPELLDEFENSE (DND)'),
+(2, 1, 669, 'Language Orcish'),
+(2, 1, 1843, 'Disarm'),
+(2, 1, 2382, 'Generic'),
+(2, 1, 2457, 'Battle Stance'),
+(2, 1, 2479, 'Honorless Target'),
+(2, 1, 3050, 'Detect'),
+(2, 1, 3365, 'Opening'),
+(2, 1, 5301, 'Defensive State (DND)'),
+(2, 1, 6233, 'Closing'),
+(2, 1, 6246, 'Closing'),
+(2, 1, 6247, 'Opening'),
+(2, 1, 6477, 'Opening'),
+(2, 1, 6478, 'Opening'),
+(2, 1, 6603, 'Attack'),
+(2, 1, 7266, 'Duel'),
+(2, 1, 7267, 'Grovel'),
+(2, 1, 7355, 'Stuck'),
+(2, 1, 8386, 'Attacking'),
+(2, 1, 8737, 'Mail'),
+(2, 1, 9077, 'Leather'),
+(2, 1, 9078, 'Cloth'),
+(2, 1, 9116, 'Shield'),
+(2, 1, 9125, 'Generic'),
+(2, 1, 20572, 'Blood Fury'),
+(2, 1, 20573, 'Hardiness'),
+(2, 1, 20574, 'Axe Specialization'),
+(2, 1, 21563, 'Command'),
+(2, 1, 21651, 'Opening'),
+(2, 1, 21652, 'Closing'),
+(2, 1, 22027, 'Remove Insignia'),
+(2, 1, 22810, 'Opening - No Text'),
+(2, 1, 32215, 'Victorious State'),
+(2, 1, 45927, 'Summon Friend'),
+(2, 1, 61437, 'Opening'),
+(2, 3, 75, 'Auto Shot'),
+(2, 3, 81, 'Dodge'),
+(2, 3, 196, 'One-Handed Axes'),
+(2, 3, 203, 'Unarmed'),
+(2, 3, 204, 'Defense'),
+(2, 3, 264, 'Bows'),
+(2, 3, 522, 'SPELLDEFENSE (DND)'),
+(2, 3, 669, 'Language Orcish'),
+(2, 3, 1843, 'Disarm'),
+(2, 3, 2382, 'Generic'),
+(2, 3, 2479, 'Honorless Target'),
+(2, 3, 2973, 'Raptor Strike'),
+(2, 3, 3050, 'Detect'),
+(2, 3, 3365, 'Opening'),
+(2, 3, 6233, 'Closing'),
+(2, 3, 6246, 'Closing'),
+(2, 3, 6247, 'Opening'),
+(2, 3, 6477, 'Opening'),
+(2, 3, 6478, 'Opening'),
+(2, 3, 6603, 'Attack'),
+(2, 3, 7266, 'Duel'),
+(2, 3, 7267, 'Grovel'),
+(2, 3, 7355, 'Stuck'),
+(2, 3, 8386, 'Attacking'),
+(2, 3, 9077, 'Leather'),
+(2, 3, 9078, 'Cloth'),
+(2, 3, 9125, 'Generic'),
+(2, 3, 13358, 'Defensive State (DND)'),
+(2, 3, 20572, 'Blood Fury'),
+(2, 3, 20573, 'Hardiness'),
+(2, 3, 20574, 'Axe Specialization'),
+(2, 3, 20576, 'Command'),
+(2, 3, 21651, 'Opening'),
+(2, 3, 21652, 'Closing'),
+(2, 3, 22027, 'Remove Insignia'),
+(2, 3, 22810, 'Opening - No Text'),
+(2, 3, 24949, 'Defensive State 2 (DND)'),
+(2, 3, 34082, 'Advantaged State (DND)'),
+(2, 3, 45927, 'Summon Friend'),
+(2, 3, 61437, 'Opening'),
+(2, 4, 81, 'Dodge'),
+(2, 4, 203, 'Unarmed'),
+(2, 4, 204, 'Defense'),
+(2, 4, 522, 'SPELLDEFENSE (DND)'),
+(2, 4, 669, 'Language Orcish'),
+(2, 4, 1180, 'Daggers'),
+(2, 4, 1752, 'Sinister Strike'),
+(2, 4, 1843, 'Disarm'),
+(2, 4, 2098, 'Eviscerate'),
+(2, 4, 2382, 'Generic'),
+(2, 4, 2479, 'Honorless Target'),
+(2, 4, 2567, 'Thrown'),
+(2, 4, 2764, 'Throw'),
+(2, 4, 3050, 'Detect'),
+(2, 4, 3365, 'Opening'),
+(2, 4, 6233, 'Closing'),
+(2, 4, 6246, 'Closing'),
+(2, 4, 6247, 'Opening'),
+(2, 4, 6477, 'Opening'),
+(2, 4, 6478, 'Opening'),
+(2, 4, 6603, 'Attack'),
+(2, 4, 7266, 'Duel'),
+(2, 4, 7267, 'Grovel'),
+(2, 4, 7355, 'Stuck'),
+(2, 4, 8386, 'Attacking'),
+(2, 4, 9077, 'Leather'),
+(2, 4, 9078, 'Cloth'),
+(2, 4, 9125, 'Generic'),
+(2, 4, 16092, 'Defensive State (DND)'),
+(2, 4, 20572, 'Blood Fury'),
+(2, 4, 20573, 'Hardiness'),
+(2, 4, 20574, 'Axe Specialization'),
+(2, 4, 21184, 'Rogue Passive (DND)'),
+(2, 4, 21563, 'Command'),
+(2, 4, 21651, 'Opening'),
+(2, 4, 21652, 'Closing'),
+(2, 4, 22027, 'Remove Insignia'),
+(2, 4, 22810, 'Opening - No Text'),
+(2, 4, 45927, 'Summon Friend'),
+(2, 4, 61437, 'Opening'),
+(2, 6, 81, 'Dodge'),
+(2, 6, 196, 'One-Handed Axes'),
+(2, 6, 197, 'Two-Handed Axes'),
+(2, 6, 200, 'Polearms'),
+(2, 6, 201, 'One-Handed Swords'),
+(2, 6, 202, 'Two-Handed Swords'),
+(2, 6, 203, 'Unarmed'),
+(2, 6, 204, 'Defense'),
+(2, 6, 522, 'SPELLDEFENSE (DND)'),
+(2, 6, 669, 'Language Orcish'),
+(2, 6, 674, 'Dual Wield'),
+(2, 6, 750, 'Plate Mail'),
+(2, 6, 1843, 'Disarm'),
+(2, 6, 2382, 'Generic'),
+(2, 6, 2479, 'Honorless Target'),
+(2, 6, 3050, 'Detect'),
+(2, 6, 3127, 'Parry'),
+(2, 6, 3275, 'Linen Bandage'),
+(2, 6, 3276, 'Heavy Linen Bandage'),
+(2, 6, 3277, 'Wool Bandage'),
+(2, 6, 3278, 'Heavy Wool Bandage'),
+(2, 6, 3365, 'Opening'),
+(2, 6, 6233, 'Closing'),
+(2, 6, 6246, 'Closing'),
+(2, 6, 6247, 'Opening'),
+(2, 6, 6477, 'Opening'),
+(2, 6, 6478, 'Opening'),
+(2, 6, 6603, 'Attack'),
+(2, 6, 7266, 'Duel'),
+(2, 6, 7267, 'Grovel'),
+(2, 6, 7355, 'Stuck'),
+(2, 6, 7928, 'Silk Bandage'),
+(2, 6, 7929, 'Heavy Silk Bandage'),
+(2, 6, 7934, 'Anti-Venom'),
+(2, 6, 8386, 'Attacking'),
+(2, 6, 8737, 'Mail'),
+(2, 6, 9077, 'Leather'),
+(2, 6, 9078, 'Cloth'),
+(2, 6, 9125, 'Generic'),
+(2, 6, 10840, 'Mageweave Bandage'),
+(2, 6, 10841, 'Heavy Mageweave Bandage'),
+(2, 6, 10846, 'First Aid'),
+(2, 6, 18629, 'Runecloth Bandage'),
+(2, 6, 18630, 'Heavy Runecloth Bandage'),
+(2, 6, 20572, 'Blood Fury'),
+(2, 6, 20573, 'Hardiness'),
+(2, 6, 20574, 'Axe Specialization'),
+(2, 6, 21651, 'Opening'),
+(2, 6, 21652, 'Closing'),
+(2, 6, 22027, 'Remove Insignia'),
+(2, 6, 22810, 'Opening - No Text'),
+(2, 6, 33391, 'Journeyman Riding'),
+(2, 6, 45462, 'Plague Strike'),
+(2, 6, 45477, 'Icy Touch'),
+(2, 6, 45902, 'Blood Strike'),
+(2, 6, 45903, 'Offensive State (DND)'),
+(2, 6, 45927, 'Summon Friend'),
+(2, 6, 47541, 'Death Coil'),
+(2, 6, 48266, 'Blood Presence'),
+(2, 6, 49410, 'Forceful Deflection'),
+(2, 6, 49576, 'Death Grip'),
+(2, 6, 52665, 'Sigil'),
+(2, 6, 54562, 'Command'),
+(2, 6, 59879, 'Blood Plague'),
+(2, 6, 59921, 'Frost Fever'),
+(2, 6, 61437, 'Opening'),
+(2, 6, 61455, 'Runic Focus'),
+(2, 7, 81, 'Dodge'),
+(2, 7, 107, 'Block'),
+(2, 7, 198, 'One-Handed Maces'),
+(2, 7, 203, 'Unarmed'),
+(2, 7, 204, 'Defense'),
+(2, 7, 227, 'Staves'),
+(2, 7, 331, 'Healing Wave'),
+(2, 7, 403, 'Lightning Bolt'),
+(2, 7, 522, 'SPELLDEFENSE (DND)'),
+(2, 7, 669, 'Language Orcish'),
+(2, 7, 1843, 'Disarm'),
+(2, 7, 2382, 'Generic'),
+(2, 7, 2479, 'Honorless Target'),
+(2, 7, 3050, 'Detect'),
+(2, 7, 3365, 'Opening'),
+(2, 7, 6233, 'Closing'),
+(2, 7, 6246, 'Closing'),
+(2, 7, 6247, 'Opening'),
+(2, 7, 6477, 'Opening'),
+(2, 7, 6478, 'Opening'),
+(2, 7, 6603, 'Attack'),
+(2, 7, 7266, 'Duel'),
+(2, 7, 7267, 'Grovel'),
+(2, 7, 7355, 'Stuck'),
+(2, 7, 8386, 'Attacking'),
+(2, 7, 9077, 'Leather'),
+(2, 7, 9078, 'Cloth'),
+(2, 7, 9116, 'Shield'),
+(2, 7, 9125, 'Generic'),
+(2, 7, 20573, 'Hardiness'),
+(2, 7, 20574, 'Axe Specialization'),
+(2, 7, 21563, 'Command'),
+(2, 7, 21651, 'Opening'),
+(2, 7, 21652, 'Closing'),
+(2, 7, 22027, 'Remove Insignia'),
+(2, 7, 22810, 'Opening - No Text'),
+(2, 7, 27763, 'Totem'),
+(2, 7, 33697, 'Blood Fury'),
+(2, 7, 45927, 'Summon Friend'),
+(2, 7, 61437, 'Opening'),
+(2, 9, 81, 'Dodge'),
+(2, 9, 203, 'Unarmed'),
+(2, 9, 204, 'Defense'),
+(2, 9, 522, 'SPELLDEFENSE (DND)'),
+(2, 9, 669, 'Language Orcish'),
+(2, 9, 686, 'Shadow Bolt'),
+(2, 9, 687, 'Demon Skin'),
+(2, 9, 1180, 'Daggers'),
+(2, 9, 1843, 'Disarm'),
+(2, 9, 2382, 'Generic'),
+(2, 9, 2479, 'Honorless Target'),
+(2, 9, 3050, 'Detect'),
+(2, 9, 3365, 'Opening'),
+(2, 9, 5009, 'Wands'),
+(2, 9, 5019, 'Shoot'),
+(2, 9, 6233, 'Closing'),
+(2, 9, 6246, 'Closing'),
+(2, 9, 6247, 'Opening'),
+(2, 9, 6477, 'Opening'),
+(2, 9, 6478, 'Opening'),
+(2, 9, 6603, 'Attack'),
+(2, 9, 7266, 'Duel'),
+(2, 9, 7267, 'Grovel'),
+(2, 9, 7355, 'Stuck'),
+(2, 9, 8386, 'Attacking'),
+(2, 9, 9078, 'Cloth'),
+(2, 9, 9125, 'Generic'),
+(2, 9, 20573, 'Hardiness'),
+(2, 9, 20574, 'Axe Specialization'),
+(2, 9, 20575, 'Command'),
+(2, 9, 21651, 'Opening'),
+(2, 9, 21652, 'Closing'),
+(2, 9, 22027, 'Remove Insignia'),
+(2, 9, 22810, 'Opening - No Text'),
+(2, 9, 33702, 'Blood Fury'),
+(2, 9, 45927, 'Summon Friend'),
+(2, 9, 58284, 'Chaos Bolt Passive'),
+(2, 9, 61437, 'Opening'),
+(3, 1, 78, 'Heroic Strike'),
+(3, 1, 81, 'Dodge'),
+(3, 1, 107, 'Block'),
+(3, 1, 196, 'One-Handed Axes'),
+(3, 1, 197, 'Two-Handed Axes'),
+(3, 1, 198, 'One-Handed Maces'),
+(3, 1, 203, 'Unarmed'),
+(3, 1, 204, 'Defense'),
+(3, 1, 522, 'SPELLDEFENSE (DND)'),
+(3, 1, 668, 'Language Common'),
+(3, 1, 672, 'Language Dwarven'),
+(3, 1, 1843, 'Disarm'),
+(3, 1, 2382, 'Generic'),
+(3, 1, 2457, 'Battle Stance'),
+(3, 1, 2479, 'Honorless Target'),
+(3, 1, 2481, 'Find Treasure'),
+(3, 1, 3050, 'Detect'),
+(3, 1, 3365, 'Opening'),
+(3, 1, 5301, 'Defensive State (DND)'),
+(3, 1, 6233, 'Closing'),
+(3, 1, 6246, 'Closing'),
+(3, 1, 6247, 'Opening'),
+(3, 1, 6477, 'Opening'),
+(3, 1, 6478, 'Opening'),
+(3, 1, 6603, 'Attack'),
+(3, 1, 7266, 'Duel'),
+(3, 1, 7267, 'Grovel'),
+(3, 1, 7355, 'Stuck'),
+(3, 1, 8386, 'Attacking'),
+(3, 1, 8737, 'Mail'),
+(3, 1, 9077, 'Leather'),
+(3, 1, 9078, 'Cloth'),
+(3, 1, 9116, 'Shield'),
+(3, 1, 9125, 'Generic'),
+(3, 1, 20594, 'Stoneform'),
+(3, 1, 20595, 'Gun Specialization'),
+(3, 1, 20596, 'Frost Resistance'),
+(3, 1, 21651, 'Opening'),
+(3, 1, 21652, 'Closing'),
+(3, 1, 22027, 'Remove Insignia'),
+(3, 1, 22810, 'Opening - No Text'),
+(3, 1, 32215, 'Victorious State'),
+(3, 1, 45927, 'Summon Friend'),
+(3, 1, 59224, 'Mace Specialization'),
+(3, 1, 61437, 'Opening'),
+(3, 2, 81, 'Dodge'),
+(3, 2, 107, 'Block'),
+(3, 2, 198, 'One-Handed Maces'),
+(3, 2, 199, 'Two-Handed Maces'),
+(3, 2, 203, 'Unarmed'),
+(3, 2, 204, 'Defense'),
+(3, 2, 522, 'SPELLDEFENSE (DND)'),
+(3, 2, 635, 'Holy Light'),
+(3, 2, 668, 'Language Common'),
+(3, 2, 672, 'Language Dwarven'),
+(3, 2, 1843, 'Disarm'),
+(3, 2, 2382, 'Generic'),
+(3, 2, 2479, 'Honorless Target'),
+(3, 2, 2481, 'Find Treasure'),
+(3, 2, 3050, 'Detect'),
+(3, 2, 3365, 'Opening'),
+(3, 2, 6233, 'Closing'),
+(3, 2, 6246, 'Closing'),
+(3, 2, 6247, 'Opening'),
+(3, 2, 6477, 'Opening'),
+(3, 2, 6478, 'Opening'),
+(3, 2, 6603, 'Attack'),
+(3, 2, 7266, 'Duel'),
+(3, 2, 7267, 'Grovel'),
+(3, 2, 7355, 'Stuck'),
+(3, 2, 8386, 'Attacking'),
+(3, 2, 8737, 'Mail'),
+(3, 2, 9077, 'Leather'),
+(3, 2, 9078, 'Cloth'),
+(3, 2, 9116, 'Shield'),
+(3, 2, 9125, 'Generic'),
+(3, 2, 20154, 'Seal of Righteousness'),
+(3, 2, 20594, 'Stoneform'),
+(3, 2, 20595, 'Gun Specialization'),
+(3, 2, 20596, 'Frost Resistance'),
+(3, 2, 21651, 'Opening'),
+(3, 2, 21652, 'Closing'),
+(3, 2, 22027, 'Remove Insignia'),
+(3, 2, 22810, 'Opening - No Text'),
+(3, 2, 27762, 'Libram'),
+(3, 2, 45927, 'Summon Friend'),
+(3, 2, 59224, 'Mace Specialization'),
+(3, 2, 61437, 'Opening'),
+(3, 3, 75, 'Auto Shot'),
+(3, 3, 81, 'Dodge'),
+(3, 3, 196, 'One-Handed Axes'),
+(3, 3, 203, 'Unarmed'),
+(3, 3, 204, 'Defense'),
+(3, 3, 266, 'Guns'),
+(3, 3, 522, 'SPELLDEFENSE (DND)'),
+(3, 3, 668, 'Language Common'),
+(3, 3, 672, 'Language Dwarven'),
+(3, 3, 1843, 'Disarm'),
+(3, 3, 2382, 'Generic'),
+(3, 3, 2479, 'Honorless Target'),
+(3, 3, 2481, 'Find Treasure'),
+(3, 3, 2973, 'Raptor Strike'),
+(3, 3, 3050, 'Detect'),
+(3, 3, 3365, 'Opening'),
+(3, 3, 6233, 'Closing'),
+(3, 3, 6246, 'Closing'),
+(3, 3, 6247, 'Opening'),
+(3, 3, 6477, 'Opening'),
+(3, 3, 6478, 'Opening'),
+(3, 3, 6603, 'Attack'),
+(3, 3, 7266, 'Duel'),
+(3, 3, 7267, 'Grovel'),
+(3, 3, 7355, 'Stuck'),
+(3, 3, 8386, 'Attacking'),
+(3, 3, 9077, 'Leather'),
+(3, 3, 9078, 'Cloth'),
+(3, 3, 9125, 'Generic'),
+(3, 3, 13358, 'Defensive State (DND)'),
+(3, 3, 20594, 'Stoneform'),
+(3, 3, 20595, 'Gun Specialization'),
+(3, 3, 20596, 'Frost Resistance'),
+(3, 3, 21651, 'Opening'),
+(3, 3, 21652, 'Closing'),
+(3, 3, 22027, 'Remove Insignia'),
+(3, 3, 22810, 'Opening - No Text'),
+(3, 3, 24949, 'Defensive State 2 (DND)'),
+(3, 3, 34082, 'Advantaged State (DND)'),
+(3, 3, 45927, 'Summon Friend'),
+(3, 3, 59224, 'Mace Specialization'),
+(3, 3, 61437, 'Opening'),
+(3, 4, 81, 'Dodge'),
+(3, 4, 203, 'Unarmed'),
+(3, 4, 204, 'Defense'),
+(3, 4, 522, 'SPELLDEFENSE (DND)'),
+(3, 4, 668, 'Language Common'),
+(3, 4, 672, 'Language Dwarven'),
+(3, 4, 1180, 'Daggers'),
+(3, 4, 1752, 'Sinister Strike'),
+(3, 4, 1843, 'Disarm'),
+(3, 4, 2098, 'Eviscerate'),
+(3, 4, 2382, 'Generic'),
+(3, 4, 2479, 'Honorless Target'),
+(3, 4, 2481, 'Find Treasure'),
+(3, 4, 2567, 'Thrown'),
+(3, 4, 2764, 'Throw'),
+(3, 4, 3050, 'Detect'),
+(3, 4, 3365, 'Opening'),
+(3, 4, 6233, 'Closing'),
+(3, 4, 6246, 'Closing'),
+(3, 4, 6247, 'Opening'),
+(3, 4, 6477, 'Opening'),
+(3, 4, 6478, 'Opening'),
+(3, 4, 6603, 'Attack'),
+(3, 4, 7266, 'Duel'),
+(3, 4, 7267, 'Grovel'),
+(3, 4, 7355, 'Stuck'),
+(3, 4, 8386, 'Attacking'),
+(3, 4, 9077, 'Leather'),
+(3, 4, 9078, 'Cloth'),
+(3, 4, 9125, 'Generic'),
+(3, 4, 16092, 'Defensive State (DND)'),
+(3, 4, 20594, 'Stoneform'),
+(3, 4, 20595, 'Gun Specialization'),
+(3, 4, 20596, 'Frost Resistance'),
+(3, 4, 21184, 'Rogue Passive (DND)'),
+(3, 4, 21651, 'Opening'),
+(3, 4, 21652, 'Closing'),
+(3, 4, 22027, 'Remove Insignia'),
+(3, 4, 22810, 'Opening - No Text'),
+(3, 4, 45927, 'Summon Friend'),
+(3, 4, 59224, 'Mace Specialization'),
+(3, 4, 61437, 'Opening'),
+(3, 5, 81, 'Dodge'),
+(3, 5, 198, 'One-Handed Maces'),
+(3, 5, 203, 'Unarmed'),
+(3, 5, 204, 'Defense'),
+(3, 5, 522, 'SPELLDEFENSE (DND)'),
+(3, 5, 585, 'Smite'),
+(3, 5, 668, 'Language Common'),
+(3, 5, 672, 'Language Dwarven'),
+(3, 5, 1843, 'Disarm'),
+(3, 5, 2050, 'Lesser Heal'),
+(3, 5, 2382, 'Generic'),
+(3, 5, 2479, 'Honorless Target'),
+(3, 5, 2481, 'Find Treasure'),
+(3, 5, 3050, 'Detect'),
+(3, 5, 3365, 'Opening'),
+(3, 5, 5009, 'Wands'),
+(3, 5, 5019, 'Shoot'),
+(3, 5, 6233, 'Closing'),
+(3, 5, 6246, 'Closing'),
+(3, 5, 6247, 'Opening'),
+(3, 5, 6477, 'Opening'),
+(3, 5, 6478, 'Opening'),
+(3, 5, 6603, 'Attack'),
+(3, 5, 7266, 'Duel'),
+(3, 5, 7267, 'Grovel'),
+(3, 5, 7355, 'Stuck'),
+(3, 5, 8386, 'Attacking'),
+(3, 5, 9078, 'Cloth'),
+(3, 5, 9125, 'Generic'),
+(3, 5, 20594, 'Stoneform'),
+(3, 5, 20595, 'Gun Specialization'),
+(3, 5, 20596, 'Frost Resistance'),
+(3, 5, 21651, 'Opening'),
+(3, 5, 21652, 'Closing'),
+(3, 5, 22027, 'Remove Insignia'),
+(3, 5, 22810, 'Opening - No Text'),
+(3, 5, 45927, 'Summon Friend'),
+(3, 5, 59224, 'Mace Specialization'),
+(3, 5, 61437, 'Opening'),
+(3, 6, 81, 'Dodge'),
+(3, 6, 196, 'One-Handed Axes'),
+(3, 6, 197, 'Two-Handed Axes'),
+(3, 6, 200, 'Polearms'),
+(3, 6, 201, 'One-Handed Swords'),
+(3, 6, 202, 'Two-Handed Swords'),
+(3, 6, 203, 'Unarmed'),
+(3, 6, 204, 'Defense'),
+(3, 6, 522, 'SPELLDEFENSE (DND)'),
+(3, 6, 668, 'Language Common'),
+(3, 6, 672, 'Language Dwarven'),
+(3, 6, 674, 'Dual Wield'),
+(3, 6, 750, 'Plate Mail'),
+(3, 6, 1843, 'Disarm'),
+(3, 6, 2382, 'Generic'),
+(3, 6, 2479, 'Honorless Target'),
+(3, 6, 2481, 'Find Treasure'),
+(3, 6, 3050, 'Detect'),
+(3, 6, 3127, 'Parry'),
+(3, 6, 3275, 'Linen Bandage'),
+(3, 6, 3276, 'Heavy Linen Bandage'),
+(3, 6, 3277, 'Wool Bandage'),
+(3, 6, 3278, 'Heavy Wool Bandage'),
+(3, 6, 3365, 'Opening'),
+(3, 6, 6233, 'Closing'),
+(3, 6, 6246, 'Closing'),
+(3, 6, 6247, 'Opening'),
+(3, 6, 6477, 'Opening'),
+(3, 6, 6478, 'Opening'),
+(3, 6, 6603, 'Attack'),
+(3, 6, 7266, 'Duel'),
+(3, 6, 7267, 'Grovel'),
+(3, 6, 7355, 'Stuck'),
+(3, 6, 7928, 'Silk Bandage'),
+(3, 6, 7929, 'Heavy Silk Bandage'),
+(3, 6, 7934, 'Anti-Venom'),
+(3, 6, 8386, 'Attacking'),
+(3, 6, 8737, 'Mail'),
+(3, 6, 9077, 'Leather'),
+(3, 6, 9078, 'Cloth'),
+(3, 6, 9125, 'Generic'),
+(3, 6, 10840, 'Mageweave Bandage'),
+(3, 6, 10841, 'Heavy Mageweave Bandage'),
+(3, 6, 10846, 'First Aid'),
+(3, 6, 18629, 'Runecloth Bandage'),
+(3, 6, 18630, 'Heavy Runecloth Bandage'),
+(3, 6, 20594, 'Stoneform'),
+(3, 6, 20595, 'Gun Specialization'),
+(3, 6, 20596, 'Frost Resistance'),
+(3, 6, 21651, 'Opening'),
+(3, 6, 21652, 'Closing'),
+(3, 6, 22027, 'Remove Insignia'),
+(3, 6, 22810, 'Opening - No Text'),
+(3, 6, 33391, 'Journeyman Riding'),
+(3, 6, 45462, 'Plague Strike'),
+(3, 6, 45477, 'Icy Touch'),
+(3, 6, 45902, 'Blood Strike'),
+(3, 6, 45903, 'Offensive State (DND)'),
+(3, 6, 45927, 'Summon Friend'),
+(3, 6, 47541, 'Death Coil'),
+(3, 6, 48266, 'Blood Presence'),
+(3, 6, 49410, 'Forceful Deflection'),
+(3, 6, 49576, 'Death Grip'),
+(3, 6, 52665, 'Sigil'),
+(3, 6, 59224, 'Mace Specialization'),
+(3, 6, 59879, 'Blood Plague'),
+(3, 6, 59921, 'Frost Fever'),
+(3, 6, 61437, 'Opening'),
+(3, 6, 61455, 'Runic Focus'),
+(4, 1, 78, 'Heroic Strike'),
+(4, 1, 81, 'Dodge'),
+(4, 1, 107, 'Block'),
+(4, 1, 198, 'One-Handed Maces'),
+(4, 1, 201, 'One-Handed Swords'),
+(4, 1, 203, 'Unarmed'),
+(4, 1, 204, 'Defense'),
+(4, 1, 522, 'SPELLDEFENSE (DND)'),
+(4, 1, 668, 'Language Common'),
+(4, 1, 671, 'Language Darnassian'),
+(4, 1, 1180, 'Daggers'),
+(4, 1, 1843, 'Disarm'),
+(4, 1, 2382, 'Generic'),
+(4, 1, 2457, 'Battle Stance'),
+(4, 1, 2479, 'Honorless Target'),
+(4, 1, 3050, 'Detect'),
+(4, 1, 3365, 'Opening'),
+(4, 1, 5301, 'Defensive State (DND)'),
+(4, 1, 6233, 'Closing'),
+(4, 1, 6246, 'Closing'),
+(4, 1, 6247, 'Opening'),
+(4, 1, 6477, 'Opening'),
+(4, 1, 6478, 'Opening'),
+(4, 1, 6603, 'Attack'),
+(4, 1, 7266, 'Duel'),
+(4, 1, 7267, 'Grovel'),
+(4, 1, 7355, 'Stuck'),
+(4, 1, 8386, 'Attacking'),
+(4, 1, 8737, 'Mail'),
+(4, 1, 9077, 'Leather'),
+(4, 1, 9078, 'Cloth'),
+(4, 1, 9116, 'Shield'),
+(4, 1, 9125, 'Generic'),
+(4, 1, 20582, 'Quickness'),
+(4, 1, 20583, 'Nature Resistance'),
+(4, 1, 20585, 'Wisp Spirit'),
+(4, 1, 21651, 'Opening'),
+(4, 1, 21652, 'Closing'),
+(4, 1, 22027, 'Remove Insignia'),
+(4, 1, 22810, 'Opening - No Text'),
+(4, 1, 32215, 'Victorious State'),
+(4, 1, 45927, 'Summon Friend'),
+(4, 1, 58984, 'Shadowmelt'),
+(4, 1, 61437, 'Opening'),
+(4, 3, 75, 'Auto Shot'),
+(4, 3, 81, 'Dodge'),
+(4, 3, 203, 'Unarmed'),
+(4, 3, 204, 'Defense'),
+(4, 3, 264, 'Bows'),
+(4, 3, 522, 'SPELLDEFENSE (DND)'),
+(4, 3, 668, 'Language Common'),
+(4, 3, 671, 'Language Darnassian'),
+(4, 3, 1180, 'Daggers'),
+(4, 3, 1843, 'Disarm'),
+(4, 3, 2382, 'Generic'),
+(4, 3, 2479, 'Honorless Target'),
+(4, 3, 2973, 'Raptor Strike'),
+(4, 3, 3050, 'Detect'),
+(4, 3, 3365, 'Opening'),
+(4, 3, 6233, 'Closing'),
+(4, 3, 6246, 'Closing'),
+(4, 3, 6247, 'Opening'),
+(4, 3, 6477, 'Opening'),
+(4, 3, 6478, 'Opening'),
+(4, 3, 6603, 'Attack'),
+(4, 3, 7266, 'Duel'),
+(4, 3, 7267, 'Grovel'),
+(4, 3, 7355, 'Stuck'),
+(4, 3, 8386, 'Attacking'),
+(4, 3, 9077, 'Leather'),
+(4, 3, 9078, 'Cloth'),
+(4, 3, 9125, 'Generic'),
+(4, 3, 13358, 'Defensive State (DND)'),
+(4, 3, 20582, 'Quickness'),
+(4, 3, 20583, 'Nature Resistance'),
+(4, 3, 20585, 'Wisp Spirit'),
+(4, 3, 21651, 'Opening'),
+(4, 3, 21652, 'Closing'),
+(4, 3, 22027, 'Remove Insignia'),
+(4, 3, 22810, 'Opening - No Text'),
+(4, 3, 24949, 'Defensive State 2 (DND)'),
+(4, 3, 34082, 'Advantaged State (DND)'),
+(4, 3, 45927, 'Summon Friend'),
+(4, 3, 58984, 'Shadowmelt'),
+(4, 3, 61437, 'Opening'),
+(4, 4, 81, 'Dodge'),
+(4, 4, 203, 'Unarmed'),
+(4, 4, 204, 'Defense'),
+(4, 4, 522, 'SPELLDEFENSE (DND)'),
+(4, 4, 668, 'Language Common'),
+(4, 4, 671, 'Language Darnassian'),
+(4, 4, 1180, 'Daggers'),
+(4, 4, 1752, 'Sinister Strike'),
+(4, 4, 1843, 'Disarm'),
+(4, 4, 2098, 'Eviscerate'),
+(4, 4, 2382, 'Generic'),
+(4, 4, 2479, 'Honorless Target'),
+(4, 4, 2567, 'Thrown'),
+(4, 4, 2764, 'Throw'),
+(4, 4, 3050, 'Detect'),
+(4, 4, 3365, 'Opening'),
+(4, 4, 6233, 'Closing'),
+(4, 4, 6246, 'Closing'),
+(4, 4, 6247, 'Opening'),
+(4, 4, 6477, 'Opening'),
+(4, 4, 6478, 'Opening'),
+(4, 4, 6603, 'Attack'),
+(4, 4, 7266, 'Duel'),
+(4, 4, 7267, 'Grovel'),
+(4, 4, 7355, 'Stuck'),
+(4, 4, 8386, 'Attacking'),
+(4, 4, 9077, 'Leather'),
+(4, 4, 9078, 'Cloth'),
+(4, 4, 9125, 'Generic'),
+(4, 4, 16092, 'Defensive State (DND)'),
+(4, 4, 20582, 'Quickness'),
+(4, 4, 20583, 'Nature Resistance'),
+(4, 4, 20585, 'Wisp Spirit'),
+(4, 4, 21184, 'Rogue Passive (DND)'),
+(4, 4, 21651, 'Opening'),
+(4, 4, 21652, 'Closing'),
+(4, 4, 22027, 'Remove Insignia'),
+(4, 4, 22810, 'Opening - No Text'),
+(4, 4, 45927, 'Summon Friend'),
+(4, 4, 58984, 'Shadowmelt'),
+(4, 4, 61437, 'Opening'),
+(4, 5, 81, 'Dodge'),
+(4, 5, 198, 'One-Handed Maces'),
+(4, 5, 203, 'Unarmed'),
+(4, 5, 204, 'Defense'),
+(4, 5, 522, 'SPELLDEFENSE (DND)'),
+(4, 5, 585, 'Smite'),
+(4, 5, 668, 'Language Common'),
+(4, 5, 671, 'Language Darnassian'),
+(4, 5, 1843, 'Disarm'),
+(4, 5, 2050, 'Lesser Heal'),
+(4, 5, 2382, 'Generic'),
+(4, 5, 2479, 'Honorless Target'),
+(4, 5, 3050, 'Detect'),
+(4, 5, 3365, 'Opening'),
+(4, 5, 5009, 'Wands'),
+(4, 5, 5019, 'Shoot'),
+(4, 5, 6233, 'Closing'),
+(4, 5, 6246, 'Closing'),
+(4, 5, 6247, 'Opening'),
+(4, 5, 6477, 'Opening'),
+(4, 5, 6478, 'Opening'),
+(4, 5, 6603, 'Attack'),
+(4, 5, 7266, 'Duel'),
+(4, 5, 7267, 'Grovel'),
+(4, 5, 7355, 'Stuck'),
+(4, 5, 8386, 'Attacking'),
+(4, 5, 9078, 'Cloth'),
+(4, 5, 9125, 'Generic'),
+(4, 5, 20582, 'Quickness'),
+(4, 5, 20583, 'Nature Resistance'),
+(4, 5, 20585, 'Wisp Spirit'),
+(4, 5, 21651, 'Opening'),
+(4, 5, 21652, 'Closing'),
+(4, 5, 22027, 'Remove Insignia'),
+(4, 5, 22810, 'Opening - No Text'),
+(4, 5, 45927, 'Summon Friend'),
+(4, 5, 58984, 'Shadowmelt'),
+(4, 5, 61437, 'Opening'),
+(4, 6, 81, 'Dodge'),
+(4, 6, 196, 'One-Handed Axes'),
+(4, 6, 197, 'Two-Handed Axes'),
+(4, 6, 200, 'Polearms'),
+(4, 6, 201, 'One-Handed Swords'),
+(4, 6, 202, 'Two-Handed Swords'),
+(4, 6, 203, 'Unarmed'),
+(4, 6, 204, 'Defense'),
+(4, 6, 522, 'SPELLDEFENSE (DND)'),
+(4, 6, 668, 'Language Common'),
+(4, 6, 671, 'Language Darnassian'),
+(4, 6, 674, 'Dual Wield'),
+(4, 6, 750, 'Plate Mail'),
+(4, 6, 1843, 'Disarm'),
+(4, 6, 2382, 'Generic'),
+(4, 6, 2479, 'Honorless Target'),
+(4, 6, 3050, 'Detect'),
+(4, 6, 3127, 'Parry'),
+(4, 6, 3275, 'Linen Bandage'),
+(4, 6, 3276, 'Heavy Linen Bandage'),
+(4, 6, 3277, 'Wool Bandage'),
+(4, 6, 3278, 'Heavy Wool Bandage'),
+(4, 6, 3365, 'Opening'),
+(4, 6, 6233, 'Closing'),
+(4, 6, 6246, 'Closing'),
+(4, 6, 6247, 'Opening'),
+(4, 6, 6477, 'Opening'),
+(4, 6, 6478, 'Opening'),
+(4, 6, 6603, 'Attack'),
+(4, 6, 7266, 'Duel'),
+(4, 6, 7267, 'Grovel'),
+(4, 6, 7355, 'Stuck'),
+(4, 6, 7928, 'Silk Bandage'),
+(4, 6, 7929, 'Heavy Silk Bandage'),
+(4, 6, 7934, 'Anti-Venom'),
+(4, 6, 8386, 'Attacking'),
+(4, 6, 8737, 'Mail'),
+(4, 6, 9077, 'Leather'),
+(4, 6, 9078, 'Cloth'),
+(4, 6, 9125, 'Generic'),
+(4, 6, 10840, 'Mageweave Bandage'),
+(4, 6, 10841, 'Heavy Mageweave Bandage'),
+(4, 6, 10846, 'First Aid'),
+(4, 6, 18629, 'Runecloth Bandage'),
+(4, 6, 18630, 'Heavy Runecloth Bandage'),
+(4, 6, 20582, 'Quickness'),
+(4, 6, 20583, 'Nature Resistance'),
+(4, 6, 20585, 'Wisp Spirit'),
+(4, 6, 21651, 'Opening'),
+(4, 6, 21652, 'Closing'),
+(4, 6, 22027, 'Remove Insignia'),
+(4, 6, 22810, 'Opening - No Text'),
+(4, 6, 33391, 'Journeyman Riding'),
+(4, 6, 45462, 'Plague Strike'),
+(4, 6, 45477, 'Icy Touch'),
+(4, 6, 45902, 'Blood Strike'),
+(4, 6, 45903, 'Offensive State (DND)'),
+(4, 6, 45927, 'Summon Friend'),
+(4, 6, 47541, 'Death Coil'),
+(4, 6, 48266, 'Blood Presence'),
+(4, 6, 49410, 'Forceful Deflection'),
+(4, 6, 49576, 'Death Grip'),
+(4, 6, 52665, 'Sigil'),
+(4, 6, 58984, 'Shadowmeld'),
+(4, 6, 59879, 'Blood Plague'),
+(4, 6, 59921, 'Frost Fever'),
+(4, 6, 61437, 'Opening'),
+(4, 6, 61455, 'Runic Focus'),
+(4, 11, 81, 'Dodge'),
+(4, 11, 203, 'Unarmed'),
+(4, 11, 204, 'Defense'),
+(4, 11, 227, 'Staves'),
+(4, 11, 522, 'SPELLDEFENSE (DND)'),
+(4, 11, 668, 'Language Common'),
+(4, 11, 671, 'Language Darnassian'),
+(4, 11, 1180, 'Daggers'),
+(4, 11, 1843, 'Disarm'),
+(4, 11, 2382, 'Generic'),
+(4, 11, 2479, 'Honorless Target'),
+(4, 11, 3050, 'Detect'),
+(4, 11, 3365, 'Opening'),
+(4, 11, 5176, 'Wrath'),
+(4, 11, 5185, 'Healing Touch'),
+(4, 11, 6233, 'Closing'),
+(4, 11, 6246, 'Closing'),
+(4, 11, 6247, 'Opening'),
+(4, 11, 6477, 'Opening'),
+(4, 11, 6478, 'Opening'),
+(4, 11, 6603, 'Attack'),
+(4, 11, 7266, 'Duel'),
+(4, 11, 7267, 'Grovel'),
+(4, 11, 7355, 'Stuck'),
+(4, 11, 8386, 'Attacking'),
+(4, 11, 9077, 'Leather'),
+(4, 11, 9078, 'Cloth'),
+(4, 11, 9125, 'Generic'),
+(4, 11, 20582, 'Quickness'),
+(4, 11, 20583, 'Nature Resistance'),
+(4, 11, 20585, 'Wisp Spirit'),
+(4, 11, 21651, 'Opening'),
+(4, 11, 21652, 'Closing'),
+(4, 11, 22027, 'Remove Insignia'),
+(4, 11, 22810, 'Opening - No Text'),
+(4, 11, 27764, 'Fetish'),
+(4, 11, 45927, 'Summon Friend'),
+(4, 11, 58984, 'Shadowmelt'),
+(4, 11, 61437, 'Opening'),
+(5, 1, 78, 'Heroic Strike'),
+(5, 1, 81, 'Dodge'),
+(5, 1, 107, 'Block'),
+(5, 1, 201, 'One-Handed Swords'),
+(5, 1, 202, 'Two-Handed Swords'),
+(5, 1, 203, 'Unarmed'),
+(5, 1, 204, 'Defense'),
+(5, 1, 522, 'SPELLDEFENSE (DND)'),
+(5, 1, 669, 'Language Orcish'),
+(5, 1, 1180, 'Daggers'),
+(5, 1, 1843, 'Disarm'),
+(5, 1, 2382, 'Generic'),
+(5, 1, 2457, 'Battle Stance'),
+(5, 1, 2479, 'Honorless Target'),
+(5, 1, 3050, 'Detect'),
+(5, 1, 3365, 'Opening'),
+(5, 1, 5227, 'Underwater Breathing'),
+(5, 1, 5301, 'Defensive State (DND)'),
+(5, 1, 6233, 'Closing'),
+(5, 1, 6246, 'Closing'),
+(5, 1, 6247, 'Opening'),
+(5, 1, 6477, 'Opening'),
+(5, 1, 6478, 'Opening'),
+(5, 1, 6603, 'Attack'),
+(5, 1, 7266, 'Duel'),
+(5, 1, 7267, 'Grovel'),
+(5, 1, 7355, 'Stuck'),
+(5, 1, 7744, 'Will of the Forsaken'),
+(5, 1, 8386, 'Attacking'),
+(5, 1, 8737, 'Mail'),
+(5, 1, 9077, 'Leather'),
+(5, 1, 9078, 'Cloth'),
+(5, 1, 9116, 'Shield'),
+(5, 1, 9125, 'Generic'),
+(5, 1, 17737, 'Language Gutterspeak'),
+(5, 1, 20577, 'Cannibalize'),
+(5, 1, 20579, 'Shadow Resistance'),
+(5, 1, 21651, 'Opening'),
+(5, 1, 21652, 'Closing'),
+(5, 1, 22027, 'Remove Insignia'),
+(5, 1, 22810, 'Opening - No Text'),
+(5, 1, 32215, 'Victorious State'),
+(5, 1, 45927, 'Summon Friend'),
+(5, 1, 61437, 'Opening'),
+(5, 4, 81, 'Dodge'),
+(5, 4, 203, 'Unarmed'),
+(5, 4, 204, 'Defense'),
+(5, 4, 522, 'SPELLDEFENSE (DND)'),
+(5, 4, 669, 'Language Orcish'),
+(5, 4, 1180, 'Daggers'),
+(5, 4, 1752, 'Sinister Strike'),
+(5, 4, 1843, 'Disarm'),
+(5, 4, 2098, 'Eviscerate'),
+(5, 4, 2382, 'Generic'),
+(5, 4, 2479, 'Honorless Target'),
+(5, 4, 2567, 'Thrown'),
+(5, 4, 2764, 'Throw'),
+(5, 4, 3050, 'Detect'),
+(5, 4, 3365, 'Opening'),
+(5, 4, 5227, 'Underwater Breathing'),
+(5, 4, 6233, 'Closing'),
+(5, 4, 6246, 'Closing'),
+(5, 4, 6247, 'Opening'),
+(5, 4, 6477, 'Opening'),
+(5, 4, 6478, 'Opening'),
+(5, 4, 6603, 'Attack'),
+(5, 4, 7266, 'Duel'),
+(5, 4, 7267, 'Grovel'),
+(5, 4, 7355, 'Stuck'),
+(5, 4, 7744, 'Will of the Forsaken'),
+(5, 4, 8386, 'Attacking'),
+(5, 4, 9077, 'Leather'),
+(5, 4, 9078, 'Cloth'),
+(5, 4, 9125, 'Generic'),
+(5, 4, 16092, 'Defensive State (DND)'),
+(5, 4, 17737, 'Language Gutterspeak'),
+(5, 4, 20577, 'Cannibalize'),
+(5, 4, 20579, 'Shadow Resistance'),
+(5, 4, 21184, 'Rogue Passive (DND)'),
+(5, 4, 21651, 'Opening'),
+(5, 4, 21652, 'Closing'),
+(5, 4, 22027, 'Remove Insignia'),
+(5, 4, 22810, 'Opening - No Text'),
+(5, 4, 45927, 'Summon Friend'),
+(5, 4, 61437, 'Opening'),
+(5, 5, 81, 'Dodge'),
+(5, 5, 198, 'One-Handed Maces'),
+(5, 5, 203, 'Unarmed'),
+(5, 5, 204, 'Defense'),
+(5, 5, 522, 'SPELLDEFENSE (DND)'),
+(5, 5, 585, 'Smite'),
+(5, 5, 669, 'Language Orcish'),
+(5, 5, 1843, 'Disarm'),
+(5, 5, 2050, 'Lesser Heal'),
+(5, 5, 2382, 'Generic'),
+(5, 5, 2479, 'Honorless Target'),
+(5, 5, 3050, 'Detect'),
+(5, 5, 3365, 'Opening'),
+(5, 5, 5009, 'Wands'),
+(5, 5, 5019, 'Shoot'),
+(5, 5, 5227, 'Underwater Breathing'),
+(5, 5, 6233, 'Closing'),
+(5, 5, 6246, 'Closing'),
+(5, 5, 6247, 'Opening'),
+(5, 5, 6477, 'Opening'),
+(5, 5, 6478, 'Opening'),
+(5, 5, 6603, 'Attack'),
+(5, 5, 7266, 'Duel'),
+(5, 5, 7267, 'Grovel'),
+(5, 5, 7355, 'Stuck'),
+(5, 5, 7744, 'Will of the Forsaken'),
+(5, 5, 8386, 'Attacking'),
+(5, 5, 9078, 'Cloth'),
+(5, 5, 9125, 'Generic'),
+(5, 5, 17737, 'Language Gutterspeak'),
+(5, 5, 20577, 'Cannibalize'),
+(5, 5, 20579, 'Shadow Resistance'),
+(5, 5, 21651, 'Opening'),
+(5, 5, 21652, 'Closing'),
+(5, 5, 22027, 'Remove Insignia'),
+(5, 5, 22810, 'Opening - No Text'),
+(5, 5, 45927, 'Summon Friend'),
+(5, 5, 61437, 'Opening'),
+(5, 6, 81, 'Dodge'),
+(5, 6, 196, 'One-Handed Axes'),
+(5, 6, 197, 'Two-Handed Axes'),
+(5, 6, 200, 'Polearms'),
+(5, 6, 201, 'One-Handed Swords'),
+(5, 6, 202, 'Two-Handed Swords'),
+(5, 6, 203, 'Unarmed'),
+(5, 6, 204, 'Defense'),
+(5, 6, 522, 'SPELLDEFENSE (DND)'),
+(5, 6, 669, 'Language Orcish'),
+(5, 6, 674, 'Dual Wield'),
+(5, 6, 750, 'Plate Mail'),
+(5, 6, 1843, 'Disarm'),
+(5, 6, 2382, 'Generic'),
+(5, 6, 2479, 'Honorless Target'),
+(5, 6, 3050, 'Detect'),
+(5, 6, 3127, 'Parry'),
+(5, 6, 3275, 'Linen Bandage'),
+(5, 6, 3276, 'Heavy Linen Bandage'),
+(5, 6, 3277, 'Wool Bandage'),
+(5, 6, 3278, 'Heavy Wool Bandage'),
+(5, 6, 3365, 'Opening'),
+(5, 6, 5227, 'Underwater Breathing'),
+(5, 6, 6233, 'Closing'),
+(5, 6, 6246, 'Closing'),
+(5, 6, 6247, 'Opening'),
+(5, 6, 6477, 'Opening'),
+(5, 6, 6478, 'Opening'),
+(5, 6, 6603, 'Attack'),
+(5, 6, 7266, 'Duel'),
+(5, 6, 7267, 'Grovel'),
+(5, 6, 7355, 'Stuck'),
+(5, 6, 7744, 'Will of the Forsaken'),
+(5, 6, 7928, 'Silk Bandage'),
+(5, 6, 7929, 'Heavy Silk Bandage'),
+(5, 6, 7934, 'Anti-Venom'),
+(5, 6, 8386, 'Attacking'),
+(5, 6, 8737, 'Mail'),
+(5, 6, 9077, 'Leather'),
+(5, 6, 9078, 'Cloth'),
+(5, 6, 9125, 'Generic'),
+(5, 6, 10840, 'Mageweave Bandage'),
+(5, 6, 10841, 'Heavy Mageweave Bandage'),
+(5, 6, 10846, 'First Aid'),
+(5, 6, 17737, 'Language Gutterspeak'),
+(5, 6, 18629, 'Runecloth Bandage'),
+(5, 6, 18630, 'Heavy Runecloth Bandage'),
+(5, 6, 20577, 'Cannibalize'),
+(5, 6, 20579, 'Shadow Resistance'),
+(5, 6, 21651, 'Opening'),
+(5, 6, 21652, 'Closing'),
+(5, 6, 22027, 'Remove Insignia'),
+(5, 6, 22810, 'Opening - No Text'),
+(5, 6, 33391, 'Journeyman Riding'),
+(5, 6, 45462, 'Plague Strike'),
+(5, 6, 45477, 'Icy Touch'),
+(5, 6, 45902, 'Blood Strike'),
+(5, 6, 45903, 'Offensive State (DND)'),
+(5, 6, 45927, 'Summon Friend'),
+(5, 6, 47541, 'Death Coil'),
+(5, 6, 48266, 'Blood Presence'),
+(5, 6, 49410, 'Forceful Deflection'),
+(5, 6, 49576, 'Death Grip'),
+(5, 6, 52665, 'Sigil'),
+(5, 6, 59879, 'Blood Plague'),
+(5, 6, 59921, 'Frost Fever'),
+(5, 6, 61437, 'Opening'),
+(5, 6, 61455, 'Runic Focus'),
+(5, 8, 81, 'Dodge'),
+(5, 8, 133, 'Fireball'),
+(5, 8, 168, 'Frost Armor'),
+(5, 8, 203, 'Unarmed'),
+(5, 8, 204, 'Defense'),
+(5, 8, 227, 'Staves'),
+(5, 8, 522, 'SPELLDEFENSE (DND)'),
+(5, 8, 669, 'Language Orcish'),
+(5, 8, 1843, 'Disarm'),
+(5, 8, 2382, 'Generic'),
+(5, 8, 2479, 'Honorless Target'),
+(5, 8, 3050, 'Detect'),
+(5, 8, 3365, 'Opening'),
+(5, 8, 5009, 'Wands'),
+(5, 8, 5019, 'Shoot'),
+(5, 8, 5227, 'Underwater Breathing'),
+(5, 8, 6233, 'Closing'),
+(5, 8, 6246, 'Closing'),
+(5, 8, 6247, 'Opening'),
+(5, 8, 6477, 'Opening'),
+(5, 8, 6478, 'Opening'),
+(5, 8, 6603, 'Attack'),
+(5, 8, 7266, 'Duel'),
+(5, 8, 7267, 'Grovel'),
+(5, 8, 7355, 'Stuck'),
+(5, 8, 7744, 'Will of the Forsaken'),
+(5, 8, 8386, 'Attacking'),
+(5, 8, 9078, 'Cloth'),
+(5, 8, 9125, 'Generic'),
+(5, 8, 17737, 'Language Gutterspeak'),
+(5, 8, 20577, 'Cannibalize'),
+(5, 8, 20579, 'Shadow Resistance'),
+(5, 8, 21651, 'Opening'),
+(5, 8, 21652, 'Closing'),
+(5, 8, 22027, 'Remove Insignia'),
+(5, 8, 22810, 'Opening - No Text'),
+(5, 8, 45927, 'Summon Friend'),
+(5, 8, 61437, 'Opening'),
+(5, 9, 81, 'Dodge'),
+(5, 9, 203, 'Unarmed'),
+(5, 9, 204, 'Defense'),
+(5, 9, 522, 'SPELLDEFENSE (DND)'),
+(5, 9, 669, 'Language Orcish'),
+(5, 9, 686, 'Shadow Bolt'),
+(5, 9, 687, 'Demon Skin'),
+(5, 9, 1180, 'Daggers'),
+(5, 9, 1843, 'Disarm'),
+(5, 9, 2382, 'Generic'),
+(5, 9, 2479, 'Honorless Target'),
+(5, 9, 3050, 'Detect'),
+(5, 9, 3365, 'Opening'),
+(5, 9, 5009, 'Wands'),
+(5, 9, 5019, 'Shoot'),
+(5, 9, 5227, 'Underwater Breathing'),
+(5, 9, 6233, 'Closing'),
+(5, 9, 6246, 'Closing'),
+(5, 9, 6247, 'Opening'),
+(5, 9, 6477, 'Opening'),
+(5, 9, 6478, 'Opening'),
+(5, 9, 6603, 'Attack'),
+(5, 9, 7266, 'Duel'),
+(5, 9, 7267, 'Grovel'),
+(5, 9, 7355, 'Stuck'),
+(5, 9, 7744, 'Will of the Forsaken'),
+(5, 9, 8386, 'Attacking'),
+(5, 9, 9078, 'Cloth'),
+(5, 9, 9125, 'Generic'),
+(5, 9, 17737, 'Language Gutterspeak'),
+(5, 9, 20577, 'Cannibalize'),
+(5, 9, 20579, 'Shadow Resistance'),
+(5, 9, 21651, 'Opening'),
+(5, 9, 21652, 'Closing'),
+(5, 9, 22027, 'Remove Insignia'),
+(5, 9, 22810, 'Opening - No Text'),
+(5, 9, 45927, 'Summon Friend'),
+(5, 9, 58284, 'Chaos Bolt Passive'),
+(5, 9, 61437, 'Opening'),
+(6, 1, 78, 'Heroic Strike'),
+(6, 1, 81, 'Dodge'),
+(6, 1, 107, 'Block'),
+(6, 1, 196, 'One-Handed Axes'),
+(6, 1, 198, 'One-Handed Maces'),
+(6, 1, 199, 'Two-Handed Maces'),
+(6, 1, 203, 'Unarmed'),
+(6, 1, 204, 'Defense'),
+(6, 1, 522, 'SPELLDEFENSE (DND)'),
+(6, 1, 669, 'Language Orcish'),
+(6, 1, 670, 'Language Taurahe'),
+(6, 1, 1843, 'Disarm'),
+(6, 1, 2382, 'Generic'),
+(6, 1, 2457, 'Battle Stance'),
+(6, 1, 2479, 'Honorless Target'),
+(6, 1, 3050, 'Detect'),
+(6, 1, 3365, 'Opening'),
+(6, 1, 5301, 'Defensive State (DND)'),
+(6, 1, 6233, 'Closing'),
+(6, 1, 6246, 'Closing'),
+(6, 1, 6247, 'Opening'),
+(6, 1, 6477, 'Opening'),
+(6, 1, 6478, 'Opening'),
+(6, 1, 6603, 'Attack'),
+(6, 1, 7266, 'Duel'),
+(6, 1, 7267, 'Grovel'),
+(6, 1, 7355, 'Stuck'),
+(6, 1, 8386, 'Attacking'),
+(6, 1, 8737, 'Mail'),
+(6, 1, 9077, 'Leather'),
+(6, 1, 9078, 'Cloth'),
+(6, 1, 9116, 'Shield'),
+(6, 1, 9125, 'Generic'),
+(6, 1, 20549, 'War Stomp'),
+(6, 1, 20550, 'Endurance'),
+(6, 1, 20551, 'Nature Resistance'),
+(6, 1, 20552, 'Cultivation'),
+(6, 1, 21651, 'Opening'),
+(6, 1, 21652, 'Closing'),
+(6, 1, 22027, 'Remove Insignia'),
+(6, 1, 22810, 'Opening - No Text'),
+(6, 1, 32215, 'Victorious State'),
+(6, 1, 45927, 'Summon Friend'),
+(6, 1, 61437, 'Opening'),
+(6, 3, 75, 'Auto Shot'),
+(6, 3, 81, 'Dodge'),
+(6, 3, 196, 'One-Handed Axes'),
+(6, 3, 203, 'Unarmed'),
+(6, 3, 204, 'Defense'),
+(6, 3, 266, 'Guns'),
+(6, 3, 522, 'SPELLDEFENSE (DND)'),
+(6, 3, 669, 'Language Orcish'),
+(6, 3, 670, 'Language Taurahe'),
+(6, 3, 1843, 'Disarm'),
+(6, 3, 2382, 'Generic'),
+(6, 3, 2479, 'Honorless Target'),
+(6, 3, 2973, 'Raptor Strike'),
+(6, 3, 3050, 'Detect'),
+(6, 3, 3365, 'Opening'),
+(6, 3, 6233, 'Closing'),
+(6, 3, 6246, 'Closing'),
+(6, 3, 6247, 'Opening'),
+(6, 3, 6477, 'Opening'),
+(6, 3, 6478, 'Opening'),
+(6, 3, 6603, 'Attack'),
+(6, 3, 7266, 'Duel'),
+(6, 3, 7267, 'Grovel'),
+(6, 3, 7355, 'Stuck'),
+(6, 3, 8386, 'Attacking'),
+(6, 3, 9077, 'Leather'),
+(6, 3, 9078, 'Cloth'),
+(6, 3, 9125, 'Generic'),
+(6, 3, 13358, 'Defensive State (DND)'),
+(6, 3, 20549, 'War Stomp'),
+(6, 3, 20550, 'Endurance'),
+(6, 3, 20551, 'Nature Resistance'),
+(6, 3, 20552, 'Cultivation'),
+(6, 3, 21651, 'Opening'),
+(6, 3, 21652, 'Closing'),
+(6, 3, 22027, 'Remove Insignia'),
+(6, 3, 22810, 'Opening - No Text'),
+(6, 3, 24949, 'Defensive State 2 (DND)'),
+(6, 3, 34082, 'Advantaged State (DND)'),
+(6, 3, 45927, 'Summon Friend'),
+(6, 3, 61437, 'Opening'),
+(6, 6, 81, 'Dodge'),
+(6, 6, 196, 'One-Handed Axes'),
+(6, 6, 197, 'Two-Handed Axes'),
+(6, 6, 200, 'Polearms'),
+(6, 6, 201, 'One-Handed Swords'),
+(6, 6, 202, 'Two-Handed Swords'),
+(6, 6, 203, 'Unarmed'),
+(6, 6, 204, 'Defense'),
+(6, 6, 522, 'SPELLDEFENSE (DND)'),
+(6, 6, 669, 'Language Orcish'),
+(6, 6, 670, 'Language Taurahe'),
+(6, 6, 674, 'Dual Wield'),
+(6, 6, 750, 'Plate Mail'),
+(6, 6, 1843, 'Disarm'),
+(6, 6, 2382, 'Generic'),
+(6, 6, 2479, 'Honorless Target'),
+(6, 6, 3050, 'Detect'),
+(6, 6, 3127, 'Parry'),
+(6, 6, 3275, 'Linen Bandage'),
+(6, 6, 3276, 'Heavy Linen Bandage'),
+(6, 6, 3277, 'Wool Bandage'),
+(6, 6, 3278, 'Heavy Wool Bandage'),
+(6, 6, 3365, 'Opening'),
+(6, 6, 6233, 'Closing'),
+(6, 6, 6246, 'Closing'),
+(6, 6, 6247, 'Opening'),
+(6, 6, 6477, 'Opening'),
+(6, 6, 6478, 'Opening'),
+(6, 6, 6603, 'Attack'),
+(6, 6, 7266, 'Duel'),
+(6, 6, 7267, 'Grovel'),
+(6, 6, 7355, 'Stuck'),
+(6, 6, 7928, 'Silk Bandage'),
+(6, 6, 7929, 'Heavy Silk Bandage'),
+(6, 6, 7934, 'Anti-Venom'),
+(6, 6, 8386, 'Attacking'),
+(6, 6, 8737, 'Mail'),
+(6, 6, 9077, 'Leather'),
+(6, 6, 9078, 'Cloth'),
+(6, 6, 9125, 'Generic'),
+(6, 6, 10840, 'Mageweave Bandage'),
+(6, 6, 10841, 'Heavy Mageweave Bandage'),
+(6, 6, 10846, 'First Aid'),
+(6, 6, 18629, 'Runecloth Bandage'),
+(6, 6, 18630, 'Heavy Runecloth Bandage'),
+(6, 6, 20549, 'War Stomp'),
+(6, 6, 20550, 'Endurance'),
+(6, 6, 20551, 'Nature Resistance'),
+(6, 6, 20552, 'Cultivation'),
+(6, 6, 21651, 'Opening'),
+(6, 6, 21652, 'Closing'),
+(6, 6, 22027, 'Remove Insignia'),
+(6, 6, 22810, 'Opening - No Text'),
+(6, 6, 33391, 'Journeyman Riding'),
+(6, 6, 45462, 'Plague Strike'),
+(6, 6, 45477, 'Icy Touch'),
+(6, 6, 45902, 'Blood Strike'),
+(6, 6, 45903, 'Offensive State (DND)'),
+(6, 6, 45927, 'Summon Friend'),
+(6, 6, 47541, 'Death Coil'),
+(6, 6, 48266, 'Blood Presence'),
+(6, 6, 49410, 'Forceful Deflection'),
+(6, 6, 49576, 'Death Grip'),
+(6, 6, 52665, 'Sigil'),
+(6, 6, 59879, 'Blood Plague'),
+(6, 6, 59921, 'Frost Fever'),
+(6, 6, 61437, 'Opening'),
+(6, 6, 61455, 'Runic Focus'),
+(6, 7, 81, 'Dodge'),
+(6, 7, 107, 'Block'),
+(6, 7, 198, 'One-Handed Maces'),
+(6, 7, 203, 'Unarmed'),
+(6, 7, 204, 'Defense'),
+(6, 7, 227, 'Staves'),
+(6, 7, 331, 'Healing Wave'),
+(6, 7, 403, 'Lightning Bolt'),
+(6, 7, 522, 'SPELLDEFENSE (DND)'),
+(6, 7, 669, 'Language Orcish'),
+(6, 7, 670, 'Language Taurahe'),
+(6, 7, 1843, 'Disarm'),
+(6, 7, 2382, 'Generic'),
+(6, 7, 2479, 'Honorless Target'),
+(6, 7, 3050, 'Detect'),
+(6, 7, 3365, 'Opening'),
+(6, 7, 6233, 'Closing'),
+(6, 7, 6246, 'Closing'),
+(6, 7, 6247, 'Opening'),
+(6, 7, 6477, 'Opening'),
+(6, 7, 6478, 'Opening'),
+(6, 7, 6603, 'Attack'),
+(6, 7, 7266, 'Duel'),
+(6, 7, 7267, 'Grovel'),
+(6, 7, 7355, 'Stuck'),
+(6, 7, 8386, 'Attacking'),
+(6, 7, 9077, 'Leather'),
+(6, 7, 9078, 'Cloth'),
+(6, 7, 9116, 'Shield'),
+(6, 7, 9125, 'Generic'),
+(6, 7, 20549, 'War Stomp'),
+(6, 7, 20550, 'Endurance'),
+(6, 7, 20551, 'Nature Resistance'),
+(6, 7, 20552, 'Cultivation'),
+(6, 7, 21651, 'Opening'),
+(6, 7, 21652, 'Closing'),
+(6, 7, 22027, 'Remove Insignia'),
+(6, 7, 22810, 'Opening - No Text'),
+(6, 7, 27763, 'Totem'),
+(6, 7, 45927, 'Summon Friend'),
+(6, 7, 61437, 'Opening'),
+(6, 11, 81, 'Dodge'),
+(6, 11, 198, 'One-Handed Maces'),
+(6, 11, 203, 'Unarmed'),
+(6, 11, 204, 'Defense'),
+(6, 11, 227, 'Staves'),
+(6, 11, 522, 'SPELLDEFENSE (DND)'),
+(6, 11, 669, 'Language Orcish'),
+(6, 11, 670, 'Language Taurahe'),
+(6, 11, 1843, 'Disarm'),
+(6, 11, 2382, 'Generic'),
+(6, 11, 2479, 'Honorless Target'),
+(6, 11, 3050, 'Detect'),
+(6, 11, 3365, 'Opening'),
+(6, 11, 5176, 'Wrath'),
+(6, 11, 5185, 'Healing Touch'),
+(6, 11, 6233, 'Closing'),
+(6, 11, 6246, 'Closing'),
+(6, 11, 6247, 'Opening'),
+(6, 11, 6477, 'Opening'),
+(6, 11, 6478, 'Opening'),
+(6, 11, 6603, 'Attack'),
+(6, 11, 7266, 'Duel'),
+(6, 11, 7267, 'Grovel'),
+(6, 11, 7355, 'Stuck'),
+(6, 11, 8386, 'Attacking'),
+(6, 11, 9077, 'Leather'),
+(6, 11, 9078, 'Cloth'),
+(6, 11, 9125, 'Generic'),
+(6, 11, 20549, 'War Stomp'),
+(6, 11, 20550, 'Endurance'),
+(6, 11, 20551, 'Nature Resistance'),
+(6, 11, 20552, 'Cultivation'),
+(6, 11, 21651, 'Opening'),
+(6, 11, 21652, 'Closing'),
+(6, 11, 22027, 'Remove Insignia'),
+(6, 11, 22810, 'Opening - No Text'),
+(6, 11, 27764, 'Fetish'),
+(6, 11, 45927, 'Summon Friend'),
+(6, 11, 61437, 'Opening'),
+(7, 1, 78, 'Heroic Strike'),
+(7, 1, 81, 'Dodge'),
+(7, 1, 107, 'Block'),
+(7, 1, 198, 'One-Handed Maces'),
+(7, 1, 201, 'One-Handed Swords'),
+(7, 1, 203, 'Unarmed'),
+(7, 1, 204, 'Defense'),
+(7, 1, 522, 'SPELLDEFENSE (DND)'),
+(7, 1, 668, 'Language Common'),
+(7, 1, 1180, 'Daggers'),
+(7, 1, 1843, 'Disarm'),
+(7, 1, 2382, 'Generic'),
+(7, 1, 2457, 'Battle Stance'),
+(7, 1, 2479, 'Honorless Target'),
+(7, 1, 3050, 'Detect'),
+(7, 1, 3365, 'Opening'),
+(7, 1, 5301, 'Defensive State (DND)'),
+(7, 1, 6233, 'Closing'),
+(7, 1, 6246, 'Closing'),
+(7, 1, 6247, 'Opening'),
+(7, 1, 6477, 'Opening'),
+(7, 1, 6478, 'Opening'),
+(7, 1, 6603, 'Attack'),
+(7, 1, 7266, 'Duel'),
+(7, 1, 7267, 'Grovel'),
+(7, 1, 7340, 'Language Gnomish'),
+(7, 1, 7355, 'Stuck'),
+(7, 1, 8386, 'Attacking'),
+(7, 1, 8737, 'Mail'),
+(7, 1, 9077, 'Leather'),
+(7, 1, 9078, 'Cloth'),
+(7, 1, 9116, 'Shield'),
+(7, 1, 9125, 'Generic'),
+(7, 1, 20589, 'Escape Artist'),
+(7, 1, 20591, 'Expansive Mind'),
+(7, 1, 20592, 'Arcane Resistance'),
+(7, 1, 20593, 'Engineering Specialization'),
+(7, 1, 21651, 'Opening'),
+(7, 1, 21652, 'Closing'),
+(7, 1, 22027, 'Remove Insignia'),
+(7, 1, 22810, 'Opening - No Text'),
+(7, 1, 32215, 'Victorious State'),
+(7, 1, 45927, 'Summon Friend'),
+(7, 1, 61437, 'Opening'),
+(7, 4, 81, 'Dodge'),
+(7, 4, 203, 'Unarmed'),
+(7, 4, 204, 'Defense'),
+(7, 4, 522, 'SPELLDEFENSE (DND)'),
+(7, 4, 668, 'Language Common'),
+(7, 4, 1180, 'Daggers'),
+(7, 4, 1752, 'Sinister Strike'),
+(7, 4, 1843, 'Disarm'),
+(7, 4, 2098, 'Eviscerate'),
+(7, 4, 2382, 'Generic'),
+(7, 4, 2479, 'Honorless Target'),
+(7, 4, 2567, 'Thrown'),
+(7, 4, 2764, 'Throw'),
+(7, 4, 3050, 'Detect'),
+(7, 4, 3365, 'Opening'),
+(7, 4, 6233, 'Closing'),
+(7, 4, 6246, 'Closing'),
+(7, 4, 6247, 'Opening'),
+(7, 4, 6477, 'Opening'),
+(7, 4, 6478, 'Opening'),
+(7, 4, 6603, 'Attack'),
+(7, 4, 7266, 'Duel'),
+(7, 4, 7267, 'Grovel'),
+(7, 4, 7340, 'Language Gnomish'),
+(7, 4, 7355, 'Stuck'),
+(7, 4, 8386, 'Attacking'),
+(7, 4, 9077, 'Leather'),
+(7, 4, 9078, 'Cloth'),
+(7, 4, 9125, 'Generic'),
+(7, 4, 16092, 'Defensive State (DND)'),
+(7, 4, 20589, 'Escape Artist'),
+(7, 4, 20591, 'Expansive Mind'),
+(7, 4, 20592, 'Arcane Resistance'),
+(7, 4, 20593, 'Engineering Specialization'),
+(7, 4, 21184, 'Rogue Passive (DND)'),
+(7, 4, 21651, 'Opening'),
+(7, 4, 21652, 'Closing'),
+(7, 4, 22027, 'Remove Insignia'),
+(7, 4, 22810, 'Opening - No Text'),
+(7, 4, 45927, 'Summon Friend'),
+(7, 4, 61437, 'Opening'),
+(7, 6, 81, 'Dodge'),
+(7, 6, 196, 'One-Handed Axes'),
+(7, 6, 197, 'Two-Handed Axes'),
+(7, 6, 200, 'Polearms'),
+(7, 6, 201, 'One-Handed Swords'),
+(7, 6, 202, 'Two-Handed Swords'),
+(7, 6, 203, 'Unarmed'),
+(7, 6, 204, 'Defense'),
+(7, 6, 522, 'SPELLDEFENSE (DND)'),
+(7, 6, 668, 'Language Common'),
+(7, 6, 674, 'Dual Wield'),
+(7, 6, 750, 'Plate Mail'),
+(7, 6, 1843, 'Disarm'),
+(7, 6, 2382, 'Generic'),
+(7, 6, 2479, 'Honorless Target'),
+(7, 6, 3050, 'Detect'),
+(7, 6, 3127, 'Parry'),
+(7, 6, 3275, 'Linen Bandage'),
+(7, 6, 3276, 'Heavy Linen Bandage'),
+(7, 6, 3277, 'Wool Bandage'),
+(7, 6, 3278, 'Heavy Wool Bandage'),
+(7, 6, 3365, 'Opening'),
+(7, 6, 6233, 'Closing'),
+(7, 6, 6246, 'Closing'),
+(7, 6, 6247, 'Opening'),
+(7, 6, 6477, 'Opening'),
+(7, 6, 6478, 'Opening'),
+(7, 6, 6603, 'Attack'),
+(7, 6, 7266, 'Duel'),
+(7, 6, 7267, 'Grovel'),
+(7, 6, 7340, 'Language Gnomish'),
+(7, 6, 7355, 'Stuck'),
+(7, 6, 7928, 'Silk Bandage'),
+(7, 6, 7929, 'Heavy Silk Bandage'),
+(7, 6, 7934, 'Anti-Venom'),
+(7, 6, 8386, 'Attacking'),
+(7, 6, 8737, 'Mail'),
+(7, 6, 9077, 'Leather'),
+(7, 6, 9078, 'Cloth'),
+(7, 6, 9125, 'Generic'),
+(7, 6, 10840, 'Mageweave Bandage'),
+(7, 6, 10841, 'Heavy Mageweave Bandage'),
+(7, 6, 10846, 'First Aid'),
+(7, 6, 18629, 'Runecloth Bandage'),
+(7, 6, 18630, 'Heavy Runecloth Bandage'),
+(7, 6, 20589, 'Escape Artist'),
+(7, 6, 20591, 'Expansive Mind'),
+(7, 6, 20592, 'Arcane Resistance'),
+(7, 6, 20593, 'Engineering Specialization'),
+(7, 6, 21651, 'Opening'),
+(7, 6, 21652, 'Closing'),
+(7, 6, 22027, 'Remove Insignia'),
+(7, 6, 22810, 'Opening - No Text'),
+(7, 6, 33391, 'Journeyman Riding'),
+(7, 6, 45462, 'Plague Strike'),
+(7, 6, 45477, 'Icy Touch'),
+(7, 6, 45902, 'Blood Strike'),
+(7, 6, 45903, 'Offensive State (DND)'),
+(7, 6, 45927, 'Summon Friend'),
+(7, 6, 47541, 'Death Coil'),
+(7, 6, 48266, 'Blood Presence'),
+(7, 6, 49410, 'Forceful Deflection'),
+(7, 6, 49576, 'Death Grip'),
+(7, 6, 52665, 'Sigil'),
+(7, 6, 59879, 'Blood Plague'),
+(7, 6, 59921, 'Frost Fever'),
+(7, 6, 61437, 'Opening'),
+(7, 6, 61455, 'Runic Focus'),
+(7, 8, 81, 'Dodge'),
+(7, 8, 133, 'Fireball'),
+(7, 8, 168, 'Frost Armor'),
+(7, 8, 203, 'Unarmed'),
+(7, 8, 204, 'Defense'),
+(7, 8, 227, 'Staves'),
+(7, 8, 522, 'SPELLDEFENSE (DND)'),
+(7, 8, 668, 'Language Common'),
+(7, 8, 1843, 'Disarm'),
+(7, 8, 2382, 'Generic'),
+(7, 8, 2479, 'Honorless Target'),
+(7, 8, 3050, 'Detect'),
+(7, 8, 3365, 'Opening'),
+(7, 8, 5009, 'Wands'),
+(7, 8, 5019, 'Shoot'),
+(7, 8, 6233, 'Closing'),
+(7, 8, 6246, 'Closing'),
+(7, 8, 6247, 'Opening'),
+(7, 8, 6477, 'Opening'),
+(7, 8, 6478, 'Opening'),
+(7, 8, 6603, 'Attack'),
+(7, 8, 7266, 'Duel'),
+(7, 8, 7267, 'Grovel'),
+(7, 8, 7340, 'Language Gnomish'),
+(7, 8, 7355, 'Stuck'),
+(7, 8, 8386, 'Attacking'),
+(7, 8, 9078, 'Cloth'),
+(7, 8, 9125, 'Generic'),
+(7, 8, 20589, 'Escape Artist'),
+(7, 8, 20591, 'Expansive Mind'),
+(7, 8, 20592, 'Arcane Resistance'),
+(7, 8, 20593, 'Engineering Specialization'),
+(7, 8, 21651, 'Opening'),
+(7, 8, 21652, 'Closing'),
+(7, 8, 22027, 'Remove Insignia'),
+(7, 8, 22810, 'Opening - No Text'),
+(7, 8, 45927, 'Summon Friend'),
+(7, 8, 61437, 'Opening'),
+(7, 9, 81, 'Dodge'),
+(7, 9, 203, 'Unarmed'),
+(7, 9, 204, 'Defense'),
+(7, 9, 522, 'SPELLDEFENSE (DND)'),
+(7, 9, 668, 'Language Common'),
+(7, 9, 686, 'Shadow Bolt'),
+(7, 9, 687, 'Demon Skin'),
+(7, 9, 1180, 'Daggers'),
+(7, 9, 1843, 'Disarm'),
+(7, 9, 2382, 'Generic'),
+(7, 9, 2479, 'Honorless Target'),
+(7, 9, 3050, 'Detect'),
+(7, 9, 3365, 'Opening'),
+(7, 9, 5009, 'Wands'),
+(7, 9, 5019, 'Shoot'),
+(7, 9, 6233, 'Closing'),
+(7, 9, 6246, 'Closing'),
+(7, 9, 6247, 'Opening'),
+(7, 9, 6477, 'Opening'),
+(7, 9, 6478, 'Opening'),
+(7, 9, 6603, 'Attack'),
+(7, 9, 7266, 'Duel'),
+(7, 9, 7267, 'Grovel'),
+(7, 9, 7340, 'Language Gnomish'),
+(7, 9, 7355, 'Stuck'),
+(7, 9, 8386, 'Attacking'),
+(7, 9, 9078, 'Cloth'),
+(7, 9, 9125, 'Generic'),
+(7, 9, 20589, 'Escape Artist'),
+(7, 9, 20591, 'Expansive Mind'),
+(7, 9, 20592, 'Arcane Resistance'),
+(7, 9, 20593, 'Engineering Specialization'),
+(7, 9, 21651, 'Opening'),
+(7, 9, 21652, 'Closing'),
+(7, 9, 22027, 'Remove Insignia'),
+(7, 9, 22810, 'Opening - No Text'),
+(7, 9, 45927, 'Summon Friend'),
+(7, 9, 58284, 'Chaos Bolt Passive'),
+(7, 9, 61437, 'Opening'),
+(8, 1, 78, 'Heroic Strike'),
+(8, 1, 81, 'Dodge'),
+(8, 1, 107, 'Block'),
+(8, 1, 196, 'One-Handed Axes'),
+(8, 1, 203, 'Unarmed'),
+(8, 1, 204, 'Defense'),
+(8, 1, 522, 'SPELLDEFENSE (DND)'),
+(8, 1, 669, 'Language Orcish'),
+(8, 1, 1180, 'Daggers'),
+(8, 1, 1843, 'Disarm'),
+(8, 1, 2382, 'Generic'),
+(8, 1, 2457, 'Battle Stance'),
+(8, 1, 2479, 'Honorless Target'),
+(8, 1, 2567, 'Thrown'),
+(8, 1, 2764, 'Throw'),
+(8, 1, 3050, 'Detect'),
+(8, 1, 3365, 'Opening'),
+(8, 1, 5301, 'Defensive State (DND)'),
+(8, 1, 6233, 'Closing'),
+(8, 1, 6246, 'Closing'),
+(8, 1, 6247, 'Opening'),
+(8, 1, 6477, 'Opening'),
+(8, 1, 6478, 'Opening'),
+(8, 1, 6603, 'Attack'),
+(8, 1, 7266, 'Duel'),
+(8, 1, 7267, 'Grovel'),
+(8, 1, 7341, 'Language Troll'),
+(8, 1, 7355, 'Stuck'),
+(8, 1, 8386, 'Attacking'),
+(8, 1, 8737, 'Mail'),
+(8, 1, 9077, 'Leather'),
+(8, 1, 9078, 'Cloth'),
+(8, 1, 9116, 'Shield'),
+(8, 1, 9125, 'Generic'),
+(8, 1, 20555, 'Regeneration'),
+(8, 1, 20557, 'Beast Slaying');
+INSERT IGNORE INTO `playercreateinfo_spell` (`race`, `class`, `Spell`, `Note`) VALUES
+(8, 1, 20558, 'Throwing Specialization'),
+(8, 1, 21651, 'Opening'),
+(8, 1, 21652, 'Closing'),
+(8, 1, 22027, 'Remove Insignia'),
+(8, 1, 22810, 'Opening - No Text'),
+(8, 1, 26290, 'Bow Specialization'),
+(8, 1, 26296, 'Berserking'),
+(8, 1, 32215, 'Victorious State'),
+(8, 1, 45927, 'Summon Friend'),
+(8, 1, 58943, 'Da Voodoo Shuffle'),
+(8, 1, 61437, 'Opening'),
+(8, 3, 75, 'Auto Shot'),
+(8, 3, 81, 'Dodge'),
+(8, 3, 196, 'One-Handed Axes'),
+(8, 3, 203, 'Unarmed'),
+(8, 3, 204, 'Defense'),
+(8, 3, 264, 'Bows'),
+(8, 3, 522, 'SPELLDEFENSE (DND)'),
+(8, 3, 669, 'Language Orcish'),
+(8, 3, 1843, 'Disarm'),
+(8, 3, 2382, 'Generic'),
+(8, 3, 2479, 'Honorless Target'),
+(8, 3, 2973, 'Raptor Strike'),
+(8, 3, 3050, 'Detect'),
+(8, 3, 3365, 'Opening'),
+(8, 3, 6233, 'Closing'),
+(8, 3, 6246, 'Closing'),
+(8, 3, 6247, 'Opening'),
+(8, 3, 6477, 'Opening'),
+(8, 3, 6478, 'Opening'),
+(8, 3, 6603, 'Attack'),
+(8, 3, 7266, 'Duel'),
+(8, 3, 7267, 'Grovel'),
+(8, 3, 7341, 'Language Troll'),
+(8, 3, 7355, 'Stuck'),
+(8, 3, 8386, 'Attacking'),
+(8, 3, 9077, 'Leather'),
+(8, 3, 9078, 'Cloth'),
+(8, 3, 9125, 'Generic'),
+(8, 3, 13358, 'Defensive State (DND)'),
+(8, 3, 20554, 'Berserking'),
+(8, 3, 20555, 'Regeneration'),
+(8, 3, 20557, 'Beast Slaying'),
+(8, 3, 20558, 'Throwing Specialization'),
+(8, 3, 21651, 'Opening'),
+(8, 3, 21652, 'Closing'),
+(8, 3, 22027, 'Remove Insignia'),
+(8, 3, 22810, 'Opening - No Text'),
+(8, 3, 24949, 'Defensive State 2 (DND)'),
+(8, 3, 26290, 'Bow Specialization'),
+(8, 3, 34082, 'Advantaged State (DND)'),
+(8, 3, 45927, 'Summon Friend'),
+(8, 3, 58943, 'Da Voodoo Shuffle'),
+(8, 3, 61437, 'Opening'),
+(8, 4, 81, 'Dodge'),
+(8, 4, 203, 'Unarmed'),
+(8, 4, 204, 'Defense'),
+(8, 4, 522, 'SPELLDEFENSE (DND)'),
+(8, 4, 669, 'Language Orcish'),
+(8, 4, 1180, 'Daggers'),
+(8, 4, 1752, 'Sinister Strike'),
+(8, 4, 1843, 'Disarm'),
+(8, 4, 2098, 'Eviscerate'),
+(8, 4, 2382, 'Generic'),
+(8, 4, 2479, 'Honorless Target'),
+(8, 4, 2567, 'Thrown'),
+(8, 4, 2764, 'Throw'),
+(8, 4, 3050, 'Detect'),
+(8, 4, 3365, 'Opening'),
+(8, 4, 6233, 'Closing'),
+(8, 4, 6246, 'Closing'),
+(8, 4, 6247, 'Opening'),
+(8, 4, 6477, 'Opening'),
+(8, 4, 6478, 'Opening'),
+(8, 4, 6603, 'Attack'),
+(8, 4, 7266, 'Duel'),
+(8, 4, 7267, 'Grovel'),
+(8, 4, 7341, 'Language Troll'),
+(8, 4, 7355, 'Stuck'),
+(8, 4, 8386, 'Attacking'),
+(8, 4, 9077, 'Leather'),
+(8, 4, 9078, 'Cloth'),
+(8, 4, 9125, 'Generic'),
+(8, 4, 16092, 'Defensive State (DND)'),
+(8, 4, 20555, 'Regeneration'),
+(8, 4, 20557, 'Beast Slaying'),
+(8, 4, 20558, 'Throwing Specialization'),
+(8, 4, 21184, 'Rogue Passive (DND)'),
+(8, 4, 21651, 'Opening'),
+(8, 4, 21652, 'Closing'),
+(8, 4, 22027, 'Remove Insignia'),
+(8, 4, 22810, 'Opening - No Text'),
+(8, 4, 26290, 'Bow Specialization'),
+(8, 4, 26297, 'Berserking'),
+(8, 4, 45927, 'Summon Friend'),
+(8, 4, 58943, 'Da Voodoo Shuffle'),
+(8, 4, 61437, 'Opening'),
+(8, 5, 81, 'Dodge'),
+(8, 5, 198, 'One-Handed Maces'),
+(8, 5, 203, 'Unarmed'),
+(8, 5, 204, 'Defense'),
+(8, 5, 522, 'SPELLDEFENSE (DND)'),
+(8, 5, 585, 'Smite'),
+(8, 5, 669, 'Language Orcish'),
+(8, 5, 1843, 'Disarm'),
+(8, 5, 2050, 'Lesser Heal'),
+(8, 5, 2382, 'Generic'),
+(8, 5, 2479, 'Honorless Target'),
+(8, 5, 3050, 'Detect'),
+(8, 5, 3365, 'Opening'),
+(8, 5, 5009, 'Wands'),
+(8, 5, 5019, 'Shoot'),
+(8, 5, 6233, 'Closing'),
+(8, 5, 6246, 'Closing'),
+(8, 5, 6247, 'Opening'),
+(8, 5, 6477, 'Opening'),
+(8, 5, 6478, 'Opening'),
+(8, 5, 6603, 'Attack'),
+(8, 5, 7266, 'Duel'),
+(8, 5, 7267, 'Grovel'),
+(8, 5, 7341, 'Language Troll'),
+(8, 5, 7355, 'Stuck'),
+(8, 5, 8386, 'Attacking'),
+(8, 5, 9078, 'Cloth'),
+(8, 5, 9125, 'Generic'),
+(8, 5, 20554, 'Berserking'),
+(8, 5, 20555, 'Regeneration'),
+(8, 5, 20557, 'Beast Slaying'),
+(8, 5, 20558, 'Throwing Specialization'),
+(8, 5, 21651, 'Opening'),
+(8, 5, 21652, 'Closing'),
+(8, 5, 22027, 'Remove Insignia'),
+(8, 5, 22810, 'Opening - No Text'),
+(8, 5, 26290, 'Bow Specialization'),
+(8, 5, 45927, 'Summon Friend'),
+(8, 5, 58943, 'Da Voodoo Shuffle'),
+(8, 5, 61437, 'Opening'),
+(8, 6, 81, 'Dodge'),
+(8, 6, 196, 'One-Handed Axes'),
+(8, 6, 197, 'Two-Handed Axes'),
+(8, 6, 200, 'Polearms'),
+(8, 6, 201, 'One-Handed Swords'),
+(8, 6, 202, 'Two-Handed Swords'),
+(8, 6, 203, 'Unarmed'),
+(8, 6, 204, 'Defense'),
+(8, 6, 522, 'SPELLDEFENSE (DND)'),
+(8, 6, 669, 'Language Orcish'),
+(8, 6, 674, 'Dual Wield'),
+(8, 6, 750, 'Plate Mail'),
+(8, 6, 1843, 'Disarm'),
+(8, 6, 2382, 'Generic'),
+(8, 6, 2479, 'Honorless Target'),
+(8, 6, 3050, 'Detect'),
+(8, 6, 3127, 'Parry'),
+(8, 6, 3275, 'Linen Bandage'),
+(8, 6, 3276, 'Heavy Linen Bandage'),
+(8, 6, 3277, 'Wool Bandage'),
+(8, 6, 3278, 'Heavy Wool Bandage'),
+(8, 6, 3365, 'Opening'),
+(8, 6, 6233, 'Closing'),
+(8, 6, 6246, 'Closing'),
+(8, 6, 6247, 'Opening'),
+(8, 6, 6477, 'Opening'),
+(8, 6, 6478, 'Opening'),
+(8, 6, 6603, 'Attack'),
+(8, 6, 7266, 'Duel'),
+(8, 6, 7267, 'Grovel'),
+(8, 6, 7341, 'Language Troll'),
+(8, 6, 7355, 'Stuck'),
+(8, 6, 7928, 'Silk Bandage'),
+(8, 6, 7929, 'Heavy Silk Bandage'),
+(8, 6, 7934, 'Anti-Venom'),
+(8, 6, 8386, 'Attacking'),
+(8, 6, 8737, 'Mail'),
+(8, 6, 9077, 'Leather'),
+(8, 6, 9078, 'Cloth'),
+(8, 6, 9125, 'Generic'),
+(8, 6, 10840, 'Mageweave Bandage'),
+(8, 6, 10841, 'Heavy Mageweave Bandage'),
+(8, 6, 10846, 'First Aid'),
+(8, 6, 18629, 'Runecloth Bandage'),
+(8, 6, 18630, 'Heavy Runecloth Bandage'),
+(8, 6, 20555, 'Regeneration'),
+(8, 6, 20557, 'Beast Slaying'),
+(8, 6, 20558, 'Throwing Specialization'),
+(8, 6, 21651, 'Opening'),
+(8, 6, 21652, 'Closing'),
+(8, 6, 22027, 'Remove Insignia'),
+(8, 6, 22810, 'Opening - No Text'),
+(8, 6, 26290, 'Bow Specialization'),
+(8, 6, 33391, 'Journeyman Riding'),
+(8, 6, 45462, 'Plague Strike'),
+(8, 6, 45477, 'Icy Touch'),
+(8, 6, 45902, 'Blood Strike'),
+(8, 6, 45903, 'Offensive State (DND)'),
+(8, 6, 45927, 'Summon Friend'),
+(8, 6, 47541, 'Death Coil'),
+(8, 6, 48266, 'Blood Presence'),
+(8, 6, 49410, 'Forceful Deflection'),
+(8, 6, 49576, 'Death Grip'),
+(8, 6, 50621, 'Berserking'),
+(8, 6, 52665, 'Sigil'),
+(8, 6, 58943, 'Da Voodoo Shuffle'),
+(8, 6, 59879, 'Blood Plague'),
+(8, 6, 59921, 'Frost Fever'),
+(8, 6, 61437, 'Opening'),
+(8, 6, 61455, 'Runic Focus'),
+(8, 7, 81, 'Dodge'),
+(8, 7, 107, 'Block'),
+(8, 7, 198, 'One-Handed Maces'),
+(8, 7, 203, 'Unarmed'),
+(8, 7, 204, 'Defense'),
+(8, 7, 227, 'Staves'),
+(8, 7, 331, 'Healing Wave'),
+(8, 7, 403, 'Lightning Bolt'),
+(8, 7, 522, 'SPELLDEFENSE (DND)'),
+(8, 7, 669, 'Language Orcish'),
+(8, 7, 1843, 'Disarm'),
+(8, 7, 2382, 'Generic'),
+(8, 7, 2479, 'Honorless Target'),
+(8, 7, 3050, 'Detect'),
+(8, 7, 3365, 'Opening'),
+(8, 7, 6233, 'Closing'),
+(8, 7, 6246, 'Closing'),
+(8, 7, 6247, 'Opening'),
+(8, 7, 6477, 'Opening'),
+(8, 7, 6478, 'Opening'),
+(8, 7, 6603, 'Attack'),
+(8, 7, 7266, 'Duel'),
+(8, 7, 7267, 'Grovel'),
+(8, 7, 7341, 'Language Troll'),
+(8, 7, 7355, 'Stuck'),
+(8, 7, 8386, 'Attacking'),
+(8, 7, 9077, 'Leather'),
+(8, 7, 9078, 'Cloth'),
+(8, 7, 9116, 'Shield'),
+(8, 7, 9125, 'Generic'),
+(8, 7, 20554, 'Berserking'),
+(8, 7, 20555, 'Regeneration'),
+(8, 7, 20557, 'Beast Slaying'),
+(8, 7, 20558, 'Throwing Specialization'),
+(8, 7, 21651, 'Opening'),
+(8, 7, 21652, 'Closing'),
+(8, 7, 22027, 'Remove Insignia'),
+(8, 7, 22810, 'Opening - No Text'),
+(8, 7, 26290, 'Bow Specialization'),
+(8, 7, 27763, 'Totem'),
+(8, 7, 45927, 'Summon Friend'),
+(8, 7, 58943, 'Da Voodoo Shuffle'),
+(8, 7, 61437, 'Opening'),
+(8, 8, 81, 'Dodge'),
+(8, 8, 133, 'Fireball'),
+(8, 8, 168, 'Frost Armor'),
+(8, 8, 203, 'Unarmed'),
+(8, 8, 204, 'Defense'),
+(8, 8, 227, 'Staves'),
+(8, 8, 522, 'SPELLDEFENSE (DND)'),
+(8, 8, 669, 'Language Orcish'),
+(8, 8, 1843, 'Disarm'),
+(8, 8, 2382, 'Generic'),
+(8, 8, 2479, 'Honorless Target'),
+(8, 8, 3050, 'Detect'),
+(8, 8, 3365, 'Opening'),
+(8, 8, 5009, 'Wands'),
+(8, 8, 5019, 'Shoot'),
+(8, 8, 6233, 'Closing'),
+(8, 8, 6246, 'Closing'),
+(8, 8, 6247, 'Opening'),
+(8, 8, 6477, 'Opening'),
+(8, 8, 6478, 'Opening'),
+(8, 8, 6603, 'Attack'),
+(8, 8, 7266, 'Duel'),
+(8, 8, 7267, 'Grovel'),
+(8, 8, 7341, 'Language Troll'),
+(8, 8, 7355, 'Stuck'),
+(8, 8, 8386, 'Attacking'),
+(8, 8, 9078, 'Cloth'),
+(8, 8, 9125, 'Generic'),
+(8, 8, 20554, 'Berserking'),
+(8, 8, 20555, 'Regeneration'),
+(8, 8, 20557, 'Beast Slaying'),
+(8, 8, 20558, 'Throwing Specialization'),
+(8, 8, 21651, 'Opening'),
+(8, 8, 21652, 'Closing'),
+(8, 8, 22027, 'Remove Insignia'),
+(8, 8, 22810, 'Opening - No Text'),
+(8, 8, 26290, 'Bow Specialization'),
+(8, 8, 45927, 'Summon Friend'),
+(8, 8, 58943, 'Da Voodoo Shuffle'),
+(8, 8, 61437, 'Opening'),
+(10, 2, 81, 'Dodge'),
+(10, 2, 107, 'Block'),
+(10, 2, 201, 'One-Handed Swords'),
+(10, 2, 202, 'Two-Handed Swords'),
+(10, 2, 203, 'Unarmed'),
+(10, 2, 204, 'Defense'),
+(10, 2, 522, 'SPELLDEFENSE (DND)'),
+(10, 2, 635, 'Holy Light'),
+(10, 2, 669, 'Language Orcish'),
+(10, 2, 813, 'Language Thalassian'),
+(10, 2, 822, 'Magic Resistance'),
+(10, 2, 2382, 'Generic'),
+(10, 2, 2479, 'Honorless Target'),
+(10, 2, 3050, 'Detect'),
+(10, 2, 3365, 'Opening'),
+(10, 2, 6233, 'Closing'),
+(10, 2, 6246, 'Closing'),
+(10, 2, 6247, 'Opening'),
+(10, 2, 6477, 'Opening'),
+(10, 2, 6478, 'Opening'),
+(10, 2, 6603, 'Attack'),
+(10, 2, 7266, 'Duel'),
+(10, 2, 7267, 'Grovel'),
+(10, 2, 7355, 'Stuck'),
+(10, 2, 8386, 'Attacking'),
+(10, 2, 8737, 'Mail'),
+(10, 2, 9077, 'Leather'),
+(10, 2, 9078, 'Cloth'),
+(10, 2, 9116, 'Shield'),
+(10, 2, 9125, 'Generic'),
+(10, 2, 21084, 'Seal of Righteousness'),
+(10, 2, 21651, 'Opening'),
+(10, 2, 21652, 'Closing'),
+(10, 2, 22027, 'Remove Insignia'),
+(10, 2, 22810, 'Opening - No Text'),
+(10, 2, 27762, 'Libram'),
+(10, 2, 28730, 'Arcane Torrent'),
+(10, 2, 28734, 'Mana Tap'),
+(10, 2, 28877, 'Arcane Affinity'),
+(10, 3, 75, 'Auto Shot'),
+(10, 3, 81, 'Dodge'),
+(10, 3, 203, 'Unarmed'),
+(10, 3, 204, 'Defense'),
+(10, 3, 264, 'Bows'),
+(10, 3, 522, 'SPELLDEFENSE (DND)'),
+(10, 3, 669, 'Language Orcish'),
+(10, 3, 813, 'Language Thalassian'),
+(10, 3, 822, 'Magic Resistance'),
+(10, 3, 1180, 'Daggers'),
+(10, 3, 2382, 'Generic'),
+(10, 3, 2479, 'Honorless Target'),
+(10, 3, 2973, 'Raptor Strike'),
+(10, 3, 3050, 'Detect'),
+(10, 3, 3365, 'Opening'),
+(10, 3, 6233, 'Closing'),
+(10, 3, 6246, 'Closing'),
+(10, 3, 6247, 'Opening'),
+(10, 3, 6477, 'Opening'),
+(10, 3, 6478, 'Opening'),
+(10, 3, 6603, 'Attack'),
+(10, 3, 7266, 'Duel'),
+(10, 3, 7267, 'Grovel'),
+(10, 3, 7355, 'Stuck'),
+(10, 3, 8386, 'Attacking'),
+(10, 3, 9077, 'Leather'),
+(10, 3, 9078, 'Cloth'),
+(10, 3, 9125, 'Generic'),
+(10, 3, 13358, 'Defensive State (DND)'),
+(10, 3, 21651, 'Opening'),
+(10, 3, 21652, 'Closing'),
+(10, 3, 22027, 'Remove Insignia'),
+(10, 3, 22810, 'Opening - No Text'),
+(10, 3, 24949, 'Defensive State 2 (DND)'),
+(10, 3, 28730, 'Arcane Torrent'),
+(10, 3, 28734, 'Mana Tap'),
+(10, 3, 28877, 'Arcane Affinity'),
+(10, 3, 34082, 'Advantaged State (DND)'),
+(10, 4, 81, 'Dodge'),
+(10, 4, 203, 'Unarmed'),
+(10, 4, 204, 'Defense'),
+(10, 4, 522, 'SPELLDEFENSE (DND)'),
+(10, 4, 669, 'Language Orcish'),
+(10, 4, 813, 'Language Thalassian'),
+(10, 4, 822, 'Magic Resistance'),
+(10, 4, 1180, 'Daggers'),
+(10, 4, 1752, 'Sinister Strike'),
+(10, 4, 2098, 'Eviscerate'),
+(10, 4, 2382, 'Generic'),
+(10, 4, 2479, 'Honorless Target'),
+(10, 4, 2567, 'Thrown'),
+(10, 4, 2764, 'Throw'),
+(10, 4, 3050, 'Detect'),
+(10, 4, 3365, 'Opening'),
+(10, 4, 6233, 'Closing'),
+(10, 4, 6246, 'Closing'),
+(10, 4, 6247, 'Opening'),
+(10, 4, 6477, 'Opening'),
+(10, 4, 6478, 'Opening'),
+(10, 4, 6603, 'Attack'),
+(10, 4, 7266, 'Duel'),
+(10, 4, 7267, 'Grovel'),
+(10, 4, 7355, 'Stuck'),
+(10, 4, 8386, 'Attacking'),
+(10, 4, 9077, 'Leather'),
+(10, 4, 9078, 'Cloth'),
+(10, 4, 9125, 'Generic'),
+(10, 4, 16092, 'Defensive State (DND)'),
+(10, 4, 21184, 'Rogue Passive (DND)'),
+(10, 4, 21651, 'Opening'),
+(10, 4, 21652, 'Closing'),
+(10, 4, 22027, 'Remove Insignia'),
+(10, 4, 22810, 'Opening - No Text'),
+(10, 4, 25046, 'Arcane Torrent'),
+(10, 4, 28734, 'Mana Tap'),
+(10, 4, 28877, 'Arcane Affinity'),
+(10, 5, 81, 'Dodge'),
+(10, 5, 198, 'One-Handed Maces'),
+(10, 5, 203, 'Unarmed'),
+(10, 5, 204, 'Defense'),
+(10, 5, 522, 'SPELLDEFENSE (DND)'),
+(10, 5, 585, 'Smite'),
+(10, 5, 669, 'Language Orcish'),
+(10, 5, 813, 'Language Thalassian'),
+(10, 5, 822, 'Magic Resistance'),
+(10, 5, 2050, 'Lesser Heal'),
+(10, 5, 2382, 'Generic'),
+(10, 5, 2479, 'Honorless Target'),
+(10, 5, 3050, 'Detect'),
+(10, 5, 3365, 'Opening'),
+(10, 5, 5009, 'Wands'),
+(10, 5, 5019, 'Shoot'),
+(10, 5, 6233, 'Closing'),
+(10, 5, 6246, 'Closing'),
+(10, 5, 6247, 'Opening'),
+(10, 5, 6477, 'Opening'),
+(10, 5, 6478, 'Opening'),
+(10, 5, 6603, 'Attack'),
+(10, 5, 7266, 'Duel'),
+(10, 5, 7267, 'Grovel'),
+(10, 5, 7355, 'Stuck'),
+(10, 5, 8386, 'Attacking'),
+(10, 5, 9078, 'Cloth'),
+(10, 5, 9125, 'Generic'),
+(10, 5, 21651, 'Opening'),
+(10, 5, 21652, 'Closing'),
+(10, 5, 22027, 'Remove Insignia'),
+(10, 5, 22810, 'Opening - No Text'),
+(10, 5, 28730, 'Arcane Torrent'),
+(10, 5, 28734, 'Mana Tap'),
+(10, 5, 28877, 'Arcane Affinity'),
+(10, 6, 81, 'Dodge'),
+(10, 6, 196, 'One-Handed Axes'),
+(10, 6, 197, 'Two-Handed Axes'),
+(10, 6, 200, 'Polearms'),
+(10, 6, 201, 'One-Handed Swords'),
+(10, 6, 202, 'Two-Handed Swords'),
+(10, 6, 203, 'Unarmed'),
+(10, 6, 204, 'Defense'),
+(10, 6, 522, 'SPELLDEFENSE (DND)'),
+(10, 6, 669, 'Language Orcish'),
+(10, 6, 674, 'Dual Wield'),
+(10, 6, 750, 'Plate Mail'),
+(10, 6, 813, 'Language Thalassian'),
+(10, 6, 822, 'Magic Resistance'),
+(10, 6, 1843, 'Disarm'),
+(10, 6, 2382, 'Generic'),
+(10, 6, 2479, 'Honorless Target'),
+(10, 6, 3050, 'Detect'),
+(10, 6, 3127, 'Parry'),
+(10, 6, 3275, 'Linen Bandage'),
+(10, 6, 3276, 'Heavy Linen Bandage'),
+(10, 6, 3277, 'Wool Bandage'),
+(10, 6, 3278, 'Heavy Wool Bandage'),
+(10, 6, 3365, 'Opening'),
+(10, 6, 6233, 'Closing'),
+(10, 6, 6246, 'Closing'),
+(10, 6, 6247, 'Opening'),
+(10, 6, 6477, 'Opening'),
+(10, 6, 6478, 'Opening'),
+(10, 6, 6603, 'Attack'),
+(10, 6, 7266, 'Duel'),
+(10, 6, 7267, 'Grovel'),
+(10, 6, 7355, 'Stuck'),
+(10, 6, 7928, 'Silk Bandage'),
+(10, 6, 7929, 'Heavy Silk Bandage'),
+(10, 6, 7934, 'Anti-Venom'),
+(10, 6, 8386, 'Attacking'),
+(10, 6, 8737, 'Mail'),
+(10, 6, 9077, 'Leather'),
+(10, 6, 9078, 'Cloth'),
+(10, 6, 9125, 'Generic'),
+(10, 6, 10840, 'Mageweave Bandage'),
+(10, 6, 10841, 'Heavy Mageweave Bandage'),
+(10, 6, 10846, 'First Aid'),
+(10, 6, 18629, 'Runecloth Bandage'),
+(10, 6, 18630, 'Heavy Runecloth Bandage'),
+(10, 6, 21651, 'Opening'),
+(10, 6, 21652, 'Closing'),
+(10, 6, 22027, 'Remove Insignia'),
+(10, 6, 22810, 'Opening - No Text'),
+(10, 6, 28877, 'Arcane Affinity'),
+(10, 6, 33391, 'Journeyman Riding'),
+(10, 6, 45462, 'Plague Strike'),
+(10, 6, 45477, 'Icy Touch'),
+(10, 6, 45902, 'Blood Strike'),
+(10, 6, 45903, 'Offensive State (DND)'),
+(10, 6, 45927, 'Summon Friend'),
+(10, 6, 47541, 'Death Coil'),
+(10, 6, 48266, 'Blood Presence'),
+(10, 6, 49410, 'Forceful Deflection'),
+(10, 6, 49576, 'Death Grip'),
+(10, 6, 50613, 'Arcane Torrent'),
+(10, 6, 52665, 'Sigil'),
+(10, 6, 59879, 'Blood Plague'),
+(10, 6, 59921, 'Frost Fever'),
+(10, 6, 61437, 'Opening'),
+(10, 6, 61455, 'Runic Focus'),
+(10, 8, 81, 'Dodge'),
+(10, 8, 133, 'Fireball'),
+(10, 8, 168, 'Frost Armor'),
+(10, 8, 203, 'Unarmed'),
+(10, 8, 204, 'Defense'),
+(10, 8, 227, 'Staves'),
+(10, 8, 522, 'SPELLDEFENSE (DND)'),
+(10, 8, 669, 'Language Orcish'),
+(10, 8, 813, 'Language Thalassian'),
+(10, 8, 822, 'Magic Resistance'),
+(10, 8, 2382, 'Generic'),
+(10, 8, 2479, 'Honorless Target'),
+(10, 8, 3050, 'Detect'),
+(10, 8, 3365, 'Opening'),
+(10, 8, 5009, 'Wands'),
+(10, 8, 5019, 'Shoot'),
+(10, 8, 6233, 'Closing'),
+(10, 8, 6246, 'Closing'),
+(10, 8, 6247, 'Opening'),
+(10, 8, 6477, 'Opening'),
+(10, 8, 6478, 'Opening'),
+(10, 8, 6603, 'Attack'),
+(10, 8, 7266, 'Duel'),
+(10, 8, 7267, 'Grovel'),
+(10, 8, 7355, 'Stuck'),
+(10, 8, 8386, 'Attacking'),
+(10, 8, 9078, 'Cloth'),
+(10, 8, 9125, 'Generic'),
+(10, 8, 21651, 'Opening'),
+(10, 8, 21652, 'Closing'),
+(10, 8, 22027, 'Remove Insignia'),
+(10, 8, 22810, 'Opening - No Text'),
+(10, 8, 28730, 'Arcane Torrent'),
+(10, 8, 28734, 'Mana Tap'),
+(10, 8, 28877, 'Arcane Affinity'),
+(10, 9, 81, 'Dodge'),
+(10, 9, 203, 'Unarmed'),
+(10, 9, 204, 'Defense'),
+(10, 9, 522, 'SPELLDEFENSE (DND)'),
+(10, 9, 669, 'Language Orcish'),
+(10, 9, 686, 'Shadow Bolt'),
+(10, 9, 687, 'Demon Skin'),
+(10, 9, 813, 'Language Thalassian'),
+(10, 9, 822, 'Magic Resistance'),
+(10, 9, 1180, 'Daggers'),
+(10, 9, 2382, 'Generic'),
+(10, 9, 2479, 'Honorless Target'),
+(10, 9, 3050, 'Detect'),
+(10, 9, 3365, 'Opening'),
+(10, 9, 5009, 'Wands'),
+(10, 9, 5019, 'Shoot'),
+(10, 9, 6233, 'Closing'),
+(10, 9, 6246, 'Closing'),
+(10, 9, 6247, 'Opening'),
+(10, 9, 6477, 'Opening'),
+(10, 9, 6478, 'Opening'),
+(10, 9, 6603, 'Attack'),
+(10, 9, 7266, 'Duel'),
+(10, 9, 7267, 'Grovel'),
+(10, 9, 7355, 'Stuck'),
+(10, 9, 8386, 'Attacking'),
+(10, 9, 9078, 'Cloth'),
+(10, 9, 9125, 'Generic'),
+(10, 9, 21651, 'Opening'),
+(10, 9, 21652, 'Closing'),
+(10, 9, 22027, 'Remove Insignia'),
+(10, 9, 22810, 'Opening - No Text'),
+(10, 9, 28730, 'Arcane Torrent'),
+(10, 9, 28734, 'Mana Tap'),
+(10, 9, 28877, 'Arcane Affinity'),
+(10, 9, 58284, 'Chaos Bolt Passive'),
+(11, 1, 78, 'Heroic Strike'),
+(11, 1, 81, 'Dodge'),
+(11, 1, 107, 'Block'),
+(11, 1, 198, 'One-Handed Maces'),
+(11, 1, 201, 'One-Handed Swords'),
+(11, 1, 202, 'Two-Handed Swords'),
+(11, 1, 203, 'Unarmed'),
+(11, 1, 204, 'Defense'),
+(11, 1, 522, 'SPELLDEFENSE (DND)'),
+(11, 1, 668, 'Language Common'),
+(11, 1, 1843, 'Disarm'),
+(11, 1, 2382, 'Generic'),
+(11, 1, 2457, 'Battle Stance'),
+(11, 1, 2479, 'Honorless Target'),
+(11, 1, 3050, 'Detect'),
+(11, 1, 3365, 'Opening'),
+(11, 1, 5301, 'Defensive State (DND)'),
+(11, 1, 6233, 'Closing'),
+(11, 1, 6246, 'Closing'),
+(11, 1, 6247, 'Opening'),
+(11, 1, 6477, 'Opening'),
+(11, 1, 6478, 'Opening'),
+(11, 1, 6562, 'Heroic Presence'),
+(11, 1, 6603, 'Attack'),
+(11, 1, 7266, 'Duel'),
+(11, 1, 7267, 'Grovel'),
+(11, 1, 7355, 'Stuck'),
+(11, 1, 8386, 'Attacking'),
+(11, 1, 8737, 'Mail'),
+(11, 1, 9077, 'Leather'),
+(11, 1, 9078, 'Cloth'),
+(11, 1, 9116, 'Shield'),
+(11, 1, 9125, 'Generic'),
+(11, 1, 21651, 'Opening'),
+(11, 1, 21652, 'Closing'),
+(11, 1, 22027, 'Remove Insignia'),
+(11, 1, 22810, 'Opening - No Text'),
+(11, 1, 28875, 'Gemcutting'),
+(11, 1, 28880, 'Gift of the Naaru'),
+(11, 1, 29932, 'Language Draenei'),
+(11, 1, 32215, 'Victorious State'),
+(11, 1, 45927, 'Summon Friend'),
+(11, 1, 59221, 'Shadow Resistance'),
+(11, 1, 61437, 'Opening'),
+(11, 2, 81, 'Dodge'),
+(11, 2, 107, 'Block'),
+(11, 2, 198, 'One-Handed Maces'),
+(11, 2, 199, 'Two-Handed Maces'),
+(11, 2, 203, 'Unarmed'),
+(11, 2, 204, 'Defense'),
+(11, 2, 522, 'SPELLDEFENSE (DND)'),
+(11, 2, 635, 'Holy Light'),
+(11, 2, 668, 'Language Common'),
+(11, 2, 1843, 'Disarm'),
+(11, 2, 2382, 'Generic'),
+(11, 2, 2479, 'Honorless Target'),
+(11, 2, 3050, 'Detect'),
+(11, 2, 3365, 'Opening'),
+(11, 2, 6233, 'Closing'),
+(11, 2, 6246, 'Closing'),
+(11, 2, 6247, 'Opening'),
+(11, 2, 6477, 'Opening'),
+(11, 2, 6478, 'Opening'),
+(11, 2, 6562, 'Heroic Presence'),
+(11, 2, 6603, 'Attack'),
+(11, 2, 7266, 'Duel'),
+(11, 2, 7267, 'Grovel'),
+(11, 2, 7355, 'Stuck'),
+(11, 2, 8386, 'Attacking'),
+(11, 2, 8737, 'Mail'),
+(11, 2, 9077, 'Leather'),
+(11, 2, 9078, 'Cloth'),
+(11, 2, 9116, 'Shield'),
+(11, 2, 9125, 'Generic'),
+(11, 2, 21084, 'Seal of Righteousness'),
+(11, 2, 21651, 'Opening'),
+(11, 2, 21652, 'Closing'),
+(11, 2, 22027, 'Remove Insignia'),
+(11, 2, 22810, 'Opening - No Text'),
+(11, 2, 27762, 'Libram'),
+(11, 2, 28875, 'Gemcutting'),
+(11, 2, 29932, 'Language Draenei'),
+(11, 2, 45927, 'Summon Friend'),
+(11, 2, 59221, 'Shadow Resistance'),
+(11, 2, 59542, 'Gift of the Naaru'),
+(11, 2, 61437, 'Opening'),
+(11, 3, 75, 'Auto Shot'),
+(11, 3, 81, 'Dodge'),
+(11, 3, 201, 'One-Handed Swords'),
+(11, 3, 203, 'Unarmed'),
+(11, 3, 204, 'Defense'),
+(11, 3, 522, 'SPELLDEFENSE (DND)'),
+(11, 3, 668, 'Language Common'),
+(11, 3, 1843, 'Disarm'),
+(11, 3, 2382, 'Generic'),
+(11, 3, 2479, 'Honorless Target'),
+(11, 3, 2973, 'Raptor Strike'),
+(11, 3, 3050, 'Detect'),
+(11, 3, 3365, 'Opening'),
+(11, 3, 5011, 'Crossbows'),
+(11, 3, 6233, 'Closing'),
+(11, 3, 6246, 'Closing'),
+(11, 3, 6247, 'Opening'),
+(11, 3, 6477, 'Opening'),
+(11, 3, 6478, 'Opening'),
+(11, 3, 6562, 'Heroic Presence'),
+(11, 3, 6603, 'Attack'),
+(11, 3, 7266, 'Duel'),
+(11, 3, 7267, 'Grovel'),
+(11, 3, 7355, 'Stuck'),
+(11, 3, 8386, 'Attacking'),
+(11, 3, 9077, 'Leather'),
+(11, 3, 9078, 'Cloth'),
+(11, 3, 9125, 'Generic'),
+(11, 3, 13358, 'Defensive State (DND)'),
+(11, 3, 21651, 'Opening'),
+(11, 3, 21652, 'Closing'),
+(11, 3, 22027, 'Remove Insignia'),
+(11, 3, 22810, 'Opening - No Text'),
+(11, 3, 24949, 'Defensive State 2 (DND)'),
+(11, 3, 28875, 'Gemcutting'),
+(11, 3, 29932, 'Language Draenei'),
+(11, 3, 34082, 'Advantaged State (DND)'),
+(11, 3, 45927, 'Summon Friend'),
+(11, 3, 59221, 'Shadow Resistance'),
+(11, 3, 59543, 'Gift of the Naaru'),
+(11, 3, 61437, 'Opening'),
+(11, 5, 81, 'Dodge'),
+(11, 5, 198, 'One-Handed Maces'),
+(11, 5, 203, 'Unarmed'),
+(11, 5, 204, 'Defense'),
+(11, 5, 522, 'SPELLDEFENSE (DND)'),
+(11, 5, 585, 'Smite'),
+(11, 5, 668, 'Language Common'),
+(11, 5, 1843, 'Disarm'),
+(11, 5, 2050, 'Lesser Heal'),
+(11, 5, 2382, 'Generic'),
+(11, 5, 2479, 'Honorless Target'),
+(11, 5, 3050, 'Detect'),
+(11, 5, 3365, 'Opening'),
+(11, 5, 5009, 'Wands'),
+(11, 5, 5019, 'Shoot'),
+(11, 5, 6233, 'Closing'),
+(11, 5, 6246, 'Closing'),
+(11, 5, 6247, 'Opening'),
+(11, 5, 6477, 'Opening'),
+(11, 5, 6478, 'Opening'),
+(11, 5, 6603, 'Attack'),
+(11, 5, 7266, 'Duel'),
+(11, 5, 7267, 'Grovel'),
+(11, 5, 7355, 'Stuck'),
+(11, 5, 8386, 'Attacking'),
+(11, 5, 9078, 'Cloth'),
+(11, 5, 9125, 'Generic'),
+(11, 5, 21651, 'Opening'),
+(11, 5, 21652, 'Closing'),
+(11, 5, 22027, 'Remove Insignia'),
+(11, 5, 22810, 'Opening - No Text'),
+(11, 5, 28875, 'Gemcutting'),
+(11, 5, 28878, 'Inspiring Presence'),
+(11, 5, 29932, 'Language Draenei'),
+(11, 5, 45927, 'Summon Friend'),
+(11, 5, 59221, 'Shadow Resistance'),
+(11, 5, 59544, 'Gift of the Naaru'),
+(11, 5, 61437, 'Opening'),
+(11, 6, 81, 'Dodge'),
+(11, 6, 196, 'One-Handed Axes'),
+(11, 6, 197, 'Two-Handed Axes'),
+(11, 6, 200, 'Polearms'),
+(11, 6, 201, 'One-Handed Swords'),
+(11, 6, 202, 'Two-Handed Swords'),
+(11, 6, 203, 'Unarmed'),
+(11, 6, 204, 'Defense'),
+(11, 6, 522, 'SPELLDEFENSE (DND)'),
+(11, 6, 668, 'Language Common'),
+(11, 6, 674, 'Dual Wield'),
+(11, 6, 750, 'Plate Mail'),
+(11, 6, 1843, 'Disarm'),
+(11, 6, 2382, 'Generic'),
+(11, 6, 2479, 'Honorless Target'),
+(11, 6, 3050, 'Detect'),
+(11, 6, 3127, 'Parry'),
+(11, 6, 3275, 'Linen Bandage'),
+(11, 6, 3276, 'Heavy Linen Bandage'),
+(11, 6, 3277, 'Wool Bandage'),
+(11, 6, 3278, 'Heavy Wool Bandage'),
+(11, 6, 3365, 'Opening'),
+(11, 6, 6233, 'Closing'),
+(11, 6, 6246, 'Closing'),
+(11, 6, 6247, 'Opening'),
+(11, 6, 6477, 'Opening'),
+(11, 6, 6478, 'Opening'),
+(11, 6, 6562, 'Heroic Presence'),
+(11, 6, 6603, 'Attack'),
+(11, 6, 7266, 'Duel'),
+(11, 6, 7267, 'Grovel'),
+(11, 6, 7355, 'Stuck'),
+(11, 6, 7928, 'Silk Bandage'),
+(11, 6, 7929, 'Heavy Silk Bandage'),
+(11, 6, 7934, 'Anti-Venom'),
+(11, 6, 8386, 'Attacking'),
+(11, 6, 8737, 'Mail'),
+(11, 6, 9077, 'Leather'),
+(11, 6, 9078, 'Cloth'),
+(11, 6, 9125, 'Generic'),
+(11, 6, 10840, 'Mageweave Bandage'),
+(11, 6, 10841, 'Heavy Mageweave Bandage'),
+(11, 6, 10846, 'First Aid'),
+(11, 6, 18629, 'Runecloth Bandage'),
+(11, 6, 18630, 'Heavy Runecloth Bandage'),
+(11, 6, 21651, 'Opening'),
+(11, 6, 21652, 'Closing'),
+(11, 6, 22027, 'Remove Insignia'),
+(11, 6, 22810, 'Opening - No Text'),
+(11, 6, 28875, 'Gemcutting'),
+(11, 6, 29932, 'Language Draenei'),
+(11, 6, 33391, 'Journeyman Riding'),
+(11, 6, 45462, 'Plague Strike'),
+(11, 6, 45477, 'Icy Touch'),
+(11, 6, 45902, 'Blood Strike'),
+(11, 6, 45903, 'Offensive State (DND)'),
+(11, 6, 45927, 'Summon Friend'),
+(11, 6, 47541, 'Death Coil'),
+(11, 6, 48266, 'Blood Presence'),
+(11, 6, 49410, 'Forceful Deflection'),
+(11, 6, 49576, 'Death Grip'),
+(11, 6, 52665, 'Sigil'),
+(11, 6, 59221, 'Shadow Resistance'),
+(11, 6, 59539, 'Shadow Resistance'),
+(11, 6, 59545, 'Gift of the Naaru'),
+(11, 6, 59879, 'Blood Plague'),
+(11, 6, 59921, 'Frost Fever'),
+(11, 6, 61437, 'Opening'),
+(11, 6, 61455, 'Runic Focus'),
+(11, 7, 81, 'Dodge'),
+(11, 7, 107, 'Block'),
+(11, 7, 198, 'One-Handed Maces'),
+(11, 7, 203, 'Unarmed'),
+(11, 7, 204, 'Defense'),
+(11, 7, 227, 'Staves'),
+(11, 7, 331, 'Healing Wave'),
+(11, 7, 403, 'Lightning Bolt'),
+(11, 7, 522, 'SPELLDEFENSE (DND)'),
+(11, 7, 668, 'Language Common'),
+(11, 7, 1843, 'Disarm'),
+(11, 7, 2382, 'Generic'),
+(11, 7, 2479, 'Honorless Target'),
+(11, 7, 3050, 'Detect'),
+(11, 7, 3365, 'Opening'),
+(11, 7, 6233, 'Closing'),
+(11, 7, 6246, 'Closing'),
+(11, 7, 6247, 'Opening'),
+(11, 7, 6477, 'Opening'),
+(11, 7, 6478, 'Opening'),
+(11, 7, 6603, 'Attack'),
+(11, 7, 7266, 'Duel'),
+(11, 7, 7267, 'Grovel'),
+(11, 7, 7355, 'Stuck'),
+(11, 7, 8386, 'Attacking'),
+(11, 7, 9077, 'Leather'),
+(11, 7, 9078, 'Cloth'),
+(11, 7, 9116, 'Shield'),
+(11, 7, 9125, 'Generic'),
+(11, 7, 21651, 'Opening'),
+(11, 7, 21652, 'Closing'),
+(11, 7, 22027, 'Remove Insignia'),
+(11, 7, 22810, 'Opening - No Text'),
+(11, 7, 27763, 'Totem'),
+(11, 7, 28875, 'Gemcutting'),
+(11, 7, 28878, 'Inspiring Presence'),
+(11, 7, 29932, 'Language Draenei'),
+(11, 7, 45927, 'Summon Friend'),
+(11, 7, 59221, 'Shadow Resistance'),
+(11, 7, 59547, 'Gift of the Naaru'),
+(11, 7, 61437, 'Opening'),
+(11, 8, 81, 'Dodge'),
+(11, 8, 133, 'Fireball'),
+(11, 8, 168, 'Frost Armor'),
+(11, 8, 203, 'Unarmed'),
+(11, 8, 204, 'Defense'),
+(11, 8, 227, 'Staves'),
+(11, 8, 522, 'SPELLDEFENSE (DND)'),
+(11, 8, 668, 'Language Common'),
+(11, 8, 1843, 'Disarm'),
+(11, 8, 2382, 'Generic'),
+(11, 8, 2479, 'Honorless Target'),
+(11, 8, 3050, 'Detect'),
+(11, 8, 3365, 'Opening'),
+(11, 8, 5009, 'Wands'),
+(11, 8, 5019, 'Shoot'),
+(11, 8, 6233, 'Closing'),
+(11, 8, 6246, 'Closing'),
+(11, 8, 6247, 'Opening'),
+(11, 8, 6477, 'Opening'),
+(11, 8, 6478, 'Opening'),
+(11, 8, 6603, 'Attack'),
+(11, 8, 7266, 'Duel'),
+(11, 8, 7267, 'Grovel'),
+(11, 8, 7355, 'Stuck'),
+(11, 8, 8386, 'Attacking'),
+(11, 8, 9078, 'Cloth'),
+(11, 8, 9125, 'Generic'),
+(11, 8, 21651, 'Opening'),
+(11, 8, 21652, 'Closing'),
+(11, 8, 22027, 'Remove Insignia'),
+(11, 8, 22810, 'Opening - No Text'),
+(11, 8, 28875, 'Gemcutting'),
+(11, 8, 28878, 'Inspiring Presence'),
+(11, 8, 29932, 'Language Draenei'),
+(11, 8, 45927, 'Summon Friend'),
+(11, 8, 59221, 'Shadow Resistance'),
+(11, 8, 59548, 'Gift of the Naaru'),
+(11, 8, 61437, 'Opening');
+
+-- player_classlevelstats
+INSERT IGNORE INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES
+(1, 1, 20, 0),
+(1, 2, 29, 0),
+(1, 3, 38, 0),
+(1, 4, 47, 0),
+(1, 5, 56, 0),
+(1, 6, 65, 0),
+(1, 7, 74, 0),
+(1, 8, 83, 0),
+(1, 9, 92, 0),
+(1, 10, 101, 0),
+(1, 11, 100, 0),
+(1, 12, 109, 0),
+(1, 13, 118, 0),
+(1, 14, 128, 0),
+(1, 15, 139, 0),
+(1, 16, 151, 0),
+(1, 17, 154, 0),
+(1, 18, 168, 0),
+(1, 19, 183, 0),
+(1, 20, 199, 0),
+(1, 21, 206, 0),
+(1, 22, 224, 0),
+(1, 23, 243, 0),
+(1, 24, 253, 0),
+(1, 25, 274, 0),
+(1, 26, 296, 0),
+(1, 27, 309, 0),
+(1, 28, 333, 0),
+(1, 29, 348, 0),
+(1, 30, 374, 0),
+(1, 31, 401, 0),
+(1, 32, 419, 0),
+(1, 33, 448, 0),
+(1, 34, 468, 0),
+(1, 35, 499, 0),
+(1, 36, 521, 0),
+(1, 37, 545, 0),
+(1, 38, 581, 0),
+(1, 39, 609, 0),
+(1, 40, 649, 0),
+(1, 41, 681, 0),
+(1, 42, 715, 0),
+(1, 43, 761, 0),
+(1, 44, 799, 0),
+(1, 45, 839, 0),
+(1, 46, 881, 0),
+(1, 47, 935, 0),
+(1, 48, 981, 0),
+(1, 49, 1029, 0),
+(1, 50, 1079, 0),
+(1, 51, 1131, 0),
+(1, 52, 1185, 0),
+(1, 53, 1241, 0),
+(1, 54, 1299, 0),
+(1, 55, 1359, 0),
+(1, 56, 1421, 0),
+(1, 57, 1485, 0),
+(1, 58, 1551, 0),
+(1, 59, 1619, 0),
+(1, 60, 1689, 0),
+(1, 61, 1902, 0),
+(1, 62, 2129, 0),
+(1, 63, 2357, 0),
+(1, 64, 2612, 0),
+(1, 65, 2883, 0),
+(1, 66, 3169, 0),
+(1, 67, 3455, 0),
+(1, 68, 3774, 0),
+(1, 69, 4109, 0),
+(1, 70, 4444, 0),
+(1, 71, 4720, 0),
+(1, 72, 5013, 0),
+(1, 73, 5325, 0),
+(1, 74, 5656, 0),
+(1, 75, 6008, 0),
+(1, 76, 6381, 0),
+(1, 77, 6778, 0),
+(1, 78, 7198, 0),
+(1, 79, 7646, 0),
+(1, 80, 8121, 0),
+(2, 1, 28, 60),
+(2, 2, 36, 78),
+(2, 3, 44, 98),
+(2, 4, 52, 104),
+(2, 5, 60, 111),
+(2, 6, 68, 134),
+(2, 7, 76, 143),
+(2, 8, 84, 153),
+(2, 9, 92, 179),
+(2, 10, 100, 192),
+(2, 11, 108, 205),
+(2, 12, 116, 219),
+(2, 13, 124, 249),
+(2, 14, 132, 265),
+(2, 15, 131, 282),
+(2, 16, 141, 315),
+(2, 17, 152, 334),
+(2, 18, 164, 354),
+(2, 19, 177, 390),
+(2, 20, 191, 412),
+(2, 21, 206, 435),
+(2, 22, 222, 459),
+(2, 23, 239, 499),
+(2, 24, 247, 525),
+(2, 25, 266, 552),
+(2, 26, 286, 579),
+(2, 27, 307, 621),
+(2, 28, 329, 648),
+(2, 29, 342, 675),
+(2, 30, 366, 702),
+(2, 31, 391, 729),
+(2, 32, 407, 756),
+(2, 33, 434, 798),
+(2, 34, 462, 825),
+(2, 35, 481, 852),
+(2, 36, 511, 879),
+(2, 37, 542, 906),
+(2, 38, 564, 933),
+(2, 39, 597, 960),
+(2, 40, 621, 987),
+(2, 41, 656, 1014),
+(2, 42, 682, 1041),
+(2, 43, 719, 1068),
+(2, 44, 747, 1110),
+(2, 45, 786, 1137),
+(2, 46, 816, 1164),
+(2, 47, 857, 1176),
+(2, 48, 889, 1203),
+(2, 49, 922, 1230),
+(2, 50, 966, 1257),
+(2, 51, 1001, 1284),
+(2, 52, 1037, 1311),
+(2, 53, 1084, 1338),
+(2, 54, 1122, 1365),
+(2, 55, 1161, 1392),
+(2, 56, 1201, 1419),
+(2, 57, 1252, 1446),
+(2, 58, 1294, 1458),
+(2, 59, 1337, 1485),
+(2, 60, 1381, 1512),
+(2, 61, 1540, 1656),
+(2, 62, 1708, 1800),
+(2, 63, 1884, 1944),
+(2, 64, 2068, 2088),
+(2, 65, 2262, 2232),
+(2, 66, 2466, 2377),
+(2, 67, 2679, 2521),
+(2, 68, 2901, 2665),
+(2, 69, 3134, 2809),
+(2, 70, 3377, 2953),
+(2, 71, 3629, 3097),
+(2, 72, 3900, 3241),
+(2, 73, 4191, 3385),
+(2, 74, 4503, 3529),
+(2, 75, 4839, 3673),
+(2, 76, 5200, 3817),
+(2, 77, 5588, 3962),
+(2, 78, 6005, 4106),
+(2, 79, 6453, 4250),
+(2, 80, 6934, 4394),
+(3, 1, 46, 65),
+(3, 2, 53, 70),
+(3, 3, 60, 76),
+(3, 4, 67, 98),
+(3, 5, 74, 106),
+(3, 6, 81, 130),
+(3, 7, 88, 140),
+(3, 8, 95, 166),
+(3, 9, 102, 193),
+(3, 10, 109, 206),
+(3, 11, 116, 235),
+(3, 12, 123, 250),
+(3, 13, 130, 266),
+(3, 14, 138, 298),
+(3, 15, 147, 316),
+(3, 16, 157, 350),
+(3, 17, 168, 370),
+(3, 18, 180, 391),
+(3, 19, 193, 428),
+(3, 20, 207, 451),
+(3, 21, 222, 475),
+(3, 22, 238, 515),
+(3, 23, 255, 541),
+(3, 24, 273, 568),
+(3, 25, 292, 611),
+(3, 26, 312, 640),
+(3, 27, 333, 670),
+(3, 28, 355, 715),
+(3, 29, 378, 745),
+(3, 30, 402, 775),
+(3, 31, 417, 805),
+(3, 32, 443, 850),
+(3, 33, 470, 880),
+(3, 34, 498, 910),
+(3, 35, 527, 940),
+(3, 36, 547, 970),
+(3, 37, 578, 1015),
+(3, 38, 610, 1045),
+(3, 39, 643, 1075),
+(3, 40, 667, 1105),
+(3, 41, 702, 1135),
+(3, 42, 738, 1180),
+(3, 43, 775, 1210),
+(3, 44, 803, 1240),
+(3, 45, 842, 1270),
+(3, 46, 872, 1300),
+(3, 47, 913, 1330),
+(3, 48, 955, 1360),
+(3, 49, 994, 1390),
+(3, 50, 1047, 1420),
+(3, 51, 1067, 1450),
+(3, 52, 1113, 1480),
+(3, 53, 1150, 1510),
+(3, 54, 1198, 1540),
+(3, 55, 1237, 1570),
+(3, 56, 1287, 1600),
+(3, 57, 1328, 1630),
+(3, 58, 1370, 1660),
+(3, 59, 1423, 1690),
+(3, 60, 1467, 1720),
+(3, 61, 1633, 1886),
+(3, 62, 1819, 2053),
+(3, 63, 2003, 2219),
+(3, 64, 2195, 2385),
+(3, 65, 2397, 2552),
+(3, 66, 2623, 2718),
+(3, 67, 2844, 2884),
+(3, 68, 3075, 3050),
+(3, 69, 3316, 3217),
+(3, 70, 3568, 3383),
+(3, 71, 3834, 3549),
+(3, 72, 4120, 3716),
+(3, 73, 4427, 3882),
+(3, 74, 4757, 4048),
+(3, 75, 5112, 4215),
+(3, 76, 5493, 4381),
+(3, 77, 5903, 4547),
+(3, 78, 6343, 4713),
+(3, 79, 6816, 4880),
+(3, 80, 7324, 5046),
+(4, 1, 25, 0),
+(4, 2, 32, 0),
+(4, 3, 49, 0),
+(4, 4, 56, 0),
+(4, 5, 63, 0),
+(4, 6, 70, 0),
+(4, 7, 87, 0),
+(4, 8, 94, 0),
+(4, 9, 101, 0),
+(4, 10, 118, 0),
+(4, 11, 125, 0),
+(4, 12, 142, 0),
+(4, 13, 149, 0),
+(4, 14, 156, 0),
+(4, 15, 173, 0),
+(4, 16, 181, 0),
+(4, 17, 190, 0),
+(4, 18, 200, 0),
+(4, 19, 221, 0),
+(4, 20, 233, 0),
+(4, 21, 246, 0),
+(4, 22, 260, 0),
+(4, 23, 275, 0),
+(4, 24, 301, 0),
+(4, 25, 318, 0),
+(4, 26, 336, 0),
+(4, 27, 355, 0),
+(4, 28, 375, 0),
+(4, 29, 396, 0),
+(4, 30, 428, 0),
+(4, 31, 451, 0),
+(4, 32, 475, 0),
+(4, 33, 500, 0),
+(4, 34, 526, 0),
+(4, 35, 553, 0),
+(4, 36, 581, 0),
+(4, 37, 610, 0),
+(4, 38, 640, 0),
+(4, 39, 671, 0),
+(4, 40, 703, 0),
+(4, 41, 736, 0),
+(4, 42, 770, 0),
+(4, 43, 805, 0),
+(4, 44, 841, 0),
+(4, 45, 878, 0),
+(4, 46, 916, 0),
+(4, 47, 955, 0),
+(4, 48, 995, 0),
+(4, 49, 1026, 0),
+(4, 50, 1068, 0),
+(4, 51, 1111, 0),
+(4, 52, 1155, 0),
+(4, 53, 1200, 0),
+(4, 54, 1246, 0),
+(4, 55, 1283, 0),
+(4, 56, 1331, 0),
+(4, 57, 1380, 0),
+(4, 58, 1430, 0),
+(4, 59, 1471, 0),
+(4, 60, 1523, 0),
+(4, 61, 1702, 0),
+(4, 62, 1879, 0),
+(4, 63, 2077, 0),
+(4, 64, 2285, 0),
+(4, 65, 2489, 0),
+(4, 66, 2717, 0),
+(4, 67, 2941, 0),
+(4, 68, 3190, 0),
+(4, 69, 3450, 0),
+(4, 70, 3704, 0),
+(4, 71, 3980, 0),
+(4, 72, 4277, 0),
+(4, 73, 4596, 0),
+(4, 74, 4939, 0),
+(4, 75, 5307, 0),
+(4, 76, 5703, 0),
+(4, 77, 6128, 0),
+(4, 78, 6585, 0),
+(4, 79, 7076, 0),
+(4, 80, 7604, 0),
+(5, 1, 52, 73),
+(5, 2, 57, 76),
+(5, 3, 72, 95),
+(5, 4, 77, 114),
+(5, 5, 92, 133),
+(5, 6, 97, 152),
+(5, 7, 112, 171),
+(5, 8, 117, 190),
+(5, 9, 132, 209),
+(5, 10, 137, 212),
+(5, 11, 142, 215),
+(5, 12, 157, 234),
+(5, 13, 172, 254),
+(5, 14, 177, 260),
+(5, 15, 192, 282),
+(5, 16, 197, 305),
+(5, 17, 212, 329),
+(5, 18, 227, 339),
+(5, 19, 232, 365),
+(5, 20, 247, 377),
+(5, 21, 252, 405),
+(5, 22, 268, 434),
+(5, 23, 275, 449),
+(5, 24, 293, 480),
+(5, 25, 302, 497),
+(5, 26, 322, 530),
+(5, 27, 343, 549),
+(5, 28, 355, 584),
+(5, 29, 378, 605),
+(5, 30, 392, 627),
+(5, 31, 417, 665),
+(5, 32, 433, 689),
+(5, 33, 460, 728),
+(5, 34, 478, 752),
+(5, 35, 507, 776),
+(5, 36, 527, 800),
+(5, 37, 548, 839),
+(5, 38, 580, 863),
+(5, 39, 603, 887),
+(5, 40, 637, 911),
+(5, 41, 662, 950),
+(5, 42, 698, 974),
+(5, 43, 725, 998),
+(5, 44, 763, 1022),
+(5, 45, 792, 1046),
+(5, 46, 822, 1070),
+(5, 47, 863, 1094),
+(5, 48, 895, 1118),
+(5, 49, 928, 1142),
+(5, 50, 972, 1166),
+(5, 51, 1007, 1190),
+(5, 52, 1053, 1214),
+(5, 53, 1090, 1238),
+(5, 54, 1128, 1262),
+(5, 55, 1177, 1271),
+(5, 56, 1217, 1295),
+(5, 57, 1258, 1319),
+(5, 58, 1300, 1343),
+(5, 59, 1353, 1352),
+(5, 60, 1397, 1376),
+(5, 61, 1557, 1500),
+(5, 62, 1738, 1625),
+(5, 63, 1916, 1749),
+(5, 64, 2101, 1873),
+(5, 65, 2295, 1998),
+(5, 66, 2495, 2122),
+(5, 67, 2719, 2247),
+(5, 68, 2936, 2371),
+(5, 69, 3160, 2495),
+(5, 70, 3391, 2620),
+(5, 71, 3644, 2744),
+(5, 72, 3916, 2868),
+(5, 73, 4208, 2993),
+(5, 74, 4522, 3117),
+(5, 75, 4859, 3242),
+(5, 76, 5221, 3366),
+(5, 77, 5610, 3490),
+(5, 78, 6028, 3615),
+(5, 79, 6477, 3739),
+(5, 80, 6960, 3863),
+(6, 1, 22, 0),
+(6, 2, 27, 0),
+(6, 3, 32, 0),
+(6, 4, 37, 0),
+(6, 5, 42, 0),
+(6, 6, 47, 0),
+(6, 7, 52, 0),
+(6, 8, 58, 0),
+(6, 9, 64, 0),
+(6, 10, 70, 0),
+(6, 11, 77, 0),
+(6, 12, 84, 0),
+(6, 13, 92, 0),
+(6, 14, 100, 0),
+(6, 15, 117, 0),
+(6, 16, 127, 0),
+(6, 17, 138, 0),
+(6, 18, 150, 0),
+(6, 19, 163, 0),
+(6, 20, 177, 0),
+(6, 21, 192, 0),
+(6, 22, 208, 0),
+(6, 23, 225, 0),
+(6, 24, 239, 0),
+(6, 25, 258, 0),
+(6, 26, 278, 0),
+(6, 27, 299, 0),
+(6, 28, 321, 0),
+(6, 29, 344, 0),
+(6, 30, 368, 0),
+(6, 31, 393, 0),
+(6, 32, 419, 0),
+(6, 33, 446, 0),
+(6, 34, 474, 0),
+(6, 35, 503, 0),
+(6, 36, 533, 0),
+(6, 37, 564, 0),
+(6, 38, 596, 0),
+(6, 39, 629, 0),
+(6, 40, 698, 0),
+(6, 41, 698, 0),
+(6, 42, 734, 0),
+(6, 43, 771, 0),
+(6, 44, 809, 0),
+(6, 45, 849, 0),
+(6, 46, 891, 0),
+(6, 47, 935, 0),
+(6, 48, 981, 0),
+(6, 49, 1029, 0),
+(6, 50, 1079, 0),
+(6, 51, 1131, 0),
+(6, 52, 1185, 0),
+(6, 53, 1241, 0),
+(6, 54, 1299, 0),
+(6, 55, 1359, 0),
+(6, 56, 1421, 0),
+(6, 57, 1485, 0),
+(6, 58, 1551, 0),
+(6, 59, 1619, 0),
+(6, 60, 1689, 0),
+(6, 61, 1902, 0),
+(6, 62, 2129, 0),
+(6, 63, 2357, 0),
+(6, 64, 2612, 0),
+(6, 65, 2883, 0),
+(6, 66, 3169, 0),
+(6, 67, 3455, 0),
+(6, 68, 3774, 0),
+(6, 69, 4109, 0),
+(6, 70, 4444, 0),
+(6, 71, 4720, 0),
+(6, 72, 5013, 0),
+(6, 73, 5325, 0),
+(6, 74, 5656, 0),
+(6, 75, 6008, 0),
+(6, 76, 6381, 0),
+(6, 77, 6778, 0),
+(6, 78, 7199, 0),
+(6, 79, 7646, 0),
+(6, 80, 8121, 0),
+(7, 1, 37, 85),
+(7, 2, 44, 91),
+(7, 3, 51, 98),
+(7, 4, 58, 106),
+(7, 5, 65, 115),
+(7, 6, 72, 125),
+(7, 7, 79, 136),
+(7, 8, 86, 148),
+(7, 9, 93, 161),
+(7, 10, 100, 175),
+(7, 11, 107, 190),
+(7, 12, 114, 206),
+(7, 13, 121, 223),
+(7, 14, 128, 241),
+(7, 15, 135, 260),
+(7, 16, 142, 280),
+(7, 17, 150, 301),
+(7, 18, 159, 323),
+(7, 19, 169, 346),
+(7, 20, 180, 370),
+(7, 21, 192, 395),
+(7, 22, 205, 421),
+(7, 23, 219, 448),
+(7, 24, 234, 476),
+(7, 25, 240, 505),
+(7, 26, 257, 535),
+(7, 27, 275, 566),
+(7, 28, 294, 598),
+(7, 29, 314, 631),
+(7, 30, 335, 665),
+(7, 31, 347, 699),
+(7, 32, 370, 733),
+(7, 33, 394, 767),
+(7, 34, 419, 786),
+(7, 35, 435, 820),
+(7, 36, 462, 854),
+(7, 37, 490, 888),
+(7, 38, 509, 922),
+(7, 39, 539, 941),
+(7, 40, 570, 975),
+(7, 41, 592, 1009),
+(7, 42, 625, 1028),
+(7, 43, 649, 1062),
+(7, 44, 684, 1096),
+(7, 45, 710, 1115),
+(7, 46, 747, 1149),
+(7, 47, 775, 1183),
+(7, 48, 814, 1202),
+(7, 49, 844, 1236),
+(7, 50, 885, 1255),
+(7, 51, 917, 1289),
+(7, 52, 960, 1323),
+(7, 53, 994, 1342),
+(7, 54, 1029, 1376),
+(7, 55, 1075, 1395),
+(7, 56, 1112, 1414),
+(7, 57, 1150, 1448),
+(7, 58, 1199, 1467),
+(7, 59, 1239, 1501),
+(7, 60, 1330, 1520),
+(7, 61, 1428, 1664),
+(7, 62, 1583, 1808),
+(7, 63, 1760, 1951),
+(7, 64, 1932, 2095),
+(7, 65, 2114, 2239),
+(7, 66, 2304, 2383),
+(7, 67, 2504, 2527),
+(7, 68, 2713, 2670),
+(7, 69, 2931, 2814),
+(7, 70, 3159, 2958),
+(7, 71, 3395, 3102),
+(7, 72, 3648, 3246),
+(7, 73, 3920, 3389),
+(7, 74, 4212, 3533),
+(7, 75, 4526, 3677),
+(7, 76, 4863, 3821),
+(7, 77, 5226, 3965),
+(7, 78, 5616, 4108),
+(7, 79, 6035, 4252),
+(7, 80, 6485, 4396),
+(8, 1, 32, 100),
+(8, 2, 47, 110),
+(8, 3, 52, 106),
+(8, 4, 67, 118),
+(8, 5, 82, 131),
+(8, 6, 97, 130),
+(8, 7, 102, 145),
+(8, 8, 117, 146),
+(8, 9, 132, 163),
+(8, 10, 137, 196),
+(8, 11, 152, 215),
+(8, 12, 167, 220),
+(8, 13, 172, 241),
+(8, 14, 187, 263),
+(8, 15, 202, 271),
+(8, 16, 207, 295),
+(8, 17, 222, 305),
+(8, 18, 237, 331),
+(8, 19, 242, 343),
+(8, 20, 257, 371),
+(8, 21, 272, 385),
+(8, 22, 277, 415),
+(8, 23, 292, 431),
+(8, 24, 298, 463),
+(8, 25, 315, 481),
+(8, 26, 333, 515),
+(8, 27, 342, 535),
+(8, 28, 362, 556),
+(8, 29, 373, 592),
+(8, 30, 395, 613),
+(8, 31, 418, 634),
+(8, 32, 432, 670),
+(8, 33, 457, 691),
+(8, 34, 473, 712),
+(8, 35, 500, 733),
+(8, 36, 518, 754),
+(8, 37, 547, 790),
+(8, 38, 577, 811),
+(8, 39, 598, 832),
+(8, 40, 630, 853),
+(8, 41, 653, 874),
+(8, 42, 687, 895),
+(8, 43, 712, 916),
+(8, 44, 748, 937),
+(8, 45, 775, 958),
+(8, 46, 813, 979),
+(8, 47, 842, 1000),
+(8, 48, 882, 1021),
+(8, 49, 913, 1042),
+(8, 50, 955, 1048),
+(8, 51, 988, 1069),
+(8, 52, 1032, 1090),
+(8, 53, 1067, 1111),
+(8, 54, 1103, 1117),
+(8, 55, 1150, 1138),
+(8, 56, 1188, 1159),
+(8, 57, 1237, 1165),
+(8, 58, 1277, 1186),
+(8, 59, 1328, 1192),
+(8, 60, 1370, 1213),
+(8, 61, 1526, 1316),
+(8, 62, 1702, 1419),
+(8, 63, 1875, 1521),
+(8, 64, 2070, 1624),
+(8, 65, 2261, 1727),
+(8, 66, 2461, 1830),
+(8, 67, 2686, 1932),
+(8, 68, 2906, 2035),
+(8, 69, 3136, 2138),
+(8, 70, 3393, 2241),
+(8, 71, 3646, 2343),
+(8, 72, 3918, 2446),
+(8, 73, 4210, 2549),
+(8, 74, 4524, 2652),
+(8, 75, 4861, 2754),
+(8, 76, 5223, 2857),
+(8, 77, 5612, 2960),
+(8, 78, 6030, 3063),
+(8, 79, 6480, 3165),
+(8, 80, 6963, 3268),
+(9, 1, 23, 90),
+(9, 2, 28, 98),
+(9, 3, 43, 107),
+(9, 4, 48, 102),
+(9, 5, 63, 113),
+(9, 6, 68, 126),
+(9, 7, 83, 144),
+(9, 8, 88, 162),
+(9, 9, 93, 180),
+(9, 10, 108, 198),
+(9, 11, 123, 200),
+(9, 12, 128, 218),
+(9, 13, 143, 237),
+(9, 14, 148, 257),
+(9, 15, 153, 278),
+(9, 16, 168, 300),
+(9, 17, 173, 308),
+(9, 18, 189, 332),
+(9, 19, 196, 357),
+(9, 20, 204, 383),
+(9, 21, 223, 395),
+(9, 22, 233, 423),
+(9, 23, 244, 452),
+(9, 24, 266, 467),
+(9, 25, 279, 498),
+(9, 26, 293, 530),
+(9, 27, 318, 548),
+(9, 28, 334, 582),
+(9, 29, 351, 602),
+(9, 30, 379, 638),
+(9, 31, 398, 674),
+(9, 32, 418, 695),
+(9, 33, 439, 731),
+(9, 34, 471, 752),
+(9, 35, 494, 788),
+(9, 36, 518, 809),
+(9, 37, 543, 830),
+(9, 38, 569, 866),
+(9, 39, 606, 887),
+(9, 40, 634, 923),
+(9, 41, 663, 944),
+(9, 42, 693, 965),
+(9, 43, 724, 1001),
+(9, 44, 756, 1022),
+(9, 45, 799, 1043),
+(9, 46, 832, 1064),
+(9, 47, 868, 1100),
+(9, 48, 904, 1121),
+(9, 49, 941, 1142),
+(9, 50, 979, 1163),
+(9, 51, 1018, 1184),
+(9, 52, 1058, 1205),
+(9, 53, 1099, 1226),
+(9, 54, 1141, 1247),
+(9, 55, 1184, 1268),
+(9, 56, 1228, 1289),
+(9, 57, 1273, 1310),
+(9, 58, 1319, 1331),
+(9, 59, 1366, 1352),
+(9, 60, 1414, 1373),
+(9, 61, 1580, 1497),
+(9, 62, 1755, 1621),
+(9, 63, 1939, 1745),
+(9, 64, 2133, 1870),
+(9, 65, 2323, 1994),
+(9, 66, 2535, 2118),
+(9, 67, 2758, 2242),
+(9, 68, 2991, 2366),
+(9, 69, 3235, 2490),
+(9, 70, 3490, 2615),
+(9, 71, 3750, 2739),
+(9, 72, 4025, 2863),
+(9, 73, 4330, 2987),
+(9, 74, 4646, 3111),
+(9, 75, 4997, 3235),
+(9, 76, 5373, 3360),
+(9, 77, 5774, 3483),
+(9, 78, 6207, 3608),
+(9, 79, 6667, 3732),
+(9, 80, 7136, 3856),
+(11, 1, 44, 60),
+(11, 2, 51, 66),
+(11, 3, 58, 73),
+(11, 4, 75, 81),
+(11, 5, 82, 90),
+(11, 6, 89, 100),
+(11, 7, 106, 111),
+(11, 8, 113, 123),
+(11, 9, 120, 136),
+(11, 10, 137, 150),
+(11, 11, 144, 165),
+(11, 12, 151, 182),
+(11, 13, 168, 200),
+(11, 14, 175, 219),
+(11, 15, 182, 239),
+(11, 16, 199, 260),
+(11, 17, 206, 282),
+(11, 18, 214, 305),
+(11, 19, 233, 329),
+(11, 20, 243, 354),
+(11, 21, 254, 380),
+(11, 22, 266, 392),
+(11, 23, 289, 420),
+(11, 24, 303, 449),
+(11, 25, 318, 479),
+(11, 26, 334, 509),
+(11, 27, 361, 524),
+(11, 28, 379, 554),
+(11, 29, 398, 584),
+(11, 30, 418, 614),
+(11, 31, 439, 629),
+(11, 32, 461, 659),
+(11, 33, 494, 689),
+(11, 34, 518, 704),
+(11, 35, 543, 734),
+(11, 36, 569, 749),
+(11, 37, 596, 779),
+(11, 38, 624, 809),
+(11, 39, 653, 824),
+(11, 40, 683, 854),
+(11, 41, 714, 869),
+(11, 42, 746, 899),
+(11, 43, 779, 914),
+(11, 44, 823, 944),
+(11, 45, 858, 959),
+(11, 46, 894, 989),
+(11, 47, 921, 1004),
+(11, 48, 959, 1019),
+(11, 49, 998, 1049),
+(11, 50, 1038, 1064),
+(11, 51, 1079, 1079),
+(11, 52, 1121, 1109),
+(11, 53, 1164, 1124),
+(11, 54, 1208, 1139),
+(11, 55, 1253, 1154),
+(11, 56, 1299, 1169),
+(11, 57, 1346, 1199),
+(11, 58, 1384, 1214),
+(11, 59, 1433, 1229),
+(11, 60, 1483, 1244),
+(11, 61, 1657, 1357),
+(11, 62, 1840, 1469),
+(11, 63, 2020, 1582),
+(11, 64, 2222, 1694),
+(11, 65, 2433, 1807),
+(11, 66, 2640, 1919),
+(11, 67, 2872, 2032),
+(11, 68, 3114, 2145),
+(11, 69, 3351, 2257),
+(11, 70, 3614, 2370),
+(11, 71, 3883, 2482),
+(11, 72, 4172, 2595),
+(11, 73, 4483, 2708),
+(11, 74, 4817, 2820),
+(11, 75, 5176, 2933),
+(11, 76, 5562, 3045),
+(11, 77, 5977, 3158),
+(11, 78, 6423, 3270),
+(11, 79, 6902, 3383),
+(11, 80, 7417, 3496);
+
+-- player_levelstats
+INSERT IGNORE INTO `player_levelstats` (`race`, `class`, `level`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES
+(1, 1, 1, 23, 20, 22, 20, 20),
+(1, 1, 2, 24, 21, 23, 20, 20),
+(1, 1, 3, 26, 22, 24, 20, 21),
+(1, 1, 4, 27, 22, 26, 20, 21),
+(1, 1, 5, 28, 23, 27, 20, 21),
+(1, 1, 6, 30, 24, 28, 20, 21),
+(1, 1, 7, 31, 25, 29, 21, 22),
+(1, 1, 8, 32, 26, 30, 21, 22),
+(1, 1, 9, 34, 26, 32, 21, 22),
+(1, 1, 10, 35, 27, 33, 21, 23),
+(1, 1, 11, 36, 28, 34, 21, 23),
+(1, 1, 12, 38, 29, 35, 21, 23),
+(1, 1, 13, 39, 30, 37, 21, 24),
+(1, 1, 14, 41, 31, 38, 21, 24),
+(1, 1, 15, 42, 32, 39, 21, 24),
+(1, 1, 16, 44, 33, 41, 21, 25),
+(1, 1, 17, 45, 34, 42, 22, 25),
+(1, 1, 18, 47, 34, 43, 22, 25),
+(1, 1, 19, 48, 35, 45, 22, 26),
+(1, 1, 20, 50, 36, 46, 22, 26),
+(1, 1, 21, 51, 37, 48, 22, 26),
+(1, 1, 22, 53, 38, 49, 22, 27),
+(1, 1, 23, 54, 39, 51, 22, 27),
+(1, 1, 24, 56, 40, 52, 23, 28),
+(1, 1, 25, 58, 41, 53, 23, 28),
+(1, 1, 26, 59, 42, 55, 23, 28),
+(1, 1, 27, 61, 43, 56, 23, 29),
+(1, 1, 28, 63, 44, 58, 23, 29),
+(1, 1, 29, 64, 45, 59, 23, 30),
+(1, 1, 30, 66, 46, 61, 24, 30),
+(1, 1, 31, 68, 47, 62, 24, 30),
+(1, 1, 32, 69, 48, 64, 24, 31),
+(1, 1, 33, 71, 50, 66, 24, 31),
+(1, 1, 34, 73, 51, 67, 24, 32),
+(1, 1, 35, 74, 52, 69, 24, 32),
+(1, 1, 36, 76, 53, 70, 25, 33),
+(1, 1, 37, 78, 54, 72, 25, 33),
+(1, 1, 38, 80, 55, 74, 25, 34),
+(1, 1, 39, 82, 56, 75, 25, 34),
+(1, 1, 40, 83, 57, 77, 25, 35),
+(1, 1, 41, 85, 58, 79, 26, 35),
+(1, 1, 42, 87, 60, 80, 26, 35),
+(1, 1, 43, 89, 61, 82, 26, 36),
+(1, 1, 44, 91, 62, 84, 26, 36),
+(1, 1, 45, 93, 63, 85, 26, 37),
+(1, 1, 46, 95, 64, 87, 27, 37),
+(1, 1, 47, 97, 66, 89, 27, 38),
+(1, 1, 48, 99, 67, 91, 27, 38),
+(1, 1, 49, 101, 68, 93, 27, 39),
+(1, 1, 50, 103, 69, 94, 28, 40),
+(1, 1, 51, 105, 71, 96, 28, 40),
+(1, 1, 52, 107, 72, 98, 28, 41),
+(1, 1, 53, 109, 73, 100, 28, 41),
+(1, 1, 54, 111, 74, 102, 29, 42),
+(1, 1, 55, 113, 76, 103, 29, 42),
+(1, 1, 56, 115, 77, 105, 29, 43),
+(1, 1, 57, 117, 78, 107, 29, 43),
+(1, 1, 58, 119, 79, 109, 30, 44),
+(1, 1, 59, 121, 81, 111, 30, 44),
+(1, 1, 60, 123, 82, 113, 30, 45),
+(1, 1, 61, 125, 83, 115, 30, 46),
+(1, 1, 62, 127, 85, 117, 31, 46),
+(1, 1, 63, 129, 86, 119, 31, 47),
+(1, 1, 64, 132, 88, 121, 31, 47),
+(1, 1, 65, 134, 89, 123, 32, 48),
+(1, 1, 66, 136, 90, 125, 32, 49),
+(1, 1, 67, 138, 92, 127, 32, 49),
+(1, 1, 68, 140, 93, 129, 32, 50),
+(1, 1, 69, 143, 95, 131, 33, 50),
+(1, 1, 70, 145, 96, 133, 33, 51),
+(1, 1, 71, 148, 97, 140, 33, 53),
+(1, 1, 72, 156, 99, 143, 33, 54),
+(1, 1, 73, 162, 101, 148, 33, 55),
+(1, 1, 74, 162, 102, 148, 34, 55),
+(1, 1, 75, 165, 104, 150, 34, 56),
+(1, 1, 76, 171, 106, 156, 34, 57),
+(1, 1, 77, 171, 108, 157, 35, 58),
+(1, 1, 78, 174, 109, 159, 35, 58),
+(1, 1, 79, 181, 111, 165, 35, 59),
+(1, 1, 80, 184, 113, 168, 36, 60),
+(1, 2, 1, 22, 20, 22, 20, 21),
+(1, 2, 2, 23, 21, 23, 21, 22),
+(1, 2, 3, 24, 21, 24, 21, 22),
+(1, 2, 4, 25, 22, 25, 22, 23),
+(1, 2, 5, 26, 22, 26, 23, 24),
+(1, 2, 6, 28, 23, 27, 23, 25),
+(1, 2, 7, 29, 24, 28, 24, 25),
+(1, 2, 8, 30, 24, 29, 25, 26),
+(1, 2, 9, 31, 25, 30, 25, 27),
+(1, 2, 10, 32, 25, 32, 26, 27),
+(1, 2, 11, 33, 26, 33, 27, 28),
+(1, 2, 12, 35, 27, 34, 27, 29),
+(1, 2, 13, 36, 27, 35, 28, 30),
+(1, 2, 14, 37, 28, 36, 29, 31),
+(1, 2, 15, 38, 29, 37, 30, 31),
+(1, 2, 16, 40, 29, 38, 30, 32),
+(1, 2, 17, 41, 30, 40, 31, 33),
+(1, 2, 18, 42, 31, 41, 32, 34),
+(1, 2, 19, 43, 31, 42, 33, 35),
+(1, 2, 20, 45, 32, 43, 33, 35),
+(1, 2, 21, 46, 33, 45, 34, 36),
+(1, 2, 22, 47, 33, 46, 35, 37),
+(1, 2, 23, 49, 34, 47, 36, 38),
+(1, 2, 24, 50, 35, 48, 37, 39),
+(1, 2, 25, 51, 36, 50, 37, 40),
+(1, 2, 26, 53, 36, 51, 38, 41),
+(1, 2, 27, 54, 37, 52, 39, 42),
+(1, 2, 28, 56, 38, 54, 40, 43),
+(1, 2, 29, 57, 39, 55, 41, 43),
+(1, 2, 30, 58, 39, 56, 42, 44),
+(1, 2, 31, 60, 40, 58, 43, 45),
+(1, 2, 32, 61, 41, 59, 43, 46),
+(1, 2, 33, 63, 42, 60, 44, 47),
+(1, 2, 34, 64, 43, 62, 45, 48),
+(1, 2, 35, 66, 44, 63, 46, 49),
+(1, 2, 36, 67, 44, 65, 47, 50),
+(1, 2, 37, 69, 45, 66, 48, 51),
+(1, 2, 38, 70, 46, 67, 49, 52),
+(1, 2, 39, 72, 47, 69, 50, 53),
+(1, 2, 40, 73, 48, 70, 51, 54),
+(1, 2, 41, 75, 49, 72, 52, 55),
+(1, 2, 42, 77, 49, 73, 53, 56),
+(1, 2, 43, 78, 50, 75, 54, 57),
+(1, 2, 44, 80, 51, 76, 55, 58),
+(1, 2, 45, 81, 52, 78, 56, 59),
+(1, 2, 46, 83, 53, 79, 57, 61),
+(1, 2, 47, 85, 54, 81, 58, 62),
+(1, 2, 48, 86, 55, 83, 59, 63),
+(1, 2, 49, 88, 56, 84, 60, 64),
+(1, 2, 50, 90, 57, 86, 61, 65),
+(1, 2, 51, 91, 58, 87, 62, 66),
+(1, 2, 52, 93, 59, 89, 63, 67),
+(1, 2, 53, 95, 60, 91, 64, 68),
+(1, 2, 54, 97, 61, 92, 65, 69),
+(1, 2, 55, 98, 61, 94, 66, 71),
+(1, 2, 56, 100, 62, 95, 67, 72),
+(1, 2, 57, 102, 63, 97, 68, 73),
+(1, 2, 58, 104, 64, 99, 69, 74),
+(1, 2, 59, 105, 65, 101, 70, 75),
+(1, 2, 60, 107, 66, 102, 71, 77),
+(1, 2, 61, 109, 67, 104, 73, 78),
+(1, 2, 62, 111, 69, 106, 74, 79),
+(1, 2, 63, 113, 70, 107, 75, 80),
+(1, 2, 64, 115, 71, 109, 76, 81),
+(1, 2, 65, 116, 72, 111, 77, 83),
+(1, 2, 66, 118, 73, 113, 78, 84),
+(1, 2, 67, 120, 74, 115, 79, 85),
+(1, 2, 68, 122, 75, 116, 81, 86),
+(1, 2, 69, 124, 76, 118, 82, 88),
+(1, 2, 70, 126, 77, 120, 83, 89),
+(1, 2, 71, 148, 78, 122, 84, 92),
+(1, 2, 72, 150, 79, 125, 86, 94),
+(1, 2, 73, 152, 80, 127, 87, 96),
+(1, 2, 74, 156, 82, 129, 89, 97),
+(1, 2, 75, 158, 83, 131, 90, 99),
+(1, 2, 76, 162, 84, 134, 92, 100),
+(1, 2, 77, 164, 86, 136, 93, 103),
+(1, 2, 78, 167, 87, 138, 95, 105),
+(1, 2, 79, 170, 88, 153, 96, 106),
+(1, 2, 80, 173, 90, 160, 98, 108),
+(1, 4, 1, 21, 23, 21, 20, 20),
+(1, 4, 2, 22, 24, 22, 20, 20),
+(1, 4, 3, 23, 26, 22, 20, 21),
+(1, 4, 4, 23, 27, 23, 20, 21),
+(1, 4, 5, 24, 29, 24, 21, 21),
+(1, 4, 6, 25, 30, 25, 21, 22),
+(1, 4, 7, 26, 32, 25, 21, 22),
+(1, 4, 8, 26, 33, 26, 21, 23),
+(1, 4, 9, 27, 35, 27, 21, 23),
+(1, 4, 10, 28, 36, 27, 21, 23),
+(1, 4, 11, 29, 38, 28, 22, 24),
+(1, 4, 12, 30, 39, 29, 22, 24),
+(1, 4, 13, 31, 41, 30, 22, 25),
+(1, 4, 14, 31, 43, 31, 22, 25),
+(1, 4, 15, 32, 44, 31, 22, 25),
+(1, 4, 16, 33, 46, 32, 23, 26),
+(1, 4, 17, 34, 48, 33, 23, 26),
+(1, 4, 18, 35, 49, 34, 23, 27),
+(1, 4, 19, 36, 51, 35, 23, 27),
+(1, 4, 20, 37, 53, 35, 23, 28),
+(1, 4, 21, 38, 54, 36, 24, 28),
+(1, 4, 22, 39, 56, 37, 24, 29),
+(1, 4, 23, 40, 58, 38, 24, 29),
+(1, 4, 24, 41, 60, 39, 24, 30),
+(1, 4, 25, 42, 61, 40, 25, 30),
+(1, 4, 26, 43, 63, 41, 25, 31),
+(1, 4, 27, 44, 65, 42, 25, 31),
+(1, 4, 28, 45, 67, 43, 25, 32),
+(1, 4, 29, 46, 69, 43, 25, 32),
+(1, 4, 30, 47, 71, 44, 26, 33),
+(1, 4, 31, 48, 72, 45, 26, 33),
+(1, 4, 32, 49, 74, 46, 26, 34),
+(1, 4, 33, 50, 76, 47, 27, 34),
+(1, 4, 34, 51, 78, 48, 27, 35),
+(1, 4, 35, 52, 80, 49, 27, 35),
+(1, 4, 36, 53, 82, 50, 27, 36),
+(1, 4, 37, 54, 84, 51, 28, 36),
+(1, 4, 38, 55, 86, 52, 28, 37),
+(1, 4, 39, 56, 88, 53, 28, 38),
+(1, 4, 40, 57, 90, 54, 28, 38),
+(1, 4, 41, 58, 92, 55, 29, 39),
+(1, 4, 42, 60, 94, 56, 29, 39),
+(1, 4, 43, 61, 96, 57, 29, 40),
+(1, 4, 44, 62, 98, 58, 30, 40),
+(1, 4, 45, 63, 100, 59, 30, 41),
+(1, 4, 46, 64, 103, 61, 30, 42),
+(1, 4, 47, 65, 105, 62, 31, 42),
+(1, 4, 48, 66, 107, 63, 31, 43),
+(1, 4, 49, 68, 109, 64, 31, 44),
+(1, 4, 50, 69, 111, 65, 32, 44),
+(1, 4, 51, 70, 113, 66, 32, 45),
+(1, 4, 52, 71, 116, 67, 32, 45),
+(1, 4, 53, 73, 118, 68, 33, 46),
+(1, 4, 54, 74, 120, 69, 33, 47),
+(1, 4, 55, 75, 122, 71, 33, 47),
+(1, 4, 56, 76, 125, 72, 34, 48),
+(1, 4, 57, 78, 127, 73, 34, 49),
+(1, 4, 58, 79, 129, 74, 34, 49),
+(1, 4, 59, 80, 131, 75, 35, 50),
+(1, 4, 60, 81, 134, 77, 35, 51),
+(1, 4, 61, 83, 136, 78, 35, 51),
+(1, 4, 62, 84, 138, 79, 36, 52),
+(1, 4, 63, 85, 141, 80, 36, 53),
+(1, 4, 64, 87, 143, 81, 37, 54),
+(1, 4, 65, 88, 146, 83, 37, 54),
+(1, 4, 66, 89, 148, 84, 37, 55),
+(1, 4, 67, 91, 151, 85, 38, 56),
+(1, 4, 68, 92, 153, 86, 38, 57),
+(1, 4, 69, 94, 156, 88, 39, 57),
+(1, 4, 70, 95, 158, 89, 39, 58),
+(1, 4, 71, 97, 161, 90, 39, 60),
+(1, 4, 72, 99, 164, 92, 40, 60),
+(1, 4, 73, 100, 167, 94, 40, 61),
+(1, 4, 74, 102, 170, 95, 41, 62),
+(1, 4, 75, 104, 173, 97, 41, 63),
+(1, 4, 76, 105, 176, 98, 41, 64),
+(1, 4, 77, 107, 179, 100, 42, 65),
+(1, 4, 78, 109, 183, 106, 42, 66),
+(1, 4, 79, 111, 186, 107, 43, 67),
+(1, 4, 80, 113, 189, 109, 43, 69),
+(1, 5, 1, 20, 20, 20, 22, 23),
+(1, 5, 2, 20, 20, 20, 23, 24),
+(1, 5, 3, 20, 20, 21, 25, 26),
+(1, 5, 4, 20, 21, 21, 26, 27),
+(1, 5, 5, 21, 21, 21, 27, 28),
+(1, 5, 6, 21, 21, 22, 29, 30),
+(1, 5, 7, 21, 21, 22, 30, 31),
+(1, 5, 8, 21, 22, 23, 31, 33),
+(1, 5, 9, 21, 22, 23, 33, 34),
+(1, 5, 10, 21, 22, 23, 34, 36),
+(1, 5, 11, 22, 22, 24, 36, 37),
+(1, 5, 12, 22, 23, 24, 37, 39),
+(1, 5, 13, 22, 23, 25, 38, 40),
+(1, 5, 14, 22, 23, 25, 40, 42),
+(1, 5, 15, 22, 23, 25, 41, 43),
+(1, 5, 16, 23, 24, 26, 43, 45),
+(1, 5, 17, 23, 24, 26, 44, 46),
+(1, 5, 18, 23, 24, 27, 46, 48),
+(1, 5, 19, 23, 24, 27, 47, 49),
+(1, 5, 20, 23, 25, 28, 49, 51),
+(1, 5, 21, 24, 25, 28, 51, 53),
+(1, 5, 22, 24, 25, 29, 52, 54),
+(1, 5, 23, 24, 26, 29, 54, 56),
+(1, 5, 24, 24, 26, 30, 55, 58),
+(1, 5, 25, 25, 26, 30, 57, 59),
+(1, 5, 26, 25, 27, 31, 59, 61),
+(1, 5, 27, 25, 27, 31, 60, 63),
+(1, 5, 28, 25, 27, 32, 62, 65),
+(1, 5, 29, 25, 28, 32, 64, 66),
+(1, 5, 30, 26, 28, 33, 65, 68),
+(1, 5, 31, 26, 28, 33, 67, 70),
+(1, 5, 32, 26, 29, 34, 69, 72),
+(1, 5, 33, 27, 29, 34, 70, 73),
+(1, 5, 34, 27, 29, 35, 72, 75),
+(1, 5, 35, 27, 30, 35, 74, 77),
+(1, 5, 36, 27, 30, 36, 76, 79),
+(1, 5, 37, 28, 30, 36, 78, 81),
+(1, 5, 38, 28, 31, 37, 79, 83),
+(1, 5, 39, 28, 31, 38, 81, 85),
+(1, 5, 40, 28, 31, 38, 83, 87),
+(1, 5, 41, 29, 32, 39, 85, 88),
+(1, 5, 42, 29, 32, 39, 87, 90),
+(1, 5, 43, 29, 33, 40, 89, 92),
+(1, 5, 44, 30, 33, 40, 91, 94),
+(1, 5, 45, 30, 33, 41, 92, 96),
+(1, 5, 46, 30, 34, 42, 94, 98),
+(1, 5, 47, 31, 34, 42, 96, 100),
+(1, 5, 48, 31, 35, 43, 98, 102),
+(1, 5, 49, 31, 35, 44, 100, 104),
+(1, 5, 50, 32, 36, 44, 102, 106),
+(1, 5, 51, 32, 36, 45, 104, 109),
+(1, 5, 52, 32, 36, 45, 106, 111),
+(1, 5, 53, 33, 37, 46, 108, 113),
+(1, 5, 54, 33, 37, 47, 110, 115),
+(1, 5, 55, 33, 38, 47, 112, 117),
+(1, 5, 56, 34, 38, 48, 114, 119),
+(1, 5, 57, 34, 39, 49, 117, 121),
+(1, 5, 58, 34, 39, 49, 119, 124),
+(1, 5, 59, 35, 40, 50, 121, 126),
+(1, 5, 60, 35, 40, 51, 123, 128),
+(1, 5, 61, 35, 41, 51, 125, 130),
+(1, 5, 62, 36, 41, 52, 127, 132),
+(1, 5, 63, 36, 41, 53, 129, 135),
+(1, 5, 64, 37, 42, 54, 132, 137),
+(1, 5, 65, 37, 42, 54, 134, 139),
+(1, 5, 66, 37, 43, 55, 136, 142),
+(1, 5, 67, 38, 43, 56, 138, 144),
+(1, 5, 68, 38, 44, 57, 140, 146),
+(1, 5, 69, 39, 44, 57, 143, 149),
+(1, 5, 70, 39, 45, 58, 145, 151),
+(1, 5, 71, 39, 46, 59, 148, 158),
+(1, 5, 72, 40, 46, 59, 151, 161),
+(1, 5, 73, 40, 47, 60, 154, 164),
+(1, 5, 74, 41, 47, 61, 156, 167),
+(1, 5, 75, 41, 48, 62, 159, 170),
+(1, 5, 76, 41, 49, 63, 162, 174),
+(1, 5, 77, 42, 49, 64, 165, 177),
+(1, 5, 78, 42, 50, 65, 168, 180),
+(1, 5, 79, 43, 50, 66, 171, 183),
+(1, 5, 80, 43, 51, 67, 174, 186),
+(1, 6, 1, 23, 20, 22, 20, 20),
+(1, 6, 2, 24, 21, 23, 20, 20),
+(1, 6, 3, 26, 22, 24, 20, 21),
+(1, 6, 4, 27, 22, 26, 20, 21),
+(1, 6, 5, 28, 23, 27, 20, 21),
+(1, 6, 6, 30, 24, 28, 20, 21),
+(1, 6, 7, 31, 25, 29, 21, 22),
+(1, 6, 8, 32, 26, 30, 21, 22),
+(1, 6, 9, 34, 26, 32, 21, 22),
+(1, 6, 10, 35, 27, 33, 21, 23),
+(1, 6, 11, 36, 28, 34, 21, 23),
+(1, 6, 12, 38, 29, 35, 21, 23),
+(1, 6, 13, 39, 30, 37, 21, 24),
+(1, 6, 14, 41, 31, 38, 21, 24),
+(1, 6, 15, 42, 32, 39, 21, 24),
+(1, 6, 16, 44, 33, 41, 21, 25),
+(1, 6, 17, 45, 34, 42, 22, 25),
+(1, 6, 18, 47, 34, 43, 22, 25),
+(1, 6, 19, 48, 35, 45, 22, 26),
+(1, 6, 20, 50, 36, 46, 22, 26),
+(1, 6, 21, 51, 37, 48, 22, 26),
+(1, 6, 22, 53, 38, 49, 22, 27),
+(1, 6, 23, 54, 39, 51, 22, 27),
+(1, 6, 24, 56, 40, 52, 23, 28),
+(1, 6, 25, 58, 41, 53, 23, 28),
+(1, 6, 26, 59, 42, 55, 23, 28),
+(1, 6, 27, 61, 43, 56, 23, 29),
+(1, 6, 28, 63, 44, 58, 23, 29),
+(1, 6, 29, 64, 45, 59, 23, 30),
+(1, 6, 30, 66, 46, 61, 24, 30),
+(1, 6, 31, 68, 47, 62, 24, 30),
+(1, 6, 32, 69, 48, 64, 24, 31),
+(1, 6, 33, 71, 50, 66, 24, 31),
+(1, 6, 34, 73, 51, 67, 24, 32),
+(1, 6, 35, 74, 52, 69, 24, 32),
+(1, 6, 36, 76, 53, 70, 25, 33),
+(1, 6, 37, 78, 54, 72, 25, 33),
+(1, 6, 38, 80, 55, 74, 25, 34),
+(1, 6, 39, 82, 56, 75, 25, 34),
+(1, 6, 40, 83, 57, 77, 25, 35),
+(1, 6, 41, 85, 58, 79, 26, 35),
+(1, 6, 42, 87, 60, 80, 26, 35),
+(1, 6, 43, 89, 61, 82, 26, 36),
+(1, 6, 44, 91, 62, 84, 26, 36),
+(1, 6, 45, 93, 63, 85, 26, 37),
+(1, 6, 46, 95, 64, 87, 27, 37),
+(1, 6, 47, 97, 66, 89, 27, 38),
+(1, 6, 48, 99, 67, 91, 27, 38),
+(1, 6, 49, 101, 68, 93, 27, 39),
+(1, 6, 50, 103, 69, 94, 28, 40),
+(1, 6, 51, 105, 71, 96, 28, 40),
+(1, 6, 52, 106, 72, 97, 28, 41),
+(1, 6, 53, 107, 72, 98, 28, 41),
+(1, 6, 54, 107, 73, 98, 29, 42),
+(1, 6, 55, 108, 73, 99, 29, 43),
+(1, 6, 56, 111, 75, 102, 29, 44),
+(1, 6, 57, 113, 76, 104, 29, 44),
+(1, 6, 58, 118, 77, 106, 30, 45),
+(1, 6, 59, 118, 79, 108, 30, 45),
+(1, 6, 60, 123, 80, 110, 30, 46),
+(1, 6, 61, 125, 81, 112, 30, 47),
+(1, 6, 62, 128, 83, 114, 30, 47),
+(1, 6, 63, 130, 84, 117, 31, 48),
+(1, 6, 64, 130, 86, 119, 31, 48),
+(1, 6, 65, 140, 87, 128, 31, 49),
+(1, 6, 66, 143, 89, 131, 31, 50),
+(1, 6, 67, 146, 90, 133, 32, 50),
+(1, 6, 68, 148, 92, 135, 32, 51),
+(1, 6, 69, 151, 93, 138, 32, 52),
+(1, 6, 70, 154, 95, 140, 32, 52),
+(1, 6, 71, 162, 97, 144, 33, 53),
+(1, 6, 72, 164, 98, 146, 33, 54),
+(1, 6, 73, 165, 100, 148, 33, 55),
+(1, 6, 74, 166, 102, 151, 33, 55),
+(1, 6, 75, 169, 103, 154, 34, 56),
+(1, 6, 76, 172, 105, 157, 34, 57),
+(1, 6, 77, 175, 107, 157, 34, 58),
+(1, 6, 78, 176, 108, 157, 34, 58),
+(1, 6, 79, 177, 110, 157, 35, 59),
+(1, 6, 80, 180, 112, 160, 35, 60),
+(1, 8, 1, 20, 20, 20, 23, 22),
+(1, 8, 2, 20, 20, 20, 24, 23),
+(1, 8, 3, 20, 20, 21, 26, 25),
+(1, 8, 4, 20, 20, 21, 27, 26),
+(1, 8, 5, 20, 21, 21, 28, 27),
+(1, 8, 6, 20, 21, 21, 30, 29),
+(1, 8, 7, 21, 21, 22, 31, 30),
+(1, 8, 8, 21, 21, 22, 33, 31),
+(1, 8, 9, 21, 21, 22, 34, 33),
+(1, 8, 10, 21, 21, 23, 36, 34),
+(1, 8, 11, 21, 22, 23, 37, 36),
+(1, 8, 12, 21, 22, 23, 39, 37),
+(1, 8, 13, 21, 22, 24, 40, 38),
+(1, 8, 14, 21, 22, 24, 42, 40),
+(1, 8, 15, 21, 22, 24, 43, 41),
+(1, 8, 16, 21, 23, 25, 45, 43),
+(1, 8, 17, 22, 23, 25, 46, 44),
+(1, 8, 18, 22, 23, 25, 48, 46),
+(1, 8, 19, 22, 23, 26, 49, 47),
+(1, 8, 20, 22, 23, 26, 51, 49),
+(1, 8, 21, 22, 24, 26, 53, 51),
+(1, 8, 22, 22, 24, 27, 54, 52),
+(1, 8, 23, 22, 24, 27, 56, 54),
+(1, 8, 24, 23, 24, 28, 58, 55),
+(1, 8, 25, 23, 25, 28, 59, 57),
+(1, 8, 26, 23, 25, 28, 61, 59),
+(1, 8, 27, 23, 25, 29, 63, 60),
+(1, 8, 28, 23, 25, 29, 65, 62),
+(1, 8, 29, 23, 25, 30, 66, 64),
+(1, 8, 30, 24, 26, 30, 68, 65),
+(1, 8, 31, 24, 26, 30, 70, 67),
+(1, 8, 32, 24, 26, 31, 72, 69),
+(1, 8, 33, 24, 27, 31, 73, 70),
+(1, 8, 34, 24, 27, 32, 75, 72),
+(1, 8, 35, 24, 27, 32, 77, 74),
+(1, 8, 36, 25, 27, 33, 79, 76),
+(1, 8, 37, 25, 28, 33, 81, 78),
+(1, 8, 38, 25, 28, 34, 83, 79),
+(1, 8, 39, 25, 28, 34, 85, 81),
+(1, 8, 40, 25, 28, 35, 87, 83),
+(1, 8, 41, 26, 29, 35, 88, 85),
+(1, 8, 42, 26, 29, 35, 90, 87),
+(1, 8, 43, 26, 29, 36, 92, 89),
+(1, 8, 44, 26, 30, 36, 94, 91),
+(1, 8, 45, 26, 30, 37, 96, 92),
+(1, 8, 46, 27, 30, 37, 98, 94),
+(1, 8, 47, 27, 31, 38, 100, 96),
+(1, 8, 48, 27, 31, 38, 102, 98),
+(1, 8, 49, 27, 31, 39, 104, 100),
+(1, 8, 50, 28, 32, 40, 106, 102),
+(1, 8, 51, 28, 32, 40, 109, 104),
+(1, 8, 52, 28, 32, 41, 111, 106),
+(1, 8, 53, 28, 33, 41, 113, 108),
+(1, 8, 54, 29, 33, 42, 115, 110),
+(1, 8, 55, 29, 33, 42, 117, 112),
+(1, 8, 56, 29, 34, 43, 119, 114),
+(1, 8, 57, 29, 34, 43, 121, 117),
+(1, 8, 58, 30, 34, 44, 124, 119),
+(1, 8, 59, 30, 35, 44, 126, 121),
+(1, 8, 60, 30, 35, 45, 128, 123),
+(1, 8, 61, 30, 35, 46, 130, 125),
+(1, 8, 62, 31, 36, 46, 132, 127),
+(1, 8, 63, 31, 36, 47, 135, 129),
+(1, 8, 64, 31, 37, 47, 137, 132),
+(1, 8, 65, 32, 37, 48, 139, 134),
+(1, 8, 66, 32, 37, 49, 142, 136),
+(1, 8, 67, 32, 38, 49, 144, 138),
+(1, 8, 68, 32, 38, 50, 146, 140),
+(1, 8, 69, 33, 39, 50, 149, 143),
+(1, 8, 70, 33, 39, 51, 151, 145),
+(1, 8, 71, 33, 39, 52, 154, 152),
+(1, 8, 72, 33, 40, 53, 160, 155),
+(1, 8, 73, 33, 40, 54, 160, 158),
+(1, 8, 74, 34, 41, 54, 163, 160),
+(1, 8, 75, 34, 41, 55, 166, 163),
+(1, 8, 76, 34, 41, 56, 169, 166),
+(1, 8, 77, 35, 42, 57, 172, 169),
+(1, 8, 78, 35, 42, 57, 175, 173),
+(1, 8, 79, 35, 43, 58, 178, 176),
+(1, 8, 80, 36, 43, 59, 181, 179),
+(1, 9, 1, 20, 20, 21, 22, 22),
+(1, 9, 2, 20, 20, 22, 23, 23),
+(1, 9, 3, 21, 21, 22, 24, 24),
+(1, 9, 4, 21, 21, 23, 26, 25),
+(1, 9, 5, 21, 21, 23, 27, 27),
+(1, 9, 6, 21, 22, 24, 28, 28),
+(1, 9, 7, 22, 22, 24, 29, 29),
+(1, 9, 8, 22, 23, 25, 30, 30),
+(1, 9, 9, 22, 23, 26, 32, 31),
+(1, 9, 10, 23, 23, 26, 33, 33),
+(1, 9, 11, 23, 24, 27, 34, 34),
+(1, 9, 12, 23, 24, 27, 35, 35),
+(1, 9, 13, 24, 25, 28, 37, 36),
+(1, 9, 14, 24, 25, 29, 38, 38),
+(1, 9, 15, 24, 25, 29, 39, 39),
+(1, 9, 16, 25, 26, 30, 41, 40),
+(1, 9, 17, 25, 26, 31, 42, 42),
+(1, 9, 18, 25, 27, 31, 43, 43),
+(1, 9, 19, 26, 27, 32, 45, 44),
+(1, 9, 20, 26, 28, 33, 46, 46),
+(1, 9, 21, 26, 28, 33, 48, 47),
+(1, 9, 22, 27, 29, 34, 49, 49),
+(1, 9, 23, 27, 29, 35, 51, 50),
+(1, 9, 24, 28, 30, 35, 52, 51),
+(1, 9, 25, 28, 30, 36, 53, 53),
+(1, 9, 26, 28, 31, 37, 55, 54),
+(1, 9, 27, 29, 31, 37, 56, 56),
+(1, 9, 28, 29, 32, 38, 58, 57),
+(1, 9, 29, 30, 32, 39, 59, 59),
+(1, 9, 30, 30, 33, 40, 61, 60),
+(1, 9, 31, 30, 33, 40, 62, 62),
+(1, 9, 32, 31, 34, 41, 64, 63),
+(1, 9, 33, 31, 34, 42, 66, 65),
+(1, 9, 34, 32, 35, 43, 67, 66),
+(1, 9, 35, 32, 35, 44, 69, 68),
+(1, 9, 36, 33, 36, 44, 70, 69),
+(1, 9, 37, 33, 36, 45, 72, 71),
+(1, 9, 38, 34, 37, 46, 74, 73),
+(1, 9, 39, 34, 38, 47, 75, 74),
+(1, 9, 40, 35, 38, 48, 77, 76),
+(1, 9, 41, 35, 39, 48, 79, 78),
+(1, 9, 42, 35, 39, 49, 80, 79),
+(1, 9, 43, 36, 40, 50, 82, 81),
+(1, 9, 44, 36, 40, 51, 84, 83),
+(1, 9, 45, 37, 41, 52, 85, 84),
+(1, 9, 46, 37, 42, 53, 87, 86),
+(1, 9, 47, 38, 42, 54, 89, 88),
+(1, 9, 48, 38, 43, 55, 91, 89),
+(1, 9, 49, 39, 44, 55, 93, 91),
+(1, 9, 50, 40, 44, 56, 94, 93),
+(1, 9, 51, 40, 45, 57, 96, 95),
+(1, 9, 52, 41, 45, 58, 98, 97),
+(1, 9, 53, 41, 46, 59, 100, 98),
+(1, 9, 54, 42, 47, 60, 102, 100),
+(1, 9, 55, 42, 47, 61, 103, 102),
+(1, 9, 56, 43, 48, 62, 105, 104),
+(1, 9, 57, 43, 49, 63, 107, 106),
+(1, 9, 58, 44, 49, 64, 109, 108),
+(1, 9, 59, 44, 50, 65, 111, 109),
+(1, 9, 60, 45, 51, 66, 113, 111),
+(1, 9, 61, 46, 51, 67, 115, 113),
+(1, 9, 62, 46, 52, 68, 117, 115),
+(1, 9, 63, 47, 53, 69, 119, 117),
+(1, 9, 64, 47, 54, 70, 121, 119),
+(1, 9, 65, 48, 54, 71, 123, 121),
+(1, 9, 66, 49, 55, 72, 125, 123),
+(1, 9, 67, 49, 56, 73, 127, 125),
+(1, 9, 68, 50, 57, 74, 129, 127),
+(1, 9, 69, 50, 57, 75, 131, 129),
+(1, 9, 70, 51, 58, 76, 133, 131),
+(1, 9, 71, 52, 59, 78, 135, 146),
+(1, 9, 72, 53, 59, 79, 138, 148),
+(1, 9, 73, 54, 60, 80, 140, 151),
+(1, 9, 74, 54, 61, 89, 143, 154),
+(1, 9, 75, 55, 62, 91, 145, 156),
+(1, 9, 76, 56, 63, 92, 148, 159),
+(1, 9, 77, 57, 64, 93, 151, 162),
+(1, 9, 78, 57, 65, 95, 153, 165),
+(1, 9, 79, 58, 66, 96, 156, 168),
+(1, 9, 80, 59, 67, 97, 159, 170),
+(2, 1, 1, 26, 17, 24, 17, 23),
+(2, 1, 2, 27, 18, 25, 17, 23),
+(2, 1, 3, 29, 19, 26, 17, 24),
+(2, 1, 4, 30, 19, 27, 17, 24),
+(2, 1, 5, 31, 20, 29, 17, 24),
+(2, 1, 6, 32, 21, 30, 17, 24),
+(2, 1, 7, 34, 22, 31, 18, 25),
+(2, 1, 8, 35, 23, 32, 18, 25),
+(2, 1, 9, 37, 24, 34, 18, 25),
+(2, 1, 10, 38, 24, 35, 18, 26),
+(2, 1, 11, 39, 25, 36, 18, 26),
+(2, 1, 12, 41, 26, 37, 18, 26),
+(2, 1, 13, 42, 27, 39, 18, 27),
+(2, 1, 14, 44, 28, 40, 18, 27),
+(2, 1, 15, 45, 29, 41, 18, 27),
+(2, 1, 16, 47, 30, 43, 19, 28),
+(2, 1, 17, 48, 31, 44, 19, 28),
+(2, 1, 18, 50, 32, 45, 19, 28),
+(2, 1, 19, 51, 33, 47, 19, 29),
+(2, 1, 20, 53, 34, 48, 19, 29),
+(2, 1, 21, 54, 34, 50, 19, 29),
+(2, 1, 22, 56, 35, 51, 19, 30),
+(2, 1, 23, 57, 36, 52, 20, 30),
+(2, 1, 24, 59, 37, 54, 20, 30),
+(2, 1, 25, 60, 38, 55, 20, 31),
+(2, 1, 26, 62, 39, 57, 20, 31),
+(2, 1, 27, 64, 40, 58, 20, 32),
+(2, 1, 28, 65, 41, 60, 20, 32),
+(2, 1, 29, 67, 43, 61, 21, 32),
+(2, 1, 30, 69, 44, 63, 21, 33),
+(2, 1, 31, 70, 45, 64, 21, 33),
+(2, 1, 32, 72, 46, 66, 21, 34),
+(2, 1, 33, 74, 47, 67, 21, 34),
+(2, 1, 34, 76, 48, 69, 21, 35),
+(2, 1, 35, 77, 49, 71, 22, 35),
+(2, 1, 36, 79, 50, 72, 22, 36),
+(2, 1, 37, 81, 51, 74, 22, 36),
+(2, 1, 38, 83, 52, 76, 22, 36),
+(2, 1, 39, 84, 53, 77, 22, 37),
+(2, 1, 40, 86, 55, 79, 23, 37),
+(2, 1, 41, 88, 56, 81, 23, 38),
+(2, 1, 42, 90, 57, 82, 23, 38),
+(2, 1, 43, 92, 58, 84, 23, 39),
+(2, 1, 44, 94, 59, 86, 23, 39),
+(2, 1, 45, 96, 60, 87, 24, 40),
+(2, 1, 46, 98, 62, 89, 24, 40),
+(2, 1, 47, 100, 63, 91, 24, 41),
+(2, 1, 48, 101, 64, 93, 24, 41),
+(2, 1, 49, 103, 65, 94, 25, 42),
+(2, 1, 50, 105, 66, 96, 25, 42),
+(2, 1, 51, 107, 68, 98, 25, 43),
+(2, 1, 52, 109, 69, 100, 25, 43),
+(2, 1, 53, 111, 70, 102, 25, 44),
+(2, 1, 54, 113, 71, 104, 26, 45),
+(2, 1, 55, 115, 73, 105, 26, 45),
+(2, 1, 56, 118, 74, 107, 26, 46),
+(2, 1, 57, 120, 75, 109, 26, 46),
+(2, 1, 58, 122, 77, 111, 27, 47),
+(2, 1, 59, 124, 78, 113, 27, 47),
+(2, 1, 60, 126, 79, 115, 27, 48),
+(2, 1, 61, 128, 81, 117, 27, 48),
+(2, 1, 62, 130, 82, 119, 28, 49),
+(2, 1, 63, 132, 83, 121, 28, 50),
+(2, 1, 64, 135, 85, 123, 28, 50),
+(2, 1, 65, 137, 86, 125, 29, 51),
+(2, 1, 66, 139, 87, 127, 29, 52),
+(2, 1, 67, 141, 89, 129, 29, 52),
+(2, 1, 68, 143, 90, 131, 29, 53),
+(2, 1, 69, 146, 92, 133, 30, 53),
+(2, 1, 70, 148, 93, 135, 30, 54),
+(2, 1, 71, 157, 94, 142, 30, 55),
+(2, 1, 72, 162, 96, 148, 30, 56),
+(2, 1, 73, 165, 98, 150, 30, 57),
+(2, 1, 74, 168, 99, 153, 31, 57),
+(2, 1, 75, 170, 101, 154, 31, 58),
+(2, 1, 76, 172, 103, 156, 31, 59),
+(2, 1, 77, 174, 105, 159, 32, 60),
+(2, 1, 78, 179, 106, 162, 32, 60),
+(2, 1, 79, 184, 108, 167, 32, 61),
+(2, 1, 80, 187, 110, 170, 33, 62),
+(2, 3, 1, 23, 20, 23, 17, 24),
+(2, 3, 2, 23, 21, 24, 18, 25),
+(2, 3, 3, 24, 23, 25, 18, 25),
+(2, 3, 4, 24, 24, 26, 19, 26),
+(2, 3, 5, 25, 25, 27, 19, 26),
+(2, 3, 6, 25, 27, 28, 20, 27),
+(2, 3, 7, 26, 28, 28, 21, 28),
+(2, 3, 8, 26, 30, 29, 21, 28),
+(2, 3, 9, 26, 31, 30, 22, 29),
+(2, 3, 10, 27, 33, 31, 22, 30),
+(2, 3, 11, 27, 34, 32, 23, 30),
+(2, 3, 12, 28, 36, 33, 24, 31),
+(2, 3, 13, 28, 37, 34, 24, 32),
+(2, 3, 14, 29, 39, 35, 25, 33),
+(2, 3, 15, 29, 40, 36, 26, 33),
+(2, 3, 16, 30, 42, 37, 26, 34),
+(2, 3, 17, 30, 43, 39, 27, 35),
+(2, 3, 18, 31, 45, 40, 28, 35),
+(2, 3, 19, 31, 47, 41, 28, 36),
+(2, 3, 20, 32, 48, 42, 29, 37),
+(2, 3, 21, 32, 50, 43, 30, 38),
+(2, 3, 22, 33, 51, 44, 31, 39),
+(2, 3, 23, 34, 53, 45, 31, 39),
+(2, 3, 24, 34, 55, 46, 32, 40),
+(2, 3, 25, 35, 57, 47, 33, 41),
+(2, 3, 26, 35, 58, 48, 34, 42),
+(2, 3, 27, 36, 60, 50, 34, 43),
+(2, 3, 28, 36, 62, 51, 35, 43),
+(2, 3, 29, 37, 63, 52, 36, 44),
+(2, 3, 30, 38, 65, 53, 37, 45),
+(2, 3, 31, 38, 67, 54, 37, 46),
+(2, 3, 32, 39, 69, 56, 38, 47),
+(2, 3, 33, 39, 71, 57, 39, 48),
+(2, 3, 34, 40, 72, 58, 40, 49),
+(2, 3, 35, 41, 74, 59, 41, 49),
+(2, 3, 36, 41, 76, 61, 42, 50),
+(2, 3, 37, 42, 78, 62, 42, 51),
+(2, 3, 38, 43, 80, 63, 43, 52),
+(2, 3, 39, 43, 82, 64, 44, 53),
+(2, 3, 40, 44, 84, 66, 45, 54),
+(2, 3, 41, 45, 86, 67, 46, 55),
+(2, 3, 42, 45, 88, 68, 47, 56),
+(2, 3, 43, 46, 90, 70, 47, 57),
+(2, 3, 44, 47, 91, 71, 48, 58),
+(2, 3, 45, 47, 93, 72, 49, 59),
+(2, 3, 46, 48, 95, 74, 50, 60),
+(2, 3, 47, 49, 98, 75, 51, 61),
+(2, 3, 48, 50, 100, 77, 52, 62),
+(2, 3, 49, 50, 102, 78, 53, 63),
+(2, 3, 50, 51, 104, 79, 54, 64),
+(2, 3, 51, 52, 106, 81, 55, 65),
+(2, 3, 52, 52, 108, 82, 56, 66),
+(2, 3, 53, 53, 110, 84, 57, 67),
+(2, 3, 54, 54, 112, 85, 58, 68),
+(2, 3, 55, 55, 114, 87, 59, 69),
+(2, 3, 56, 55, 116, 88, 60, 70),
+(2, 3, 57, 56, 118, 90, 61, 71),
+(2, 3, 58, 57, 121, 91, 62, 72),
+(2, 3, 59, 58, 123, 93, 63, 73),
+(2, 3, 60, 59, 125, 94, 64, 74),
+(2, 3, 61, 59, 127, 96, 65, 76),
+(2, 3, 62, 60, 130, 97, 66, 77),
+(2, 3, 63, 61, 132, 99, 67, 78),
+(2, 3, 64, 62, 134, 100, 68, 79),
+(2, 3, 65, 63, 136, 102, 69, 80),
+(2, 3, 66, 64, 139, 104, 70, 81),
+(2, 3, 67, 64, 141, 105, 71, 82),
+(2, 3, 68, 65, 143, 107, 72, 84),
+(2, 3, 69, 66, 146, 108, 73, 85),
+(2, 3, 70, 67, 148, 110, 74, 86),
+(2, 3, 71, 68, 151, 112, 75, 87),
+(2, 3, 72, 69, 154, 114, 76, 88),
+(2, 3, 73, 70, 157, 116, 77, 90),
+(2, 3, 74, 71, 160, 118, 79, 91),
+(2, 3, 75, 72, 163, 120, 80, 93),
+(2, 3, 76, 73, 166, 122, 81, 94),
+(2, 3, 77, 74, 169, 124, 83, 96),
+(2, 3, 78, 75, 172, 126, 84, 97),
+(2, 3, 79, 76, 175, 128, 85, 99),
+(2, 3, 80, 77, 178, 130, 87, 100),
+(2, 4, 1, 24, 20, 23, 17, 23),
+(2, 4, 2, 25, 21, 24, 17, 23),
+(2, 4, 3, 25, 23, 24, 17, 24),
+(2, 4, 4, 26, 24, 25, 17, 24),
+(2, 4, 5, 27, 26, 26, 18, 24),
+(2, 4, 6, 28, 27, 26, 18, 25),
+(2, 4, 7, 29, 29, 27, 18, 25),
+(2, 4, 8, 29, 30, 28, 18, 26),
+(2, 4, 9, 30, 32, 29, 18, 26),
+(2, 4, 10, 31, 33, 29, 19, 26),
+(2, 4, 11, 32, 35, 30, 19, 27),
+(2, 4, 12, 33, 37, 31, 19, 27),
+(2, 4, 13, 34, 38, 32, 19, 28),
+(2, 4, 14, 34, 40, 32, 19, 28),
+(2, 4, 15, 35, 41, 33, 19, 28),
+(2, 4, 16, 36, 43, 34, 20, 29),
+(2, 4, 17, 37, 45, 35, 20, 29),
+(2, 4, 18, 38, 46, 36, 20, 30),
+(2, 4, 19, 39, 48, 37, 20, 30),
+(2, 4, 20, 40, 50, 37, 21, 31),
+(2, 4, 21, 41, 52, 38, 21, 31),
+(2, 4, 22, 42, 53, 39, 21, 31),
+(2, 4, 23, 43, 55, 40, 21, 32),
+(2, 4, 24, 43, 57, 41, 21, 32),
+(2, 4, 25, 44, 59, 42, 22, 33),
+(2, 4, 26, 45, 60, 43, 22, 33),
+(2, 4, 27, 46, 62, 44, 22, 34),
+(2, 4, 28, 47, 64, 44, 22, 34),
+(2, 4, 29, 48, 66, 45, 23, 35),
+(2, 4, 30, 49, 68, 46, 23, 35),
+(2, 4, 31, 50, 70, 47, 23, 36),
+(2, 4, 32, 51, 72, 48, 23, 36),
+(2, 4, 33, 53, 73, 49, 24, 37),
+(2, 4, 34, 54, 75, 50, 24, 38),
+(2, 4, 35, 55, 77, 51, 24, 38),
+(2, 4, 36, 56, 79, 52, 24, 39),
+(2, 4, 37, 57, 81, 53, 25, 39),
+(2, 4, 38, 58, 83, 54, 25, 40),
+(2, 4, 39, 59, 85, 55, 25, 40),
+(2, 4, 40, 60, 87, 56, 26, 41),
+(2, 4, 41, 61, 89, 57, 26, 41),
+(2, 4, 42, 62, 91, 58, 26, 42),
+(2, 4, 43, 63, 93, 59, 27, 43),
+(2, 4, 44, 65, 95, 60, 27, 43),
+(2, 4, 45, 66, 98, 61, 27, 44),
+(2, 4, 46, 67, 100, 62, 27, 44),
+(2, 4, 47, 68, 102, 64, 28, 45),
+(2, 4, 48, 69, 104, 65, 28, 46),
+(2, 4, 49, 71, 106, 66, 28, 46),
+(2, 4, 50, 72, 108, 67, 29, 47),
+(2, 4, 51, 73, 110, 68, 29, 48),
+(2, 4, 52, 74, 113, 69, 29, 48),
+(2, 4, 53, 75, 115, 70, 30, 49),
+(2, 4, 54, 77, 117, 71, 30, 50),
+(2, 4, 55, 78, 119, 73, 30, 50),
+(2, 4, 56, 79, 122, 74, 31, 51),
+(2, 4, 57, 80, 124, 75, 31, 52),
+(2, 4, 58, 82, 126, 76, 31, 52),
+(2, 4, 59, 83, 129, 77, 32, 53),
+(2, 4, 60, 84, 131, 78, 32, 54),
+(2, 4, 61, 86, 133, 80, 33, 54),
+(2, 4, 62, 87, 136, 81, 33, 55),
+(2, 4, 63, 88, 138, 82, 33, 56),
+(2, 4, 64, 90, 140, 83, 34, 57),
+(2, 4, 65, 91, 143, 85, 34, 57),
+(2, 4, 66, 92, 145, 86, 34, 58),
+(2, 4, 67, 94, 148, 87, 35, 59),
+(2, 4, 68, 95, 150, 88, 35, 59),
+(2, 4, 69, 97, 153, 90, 36, 60),
+(2, 4, 70, 98, 155, 91, 36, 61),
+(2, 4, 71, 100, 158, 92, 36, 62),
+(2, 4, 72, 102, 161, 94, 37, 62),
+(2, 4, 73, 103, 164, 99, 37, 63),
+(2, 4, 74, 105, 167, 100, 38, 64),
+(2, 4, 75, 107, 170, 102, 38, 65),
+(2, 4, 76, 108, 173, 102, 38, 66),
+(2, 4, 77, 110, 176, 102, 39, 67),
+(2, 4, 78, 112, 180, 103, 39, 68),
+(2, 4, 79, 114, 183, 105, 40, 69),
+(2, 4, 80, 116, 186, 107, 40, 70),
+(2, 6, 1, 26, 17, 24, 17, 23),
+(2, 6, 2, 27, 18, 25, 17, 23),
+(2, 6, 3, 29, 19, 26, 17, 24),
+(2, 6, 4, 30, 19, 27, 17, 24),
+(2, 6, 5, 31, 20, 29, 17, 24),
+(2, 6, 6, 32, 21, 30, 17, 24),
+(2, 6, 7, 34, 22, 31, 18, 25),
+(2, 6, 8, 35, 23, 32, 18, 25),
+(2, 6, 9, 37, 24, 34, 18, 25),
+(2, 6, 10, 38, 24, 35, 18, 26),
+(2, 6, 11, 39, 25, 36, 18, 26),
+(2, 6, 12, 41, 26, 37, 18, 26),
+(2, 6, 13, 42, 27, 39, 18, 27),
+(2, 6, 14, 44, 28, 40, 18, 27),
+(2, 6, 15, 45, 29, 41, 18, 27),
+(2, 6, 16, 47, 30, 43, 19, 28),
+(2, 6, 17, 48, 31, 44, 19, 28),
+(2, 6, 18, 50, 32, 45, 19, 28),
+(2, 6, 19, 51, 33, 47, 19, 29),
+(2, 6, 20, 53, 34, 48, 19, 29),
+(2, 6, 21, 54, 34, 50, 19, 29),
+(2, 6, 22, 56, 35, 51, 19, 30),
+(2, 6, 23, 57, 36, 52, 20, 30),
+(2, 6, 24, 59, 37, 54, 20, 30),
+(2, 6, 25, 60, 38, 55, 20, 31),
+(2, 6, 26, 62, 39, 57, 20, 31),
+(2, 6, 27, 64, 40, 58, 20, 32),
+(2, 6, 28, 65, 41, 60, 20, 32),
+(2, 6, 29, 67, 43, 61, 21, 32),
+(2, 6, 30, 69, 44, 63, 21, 33),
+(2, 6, 31, 70, 45, 64, 21, 33),
+(2, 6, 32, 72, 46, 66, 21, 34),
+(2, 6, 33, 74, 47, 67, 21, 34),
+(2, 6, 34, 76, 48, 69, 21, 35),
+(2, 6, 35, 77, 49, 71, 22, 35),
+(2, 6, 36, 79, 50, 72, 22, 36),
+(2, 6, 37, 81, 51, 74, 22, 36),
+(2, 6, 38, 83, 52, 76, 22, 36),
+(2, 6, 39, 84, 53, 77, 22, 37),
+(2, 6, 40, 86, 55, 79, 23, 37),
+(2, 6, 41, 88, 56, 81, 23, 38),
+(2, 6, 42, 90, 57, 82, 23, 38),
+(2, 6, 43, 92, 58, 84, 23, 39),
+(2, 6, 44, 94, 59, 86, 23, 39),
+(2, 6, 45, 96, 60, 87, 24, 40),
+(2, 6, 46, 98, 62, 89, 24, 40),
+(2, 6, 47, 100, 63, 91, 24, 41),
+(2, 6, 48, 101, 64, 93, 24, 41),
+(2, 6, 49, 103, 65, 94, 25, 42),
+(2, 6, 50, 105, 66, 96, 25, 42),
+(2, 6, 51, 107, 68, 98, 25, 43),
+(2, 6, 52, 109, 69, 100, 25, 43),
+(2, 6, 53, 110, 69, 100, 25, 44),
+(2, 6, 54, 111, 70, 101, 26, 45),
+(2, 6, 55, 111, 70, 101, 26, 45),
+(2, 6, 56, 114, 72, 104, 26, 46),
+(2, 6, 57, 116, 73, 106, 26, 46),
+(2, 6, 58, 118, 74, 108, 27, 47),
+(2, 6, 59, 124, 76, 110, 27, 47),
+(2, 6, 60, 126, 77, 112, 27, 48),
+(2, 6, 61, 128, 78, 114, 27, 49),
+(2, 6, 62, 131, 80, 116, 27, 49),
+(2, 6, 63, 133, 81, 119, 28, 50),
+(2, 6, 64, 136, 83, 121, 28, 50),
+(2, 6, 65, 136, 84, 123, 28, 51),
+(2, 6, 66, 142, 86, 126, 28, 52),
+(2, 6, 67, 145, 87, 128, 29, 52),
+(2, 6, 68, 147, 89, 130, 29, 53),
+(2, 6, 69, 150, 90, 133, 29, 54),
+(2, 6, 70, 157, 92, 135, 29, 54),
+(2, 6, 71, 160, 94, 138, 30, 55),
+(2, 6, 72, 163, 95, 140, 30, 56),
+(2, 6, 73, 166, 97, 151, 30, 57),
+(2, 6, 74, 169, 99, 154, 30, 57),
+(2, 6, 75, 172, 100, 156, 31, 58),
+(2, 6, 76, 175, 102, 160, 31, 59),
+(2, 6, 77, 179, 104, 162, 31, 60),
+(2, 6, 78, 182, 105, 165, 31, 60),
+(2, 6, 79, 191, 107, 168, 32, 61),
+(2, 6, 80, 194, 109, 171, 32, 62),
+(2, 7, 1, 24, 17, 23, 18, 25),
+(2, 7, 2, 25, 17, 24, 19, 26),
+(2, 7, 3, 26, 18, 25, 20, 27),
+(2, 7, 4, 26, 18, 26, 21, 28),
+(2, 7, 5, 27, 19, 27, 22, 29),
+(2, 7, 6, 28, 19, 28, 23, 30),
+(2, 7, 7, 29, 20, 29, 24, 31),
+(2, 7, 8, 30, 20, 30, 25, 32),
+(2, 7, 9, 31, 21, 31, 26, 33),
+(2, 7, 10, 32, 21, 32, 27, 34),
+(2, 7, 11, 33, 22, 33, 28, 36),
+(2, 7, 12, 34, 22, 34, 29, 37),
+(2, 7, 13, 34, 23, 35, 30, 38),
+(2, 7, 14, 35, 23, 36, 31, 39),
+(2, 7, 15, 36, 24, 37, 32, 40),
+(2, 7, 16, 37, 24, 39, 33, 41),
+(2, 7, 17, 38, 25, 40, 34, 43),
+(2, 7, 18, 39, 25, 41, 35, 44),
+(2, 7, 19, 40, 26, 42, 36, 45),
+(2, 7, 20, 41, 26, 43, 37, 46),
+(2, 7, 21, 42, 27, 44, 38, 47),
+(2, 7, 22, 43, 27, 45, 39, 49),
+(2, 7, 23, 44, 28, 47, 40, 50),
+(2, 7, 24, 45, 28, 48, 41, 51),
+(2, 7, 25, 47, 29, 49, 43, 52),
+(2, 7, 26, 48, 30, 50, 44, 54),
+(2, 7, 27, 49, 30, 52, 45, 55),
+(2, 7, 28, 50, 31, 53, 46, 56),
+(2, 7, 29, 51, 31, 54, 47, 58),
+(2, 7, 30, 52, 32, 55, 48, 59),
+(2, 7, 31, 53, 33, 57, 50, 60),
+(2, 7, 32, 54, 33, 58, 51, 62),
+(2, 7, 33, 55, 34, 59, 52, 63),
+(2, 7, 34, 57, 34, 61, 53, 65),
+(2, 7, 35, 58, 35, 62, 55, 66),
+(2, 7, 36, 59, 36, 63, 56, 67),
+(2, 7, 37, 60, 36, 65, 57, 69),
+(2, 7, 38, 61, 37, 66, 58, 70),
+(2, 7, 39, 62, 38, 67, 60, 72),
+(2, 7, 40, 64, 38, 69, 61, 73),
+(2, 7, 41, 65, 39, 70, 62, 75),
+(2, 7, 42, 66, 40, 72, 64, 76),
+(2, 7, 43, 67, 40, 73, 65, 78),
+(2, 7, 44, 69, 41, 74, 66, 79),
+(2, 7, 45, 70, 42, 76, 68, 81),
+(2, 7, 46, 71, 42, 77, 69, 82),
+(2, 7, 47, 72, 43, 79, 70, 84),
+(2, 7, 48, 74, 44, 80, 72, 85),
+(2, 7, 49, 75, 45, 82, 73, 87),
+(2, 7, 50, 76, 45, 83, 75, 89),
+(2, 7, 51, 78, 46, 85, 76, 90),
+(2, 7, 52, 79, 47, 86, 77, 92),
+(2, 7, 53, 80, 47, 88, 79, 93),
+(2, 7, 54, 82, 48, 90, 80, 95),
+(2, 7, 55, 83, 49, 91, 82, 97),
+(2, 7, 56, 85, 50, 93, 83, 98),
+(2, 7, 57, 86, 50, 94, 85, 100),
+(2, 7, 58, 87, 51, 96, 86, 102),
+(2, 7, 59, 89, 52, 97, 88, 103),
+(2, 7, 60, 90, 53, 99, 89, 105),
+(2, 7, 61, 92, 54, 101, 91, 107),
+(2, 7, 62, 93, 54, 102, 92, 109),
+(2, 7, 63, 95, 55, 104, 94, 110),
+(2, 7, 64, 96, 56, 106, 95, 112),
+(2, 7, 65, 97, 57, 107, 97, 114),
+(2, 7, 66, 99, 58, 109, 99, 116),
+(2, 7, 67, 100, 58, 111, 100, 118),
+(2, 7, 68, 102, 59, 113, 102, 119),
+(2, 7, 69, 103, 60, 114, 103, 121),
+(2, 7, 70, 105, 61, 116, 105, 123),
+(2, 7, 71, 106, 62, 118, 117, 125),
+(2, 7, 72, 108, 63, 120, 119, 128),
+(2, 7, 73, 110, 64, 122, 122, 130),
+(2, 7, 74, 112, 65, 125, 124, 132),
+(2, 7, 75, 114, 66, 127, 126, 134),
+(2, 7, 76, 116, 67, 129, 128, 137),
+(2, 7, 77, 117, 68, 131, 128, 139),
+(2, 7, 78, 119, 69, 133, 133, 141),
+(2, 7, 79, 121, 70, 136, 135, 144),
+(2, 7, 80, 123, 71, 138, 137, 146),
+(2, 9, 1, 23, 17, 23, 19, 25),
+(2, 9, 2, 23, 17, 24, 20, 26),
+(2, 9, 3, 24, 18, 24, 21, 27),
+(2, 9, 4, 24, 18, 25, 23, 28),
+(2, 9, 5, 24, 18, 25, 24, 30),
+(2, 9, 6, 24, 19, 26, 25, 31),
+(2, 9, 7, 25, 19, 26, 26, 32),
+(2, 9, 8, 25, 20, 27, 27, 33),
+(2, 9, 9, 25, 20, 27, 29, 34),
+(2, 9, 10, 26, 20, 28, 30, 36),
+(2, 9, 11, 26, 21, 29, 31, 37),
+(2, 9, 12, 26, 21, 29, 33, 38),
+(2, 9, 13, 27, 22, 30, 34, 39),
+(2, 9, 14, 27, 22, 31, 35, 41),
+(2, 9, 15, 27, 23, 31, 37, 42),
+(2, 9, 16, 28, 23, 32, 38, 43),
+(2, 9, 17, 28, 23, 32, 39, 45),
+(2, 9, 18, 28, 24, 33, 41, 46),
+(2, 9, 19, 29, 24, 34, 42, 47),
+(2, 9, 20, 29, 25, 34, 43, 49),
+(2, 9, 21, 29, 25, 35, 45, 50),
+(2, 9, 22, 30, 26, 36, 46, 51),
+(2, 9, 23, 30, 26, 37, 48, 53),
+(2, 9, 24, 30, 27, 37, 49, 54),
+(2, 9, 25, 31, 27, 38, 51, 56),
+(2, 9, 26, 31, 28, 39, 52, 57),
+(2, 9, 27, 32, 28, 39, 54, 59),
+(2, 9, 28, 32, 29, 40, 55, 60),
+(2, 9, 29, 32, 29, 41, 57, 62),
+(2, 9, 30, 33, 30, 42, 58, 63),
+(2, 9, 31, 33, 30, 42, 60, 65),
+(2, 9, 32, 34, 31, 43, 61, 66),
+(2, 9, 33, 34, 31, 44, 63, 68),
+(2, 9, 34, 35, 32, 45, 64, 69),
+(2, 9, 35, 35, 32, 45, 66, 71),
+(2, 9, 36, 36, 33, 46, 68, 72),
+(2, 9, 37, 36, 34, 47, 69, 74),
+(2, 9, 38, 36, 34, 48, 71, 76),
+(2, 9, 39, 37, 35, 49, 72, 77),
+(2, 9, 40, 37, 35, 50, 74, 79),
+(2, 9, 41, 38, 36, 50, 76, 80),
+(2, 9, 42, 38, 36, 51, 77, 82),
+(2, 9, 43, 39, 37, 52, 79, 84),
+(2, 9, 44, 39, 38, 53, 81, 85),
+(2, 9, 45, 40, 38, 54, 83, 87),
+(2, 9, 46, 40, 39, 55, 84, 89),
+(2, 9, 47, 41, 39, 56, 86, 91),
+(2, 9, 48, 41, 40, 56, 88, 92),
+(2, 9, 49, 42, 41, 57, 90, 94),
+(2, 9, 50, 42, 41, 58, 91, 96),
+(2, 9, 51, 43, 42, 59, 93, 98),
+(2, 9, 52, 43, 43, 60, 95, 99),
+(2, 9, 53, 44, 43, 61, 97, 101),
+(2, 9, 54, 45, 44, 62, 99, 103),
+(2, 9, 55, 45, 45, 63, 101, 105),
+(2, 9, 56, 46, 45, 64, 102, 107),
+(2, 9, 57, 46, 46, 65, 104, 109),
+(2, 9, 58, 47, 47, 66, 106, 110),
+(2, 9, 59, 47, 47, 67, 108, 112),
+(2, 9, 60, 48, 48, 68, 110, 114),
+(2, 9, 61, 48, 49, 69, 112, 116),
+(2, 9, 62, 49, 49, 70, 114, 118),
+(2, 9, 63, 50, 50, 71, 116, 120),
+(2, 9, 64, 50, 51, 72, 118, 122),
+(2, 9, 65, 51, 51, 73, 120, 124),
+(2, 9, 66, 52, 52, 74, 122, 126),
+(2, 9, 67, 52, 53, 75, 124, 128),
+(2, 9, 68, 53, 54, 76, 126, 130),
+(2, 9, 69, 53, 54, 77, 128, 132),
+(2, 9, 70, 54, 55, 78, 130, 134),
+(2, 9, 71, 55, 56, 88, 134, 145),
+(2, 9, 72, 56, 56, 89, 135, 147),
+(2, 9, 73, 57, 57, 90, 137, 150),
+(2, 9, 74, 57, 58, 91, 142, 153),
+(2, 9, 75, 58, 59, 93, 142, 155),
+(2, 9, 76, 59, 60, 94, 145, 158),
+(2, 9, 77, 60, 61, 95, 148, 161),
+(2, 9, 78, 60, 62, 97, 150, 164),
+(2, 9, 79, 61, 63, 98, 153, 167),
+(2, 9, 80, 62, 64, 99, 156, 169),
+(3, 1, 1, 25, 16, 25, 19, 19),
+(3, 1, 2, 26, 17, 26, 19, 19),
+(3, 1, 3, 28, 18, 27, 19, 20),
+(3, 1, 4, 29, 18, 28, 19, 20),
+(3, 1, 5, 30, 19, 30, 19, 20),
+(3, 1, 6, 31, 20, 31, 19, 20),
+(3, 1, 7, 33, 21, 32, 20, 21),
+(3, 1, 8, 34, 22, 33, 20, 21),
+(3, 1, 9, 36, 23, 35, 20, 21),
+(3, 1, 10, 37, 23, 36, 20, 22),
+(3, 1, 11, 38, 24, 37, 20, 22),
+(3, 1, 12, 40, 25, 38, 20, 22),
+(3, 1, 13, 41, 26, 40, 20, 23),
+(3, 1, 14, 43, 27, 41, 20, 23),
+(3, 1, 15, 44, 28, 42, 20, 23),
+(3, 1, 16, 46, 29, 44, 21, 24),
+(3, 1, 17, 47, 30, 45, 21, 24),
+(3, 1, 18, 49, 31, 46, 21, 24),
+(3, 1, 19, 50, 32, 48, 21, 25),
+(3, 1, 20, 52, 33, 49, 21, 25),
+(3, 1, 21, 53, 34, 51, 21, 26),
+(3, 1, 22, 55, 34, 52, 21, 26),
+(3, 1, 23, 56, 35, 53, 21, 26),
+(3, 1, 24, 58, 36, 55, 22, 27),
+(3, 1, 25, 59, 37, 56, 22, 27),
+(3, 1, 26, 61, 38, 58, 22, 27),
+(3, 1, 27, 63, 39, 59, 22, 28),
+(3, 1, 28, 64, 41, 61, 22, 28),
+(3, 1, 29, 66, 42, 62, 22, 29),
+(3, 1, 30, 68, 43, 64, 23, 29),
+(3, 1, 31, 69, 44, 65, 23, 30),
+(3, 1, 32, 71, 45, 67, 23, 30),
+(3, 1, 33, 73, 46, 68, 23, 30),
+(3, 1, 34, 75, 47, 70, 23, 31),
+(3, 1, 35, 76, 48, 72, 24, 31),
+(3, 1, 36, 78, 49, 73, 24, 32),
+(3, 1, 37, 80, 50, 75, 24, 32),
+(3, 1, 38, 82, 51, 76, 24, 33),
+(3, 1, 39, 84, 52, 78, 24, 33),
+(3, 1, 40, 85, 54, 80, 24, 34),
+(3, 1, 41, 87, 55, 81, 25, 34),
+(3, 1, 42, 89, 56, 83, 25, 35),
+(3, 1, 43, 91, 57, 85, 25, 35),
+(3, 1, 44, 93, 58, 87, 25, 36),
+(3, 1, 45, 95, 59, 88, 26, 36),
+(3, 1, 46, 97, 61, 90, 26, 37),
+(3, 1, 47, 99, 62, 92, 26, 37),
+(3, 1, 48, 101, 63, 94, 26, 38),
+(3, 1, 49, 102, 64, 95, 26, 38),
+(3, 1, 50, 104, 65, 97, 27, 39),
+(3, 1, 51, 106, 67, 99, 27, 39),
+(3, 1, 52, 108, 68, 101, 27, 40),
+(3, 1, 53, 110, 69, 103, 27, 40),
+(3, 1, 54, 112, 70, 104, 28, 41),
+(3, 1, 55, 115, 72, 106, 28, 41),
+(3, 1, 56, 117, 73, 108, 28, 42),
+(3, 1, 57, 119, 74, 110, 28, 42),
+(3, 1, 58, 121, 76, 112, 29, 43),
+(3, 1, 59, 123, 77, 114, 29, 43),
+(3, 1, 60, 125, 78, 116, 29, 44),
+(3, 1, 61, 127, 80, 118, 29, 45),
+(3, 1, 62, 129, 81, 120, 30, 45),
+(3, 1, 63, 131, 82, 122, 30, 46),
+(3, 1, 64, 134, 84, 124, 30, 46),
+(3, 1, 65, 136, 85, 126, 31, 47),
+(3, 1, 66, 138, 86, 128, 31, 48),
+(3, 1, 67, 140, 88, 130, 31, 48),
+(3, 1, 68, 142, 89, 132, 31, 49),
+(3, 1, 69, 145, 91, 134, 32, 49),
+(3, 1, 70, 147, 92, 136, 32, 50),
+(3, 1, 71, 150, 93, 138, 32, 51),
+(3, 1, 72, 152, 95, 141, 32, 52),
+(3, 1, 73, 164, 97, 151, 32, 53),
+(3, 1, 74, 164, 98, 151, 33, 53),
+(3, 1, 75, 170, 100, 156, 33, 54),
+(3, 1, 76, 173, 102, 160, 33, 55),
+(3, 1, 77, 173, 104, 160, 34, 56),
+(3, 1, 78, 176, 105, 162, 34, 56),
+(3, 1, 79, 183, 107, 168, 34, 57),
+(3, 1, 80, 186, 109, 171, 35, 58),
+(3, 2, 1, 24, 16, 25, 19, 20),
+(3, 2, 2, 25, 17, 26, 20, 21),
+(3, 2, 3, 26, 17, 27, 20, 21),
+(3, 2, 4, 27, 18, 28, 21, 22),
+(3, 2, 5, 28, 18, 29, 22, 23),
+(3, 2, 6, 29, 19, 30, 22, 24),
+(3, 2, 7, 31, 20, 31, 23, 24),
+(3, 2, 8, 32, 20, 32, 24, 25),
+(3, 2, 9, 33, 21, 33, 24, 26),
+(3, 2, 10, 34, 21, 34, 25, 26),
+(3, 2, 11, 35, 22, 36, 26, 27),
+(3, 2, 12, 36, 23, 37, 26, 28),
+(3, 2, 13, 38, 23, 38, 27, 29),
+(3, 2, 14, 39, 24, 39, 28, 30),
+(3, 2, 15, 40, 25, 40, 29, 30),
+(3, 2, 16, 41, 25, 41, 29, 31),
+(3, 2, 17, 43, 26, 43, 30, 32),
+(3, 2, 18, 44, 27, 44, 31, 33),
+(3, 2, 19, 45, 28, 45, 32, 34),
+(3, 2, 20, 47, 28, 46, 32, 35),
+(3, 2, 21, 48, 29, 47, 33, 35),
+(3, 2, 22, 49, 30, 49, 34, 36),
+(3, 2, 23, 51, 30, 50, 35, 37),
+(3, 2, 24, 52, 31, 51, 36, 38),
+(3, 2, 25, 53, 32, 52, 36, 39),
+(3, 2, 26, 55, 33, 54, 37, 40),
+(3, 2, 27, 56, 33, 55, 38, 41),
+(3, 2, 28, 57, 34, 56, 39, 42),
+(3, 2, 29, 59, 35, 58, 40, 43),
+(3, 2, 30, 60, 36, 59, 41, 43),
+(3, 2, 31, 62, 37, 60, 42, 44),
+(3, 2, 32, 63, 37, 62, 42, 45),
+(3, 2, 33, 65, 38, 63, 43, 46),
+(3, 2, 34, 66, 39, 65, 44, 47),
+(3, 2, 35, 68, 40, 66, 45, 48),
+(3, 2, 36, 69, 41, 67, 46, 49),
+(3, 2, 37, 71, 41, 69, 47, 50),
+(3, 2, 38, 72, 42, 70, 48, 51),
+(3, 2, 39, 74, 43, 72, 49, 52),
+(3, 2, 40, 75, 44, 73, 50, 53),
+(3, 2, 41, 77, 45, 75, 51, 54),
+(3, 2, 42, 78, 46, 76, 52, 55),
+(3, 2, 43, 80, 47, 78, 53, 56),
+(3, 2, 44, 82, 47, 79, 54, 57),
+(3, 2, 45, 83, 48, 81, 55, 59),
+(3, 2, 46, 85, 49, 82, 56, 60),
+(3, 2, 47, 87, 50, 84, 57, 61),
+(3, 2, 48, 88, 51, 85, 58, 62),
+(3, 2, 49, 90, 52, 87, 59, 63),
+(3, 2, 50, 92, 53, 89, 60, 64),
+(3, 2, 51, 93, 54, 90, 61, 65),
+(3, 2, 52, 95, 55, 92, 62, 66),
+(3, 2, 53, 97, 56, 93, 63, 67),
+(3, 2, 54, 98, 57, 95, 64, 69),
+(3, 2, 55, 100, 58, 97, 65, 70),
+(3, 2, 56, 102, 59, 98, 66, 71),
+(3, 2, 57, 104, 60, 100, 67, 72),
+(3, 2, 58, 106, 61, 102, 68, 73),
+(3, 2, 59, 107, 62, 103, 69, 74),
+(3, 2, 60, 109, 63, 105, 70, 76),
+(3, 2, 61, 111, 64, 107, 72, 77),
+(3, 2, 62, 113, 65, 109, 73, 78),
+(3, 2, 63, 115, 66, 110, 74, 79),
+(3, 2, 64, 117, 67, 112, 75, 80),
+(3, 2, 65, 118, 68, 114, 76, 82),
+(3, 2, 66, 120, 69, 116, 77, 83),
+(3, 2, 67, 122, 70, 118, 78, 84),
+(3, 2, 68, 124, 71, 119, 80, 85),
+(3, 2, 69, 126, 72, 121, 81, 87),
+(3, 2, 70, 128, 73, 123, 82, 88),
+(3, 2, 71, 150, 74, 125, 83, 89),
+(3, 2, 72, 152, 75, 128, 85, 91),
+(3, 2, 73, 156, 76, 130, 86, 93),
+(3, 2, 74, 158, 78, 132, 88, 94),
+(3, 2, 75, 161, 79, 134, 89, 96),
+(3, 2, 76, 164, 80, 137, 91, 97),
+(3, 2, 77, 166, 82, 139, 92, 99),
+(3, 2, 78, 170, 83, 141, 94, 101),
+(3, 2, 79, 172, 84, 144, 95, 102),
+(3, 2, 80, 175, 86, 146, 97, 104),
+(3, 3, 1, 22, 19, 24, 19, 20),
+(3, 3, 2, 22, 20, 25, 20, 21),
+(3, 3, 3, 23, 22, 26, 20, 21),
+(3, 3, 4, 23, 23, 27, 21, 22),
+(3, 3, 5, 24, 25, 28, 21, 23),
+(3, 3, 6, 24, 26, 29, 22, 23),
+(3, 3, 7, 25, 27, 29, 23, 24),
+(3, 3, 8, 25, 29, 30, 23, 25),
+(3, 3, 9, 25, 30, 31, 24, 25),
+(3, 3, 10, 26, 32, 32, 24, 26),
+(3, 3, 11, 26, 33, 33, 25, 27),
+(3, 3, 12, 27, 35, 34, 26, 27),
+(3, 3, 13, 27, 36, 35, 26, 28),
+(3, 3, 14, 28, 38, 36, 27, 29),
+(3, 3, 15, 28, 39, 37, 28, 29),
+(3, 3, 16, 29, 41, 38, 28, 30),
+(3, 3, 17, 29, 42, 39, 29, 31),
+(3, 3, 18, 30, 44, 41, 30, 32),
+(3, 3, 19, 30, 46, 42, 30, 32),
+(3, 3, 20, 31, 47, 43, 31, 33),
+(3, 3, 21, 32, 49, 44, 32, 34),
+(3, 3, 22, 32, 51, 45, 33, 35),
+(3, 3, 23, 33, 52, 46, 33, 36),
+(3, 3, 24, 33, 54, 47, 34, 36),
+(3, 3, 25, 34, 56, 48, 35, 37),
+(3, 3, 26, 34, 57, 49, 35, 38),
+(3, 3, 27, 35, 59, 51, 36, 39),
+(3, 3, 28, 35, 61, 52, 37, 40),
+(3, 3, 29, 36, 63, 53, 38, 40),
+(3, 3, 30, 37, 64, 54, 39, 41),
+(3, 3, 31, 37, 66, 55, 39, 42),
+(3, 3, 32, 38, 68, 57, 40, 43),
+(3, 3, 33, 38, 70, 58, 41, 44),
+(3, 3, 34, 39, 71, 59, 42, 45),
+(3, 3, 35, 40, 73, 60, 43, 46),
+(3, 3, 36, 40, 75, 62, 43, 47),
+(3, 3, 37, 41, 77, 63, 44, 47),
+(3, 3, 38, 42, 79, 64, 45, 48),
+(3, 3, 39, 42, 81, 65, 46, 49),
+(3, 3, 40, 43, 83, 67, 47, 50),
+(3, 3, 41, 44, 85, 68, 48, 51),
+(3, 3, 42, 44, 87, 69, 49, 52),
+(3, 3, 43, 45, 89, 71, 49, 53),
+(3, 3, 44, 46, 91, 72, 50, 54),
+(3, 3, 45, 46, 93, 73, 51, 55),
+(3, 3, 46, 47, 95, 75, 52, 56),
+(3, 3, 47, 48, 97, 76, 53, 57),
+(3, 3, 48, 49, 99, 78, 54, 58),
+(3, 3, 49, 49, 101, 79, 55, 59),
+(3, 3, 50, 50, 103, 80, 56, 60),
+(3, 3, 51, 51, 105, 82, 57, 61),
+(3, 3, 52, 51, 107, 83, 58, 62),
+(3, 3, 53, 52, 109, 85, 59, 63),
+(3, 3, 54, 53, 111, 86, 60, 64),
+(3, 3, 55, 54, 113, 88, 61, 65),
+(3, 3, 56, 55, 115, 89, 62, 66),
+(3, 3, 57, 55, 118, 91, 62, 67),
+(3, 3, 58, 56, 120, 92, 63, 68),
+(3, 3, 59, 57, 122, 94, 64, 70),
+(3, 3, 60, 58, 124, 95, 65, 71),
+(3, 3, 61, 58, 126, 97, 67, 72),
+(3, 3, 62, 59, 129, 98, 68, 73),
+(3, 3, 63, 60, 131, 100, 69, 74),
+(3, 3, 64, 61, 133, 101, 70, 75),
+(3, 3, 65, 62, 135, 103, 71, 76),
+(3, 3, 66, 63, 138, 105, 72, 77),
+(3, 3, 67, 63, 140, 106, 73, 78),
+(3, 3, 68, 64, 142, 108, 74, 80),
+(3, 3, 69, 65, 145, 109, 75, 81),
+(3, 3, 70, 66, 147, 111, 76, 82),
+(3, 3, 71, 67, 150, 113, 77, 83),
+(3, 3, 72, 68, 153, 115, 78, 84),
+(3, 3, 73, 69, 156, 117, 79, 86),
+(3, 3, 74, 70, 159, 119, 81, 87),
+(3, 3, 75, 71, 162, 121, 82, 89),
+(3, 3, 76, 72, 165, 123, 83, 90),
+(3, 3, 77, 73, 168, 125, 85, 92),
+(3, 3, 78, 74, 171, 127, 86, 93),
+(3, 3, 79, 75, 174, 129, 87, 95),
+(3, 3, 80, 76, 177, 131, 89, 96),
+(3, 4, 1, 23, 19, 24, 19, 19),
+(3, 4, 2, 24, 20, 25, 19, 19),
+(3, 4, 3, 24, 22, 25, 19, 20),
+(3, 4, 4, 25, 23, 26, 19, 20),
+(3, 4, 5, 26, 25, 27, 20, 20),
+(3, 4, 6, 27, 26, 27, 20, 21),
+(3, 4, 7, 28, 28, 28, 20, 21),
+(3, 4, 8, 28, 29, 29, 20, 22),
+(3, 4, 9, 29, 31, 30, 20, 22),
+(3, 4, 10, 30, 32, 30, 20, 22),
+(3, 4, 11, 31, 34, 31, 21, 23),
+(3, 4, 12, 32, 36, 32, 21, 23),
+(3, 4, 13, 33, 37, 33, 21, 24),
+(3, 4, 14, 33, 39, 33, 21, 24),
+(3, 4, 15, 34, 40, 34, 21, 25),
+(3, 4, 16, 35, 42, 35, 22, 25),
+(3, 4, 17, 36, 44, 36, 22, 25),
+(3, 4, 18, 37, 45, 37, 22, 26),
+(3, 4, 19, 38, 47, 38, 22, 26),
+(3, 4, 20, 39, 49, 38, 22, 27),
+(3, 4, 21, 40, 51, 39, 23, 27),
+(3, 4, 22, 41, 52, 40, 23, 28),
+(3, 4, 23, 42, 54, 41, 23, 28),
+(3, 4, 24, 43, 56, 42, 23, 29),
+(3, 4, 25, 44, 58, 43, 24, 29),
+(3, 4, 26, 44, 59, 44, 24, 30),
+(3, 4, 27, 45, 61, 44, 24, 30),
+(3, 4, 28, 46, 63, 45, 24, 31),
+(3, 4, 29, 47, 65, 46, 25, 31),
+(3, 4, 30, 48, 67, 47, 25, 32),
+(3, 4, 31, 49, 69, 48, 25, 32),
+(3, 4, 32, 51, 71, 49, 25, 33),
+(3, 4, 33, 52, 72, 50, 26, 33),
+(3, 4, 34, 53, 74, 51, 26, 34),
+(3, 4, 35, 54, 76, 52, 26, 34),
+(3, 4, 36, 55, 78, 53, 26, 35),
+(3, 4, 37, 56, 80, 54, 27, 35),
+(3, 4, 38, 57, 82, 55, 27, 36),
+(3, 4, 39, 58, 84, 56, 27, 37),
+(3, 4, 40, 59, 86, 57, 28, 37),
+(3, 4, 41, 60, 88, 58, 28, 38),
+(3, 4, 42, 61, 90, 59, 28, 38),
+(3, 4, 43, 63, 92, 60, 28, 39),
+(3, 4, 44, 64, 95, 61, 29, 39),
+(3, 4, 45, 65, 97, 62, 29, 40),
+(3, 4, 46, 66, 99, 63, 29, 41),
+(3, 4, 47, 67, 101, 64, 30, 41),
+(3, 4, 48, 68, 103, 66, 30, 42),
+(3, 4, 49, 70, 105, 67, 30, 43),
+(3, 4, 50, 71, 107, 68, 31, 43),
+(3, 4, 51, 72, 110, 69, 31, 44),
+(3, 4, 52, 73, 112, 70, 31, 44),
+(3, 4, 53, 74, 114, 71, 32, 45),
+(3, 4, 54, 76, 116, 72, 32, 46),
+(3, 4, 55, 77, 118, 73, 32, 46),
+(3, 4, 56, 78, 121, 75, 33, 47),
+(3, 4, 57, 80, 123, 76, 33, 48),
+(3, 4, 58, 81, 125, 77, 33, 48),
+(3, 4, 59, 82, 128, 78, 34, 49),
+(3, 4, 60, 83, 130, 79, 34, 50),
+(3, 4, 61, 85, 132, 81, 34, 51),
+(3, 4, 62, 86, 135, 82, 35, 51),
+(3, 4, 63, 87, 137, 83, 35, 52),
+(3, 4, 64, 89, 139, 84, 36, 53),
+(3, 4, 65, 90, 142, 86, 36, 53),
+(3, 4, 66, 91, 144, 87, 36, 54),
+(3, 4, 67, 93, 147, 88, 37, 55),
+(3, 4, 68, 94, 149, 89, 37, 56),
+(3, 4, 69, 96, 152, 91, 38, 56),
+(3, 4, 70, 97, 154, 92, 38, 57),
+(3, 4, 71, 99, 157, 93, 38, 58),
+(3, 4, 72, 101, 160, 96, 39, 58),
+(3, 4, 73, 102, 163, 97, 39, 59),
+(3, 4, 74, 104, 166, 98, 40, 60),
+(3, 4, 75, 106, 169, 100, 40, 61),
+(3, 4, 76, 107, 172, 101, 40, 62),
+(3, 4, 77, 109, 175, 103, 41, 63),
+(3, 4, 78, 111, 179, 105, 41, 64),
+(3, 4, 79, 113, 182, 106, 42, 65),
+(3, 4, 80, 115, 185, 108, 42, 66),
+(3, 5, 1, 22, 16, 23, 21, 22),
+(3, 5, 2, 22, 16, 23, 22, 23),
+(3, 5, 3, 22, 16, 24, 24, 25),
+(3, 5, 4, 22, 17, 24, 25, 26),
+(3, 5, 5, 23, 17, 24, 26, 27),
+(3, 5, 6, 23, 17, 25, 28, 29),
+(3, 5, 7, 23, 17, 25, 29, 30),
+(3, 5, 8, 23, 18, 26, 30, 32),
+(3, 5, 9, 23, 18, 26, 32, 33),
+(3, 5, 10, 23, 18, 26, 33, 35),
+(3, 5, 11, 24, 18, 27, 35, 36),
+(3, 5, 12, 24, 19, 27, 36, 38),
+(3, 5, 13, 24, 19, 28, 37, 39),
+(3, 5, 14, 24, 19, 28, 39, 41),
+(3, 5, 15, 24, 19, 28, 40, 42),
+(3, 5, 16, 24, 20, 29, 42, 44),
+(3, 5, 17, 25, 20, 29, 43, 45),
+(3, 5, 18, 25, 20, 30, 45, 47),
+(3, 5, 19, 25, 21, 30, 46, 49),
+(3, 5, 20, 25, 21, 31, 48, 50),
+(3, 5, 21, 25, 21, 31, 50, 52),
+(3, 5, 22, 26, 22, 31, 51, 53),
+(3, 5, 23, 26, 22, 32, 53, 55),
+(3, 5, 24, 26, 22, 32, 54, 57),
+(3, 5, 25, 26, 22, 33, 56, 58),
+(3, 5, 26, 27, 23, 33, 58, 60),
+(3, 5, 27, 27, 23, 34, 59, 62),
+(3, 5, 28, 27, 23, 34, 61, 64),
+(3, 5, 29, 27, 24, 35, 63, 65),
+(3, 5, 30, 28, 24, 35, 64, 67),
+(3, 5, 31, 28, 24, 36, 66, 69),
+(3, 5, 32, 28, 25, 36, 68, 71),
+(3, 5, 33, 28, 25, 37, 70, 72),
+(3, 5, 34, 29, 26, 38, 71, 74),
+(3, 5, 35, 29, 26, 38, 73, 76),
+(3, 5, 36, 29, 26, 39, 75, 78),
+(3, 5, 37, 29, 27, 39, 77, 80),
+(3, 5, 38, 30, 27, 40, 78, 82),
+(3, 5, 39, 30, 27, 40, 80, 84),
+(3, 5, 40, 30, 28, 41, 82, 86),
+(3, 5, 41, 31, 28, 41, 84, 88),
+(3, 5, 42, 31, 29, 42, 86, 89),
+(3, 5, 43, 31, 29, 43, 88, 91),
+(3, 5, 44, 32, 29, 43, 90, 93),
+(3, 5, 45, 32, 30, 44, 92, 95),
+(3, 5, 46, 32, 30, 44, 93, 97),
+(3, 5, 47, 32, 30, 45, 95, 99),
+(3, 5, 48, 33, 31, 46, 97, 101),
+(3, 5, 49, 33, 31, 46, 99, 103),
+(3, 5, 50, 33, 32, 47, 101, 106),
+(3, 5, 51, 34, 32, 48, 103, 108),
+(3, 5, 52, 34, 33, 48, 105, 110),
+(3, 5, 53, 35, 33, 49, 107, 112),
+(3, 5, 54, 35, 33, 50, 109, 114),
+(3, 5, 55, 35, 34, 50, 111, 116),
+(3, 5, 56, 36, 34, 51, 113, 118),
+(3, 5, 57, 36, 35, 52, 116, 120),
+(3, 5, 58, 36, 35, 52, 118, 123),
+(3, 5, 59, 37, 36, 53, 120, 125),
+(3, 5, 60, 37, 36, 54, 122, 127),
+(3, 5, 61, 37, 37, 54, 124, 129),
+(3, 5, 62, 38, 37, 55, 126, 131),
+(3, 5, 63, 38, 38, 56, 128, 134),
+(3, 5, 64, 39, 38, 57, 131, 136),
+(3, 5, 65, 39, 39, 57, 133, 138),
+(3, 5, 66, 39, 39, 58, 135, 141),
+(3, 5, 67, 40, 40, 59, 137, 143),
+(3, 5, 68, 40, 40, 59, 139, 145),
+(3, 5, 69, 41, 40, 60, 142, 148),
+(3, 5, 70, 41, 41, 61, 144, 150),
+(3, 5, 71, 41, 42, 62, 147, 153),
+(3, 5, 72, 42, 42, 62, 150, 163),
+(3, 5, 73, 42, 43, 63, 153, 166),
+(3, 5, 74, 43, 43, 64, 155, 170),
+(3, 5, 75, 43, 44, 65, 158, 173),
+(3, 5, 76, 43, 45, 66, 161, 176),
+(3, 5, 77, 44, 45, 67, 164, 179),
+(3, 5, 78, 44, 46, 68, 167, 182),
+(3, 5, 79, 45, 46, 69, 170, 184),
+(3, 5, 80, 45, 47, 70, 173, 189),
+(3, 6, 1, 25, 16, 25, 19, 19),
+(3, 6, 2, 26, 17, 26, 19, 19),
+(3, 6, 3, 28, 18, 27, 19, 20),
+(3, 6, 4, 29, 18, 28, 19, 20),
+(3, 6, 5, 30, 19, 30, 19, 20),
+(3, 6, 6, 31, 20, 31, 19, 20),
+(3, 6, 7, 33, 21, 32, 20, 21),
+(3, 6, 8, 34, 22, 33, 20, 21),
+(3, 6, 9, 36, 23, 35, 20, 21),
+(3, 6, 10, 37, 23, 36, 20, 22),
+(3, 6, 11, 38, 24, 37, 20, 22),
+(3, 6, 12, 40, 25, 38, 20, 22),
+(3, 6, 13, 41, 26, 40, 20, 23),
+(3, 6, 14, 43, 27, 41, 20, 23),
+(3, 6, 15, 44, 28, 42, 20, 23),
+(3, 6, 16, 46, 29, 44, 21, 24),
+(3, 6, 17, 47, 30, 45, 21, 24),
+(3, 6, 18, 49, 31, 46, 21, 24),
+(3, 6, 19, 50, 32, 48, 21, 25),
+(3, 6, 20, 52, 33, 49, 21, 25),
+(3, 6, 21, 53, 34, 51, 21, 26),
+(3, 6, 22, 55, 34, 52, 21, 26),
+(3, 6, 23, 56, 35, 53, 21, 26),
+(3, 6, 24, 58, 36, 55, 22, 27),
+(3, 6, 25, 59, 37, 56, 22, 27),
+(3, 6, 26, 61, 38, 58, 22, 27),
+(3, 6, 27, 63, 39, 59, 22, 28),
+(3, 6, 28, 64, 41, 61, 22, 28),
+(3, 6, 29, 66, 42, 62, 22, 29),
+(3, 6, 30, 68, 43, 64, 23, 29),
+(3, 6, 31, 69, 44, 65, 23, 30),
+(3, 6, 32, 71, 45, 67, 23, 30),
+(3, 6, 33, 73, 46, 68, 23, 30),
+(3, 6, 34, 75, 47, 70, 23, 31),
+(3, 6, 35, 76, 48, 72, 24, 31),
+(3, 6, 36, 78, 49, 73, 24, 32),
+(3, 6, 37, 80, 50, 75, 24, 32),
+(3, 6, 38, 82, 51, 76, 24, 33),
+(3, 6, 39, 84, 52, 78, 24, 33),
+(3, 6, 40, 85, 54, 80, 24, 34),
+(3, 6, 41, 87, 55, 81, 25, 34),
+(3, 6, 42, 89, 56, 83, 25, 35),
+(3, 6, 43, 91, 57, 85, 25, 35),
+(3, 6, 44, 93, 58, 87, 25, 36),
+(3, 6, 45, 95, 59, 88, 26, 36),
+(3, 6, 46, 97, 61, 90, 26, 37),
+(3, 6, 47, 99, 62, 92, 26, 37),
+(3, 6, 48, 101, 63, 94, 26, 38),
+(3, 6, 49, 102, 64, 95, 26, 38),
+(3, 6, 50, 104, 65, 97, 27, 39),
+(3, 6, 51, 106, 67, 99, 27, 39),
+(3, 6, 52, 108, 68, 99, 27, 40),
+(3, 6, 53, 109, 68, 101, 27, 40),
+(3, 6, 54, 110, 69, 101, 28, 41),
+(3, 6, 55, 110, 69, 102, 28, 41),
+(3, 6, 56, 113, 71, 105, 28, 42),
+(3, 6, 57, 118, 72, 107, 28, 42),
+(3, 6, 58, 120, 73, 109, 29, 43),
+(3, 6, 59, 123, 75, 111, 29, 43),
+(3, 6, 60, 125, 76, 113, 29, 44),
+(3, 6, 61, 126, 77, 115, 29, 45),
+(3, 6, 62, 127, 79, 117, 29, 45),
+(3, 6, 63, 129, 80, 120, 30, 46),
+(3, 6, 64, 132, 82, 122, 30, 46),
+(3, 6, 65, 135, 83, 124, 30, 47),
+(3, 6, 66, 137, 85, 127, 30, 48),
+(3, 6, 67, 144, 86, 129, 31, 48),
+(3, 6, 68, 146, 88, 131, 31, 49),
+(3, 6, 69, 149, 89, 133, 31, 50),
+(3, 6, 70, 152, 91, 136, 31, 50),
+(3, 6, 71, 154, 93, 139, 32, 51),
+(3, 6, 72, 157, 94, 141, 32, 52),
+(3, 6, 73, 160, 96, 144, 32, 53),
+(3, 6, 74, 163, 98, 146, 32, 53),
+(3, 6, 75, 166, 99, 150, 33, 54),
+(3, 6, 76, 169, 101, 152, 33, 55),
+(3, 6, 77, 172, 103, 155, 33, 56),
+(3, 6, 78, 176, 104, 157, 33, 56),
+(3, 6, 79, 179, 106, 160, 34, 57),
+(3, 6, 80, 182, 108, 163, 34, 58),
+(4, 1, 1, 20, 25, 21, 20, 20),
+(4, 1, 2, 21, 26, 22, 20, 20),
+(4, 1, 3, 23, 27, 23, 20, 21),
+(4, 1, 4, 24, 27, 25, 20, 21),
+(4, 1, 5, 25, 28, 26, 20, 21),
+(4, 1, 6, 27, 29, 27, 20, 21),
+(4, 1, 7, 28, 30, 28, 21, 22),
+(4, 1, 8, 29, 31, 29, 21, 22),
+(4, 1, 9, 31, 31, 31, 21, 22),
+(4, 1, 10, 32, 32, 32, 21, 23),
+(4, 1, 11, 33, 33, 33, 21, 23),
+(4, 1, 12, 35, 34, 34, 21, 23),
+(4, 1, 13, 36, 35, 36, 21, 24),
+(4, 1, 14, 38, 36, 37, 21, 24),
+(4, 1, 15, 39, 37, 38, 21, 24),
+(4, 1, 16, 41, 37, 40, 21, 25),
+(4, 1, 17, 42, 38, 41, 22, 25),
+(4, 1, 18, 44, 39, 43, 22, 25),
+(4, 1, 19, 45, 40, 44, 22, 26),
+(4, 1, 20, 47, 41, 45, 22, 26),
+(4, 1, 21, 48, 42, 47, 22, 26),
+(4, 1, 22, 50, 43, 48, 22, 27),
+(4, 1, 23, 52, 44, 50, 22, 27),
+(4, 1, 24, 53, 45, 51, 23, 28),
+(4, 1, 25, 55, 46, 52, 23, 28),
+(4, 1, 26, 56, 47, 54, 23, 28),
+(4, 1, 27, 58, 48, 55, 23, 29),
+(4, 1, 28, 60, 49, 57, 23, 29),
+(4, 1, 29, 61, 50, 58, 23, 30),
+(4, 1, 30, 63, 51, 60, 24, 30),
+(4, 1, 31, 65, 52, 62, 24, 30),
+(4, 1, 32, 66, 53, 63, 24, 31),
+(4, 1, 33, 68, 54, 65, 24, 31),
+(4, 1, 34, 70, 55, 66, 24, 32),
+(4, 1, 35, 72, 56, 68, 24, 32),
+(4, 1, 36, 73, 58, 69, 25, 33),
+(4, 1, 37, 75, 59, 71, 25, 33),
+(4, 1, 38, 77, 60, 73, 25, 34),
+(4, 1, 39, 79, 61, 74, 25, 34),
+(4, 1, 40, 81, 62, 76, 25, 35),
+(4, 1, 41, 82, 63, 78, 26, 35),
+(4, 1, 42, 84, 64, 79, 26, 35),
+(4, 1, 43, 86, 66, 81, 26, 36),
+(4, 1, 44, 88, 67, 83, 26, 36),
+(4, 1, 45, 90, 68, 85, 26, 37),
+(4, 1, 46, 92, 69, 86, 27, 37),
+(4, 1, 47, 94, 70, 88, 27, 38),
+(4, 1, 48, 96, 72, 90, 27, 38),
+(4, 1, 49, 98, 73, 92, 27, 39),
+(4, 1, 50, 100, 74, 93, 28, 40),
+(4, 1, 51, 102, 75, 95, 28, 40),
+(4, 1, 52, 104, 77, 97, 28, 41),
+(4, 1, 53, 106, 78, 99, 28, 41),
+(4, 1, 54, 108, 79, 101, 29, 42),
+(4, 1, 55, 110, 80, 103, 29, 42),
+(4, 1, 56, 112, 82, 104, 29, 43),
+(4, 1, 57, 114, 83, 106, 29, 43),
+(4, 1, 58, 116, 84, 108, 30, 44),
+(4, 1, 59, 118, 86, 110, 30, 44),
+(4, 1, 60, 120, 87, 112, 30, 45),
+(4, 1, 61, 122, 88, 114, 30, 46),
+(4, 1, 62, 124, 90, 116, 31, 46),
+(4, 1, 63, 127, 91, 118, 31, 47),
+(4, 1, 64, 129, 92, 120, 31, 47),
+(4, 1, 65, 131, 94, 122, 32, 48),
+(4, 1, 66, 133, 95, 124, 32, 49),
+(4, 1, 67, 135, 97, 126, 32, 49),
+(4, 1, 68, 138, 98, 128, 32, 50),
+(4, 1, 69, 140, 100, 130, 33, 50),
+(4, 1, 70, 142, 101, 132, 33, 51),
+(4, 1, 71, 145, 102, 134, 33, 52),
+(4, 1, 72, 147, 104, 137, 33, 53),
+(4, 1, 73, 150, 106, 139, 33, 54),
+(4, 1, 74, 153, 107, 142, 34, 54),
+(4, 1, 75, 156, 109, 144, 34, 55),
+(4, 1, 76, 159, 111, 148, 34, 56),
+(4, 1, 77, 162, 113, 150, 35, 57),
+(4, 1, 78, 165, 114, 152, 35, 57),
+(4, 1, 79, 178, 116, 164, 35, 58),
+(4, 1, 80, 181, 118, 167, 36, 59),
+(4, 3, 1, 17, 28, 20, 20, 21),
+(4, 3, 2, 17, 29, 21, 21, 22),
+(4, 3, 3, 18, 31, 22, 21, 22),
+(4, 3, 4, 18, 32, 23, 22, 23),
+(4, 3, 5, 19, 33, 24, 22, 24),
+(4, 3, 6, 19, 35, 25, 23, 24),
+(4, 3, 7, 20, 36, 26, 24, 25),
+(4, 3, 8, 20, 38, 27, 24, 25),
+(4, 3, 9, 21, 39, 27, 25, 26),
+(4, 3, 10, 21, 40, 28, 25, 27),
+(4, 3, 11, 22, 42, 29, 26, 28),
+(4, 3, 12, 22, 43, 30, 27, 28),
+(4, 3, 13, 23, 45, 31, 27, 29),
+(4, 3, 14, 23, 46, 32, 28, 30),
+(4, 3, 15, 24, 48, 34, 29, 30),
+(4, 3, 16, 24, 50, 35, 29, 31),
+(4, 3, 17, 25, 51, 36, 30, 32),
+(4, 3, 18, 25, 53, 37, 31, 33),
+(4, 3, 19, 26, 54, 38, 31, 33),
+(4, 3, 20, 26, 56, 39, 32, 34),
+(4, 3, 21, 27, 57, 40, 33, 35),
+(4, 3, 22, 27, 59, 41, 33, 36),
+(4, 3, 23, 28, 61, 42, 34, 36),
+(4, 3, 24, 28, 62, 43, 35, 37),
+(4, 3, 25, 29, 64, 44, 36, 38),
+(4, 3, 26, 30, 66, 46, 36, 39),
+(4, 3, 27, 30, 68, 47, 37, 40),
+(4, 3, 28, 31, 69, 48, 38, 41),
+(4, 3, 29, 31, 71, 49, 39, 41);
+INSERT IGNORE INTO `player_levelstats` (`race`, `class`, `level`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES
+(4, 3, 30, 32, 73, 50, 39, 42),
+(4, 3, 31, 33, 75, 52, 40, 43),
+(4, 3, 32, 33, 76, 53, 41, 44),
+(4, 3, 33, 34, 78, 54, 42, 45),
+(4, 3, 34, 34, 80, 55, 43, 46),
+(4, 3, 35, 35, 82, 57, 44, 47),
+(4, 3, 36, 36, 84, 58, 44, 48),
+(4, 3, 37, 36, 86, 59, 45, 48),
+(4, 3, 38, 37, 87, 60, 46, 49),
+(4, 3, 39, 38, 89, 62, 47, 50),
+(4, 3, 40, 38, 91, 63, 48, 51),
+(4, 3, 41, 39, 93, 64, 49, 52),
+(4, 3, 42, 40, 95, 66, 49, 53),
+(4, 3, 43, 40, 97, 67, 50, 54),
+(4, 3, 44, 41, 99, 68, 51, 55),
+(4, 3, 45, 42, 101, 70, 52, 56),
+(4, 3, 46, 42, 103, 71, 53, 57),
+(4, 3, 47, 43, 105, 72, 54, 58),
+(4, 3, 48, 44, 107, 74, 55, 59),
+(4, 3, 49, 45, 109, 75, 56, 60),
+(4, 3, 50, 45, 111, 77, 57, 61),
+(4, 3, 51, 46, 113, 78, 58, 62),
+(4, 3, 52, 47, 115, 79, 59, 63),
+(4, 3, 53, 47, 118, 81, 60, 64),
+(4, 3, 54, 48, 120, 82, 61, 65),
+(4, 3, 55, 49, 122, 84, 61, 66),
+(4, 3, 56, 50, 124, 85, 62, 67),
+(4, 3, 57, 50, 126, 87, 63, 68),
+(4, 3, 58, 51, 128, 88, 64, 69),
+(4, 3, 59, 52, 131, 90, 65, 70),
+(4, 3, 60, 53, 133, 91, 66, 72),
+(4, 3, 61, 54, 135, 93, 67, 73),
+(4, 3, 62, 54, 137, 94, 69, 74),
+(4, 3, 63, 55, 140, 96, 70, 75),
+(4, 3, 64, 56, 142, 97, 71, 76),
+(4, 3, 65, 57, 144, 99, 72, 77),
+(4, 3, 66, 58, 147, 101, 73, 78),
+(4, 3, 67, 58, 149, 102, 74, 79),
+(4, 3, 68, 59, 151, 104, 75, 81),
+(4, 3, 69, 60, 154, 105, 76, 82),
+(4, 3, 70, 61, 156, 107, 77, 83),
+(4, 3, 71, 62, 159, 109, 78, 84),
+(4, 3, 72, 63, 162, 111, 79, 85),
+(4, 3, 73, 64, 165, 113, 80, 87),
+(4, 3, 74, 65, 168, 115, 82, 88),
+(4, 3, 75, 66, 171, 117, 83, 90),
+(4, 3, 76, 67, 174, 119, 84, 91),
+(4, 3, 77, 68, 177, 121, 86, 93),
+(4, 3, 78, 69, 180, 123, 87, 94),
+(4, 3, 79, 70, 190, 125, 91, 96),
+(4, 3, 80, 71, 193, 127, 93, 97),
+(4, 4, 1, 18, 28, 20, 20, 20),
+(4, 4, 2, 19, 29, 21, 20, 20),
+(4, 4, 3, 20, 31, 21, 20, 21),
+(4, 4, 4, 20, 32, 22, 20, 21),
+(4, 4, 5, 21, 34, 23, 21, 21),
+(4, 4, 6, 22, 35, 24, 21, 22),
+(4, 4, 7, 23, 37, 24, 21, 22),
+(4, 4, 8, 24, 38, 25, 21, 23),
+(4, 4, 9, 24, 40, 26, 21, 23),
+(4, 4, 10, 25, 41, 26, 21, 23),
+(4, 4, 11, 26, 43, 27, 22, 24),
+(4, 4, 12, 27, 44, 28, 22, 24),
+(4, 4, 13, 28, 46, 29, 22, 25),
+(4, 4, 14, 29, 48, 30, 22, 25),
+(4, 4, 15, 29, 49, 30, 22, 25),
+(4, 4, 16, 30, 51, 31, 23, 26),
+(4, 4, 17, 31, 52, 32, 23, 26),
+(4, 4, 18, 32, 54, 33, 23, 27),
+(4, 4, 19, 33, 56, 34, 23, 27),
+(4, 4, 20, 34, 57, 35, 23, 28),
+(4, 4, 21, 35, 59, 35, 24, 28),
+(4, 4, 22, 36, 61, 36, 24, 29),
+(4, 4, 23, 37, 63, 37, 24, 29),
+(4, 4, 24, 38, 64, 38, 24, 30),
+(4, 4, 25, 39, 66, 39, 25, 30),
+(4, 4, 26, 40, 68, 40, 25, 31),
+(4, 4, 27, 41, 70, 41, 25, 31),
+(4, 4, 28, 42, 72, 42, 25, 32),
+(4, 4, 29, 43, 73, 43, 25, 32),
+(4, 4, 30, 44, 75, 43, 26, 33),
+(4, 4, 31, 45, 77, 44, 26, 33),
+(4, 4, 32, 46, 79, 45, 26, 34),
+(4, 4, 33, 47, 81, 46, 27, 34),
+(4, 4, 34, 48, 83, 47, 27, 35),
+(4, 4, 35, 49, 85, 48, 27, 35),
+(4, 4, 36, 50, 87, 49, 27, 36),
+(4, 4, 37, 51, 89, 50, 28, 36),
+(4, 4, 38, 52, 91, 51, 28, 37),
+(4, 4, 39, 53, 93, 52, 28, 38),
+(4, 4, 40, 54, 95, 53, 28, 38),
+(4, 4, 41, 56, 97, 54, 29, 39),
+(4, 4, 42, 57, 99, 55, 29, 39),
+(4, 4, 43, 58, 101, 56, 29, 40),
+(4, 4, 44, 59, 103, 57, 30, 40),
+(4, 4, 45, 60, 105, 59, 30, 41),
+(4, 4, 46, 61, 107, 60, 30, 42),
+(4, 4, 47, 62, 109, 61, 31, 42),
+(4, 4, 48, 64, 112, 62, 31, 43),
+(4, 4, 49, 65, 114, 63, 31, 44),
+(4, 4, 50, 66, 116, 64, 32, 44),
+(4, 4, 51, 67, 118, 65, 32, 45),
+(4, 4, 52, 68, 120, 66, 32, 45),
+(4, 4, 53, 70, 123, 67, 33, 46),
+(4, 4, 54, 71, 125, 69, 33, 47),
+(4, 4, 55, 72, 127, 70, 33, 47),
+(4, 4, 56, 73, 129, 71, 34, 48),
+(4, 4, 57, 75, 132, 72, 34, 49),
+(4, 4, 58, 76, 134, 73, 34, 49),
+(4, 4, 59, 77, 136, 74, 35, 50),
+(4, 4, 60, 79, 139, 76, 35, 51),
+(4, 4, 61, 80, 141, 77, 35, 51),
+(4, 4, 62, 81, 143, 78, 36, 52),
+(4, 4, 63, 82, 146, 79, 36, 53),
+(4, 4, 64, 84, 148, 80, 37, 54),
+(4, 4, 65, 85, 151, 82, 37, 54),
+(4, 4, 66, 87, 153, 83, 37, 55),
+(4, 4, 67, 88, 156, 84, 38, 56),
+(4, 4, 68, 89, 158, 85, 38, 57),
+(4, 4, 69, 91, 160, 87, 39, 57),
+(4, 4, 70, 92, 163, 88, 39, 58),
+(4, 4, 71, 94, 166, 90, 39, 59),
+(4, 4, 72, 96, 169, 91, 40, 59),
+(4, 4, 73, 97, 172, 93, 40, 60),
+(4, 4, 74, 99, 175, 94, 41, 61),
+(4, 4, 75, 101, 178, 96, 41, 62),
+(4, 4, 76, 102, 181, 97, 41, 63),
+(4, 4, 77, 104, 184, 99, 42, 64),
+(4, 4, 78, 106, 188, 101, 42, 65),
+(4, 4, 79, 108, 191, 102, 43, 66),
+(4, 4, 80, 110, 194, 104, 43, 67),
+(4, 5, 1, 17, 25, 19, 22, 23),
+(4, 5, 2, 17, 25, 19, 23, 24),
+(4, 5, 3, 17, 25, 20, 25, 26),
+(4, 5, 4, 17, 26, 20, 26, 27),
+(4, 5, 5, 18, 26, 20, 27, 28),
+(4, 5, 6, 18, 26, 21, 29, 30),
+(4, 5, 7, 18, 26, 21, 30, 31),
+(4, 5, 8, 18, 26, 22, 31, 33),
+(4, 5, 9, 18, 27, 22, 33, 34),
+(4, 5, 10, 19, 27, 22, 34, 36),
+(4, 5, 11, 19, 27, 23, 36, 37),
+(4, 5, 12, 19, 27, 23, 37, 39),
+(4, 5, 13, 19, 28, 24, 38, 40),
+(4, 5, 14, 19, 28, 24, 40, 42),
+(4, 5, 15, 19, 28, 25, 41, 43),
+(4, 5, 16, 20, 28, 25, 43, 45),
+(4, 5, 17, 20, 29, 25, 44, 46),
+(4, 5, 18, 20, 29, 26, 46, 48),
+(4, 5, 19, 20, 29, 26, 47, 49),
+(4, 5, 20, 21, 30, 27, 49, 51),
+(4, 5, 21, 21, 30, 27, 51, 53),
+(4, 5, 22, 21, 30, 28, 52, 54),
+(4, 5, 23, 21, 30, 28, 54, 56),
+(4, 5, 24, 21, 31, 29, 55, 58),
+(4, 5, 25, 22, 31, 29, 57, 59),
+(4, 5, 26, 22, 31, 30, 59, 61),
+(4, 5, 27, 22, 32, 30, 60, 63),
+(4, 5, 28, 22, 32, 31, 62, 65),
+(4, 5, 29, 23, 32, 31, 64, 66),
+(4, 5, 30, 23, 33, 32, 65, 68),
+(4, 5, 31, 23, 33, 32, 67, 70),
+(4, 5, 32, 23, 33, 33, 69, 72),
+(4, 5, 33, 24, 34, 33, 70, 73),
+(4, 5, 34, 24, 34, 34, 72, 75),
+(4, 5, 35, 24, 34, 34, 74, 77),
+(4, 5, 36, 24, 35, 35, 76, 79),
+(4, 5, 37, 25, 35, 35, 78, 81),
+(4, 5, 38, 25, 35, 36, 79, 83),
+(4, 5, 39, 25, 36, 37, 81, 85),
+(4, 5, 40, 26, 36, 37, 83, 87),
+(4, 5, 41, 26, 37, 38, 85, 88),
+(4, 5, 42, 26, 37, 38, 87, 90),
+(4, 5, 43, 27, 37, 39, 89, 92),
+(4, 5, 44, 27, 38, 39, 91, 94),
+(4, 5, 45, 27, 38, 40, 92, 96),
+(4, 5, 46, 27, 39, 41, 94, 98),
+(4, 5, 47, 28, 39, 41, 96, 100),
+(4, 5, 48, 28, 39, 42, 98, 102),
+(4, 5, 49, 28, 40, 43, 100, 104),
+(4, 5, 50, 29, 40, 43, 102, 106),
+(4, 5, 51, 29, 41, 44, 104, 109),
+(4, 5, 52, 29, 41, 44, 106, 111),
+(4, 5, 53, 30, 42, 45, 108, 113),
+(4, 5, 54, 30, 42, 46, 110, 115),
+(4, 5, 55, 30, 43, 46, 112, 117),
+(4, 5, 56, 31, 43, 47, 114, 119),
+(4, 5, 57, 31, 43, 48, 117, 121),
+(4, 5, 58, 31, 44, 48, 119, 124),
+(4, 5, 59, 32, 44, 49, 121, 126),
+(4, 5, 60, 32, 45, 50, 123, 128),
+(4, 5, 61, 33, 45, 51, 125, 130),
+(4, 5, 62, 33, 46, 51, 127, 132),
+(4, 5, 63, 33, 46, 52, 129, 135),
+(4, 5, 64, 34, 47, 53, 132, 137),
+(4, 5, 65, 34, 47, 53, 134, 139),
+(4, 5, 66, 34, 48, 54, 136, 142),
+(4, 5, 67, 35, 48, 55, 138, 144),
+(4, 5, 68, 35, 49, 56, 140, 146),
+(4, 5, 69, 36, 49, 56, 143, 149),
+(4, 5, 70, 36, 50, 57, 145, 151),
+(4, 5, 71, 36, 51, 58, 148, 161),
+(4, 5, 72, 37, 51, 58, 151, 164),
+(4, 5, 73, 37, 52, 59, 154, 168),
+(4, 5, 74, 38, 52, 60, 156, 171),
+(4, 5, 75, 38, 53, 61, 159, 174),
+(4, 5, 76, 38, 54, 62, 162, 177),
+(4, 5, 77, 39, 54, 63, 165, 180),
+(4, 5, 78, 39, 55, 64, 168, 183),
+(4, 5, 79, 40, 55, 65, 171, 186),
+(4, 5, 80, 40, 56, 66, 200, 191),
+(4, 6, 1, 20, 25, 21, 20, 20),
+(4, 6, 2, 21, 26, 22, 20, 20),
+(4, 6, 3, 23, 27, 23, 20, 21),
+(4, 6, 4, 24, 27, 25, 20, 21),
+(4, 6, 5, 25, 28, 26, 20, 21),
+(4, 6, 6, 27, 29, 27, 20, 21),
+(4, 6, 7, 28, 30, 28, 21, 22),
+(4, 6, 8, 29, 31, 29, 21, 22),
+(4, 6, 9, 31, 31, 31, 21, 22),
+(4, 6, 10, 32, 32, 32, 21, 23),
+(4, 6, 11, 33, 33, 33, 21, 23),
+(4, 6, 12, 35, 34, 34, 21, 23),
+(4, 6, 13, 36, 35, 36, 21, 24),
+(4, 6, 14, 38, 36, 37, 21, 24),
+(4, 6, 15, 39, 37, 38, 21, 24),
+(4, 6, 16, 41, 37, 40, 21, 25),
+(4, 6, 17, 42, 38, 41, 22, 25),
+(4, 6, 18, 44, 39, 43, 22, 25),
+(4, 6, 19, 45, 40, 44, 22, 26),
+(4, 6, 20, 47, 41, 45, 22, 26),
+(4, 6, 21, 48, 42, 47, 22, 26),
+(4, 6, 22, 50, 43, 48, 22, 27),
+(4, 6, 23, 52, 44, 50, 22, 27),
+(4, 6, 24, 53, 45, 51, 23, 28),
+(4, 6, 25, 55, 46, 52, 23, 28),
+(4, 6, 26, 56, 47, 54, 23, 28),
+(4, 6, 27, 58, 48, 55, 23, 29),
+(4, 6, 28, 60, 49, 57, 23, 29),
+(4, 6, 29, 61, 50, 58, 23, 30),
+(4, 6, 30, 63, 51, 60, 24, 30),
+(4, 6, 31, 65, 52, 62, 24, 30),
+(4, 6, 32, 66, 53, 63, 24, 31),
+(4, 6, 33, 68, 54, 65, 24, 31),
+(4, 6, 34, 70, 55, 66, 24, 32),
+(4, 6, 35, 72, 56, 68, 24, 32),
+(4, 6, 36, 73, 58, 69, 25, 33),
+(4, 6, 37, 75, 59, 71, 25, 33),
+(4, 6, 38, 77, 60, 73, 25, 34),
+(4, 6, 39, 79, 61, 74, 25, 34),
+(4, 6, 40, 81, 62, 76, 25, 35),
+(4, 6, 41, 82, 63, 78, 26, 35),
+(4, 6, 42, 84, 64, 79, 26, 35),
+(4, 6, 43, 86, 66, 81, 26, 36),
+(4, 6, 44, 88, 67, 83, 26, 36),
+(4, 6, 45, 90, 68, 85, 26, 37),
+(4, 6, 46, 92, 69, 86, 27, 37),
+(4, 6, 47, 94, 70, 88, 27, 38),
+(4, 6, 48, 96, 72, 90, 27, 38),
+(4, 6, 49, 98, 73, 92, 27, 39),
+(4, 6, 50, 100, 74, 93, 28, 40),
+(4, 6, 51, 101, 75, 94, 28, 40),
+(4, 6, 52, 102, 76, 95, 28, 41),
+(4, 6, 53, 103, 77, 96, 28, 41),
+(4, 6, 54, 104, 77, 97, 29, 42),
+(4, 6, 55, 105, 78, 98, 29, 42),
+(4, 6, 56, 108, 80, 101, 29, 43),
+(4, 6, 57, 113, 81, 103, 29, 43),
+(4, 6, 58, 115, 82, 105, 30, 44),
+(4, 6, 59, 115, 84, 107, 30, 44),
+(4, 6, 60, 120, 85, 109, 30, 45),
+(4, 6, 61, 122, 86, 111, 30, 46),
+(4, 6, 62, 122, 88, 113, 30, 46),
+(4, 6, 63, 127, 89, 116, 31, 47),
+(4, 6, 64, 127, 91, 118, 31, 47),
+(4, 6, 65, 133, 92, 120, 31, 48),
+(4, 6, 66, 135, 94, 123, 31, 49),
+(4, 6, 67, 136, 95, 125, 32, 49),
+(4, 6, 68, 137, 97, 127, 32, 50),
+(4, 6, 69, 140, 98, 130, 32, 51),
+(4, 6, 70, 147, 100, 132, 32, 51),
+(4, 6, 71, 154, 102, 135, 33, 52),
+(4, 6, 72, 156, 103, 137, 33, 53),
+(4, 6, 73, 157, 105, 140, 33, 54),
+(4, 6, 74, 158, 107, 142, 33, 54),
+(4, 6, 75, 161, 108, 145, 34, 55),
+(4, 6, 76, 164, 110, 148, 34, 56),
+(4, 6, 77, 167, 112, 150, 34, 57),
+(4, 6, 78, 170, 113, 153, 34, 57),
+(4, 6, 79, 172, 115, 156, 35, 58),
+(4, 6, 80, 177, 117, 159, 35, 59),
+(4, 11, 1, 18, 25, 19, 22, 22),
+(4, 11, 2, 19, 25, 20, 23, 23),
+(4, 11, 3, 19, 26, 20, 24, 24),
+(4, 11, 4, 20, 26, 21, 25, 26),
+(4, 11, 5, 20, 27, 22, 26, 27),
+(4, 11, 6, 21, 27, 22, 27, 28),
+(4, 11, 7, 21, 28, 23, 28, 29),
+(4, 11, 8, 22, 28, 24, 29, 30),
+(4, 11, 9, 23, 29, 24, 30, 32),
+(4, 11, 10, 23, 29, 25, 32, 33),
+(4, 11, 11, 24, 30, 26, 33, 34),
+(4, 11, 12, 24, 31, 26, 34, 35),
+(4, 11, 13, 25, 31, 27, 35, 37),
+(4, 11, 14, 26, 32, 28, 36, 38),
+(4, 11, 15, 26, 32, 29, 37, 39),
+(4, 11, 16, 27, 33, 29, 38, 41),
+(4, 11, 17, 28, 33, 30, 40, 42),
+(4, 11, 18, 28, 34, 31, 41, 43),
+(4, 11, 19, 29, 35, 32, 42, 45),
+(4, 11, 20, 30, 35, 32, 43, 46),
+(4, 11, 21, 30, 36, 33, 45, 48),
+(4, 11, 22, 31, 36, 34, 46, 49),
+(4, 11, 23, 32, 37, 35, 47, 51),
+(4, 11, 24, 32, 38, 36, 48, 52),
+(4, 11, 25, 33, 38, 36, 50, 53),
+(4, 11, 26, 34, 39, 37, 51, 55),
+(4, 11, 27, 35, 40, 38, 52, 56),
+(4, 11, 28, 35, 40, 39, 54, 58),
+(4, 11, 29, 36, 41, 40, 55, 59),
+(4, 11, 30, 37, 42, 41, 56, 61),
+(4, 11, 31, 38, 42, 42, 58, 62),
+(4, 11, 32, 38, 43, 42, 59, 64),
+(4, 11, 33, 39, 44, 43, 60, 66),
+(4, 11, 34, 40, 44, 44, 62, 67),
+(4, 11, 35, 41, 45, 45, 63, 69),
+(4, 11, 36, 42, 46, 46, 65, 70),
+(4, 11, 37, 42, 47, 47, 66, 72),
+(4, 11, 38, 43, 47, 48, 67, 74),
+(4, 11, 39, 44, 48, 49, 69, 75),
+(4, 11, 40, 45, 49, 50, 70, 77),
+(4, 11, 41, 46, 50, 51, 72, 79),
+(4, 11, 42, 46, 50, 52, 73, 80),
+(4, 11, 43, 47, 51, 53, 75, 82),
+(4, 11, 44, 48, 52, 54, 76, 84),
+(4, 11, 45, 49, 53, 55, 78, 85),
+(4, 11, 46, 50, 54, 56, 79, 87),
+(4, 11, 47, 51, 54, 57, 81, 89),
+(4, 11, 48, 52, 55, 58, 83, 91),
+(4, 11, 49, 53, 56, 59, 84, 93),
+(4, 11, 50, 53, 57, 60, 86, 94),
+(4, 11, 51, 54, 58, 61, 87, 96),
+(4, 11, 52, 55, 59, 62, 89, 98),
+(4, 11, 53, 56, 59, 63, 91, 100),
+(4, 11, 54, 57, 60, 64, 92, 102),
+(4, 11, 55, 58, 61, 65, 94, 103),
+(4, 11, 56, 59, 62, 66, 95, 105),
+(4, 11, 57, 60, 63, 67, 97, 107),
+(4, 11, 58, 61, 64, 68, 99, 109),
+(4, 11, 59, 62, 65, 69, 101, 111),
+(4, 11, 60, 63, 66, 70, 102, 113),
+(4, 11, 61, 64, 66, 72, 104, 115),
+(4, 11, 62, 65, 67, 73, 106, 117),
+(4, 11, 63, 66, 68, 74, 107, 119),
+(4, 11, 64, 67, 69, 75, 109, 121),
+(4, 11, 65, 68, 70, 76, 111, 123),
+(4, 11, 66, 69, 71, 77, 113, 125),
+(4, 11, 67, 70, 72, 78, 115, 127),
+(4, 11, 68, 71, 73, 80, 116, 129),
+(4, 11, 69, 72, 74, 81, 118, 131),
+(4, 11, 70, 73, 75, 82, 120, 133),
+(4, 11, 71, 75, 76, 83, 122, 135),
+(4, 11, 72, 76, 78, 85, 125, 138),
+(4, 11, 73, 77, 79, 86, 127, 140),
+(4, 11, 74, 78, 80, 88, 131, 143),
+(4, 11, 75, 80, 81, 89, 133, 145),
+(4, 11, 76, 81, 82, 91, 134, 148),
+(4, 11, 77, 82, 83, 92, 136, 151),
+(4, 11, 78, 84, 85, 94, 138, 153),
+(4, 11, 79, 85, 86, 95, 141, 156),
+(4, 11, 80, 86, 87, 97, 143, 159),
+(5, 1, 1, 22, 18, 23, 18, 25),
+(5, 1, 2, 23, 19, 24, 18, 25),
+(5, 1, 3, 25, 20, 25, 18, 26),
+(5, 1, 4, 26, 20, 26, 18, 26),
+(5, 1, 5, 27, 21, 28, 18, 26),
+(5, 1, 6, 29, 22, 29, 18, 26),
+(5, 1, 7, 30, 23, 30, 19, 27),
+(5, 1, 8, 31, 24, 31, 19, 27),
+(5, 1, 9, 33, 25, 33, 19, 27),
+(5, 1, 10, 34, 25, 34, 19, 28),
+(5, 1, 11, 35, 26, 35, 19, 28),
+(5, 1, 12, 37, 27, 36, 19, 28),
+(5, 1, 13, 38, 28, 38, 19, 28),
+(5, 1, 14, 40, 29, 39, 19, 29),
+(5, 1, 15, 41, 30, 40, 19, 29),
+(5, 1, 16, 43, 31, 42, 20, 29),
+(5, 1, 17, 44, 32, 43, 20, 30),
+(5, 1, 18, 46, 33, 44, 20, 30),
+(5, 1, 19, 47, 34, 46, 20, 31),
+(5, 1, 20, 49, 34, 47, 20, 31),
+(5, 1, 21, 50, 35, 49, 20, 31),
+(5, 1, 22, 52, 36, 50, 20, 32),
+(5, 1, 23, 53, 37, 51, 21, 32),
+(5, 1, 24, 55, 38, 53, 21, 32),
+(5, 1, 25, 57, 39, 54, 21, 33),
+(5, 1, 26, 58, 40, 56, 21, 33),
+(5, 1, 27, 60, 41, 57, 21, 34),
+(5, 1, 28, 62, 42, 59, 21, 34),
+(5, 1, 29, 63, 43, 60, 21, 34),
+(5, 1, 30, 65, 44, 62, 22, 35),
+(5, 1, 31, 67, 46, 63, 22, 35),
+(5, 1, 32, 68, 47, 65, 22, 36),
+(5, 1, 33, 70, 48, 67, 22, 36),
+(5, 1, 34, 72, 49, 68, 22, 36),
+(5, 1, 35, 74, 50, 70, 23, 37),
+(5, 1, 36, 75, 51, 71, 23, 37),
+(5, 1, 37, 77, 52, 73, 23, 38),
+(5, 1, 38, 79, 53, 75, 23, 38),
+(5, 1, 39, 81, 54, 76, 23, 39),
+(5, 1, 40, 83, 55, 78, 24, 39),
+(5, 1, 41, 84, 57, 80, 24, 40),
+(5, 1, 42, 86, 58, 81, 24, 40),
+(5, 1, 43, 88, 59, 83, 24, 41),
+(5, 1, 44, 90, 60, 85, 24, 41),
+(5, 1, 45, 92, 61, 86, 25, 42),
+(5, 1, 46, 94, 62, 88, 25, 42),
+(5, 1, 47, 96, 64, 90, 25, 43),
+(5, 1, 48, 98, 65, 92, 25, 43),
+(5, 1, 49, 100, 66, 93, 25, 44),
+(5, 1, 50, 102, 67, 95, 26, 44),
+(5, 1, 51, 104, 69, 97, 26, 45),
+(5, 1, 52, 106, 70, 99, 26, 45),
+(5, 1, 53, 108, 71, 101, 26, 46),
+(5, 1, 54, 110, 72, 103, 27, 46),
+(5, 1, 55, 112, 74, 104, 27, 47),
+(5, 1, 56, 114, 75, 106, 27, 48),
+(5, 1, 57, 116, 76, 108, 27, 48),
+(5, 1, 58, 118, 78, 110, 28, 49),
+(5, 1, 59, 120, 79, 112, 28, 49),
+(5, 1, 60, 122, 80, 114, 28, 50),
+(5, 1, 61, 124, 82, 116, 28, 50),
+(5, 1, 62, 126, 83, 118, 29, 51),
+(5, 1, 63, 128, 84, 120, 29, 52),
+(5, 1, 64, 131, 86, 122, 29, 52),
+(5, 1, 65, 133, 87, 124, 30, 53),
+(5, 1, 66, 135, 88, 126, 30, 53),
+(5, 1, 67, 137, 90, 128, 30, 54),
+(5, 1, 68, 139, 91, 130, 30, 55),
+(5, 1, 69, 142, 93, 132, 31, 55),
+(5, 1, 70, 144, 94, 134, 31, 56),
+(5, 1, 71, 147, 95, 136, 31, 57),
+(5, 1, 72, 150, 97, 139, 31, 58),
+(5, 1, 73, 152, 99, 141, 31, 59),
+(5, 1, 74, 155, 100, 144, 32, 59),
+(5, 1, 75, 158, 102, 146, 32, 60),
+(5, 1, 76, 163, 104, 149, 32, 61),
+(5, 1, 77, 167, 106, 152, 33, 62),
+(5, 1, 78, 167, 107, 154, 33, 62),
+(5, 1, 79, 170, 109, 157, 33, 63),
+(5, 1, 80, 173, 111, 160, 34, 64),
+(5, 4, 1, 20, 21, 22, 18, 25),
+(5, 4, 2, 21, 22, 23, 18, 25),
+(5, 4, 3, 22, 24, 23, 18, 26),
+(5, 4, 4, 22, 25, 24, 18, 26),
+(5, 4, 5, 23, 27, 25, 19, 26),
+(5, 4, 6, 24, 28, 25, 19, 27),
+(5, 4, 7, 25, 30, 26, 19, 27),
+(5, 4, 8, 25, 31, 27, 19, 27),
+(5, 4, 9, 26, 33, 28, 19, 28),
+(5, 4, 10, 27, 34, 28, 19, 28),
+(5, 4, 11, 28, 36, 29, 20, 29),
+(5, 4, 12, 29, 38, 30, 20, 29),
+(5, 4, 13, 30, 39, 31, 20, 29),
+(5, 4, 14, 31, 41, 32, 20, 30),
+(5, 4, 15, 31, 42, 32, 20, 30),
+(5, 4, 16, 32, 44, 33, 21, 31),
+(5, 4, 17, 33, 46, 34, 21, 31),
+(5, 4, 18, 34, 47, 35, 21, 32),
+(5, 4, 19, 35, 49, 36, 21, 32),
+(5, 4, 20, 36, 51, 36, 21, 32),
+(5, 4, 21, 37, 52, 37, 22, 33),
+(5, 4, 22, 38, 54, 38, 22, 33),
+(5, 4, 23, 39, 56, 39, 22, 34),
+(5, 4, 24, 40, 58, 40, 22, 34),
+(5, 4, 25, 41, 60, 41, 23, 35),
+(5, 4, 26, 42, 61, 42, 23, 35),
+(5, 4, 27, 43, 63, 43, 23, 36),
+(5, 4, 28, 44, 65, 44, 23, 36),
+(5, 4, 29, 45, 67, 44, 24, 37),
+(5, 4, 30, 46, 69, 45, 24, 37),
+(5, 4, 31, 47, 71, 46, 24, 38),
+(5, 4, 32, 48, 72, 47, 24, 38),
+(5, 4, 33, 49, 74, 48, 25, 39),
+(5, 4, 34, 50, 76, 49, 25, 39),
+(5, 4, 35, 51, 78, 50, 25, 40),
+(5, 4, 36, 52, 80, 51, 25, 41),
+(5, 4, 37, 53, 82, 52, 26, 41),
+(5, 4, 38, 54, 84, 53, 26, 42),
+(5, 4, 39, 55, 86, 54, 26, 42),
+(5, 4, 40, 56, 88, 55, 27, 43),
+(5, 4, 41, 57, 90, 56, 27, 43),
+(5, 4, 42, 59, 92, 57, 27, 44),
+(5, 4, 43, 60, 94, 58, 27, 45),
+(5, 4, 44, 61, 96, 59, 28, 45),
+(5, 4, 45, 62, 99, 60, 28, 46),
+(5, 4, 46, 63, 101, 61, 28, 46),
+(5, 4, 47, 64, 103, 63, 29, 47),
+(5, 4, 48, 66, 105, 64, 29, 48),
+(5, 4, 49, 67, 107, 65, 29, 48),
+(5, 4, 50, 68, 109, 66, 30, 49),
+(5, 4, 51, 69, 111, 67, 30, 50),
+(5, 4, 52, 70, 114, 68, 30, 50),
+(5, 4, 53, 72, 116, 69, 31, 51),
+(5, 4, 54, 73, 118, 70, 31, 52),
+(5, 4, 55, 74, 120, 72, 31, 52),
+(5, 4, 56, 75, 123, 73, 32, 53),
+(5, 4, 57, 77, 125, 74, 32, 54),
+(5, 4, 58, 78, 127, 75, 32, 54),
+(5, 4, 59, 79, 130, 76, 33, 55),
+(5, 4, 60, 81, 132, 77, 33, 56),
+(5, 4, 61, 82, 134, 79, 34, 56),
+(5, 4, 62, 83, 137, 80, 34, 57),
+(5, 4, 63, 84, 139, 81, 34, 58),
+(5, 4, 64, 86, 141, 82, 35, 59),
+(5, 4, 65, 87, 144, 84, 35, 59),
+(5, 4, 66, 88, 146, 85, 35, 60),
+(5, 4, 67, 90, 149, 86, 36, 61),
+(5, 4, 68, 91, 151, 87, 36, 61),
+(5, 4, 69, 93, 154, 89, 37, 62),
+(5, 4, 70, 94, 156, 90, 37, 63),
+(5, 4, 71, 96, 159, 91, 37, 64),
+(5, 4, 72, 98, 162, 93, 38, 64),
+(5, 4, 73, 99, 165, 95, 38, 65),
+(5, 4, 74, 101, 168, 96, 39, 66),
+(5, 4, 75, 103, 171, 98, 39, 67),
+(5, 4, 76, 104, 174, 99, 39, 68),
+(5, 4, 77, 106, 177, 101, 40, 69),
+(5, 4, 78, 108, 181, 103, 40, 70),
+(5, 4, 79, 110, 184, 104, 41, 71),
+(5, 4, 80, 112, 187, 106, 41, 72),
+(5, 5, 1, 19, 18, 21, 20, 28),
+(5, 5, 2, 19, 18, 21, 21, 29),
+(5, 5, 3, 19, 18, 22, 23, 31),
+(5, 5, 4, 19, 19, 22, 24, 32),
+(5, 5, 5, 20, 19, 22, 25, 33),
+(5, 5, 6, 20, 19, 23, 27, 35),
+(5, 5, 7, 20, 19, 23, 28, 36),
+(5, 5, 8, 20, 20, 24, 29, 38),
+(5, 5, 9, 20, 20, 24, 31, 39),
+(5, 5, 10, 20, 20, 24, 32, 40),
+(5, 5, 11, 21, 20, 25, 34, 42),
+(5, 5, 12, 21, 21, 25, 35, 43),
+(5, 5, 13, 21, 21, 26, 37, 45),
+(5, 5, 14, 21, 21, 26, 38, 46),
+(5, 5, 15, 21, 21, 26, 39, 48),
+(5, 5, 16, 22, 22, 27, 41, 50),
+(5, 5, 17, 22, 22, 27, 42, 51),
+(5, 5, 18, 22, 22, 28, 44, 53),
+(5, 5, 19, 22, 23, 28, 46, 54),
+(5, 5, 20, 22, 23, 29, 47, 56),
+(5, 5, 21, 23, 23, 29, 49, 57),
+(5, 5, 22, 23, 23, 30, 50, 59),
+(5, 5, 23, 23, 24, 30, 52, 61),
+(5, 5, 24, 23, 24, 31, 53, 62),
+(5, 5, 25, 24, 24, 31, 55, 64),
+(5, 5, 26, 24, 25, 32, 57, 66),
+(5, 5, 27, 24, 25, 32, 58, 68),
+(5, 5, 28, 24, 25, 33, 60, 69),
+(5, 5, 29, 25, 26, 33, 62, 71),
+(5, 5, 30, 25, 26, 34, 63, 73),
+(5, 5, 31, 25, 26, 34, 65, 75),
+(5, 5, 32, 25, 27, 35, 67, 76),
+(5, 5, 33, 26, 27, 35, 69, 78),
+(5, 5, 34, 26, 27, 36, 70, 80),
+(5, 5, 35, 26, 28, 36, 72, 82),
+(5, 5, 36, 26, 28, 37, 74, 84),
+(5, 5, 37, 27, 28, 37, 76, 86),
+(5, 5, 38, 27, 29, 38, 77, 87),
+(5, 5, 39, 27, 29, 38, 79, 89),
+(5, 5, 40, 28, 30, 39, 81, 91),
+(5, 5, 41, 28, 30, 40, 83, 93),
+(5, 5, 42, 28, 30, 40, 85, 95),
+(5, 5, 43, 28, 31, 41, 87, 97),
+(5, 5, 44, 29, 31, 41, 89, 99),
+(5, 5, 45, 29, 32, 42, 91, 101),
+(5, 5, 46, 29, 32, 43, 92, 103),
+(5, 5, 47, 30, 32, 43, 94, 105),
+(5, 5, 48, 30, 33, 44, 96, 107),
+(5, 5, 49, 30, 33, 44, 98, 109),
+(5, 5, 50, 31, 34, 45, 100, 111),
+(5, 5, 51, 31, 34, 46, 102, 113),
+(5, 5, 52, 31, 35, 46, 104, 115),
+(5, 5, 53, 32, 35, 47, 106, 118),
+(5, 5, 54, 32, 35, 48, 108, 120),
+(5, 5, 55, 32, 36, 48, 110, 122),
+(5, 5, 56, 33, 36, 49, 113, 124),
+(5, 5, 57, 33, 37, 50, 115, 126),
+(5, 5, 58, 33, 37, 50, 117, 128),
+(5, 5, 59, 34, 38, 51, 119, 131),
+(5, 5, 60, 34, 38, 52, 121, 133),
+(5, 5, 61, 34, 39, 52, 123, 135),
+(5, 5, 62, 35, 39, 53, 125, 137),
+(5, 5, 63, 35, 40, 54, 127, 140),
+(5, 5, 64, 36, 40, 55, 130, 142),
+(5, 5, 65, 36, 41, 55, 132, 144),
+(5, 5, 66, 36, 41, 56, 134, 147),
+(5, 5, 67, 37, 41, 57, 136, 149),
+(5, 5, 68, 37, 42, 58, 138, 151),
+(5, 5, 69, 38, 42, 58, 141, 154),
+(5, 5, 70, 38, 43, 59, 143, 156),
+(5, 5, 71, 38, 44, 60, 146, 159),
+(5, 5, 72, 39, 44, 60, 149, 162),
+(5, 5, 73, 39, 45, 61, 152, 165),
+(5, 5, 74, 40, 45, 62, 157, 168),
+(5, 5, 75, 40, 46, 63, 157, 171),
+(5, 5, 76, 40, 47, 64, 160, 174),
+(5, 5, 77, 41, 47, 65, 163, 177),
+(5, 5, 78, 41, 48, 66, 166, 180),
+(5, 5, 79, 42, 48, 67, 169, 183),
+(5, 5, 80, 42, 49, 68, 172, 186),
+(5, 6, 1, 22, 18, 23, 18, 25),
+(5, 6, 2, 23, 19, 24, 18, 25),
+(5, 6, 3, 25, 20, 25, 18, 26),
+(5, 6, 4, 26, 20, 26, 18, 26),
+(5, 6, 5, 27, 21, 28, 18, 26),
+(5, 6, 6, 29, 22, 29, 18, 26),
+(5, 6, 7, 30, 23, 30, 19, 27),
+(5, 6, 8, 31, 24, 31, 19, 27),
+(5, 6, 9, 33, 25, 33, 19, 27),
+(5, 6, 10, 34, 25, 34, 19, 28),
+(5, 6, 11, 35, 26, 35, 19, 28),
+(5, 6, 12, 37, 27, 36, 19, 28),
+(5, 6, 13, 38, 28, 38, 19, 28),
+(5, 6, 14, 40, 29, 39, 19, 29),
+(5, 6, 15, 41, 30, 40, 19, 29),
+(5, 6, 16, 43, 31, 42, 20, 29),
+(5, 6, 17, 44, 32, 43, 20, 30),
+(5, 6, 18, 46, 33, 44, 20, 30),
+(5, 6, 19, 47, 34, 46, 20, 31),
+(5, 6, 20, 49, 34, 47, 20, 31),
+(5, 6, 21, 50, 35, 49, 20, 31),
+(5, 6, 22, 52, 36, 50, 20, 32),
+(5, 6, 23, 53, 37, 51, 21, 32),
+(5, 6, 24, 55, 38, 53, 21, 32),
+(5, 6, 25, 57, 39, 54, 21, 33),
+(5, 6, 26, 58, 40, 56, 21, 33),
+(5, 6, 27, 60, 41, 57, 21, 34),
+(5, 6, 28, 62, 42, 59, 21, 34),
+(5, 6, 29, 63, 43, 60, 21, 34),
+(5, 6, 30, 65, 44, 62, 22, 35),
+(5, 6, 31, 67, 46, 63, 22, 35),
+(5, 6, 32, 68, 47, 65, 22, 36),
+(5, 6, 33, 70, 48, 67, 22, 36),
+(5, 6, 34, 72, 49, 68, 22, 36),
+(5, 6, 35, 74, 50, 70, 23, 37),
+(5, 6, 36, 75, 51, 71, 23, 37),
+(5, 6, 37, 77, 52, 73, 23, 38),
+(5, 6, 38, 79, 53, 75, 23, 38),
+(5, 6, 39, 81, 54, 76, 23, 39),
+(5, 6, 40, 83, 55, 78, 24, 39),
+(5, 6, 41, 84, 57, 80, 24, 40),
+(5, 6, 42, 86, 58, 81, 24, 40),
+(5, 6, 43, 88, 59, 83, 24, 41),
+(5, 6, 44, 90, 60, 85, 24, 41),
+(5, 6, 45, 92, 61, 86, 25, 42),
+(5, 6, 46, 94, 62, 88, 25, 42),
+(5, 6, 47, 96, 64, 90, 25, 43),
+(5, 6, 48, 98, 65, 92, 25, 43),
+(5, 6, 49, 100, 66, 93, 25, 44),
+(5, 6, 50, 102, 67, 95, 26, 44),
+(5, 6, 51, 103, 67, 96, 26, 45),
+(5, 6, 52, 104, 68, 97, 26, 45),
+(5, 6, 53, 105, 69, 98, 26, 46),
+(5, 6, 54, 106, 70, 99, 27, 46),
+(5, 6, 55, 107, 71, 100, 27, 47),
+(5, 6, 56, 110, 73, 103, 27, 48),
+(5, 6, 57, 112, 74, 105, 27, 48),
+(5, 6, 58, 114, 75, 107, 28, 49),
+(5, 6, 59, 119, 77, 109, 28, 49),
+(5, 6, 60, 122, 78, 111, 28, 50),
+(5, 6, 61, 124, 79, 113, 28, 51),
+(5, 6, 62, 127, 81, 115, 28, 51),
+(5, 6, 63, 129, 82, 118, 29, 52),
+(5, 6, 64, 136, 84, 120, 29, 52),
+(5, 6, 65, 137, 85, 123, 29, 53),
+(5, 6, 66, 138, 87, 125, 29, 54),
+(5, 6, 67, 141, 88, 127, 30, 54),
+(5, 6, 68, 143, 90, 129, 30, 55),
+(5, 6, 69, 146, 91, 132, 30, 56),
+(5, 6, 70, 149, 93, 134, 30, 56),
+(5, 6, 71, 152, 95, 137, 31, 57),
+(5, 6, 72, 154, 96, 139, 31, 58),
+(5, 6, 73, 157, 98, 142, 31, 59),
+(5, 6, 74, 158, 100, 145, 31, 59),
+(5, 6, 75, 159, 101, 147, 32, 60),
+(5, 6, 76, 162, 103, 150, 32, 61),
+(5, 6, 77, 167, 105, 152, 32, 62),
+(5, 6, 78, 173, 106, 155, 32, 62),
+(5, 6, 79, 174, 108, 158, 33, 63),
+(5, 6, 80, 174, 110, 161, 33, 64),
+(5, 8, 1, 19, 18, 21, 21, 27),
+(5, 8, 2, 19, 18, 21, 22, 28),
+(5, 8, 3, 19, 18, 22, 24, 30),
+(5, 8, 4, 19, 18, 22, 25, 31),
+(5, 8, 5, 19, 19, 22, 26, 32),
+(5, 8, 6, 19, 19, 22, 28, 34),
+(5, 8, 7, 20, 19, 23, 29, 35),
+(5, 8, 8, 20, 19, 23, 31, 36),
+(5, 8, 9, 20, 19, 23, 32, 38),
+(5, 8, 10, 20, 19, 24, 34, 39),
+(5, 8, 11, 20, 20, 24, 35, 40),
+(5, 8, 12, 20, 20, 24, 37, 42),
+(5, 8, 13, 20, 20, 25, 38, 43),
+(5, 8, 14, 20, 20, 25, 40, 45),
+(5, 8, 15, 20, 20, 25, 41, 46),
+(5, 8, 16, 21, 21, 26, 43, 48),
+(5, 8, 17, 21, 21, 26, 44, 49),
+(5, 8, 18, 21, 21, 26, 46, 51),
+(5, 8, 19, 21, 21, 27, 48, 52),
+(5, 8, 20, 21, 21, 27, 49, 54),
+(5, 8, 21, 21, 22, 27, 51, 55),
+(5, 8, 22, 21, 22, 28, 52, 57),
+(5, 8, 23, 21, 22, 28, 54, 58),
+(5, 8, 24, 22, 22, 29, 56, 60),
+(5, 8, 25, 22, 23, 29, 57, 62),
+(5, 8, 26, 22, 23, 29, 59, 63),
+(5, 8, 27, 22, 23, 30, 61, 65),
+(5, 8, 28, 22, 23, 30, 63, 67),
+(5, 8, 29, 22, 24, 31, 64, 68),
+(5, 8, 30, 23, 24, 31, 66, 70),
+(5, 8, 31, 23, 24, 31, 68, 72),
+(5, 8, 32, 23, 24, 32, 70, 73),
+(5, 8, 33, 23, 25, 32, 72, 75),
+(5, 8, 34, 23, 25, 33, 73, 77),
+(5, 8, 35, 24, 25, 33, 75, 79),
+(5, 8, 36, 24, 25, 34, 77, 80),
+(5, 8, 37, 24, 26, 34, 79, 82),
+(5, 8, 38, 24, 26, 35, 81, 84),
+(5, 8, 39, 24, 26, 35, 83, 86),
+(5, 8, 40, 24, 27, 35, 85, 88),
+(5, 8, 41, 25, 27, 36, 87, 90),
+(5, 8, 42, 25, 27, 36, 89, 91),
+(5, 8, 43, 25, 27, 37, 90, 93),
+(5, 8, 44, 25, 28, 37, 92, 95),
+(5, 8, 45, 26, 28, 38, 94, 97),
+(5, 8, 46, 26, 28, 38, 96, 99),
+(5, 8, 47, 26, 29, 39, 98, 101),
+(5, 8, 48, 26, 29, 39, 100, 103),
+(5, 8, 49, 26, 29, 40, 103, 105),
+(5, 8, 50, 27, 30, 40, 105, 107),
+(5, 8, 51, 27, 30, 41, 107, 109),
+(5, 8, 52, 27, 30, 42, 109, 111),
+(5, 8, 53, 27, 31, 42, 111, 113),
+(5, 8, 54, 28, 31, 43, 113, 115),
+(5, 8, 55, 28, 31, 43, 115, 117),
+(5, 8, 56, 28, 32, 44, 117, 119),
+(5, 8, 57, 28, 32, 44, 119, 121),
+(5, 8, 58, 29, 32, 45, 122, 123),
+(5, 8, 59, 29, 33, 45, 124, 126),
+(5, 8, 60, 29, 33, 46, 126, 128),
+(5, 8, 61, 29, 34, 47, 128, 130),
+(5, 8, 62, 30, 34, 47, 131, 132),
+(5, 8, 63, 30, 34, 48, 133, 134),
+(5, 8, 64, 30, 35, 48, 135, 136),
+(5, 8, 65, 31, 35, 49, 137, 139),
+(5, 8, 66, 31, 35, 50, 140, 141),
+(5, 8, 67, 31, 36, 50, 142, 143),
+(5, 8, 68, 31, 36, 51, 144, 145),
+(5, 8, 69, 32, 37, 51, 147, 148),
+(5, 8, 70, 32, 37, 52, 149, 150),
+(5, 8, 71, 32, 37, 53, 152, 153),
+(5, 8, 72, 32, 38, 54, 155, 156),
+(5, 8, 73, 32, 38, 55, 158, 159),
+(5, 8, 74, 33, 39, 55, 161, 161),
+(5, 8, 75, 33, 39, 56, 164, 164),
+(5, 8, 76, 33, 39, 57, 167, 167),
+(5, 8, 77, 34, 40, 58, 170, 170),
+(5, 8, 78, 34, 40, 58, 173, 173),
+(5, 8, 79, 34, 41, 59, 176, 176),
+(5, 8, 80, 35, 41, 60, 179, 179),
+(5, 9, 1, 19, 18, 22, 20, 27),
+(5, 9, 2, 19, 18, 23, 21, 28),
+(5, 9, 3, 20, 19, 23, 22, 29),
+(5, 9, 4, 20, 19, 24, 24, 30),
+(5, 9, 5, 20, 19, 24, 25, 32),
+(5, 9, 6, 20, 20, 25, 26, 33),
+(5, 9, 7, 21, 20, 25, 27, 34),
+(5, 9, 8, 21, 21, 26, 28, 35),
+(5, 9, 9, 21, 21, 26, 30, 36),
+(5, 9, 10, 22, 21, 27, 31, 38),
+(5, 9, 11, 22, 22, 28, 32, 39),
+(5, 9, 12, 22, 22, 28, 34, 40),
+(5, 9, 13, 23, 23, 29, 35, 41),
+(5, 9, 14, 23, 23, 30, 36, 43),
+(5, 9, 15, 23, 24, 30, 37, 44),
+(5, 9, 16, 24, 24, 31, 39, 45),
+(5, 9, 17, 24, 24, 31, 40, 47),
+(5, 9, 18, 24, 25, 32, 42, 48),
+(5, 9, 19, 25, 25, 33, 43, 49),
+(5, 9, 20, 25, 26, 33, 44, 51),
+(5, 9, 21, 26, 26, 34, 46, 52),
+(5, 9, 22, 26, 27, 35, 47, 53),
+(5, 9, 23, 26, 27, 36, 49, 55),
+(5, 9, 24, 27, 28, 36, 50, 56),
+(5, 9, 25, 27, 28, 37, 52, 58),
+(5, 9, 26, 27, 29, 38, 53, 59),
+(5, 9, 27, 28, 29, 38, 55, 60),
+(5, 9, 28, 28, 30, 39, 56, 62),
+(5, 9, 29, 29, 30, 40, 58, 63),
+(5, 9, 30, 29, 31, 41, 59, 65),
+(5, 9, 31, 30, 31, 41, 61, 66),
+(5, 9, 32, 30, 32, 42, 62, 68),
+(5, 9, 33, 30, 32, 43, 64, 69),
+(5, 9, 34, 31, 33, 44, 65, 71),
+(5, 9, 35, 31, 33, 45, 67, 73),
+(5, 9, 36, 32, 34, 45, 69, 74),
+(5, 9, 37, 32, 34, 46, 70, 76),
+(5, 9, 38, 33, 35, 47, 72, 77),
+(5, 9, 39, 33, 36, 48, 73, 79),
+(5, 9, 40, 34, 36, 49, 75, 81),
+(5, 9, 41, 34, 37, 49, 77, 82),
+(5, 9, 42, 35, 37, 50, 78, 84),
+(5, 9, 43, 35, 38, 51, 80, 86),
+(5, 9, 44, 36, 39, 52, 82, 87),
+(5, 9, 45, 36, 39, 53, 84, 89),
+(5, 9, 46, 37, 40, 54, 85, 91),
+(5, 9, 47, 37, 40, 55, 87, 92),
+(5, 9, 48, 38, 41, 55, 89, 94),
+(5, 9, 49, 38, 42, 56, 91, 96),
+(5, 9, 50, 39, 42, 57, 92, 98),
+(5, 9, 51, 39, 43, 58, 94, 100),
+(5, 9, 52, 40, 44, 59, 96, 101),
+(5, 9, 53, 40, 44, 60, 98, 103),
+(5, 9, 54, 41, 45, 61, 100, 105),
+(5, 9, 55, 41, 45, 62, 102, 107),
+(5, 9, 56, 42, 46, 63, 103, 109),
+(5, 9, 57, 42, 47, 64, 105, 111),
+(5, 9, 58, 43, 47, 65, 107, 112),
+(5, 9, 59, 43, 48, 66, 109, 114),
+(5, 9, 60, 44, 49, 67, 111, 116),
+(5, 9, 61, 45, 50, 68, 113, 118),
+(5, 9, 62, 45, 50, 69, 115, 120),
+(5, 9, 63, 46, 51, 70, 117, 122),
+(5, 9, 64, 46, 52, 71, 119, 124),
+(5, 9, 65, 47, 52, 72, 121, 126),
+(5, 9, 66, 48, 53, 73, 123, 128),
+(5, 9, 67, 48, 54, 74, 125, 130),
+(5, 9, 68, 49, 55, 75, 127, 132),
+(5, 9, 69, 49, 55, 76, 129, 134),
+(5, 9, 70, 50, 56, 77, 131, 136),
+(5, 9, 71, 51, 57, 86, 135, 147),
+(5, 9, 72, 52, 57, 88, 136, 149),
+(5, 9, 73, 53, 58, 89, 138, 152),
+(5, 9, 74, 53, 59, 90, 141, 155),
+(5, 9, 75, 54, 60, 92, 143, 157),
+(5, 9, 76, 55, 61, 93, 146, 160),
+(5, 9, 77, 56, 62, 94, 149, 163),
+(5, 9, 78, 56, 63, 96, 151, 166),
+(5, 9, 79, 57, 64, 97, 154, 169),
+(5, 9, 80, 58, 65, 99, 157, 171),
+(6, 1, 1, 28, 15, 24, 15, 22),
+(6, 1, 2, 29, 16, 25, 15, 22),
+(6, 1, 3, 31, 17, 26, 15, 23),
+(6, 1, 4, 32, 17, 27, 15, 23),
+(6, 1, 5, 33, 18, 29, 15, 23),
+(6, 1, 6, 34, 19, 30, 15, 23),
+(6, 1, 7, 36, 20, 31, 16, 24),
+(6, 1, 8, 37, 21, 32, 16, 24),
+(6, 1, 9, 38, 22, 34, 16, 24),
+(6, 1, 10, 40, 22, 35, 16, 25),
+(6, 1, 11, 41, 23, 36, 16, 25),
+(6, 1, 12, 43, 24, 37, 16, 25),
+(6, 1, 13, 44, 25, 39, 16, 26),
+(6, 1, 14, 46, 26, 40, 16, 26),
+(6, 1, 15, 47, 27, 41, 17, 26),
+(6, 1, 16, 48, 28, 43, 17, 27),
+(6, 1, 17, 50, 29, 44, 17, 27),
+(6, 1, 18, 51, 30, 45, 17, 27),
+(6, 1, 19, 53, 31, 47, 17, 28),
+(6, 1, 20, 54, 32, 48, 17, 28),
+(6, 1, 21, 56, 33, 50, 17, 28),
+(6, 1, 22, 58, 34, 51, 18, 29),
+(6, 1, 23, 59, 35, 52, 18, 29),
+(6, 1, 24, 61, 36, 54, 18, 30),
+(6, 1, 25, 62, 37, 55, 18, 30),
+(6, 1, 26, 64, 38, 57, 18, 30),
+(6, 1, 27, 66, 39, 58, 18, 31),
+(6, 1, 28, 67, 40, 60, 18, 31),
+(6, 1, 29, 69, 41, 61, 19, 32),
+(6, 1, 30, 71, 42, 63, 19, 32),
+(6, 1, 31, 72, 43, 64, 19, 32),
+(6, 1, 32, 74, 44, 66, 19, 33),
+(6, 1, 33, 76, 45, 67, 19, 33),
+(6, 1, 34, 77, 46, 69, 20, 34),
+(6, 1, 35, 79, 47, 71, 20, 34),
+(6, 1, 36, 81, 48, 72, 20, 35),
+(6, 1, 37, 83, 49, 74, 20, 35),
+(6, 1, 38, 85, 50, 76, 20, 35),
+(6, 1, 39, 86, 51, 77, 21, 36),
+(6, 1, 40, 88, 53, 79, 21, 36),
+(6, 1, 41, 90, 54, 81, 21, 37),
+(6, 1, 42, 92, 55, 82, 21, 37),
+(6, 1, 43, 94, 56, 84, 21, 38),
+(6, 1, 44, 96, 57, 86, 22, 38),
+(6, 1, 45, 98, 58, 87, 22, 39),
+(6, 1, 46, 99, 60, 89, 22, 39),
+(6, 1, 47, 101, 61, 91, 22, 40),
+(6, 1, 48, 103, 62, 93, 22, 40),
+(6, 1, 49, 105, 63, 94, 23, 41),
+(6, 1, 50, 107, 65, 96, 23, 41),
+(6, 1, 51, 109, 66, 98, 23, 42),
+(6, 1, 52, 111, 67, 100, 23, 42),
+(6, 1, 53, 113, 68, 102, 24, 43),
+(6, 1, 54, 115, 70, 104, 24, 44),
+(6, 1, 55, 117, 71, 105, 24, 44),
+(6, 1, 56, 119, 72, 107, 24, 45),
+(6, 1, 57, 122, 73, 109, 25, 45),
+(6, 1, 58, 124, 75, 111, 25, 46),
+(6, 1, 59, 126, 76, 113, 25, 46),
+(6, 1, 60, 128, 77, 115, 25, 47),
+(6, 1, 61, 130, 79, 117, 26, 48),
+(6, 1, 62, 132, 80, 119, 26, 48),
+(6, 1, 63, 134, 81, 121, 26, 49),
+(6, 1, 64, 137, 83, 123, 26, 49),
+(6, 1, 65, 139, 84, 125, 27, 50),
+(6, 1, 66, 141, 85, 127, 27, 51),
+(6, 1, 67, 143, 87, 129, 27, 51),
+(6, 1, 68, 145, 88, 131, 27, 52),
+(6, 1, 69, 148, 90, 133, 28, 52),
+(6, 1, 70, 150, 91, 135, 28, 53),
+(6, 1, 71, 153, 92, 137, 28, 54),
+(6, 1, 72, 155, 94, 140, 28, 55),
+(6, 1, 73, 158, 96, 142, 28, 56),
+(6, 1, 74, 161, 97, 145, 29, 56),
+(6, 1, 75, 164, 99, 147, 29, 57),
+(6, 1, 76, 167, 101, 150, 29, 58),
+(6, 1, 77, 170, 103, 153, 30, 59),
+(6, 1, 78, 173, 104, 155, 30, 59),
+(6, 1, 79, 176, 106, 164, 30, 60),
+(6, 1, 80, 179, 108, 170, 31, 61),
+(6, 3, 1, 25, 18, 23, 15, 23),
+(6, 3, 2, 25, 19, 24, 16, 24),
+(6, 3, 3, 26, 21, 25, 16, 24),
+(6, 3, 4, 26, 22, 26, 17, 25),
+(6, 3, 5, 27, 24, 27, 17, 25),
+(6, 3, 6, 27, 25, 28, 18, 26),
+(6, 3, 7, 28, 26, 28, 19, 27),
+(6, 3, 8, 28, 28, 29, 19, 27),
+(6, 3, 9, 28, 29, 30, 20, 28),
+(6, 3, 10, 29, 31, 31, 20, 29),
+(6, 3, 11, 29, 32, 32, 21, 29),
+(6, 3, 12, 30, 34, 33, 22, 30),
+(6, 3, 13, 30, 35, 34, 22, 31),
+(6, 3, 14, 31, 37, 35, 23, 32),
+(6, 3, 15, 31, 38, 36, 24, 32),
+(6, 3, 16, 32, 40, 37, 24, 33),
+(6, 3, 17, 32, 41, 39, 25, 34),
+(6, 3, 18, 33, 43, 40, 26, 35),
+(6, 3, 19, 33, 45, 41, 27, 35),
+(6, 3, 20, 34, 46, 42, 27, 36),
+(6, 3, 21, 34, 48, 43, 28, 37),
+(6, 3, 22, 35, 50, 44, 29, 38),
+(6, 3, 23, 35, 51, 45, 29, 38),
+(6, 3, 24, 36, 53, 46, 30, 39),
+(6, 3, 25, 37, 55, 47, 31, 40),
+(6, 3, 26, 37, 56, 48, 32, 41),
+(6, 3, 27, 38, 58, 50, 32, 42),
+(6, 3, 28, 38, 60, 51, 33, 42),
+(6, 3, 29, 39, 62, 52, 34, 43),
+(6, 3, 30, 39, 63, 53, 35, 44),
+(6, 3, 31, 40, 65, 54, 36, 45),
+(6, 3, 32, 41, 67, 56, 36, 46),
+(6, 3, 33, 41, 69, 57, 37, 47),
+(6, 3, 34, 42, 71, 58, 38, 48),
+(6, 3, 35, 43, 72, 59, 39, 48),
+(6, 3, 36, 43, 74, 61, 40, 49),
+(6, 3, 37, 44, 76, 62, 40, 50),
+(6, 3, 38, 45, 78, 63, 41, 51),
+(6, 3, 39, 45, 80, 64, 42, 52),
+(6, 3, 40, 46, 82, 66, 43, 53),
+(6, 3, 41, 47, 84, 67, 44, 54),
+(6, 3, 42, 47, 86, 68, 45, 55),
+(6, 3, 43, 48, 88, 70, 46, 56),
+(6, 3, 44, 49, 90, 71, 46, 57),
+(6, 3, 45, 49, 92, 72, 47, 58),
+(6, 3, 46, 50, 94, 74, 48, 59),
+(6, 3, 47, 51, 96, 75, 49, 60),
+(6, 3, 48, 51, 98, 77, 50, 61),
+(6, 3, 49, 52, 100, 78, 51, 62),
+(6, 3, 50, 53, 102, 79, 52, 63),
+(6, 3, 51, 54, 104, 81, 53, 64),
+(6, 3, 52, 54, 106, 82, 54, 65),
+(6, 3, 53, 55, 108, 84, 55, 66),
+(6, 3, 54, 56, 110, 85, 56, 67),
+(6, 3, 55, 57, 112, 87, 57, 68),
+(6, 3, 56, 57, 114, 88, 58, 69),
+(6, 3, 57, 58, 117, 90, 59, 70),
+(6, 3, 58, 59, 119, 91, 60, 71),
+(6, 3, 59, 60, 121, 93, 61, 72),
+(6, 3, 60, 61, 123, 94, 62, 74),
+(6, 3, 61, 61, 125, 96, 63, 75),
+(6, 3, 62, 62, 128, 97, 64, 76),
+(6, 3, 63, 63, 130, 99, 65, 77),
+(6, 3, 64, 64, 132, 100, 66, 78),
+(6, 3, 65, 65, 134, 102, 67, 79),
+(6, 3, 66, 66, 137, 104, 68, 80),
+(6, 3, 67, 66, 139, 105, 69, 81),
+(6, 3, 68, 67, 141, 107, 70, 83),
+(6, 3, 69, 68, 144, 108, 71, 84),
+(6, 3, 70, 69, 146, 110, 72, 85),
+(6, 3, 71, 70, 149, 112, 73, 86),
+(6, 3, 72, 71, 152, 114, 74, 87),
+(6, 3, 73, 72, 155, 116, 75, 89),
+(6, 3, 74, 73, 158, 118, 77, 90),
+(6, 3, 75, 74, 161, 120, 78, 92),
+(6, 3, 76, 75, 164, 122, 79, 93),
+(6, 3, 77, 76, 167, 124, 81, 95),
+(6, 3, 78, 77, 176, 126, 85, 96),
+(6, 3, 79, 78, 179, 128, 86, 98),
+(6, 3, 80, 79, 183, 130, 88, 99),
+(6, 6, 1, 28, 15, 24, 15, 22),
+(6, 6, 2, 29, 16, 25, 15, 22),
+(6, 6, 3, 31, 17, 26, 15, 23),
+(6, 6, 4, 32, 17, 27, 15, 23),
+(6, 6, 5, 33, 18, 29, 15, 23),
+(6, 6, 6, 34, 19, 30, 15, 23),
+(6, 6, 7, 36, 20, 31, 16, 24),
+(6, 6, 8, 37, 21, 32, 16, 24),
+(6, 6, 9, 38, 22, 34, 16, 24),
+(6, 6, 10, 40, 22, 35, 16, 25),
+(6, 6, 11, 41, 23, 36, 16, 25),
+(6, 6, 12, 43, 24, 37, 16, 25),
+(6, 6, 13, 44, 25, 39, 16, 26),
+(6, 6, 14, 46, 26, 40, 16, 26),
+(6, 6, 15, 47, 27, 41, 17, 26),
+(6, 6, 16, 48, 28, 43, 17, 27),
+(6, 6, 17, 50, 29, 44, 17, 27),
+(6, 6, 18, 51, 30, 45, 17, 27),
+(6, 6, 19, 53, 31, 47, 17, 28),
+(6, 6, 20, 54, 32, 48, 17, 28),
+(6, 6, 21, 56, 33, 50, 17, 28),
+(6, 6, 22, 58, 34, 51, 18, 29),
+(6, 6, 23, 59, 35, 52, 18, 29),
+(6, 6, 24, 61, 36, 54, 18, 30),
+(6, 6, 25, 62, 37, 55, 18, 30),
+(6, 6, 26, 64, 38, 57, 18, 30),
+(6, 6, 27, 66, 39, 58, 18, 31),
+(6, 6, 28, 67, 40, 60, 18, 31),
+(6, 6, 29, 69, 41, 61, 19, 32),
+(6, 6, 30, 71, 42, 63, 19, 32),
+(6, 6, 31, 72, 43, 64, 19, 32),
+(6, 6, 32, 74, 44, 66, 19, 33),
+(6, 6, 33, 76, 45, 67, 19, 33),
+(6, 6, 34, 77, 46, 69, 20, 34),
+(6, 6, 35, 79, 47, 71, 20, 34),
+(6, 6, 36, 81, 48, 72, 20, 35),
+(6, 6, 37, 83, 49, 74, 20, 35),
+(6, 6, 38, 85, 50, 76, 20, 35),
+(6, 6, 39, 86, 51, 77, 21, 36),
+(6, 6, 40, 88, 53, 79, 21, 36),
+(6, 6, 41, 90, 54, 81, 21, 37),
+(6, 6, 42, 92, 55, 82, 21, 37),
+(6, 6, 43, 94, 56, 84, 21, 38),
+(6, 6, 44, 96, 57, 86, 22, 38),
+(6, 6, 45, 98, 58, 87, 22, 39),
+(6, 6, 46, 99, 60, 89, 22, 39),
+(6, 6, 47, 101, 60, 91, 22, 40),
+(6, 6, 48, 103, 61, 93, 22, 40),
+(6, 6, 49, 105, 62, 94, 23, 41),
+(6, 6, 50, 107, 63, 96, 23, 41),
+(6, 6, 51, 109, 64, 97, 23, 42),
+(6, 6, 52, 110, 65, 98, 23, 42),
+(6, 6, 53, 111, 66, 99, 24, 43),
+(6, 6, 54, 112, 67, 100, 24, 44),
+(6, 6, 55, 113, 68, 101, 24, 44),
+(6, 6, 56, 116, 70, 104, 24, 45),
+(6, 6, 57, 121, 71, 106, 24, 45),
+(6, 6, 58, 123, 72, 108, 25, 46),
+(6, 6, 59, 123, 74, 110, 25, 46),
+(6, 6, 60, 125, 75, 112, 25, 47),
+(6, 6, 61, 127, 76, 114, 25, 48),
+(6, 6, 62, 133, 78, 116, 25, 48),
+(6, 6, 63, 135, 79, 119, 26, 49),
+(6, 6, 64, 139, 81, 121, 26, 49),
+(6, 6, 65, 142, 82, 123, 26, 50),
+(6, 6, 66, 146, 84, 126, 26, 51),
+(6, 6, 67, 150, 85, 132, 27, 51),
+(6, 6, 68, 153, 87, 137, 27, 52),
+(6, 6, 69, 157, 88, 140, 27, 53),
+(6, 6, 70, 160, 90, 143, 27, 53),
+(6, 6, 71, 163, 92, 146, 28, 54),
+(6, 6, 72, 165, 93, 148, 28, 55),
+(6, 6, 73, 167, 95, 150, 28, 56),
+(6, 6, 74, 171, 97, 153, 28, 56),
+(6, 6, 75, 174, 98, 156, 29, 57),
+(6, 6, 76, 178, 100, 156, 29, 58),
+(6, 6, 77, 179, 102, 156, 29, 59),
+(6, 6, 78, 179, 103, 156, 29, 59),
+(6, 6, 79, 182, 105, 159, 30, 60),
+(6, 6, 80, 185, 107, 162, 30, 61),
+(6, 7, 1, 26, 15, 23, 16, 24),
+(6, 7, 2, 27, 15, 24, 17, 25),
+(6, 7, 3, 28, 16, 25, 18, 26),
+(6, 7, 4, 28, 16, 26, 19, 27),
+(6, 7, 5, 29, 17, 27, 20, 28),
+(6, 7, 6, 30, 17, 28, 21, 29),
+(6, 7, 7, 31, 18, 29, 22, 30),
+(6, 7, 8, 32, 18, 30, 23, 31),
+(6, 7, 9, 33, 19, 31, 24, 32),
+(6, 7, 10, 34, 19, 32, 25, 33),
+(6, 7, 11, 35, 20, 33, 26, 35),
+(6, 7, 12, 35, 20, 34, 27, 36),
+(6, 7, 13, 36, 21, 35, 28, 37),
+(6, 7, 14, 37, 21, 36, 29, 38),
+(6, 7, 15, 38, 22, 37, 30, 39),
+(6, 7, 16, 39, 22, 39, 31, 40),
+(6, 7, 17, 40, 23, 40, 32, 42),
+(6, 7, 18, 41, 23, 41, 33, 43),
+(6, 7, 19, 42, 24, 42, 34, 44),
+(6, 7, 20, 43, 24, 43, 35, 45),
+(6, 7, 21, 44, 25, 44, 36, 46),
+(6, 7, 22, 45, 25, 45, 37, 48),
+(6, 7, 23, 46, 26, 47, 38, 49),
+(6, 7, 24, 47, 27, 48, 40, 50),
+(6, 7, 25, 48, 27, 49, 41, 51),
+(6, 7, 26, 49, 28, 50, 42, 53),
+(6, 7, 27, 51, 28, 52, 43, 54),
+(6, 7, 28, 52, 29, 53, 44, 55),
+(6, 7, 29, 53, 29, 54, 45, 57),
+(6, 7, 30, 54, 30, 55, 47, 58),
+(6, 7, 31, 55, 31, 57, 48, 59),
+(6, 7, 32, 56, 31, 58, 49, 61),
+(6, 7, 33, 57, 32, 59, 50, 62),
+(6, 7, 34, 58, 33, 61, 51, 64),
+(6, 7, 35, 60, 33, 62, 53, 65),
+(6, 7, 36, 61, 34, 63, 54, 66),
+(6, 7, 37, 62, 34, 65, 55, 68),
+(6, 7, 38, 63, 35, 66, 57, 69),
+(6, 7, 39, 64, 36, 67, 58, 71),
+(6, 7, 40, 66, 36, 69, 59, 72),
+(6, 7, 41, 67, 37, 70, 60, 74),
+(6, 7, 42, 68, 38, 72, 62, 75),
+(6, 7, 43, 69, 38, 73, 63, 77),
+(6, 7, 44, 70, 39, 74, 64, 78),
+(6, 7, 45, 72, 40, 76, 66, 80),
+(6, 7, 46, 73, 41, 77, 67, 81),
+(6, 7, 47, 74, 41, 79, 69, 83),
+(6, 7, 48, 76, 42, 80, 70, 84),
+(6, 7, 49, 77, 43, 82, 71, 86),
+(6, 7, 50, 78, 43, 83, 73, 88),
+(6, 7, 51, 80, 44, 85, 74, 89),
+(6, 7, 52, 81, 45, 86, 76, 91),
+(6, 7, 53, 82, 46, 88, 77, 92),
+(6, 7, 54, 84, 46, 90, 78, 94),
+(6, 7, 55, 85, 47, 91, 80, 96),
+(6, 7, 56, 86, 48, 93, 81, 97),
+(6, 7, 57, 88, 49, 94, 83, 99),
+(6, 7, 58, 89, 49, 96, 84, 101),
+(6, 7, 59, 91, 50, 97, 86, 102),
+(6, 7, 60, 92, 51, 99, 87, 104),
+(6, 7, 61, 94, 52, 101, 89, 106),
+(6, 7, 62, 95, 52, 102, 90, 108),
+(6, 7, 63, 96, 53, 104, 92, 109),
+(6, 7, 64, 98, 54, 106, 93, 111),
+(6, 7, 65, 99, 55, 107, 95, 113),
+(6, 7, 66, 101, 56, 109, 97, 115),
+(6, 7, 67, 102, 57, 111, 98, 117),
+(6, 7, 68, 104, 57, 113, 100, 118),
+(6, 7, 69, 105, 58, 114, 101, 120),
+(6, 7, 70, 107, 59, 116, 103, 122),
+(6, 7, 71, 108, 60, 118, 113, 124),
+(6, 7, 72, 110, 61, 120, 117, 127),
+(6, 7, 73, 112, 62, 122, 119, 129),
+(6, 7, 74, 114, 63, 125, 122, 131),
+(6, 7, 75, 116, 64, 127, 124, 133),
+(6, 7, 76, 118, 65, 129, 126, 136),
+(6, 7, 77, 119, 66, 131, 128, 138),
+(6, 7, 78, 121, 67, 133, 130, 140),
+(6, 7, 79, 123, 68, 136, 133, 143),
+(6, 7, 80, 125, 69, 138, 135, 145),
+(6, 11, 1, 26, 15, 22, 17, 24),
+(6, 11, 2, 27, 16, 23, 18, 25),
+(6, 11, 3, 27, 16, 23, 19, 26),
+(6, 11, 4, 28, 17, 24, 20, 27),
+(6, 11, 5, 28, 17, 25, 21, 29),
+(6, 11, 6, 29, 18, 25, 22, 30),
+(6, 11, 7, 29, 18, 26, 23, 31),
+(6, 11, 8, 30, 19, 27, 24, 32),
+(6, 11, 9, 30, 19, 27, 26, 34),
+(6, 11, 10, 31, 20, 28, 27, 35),
+(6, 11, 11, 32, 20, 29, 28, 36),
+(6, 11, 12, 32, 21, 29, 29, 37),
+(6, 11, 13, 33, 21, 30, 30, 39),
+(6, 11, 14, 33, 22, 31, 31, 40),
+(6, 11, 15, 34, 23, 32, 32, 41),
+(6, 11, 16, 35, 23, 32, 34, 43),
+(6, 11, 17, 35, 24, 33, 35, 44),
+(6, 11, 18, 36, 24, 34, 36, 45),
+(6, 11, 19, 37, 25, 35, 37, 47),
+(6, 11, 20, 37, 26, 35, 39, 48),
+(6, 11, 21, 38, 26, 36, 40, 50),
+(6, 11, 22, 39, 27, 37, 41, 51),
+(6, 11, 23, 39, 28, 38, 42, 52),
+(6, 11, 24, 40, 28, 39, 44, 54),
+(6, 11, 25, 41, 29, 39, 45, 55),
+(6, 11, 26, 41, 30, 40, 46, 57),
+(6, 11, 27, 42, 30, 41, 47, 58),
+(6, 11, 28, 43, 31, 42, 49, 60),
+(6, 11, 29, 44, 32, 43, 50, 61),
+(6, 11, 30, 44, 32, 44, 52, 63),
+(6, 11, 31, 45, 33, 44, 53, 64),
+(6, 11, 32, 46, 34, 45, 54, 66),
+(6, 11, 33, 47, 34, 46, 56, 67),
+(6, 11, 34, 47, 35, 47, 57, 69),
+(6, 11, 35, 48, 36, 48, 58, 71),
+(6, 11, 36, 49, 36, 49, 60, 72),
+(6, 11, 37, 50, 37, 50, 61, 74),
+(6, 11, 38, 51, 38, 51, 63, 76),
+(6, 11, 39, 52, 39, 52, 64, 77),
+(6, 11, 40, 52, 39, 53, 66, 79),
+(6, 11, 41, 53, 40, 54, 67, 81),
+(6, 11, 42, 54, 41, 55, 69, 82),
+(6, 11, 43, 55, 42, 56, 70, 84),
+(6, 11, 44, 56, 43, 57, 72, 86),
+(6, 11, 45, 57, 43, 57, 73, 87),
+(6, 11, 46, 57, 44, 58, 75, 89),
+(6, 11, 47, 58, 45, 60, 76, 91),
+(6, 11, 48, 59, 46, 61, 78, 93),
+(6, 11, 49, 60, 47, 62, 79, 94),
+(6, 11, 50, 61, 47, 63, 81, 96),
+(6, 11, 51, 62, 48, 64, 83, 98),
+(6, 11, 52, 63, 49, 65, 84, 100),
+(6, 11, 53, 64, 50, 66, 86, 102),
+(6, 11, 54, 65, 51, 67, 87, 104),
+(6, 11, 55, 66, 51, 68, 89, 105),
+(6, 11, 56, 67, 52, 69, 91, 107),
+(6, 11, 57, 68, 53, 70, 92, 109),
+(6, 11, 58, 69, 54, 71, 94, 111),
+(6, 11, 59, 70, 55, 72, 96, 113),
+(6, 11, 60, 71, 56, 73, 97, 115),
+(6, 11, 61, 72, 57, 74, 99, 117),
+(6, 11, 62, 73, 58, 76, 101, 119),
+(6, 11, 63, 74, 59, 77, 103, 121),
+(6, 11, 64, 75, 59, 78, 104, 123),
+(6, 11, 65, 76, 60, 79, 106, 125),
+(6, 11, 66, 77, 61, 80, 108, 127),
+(6, 11, 67, 78, 62, 81, 110, 129),
+(6, 11, 68, 79, 63, 83, 111, 131),
+(6, 11, 69, 80, 64, 84, 113, 133),
+(6, 11, 70, 81, 65, 85, 115, 135),
+(6, 11, 71, 83, 66, 86, 117, 137),
+(6, 11, 72, 84, 68, 88, 120, 140),
+(6, 11, 73, 85, 69, 89, 122, 142),
+(6, 11, 74, 86, 70, 91, 124, 145),
+(6, 11, 75, 88, 71, 92, 126, 147),
+(6, 11, 76, 89, 72, 94, 128, 150),
+(6, 11, 77, 90, 73, 95, 131, 153),
+(6, 11, 78, 92, 75, 97, 133, 155),
+(6, 11, 79, 93, 76, 98, 136, 158),
+(6, 11, 80, 94, 77, 100, 138, 185),
+(7, 1, 1, 18, 23, 21, 24, 20),
+(7, 1, 2, 19, 24, 22, 24, 20),
+(7, 1, 3, 21, 25, 23, 24, 21),
+(7, 1, 4, 22, 25, 25, 24, 21),
+(7, 1, 5, 23, 26, 26, 24, 21),
+(7, 1, 6, 25, 27, 27, 24, 21),
+(7, 1, 7, 26, 28, 28, 24, 22),
+(7, 1, 8, 27, 29, 29, 25, 22),
+(7, 1, 9, 29, 29, 31, 25, 22),
+(7, 1, 10, 30, 30, 32, 25, 23),
+(7, 1, 11, 32, 31, 33, 25, 23),
+(7, 1, 12, 33, 32, 34, 25, 23),
+(7, 1, 13, 34, 33, 36, 25, 24),
+(7, 1, 14, 36, 34, 37, 25, 24),
+(7, 1, 15, 37, 35, 38, 25, 24),
+(7, 1, 16, 39, 36, 40, 25, 25),
+(7, 1, 17, 40, 36, 41, 25, 25),
+(7, 1, 18, 42, 37, 43, 26, 25),
+(7, 1, 19, 43, 38, 44, 26, 26),
+(7, 1, 20, 45, 39, 45, 26, 26),
+(7, 1, 21, 47, 40, 47, 26, 26),
+(7, 1, 22, 48, 41, 48, 26, 27),
+(7, 1, 23, 50, 42, 50, 26, 27),
+(7, 1, 24, 51, 43, 51, 26, 28),
+(7, 1, 25, 53, 44, 52, 27, 28),
+(7, 1, 26, 55, 45, 54, 27, 28),
+(7, 1, 27, 56, 46, 55, 27, 29),
+(7, 1, 28, 58, 47, 57, 27, 29),
+(7, 1, 29, 59, 48, 58, 27, 30),
+(7, 1, 30, 61, 49, 60, 27, 30),
+(7, 1, 31, 63, 50, 62, 27, 30),
+(7, 1, 32, 65, 51, 63, 28, 31),
+(7, 1, 33, 66, 52, 65, 28, 31),
+(7, 1, 34, 68, 53, 66, 28, 32),
+(7, 1, 35, 70, 55, 68, 28, 32),
+(7, 1, 36, 72, 56, 69, 28, 33),
+(7, 1, 37, 73, 57, 71, 29, 33),
+(7, 1, 38, 75, 58, 73, 29, 34),
+(7, 1, 39, 77, 59, 74, 29, 34),
+(7, 1, 40, 79, 60, 76, 29, 35),
+(7, 1, 41, 81, 61, 78, 29, 35),
+(7, 1, 42, 82, 62, 79, 30, 35),
+(7, 1, 43, 84, 64, 81, 30, 36),
+(7, 1, 44, 86, 65, 83, 30, 36),
+(7, 1, 45, 88, 66, 85, 30, 37),
+(7, 1, 46, 90, 67, 86, 30, 37),
+(7, 1, 47, 92, 68, 88, 31, 38),
+(7, 1, 48, 94, 70, 90, 31, 38),
+(7, 1, 49, 96, 71, 92, 31, 39),
+(7, 1, 50, 98, 72, 93, 31, 40),
+(7, 1, 51, 100, 73, 95, 32, 40),
+(7, 1, 52, 102, 75, 97, 32, 41),
+(7, 1, 53, 104, 76, 99, 32, 41),
+(7, 1, 54, 106, 77, 101, 32, 42),
+(7, 1, 55, 108, 78, 103, 33, 42),
+(7, 1, 56, 110, 80, 104, 33, 43),
+(7, 1, 57, 112, 81, 106, 33, 43),
+(7, 1, 58, 114, 82, 108, 33, 44),
+(7, 1, 59, 116, 84, 110, 34, 44),
+(7, 1, 60, 118, 85, 112, 34, 45),
+(7, 1, 61, 120, 86, 114, 34, 46),
+(7, 1, 62, 122, 88, 116, 35, 46),
+(7, 1, 63, 125, 89, 118, 35, 47),
+(7, 1, 64, 127, 91, 120, 35, 47),
+(7, 1, 65, 129, 92, 122, 35, 48),
+(7, 1, 66, 131, 93, 124, 36, 49),
+(7, 1, 67, 133, 95, 126, 36, 49),
+(7, 1, 68, 136, 96, 128, 36, 50),
+(7, 1, 69, 138, 98, 130, 37, 50),
+(7, 1, 70, 140, 99, 132, 37, 51),
+(7, 1, 71, 143, 100, 134, 37, 52),
+(7, 1, 72, 145, 102, 137, 37, 53),
+(7, 1, 73, 148, 104, 139, 37, 54),
+(7, 1, 74, 151, 105, 142, 38, 54),
+(7, 1, 75, 154, 107, 144, 38, 55),
+(7, 1, 76, 157, 109, 147, 38, 56),
+(7, 1, 77, 163, 111, 153, 39, 57),
+(7, 1, 78, 169, 112, 158, 39, 57),
+(7, 1, 79, 172, 114, 161, 39, 58),
+(7, 1, 80, 175, 116, 164, 40, 59),
+(7, 4, 1, 16, 26, 20, 24, 20),
+(7, 4, 2, 17, 27, 21, 24, 20),
+(7, 4, 3, 18, 29, 21, 24, 21),
+(7, 4, 4, 18, 30, 22, 24, 21),
+(7, 4, 5, 19, 32, 23, 25, 21),
+(7, 4, 6, 20, 33, 24, 25, 22),
+(7, 4, 7, 21, 35, 24, 25, 22),
+(7, 4, 8, 22, 36, 25, 25, 23),
+(7, 4, 9, 22, 38, 26, 25, 23),
+(7, 4, 10, 23, 39, 26, 25, 23),
+(7, 4, 11, 24, 41, 27, 25, 24),
+(7, 4, 12, 25, 42, 28, 26, 24),
+(7, 4, 13, 26, 44, 29, 26, 25),
+(7, 4, 14, 27, 46, 30, 26, 25),
+(7, 4, 15, 28, 47, 30, 26, 25),
+(7, 4, 16, 28, 49, 31, 26, 26),
+(7, 4, 17, 29, 50, 32, 27, 26),
+(7, 4, 18, 30, 52, 33, 27, 27),
+(7, 4, 19, 31, 54, 34, 27, 27),
+(7, 4, 20, 32, 56, 35, 27, 28),
+(7, 4, 21, 33, 57, 35, 27, 28),
+(7, 4, 22, 34, 59, 36, 28, 29),
+(7, 4, 23, 35, 61, 37, 28, 29),
+(7, 4, 24, 36, 62, 38, 28, 30),
+(7, 4, 25, 37, 64, 39, 28, 30),
+(7, 4, 26, 38, 66, 40, 29, 31),
+(7, 4, 27, 39, 68, 41, 29, 31),
+(7, 4, 28, 40, 70, 42, 29, 32),
+(7, 4, 29, 41, 72, 43, 29, 32),
+(7, 4, 30, 42, 73, 43, 29, 33),
+(7, 4, 31, 43, 75, 44, 30, 33),
+(7, 4, 32, 44, 77, 45, 30, 34),
+(7, 4, 33, 45, 79, 46, 30, 34),
+(7, 4, 34, 46, 81, 47, 31, 35),
+(7, 4, 35, 47, 83, 48, 31, 35),
+(7, 4, 36, 48, 85, 49, 31, 36),
+(7, 4, 37, 49, 87, 50, 31, 36),
+(7, 4, 38, 50, 89, 51, 32, 37),
+(7, 4, 39, 51, 91, 52, 32, 38),
+(7, 4, 40, 53, 93, 53, 32, 38),
+(7, 4, 41, 54, 95, 54, 33, 39),
+(7, 4, 42, 55, 97, 55, 33, 39),
+(7, 4, 43, 56, 99, 56, 33, 40),
+(7, 4, 44, 57, 101, 57, 33, 40),
+(7, 4, 45, 58, 103, 59, 34, 41),
+(7, 4, 46, 59, 105, 60, 34, 42),
+(7, 4, 47, 61, 107, 61, 34, 42),
+(7, 4, 48, 62, 110, 62, 35, 43),
+(7, 4, 49, 63, 112, 63, 35, 44),
+(7, 4, 50, 64, 114, 64, 35, 44),
+(7, 4, 51, 65, 116, 65, 36, 45),
+(7, 4, 52, 67, 118, 66, 36, 45),
+(7, 4, 53, 68, 121, 67, 36, 46),
+(7, 4, 54, 69, 123, 69, 37, 47),
+(7, 4, 55, 70, 125, 70, 37, 47),
+(7, 4, 56, 72, 127, 71, 37, 48),
+(7, 4, 57, 73, 130, 72, 38, 49),
+(7, 4, 58, 74, 132, 73, 38, 49),
+(7, 4, 59, 75, 134, 74, 39, 50),
+(7, 4, 60, 77, 137, 76, 39, 51),
+(7, 4, 61, 78, 139, 77, 39, 51),
+(7, 4, 62, 79, 141, 78, 40, 52),
+(7, 4, 63, 81, 144, 79, 40, 53),
+(7, 4, 64, 82, 146, 80, 41, 54),
+(7, 4, 65, 83, 149, 82, 41, 54),
+(7, 4, 66, 85, 151, 83, 41, 55),
+(7, 4, 67, 86, 154, 84, 42, 56),
+(7, 4, 68, 87, 156, 85, 42, 57),
+(7, 4, 69, 89, 158, 87, 43, 57),
+(7, 4, 70, 90, 161, 88, 43, 58),
+(7, 4, 71, 92, 164, 89, 44, 59),
+(7, 4, 72, 94, 167, 91, 45, 59),
+(7, 4, 73, 95, 170, 93, 45, 60),
+(7, 4, 74, 97, 173, 94, 46, 61),
+(7, 4, 75, 99, 176, 96, 46, 62),
+(7, 4, 76, 100, 179, 97, 46, 63),
+(7, 4, 77, 102, 182, 102, 47, 64),
+(7, 4, 78, 104, 186, 105, 47, 65),
+(7, 4, 79, 106, 189, 106, 48, 66),
+(7, 4, 80, 108, 192, 108, 48, 67),
+(7, 6, 1, 18, 23, 21, 24, 20),
+(7, 6, 2, 19, 24, 22, 24, 20),
+(7, 6, 3, 21, 25, 23, 24, 21),
+(7, 6, 4, 22, 25, 25, 24, 21),
+(7, 6, 5, 23, 26, 26, 24, 21),
+(7, 6, 6, 25, 27, 27, 24, 21),
+(7, 6, 7, 26, 28, 28, 24, 22),
+(7, 6, 8, 27, 29, 29, 25, 22),
+(7, 6, 9, 29, 29, 31, 25, 22),
+(7, 6, 10, 30, 30, 32, 25, 23),
+(7, 6, 11, 32, 31, 33, 25, 23),
+(7, 6, 12, 33, 32, 34, 25, 23),
+(7, 6, 13, 34, 33, 36, 25, 24),
+(7, 6, 14, 36, 34, 37, 25, 24),
+(7, 6, 15, 37, 35, 38, 25, 24),
+(7, 6, 16, 39, 36, 40, 25, 25),
+(7, 6, 17, 40, 36, 41, 25, 25),
+(7, 6, 18, 42, 37, 43, 26, 25),
+(7, 6, 19, 43, 38, 44, 26, 26),
+(7, 6, 20, 45, 39, 45, 26, 26),
+(7, 6, 21, 47, 40, 47, 26, 26),
+(7, 6, 22, 48, 41, 48, 26, 27),
+(7, 6, 23, 50, 42, 50, 26, 27),
+(7, 6, 24, 51, 43, 51, 26, 28),
+(7, 6, 25, 53, 44, 52, 27, 28),
+(7, 6, 26, 55, 45, 54, 27, 28),
+(7, 6, 27, 56, 46, 55, 27, 29),
+(7, 6, 28, 58, 47, 57, 27, 29),
+(7, 6, 29, 59, 48, 58, 27, 30),
+(7, 6, 30, 61, 49, 60, 27, 30),
+(7, 6, 31, 63, 50, 62, 27, 30),
+(7, 6, 32, 65, 51, 63, 28, 31),
+(7, 6, 33, 66, 52, 65, 28, 31),
+(7, 6, 34, 68, 53, 66, 28, 32),
+(7, 6, 35, 70, 55, 68, 28, 32),
+(7, 6, 36, 72, 56, 69, 28, 33),
+(7, 6, 37, 73, 57, 71, 29, 33),
+(7, 6, 38, 75, 58, 73, 29, 34),
+(7, 6, 39, 77, 59, 74, 29, 34),
+(7, 6, 40, 79, 60, 76, 29, 35),
+(7, 6, 41, 81, 61, 78, 29, 35),
+(7, 6, 42, 82, 62, 79, 30, 35),
+(7, 6, 43, 84, 64, 81, 30, 36),
+(7, 6, 44, 86, 65, 83, 30, 36),
+(7, 6, 45, 88, 66, 85, 30, 37),
+(7, 6, 46, 90, 67, 86, 30, 37),
+(7, 6, 47, 92, 68, 88, 31, 38),
+(7, 6, 48, 94, 70, 90, 31, 38),
+(7, 6, 49, 96, 71, 92, 31, 39),
+(7, 6, 50, 98, 72, 93, 31, 40),
+(7, 6, 51, 99, 72, 93, 32, 40),
+(7, 6, 52, 100, 73, 95, 32, 41),
+(7, 6, 53, 101, 74, 96, 32, 41),
+(7, 6, 54, 102, 75, 97, 32, 42),
+(7, 6, 55, 103, 76, 98, 33, 42),
+(7, 6, 56, 106, 78, 101, 33, 43),
+(7, 6, 57, 111, 79, 103, 33, 43),
+(7, 6, 58, 113, 80, 105, 34, 44),
+(7, 6, 59, 116, 82, 107, 34, 44),
+(7, 6, 60, 118, 83, 109, 34, 45),
+(7, 6, 61, 120, 84, 111, 34, 46),
+(7, 6, 62, 127, 86, 119, 34, 46),
+(7, 6, 63, 129, 87, 122, 35, 47),
+(7, 6, 64, 132, 89, 125, 35, 47),
+(7, 6, 65, 135, 90, 127, 35, 48),
+(7, 6, 66, 137, 92, 130, 35, 49),
+(7, 6, 67, 138, 93, 130, 36, 49),
+(7, 6, 68, 140, 95, 131, 36, 50),
+(7, 6, 69, 142, 96, 131, 36, 51),
+(7, 6, 70, 145, 98, 132, 36, 51),
+(7, 6, 71, 148, 100, 135, 37, 52),
+(7, 6, 72, 150, 101, 137, 37, 53),
+(7, 6, 73, 153, 103, 140, 37, 54),
+(7, 6, 74, 154, 105, 142, 37, 54),
+(7, 6, 75, 155, 106, 145, 38, 55),
+(7, 6, 76, 158, 108, 151, 38, 56),
+(7, 6, 77, 161, 110, 157, 38, 57),
+(7, 6, 78, 164, 111, 162, 38, 57),
+(7, 6, 79, 167, 113, 165, 39, 58),
+(7, 6, 80, 170, 115, 168, 39, 59),
+(7, 8, 1, 15, 23, 19, 27, 22),
+(7, 8, 2, 15, 23, 19, 28, 23),
+(7, 8, 3, 15, 23, 20, 30, 25),
+(7, 8, 4, 15, 23, 20, 31, 26),
+(7, 8, 5, 15, 24, 20, 32, 27),
+(7, 8, 6, 15, 24, 20, 34, 29),
+(7, 8, 7, 16, 24, 21, 35, 30),
+(7, 8, 8, 16, 24, 21, 37, 31),
+(7, 8, 9, 16, 24, 21, 38, 33),
+(7, 8, 10, 16, 24, 22, 40, 34),
+(7, 8, 11, 16, 25, 22, 41, 36),
+(7, 8, 12, 16, 25, 22, 42, 37),
+(7, 8, 13, 16, 25, 23, 44, 38),
+(7, 8, 14, 16, 25, 23, 45, 40),
+(7, 8, 15, 17, 25, 23, 47, 41),
+(7, 8, 16, 17, 25, 24, 49, 43),
+(7, 8, 17, 17, 26, 24, 50, 44),
+(7, 8, 18, 17, 26, 24, 52, 46),
+(7, 8, 19, 17, 26, 25, 53, 47),
+(7, 8, 20, 17, 26, 25, 55, 49),
+(7, 8, 21, 17, 26, 26, 57, 51),
+(7, 8, 22, 18, 27, 26, 58, 52),
+(7, 8, 23, 18, 27, 26, 60, 54),
+(7, 8, 24, 18, 27, 27, 61, 55),
+(7, 8, 25, 18, 27, 27, 63, 57),
+(7, 8, 26, 18, 28, 27, 65, 59),
+(7, 8, 27, 18, 28, 28, 67, 60),
+(7, 8, 28, 18, 28, 28, 68, 62),
+(7, 8, 29, 19, 28, 29, 70, 64),
+(7, 8, 30, 19, 29, 29, 72, 65),
+(7, 8, 31, 19, 29, 30, 74, 67),
+(7, 8, 32, 19, 29, 30, 75, 69),
+(7, 8, 33, 19, 29, 30, 77, 70),
+(7, 8, 34, 20, 30, 31, 79, 72),
+(7, 8, 35, 20, 30, 31, 81, 74),
+(7, 8, 36, 20, 30, 32, 83, 76),
+(7, 8, 37, 20, 30, 32, 85, 78),
+(7, 8, 38, 20, 31, 33, 86, 79),
+(7, 8, 39, 21, 31, 33, 88, 81),
+(7, 8, 40, 21, 31, 34, 90, 83),
+(7, 8, 41, 21, 32, 34, 92, 85),
+(7, 8, 42, 21, 32, 35, 94, 87),
+(7, 8, 43, 21, 32, 35, 96, 89),
+(7, 8, 44, 22, 32, 36, 98, 91),
+(7, 8, 45, 22, 33, 36, 100, 92),
+(7, 8, 46, 22, 33, 37, 102, 94),
+(7, 8, 47, 22, 33, 37, 104, 96),
+(7, 8, 48, 22, 34, 38, 106, 98),
+(7, 8, 49, 23, 34, 38, 108, 100),
+(7, 8, 50, 23, 34, 39, 110, 102),
+(7, 8, 51, 23, 35, 39, 112, 104),
+(7, 8, 52, 23, 35, 40, 114, 106),
+(7, 8, 53, 24, 35, 40, 117, 108),
+(7, 8, 54, 24, 36, 41, 119, 110),
+(7, 8, 55, 24, 36, 41, 121, 112),
+(7, 8, 56, 24, 37, 42, 123, 114),
+(7, 8, 57, 25, 37, 42, 125, 117),
+(7, 8, 58, 25, 37, 43, 127, 119),
+(7, 8, 59, 25, 38, 43, 130, 121),
+(7, 8, 60, 25, 38, 44, 132, 123),
+(7, 8, 61, 26, 38, 45, 134, 125),
+(7, 8, 62, 26, 39, 45, 136, 127),
+(7, 8, 63, 26, 39, 46, 139, 129),
+(7, 8, 64, 26, 40, 46, 141, 132),
+(7, 8, 65, 27, 40, 47, 143, 134),
+(7, 8, 66, 27, 40, 48, 146, 136),
+(7, 8, 67, 27, 41, 48, 148, 138),
+(7, 8, 68, 27, 41, 49, 150, 140),
+(7, 8, 69, 28, 42, 49, 153, 143),
+(7, 8, 70, 28, 42, 50, 155, 145),
+(7, 8, 71, 28, 42, 51, 168, 148),
+(7, 8, 72, 28, 43, 52, 168, 151),
+(7, 8, 73, 28, 43, 53, 171, 154),
+(7, 8, 74, 29, 44, 53, 174, 156),
+(7, 8, 75, 29, 44, 54, 177, 159),
+(7, 8, 76, 29, 44, 55, 180, 162),
+(7, 8, 77, 30, 45, 56, 183, 165),
+(7, 8, 78, 30, 45, 56, 186, 168),
+(7, 8, 79, 30, 46, 57, 190, 171),
+(7, 8, 80, 31, 46, 58, 193, 174),
+(7, 9, 1, 15, 23, 20, 26, 22),
+(7, 9, 2, 15, 23, 21, 27, 23),
+(7, 9, 3, 16, 24, 21, 28, 24),
+(7, 9, 4, 16, 24, 22, 29, 25),
+(7, 9, 5, 16, 24, 22, 31, 27),
+(7, 9, 6, 17, 25, 23, 32, 28),
+(7, 9, 7, 17, 25, 23, 33, 29),
+(7, 9, 8, 17, 26, 24, 34, 30),
+(7, 9, 9, 17, 26, 25, 36, 31),
+(7, 9, 10, 18, 26, 25, 37, 33),
+(7, 9, 11, 18, 27, 26, 38, 34),
+(7, 9, 12, 18, 27, 26, 39, 35),
+(7, 9, 13, 19, 28, 27, 41, 36),
+(7, 9, 14, 19, 28, 28, 42, 38),
+(7, 9, 15, 20, 28, 28, 43, 39),
+(7, 9, 16, 20, 29, 29, 45, 40),
+(7, 9, 17, 20, 29, 30, 46, 42),
+(7, 9, 18, 21, 30, 30, 47, 43),
+(7, 9, 19, 21, 30, 31, 49, 44),
+(7, 9, 20, 21, 31, 32, 50, 46),
+(7, 9, 21, 22, 31, 32, 51, 47),
+(7, 9, 22, 22, 31, 33, 53, 49),
+(7, 9, 23, 23, 32, 34, 54, 50),
+(7, 9, 24, 23, 32, 34, 56, 51),
+(7, 9, 25, 23, 33, 35, 57, 53),
+(7, 9, 26, 24, 33, 36, 59, 54),
+(7, 9, 27, 24, 34, 37, 60, 56),
+(7, 9, 28, 25, 34, 37, 62, 57),
+(7, 9, 29, 25, 35, 38, 63, 59),
+(7, 9, 30, 25, 35, 39, 65, 60),
+(7, 9, 31, 26, 36, 40, 66, 62),
+(7, 9, 32, 26, 36, 40, 68, 63),
+(7, 9, 33, 27, 37, 41, 69, 65),
+(7, 9, 34, 27, 38, 42, 71, 66),
+(7, 9, 35, 28, 38, 43, 73, 68),
+(7, 9, 36, 28, 39, 43, 74, 69),
+(7, 9, 37, 28, 39, 44, 76, 71),
+(7, 9, 38, 29, 40, 45, 77, 73),
+(7, 9, 39, 29, 40, 46, 79, 74),
+(7, 9, 40, 30, 41, 47, 81, 76),
+(7, 9, 41, 30, 41, 48, 82, 78),
+(7, 9, 42, 31, 42, 48, 84, 79),
+(7, 9, 43, 31, 43, 49, 86, 81),
+(7, 9, 44, 32, 43, 50, 88, 83),
+(7, 9, 45, 32, 44, 51, 89, 84),
+(7, 9, 46, 33, 44, 52, 91, 86),
+(7, 9, 47, 33, 45, 53, 93, 88),
+(7, 9, 48, 34, 46, 54, 95, 89),
+(7, 9, 49, 34, 46, 54, 96, 91),
+(7, 9, 50, 35, 47, 55, 98, 93),
+(7, 9, 51, 35, 48, 56, 100, 95),
+(7, 9, 52, 36, 48, 57, 102, 97);
+INSERT IGNORE INTO `player_levelstats` (`race`, `class`, `level`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES
+(7, 9, 53, 36, 49, 58, 104, 98),
+(7, 9, 54, 37, 50, 59, 105, 100),
+(7, 9, 55, 37, 50, 60, 107, 102),
+(7, 9, 56, 38, 51, 61, 109, 104),
+(7, 9, 57, 38, 52, 62, 111, 106),
+(7, 9, 58, 39, 52, 63, 113, 108),
+(7, 9, 59, 40, 53, 64, 115, 109),
+(7, 9, 60, 40, 54, 65, 117, 111),
+(7, 9, 61, 41, 54, 66, 119, 113),
+(7, 9, 62, 41, 55, 67, 121, 115),
+(7, 9, 63, 42, 56, 68, 123, 117),
+(7, 9, 64, 42, 57, 69, 125, 119),
+(7, 9, 65, 43, 57, 70, 127, 121),
+(7, 9, 66, 44, 58, 71, 129, 123),
+(7, 9, 67, 44, 59, 72, 131, 125),
+(7, 9, 68, 45, 59, 73, 133, 127),
+(7, 9, 69, 45, 60, 74, 135, 129),
+(7, 9, 70, 46, 61, 75, 137, 131),
+(7, 9, 71, 47, 62, 84, 147, 142),
+(7, 9, 72, 48, 62, 85, 148, 144),
+(7, 9, 73, 49, 63, 85, 153, 147),
+(7, 9, 74, 49, 64, 88, 153, 150),
+(7, 9, 75, 50, 65, 90, 155, 152),
+(7, 9, 76, 51, 66, 91, 158, 155),
+(7, 9, 77, 52, 67, 92, 161, 158),
+(7, 9, 78, 52, 68, 93, 163, 161),
+(7, 9, 79, 53, 69, 95, 166, 164),
+(7, 9, 80, 54, 70, 96, 170, 166),
+(8, 1, 1, 24, 22, 23, 16, 21),
+(8, 1, 2, 25, 23, 24, 16, 21),
+(8, 1, 3, 27, 24, 25, 16, 22),
+(8, 1, 4, 28, 24, 26, 16, 22),
+(8, 1, 5, 29, 25, 28, 16, 22),
+(8, 1, 6, 31, 26, 29, 16, 22),
+(8, 1, 7, 32, 27, 30, 17, 23),
+(8, 1, 8, 33, 28, 31, 17, 23),
+(8, 1, 9, 35, 28, 33, 17, 23),
+(8, 1, 10, 36, 29, 34, 17, 24),
+(8, 1, 11, 37, 30, 35, 17, 24),
+(8, 1, 12, 39, 31, 36, 17, 24),
+(8, 1, 13, 40, 32, 38, 17, 25),
+(8, 1, 14, 42, 33, 39, 17, 25),
+(8, 1, 15, 43, 34, 40, 18, 25),
+(8, 1, 16, 45, 35, 42, 18, 26),
+(8, 1, 17, 46, 35, 43, 18, 26),
+(8, 1, 18, 48, 36, 44, 18, 26),
+(8, 1, 19, 49, 37, 46, 18, 27),
+(8, 1, 20, 51, 38, 47, 18, 27),
+(8, 1, 21, 52, 39, 49, 18, 27),
+(8, 1, 22, 54, 40, 50, 18, 28),
+(8, 1, 23, 55, 41, 51, 19, 28),
+(8, 1, 24, 57, 42, 53, 19, 29),
+(8, 1, 25, 59, 43, 54, 19, 29),
+(8, 1, 26, 60, 44, 56, 19, 29),
+(8, 1, 27, 62, 45, 57, 19, 30),
+(8, 1, 28, 63, 46, 59, 19, 30),
+(8, 1, 29, 65, 47, 60, 20, 31),
+(8, 1, 30, 67, 48, 62, 20, 31),
+(8, 1, 31, 69, 49, 63, 20, 31),
+(8, 1, 32, 70, 50, 65, 20, 32),
+(8, 1, 33, 72, 51, 67, 20, 32),
+(8, 1, 34, 74, 53, 68, 20, 33),
+(8, 1, 35, 75, 54, 70, 21, 33),
+(8, 1, 36, 77, 55, 71, 21, 34),
+(8, 1, 37, 79, 56, 73, 21, 34),
+(8, 1, 38, 81, 57, 75, 21, 35),
+(8, 1, 39, 83, 58, 76, 21, 35),
+(8, 1, 40, 84, 59, 78, 22, 35),
+(8, 1, 41, 86, 60, 80, 22, 36),
+(8, 1, 42, 88, 62, 81, 22, 36),
+(8, 1, 43, 90, 63, 83, 22, 37),
+(8, 1, 44, 92, 64, 85, 22, 37),
+(8, 1, 45, 94, 65, 86, 23, 38),
+(8, 1, 46, 96, 66, 88, 23, 38),
+(8, 1, 47, 98, 67, 90, 23, 39),
+(8, 1, 48, 100, 69, 92, 23, 39),
+(8, 1, 49, 102, 70, 93, 24, 40),
+(8, 1, 50, 103, 71, 95, 24, 40),
+(8, 1, 51, 105, 72, 97, 24, 41),
+(8, 1, 52, 107, 74, 99, 24, 42),
+(8, 1, 53, 109, 75, 101, 25, 42),
+(8, 1, 54, 112, 76, 103, 25, 43),
+(8, 1, 55, 114, 78, 104, 25, 43),
+(8, 1, 56, 116, 79, 106, 25, 44),
+(8, 1, 57, 118, 80, 108, 25, 44),
+(8, 1, 58, 120, 81, 110, 26, 45),
+(8, 1, 59, 122, 83, 112, 26, 45),
+(8, 1, 60, 124, 84, 114, 26, 46),
+(8, 1, 61, 126, 85, 116, 27, 47),
+(8, 1, 62, 128, 87, 118, 27, 47),
+(8, 1, 63, 130, 88, 120, 27, 48),
+(8, 1, 64, 133, 90, 122, 27, 48),
+(8, 1, 65, 135, 91, 124, 28, 49),
+(8, 1, 66, 137, 92, 126, 28, 50),
+(8, 1, 67, 139, 94, 128, 28, 50),
+(8, 1, 68, 141, 95, 130, 28, 51),
+(8, 1, 69, 144, 97, 132, 29, 51),
+(8, 1, 70, 146, 98, 134, 29, 52),
+(8, 1, 71, 149, 99, 136, 29, 53),
+(8, 1, 72, 151, 101, 139, 29, 54),
+(8, 1, 73, 154, 103, 141, 29, 55),
+(8, 1, 74, 157, 104, 144, 30, 55),
+(8, 1, 75, 166, 106, 151, 30, 56),
+(8, 1, 76, 172, 108, 157, 30, 57),
+(8, 1, 77, 175, 110, 161, 31, 58),
+(8, 1, 78, 179, 111, 163, 31, 58),
+(8, 1, 79, 182, 113, 164, 31, 59),
+(8, 1, 80, 185, 115, 169, 32, 60),
+(8, 3, 1, 21, 25, 22, 16, 22),
+(8, 3, 2, 21, 26, 23, 17, 23),
+(8, 3, 3, 22, 28, 24, 17, 23),
+(8, 3, 4, 22, 29, 25, 18, 24),
+(8, 3, 5, 23, 30, 26, 18, 25),
+(8, 3, 6, 23, 32, 27, 19, 25),
+(8, 3, 7, 24, 33, 28, 20, 26),
+(8, 3, 8, 24, 35, 28, 20, 26),
+(8, 3, 9, 25, 36, 29, 21, 27),
+(8, 3, 10, 25, 38, 30, 21, 28),
+(8, 3, 11, 25, 39, 31, 22, 29),
+(8, 3, 12, 26, 41, 32, 23, 29),
+(8, 3, 13, 26, 42, 33, 23, 30),
+(8, 3, 14, 27, 44, 34, 24, 31),
+(8, 3, 15, 27, 45, 35, 25, 31),
+(8, 3, 16, 28, 47, 36, 25, 32),
+(8, 3, 17, 28, 48, 38, 26, 33),
+(8, 3, 18, 29, 50, 39, 27, 34),
+(8, 3, 19, 29, 51, 40, 28, 34),
+(8, 3, 20, 30, 53, 41, 28, 35),
+(8, 3, 21, 31, 55, 42, 29, 36),
+(8, 3, 22, 31, 56, 43, 30, 37),
+(8, 3, 23, 32, 58, 44, 30, 37),
+(8, 3, 24, 32, 60, 45, 31, 38),
+(8, 3, 25, 33, 61, 46, 32, 39),
+(8, 3, 26, 33, 63, 48, 33, 40),
+(8, 3, 27, 34, 65, 49, 33, 41),
+(8, 3, 28, 35, 66, 50, 34, 41),
+(8, 3, 29, 35, 68, 51, 35, 42),
+(8, 3, 30, 36, 70, 52, 36, 43),
+(8, 3, 31, 36, 72, 53, 37, 44),
+(8, 3, 32, 37, 73, 55, 37, 45),
+(8, 3, 33, 38, 75, 56, 38, 46),
+(8, 3, 34, 38, 77, 57, 39, 47),
+(8, 3, 35, 39, 79, 58, 40, 48),
+(8, 3, 36, 39, 81, 60, 41, 48),
+(8, 3, 37, 40, 83, 61, 41, 49),
+(8, 3, 38, 41, 85, 62, 42, 50),
+(8, 3, 39, 41, 86, 63, 43, 51),
+(8, 3, 40, 42, 88, 65, 44, 52),
+(8, 3, 41, 43, 90, 66, 45, 53),
+(8, 3, 42, 43, 92, 67, 46, 54),
+(8, 3, 43, 44, 94, 69, 47, 55),
+(8, 3, 44, 45, 96, 70, 47, 56),
+(8, 3, 45, 45, 98, 71, 48, 57),
+(8, 3, 46, 46, 100, 73, 49, 58),
+(8, 3, 47, 47, 102, 74, 50, 59),
+(8, 3, 48, 48, 104, 76, 51, 60),
+(8, 3, 49, 48, 106, 77, 52, 61),
+(8, 3, 50, 49, 108, 78, 53, 62),
+(8, 3, 51, 50, 110, 80, 54, 63),
+(8, 3, 52, 51, 113, 81, 55, 64),
+(8, 3, 53, 51, 115, 83, 56, 65),
+(8, 3, 54, 52, 117, 84, 57, 66),
+(8, 3, 55, 53, 119, 86, 58, 67),
+(8, 3, 56, 54, 121, 87, 59, 68),
+(8, 3, 57, 54, 123, 89, 60, 69),
+(8, 3, 58, 55, 126, 90, 61, 70),
+(8, 3, 59, 56, 128, 92, 62, 71),
+(8, 3, 60, 57, 130, 93, 63, 73),
+(8, 3, 61, 58, 132, 95, 64, 74),
+(8, 3, 62, 58, 134, 96, 65, 75),
+(8, 3, 63, 59, 137, 98, 66, 76),
+(8, 3, 64, 60, 139, 99, 67, 77),
+(8, 3, 65, 61, 141, 101, 68, 78),
+(8, 3, 66, 62, 144, 103, 69, 79),
+(8, 3, 67, 62, 146, 104, 70, 80),
+(8, 3, 68, 63, 148, 106, 71, 82),
+(8, 3, 69, 64, 151, 107, 72, 83),
+(8, 3, 70, 65, 153, 109, 73, 84),
+(8, 3, 71, 66, 156, 111, 74, 85),
+(8, 3, 72, 67, 159, 113, 75, 86),
+(8, 3, 73, 68, 162, 115, 76, 88),
+(8, 3, 74, 69, 165, 117, 78, 89),
+(8, 3, 75, 70, 174, 119, 82, 91),
+(8, 3, 76, 71, 177, 121, 83, 92),
+(8, 3, 77, 72, 180, 123, 85, 94),
+(8, 3, 78, 73, 184, 125, 86, 95),
+(8, 3, 79, 74, 187, 127, 87, 97),
+(8, 3, 80, 75, 190, 129, 89, 98),
+(8, 4, 1, 22, 25, 22, 16, 21),
+(8, 4, 2, 23, 26, 23, 16, 21),
+(8, 4, 3, 24, 28, 23, 16, 22),
+(8, 4, 4, 24, 29, 24, 16, 22),
+(8, 4, 5, 25, 31, 25, 17, 22),
+(8, 4, 6, 26, 32, 25, 17, 23),
+(8, 4, 7, 27, 34, 26, 17, 23),
+(8, 4, 8, 27, 35, 27, 17, 24),
+(8, 4, 9, 28, 37, 28, 17, 24),
+(8, 4, 10, 29, 38, 28, 18, 24),
+(8, 4, 11, 30, 40, 29, 18, 25),
+(8, 4, 12, 31, 41, 30, 18, 25),
+(8, 4, 13, 32, 43, 31, 18, 26),
+(8, 4, 14, 32, 45, 32, 18, 26),
+(8, 4, 15, 33, 46, 32, 19, 26),
+(8, 4, 16, 34, 48, 33, 19, 27),
+(8, 4, 17, 35, 50, 34, 19, 27),
+(8, 4, 18, 36, 51, 35, 19, 28),
+(8, 4, 19, 37, 53, 36, 19, 28),
+(8, 4, 20, 38, 55, 36, 20, 29),
+(8, 4, 21, 39, 56, 37, 20, 29),
+(8, 4, 22, 40, 58, 38, 20, 30),
+(8, 4, 23, 41, 60, 39, 20, 30),
+(8, 4, 24, 42, 62, 40, 20, 31),
+(8, 4, 25, 43, 63, 41, 21, 31),
+(8, 4, 26, 44, 65, 42, 21, 32),
+(8, 4, 27, 45, 67, 43, 21, 32),
+(8, 4, 28, 46, 69, 44, 21, 33),
+(8, 4, 29, 47, 71, 44, 22, 33),
+(8, 4, 30, 48, 72, 45, 22, 34),
+(8, 4, 31, 49, 74, 46, 22, 34),
+(8, 4, 32, 50, 76, 47, 22, 35),
+(8, 4, 33, 51, 78, 48, 23, 35),
+(8, 4, 34, 52, 80, 49, 23, 36),
+(8, 4, 35, 53, 82, 50, 23, 36),
+(8, 4, 36, 54, 84, 51, 24, 37),
+(8, 4, 37, 55, 86, 52, 24, 37),
+(8, 4, 38, 56, 88, 53, 24, 38),
+(8, 4, 39, 57, 90, 54, 24, 38),
+(8, 4, 40, 58, 92, 55, 25, 39),
+(8, 4, 41, 59, 94, 56, 25, 40),
+(8, 4, 42, 60, 96, 57, 25, 40),
+(8, 4, 43, 62, 98, 58, 26, 41),
+(8, 4, 44, 63, 100, 59, 26, 41),
+(8, 4, 45, 64, 102, 60, 26, 42),
+(8, 4, 46, 65, 104, 61, 27, 43),
+(8, 4, 47, 66, 107, 63, 27, 43),
+(8, 4, 48, 67, 109, 64, 27, 44),
+(8, 4, 49, 69, 111, 65, 27, 44),
+(8, 4, 50, 70, 113, 66, 28, 45),
+(8, 4, 51, 71, 115, 67, 28, 46),
+(8, 4, 52, 72, 117, 68, 28, 46),
+(8, 4, 53, 74, 120, 69, 29, 47),
+(8, 4, 54, 75, 122, 70, 29, 48),
+(8, 4, 55, 76, 124, 72, 29, 48),
+(8, 4, 56, 77, 126, 73, 30, 49),
+(8, 4, 57, 79, 129, 74, 30, 50),
+(8, 4, 58, 80, 131, 75, 30, 50),
+(8, 4, 59, 81, 133, 76, 31, 51),
+(8, 4, 60, 82, 136, 77, 31, 52),
+(8, 4, 61, 84, 138, 79, 32, 52),
+(8, 4, 62, 85, 140, 80, 32, 53),
+(8, 4, 63, 86, 143, 81, 32, 54),
+(8, 4, 64, 88, 145, 82, 33, 55),
+(8, 4, 65, 89, 148, 84, 33, 55),
+(8, 4, 66, 90, 150, 85, 33, 56),
+(8, 4, 67, 92, 153, 86, 34, 57),
+(8, 4, 68, 93, 155, 87, 34, 58),
+(8, 4, 69, 95, 157, 89, 35, 58),
+(8, 4, 70, 96, 160, 90, 35, 59),
+(8, 4, 71, 98, 163, 94, 35, 60),
+(8, 4, 72, 100, 166, 96, 36, 60),
+(8, 4, 73, 101, 169, 96, 36, 61),
+(8, 4, 74, 103, 172, 97, 37, 62),
+(8, 4, 75, 105, 175, 98, 37, 63),
+(8, 4, 76, 106, 178, 99, 37, 64),
+(8, 4, 77, 108, 181, 105, 38, 65),
+(8, 4, 78, 110, 185, 107, 38, 66),
+(8, 4, 79, 112, 188, 109, 39, 67),
+(8, 4, 80, 114, 191, 110, 39, 68),
+(8, 5, 1, 21, 22, 21, 18, 24),
+(8, 5, 2, 21, 22, 21, 19, 25),
+(8, 5, 3, 21, 22, 22, 21, 27),
+(8, 5, 4, 21, 23, 22, 22, 28),
+(8, 5, 5, 22, 23, 22, 23, 29),
+(8, 5, 6, 22, 23, 23, 25, 31),
+(8, 5, 7, 22, 23, 23, 26, 32),
+(8, 5, 8, 22, 24, 24, 27, 34),
+(8, 5, 9, 22, 24, 24, 29, 35),
+(8, 5, 10, 22, 24, 24, 30, 37),
+(8, 5, 11, 23, 24, 25, 32, 38),
+(8, 5, 12, 23, 24, 25, 33, 40),
+(8, 5, 13, 23, 25, 26, 35, 41),
+(8, 5, 14, 23, 25, 26, 36, 43),
+(8, 5, 15, 23, 25, 26, 38, 44),
+(8, 5, 16, 24, 26, 27, 39, 46),
+(8, 5, 17, 24, 26, 27, 41, 47),
+(8, 5, 18, 24, 26, 28, 42, 49),
+(8, 5, 19, 24, 26, 28, 44, 50),
+(8, 5, 20, 24, 27, 29, 45, 52),
+(8, 5, 21, 25, 27, 29, 47, 54),
+(8, 5, 22, 25, 27, 30, 48, 55),
+(8, 5, 23, 25, 28, 30, 50, 57),
+(8, 5, 24, 25, 28, 31, 52, 59),
+(8, 5, 25, 25, 28, 31, 53, 60),
+(8, 5, 26, 26, 28, 32, 55, 62),
+(8, 5, 27, 26, 29, 32, 56, 64),
+(8, 5, 28, 26, 29, 33, 58, 65),
+(8, 5, 29, 26, 29, 33, 60, 67),
+(8, 5, 30, 27, 30, 34, 62, 69),
+(8, 5, 31, 27, 30, 34, 63, 71),
+(8, 5, 32, 27, 30, 35, 65, 73),
+(8, 5, 33, 27, 31, 35, 67, 74),
+(8, 5, 34, 28, 31, 36, 68, 76),
+(8, 5, 35, 28, 32, 36, 70, 78),
+(8, 5, 36, 28, 32, 37, 72, 80),
+(8, 5, 37, 29, 32, 37, 74, 82),
+(8, 5, 38, 29, 33, 38, 76, 84),
+(8, 5, 39, 29, 33, 38, 77, 86),
+(8, 5, 40, 29, 33, 39, 79, 87),
+(8, 5, 41, 30, 34, 40, 81, 89),
+(8, 5, 42, 30, 34, 40, 83, 91),
+(8, 5, 43, 30, 35, 41, 85, 93),
+(8, 5, 44, 31, 35, 41, 87, 95),
+(8, 5, 45, 31, 35, 42, 89, 97),
+(8, 5, 46, 31, 36, 43, 91, 99),
+(8, 5, 47, 32, 36, 43, 93, 101),
+(8, 5, 48, 32, 37, 44, 94, 103),
+(8, 5, 49, 32, 37, 44, 96, 105),
+(8, 5, 50, 33, 37, 45, 98, 107),
+(8, 5, 51, 33, 38, 46, 100, 110),
+(8, 5, 52, 33, 38, 46, 102, 112),
+(8, 5, 53, 34, 39, 47, 104, 114),
+(8, 5, 54, 34, 39, 48, 106, 116),
+(8, 5, 55, 34, 40, 48, 109, 118),
+(8, 5, 56, 35, 40, 49, 111, 120),
+(8, 5, 57, 35, 41, 50, 113, 122),
+(8, 5, 58, 35, 41, 50, 115, 125),
+(8, 5, 59, 36, 42, 51, 117, 127),
+(8, 5, 60, 36, 42, 52, 119, 129),
+(8, 5, 61, 36, 42, 52, 121, 131),
+(8, 5, 62, 37, 43, 53, 123, 133),
+(8, 5, 63, 37, 43, 54, 125, 136),
+(8, 5, 64, 38, 44, 55, 128, 138),
+(8, 5, 65, 38, 44, 55, 130, 140),
+(8, 5, 66, 38, 45, 56, 132, 143),
+(8, 5, 67, 39, 45, 57, 134, 145),
+(8, 5, 68, 39, 46, 58, 136, 147),
+(8, 5, 69, 40, 46, 58, 139, 150),
+(8, 5, 70, 40, 47, 59, 141, 152),
+(8, 5, 71, 40, 48, 60, 144, 155),
+(8, 5, 72, 41, 48, 60, 147, 158),
+(8, 5, 73, 41, 49, 61, 150, 161),
+(8, 5, 74, 42, 49, 62, 152, 164),
+(8, 5, 75, 42, 50, 63, 155, 167),
+(8, 5, 76, 42, 51, 64, 158, 170),
+(8, 5, 77, 43, 51, 65, 161, 173),
+(8, 5, 78, 43, 52, 66, 164, 176),
+(8, 5, 79, 44, 52, 67, 167, 179),
+(8, 5, 80, 44, 53, 68, 170, 182),
+(8, 6, 1, 24, 22, 23, 16, 21),
+(8, 6, 2, 25, 23, 24, 16, 21),
+(8, 6, 3, 27, 24, 25, 16, 22),
+(8, 6, 4, 28, 24, 26, 16, 22),
+(8, 6, 5, 29, 25, 28, 16, 22),
+(8, 6, 6, 31, 26, 29, 16, 22),
+(8, 6, 7, 32, 27, 30, 17, 23),
+(8, 6, 8, 33, 28, 31, 17, 23),
+(8, 6, 9, 35, 28, 33, 17, 23),
+(8, 6, 10, 36, 29, 34, 17, 24),
+(8, 6, 11, 37, 30, 35, 17, 24),
+(8, 6, 12, 39, 31, 36, 17, 24),
+(8, 6, 13, 40, 32, 38, 17, 25),
+(8, 6, 14, 42, 33, 39, 17, 25),
+(8, 6, 15, 43, 34, 40, 18, 25),
+(8, 6, 16, 45, 35, 42, 18, 26),
+(8, 6, 17, 46, 35, 43, 18, 26),
+(8, 6, 18, 48, 36, 44, 18, 26),
+(8, 6, 19, 49, 37, 46, 18, 27),
+(8, 6, 20, 51, 38, 47, 18, 27),
+(8, 6, 21, 52, 39, 49, 18, 27),
+(8, 6, 22, 54, 40, 50, 18, 28),
+(8, 6, 23, 55, 41, 51, 19, 28),
+(8, 6, 24, 57, 42, 53, 19, 29),
+(8, 6, 25, 59, 43, 54, 19, 29),
+(8, 6, 26, 60, 44, 56, 19, 29),
+(8, 6, 27, 62, 45, 57, 19, 30),
+(8, 6, 28, 63, 46, 59, 19, 30),
+(8, 6, 29, 65, 47, 60, 20, 31),
+(8, 6, 30, 67, 48, 62, 20, 31),
+(8, 6, 31, 69, 49, 63, 20, 31),
+(8, 6, 32, 70, 50, 65, 20, 32),
+(8, 6, 33, 72, 51, 67, 20, 32),
+(8, 6, 34, 74, 53, 68, 20, 33),
+(8, 6, 35, 75, 54, 70, 21, 33),
+(8, 6, 36, 77, 55, 71, 21, 34),
+(8, 6, 37, 79, 56, 73, 21, 34),
+(8, 6, 38, 81, 57, 75, 21, 35),
+(8, 6, 39, 83, 58, 76, 21, 35),
+(8, 6, 40, 84, 59, 78, 22, 35),
+(8, 6, 41, 86, 60, 80, 22, 36),
+(8, 6, 42, 88, 62, 81, 22, 36),
+(8, 6, 43, 90, 63, 83, 22, 37),
+(8, 6, 44, 92, 64, 85, 22, 37),
+(8, 6, 45, 94, 65, 86, 23, 38),
+(8, 6, 46, 96, 66, 88, 23, 38),
+(8, 6, 47, 98, 67, 90, 23, 39),
+(8, 6, 48, 100, 69, 92, 23, 39),
+(8, 6, 49, 102, 70, 93, 24, 40),
+(8, 6, 50, 103, 71, 95, 24, 40),
+(8, 6, 51, 105, 72, 96, 24, 41),
+(8, 6, 52, 106, 74, 97, 24, 42),
+(8, 6, 53, 107, 73, 98, 25, 42),
+(8, 6, 54, 108, 74, 99, 25, 43),
+(8, 6, 55, 109, 75, 100, 25, 43),
+(8, 6, 56, 112, 77, 103, 25, 44),
+(8, 6, 57, 114, 78, 105, 25, 44),
+(8, 6, 58, 118, 79, 107, 26, 45),
+(8, 6, 59, 119, 81, 109, 26, 45),
+(8, 6, 60, 121, 82, 111, 26, 46),
+(8, 6, 61, 123, 83, 113, 26, 47),
+(8, 6, 62, 126, 85, 115, 26, 47),
+(8, 6, 63, 128, 86, 118, 27, 48),
+(8, 6, 64, 131, 88, 120, 27, 48),
+(8, 6, 65, 138, 89, 122, 27, 49),
+(8, 6, 66, 140, 91, 125, 27, 50),
+(8, 6, 67, 143, 92, 127, 28, 50),
+(8, 6, 68, 145, 94, 129, 28, 51),
+(8, 6, 69, 148, 95, 132, 28, 52),
+(8, 6, 70, 151, 97, 134, 28, 52),
+(8, 6, 71, 154, 99, 137, 29, 53),
+(8, 6, 72, 156, 100, 139, 29, 54),
+(8, 6, 73, 159, 102, 142, 29, 55),
+(8, 6, 74, 162, 104, 144, 29, 55),
+(8, 6, 75, 165, 105, 147, 30, 56),
+(8, 6, 76, 168, 107, 150, 30, 57),
+(8, 6, 77, 169, 109, 153, 30, 58),
+(8, 6, 78, 170, 110, 155, 30, 58),
+(8, 6, 79, 178, 112, 158, 31, 59),
+(8, 6, 80, 181, 114, 161, 31, 60),
+(8, 7, 1, 22, 22, 22, 17, 23),
+(8, 7, 2, 23, 22, 23, 18, 24),
+(8, 7, 3, 24, 23, 24, 19, 25),
+(8, 7, 4, 25, 23, 25, 20, 26),
+(8, 7, 5, 25, 24, 26, 21, 27),
+(8, 7, 6, 26, 24, 27, 22, 28),
+(8, 7, 7, 27, 25, 28, 23, 29),
+(8, 7, 8, 28, 25, 29, 24, 30),
+(8, 7, 9, 29, 25, 30, 25, 31),
+(8, 7, 10, 30, 26, 31, 26, 33),
+(8, 7, 11, 31, 26, 32, 27, 34),
+(8, 7, 12, 32, 27, 33, 28, 35),
+(8, 7, 13, 33, 27, 34, 29, 36),
+(8, 7, 14, 34, 28, 35, 30, 37),
+(8, 7, 15, 34, 28, 36, 31, 38),
+(8, 7, 16, 35, 29, 38, 32, 39),
+(8, 7, 17, 36, 29, 39, 33, 41),
+(8, 7, 18, 37, 30, 40, 34, 42),
+(8, 7, 19, 38, 30, 41, 35, 43),
+(8, 7, 20, 39, 31, 42, 36, 44),
+(8, 7, 21, 40, 32, 43, 37, 45),
+(8, 7, 22, 41, 32, 45, 38, 47),
+(8, 7, 23, 43, 33, 46, 39, 48),
+(8, 7, 24, 44, 33, 47, 40, 49),
+(8, 7, 25, 45, 34, 48, 42, 51),
+(8, 7, 26, 46, 34, 49, 43, 52),
+(8, 7, 27, 47, 35, 51, 44, 53),
+(8, 7, 28, 48, 35, 52, 45, 54),
+(8, 7, 29, 49, 36, 53, 46, 56),
+(8, 7, 30, 50, 37, 54, 48, 57),
+(8, 7, 31, 51, 37, 56, 49, 59),
+(8, 7, 32, 52, 38, 57, 50, 60),
+(8, 7, 33, 53, 38, 58, 51, 61),
+(8, 7, 34, 55, 39, 60, 52, 63),
+(8, 7, 35, 56, 40, 61, 54, 64),
+(8, 7, 36, 57, 40, 62, 55, 66),
+(8, 7, 37, 58, 41, 64, 56, 67),
+(8, 7, 38, 59, 42, 65, 57, 68),
+(8, 7, 39, 61, 42, 66, 59, 70),
+(8, 7, 40, 62, 43, 68, 60, 71),
+(8, 7, 41, 63, 44, 69, 61, 73),
+(8, 7, 42, 64, 44, 71, 63, 74),
+(8, 7, 43, 65, 45, 72, 64, 76),
+(8, 7, 44, 67, 46, 74, 65, 77),
+(8, 7, 45, 68, 46, 75, 67, 79),
+(8, 7, 46, 69, 47, 76, 68, 80),
+(8, 7, 47, 71, 48, 78, 69, 82),
+(8, 7, 48, 72, 49, 79, 71, 83),
+(8, 7, 49, 73, 49, 81, 72, 85),
+(8, 7, 50, 74, 50, 82, 74, 87),
+(8, 7, 51, 76, 51, 84, 75, 88),
+(8, 7, 52, 77, 51, 85, 77, 90),
+(8, 7, 53, 78, 52, 87, 78, 92),
+(8, 7, 54, 80, 53, 89, 79, 93),
+(8, 7, 55, 81, 54, 90, 81, 95),
+(8, 7, 56, 83, 55, 92, 82, 96),
+(8, 7, 57, 84, 55, 93, 84, 98),
+(8, 7, 58, 85, 56, 95, 85, 100),
+(8, 7, 59, 87, 57, 97, 87, 102),
+(8, 7, 60, 88, 58, 98, 88, 103),
+(8, 7, 61, 90, 58, 100, 90, 105),
+(8, 7, 62, 91, 59, 101, 91, 107),
+(8, 7, 63, 93, 60, 103, 93, 108),
+(8, 7, 64, 94, 61, 105, 94, 110),
+(8, 7, 65, 95, 62, 106, 96, 112),
+(8, 7, 66, 97, 63, 108, 98, 114),
+(8, 7, 67, 98, 63, 110, 99, 116),
+(8, 7, 68, 100, 64, 112, 101, 117),
+(8, 7, 69, 101, 65, 113, 102, 119),
+(8, 7, 70, 103, 66, 115, 104, 121),
+(8, 7, 71, 104, 67, 117, 116, 123),
+(8, 7, 72, 106, 68, 119, 118, 126),
+(8, 7, 73, 108, 69, 121, 121, 128),
+(8, 7, 74, 110, 70, 124, 123, 130),
+(8, 7, 75, 112, 71, 126, 125, 132),
+(8, 7, 76, 114, 72, 128, 127, 135),
+(8, 7, 77, 115, 73, 130, 129, 137),
+(8, 7, 78, 117, 74, 132, 132, 139),
+(8, 7, 79, 119, 75, 135, 134, 142),
+(8, 7, 80, 121, 76, 137, 136, 144),
+(8, 8, 1, 21, 22, 21, 19, 23),
+(8, 8, 2, 21, 22, 21, 20, 24),
+(8, 8, 3, 21, 22, 22, 22, 26),
+(8, 8, 4, 21, 22, 22, 23, 27),
+(8, 8, 5, 21, 23, 22, 25, 28),
+(8, 8, 6, 21, 23, 22, 26, 30),
+(8, 8, 7, 21, 23, 23, 27, 31),
+(8, 8, 8, 22, 23, 23, 29, 32),
+(8, 8, 9, 22, 23, 23, 30, 34),
+(8, 8, 10, 22, 23, 24, 32, 35),
+(8, 8, 11, 22, 24, 24, 33, 37),
+(8, 8, 12, 22, 24, 24, 35, 38),
+(8, 8, 13, 22, 24, 25, 36, 39),
+(8, 8, 14, 22, 24, 25, 38, 41),
+(8, 8, 15, 22, 24, 25, 39, 42),
+(8, 8, 16, 22, 24, 26, 41, 44),
+(8, 8, 17, 23, 25, 26, 42, 45),
+(8, 8, 18, 23, 25, 26, 44, 47),
+(8, 8, 19, 23, 25, 27, 46, 48),
+(8, 8, 20, 23, 25, 27, 47, 50),
+(8, 8, 21, 23, 25, 27, 49, 51),
+(8, 8, 22, 23, 26, 28, 51, 53),
+(8, 8, 23, 23, 26, 28, 52, 55),
+(8, 8, 24, 24, 26, 29, 54, 56),
+(8, 8, 25, 24, 26, 29, 56, 58),
+(8, 8, 26, 24, 27, 29, 57, 60),
+(8, 8, 27, 24, 27, 30, 59, 61),
+(8, 8, 28, 24, 27, 30, 61, 63),
+(8, 8, 29, 24, 27, 31, 63, 65),
+(8, 8, 30, 24, 28, 31, 64, 66),
+(8, 8, 31, 25, 28, 31, 66, 68),
+(8, 8, 32, 25, 28, 32, 68, 70),
+(8, 8, 33, 25, 28, 32, 70, 71),
+(8, 8, 34, 25, 29, 33, 71, 73),
+(8, 8, 35, 25, 29, 33, 73, 75),
+(8, 8, 36, 26, 29, 34, 75, 77),
+(8, 8, 37, 26, 29, 34, 77, 79),
+(8, 8, 38, 26, 30, 35, 79, 80),
+(8, 8, 39, 26, 30, 35, 81, 82),
+(8, 8, 40, 26, 30, 35, 83, 84),
+(8, 8, 41, 27, 31, 36, 85, 86),
+(8, 8, 42, 27, 31, 36, 87, 88),
+(8, 8, 43, 27, 31, 37, 89, 90),
+(8, 8, 44, 27, 32, 37, 91, 91),
+(8, 8, 45, 27, 32, 38, 93, 93),
+(8, 8, 46, 28, 32, 38, 95, 95),
+(8, 8, 47, 28, 32, 39, 97, 97),
+(8, 8, 48, 28, 33, 39, 99, 99),
+(8, 8, 49, 28, 33, 40, 101, 101),
+(8, 8, 50, 29, 33, 40, 103, 103),
+(8, 8, 51, 29, 34, 41, 105, 105),
+(8, 8, 52, 29, 34, 42, 107, 107),
+(8, 8, 53, 29, 35, 42, 109, 109),
+(8, 8, 54, 30, 35, 43, 111, 111),
+(8, 8, 55, 30, 35, 43, 113, 113),
+(8, 8, 56, 30, 36, 44, 115, 115),
+(8, 8, 57, 30, 36, 44, 118, 118),
+(8, 8, 58, 31, 36, 45, 120, 120),
+(8, 8, 59, 31, 37, 45, 122, 122),
+(8, 8, 60, 31, 37, 46, 124, 124),
+(8, 8, 61, 31, 37, 47, 126, 126),
+(8, 8, 62, 32, 38, 47, 129, 128),
+(8, 8, 63, 32, 38, 48, 131, 130),
+(8, 8, 64, 32, 39, 48, 133, 133),
+(8, 8, 65, 33, 39, 49, 135, 135),
+(8, 8, 66, 33, 39, 50, 138, 137),
+(8, 8, 67, 33, 40, 50, 140, 139),
+(8, 8, 68, 33, 40, 51, 142, 141),
+(8, 8, 69, 34, 41, 51, 145, 144),
+(8, 8, 70, 34, 41, 52, 147, 146),
+(8, 8, 71, 34, 41, 53, 150, 149),
+(8, 8, 72, 34, 42, 54, 153, 152),
+(8, 8, 73, 34, 42, 55, 156, 155),
+(8, 8, 74, 35, 43, 55, 159, 157),
+(8, 8, 75, 35, 43, 56, 162, 160),
+(8, 8, 76, 35, 43, 57, 168, 163),
+(8, 8, 77, 36, 44, 58, 168, 166),
+(8, 8, 78, 36, 44, 58, 171, 169),
+(8, 8, 79, 36, 45, 59, 177, 172),
+(8, 8, 80, 37, 45, 60, 177, 175),
+(10, 2, 1, 19, 22, 21, 24, 20),
+(10, 2, 2, 20, 23, 22, 25, 21),
+(10, 2, 3, 21, 23, 23, 25, 21),
+(10, 2, 4, 22, 24, 24, 26, 22),
+(10, 2, 5, 23, 24, 25, 27, 23),
+(10, 2, 6, 25, 25, 26, 27, 24),
+(10, 2, 7, 26, 25, 27, 28, 24),
+(10, 2, 8, 27, 26, 28, 29, 25),
+(10, 2, 9, 28, 27, 29, 29, 26),
+(10, 2, 10, 29, 27, 31, 30, 26),
+(10, 2, 11, 30, 28, 32, 31, 27),
+(10, 2, 12, 32, 29, 33, 31, 28),
+(10, 2, 13, 33, 29, 34, 32, 29),
+(10, 2, 14, 34, 30, 35, 33, 30),
+(10, 2, 15, 35, 31, 36, 33, 30),
+(10, 2, 16, 37, 31, 37, 34, 31),
+(10, 2, 17, 38, 32, 39, 35, 32),
+(10, 2, 18, 39, 33, 40, 36, 33),
+(10, 2, 19, 40, 33, 41, 36, 34),
+(10, 2, 20, 42, 34, 42, 37, 35),
+(10, 2, 21, 43, 35, 44, 38, 35),
+(10, 2, 22, 44, 35, 45, 39, 36),
+(10, 2, 23, 46, 36, 46, 40, 37),
+(10, 2, 24, 47, 37, 47, 40, 38),
+(10, 2, 25, 49, 38, 49, 41, 39),
+(10, 2, 26, 50, 38, 50, 42, 40),
+(10, 2, 27, 51, 39, 51, 43, 41),
+(10, 2, 28, 53, 40, 53, 44, 42),
+(10, 2, 29, 54, 41, 54, 45, 43),
+(10, 2, 30, 56, 41, 55, 45, 43),
+(10, 2, 31, 57, 42, 57, 46, 44),
+(10, 2, 32, 58, 43, 58, 47, 45),
+(10, 2, 33, 60, 44, 59, 48, 46),
+(10, 2, 34, 61, 45, 61, 49, 47),
+(10, 2, 35, 63, 45, 62, 50, 48),
+(10, 2, 36, 64, 46, 64, 51, 49),
+(10, 2, 37, 66, 47, 65, 52, 50),
+(10, 2, 38, 67, 48, 67, 53, 51),
+(10, 2, 39, 69, 49, 68, 54, 52),
+(10, 2, 40, 71, 50, 69, 55, 53),
+(10, 2, 41, 72, 50, 71, 55, 54),
+(10, 2, 42, 74, 51, 72, 56, 55),
+(10, 2, 43, 75, 52, 74, 57, 56),
+(10, 2, 44, 77, 53, 75, 58, 57),
+(10, 2, 45, 79, 54, 77, 59, 59),
+(10, 2, 46, 80, 55, 78, 60, 60),
+(10, 2, 47, 82, 56, 80, 61, 61),
+(10, 2, 48, 83, 57, 82, 62, 62),
+(10, 2, 49, 85, 58, 83, 63, 63),
+(10, 2, 50, 87, 59, 85, 64, 64),
+(10, 2, 51, 89, 60, 86, 66, 65),
+(10, 2, 52, 90, 61, 88, 67, 66),
+(10, 2, 53, 92, 61, 90, 68, 67),
+(10, 2, 54, 94, 62, 91, 69, 69),
+(10, 2, 55, 95, 63, 93, 70, 70),
+(10, 2, 56, 97, 64, 95, 71, 71),
+(10, 2, 57, 99, 65, 96, 72, 72),
+(10, 2, 58, 101, 66, 98, 73, 73),
+(10, 2, 59, 102, 67, 100, 74, 74),
+(10, 2, 60, 104, 68, 101, 75, 76),
+(10, 2, 61, 106, 69, 103, 76, 77),
+(10, 2, 62, 108, 70, 105, 78, 78),
+(10, 2, 63, 110, 72, 106, 79, 79),
+(10, 2, 64, 112, 73, 108, 80, 80),
+(10, 2, 65, 113, 74, 110, 81, 82),
+(10, 2, 66, 115, 75, 112, 82, 83),
+(10, 2, 67, 117, 76, 114, 83, 84),
+(10, 2, 68, 119, 77, 115, 85, 85),
+(10, 2, 69, 121, 78, 117, 86, 87),
+(10, 2, 70, 123, 79, 119, 87, 88),
+(10, 2, 71, 125, 80, 120, 88, 89),
+(10, 2, 72, 128, 81, 123, 90, 91),
+(10, 2, 73, 130, 82, 125, 91, 93),
+(10, 2, 74, 133, 84, 127, 93, 94),
+(10, 2, 75, 135, 85, 129, 94, 96),
+(10, 2, 76, 137, 86, 132, 96, 97),
+(10, 2, 77, 140, 88, 134, 97, 99),
+(10, 2, 78, 143, 89, 136, 99, 101),
+(10, 2, 79, 145, 90, 139, 100, 102),
+(10, 2, 80, 148, 92, 141, 102, 104),
+(10, 3, 1, 17, 25, 20, 24, 20),
+(10, 3, 2, 17, 26, 21, 25, 21),
+(10, 3, 3, 18, 28, 22, 25, 21),
+(10, 3, 4, 18, 29, 23, 26, 22),
+(10, 3, 5, 19, 30, 24, 26, 23),
+(10, 3, 6, 19, 32, 25, 27, 23),
+(10, 3, 7, 20, 33, 26, 27, 24),
+(10, 3, 8, 20, 35, 27, 28, 25),
+(10, 3, 9, 21, 36, 27, 29, 25),
+(10, 3, 10, 21, 38, 28, 29, 26),
+(10, 3, 11, 22, 39, 29, 30, 27),
+(10, 3, 12, 22, 41, 30, 31, 27),
+(10, 3, 13, 23, 42, 31, 31, 28),
+(10, 3, 14, 23, 44, 32, 32, 29),
+(10, 3, 15, 24, 45, 34, 32, 29),
+(10, 3, 16, 24, 47, 35, 33, 30),
+(10, 3, 17, 25, 48, 36, 34, 31),
+(10, 3, 18, 25, 50, 37, 34, 32),
+(10, 3, 19, 26, 51, 38, 35, 32),
+(10, 3, 20, 26, 53, 39, 36, 33),
+(10, 3, 21, 27, 55, 40, 37, 34),
+(10, 3, 22, 27, 56, 41, 37, 35),
+(10, 3, 23, 28, 58, 42, 38, 36),
+(10, 3, 24, 28, 60, 43, 39, 36),
+(10, 3, 25, 29, 61, 44, 39, 37),
+(10, 3, 26, 30, 63, 46, 40, 38),
+(10, 3, 27, 30, 65, 47, 41, 39),
+(10, 3, 28, 31, 66, 48, 42, 40),
+(10, 3, 29, 31, 68, 49, 42, 40),
+(10, 3, 30, 32, 70, 50, 43, 41),
+(10, 3, 31, 33, 72, 52, 44, 42),
+(10, 3, 32, 33, 73, 53, 45, 43),
+(10, 3, 33, 34, 75, 54, 46, 44),
+(10, 3, 34, 34, 77, 55, 46, 45),
+(10, 3, 35, 35, 79, 57, 47, 46),
+(10, 3, 36, 36, 81, 58, 48, 47),
+(10, 3, 37, 36, 83, 59, 49, 47),
+(10, 3, 38, 37, 85, 60, 50, 48),
+(10, 3, 39, 38, 86, 62, 51, 49),
+(10, 3, 40, 38, 88, 63, 51, 50),
+(10, 3, 41, 39, 90, 64, 52, 51),
+(10, 3, 42, 40, 92, 66, 53, 52),
+(10, 3, 43, 40, 94, 67, 54, 53),
+(10, 3, 44, 41, 96, 68, 55, 54),
+(10, 3, 45, 42, 98, 70, 56, 55),
+(10, 3, 46, 42, 100, 71, 57, 56),
+(10, 3, 47, 43, 102, 72, 58, 57),
+(10, 3, 48, 44, 104, 74, 59, 58),
+(10, 3, 49, 45, 106, 75, 60, 59),
+(10, 3, 50, 45, 108, 77, 61, 60),
+(10, 3, 51, 46, 110, 78, 61, 61),
+(10, 3, 52, 47, 113, 79, 62, 62),
+(10, 3, 53, 47, 115, 81, 63, 63),
+(10, 3, 54, 48, 117, 82, 64, 64),
+(10, 3, 55, 49, 119, 84, 65, 65),
+(10, 3, 56, 50, 121, 85, 66, 66),
+(10, 3, 57, 50, 123, 87, 67, 67),
+(10, 3, 58, 51, 126, 88, 68, 68),
+(10, 3, 59, 52, 128, 90, 69, 70),
+(10, 3, 60, 53, 130, 91, 70, 71),
+(10, 3, 61, 54, 132, 93, 71, 72),
+(10, 3, 62, 54, 134, 94, 72, 73),
+(10, 3, 63, 55, 137, 96, 73, 74),
+(10, 3, 64, 56, 139, 97, 75, 75),
+(10, 3, 65, 57, 141, 99, 76, 76),
+(10, 3, 66, 58, 144, 101, 77, 77),
+(10, 3, 67, 58, 146, 102, 78, 78),
+(10, 3, 68, 59, 148, 104, 79, 80),
+(10, 3, 69, 60, 151, 105, 80, 81),
+(10, 3, 70, 61, 153, 107, 81, 82),
+(10, 3, 71, 62, 156, 108, 82, 83),
+(10, 3, 72, 63, 159, 110, 83, 84),
+(10, 3, 73, 64, 162, 112, 84, 86),
+(10, 3, 74, 65, 165, 114, 86, 87),
+(10, 3, 75, 66, 168, 116, 87, 89),
+(10, 3, 76, 67, 171, 118, 89, 90),
+(10, 3, 77, 68, 174, 120, 90, 92),
+(10, 3, 78, 69, 177, 122, 91, 93),
+(10, 3, 79, 70, 180, 124, 92, 95),
+(10, 3, 80, 71, 183, 126, 94, 96),
+(10, 4, 1, 18, 25, 20, 24, 19),
+(10, 4, 2, 19, 26, 21, 24, 19),
+(10, 4, 3, 20, 28, 21, 24, 20),
+(10, 4, 4, 20, 29, 22, 24, 20),
+(10, 4, 5, 21, 31, 23, 25, 20),
+(10, 4, 6, 22, 32, 24, 25, 21),
+(10, 4, 7, 23, 34, 24, 25, 21),
+(10, 4, 8, 24, 35, 25, 25, 22),
+(10, 4, 9, 24, 37, 26, 25, 22),
+(10, 4, 10, 25, 38, 26, 25, 22),
+(10, 4, 11, 26, 40, 27, 25, 23),
+(10, 4, 12, 27, 41, 28, 26, 23),
+(10, 4, 13, 28, 43, 29, 26, 24),
+(10, 4, 14, 29, 45, 30, 26, 24),
+(10, 4, 15, 29, 46, 30, 26, 25),
+(10, 4, 16, 30, 48, 31, 26, 25),
+(10, 4, 17, 31, 50, 32, 27, 25),
+(10, 4, 18, 32, 51, 33, 27, 26),
+(10, 4, 19, 33, 53, 34, 27, 26),
+(10, 4, 20, 34, 55, 35, 27, 27),
+(10, 4, 21, 35, 56, 35, 27, 27),
+(10, 4, 22, 36, 58, 36, 28, 28),
+(10, 4, 23, 37, 60, 37, 28, 28),
+(10, 4, 24, 38, 62, 38, 28, 29),
+(10, 4, 25, 39, 63, 39, 28, 29),
+(10, 4, 26, 40, 65, 40, 29, 30),
+(10, 4, 27, 41, 67, 41, 29, 30),
+(10, 4, 28, 42, 69, 42, 29, 31),
+(10, 4, 29, 43, 71, 43, 29, 31),
+(10, 4, 30, 44, 72, 43, 29, 32),
+(10, 4, 31, 45, 74, 44, 30, 32),
+(10, 4, 32, 46, 76, 45, 30, 33),
+(10, 4, 33, 47, 78, 46, 30, 33),
+(10, 4, 34, 48, 80, 47, 31, 34),
+(10, 4, 35, 49, 82, 48, 31, 34),
+(10, 4, 36, 50, 84, 49, 31, 35),
+(10, 4, 37, 51, 86, 50, 31, 35),
+(10, 4, 38, 52, 88, 51, 32, 36),
+(10, 4, 39, 53, 90, 52, 32, 37),
+(10, 4, 40, 54, 92, 53, 32, 37),
+(10, 4, 41, 56, 94, 54, 33, 38),
+(10, 4, 42, 57, 96, 55, 33, 38),
+(10, 4, 43, 58, 98, 56, 33, 39),
+(10, 4, 44, 59, 100, 57, 33, 39),
+(10, 4, 45, 60, 102, 59, 34, 40),
+(10, 4, 46, 61, 104, 60, 34, 41),
+(10, 4, 47, 62, 107, 61, 34, 41),
+(10, 4, 48, 64, 109, 62, 35, 42),
+(10, 4, 49, 65, 111, 63, 35, 43),
+(10, 4, 50, 66, 113, 64, 35, 43),
+(10, 4, 51, 67, 115, 65, 36, 44),
+(10, 4, 52, 68, 117, 66, 36, 44),
+(10, 4, 53, 70, 120, 67, 36, 45),
+(10, 4, 54, 71, 122, 69, 37, 46),
+(10, 4, 55, 72, 124, 70, 37, 46),
+(10, 4, 56, 73, 126, 71, 37, 47),
+(10, 4, 57, 75, 129, 72, 38, 48),
+(10, 4, 58, 76, 131, 73, 38, 48),
+(10, 4, 59, 77, 133, 74, 39, 49),
+(10, 4, 60, 79, 136, 76, 39, 50),
+(10, 4, 61, 80, 138, 77, 39, 51),
+(10, 4, 62, 81, 140, 78, 40, 51),
+(10, 4, 63, 82, 143, 79, 40, 52),
+(10, 4, 64, 84, 145, 80, 41, 53),
+(10, 4, 65, 85, 148, 82, 41, 53),
+(10, 4, 66, 87, 150, 83, 41, 54),
+(10, 4, 67, 88, 153, 84, 42, 55),
+(10, 4, 68, 89, 155, 85, 42, 56),
+(10, 4, 69, 91, 157, 87, 43, 56),
+(10, 4, 70, 92, 160, 88, 43, 57),
+(10, 4, 71, 94, 163, 88, 43, 58),
+(10, 4, 72, 96, 166, 90, 44, 58),
+(10, 4, 73, 97, 169, 92, 44, 59),
+(10, 4, 74, 99, 172, 93, 45, 60),
+(10, 4, 75, 101, 175, 95, 45, 61),
+(10, 4, 76, 102, 178, 96, 45, 62),
+(10, 4, 77, 104, 181, 101, 46, 63),
+(10, 4, 78, 106, 185, 104, 46, 64),
+(10, 4, 79, 108, 188, 105, 47, 65),
+(10, 4, 80, 110, 191, 107, 47, 66),
+(10, 5, 1, 17, 22, 19, 26, 22),
+(10, 5, 2, 17, 22, 19, 27, 23),
+(10, 5, 3, 17, 22, 20, 29, 25),
+(10, 5, 4, 17, 23, 20, 30, 26),
+(10, 5, 5, 18, 23, 20, 31, 27),
+(10, 5, 6, 18, 23, 21, 33, 29),
+(10, 5, 7, 18, 23, 21, 34, 30),
+(10, 5, 8, 18, 24, 22, 35, 32),
+(10, 5, 9, 18, 24, 22, 37, 33),
+(10, 5, 10, 19, 24, 22, 38, 35),
+(10, 5, 11, 19, 24, 23, 39, 36),
+(10, 5, 12, 19, 24, 23, 41, 38),
+(10, 5, 13, 19, 25, 24, 42, 39),
+(10, 5, 14, 19, 25, 24, 44, 41),
+(10, 5, 15, 19, 25, 25, 45, 42),
+(10, 5, 16, 20, 26, 25, 47, 44),
+(10, 5, 17, 20, 26, 25, 48, 45),
+(10, 5, 18, 20, 26, 26, 50, 47),
+(10, 5, 19, 20, 26, 26, 51, 49),
+(10, 5, 20, 21, 27, 27, 53, 50),
+(10, 5, 21, 21, 27, 27, 54, 52),
+(10, 5, 22, 21, 27, 28, 56, 53),
+(10, 5, 23, 21, 28, 28, 58, 55),
+(10, 5, 24, 21, 28, 29, 59, 57),
+(10, 5, 25, 22, 28, 29, 61, 58),
+(10, 5, 26, 22, 28, 30, 62, 60),
+(10, 5, 27, 22, 29, 30, 64, 62),
+(10, 5, 28, 22, 29, 31, 66, 64),
+(10, 5, 29, 23, 29, 31, 67, 65),
+(10, 5, 30, 23, 30, 32, 69, 67),
+(10, 5, 31, 23, 30, 32, 71, 69),
+(10, 5, 32, 23, 30, 33, 72, 71),
+(10, 5, 33, 24, 31, 33, 74, 72),
+(10, 5, 34, 24, 31, 34, 76, 74),
+(10, 5, 35, 24, 32, 34, 78, 76),
+(10, 5, 36, 24, 32, 35, 80, 78),
+(10, 5, 37, 25, 32, 35, 81, 80),
+(10, 5, 38, 25, 33, 36, 83, 82),
+(10, 5, 39, 25, 33, 37, 85, 84),
+(10, 5, 40, 26, 33, 37, 87, 86),
+(10, 5, 41, 26, 34, 38, 89, 88),
+(10, 5, 42, 26, 34, 38, 91, 89),
+(10, 5, 43, 27, 35, 39, 92, 91),
+(10, 5, 44, 27, 35, 39, 94, 93),
+(10, 5, 45, 27, 35, 40, 96, 95),
+(10, 5, 46, 27, 36, 41, 98, 97),
+(10, 5, 47, 28, 36, 41, 100, 99),
+(10, 5, 48, 28, 37, 42, 102, 101),
+(10, 5, 49, 28, 37, 43, 104, 103),
+(10, 5, 50, 29, 37, 43, 106, 106),
+(10, 5, 51, 29, 38, 44, 108, 108),
+(10, 5, 52, 29, 38, 44, 110, 110),
+(10, 5, 53, 30, 39, 45, 112, 112),
+(10, 5, 54, 30, 39, 46, 114, 114),
+(10, 5, 55, 30, 40, 46, 116, 116),
+(10, 5, 56, 31, 40, 47, 118, 118),
+(10, 5, 57, 31, 41, 48, 120, 120),
+(10, 5, 58, 31, 41, 48, 123, 123),
+(10, 5, 59, 32, 42, 49, 125, 125),
+(10, 5, 60, 32, 42, 50, 127, 127),
+(10, 5, 61, 33, 42, 51, 129, 129),
+(10, 5, 62, 33, 43, 51, 131, 131),
+(10, 5, 63, 33, 43, 52, 133, 134),
+(10, 5, 64, 34, 44, 53, 135, 136),
+(10, 5, 65, 34, 44, 53, 138, 138),
+(10, 5, 66, 34, 45, 54, 140, 141),
+(10, 5, 67, 35, 45, 55, 142, 143),
+(10, 5, 68, 35, 46, 56, 144, 145),
+(10, 5, 69, 36, 46, 56, 147, 148),
+(10, 5, 70, 36, 47, 57, 149, 150),
+(10, 5, 71, 36, 48, 57, 152, 153),
+(10, 5, 72, 37, 48, 57, 155, 156),
+(10, 5, 73, 37, 49, 58, 158, 159),
+(10, 5, 74, 38, 49, 59, 160, 163),
+(10, 5, 75, 38, 50, 60, 163, 165),
+(10, 5, 76, 38, 51, 61, 166, 170),
+(10, 5, 77, 39, 51, 62, 168, 175),
+(10, 5, 78, 39, 52, 63, 172, 174),
+(10, 5, 79, 40, 52, 64, 175, 177),
+(10, 5, 80, 40, 53, 65, 178, 180),
+(10, 6, 1, 18, 23, 21, 24, 20),
+(10, 6, 2, 19, 24, 22, 24, 20),
+(10, 6, 3, 21, 25, 23, 24, 21),
+(10, 6, 4, 22, 25, 25, 24, 21),
+(10, 6, 5, 23, 26, 26, 24, 21),
+(10, 6, 6, 25, 27, 27, 24, 21),
+(10, 6, 7, 26, 28, 28, 24, 22),
+(10, 6, 8, 27, 29, 29, 25, 22),
+(10, 6, 9, 29, 29, 31, 25, 22),
+(10, 6, 10, 30, 30, 32, 25, 23),
+(10, 6, 11, 32, 31, 33, 25, 23),
+(10, 6, 12, 33, 32, 34, 25, 23),
+(10, 6, 13, 34, 33, 36, 25, 24),
+(10, 6, 14, 36, 34, 37, 25, 24),
+(10, 6, 15, 37, 35, 38, 25, 24),
+(10, 6, 16, 39, 36, 40, 25, 25),
+(10, 6, 17, 40, 36, 41, 25, 25),
+(10, 6, 18, 42, 37, 43, 26, 25),
+(10, 6, 19, 43, 38, 44, 26, 26),
+(10, 6, 20, 45, 39, 45, 26, 26),
+(10, 6, 21, 47, 40, 47, 26, 26),
+(10, 6, 22, 48, 41, 48, 26, 27),
+(10, 6, 23, 50, 42, 50, 26, 27),
+(10, 6, 24, 51, 43, 51, 26, 28),
+(10, 6, 25, 53, 44, 52, 27, 28),
+(10, 6, 26, 55, 45, 54, 27, 28),
+(10, 6, 27, 56, 46, 55, 27, 29),
+(10, 6, 28, 58, 47, 57, 27, 29),
+(10, 6, 29, 59, 48, 58, 27, 30),
+(10, 6, 30, 61, 49, 60, 27, 30),
+(10, 6, 31, 63, 50, 62, 27, 30),
+(10, 6, 32, 65, 51, 63, 28, 31),
+(10, 6, 33, 66, 52, 65, 28, 31),
+(10, 6, 34, 68, 53, 66, 28, 32),
+(10, 6, 35, 70, 55, 68, 28, 32),
+(10, 6, 36, 72, 56, 69, 28, 33),
+(10, 6, 37, 73, 57, 71, 29, 33),
+(10, 6, 38, 75, 58, 73, 29, 34),
+(10, 6, 39, 77, 59, 74, 29, 34),
+(10, 6, 40, 79, 60, 76, 29, 35),
+(10, 6, 41, 81, 61, 78, 29, 35),
+(10, 6, 42, 82, 62, 79, 30, 35),
+(10, 6, 43, 84, 64, 81, 30, 36),
+(10, 6, 44, 86, 65, 83, 30, 36),
+(10, 6, 45, 88, 66, 85, 30, 37),
+(10, 6, 46, 90, 67, 86, 30, 37),
+(10, 6, 47, 92, 68, 88, 31, 38),
+(10, 6, 48, 94, 69, 90, 31, 38),
+(10, 6, 49, 96, 69, 92, 31, 39),
+(10, 6, 50, 98, 70, 93, 31, 40),
+(10, 6, 51, 100, 71, 95, 32, 40),
+(10, 6, 52, 102, 72, 96, 32, 41),
+(10, 6, 53, 103, 73, 97, 32, 41),
+(10, 6, 54, 104, 74, 98, 32, 41),
+(10, 6, 55, 105, 75, 97, 33, 41),
+(10, 6, 56, 108, 77, 100, 33, 42),
+(10, 6, 57, 113, 78, 102, 33, 42),
+(10, 6, 58, 115, 79, 104, 34, 43),
+(10, 6, 59, 117, 81, 106, 34, 43),
+(10, 6, 60, 118, 82, 108, 34, 44),
+(10, 6, 61, 119, 83, 110, 34, 45),
+(10, 6, 62, 121, 85, 112, 34, 45),
+(10, 6, 63, 124, 86, 115, 35, 46),
+(10, 6, 64, 127, 88, 117, 35, 46),
+(10, 6, 65, 133, 89, 119, 35, 47),
+(10, 6, 66, 135, 91, 122, 35, 48),
+(10, 6, 67, 139, 92, 124, 36, 48),
+(10, 6, 68, 141, 94, 126, 36, 49),
+(10, 6, 69, 142, 95, 129, 36, 50),
+(10, 6, 70, 145, 97, 131, 36, 50),
+(10, 6, 71, 150, 99, 134, 37, 51),
+(10, 6, 72, 152, 100, 136, 37, 52),
+(10, 6, 73, 155, 102, 139, 37, 53),
+(10, 6, 74, 158, 104, 141, 37, 53),
+(10, 6, 75, 159, 105, 144, 38, 54),
+(10, 6, 76, 160, 107, 147, 38, 55),
+(10, 6, 77, 163, 109, 149, 38, 56),
+(10, 6, 78, 166, 110, 152, 38, 56),
+(10, 6, 79, 169, 112, 155, 39, 57),
+(10, 6, 80, 172, 114, 158, 39, 58),
+(10, 8, 1, 17, 22, 19, 27, 21),
+(10, 8, 2, 17, 22, 19, 28, 22),
+(10, 8, 3, 17, 22, 20, 30, 24),
+(10, 8, 4, 17, 22, 20, 31, 25),
+(10, 8, 5, 17, 23, 20, 32, 26),
+(10, 8, 6, 17, 23, 20, 34, 28),
+(10, 8, 7, 18, 23, 21, 35, 29),
+(10, 8, 8, 18, 23, 21, 37, 30),
+(10, 8, 9, 18, 23, 21, 38, 32),
+(10, 8, 10, 18, 23, 22, 40, 33),
+(10, 8, 11, 18, 24, 22, 41, 35),
+(10, 8, 12, 18, 24, 22, 42, 36),
+(10, 8, 13, 18, 24, 23, 44, 37),
+(10, 8, 14, 18, 24, 23, 45, 39),
+(10, 8, 15, 18, 24, 23, 47, 40),
+(10, 8, 16, 19, 24, 24, 49, 42),
+(10, 8, 17, 19, 25, 24, 50, 43),
+(10, 8, 18, 19, 25, 24, 52, 45),
+(10, 8, 19, 19, 25, 25, 53, 46),
+(10, 8, 20, 19, 25, 25, 55, 48),
+(10, 8, 21, 19, 25, 26, 57, 50),
+(10, 8, 22, 19, 26, 26, 58, 51),
+(10, 8, 23, 20, 26, 26, 60, 53),
+(10, 8, 24, 20, 26, 27, 61, 54),
+(10, 8, 25, 20, 26, 27, 63, 56),
+(10, 8, 26, 20, 27, 27, 65, 58),
+(10, 8, 27, 20, 27, 28, 67, 59),
+(10, 8, 28, 20, 27, 28, 68, 61),
+(10, 8, 29, 21, 27, 29, 70, 63),
+(10, 8, 30, 21, 28, 29, 72, 64),
+(10, 8, 31, 21, 28, 30, 74, 66),
+(10, 8, 32, 21, 28, 30, 75, 68),
+(10, 8, 33, 21, 28, 30, 77, 70),
+(10, 8, 34, 21, 29, 31, 79, 71),
+(10, 8, 35, 22, 29, 31, 81, 73),
+(10, 8, 36, 22, 29, 32, 83, 75),
+(10, 8, 37, 22, 29, 32, 85, 77),
+(10, 8, 38, 22, 30, 33, 86, 78),
+(10, 8, 39, 22, 30, 33, 88, 80),
+(10, 8, 40, 23, 30, 34, 90, 82),
+(10, 8, 41, 23, 31, 34, 92, 84),
+(10, 8, 42, 23, 31, 35, 94, 86),
+(10, 8, 43, 23, 31, 35, 96, 88),
+(10, 8, 44, 23, 32, 36, 98, 90),
+(10, 8, 45, 24, 32, 36, 100, 92),
+(10, 8, 46, 24, 32, 37, 102, 93),
+(10, 8, 47, 24, 32, 37, 104, 95),
+(10, 8, 48, 24, 33, 38, 106, 97),
+(10, 8, 49, 25, 33, 38, 108, 99),
+(10, 8, 50, 25, 33, 39, 110, 101),
+(10, 8, 51, 25, 34, 39, 112, 103),
+(10, 8, 52, 25, 34, 40, 114, 105),
+(10, 8, 53, 25, 35, 40, 117, 107),
+(10, 8, 54, 26, 35, 41, 119, 109),
+(10, 8, 55, 26, 35, 41, 121, 111),
+(10, 8, 56, 26, 36, 42, 123, 113),
+(10, 8, 57, 26, 36, 42, 125, 116),
+(10, 8, 58, 27, 36, 43, 127, 118),
+(10, 8, 59, 27, 37, 43, 130, 120),
+(10, 8, 60, 27, 37, 44, 132, 122),
+(10, 8, 61, 27, 37, 45, 134, 124),
+(10, 8, 62, 28, 38, 45, 136, 126),
+(10, 8, 63, 28, 38, 46, 139, 128),
+(10, 8, 64, 28, 39, 46, 141, 131),
+(10, 8, 65, 29, 39, 47, 143, 133),
+(10, 8, 66, 29, 39, 48, 146, 135),
+(10, 8, 67, 29, 40, 48, 148, 137),
+(10, 8, 68, 29, 40, 49, 150, 139),
+(10, 8, 69, 30, 41, 49, 153, 142),
+(10, 8, 70, 30, 41, 50, 155, 144),
+(10, 8, 71, 30, 41, 50, 158, 147),
+(10, 8, 72, 30, 42, 51, 161, 150),
+(10, 8, 73, 30, 42, 52, 164, 153),
+(10, 8, 74, 31, 43, 52, 167, 155),
+(10, 8, 75, 31, 43, 53, 170, 158),
+(10, 8, 76, 31, 43, 54, 173, 161),
+(10, 8, 77, 32, 44, 55, 176, 164),
+(10, 8, 78, 32, 44, 55, 179, 167),
+(10, 8, 79, 32, 45, 56, 182, 170),
+(10, 8, 80, 33, 45, 57, 185, 173),
+(10, 9, 1, 17, 22, 20, 26, 21),
+(10, 9, 2, 17, 22, 21, 27, 22),
+(10, 9, 3, 18, 23, 21, 28, 23),
+(10, 9, 4, 18, 23, 22, 29, 24),
+(10, 9, 5, 18, 23, 22, 31, 26),
+(10, 9, 6, 18, 24, 23, 32, 27),
+(10, 9, 7, 19, 24, 23, 33, 28),
+(10, 9, 8, 19, 25, 24, 34, 29),
+(10, 9, 9, 19, 25, 25, 36, 30),
+(10, 9, 10, 20, 25, 25, 37, 32),
+(10, 9, 11, 20, 26, 26, 38, 33),
+(10, 9, 12, 20, 26, 26, 39, 34),
+(10, 9, 13, 21, 27, 27, 41, 36),
+(10, 9, 14, 21, 27, 28, 42, 37),
+(10, 9, 15, 21, 27, 28, 43, 38),
+(10, 9, 16, 22, 28, 29, 45, 39),
+(10, 9, 17, 22, 28, 30, 46, 41),
+(10, 9, 18, 23, 29, 30, 47, 42),
+(10, 9, 19, 23, 29, 31, 49, 43),
+(10, 9, 20, 23, 30, 32, 50, 45),
+(10, 9, 21, 24, 30, 32, 51, 46),
+(10, 9, 22, 24, 31, 33, 53, 48),
+(10, 9, 23, 24, 31, 34, 54, 49),
+(10, 9, 24, 25, 31, 34, 56, 50),
+(10, 9, 25, 25, 32, 35, 57, 52),
+(10, 9, 26, 26, 32, 36, 59, 53),
+(10, 9, 27, 26, 33, 37, 60, 55),
+(10, 9, 28, 26, 33, 37, 62, 56),
+(10, 9, 29, 27, 34, 38, 63, 58),
+(10, 9, 30, 27, 34, 39, 65, 59),
+(10, 9, 31, 28, 35, 40, 66, 61),
+(10, 9, 32, 28, 36, 40, 68, 62),
+(10, 9, 33, 29, 36, 41, 69, 64),
+(10, 9, 34, 29, 37, 42, 71, 65),
+(10, 9, 35, 29, 37, 43, 73, 67),
+(10, 9, 36, 30, 38, 43, 74, 69),
+(10, 9, 37, 30, 38, 44, 76, 70),
+(10, 9, 38, 31, 39, 45, 77, 72),
+(10, 9, 39, 31, 39, 46, 79, 73),
+(10, 9, 40, 32, 40, 47, 81, 75),
+(10, 9, 41, 32, 41, 48, 82, 77),
+(10, 9, 42, 33, 41, 48, 84, 78),
+(10, 9, 43, 33, 42, 49, 86, 80),
+(10, 9, 44, 34, 42, 50, 88, 82),
+(10, 9, 45, 34, 43, 51, 89, 83),
+(10, 9, 46, 35, 44, 52, 91, 85),
+(10, 9, 47, 35, 44, 53, 93, 87),
+(10, 9, 48, 36, 45, 54, 95, 89),
+(10, 9, 49, 36, 45, 54, 96, 90),
+(10, 9, 50, 37, 46, 55, 98, 92),
+(10, 9, 51, 37, 47, 56, 100, 94),
+(10, 9, 52, 38, 47, 57, 102, 96),
+(10, 9, 53, 38, 48, 58, 104, 97),
+(10, 9, 54, 39, 49, 59, 105, 99),
+(10, 9, 55, 39, 49, 60, 107, 101),
+(10, 9, 56, 40, 50, 61, 109, 103),
+(10, 9, 57, 40, 51, 62, 111, 105),
+(10, 9, 58, 41, 51, 63, 113, 107),
+(10, 9, 59, 42, 52, 64, 115, 108),
+(10, 9, 60, 42, 53, 65, 117, 110),
+(10, 9, 61, 43, 53, 66, 119, 112),
+(10, 9, 62, 43, 54, 67, 121, 114),
+(10, 9, 63, 44, 55, 68, 123, 116),
+(10, 9, 64, 44, 56, 69, 125, 118),
+(10, 9, 65, 45, 56, 70, 127, 120),
+(10, 9, 66, 46, 57, 71, 129, 122),
+(10, 9, 67, 46, 58, 72, 131, 124),
+(10, 9, 68, 47, 58, 73, 133, 126),
+(10, 9, 69, 47, 59, 74, 135, 128),
+(10, 9, 70, 48, 60, 75, 137, 130),
+(10, 9, 71, 49, 61, 83, 139, 141),
+(10, 9, 72, 50, 61, 84, 142, 143),
+(10, 9, 73, 51, 62, 84, 144, 146),
+(10, 9, 74, 51, 63, 86, 147, 149),
+(10, 9, 75, 52, 64, 89, 149, 151),
+(10, 9, 76, 53, 65, 90, 155, 154),
+(10, 9, 77, 54, 66, 91, 155, 157),
+(10, 9, 78, 54, 67, 93, 157, 160),
+(10, 9, 79, 55, 68, 94, 160, 163),
+(10, 9, 80, 56, 69, 95, 163, 165),
+(11, 1, 1, 24, 17, 21, 21, 22),
+(11, 1, 2, 25, 18, 22, 21, 22),
+(11, 1, 3, 27, 19, 23, 21, 23),
+(11, 1, 4, 28, 19, 25, 21, 23),
+(11, 1, 5, 29, 20, 26, 21, 23),
+(11, 1, 6, 31, 21, 27, 21, 23),
+(11, 1, 7, 32, 22, 28, 21, 24),
+(11, 1, 8, 33, 23, 29, 22, 24),
+(11, 1, 9, 35, 24, 31, 22, 24),
+(11, 1, 10, 36, 24, 32, 22, 25),
+(11, 1, 11, 37, 25, 33, 22, 25),
+(11, 1, 12, 39, 26, 34, 22, 25),
+(11, 1, 13, 40, 27, 36, 22, 26),
+(11, 1, 14, 42, 28, 37, 22, 26),
+(11, 1, 15, 43, 29, 38, 22, 26),
+(11, 1, 16, 45, 30, 40, 22, 27),
+(11, 1, 17, 46, 31, 41, 23, 27),
+(11, 1, 18, 48, 32, 43, 23, 27),
+(11, 1, 19, 49, 33, 44, 23, 28),
+(11, 1, 20, 51, 34, 45, 23, 28),
+(11, 1, 21, 52, 34, 47, 23, 28),
+(11, 1, 22, 54, 35, 48, 23, 29),
+(11, 1, 23, 55, 36, 50, 23, 29),
+(11, 1, 24, 57, 37, 51, 24, 30),
+(11, 1, 25, 59, 38, 52, 24, 30),
+(11, 1, 26, 60, 39, 54, 24, 30),
+(11, 1, 27, 62, 40, 55, 24, 31),
+(11, 1, 28, 63, 41, 57, 24, 31),
+(11, 1, 29, 65, 43, 58, 24, 32),
+(11, 1, 30, 67, 44, 60, 24, 32),
+(11, 1, 31, 69, 45, 62, 25, 32),
+(11, 1, 32, 70, 46, 63, 25, 33),
+(11, 1, 33, 72, 47, 65, 25, 33),
+(11, 1, 34, 74, 48, 66, 25, 34),
+(11, 1, 35, 75, 49, 68, 25, 34),
+(11, 1, 36, 77, 50, 69, 26, 35),
+(11, 1, 37, 79, 51, 71, 26, 35),
+(11, 1, 38, 81, 52, 73, 26, 35),
+(11, 1, 39, 83, 53, 74, 26, 36),
+(11, 1, 40, 84, 55, 76, 26, 36),
+(11, 1, 41, 86, 56, 78, 27, 37),
+(11, 1, 42, 88, 57, 79, 27, 37),
+(11, 1, 43, 90, 58, 81, 27, 38),
+(11, 1, 44, 92, 59, 83, 27, 38),
+(11, 1, 45, 94, 60, 85, 27, 39),
+(11, 1, 46, 96, 62, 86, 28, 39),
+(11, 1, 47, 98, 63, 88, 28, 40),
+(11, 1, 48, 100, 64, 90, 28, 40),
+(11, 1, 49, 102, 65, 92, 28, 41),
+(11, 1, 50, 103, 66, 93, 29, 41),
+(11, 1, 51, 105, 68, 95, 29, 42),
+(11, 1, 52, 107, 69, 97, 29, 42),
+(11, 1, 53, 109, 70, 99, 29, 43),
+(11, 1, 54, 112, 71, 101, 30, 44),
+(11, 1, 55, 114, 73, 103, 30, 44),
+(11, 1, 56, 116, 74, 104, 30, 45),
+(11, 1, 57, 118, 75, 106, 30, 45),
+(11, 1, 58, 120, 77, 108, 31, 46),
+(11, 1, 59, 122, 78, 110, 31, 46),
+(11, 1, 60, 124, 79, 112, 31, 47),
+(11, 1, 61, 126, 81, 114, 31, 48),
+(11, 1, 62, 128, 82, 116, 32, 48),
+(11, 1, 63, 130, 83, 118, 32, 49),
+(11, 1, 64, 133, 85, 120, 32, 49),
+(11, 1, 65, 135, 86, 122, 33, 50),
+(11, 1, 66, 137, 87, 124, 33, 51),
+(11, 1, 67, 139, 89, 126, 33, 51),
+(11, 1, 68, 141, 90, 128, 33, 52),
+(11, 1, 69, 144, 92, 130, 34, 52),
+(11, 1, 70, 146, 93, 132, 34, 53),
+(11, 1, 71, 149, 94, 134, 34, 54),
+(11, 1, 72, 151, 96, 137, 34, 55),
+(11, 1, 73, 154, 98, 139, 34, 56),
+(11, 1, 74, 157, 99, 142, 35, 56),
+(11, 1, 75, 166, 101, 149, 35, 57),
+(11, 1, 76, 172, 103, 155, 35, 58),
+(11, 1, 77, 175, 105, 159, 36, 59),
+(11, 1, 78, 179, 106, 161, 36, 59),
+(11, 1, 79, 182, 108, 164, 36, 60),
+(11, 1, 80, 185, 110, 167, 37, 61),
+(11, 2, 1, 23, 17, 21, 21, 23),
+(11, 2, 2, 24, 18, 22, 22, 24),
+(11, 2, 3, 25, 18, 23, 22, 24),
+(11, 2, 4, 26, 19, 24, 23, 25),
+(11, 2, 5, 27, 19, 25, 24, 26),
+(11, 2, 6, 29, 20, 26, 24, 26),
+(11, 2, 7, 30, 21, 27, 25, 27),
+(11, 2, 8, 31, 21, 28, 26, 28),
+(11, 2, 9, 32, 22, 29, 26, 29),
+(11, 2, 10, 33, 22, 31, 27, 29),
+(11, 2, 11, 34, 23, 32, 28, 30),
+(11, 2, 12, 36, 24, 33, 28, 31),
+(11, 2, 13, 37, 24, 34, 29, 32),
+(11, 2, 14, 38, 25, 35, 30, 32),
+(11, 2, 15, 39, 26, 36, 31, 33),
+(11, 2, 16, 40, 26, 37, 31, 34),
+(11, 2, 17, 42, 27, 39, 32, 35),
+(11, 2, 18, 43, 28, 40, 33, 36),
+(11, 2, 19, 44, 28, 41, 34, 37),
+(11, 2, 20, 46, 29, 42, 34, 37),
+(11, 2, 21, 47, 30, 44, 35, 38),
+(11, 2, 22, 48, 31, 45, 36, 39),
+(11, 2, 23, 50, 31, 46, 37, 40),
+(11, 2, 24, 51, 32, 47, 38, 41),
+(11, 2, 25, 52, 33, 49, 38, 42),
+(11, 2, 26, 54, 34, 50, 39, 43),
+(11, 2, 27, 55, 34, 51, 40, 44),
+(11, 2, 28, 56, 35, 53, 41, 44),
+(11, 2, 29, 58, 36, 54, 42, 45),
+(11, 2, 30, 59, 37, 55, 43, 46),
+(11, 2, 31, 61, 37, 57, 43, 47),
+(11, 2, 32, 62, 38, 58, 44, 48),
+(11, 2, 33, 64, 39, 59, 45, 49),
+(11, 2, 34, 65, 40, 61, 46, 50),
+(11, 2, 35, 67, 41, 62, 47, 51),
+(11, 2, 36, 68, 42, 64, 48, 52),
+(11, 2, 37, 70, 42, 65, 49, 53),
+(11, 2, 38, 71, 43, 67, 50, 54),
+(11, 2, 39, 73, 44, 68, 51, 55),
+(11, 2, 40, 74, 45, 69, 52, 56),
+(11, 2, 41, 76, 46, 71, 53, 57),
+(11, 2, 42, 78, 47, 72, 54, 58),
+(11, 2, 43, 79, 47, 74, 55, 59),
+(11, 2, 44, 81, 48, 75, 56, 60),
+(11, 2, 45, 82, 49, 77, 57, 61),
+(11, 2, 46, 84, 50, 78, 58, 62),
+(11, 2, 47, 86, 51, 80, 59, 64),
+(11, 2, 48, 87, 52, 82, 60, 65),
+(11, 2, 49, 89, 53, 83, 61, 66),
+(11, 2, 50, 91, 54, 85, 62, 67),
+(11, 2, 51, 92, 55, 86, 63, 68),
+(11, 2, 52, 94, 56, 88, 64, 69),
+(11, 2, 53, 96, 57, 90, 65, 70),
+(11, 2, 54, 97, 58, 91, 66, 71),
+(11, 2, 55, 99, 59, 93, 67, 73),
+(11, 2, 56, 101, 60, 95, 68, 74),
+(11, 2, 57, 103, 61, 96, 69, 75),
+(11, 2, 58, 105, 62, 98, 70, 76),
+(11, 2, 59, 106, 63, 100, 71, 77),
+(11, 2, 60, 108, 64, 101, 72, 78),
+(11, 2, 61, 110, 65, 103, 74, 80),
+(11, 2, 62, 112, 66, 105, 75, 81),
+(11, 2, 63, 114, 67, 106, 76, 82),
+(11, 2, 64, 116, 68, 108, 77, 83),
+(11, 2, 65, 117, 69, 110, 78, 85),
+(11, 2, 66, 119, 70, 112, 79, 86),
+(11, 2, 67, 121, 71, 114, 80, 87),
+(11, 2, 68, 123, 72, 115, 82, 88),
+(11, 2, 69, 125, 73, 117, 83, 90),
+(11, 2, 70, 127, 74, 119, 84, 91),
+(11, 2, 71, 130, 75, 121, 87, 92),
+(11, 2, 72, 132, 76, 124, 90, 94),
+(11, 2, 73, 134, 77, 126, 93, 96),
+(11, 2, 74, 137, 79, 128, 97, 97),
+(11, 2, 75, 139, 80, 130, 101, 99),
+(11, 2, 76, 142, 81, 133, 106, 100),
+(11, 2, 77, 144, 83, 135, 108, 102),
+(11, 2, 78, 147, 84, 137, 110, 104),
+(11, 2, 79, 149, 85, 140, 111, 105),
+(11, 2, 80, 152, 87, 142, 113, 107),
+(11, 3, 1, 21, 20, 20, 21, 23),
+(11, 3, 2, 21, 21, 21, 22, 24),
+(11, 3, 3, 22, 23, 22, 22, 24),
+(11, 3, 4, 22, 24, 23, 23, 25),
+(11, 3, 5, 23, 25, 24, 23, 25),
+(11, 3, 6, 23, 27, 25, 24, 26),
+(11, 3, 7, 24, 28, 26, 24, 27),
+(11, 3, 8, 24, 30, 27, 25, 27),
+(11, 3, 9, 25, 31, 27, 26, 28),
+(11, 3, 10, 25, 33, 28, 26, 29),
+(11, 3, 11, 25, 34, 29, 27, 29),
+(11, 3, 12, 26, 36, 30, 28, 30),
+(11, 3, 13, 26, 37, 31, 28, 31),
+(11, 3, 14, 27, 39, 32, 29, 32),
+(11, 3, 15, 27, 40, 34, 30, 32),
+(11, 3, 16, 28, 42, 35, 30, 33),
+(11, 3, 17, 28, 43, 36, 31, 34),
+(11, 3, 18, 29, 45, 37, 32, 35),
+(11, 3, 19, 29, 47, 38, 32, 35),
+(11, 3, 20, 30, 48, 39, 33, 36),
+(11, 3, 21, 31, 50, 40, 34, 37),
+(11, 3, 22, 31, 51, 41, 34, 38),
+(11, 3, 23, 32, 53, 42, 35, 38),
+(11, 3, 24, 32, 55, 43, 36, 39),
+(11, 3, 25, 33, 57, 44, 37, 40),
+(11, 3, 26, 33, 58, 46, 37, 41),
+(11, 3, 27, 34, 60, 47, 38, 42),
+(11, 3, 28, 35, 62, 48, 39, 42),
+(11, 3, 29, 35, 63, 49, 40, 43),
+(11, 3, 30, 36, 65, 50, 40, 44),
+(11, 3, 31, 36, 67, 52, 41, 45),
+(11, 3, 32, 37, 69, 53, 42, 46),
+(11, 3, 33, 38, 71, 54, 43, 47),
+(11, 3, 34, 38, 72, 55, 44, 48),
+(11, 3, 35, 39, 74, 57, 44, 48),
+(11, 3, 36, 39, 76, 58, 45, 49),
+(11, 3, 37, 40, 78, 59, 46, 50),
+(11, 3, 38, 41, 80, 60, 47, 51),
+(11, 3, 39, 41, 82, 62, 48, 52),
+(11, 3, 40, 42, 84, 63, 49, 53),
+(11, 3, 41, 43, 86, 64, 50, 54),
+(11, 3, 42, 43, 88, 66, 50, 55),
+(11, 3, 43, 44, 90, 67, 51, 56),
+(11, 3, 44, 45, 91, 68, 52, 57),
+(11, 3, 45, 45, 93, 70, 53, 58),
+(11, 3, 46, 46, 95, 71, 54, 59),
+(11, 3, 47, 47, 98, 72, 55, 60),
+(11, 3, 48, 48, 100, 74, 56, 61),
+(11, 3, 49, 48, 102, 75, 57, 62),
+(11, 3, 50, 49, 104, 77, 58, 63),
+(11, 3, 51, 50, 106, 78, 59, 64),
+(11, 3, 52, 51, 108, 79, 60, 65),
+(11, 3, 53, 51, 110, 81, 61, 66),
+(11, 3, 54, 52, 112, 82, 61, 67),
+(11, 3, 55, 53, 114, 84, 62, 68),
+(11, 3, 56, 54, 116, 85, 63, 69),
+(11, 3, 57, 54, 118, 87, 64, 70),
+(11, 3, 58, 55, 121, 88, 65, 71),
+(11, 3, 59, 56, 123, 90, 66, 72),
+(11, 3, 60, 57, 125, 91, 67, 74),
+(11, 3, 61, 58, 127, 93, 68, 75),
+(11, 3, 62, 58, 130, 94, 69, 76),
+(11, 3, 63, 59, 132, 96, 71, 77),
+(11, 3, 64, 60, 134, 97, 72, 78),
+(11, 3, 65, 61, 136, 99, 73, 79),
+(11, 3, 66, 62, 139, 101, 74, 80),
+(11, 3, 67, 62, 141, 102, 75, 81),
+(11, 3, 68, 63, 143, 104, 76, 83),
+(11, 3, 69, 64, 146, 105, 77, 84),
+(11, 3, 70, 65, 148, 107, 78, 85),
+(11, 3, 71, 66, 151, 109, 79, 86),
+(11, 3, 72, 67, 154, 111, 80, 87),
+(11, 3, 73, 68, 157, 113, 81, 89),
+(11, 3, 74, 69, 160, 115, 83, 90),
+(11, 3, 75, 70, 163, 117, 84, 92),
+(11, 3, 76, 71, 166, 119, 85, 93),
+(11, 3, 77, 72, 169, 121, 87, 95),
+(11, 3, 78, 73, 172, 123, 88, 96),
+(11, 3, 79, 74, 175, 125, 89, 98),
+(11, 3, 80, 75, 178, 127, 91, 99),
+(11, 5, 1, 21, 17, 19, 23, 25),
+(11, 5, 2, 21, 17, 19, 24, 26),
+(11, 5, 3, 21, 17, 20, 26, 28),
+(11, 5, 4, 21, 18, 20, 27, 29),
+(11, 5, 5, 22, 18, 20, 28, 30),
+(11, 5, 6, 22, 18, 21, 30, 32),
+(11, 5, 7, 22, 18, 21, 31, 33),
+(11, 5, 8, 22, 19, 22, 32, 35),
+(11, 5, 9, 22, 19, 22, 34, 36),
+(11, 5, 10, 22, 19, 22, 35, 38),
+(11, 5, 11, 23, 19, 23, 37, 39),
+(11, 5, 12, 23, 20, 23, 38, 41),
+(11, 5, 13, 23, 20, 24, 39, 42),
+(11, 5, 14, 23, 20, 24, 41, 44),
+(11, 5, 15, 23, 20, 25, 42, 45),
+(11, 5, 16, 24, 21, 25, 44, 47),
+(11, 5, 17, 24, 21, 25, 45, 48),
+(11, 5, 18, 24, 21, 26, 47, 50),
+(11, 5, 19, 24, 22, 26, 48, 51),
+(11, 5, 20, 24, 22, 27, 50, 53),
+(11, 5, 21, 25, 22, 27, 51, 55),
+(11, 5, 22, 25, 22, 28, 53, 56),
+(11, 5, 23, 25, 23, 28, 55, 58),
+(11, 5, 24, 25, 23, 29, 56, 60),
+(11, 5, 25, 25, 23, 29, 58, 61),
+(11, 5, 26, 26, 24, 30, 60, 63),
+(11, 5, 27, 26, 24, 30, 61, 65),
+(11, 5, 28, 26, 24, 31, 63, 66),
+(11, 5, 29, 26, 25, 31, 65, 68),
+(11, 5, 30, 27, 25, 32, 66, 70),
+(11, 5, 31, 27, 25, 32, 68, 72),
+(11, 5, 32, 27, 26, 33, 70, 73),
+(11, 5, 33, 27, 26, 33, 71, 75),
+(11, 5, 34, 28, 26, 34, 73, 77),
+(11, 5, 35, 28, 27, 34, 75, 79),
+(11, 5, 36, 28, 27, 35, 77, 81),
+(11, 5, 37, 29, 28, 35, 79, 83),
+(11, 5, 38, 29, 28, 36, 80, 85),
+(11, 5, 39, 29, 28, 37, 82, 86),
+(11, 5, 40, 29, 29, 37, 84, 88),
+(11, 5, 41, 30, 29, 38, 86, 90),
+(11, 5, 42, 30, 29, 38, 88, 92),
+(11, 5, 43, 30, 30, 39, 90, 94),
+(11, 5, 44, 31, 30, 39, 91, 96),
+(11, 5, 45, 31, 31, 40, 93, 98),
+(11, 5, 46, 31, 31, 41, 95, 100),
+(11, 5, 47, 32, 31, 41, 97, 102),
+(11, 5, 48, 32, 32, 42, 99, 104),
+(11, 5, 49, 32, 32, 43, 101, 106),
+(11, 5, 50, 33, 33, 43, 103, 108),
+(11, 5, 51, 33, 33, 44, 105, 110),
+(11, 5, 52, 33, 34, 44, 107, 113),
+(11, 5, 53, 34, 34, 45, 109, 115),
+(11, 5, 54, 34, 34, 46, 111, 117),
+(11, 5, 55, 34, 35, 46, 113, 119),
+(11, 5, 56, 35, 35, 47, 115, 121),
+(11, 5, 57, 35, 36, 48, 118, 123),
+(11, 5, 58, 35, 36, 48, 120, 126),
+(11, 5, 59, 36, 37, 49, 122, 128),
+(11, 5, 60, 36, 37, 50, 124, 130),
+(11, 5, 61, 36, 38, 51, 126, 132),
+(11, 5, 62, 37, 38, 51, 128, 134),
+(11, 5, 63, 37, 39, 52, 130, 137),
+(11, 5, 64, 38, 39, 53, 133, 139),
+(11, 5, 65, 38, 40, 53, 135, 141),
+(11, 5, 66, 38, 40, 54, 137, 144),
+(11, 5, 67, 39, 40, 55, 139, 146),
+(11, 5, 68, 39, 41, 56, 141, 148),
+(11, 5, 69, 40, 41, 56, 144, 151),
+(11, 5, 70, 40, 42, 57, 146, 153),
+(11, 5, 71, 40, 43, 58, 149, 156),
+(11, 5, 72, 41, 43, 58, 155, 159),
+(11, 5, 73, 41, 44, 59, 157, 160),
+(11, 5, 74, 42, 44, 61, 160, 163),
+(11, 5, 75, 42, 45, 62, 164, 166),
+(11, 5, 76, 42, 46, 62, 167, 169),
+(11, 5, 77, 43, 46, 63, 168, 172),
+(11, 5, 78, 43, 47, 64, 169, 177),
+(11, 5, 79, 44, 47, 65, 172, 180),
+(11, 5, 80, 44, 48, 66, 175, 183),
+(11, 6, 1, 24, 17, 21, 21, 22),
+(11, 6, 2, 25, 18, 22, 21, 22),
+(11, 6, 3, 27, 19, 23, 21, 23),
+(11, 6, 4, 28, 19, 25, 21, 23),
+(11, 6, 5, 29, 20, 26, 21, 23),
+(11, 6, 6, 31, 21, 27, 21, 23),
+(11, 6, 7, 32, 22, 28, 21, 24),
+(11, 6, 8, 33, 23, 29, 22, 24),
+(11, 6, 9, 35, 24, 31, 22, 24),
+(11, 6, 10, 36, 24, 32, 22, 25),
+(11, 6, 11, 37, 25, 33, 22, 25),
+(11, 6, 12, 39, 26, 34, 22, 25),
+(11, 6, 13, 40, 27, 36, 22, 26),
+(11, 6, 14, 42, 28, 37, 22, 26),
+(11, 6, 15, 43, 29, 38, 22, 26),
+(11, 6, 16, 45, 30, 40, 22, 27),
+(11, 6, 17, 46, 31, 41, 23, 27),
+(11, 6, 18, 48, 32, 43, 23, 27),
+(11, 6, 19, 49, 33, 44, 23, 28),
+(11, 6, 20, 51, 34, 45, 23, 28),
+(11, 6, 21, 52, 34, 47, 23, 28),
+(11, 6, 22, 54, 35, 48, 23, 29),
+(11, 6, 23, 55, 36, 50, 23, 29),
+(11, 6, 24, 57, 37, 51, 24, 30),
+(11, 6, 25, 59, 38, 52, 24, 30),
+(11, 6, 26, 60, 39, 54, 24, 30),
+(11, 6, 27, 62, 40, 55, 24, 31),
+(11, 6, 28, 63, 41, 57, 24, 31),
+(11, 6, 29, 65, 43, 58, 24, 32),
+(11, 6, 30, 67, 44, 60, 24, 32),
+(11, 6, 31, 69, 45, 62, 25, 32),
+(11, 6, 32, 70, 46, 63, 25, 33),
+(11, 6, 33, 72, 47, 65, 25, 33),
+(11, 6, 34, 74, 48, 66, 25, 34),
+(11, 6, 35, 75, 49, 68, 25, 34),
+(11, 6, 36, 77, 50, 69, 26, 35),
+(11, 6, 37, 79, 51, 71, 26, 35),
+(11, 6, 38, 81, 52, 73, 26, 35),
+(11, 6, 39, 83, 53, 74, 26, 36),
+(11, 6, 40, 84, 55, 76, 26, 36),
+(11, 6, 41, 86, 56, 78, 27, 37),
+(11, 6, 42, 88, 57, 79, 27, 37),
+(11, 6, 43, 90, 58, 81, 27, 38),
+(11, 6, 44, 92, 59, 83, 27, 38),
+(11, 6, 45, 94, 60, 85, 27, 39),
+(11, 6, 46, 96, 62, 86, 28, 39),
+(11, 6, 47, 98, 63, 88, 28, 40),
+(11, 6, 48, 100, 64, 90, 28, 40),
+(11, 6, 49, 102, 65, 92, 28, 41),
+(11, 6, 50, 103, 65, 93, 29, 41),
+(11, 6, 51, 105, 66, 94, 29, 42),
+(11, 6, 52, 106, 67, 95, 29, 42),
+(11, 6, 53, 107, 68, 96, 29, 43),
+(11, 6, 54, 108, 69, 97, 30, 44),
+(11, 6, 55, 109, 70, 98, 30, 44),
+(11, 6, 56, 112, 72, 101, 30, 45),
+(11, 6, 57, 114, 73, 103, 30, 45),
+(11, 6, 58, 117, 74, 105, 31, 46),
+(11, 6, 59, 119, 76, 107, 31, 46),
+(11, 6, 60, 121, 77, 109, 31, 47),
+(11, 6, 61, 123, 78, 111, 31, 48),
+(11, 6, 62, 126, 80, 113, 31, 48),
+(11, 6, 63, 128, 81, 116, 32, 49),
+(11, 6, 64, 131, 83, 118, 32, 49),
+(11, 6, 65, 136, 84, 120, 32, 50),
+(11, 6, 66, 140, 86, 123, 32, 51),
+(11, 6, 67, 141, 87, 125, 33, 51),
+(11, 6, 68, 141, 89, 127, 33, 52),
+(11, 6, 69, 144, 90, 130, 33, 53),
+(11, 6, 70, 147, 92, 132, 33, 53),
+(11, 6, 71, 150, 94, 135, 34, 54),
+(11, 6, 72, 152, 95, 137, 34, 55),
+(11, 6, 73, 155, 97, 140, 34, 56),
+(11, 6, 74, 162, 99, 142, 34, 56),
+(11, 6, 75, 165, 100, 145, 35, 57),
+(11, 6, 76, 167, 102, 146, 35, 58),
+(11, 6, 77, 169, 104, 150, 35, 59),
+(11, 6, 78, 170, 105, 152, 35, 59),
+(11, 6, 79, 173, 107, 156, 36, 60),
+(11, 6, 80, 176, 109, 159, 36, 61),
+(11, 7, 1, 22, 17, 20, 22, 24),
+(11, 7, 2, 23, 17, 21, 23, 25),
+(11, 7, 3, 24, 18, 22, 24, 26),
+(11, 7, 4, 25, 18, 23, 25, 27),
+(11, 7, 5, 25, 19, 24, 26, 28),
+(11, 7, 6, 26, 19, 25, 27, 29),
+(11, 7, 7, 27, 20, 26, 28, 30),
+(11, 7, 8, 28, 20, 27, 28, 31),
+(11, 7, 9, 29, 21, 28, 29, 32),
+(11, 7, 10, 30, 21, 29, 30, 33),
+(11, 7, 11, 31, 22, 30, 31, 35),
+(11, 7, 12, 32, 22, 31, 32, 36),
+(11, 7, 13, 33, 23, 32, 33, 37),
+(11, 7, 14, 34, 23, 33, 34, 38),
+(11, 7, 15, 34, 24, 35, 35, 39),
+(11, 7, 16, 35, 24, 36, 36, 40),
+(11, 7, 17, 36, 25, 37, 38, 42),
+(11, 7, 18, 37, 25, 38, 39, 43),
+(11, 7, 19, 38, 26, 39, 40, 44),
+(11, 7, 20, 39, 26, 40, 41, 45),
+(11, 7, 21, 40, 27, 41, 42, 46),
+(11, 7, 22, 41, 27, 43, 43, 48),
+(11, 7, 23, 43, 28, 44, 44, 49),
+(11, 7, 24, 44, 28, 45, 45, 50),
+(11, 7, 25, 45, 29, 46, 46, 51),
+(11, 7, 26, 46, 30, 47, 48, 53),
+(11, 7, 27, 47, 30, 49, 49, 54),
+(11, 7, 28, 48, 31, 50, 50, 55),
+(11, 7, 29, 49, 31, 51, 51, 57),
+(11, 7, 30, 50, 32, 53, 52, 58),
+(11, 7, 31, 51, 33, 54, 53, 59),
+(11, 7, 32, 52, 33, 55, 55, 61),
+(11, 7, 33, 53, 34, 56, 56, 62),
+(11, 7, 34, 55, 34, 58, 57, 64),
+(11, 7, 35, 56, 35, 59, 58, 65),
+(11, 7, 36, 57, 36, 60, 60, 66),
+(11, 7, 37, 58, 36, 62, 61, 68),
+(11, 7, 38, 59, 37, 63, 62, 69),
+(11, 7, 39, 61, 38, 65, 63, 71),
+(11, 7, 40, 62, 38, 66, 65, 72),
+(11, 7, 41, 63, 39, 67, 66, 74),
+(11, 7, 42, 64, 40, 69, 67, 75),
+(11, 7, 43, 65, 40, 70, 69, 77),
+(11, 7, 44, 67, 41, 72, 70, 78),
+(11, 7, 45, 68, 42, 73, 71, 80),
+(11, 7, 46, 69, 42, 75, 73, 81),
+(11, 7, 47, 71, 43, 76, 74, 83);
+INSERT IGNORE INTO `player_levelstats` (`race`, `class`, `level`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES
+(11, 7, 48, 72, 44, 78, 76, 84),
+(11, 7, 49, 73, 45, 79, 77, 86),
+(11, 7, 50, 74, 45, 81, 78, 88),
+(11, 7, 51, 76, 46, 82, 80, 89),
+(11, 7, 52, 77, 47, 84, 81, 91),
+(11, 7, 53, 78, 47, 85, 83, 92),
+(11, 7, 54, 80, 48, 87, 84, 94),
+(11, 7, 55, 81, 49, 88, 86, 96),
+(11, 7, 56, 83, 50, 90, 87, 97),
+(11, 7, 57, 84, 50, 91, 89, 99),
+(11, 7, 58, 85, 51, 93, 90, 101),
+(11, 7, 59, 87, 52, 95, 92, 102),
+(11, 7, 60, 88, 53, 96, 93, 104),
+(11, 7, 61, 90, 54, 98, 95, 106),
+(11, 7, 62, 91, 54, 99, 96, 108),
+(11, 7, 63, 93, 55, 101, 98, 109),
+(11, 7, 64, 94, 56, 103, 99, 111),
+(11, 7, 65, 95, 57, 104, 101, 113),
+(11, 7, 66, 97, 58, 106, 103, 115),
+(11, 7, 67, 98, 58, 108, 104, 117),
+(11, 7, 68, 100, 59, 110, 106, 118),
+(11, 7, 69, 101, 60, 111, 107, 120),
+(11, 7, 70, 103, 61, 113, 109, 122),
+(11, 7, 71, 104, 62, 115, 122, 124),
+(11, 7, 72, 106, 63, 117, 124, 127),
+(11, 7, 73, 108, 64, 119, 126, 129),
+(11, 7, 74, 110, 65, 122, 128, 131),
+(11, 7, 75, 112, 66, 124, 130, 133),
+(11, 7, 76, 114, 67, 126, 133, 136),
+(11, 7, 77, 115, 68, 128, 135, 138),
+(11, 7, 78, 117, 69, 130, 137, 140),
+(11, 7, 79, 119, 70, 133, 139, 143),
+(11, 7, 80, 121, 71, 135, 141, 145),
+(11, 8, 1, 21, 17, 19, 24, 24),
+(11, 8, 2, 21, 17, 19, 25, 25),
+(11, 8, 3, 21, 17, 20, 27, 27),
+(11, 8, 4, 21, 17, 20, 28, 28),
+(11, 8, 5, 21, 18, 20, 29, 29),
+(11, 8, 6, 21, 18, 20, 31, 31),
+(11, 8, 7, 21, 18, 21, 32, 32),
+(11, 8, 8, 22, 18, 21, 34, 33),
+(11, 8, 9, 22, 18, 21, 35, 35),
+(11, 8, 10, 22, 19, 22, 37, 36),
+(11, 8, 11, 22, 19, 22, 38, 37),
+(11, 8, 12, 22, 19, 22, 40, 39),
+(11, 8, 13, 22, 19, 23, 41, 40),
+(11, 8, 14, 22, 19, 23, 43, 42),
+(11, 8, 15, 22, 19, 23, 44, 43),
+(11, 8, 16, 22, 20, 24, 46, 45),
+(11, 8, 17, 23, 20, 24, 47, 46),
+(11, 8, 18, 23, 20, 24, 49, 48),
+(11, 8, 19, 23, 20, 25, 50, 49),
+(11, 8, 20, 23, 21, 25, 52, 51),
+(11, 8, 21, 23, 21, 26, 54, 52),
+(11, 8, 22, 23, 21, 26, 55, 54),
+(11, 8, 23, 23, 21, 26, 57, 56),
+(11, 8, 24, 24, 21, 27, 59, 57),
+(11, 8, 25, 24, 22, 27, 60, 59),
+(11, 8, 26, 24, 22, 27, 62, 60),
+(11, 8, 27, 24, 22, 28, 64, 62),
+(11, 8, 28, 24, 22, 28, 65, 64),
+(11, 8, 29, 24, 23, 29, 67, 65),
+(11, 8, 30, 24, 23, 29, 69, 67),
+(11, 8, 31, 25, 23, 30, 71, 69),
+(11, 8, 32, 25, 23, 30, 73, 71),
+(11, 8, 33, 25, 24, 30, 74, 72),
+(11, 8, 34, 25, 24, 31, 76, 74),
+(11, 8, 35, 25, 24, 31, 78, 76),
+(11, 8, 36, 26, 24, 32, 80, 78),
+(11, 8, 37, 26, 25, 32, 82, 79),
+(11, 8, 38, 26, 25, 33, 84, 81),
+(11, 8, 39, 26, 25, 33, 86, 83),
+(11, 8, 40, 26, 26, 34, 87, 85),
+(11, 8, 41, 27, 26, 34, 89, 87),
+(11, 8, 42, 27, 26, 35, 91, 89),
+(11, 8, 43, 27, 27, 35, 93, 91),
+(11, 8, 44, 27, 27, 36, 95, 92),
+(11, 8, 45, 27, 27, 36, 97, 94),
+(11, 8, 46, 28, 27, 37, 99, 96),
+(11, 8, 47, 28, 28, 37, 101, 98),
+(11, 8, 48, 28, 28, 38, 103, 100),
+(11, 8, 49, 28, 28, 38, 105, 102),
+(11, 8, 50, 29, 29, 39, 107, 104),
+(11, 8, 51, 29, 29, 39, 110, 106),
+(11, 8, 52, 29, 29, 40, 112, 108),
+(11, 8, 53, 29, 30, 40, 114, 110),
+(11, 8, 54, 30, 30, 41, 116, 112),
+(11, 8, 55, 30, 30, 41, 118, 114),
+(11, 8, 56, 30, 31, 42, 120, 116),
+(11, 8, 57, 30, 31, 42, 122, 118),
+(11, 8, 58, 31, 31, 43, 125, 121),
+(11, 8, 59, 31, 32, 43, 127, 123),
+(11, 8, 60, 31, 32, 44, 129, 125),
+(11, 8, 61, 31, 33, 45, 131, 127),
+(11, 8, 62, 32, 33, 45, 133, 129),
+(11, 8, 63, 32, 33, 46, 136, 131),
+(11, 8, 64, 32, 34, 46, 138, 134),
+(11, 8, 65, 33, 34, 47, 140, 136),
+(11, 8, 66, 33, 34, 48, 143, 138),
+(11, 8, 67, 33, 35, 48, 145, 140),
+(11, 8, 68, 33, 35, 49, 147, 142),
+(11, 8, 69, 34, 36, 49, 150, 145),
+(11, 8, 70, 34, 36, 50, 152, 147),
+(11, 8, 71, 34, 36, 51, 155, 150),
+(11, 8, 72, 34, 37, 52, 161, 153),
+(11, 8, 73, 34, 37, 53, 161, 156),
+(11, 8, 74, 35, 38, 53, 164, 158),
+(11, 8, 75, 35, 38, 54, 167, 161),
+(11, 8, 76, 35, 38, 55, 170, 164),
+(11, 8, 77, 36, 39, 56, 173, 167),
+(11, 8, 78, 36, 39, 56, 176, 170),
+(11, 8, 79, 36, 40, 57, 179, 173),
+(11, 8, 80, 37, 40, 58, 182, 176);
+
+-- player_xp_for_level
+INSERT IGNORE INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES
+(1, 400),
+(2, 900),
+(3, 1400),
+(4, 2100),
+(5, 2800),
+(6, 3600),
+(7, 4500),
+(8, 5400),
+(9, 6500),
+(10, 7600),
+(11, 8700),
+(12, 9800),
+(13, 11000),
+(14, 12300),
+(15, 13600),
+(16, 15000),
+(17, 16400),
+(18, 17800),
+(19, 19300),
+(20, 20800),
+(21, 22400),
+(22, 24000),
+(23, 25500),
+(24, 27200),
+(25, 28900),
+(26, 30500),
+(27, 32200),
+(28, 33900),
+(29, 36300),
+(30, 38800),
+(31, 41600),
+(32, 44600),
+(33, 48000),
+(34, 51400),
+(35, 55000),
+(36, 58700),
+(37, 62400),
+(38, 66200),
+(39, 70200),
+(40, 74300),
+(41, 78500),
+(42, 82800),
+(43, 87100),
+(44, 91600),
+(45, 96300),
+(46, 101000),
+(47, 105800),
+(48, 110700),
+(49, 115700),
+(50, 120900),
+(51, 126100),
+(52, 131500),
+(53, 137000),
+(54, 142500),
+(55, 148200),
+(56, 154000),
+(57, 159900),
+(58, 165800),
+(59, 172000),
+(60, 290000),
+(61, 317000),
+(62, 349000),
+(63, 386000),
+(64, 428000),
+(65, 475000),
+(66, 527000),
+(67, 585000),
+(68, 648000),
+(69, 717000),
+(70, 1523800),
+(71, 1539600),
+(72, 1555700),
+(73, 1571800),
+(74, 1587900),
+(75, 1604200),
+(76, 1620700),
+(77, 1637400),
+(78, 1653900),
+(79, 1670800);
+
+-- spell_learn_spell
+INSERT IGNORE INTO `spell_learn_spell` (`entry`, `SpellID`, `Active`) VALUES
+(71, 7376, 0),
+(768, 3025, 0),
+(783, 5419, 0),
+(1066, 5421, 0),
+(2457, 21156, 0),
+(2458, 7381, 0),
+(5487, 1178, 0),
+(5487, 21178, 0),
+(5784, 33388, 1),
+(9634, 9635, 0),
+(9634, 21178, 0),
+(13819, 33388, 1),
+(17002, 24867, 0),
+(23161, 33391, 1),
+(23214, 33391, 1),
+(24858, 24905, 0),
+(24866, 24864, 0),
+(33872, 47179, 0),
+(33873, 47180, 0),
+(33891, 5420, 0),
+(33891, 34123, 0),
+(33943, 33948, 0),
+(33943, 34090, 1),
+(33943, 34764, 0),
+(34767, 33391, 1),
+(34769, 33388, 1),
+(40123, 40121, 0),
+(40123, 40122, 0),
+(53428, 53341, 1),
+(53428, 53343, 1),
+(58984, 21009, 1);
+
+-- spell_loot_template
+-- No data yet
+
+DELETE FROM `item_template` WHERE entry IN (34648,34649,34650,34651,34652,34653,34655,34656,34657,34658,34659,38145,38147,41751);
+INSERT INTO `item_template` VALUES
+(34648,4,4,-1,'Acherus Knight\'s Greaves',51496,2,32768,1,51,10,8,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,10,7,12,3,7,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,392,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34649,4,4,-1,'Acherus Knight\'s Gauntlets',51498,2,32768,1,34,6,10,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,6,32,8,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,356,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34650,4,4,-1,'Acherus Knight\'s Tunic',51494,2,32768,1,69,13,5,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,20,7,11,32,7,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,570,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34651,4,4,-1,'Acherus Knight\'s Girdle',51497,2,32768,1,35,7,6,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,10,32,15,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,320,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34652,4,4,-1,'Acherus Knight\'s Hood',51495,2,32768,1,52,10,1,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,15,32,9,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,463,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34653,4,4,-1,'Acherus Knight\'s Wristguard',51500,2,32768,1,36,7,9,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,7,31,7,7,11,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,249,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34655,4,4,-1,'Acherus Knight\'s Pauldrons',51501,2,32768,1,54,10,3,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,9,7,11,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,427,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34656,4,4,-1,'Acherus Knight\'s Cover',51499,2,32768,1,73,14,7,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,13,3,10,7,15,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,499,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,85,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34657,4,0,-1,'Choker of Damnation',6539,2,32768,1,2303,575,2,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,9,7,8,31,6,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,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34658,4,0,-1,'Plague Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,7,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34659,4,1,-1,'Acherus Knight\'s Shroud',49738,2,32768,1,31,6,16,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,12,7,7,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,39,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38145,1,0,-1,'Deathweave Bag',1282,1,32768,1,0,0,18,-1,-1,35,0,0,0,0,0,0,0,0,0,1,12,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38147,4,0,-1,'Corrupted Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,32,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(41751,0,5,-1,'Black Mushroom',36728,1,0,1,100,5,0,-1,-1,65,55,0,0,0,0,0,0,0,0,20,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,27094,0,-1,0,0,11,1000,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0);
+
+DELETE FROM `playercreateinfo` WHERE class = 6;
+INSERT INTO `playercreateinfo` VALUES
+(1 ,6,609,4298,2355.84,-5664.77,426.028),
+(2 ,6,609,4298,2358.44,-5666.9, 426.023),
+(3 ,6,609,4298,2358.44,-5666.9, 426.023),
+(4 ,6,609,4298,2356.21,-5662.21,426.026),
+(5 ,6,609,4298,2356.21,-5662.21,426.026),
+(6 ,6,609,4298,2358.17,-5663.21,426.027),
+(7 ,6,609,4298,2355.05,-5661.7, 426.026),
+(8 ,6,609,4298,2355.05,-5661.7, 426.026),
+(10,6,609,4298,2355.84,-5664.77,426.028),
+(11,6,609,4298,2358.17,-5663.21,426.027);
+DELETE FROM `playercreateinfo` WHERE `race`=7 AND `class` IN (4,8,9);
+INSERT INTO `playercreateinfo` VALUES
+(7,4,0,1,-6240,331,383),
+(7,8,0,1,-6240,331,383),
+(7,9,0,1,-6240,331,383); \ No newline at end of file
diff --git a/sql/TBC-WLK_converter/TBC-WLK_world_run_only_once.sql b/sql/TBC-WLK_converter/TBC-WLK_world_run_only_once.sql
new file mode 100644
index 00000000000..798d296370c
--- /dev/null
+++ b/sql/TBC-WLK_converter/TBC-WLK_world_run_only_once.sql
@@ -0,0 +1,189 @@
+DROP TABLE IF EXISTS `achievement_reward`;
+CREATE TABLE `achievement_reward` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `title_A` mediumint(8) unsigned NOT NULL default '0',
+ `title_H` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `sender` mediumint(8) unsigned NOT NULL default '0',
+ `subject` varchar(255) default NULL,
+ `text` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+
+DROP TABLE IF EXISTS `locales_achievement_reward`;
+CREATE TABLE `locales_achievement_reward` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `subject_loc1` varchar(100) NOT NULL default '',
+ `subject_loc2` varchar(100) NOT NULL default '',
+ `subject_loc3` varchar(100) NOT NULL default '',
+ `subject_loc4` varchar(100) NOT NULL default '',
+ `subject_loc5` varchar(100) NOT NULL default '',
+ `subject_loc6` varchar(100) NOT NULL default '',
+ `subject_loc7` varchar(100) NOT NULL default '',
+ `subject_loc8` varchar(100) NOT NULL default '',
+ `text_loc1` text default NULL,
+ `text_loc2` text default NULL,
+ `text_loc3` text default NULL,
+ `text_loc4` text default NULL,
+ `text_loc5` text default NULL,
+ `text_loc6` text default NULL,
+ `text_loc7` text default NULL,
+ `text_loc8` text default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+TRUNCATE `creature_equip_template`;
+ALTER TABLE `creature_equip_template`
+ DROP COLUMN `equipinfo1`,
+ DROP COLUMN `equipinfo2`,
+ DROP COLUMN `equipinfo3`,
+ DROP COLUMN `equipslot1`,
+ DROP COLUMN `equipslot2`,
+ DROP COLUMN `equipslot3`,
+ CHANGE COLUMN `equipmodel1` `equipentry1` mediumint(8) UNSIGNED default '0' NOT NULL,
+ CHANGE COLUMN `equipmodel2` `equipentry2` mediumint(8) UNSIGNED default '0' NOT NULL,
+ CHANGE COLUMN `equipmodel3` `equipentry3` mediumint(8) UNSIGNED default '0' NOT NULL;
+UPDATE `creature_template` set equipment_id = 0;
+
+ALTER TABLE `item_template`
+ ADD COLUMN `ScalingStatDistribution` smallint(6) DEFAULT '0' NOT NULL after `stat_value10`,
+ ADD COLUMN `ScalingStatValue` smallint(6) DEFAULT '0' NOT NULL after `ScalingStatDistribution`,
+ ADD COLUMN `ItemLimitCategory` smallint(6) DEFAULT '0' NOT NULL after `ArmorDamageModifier`,
+ CHANGE COLUMN `Duration` `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time' after ArmorDamageModifier,
+ ADD COLUMN `StatsCount` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `ContainerSlots`,
+ CHANGE COLUMN `TotemCategory` `TotemCategory` mediumint(9) NOT NULL default '0';
+
+UPDATE `item_template`
+ SET `maxcount`=0 WHERE `maxcount` > 32000;
+UPDATE `item_template`
+ SET `stackable`=0 WHERE `stackable` > 32000;
+ALTER TABLE `item_template`
+ CHANGE COLUMN `maxcount` `maxcount` smallint(5) NOT NULL default '-1',
+ CHANGE COLUMN `stackable` `stackable` smallint(5) NOT NULL default '1';
+UPDATE `item_template`
+ SET `stackable`=-1 WHERE `stackable` = 0;
+
+ALTER TABLE `quest_template`
+ ADD COLUMN `PlayersSlain` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `CharTitleId`,
+ ADD COLUMN `BonusTalents` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `PlayersSlain`,
+ CHANGE COLUMN `RewHonorableKills` `RewHonorableKills` int unsigned NOT NULL default '0';
+
+DROP TABLE IF EXISTS `milling_loot_template`;
+CREATE TABLE `milling_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+DROP TABLE IF EXISTS `spell_affect`;
+CREATE TABLE `spell_affect` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `effectId` tinyint(3) unsigned NOT NULL default '0',
+ `SpellClassMask0` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask1` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask2` int(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`effectId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+ALTER TABLE `skill_discovery_template`
+ DROP PRIMARY KEY,
+ ADD PRIMARY KEY (`spellId`,`reqSpell`),
+ ADD COLUMN `reqClass` tinyint(2) unsigned NOT NULL default '0' COMMENT 'class requirement' AFTER reqSpell;
+ALTER TABLE skill_discovery_template
+ DROP COLUMN `reqClass`,
+ ADD COLUMN `reqSkillValue` smallint(5) unsigned NOT NULL default '0' COMMENT 'skill points requirement' AFTER reqSpell;
+
+DROP TABLE IF EXISTS `player_classlevelstats`;
+CREATE TABLE `player_classlevelstats` (
+ `class` tinyint(3) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL,
+ `basehp` smallint(5) unsigned NOT NULL,
+ `basemana` smallint(5) unsigned NOT NULL,
+ PRIMARY KEY (`class`,`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.';
+
+DROP TABLE IF EXISTS `player_levelstats`;
+CREATE TABLE `player_levelstats` (
+ `race` tinyint(3) unsigned NOT NULL,
+ `class` tinyint(3) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL,
+ `str` tinyint(3) unsigned NOT NULL,
+ `agi` tinyint(3) unsigned NOT NULL,
+ `sta` tinyint(3) unsigned NOT NULL,
+ `inte` tinyint(3) unsigned NOT NULL,
+ `spi` tinyint(3) unsigned NOT NULL,
+ PRIMARY KEY (`race`,`class`,`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.';
+
+DROP TABLE IF EXISTS `playercreateinfo_spell`;
+CREATE TABLE `playercreateinfo_spell` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `Spell` mediumint(8) unsigned NOT NULL default '0',
+ `Note` varchar(255) default NULL,
+ PRIMARY KEY (`race`,`class`,`Spell`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `playercreateinfo_action`;
+CREATE TABLE `playercreateinfo_action` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `button` smallint(5) unsigned NOT NULL default '0',
+ `action` smallint(5) unsigned NOT NULL default '0',
+ `type` smallint(5) unsigned NOT NULL default '0',
+ `misc` smallint(5) unsigned NOT NULL default '0',
+ KEY `playercreateinfo_race_class_index` (`race`,`class`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `spell_learn_spell`;
+CREATE TABLE `spell_learn_spell` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `SpellID` smallint(5) unsigned NOT NULL default '0',
+ `Active` tinyint(3) unsigned NOT NULL default '1',
+ PRIMARY KEY (`entry`,`SpellID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
+
+DROP TABLE IF EXISTS `spell_proc_event`;
+CREATE TABLE `spell_proc_event` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `SchoolMask` tinyint(4) NOT NULL default '0',
+ `SpellFamilyName` smallint(5) unsigned NOT NULL default '0',
+ `SpellFamilyMask0` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask1` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask2` int(10) unsigned NOT NULL default '0',
+ `procFlags` int(10) unsigned NOT NULL default '0',
+ `procEx` int(10) unsigned NOT NULL default '0',
+ `ppmRate` float NOT NULL default '0',
+ `CustomChance` float NOT NULL default '0',
+ `Cooldown` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `player_xp_for_level`;
+CREATE TABLE `player_xp_for_level` (
+ `lvl` int(3) unsigned NOT NULL,
+ `xp_for_next_level` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`lvl`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `spell_loot_template`;
+CREATE TABLE `spell_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; \ No newline at end of file
diff --git a/sql/characters.sql b/sql/characters.sql
index c2233b7e282..97d1e744e7c 100644
--- a/sql/characters.sql
+++ b/sql/characters.sql
@@ -1,8 +1,8 @@
-- MySQL dump 10.11
--
--- Host: localhost Database: char_temp
+-- Host: localhost Database: characters
-- ------------------------------------------------------
--- Server version 5.0.34-log
+-- Server version 5.0.45-Debian_1ubuntu3.1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -16,6 +16,51 @@
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
+<<<<<<< HEAD:sql/characters.sql
+=======
+-- Table structure for table `character_db_version`
+--
+
+DROP TABLE IF EXISTS `character_db_version`;
+CREATE TABLE `character_db_version` (
+ `required_7644_01_characters_character_pet` bit(1) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
+
+--
+-- Dumping data for table `character_db_version`
+--
+
+LOCK TABLES `character_db_version` WRITE;
+/*!40000 ALTER TABLE `character_db_version` DISABLE KEYS */;
+INSERT INTO `character_db_version` VALUES
+(NULL);
+/*!40000 ALTER TABLE `character_db_version` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+>>>>>>> ddfa7199207e499dd233854a75ac3a6216938873:sql/characters.sql
+-- Table structure for table `account_data`
+--
+
+DROP TABLE IF EXISTS `account_data`;
+CREATE TABLE `account_data` (
+ `account` int(11) unsigned NOT NULL default '0',
+ `type` int(11) unsigned NOT NULL default '0',
+ `time` bigint(11) unsigned NOT NULL default '0',
+ `data` longtext NOT NULL,
+ PRIMARY KEY (`account`,`type`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `account_data`
+--
+
+LOCK TABLES `account_data` WRITE;
+/*!40000 ALTER TABLE `account_data` DISABLE KEYS */;
+/*!40000 ALTER TABLE `account_data` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `arena_team`
--
@@ -264,8 +309,15 @@ CREATE TABLE `characters` (
`zone` int(11) unsigned NOT NULL default '0',
`death_expire_time` bigint(20) unsigned NOT NULL default '0',
`taxi_path` text,
- `arena_pending_points` int (10) UNSIGNED NOT NULL default '0',
+ `arena_pending_points` int(10) UNSIGNED NOT NULL default '0',
`latency` int(11) unsigned NOT NULL default '0',
+ `bgid` int(10) unsigned NOT NULL default '0',
+ `bgteam` int(10) unsigned NOT NULL default '0',
+ `bgmap` int(10) unsigned NOT NULL default '0',
+ `bgx` float NOT NULL default '0',
+ `bgy` float NOT NULL default '0',
+ `bgz` float NOT NULL default '0',
+ `bgo` float NOT NULL default '0',
PRIMARY KEY (`guid`),
KEY `idx_account` (`account`),
KEY `idx_online` (`online`),
@@ -282,6 +334,49 @@ LOCK TABLES `characters` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `character_achievement`
+--
+
+DROP TABLE IF EXISTS `character_achievement`;
+CREATE TABLE `character_achievement` (
+ `guid` int(11) NOT NULL,
+ `achievement` int(11) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`guid`,`achievement`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `character_achievement`
+--
+
+LOCK TABLES `character_achievement` WRITE;
+/*!40000 ALTER TABLE `character_achievement` DISABLE KEYS */;
+/*!40000 ALTER TABLE `character_achievement` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `character_achievement_progress`
+--
+
+DROP TABLE IF EXISTS `character_achievement_progress`;
+CREATE TABLE `character_achievement_progress` (
+ `guid` int(11) NOT NULL,
+ `criteria` int(11) NOT NULL,
+ `counter` int(11) NOT NULL,
+ `date` int(11) NOT NULL,
+ PRIMARY KEY (`guid`,`criteria`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `character_achievement_progress`
+--
+
+LOCK TABLES `character_achievement_progress` WRITE;
+/*!40000 ALTER TABLE `character_achievement_progress` DISABLE KEYS */;
+/*!40000 ALTER TABLE `character_achievement_progress` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `character_action`
--
@@ -463,9 +558,7 @@ CREATE TABLE `character_pet` (
`level` int(11) unsigned NOT NULL default '1',
`exp` int(11) unsigned NOT NULL default '0',
`Reactstate` tinyint(1) unsigned NOT NULL default '0',
- `loyaltypoints` int(11) NOT NULL default '0',
- `loyalty` int(11) unsigned NOT NULL default '0',
- `trainpoint` int(11) NOT NULL default '0',
+ `talentpoints` int(11) unsigned NOT NULL default '0',
`name` varchar(100) default 'Pet',
`renamed` tinyint(1) unsigned NOT NULL default '0',
`slot` int(11) unsigned NOT NULL default '0',
@@ -504,7 +597,7 @@ CREATE TABLE `character_pet_declinedname` (
`instrumental` varchar(12) NOT NULL default '',
`prepositional` varchar(12) NOT NULL default '',
PRIMARY KEY (`id`),
- KEY `owner_key` (`owner`)
+ KEY owner_key (`owner`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
--
@@ -601,7 +694,7 @@ CREATE TABLE `character_social` (
`guid` int(11) unsigned NOT NULL default '0' COMMENT 'Character Global Unique Identifier',
`friend` int(11) unsigned NOT NULL default '0' COMMENT 'Friend Global Unique Identifier',
`flags` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Friend Flags',
- `note` varchar(48) NOT NULL default '' COMMENT 'Friend Note',
+ `note` varchar(48) NOT NULL DEFAULT '' COMMENT 'Friend Note',
PRIMARY KEY (`guid`,`friend`,`flags`),
KEY `guid` (`guid`),
KEY `friend` (`friend`),
@@ -626,7 +719,6 @@ DROP TABLE IF EXISTS `character_spell`;
CREATE TABLE `character_spell` (
`guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
`spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier',
- `slot` int(11) unsigned NOT NULL default '0',
`active` tinyint(3) unsigned NOT NULL default '1',
`disabled` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`guid`,`spell`)
@@ -680,7 +772,7 @@ CREATE TABLE `character_tutorial` (
`tut6` int(11) unsigned NOT NULL default '0',
`tut7` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`account`,`realmid`),
- KEY `acc_key` (`account`)
+ KEY acc_key (`account`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
--
@@ -706,6 +798,7 @@ CREATE TABLE `corpse` (
`orientation` float NOT NULL default '0',
`zone` int(11) unsigned NOT NULL default '38' COMMENT 'Zone Identifier',
`map` int(11) unsigned NOT NULL default '0' COMMENT 'Map Identifier',
+ `phaseMask` smallint(5) unsigned NOT NULL default '1',
`data` longtext,
`time` bigint(20) unsigned NOT NULL default '0',
`corpse_type` tinyint(3) unsigned NOT NULL default '0',
@@ -939,7 +1032,7 @@ CREATE TABLE `guild_bank_item` (
`SlotId` tinyint(3) unsigned NOT NULL default '0',
`item_guid` int(11) unsigned NOT NULL default '0',
`item_entry` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`guildid`,`TabId`,`SlotId`),
+ PRIMARY KEY (`guildid`,`tabid`,`slotid`),
KEY `guildid_key` (`guildid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -986,7 +1079,7 @@ CREATE TABLE `guild_bank_tab` (
`TabId` tinyint(1) unsigned NOT NULL default '0',
`TabName` varchar(100) NOT NULL default '',
`TabIcon` varchar(100) NOT NULL default '',
- `TabText` varchar(500) NOT NULL default '',
+ `TabText` text,
PRIMARY KEY (`guildid`,`TabId`),
KEY `guildid_key` (`guildid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1013,7 +1106,7 @@ CREATE TABLE `guild_eventlog` (
`PlayerGuid2` int(11) NOT NULL COMMENT 'Player 2',
`NewRank` tinyint(2) NOT NULL COMMENT 'New rank(in case promotion/demotion)',
`TimeStamp` bigint(20) NOT NULL COMMENT 'Event UNIX time'
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Guild Eventlog';
+) ENGINE = InnoDB DEFAULT CHARSET = latin1 COMMENT 'Guild Eventlog';
--
-- Dumping data for table `guild_eventlog`
@@ -1051,7 +1144,7 @@ CREATE TABLE `guild_member` (
`BankRemSlotsTab5` int(11) unsigned NOT NULL default '0',
KEY `guildid_key` (`guildid`),
KEY `guildid_rank_key` (`guildid`,`rank`),
- KEY `guid_key` (`guid`)
+ UNIQUE KEY `guid_key` (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Guild System';
--
@@ -1264,7 +1357,6 @@ DROP TABLE IF EXISTS `pet_spell`;
CREATE TABLE `pet_spell` (
`guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
`spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier',
- `slot` int(11) unsigned NOT NULL default '0',
`active` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`guid`,`spell`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet System';
@@ -1351,7 +1443,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `saved_variables`;
CREATE TABLE `saved_variables` (
- `NextArenaPointDistributionTime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
+ `NextArenaPointDistributionTime` bigint(40) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Variable Saves';
--
@@ -1364,6 +1456,7 @@ LOCK TABLES `saved_variables` WRITE;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
@@ -1372,5 +1465,6 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2008-11-18 11:24:11
+-- Dump completed on 2008-01-10 11:37:06
+-- Updated on 2003-02-22 01:44:45 \ No newline at end of file
diff --git a/sql/mangos.sql b/sql/mangos.sql
new file mode 100644
index 00000000000..1055ffd0cf6
--- /dev/null
+++ b/sql/mangos.sql
@@ -0,0 +1,18020 @@
+-- MySQL dump 10.11
+--
+-- Host: localhost Database: mangos
+-- ------------------------------------------------------
+-- Server version 5.0.56-nt
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `db_version`
+--
+
+DROP TABLE IF EXISTS `db_version`;
+CREATE TABLE `db_version` (
+ `version` varchar(120) default NULL,
+ `creature_ai_version` varchar(120) default NULL,
+ `required_7662_02_mangos_spell_bonus_data` bit(1) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
+
+--
+-- Dumping data for table `db_version`
+--
+
+LOCK TABLES `db_version` WRITE;
+/*!40000 ALTER TABLE `db_version` DISABLE KEYS */;
+INSERT INTO `db_version` VALUES
+('Mangos default database.','Creature EventAI not provided.',NULL);
+/*!40000 ALTER TABLE `db_version` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `achievement_criteria_data`
+--
+
+DROP TABLE IF EXISTS `achievement_criteria_data`;
+CREATE TABLE `achievement_criteria_data` (
+ `criteria_id` mediumint(8) NOT NULL,
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `value1` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `value2` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`criteria_id`,`type`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Achievment system';
+
+--
+-- Dumping data for table `achievement_criteria_data`
+--
+
+LOCK TABLES `achievement_criteria_data` WRITE;
+/*!40000 ALTER TABLE `achievement_criteria_data` DISABLE KEYS */;
+/*!40000 ALTER TABLE `achievement_criteria_data` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `achievement_reward`
+--
+
+DROP TABLE IF EXISTS `achievement_reward`;
+CREATE TABLE `achievement_reward` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `title_A` mediumint(8) unsigned NOT NULL default '0',
+ `title_H` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `sender` mediumint(8) unsigned NOT NULL default '0',
+ `subject` varchar(255) default NULL,
+ `text` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Achievment system';
+
+--
+-- Dumping data for table `achievement_reward`
+--
+
+LOCK TABLES `achievement_reward` WRITE;
+/*!40000 ALTER TABLE `achievement_reward` DISABLE KEYS */;
+/*!40000 ALTER TABLE `achievement_reward` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `areatrigger_involvedrelation`
+--
+
+DROP TABLE IF EXISTS `areatrigger_involvedrelation`;
+CREATE TABLE `areatrigger_involvedrelation` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System';
+
+--
+-- Dumping data for table `areatrigger_involvedrelation`
+--
+
+LOCK TABLES `areatrigger_involvedrelation` WRITE;
+/*!40000 ALTER TABLE `areatrigger_involvedrelation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `areatrigger_scripts`
+--
+
+DROP TABLE IF EXISTS `areatrigger_scripts`;
+CREATE TABLE `areatrigger_scripts` (
+ `entry` MEDIUMINT( 8 ) NOT NULL ,
+ `ScriptName` CHAR( 64 ) NOT NULL ,
+ PRIMARY KEY ( `entry` )
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `areatrigger_scripts`
+--
+
+LOCK TABLES `areatrigger_scripts` WRITE;
+/*!40000 ALTER TABLE `areatrigger_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `areatrigger_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `areatrigger_tavern`
+--
+
+DROP TABLE IF EXISTS `areatrigger_tavern`;
+CREATE TABLE `areatrigger_tavern` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `name` text,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System';
+
+--
+-- Dumping data for table `areatrigger_tavern`
+--
+
+LOCK TABLES `areatrigger_tavern` WRITE;
+/*!40000 ALTER TABLE `areatrigger_tavern` DISABLE KEYS */;
+/*!40000 ALTER TABLE `areatrigger_tavern` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `areatrigger_teleport`
+--
+
+DROP TABLE IF EXISTS `areatrigger_teleport`;
+CREATE TABLE `areatrigger_teleport` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `name` text,
+ `required_level` tinyint(3) unsigned NOT NULL default '0',
+ `required_item` mediumint(8) unsigned NOT NULL default '0',
+ `required_item2` mediumint(8) unsigned NOT NULL default '0',
+ `heroic_key` mediumint(8) unsigned NOT NULL default '0',
+ `heroic_key2` mediumint(8) unsigned NOT NULL default '0',
+ `required_quest_done` int(11) unsigned NOT NULL default '0',
+ `required_failed_text` text,
+ `target_map` smallint(5) unsigned NOT NULL default '0',
+ `target_position_x` float NOT NULL default '0',
+ `target_position_y` float NOT NULL default '0',
+ `target_position_z` float NOT NULL default '0',
+ `target_orientation` float NOT NULL default '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System';
+
+--
+-- Dumping data for table `areatrigger_teleport`
+--
+
+LOCK TABLES `areatrigger_teleport` WRITE;
+/*!40000 ALTER TABLE `areatrigger_teleport` DISABLE KEYS */;
+/*!40000 ALTER TABLE `areatrigger_teleport` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `battleground_template`
+--
+
+DROP TABLE IF EXISTS `battleground_template`;
+CREATE TABLE `battleground_template` (
+ `id` mediumint(8) unsigned NOT NULL,
+ `MinPlayersPerTeam` smallint(5) unsigned NOT NULL default '0',
+ `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL default '0',
+ `MinLvl` tinyint(3) unsigned NOT NULL default '0',
+ `MaxLvl` tinyint(3) unsigned NOT NULL default '0',
+ `AllianceStartLoc` mediumint(8) unsigned NOT NULL,
+ `AllianceStartO` float NOT NULL,
+ `HordeStartLoc` mediumint(8) unsigned NOT NULL,
+ `HordeStartO` float NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `battleground_template`
+--
+
+LOCK TABLES `battleground_template` WRITE;
+/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */;
+INSERT INTO `battleground_template` VALUES
+(1,0,0,0,0,611,2.72532,610,2.27452),
+(2,0,0,0,0,769,3.14159,770,3.14159),
+(4,0,2,10,70,929,0,936,3.14159),
+(3,0,0,0,0,890,3.40156,889,0.263892),
+(5,0,2,10,70,939,0,940,3.14159),
+(6,0,2,10,70,0,0,0,0),
+(7,0,0,0,0,1103,3.40156,1104,0.263892),
+(8,0,2,10,70,1258,0,1259,3.14159),
+(9,0,0,0,0,1367,0,1368,0),
+(10,5,5,10,80,1362,0,1363,0),
+(11,5,5,10,80,1364,0,1365,0);
+/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `battlemaster_entry`
+--
+
+DROP TABLE IF EXISTS `battlemaster_entry`;
+CREATE TABLE `battlemaster_entry` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Entry of a creature',
+ `bg_template` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Battleground template id',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `battlemaster_entry`
+--
+
+LOCK TABLES `battlemaster_entry` WRITE;
+/*!40000 ALTER TABLE `battlemaster_entry` DISABLE KEYS */;
+/*!40000 ALTER TABLE `battlemaster_entry` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `command`
+--
+
+DROP TABLE IF EXISTS `command`;
+CREATE TABLE `command` (
+ `name` varchar(50) NOT NULL default '',
+ `security` tinyint(3) unsigned NOT NULL default '0',
+ `help` longtext,
+ PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Chat System';
+
+--
+-- Dumping data for table `command`
+--
+
+LOCK TABLES `command` WRITE;
+/*!40000 ALTER TABLE `command` DISABLE KEYS */;
+INSERT INTO `command` VALUES
+('account',0,'Syntax: .account\r\n\r\nDisplay the access level of your account.'),
+('account create',4,'Syntax: .account create $account $password\r\n\r\nCreate account and set password to it.'),
+('account delete',4,'Syntax: .account delete $account\r\n\r\nDelete account with all characters.'),
+('account onlinelist',4,'Syntax: .account onlinelist\r\n\r\nShow list of online accounts.'),
+('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
+('account set gmlevel',4,'Syntax: .account set gmlevel [$account] #level\r\n\r\nSet the security level for targeted player (can''t be used at self) or for account $name to a level of #level.\r\n\r\n#level may range from 0 to 3.'),
+('account set password',4,'Syntax: .account set password $account $password $password\r\n\r\nSet password for account.'),
+('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'),
+('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'),
+('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'),
+('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'),
+('ban account',3,'Syntax: .ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban character',3,'Syntax: .ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban ip',3,'Syntax: .ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('baninfo account',3,'Syntax: .baninfo account\r\nWatch full information about a specific ban.'),
+('baninfo character',3,'Syntax: .baninfo character\r\nWatch full information about a specific ban.'),
+('baninfo ip',3,'Syntax: .baninfo ip\r\nWatch full information about a specific ban.'),
+('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'),
+('banlist account',3,'Syntax: .banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'),
+('banlist character',3,'Syntax: .banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'),
+('banlist ip',3,'Syntax: .banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'),
+('cast',3,'Syntax: .cast #spellid [triggered]\r\n Cast #spellid to selected target. If no target selected cast to self. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n Selected target will cast #spellid to your character. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n You will cast spell to pint at distance #dist. If \'trigered\' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'),
+('cast self',3,'Syntax: .cast self #spellid [triggered]\r\nCast #spellid by target at target itself. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast target',3,'Syntax: .cast target #spellid [triggered]\r\n Selected target will cast #spellid to his victim. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('chardelete',4,'Syntax: .chardelete $charactername\r\n\r\nDelete character.'),
+('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'),
+('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'),
+('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'),
+('damage',3,'Syntax: .damage $damage_amount [$school [$spellid]]\r\n\r\nApply $damage to target. If not $school and $spellid provided then this flat clean melee damage without any modifiers. If $school provided then damage modified by armor reduction (if school physical), and target absorbing modifiers and result applied as melee damage to target. If spell provided then damage modified and applied as spell damage. $spellid can be shift-link.'),
+('debug anim',2,'Syntax: .debug anim #emoteid\r\n\r\nPlay emote #emoteid for your character.'),
+('debug arena',3,'Syntax: .debug arena\r\n\r\nToggle debug mode for arenas. In debug mode GM can start arena with single player.'),
+('debug bg',3,'Syntax: .debug bg\r\n\r\nToggle debug mode for battlegrounds. In debug mode GM can start battleground with single player.'),
+('debug getvalue',3,'Syntax: .debug getvalue #field #isInt\r\n\r\nGet the field #field of the selected creature. If no creature is selected, get the content of your field.\r\n\r\nUse a #isInt of value 1 if the expected field content is an integer.'),
+('debug play cinematic',1,'Syntax: .debug play cinematic #cinematicid\r\n\r\nPlay cinematic #cinematicid for you. You stay at place while your mind fly.\r\n'),
+('debug play movie',1,'Syntax: .debug play movie #movieid\r\n\r\nPlay movie #movieid for you.'),
+('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),
+('debug setvalue',3,'Syntax: .debug setvalue #field #value #isInt\r\n\r\nSet the field #field of the selected creature with value #value. If no creature is selected, set the content of your field.\r\n\r\nUse a #isInt of value 1 if #value is an integer.'),
+('debug update',3,'Syntax: .debug update #field #value\r\n\r\nUpdate the field #field of the selected character or creature with value #value.\r\n\r\nIf no #value is provided, display the content of field #field.'),
+('debug Mod32Value',3,'Syntax: .debug Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'),
+('delticket',2,'Syntax: .delticket all\r\n .delticket #num\r\n .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),
+('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),
+('die',3,'Syntax: .die\r\n\r\nKill the selected player. If no player is selected, it will kill you.'),
+('dismount',0,'Syntax: .dismount\r\n\r\nDismount you, if you are mounted.'),
+('distance',3,'Syntax: .distance [$name/$link]\r\n\r\nDisplay the distance from your character to the selected creature/player, or player with name $name, or player/creature/gameobject pointed to shift-link with guid.'),
+('event',2,'Syntax: .event #event_id\r\nShow details about event with #event_id.'),
+('event activelist',2,'Syntax: .event activelist\r\nShow list of currently active events.'),
+('event start',2,'Syntax: .event start #event_id\r\nStart event #event_id. Set start time for event to current moment (change not saved in DB).'),
+('event stop',2,'Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'),
+('explorecheat',3,'Syntax: .explorecheat #flag\r\n\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),
+('flusharenapoints','3','Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'),
+('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'),
+('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'),
+('gm fly',3,'Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'),
+('gm ingame',0,'Syntax: .gm ingame\r\n\r\nDisplay a list of available in game Game Masters.'),
+('gm list',3,'Syntax: .gm list\r\n\r\nDisplay a list of all Game Masters accounts and security levels.'),
+('gm online',0,'Syntax: .gm online\r\n\r\nDisplay a list of available Game Masters.'),
+('gm visible',1,'Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'),
+('go creature',1,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),
+('go graveyard',1,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),
+('go grid',1,'Syntax: .go grid #gridX #gridY [#mapId]\r\n\r\nTeleport the gm to center of grid with provided indexes at map #mapId (or current map if it not provided).'),
+('go object',1,'Syntax: .go object #object_guid\r\nTeleport your character to gameobject with guid #object_guid'),
+('go trigger',1,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'),
+('go xy',1,'Syntax: .go xy #x #y [#mapid]\r\n\r\nTeleport player to point with (#x,#y) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),
+('go xyz',1,'Syntax: .go xyz #x #y #z [#mapid]\r\n\r\nTeleport player to point with (#x,#y,#z) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),
+('go zonexy',1,'Syntax: .go zonexy #x #y [#zone]\r\n\r\nTeleport player to point with (#x,#y) client coordinates at ground(water) level in zone #zoneid or current zone if #zoneid not provided. You can look up zone using .lookup area $namepart'),
+('gobject add',2,'Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'),
+('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'),
+('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'),
+('gobject near',2,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),
+('gobject setphase',2,'Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'),
+('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'),
+('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'),
+('goname',1,'Syntax: .goname $charactername\r\n\r\nTeleport to the given character. Either specify the character name or click on the character\'s portrait, e.g. when you are in a group.'),
+('gps',1,'Syntax: .gps [$name|$shift-link]\r\n\r\nDisplay the position information for a selected character or creature (also if player name $name provided then for named player, or if creature/gameobject shift-link provided then pointed creature/gameobject if it loaded). Position information includes X, Y, Z, and orientation, map Id and zone Id'),
+('groupgo',1,'Syntax: .groupgo $charactername\r\n\r\nTeleport the given character and his group to you.'),
+('guid',2,'Syntax: .guid\r\n\r\nDisplay the GUID for the selected character.'),
+('guild create',2,'Syntax: .guild create $GuildLeaderName $GuildName\r\n\r\nCreate a guild named $GuildName with the player $GuildLeaderName as leader.'),
+('guild delete',2,'Syntax: .guild delete $GuildName\r\n\r\nDelete guild $GuildName.'),
+('guild invite',2,'Syntax: .guild invite $CharacterName $GuildName\r\n\r\nAdd $CharacterName into a guild $GuildName.'),
+('guild rank',2,'Syntax: .guild rank $CharacterName #Rank\r\n\r\nSet for $CharacterName rank #Rank in a guild.'),
+('guild uninvite',2,'Syntax: .guild uninvite $CharacterName\r\n\r\nRemove $CharacterName from a guild.'),
+('help',0,'Syntax: .help [$command]\r\n\r\nDisplay usage instructions for the given $command. If no $command provided show list available commands.'),
+('hidearea',3,'Syntax: .hidearea #areaid\r\n\r\nHide the area of #areaid to the selected character. If no character is selected, hide this area to you.'),
+('honor add',2,'Syntax: .honor add $amount\r\n\r\nAdd a certain amount of honor (gained today) to the selected player.'),
+('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),
+('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),
+('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),
+('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected player\'s binds will be cleared.'),
+('instance listbinds',3,'Syntax: .instance listbinds\r\n Lists the binds of the selected player.'),
+('instance stats',3,'Syntax: .instance stats\r\n Shows statistics about instances.'),
+('instance savedata',3,'Syntax: .instance savedata\r\n Save the InstanceData for the current player\'s map to the DB.'),
+('itemmove',2,'Syntax: .itemmove #sourceslotid #destinationslotid\r\n\r\nMove an item from slots #sourceslotid to #destinationslotid in your inventory\r\n\r\nNot yet implemented'),
+('kick',2,'Syntax: .kick [$charactername]\r\n\r\nKick the given character name from the world. If no character name is provided then the selected player (except for yourself) will be kicked.'),
+('learn',3,'Syntax: .learn #spell [all]\r\n\r\nSelected character learn a spell of id #spell. If \'all\' provided then all ranks learned.'),
+('learn all',3,'Syntax: .learn all\r\n\r\nLearn all big set different spell maybe useful for Administaror.'),
+('learn all_crafts',2,'Syntax: .learn crafts\r\n\r\nLearn all professions and recipes.'),
+('learn all_default',1,'Syntax: .learn all_default [$playername]\r\n\r\nLearn for selected/$playername player all default spells for his race/class and spells rewarded by completed quests.'),
+('learn all_gm',2,'Syntax: .learn all_gm\r\n\r\nLearn all default spells for Game Masters.'),
+('learn all_lang',1,'Syntax: .learn all_lang\r\n\r\nLearn all languages'),
+('learn all_myclass',3,'Syntax: .learn all_myclass\r\n\r\nLearn all spells and talents available for his class.'),
+('learn all_mypettalents',3,'Syntax: .learn all_mypettalents\r\n\r\nLearn all talents for your pet available for his creature type (only for hunter pets).'),
+('learn all_myspells',3,'Syntax: .learn all_myspells\r\n\r\nLearn all spells (except talents and spells with first rank learned as talent) available for his class.'),
+('learn all_mytalents',3,'Syntax: .learn all_mytalents\r\n\r\nLearn all talents (and spells with first rank learned as talent) available for his class.'),
+('learn all_recipes',2,'Syntax: .learn all_recipes [$profession]\r\rLearns all recipes of specified profession and sets skill level to max.\rExample: .learn all_recipes enchanting'),
+('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent VALUESrecalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'),
+('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'),
+('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'),
+('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails, auctions, and guild banks. Output item guids, item owner guid, owner account and owner name (guild name and guid in case guild bank). Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'),
+('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),
+('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),
+('lockaccount',0,'Syntax: .lockaccount [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'),
+('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),
+('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),
+('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'),
+('lookup faction',3,'Syntax: .lookup faction $name\r\nAttempts to find the ID of the faction with the provided $name.'),
+('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'),
+('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'),
+('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'),
+('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),
+('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),
+('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),
+('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'),
+('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'),
+('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),
+('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'),
+('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum VALUESfor its current level.'),
+('modify arena',1,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),
+('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify bit',1,'Syntax: .modify bit #field #bit\r\n\r\nToggle the #bit bit of the #field field for the selected player. If no player is selected, modify your character.'),
+('modify bwalk',1,'Syntax: .modify bwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to \"normal walk back speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify drunk',1,'Syntax: .modify drunk #value\r\n Set drunk level to #value (0..100). Value 0 remove drunk state, 100 is max drunked state.'),
+('modify energy',1,'Syntax: .modify energy #energy\r\n\r\nModify the energy of the selected player. If no player is selected, modify your energy.'),
+('modify faction',1,'Syntax: .modify faction #factionid #flagid #npcflagid #dynamicflagid\r\n\r\nModify the faction and flags of the selected creature. Without arguments, display the faction and flags of the selected creature.'),
+('modify gender',2,'Syntax: .modify gender male/female\r\n\r\nChange gender of selected player.'),
+('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'),
+('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'),
+('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'),
+('modify money',1,'Syntax: .modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'),
+('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'),
+('modify mount',1,'Syntax: .modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'),
+('modify phase',3,'Syntax: .modify phase #phasemask\r\n\r\nSelected character phasemask changed to #phasemask with related world vision update. Change active until in game phase changed, or GM-mode enable/disable, or re-login. Character pts pasemask update to same value.'),
+('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'),
+('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'),
+('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.'),
+('modify scale',1,''),
+('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify spell',1,''),
+('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
+('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
+('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'),
+('mute',1,'Syntax: .mute $playerName $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName at $timeInMinutes minutes.'),
+('namego',1,'Syntax: .namego $charactername\r\n\r\nTeleport the given character to you.'),
+('neargrave',3,'Syntax: .neargrave [alliance|horde]\r\n\r\nFind nearest graveyard linked to zone (or only nearest from accepts alliance or horde faction ghosts).'),
+('notify',1,'Syntax: .notify $MessageToBroadcast\r\n\r\nSend a global message to all players online in screen.'),
+('npc add',2,'Syntax: .npc add #creatureid\r\n\r\nSpawn a creature by the given template id of #creatureid.'),
+('npc additem',2,'Syntax: .npc additem #itemId <#maxcount><#incrtime><#extendedcost>r\r\n\r\nAdd item #itemid to item list of selected vendor. Also optionally set max count item in vendor item list and time to item count restoring and items ExtendedCost.'),
+('npc addmove',2,'Syntax: .npc addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'),
+('npc addweapon',3,'Not yet implemented.'),
+('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement creatures in world. Not implemented.'),
+('npc changelevel',2,'Syntax: .npc changelevel #level\r\n\r\nChange the level of the selected creature to #level.\r\n\r\n#level may range from 1 to 63.'),
+('npc delete',2,'Syntax: .npc delete [#guid]\r\n\r\nDelete creature with guid #guid (or the selected if no guid is provided)'),
+('npc delitem',2,'Syntax: .npc delitem #itemId\r\n\r\nRemove item #itemid from item list of selected vendor.'),
+('npc factionid',2,'Syntax: .npc factionid #factionid\r\n\r\nSet the faction of the selected creature to #factionid.'),
+('npc flag',2,'Syntax: .npc flag #npcflag\r\n\r\nSet the NPC flags of creature template of the selected creature and selected creature to #npcflag. NPC flags will applied to all creatures of selected creature template after server restart or grid unload/load.'),
+('npc follow',2,'Syntax: .npc follow\r\n\r\nSelected creature start follow you until death/fight/etc.'),
+('npc info',3,'Syntax: .npc info\r\n\r\nDisplay a list of details for the selected creature.\r\n\r\nThe list includes:\r\n- GUID, Faction, NPC flags, Entry ID, Model ID,\r\n- Level,\r\n- Health (current/maximum),\r\n\r\n- Field flags, dynamic flags, faction template, \r\n- Position information,\r\n- and the creature type, e.g. if the creature is a vendor.'),
+('npc move',2,'Syntax: .npc move [#creature_guid]\r\n\r\nMove the targeted creature spawn point to your coordinates.'),
+('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),
+('npc setphase',3,'Syntax: .npc setphase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'),
+('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),
+('npc setdeathstate',2,'Syntax: .npc setdeathstate on/off\r\n\r\nSet default death state (dead/alive) for npc at spawn.'),
+('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),
+('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),
+('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),
+('npc spawntime',2,'Syntax: .npc spawntime #time \r\n\r\nAdjust spawntime of selected creature to time.'),
+('npc subname',2,'Syntax: .npc subname $Name\r\n\r\nChange the subname of the selected creature or player to $Name.\r\n\r\nCommand disabled.'),
+('npc tame',2,'Syntax: .npc tame\r\n\r\nTame selected creature (tameable non pet creature). You don''t must have pet.'),
+('npc textemote',1,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'),
+('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to #playerguid.'),
+('npc unfollow',2,'Syntax: .npc unfollow\r\n\r\nSelected creature (non pet) stop follow you.'),
+('password',0,'Syntax: .password $old_password $new_password $new_password\r\n\r\nChange your account password.'),
+('pdump write',3,'Syntax: .pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'),
+('pdump load',3,'Syntax: .pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'),
+('pinfo',2,'Syntax: .pinfo [$player_name] [rep]\r\n\r\nOutput account information for selected player or player find by $player_name. If \"rep\" parameter provided show reputation information for player.'),
+('plimit',3,'Syntax: .plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'),
+('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can\'t be added by this command but correct .additem call provided in command output.'),
+('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'),
+('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'),
+('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'),
+('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'),
+('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'),
+('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),
+('reload all_quest',3,'Syntax: .reload all_quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'),
+('reload all_spell',3,'Syntax: .reload all_spell\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'),
+('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'),
+('reload config',3,'Syntax: .reload config\r\n\r\nReload config settings (by default stored in mangosd.conf). Not all settings can be change at reload: some new setting values will be ignored until restart, some values will applied with delay or only to new objects/maps, some values will explicitly rejected to change at reload.'),
+('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'),
+('reset achievements',3,'Syntax: .reset achievements [$playername]\r\n\r\nReset achievements data for selected or named (online or offline) character. Achievements for persistance progress data like completed quests/etc re-filled at reset. Achievements for events like kills/casts/etc will lost.'),
+('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents at next login each existed character.'),
+('reset honor',3,'Syntax: .reset honor [Playername]\r\n Reset all honor data for targeted character.'),
+('reset level',3,'Syntax: .reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'),
+('reset spells',3,'Syntax: .reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'),
+('reset stats',3,'Syntax: .reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'),
+('reset talents',3,'Syntax: .reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'),
+('respawn',3,'Syntax: .respawn\r\n\r\nRespawn selected creature or respawn all nearest creatures (if none selected) and GO without waiting respawn time expiration.'),
+('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'),
+('save',0,'Syntax: .save\r\n\r\nSaves your character.'),
+('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'),
+('send items',3,'Syntax: .send items #playername "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in "". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),
+('send mail',1,'Syntax: .send mail #playername "#subject" "#text"\r\n\r\nSend a mail to a player. Subject and mail text must be in "".'),
+('send message',3,'Syntax: .send message $playername $message\r\n\r\nSend screen message to player from ADMINISTRATOR.'),
+('send money','3','Syntax: .send money #playername "#subject" "#text" #money\r\n\r\nSend mail with money to a player. Subject and mail text must be in "".'),
+('server corpses',2,'Syntax: .server corpses\r\n\r\nTriggering corpses expire check in world.'),
+('server exit',4,'Syntax: .server exit\r\n\r\nTerminate mangosd NOW. Exit code 0.'),
+('server info',0,'Syntax: .server info\r\n\r\nDisplay server version and the number of connected players.'),
+('server idleshutdown',3,'Syntax: .server idleshutdown #delay [#exist_code]\r\n\r\nShut the server down after #delay seconds if no active connections are present (no players). Use #exist_code or 0 as program exist code.'),
+('server idleshutdown cancel',3,'Syntax: .server idleshutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server idlerestart',3,'Syntax: .server idlerestart #delay\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players). Use #exist_code or 2 as program exist code.'),
+('server idlerestart cancel',3,'Syntax: .server idlerestart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server motd',0,'Syntax: .server motd\r\n\r\nShow server Message of the day.'),
+('server restart',3,'Syntax: .server restart #delay\r\n\r\nRestart the server after #delay seconds. Use #exist_code or 2 as program exist code.'),
+('server restart cancel',3,'Syntax: .server restart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server set loglevel',4,'Syntax: .server set loglevel #level\r\n\r\nSet server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'),
+('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.'),
+('server shutdown',3,'Syntax: .server shutdown #delay [#exist_code]\r\n\r\nShut the server down after #delay seconds. Use #exist_code or 0 as program exist code.'),
+('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),
+('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),
+('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),
+('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),
+('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),
+('tele add',3,'Syntax: .tele add $name\r\n\r\nAdd current your position to .tele command target locations list with name $name.'),
+('tele del',3,'Syntax: .tele del $name\r\n\r\nRemove location with name $name for .tele command locations list.'),
+('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),
+('tele name',1,'Syntax: .tele name #playername #location\r\n\r\nTeleport a player to a given location.'),
+('ticket',2,'Syntax: .ticket on\r\n .ticket off\r\n .ticket #num\r\n .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'),
+('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'),
+('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'),
+('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'),
+('unban ip',3,'Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.'),
+('unlearn',3,'Syntax: .unlearn #spell [all]\r\n\r\nUnlearn for selected player a spell #spell. If \'all\' provided then all ranks unlearned.'),
+('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'),
+('waterwalk',2,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.'),
+('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'),
+('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'),
+('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'),
+('wp add',2,'Syntax: .wp add [#creature_guid or Select a Creature]'),
+('wp export',3,'Syntax: .wp export [#creature_guid or Select a Creature] $filename'),
+('wp import',3,'Syntax: .wp import $filename'),
+('wp modify',2,'Syntax: .wp modify [#creature_guid or Select a Creature]\r\nadd - Add a waypoint after the selected visual\r\nwaittime $time\r\nemote ID\r\nspell ID\r\ntext1| text2| text3| text4| text5 <text>\r\nmodel1 ID\r\nmodel2 ID\r\nmove(moves wp to player pos)\r\ndel (deletes the wp)\r\n\r\nOnly one parameter per time!'),
+('wp show',2,'Syntax: .wp show [#creature_guid or Select a Creature]\r\non\r\nfirst\r\nlast\r\noff\r\ninfo\r\n\r\nFor using info you have to do first show on and than select a Visual-Waypoint and do the show info!');
+/*!40000 ALTER TABLE `command` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature`
+--
+
+DROP TABLE IF EXISTS `creature`;
+CREATE TABLE `creature` (
+ `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier',
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier',
+ `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier',
+ `spawnMask` tinyint(3) unsigned NOT NULL default '1',
+ `phaseMask` smallint(5) unsigned NOT NULL default '1',
+ `modelid` mediumint(8) unsigned NOT NULL default '0',
+ `equipment_id` mediumint(9) NOT NULL default '0',
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `spawntimesecs` int(10) unsigned NOT NULL default '120',
+ `spawndist` float NOT NULL default '5',
+ `currentwaypoint` mediumint(8) unsigned NOT NULL default '0',
+ `curhealth` int(10) unsigned NOT NULL default '1',
+ `curmana` int(10) unsigned NOT NULL default '0',
+ `DeathState` tinyint(3) unsigned NOT NULL default '0',
+ `MovementType` tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`),
+ KEY `idx_map` (`map`),
+ KEY `index_id` (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System';
+
+--
+-- Dumping data for table `creature`
+--
+
+LOCK TABLES `creature` WRITE;
+/*!40000 ALTER TABLE `creature` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_addon`
+--
+
+DROP TABLE IF EXISTS `creature_addon`;
+CREATE TABLE `creature_addon` (
+ `guid` int(11) NOT NULL default '0',
+ `mount` mediumint(8) unsigned NOT NULL default '0',
+ `bytes0` int(10) unsigned NOT NULL default '0',
+ `bytes1` int(10) unsigned NOT NULL default '0',
+ `bytes2` int(10) unsigned NOT NULL default '0',
+ `emote` int(10) unsigned NOT NULL default '0',
+ `moveflags` int(10) unsigned NOT NULL default '0',
+ `auras` text,
+ PRIMARY KEY (`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `creature_addon`
+--
+
+LOCK TABLES `creature_addon` WRITE;
+/*!40000 ALTER TABLE `creature_addon` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_addon` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_equip_template`
+--
+
+DROP TABLE IF EXISTS `creature_equip_template`;
+CREATE TABLE `creature_equip_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Unique entry',
+ `equipentry1` mediumint(8) unsigned NOT NULL default '0',
+ `equipentry2` mediumint(8) unsigned NOT NULL default '0',
+ `equipentry3` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)';
+
+--
+-- Dumping data for table `creature_equip_template`
+--
+
+LOCK TABLES `creature_equip_template` WRITE;
+/*!40000 ALTER TABLE `creature_equip_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_equip_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_involvedrelation`
+--
+
+DROP TABLE IF EXISTS `creature_involvedrelation`;
+CREATE TABLE `creature_involvedrelation` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`id`,`quest`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System';
+
+--
+-- Dumping data for table `creature_involvedrelation`
+--
+
+LOCK TABLES `creature_involvedrelation` WRITE;
+/*!40000 ALTER TABLE `creature_involvedrelation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_involvedrelation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_loot_template`
+--
+
+DROP TABLE IF EXISTS `creature_loot_template`;
+CREATE TABLE `creature_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `creature_loot_template`
+--
+
+LOCK TABLES `creature_loot_template` WRITE;
+/*!40000 ALTER TABLE `creature_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_model_info`
+--
+
+DROP TABLE IF EXISTS `creature_model_info`;
+CREATE TABLE `creature_model_info` (
+ `modelid` mediumint(8) unsigned NOT NULL default '0',
+ `bounding_radius` float NOT NULL default '0',
+ `combat_reach` float NOT NULL default '0',
+ `gender` tinyint(3) unsigned NOT NULL default '2',
+ `modelid_other_gender` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`modelid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)';
+
+--
+-- Dumping data for table `creature_model_info`
+--
+
+LOCK TABLES `creature_model_info` WRITE;
+/*!40000 ALTER TABLE `creature_model_info` DISABLE KEYS */;
+INSERT INTO `creature_model_info` VALUES
+(10045, 1, 1.5, 2, 0);
+/*!40000 ALTER TABLE `creature_model_info` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_movement`
+--
+
+DROP TABLE IF EXISTS `creature_movement`;
+CREATE TABLE `creature_movement` (
+ `id` int(10) unsigned NOT NULL COMMENT 'Creature GUID',
+ `point` mediumint(8) unsigned NOT NULL default '0',
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `waittime` int(10) unsigned NOT NULL default '0',
+ `textid1` int(11) NOT NULL default '0',
+ `textid2` int(11) NOT NULL default '0',
+ `textid3` int(11) NOT NULL default '0',
+ `textid4` int(11) NOT NULL default '0',
+ `textid5` int(11) NOT NULL default '0',
+ `emote` mediumint(8) unsigned NOT NULL default '0',
+ `spell` mediumint(8) unsigned NOT NULL default '0',
+ `wpguid` int(11) NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `model1` mediumint(9) NOT NULL default '0',
+ `model2` mediumint(9) NOT NULL default '0',
+ PRIMARY KEY (`id`,`point`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System';
+
+--
+-- Dumping data for table `creature_movement`
+--
+
+LOCK TABLES `creature_movement` WRITE;
+/*!40000 ALTER TABLE `creature_movement` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_movement` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_onkill_reputation`
+--
+
+DROP TABLE IF EXISTS `creature_onkill_reputation`;
+CREATE TABLE `creature_onkill_reputation` (
+ `creature_id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier',
+ `RewOnKillRepFaction1` smallint(6) NOT NULL default '0',
+ `RewOnKillRepFaction2` smallint(6) NOT NULL default '0',
+ `MaxStanding1` tinyint(4) NOT NULL default '0',
+ `IsTeamAward1` tinyint(4) NOT NULL default '0',
+ `RewOnKillRepValue1` mediumint(9) NOT NULL default '0',
+ `MaxStanding2` tinyint(4) NOT NULL default '0',
+ `IsTeamAward2` tinyint(4) NOT NULL default '0',
+ `RewOnKillRepValue2` mediumint(9) NOT NULL default '0',
+ `TeamDependent` tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (`creature_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature OnKill Reputation gain';
+
+--
+-- Dumping data for table `creature_onkill_reputation`
+--
+
+LOCK TABLES `creature_onkill_reputation` WRITE;
+/*!40000 ALTER TABLE `creature_onkill_reputation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_onkill_reputation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_questrelation`
+--
+
+DROP TABLE IF EXISTS `creature_questrelation`;
+CREATE TABLE `creature_questrelation` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`id`,`quest`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System';
+
+--
+-- Dumping data for table `creature_questrelation`
+--
+
+LOCK TABLES `creature_questrelation` WRITE;
+/*!40000 ALTER TABLE `creature_questrelation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_questrelation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_respawn`
+--
+
+DROP TABLE IF EXISTS `creature_respawn`;
+CREATE TABLE `creature_respawn` (
+ `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
+ `respawntime` bigint(20) NOT NULL default '0',
+ `instance` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`,`instance`),
+ KEY `instance` (`instance`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System';
+
+--
+-- Dumping data for table `creature_respawn`
+--
+
+LOCK TABLES `creature_respawn` WRITE;
+/*!40000 ALTER TABLE `creature_respawn` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_respawn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_template`
+--
+
+DROP TABLE IF EXISTS `creature_template`;
+CREATE TABLE `creature_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `heroic_entry` mediumint(8) unsigned NOT NULL default '0',
+ `modelid_A` mediumint(8) unsigned NOT NULL default '0',
+ `modelid_A2` mediumint(8) unsigned NOT NULL default '0',
+ `modelid_H` mediumint(8) unsigned NOT NULL default '0',
+ `modelid_H2` mediumint(8) unsigned NOT NULL default '0',
+ `name` char(100) NOT NULL default '0',
+ `subname` char(100) default NULL,
+ `IconName` char(100) default NULL,
+ `minlevel` tinyint(3) unsigned NOT NULL default '1',
+ `maxlevel` tinyint(3) unsigned NOT NULL default '1',
+ `minhealth` int(10) unsigned NOT NULL default '0',
+ `maxhealth` int(10) unsigned NOT NULL default '0',
+ `minmana` int(10) unsigned NOT NULL default '0',
+ `maxmana` int(10) unsigned NOT NULL default '0',
+ `armor` mediumint(8) unsigned NOT NULL default '0',
+ `faction_A` smallint(5) unsigned NOT NULL default '0',
+ `faction_H` smallint(5) unsigned NOT NULL default '0',
+ `npcflag` int(10) unsigned NOT NULL default '0',
+ `speed` float NOT NULL default '1',
+ `scale` float NOT NULL default '1',
+ `rank` tinyint(3) unsigned NOT NULL default '0',
+ `mindmg` float NOT NULL default '0',
+ `maxdmg` float NOT NULL default '0',
+ `dmgschool` tinyint(4) NOT NULL default '0',
+ `attackpower` int(10) unsigned NOT NULL default '0',
+ `baseattacktime` int(10) unsigned NOT NULL default '0',
+ `rangeattacktime` int(10) unsigned NOT NULL default '0',
+ `unit_flags` int(10) unsigned NOT NULL default '0',
+ `dynamicflags` int(10) unsigned NOT NULL default '0',
+ `family` tinyint(4) NOT NULL default '0',
+ `trainer_type` tinyint(4) NOT NULL default '0',
+ `trainer_spell` mediumint(8) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `minrangedmg` float NOT NULL default '0',
+ `maxrangedmg` float NOT NULL default '0',
+ `rangedattackpower` smallint(5) unsigned NOT NULL default '0',
+ `type` tinyint(3) unsigned NOT NULL default '0',
+ `type_flags` int(10) unsigned NOT NULL default '0',
+ `lootid` mediumint(8) unsigned NOT NULL default '0',
+ `pickpocketloot` mediumint(8) unsigned NOT NULL default '0',
+ `skinloot` mediumint(8) unsigned NOT NULL default '0',
+ `resistance1` smallint(5) NOT NULL default '0',
+ `resistance2` smallint(5) NOT NULL default '0',
+ `resistance3` smallint(5) NOT NULL default '0',
+ `resistance4` smallint(5) NOT NULL default '0',
+ `resistance5` smallint(5) NOT NULL default '0',
+ `resistance6` smallint(5) NOT NULL default '0',
+ `spell1` mediumint(8) unsigned NOT NULL default '0',
+ `spell2` mediumint(8) unsigned NOT NULL default '0',
+ `spell3` mediumint(8) unsigned NOT NULL default '0',
+ `spell4` mediumint(8) unsigned NOT NULL default '0',
+ `PetSpellDataId` mediumint(8) unsigned NOT NULL default '0',
+ `mingold` mediumint(8) unsigned NOT NULL default '0',
+ `maxgold` mediumint(8) unsigned NOT NULL default '0',
+ `AIName` char(64) NOT NULL default '',
+ `MovementType` tinyint(3) unsigned NOT NULL default '0',
+ `InhabitType` tinyint(3) unsigned NOT NULL default '3',
+ `unk16` float NOT NULL default '1',
+ `unk17` float NOT NULL default '1',
+ `RacialLeader` tinyint(3) unsigned NOT NULL default '0',
+ `RegenHealth` tinyint(3) unsigned NOT NULL default '1',
+ `equipment_id` mediumint(8) unsigned NOT NULL default '0',
+ `mechanic_immune_mask` int(10) unsigned NOT NULL default '0',
+ `flags_extra` int(10) unsigned NOT NULL default '0',
+ `ScriptName` char(64) NOT NULL default '',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System';
+
+--
+-- Dumping data for table `creature_template`
+--
+
+LOCK TABLES `creature_template` WRITE;
+/*!40000 ALTER TABLE `creature_template` DISABLE KEYS */;
+INSERT INTO `creature_template` VALUES
+(1,0,10045,0,10045,0,'Waypoint(Only GM can see it)','Visual',NULL,1,1,64,64,0,0,0,35,35,0,0.91,1,0,14,15,0,100,2000,2200,4096,0,0,0,0,0,0,1.76,2.42,100,8,5242886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,3,1.0,1.0,0,1,0,0,0x82,'');
+/*!40000 ALTER TABLE `creature_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_template_addon`
+--
+
+DROP TABLE IF EXISTS `creature_template_addon`;
+CREATE TABLE `creature_template_addon` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `mount` mediumint(8) unsigned NOT NULL default '0',
+ `bytes0` int(10) unsigned NOT NULL default '0',
+ `bytes1` int(10) unsigned NOT NULL default '0',
+ `bytes2` int(10) unsigned NOT NULL default '0',
+ `emote` mediumint(8) unsigned NOT NULL default '0',
+ `moveflags` int(10) unsigned NOT NULL default '0',
+ `auras` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `creature_template_addon`
+--
+
+LOCK TABLES `creature_template_addon` WRITE;
+/*!40000 ALTER TABLE `creature_template_addon` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `db_script_string`
+--
+
+DROP TABLE IF EXISTS `db_script_string`;
+CREATE TABLE `db_script_string` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `db_script_string`
+--
+
+LOCK TABLES `db_script_string` WRITE;
+/*!40000 ALTER TABLE `db_script_string` DISABLE KEYS */;
+/*!40000 ALTER TABLE `db_script_string` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `disenchant_loot_template`
+--
+
+DROP TABLE IF EXISTS `disenchant_loot_template`;
+CREATE TABLE `disenchant_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Recommended id selection: item_level*100 + item_quality',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `disenchant_loot_template`
+--
+
+LOCK TABLES `disenchant_loot_template` WRITE;
+/*!40000 ALTER TABLE `disenchant_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `disenchant_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_ai_scripts`
+--
+
+DROP TABLE IF EXISTS `creature_ai_scripts`;
+CREATE TABLE `creature_ai_scripts` (
+ `id` int(11) unsigned NOT NULL COMMENT 'Identifier' AUTO_INCREMENT,
+ `creature_id` int(11) unsigned NOT NULL default '0' COMMENT 'Creature Template Identifier',
+ `event_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Event Type',
+ `event_inverse_phase_mask` int(11) signed NOT NULL default '0' COMMENT 'Mask which phases this event will not trigger in',
+ `event_chance` int(3) unsigned NOT NULL default '100',
+ `event_flags` int(3) unsigned NOT NULL default '0',
+ `event_param1` int(11) signed NOT NULL default '0',
+ `event_param2` int(11) signed NOT NULL default '0',
+ `event_param3` int(11) signed NOT NULL default '0',
+ `event_param4` int(11) signed NOT NULL default '0',
+ `action1_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action1_param1` int(11) signed NOT NULL default '0',
+ `action1_param2` int(11) signed NOT NULL default '0',
+ `action1_param3` int(11) signed NOT NULL default '0',
+ `action2_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action2_param1` int(11) signed NOT NULL default '0',
+ `action2_param2` int(11) signed NOT NULL default '0',
+ `action2_param3` int(11) signed NOT NULL default '0',
+ `action3_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action3_param1` int(11) signed NOT NULL default '0',
+ `action3_param2` int(11) signed NOT NULL default '0',
+ `action3_param3` int(11) signed NOT NULL default '0',
+ `comment` varchar(255) NOT NULL default '' COMMENT 'Event Comment',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts';
+
+--
+-- Dumping data for table `creature_ai_scripts`
+--
+
+LOCK TABLES `creature_ai_scripts` WRITE;
+/*!40000 ALTER TABLE `creature_ai_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_ai_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_ai_summons`
+--
+
+DROP TABLE IF EXISTS `creature_ai_summons`;
+CREATE TABLE `creature_ai_summons` (
+ `id` int(11) unsigned NOT NULL COMMENT 'Location Identifier' AUTO_INCREMENT,
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `spawntimesecs` int(11) unsigned NOT NULL default '120',
+ `comment` varchar(255) NOT NULL default '' COMMENT 'Summon Comment',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations';
+
+--
+-- Dumping data for table `creature_ai_summons`
+--
+
+LOCK TABLES `creature_ai_summons` WRITE;
+/*!40000 ALTER TABLE `creature_ai_summons` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_ai_summons` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `creature_ai_texts`
+--
+
+DROP TABLE IF EXISTS `creature_ai_texts`;
+CREATE TABLE `creature_ai_texts` (
+ `entry` mediumint(8) NOT NULL,
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ `sound` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `language` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `emote` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `comment` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts';
+
+--
+-- Dumping data for table `creature_ai_texts`
+--
+
+LOCK TABLES `creature_ai_texts` WRITE;
+/*!40000 ALTER TABLE `creature_ai_texts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_ai_texts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `event_scripts`
+--
+
+DROP TABLE IF EXISTS `event_scripts`;
+CREATE TABLE `event_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `event_scripts`
+--
+
+LOCK TABLES `event_scripts` WRITE;
+/*!40000 ALTER TABLE `event_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `event_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `exploration_basexp`
+--
+
+DROP TABLE IF EXISTS `exploration_basexp`;
+CREATE TABLE `exploration_basexp` (
+ `level` tinyint(4) NOT NULL default '0',
+ `basexp` mediumint(9) NOT NULL default '0',
+ PRIMARY KEY (`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Exploration System';
+
+--
+-- Dumping data for table `exploration_basexp`
+--
+
+LOCK TABLES `exploration_basexp` WRITE;
+/*!40000 ALTER TABLE `exploration_basexp` DISABLE KEYS */;
+INSERT INTO `exploration_basexp` VALUES
+(0,0),
+(1,5),
+(2,15),
+(3,25),
+(4,35),
+(5,45),
+(6,55),
+(7,65),
+(8,70),
+(9,80),
+(10,85),
+(11,90),
+(12,90),
+(13,90),
+(14,100),
+(15,105),
+(16,115),
+(17,125),
+(18,135),
+(19,145),
+(20,155),
+(21,165),
+(22,175),
+(23,185),
+(24,195),
+(25,200),
+(26,210),
+(27,220),
+(28,230),
+(29,240),
+(30,245),
+(31,250),
+(32,255),
+(33,265),
+(34,270),
+(35,275),
+(36,280),
+(37,285),
+(38,285),
+(39,300),
+(40,315),
+(41,330),
+(42,345),
+(43,360),
+(44,375),
+(45,390),
+(46,405),
+(47,420),
+(48,440),
+(49,455),
+(50,470),
+(51,490),
+(52,510),
+(53,530),
+(54,540),
+(55,560),
+(56,580),
+(57,600),
+(58,620),
+(59,640),
+(60,660),
+(61,970),
+(62,1000),
+(63,1050),
+(64,1080),
+(65,1100),
+(66,1130),
+(67,1160),
+(68,1200),
+(69,1230),
+(70,1250);
+/*!40000 ALTER TABLE `exploration_basexp` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `fishing_loot_template`
+--
+
+DROP TABLE IF EXISTS `fishing_loot_template`;
+CREATE TABLE `fishing_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `fishing_loot_template`
+--
+
+LOCK TABLES `fishing_loot_template` WRITE;
+/*!40000 ALTER TABLE `fishing_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `fishing_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event`
+--
+
+DROP TABLE IF EXISTS `game_event`;
+CREATE TABLE `game_event` (
+ `entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event',
+ `start_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before',
+ `end_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler',
+ `occurence` bigint(20) unsigned NOT NULL default '86400' COMMENT 'Delay in hours between occurences of the event',
+ `length` bigint(20) unsigned NOT NULL default '43200' COMMENT 'Length in hours of the event',
+ `holiday` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Client side holiday id',
+ `description` varchar(255) default NULL COMMENT 'Description of the event displayed in console',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event`
+--
+
+LOCK TABLES `game_event` WRITE;
+/*!40000 ALTER TABLE `game_event` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event_creature`
+--
+
+DROP TABLE IF EXISTS `game_event_creature`;
+CREATE TABLE `game_event_creature` (
+ `guid` int(10) unsigned NOT NULL,
+ `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
+ PRIMARY KEY (`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event_creature`
+--
+
+LOCK TABLES `game_event_creature` WRITE;
+/*!40000 ALTER TABLE `game_event_creature` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event_creature` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event_creature_quest`
+--
+
+DROP TABLE IF EXISTS `game_event_creature_quest`;
+CREATE TABLE `game_event_creature_quest` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `quest` mediumint(8) unsigned NOT NULL default '0',
+ `event` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`,`quest`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event_creature_quest`
+--
+
+LOCK TABLES `game_event_creature_quest` WRITE;
+/*!40000 ALTER TABLE `game_event_creature_quest` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event_creature_quest` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event_gameobject`
+--
+
+DROP TABLE IF EXISTS `game_event_gameobject`;
+CREATE TABLE `game_event_gameobject` (
+ `guid` int(10) unsigned NOT NULL,
+ `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
+ PRIMARY KEY (`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event_gameobject`
+--
+
+LOCK TABLES `game_event_gameobject` WRITE;
+/*!40000 ALTER TABLE `game_event_gameobject` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event_gameobject` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event_model_equip`
+--
+
+DROP TABLE IF EXISTS `game_event_model_equip`;
+CREATE TABLE `game_event_model_equip` (
+ `guid` int(10) unsigned NOT NULL default '0',
+ `modelid` mediumint(8) unsigned NOT NULL default '0',
+ `equipment_id` mediumint(8) unsigned NOT NULL default '0',
+ `event` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event_model_equip`
+--
+
+LOCK TABLES `game_event_model_equip` WRITE;
+/*!40000 ALTER TABLE `game_event_model_equip` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event_model_equip` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_graveyard_zone`
+--
+
+DROP TABLE IF EXISTS `game_graveyard_zone`;
+CREATE TABLE `game_graveyard_zone` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `ghost_zone` mediumint(8) unsigned NOT NULL default '0',
+ `faction` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`,`ghost_zone`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System';
+
+--
+-- Dumping data for table `game_graveyard_zone`
+--
+
+LOCK TABLES `game_graveyard_zone` WRITE;
+/*!40000 ALTER TABLE `game_graveyard_zone` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_graveyard_zone` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_tele`
+--
+
+DROP TABLE IF EXISTS `game_tele`;
+CREATE TABLE `game_tele` (
+ `id` mediumint(8) unsigned NOT NULL auto_increment,
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `map` smallint(5) unsigned NOT NULL default '0',
+ `name` varchar(100) NOT NULL default '',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tele Command';
+
+--
+-- Dumping data for table `game_tele`
+--
+
+LOCK TABLES `game_tele` WRITE;
+/*!40000 ALTER TABLE `game_tele` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_tele` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_weather`
+--
+
+DROP TABLE IF EXISTS `game_weather`;
+CREATE TABLE `game_weather` (
+ `zone` mediumint(8) unsigned NOT NULL default '0',
+ `spring_rain_chance` tinyint(3) unsigned NOT NULL default '25',
+ `spring_snow_chance` tinyint(3) unsigned NOT NULL default '25',
+ `spring_storm_chance` tinyint(3) unsigned NOT NULL default '25',
+ `summer_rain_chance` tinyint(3) unsigned NOT NULL default '25',
+ `summer_snow_chance` tinyint(3) unsigned NOT NULL default '25',
+ `summer_storm_chance` tinyint(3) unsigned NOT NULL default '25',
+ `fall_rain_chance` tinyint(3) unsigned NOT NULL default '25',
+ `fall_snow_chance` tinyint(3) unsigned NOT NULL default '25',
+ `fall_storm_chance` tinyint(3) unsigned NOT NULL default '25',
+ `winter_rain_chance` tinyint(3) unsigned NOT NULL default '25',
+ `winter_snow_chance` tinyint(3) unsigned NOT NULL default '25',
+ `winter_storm_chance` tinyint(3) unsigned NOT NULL default '25',
+ PRIMARY KEY (`zone`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Weather System';
+
+--
+-- Dumping data for table `game_weather`
+--
+
+LOCK TABLES `game_weather` WRITE;
+/*!40000 ALTER TABLE `game_weather` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_weather` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject`
+--
+
+DROP TABLE IF EXISTS `gameobject`;
+CREATE TABLE `gameobject` (
+ `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier',
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Gameobject Identifier',
+ `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier',
+ `spawnMask` tinyint(3) unsigned NOT NULL default '1',
+ `phaseMask` smallint(5) unsigned NOT NULL default '1',
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `rotation0` float NOT NULL default '0',
+ `rotation1` float NOT NULL default '0',
+ `rotation2` float NOT NULL default '0',
+ `rotation3` float NOT NULL default '0',
+ `spawntimesecs` int(11) NOT NULL default '0',
+ `animprogress` tinyint(3) unsigned NOT NULL default '0',
+ `state` tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System';
+
+--
+-- Dumping data for table `gameobject`
+--
+
+LOCK TABLES `gameobject` WRITE;
+/*!40000 ALTER TABLE `gameobject` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_involvedrelation`
+--
+
+DROP TABLE IF EXISTS `gameobject_involvedrelation`;
+CREATE TABLE `gameobject_involvedrelation` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`id`,`quest`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `gameobject_involvedrelation`
+--
+
+LOCK TABLES `gameobject_involvedrelation` WRITE;
+/*!40000 ALTER TABLE `gameobject_involvedrelation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_involvedrelation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_loot_template`
+--
+
+DROP TABLE IF EXISTS `gameobject_loot_template`;
+CREATE TABLE `gameobject_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `gameobject_loot_template`
+--
+
+LOCK TABLES `gameobject_loot_template` WRITE;
+/*!40000 ALTER TABLE `gameobject_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_questrelation`
+--
+
+DROP TABLE IF EXISTS `gameobject_questrelation`;
+CREATE TABLE `gameobject_questrelation` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`id`,`quest`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `gameobject_questrelation`
+--
+
+LOCK TABLES `gameobject_questrelation` WRITE;
+/*!40000 ALTER TABLE `gameobject_questrelation` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_questrelation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_respawn`
+--
+
+DROP TABLE IF EXISTS `gameobject_respawn`;
+CREATE TABLE `gameobject_respawn` (
+ `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
+ `respawntime` bigint(20) NOT NULL default '0',
+ `instance` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`,`instance`),
+ KEY `instance` (`instance`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System';
+
+--
+-- Dumping data for table `gameobject_respawn`
+--
+
+LOCK TABLES `gameobject_respawn` WRITE;
+/*!40000 ALTER TABLE `gameobject_respawn` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_respawn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_scripts`
+--
+
+DROP TABLE IF EXISTS `gameobject_scripts`;
+CREATE TABLE `gameobject_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `gameobject_scripts`
+--
+
+LOCK TABLES `gameobject_scripts` WRITE;
+/*!40000 ALTER TABLE `gameobject_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `gameobject_template`
+--
+
+DROP TABLE IF EXISTS `gameobject_template`;
+CREATE TABLE `gameobject_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `type` tinyint(3) unsigned NOT NULL default '0',
+ `displayId` mediumint(8) unsigned NOT NULL default '0',
+ `name` varchar(100) NOT NULL default '',
+ `IconName` varchar(100) NOT NULL default '',
+ `castBarCaption` varchar(100) NOT NULL default '',
+ `faction` smallint(5) unsigned NOT NULL default '0',
+ `flags` int(10) unsigned NOT NULL default '0',
+ `size` float NOT NULL default '1',
+ `data0` int(10) unsigned NOT NULL default '0',
+ `data1` int(10) unsigned NOT NULL default '0',
+ `data2` int(10) unsigned NOT NULL default '0',
+ `data3` int(10) unsigned NOT NULL default '0',
+ `data4` int(10) unsigned NOT NULL default '0',
+ `data5` int(10) unsigned NOT NULL default '0',
+ `data6` int(10) unsigned NOT NULL default '0',
+ `data7` int(10) unsigned NOT NULL default '0',
+ `data8` int(10) unsigned NOT NULL default '0',
+ `data9` int(10) unsigned NOT NULL default '0',
+ `data10` int(10) unsigned NOT NULL default '0',
+ `data11` int(10) unsigned NOT NULL default '0',
+ `data12` int(10) unsigned NOT NULL default '0',
+ `data13` int(10) unsigned NOT NULL default '0',
+ `data14` int(10) unsigned NOT NULL default '0',
+ `data15` int(10) unsigned NOT NULL default '0',
+ `data16` int(10) unsigned NOT NULL default '0',
+ `data17` int(10) unsigned NOT NULL default '0',
+ `data18` int(10) unsigned NOT NULL default '0',
+ `data19` int(10) unsigned NOT NULL default '0',
+ `data20` int(10) unsigned NOT NULL default '0',
+ `data21` int(10) unsigned NOT NULL default '0',
+ `data22` int(10) unsigned NOT NULL default '0',
+ `data23` int(10) unsigned NOT NULL default '0',
+ `ScriptName` varchar(64) NOT NULL default '',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System';
+
+--
+-- Dumping data for table `gameobject_template`
+--
+
+LOCK TABLES `gameobject_template` WRITE;
+/*!40000 ALTER TABLE `gameobject_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `gameobject_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `instance_template`
+--
+
+DROP TABLE IF EXISTS `instance_template`;
+CREATE TABLE `instance_template` (
+ `map` smallint(5) unsigned NOT NULL,
+ `parent` int(10) unsigned NOT NULL,
+ `levelMin` tinyint(3) unsigned NOT NULL default '0',
+ `levelMax` tinyint(3) unsigned NOT NULL default '0',
+ `maxPlayers` tinyint(3) unsigned NOT NULL default '0',
+ `maxPlayersHeroic` tinyint(3) unsigned NOT NULL default '0',
+ `reset_delay` int(10) unsigned NOT NULL default '0',
+ `startLocX` float default NULL,
+ `startLocY` float default NULL,
+ `startLocZ` float default NULL,
+ `startLocO` float default NULL,
+ `script` varchar(128) NOT NULL default '',
+ PRIMARY KEY (`map`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `instance_template`
+--
+
+LOCK TABLES `instance_template` WRITE;
+/*!40000 ALTER TABLE `instance_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `item_enchantment_template`
+--
+
+DROP TABLE IF EXISTS `item_enchantment_template`;
+CREATE TABLE `item_enchantment_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `ench` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`ench`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item Random Enchantment System';
+
+--
+-- Dumping data for table `item_enchantment_template`
+--
+
+LOCK TABLES `item_enchantment_template` WRITE;
+/*!40000 ALTER TABLE `item_enchantment_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `item_enchantment_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `item_loot_template`
+--
+
+DROP TABLE IF EXISTS `item_loot_template`;
+CREATE TABLE `item_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `item_loot_template`
+--
+
+LOCK TABLES `item_loot_template` WRITE;
+/*!40000 ALTER TABLE `item_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `item_template`
+--
+
+DROP TABLE IF EXISTS `item_template`;
+CREATE TABLE `item_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `subclass` tinyint(3) unsigned NOT NULL default '0',
+ `unk0` int(11) NOT NULL default '-1',
+ `name` varchar(255) NOT NULL default '',
+ `displayid` mediumint(8) unsigned NOT NULL default '0',
+ `Quality` tinyint(3) unsigned NOT NULL default '0',
+ `Flags` int(10) unsigned NOT NULL default '0',
+ `BuyCount` tinyint(3) unsigned NOT NULL default '1',
+ `BuyPrice` int(10) unsigned NOT NULL default '0',
+ `SellPrice` int(10) unsigned NOT NULL default '0',
+ `InventoryType` tinyint(3) unsigned NOT NULL default '0',
+ `AllowableClass` mediumint(9) NOT NULL default '-1',
+ `AllowableRace` mediumint(9) NOT NULL default '-1',
+ `ItemLevel` tinyint(3) unsigned NOT NULL default '0',
+ `RequiredLevel` tinyint(3) unsigned NOT NULL default '0',
+ `RequiredSkill` smallint(5) unsigned NOT NULL default '0',
+ `RequiredSkillRank` smallint(5) unsigned NOT NULL default '0',
+ `requiredspell` mediumint(8) unsigned NOT NULL default '0',
+ `requiredhonorrank` mediumint(8) unsigned NOT NULL default '0',
+ `RequiredCityRank` mediumint(8) unsigned NOT NULL default '0',
+ `RequiredReputationFaction` smallint(5) unsigned NOT NULL default '0',
+ `RequiredReputationRank` smallint(5) unsigned NOT NULL default '0',
+ `maxcount` smallint(5) NOT NULL default '-1',
+ `stackable` smallint(5) NOT NULL default '1',
+ `ContainerSlots` tinyint(3) unsigned NOT NULL default '0',
+ `StatsCount` tinyint(3) unsigned NOT NULL default '0',
+ `stat_type1` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value1` smallint(6) NOT NULL default '0',
+ `stat_type2` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value2` smallint(6) NOT NULL default '0',
+ `stat_type3` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value3` smallint(6) NOT NULL default '0',
+ `stat_type4` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value4` smallint(6) NOT NULL default '0',
+ `stat_type5` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value5` smallint(6) NOT NULL default '0',
+ `stat_type6` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value6` smallint(6) NOT NULL default '0',
+ `stat_type7` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value7` smallint(6) NOT NULL default '0',
+ `stat_type8` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value8` smallint(6) NOT NULL default '0',
+ `stat_type9` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value9` smallint(6) NOT NULL default '0',
+ `stat_type10` tinyint(3) unsigned NOT NULL default '0',
+ `stat_value10` smallint(6) NOT NULL default '0',
+ `ScalingStatDistribution` smallint(6) NOT NULL default '0',
+ `ScalingStatValue` smallint(6) NOT NULL default '0',
+ `dmg_min1` float NOT NULL default '0',
+ `dmg_max1` float NOT NULL default '0',
+ `dmg_type1` tinyint(3) unsigned NOT NULL default '0',
+ `dmg_min2` float NOT NULL default '0',
+ `dmg_max2` float NOT NULL default '0',
+ `dmg_type2` tinyint(3) unsigned NOT NULL default '0',
+ `dmg_min3` float NOT NULL default '0',
+ `dmg_max3` float NOT NULL default '0',
+ `dmg_type3` tinyint(3) unsigned NOT NULL default '0',
+ `dmg_min4` float NOT NULL default '0',
+ `dmg_max4` float NOT NULL default '0',
+ `dmg_type4` tinyint(3) unsigned NOT NULL default '0',
+ `dmg_min5` float NOT NULL default '0',
+ `dmg_max5` float NOT NULL default '0',
+ `dmg_type5` tinyint(3) unsigned NOT NULL default '0',
+ `armor` smallint(5) unsigned NOT NULL default '0',
+ `holy_res` tinyint(3) unsigned NOT NULL default '0',
+ `fire_res` tinyint(3) unsigned NOT NULL default '0',
+ `nature_res` tinyint(3) unsigned NOT NULL default '0',
+ `frost_res` tinyint(3) unsigned NOT NULL default '0',
+ `shadow_res` tinyint(3) unsigned NOT NULL default '0',
+ `arcane_res` tinyint(3) unsigned NOT NULL default '0',
+ `delay` smallint(5) unsigned NOT NULL default '1000',
+ `ammo_type` tinyint(3) unsigned NOT NULL default '0',
+ `RangedModRange` float NOT NULL default '0',
+ `spellid_1` mediumint(8) unsigned NOT NULL default '0',
+ `spelltrigger_1` tinyint(3) unsigned NOT NULL default '0',
+ `spellcharges_1` tinyint(4) NOT NULL default '0',
+ `spellppmRate_1` float NOT NULL default '0',
+ `spellcooldown_1` int(11) NOT NULL default '-1',
+ `spellcategory_1` smallint(5) unsigned NOT NULL default '0',
+ `spellcategorycooldown_1` int(11) NOT NULL default '-1',
+ `spellid_2` mediumint(8) unsigned NOT NULL default '0',
+ `spelltrigger_2` tinyint(3) unsigned NOT NULL default '0',
+ `spellcharges_2` tinyint(4) NOT NULL default '0',
+ `spellppmRate_2` float NOT NULL default '0',
+ `spellcooldown_2` int(11) NOT NULL default '-1',
+ `spellcategory_2` smallint(5) unsigned NOT NULL default '0',
+ `spellcategorycooldown_2` int(11) NOT NULL default '-1',
+ `spellid_3` mediumint(8) unsigned NOT NULL default '0',
+ `spelltrigger_3` tinyint(3) unsigned NOT NULL default '0',
+ `spellcharges_3` tinyint(4) NOT NULL default '0',
+ `spellppmRate_3` float NOT NULL default '0',
+ `spellcooldown_3` int(11) NOT NULL default '-1',
+ `spellcategory_3` smallint(5) unsigned NOT NULL default '0',
+ `spellcategorycooldown_3` int(11) NOT NULL default '-1',
+ `spellid_4` mediumint(8) unsigned NOT NULL default '0',
+ `spelltrigger_4` tinyint(3) unsigned NOT NULL default '0',
+ `spellcharges_4` tinyint(4) NOT NULL default '0',
+ `spellppmRate_4` float NOT NULL default '0',
+ `spellcooldown_4` int(11) NOT NULL default '-1',
+ `spellcategory_4` smallint(5) unsigned NOT NULL default '0',
+ `spellcategorycooldown_4` int(11) NOT NULL default '-1',
+ `spellid_5` mediumint(8) unsigned NOT NULL default '0',
+ `spelltrigger_5` tinyint(3) unsigned NOT NULL default '0',
+ `spellcharges_5` tinyint(4) NOT NULL default '0',
+ `spellppmRate_5` float NOT NULL default '0',
+ `spellcooldown_5` int(11) NOT NULL default '-1',
+ `spellcategory_5` smallint(5) unsigned NOT NULL default '0',
+ `spellcategorycooldown_5` int(11) NOT NULL default '-1',
+ `bonding` tinyint(3) unsigned NOT NULL default '0',
+ `description` varchar(255) NOT NULL default '',
+ `PageText` mediumint(8) unsigned NOT NULL default '0',
+ `LanguageID` tinyint(3) unsigned NOT NULL default '0',
+ `PageMaterial` tinyint(3) unsigned NOT NULL default '0',
+ `startquest` mediumint(8) unsigned NOT NULL default '0',
+ `lockid` mediumint(8) unsigned NOT NULL default '0',
+ `Material` tinyint(4) NOT NULL default '0',
+ `sheath` tinyint(3) unsigned NOT NULL default '0',
+ `RandomProperty` mediumint(8) unsigned NOT NULL default '0',
+ `RandomSuffix` mediumint(8) unsigned NOT NULL default '0',
+ `block` mediumint(8) unsigned NOT NULL default '0',
+ `itemset` mediumint(8) unsigned NOT NULL default '0',
+ `MaxDurability` smallint(5) unsigned NOT NULL default '0',
+ `area` mediumint(8) unsigned NOT NULL default '0',
+ `Map` smallint(6) NOT NULL default '0',
+ `BagFamily` mediumint(9) NOT NULL default '0',
+ `TotemCategory` mediumint(9) NOT NULL default '0',
+ `socketColor_1` tinyint(4) NOT NULL default '0',
+ `socketContent_1` mediumint(9) NOT NULL default '0',
+ `socketColor_2` tinyint(4) NOT NULL default '0',
+ `socketContent_2` mediumint(9) NOT NULL default '0',
+ `socketColor_3` tinyint(4) NOT NULL default '0',
+ `socketContent_3` mediumint(9) NOT NULL default '0',
+ `socketBonus` mediumint(9) NOT NULL default '0',
+ `GemProperties` mediumint(9) NOT NULL default '0',
+ `RequiredDisenchantSkill` smallint(6) NOT NULL default '-1',
+ `ArmorDamageModifier` float NOT NULL default '0',
+ `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time',
+ `ItemLimitCategory` smallint(6) NOT NULL default '0',
+ `ScriptName` varchar(64) NOT NULL default '',
+ `DisenchantID` mediumint(8) unsigned NOT NULL default '0',
+ `FoodType` tinyint(3) unsigned NOT NULL default '0',
+ `minMoneyLoot` int(10) unsigned NOT NULL default '0',
+ `maxMoneyLoot` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`),
+ KEY `items_index` (`class`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
+
+--
+-- Dumping data for table `item_template`
+--
+
+LOCK TABLES `item_template` WRITE;
+/*!40000 ALTER TABLE `item_template` DISABLE KEYS */;
+INSERT INTO `item_template` VALUES
+(25,2,7,-1,'Worn Shortsword',1542,1,0,1,35,7,21,32767,511,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1900,0,0,0,0,0,0,-1,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,0,0,0,1,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(35,2,10,-1,'Bent Staff',472,1,0,1,47,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,2,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(36,2,4,-1,'Worn Mace',5194,1,0,1,38,7,21,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1900,0,0,0,0,0,0,-1,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,2,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(37,2,0,-1,'Worn Axe',14029,1,0,1,38,7,21,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,0,0,0,0,0,0,-1,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,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(38,4,0,-1,'Recruit\'s Shirt',9891,1,0,1,1,1,4,-1,-1,1,0,0,0,0,0,0,0,0,0,1,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,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(39,4,1,-1,'Recruit\'s Pants',9892,0,0,1,5,1,7,32767,511,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(40,4,0,-1,'Recruit\'s Boots',10141,1,0,1,4,1,8,32767,511,1,0,0,0,0,0,0,0,0,0,1,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,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(43,4,0,-1,'Squire\'s Boots',9938,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(44,4,1,-1,'Squire\'s Pants',9937,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(45,4,0,-1,'Squire\'s Shirt',3265,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(47,4,0,-1,'Footpad\'s Shoes',9915,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(48,4,1,-1,'Footpad\'s Pants',9913,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(49,4,0,-1,'Footpad\'s Shirt',9906,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(51,4,0,-1,'Neophyte\'s Boots',9946,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(52,4,1,-1,'Neophyte\'s Pants',9945,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(53,4,0,-1,'Neophyte\'s Shirt',9944,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(55,4,0,-1,'Apprentice\'s Boots',9929,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(56,4,1,-1,'Apprentice\'s Robe',12647,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(57,4,1,-1,'Acolyte\'s Robe',12645,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(59,4,0,-1,'Acolyte\'s Shoes',3261,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(117,0,0,-1,'Tough Jerky',2473,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(120,4,1,-1,'Thug Pants',10006,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(121,4,0,-1,'Thug Boots',10008,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(127,4,0,-1,'Trapper\'s Shirt',9996,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(139,4,1,-1,'Brawler\'s Pants',9988,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(140,4,0,-1,'Brawler\'s Boots',9992,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(147,4,1,-1,'Rugged Trapper\'s Pants',9975,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(148,4,0,-1,'Rugged Trapper\'s Shirt',9976,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(153,4,2,-1,'Primitive Kilt',10050,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,14,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,8,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(154,4,0,-1,'Primitive Mantle',10058,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(159,0,0,-1,'Refreshing Spring Water',18084,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,430,0,-1,0,-1,59,1000,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(1395,4,1,-1,'Apprentice\'s Pants',9924,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(1396,4,1,-1,'Acolyte\'s Pants',3260,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2070,0,0,-1,'Darnassian Bleu',6353,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2092,2,15,-1,'Worn Dagger',6442,1,0,1,35,7,13,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1600,0,0,0,0,0,0,-1,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,3,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2101,11,2,-1,'Light Quiver',21328,1,0,1,4,1,18,2047,255,1,1,0,0,0,0,0,0,0,0,1,6,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,1000,0,0,14824,1,0,0,-1,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,'',0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2102,11,3,-1,'Small Ammo Pouch',1816,1,0,1,4,1,18,2047,255,1,1,0,0,0,0,0,0,0,0,1,6,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,1000,0,0,14824,1,0,0,-1,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,'',0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2105,4,0,-1,'Thug Shirt',10005,1,0,1,5,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2361,2,5,-1,'Battleworn Hammer',8690,1,0,1,45,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,1,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2362,4,6,-1,'Worn Wooden Shield',18730,0,0,1,7,1,14,32767,511,1,1,0,0,0,0,0,0,0,0,1,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,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,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,4,0,0,1,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2504,2,2,-1,'Worn Shortbow',8106,1,0,1,29,5,15,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2300,2,0,0,0,0,0,-1,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,2,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2508,2,3,-1,'Old Blunderbuss',6606,1,0,1,27,5,26,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2300,3,0,0,0,0,0,-1,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,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2512,6,2,-1,'Rough Arrow',5996,1,0,1,10,0,24,2047,255,5,1,0,0,0,0,0,0,0,0,200,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3000,0,0,0,0,0,0,-1,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,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2516,6,3,-1,'Light Shot',5998,1,0,1,10,0,24,2047,255,5,1,0,0,0,0,0,0,0,0,200,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3000,0,0,0,0,0,0,-1,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,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2947,15,0,-1,'Small Throwing Knife',16754,1,0,1,15,0,0,2047,255,3,1,0,0,0,0,0,0,0,0,200,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,4,0,0,0,0,0,-1,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(3661,2,10,-1,'Handcrafted Staff',18530,1,0,1,45,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,2,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(4536,0,0,-1,'Shiny Red Apple',6410,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,100,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(4540,0,0,-1,'Tough Hunk of Bread',6399,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(4604,0,0,-1,'Forest Mushroom Cap',15852,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6096,4,0,-1,'Apprentice\'s Shirt',2163,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6097,4,0,-1,'Acolyte\'s Shirt',2470,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6098,4,1,-1,'Neophyte\'s Robe',12679,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6119,4,1,-1,'Neophyte\'s Robe',12681,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6123,4,1,-1,'Novice\'s Robe',12683,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6124,4,1,-1,'Novice\'s Pants',9987,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6125,4,0,-1,'Brawler\'s Harness',9995,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6126,4,1,-1,'Trapper\'s Pants',10002,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6127,4,0,-1,'Trapper\'s Boots',10003,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6129,4,1,-1,'Acolyte\'s Robe',12646,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6134,4,0,-1,'Primitive Mantle',10108,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6135,4,2,-1,'Primitive Kilt',10109,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,14,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,8,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6139,4,1,-1,'Novice\'s Robe',12684,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6140,4,1,-1,'Apprentice\'s Robe',12649,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6144,4,1,-1,'Neophyte\'s Robe',12680,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6948,15,0,-1,'Hearthstone',6418,1,64,1,0,0,0,32767,511,1,0,0,0,0,0,0,0,0,0,1,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,8690,0,0,0,-1,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,'',0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(12282,2,1,-1,'Worn Battleaxe',22291,1,0,1,43,8,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14646,12,0,-1,'Northshire Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5805,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14647,12,0,-1,'Coldridge Valley Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5841,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14648,12,0,-1,'Shadowglen Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5842,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14649,12,0,-1,'Valley of Trials Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5843,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14650,12,0,-1,'Camp Narache Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5844,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14651,12,0,-1,'Deathknell Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5847,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(25861,2,16,-1,'Crude Throwing Axe',20777,1,0,1,15,0,25,2047,255,3,1,0,0,0,0,0,0,0,0,200,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,4,0,0,0,0,0,-1,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(34648,4,4,-1,'Acherus Knight\'s Greaves',51496,2,32768,1,51,10,8,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,10,7,12,3,7,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,392,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34649,4,4,-1,'Acherus Knight\'s Gauntlets',51498,2,32768,1,34,6,10,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,6,32,8,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,356,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34650,4,4,-1,'Acherus Knight\'s Tunic',51494,2,32768,1,69,13,5,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,20,7,11,32,7,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,570,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34651,4,4,-1,'Acherus Knight\'s Girdle',51497,2,32768,1,35,7,6,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,10,32,15,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,320,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34652,4,4,-1,'Acherus Knight\'s Hood',51495,2,32768,1,52,10,1,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,15,32,9,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,463,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34653,4,4,-1,'Acherus Knight\'s Wristguard',51500,2,32768,1,36,7,9,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,7,31,7,7,11,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,249,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34655,4,4,-1,'Acherus Knight\'s Pauldrons',51501,2,32768,1,54,10,3,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,9,7,11,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,427,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34656,4,4,-1,'Acherus Knight\'s Cover',51499,2,32768,1,73,14,7,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,13,3,10,7,15,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,499,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,85,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34657,4,0,-1,'Choker of Damnation',6539,2,32768,1,2303,575,2,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,9,7,8,31,6,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,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34658,4,0,-1,'Plague Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,7,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34659,4,1,-1,'Acherus Knight\'s Shroud',49738,2,32768,1,31,6,16,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,12,7,7,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,39,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38145,1,0,-1,'Deathweave Bag',1282,1,32768,1,0,0,18,-1,-1,35,0,0,0,0,0,0,0,0,0,1,12,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38147,4,0,-1,'Corrupted Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,32,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(41751,0,5,-1,'Black Mushroom',36728,1,0,1,100,5,0,-1,-1,65,55,0,0,0,0,0,0,0,0,20,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,27094,0,-1,0,0,11,1000,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0);
+/*!40000 ALTER TABLE `item_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_achievement_reward`
+--
+
+DROP TABLE IF EXISTS `locales_achievement_reward`;
+CREATE TABLE `locales_achievement_reward` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `subject_loc1` varchar(100) NOT NULL default '',
+ `subject_loc2` varchar(100) NOT NULL default '',
+ `subject_loc3` varchar(100) NOT NULL default '',
+ `subject_loc4` varchar(100) NOT NULL default '',
+ `subject_loc5` varchar(100) NOT NULL default '',
+ `subject_loc6` varchar(100) NOT NULL default '',
+ `subject_loc7` varchar(100) NOT NULL default '',
+ `subject_loc8` varchar(100) NOT NULL default '',
+ `text_loc1` text default NULL,
+ `text_loc2` text default NULL,
+ `text_loc3` text default NULL,
+ `text_loc4` text default NULL,
+ `text_loc5` text default NULL,
+ `text_loc6` text default NULL,
+ `text_loc7` text default NULL,
+ `text_loc8` text default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_achievement_reward`
+--
+
+LOCK TABLES `locales_achievement_reward` WRITE;
+/*!40000 ALTER TABLE `locales_achievement_reward` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_achievement_reward` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_creature`
+--
+
+DROP TABLE IF EXISTS `locales_creature`;
+CREATE TABLE `locales_creature` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `name_loc1` varchar(100) NOT NULL default '',
+ `name_loc2` varchar(100) NOT NULL default '',
+ `name_loc3` varchar(100) NOT NULL default '',
+ `name_loc4` varchar(100) NOT NULL default '',
+ `name_loc5` varchar(100) NOT NULL default '',
+ `name_loc6` varchar(100) NOT NULL default '',
+ `name_loc7` varchar(100) NOT NULL default '',
+ `name_loc8` varchar(100) NOT NULL default '',
+ `subname_loc1` varchar(100) default NULL,
+ `subname_loc2` varchar(100) default NULL,
+ `subname_loc3` varchar(100) default NULL,
+ `subname_loc4` varchar(100) default NULL,
+ `subname_loc5` varchar(100) default NULL,
+ `subname_loc6` varchar(100) default NULL,
+ `subname_loc7` varchar(100) default NULL,
+ `subname_loc8` varchar(100) default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_creature`
+--
+
+LOCK TABLES `locales_creature` WRITE;
+/*!40000 ALTER TABLE `locales_creature` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_creature` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_gameobject`
+--
+
+DROP TABLE IF EXISTS `locales_gameobject`;
+CREATE TABLE `locales_gameobject` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `name_loc1` varchar(100) NOT NULL default '',
+ `name_loc2` varchar(100) NOT NULL default '',
+ `name_loc3` varchar(100) NOT NULL default '',
+ `name_loc4` varchar(100) NOT NULL default '',
+ `name_loc5` varchar(100) NOT NULL default '',
+ `name_loc6` varchar(100) NOT NULL default '',
+ `name_loc7` varchar(100) NOT NULL default '',
+ `name_loc8` varchar(100) NOT NULL default '',
+ `castbarcaption_loc1` varchar(100) NOT NULL default '',
+ `castbarcaption_loc2` varchar(100) NOT NULL default '',
+ `castbarcaption_loc3` varchar(100) NOT NULL default '',
+ `castbarcaption_loc4` varchar(100) NOT NULL default '',
+ `castbarcaption_loc5` varchar(100) NOT NULL default '',
+ `castbarcaption_loc6` varchar(100) NOT NULL default '',
+ `castbarcaption_loc7` varchar(100) NOT NULL default '',
+ `castbarcaption_loc8` varchar(100) NOT NULL default '',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_gameobject`
+--
+
+LOCK TABLES `locales_gameobject` WRITE;
+/*!40000 ALTER TABLE `locales_gameobject` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_gameobject` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_item`
+--
+
+DROP TABLE IF EXISTS `locales_item`;
+CREATE TABLE `locales_item` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `name_loc1` varchar(100) NOT NULL default '',
+ `name_loc2` varchar(100) NOT NULL default '',
+ `name_loc3` varchar(100) NOT NULL default '',
+ `name_loc4` varchar(100) NOT NULL default '',
+ `name_loc5` varchar(100) NOT NULL default '',
+ `name_loc6` varchar(100) NOT NULL default '',
+ `name_loc7` varchar(100) NOT NULL default '',
+ `name_loc8` varchar(100) NOT NULL default '',
+ `description_loc1` varchar(255) default NULL,
+ `description_loc2` varchar(255) default NULL,
+ `description_loc3` varchar(255) default NULL,
+ `description_loc4` varchar(255) default NULL,
+ `description_loc5` varchar(255) default NULL,
+ `description_loc6` varchar(255) default NULL,
+ `description_loc7` varchar(255) default NULL,
+ `description_loc8` varchar(255) default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_item`
+--
+
+LOCK TABLES `locales_item` WRITE;
+/*!40000 ALTER TABLE `locales_item` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */;
+UNLOCK TABLES;
+
+
+--
+-- Table structure for table `locales_npc_option`
+--
+
+DROP TABLE IF EXISTS `locales_npc_option`;
+CREATE TABLE `locales_npc_option` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `option_text_loc1` text,
+ `option_text_loc2` text,
+ `option_text_loc3` text,
+ `option_text_loc4` text,
+ `option_text_loc5` text,
+ `option_text_loc6` text,
+ `option_text_loc7` text,
+ `option_text_loc8` text,
+ `box_text_loc1` text,
+ `box_text_loc2` text,
+ `box_text_loc3` text,
+ `box_text_loc4` text,
+ `box_text_loc5` text,
+ `box_text_loc6` text,
+ `box_text_loc7` text,
+ `box_text_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_npc_option`
+--
+
+LOCK TABLES `locales_npc_option` WRITE;
+/*!40000 ALTER TABLE `locales_npc_option` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_npc_option` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_npc_text`
+--
+
+DROP TABLE IF EXISTS `locales_npc_text`;
+CREATE TABLE `locales_npc_text` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `Text0_0_loc1` longtext,
+ `Text0_0_loc2` longtext,
+ `Text0_0_loc3` longtext,
+ `Text0_0_loc4` longtext,
+ `Text0_0_loc5` longtext,
+ `Text0_0_loc6` longtext,
+ `Text0_0_loc7` longtext,
+ `Text0_0_loc8` longtext,
+ `Text0_1_loc1` longtext,
+ `Text0_1_loc2` longtext,
+ `Text0_1_loc3` longtext,
+ `Text0_1_loc4` longtext,
+ `Text0_1_loc5` longtext,
+ `Text0_1_loc6` longtext,
+ `Text0_1_loc7` longtext,
+ `Text0_1_loc8` longtext,
+ `Text1_0_loc1` longtext,
+ `Text1_0_loc2` longtext,
+ `Text1_0_loc3` longtext,
+ `Text1_0_loc4` longtext,
+ `Text1_0_loc5` longtext,
+ `Text1_0_loc6` longtext,
+ `Text1_0_loc7` longtext,
+ `Text1_0_loc8` longtext,
+ `Text1_1_loc1` longtext,
+ `Text1_1_loc2` longtext,
+ `Text1_1_loc3` longtext,
+ `Text1_1_loc4` longtext,
+ `Text1_1_loc5` longtext,
+ `Text1_1_loc6` longtext,
+ `Text1_1_loc7` longtext,
+ `Text1_1_loc8` longtext,
+ `Text2_0_loc1` longtext,
+ `Text2_0_loc2` longtext,
+ `Text2_0_loc3` longtext,
+ `Text2_0_loc4` longtext,
+ `Text2_0_loc5` longtext,
+ `Text2_0_loc6` longtext,
+ `Text2_0_loc7` longtext,
+ `Text2_0_loc8` longtext,
+ `Text2_1_loc1` longtext,
+ `Text2_1_loc2` longtext,
+ `Text2_1_loc3` longtext,
+ `Text2_1_loc4` longtext,
+ `Text2_1_loc5` longtext,
+ `Text2_1_loc6` longtext,
+ `Text2_1_loc7` longtext,
+ `Text2_1_loc8` longtext,
+ `Text3_0_loc1` longtext,
+ `Text3_0_loc2` longtext,
+ `Text3_0_loc3` longtext,
+ `Text3_0_loc4` longtext,
+ `Text3_0_loc5` longtext,
+ `Text3_0_loc6` longtext,
+ `Text3_0_loc7` longtext,
+ `Text3_0_loc8` longtext,
+ `Text3_1_loc1` longtext,
+ `Text3_1_loc2` longtext,
+ `Text3_1_loc3` longtext,
+ `Text3_1_loc4` longtext,
+ `Text3_1_loc5` longtext,
+ `Text3_1_loc6` longtext,
+ `Text3_1_loc7` longtext,
+ `Text3_1_loc8` longtext,
+ `Text4_0_loc1` longtext,
+ `Text4_0_loc2` longtext,
+ `Text4_0_loc3` longtext,
+ `Text4_0_loc4` longtext,
+ `Text4_0_loc5` longtext,
+ `Text4_0_loc6` longtext,
+ `Text4_0_loc7` longtext,
+ `Text4_0_loc8` longtext,
+ `Text4_1_loc1` longtext,
+ `Text4_1_loc2` longtext,
+ `Text4_1_loc3` longtext,
+ `Text4_1_loc4` longtext,
+ `Text4_1_loc5` longtext,
+ `Text4_1_loc6` longtext,
+ `Text4_1_loc7` longtext,
+ `Text4_1_loc8` longtext,
+ `Text5_0_loc1` longtext,
+ `Text5_0_loc2` longtext,
+ `Text5_0_loc3` longtext,
+ `Text5_0_loc4` longtext,
+ `Text5_0_loc5` longtext,
+ `Text5_0_loc6` longtext,
+ `Text5_0_loc7` longtext,
+ `Text5_0_loc8` longtext,
+ `Text5_1_loc1` longtext,
+ `Text5_1_loc2` longtext,
+ `Text5_1_loc3` longtext,
+ `Text5_1_loc4` longtext,
+ `Text5_1_loc5` longtext,
+ `Text5_1_loc6` longtext,
+ `Text5_1_loc7` longtext,
+ `Text5_1_loc8` longtext,
+ `Text6_0_loc1` longtext,
+ `Text6_0_loc2` longtext,
+ `Text6_0_loc3` longtext,
+ `Text6_0_loc4` longtext,
+ `Text6_0_loc5` longtext,
+ `Text6_0_loc6` longtext,
+ `Text6_0_loc7` longtext,
+ `Text6_0_loc8` longtext,
+ `Text6_1_loc1` longtext,
+ `Text6_1_loc2` longtext,
+ `Text6_1_loc3` longtext,
+ `Text6_1_loc4` longtext,
+ `Text6_1_loc5` longtext,
+ `Text6_1_loc6` longtext,
+ `Text6_1_loc7` longtext,
+ `Text6_1_loc8` longtext,
+ `Text7_0_loc1` longtext,
+ `Text7_0_loc2` longtext,
+ `Text7_0_loc3` longtext,
+ `Text7_0_loc4` longtext,
+ `Text7_0_loc5` longtext,
+ `Text7_0_loc6` longtext,
+ `Text7_0_loc7` longtext,
+ `Text7_0_loc8` longtext,
+ `Text7_1_loc1` longtext,
+ `Text7_1_loc2` longtext,
+ `Text7_1_loc3` longtext,
+ `Text7_1_loc4` longtext,
+ `Text7_1_loc5` longtext,
+ `Text7_1_loc6` longtext,
+ `Text7_1_loc7` longtext,
+ `Text7_1_loc8` longtext,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_npc_text`
+--
+
+LOCK TABLES `locales_npc_text` WRITE;
+/*!40000 ALTER TABLE `locales_npc_text` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_npc_text` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_page_text`
+--
+
+DROP TABLE IF EXISTS `locales_page_text`;
+CREATE TABLE `locales_page_text` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `Text_loc1` longtext,
+ `Text_loc2` longtext,
+ `Text_loc3` longtext,
+ `Text_loc4` longtext,
+ `Text_loc5` longtext,
+ `Text_loc6` longtext,
+ `Text_loc7` longtext,
+ `Text_loc8` longtext,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_page_text`
+--
+
+LOCK TABLES `locales_page_text` WRITE;
+/*!40000 ALTER TABLE `locales_page_text` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_points_of_interest`
+--
+
+DROP TABLE IF EXISTS `locales_points_of_interest`;
+CREATE TABLE `locales_points_of_interest` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `icon_name_loc1` text,
+ `icon_name_loc2` text,
+ `icon_name_loc3` text,
+ `icon_name_loc4` text,
+ `icon_name_loc5` text,
+ `icon_name_loc6` text,
+ `icon_name_loc7` text,
+ `icon_name_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_points_of_interest`
+--
+
+LOCK TABLES `locales_points_of_interest` WRITE;
+/*!40000 ALTER TABLE `locales_points_of_interest` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_points_of_interest` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `locales_quest`
+--
+
+DROP TABLE IF EXISTS `locales_quest`;
+CREATE TABLE `locales_quest` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `Title_loc1` text,
+ `Title_loc2` text,
+ `Title_loc3` text,
+ `Title_loc4` text,
+ `Title_loc5` text,
+ `Title_loc6` text,
+ `Title_loc7` text,
+ `Title_loc8` text,
+ `Details_loc1` text,
+ `Details_loc2` text,
+ `Details_loc3` text,
+ `Details_loc4` text,
+ `Details_loc5` text,
+ `Details_loc6` text,
+ `Details_loc7` text,
+ `Details_loc8` text,
+ `Objectives_loc1` text,
+ `Objectives_loc2` text,
+ `Objectives_loc3` text,
+ `Objectives_loc4` text,
+ `Objectives_loc5` text,
+ `Objectives_loc6` text,
+ `Objectives_loc7` text,
+ `Objectives_loc8` text,
+ `OfferRewardText_loc1` text,
+ `OfferRewardText_loc2` text,
+ `OfferRewardText_loc3` text,
+ `OfferRewardText_loc4` text,
+ `OfferRewardText_loc5` text,
+ `OfferRewardText_loc6` text,
+ `OfferRewardText_loc7` text,
+ `OfferRewardText_loc8` text,
+ `RequestItemsText_loc1` text,
+ `RequestItemsText_loc2` text,
+ `RequestItemsText_loc3` text,
+ `RequestItemsText_loc4` text,
+ `RequestItemsText_loc5` text,
+ `RequestItemsText_loc6` text,
+ `RequestItemsText_loc7` text,
+ `RequestItemsText_loc8` text,
+ `EndText_loc1` text,
+ `EndText_loc2` text,
+ `EndText_loc3` text,
+ `EndText_loc4` text,
+ `EndText_loc5` text,
+ `EndText_loc6` text,
+ `EndText_loc7` text,
+ `EndText_loc8` text,
+ `ObjectiveText1_loc1` text,
+ `ObjectiveText1_loc2` text,
+ `ObjectiveText1_loc3` text,
+ `ObjectiveText1_loc4` text,
+ `ObjectiveText1_loc5` text,
+ `ObjectiveText1_loc6` text,
+ `ObjectiveText1_loc7` text,
+ `ObjectiveText1_loc8` text,
+ `ObjectiveText2_loc1` text,
+ `ObjectiveText2_loc2` text,
+ `ObjectiveText2_loc3` text,
+ `ObjectiveText2_loc4` text,
+ `ObjectiveText2_loc5` text,
+ `ObjectiveText2_loc6` text,
+ `ObjectiveText2_loc7` text,
+ `ObjectiveText2_loc8` text,
+ `ObjectiveText3_loc1` text,
+ `ObjectiveText3_loc2` text,
+ `ObjectiveText3_loc3` text,
+ `ObjectiveText3_loc4` text,
+ `ObjectiveText3_loc5` text,
+ `ObjectiveText3_loc6` text,
+ `ObjectiveText3_loc7` text,
+ `ObjectiveText3_loc8` text,
+ `ObjectiveText4_loc1` text,
+ `ObjectiveText4_loc2` text,
+ `ObjectiveText4_loc3` text,
+ `ObjectiveText4_loc4` text,
+ `ObjectiveText4_loc5` text,
+ `ObjectiveText4_loc6` text,
+ `ObjectiveText4_loc7` text,
+ `ObjectiveText4_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `locales_quest`
+--
+
+LOCK TABLES `locales_quest` WRITE;
+/*!40000 ALTER TABLE `locales_quest` DISABLE KEYS */;
+/*!40000 ALTER TABLE `locales_quest` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `mangos_string`
+--
+
+DROP TABLE IF EXISTS `mangos_string`;
+CREATE TABLE `mangos_string` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `mangos_string`
+--
+
+LOCK TABLES `mangos_string` WRITE;
+/*!40000 ALTER TABLE `mangos_string` DISABLE KEYS */;
+INSERT INTO `mangos_string` VALUES
+(1,'You should select a character or a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(2,'You should select a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(3,'|cffff0000[System Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(4,'|cffff0000[Event Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(5,'There is no help for that command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(6,'There is no such command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(7,'There is no such subcommand',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(8,'Command %s have subcommands:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(9,'Commands available to you:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(10,'Incorrect syntax.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(11,'Your account level is: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(12,'Online players: %u (max: %u) Queued players: %u (max: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(13,'Server uptime: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(14,'Player saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(15,'All players saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(16,'There are the following active GMs on this server:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(17,'There are no GMs currently logged in on this server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(18,'Cannot do that while flying.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(19,'Cannot do that in Battlegrounds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(20,'Target is flying you can\'t do that.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(21,'%s is flying command failed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(22,'You are not mounted so you can\'t dismount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(23,'Cannot do that while fighting.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(24,'You used it recently.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(25,'Password not changed (unknown error)!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(26,'The password was changed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(27,'The new passwords do not match or the old password is wrong',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(28,'Your account is now locked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(29,'Your account is now unlocked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(30,', rank ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(31,' [known]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(32,' [learn]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(33,' [passive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(34,' [talent]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(35,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(36,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(37,' (offline)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(38,'on',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(39,'off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(40,'You are: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(41,'visible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(42,'invisible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(43,'done',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(44,'You',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(45,' <unknown> ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(46,'<error>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(47,'<non-existing character>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(48,'UNKNOWN',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(49,'You must be at least level %u to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(50,'You must be at least level %u and have item %s to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(51,'Hello! Ready for some training?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(52,'Invaid item count (%u) for item %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(53,'Mail can\'t have more %u item stacks',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(54,'The new passwords do not match',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(55,'Your password can\'t be longer than 16 characters (client limit), password not changed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(56,'Current Message of the day: \r\n%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(57,'Using World DB: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(58,'Using script library: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(59,'Using creature EventAI: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(100,'Global notify: ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s) Phase: %u\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(102,'%s is already being teleported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(103,'You can summon a player to your instance only if he is in your party with you as leader.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(104,'You cannot go to the player\'s instance because you are in a party now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(105,'You can go to the player\'s instance while not being in his party only if your GM mode is on.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(106,'You can not go to player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(107,'You can not summon player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(108,'You are summoning %s%s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(109,'You are being summoned by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(110,'You are teleporting %s%s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(111,'You are being teleported by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(112,'Player (%s) does not exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(113,'Appearing at %s\'s location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(114,'%s is appearing to your location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(115,'Incorrect values.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(116,'No character selected.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(117,'%s is not in a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(118,'You changed HP of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(119,'%s changed your HP to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(120,'You changed MANA of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(121,'%s changed your MANA to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(122,'You changed ENERGY of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(123,'%s changed your ENERGY to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(124,'Current energy: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(125,'You changed rage of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(126,'%s changed your rage to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(127,'You changed level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(128,'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(129,'Wrong faction: %u (not found in factiontemplate.dbc).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(130,'You changed GUID=%i \'s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(131,'You changed the spellflatid=%i, val= %i, mark =%i to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(132,'%s changed your spellflatid=%i, val= %i, mark =%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(133,'%s has access to all taxi nodes now (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(134,'%s has no more access to all taxi nodes now (only visited accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(135,'%s has given you access to all taxi nodes (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(136,'%s has removed access to all taxi nodes (only visited still accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(137,'You set all speeds to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(138,'%s set all your speeds to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(139,'You set the speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(140,'%s set your speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(141,'You set the swim speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(142,'%s set your swim speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(143,'You set the backwards run speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(144,'%s set your backwards run speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(145,'You set the fly speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(146,'%s set your fly speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(147,'You set the size %2.2f of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(148,'%s set your size to %2.2f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(149,'There is no such mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(150,'You give a mount to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(151,'%s gave you a mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(152,'USER1: %i, ADD: %i, DIF: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(153,'You take all copper of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(154,'%s took you all of your copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(155,'You take %i copper from %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(156,'%s took %i copper from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(157,'You give %i copper to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(158,'%s gave you %i copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(159,'You hear sound %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(160,'USER2: %i, ADD: %i, RESULT: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(161,'Removed bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(162,'Set bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(163,'Teleport location table is empty!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(164,'Teleport location not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(165,'Requires search parameter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(166,'There are no teleport locations matching your request.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(168,'Locations found are:\n %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(169,'Mail sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(170,'You try to hear sound %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(172,'server console command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(173,'You changed runic power of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(174,'%s changed your runic power to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(175,'Liquid level: %f, ground: %f, type: %d, status: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(200,'No selection.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(201,'Object GUID is: lowpart %u highpart %X',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(202,'The name was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(203,'Error, name can only contain characters A-Z and a-z.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(204,'The subname was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(205,'Not yet implemented',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(206,'Item \'%i\' \'%s\' added to list with maxcount \'%i\' and incrtime \'%i\' and extendedcost \'%i\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(207,'Item \'%i\' not found in database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(208,'Item \'%i\' \'%s\' deleted from vendor list',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(209,'Item \'%i\' not found in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(210,'Item \'%i\' already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(211,'Spells of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(212,'Spells of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(213,'Talents of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(214,'Talents of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(215,'Your spells have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(216,'Your talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(217,'Unknown case \'%s\' for .resetall command. Type full correct case name.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(218,'Spells will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(219,'Talents will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(220,'Creature (GUID: %u) No waypoint found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(221,'Creature (GUID: %u) Last waypoint not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(222,'Creature (GUID: %u) No waypoint found - used \'wpguid\'. Now trying to find it by its position...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(223,'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(224,'Selected creature is ignored - provided GUID is used',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(225,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(226,'You must select a visual waypoint.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(227,'No visual waypoints found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(228,'Could not create visual waypoint with creatureID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(229,'All visual waypoints removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(230,'Could not create waypoint-creature with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(231,'No GUID provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(232,'No waypoint number provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(233,'Argument required for \'%s\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(234,'Waypoint %i added to GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(235,'Waypoint %d added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(236,'Waypoint changed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(237,'Waypoint %s modified.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(238,'WP export successfull.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(239,'No waypoints found inside the database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(240,'File imported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(241,'Waypoint removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(242,'Warning: Could not delete WP from the world with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(243,'This happens if the waypoint is too far away from your char.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(244,'The WP is deleted from the database, but not from the world here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(245,'They will disappear after a server restart.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(246,'Waypoint %d: Info for creature: %s, GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(247,'Waittime: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(248,'Model %d: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(249,'Emote: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(250,'Spell: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(251,'Text%d (ID: %i): %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(252,'AIScript: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(253,'Forced rename for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(254,'Forced rename for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(255,'Waypoint-Creature (GUID: %u) Not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(256,'Could not find NPC...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(257,'Creature movement type set to \'%s\', waypoints removed (if any).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(258,'Creature movement type set to \'%s\', waypoints were not removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(259,'Incorrect value, use on or off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(260,'Value saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(261,'Value saved, you may need to rejoin or clean your client cache.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(262,'Areatrigger ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(263,'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(264,'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(265,'Zone %u (%s) is part of instanceable map %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(266,'Nothing found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(267,'Object not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(268,'Creature not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(269,'Warning: Mob found more than once - you will be teleported to the first one found in DB.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(270,'Creature Removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(271,'Creature moved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(272,'Creature (GUID:%u) must be on the same map as player!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(273,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(274,'Game Object (GUID: %u) has references in not found creature %u GO list, can\'t be deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(275,'Game Object (GUID: %u) removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(276,'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) turned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(277,'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) moved',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(278,'You must select a vendor',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(279,'You must send id for item',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(280,'Vendor has too many items (max 128)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(281,'You can\'t kick self, logout instead',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(282,'Player %s kicked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(283,'Player %s not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(284,'Accepting Whisper: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(285,'Accepting Whisper: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(286,'Accepting Whisper: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(287,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(288,'Tickets count: %i show new tickets: %s\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(289,'New ticket from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(290,'Ticket of %s (Last updated: %s):\n%s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(291,'New ticket show: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(292,'New ticket show: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(293,'Ticket %i doesn\'t exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(294,'All tickets deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(295,'Character %s ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(296,'Ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(297,'Spawn distance changed to: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(298,'Spawn time changed to: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(299,'The honor of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(300,'Your chat has been disabled for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(301,'You have disabled %s\'s chat for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(302,'Player\'s chat is already enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(303,'Your chat has been enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(304,'You have enabled %s\'s chat.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(305, 'Faction %s (%u) reputation of %s was set to %5d!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(306, 'The arena points of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(307, 'No faction found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(308, 'Faction %i unknown!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(309, 'Invalid parameter %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(310, 'delta must be between 0 and %d (inclusive)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(311, '%d - |cffffffff|Hfaction:%d|h[%s]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(312, ' [visible]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(313, ' [at war]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(314, ' [peace forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(315, ' [hidden]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(316, ' [invisible forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(317, ' [inactive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(318, 'Hated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(319, 'Hostile',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(320, 'Unfriendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(321, 'Neutral',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(322, 'Friendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(323, 'Honored',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(324, 'Revered',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(325, 'Exalted',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(326, 'Faction %s (%u) can\'not have reputation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(327, ' [no reputation]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(328,'Characters at account %s (Id: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(329,' %s (GUID %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(330,'No players found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(331,'Extended item cost %u not exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(332,'GM mode is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(333,'GM mode is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(334,'GM Chat Badge is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(335,'GM Chat Badge is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(336,'You repair all %s''s items.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(337,'All your items repaired by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(338,'You set waterwalk mode %s for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(339,'Your waterwalk mode %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(340,'%s is now following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(341,'%s is not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(342,'%s is now not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(343,'Creature (Entry: %u) cannot be tamed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(344,'You already have pet.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(403,'You have low security level for this.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(404,'Creature movement disabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(405,'Creature movement enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(406,'Weather can\'t be changed for this zone.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(407,'Weather system disabled at server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(408,'%s is banned for %s. Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(409,'%s is banned permanently for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(410,'%s %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(411,'%s unbanned.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(412,'There was an error removing the ban on %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(413,'Account not exist: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(414,'There is no such character.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(415,'There is no such IP in banlist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(416,'Account %s has never been banned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(417,'Ban history for account %s:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(418,'Ban Date: %s Bantime: %s Still active: %s Reason: %s Set by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(419,'Inf.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(420,'Never',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(421,'Yes',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(422,'No',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(423,'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(424,'There is no matching IPban.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(425,'There is no matching account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(426,'There is no banned account owning a character matching this part.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(427,'The following IPs match your pattern:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(428,'The following accounts match your query:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(429,'You learned many spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(430,'You learned all spells for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(431,'You learned all talents for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(432,'You learned all languages.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(433,'You learned all craft skills and recipes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(434,'Could not find \'%s\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(435,'Invalid item id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(436,'No items found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(437,'Invalid gameobject id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(438,'Found items %u: %u ( inventory %u mail %u auction %u guild %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(439,'Found gameobjects %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(440,'Invalid creature id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(441,'Found creatures %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(442,'No area found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(443,'No item sets found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(444,'No skills found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(445,'No spells found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(446,'No quests found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(447,'No creatures found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(448,'No gameobjects found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(449,'Graveyard #%u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(457,'alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(458,'horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(459,'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(460,'Zone #%u doesn\'t have linked graveyards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(461,'Zone #%u doesn\'t have linked graveyards for faction: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(462,'Teleport location already exists!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(463,'Teleport location added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(464,'Teleport location NOT added: database error.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(465,'Teleport location deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(467,'Target unit has %d auras:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(468,'id: %d eff: %d type: %d duration: %d maxduration: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(469,'Target unit has %d auras of type %d:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(470,'id: %d eff: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(471,'Quest %u not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(472,'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(473,'Quest removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(474,' [rewarded]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(475,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(476,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(477,'%s\'s Fly Mode %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(478,'Opcode %u sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(479,'Character loaded successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(480,'Failed to load the character!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(481,'Character dumped successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(482,'Character dump failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(483,'Spell %u broken and not allowed to cast or learn!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(484,'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(485,'Player %s must have skill %u (%s) before using this command.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(486,'Invalid skill id (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(487,'You learned default GM spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(488,'You already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(489,'Target(%s) already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(490,'%s doesn\'t know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(491,'You already forgot that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(492,'All spell cooldowns removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(493,'Spell %u cooldown removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(494,'Command : Additem, itemId = %i, amount = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(495,'Command : Additemset, itemsetId = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(496,'Removed itemID = %i, amount = %i from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(497,'Cannot create item \'%i\' (amount: %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(498,'You need to provide a guild name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(499,'Player not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(500,'Player already has a guild!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(501,'Guild not created! (already exists?)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(502,'No items from itemset \'%u\' found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(503,'The distance is: (3D) %f (2D) %f yards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(504,'Item \'%i\' \'%s\' Item Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(505,'Item \'%i\' doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(506,'Item \'%i\' \'%s\' Added to Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(507,'Item save failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(508,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(509,'%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(510,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(511,'Wrong link type!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(512,'%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(513,'%d - |cffffffff|Hquest:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(514,'%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(515,'%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(516,'%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(517,'%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(518,'%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(522,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(524,'Selected object:\n|cffffffff|Hgameobject:%d|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(526,'%s (lowguid: %u) movement generators stack:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(527,' Idle',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(528,' Random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(529,' Waypoint',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(530,' Animal random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(531,' Confused',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(532,' Targeted to player %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(533,' Targeted to creature %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(534,' Targeted to <NULL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(535,' Home movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(536,' Home movement used for player?!?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(537,' Taxi flight',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(538,' Unknown movement generator (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(539,'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(540,'Level: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(541,'Health (base): %u. (max): %u. (current): %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(542,'Unit Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(543,'Loot: %u Pickpocket: %u Skinning: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(544,'Position: %f %f %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(545,'*** Is a vendor!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(546,'*** Is a trainer!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(547,'InstanceID: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(548,'Player%s %s (guid: %u) Account: %s (id: %u) GMLevel: %u Last IP: %s Last login: %s Latency: %ums',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(549,'Played time: %s Level: %u Money: %ug%us%uc',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(550,'Command .pinfo doesn\'t support \'rep\' option for offline players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(551,'%s has explored all zones now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(552,'%s has no more explored zones.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(553,'%s has explored all zones for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(554,'%s has hidden all zones from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(555,'Hover enabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(556,'Hover disabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(557,'You have been leveled up (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(558,'You have been leveled down (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(559,'Your level progress has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(560,'The area has been set as explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(561,'The area has been set as not explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(562,'GUID=%i \'s updateIndex: %i, value: %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(563,'You change GUID=%i \'s UpdateIndex: %i value to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(564,'The value index %u is too big to %u(count: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(565,'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(566,'You Set %u Field:%u to uint32 Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(567,'Set %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(568,'You Set %u Field:%i to float Value: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(569,'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(570,'The uint32 value of %u in %u is: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(571,'Get %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(572,'The float of %u value in %u is: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(573,'.Set32Bit:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(574,'You set Bit of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(575,'.Mod32Value:[OPCODE]:%u [VALUE]:%i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(576,'You modified the value of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(577,'You are now invisible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(578,'You are now visible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(579,'Selected player or creature not have victim.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(580,'You learned all default spells for race/class and completed quests rewarded spells.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(581,'Found near gameobjects (distance %f): %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(582,'SpawnTime: Full:%s Remain:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(583,'%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(584,'No event found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(585,'Event not exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(586,'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(587,'Event %u already active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(588,'Event %u not active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(589,' Point movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(590,' Fear movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(591,' Distract movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(592,'You have learned all spells in craft: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(593,'Currently Banned Accounts:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(594,'| Account | BanDate | UnbanDate | Banned By | Ban Reason |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(595,'Currently Banned IPs:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(596,'| IP | BanDate | UnbanDate | Banned By | Ban Reason |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(597,'Current gamemasters:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(598,'| Account | GM |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(599,'No gamemasters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(600,'The Alliance wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(601,'The Horde wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(602,'The battle for Warsong Gulch begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(603,'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(604,'Let the battle for Warsong Gulch begin!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(605,'$n captured the Horde flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(606,'$n captured the Alliance flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(607,'The Horde flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(608,'The Alliance Flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(609,'The Alliance Flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(610,'The Horde flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(611,'The Horde flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(612,'The Alliance Flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(613,'The flags are now placed at their bases.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(614,'The Alliance flag is now placed at its base.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(615,'The Horde flag is now placed at its base.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(636,'The battle begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(637,'The battle begins in 30 seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(638,'The battle has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(650,'Alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(651,'Horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(652,'stables',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(653,'blacksmith',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(654,'farm',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(655,'lumber mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(656,'mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(657,'The %s has taken the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(658,'$n has defended the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(659,'$n has assaulted the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(660,'$n claims the %s! If left unchallenged, the %s will control it in 1 minute!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(661,'The battle for Arathi Basin begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(662,'The battle for Arathi Basin begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(663,'The battle for Arathi Basin has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(664,'The Alliance has gathered $1776W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(665,'The Horde has gathered $1777W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(666,'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(667,'The Alliance has taken control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(668,'The Horde has taken control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(669,'The Alliance has taken control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(670,'The Horde has taken control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(671,'The Alliance has taken control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(672,'The Horde has taken control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(673,'The Alliance has taken control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(674,'The Horde has taken control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(675,'The Alliance has lost control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(676,'The Horde has lost control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(677,'The Alliance has lost control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(678,'The Horde has lost control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(679,'The Alliance has lost control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(680,'The Horde has lost control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(681,'The Alliance has lost control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(682,'The Horde has lost control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(683,'%s has taken the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(684,'The Alliance have captured the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(685,'The Horde have captured the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(686,'The flag has been dropped.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(687,'The flag has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(700,'You must be level %u to form an arena team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(701,'One minute until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(702,'Thirty seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(703,'Fifteen seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(704,'The Arena battle has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(705,'You must wait %s before speaking again.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(706,'This item(s) have problems with equipping/storing in inventory.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(707,'%s wishes to not be disturbed and cannot receive whisper messages: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(708,'%s is Away from Keyboard: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(711,'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(717,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(718,'|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(719,'|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(720,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(721,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(722,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(723,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(724,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(725,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(727,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(728,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(729,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(730,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(731,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(732,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(733,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(734,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(735,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(736,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(737,'Arenas are set to 1v1 for debugging. So, don\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(738,'Arenas are set to normal playercount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(739,'Battlegrounds are set to 1v0 for debugging.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(740,'Battlegrounds are set to normal playercount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(741,'Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(742,'Distributing arena points to players...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(743,'Finished setting arena points for online players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(744,'Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(745,'Modification done.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(746,'Done flushing Arena points.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(755,'The battle begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(804,'You do not have permission to perform that function',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(805,'Unknown language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(806,'You don\'t know that language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(807,'Please provide character name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(808,'Player %s not found or offline',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(809,'Account for character %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(810,'|Hplayer:$N|h[$N]|h has earned the achievement $a!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(811,'Guild Master',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(812,'Officer',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(813,'Veteran',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(814,'Member',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(815,'Initiate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1000,'Exiting daemon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1001,'Account deleted: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1002,'Account %s NOT deleted (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1003,'Account %s NOT deleted (unknown error)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1004,'Account created: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1005,'Account name can\'t be longer than 16 characters (client limit), account not created!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1006,'Account with this name already exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1007,'Account %s NOT created (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1008,'Account %s NOT created (unknown error)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1009,'Player %s (Guid: %u) Account %s (Id: %u) deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1010,'| Account | Character | IP | GM | Expansion |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1011,'|<Error> | %20s |<Error> |<Er>| <Error> |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1012,'===========================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1013,'|%15s| %20s | %15s |%4d| %9d |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1014,'No online players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1100,'Account %s (Id: %u) have up to %u expansion allowed now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1101,'Message of the day changed to:\r\n%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1102,'Message sent to %s: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1103,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1104,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1105,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1106,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1107,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1108,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1109,'%d - %s %s %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1110,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1111,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1112,'Failed to open file: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1113,'Account %s (%u) have max amount allowed characters (client limit)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1114,'Dump file have broken data!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1115,'Invalid character name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1116,'Invalid character guid!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1117,'Character guid %u in use!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1119,'You must use male or female as gender.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1120,'You change gender of %s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1121,'Your gender changed to %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1122,'(%u/%u +perm %u +temp %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1123,'Not pet found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1124,'Wrong pet type',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1125,'Your pet learned all talents',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1126,'Your pet talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1127,'Talents of %s\'s pet reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `milling_loot_template`
+--
+
+DROP TABLE IF EXISTS `milling_loot_template`;
+CREATE TABLE `milling_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `milling_loot_template`
+--
+
+LOCK TABLES `milling_loot_template` WRITE;
+/*!40000 ALTER TABLE `milling_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `milling_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_gossip`
+--
+
+DROP TABLE IF EXISTS `npc_gossip`;
+CREATE TABLE `npc_gossip` (
+ `npc_guid` int(10) unsigned NOT NULL default '0',
+ `textid` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`npc_guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `npc_gossip`
+--
+
+LOCK TABLES `npc_gossip` WRITE;
+/*!40000 ALTER TABLE `npc_gossip` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_gossip` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_gossip_textid`
+--
+
+DROP TABLE IF EXISTS `npc_gossip_textid`;
+CREATE TABLE `npc_gossip_textid` (
+ `zoneid` smallint(5) unsigned NOT NULL default '0',
+ `action` smallint(5) unsigned NOT NULL default '0',
+ `textid` mediumint(8) unsigned NOT NULL default '0',
+ KEY `zoneid` (`zoneid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `npc_gossip_textid`
+--
+
+LOCK TABLES `npc_gossip_textid` WRITE;
+/*!40000 ALTER TABLE `npc_gossip_textid` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_gossip_textid` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_option`
+--
+
+DROP TABLE IF EXISTS `npc_option`;
+CREATE TABLE `npc_option` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `gossip_id` mediumint(8) unsigned NOT NULL default '0',
+ `npcflag` int(10) unsigned NOT NULL default '0',
+ `icon` tinyint(3) unsigned NOT NULL default '0',
+ `action` mediumint(8) unsigned NOT NULL default '0',
+ `box_money` int(10) unsigned NOT NULL default '0',
+ `coded` tinyint(3) unsigned NOT NULL default '0',
+ `option_text` text,
+ `box_text` text,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `npc_option`
+--
+
+LOCK TABLES `npc_option` WRITE;
+/*!40000 ALTER TABLE `npc_option` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_option` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_text`
+--
+
+DROP TABLE IF EXISTS `npc_text`;
+CREATE TABLE `npc_text` (
+ `ID` mediumint(8) unsigned NOT NULL default '0',
+ `text0_0` longtext,
+ `text0_1` longtext,
+ `lang0` tinyint(3) unsigned NOT NULL default '0',
+ `prob0` float NOT NULL default '0',
+ `em0_0` smallint(5) unsigned NOT NULL default '0',
+ `em0_1` smallint(5) unsigned NOT NULL default '0',
+ `em0_2` smallint(5) unsigned NOT NULL default '0',
+ `em0_3` smallint(5) unsigned NOT NULL default '0',
+ `em0_4` smallint(5) unsigned NOT NULL default '0',
+ `em0_5` smallint(5) unsigned NOT NULL default '0',
+ `text1_0` longtext,
+ `text1_1` longtext,
+ `lang1` tinyint(3) unsigned NOT NULL default '0',
+ `prob1` float NOT NULL default '0',
+ `em1_0` smallint(5) unsigned NOT NULL default '0',
+ `em1_1` smallint(5) unsigned NOT NULL default '0',
+ `em1_2` smallint(5) unsigned NOT NULL default '0',
+ `em1_3` smallint(5) unsigned NOT NULL default '0',
+ `em1_4` smallint(5) unsigned NOT NULL default '0',
+ `em1_5` smallint(5) unsigned NOT NULL default '0',
+ `text2_0` longtext,
+ `text2_1` longtext,
+ `lang2` tinyint(3) unsigned NOT NULL default '0',
+ `prob2` float NOT NULL default '0',
+ `em2_0` smallint(5) unsigned NOT NULL default '0',
+ `em2_1` smallint(5) unsigned NOT NULL default '0',
+ `em2_2` smallint(5) unsigned NOT NULL default '0',
+ `em2_3` smallint(5) unsigned NOT NULL default '0',
+ `em2_4` smallint(5) unsigned NOT NULL default '0',
+ `em2_5` smallint(5) unsigned NOT NULL default '0',
+ `text3_0` longtext,
+ `text3_1` longtext,
+ `lang3` tinyint(3) unsigned NOT NULL default '0',
+ `prob3` float NOT NULL default '0',
+ `em3_0` smallint(5) unsigned NOT NULL default '0',
+ `em3_1` smallint(5) unsigned NOT NULL default '0',
+ `em3_2` smallint(5) unsigned NOT NULL default '0',
+ `em3_3` smallint(5) unsigned NOT NULL default '0',
+ `em3_4` smallint(5) unsigned NOT NULL default '0',
+ `em3_5` smallint(5) unsigned NOT NULL default '0',
+ `text4_0` longtext,
+ `text4_1` longtext,
+ `lang4` tinyint(3) unsigned NOT NULL default '0',
+ `prob4` float NOT NULL default '0',
+ `em4_0` smallint(5) unsigned NOT NULL default '0',
+ `em4_1` smallint(5) unsigned NOT NULL default '0',
+ `em4_2` smallint(5) unsigned NOT NULL default '0',
+ `em4_3` smallint(5) unsigned NOT NULL default '0',
+ `em4_4` smallint(5) unsigned NOT NULL default '0',
+ `em4_5` smallint(5) unsigned NOT NULL default '0',
+ `text5_0` longtext,
+ `text5_1` longtext,
+ `lang5` tinyint(3) unsigned NOT NULL default '0',
+ `prob5` float NOT NULL default '0',
+ `em5_0` smallint(5) unsigned NOT NULL default '0',
+ `em5_1` smallint(5) unsigned NOT NULL default '0',
+ `em5_2` smallint(5) unsigned NOT NULL default '0',
+ `em5_3` smallint(5) unsigned NOT NULL default '0',
+ `em5_4` smallint(5) unsigned NOT NULL default '0',
+ `em5_5` smallint(5) unsigned NOT NULL default '0',
+ `text6_0` longtext,
+ `text6_1` longtext,
+ `lang6` tinyint(3) unsigned NOT NULL default '0',
+ `prob6` float NOT NULL default '0',
+ `em6_0` smallint(5) unsigned NOT NULL default '0',
+ `em6_1` smallint(5) unsigned NOT NULL default '0',
+ `em6_2` smallint(5) unsigned NOT NULL default '0',
+ `em6_3` smallint(5) unsigned NOT NULL default '0',
+ `em6_4` smallint(5) unsigned NOT NULL default '0',
+ `em6_5` smallint(5) unsigned NOT NULL default '0',
+ `text7_0` longtext,
+ `text7_1` longtext,
+ `lang7` tinyint(3) unsigned NOT NULL default '0',
+ `prob7` float NOT NULL default '0',
+ `em7_0` smallint(5) unsigned NOT NULL default '0',
+ `em7_1` smallint(5) unsigned NOT NULL default '0',
+ `em7_2` smallint(5) unsigned NOT NULL default '0',
+ `em7_3` smallint(5) unsigned NOT NULL default '0',
+ `em7_4` smallint(5) unsigned NOT NULL default '0',
+ `em7_5` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `npc_text`
+--
+
+LOCK TABLES `npc_text` WRITE;
+/*!40000 ALTER TABLE `npc_text` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_text` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_trainer`
+--
+
+DROP TABLE IF EXISTS `npc_trainer`;
+CREATE TABLE `npc_trainer` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `spell` mediumint(8) unsigned NOT NULL default '0',
+ `spellcost` int(10) unsigned NOT NULL default '0',
+ `reqskill` smallint(5) unsigned NOT NULL default '0',
+ `reqskillvalue` smallint(5) unsigned NOT NULL default '0',
+ `reqlevel` tinyint(3) unsigned NOT NULL default '0',
+ UNIQUE KEY `entry_spell` (`entry`,`spell`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `npc_trainer`
+--
+
+LOCK TABLES `npc_trainer` WRITE;
+/*!40000 ALTER TABLE `npc_trainer` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_trainer` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `npc_vendor`
+--
+
+DROP TABLE IF EXISTS `npc_vendor`;
+CREATE TABLE `npc_vendor` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `maxcount` tinyint(3) unsigned NOT NULL default '0',
+ `incrtime` int(10) unsigned NOT NULL default '0',
+ `ExtendedCost` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System';
+
+--
+-- Dumping data for table `npc_vendor`
+--
+
+LOCK TABLES `npc_vendor` WRITE;
+/*!40000 ALTER TABLE `npc_vendor` DISABLE KEYS */;
+/*!40000 ALTER TABLE `npc_vendor` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `page_text`
+--
+
+DROP TABLE IF EXISTS `page_text`;
+CREATE TABLE `page_text` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `text` longtext NOT NULL,
+ `next_page` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
+
+--
+-- Dumping data for table `page_text`
+--
+
+LOCK TABLES `page_text` WRITE;
+/*!40000 ALTER TABLE `page_text` DISABLE KEYS */;
+/*!40000 ALTER TABLE `page_text` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pet_levelstats`
+--
+
+DROP TABLE IF EXISTS `pet_levelstats`;
+CREATE TABLE `pet_levelstats` (
+ `creature_entry` mediumint(8) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL,
+ `hp` smallint(5) unsigned NOT NULL,
+ `mana` smallint(5) unsigned NOT NULL,
+ `armor` int(10) unsigned NOT NULL default '0',
+ `str` smallint(5) unsigned NOT NULL,
+ `agi` smallint(5) unsigned NOT NULL,
+ `sta` smallint(5) unsigned NOT NULL,
+ `inte` smallint(5) unsigned NOT NULL,
+ `spi` smallint(5) unsigned NOT NULL,
+ PRIMARY KEY (`creature_entry`,`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores pet levels stats.';
+
+--
+-- Dumping data for table `pet_levelstats`
+--
+
+LOCK TABLES `pet_levelstats` WRITE;
+/*!40000 ALTER TABLE `pet_levelstats` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pet_levelstats` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pet_name_generation`
+--
+
+DROP TABLE IF EXISTS `pet_name_generation`;
+CREATE TABLE `pet_name_generation` (
+ `id` mediumint(8) unsigned NOT NULL auto_increment,
+ `word` tinytext NOT NULL,
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `half` tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `pet_name_generation`
+--
+
+LOCK TABLES `pet_name_generation` WRITE;
+/*!40000 ALTER TABLE `pet_name_generation` DISABLE KEYS */;
+INSERT INTO `pet_name_generation` (`word`,`entry`,`half`) VALUES
+('Aba',416,0),
+('Az',416,0),
+('Bel',416,0),
+('Biz',416,0),
+('Cho',416,0),
+('Dag',416,0),
+('Gak',416,0),
+('Gar',416,0),
+('Gel',416,0),
+('Gho',416,0),
+('Gob',416,0),
+('Gra',416,0),
+('Jak',416,0),
+('Jub',416,0),
+('Kar',416,0),
+('Kup',416,0),
+('Laz',416,0),
+('Nal',416,0),
+('Nok',416,0),
+('Pag',416,0),
+('Pig',416,0),
+('Pip',416,0),
+('Piz',416,0),
+('Quz',416,0),
+('Rui',416,0),
+('Rul',416,0),
+('Rup',416,0),
+('Tar',416,0),
+('Vol',416,0),
+('Yaz',416,0),
+('Zep',416,0),
+('Zig',416,0),
+('Zil',416,0),
+('Zor',416,0),
+('bis',416,1),
+('fip',416,1),
+('gup',416,1),
+('ham',416,1),
+('jub',416,1),
+('kin',416,1),
+('kol',416,1),
+('lop',416,1),
+('loz',416,1),
+('mat',416,1),
+('mir',416,1),
+('nam',416,1),
+('nar',416,1),
+('nik',416,1),
+('nip',416,1),
+('pad',416,1),
+('pep',416,1),
+('pit',416,1),
+('qua',416,1),
+('rai',416,1),
+('rin',416,1),
+('rot',416,1),
+('tai',416,1),
+('tal',416,1),
+('tik',416,1),
+('tip',416,1),
+('tog',416,1),
+('tuk',416,1),
+('uri',416,1),
+('yal',416,1),
+('yap',416,1),
+('Bhee',417,0),
+('Bruu',417,0),
+('Czaa',417,0),
+('Droo',417,0),
+('Flaa',417,0),
+('Fzuu',417,0),
+('Ghaa',417,0),
+('Gree',417,0),
+('Gzaa',417,0),
+('Haa',417,0),
+('Haad',417,0),
+('Haag',417,0),
+('Haap',417,0),
+('Jhaa',417,0),
+('Jhuu',417,0),
+('Khaa',417,0),
+('Khii',417,0),
+('Khuu',417,0),
+('Kree',417,0),
+('Luu',417,0),
+('Maa',417,0),
+('Nhee',417,0),
+('Phuu',417,0),
+('Pryy',417,0),
+('Rhuu',417,0),
+('Shaa',417,0),
+('Sloo',417,0),
+('Sruu',417,0),
+('Thoo',417,0),
+('Traa',417,0),
+('Wraa',417,0),
+('Zhaa',417,0),
+('dhon',417,1),
+('dhum',417,1),
+('dhun',417,1),
+('dom',417,1),
+('don',417,1),
+('drom',417,1),
+('dym',417,1),
+('fenn',417,1),
+('fum',417,1),
+('fun',417,1),
+('ghon',417,1),
+('ghun',417,1),
+('grom',417,1),
+('grym',417,1),
+('hom',417,1),
+('hon',417,1),
+('hun',417,1),
+('jhom',417,1),
+('kun',417,1),
+('lum',417,1),
+('mmon',417,1),
+('mon',417,1),
+('myn',417,1),
+('nam',417,1),
+('nem',417,1),
+('nhym',417,1),
+('nom',417,1),
+('num',417,1),
+('phom',417,1),
+('roon',417,1),
+('rym',417,1),
+('shon',417,1),
+('thun',417,1),
+('tom',417,1),
+('zhem',417,1),
+('zhum',417,1),
+('zun',417,1),
+('Bar',1860,0),
+('Bel',1860,0),
+('Char',1860,0),
+('Grak\'',1860,0),
+('Graz\'',1860,0),
+('Grim',1860,0),
+('Hath',1860,0),
+('Hel',1860,0),
+('Hok',1860,0),
+('Huk',1860,0),
+('Jhaz',1860,0),
+('Jhom',1860,0),
+('Juk\'',1860,0),
+('Kal\'',1860,0),
+('Klath',1860,0),
+('Kon',1860,0),
+('Krag',1860,0),
+('Krak',1860,0),
+('Mak',1860,0),
+('Mezz',1860,0),
+('Orm',1860,0),
+('Phan',1860,0),
+('Sar',1860,0),
+('Tang',1860,0),
+('Than',1860,0),
+('Thog',1860,0),
+('Thok',1860,0),
+('Thul',1860,0),
+('Zag\'',1860,0),
+('Zang',1860,0),
+('Zhar\'',1860,0),
+('kath',1860,1),
+('doc',1860,1),
+('dok',1860,1),
+('gak',1860,1),
+('garth',1860,1),
+('gore',1860,1),
+('gorg',1860,1),
+('grave',1860,1),
+('gron',1860,1),
+('juk',1860,1),
+('krast',1860,1),
+('kresh',1860,1),
+('krit',1860,1),
+('los',1860,1),
+('mon',1860,1),
+('mos',1860,1),
+('moth',1860,1),
+('nagma',1860,1),
+('nak',1860,1),
+('nar',1860,1),
+('nos',1860,1),
+('nuz',1860,1),
+('phog',1860,1),
+('rath',1860,1),
+('tast',1860,1),
+('taz',1860,1),
+('thak',1860,1),
+('thang',1860,1),
+('thyk',1860,1),
+('vhug',1860,1),
+('zazt',1860,1),
+('Ael',1863,0),
+('Aez',1863,0),
+('Ang',1863,0),
+('Ban',1863,0),
+('Bet',1863,0),
+('Bro',1863,0),
+('Bry',1863,0),
+('Cat',1863,0),
+('Dir',1863,0),
+('Dis',1863,0),
+('Dom',1863,0),
+('Drus',1863,0),
+('Fie',1863,0),
+('Fier',1863,0),
+('Gly',1863,0),
+('Hel',1863,0),
+('Hes',1863,0),
+('Kal',1863,0),
+('Lyn',1863,0),
+('Mir',1863,0),
+('Nim',1863,0),
+('Sar',1863,0),
+('Sel',1863,0),
+('Vil',1863,0),
+('Zah',1863,0),
+('aith',1863,1),
+('anda',1863,1),
+('antia',1863,1),
+('evere',1863,1),
+('lia',1863,1),
+('lissa',1863,1),
+('neri',1863,1),
+('neth',1863,1),
+('nia',1863,1),
+('nlissa',1863,1),
+('nora',1863,1),
+('nva',1863,1),
+('nys',1863,1),
+('ola',1863,1),
+('ona',1863,1),
+('ora',1863,1),
+('rah',1863,1),
+('riana',1863,1),
+('riel',1863,1),
+('rona',1863,1),
+('tai',1863,1),
+('tevere',1863,1),
+('thea',1863,1),
+('vina',1863,1),
+('wena',1863,1),
+('wyn',1863,1),
+('xia',1863,1),
+('yla',1863,1),
+('yssa',1863,1),
+('Flaa',17252,0),
+('Haa',17252,0),
+('Jhuu',17252,0),
+('Shaa',17252,0),
+('Thoo',17252,0),
+('dhun',17252,1),
+('ghun',17252,1),
+('roon',17252,1),
+('thun',17252,1),
+('tom',17252,1);
+
+/*!40000 ALTER TABLE `pet_name_generation` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `petcreateinfo_spell`
+--
+
+DROP TABLE IF EXISTS `petcreateinfo_spell`;
+CREATE TABLE `petcreateinfo_spell` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `Spell1` mediumint(8) unsigned NOT NULL default '0',
+ `Spell2` mediumint(8) unsigned NOT NULL default '0',
+ `Spell3` mediumint(8) unsigned NOT NULL default '0',
+ `Spell4` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet Create Spells';
+
+--
+-- Dumping data for table `petcreateinfo_spell`
+--
+
+LOCK TABLES `petcreateinfo_spell` WRITE;
+/*!40000 ALTER TABLE `petcreateinfo_spell` DISABLE KEYS */;
+/*!40000 ALTER TABLE `petcreateinfo_spell` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pickpocketing_loot_template`
+--
+
+DROP TABLE IF EXISTS `pickpocketing_loot_template`;
+CREATE TABLE `pickpocketing_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `pickpocketing_loot_template`
+--
+
+LOCK TABLES `pickpocketing_loot_template` WRITE;
+/*!40000 ALTER TABLE `pickpocketing_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pickpocketing_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `player_classlevelstats`
+--
+
+DROP TABLE IF EXISTS `player_classlevelstats`;
+CREATE TABLE `player_classlevelstats` (
+ `class` tinyint(3) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL,
+ `basehp` smallint(5) unsigned NOT NULL,
+ `basemana` smallint(5) unsigned NOT NULL,
+ PRIMARY KEY (`class`,`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.';
+
+--
+-- Dumping data for table `player_classlevelstats`
+--
+
+LOCK TABLES `player_classlevelstats` WRITE;
+/*!40000 ALTER TABLE `player_classlevelstats` DISABLE KEYS */;
+INSERT INTO `player_classlevelstats` VALUES
+(1,1,20,0),
+(1,2,29,0),
+(1,3,38,0),
+(1,4,47,0),
+(1,5,56,0),
+(1,6,65,0),
+(1,7,74,0),
+(1,8,83,0),
+(1,9,92,0),
+(1,10,101,0),
+(1,11,100,0),
+(1,12,109,0),
+(1,13,118,0),
+(1,14,128,0),
+(1,15,139,0),
+(1,16,151,0),
+(1,17,154,0),
+(1,18,168,0),
+(1,19,183,0),
+(1,20,199,0),
+(1,21,206,0),
+(1,22,224,0),
+(1,23,243,0),
+(1,24,253,0),
+(1,25,274,0),
+(1,26,296,0),
+(1,27,309,0),
+(1,28,333,0),
+(1,29,348,0),
+(1,30,374,0),
+(1,31,401,0),
+(1,32,419,0),
+(1,33,448,0),
+(1,34,468,0),
+(1,35,499,0),
+(1,36,521,0),
+(1,37,545,0),
+(1,38,581,0),
+(1,39,609,0),
+(1,40,649,0),
+(1,41,681,0),
+(1,42,715,0),
+(1,43,761,0),
+(1,44,799,0),
+(1,45,839,0),
+(1,46,881,0),
+(1,47,935,0),
+(1,48,981,0),
+(1,49,1029,0),
+(1,50,1079,0),
+(1,51,1131,0),
+(1,52,1185,0),
+(1,53,1241,0),
+(1,54,1299,0),
+(1,55,1359,0),
+(1,56,1421,0),
+(1,57,1485,0),
+(1,58,1551,0),
+(1,59,1619,0),
+(1,60,1689,0),
+(1,61,1902,0),
+(1,62,2129,0),
+(1,63,2357,0),
+(1,64,2612,0),
+(1,65,2883,0),
+(1,66,3169,0),
+(1,67,3455,0),
+(1,68,3774,0),
+(1,69,4109,0),
+(1,70,4444,0),
+(1,71,4720,0),
+(1,72,5013,0),
+(1,73,5325,0),
+(1,74,5656,0),
+(1,75,6008,0),
+(1,76,6381,0),
+(1,77,6778,0),
+(1,78,7198,0),
+(1,79,7646,0),
+(1,80,8121,0),
+(2,1,28,60),
+(2,2,36,78),
+(2,3,44,98),
+(2,4,52,104),
+(2,5,60,111),
+(2,6,68,134),
+(2,7,76,143),
+(2,8,84,153),
+(2,9,92,179),
+(2,10,100,192),
+(2,11,108,205),
+(2,12,116,219),
+(2,13,124,249),
+(2,14,132,265),
+(2,15,131,282),
+(2,16,141,315),
+(2,17,152,334),
+(2,18,164,354),
+(2,19,177,390),
+(2,20,191,412),
+(2,21,206,435),
+(2,22,222,459),
+(2,23,239,499),
+(2,24,247,525),
+(2,25,266,552),
+(2,26,286,579),
+(2,27,307,621),
+(2,28,329,648),
+(2,29,342,675),
+(2,30,366,702),
+(2,31,391,729),
+(2,32,407,756),
+(2,33,434,798),
+(2,34,462,825),
+(2,35,481,852),
+(2,36,511,879),
+(2,37,542,906),
+(2,38,564,933),
+(2,39,597,960),
+(2,40,621,987),
+(2,41,656,1014),
+(2,42,682,1041),
+(2,43,719,1068),
+(2,44,747,1110),
+(2,45,786,1137),
+(2,46,816,1164),
+(2,47,857,1176),
+(2,48,889,1203),
+(2,49,922,1230),
+(2,50,966,1257),
+(2,51,1001,1284),
+(2,52,1037,1311),
+(2,53,1084,1338),
+(2,54,1122,1365),
+(2,55,1161,1392),
+(2,56,1201,1419),
+(2,57,1252,1446),
+(2,58,1294,1458),
+(2,59,1337,1485),
+(2,60,1381,1512),
+(2,61,1540,1656),
+(2,62,1708,1800),
+(2,63,1884,1944),
+(2,64,2068,2088),
+(2,65,2262,2232),
+(2,66,2466,2377),
+(2,67,2679,2521),
+(2,68,2901,2665),
+(2,69,3134,2809),
+(2,70,3377,2953),
+(2,71,3629,3097),
+(2,72,3900,3241),
+(2,73,4191,3385),
+(2,74,4503,3529),
+(2,75,4839,3673),
+(2,76,5200,3817),
+(2,77,5588,3962),
+(2,78,6005,4106),
+(2,79,6453,4250),
+(2,80,6934,4394),
+(3,1,46,65),
+(3,2,53,70),
+(3,3,60,76),
+(3,4,67,98),
+(3,5,74,106),
+(3,6,81,130),
+(3,7,88,140),
+(3,8,95,166),
+(3,9,102,193),
+(3,10,109,206),
+(3,11,116,235),
+(3,12,123,250),
+(3,13,130,266),
+(3,14,138,298),
+(3,15,147,316),
+(3,16,157,350),
+(3,17,168,370),
+(3,18,180,391),
+(3,19,193,428),
+(3,20,207,451),
+(3,21,222,475),
+(3,22,238,515),
+(3,23,255,541),
+(3,24,273,568),
+(3,25,292,611),
+(3,26,312,640),
+(3,27,333,670),
+(3,28,355,715),
+(3,29,378,745),
+(3,30,402,775),
+(3,31,417,805),
+(3,32,443,850),
+(3,33,470,880),
+(3,34,498,910),
+(3,35,527,940),
+(3,36,547,970),
+(3,37,578,1015),
+(3,38,610,1045),
+(3,39,643,1075),
+(3,40,667,1105),
+(3,41,702,1135),
+(3,42,738,1180),
+(3,43,775,1210),
+(3,44,803,1240),
+(3,45,842,1270),
+(3,46,872,1300),
+(3,47,913,1330),
+(3,48,955,1360),
+(3,49,994,1390),
+(3,50,1047,1420),
+(3,51,1067,1450),
+(3,52,1113,1480),
+(3,53,1150,1510),
+(3,54,1198,1540),
+(3,55,1237,1570),
+(3,56,1287,1600),
+(3,57,1328,1630),
+(3,58,1370,1660),
+(3,59,1423,1690),
+(3,60,1467,1720),
+(3,61,1633,1886),
+(3,62,1819,2053),
+(3,63,2003,2219),
+(3,64,2195,2385),
+(3,65,2397,2552),
+(3,66,2623,2718),
+(3,67,2844,2884),
+(3,68,3075,3050),
+(3,69,3316,3217),
+(3,70,3568,3383),
+(3,71,3834,3549),
+(3,72,4120,3716),
+(3,73,4427,3882),
+(3,74,4757,4048),
+(3,75,5112,4215),
+(3,76,5493,4381),
+(3,77,5903,4547),
+(3,78,6343,4713),
+(3,79,6816,4880),
+(3,80,7324,5046),
+(4,1,25,0),
+(4,2,32,0),
+(4,3,49,0),
+(4,4,56,0),
+(4,5,63,0),
+(4,6,70,0),
+(4,7,87,0),
+(4,8,94,0),
+(4,9,101,0),
+(4,10,118,0),
+(4,11,125,0),
+(4,12,142,0),
+(4,13,149,0),
+(4,14,156,0),
+(4,15,173,0),
+(4,16,181,0),
+(4,17,190,0),
+(4,18,200,0),
+(4,19,221,0),
+(4,20,233,0),
+(4,21,246,0),
+(4,22,260,0),
+(4,23,275,0),
+(4,24,301,0),
+(4,25,318,0),
+(4,26,336,0),
+(4,27,355,0),
+(4,28,375,0),
+(4,29,396,0),
+(4,30,428,0),
+(4,31,451,0),
+(4,32,475,0),
+(4,33,500,0),
+(4,34,526,0),
+(4,35,553,0),
+(4,36,581,0),
+(4,37,610,0),
+(4,38,640,0),
+(4,39,671,0),
+(4,40,703,0),
+(4,41,736,0),
+(4,42,770,0),
+(4,43,805,0),
+(4,44,841,0),
+(4,45,878,0),
+(4,46,916,0),
+(4,47,955,0),
+(4,48,995,0),
+(4,49,1026,0),
+(4,50,1068,0),
+(4,51,1111,0),
+(4,52,1155,0),
+(4,53,1200,0),
+(4,54,1246,0),
+(4,55,1283,0),
+(4,56,1331,0),
+(4,57,1380,0),
+(4,58,1430,0),
+(4,59,1471,0),
+(4,60,1523,0),
+(4,61,1702,0),
+(4,62,1879,0),
+(4,63,2077,0),
+(4,64,2285,0),
+(4,65,2489,0),
+(4,66,2717,0),
+(4,67,2941,0),
+(4,68,3190,0),
+(4,69,3450,0),
+(4,70,3704,0),
+(4,71,3980,0),
+(4,72,4277,0),
+(4,73,4596,0),
+(4,74,4939,0),
+(4,75,5307,0),
+(4,76,5703,0),
+(4,77,6128,0),
+(4,78,6585,0),
+(4,79,7076,0),
+(4,80,7604,0),
+(5,1,52,73),
+(5,2,57,76),
+(5,3,72,95),
+(5,4,77,114),
+(5,5,92,133),
+(5,6,97,152),
+(5,7,112,171),
+(5,8,117,190),
+(5,9,132,209),
+(5,10,137,212),
+(5,11,142,215),
+(5,12,157,234),
+(5,13,172,254),
+(5,14,177,260),
+(5,15,192,282),
+(5,16,197,305),
+(5,17,212,329),
+(5,18,227,339),
+(5,19,232,365),
+(5,20,247,377),
+(5,21,252,405),
+(5,22,268,434),
+(5,23,275,449),
+(5,24,293,480),
+(5,25,302,497),
+(5,26,322,530),
+(5,27,343,549),
+(5,28,355,584),
+(5,29,378,605),
+(5,30,392,627),
+(5,31,417,665),
+(5,32,433,689),
+(5,33,460,728),
+(5,34,478,752),
+(5,35,507,776),
+(5,36,527,800),
+(5,37,548,839),
+(5,38,580,863),
+(5,39,603,887),
+(5,40,637,911),
+(5,41,662,950),
+(5,42,698,974),
+(5,43,725,998),
+(5,44,763,1022),
+(5,45,792,1046),
+(5,46,822,1070),
+(5,47,863,1094),
+(5,48,895,1118),
+(5,49,928,1142),
+(5,50,972,1166),
+(5,51,1007,1190),
+(5,52,1053,1214),
+(5,53,1090,1238),
+(5,54,1128,1262),
+(5,55,1177,1271),
+(5,56,1217,1295),
+(5,57,1258,1319),
+(5,58,1300,1343),
+(5,59,1353,1352),
+(5,60,1397,1376),
+(5,61,1557,1500),
+(5,62,1738,1625),
+(5,63,1916,1749),
+(5,64,2101,1873),
+(5,65,2295,1998),
+(5,66,2495,2122),
+(5,67,2719,2247),
+(5,68,2936,2371),
+(5,69,3160,2495),
+(5,70,3391,2620),
+(5,71,3644,2744),
+(5,72,3916,2868),
+(5,73,4208,2993),
+(5,74,4522,3117),
+(5,75,4859,3242),
+(5,76,5221,3366),
+(5,77,5610,3490),
+(5,78,6028,3615),
+(5,79,6477,3739),
+(5,80,6960,3863),
+(6,1,22,0),
+(6,2,27,0),
+(6,3,32,0),
+(6,4,37,0),
+(6,5,42,0),
+(6,6,47,0),
+(6,7,52,0),
+(6,8,58,0),
+(6,9,64,0),
+(6,10,70,0),
+(6,11,77,0),
+(6,12,84,0),
+(6,13,92,0),
+(6,14,100,0),
+(6,15,117,0),
+(6,16,127,0),
+(6,17,138,0),
+(6,18,150,0),
+(6,19,163,0),
+(6,20,177,0),
+(6,21,192,0),
+(6,22,208,0),
+(6,23,225,0),
+(6,24,239,0),
+(6,25,258,0),
+(6,26,278,0),
+(6,27,299,0),
+(6,28,321,0),
+(6,29,344,0),
+(6,30,368,0),
+(6,31,393,0),
+(6,32,419,0),
+(6,33,446,0),
+(6,34,474,0),
+(6,35,503,0),
+(6,36,533,0),
+(6,37,564,0),
+(6,38,596,0),
+(6,39,629,0),
+(6,40,698,0),
+(6,41,698,0),
+(6,42,734,0),
+(6,43,771,0),
+(6,44,809,0),
+(6,45,849,0),
+(6,46,891,0),
+(6,47,935,0),
+(6,48,981,0),
+(6,49,1029,0),
+(6,50,1079,0),
+(6,51,1131,0),
+(6,52,1185,0),
+(6,53,1241,0),
+(6,54,1299,0),
+(6,55,1359,0),
+(6,56,1421,0),
+(6,57,1485,0),
+(6,58,1551,0),
+(6,59,1619,0),
+(6,60,1689,0),
+(6,61,1902,0),
+(6,62,2129,0),
+(6,63,2357,0),
+(6,64,2612,0),
+(6,65,2883,0),
+(6,66,3169,0),
+(6,67,3455,0),
+(6,68,3774,0),
+(6,69,4109,0),
+(6,70,4444,0),
+(6,71,4720,0),
+(6,72,5013,0),
+(6,73,5325,0),
+(6,74,5656,0),
+(6,75,6008,0),
+(6,76,6381,0),
+(6,77,6778,0),
+(6,78,7199,0),
+(6,79,7646,0),
+(6,80,8121,0),
+(7,1,37,85),
+(7,2,44,91),
+(7,3,51,98),
+(7,4,58,106),
+(7,5,65,115),
+(7,6,72,125),
+(7,7,79,136),
+(7,8,86,148),
+(7,9,93,161),
+(7,10,100,175),
+(7,11,107,190),
+(7,12,114,206),
+(7,13,121,223),
+(7,14,128,241),
+(7,15,135,260),
+(7,16,142,280),
+(7,17,150,301),
+(7,18,159,323),
+(7,19,169,346),
+(7,20,180,370),
+(7,21,192,395),
+(7,22,205,421),
+(7,23,219,448),
+(7,24,234,476),
+(7,25,240,505),
+(7,26,257,535),
+(7,27,275,566),
+(7,28,294,598),
+(7,29,314,631),
+(7,30,335,665),
+(7,31,347,699),
+(7,32,370,733),
+(7,33,394,767),
+(7,34,419,786),
+(7,35,435,820),
+(7,36,462,854),
+(7,37,490,888),
+(7,38,509,922),
+(7,39,539,941),
+(7,40,570,975),
+(7,41,592,1009),
+(7,42,625,1028),
+(7,43,649,1062),
+(7,44,684,1096),
+(7,45,710,1115),
+(7,46,747,1149),
+(7,47,775,1183),
+(7,48,814,1202),
+(7,49,844,1236),
+(7,50,885,1255),
+(7,51,917,1289),
+(7,52,960,1323),
+(7,53,994,1342),
+(7,54,1029,1376),
+(7,55,1075,1395),
+(7,56,1112,1414),
+(7,57,1150,1448),
+(7,58,1199,1467),
+(7,59,1239,1501),
+(7,60,1330,1520),
+(7,61,1428,1664),
+(7,62,1583,1808),
+(7,63,1760,1951),
+(7,64,1932,2095),
+(7,65,2114,2239),
+(7,66,2304,2383),
+(7,67,2504,2527),
+(7,68,2713,2670),
+(7,69,2931,2814),
+(7,70,3159,2958),
+(7,71,3395,3102),
+(7,72,3648,3246),
+(7,73,3920,3389),
+(7,74,4212,3533),
+(7,75,4526,3677),
+(7,76,4863,3821),
+(7,77,5226,3965),
+(7,78,5616,4108),
+(7,79,6035,4252),
+(7,80,6485,4396),
+(8,1,32,100),
+(8,2,47,110),
+(8,3,52,106),
+(8,4,67,118),
+(8,5,82,131),
+(8,6,97,130),
+(8,7,102,145),
+(8,8,117,146),
+(8,9,132,163),
+(8,10,137,196),
+(8,11,152,215),
+(8,12,167,220),
+(8,13,172,241),
+(8,14,187,263),
+(8,15,202,271),
+(8,16,207,295),
+(8,17,222,305),
+(8,18,237,331),
+(8,19,242,343),
+(8,20,257,371),
+(8,21,272,385),
+(8,22,277,415),
+(8,23,292,431),
+(8,24,298,463),
+(8,25,315,481),
+(8,26,333,515),
+(8,27,342,535),
+(8,28,362,556),
+(8,29,373,592),
+(8,30,395,613),
+(8,31,418,634),
+(8,32,432,670),
+(8,33,457,691),
+(8,34,473,712),
+(8,35,500,733),
+(8,36,518,754),
+(8,37,547,790),
+(8,38,577,811),
+(8,39,598,832),
+(8,40,630,853),
+(8,41,653,874),
+(8,42,687,895),
+(8,43,712,916),
+(8,44,748,937),
+(8,45,775,958),
+(8,46,813,979),
+(8,47,842,1000),
+(8,48,882,1021),
+(8,49,913,1042),
+(8,50,955,1048),
+(8,51,988,1069),
+(8,52,1032,1090),
+(8,53,1067,1111),
+(8,54,1103,1117),
+(8,55,1150,1138),
+(8,56,1188,1159),
+(8,57,1237,1165),
+(8,58,1277,1186),
+(8,59,1328,1192),
+(8,60,1370,1213),
+(8,61,1526,1316),
+(8,62,1702,1419),
+(8,63,1875,1521),
+(8,64,2070,1624),
+(8,65,2261,1727),
+(8,66,2461,1830),
+(8,67,2686,1932),
+(8,68,2906,2035),
+(8,69,3136,2138),
+(8,70,3393,2241),
+(8,71,3646,2343),
+(8,72,3918,2446),
+(8,73,4210,2549),
+(8,74,4524,2652),
+(8,75,4861,2754),
+(8,76,5223,2857),
+(8,77,5612,2960),
+(8,78,6030,3063),
+(8,79,6480,3165),
+(8,80,6963,3268),
+(9,1,23,90),
+(9,2,28,98),
+(9,3,43,107),
+(9,4,48,102),
+(9,5,63,113),
+(9,6,68,126),
+(9,7,83,144),
+(9,8,88,162),
+(9,9,93,180),
+(9,10,108,198),
+(9,11,123,200),
+(9,12,128,218),
+(9,13,143,237),
+(9,14,148,257),
+(9,15,153,278),
+(9,16,168,300),
+(9,17,173,308),
+(9,18,189,332),
+(9,19,196,357),
+(9,20,204,383),
+(9,21,223,395),
+(9,22,233,423),
+(9,23,244,452),
+(9,24,266,467),
+(9,25,279,498),
+(9,26,293,530),
+(9,27,318,548),
+(9,28,334,582),
+(9,29,351,602),
+(9,30,379,638),
+(9,31,398,674),
+(9,32,418,695),
+(9,33,439,731),
+(9,34,471,752),
+(9,35,494,788),
+(9,36,518,809),
+(9,37,543,830),
+(9,38,569,866),
+(9,39,606,887),
+(9,40,634,923),
+(9,41,663,944),
+(9,42,693,965),
+(9,43,724,1001),
+(9,44,756,1022),
+(9,45,799,1043),
+(9,46,832,1064),
+(9,47,868,1100),
+(9,48,904,1121),
+(9,49,941,1142),
+(9,50,979,1163),
+(9,51,1018,1184),
+(9,52,1058,1205),
+(9,53,1099,1226),
+(9,54,1141,1247),
+(9,55,1184,1268),
+(9,56,1228,1289),
+(9,57,1273,1310),
+(9,58,1319,1331),
+(9,59,1366,1352),
+(9,60,1414,1373),
+(9,61,1580,1497),
+(9,62,1755,1621),
+(9,63,1939,1745),
+(9,64,2133,1870),
+(9,65,2323,1994),
+(9,66,2535,2118),
+(9,67,2758,2242),
+(9,68,2991,2366),
+(9,69,3235,2490),
+(9,70,3490,2615),
+(9,71,3750,2739),
+(9,72,4025,2863),
+(9,73,4330,2987),
+(9,74,4646,3111),
+(9,75,4997,3235),
+(9,76,5373,3360),
+(9,77,5774,3483),
+(9,78,6207,3608),
+(9,79,6667,3732),
+(9,80,7136,3856),
+(11,1,44,60),
+(11,2,51,66),
+(11,3,58,73),
+(11,4,75,81),
+(11,5,82,90),
+(11,6,89,100),
+(11,7,106,111),
+(11,8,113,123),
+(11,9,120,136),
+(11,10,137,150),
+(11,11,144,165),
+(11,12,151,182),
+(11,13,168,200),
+(11,14,175,219),
+(11,15,182,239),
+(11,16,199,260),
+(11,17,206,282),
+(11,18,214,305),
+(11,19,233,329),
+(11,20,243,354),
+(11,21,254,380),
+(11,22,266,392),
+(11,23,289,420),
+(11,24,303,449),
+(11,25,318,479),
+(11,26,334,509),
+(11,27,361,524),
+(11,28,379,554),
+(11,29,398,584),
+(11,30,418,614),
+(11,31,439,629),
+(11,32,461,659),
+(11,33,494,689),
+(11,34,518,704),
+(11,35,543,734),
+(11,36,569,749),
+(11,37,596,779),
+(11,38,624,809),
+(11,39,653,824),
+(11,40,683,854),
+(11,41,714,869),
+(11,42,746,899),
+(11,43,779,914),
+(11,44,823,944),
+(11,45,858,959),
+(11,46,894,989),
+(11,47,921,1004),
+(11,48,959,1019),
+(11,49,998,1049),
+(11,50,1038,1064),
+(11,51,1079,1079),
+(11,52,1121,1109),
+(11,53,1164,1124),
+(11,54,1208,1139),
+(11,55,1253,1154),
+(11,56,1299,1169),
+(11,57,1346,1199),
+(11,58,1384,1214),
+(11,59,1433,1229),
+(11,60,1483,1244),
+(11,61,1657,1357),
+(11,62,1840,1469),
+(11,63,2020,1582),
+(11,64,2222,1694),
+(11,65,2433,1807),
+(11,66,2640,1919),
+(11,67,2872,2032),
+(11,68,3114,2145),
+(11,69,3351,2257),
+(11,70,3614,2370),
+(11,71,3883,2482),
+(11,72,4172,2595),
+(11,73,4483,2708),
+(11,74,4817,2820),
+(11,75,5176,2933),
+(11,76,5562,3045),
+(11,77,5977,3158),
+(11,78,6423,3270),
+(11,79,6902,3383),
+(11,80,7417,3496);
+/*!40000 ALTER TABLE `player_classlevelstats` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `player_levelstats`
+--
+
+DROP TABLE IF EXISTS `player_levelstats`;
+CREATE TABLE `player_levelstats` (
+ `race` tinyint(3) unsigned NOT NULL,
+ `class` tinyint(3) unsigned NOT NULL,
+ `level` tinyint(3) unsigned NOT NULL,
+ `str` tinyint(3) unsigned NOT NULL,
+ `agi` tinyint(3) unsigned NOT NULL,
+ `sta` tinyint(3) unsigned NOT NULL,
+ `inte` tinyint(3) unsigned NOT NULL,
+ `spi` tinyint(3) unsigned NOT NULL,
+ PRIMARY KEY (`race`,`class`,`level`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.';
+
+--
+-- Dumping data for table `player_levelstats`
+--
+
+LOCK TABLES `player_levelstats` WRITE;
+/*!40000 ALTER TABLE `player_levelstats` DISABLE KEYS */;
+INSERT INTO `player_levelstats` VALUES
+(1,1,1,23,20,22,20,20),
+(1,1,2,24,21,23,20,20),
+(1,1,3,26,22,24,20,21),
+(1,1,4,27,22,26,20,21),
+(1,1,5,28,23,27,20,21),
+(1,1,6,30,24,28,20,21),
+(1,1,7,31,25,29,21,22),
+(1,1,8,32,26,30,21,22),
+(1,1,9,34,26,32,21,22),
+(1,1,10,35,27,33,21,23),
+(1,1,11,36,28,34,21,23),
+(1,1,12,38,29,35,21,23),
+(1,1,13,39,30,37,21,24),
+(1,1,14,41,31,38,21,24),
+(1,1,15,42,32,39,21,24),
+(1,1,16,44,33,41,21,25),
+(1,1,17,45,34,42,22,25),
+(1,1,18,47,34,43,22,25),
+(1,1,19,48,35,45,22,26),
+(1,1,20,50,36,46,22,26),
+(1,1,21,51,37,48,22,26),
+(1,1,22,53,38,49,22,27),
+(1,1,23,54,39,51,22,27),
+(1,1,24,56,40,52,23,28),
+(1,1,25,58,41,53,23,28),
+(1,1,26,59,42,55,23,28),
+(1,1,27,61,43,56,23,29),
+(1,1,28,63,44,58,23,29),
+(1,1,29,64,45,59,23,30),
+(1,1,30,66,46,61,24,30),
+(1,1,31,68,47,62,24,30),
+(1,1,32,69,48,64,24,31),
+(1,1,33,71,50,66,24,31),
+(1,1,34,73,51,67,24,32),
+(1,1,35,74,52,69,24,32),
+(1,1,36,76,53,70,25,33),
+(1,1,37,78,54,72,25,33),
+(1,1,38,80,55,74,25,34),
+(1,1,39,82,56,75,25,34),
+(1,1,40,83,57,77,25,35),
+(1,1,41,85,58,79,26,35),
+(1,1,42,87,60,80,26,35),
+(1,1,43,89,61,82,26,36),
+(1,1,44,91,62,84,26,36),
+(1,1,45,93,63,85,26,37),
+(1,1,46,95,64,87,27,37),
+(1,1,47,97,66,89,27,38),
+(1,1,48,99,67,91,27,38),
+(1,1,49,101,68,93,27,39),
+(1,1,50,103,69,94,28,40),
+(1,1,51,105,71,96,28,40),
+(1,1,52,107,72,98,28,41),
+(1,1,53,109,73,100,28,41),
+(1,1,54,111,74,102,29,42),
+(1,1,55,113,76,103,29,42),
+(1,1,56,115,77,105,29,43),
+(1,1,57,117,78,107,29,43),
+(1,1,58,119,79,109,30,44),
+(1,1,59,121,81,111,30,44),
+(1,1,60,123,82,113,30,45),
+(1,1,61,125,83,115,30,46),
+(1,1,62,127,85,117,31,46),
+(1,1,63,129,86,119,31,47),
+(1,1,64,132,88,121,31,47),
+(1,1,65,134,89,123,32,48),
+(1,1,66,136,90,125,32,49),
+(1,1,67,138,92,127,32,49),
+(1,1,68,140,93,129,32,50),
+(1,1,69,143,95,131,33,50),
+(1,1,70,145,96,133,33,51),
+(1,1,71,148,97,140,33,53),
+(1,1,72,156,99,143,33,54),
+(1,1,73,162,101,148,33,55),
+(1,1,74,162,102,148,34,55),
+(1,1,75,165,104,150,34,56),
+(1,1,76,171,106,156,34,57),
+(1,1,77,171,108,157,35,58),
+(1,1,78,174,109,159,35,58),
+(1,1,79,181,111,165,35,59),
+(1,1,80,184,113,168,36,60),
+(1,2,1,22,20,22,20,21),
+(1,2,2,23,21,23,21,22),
+(1,2,3,24,21,24,21,22),
+(1,2,4,25,22,25,22,23),
+(1,2,5,26,22,26,23,24),
+(1,2,6,28,23,27,23,25),
+(1,2,7,29,24,28,24,25),
+(1,2,8,30,24,29,25,26),
+(1,2,9,31,25,30,25,27),
+(1,2,10,32,25,32,26,27),
+(1,2,11,33,26,33,27,28),
+(1,2,12,35,27,34,27,29),
+(1,2,13,36,27,35,28,30),
+(1,2,14,37,28,36,29,31),
+(1,2,15,38,29,37,30,31),
+(1,2,16,40,29,38,30,32),
+(1,2,17,41,30,40,31,33),
+(1,2,18,42,31,41,32,34),
+(1,2,19,43,31,42,33,35),
+(1,2,20,45,32,43,33,35),
+(1,2,21,46,33,45,34,36),
+(1,2,22,47,33,46,35,37),
+(1,2,23,49,34,47,36,38),
+(1,2,24,50,35,48,37,39),
+(1,2,25,51,36,50,37,40),
+(1,2,26,53,36,51,38,41),
+(1,2,27,54,37,52,39,42),
+(1,2,28,56,38,54,40,43),
+(1,2,29,57,39,55,41,43),
+(1,2,30,58,39,56,42,44),
+(1,2,31,60,40,58,43,45),
+(1,2,32,61,41,59,43,46),
+(1,2,33,63,42,60,44,47),
+(1,2,34,64,43,62,45,48),
+(1,2,35,66,44,63,46,49),
+(1,2,36,67,44,65,47,50),
+(1,2,37,69,45,66,48,51),
+(1,2,38,70,46,67,49,52),
+(1,2,39,72,47,69,50,53),
+(1,2,40,73,48,70,51,54),
+(1,2,41,75,49,72,52,55),
+(1,2,42,77,49,73,53,56),
+(1,2,43,78,50,75,54,57),
+(1,2,44,80,51,76,55,58),
+(1,2,45,81,52,78,56,59),
+(1,2,46,83,53,79,57,61),
+(1,2,47,85,54,81,58,62),
+(1,2,48,86,55,83,59,63),
+(1,2,49,88,56,84,60,64),
+(1,2,50,90,57,86,61,65),
+(1,2,51,91,58,87,62,66),
+(1,2,52,93,59,89,63,67),
+(1,2,53,95,60,91,64,68),
+(1,2,54,97,61,92,65,69),
+(1,2,55,98,61,94,66,71),
+(1,2,56,100,62,95,67,72),
+(1,2,57,102,63,97,68,73),
+(1,2,58,104,64,99,69,74),
+(1,2,59,105,65,101,70,75),
+(1,2,60,107,66,102,71,77),
+(1,2,61,109,67,104,73,78),
+(1,2,62,111,69,106,74,79),
+(1,2,63,113,70,107,75,80),
+(1,2,64,115,71,109,76,81),
+(1,2,65,116,72,111,77,83),
+(1,2,66,118,73,113,78,84),
+(1,2,67,120,74,115,79,85),
+(1,2,68,122,75,116,81,86),
+(1,2,69,124,76,118,82,88),
+(1,2,70,126,77,120,83,89),
+(1,2,71,148,78,122,84,92),
+(1,2,72,150,79,125,86,94),
+(1,2,73,152,80,127,87,96),
+(1,2,74,156,82,129,89,97),
+(1,2,75,158,83,131,90,99),
+(1,2,76,162,84,134,92,100),
+(1,2,77,164,86,136,93,103),
+(1,2,78,167,87,138,95,105),
+(1,2,79,170,88,153,96,106),
+(1,2,80,173,90,160,98,108),
+(1,4,1,21,23,21,20,20),
+(1,4,2,22,24,22,20,20),
+(1,4,3,23,26,22,20,21),
+(1,4,4,23,27,23,20,21),
+(1,4,5,24,29,24,21,21),
+(1,4,6,25,30,25,21,22),
+(1,4,7,26,32,25,21,22),
+(1,4,8,26,33,26,21,23),
+(1,4,9,27,35,27,21,23),
+(1,4,10,28,36,27,21,23),
+(1,4,11,29,38,28,22,24),
+(1,4,12,30,39,29,22,24),
+(1,4,13,31,41,30,22,25),
+(1,4,14,31,43,31,22,25),
+(1,4,15,32,44,31,22,25),
+(1,4,16,33,46,32,23,26),
+(1,4,17,34,48,33,23,26),
+(1,4,18,35,49,34,23,27),
+(1,4,19,36,51,35,23,27),
+(1,4,20,37,53,35,23,28),
+(1,4,21,38,54,36,24,28),
+(1,4,22,39,56,37,24,29),
+(1,4,23,40,58,38,24,29),
+(1,4,24,41,60,39,24,30),
+(1,4,25,42,61,40,25,30),
+(1,4,26,43,63,41,25,31),
+(1,4,27,44,65,42,25,31),
+(1,4,28,45,67,43,25,32),
+(1,4,29,46,69,43,25,32),
+(1,4,30,47,71,44,26,33),
+(1,4,31,48,72,45,26,33),
+(1,4,32,49,74,46,26,34),
+(1,4,33,50,76,47,27,34),
+(1,4,34,51,78,48,27,35),
+(1,4,35,52,80,49,27,35),
+(1,4,36,53,82,50,27,36),
+(1,4,37,54,84,51,28,36),
+(1,4,38,55,86,52,28,37),
+(1,4,39,56,88,53,28,38),
+(1,4,40,57,90,54,28,38),
+(1,4,41,58,92,55,29,39),
+(1,4,42,60,94,56,29,39),
+(1,4,43,61,96,57,29,40),
+(1,4,44,62,98,58,30,40),
+(1,4,45,63,100,59,30,41),
+(1,4,46,64,103,61,30,42),
+(1,4,47,65,105,62,31,42),
+(1,4,48,66,107,63,31,43),
+(1,4,49,68,109,64,31,44),
+(1,4,50,69,111,65,32,44),
+(1,4,51,70,113,66,32,45),
+(1,4,52,71,116,67,32,45),
+(1,4,53,73,118,68,33,46),
+(1,4,54,74,120,69,33,47),
+(1,4,55,75,122,71,33,47),
+(1,4,56,76,125,72,34,48),
+(1,4,57,78,127,73,34,49),
+(1,4,58,79,129,74,34,49),
+(1,4,59,80,131,75,35,50),
+(1,4,60,81,134,77,35,51),
+(1,4,61,83,136,78,35,51),
+(1,4,62,84,138,79,36,52),
+(1,4,63,85,141,80,36,53),
+(1,4,64,87,143,81,37,54),
+(1,4,65,88,146,83,37,54),
+(1,4,66,89,148,84,37,55),
+(1,4,67,91,151,85,38,56),
+(1,4,68,92,153,86,38,57),
+(1,4,69,94,156,88,39,57),
+(1,4,70,95,158,89,39,58),
+(1,4,71,97,161,90,39,60),
+(1,4,72,99,164,92,40,60),
+(1,4,73,100,167,94,40,61),
+(1,4,74,102,170,95,41,62),
+(1,4,75,104,173,97,41,63),
+(1,4,76,105,176,98,41,64),
+(1,4,77,107,179,100,42,65),
+(1,4,78,109,183,106,42,66),
+(1,4,79,111,186,107,43,67),
+(1,4,80,113,189,109,43,69),
+(1,5,1,20,20,20,22,23),
+(1,5,2,20,20,20,23,24),
+(1,5,3,20,20,21,25,26),
+(1,5,4,20,21,21,26,27),
+(1,5,5,21,21,21,27,28),
+(1,5,6,21,21,22,29,30),
+(1,5,7,21,21,22,30,31),
+(1,5,8,21,22,23,31,33),
+(1,5,9,21,22,23,33,34),
+(1,5,10,21,22,23,34,36),
+(1,5,11,22,22,24,36,37),
+(1,5,12,22,23,24,37,39),
+(1,5,13,22,23,25,38,40),
+(1,5,14,22,23,25,40,42),
+(1,5,15,22,23,25,41,43),
+(1,5,16,23,24,26,43,45),
+(1,5,17,23,24,26,44,46),
+(1,5,18,23,24,27,46,48),
+(1,5,19,23,24,27,47,49),
+(1,5,20,23,25,28,49,51),
+(1,5,21,24,25,28,51,53),
+(1,5,22,24,25,29,52,54),
+(1,5,23,24,26,29,54,56),
+(1,5,24,24,26,30,55,58),
+(1,5,25,25,26,30,57,59),
+(1,5,26,25,27,31,59,61),
+(1,5,27,25,27,31,60,63),
+(1,5,28,25,27,32,62,65),
+(1,5,29,25,28,32,64,66),
+(1,5,30,26,28,33,65,68),
+(1,5,31,26,28,33,67,70),
+(1,5,32,26,29,34,69,72),
+(1,5,33,27,29,34,70,73),
+(1,5,34,27,29,35,72,75),
+(1,5,35,27,30,35,74,77),
+(1,5,36,27,30,36,76,79),
+(1,5,37,28,30,36,78,81),
+(1,5,38,28,31,37,79,83),
+(1,5,39,28,31,38,81,85),
+(1,5,40,28,31,38,83,87),
+(1,5,41,29,32,39,85,88),
+(1,5,42,29,32,39,87,90),
+(1,5,43,29,33,40,89,92),
+(1,5,44,30,33,40,91,94),
+(1,5,45,30,33,41,92,96),
+(1,5,46,30,34,42,94,98),
+(1,5,47,31,34,42,96,100),
+(1,5,48,31,35,43,98,102),
+(1,5,49,31,35,44,100,104),
+(1,5,50,32,36,44,102,106),
+(1,5,51,32,36,45,104,109),
+(1,5,52,32,36,45,106,111),
+(1,5,53,33,37,46,108,113),
+(1,5,54,33,37,47,110,115),
+(1,5,55,33,38,47,112,117),
+(1,5,56,34,38,48,114,119),
+(1,5,57,34,39,49,117,121),
+(1,5,58,34,39,49,119,124),
+(1,5,59,35,40,50,121,126),
+(1,5,60,35,40,51,123,128),
+(1,5,61,35,41,51,125,130),
+(1,5,62,36,41,52,127,132),
+(1,5,63,36,41,53,129,135),
+(1,5,64,37,42,54,132,137),
+(1,5,65,37,42,54,134,139),
+(1,5,66,37,43,55,136,142),
+(1,5,67,38,43,56,138,144),
+(1,5,68,38,44,57,140,146),
+(1,5,69,39,44,57,143,149),
+(1,5,70,39,45,58,145,151),
+(1,5,71,39,46,59,148,158),
+(1,5,72,40,46,59,151,161),
+(1,5,73,40,47,60,154,164),
+(1,5,74,41,47,61,156,167),
+(1,5,75,41,48,62,159,170),
+(1,5,76,41,49,63,162,174),
+(1,5,77,42,49,64,165,177),
+(1,5,78,42,50,65,168,180),
+(1,5,79,43,50,66,171,183),
+(1,5,80,43,51,67,174,186),
+(1,6,1,23,20,22,20,20),
+(1,6,2,24,21,23,20,20),
+(1,6,3,26,22,24,20,21),
+(1,6,4,27,22,26,20,21),
+(1,6,5,28,23,27,20,21),
+(1,6,6,30,24,28,20,21),
+(1,6,7,31,25,29,21,22),
+(1,6,8,32,26,30,21,22),
+(1,6,9,34,26,32,21,22),
+(1,6,10,35,27,33,21,23),
+(1,6,11,36,28,34,21,23),
+(1,6,12,38,29,35,21,23),
+(1,6,13,39,30,37,21,24),
+(1,6,14,41,31,38,21,24),
+(1,6,15,42,32,39,21,24),
+(1,6,16,44,33,41,21,25),
+(1,6,17,45,34,42,22,25),
+(1,6,18,47,34,43,22,25),
+(1,6,19,48,35,45,22,26),
+(1,6,20,50,36,46,22,26),
+(1,6,21,51,37,48,22,26),
+(1,6,22,53,38,49,22,27),
+(1,6,23,54,39,51,22,27),
+(1,6,24,56,40,52,23,28),
+(1,6,25,58,41,53,23,28),
+(1,6,26,59,42,55,23,28),
+(1,6,27,61,43,56,23,29),
+(1,6,28,63,44,58,23,29),
+(1,6,29,64,45,59,23,30),
+(1,6,30,66,46,61,24,30),
+(1,6,31,68,47,62,24,30),
+(1,6,32,69,48,64,24,31),
+(1,6,33,71,50,66,24,31),
+(1,6,34,73,51,67,24,32),
+(1,6,35,74,52,69,24,32),
+(1,6,36,76,53,70,25,33),
+(1,6,37,78,54,72,25,33),
+(1,6,38,80,55,74,25,34),
+(1,6,39,82,56,75,25,34),
+(1,6,40,83,57,77,25,35),
+(1,6,41,85,58,79,26,35),
+(1,6,42,87,60,80,26,35),
+(1,6,43,89,61,82,26,36),
+(1,6,44,91,62,84,26,36),
+(1,6,45,93,63,85,26,37),
+(1,6,46,95,64,87,27,37),
+(1,6,47,97,66,89,27,38),
+(1,6,48,99,67,91,27,38),
+(1,6,49,101,68,93,27,39),
+(1,6,50,103,69,94,28,40),
+(1,6,51,105,71,96,28,40),
+(1,6,52,106,72,97,28,41),
+(1,6,53,107,72,98,28,41),
+(1,6,54,107,73,98,29,42),
+(1,6,55,108,73,99,29,43),
+(1,6,56,111,75,102,29,44),
+(1,6,57,113,76,104,29,44),
+(1,6,58,118,77,106,30,45),
+(1,6,59,118,79,108,30,45),
+(1,6,60,123,80,110,30,46),
+(1,6,61,125,81,112,30,47),
+(1,6,62,128,83,114,30,47),
+(1,6,63,130,84,117,31,48),
+(1,6,64,130,86,119,31,48),
+(1,6,65,140,87,128,31,49),
+(1,6,66,143,89,131,31,50),
+(1,6,67,146,90,133,32,50),
+(1,6,68,148,92,135,32,51),
+(1,6,69,151,93,138,32,52),
+(1,6,70,154,95,140,32,52),
+(1,6,71,162,97,144,33,53),
+(1,6,72,164,98,146,33,54),
+(1,6,73,165,100,148,33,55),
+(1,6,74,166,102,151,33,55),
+(1,6,75,169,103,154,34,56),
+(1,6,76,172,105,157,34,57),
+(1,6,77,175,107,157,34,58),
+(1,6,78,176,108,157,34,58),
+(1,6,79,177,110,157,35,59),
+(1,6,80,180,112,160,35,60),
+(1,8,1,20,20,20,23,22),
+(1,8,2,20,20,20,24,23),
+(1,8,3,20,20,21,26,25),
+(1,8,4,20,20,21,27,26),
+(1,8,5,20,21,21,28,27),
+(1,8,6,20,21,21,30,29),
+(1,8,7,21,21,22,31,30),
+(1,8,8,21,21,22,33,31),
+(1,8,9,21,21,22,34,33),
+(1,8,10,21,21,23,36,34),
+(1,8,11,21,22,23,37,36),
+(1,8,12,21,22,23,39,37),
+(1,8,13,21,22,24,40,38),
+(1,8,14,21,22,24,42,40),
+(1,8,15,21,22,24,43,41),
+(1,8,16,21,23,25,45,43),
+(1,8,17,22,23,25,46,44),
+(1,8,18,22,23,25,48,46),
+(1,8,19,22,23,26,49,47),
+(1,8,20,22,23,26,51,49),
+(1,8,21,22,24,26,53,51),
+(1,8,22,22,24,27,54,52),
+(1,8,23,22,24,27,56,54),
+(1,8,24,23,24,28,58,55),
+(1,8,25,23,25,28,59,57),
+(1,8,26,23,25,28,61,59),
+(1,8,27,23,25,29,63,60),
+(1,8,28,23,25,29,65,62),
+(1,8,29,23,25,30,66,64),
+(1,8,30,24,26,30,68,65),
+(1,8,31,24,26,30,70,67),
+(1,8,32,24,26,31,72,69),
+(1,8,33,24,27,31,73,70),
+(1,8,34,24,27,32,75,72),
+(1,8,35,24,27,32,77,74),
+(1,8,36,25,27,33,79,76),
+(1,8,37,25,28,33,81,78),
+(1,8,38,25,28,34,83,79),
+(1,8,39,25,28,34,85,81),
+(1,8,40,25,28,35,87,83),
+(1,8,41,26,29,35,88,85),
+(1,8,42,26,29,35,90,87),
+(1,8,43,26,29,36,92,89),
+(1,8,44,26,30,36,94,91),
+(1,8,45,26,30,37,96,92),
+(1,8,46,27,30,37,98,94),
+(1,8,47,27,31,38,100,96),
+(1,8,48,27,31,38,102,98),
+(1,8,49,27,31,39,104,100),
+(1,8,50,28,32,40,106,102),
+(1,8,51,28,32,40,109,104),
+(1,8,52,28,32,41,111,106),
+(1,8,53,28,33,41,113,108),
+(1,8,54,29,33,42,115,110),
+(1,8,55,29,33,42,117,112),
+(1,8,56,29,34,43,119,114),
+(1,8,57,29,34,43,121,117),
+(1,8,58,30,34,44,124,119),
+(1,8,59,30,35,44,126,121),
+(1,8,60,30,35,45,128,123),
+(1,8,61,30,35,46,130,125),
+(1,8,62,31,36,46,132,127),
+(1,8,63,31,36,47,135,129),
+(1,8,64,31,37,47,137,132),
+(1,8,65,32,37,48,139,134),
+(1,8,66,32,37,49,142,136),
+(1,8,67,32,38,49,144,138),
+(1,8,68,32,38,50,146,140),
+(1,8,69,33,39,50,149,143),
+(1,8,70,33,39,51,151,145),
+(1,8,71,33,39,52,154,152),
+(1,8,72,33,40,53,160,155),
+(1,8,73,33,40,54,160,158),
+(1,8,74,34,41,54,163,160),
+(1,8,75,34,41,55,166,163),
+(1,8,76,34,41,56,169,166),
+(1,8,77,35,42,57,172,169),
+(1,8,78,35,42,57,175,173),
+(1,8,79,35,43,58,178,176),
+(1,8,80,36,43,59,181,179),
+(1,9,1,20,20,21,22,22),
+(1,9,2,20,20,22,23,23),
+(1,9,3,21,21,22,24,24),
+(1,9,4,21,21,23,26,25),
+(1,9,5,21,21,23,27,27),
+(1,9,6,21,22,24,28,28),
+(1,9,7,22,22,24,29,29),
+(1,9,8,22,23,25,30,30),
+(1,9,9,22,23,26,32,31),
+(1,9,10,23,23,26,33,33),
+(1,9,11,23,24,27,34,34),
+(1,9,12,23,24,27,35,35),
+(1,9,13,24,25,28,37,36),
+(1,9,14,24,25,29,38,38),
+(1,9,15,24,25,29,39,39),
+(1,9,16,25,26,30,41,40),
+(1,9,17,25,26,31,42,42),
+(1,9,18,25,27,31,43,43),
+(1,9,19,26,27,32,45,44),
+(1,9,20,26,28,33,46,46),
+(1,9,21,26,28,33,48,47),
+(1,9,22,27,29,34,49,49),
+(1,9,23,27,29,35,51,50),
+(1,9,24,28,30,35,52,51),
+(1,9,25,28,30,36,53,53),
+(1,9,26,28,31,37,55,54),
+(1,9,27,29,31,37,56,56),
+(1,9,28,29,32,38,58,57),
+(1,9,29,30,32,39,59,59),
+(1,9,30,30,33,40,61,60),
+(1,9,31,30,33,40,62,62),
+(1,9,32,31,34,41,64,63),
+(1,9,33,31,34,42,66,65),
+(1,9,34,32,35,43,67,66),
+(1,9,35,32,35,44,69,68),
+(1,9,36,33,36,44,70,69),
+(1,9,37,33,36,45,72,71),
+(1,9,38,34,37,46,74,73),
+(1,9,39,34,38,47,75,74),
+(1,9,40,35,38,48,77,76),
+(1,9,41,35,39,48,79,78),
+(1,9,42,35,39,49,80,79),
+(1,9,43,36,40,50,82,81),
+(1,9,44,36,40,51,84,83),
+(1,9,45,37,41,52,85,84),
+(1,9,46,37,42,53,87,86),
+(1,9,47,38,42,54,89,88),
+(1,9,48,38,43,55,91,89),
+(1,9,49,39,44,55,93,91),
+(1,9,50,40,44,56,94,93),
+(1,9,51,40,45,57,96,95),
+(1,9,52,41,45,58,98,97),
+(1,9,53,41,46,59,100,98),
+(1,9,54,42,47,60,102,100),
+(1,9,55,42,47,61,103,102),
+(1,9,56,43,48,62,105,104),
+(1,9,57,43,49,63,107,106),
+(1,9,58,44,49,64,109,108),
+(1,9,59,44,50,65,111,109),
+(1,9,60,45,51,66,113,111),
+(1,9,61,46,51,67,115,113),
+(1,9,62,46,52,68,117,115),
+(1,9,63,47,53,69,119,117),
+(1,9,64,47,54,70,121,119),
+(1,9,65,48,54,71,123,121),
+(1,9,66,49,55,72,125,123),
+(1,9,67,49,56,73,127,125),
+(1,9,68,50,57,74,129,127),
+(1,9,69,50,57,75,131,129),
+(1,9,70,51,58,76,133,131),
+(1,9,71,52,59,78,135,146),
+(1,9,72,53,59,79,138,148),
+(1,9,73,54,60,80,140,151),
+(1,9,74,54,61,89,143,154),
+(1,9,75,55,62,91,145,156),
+(1,9,76,56,63,92,148,159),
+(1,9,77,57,64,93,151,162),
+(1,9,78,57,65,95,153,165),
+(1,9,79,58,66,96,156,168),
+(1,9,80,59,67,97,159,170),
+(2,1,1,26,17,24,17,23),
+(2,1,2,27,18,25,17,23),
+(2,1,3,29,19,26,17,24),
+(2,1,4,30,19,27,17,24),
+(2,1,5,31,20,29,17,24),
+(2,1,6,32,21,30,17,24),
+(2,1,7,34,22,31,18,25),
+(2,1,8,35,23,32,18,25),
+(2,1,9,37,24,34,18,25),
+(2,1,10,38,24,35,18,26),
+(2,1,11,39,25,36,18,26),
+(2,1,12,41,26,37,18,26),
+(2,1,13,42,27,39,18,27),
+(2,1,14,44,28,40,18,27),
+(2,1,15,45,29,41,18,27),
+(2,1,16,47,30,43,19,28),
+(2,1,17,48,31,44,19,28),
+(2,1,18,50,32,45,19,28),
+(2,1,19,51,33,47,19,29),
+(2,1,20,53,34,48,19,29),
+(2,1,21,54,34,50,19,29),
+(2,1,22,56,35,51,19,30),
+(2,1,23,57,36,52,20,30),
+(2,1,24,59,37,54,20,30),
+(2,1,25,60,38,55,20,31),
+(2,1,26,62,39,57,20,31),
+(2,1,27,64,40,58,20,32),
+(2,1,28,65,41,60,20,32),
+(2,1,29,67,43,61,21,32),
+(2,1,30,69,44,63,21,33),
+(2,1,31,70,45,64,21,33),
+(2,1,32,72,46,66,21,34),
+(2,1,33,74,47,67,21,34),
+(2,1,34,76,48,69,21,35),
+(2,1,35,77,49,71,22,35),
+(2,1,36,79,50,72,22,36),
+(2,1,37,81,51,74,22,36),
+(2,1,38,83,52,76,22,36),
+(2,1,39,84,53,77,22,37),
+(2,1,40,86,55,79,23,37),
+(2,1,41,88,56,81,23,38),
+(2,1,42,90,57,82,23,38),
+(2,1,43,92,58,84,23,39),
+(2,1,44,94,59,86,23,39),
+(2,1,45,96,60,87,24,40),
+(2,1,46,98,62,89,24,40),
+(2,1,47,100,63,91,24,41),
+(2,1,48,101,64,93,24,41),
+(2,1,49,103,65,94,25,42),
+(2,1,50,105,66,96,25,42),
+(2,1,51,107,68,98,25,43),
+(2,1,52,109,69,100,25,43),
+(2,1,53,111,70,102,25,44),
+(2,1,54,113,71,104,26,45),
+(2,1,55,115,73,105,26,45),
+(2,1,56,118,74,107,26,46),
+(2,1,57,120,75,109,26,46),
+(2,1,58,122,77,111,27,47),
+(2,1,59,124,78,113,27,47),
+(2,1,60,126,79,115,27,48),
+(2,1,61,128,81,117,27,48),
+(2,1,62,130,82,119,28,49),
+(2,1,63,132,83,121,28,50),
+(2,1,64,135,85,123,28,50),
+(2,1,65,137,86,125,29,51),
+(2,1,66,139,87,127,29,52),
+(2,1,67,141,89,129,29,52),
+(2,1,68,143,90,131,29,53),
+(2,1,69,146,92,133,30,53),
+(2,1,70,148,93,135,30,54),
+(2,1,71,157,94,142,30,55),
+(2,1,72,162,96,148,30,56),
+(2,1,73,165,98,150,30,57),
+(2,1,74,168,99,153,31,57),
+(2,1,75,170,101,154,31,58),
+(2,1,76,172,103,156,31,59),
+(2,1,77,174,105,159,32,60),
+(2,1,78,179,106,162,32,60),
+(2,1,79,184,108,167,32,61),
+(2,1,80,187,110,170,33,62),
+(2,3,1,23,20,23,17,24),
+(2,3,2,23,21,24,18,25),
+(2,3,3,24,23,25,18,25),
+(2,3,4,24,24,26,19,26),
+(2,3,5,25,25,27,19,26),
+(2,3,6,25,27,28,20,27),
+(2,3,7,26,28,28,21,28),
+(2,3,8,26,30,29,21,28),
+(2,3,9,26,31,30,22,29),
+(2,3,10,27,33,31,22,30),
+(2,3,11,27,34,32,23,30),
+(2,3,12,28,36,33,24,31),
+(2,3,13,28,37,34,24,32),
+(2,3,14,29,39,35,25,33),
+(2,3,15,29,40,36,26,33),
+(2,3,16,30,42,37,26,34),
+(2,3,17,30,43,39,27,35),
+(2,3,18,31,45,40,28,35),
+(2,3,19,31,47,41,28,36),
+(2,3,20,32,48,42,29,37),
+(2,3,21,32,50,43,30,38),
+(2,3,22,33,51,44,31,39),
+(2,3,23,34,53,45,31,39),
+(2,3,24,34,55,46,32,40),
+(2,3,25,35,57,47,33,41),
+(2,3,26,35,58,48,34,42),
+(2,3,27,36,60,50,34,43),
+(2,3,28,36,62,51,35,43),
+(2,3,29,37,63,52,36,44),
+(2,3,30,38,65,53,37,45),
+(2,3,31,38,67,54,37,46),
+(2,3,32,39,69,56,38,47),
+(2,3,33,39,71,57,39,48),
+(2,3,34,40,72,58,40,49),
+(2,3,35,41,74,59,41,49),
+(2,3,36,41,76,61,42,50),
+(2,3,37,42,78,62,42,51),
+(2,3,38,43,80,63,43,52),
+(2,3,39,43,82,64,44,53),
+(2,3,40,44,84,66,45,54),
+(2,3,41,45,86,67,46,55),
+(2,3,42,45,88,68,47,56),
+(2,3,43,46,90,70,47,57),
+(2,3,44,47,91,71,48,58),
+(2,3,45,47,93,72,49,59),
+(2,3,46,48,95,74,50,60),
+(2,3,47,49,98,75,51,61),
+(2,3,48,50,100,77,52,62),
+(2,3,49,50,102,78,53,63),
+(2,3,50,51,104,79,54,64),
+(2,3,51,52,106,81,55,65),
+(2,3,52,52,108,82,56,66),
+(2,3,53,53,110,84,57,67),
+(2,3,54,54,112,85,58,68),
+(2,3,55,55,114,87,59,69),
+(2,3,56,55,116,88,60,70),
+(2,3,57,56,118,90,61,71),
+(2,3,58,57,121,91,62,72),
+(2,3,59,58,123,93,63,73),
+(2,3,60,59,125,94,64,74),
+(2,3,61,59,127,96,65,76),
+(2,3,62,60,130,97,66,77),
+(2,3,63,61,132,99,67,78),
+(2,3,64,62,134,100,68,79),
+(2,3,65,63,136,102,69,80),
+(2,3,66,64,139,104,70,81),
+(2,3,67,64,141,105,71,82),
+(2,3,68,65,143,107,72,84),
+(2,3,69,66,146,108,73,85),
+(2,3,70,67,148,110,74,86),
+(2,3,71,68,151,112,75,87),
+(2,3,72,69,154,114,76,88),
+(2,3,73,70,157,116,77,90),
+(2,3,74,71,160,118,79,91),
+(2,3,75,72,163,120,80,93),
+(2,3,76,73,166,122,81,94),
+(2,3,77,74,169,124,83,96),
+(2,3,78,75,172,126,84,97),
+(2,3,79,76,175,128,85,99),
+(2,3,80,77,178,130,87,100),
+(2,4,1,24,20,23,17,23),
+(2,4,2,25,21,24,17,23),
+(2,4,3,25,23,24,17,24),
+(2,4,4,26,24,25,17,24),
+(2,4,5,27,26,26,18,24),
+(2,4,6,28,27,26,18,25),
+(2,4,7,29,29,27,18,25),
+(2,4,8,29,30,28,18,26),
+(2,4,9,30,32,29,18,26),
+(2,4,10,31,33,29,19,26),
+(2,4,11,32,35,30,19,27),
+(2,4,12,33,37,31,19,27),
+(2,4,13,34,38,32,19,28),
+(2,4,14,34,40,32,19,28),
+(2,4,15,35,41,33,19,28),
+(2,4,16,36,43,34,20,29),
+(2,4,17,37,45,35,20,29),
+(2,4,18,38,46,36,20,30),
+(2,4,19,39,48,37,20,30),
+(2,4,20,40,50,37,21,31),
+(2,4,21,41,52,38,21,31),
+(2,4,22,42,53,39,21,31),
+(2,4,23,43,55,40,21,32),
+(2,4,24,43,57,41,21,32),
+(2,4,25,44,59,42,22,33),
+(2,4,26,45,60,43,22,33),
+(2,4,27,46,62,44,22,34),
+(2,4,28,47,64,44,22,34),
+(2,4,29,48,66,45,23,35),
+(2,4,30,49,68,46,23,35),
+(2,4,31,50,70,47,23,36),
+(2,4,32,51,72,48,23,36),
+(2,4,33,53,73,49,24,37),
+(2,4,34,54,75,50,24,38),
+(2,4,35,55,77,51,24,38),
+(2,4,36,56,79,52,24,39),
+(2,4,37,57,81,53,25,39),
+(2,4,38,58,83,54,25,40),
+(2,4,39,59,85,55,25,40),
+(2,4,40,60,87,56,26,41),
+(2,4,41,61,89,57,26,41),
+(2,4,42,62,91,58,26,42),
+(2,4,43,63,93,59,27,43),
+(2,4,44,65,95,60,27,43),
+(2,4,45,66,98,61,27,44),
+(2,4,46,67,100,62,27,44),
+(2,4,47,68,102,64,28,45),
+(2,4,48,69,104,65,28,46),
+(2,4,49,71,106,66,28,46),
+(2,4,50,72,108,67,29,47),
+(2,4,51,73,110,68,29,48),
+(2,4,52,74,113,69,29,48),
+(2,4,53,75,115,70,30,49),
+(2,4,54,77,117,71,30,50),
+(2,4,55,78,119,73,30,50),
+(2,4,56,79,122,74,31,51),
+(2,4,57,80,124,75,31,52),
+(2,4,58,82,126,76,31,52),
+(2,4,59,83,129,77,32,53),
+(2,4,60,84,131,78,32,54),
+(2,4,61,86,133,80,33,54),
+(2,4,62,87,136,81,33,55),
+(2,4,63,88,138,82,33,56),
+(2,4,64,90,140,83,34,57),
+(2,4,65,91,143,85,34,57),
+(2,4,66,92,145,86,34,58),
+(2,4,67,94,148,87,35,59),
+(2,4,68,95,150,88,35,59),
+(2,4,69,97,153,90,36,60),
+(2,4,70,98,155,91,36,61),
+(2,4,71,100,158,92,36,62),
+(2,4,72,102,161,94,37,62),
+(2,4,73,103,164,99,37,63),
+(2,4,74,105,167,100,38,64),
+(2,4,75,107,170,102,38,65),
+(2,4,76,108,173,102,38,66),
+(2,4,77,110,176,102,39,67),
+(2,4,78,112,180,103,39,68),
+(2,4,79,114,183,105,40,69),
+(2,4,80,116,186,107,40,70),
+(2,6,1,26,17,24,17,23),
+(2,6,2,27,18,25,17,23),
+(2,6,3,29,19,26,17,24),
+(2,6,4,30,19,27,17,24),
+(2,6,5,31,20,29,17,24),
+(2,6,6,32,21,30,17,24),
+(2,6,7,34,22,31,18,25),
+(2,6,8,35,23,32,18,25),
+(2,6,9,37,24,34,18,25),
+(2,6,10,38,24,35,18,26),
+(2,6,11,39,25,36,18,26),
+(2,6,12,41,26,37,18,26),
+(2,6,13,42,27,39,18,27),
+(2,6,14,44,28,40,18,27),
+(2,6,15,45,29,41,18,27),
+(2,6,16,47,30,43,19,28),
+(2,6,17,48,31,44,19,28),
+(2,6,18,50,32,45,19,28),
+(2,6,19,51,33,47,19,29),
+(2,6,20,53,34,48,19,29),
+(2,6,21,54,34,50,19,29),
+(2,6,22,56,35,51,19,30),
+(2,6,23,57,36,52,20,30),
+(2,6,24,59,37,54,20,30),
+(2,6,25,60,38,55,20,31),
+(2,6,26,62,39,57,20,31),
+(2,6,27,64,40,58,20,32),
+(2,6,28,65,41,60,20,32),
+(2,6,29,67,43,61,21,32),
+(2,6,30,69,44,63,21,33),
+(2,6,31,70,45,64,21,33),
+(2,6,32,72,46,66,21,34),
+(2,6,33,74,47,67,21,34),
+(2,6,34,76,48,69,21,35),
+(2,6,35,77,49,71,22,35),
+(2,6,36,79,50,72,22,36),
+(2,6,37,81,51,74,22,36),
+(2,6,38,83,52,76,22,36),
+(2,6,39,84,53,77,22,37),
+(2,6,40,86,55,79,23,37),
+(2,6,41,88,56,81,23,38),
+(2,6,42,90,57,82,23,38),
+(2,6,43,92,58,84,23,39),
+(2,6,44,94,59,86,23,39),
+(2,6,45,96,60,87,24,40),
+(2,6,46,98,62,89,24,40),
+(2,6,47,100,63,91,24,41),
+(2,6,48,101,64,93,24,41),
+(2,6,49,103,65,94,25,42),
+(2,6,50,105,66,96,25,42),
+(2,6,51,107,68,98,25,43),
+(2,6,52,109,69,100,25,43),
+(2,6,53,110,69,100,25,44),
+(2,6,54,111,70,101,26,45),
+(2,6,55,111,70,101,26,45),
+(2,6,56,114,72,104,26,46),
+(2,6,57,116,73,106,26,46),
+(2,6,58,118,74,108,27,47),
+(2,6,59,124,76,110,27,47),
+(2,6,60,126,77,112,27,48),
+(2,6,61,128,78,114,27,49),
+(2,6,62,131,80,116,27,49),
+(2,6,63,133,81,119,28,50),
+(2,6,64,136,83,121,28,50),
+(2,6,65,136,84,123,28,51),
+(2,6,66,142,86,126,28,52),
+(2,6,67,145,87,128,29,52),
+(2,6,68,147,89,130,29,53),
+(2,6,69,150,90,133,29,54),
+(2,6,70,157,92,135,29,54),
+(2,6,71,160,94,138,30,55),
+(2,6,72,163,95,140,30,56),
+(2,6,73,166,97,151,30,57),
+(2,6,74,169,99,154,30,57),
+(2,6,75,172,100,156,31,58),
+(2,6,76,175,102,160,31,59),
+(2,6,77,179,104,162,31,60),
+(2,6,78,182,105,165,31,60),
+(2,6,79,191,107,168,32,61),
+(2,6,80,194,109,171,32,62),
+(2,7,1,24,17,23,18,25),
+(2,7,2,25,17,24,19,26),
+(2,7,3,26,18,25,20,27),
+(2,7,4,26,18,26,21,28),
+(2,7,5,27,19,27,22,29),
+(2,7,6,28,19,28,23,30),
+(2,7,7,29,20,29,24,31),
+(2,7,8,30,20,30,25,32),
+(2,7,9,31,21,31,26,33),
+(2,7,10,32,21,32,27,34),
+(2,7,11,33,22,33,28,36),
+(2,7,12,34,22,34,29,37),
+(2,7,13,34,23,35,30,38),
+(2,7,14,35,23,36,31,39),
+(2,7,15,36,24,37,32,40),
+(2,7,16,37,24,39,33,41),
+(2,7,17,38,25,40,34,43),
+(2,7,18,39,25,41,35,44),
+(2,7,19,40,26,42,36,45),
+(2,7,20,41,26,43,37,46),
+(2,7,21,42,27,44,38,47),
+(2,7,22,43,27,45,39,49),
+(2,7,23,44,28,47,40,50),
+(2,7,24,45,28,48,41,51),
+(2,7,25,47,29,49,43,52),
+(2,7,26,48,30,50,44,54),
+(2,7,27,49,30,52,45,55),
+(2,7,28,50,31,53,46,56),
+(2,7,29,51,31,54,47,58),
+(2,7,30,52,32,55,48,59),
+(2,7,31,53,33,57,50,60),
+(2,7,32,54,33,58,51,62),
+(2,7,33,55,34,59,52,63),
+(2,7,34,57,34,61,53,65),
+(2,7,35,58,35,62,55,66),
+(2,7,36,59,36,63,56,67),
+(2,7,37,60,36,65,57,69),
+(2,7,38,61,37,66,58,70),
+(2,7,39,62,38,67,60,72),
+(2,7,40,64,38,69,61,73),
+(2,7,41,65,39,70,62,75),
+(2,7,42,66,40,72,64,76),
+(2,7,43,67,40,73,65,78),
+(2,7,44,69,41,74,66,79),
+(2,7,45,70,42,76,68,81),
+(2,7,46,71,42,77,69,82),
+(2,7,47,72,43,79,70,84),
+(2,7,48,74,44,80,72,85),
+(2,7,49,75,45,82,73,87),
+(2,7,50,76,45,83,75,89),
+(2,7,51,78,46,85,76,90),
+(2,7,52,79,47,86,77,92),
+(2,7,53,80,47,88,79,93),
+(2,7,54,82,48,90,80,95),
+(2,7,55,83,49,91,82,97),
+(2,7,56,85,50,93,83,98),
+(2,7,57,86,50,94,85,100),
+(2,7,58,87,51,96,86,102),
+(2,7,59,89,52,97,88,103),
+(2,7,60,90,53,99,89,105),
+(2,7,61,92,54,101,91,107),
+(2,7,62,93,54,102,92,109),
+(2,7,63,95,55,104,94,110),
+(2,7,64,96,56,106,95,112),
+(2,7,65,97,57,107,97,114),
+(2,7,66,99,58,109,99,116),
+(2,7,67,100,58,111,100,118),
+(2,7,68,102,59,113,102,119),
+(2,7,69,103,60,114,103,121),
+(2,7,70,105,61,116,105,123),
+(2,7,71,106,62,118,117,125),
+(2,7,72,108,63,120,119,128),
+(2,7,73,110,64,122,122,130),
+(2,7,74,112,65,125,124,132),
+(2,7,75,114,66,127,126,134),
+(2,7,76,116,67,129,128,137),
+(2,7,77,117,68,131,128,139),
+(2,7,78,119,69,133,133,141),
+(2,7,79,121,70,136,135,144),
+(2,7,80,123,71,138,137,146),
+(2,9,1,23,17,23,19,25),
+(2,9,2,23,17,24,20,26),
+(2,9,3,24,18,24,21,27),
+(2,9,4,24,18,25,23,28),
+(2,9,5,24,18,25,24,30),
+(2,9,6,24,19,26,25,31),
+(2,9,7,25,19,26,26,32),
+(2,9,8,25,20,27,27,33),
+(2,9,9,25,20,27,29,34),
+(2,9,10,26,20,28,30,36),
+(2,9,11,26,21,29,31,37),
+(2,9,12,26,21,29,33,38),
+(2,9,13,27,22,30,34,39),
+(2,9,14,27,22,31,35,41),
+(2,9,15,27,23,31,37,42),
+(2,9,16,28,23,32,38,43),
+(2,9,17,28,23,32,39,45),
+(2,9,18,28,24,33,41,46),
+(2,9,19,29,24,34,42,47),
+(2,9,20,29,25,34,43,49),
+(2,9,21,29,25,35,45,50),
+(2,9,22,30,26,36,46,51),
+(2,9,23,30,26,37,48,53),
+(2,9,24,30,27,37,49,54),
+(2,9,25,31,27,38,51,56),
+(2,9,26,31,28,39,52,57),
+(2,9,27,32,28,39,54,59),
+(2,9,28,32,29,40,55,60),
+(2,9,29,32,29,41,57,62),
+(2,9,30,33,30,42,58,63),
+(2,9,31,33,30,42,60,65),
+(2,9,32,34,31,43,61,66),
+(2,9,33,34,31,44,63,68),
+(2,9,34,35,32,45,64,69),
+(2,9,35,35,32,45,66,71),
+(2,9,36,36,33,46,68,72),
+(2,9,37,36,34,47,69,74),
+(2,9,38,36,34,48,71,76),
+(2,9,39,37,35,49,72,77),
+(2,9,40,37,35,50,74,79),
+(2,9,41,38,36,50,76,80),
+(2,9,42,38,36,51,77,82),
+(2,9,43,39,37,52,79,84),
+(2,9,44,39,38,53,81,85),
+(2,9,45,40,38,54,83,87),
+(2,9,46,40,39,55,84,89),
+(2,9,47,41,39,56,86,91),
+(2,9,48,41,40,56,88,92),
+(2,9,49,42,41,57,90,94),
+(2,9,50,42,41,58,91,96),
+(2,9,51,43,42,59,93,98),
+(2,9,52,43,43,60,95,99),
+(2,9,53,44,43,61,97,101),
+(2,9,54,45,44,62,99,103),
+(2,9,55,45,45,63,101,105),
+(2,9,56,46,45,64,102,107),
+(2,9,57,46,46,65,104,109),
+(2,9,58,47,47,66,106,110),
+(2,9,59,47,47,67,108,112),
+(2,9,60,48,48,68,110,114),
+(2,9,61,48,49,69,112,116),
+(2,9,62,49,49,70,114,118),
+(2,9,63,50,50,71,116,120),
+(2,9,64,50,51,72,118,122),
+(2,9,65,51,51,73,120,124),
+(2,9,66,52,52,74,122,126),
+(2,9,67,52,53,75,124,128),
+(2,9,68,53,54,76,126,130),
+(2,9,69,53,54,77,128,132),
+(2,9,70,54,55,78,130,134),
+(2,9,71,55,56,88,134,145),
+(2,9,72,56,56,89,135,147),
+(2,9,73,57,57,90,137,150),
+(2,9,74,57,58,91,142,153),
+(2,9,75,58,59,93,142,155),
+(2,9,76,59,60,94,145,158),
+(2,9,77,60,61,95,148,161),
+(2,9,78,60,62,97,150,164),
+(2,9,79,61,63,98,153,167),
+(2,9,80,62,64,99,156,169),
+(3,1,1,25,16,25,19,19),
+(3,1,2,26,17,26,19,19),
+(3,1,3,28,18,27,19,20),
+(3,1,4,29,18,28,19,20),
+(3,1,5,30,19,30,19,20),
+(3,1,6,31,20,31,19,20),
+(3,1,7,33,21,32,20,21),
+(3,1,8,34,22,33,20,21),
+(3,1,9,36,23,35,20,21),
+(3,1,10,37,23,36,20,22),
+(3,1,11,38,24,37,20,22),
+(3,1,12,40,25,38,20,22),
+(3,1,13,41,26,40,20,23),
+(3,1,14,43,27,41,20,23),
+(3,1,15,44,28,42,20,23),
+(3,1,16,46,29,44,21,24),
+(3,1,17,47,30,45,21,24),
+(3,1,18,49,31,46,21,24),
+(3,1,19,50,32,48,21,25),
+(3,1,20,52,33,49,21,25),
+(3,1,21,53,34,51,21,26),
+(3,1,22,55,34,52,21,26),
+(3,1,23,56,35,53,21,26),
+(3,1,24,58,36,55,22,27),
+(3,1,25,59,37,56,22,27),
+(3,1,26,61,38,58,22,27),
+(3,1,27,63,39,59,22,28),
+(3,1,28,64,41,61,22,28),
+(3,1,29,66,42,62,22,29),
+(3,1,30,68,43,64,23,29),
+(3,1,31,69,44,65,23,30),
+(3,1,32,71,45,67,23,30),
+(3,1,33,73,46,68,23,30),
+(3,1,34,75,47,70,23,31),
+(3,1,35,76,48,72,24,31),
+(3,1,36,78,49,73,24,32),
+(3,1,37,80,50,75,24,32),
+(3,1,38,82,51,76,24,33),
+(3,1,39,84,52,78,24,33),
+(3,1,40,85,54,80,24,34),
+(3,1,41,87,55,81,25,34),
+(3,1,42,89,56,83,25,35),
+(3,1,43,91,57,85,25,35),
+(3,1,44,93,58,87,25,36),
+(3,1,45,95,59,88,26,36),
+(3,1,46,97,61,90,26,37),
+(3,1,47,99,62,92,26,37),
+(3,1,48,101,63,94,26,38),
+(3,1,49,102,64,95,26,38),
+(3,1,50,104,65,97,27,39),
+(3,1,51,106,67,99,27,39),
+(3,1,52,108,68,101,27,40),
+(3,1,53,110,69,103,27,40),
+(3,1,54,112,70,104,28,41),
+(3,1,55,115,72,106,28,41),
+(3,1,56,117,73,108,28,42),
+(3,1,57,119,74,110,28,42),
+(3,1,58,121,76,112,29,43),
+(3,1,59,123,77,114,29,43),
+(3,1,60,125,78,116,29,44),
+(3,1,61,127,80,118,29,45),
+(3,1,62,129,81,120,30,45),
+(3,1,63,131,82,122,30,46),
+(3,1,64,134,84,124,30,46),
+(3,1,65,136,85,126,31,47),
+(3,1,66,138,86,128,31,48),
+(3,1,67,140,88,130,31,48),
+(3,1,68,142,89,132,31,49),
+(3,1,69,145,91,134,32,49),
+(3,1,70,147,92,136,32,50),
+(3,1,71,150,93,138,32,51),
+(3,1,72,152,95,141,32,52),
+(3,1,73,164,97,151,32,53),
+(3,1,74,164,98,151,33,53),
+(3,1,75,170,100,156,33,54),
+(3,1,76,173,102,160,33,55),
+(3,1,77,173,104,160,34,56),
+(3,1,78,176,105,162,34,56),
+(3,1,79,183,107,168,34,57),
+(3,1,80,186,109,171,35,58),
+(3,2,1,24,16,25,19,20),
+(3,2,2,25,17,26,20,21),
+(3,2,3,26,17,27,20,21),
+(3,2,4,27,18,28,21,22),
+(3,2,5,28,18,29,22,23),
+(3,2,6,29,19,30,22,24),
+(3,2,7,31,20,31,23,24),
+(3,2,8,32,20,32,24,25),
+(3,2,9,33,21,33,24,26),
+(3,2,10,34,21,34,25,26),
+(3,2,11,35,22,36,26,27),
+(3,2,12,36,23,37,26,28),
+(3,2,13,38,23,38,27,29),
+(3,2,14,39,24,39,28,30),
+(3,2,15,40,25,40,29,30),
+(3,2,16,41,25,41,29,31),
+(3,2,17,43,26,43,30,32),
+(3,2,18,44,27,44,31,33),
+(3,2,19,45,28,45,32,34),
+(3,2,20,47,28,46,32,35),
+(3,2,21,48,29,47,33,35),
+(3,2,22,49,30,49,34,36),
+(3,2,23,51,30,50,35,37),
+(3,2,24,52,31,51,36,38),
+(3,2,25,53,32,52,36,39),
+(3,2,26,55,33,54,37,40),
+(3,2,27,56,33,55,38,41),
+(3,2,28,57,34,56,39,42),
+(3,2,29,59,35,58,40,43),
+(3,2,30,60,36,59,41,43),
+(3,2,31,62,37,60,42,44),
+(3,2,32,63,37,62,42,45),
+(3,2,33,65,38,63,43,46),
+(3,2,34,66,39,65,44,47),
+(3,2,35,68,40,66,45,48),
+(3,2,36,69,41,67,46,49),
+(3,2,37,71,41,69,47,50),
+(3,2,38,72,42,70,48,51),
+(3,2,39,74,43,72,49,52),
+(3,2,40,75,44,73,50,53),
+(3,2,41,77,45,75,51,54),
+(3,2,42,78,46,76,52,55),
+(3,2,43,80,47,78,53,56),
+(3,2,44,82,47,79,54,57),
+(3,2,45,83,48,81,55,59),
+(3,2,46,85,49,82,56,60),
+(3,2,47,87,50,84,57,61),
+(3,2,48,88,51,85,58,62),
+(3,2,49,90,52,87,59,63),
+(3,2,50,92,53,89,60,64),
+(3,2,51,93,54,90,61,65),
+(3,2,52,95,55,92,62,66),
+(3,2,53,97,56,93,63,67),
+(3,2,54,98,57,95,64,69),
+(3,2,55,100,58,97,65,70),
+(3,2,56,102,59,98,66,71),
+(3,2,57,104,60,100,67,72),
+(3,2,58,106,61,102,68,73),
+(3,2,59,107,62,103,69,74),
+(3,2,60,109,63,105,70,76),
+(3,2,61,111,64,107,72,77),
+(3,2,62,113,65,109,73,78),
+(3,2,63,115,66,110,74,79),
+(3,2,64,117,67,112,75,80),
+(3,2,65,118,68,114,76,82),
+(3,2,66,120,69,116,77,83),
+(3,2,67,122,70,118,78,84),
+(3,2,68,124,71,119,80,85),
+(3,2,69,126,72,121,81,87),
+(3,2,70,128,73,123,82,88),
+(3,2,71,150,74,125,83,89),
+(3,2,72,152,75,128,85,91),
+(3,2,73,156,76,130,86,93),
+(3,2,74,158,78,132,88,94),
+(3,2,75,161,79,134,89,96),
+(3,2,76,164,80,137,91,97),
+(3,2,77,166,82,139,92,99),
+(3,2,78,170,83,141,94,101),
+(3,2,79,172,84,144,95,102),
+(3,2,80,175,86,146,97,104),
+(3,3,1,22,19,24,19,20),
+(3,3,2,22,20,25,20,21),
+(3,3,3,23,22,26,20,21),
+(3,3,4,23,23,27,21,22),
+(3,3,5,24,25,28,21,23),
+(3,3,6,24,26,29,22,23),
+(3,3,7,25,27,29,23,24),
+(3,3,8,25,29,30,23,25),
+(3,3,9,25,30,31,24,25),
+(3,3,10,26,32,32,24,26),
+(3,3,11,26,33,33,25,27),
+(3,3,12,27,35,34,26,27),
+(3,3,13,27,36,35,26,28),
+(3,3,14,28,38,36,27,29),
+(3,3,15,28,39,37,28,29),
+(3,3,16,29,41,38,28,30),
+(3,3,17,29,42,39,29,31),
+(3,3,18,30,44,41,30,32),
+(3,3,19,30,46,42,30,32),
+(3,3,20,31,47,43,31,33),
+(3,3,21,32,49,44,32,34),
+(3,3,22,32,51,45,33,35),
+(3,3,23,33,52,46,33,36),
+(3,3,24,33,54,47,34,36),
+(3,3,25,34,56,48,35,37),
+(3,3,26,34,57,49,35,38),
+(3,3,27,35,59,51,36,39),
+(3,3,28,35,61,52,37,40),
+(3,3,29,36,63,53,38,40),
+(3,3,30,37,64,54,39,41),
+(3,3,31,37,66,55,39,42),
+(3,3,32,38,68,57,40,43),
+(3,3,33,38,70,58,41,44),
+(3,3,34,39,71,59,42,45),
+(3,3,35,40,73,60,43,46),
+(3,3,36,40,75,62,43,47),
+(3,3,37,41,77,63,44,47),
+(3,3,38,42,79,64,45,48),
+(3,3,39,42,81,65,46,49),
+(3,3,40,43,83,67,47,50),
+(3,3,41,44,85,68,48,51),
+(3,3,42,44,87,69,49,52),
+(3,3,43,45,89,71,49,53),
+(3,3,44,46,91,72,50,54),
+(3,3,45,46,93,73,51,55),
+(3,3,46,47,95,75,52,56),
+(3,3,47,48,97,76,53,57),
+(3,3,48,49,99,78,54,58),
+(3,3,49,49,101,79,55,59),
+(3,3,50,50,103,80,56,60),
+(3,3,51,51,105,82,57,61),
+(3,3,52,51,107,83,58,62),
+(3,3,53,52,109,85,59,63),
+(3,3,54,53,111,86,60,64),
+(3,3,55,54,113,88,61,65),
+(3,3,56,55,115,89,62,66),
+(3,3,57,55,118,91,62,67),
+(3,3,58,56,120,92,63,68),
+(3,3,59,57,122,94,64,70),
+(3,3,60,58,124,95,65,71),
+(3,3,61,58,126,97,67,72),
+(3,3,62,59,129,98,68,73),
+(3,3,63,60,131,100,69,74),
+(3,3,64,61,133,101,70,75),
+(3,3,65,62,135,103,71,76),
+(3,3,66,63,138,105,72,77),
+(3,3,67,63,140,106,73,78),
+(3,3,68,64,142,108,74,80),
+(3,3,69,65,145,109,75,81),
+(3,3,70,66,147,111,76,82),
+(3,3,71,67,150,113,77,83),
+(3,3,72,68,153,115,78,84),
+(3,3,73,69,156,117,79,86),
+(3,3,74,70,159,119,81,87),
+(3,3,75,71,162,121,82,89),
+(3,3,76,72,165,123,83,90),
+(3,3,77,73,168,125,85,92),
+(3,3,78,74,171,127,86,93),
+(3,3,79,75,174,129,87,95),
+(3,3,80,76,177,131,89,96),
+(3,4,1,23,19,24,19,19),
+(3,4,2,24,20,25,19,19),
+(3,4,3,24,22,25,19,20),
+(3,4,4,25,23,26,19,20),
+(3,4,5,26,25,27,20,20),
+(3,4,6,27,26,27,20,21),
+(3,4,7,28,28,28,20,21),
+(3,4,8,28,29,29,20,22),
+(3,4,9,29,31,30,20,22),
+(3,4,10,30,32,30,20,22),
+(3,4,11,31,34,31,21,23),
+(3,4,12,32,36,32,21,23),
+(3,4,13,33,37,33,21,24),
+(3,4,14,33,39,33,21,24),
+(3,4,15,34,40,34,21,25),
+(3,4,16,35,42,35,22,25),
+(3,4,17,36,44,36,22,25),
+(3,4,18,37,45,37,22,26),
+(3,4,19,38,47,38,22,26),
+(3,4,20,39,49,38,22,27),
+(3,4,21,40,51,39,23,27),
+(3,4,22,41,52,40,23,28),
+(3,4,23,42,54,41,23,28),
+(3,4,24,43,56,42,23,29),
+(3,4,25,44,58,43,24,29),
+(3,4,26,44,59,44,24,30),
+(3,4,27,45,61,44,24,30),
+(3,4,28,46,63,45,24,31),
+(3,4,29,47,65,46,25,31),
+(3,4,30,48,67,47,25,32),
+(3,4,31,49,69,48,25,32),
+(3,4,32,51,71,49,25,33),
+(3,4,33,52,72,50,26,33),
+(3,4,34,53,74,51,26,34),
+(3,4,35,54,76,52,26,34),
+(3,4,36,55,78,53,26,35),
+(3,4,37,56,80,54,27,35),
+(3,4,38,57,82,55,27,36),
+(3,4,39,58,84,56,27,37),
+(3,4,40,59,86,57,28,37),
+(3,4,41,60,88,58,28,38),
+(3,4,42,61,90,59,28,38),
+(3,4,43,63,92,60,28,39),
+(3,4,44,64,95,61,29,39),
+(3,4,45,65,97,62,29,40),
+(3,4,46,66,99,63,29,41),
+(3,4,47,67,101,64,30,41),
+(3,4,48,68,103,66,30,42),
+(3,4,49,70,105,67,30,43),
+(3,4,50,71,107,68,31,43),
+(3,4,51,72,110,69,31,44),
+(3,4,52,73,112,70,31,44),
+(3,4,53,74,114,71,32,45),
+(3,4,54,76,116,72,32,46),
+(3,4,55,77,118,73,32,46),
+(3,4,56,78,121,75,33,47),
+(3,4,57,80,123,76,33,48),
+(3,4,58,81,125,77,33,48),
+(3,4,59,82,128,78,34,49),
+(3,4,60,83,130,79,34,50),
+(3,4,61,85,132,81,34,51),
+(3,4,62,86,135,82,35,51),
+(3,4,63,87,137,83,35,52),
+(3,4,64,89,139,84,36,53),
+(3,4,65,90,142,86,36,53),
+(3,4,66,91,144,87,36,54),
+(3,4,67,93,147,88,37,55),
+(3,4,68,94,149,89,37,56),
+(3,4,69,96,152,91,38,56),
+(3,4,70,97,154,92,38,57),
+(3,4,71,99,157,93,38,58),
+(3,4,72,101,160,96,39,58),
+(3,4,73,102,163,97,39,59),
+(3,4,74,104,166,98,40,60),
+(3,4,75,106,169,100,40,61),
+(3,4,76,107,172,101,40,62),
+(3,4,77,109,175,103,41,63),
+(3,4,78,111,179,105,41,64),
+(3,4,79,113,182,106,42,65),
+(3,4,80,115,185,108,42,66),
+(3,5,1,22,16,23,21,22),
+(3,5,2,22,16,23,22,23),
+(3,5,3,22,16,24,24,25),
+(3,5,4,22,17,24,25,26),
+(3,5,5,23,17,24,26,27),
+(3,5,6,23,17,25,28,29),
+(3,5,7,23,17,25,29,30),
+(3,5,8,23,18,26,30,32),
+(3,5,9,23,18,26,32,33),
+(3,5,10,23,18,26,33,35),
+(3,5,11,24,18,27,35,36),
+(3,5,12,24,19,27,36,38),
+(3,5,13,24,19,28,37,39),
+(3,5,14,24,19,28,39,41),
+(3,5,15,24,19,28,40,42),
+(3,5,16,24,20,29,42,44),
+(3,5,17,25,20,29,43,45),
+(3,5,18,25,20,30,45,47),
+(3,5,19,25,21,30,46,49),
+(3,5,20,25,21,31,48,50),
+(3,5,21,25,21,31,50,52),
+(3,5,22,26,22,31,51,53),
+(3,5,23,26,22,32,53,55),
+(3,5,24,26,22,32,54,57),
+(3,5,25,26,22,33,56,58),
+(3,5,26,27,23,33,58,60),
+(3,5,27,27,23,34,59,62),
+(3,5,28,27,23,34,61,64),
+(3,5,29,27,24,35,63,65),
+(3,5,30,28,24,35,64,67),
+(3,5,31,28,24,36,66,69),
+(3,5,32,28,25,36,68,71),
+(3,5,33,28,25,37,70,72),
+(3,5,34,29,26,38,71,74),
+(3,5,35,29,26,38,73,76),
+(3,5,36,29,26,39,75,78),
+(3,5,37,29,27,39,77,80),
+(3,5,38,30,27,40,78,82),
+(3,5,39,30,27,40,80,84),
+(3,5,40,30,28,41,82,86),
+(3,5,41,31,28,41,84,88),
+(3,5,42,31,29,42,86,89),
+(3,5,43,31,29,43,88,91),
+(3,5,44,32,29,43,90,93),
+(3,5,45,32,30,44,92,95),
+(3,5,46,32,30,44,93,97),
+(3,5,47,32,30,45,95,99),
+(3,5,48,33,31,46,97,101),
+(3,5,49,33,31,46,99,103),
+(3,5,50,33,32,47,101,106),
+(3,5,51,34,32,48,103,108),
+(3,5,52,34,33,48,105,110),
+(3,5,53,35,33,49,107,112),
+(3,5,54,35,33,50,109,114),
+(3,5,55,35,34,50,111,116),
+(3,5,56,36,34,51,113,118),
+(3,5,57,36,35,52,116,120),
+(3,5,58,36,35,52,118,123),
+(3,5,59,37,36,53,120,125),
+(3,5,60,37,36,54,122,127),
+(3,5,61,37,37,54,124,129),
+(3,5,62,38,37,55,126,131),
+(3,5,63,38,38,56,128,134),
+(3,5,64,39,38,57,131,136),
+(3,5,65,39,39,57,133,138),
+(3,5,66,39,39,58,135,141),
+(3,5,67,40,40,59,137,143),
+(3,5,68,40,40,59,139,145),
+(3,5,69,41,40,60,142,148),
+(3,5,70,41,41,61,144,150),
+(3,5,71,41,42,62,147,153),
+(3,5,72,42,42,62,150,163),
+(3,5,73,42,43,63,153,166),
+(3,5,74,43,43,64,155,170),
+(3,5,75,43,44,65,158,173),
+(3,5,76,43,45,66,161,176),
+(3,5,77,44,45,67,164,179),
+(3,5,78,44,46,68,167,182),
+(3,5,79,45,46,69,170,184),
+(3,5,80,45,47,70,173,189),
+(3,6,1,25,16,25,19,19),
+(3,6,2,26,17,26,19,19),
+(3,6,3,28,18,27,19,20),
+(3,6,4,29,18,28,19,20),
+(3,6,5,30,19,30,19,20),
+(3,6,6,31,20,31,19,20),
+(3,6,7,33,21,32,20,21),
+(3,6,8,34,22,33,20,21),
+(3,6,9,36,23,35,20,21),
+(3,6,10,37,23,36,20,22),
+(3,6,11,38,24,37,20,22),
+(3,6,12,40,25,38,20,22),
+(3,6,13,41,26,40,20,23),
+(3,6,14,43,27,41,20,23),
+(3,6,15,44,28,42,20,23),
+(3,6,16,46,29,44,21,24),
+(3,6,17,47,30,45,21,24),
+(3,6,18,49,31,46,21,24),
+(3,6,19,50,32,48,21,25),
+(3,6,20,52,33,49,21,25),
+(3,6,21,53,34,51,21,26),
+(3,6,22,55,34,52,21,26),
+(3,6,23,56,35,53,21,26),
+(3,6,24,58,36,55,22,27),
+(3,6,25,59,37,56,22,27),
+(3,6,26,61,38,58,22,27),
+(3,6,27,63,39,59,22,28),
+(3,6,28,64,41,61,22,28),
+(3,6,29,66,42,62,22,29),
+(3,6,30,68,43,64,23,29),
+(3,6,31,69,44,65,23,30),
+(3,6,32,71,45,67,23,30),
+(3,6,33,73,46,68,23,30),
+(3,6,34,75,47,70,23,31),
+(3,6,35,76,48,72,24,31),
+(3,6,36,78,49,73,24,32),
+(3,6,37,80,50,75,24,32),
+(3,6,38,82,51,76,24,33),
+(3,6,39,84,52,78,24,33),
+(3,6,40,85,54,80,24,34),
+(3,6,41,87,55,81,25,34),
+(3,6,42,89,56,83,25,35),
+(3,6,43,91,57,85,25,35),
+(3,6,44,93,58,87,25,36),
+(3,6,45,95,59,88,26,36),
+(3,6,46,97,61,90,26,37),
+(3,6,47,99,62,92,26,37),
+(3,6,48,101,63,94,26,38),
+(3,6,49,102,64,95,26,38),
+(3,6,50,104,65,97,27,39),
+(3,6,51,106,67,99,27,39),
+(3,6,52,108,68,99,27,40),
+(3,6,53,109,68,101,27,40),
+(3,6,54,110,69,101,28,41),
+(3,6,55,110,69,102,28,41),
+(3,6,56,113,71,105,28,42),
+(3,6,57,118,72,107,28,42),
+(3,6,58,120,73,109,29,43),
+(3,6,59,123,75,111,29,43),
+(3,6,60,125,76,113,29,44),
+(3,6,61,126,77,115,29,45),
+(3,6,62,127,79,117,29,45),
+(3,6,63,129,80,120,30,46),
+(3,6,64,132,82,122,30,46),
+(3,6,65,135,83,124,30,47),
+(3,6,66,137,85,127,30,48),
+(3,6,67,144,86,129,31,48),
+(3,6,68,146,88,131,31,49),
+(3,6,69,149,89,133,31,50),
+(3,6,70,152,91,136,31,50),
+(3,6,71,154,93,139,32,51),
+(3,6,72,157,94,141,32,52),
+(3,6,73,160,96,144,32,53),
+(3,6,74,163,98,146,32,53),
+(3,6,75,166,99,150,33,54),
+(3,6,76,169,101,152,33,55),
+(3,6,77,172,103,155,33,56),
+(3,6,78,176,104,157,33,56),
+(3,6,79,179,106,160,34,57),
+(3,6,80,182,108,163,34,58),
+(4,1,1,20,25,21,20,20),
+(4,1,2,21,26,22,20,20),
+(4,1,3,23,27,23,20,21),
+(4,1,4,24,27,25,20,21),
+(4,1,5,25,28,26,20,21),
+(4,1,6,27,29,27,20,21),
+(4,1,7,28,30,28,21,22),
+(4,1,8,29,31,29,21,22),
+(4,1,9,31,31,31,21,22),
+(4,1,10,32,32,32,21,23),
+(4,1,11,33,33,33,21,23),
+(4,1,12,35,34,34,21,23),
+(4,1,13,36,35,36,21,24),
+(4,1,14,38,36,37,21,24),
+(4,1,15,39,37,38,21,24),
+(4,1,16,41,37,40,21,25),
+(4,1,17,42,38,41,22,25),
+(4,1,18,44,39,43,22,25),
+(4,1,19,45,40,44,22,26),
+(4,1,20,47,41,45,22,26),
+(4,1,21,48,42,47,22,26),
+(4,1,22,50,43,48,22,27),
+(4,1,23,52,44,50,22,27),
+(4,1,24,53,45,51,23,28),
+(4,1,25,55,46,52,23,28),
+(4,1,26,56,47,54,23,28),
+(4,1,27,58,48,55,23,29),
+(4,1,28,60,49,57,23,29),
+(4,1,29,61,50,58,23,30),
+(4,1,30,63,51,60,24,30),
+(4,1,31,65,52,62,24,30),
+(4,1,32,66,53,63,24,31),
+(4,1,33,68,54,65,24,31),
+(4,1,34,70,55,66,24,32),
+(4,1,35,72,56,68,24,32),
+(4,1,36,73,58,69,25,33),
+(4,1,37,75,59,71,25,33),
+(4,1,38,77,60,73,25,34),
+(4,1,39,79,61,74,25,34),
+(4,1,40,81,62,76,25,35),
+(4,1,41,82,63,78,26,35),
+(4,1,42,84,64,79,26,35),
+(4,1,43,86,66,81,26,36),
+(4,1,44,88,67,83,26,36),
+(4,1,45,90,68,85,26,37),
+(4,1,46,92,69,86,27,37),
+(4,1,47,94,70,88,27,38),
+(4,1,48,96,72,90,27,38),
+(4,1,49,98,73,92,27,39),
+(4,1,50,100,74,93,28,40),
+(4,1,51,102,75,95,28,40),
+(4,1,52,104,77,97,28,41),
+(4,1,53,106,78,99,28,41),
+(4,1,54,108,79,101,29,42),
+(4,1,55,110,80,103,29,42),
+(4,1,56,112,82,104,29,43),
+(4,1,57,114,83,106,29,43),
+(4,1,58,116,84,108,30,44),
+(4,1,59,118,86,110,30,44),
+(4,1,60,120,87,112,30,45),
+(4,1,61,122,88,114,30,46),
+(4,1,62,124,90,116,31,46),
+(4,1,63,127,91,118,31,47),
+(4,1,64,129,92,120,31,47),
+(4,1,65,131,94,122,32,48),
+(4,1,66,133,95,124,32,49),
+(4,1,67,135,97,126,32,49),
+(4,1,68,138,98,128,32,50),
+(4,1,69,140,100,130,33,50),
+(4,1,70,142,101,132,33,51),
+(4,1,71,145,102,134,33,52),
+(4,1,72,147,104,137,33,53),
+(4,1,73,150,106,139,33,54),
+(4,1,74,153,107,142,34,54),
+(4,1,75,156,109,144,34,55),
+(4,1,76,159,111,148,34,56),
+(4,1,77,162,113,150,35,57),
+(4,1,78,165,114,152,35,57),
+(4,1,79,178,116,164,35,58),
+(4,1,80,181,118,167,36,59),
+(4,3,1,17,28,20,20,21),
+(4,3,2,17,29,21,21,22),
+(4,3,3,18,31,22,21,22),
+(4,3,4,18,32,23,22,23),
+(4,3,5,19,33,24,22,24),
+(4,3,6,19,35,25,23,24),
+(4,3,7,20,36,26,24,25),
+(4,3,8,20,38,27,24,25),
+(4,3,9,21,39,27,25,26),
+(4,3,10,21,40,28,25,27),
+(4,3,11,22,42,29,26,28),
+(4,3,12,22,43,30,27,28),
+(4,3,13,23,45,31,27,29),
+(4,3,14,23,46,32,28,30),
+(4,3,15,24,48,34,29,30),
+(4,3,16,24,50,35,29,31),
+(4,3,17,25,51,36,30,32),
+(4,3,18,25,53,37,31,33),
+(4,3,19,26,54,38,31,33),
+(4,3,20,26,56,39,32,34),
+(4,3,21,27,57,40,33,35),
+(4,3,22,27,59,41,33,36),
+(4,3,23,28,61,42,34,36),
+(4,3,24,28,62,43,35,37),
+(4,3,25,29,64,44,36,38),
+(4,3,26,30,66,46,36,39),
+(4,3,27,30,68,47,37,40),
+(4,3,28,31,69,48,38,41),
+(4,3,29,31,71,49,39,41),
+(4,3,30,32,73,50,39,42),
+(4,3,31,33,75,52,40,43),
+(4,3,32,33,76,53,41,44),
+(4,3,33,34,78,54,42,45),
+(4,3,34,34,80,55,43,46),
+(4,3,35,35,82,57,44,47),
+(4,3,36,36,84,58,44,48),
+(4,3,37,36,86,59,45,48),
+(4,3,38,37,87,60,46,49),
+(4,3,39,38,89,62,47,50),
+(4,3,40,38,91,63,48,51),
+(4,3,41,39,93,64,49,52),
+(4,3,42,40,95,66,49,53),
+(4,3,43,40,97,67,50,54),
+(4,3,44,41,99,68,51,55),
+(4,3,45,42,101,70,52,56),
+(4,3,46,42,103,71,53,57),
+(4,3,47,43,105,72,54,58),
+(4,3,48,44,107,74,55,59),
+(4,3,49,45,109,75,56,60),
+(4,3,50,45,111,77,57,61),
+(4,3,51,46,113,78,58,62),
+(4,3,52,47,115,79,59,63),
+(4,3,53,47,118,81,60,64),
+(4,3,54,48,120,82,61,65),
+(4,3,55,49,122,84,61,66),
+(4,3,56,50,124,85,62,67),
+(4,3,57,50,126,87,63,68),
+(4,3,58,51,128,88,64,69),
+(4,3,59,52,131,90,65,70),
+(4,3,60,53,133,91,66,72),
+(4,3,61,54,135,93,67,73),
+(4,3,62,54,137,94,69,74),
+(4,3,63,55,140,96,70,75),
+(4,3,64,56,142,97,71,76),
+(4,3,65,57,144,99,72,77),
+(4,3,66,58,147,101,73,78),
+(4,3,67,58,149,102,74,79),
+(4,3,68,59,151,104,75,81),
+(4,3,69,60,154,105,76,82),
+(4,3,70,61,156,107,77,83),
+(4,3,71,62,159,109,78,84),
+(4,3,72,63,162,111,79,85),
+(4,3,73,64,165,113,80,87),
+(4,3,74,65,168,115,82,88),
+(4,3,75,66,171,117,83,90),
+(4,3,76,67,174,119,84,91),
+(4,3,77,68,177,121,86,93),
+(4,3,78,69,180,123,87,94),
+(4,3,79,70,190,125,91,96),
+(4,3,80,71,193,127,93,97),
+(4,4,1,18,28,20,20,20),
+(4,4,2,19,29,21,20,20),
+(4,4,3,20,31,21,20,21),
+(4,4,4,20,32,22,20,21),
+(4,4,5,21,34,23,21,21),
+(4,4,6,22,35,24,21,22),
+(4,4,7,23,37,24,21,22),
+(4,4,8,24,38,25,21,23),
+(4,4,9,24,40,26,21,23),
+(4,4,10,25,41,26,21,23),
+(4,4,11,26,43,27,22,24),
+(4,4,12,27,44,28,22,24),
+(4,4,13,28,46,29,22,25),
+(4,4,14,29,48,30,22,25),
+(4,4,15,29,49,30,22,25),
+(4,4,16,30,51,31,23,26),
+(4,4,17,31,52,32,23,26),
+(4,4,18,32,54,33,23,27),
+(4,4,19,33,56,34,23,27),
+(4,4,20,34,57,35,23,28),
+(4,4,21,35,59,35,24,28),
+(4,4,22,36,61,36,24,29),
+(4,4,23,37,63,37,24,29),
+(4,4,24,38,64,38,24,30),
+(4,4,25,39,66,39,25,30),
+(4,4,26,40,68,40,25,31),
+(4,4,27,41,70,41,25,31),
+(4,4,28,42,72,42,25,32),
+(4,4,29,43,73,43,25,32),
+(4,4,30,44,75,43,26,33),
+(4,4,31,45,77,44,26,33),
+(4,4,32,46,79,45,26,34),
+(4,4,33,47,81,46,27,34),
+(4,4,34,48,83,47,27,35),
+(4,4,35,49,85,48,27,35),
+(4,4,36,50,87,49,27,36),
+(4,4,37,51,89,50,28,36),
+(4,4,38,52,91,51,28,37),
+(4,4,39,53,93,52,28,38),
+(4,4,40,54,95,53,28,38),
+(4,4,41,56,97,54,29,39),
+(4,4,42,57,99,55,29,39),
+(4,4,43,58,101,56,29,40),
+(4,4,44,59,103,57,30,40),
+(4,4,45,60,105,59,30,41),
+(4,4,46,61,107,60,30,42),
+(4,4,47,62,109,61,31,42),
+(4,4,48,64,112,62,31,43),
+(4,4,49,65,114,63,31,44),
+(4,4,50,66,116,64,32,44),
+(4,4,51,67,118,65,32,45),
+(4,4,52,68,120,66,32,45),
+(4,4,53,70,123,67,33,46),
+(4,4,54,71,125,69,33,47),
+(4,4,55,72,127,70,33,47),
+(4,4,56,73,129,71,34,48),
+(4,4,57,75,132,72,34,49),
+(4,4,58,76,134,73,34,49),
+(4,4,59,77,136,74,35,50),
+(4,4,60,79,139,76,35,51),
+(4,4,61,80,141,77,35,51),
+(4,4,62,81,143,78,36,52),
+(4,4,63,82,146,79,36,53),
+(4,4,64,84,148,80,37,54),
+(4,4,65,85,151,82,37,54),
+(4,4,66,87,153,83,37,55),
+(4,4,67,88,156,84,38,56),
+(4,4,68,89,158,85,38,57),
+(4,4,69,91,160,87,39,57),
+(4,4,70,92,163,88,39,58),
+(4,4,71,94,166,90,39,59),
+(4,4,72,96,169,91,40,59),
+(4,4,73,97,172,93,40,60),
+(4,4,74,99,175,94,41,61),
+(4,4,75,101,178,96,41,62),
+(4,4,76,102,181,97,41,63),
+(4,4,77,104,184,99,42,64),
+(4,4,78,106,188,101,42,65),
+(4,4,79,108,191,102,43,66),
+(4,4,80,110,194,104,43,67),
+(4,5,1,17,25,19,22,23),
+(4,5,2,17,25,19,23,24),
+(4,5,3,17,25,20,25,26),
+(4,5,4,17,26,20,26,27),
+(4,5,5,18,26,20,27,28),
+(4,5,6,18,26,21,29,30),
+(4,5,7,18,26,21,30,31),
+(4,5,8,18,26,22,31,33),
+(4,5,9,18,27,22,33,34),
+(4,5,10,19,27,22,34,36),
+(4,5,11,19,27,23,36,37),
+(4,5,12,19,27,23,37,39),
+(4,5,13,19,28,24,38,40),
+(4,5,14,19,28,24,40,42),
+(4,5,15,19,28,25,41,43),
+(4,5,16,20,28,25,43,45),
+(4,5,17,20,29,25,44,46),
+(4,5,18,20,29,26,46,48),
+(4,5,19,20,29,26,47,49),
+(4,5,20,21,30,27,49,51),
+(4,5,21,21,30,27,51,53),
+(4,5,22,21,30,28,52,54),
+(4,5,23,21,30,28,54,56),
+(4,5,24,21,31,29,55,58),
+(4,5,25,22,31,29,57,59),
+(4,5,26,22,31,30,59,61),
+(4,5,27,22,32,30,60,63),
+(4,5,28,22,32,31,62,65),
+(4,5,29,23,32,31,64,66),
+(4,5,30,23,33,32,65,68),
+(4,5,31,23,33,32,67,70),
+(4,5,32,23,33,33,69,72),
+(4,5,33,24,34,33,70,73),
+(4,5,34,24,34,34,72,75),
+(4,5,35,24,34,34,74,77),
+(4,5,36,24,35,35,76,79),
+(4,5,37,25,35,35,78,81),
+(4,5,38,25,35,36,79,83),
+(4,5,39,25,36,37,81,85),
+(4,5,40,26,36,37,83,87),
+(4,5,41,26,37,38,85,88),
+(4,5,42,26,37,38,87,90),
+(4,5,43,27,37,39,89,92),
+(4,5,44,27,38,39,91,94),
+(4,5,45,27,38,40,92,96),
+(4,5,46,27,39,41,94,98),
+(4,5,47,28,39,41,96,100),
+(4,5,48,28,39,42,98,102),
+(4,5,49,28,40,43,100,104),
+(4,5,50,29,40,43,102,106),
+(4,5,51,29,41,44,104,109),
+(4,5,52,29,41,44,106,111),
+(4,5,53,30,42,45,108,113),
+(4,5,54,30,42,46,110,115),
+(4,5,55,30,43,46,112,117),
+(4,5,56,31,43,47,114,119),
+(4,5,57,31,43,48,117,121),
+(4,5,58,31,44,48,119,124),
+(4,5,59,32,44,49,121,126),
+(4,5,60,32,45,50,123,128),
+(4,5,61,33,45,51,125,130),
+(4,5,62,33,46,51,127,132),
+(4,5,63,33,46,52,129,135),
+(4,5,64,34,47,53,132,137),
+(4,5,65,34,47,53,134,139),
+(4,5,66,34,48,54,136,142),
+(4,5,67,35,48,55,138,144),
+(4,5,68,35,49,56,140,146),
+(4,5,69,36,49,56,143,149),
+(4,5,70,36,50,57,145,151),
+(4,5,71,36,51,58,148,161),
+(4,5,72,37,51,58,151,164),
+(4,5,73,37,52,59,154,168),
+(4,5,74,38,52,60,156,171),
+(4,5,75,38,53,61,159,174),
+(4,5,76,38,54,62,162,177),
+(4,5,77,39,54,63,165,180),
+(4,5,78,39,55,64,168,183),
+(4,5,79,40,55,65,171,186),
+(4,5,80,40,56,66,200,191),
+(4,6,1,20,25,21,20,20),
+(4,6,2,21,26,22,20,20),
+(4,6,3,23,27,23,20,21),
+(4,6,4,24,27,25,20,21),
+(4,6,5,25,28,26,20,21),
+(4,6,6,27,29,27,20,21),
+(4,6,7,28,30,28,21,22),
+(4,6,8,29,31,29,21,22),
+(4,6,9,31,31,31,21,22),
+(4,6,10,32,32,32,21,23),
+(4,6,11,33,33,33,21,23),
+(4,6,12,35,34,34,21,23),
+(4,6,13,36,35,36,21,24),
+(4,6,14,38,36,37,21,24),
+(4,6,15,39,37,38,21,24),
+(4,6,16,41,37,40,21,25),
+(4,6,17,42,38,41,22,25),
+(4,6,18,44,39,43,22,25),
+(4,6,19,45,40,44,22,26),
+(4,6,20,47,41,45,22,26),
+(4,6,21,48,42,47,22,26),
+(4,6,22,50,43,48,22,27),
+(4,6,23,52,44,50,22,27),
+(4,6,24,53,45,51,23,28),
+(4,6,25,55,46,52,23,28),
+(4,6,26,56,47,54,23,28),
+(4,6,27,58,48,55,23,29),
+(4,6,28,60,49,57,23,29),
+(4,6,29,61,50,58,23,30),
+(4,6,30,63,51,60,24,30),
+(4,6,31,65,52,62,24,30),
+(4,6,32,66,53,63,24,31),
+(4,6,33,68,54,65,24,31),
+(4,6,34,70,55,66,24,32),
+(4,6,35,72,56,68,24,32),
+(4,6,36,73,58,69,25,33),
+(4,6,37,75,59,71,25,33),
+(4,6,38,77,60,73,25,34),
+(4,6,39,79,61,74,25,34),
+(4,6,40,81,62,76,25,35),
+(4,6,41,82,63,78,26,35),
+(4,6,42,84,64,79,26,35),
+(4,6,43,86,66,81,26,36),
+(4,6,44,88,67,83,26,36),
+(4,6,45,90,68,85,26,37),
+(4,6,46,92,69,86,27,37),
+(4,6,47,94,70,88,27,38),
+(4,6,48,96,72,90,27,38),
+(4,6,49,98,73,92,27,39),
+(4,6,50,100,74,93,28,40),
+(4,6,51,101,75,94,28,40),
+(4,6,52,102,76,95,28,41),
+(4,6,53,103,77,96,28,41),
+(4,6,54,104,77,97,29,42),
+(4,6,55,105,78,98,29,42),
+(4,6,56,108,80,101,29,43),
+(4,6,57,113,81,103,29,43),
+(4,6,58,115,82,105,30,44),
+(4,6,59,115,84,107,30,44),
+(4,6,60,120,85,109,30,45),
+(4,6,61,122,86,111,30,46),
+(4,6,62,122,88,113,30,46),
+(4,6,63,127,89,116,31,47),
+(4,6,64,127,91,118,31,47),
+(4,6,65,133,92,120,31,48),
+(4,6,66,135,94,123,31,49),
+(4,6,67,136,95,125,32,49),
+(4,6,68,137,97,127,32,50),
+(4,6,69,140,98,130,32,51),
+(4,6,70,147,100,132,32,51),
+(4,6,71,154,102,135,33,52),
+(4,6,72,156,103,137,33,53),
+(4,6,73,157,105,140,33,54),
+(4,6,74,158,107,142,33,54),
+(4,6,75,161,108,145,34,55),
+(4,6,76,164,110,148,34,56),
+(4,6,77,167,112,150,34,57),
+(4,6,78,170,113,153,34,57),
+(4,6,79,172,115,156,35,58),
+(4,6,80,177,117,159,35,59),
+(4,11,1,18,25,19,22,22),
+(4,11,2,19,25,20,23,23),
+(4,11,3,19,26,20,24,24),
+(4,11,4,20,26,21,25,26),
+(4,11,5,20,27,22,26,27),
+(4,11,6,21,27,22,27,28),
+(4,11,7,21,28,23,28,29),
+(4,11,8,22,28,24,29,30),
+(4,11,9,23,29,24,30,32),
+(4,11,10,23,29,25,32,33),
+(4,11,11,24,30,26,33,34),
+(4,11,12,24,31,26,34,35),
+(4,11,13,25,31,27,35,37),
+(4,11,14,26,32,28,36,38),
+(4,11,15,26,32,29,37,39),
+(4,11,16,27,33,29,38,41),
+(4,11,17,28,33,30,40,42),
+(4,11,18,28,34,31,41,43),
+(4,11,19,29,35,32,42,45),
+(4,11,20,30,35,32,43,46),
+(4,11,21,30,36,33,45,48),
+(4,11,22,31,36,34,46,49),
+(4,11,23,32,37,35,47,51),
+(4,11,24,32,38,36,48,52),
+(4,11,25,33,38,36,50,53),
+(4,11,26,34,39,37,51,55),
+(4,11,27,35,40,38,52,56),
+(4,11,28,35,40,39,54,58),
+(4,11,29,36,41,40,55,59),
+(4,11,30,37,42,41,56,61),
+(4,11,31,38,42,42,58,62),
+(4,11,32,38,43,42,59,64),
+(4,11,33,39,44,43,60,66),
+(4,11,34,40,44,44,62,67),
+(4,11,35,41,45,45,63,69),
+(4,11,36,42,46,46,65,70),
+(4,11,37,42,47,47,66,72),
+(4,11,38,43,47,48,67,74),
+(4,11,39,44,48,49,69,75),
+(4,11,40,45,49,50,70,77),
+(4,11,41,46,50,51,72,79),
+(4,11,42,46,50,52,73,80),
+(4,11,43,47,51,53,75,82),
+(4,11,44,48,52,54,76,84),
+(4,11,45,49,53,55,78,85),
+(4,11,46,50,54,56,79,87),
+(4,11,47,51,54,57,81,89),
+(4,11,48,52,55,58,83,91),
+(4,11,49,53,56,59,84,93),
+(4,11,50,53,57,60,86,94),
+(4,11,51,54,58,61,87,96),
+(4,11,52,55,59,62,89,98),
+(4,11,53,56,59,63,91,100),
+(4,11,54,57,60,64,92,102),
+(4,11,55,58,61,65,94,103),
+(4,11,56,59,62,66,95,105),
+(4,11,57,60,63,67,97,107),
+(4,11,58,61,64,68,99,109),
+(4,11,59,62,65,69,101,111),
+(4,11,60,63,66,70,102,113),
+(4,11,61,64,66,72,104,115),
+(4,11,62,65,67,73,106,117),
+(4,11,63,66,68,74,107,119),
+(4,11,64,67,69,75,109,121),
+(4,11,65,68,70,76,111,123),
+(4,11,66,69,71,77,113,125),
+(4,11,67,70,72,78,115,127),
+(4,11,68,71,73,80,116,129),
+(4,11,69,72,74,81,118,131),
+(4,11,70,73,75,82,120,133),
+(4,11,71,75,76,83,122,135),
+(4,11,72,76,78,85,125,138),
+(4,11,73,77,79,86,127,140),
+(4,11,74,78,80,88,131,143),
+(4,11,75,80,81,89,133,145),
+(4,11,76,81,82,91,134,148),
+(4,11,77,82,83,92,136,151),
+(4,11,78,84,85,94,138,153),
+(4,11,79,85,86,95,141,156),
+(4,11,80,86,87,97,143,159),
+(5,1,1,22,18,23,18,25),
+(5,1,2,23,19,24,18,25),
+(5,1,3,25,20,25,18,26),
+(5,1,4,26,20,26,18,26),
+(5,1,5,27,21,28,18,26),
+(5,1,6,29,22,29,18,26),
+(5,1,7,30,23,30,19,27),
+(5,1,8,31,24,31,19,27),
+(5,1,9,33,25,33,19,27),
+(5,1,10,34,25,34,19,28),
+(5,1,11,35,26,35,19,28),
+(5,1,12,37,27,36,19,28),
+(5,1,13,38,28,38,19,28),
+(5,1,14,40,29,39,19,29),
+(5,1,15,41,30,40,19,29),
+(5,1,16,43,31,42,20,29),
+(5,1,17,44,32,43,20,30),
+(5,1,18,46,33,44,20,30),
+(5,1,19,47,34,46,20,31),
+(5,1,20,49,34,47,20,31),
+(5,1,21,50,35,49,20,31),
+(5,1,22,52,36,50,20,32),
+(5,1,23,53,37,51,21,32),
+(5,1,24,55,38,53,21,32),
+(5,1,25,57,39,54,21,33),
+(5,1,26,58,40,56,21,33),
+(5,1,27,60,41,57,21,34),
+(5,1,28,62,42,59,21,34),
+(5,1,29,63,43,60,21,34),
+(5,1,30,65,44,62,22,35),
+(5,1,31,67,46,63,22,35),
+(5,1,32,68,47,65,22,36),
+(5,1,33,70,48,67,22,36),
+(5,1,34,72,49,68,22,36),
+(5,1,35,74,50,70,23,37),
+(5,1,36,75,51,71,23,37),
+(5,1,37,77,52,73,23,38),
+(5,1,38,79,53,75,23,38),
+(5,1,39,81,54,76,23,39),
+(5,1,40,83,55,78,24,39),
+(5,1,41,84,57,80,24,40),
+(5,1,42,86,58,81,24,40),
+(5,1,43,88,59,83,24,41),
+(5,1,44,90,60,85,24,41),
+(5,1,45,92,61,86,25,42),
+(5,1,46,94,62,88,25,42),
+(5,1,47,96,64,90,25,43),
+(5,1,48,98,65,92,25,43),
+(5,1,49,100,66,93,25,44),
+(5,1,50,102,67,95,26,44),
+(5,1,51,104,69,97,26,45),
+(5,1,52,106,70,99,26,45),
+(5,1,53,108,71,101,26,46),
+(5,1,54,110,72,103,27,46),
+(5,1,55,112,74,104,27,47),
+(5,1,56,114,75,106,27,48),
+(5,1,57,116,76,108,27,48),
+(5,1,58,118,78,110,28,49),
+(5,1,59,120,79,112,28,49),
+(5,1,60,122,80,114,28,50),
+(5,1,61,124,82,116,28,50),
+(5,1,62,126,83,118,29,51),
+(5,1,63,128,84,120,29,52),
+(5,1,64,131,86,122,29,52),
+(5,1,65,133,87,124,30,53),
+(5,1,66,135,88,126,30,53),
+(5,1,67,137,90,128,30,54),
+(5,1,68,139,91,130,30,55),
+(5,1,69,142,93,132,31,55),
+(5,1,70,144,94,134,31,56),
+(5,1,71,147,95,136,31,57),
+(5,1,72,150,97,139,31,58),
+(5,1,73,152,99,141,31,59),
+(5,1,74,155,100,144,32,59),
+(5,1,75,158,102,146,32,60),
+(5,1,76,163,104,149,32,61),
+(5,1,77,167,106,152,33,62),
+(5,1,78,167,107,154,33,62),
+(5,1,79,170,109,157,33,63),
+(5,1,80,173,111,160,34,64),
+(5,4,1,20,21,22,18,25),
+(5,4,2,21,22,23,18,25),
+(5,4,3,22,24,23,18,26),
+(5,4,4,22,25,24,18,26),
+(5,4,5,23,27,25,19,26),
+(5,4,6,24,28,25,19,27),
+(5,4,7,25,30,26,19,27),
+(5,4,8,25,31,27,19,27),
+(5,4,9,26,33,28,19,28),
+(5,4,10,27,34,28,19,28),
+(5,4,11,28,36,29,20,29),
+(5,4,12,29,38,30,20,29),
+(5,4,13,30,39,31,20,29),
+(5,4,14,31,41,32,20,30),
+(5,4,15,31,42,32,20,30),
+(5,4,16,32,44,33,21,31),
+(5,4,17,33,46,34,21,31),
+(5,4,18,34,47,35,21,32),
+(5,4,19,35,49,36,21,32),
+(5,4,20,36,51,36,21,32),
+(5,4,21,37,52,37,22,33),
+(5,4,22,38,54,38,22,33),
+(5,4,23,39,56,39,22,34),
+(5,4,24,40,58,40,22,34),
+(5,4,25,41,60,41,23,35),
+(5,4,26,42,61,42,23,35),
+(5,4,27,43,63,43,23,36),
+(5,4,28,44,65,44,23,36),
+(5,4,29,45,67,44,24,37),
+(5,4,30,46,69,45,24,37),
+(5,4,31,47,71,46,24,38),
+(5,4,32,48,72,47,24,38),
+(5,4,33,49,74,48,25,39),
+(5,4,34,50,76,49,25,39),
+(5,4,35,51,78,50,25,40),
+(5,4,36,52,80,51,25,41),
+(5,4,37,53,82,52,26,41),
+(5,4,38,54,84,53,26,42),
+(5,4,39,55,86,54,26,42),
+(5,4,40,56,88,55,27,43),
+(5,4,41,57,90,56,27,43),
+(5,4,42,59,92,57,27,44),
+(5,4,43,60,94,58,27,45),
+(5,4,44,61,96,59,28,45),
+(5,4,45,62,99,60,28,46),
+(5,4,46,63,101,61,28,46),
+(5,4,47,64,103,63,29,47),
+(5,4,48,66,105,64,29,48),
+(5,4,49,67,107,65,29,48),
+(5,4,50,68,109,66,30,49),
+(5,4,51,69,111,67,30,50),
+(5,4,52,70,114,68,30,50),
+(5,4,53,72,116,69,31,51),
+(5,4,54,73,118,70,31,52),
+(5,4,55,74,120,72,31,52),
+(5,4,56,75,123,73,32,53),
+(5,4,57,77,125,74,32,54),
+(5,4,58,78,127,75,32,54),
+(5,4,59,79,130,76,33,55),
+(5,4,60,81,132,77,33,56),
+(5,4,61,82,134,79,34,56),
+(5,4,62,83,137,80,34,57),
+(5,4,63,84,139,81,34,58),
+(5,4,64,86,141,82,35,59),
+(5,4,65,87,144,84,35,59),
+(5,4,66,88,146,85,35,60),
+(5,4,67,90,149,86,36,61),
+(5,4,68,91,151,87,36,61),
+(5,4,69,93,154,89,37,62),
+(5,4,70,94,156,90,37,63),
+(5,4,71,96,159,91,37,64),
+(5,4,72,98,162,93,38,64),
+(5,4,73,99,165,95,38,65),
+(5,4,74,101,168,96,39,66),
+(5,4,75,103,171,98,39,67),
+(5,4,76,104,174,99,39,68),
+(5,4,77,106,177,101,40,69),
+(5,4,78,108,181,103,40,70),
+(5,4,79,110,184,104,41,71),
+(5,4,80,112,187,106,41,72),
+(5,5,1,19,18,21,20,28),
+(5,5,2,19,18,21,21,29),
+(5,5,3,19,18,22,23,31),
+(5,5,4,19,19,22,24,32),
+(5,5,5,20,19,22,25,33),
+(5,5,6,20,19,23,27,35),
+(5,5,7,20,19,23,28,36),
+(5,5,8,20,20,24,29,38),
+(5,5,9,20,20,24,31,39),
+(5,5,10,20,20,24,32,40),
+(5,5,11,21,20,25,34,42),
+(5,5,12,21,21,25,35,43),
+(5,5,13,21,21,26,37,45),
+(5,5,14,21,21,26,38,46),
+(5,5,15,21,21,26,39,48),
+(5,5,16,22,22,27,41,50),
+(5,5,17,22,22,27,42,51),
+(5,5,18,22,22,28,44,53),
+(5,5,19,22,23,28,46,54),
+(5,5,20,22,23,29,47,56),
+(5,5,21,23,23,29,49,57),
+(5,5,22,23,23,30,50,59),
+(5,5,23,23,24,30,52,61),
+(5,5,24,23,24,31,53,62),
+(5,5,25,24,24,31,55,64),
+(5,5,26,24,25,32,57,66),
+(5,5,27,24,25,32,58,68),
+(5,5,28,24,25,33,60,69),
+(5,5,29,25,26,33,62,71),
+(5,5,30,25,26,34,63,73),
+(5,5,31,25,26,34,65,75),
+(5,5,32,25,27,35,67,76),
+(5,5,33,26,27,35,69,78),
+(5,5,34,26,27,36,70,80),
+(5,5,35,26,28,36,72,82),
+(5,5,36,26,28,37,74,84),
+(5,5,37,27,28,37,76,86),
+(5,5,38,27,29,38,77,87),
+(5,5,39,27,29,38,79,89),
+(5,5,40,28,30,39,81,91),
+(5,5,41,28,30,40,83,93),
+(5,5,42,28,30,40,85,95),
+(5,5,43,28,31,41,87,97),
+(5,5,44,29,31,41,89,99),
+(5,5,45,29,32,42,91,101),
+(5,5,46,29,32,43,92,103),
+(5,5,47,30,32,43,94,105),
+(5,5,48,30,33,44,96,107),
+(5,5,49,30,33,44,98,109),
+(5,5,50,31,34,45,100,111),
+(5,5,51,31,34,46,102,113),
+(5,5,52,31,35,46,104,115),
+(5,5,53,32,35,47,106,118),
+(5,5,54,32,35,48,108,120),
+(5,5,55,32,36,48,110,122),
+(5,5,56,33,36,49,113,124),
+(5,5,57,33,37,50,115,126),
+(5,5,58,33,37,50,117,128),
+(5,5,59,34,38,51,119,131),
+(5,5,60,34,38,52,121,133),
+(5,5,61,34,39,52,123,135),
+(5,5,62,35,39,53,125,137),
+(5,5,63,35,40,54,127,140),
+(5,5,64,36,40,55,130,142),
+(5,5,65,36,41,55,132,144),
+(5,5,66,36,41,56,134,147),
+(5,5,67,37,41,57,136,149),
+(5,5,68,37,42,58,138,151),
+(5,5,69,38,42,58,141,154),
+(5,5,70,38,43,59,143,156),
+(5,5,71,38,44,60,146,159),
+(5,5,72,39,44,60,149,162),
+(5,5,73,39,45,61,152,165),
+(5,5,74,40,45,62,157,168),
+(5,5,75,40,46,63,157,171),
+(5,5,76,40,47,64,160,174),
+(5,5,77,41,47,65,163,177),
+(5,5,78,41,48,66,166,180),
+(5,5,79,42,48,67,169,183),
+(5,5,80,42,49,68,172,186),
+(5,6,1,22,18,23,18,25),
+(5,6,2,23,19,24,18,25),
+(5,6,3,25,20,25,18,26),
+(5,6,4,26,20,26,18,26),
+(5,6,5,27,21,28,18,26),
+(5,6,6,29,22,29,18,26),
+(5,6,7,30,23,30,19,27),
+(5,6,8,31,24,31,19,27),
+(5,6,9,33,25,33,19,27),
+(5,6,10,34,25,34,19,28),
+(5,6,11,35,26,35,19,28),
+(5,6,12,37,27,36,19,28),
+(5,6,13,38,28,38,19,28),
+(5,6,14,40,29,39,19,29),
+(5,6,15,41,30,40,19,29),
+(5,6,16,43,31,42,20,29),
+(5,6,17,44,32,43,20,30),
+(5,6,18,46,33,44,20,30),
+(5,6,19,47,34,46,20,31),
+(5,6,20,49,34,47,20,31),
+(5,6,21,50,35,49,20,31),
+(5,6,22,52,36,50,20,32),
+(5,6,23,53,37,51,21,32),
+(5,6,24,55,38,53,21,32),
+(5,6,25,57,39,54,21,33),
+(5,6,26,58,40,56,21,33),
+(5,6,27,60,41,57,21,34),
+(5,6,28,62,42,59,21,34),
+(5,6,29,63,43,60,21,34),
+(5,6,30,65,44,62,22,35),
+(5,6,31,67,46,63,22,35),
+(5,6,32,68,47,65,22,36),
+(5,6,33,70,48,67,22,36),
+(5,6,34,72,49,68,22,36),
+(5,6,35,74,50,70,23,37),
+(5,6,36,75,51,71,23,37),
+(5,6,37,77,52,73,23,38),
+(5,6,38,79,53,75,23,38),
+(5,6,39,81,54,76,23,39),
+(5,6,40,83,55,78,24,39),
+(5,6,41,84,57,80,24,40),
+(5,6,42,86,58,81,24,40),
+(5,6,43,88,59,83,24,41),
+(5,6,44,90,60,85,24,41),
+(5,6,45,92,61,86,25,42),
+(5,6,46,94,62,88,25,42),
+(5,6,47,96,64,90,25,43),
+(5,6,48,98,65,92,25,43),
+(5,6,49,100,66,93,25,44),
+(5,6,50,102,67,95,26,44),
+(5,6,51,103,67,96,26,45),
+(5,6,52,104,68,97,26,45),
+(5,6,53,105,69,98,26,46),
+(5,6,54,106,70,99,27,46),
+(5,6,55,107,71,100,27,47),
+(5,6,56,110,73,103,27,48),
+(5,6,57,112,74,105,27,48),
+(5,6,58,114,75,107,28,49),
+(5,6,59,119,77,109,28,49),
+(5,6,60,122,78,111,28,50),
+(5,6,61,124,79,113,28,51),
+(5,6,62,127,81,115,28,51),
+(5,6,63,129,82,118,29,52),
+(5,6,64,136,84,120,29,52),
+(5,6,65,137,85,123,29,53),
+(5,6,66,138,87,125,29,54),
+(5,6,67,141,88,127,30,54),
+(5,6,68,143,90,129,30,55),
+(5,6,69,146,91,132,30,56),
+(5,6,70,149,93,134,30,56),
+(5,6,71,152,95,137,31,57),
+(5,6,72,154,96,139,31,58),
+(5,6,73,157,98,142,31,59),
+(5,6,74,158,100,145,31,59),
+(5,6,75,159,101,147,32,60),
+(5,6,76,162,103,150,32,61),
+(5,6,77,167,105,152,32,62),
+(5,6,78,173,106,155,32,62),
+(5,6,79,174,108,158,33,63),
+(5,6,80,174,110,161,33,64),
+(5,8,1,19,18,21,21,27),
+(5,8,2,19,18,21,22,28),
+(5,8,3,19,18,22,24,30),
+(5,8,4,19,18,22,25,31),
+(5,8,5,19,19,22,26,32),
+(5,8,6,19,19,22,28,34),
+(5,8,7,20,19,23,29,35),
+(5,8,8,20,19,23,31,36),
+(5,8,9,20,19,23,32,38),
+(5,8,10,20,19,24,34,39),
+(5,8,11,20,20,24,35,40),
+(5,8,12,20,20,24,37,42),
+(5,8,13,20,20,25,38,43),
+(5,8,14,20,20,25,40,45),
+(5,8,15,20,20,25,41,46),
+(5,8,16,21,21,26,43,48),
+(5,8,17,21,21,26,44,49),
+(5,8,18,21,21,26,46,51),
+(5,8,19,21,21,27,48,52),
+(5,8,20,21,21,27,49,54),
+(5,8,21,21,22,27,51,55),
+(5,8,22,21,22,28,52,57),
+(5,8,23,21,22,28,54,58),
+(5,8,24,22,22,29,56,60),
+(5,8,25,22,23,29,57,62),
+(5,8,26,22,23,29,59,63),
+(5,8,27,22,23,30,61,65),
+(5,8,28,22,23,30,63,67),
+(5,8,29,22,24,31,64,68),
+(5,8,30,23,24,31,66,70),
+(5,8,31,23,24,31,68,72),
+(5,8,32,23,24,32,70,73),
+(5,8,33,23,25,32,72,75),
+(5,8,34,23,25,33,73,77),
+(5,8,35,24,25,33,75,79),
+(5,8,36,24,25,34,77,80),
+(5,8,37,24,26,34,79,82),
+(5,8,38,24,26,35,81,84),
+(5,8,39,24,26,35,83,86),
+(5,8,40,24,27,35,85,88),
+(5,8,41,25,27,36,87,90),
+(5,8,42,25,27,36,89,91),
+(5,8,43,25,27,37,90,93),
+(5,8,44,25,28,37,92,95),
+(5,8,45,26,28,38,94,97),
+(5,8,46,26,28,38,96,99),
+(5,8,47,26,29,39,98,101),
+(5,8,48,26,29,39,100,103),
+(5,8,49,26,29,40,103,105),
+(5,8,50,27,30,40,105,107),
+(5,8,51,27,30,41,107,109),
+(5,8,52,27,30,42,109,111),
+(5,8,53,27,31,42,111,113),
+(5,8,54,28,31,43,113,115),
+(5,8,55,28,31,43,115,117),
+(5,8,56,28,32,44,117,119),
+(5,8,57,28,32,44,119,121),
+(5,8,58,29,32,45,122,123),
+(5,8,59,29,33,45,124,126),
+(5,8,60,29,33,46,126,128),
+(5,8,61,29,34,47,128,130),
+(5,8,62,30,34,47,131,132),
+(5,8,63,30,34,48,133,134),
+(5,8,64,30,35,48,135,136),
+(5,8,65,31,35,49,137,139),
+(5,8,66,31,35,50,140,141),
+(5,8,67,31,36,50,142,143),
+(5,8,68,31,36,51,144,145),
+(5,8,69,32,37,51,147,148),
+(5,8,70,32,37,52,149,150),
+(5,8,71,32,37,53,152,153),
+(5,8,72,32,38,54,155,156),
+(5,8,73,32,38,55,158,159),
+(5,8,74,33,39,55,161,161),
+(5,8,75,33,39,56,164,164),
+(5,8,76,33,39,57,167,167),
+(5,8,77,34,40,58,170,170),
+(5,8,78,34,40,58,173,173),
+(5,8,79,34,41,59,176,176),
+(5,8,80,35,41,60,179,179),
+(5,9,1,19,18,22,20,27),
+(5,9,2,19,18,23,21,28),
+(5,9,3,20,19,23,22,29),
+(5,9,4,20,19,24,24,30),
+(5,9,5,20,19,24,25,32),
+(5,9,6,20,20,25,26,33),
+(5,9,7,21,20,25,27,34),
+(5,9,8,21,21,26,28,35),
+(5,9,9,21,21,26,30,36),
+(5,9,10,22,21,27,31,38),
+(5,9,11,22,22,28,32,39),
+(5,9,12,22,22,28,34,40),
+(5,9,13,23,23,29,35,41),
+(5,9,14,23,23,30,36,43),
+(5,9,15,23,24,30,37,44),
+(5,9,16,24,24,31,39,45),
+(5,9,17,24,24,31,40,47),
+(5,9,18,24,25,32,42,48),
+(5,9,19,25,25,33,43,49),
+(5,9,20,25,26,33,44,51),
+(5,9,21,26,26,34,46,52),
+(5,9,22,26,27,35,47,53),
+(5,9,23,26,27,36,49,55),
+(5,9,24,27,28,36,50,56),
+(5,9,25,27,28,37,52,58),
+(5,9,26,27,29,38,53,59),
+(5,9,27,28,29,38,55,60),
+(5,9,28,28,30,39,56,62),
+(5,9,29,29,30,40,58,63),
+(5,9,30,29,31,41,59,65),
+(5,9,31,30,31,41,61,66),
+(5,9,32,30,32,42,62,68),
+(5,9,33,30,32,43,64,69),
+(5,9,34,31,33,44,65,71),
+(5,9,35,31,33,45,67,73),
+(5,9,36,32,34,45,69,74),
+(5,9,37,32,34,46,70,76),
+(5,9,38,33,35,47,72,77),
+(5,9,39,33,36,48,73,79),
+(5,9,40,34,36,49,75,81),
+(5,9,41,34,37,49,77,82),
+(5,9,42,35,37,50,78,84),
+(5,9,43,35,38,51,80,86),
+(5,9,44,36,39,52,82,87),
+(5,9,45,36,39,53,84,89),
+(5,9,46,37,40,54,85,91),
+(5,9,47,37,40,55,87,92),
+(5,9,48,38,41,55,89,94),
+(5,9,49,38,42,56,91,96),
+(5,9,50,39,42,57,92,98),
+(5,9,51,39,43,58,94,100),
+(5,9,52,40,44,59,96,101),
+(5,9,53,40,44,60,98,103),
+(5,9,54,41,45,61,100,105),
+(5,9,55,41,45,62,102,107),
+(5,9,56,42,46,63,103,109),
+(5,9,57,42,47,64,105,111),
+(5,9,58,43,47,65,107,112),
+(5,9,59,43,48,66,109,114),
+(5,9,60,44,49,67,111,116),
+(5,9,61,45,50,68,113,118),
+(5,9,62,45,50,69,115,120),
+(5,9,63,46,51,70,117,122),
+(5,9,64,46,52,71,119,124),
+(5,9,65,47,52,72,121,126),
+(5,9,66,48,53,73,123,128),
+(5,9,67,48,54,74,125,130),
+(5,9,68,49,55,75,127,132),
+(5,9,69,49,55,76,129,134),
+(5,9,70,50,56,77,131,136),
+(5,9,71,51,57,86,135,147),
+(5,9,72,52,57,88,136,149),
+(5,9,73,53,58,89,138,152),
+(5,9,74,53,59,90,141,155),
+(5,9,75,54,60,92,143,157),
+(5,9,76,55,61,93,146,160),
+(5,9,77,56,62,94,149,163),
+(5,9,78,56,63,96,151,166),
+(5,9,79,57,64,97,154,169),
+(5,9,80,58,65,99,157,171),
+(6,1,1,28,15,24,15,22),
+(6,1,2,29,16,25,15,22),
+(6,1,3,31,17,26,15,23),
+(6,1,4,32,17,27,15,23),
+(6,1,5,33,18,29,15,23),
+(6,1,6,34,19,30,15,23),
+(6,1,7,36,20,31,16,24),
+(6,1,8,37,21,32,16,24),
+(6,1,9,38,22,34,16,24),
+(6,1,10,40,22,35,16,25),
+(6,1,11,41,23,36,16,25),
+(6,1,12,43,24,37,16,25),
+(6,1,13,44,25,39,16,26),
+(6,1,14,46,26,40,16,26),
+(6,1,15,47,27,41,17,26),
+(6,1,16,48,28,43,17,27),
+(6,1,17,50,29,44,17,27),
+(6,1,18,51,30,45,17,27),
+(6,1,19,53,31,47,17,28),
+(6,1,20,54,32,48,17,28),
+(6,1,21,56,33,50,17,28),
+(6,1,22,58,34,51,18,29),
+(6,1,23,59,35,52,18,29),
+(6,1,24,61,36,54,18,30),
+(6,1,25,62,37,55,18,30),
+(6,1,26,64,38,57,18,30),
+(6,1,27,66,39,58,18,31),
+(6,1,28,67,40,60,18,31),
+(6,1,29,69,41,61,19,32),
+(6,1,30,71,42,63,19,32),
+(6,1,31,72,43,64,19,32),
+(6,1,32,74,44,66,19,33),
+(6,1,33,76,45,67,19,33),
+(6,1,34,77,46,69,20,34),
+(6,1,35,79,47,71,20,34),
+(6,1,36,81,48,72,20,35),
+(6,1,37,83,49,74,20,35),
+(6,1,38,85,50,76,20,35),
+(6,1,39,86,51,77,21,36),
+(6,1,40,88,53,79,21,36),
+(6,1,41,90,54,81,21,37),
+(6,1,42,92,55,82,21,37),
+(6,1,43,94,56,84,21,38),
+(6,1,44,96,57,86,22,38),
+(6,1,45,98,58,87,22,39),
+(6,1,46,99,60,89,22,39),
+(6,1,47,101,61,91,22,40),
+(6,1,48,103,62,93,22,40),
+(6,1,49,105,63,94,23,41),
+(6,1,50,107,65,96,23,41),
+(6,1,51,109,66,98,23,42),
+(6,1,52,111,67,100,23,42),
+(6,1,53,113,68,102,24,43),
+(6,1,54,115,70,104,24,44),
+(6,1,55,117,71,105,24,44),
+(6,1,56,119,72,107,24,45),
+(6,1,57,122,73,109,25,45),
+(6,1,58,124,75,111,25,46),
+(6,1,59,126,76,113,25,46),
+(6,1,60,128,77,115,25,47),
+(6,1,61,130,79,117,26,48),
+(6,1,62,132,80,119,26,48),
+(6,1,63,134,81,121,26,49),
+(6,1,64,137,83,123,26,49),
+(6,1,65,139,84,125,27,50),
+(6,1,66,141,85,127,27,51),
+(6,1,67,143,87,129,27,51),
+(6,1,68,145,88,131,27,52),
+(6,1,69,148,90,133,28,52),
+(6,1,70,150,91,135,28,53),
+(6,1,71,153,92,137,28,54),
+(6,1,72,155,94,140,28,55),
+(6,1,73,158,96,142,28,56),
+(6,1,74,161,97,145,29,56),
+(6,1,75,164,99,147,29,57),
+(6,1,76,167,101,150,29,58),
+(6,1,77,170,103,153,30,59),
+(6,1,78,173,104,155,30,59),
+(6,1,79,176,106,164,30,60),
+(6,1,80,179,108,170,31,61),
+(6,3,1,25,18,23,15,23),
+(6,3,2,25,19,24,16,24),
+(6,3,3,26,21,25,16,24),
+(6,3,4,26,22,26,17,25),
+(6,3,5,27,24,27,17,25),
+(6,3,6,27,25,28,18,26),
+(6,3,7,28,26,28,19,27),
+(6,3,8,28,28,29,19,27),
+(6,3,9,28,29,30,20,28),
+(6,3,10,29,31,31,20,29),
+(6,3,11,29,32,32,21,29),
+(6,3,12,30,34,33,22,30),
+(6,3,13,30,35,34,22,31),
+(6,3,14,31,37,35,23,32),
+(6,3,15,31,38,36,24,32),
+(6,3,16,32,40,37,24,33),
+(6,3,17,32,41,39,25,34),
+(6,3,18,33,43,40,26,35),
+(6,3,19,33,45,41,27,35),
+(6,3,20,34,46,42,27,36),
+(6,3,21,34,48,43,28,37),
+(6,3,22,35,50,44,29,38),
+(6,3,23,35,51,45,29,38),
+(6,3,24,36,53,46,30,39),
+(6,3,25,37,55,47,31,40),
+(6,3,26,37,56,48,32,41),
+(6,3,27,38,58,50,32,42),
+(6,3,28,38,60,51,33,42),
+(6,3,29,39,62,52,34,43),
+(6,3,30,39,63,53,35,44),
+(6,3,31,40,65,54,36,45),
+(6,3,32,41,67,56,36,46),
+(6,3,33,41,69,57,37,47),
+(6,3,34,42,71,58,38,48),
+(6,3,35,43,72,59,39,48),
+(6,3,36,43,74,61,40,49),
+(6,3,37,44,76,62,40,50),
+(6,3,38,45,78,63,41,51),
+(6,3,39,45,80,64,42,52),
+(6,3,40,46,82,66,43,53),
+(6,3,41,47,84,67,44,54),
+(6,3,42,47,86,68,45,55),
+(6,3,43,48,88,70,46,56),
+(6,3,44,49,90,71,46,57),
+(6,3,45,49,92,72,47,58),
+(6,3,46,50,94,74,48,59),
+(6,3,47,51,96,75,49,60),
+(6,3,48,51,98,77,50,61),
+(6,3,49,52,100,78,51,62),
+(6,3,50,53,102,79,52,63),
+(6,3,51,54,104,81,53,64),
+(6,3,52,54,106,82,54,65),
+(6,3,53,55,108,84,55,66),
+(6,3,54,56,110,85,56,67),
+(6,3,55,57,112,87,57,68),
+(6,3,56,57,114,88,58,69),
+(6,3,57,58,117,90,59,70),
+(6,3,58,59,119,91,60,71),
+(6,3,59,60,121,93,61,72),
+(6,3,60,61,123,94,62,74),
+(6,3,61,61,125,96,63,75),
+(6,3,62,62,128,97,64,76),
+(6,3,63,63,130,99,65,77),
+(6,3,64,64,132,100,66,78),
+(6,3,65,65,134,102,67,79),
+(6,3,66,66,137,104,68,80),
+(6,3,67,66,139,105,69,81),
+(6,3,68,67,141,107,70,83),
+(6,3,69,68,144,108,71,84),
+(6,3,70,69,146,110,72,85),
+(6,3,71,70,149,112,73,86),
+(6,3,72,71,152,114,74,87),
+(6,3,73,72,155,116,75,89),
+(6,3,74,73,158,118,77,90),
+(6,3,75,74,161,120,78,92),
+(6,3,76,75,164,122,79,93),
+(6,3,77,76,167,124,81,95),
+(6,3,78,77,176,126,85,96),
+(6,3,79,78,179,128,86,98),
+(6,3,80,79,183,130,88,99),
+(6,6,1,28,15,24,15,22),
+(6,6,2,29,16,25,15,22),
+(6,6,3,31,17,26,15,23),
+(6,6,4,32,17,27,15,23),
+(6,6,5,33,18,29,15,23),
+(6,6,6,34,19,30,15,23),
+(6,6,7,36,20,31,16,24),
+(6,6,8,37,21,32,16,24),
+(6,6,9,38,22,34,16,24),
+(6,6,10,40,22,35,16,25),
+(6,6,11,41,23,36,16,25),
+(6,6,12,43,24,37,16,25),
+(6,6,13,44,25,39,16,26),
+(6,6,14,46,26,40,16,26),
+(6,6,15,47,27,41,17,26),
+(6,6,16,48,28,43,17,27),
+(6,6,17,50,29,44,17,27),
+(6,6,18,51,30,45,17,27),
+(6,6,19,53,31,47,17,28),
+(6,6,20,54,32,48,17,28),
+(6,6,21,56,33,50,17,28),
+(6,6,22,58,34,51,18,29),
+(6,6,23,59,35,52,18,29),
+(6,6,24,61,36,54,18,30),
+(6,6,25,62,37,55,18,30),
+(6,6,26,64,38,57,18,30),
+(6,6,27,66,39,58,18,31),
+(6,6,28,67,40,60,18,31),
+(6,6,29,69,41,61,19,32),
+(6,6,30,71,42,63,19,32),
+(6,6,31,72,43,64,19,32),
+(6,6,32,74,44,66,19,33),
+(6,6,33,76,45,67,19,33),
+(6,6,34,77,46,69,20,34),
+(6,6,35,79,47,71,20,34),
+(6,6,36,81,48,72,20,35),
+(6,6,37,83,49,74,20,35),
+(6,6,38,85,50,76,20,35),
+(6,6,39,86,51,77,21,36),
+(6,6,40,88,53,79,21,36),
+(6,6,41,90,54,81,21,37),
+(6,6,42,92,55,82,21,37),
+(6,6,43,94,56,84,21,38),
+(6,6,44,96,57,86,22,38),
+(6,6,45,98,58,87,22,39),
+(6,6,46,99,60,89,22,39),
+(6,6,47,101,60,91,22,40),
+(6,6,48,103,61,93,22,40),
+(6,6,49,105,62,94,23,41),
+(6,6,50,107,63,96,23,41),
+(6,6,51,109,64,97,23,42),
+(6,6,52,110,65,98,23,42),
+(6,6,53,111,66,99,24,43),
+(6,6,54,112,67,100,24,44),
+(6,6,55,113,68,101,24,44),
+(6,6,56,116,70,104,24,45),
+(6,6,57,121,71,106,24,45),
+(6,6,58,123,72,108,25,46),
+(6,6,59,123,74,110,25,46),
+(6,6,60,125,75,112,25,47),
+(6,6,61,127,76,114,25,48),
+(6,6,62,133,78,116,25,48),
+(6,6,63,135,79,119,26,49),
+(6,6,64,139,81,121,26,49),
+(6,6,65,142,82,123,26,50),
+(6,6,66,146,84,126,26,51),
+(6,6,67,150,85,132,27,51),
+(6,6,68,153,87,137,27,52),
+(6,6,69,157,88,140,27,53),
+(6,6,70,160,90,143,27,53),
+(6,6,71,163,92,146,28,54),
+(6,6,72,165,93,148,28,55),
+(6,6,73,167,95,150,28,56),
+(6,6,74,171,97,153,28,56),
+(6,6,75,174,98,156,29,57),
+(6,6,76,178,100,156,29,58),
+(6,6,77,179,102,156,29,59),
+(6,6,78,179,103,156,29,59),
+(6,6,79,182,105,159,30,60),
+(6,6,80,185,107,162,30,61),
+(6,7,1,26,15,23,16,24),
+(6,7,2,27,15,24,17,25),
+(6,7,3,28,16,25,18,26),
+(6,7,4,28,16,26,19,27),
+(6,7,5,29,17,27,20,28),
+(6,7,6,30,17,28,21,29),
+(6,7,7,31,18,29,22,30),
+(6,7,8,32,18,30,23,31),
+(6,7,9,33,19,31,24,32),
+(6,7,10,34,19,32,25,33),
+(6,7,11,35,20,33,26,35),
+(6,7,12,35,20,34,27,36),
+(6,7,13,36,21,35,28,37),
+(6,7,14,37,21,36,29,38),
+(6,7,15,38,22,37,30,39),
+(6,7,16,39,22,39,31,40),
+(6,7,17,40,23,40,32,42),
+(6,7,18,41,23,41,33,43),
+(6,7,19,42,24,42,34,44),
+(6,7,20,43,24,43,35,45),
+(6,7,21,44,25,44,36,46),
+(6,7,22,45,25,45,37,48),
+(6,7,23,46,26,47,38,49),
+(6,7,24,47,27,48,40,50),
+(6,7,25,48,27,49,41,51),
+(6,7,26,49,28,50,42,53),
+(6,7,27,51,28,52,43,54),
+(6,7,28,52,29,53,44,55),
+(6,7,29,53,29,54,45,57),
+(6,7,30,54,30,55,47,58),
+(6,7,31,55,31,57,48,59),
+(6,7,32,56,31,58,49,61),
+(6,7,33,57,32,59,50,62),
+(6,7,34,58,33,61,51,64),
+(6,7,35,60,33,62,53,65),
+(6,7,36,61,34,63,54,66),
+(6,7,37,62,34,65,55,68),
+(6,7,38,63,35,66,57,69),
+(6,7,39,64,36,67,58,71),
+(6,7,40,66,36,69,59,72),
+(6,7,41,67,37,70,60,74),
+(6,7,42,68,38,72,62,75),
+(6,7,43,69,38,73,63,77),
+(6,7,44,70,39,74,64,78),
+(6,7,45,72,40,76,66,80),
+(6,7,46,73,41,77,67,81),
+(6,7,47,74,41,79,69,83),
+(6,7,48,76,42,80,70,84),
+(6,7,49,77,43,82,71,86),
+(6,7,50,78,43,83,73,88),
+(6,7,51,80,44,85,74,89),
+(6,7,52,81,45,86,76,91),
+(6,7,53,82,46,88,77,92),
+(6,7,54,84,46,90,78,94),
+(6,7,55,85,47,91,80,96),
+(6,7,56,86,48,93,81,97),
+(6,7,57,88,49,94,83,99),
+(6,7,58,89,49,96,84,101),
+(6,7,59,91,50,97,86,102),
+(6,7,60,92,51,99,87,104),
+(6,7,61,94,52,101,89,106),
+(6,7,62,95,52,102,90,108),
+(6,7,63,96,53,104,92,109),
+(6,7,64,98,54,106,93,111),
+(6,7,65,99,55,107,95,113),
+(6,7,66,101,56,109,97,115),
+(6,7,67,102,57,111,98,117),
+(6,7,68,104,57,113,100,118),
+(6,7,69,105,58,114,101,120),
+(6,7,70,107,59,116,103,122),
+(6,7,71,108,60,118,113,124),
+(6,7,72,110,61,120,117,127),
+(6,7,73,112,62,122,119,129),
+(6,7,74,114,63,125,122,131),
+(6,7,75,116,64,127,124,133),
+(6,7,76,118,65,129,126,136),
+(6,7,77,119,66,131,128,138),
+(6,7,78,121,67,133,130,140),
+(6,7,79,123,68,136,133,143),
+(6,7,80,125,69,138,135,145),
+(6,11,1,26,15,22,17,24),
+(6,11,2,27,16,23,18,25),
+(6,11,3,27,16,23,19,26),
+(6,11,4,28,17,24,20,27),
+(6,11,5,28,17,25,21,29),
+(6,11,6,29,18,25,22,30),
+(6,11,7,29,18,26,23,31),
+(6,11,8,30,19,27,24,32),
+(6,11,9,30,19,27,26,34),
+(6,11,10,31,20,28,27,35),
+(6,11,11,32,20,29,28,36),
+(6,11,12,32,21,29,29,37),
+(6,11,13,33,21,30,30,39),
+(6,11,14,33,22,31,31,40),
+(6,11,15,34,23,32,32,41),
+(6,11,16,35,23,32,34,43),
+(6,11,17,35,24,33,35,44),
+(6,11,18,36,24,34,36,45),
+(6,11,19,37,25,35,37,47),
+(6,11,20,37,26,35,39,48),
+(6,11,21,38,26,36,40,50),
+(6,11,22,39,27,37,41,51),
+(6,11,23,39,28,38,42,52),
+(6,11,24,40,28,39,44,54),
+(6,11,25,41,29,39,45,55),
+(6,11,26,41,30,40,46,57),
+(6,11,27,42,30,41,47,58),
+(6,11,28,43,31,42,49,60),
+(6,11,29,44,32,43,50,61),
+(6,11,30,44,32,44,52,63),
+(6,11,31,45,33,44,53,64),
+(6,11,32,46,34,45,54,66),
+(6,11,33,47,34,46,56,67),
+(6,11,34,47,35,47,57,69),
+(6,11,35,48,36,48,58,71),
+(6,11,36,49,36,49,60,72),
+(6,11,37,50,37,50,61,74),
+(6,11,38,51,38,51,63,76),
+(6,11,39,52,39,52,64,77),
+(6,11,40,52,39,53,66,79),
+(6,11,41,53,40,54,67,81),
+(6,11,42,54,41,55,69,82),
+(6,11,43,55,42,56,70,84),
+(6,11,44,56,43,57,72,86),
+(6,11,45,57,43,57,73,87),
+(6,11,46,57,44,58,75,89),
+(6,11,47,58,45,60,76,91),
+(6,11,48,59,46,61,78,93),
+(6,11,49,60,47,62,79,94),
+(6,11,50,61,47,63,81,96),
+(6,11,51,62,48,64,83,98),
+(6,11,52,63,49,65,84,100),
+(6,11,53,64,50,66,86,102),
+(6,11,54,65,51,67,87,104),
+(6,11,55,66,51,68,89,105),
+(6,11,56,67,52,69,91,107),
+(6,11,57,68,53,70,92,109),
+(6,11,58,69,54,71,94,111),
+(6,11,59,70,55,72,96,113),
+(6,11,60,71,56,73,97,115),
+(6,11,61,72,57,74,99,117),
+(6,11,62,73,58,76,101,119),
+(6,11,63,74,59,77,103,121),
+(6,11,64,75,59,78,104,123),
+(6,11,65,76,60,79,106,125),
+(6,11,66,77,61,80,108,127),
+(6,11,67,78,62,81,110,129),
+(6,11,68,79,63,83,111,131),
+(6,11,69,80,64,84,113,133),
+(6,11,70,81,65,85,115,135),
+(6,11,71,83,66,86,117,137),
+(6,11,72,84,68,88,120,140),
+(6,11,73,85,69,89,122,142),
+(6,11,74,86,70,91,124,145),
+(6,11,75,88,71,92,126,147),
+(6,11,76,89,72,94,128,150),
+(6,11,77,90,73,95,131,153),
+(6,11,78,92,75,97,133,155),
+(6,11,79,93,76,98,136,158),
+(6,11,80,94,77,100,138,185),
+(7,1,1,18,23,21,24,20),
+(7,1,2,19,24,22,24,20),
+(7,1,3,21,25,23,24,21),
+(7,1,4,22,25,25,24,21),
+(7,1,5,23,26,26,24,21),
+(7,1,6,25,27,27,24,21),
+(7,1,7,26,28,28,24,22),
+(7,1,8,27,29,29,25,22),
+(7,1,9,29,29,31,25,22),
+(7,1,10,30,30,32,25,23),
+(7,1,11,32,31,33,25,23),
+(7,1,12,33,32,34,25,23),
+(7,1,13,34,33,36,25,24),
+(7,1,14,36,34,37,25,24),
+(7,1,15,37,35,38,25,24),
+(7,1,16,39,36,40,25,25),
+(7,1,17,40,36,41,25,25),
+(7,1,18,42,37,43,26,25),
+(7,1,19,43,38,44,26,26),
+(7,1,20,45,39,45,26,26),
+(7,1,21,47,40,47,26,26),
+(7,1,22,48,41,48,26,27),
+(7,1,23,50,42,50,26,27),
+(7,1,24,51,43,51,26,28),
+(7,1,25,53,44,52,27,28),
+(7,1,26,55,45,54,27,28),
+(7,1,27,56,46,55,27,29),
+(7,1,28,58,47,57,27,29),
+(7,1,29,59,48,58,27,30),
+(7,1,30,61,49,60,27,30),
+(7,1,31,63,50,62,27,30),
+(7,1,32,65,51,63,28,31),
+(7,1,33,66,52,65,28,31),
+(7,1,34,68,53,66,28,32),
+(7,1,35,70,55,68,28,32),
+(7,1,36,72,56,69,28,33),
+(7,1,37,73,57,71,29,33),
+(7,1,38,75,58,73,29,34),
+(7,1,39,77,59,74,29,34),
+(7,1,40,79,60,76,29,35),
+(7,1,41,81,61,78,29,35),
+(7,1,42,82,62,79,30,35),
+(7,1,43,84,64,81,30,36),
+(7,1,44,86,65,83,30,36),
+(7,1,45,88,66,85,30,37),
+(7,1,46,90,67,86,30,37),
+(7,1,47,92,68,88,31,38),
+(7,1,48,94,70,90,31,38),
+(7,1,49,96,71,92,31,39),
+(7,1,50,98,72,93,31,40),
+(7,1,51,100,73,95,32,40),
+(7,1,52,102,75,97,32,41),
+(7,1,53,104,76,99,32,41),
+(7,1,54,106,77,101,32,42),
+(7,1,55,108,78,103,33,42),
+(7,1,56,110,80,104,33,43),
+(7,1,57,112,81,106,33,43),
+(7,1,58,114,82,108,33,44),
+(7,1,59,116,84,110,34,44),
+(7,1,60,118,85,112,34,45),
+(7,1,61,120,86,114,34,46),
+(7,1,62,122,88,116,35,46),
+(7,1,63,125,89,118,35,47),
+(7,1,64,127,91,120,35,47),
+(7,1,65,129,92,122,35,48),
+(7,1,66,131,93,124,36,49),
+(7,1,67,133,95,126,36,49),
+(7,1,68,136,96,128,36,50),
+(7,1,69,138,98,130,37,50),
+(7,1,70,140,99,132,37,51),
+(7,1,71,143,100,134,37,52),
+(7,1,72,145,102,137,37,53),
+(7,1,73,148,104,139,37,54),
+(7,1,74,151,105,142,38,54),
+(7,1,75,154,107,144,38,55),
+(7,1,76,157,109,147,38,56),
+(7,1,77,163,111,153,39,57),
+(7,1,78,169,112,158,39,57),
+(7,1,79,172,114,161,39,58),
+(7,1,80,175,116,164,40,59),
+(7,4,1,16,26,20,24,20),
+(7,4,2,17,27,21,24,20),
+(7,4,3,18,29,21,24,21),
+(7,4,4,18,30,22,24,21),
+(7,4,5,19,32,23,25,21),
+(7,4,6,20,33,24,25,22),
+(7,4,7,21,35,24,25,22),
+(7,4,8,22,36,25,25,23),
+(7,4,9,22,38,26,25,23),
+(7,4,10,23,39,26,25,23),
+(7,4,11,24,41,27,25,24),
+(7,4,12,25,42,28,26,24),
+(7,4,13,26,44,29,26,25),
+(7,4,14,27,46,30,26,25),
+(7,4,15,28,47,30,26,25),
+(7,4,16,28,49,31,26,26),
+(7,4,17,29,50,32,27,26),
+(7,4,18,30,52,33,27,27),
+(7,4,19,31,54,34,27,27),
+(7,4,20,32,56,35,27,28),
+(7,4,21,33,57,35,27,28),
+(7,4,22,34,59,36,28,29),
+(7,4,23,35,61,37,28,29),
+(7,4,24,36,62,38,28,30),
+(7,4,25,37,64,39,28,30),
+(7,4,26,38,66,40,29,31),
+(7,4,27,39,68,41,29,31),
+(7,4,28,40,70,42,29,32),
+(7,4,29,41,72,43,29,32),
+(7,4,30,42,73,43,29,33),
+(7,4,31,43,75,44,30,33),
+(7,4,32,44,77,45,30,34),
+(7,4,33,45,79,46,30,34),
+(7,4,34,46,81,47,31,35),
+(7,4,35,47,83,48,31,35),
+(7,4,36,48,85,49,31,36),
+(7,4,37,49,87,50,31,36),
+(7,4,38,50,89,51,32,37),
+(7,4,39,51,91,52,32,38),
+(7,4,40,53,93,53,32,38),
+(7,4,41,54,95,54,33,39),
+(7,4,42,55,97,55,33,39),
+(7,4,43,56,99,56,33,40),
+(7,4,44,57,101,57,33,40),
+(7,4,45,58,103,59,34,41),
+(7,4,46,59,105,60,34,42),
+(7,4,47,61,107,61,34,42),
+(7,4,48,62,110,62,35,43),
+(7,4,49,63,112,63,35,44),
+(7,4,50,64,114,64,35,44),
+(7,4,51,65,116,65,36,45),
+(7,4,52,67,118,66,36,45),
+(7,4,53,68,121,67,36,46),
+(7,4,54,69,123,69,37,47),
+(7,4,55,70,125,70,37,47),
+(7,4,56,72,127,71,37,48),
+(7,4,57,73,130,72,38,49),
+(7,4,58,74,132,73,38,49),
+(7,4,59,75,134,74,39,50),
+(7,4,60,77,137,76,39,51),
+(7,4,61,78,139,77,39,51),
+(7,4,62,79,141,78,40,52),
+(7,4,63,81,144,79,40,53),
+(7,4,64,82,146,80,41,54),
+(7,4,65,83,149,82,41,54),
+(7,4,66,85,151,83,41,55),
+(7,4,67,86,154,84,42,56),
+(7,4,68,87,156,85,42,57),
+(7,4,69,89,158,87,43,57),
+(7,4,70,90,161,88,43,58),
+(7,4,71,92,164,89,44,59),
+(7,4,72,94,167,91,45,59),
+(7,4,73,95,170,93,45,60),
+(7,4,74,97,173,94,46,61),
+(7,4,75,99,176,96,46,62),
+(7,4,76,100,179,97,46,63),
+(7,4,77,102,182,102,47,64),
+(7,4,78,104,186,105,47,65),
+(7,4,79,106,189,106,48,66),
+(7,4,80,108,192,108,48,67),
+(7,6,1,18,23,21,24,20),
+(7,6,2,19,24,22,24,20),
+(7,6,3,21,25,23,24,21),
+(7,6,4,22,25,25,24,21),
+(7,6,5,23,26,26,24,21),
+(7,6,6,25,27,27,24,21),
+(7,6,7,26,28,28,24,22),
+(7,6,8,27,29,29,25,22),
+(7,6,9,29,29,31,25,22),
+(7,6,10,30,30,32,25,23),
+(7,6,11,32,31,33,25,23),
+(7,6,12,33,32,34,25,23),
+(7,6,13,34,33,36,25,24),
+(7,6,14,36,34,37,25,24),
+(7,6,15,37,35,38,25,24),
+(7,6,16,39,36,40,25,25),
+(7,6,17,40,36,41,25,25),
+(7,6,18,42,37,43,26,25),
+(7,6,19,43,38,44,26,26),
+(7,6,20,45,39,45,26,26),
+(7,6,21,47,40,47,26,26),
+(7,6,22,48,41,48,26,27),
+(7,6,23,50,42,50,26,27),
+(7,6,24,51,43,51,26,28),
+(7,6,25,53,44,52,27,28),
+(7,6,26,55,45,54,27,28),
+(7,6,27,56,46,55,27,29),
+(7,6,28,58,47,57,27,29),
+(7,6,29,59,48,58,27,30),
+(7,6,30,61,49,60,27,30),
+(7,6,31,63,50,62,27,30),
+(7,6,32,65,51,63,28,31),
+(7,6,33,66,52,65,28,31),
+(7,6,34,68,53,66,28,32),
+(7,6,35,70,55,68,28,32),
+(7,6,36,72,56,69,28,33),
+(7,6,37,73,57,71,29,33),
+(7,6,38,75,58,73,29,34),
+(7,6,39,77,59,74,29,34),
+(7,6,40,79,60,76,29,35),
+(7,6,41,81,61,78,29,35),
+(7,6,42,82,62,79,30,35),
+(7,6,43,84,64,81,30,36),
+(7,6,44,86,65,83,30,36),
+(7,6,45,88,66,85,30,37),
+(7,6,46,90,67,86,30,37),
+(7,6,47,92,68,88,31,38),
+(7,6,48,94,70,90,31,38),
+(7,6,49,96,71,92,31,39),
+(7,6,50,98,72,93,31,40),
+(7,6,51,99,72,93,32,40),
+(7,6,52,100,73,95,32,41),
+(7,6,53,101,74,96,32,41),
+(7,6,54,102,75,97,32,42),
+(7,6,55,103,76,98,33,42),
+(7,6,56,106,78,101,33,43),
+(7,6,57,111,79,103,33,43),
+(7,6,58,113,80,105,34,44),
+(7,6,59,116,82,107,34,44),
+(7,6,60,118,83,109,34,45),
+(7,6,61,120,84,111,34,46),
+(7,6,62,127,86,119,34,46),
+(7,6,63,129,87,122,35,47),
+(7,6,64,132,89,125,35,47),
+(7,6,65,135,90,127,35,48),
+(7,6,66,137,92,130,35,49),
+(7,6,67,138,93,130,36,49),
+(7,6,68,140,95,131,36,50),
+(7,6,69,142,96,131,36,51),
+(7,6,70,145,98,132,36,51),
+(7,6,71,148,100,135,37,52),
+(7,6,72,150,101,137,37,53),
+(7,6,73,153,103,140,37,54),
+(7,6,74,154,105,142,37,54),
+(7,6,75,155,106,145,38,55),
+(7,6,76,158,108,151,38,56),
+(7,6,77,161,110,157,38,57),
+(7,6,78,164,111,162,38,57),
+(7,6,79,167,113,165,39,58),
+(7,6,80,170,115,168,39,59),
+(7,8,1,15,23,19,27,22),
+(7,8,2,15,23,19,28,23),
+(7,8,3,15,23,20,30,25),
+(7,8,4,15,23,20,31,26),
+(7,8,5,15,24,20,32,27),
+(7,8,6,15,24,20,34,29),
+(7,8,7,16,24,21,35,30),
+(7,8,8,16,24,21,37,31),
+(7,8,9,16,24,21,38,33),
+(7,8,10,16,24,22,40,34),
+(7,8,11,16,25,22,41,36),
+(7,8,12,16,25,22,42,37),
+(7,8,13,16,25,23,44,38),
+(7,8,14,16,25,23,45,40),
+(7,8,15,17,25,23,47,41),
+(7,8,16,17,25,24,49,43),
+(7,8,17,17,26,24,50,44),
+(7,8,18,17,26,24,52,46),
+(7,8,19,17,26,25,53,47),
+(7,8,20,17,26,25,55,49),
+(7,8,21,17,26,26,57,51),
+(7,8,22,18,27,26,58,52),
+(7,8,23,18,27,26,60,54),
+(7,8,24,18,27,27,61,55),
+(7,8,25,18,27,27,63,57),
+(7,8,26,18,28,27,65,59),
+(7,8,27,18,28,28,67,60),
+(7,8,28,18,28,28,68,62),
+(7,8,29,19,28,29,70,64),
+(7,8,30,19,29,29,72,65),
+(7,8,31,19,29,30,74,67),
+(7,8,32,19,29,30,75,69),
+(7,8,33,19,29,30,77,70),
+(7,8,34,20,30,31,79,72),
+(7,8,35,20,30,31,81,74),
+(7,8,36,20,30,32,83,76),
+(7,8,37,20,30,32,85,78),
+(7,8,38,20,31,33,86,79),
+(7,8,39,21,31,33,88,81),
+(7,8,40,21,31,34,90,83),
+(7,8,41,21,32,34,92,85),
+(7,8,42,21,32,35,94,87),
+(7,8,43,21,32,35,96,89),
+(7,8,44,22,32,36,98,91),
+(7,8,45,22,33,36,100,92),
+(7,8,46,22,33,37,102,94),
+(7,8,47,22,33,37,104,96),
+(7,8,48,22,34,38,106,98),
+(7,8,49,23,34,38,108,100),
+(7,8,50,23,34,39,110,102),
+(7,8,51,23,35,39,112,104),
+(7,8,52,23,35,40,114,106),
+(7,8,53,24,35,40,117,108),
+(7,8,54,24,36,41,119,110),
+(7,8,55,24,36,41,121,112),
+(7,8,56,24,37,42,123,114),
+(7,8,57,25,37,42,125,117),
+(7,8,58,25,37,43,127,119),
+(7,8,59,25,38,43,130,121),
+(7,8,60,25,38,44,132,123),
+(7,8,61,26,38,45,134,125),
+(7,8,62,26,39,45,136,127),
+(7,8,63,26,39,46,139,129),
+(7,8,64,26,40,46,141,132),
+(7,8,65,27,40,47,143,134),
+(7,8,66,27,40,48,146,136),
+(7,8,67,27,41,48,148,138),
+(7,8,68,27,41,49,150,140),
+(7,8,69,28,42,49,153,143),
+(7,8,70,28,42,50,155,145),
+(7,8,71,28,42,51,168,148),
+(7,8,72,28,43,52,168,151),
+(7,8,73,28,43,53,171,154),
+(7,8,74,29,44,53,174,156),
+(7,8,75,29,44,54,177,159),
+(7,8,76,29,44,55,180,162),
+(7,8,77,30,45,56,183,165),
+(7,8,78,30,45,56,186,168),
+(7,8,79,30,46,57,190,171),
+(7,8,80,31,46,58,193,174),
+(7,9,1,15,23,20,26,22),
+(7,9,2,15,23,21,27,23),
+(7,9,3,16,24,21,28,24),
+(7,9,4,16,24,22,29,25),
+(7,9,5,16,24,22,31,27),
+(7,9,6,17,25,23,32,28),
+(7,9,7,17,25,23,33,29),
+(7,9,8,17,26,24,34,30),
+(7,9,9,17,26,25,36,31),
+(7,9,10,18,26,25,37,33),
+(7,9,11,18,27,26,38,34),
+(7,9,12,18,27,26,39,35),
+(7,9,13,19,28,27,41,36),
+(7,9,14,19,28,28,42,38),
+(7,9,15,20,28,28,43,39),
+(7,9,16,20,29,29,45,40),
+(7,9,17,20,29,30,46,42),
+(7,9,18,21,30,30,47,43),
+(7,9,19,21,30,31,49,44),
+(7,9,20,21,31,32,50,46),
+(7,9,21,22,31,32,51,47),
+(7,9,22,22,31,33,53,49),
+(7,9,23,23,32,34,54,50),
+(7,9,24,23,32,34,56,51),
+(7,9,25,23,33,35,57,53),
+(7,9,26,24,33,36,59,54),
+(7,9,27,24,34,37,60,56),
+(7,9,28,25,34,37,62,57),
+(7,9,29,25,35,38,63,59),
+(7,9,30,25,35,39,65,60),
+(7,9,31,26,36,40,66,62),
+(7,9,32,26,36,40,68,63),
+(7,9,33,27,37,41,69,65),
+(7,9,34,27,38,42,71,66),
+(7,9,35,28,38,43,73,68),
+(7,9,36,28,39,43,74,69),
+(7,9,37,28,39,44,76,71),
+(7,9,38,29,40,45,77,73),
+(7,9,39,29,40,46,79,74),
+(7,9,40,30,41,47,81,76),
+(7,9,41,30,41,48,82,78),
+(7,9,42,31,42,48,84,79),
+(7,9,43,31,43,49,86,81),
+(7,9,44,32,43,50,88,83),
+(7,9,45,32,44,51,89,84),
+(7,9,46,33,44,52,91,86),
+(7,9,47,33,45,53,93,88),
+(7,9,48,34,46,54,95,89),
+(7,9,49,34,46,54,96,91),
+(7,9,50,35,47,55,98,93),
+(7,9,51,35,48,56,100,95),
+(7,9,52,36,48,57,102,97),
+(7,9,53,36,49,58,104,98),
+(7,9,54,37,50,59,105,100),
+(7,9,55,37,50,60,107,102),
+(7,9,56,38,51,61,109,104),
+(7,9,57,38,52,62,111,106),
+(7,9,58,39,52,63,113,108),
+(7,9,59,40,53,64,115,109),
+(7,9,60,40,54,65,117,111),
+(7,9,61,41,54,66,119,113),
+(7,9,62,41,55,67,121,115),
+(7,9,63,42,56,68,123,117),
+(7,9,64,42,57,69,125,119),
+(7,9,65,43,57,70,127,121),
+(7,9,66,44,58,71,129,123),
+(7,9,67,44,59,72,131,125),
+(7,9,68,45,59,73,133,127),
+(7,9,69,45,60,74,135,129),
+(7,9,70,46,61,75,137,131),
+(7,9,71,47,62,84,147,142),
+(7,9,72,48,62,85,148,144),
+(7,9,73,49,63,85,153,147),
+(7,9,74,49,64,88,153,150),
+(7,9,75,50,65,90,155,152),
+(7,9,76,51,66,91,158,155),
+(7,9,77,52,67,92,161,158),
+(7,9,78,52,68,93,163,161),
+(7,9,79,53,69,95,166,164),
+(7,9,80,54,70,96,170,166),
+(8,1,1,24,22,23,16,21),
+(8,1,2,25,23,24,16,21),
+(8,1,3,27,24,25,16,22),
+(8,1,4,28,24,26,16,22),
+(8,1,5,29,25,28,16,22),
+(8,1,6,31,26,29,16,22),
+(8,1,7,32,27,30,17,23),
+(8,1,8,33,28,31,17,23),
+(8,1,9,35,28,33,17,23),
+(8,1,10,36,29,34,17,24),
+(8,1,11,37,30,35,17,24),
+(8,1,12,39,31,36,17,24),
+(8,1,13,40,32,38,17,25),
+(8,1,14,42,33,39,17,25),
+(8,1,15,43,34,40,18,25),
+(8,1,16,45,35,42,18,26),
+(8,1,17,46,35,43,18,26),
+(8,1,18,48,36,44,18,26),
+(8,1,19,49,37,46,18,27),
+(8,1,20,51,38,47,18,27),
+(8,1,21,52,39,49,18,27),
+(8,1,22,54,40,50,18,28),
+(8,1,23,55,41,51,19,28),
+(8,1,24,57,42,53,19,29),
+(8,1,25,59,43,54,19,29),
+(8,1,26,60,44,56,19,29),
+(8,1,27,62,45,57,19,30),
+(8,1,28,63,46,59,19,30),
+(8,1,29,65,47,60,20,31),
+(8,1,30,67,48,62,20,31),
+(8,1,31,69,49,63,20,31),
+(8,1,32,70,50,65,20,32),
+(8,1,33,72,51,67,20,32),
+(8,1,34,74,53,68,20,33),
+(8,1,35,75,54,70,21,33),
+(8,1,36,77,55,71,21,34),
+(8,1,37,79,56,73,21,34),
+(8,1,38,81,57,75,21,35),
+(8,1,39,83,58,76,21,35),
+(8,1,40,84,59,78,22,35),
+(8,1,41,86,60,80,22,36),
+(8,1,42,88,62,81,22,36),
+(8,1,43,90,63,83,22,37),
+(8,1,44,92,64,85,22,37),
+(8,1,45,94,65,86,23,38),
+(8,1,46,96,66,88,23,38),
+(8,1,47,98,67,90,23,39),
+(8,1,48,100,69,92,23,39),
+(8,1,49,102,70,93,24,40),
+(8,1,50,103,71,95,24,40),
+(8,1,51,105,72,97,24,41),
+(8,1,52,107,74,99,24,42),
+(8,1,53,109,75,101,25,42),
+(8,1,54,112,76,103,25,43),
+(8,1,55,114,78,104,25,43),
+(8,1,56,116,79,106,25,44),
+(8,1,57,118,80,108,25,44),
+(8,1,58,120,81,110,26,45),
+(8,1,59,122,83,112,26,45),
+(8,1,60,124,84,114,26,46),
+(8,1,61,126,85,116,27,47),
+(8,1,62,128,87,118,27,47),
+(8,1,63,130,88,120,27,48),
+(8,1,64,133,90,122,27,48),
+(8,1,65,135,91,124,28,49),
+(8,1,66,137,92,126,28,50),
+(8,1,67,139,94,128,28,50),
+(8,1,68,141,95,130,28,51),
+(8,1,69,144,97,132,29,51),
+(8,1,70,146,98,134,29,52),
+(8,1,71,149,99,136,29,53),
+(8,1,72,151,101,139,29,54),
+(8,1,73,154,103,141,29,55),
+(8,1,74,157,104,144,30,55),
+(8,1,75,166,106,151,30,56),
+(8,1,76,172,108,157,30,57),
+(8,1,77,175,110,161,31,58),
+(8,1,78,179,111,163,31,58),
+(8,1,79,182,113,164,31,59),
+(8,1,80,185,115,169,32,60),
+(8,3,1,21,25,22,16,22),
+(8,3,2,21,26,23,17,23),
+(8,3,3,22,28,24,17,23),
+(8,3,4,22,29,25,18,24),
+(8,3,5,23,30,26,18,25),
+(8,3,6,23,32,27,19,25),
+(8,3,7,24,33,28,20,26),
+(8,3,8,24,35,28,20,26),
+(8,3,9,25,36,29,21,27),
+(8,3,10,25,38,30,21,28),
+(8,3,11,25,39,31,22,29),
+(8,3,12,26,41,32,23,29),
+(8,3,13,26,42,33,23,30),
+(8,3,14,27,44,34,24,31),
+(8,3,15,27,45,35,25,31),
+(8,3,16,28,47,36,25,32),
+(8,3,17,28,48,38,26,33),
+(8,3,18,29,50,39,27,34),
+(8,3,19,29,51,40,28,34),
+(8,3,20,30,53,41,28,35),
+(8,3,21,31,55,42,29,36),
+(8,3,22,31,56,43,30,37),
+(8,3,23,32,58,44,30,37),
+(8,3,24,32,60,45,31,38),
+(8,3,25,33,61,46,32,39),
+(8,3,26,33,63,48,33,40),
+(8,3,27,34,65,49,33,41),
+(8,3,28,35,66,50,34,41),
+(8,3,29,35,68,51,35,42),
+(8,3,30,36,70,52,36,43),
+(8,3,31,36,72,53,37,44),
+(8,3,32,37,73,55,37,45),
+(8,3,33,38,75,56,38,46),
+(8,3,34,38,77,57,39,47),
+(8,3,35,39,79,58,40,48),
+(8,3,36,39,81,60,41,48),
+(8,3,37,40,83,61,41,49),
+(8,3,38,41,85,62,42,50),
+(8,3,39,41,86,63,43,51),
+(8,3,40,42,88,65,44,52),
+(8,3,41,43,90,66,45,53),
+(8,3,42,43,92,67,46,54),
+(8,3,43,44,94,69,47,55),
+(8,3,44,45,96,70,47,56),
+(8,3,45,45,98,71,48,57),
+(8,3,46,46,100,73,49,58),
+(8,3,47,47,102,74,50,59),
+(8,3,48,48,104,76,51,60),
+(8,3,49,48,106,77,52,61),
+(8,3,50,49,108,78,53,62),
+(8,3,51,50,110,80,54,63),
+(8,3,52,51,113,81,55,64),
+(8,3,53,51,115,83,56,65),
+(8,3,54,52,117,84,57,66),
+(8,3,55,53,119,86,58,67),
+(8,3,56,54,121,87,59,68),
+(8,3,57,54,123,89,60,69),
+(8,3,58,55,126,90,61,70),
+(8,3,59,56,128,92,62,71),
+(8,3,60,57,130,93,63,73),
+(8,3,61,58,132,95,64,74),
+(8,3,62,58,134,96,65,75),
+(8,3,63,59,137,98,66,76),
+(8,3,64,60,139,99,67,77),
+(8,3,65,61,141,101,68,78),
+(8,3,66,62,144,103,69,79),
+(8,3,67,62,146,104,70,80),
+(8,3,68,63,148,106,71,82),
+(8,3,69,64,151,107,72,83),
+(8,3,70,65,153,109,73,84),
+(8,3,71,66,156,111,74,85),
+(8,3,72,67,159,113,75,86),
+(8,3,73,68,162,115,76,88),
+(8,3,74,69,165,117,78,89),
+(8,3,75,70,174,119,82,91),
+(8,3,76,71,177,121,83,92),
+(8,3,77,72,180,123,85,94),
+(8,3,78,73,184,125,86,95),
+(8,3,79,74,187,127,87,97),
+(8,3,80,75,190,129,89,98),
+(8,4,1,22,25,22,16,21),
+(8,4,2,23,26,23,16,21),
+(8,4,3,24,28,23,16,22),
+(8,4,4,24,29,24,16,22),
+(8,4,5,25,31,25,17,22),
+(8,4,6,26,32,25,17,23),
+(8,4,7,27,34,26,17,23),
+(8,4,8,27,35,27,17,24),
+(8,4,9,28,37,28,17,24),
+(8,4,10,29,38,28,18,24),
+(8,4,11,30,40,29,18,25),
+(8,4,12,31,41,30,18,25),
+(8,4,13,32,43,31,18,26),
+(8,4,14,32,45,32,18,26),
+(8,4,15,33,46,32,19,26),
+(8,4,16,34,48,33,19,27),
+(8,4,17,35,50,34,19,27),
+(8,4,18,36,51,35,19,28),
+(8,4,19,37,53,36,19,28),
+(8,4,20,38,55,36,20,29),
+(8,4,21,39,56,37,20,29),
+(8,4,22,40,58,38,20,30),
+(8,4,23,41,60,39,20,30),
+(8,4,24,42,62,40,20,31),
+(8,4,25,43,63,41,21,31),
+(8,4,26,44,65,42,21,32),
+(8,4,27,45,67,43,21,32),
+(8,4,28,46,69,44,21,33),
+(8,4,29,47,71,44,22,33),
+(8,4,30,48,72,45,22,34),
+(8,4,31,49,74,46,22,34),
+(8,4,32,50,76,47,22,35),
+(8,4,33,51,78,48,23,35),
+(8,4,34,52,80,49,23,36),
+(8,4,35,53,82,50,23,36),
+(8,4,36,54,84,51,24,37),
+(8,4,37,55,86,52,24,37),
+(8,4,38,56,88,53,24,38),
+(8,4,39,57,90,54,24,38),
+(8,4,40,58,92,55,25,39),
+(8,4,41,59,94,56,25,40),
+(8,4,42,60,96,57,25,40),
+(8,4,43,62,98,58,26,41),
+(8,4,44,63,100,59,26,41),
+(8,4,45,64,102,60,26,42),
+(8,4,46,65,104,61,27,43),
+(8,4,47,66,107,63,27,43),
+(8,4,48,67,109,64,27,44),
+(8,4,49,69,111,65,27,44),
+(8,4,50,70,113,66,28,45),
+(8,4,51,71,115,67,28,46),
+(8,4,52,72,117,68,28,46),
+(8,4,53,74,120,69,29,47),
+(8,4,54,75,122,70,29,48),
+(8,4,55,76,124,72,29,48),
+(8,4,56,77,126,73,30,49),
+(8,4,57,79,129,74,30,50),
+(8,4,58,80,131,75,30,50),
+(8,4,59,81,133,76,31,51),
+(8,4,60,82,136,77,31,52),
+(8,4,61,84,138,79,32,52),
+(8,4,62,85,140,80,32,53),
+(8,4,63,86,143,81,32,54),
+(8,4,64,88,145,82,33,55),
+(8,4,65,89,148,84,33,55),
+(8,4,66,90,150,85,33,56),
+(8,4,67,92,153,86,34,57),
+(8,4,68,93,155,87,34,58),
+(8,4,69,95,157,89,35,58),
+(8,4,70,96,160,90,35,59),
+(8,4,71,98,163,94,35,60),
+(8,4,72,100,166,96,36,60),
+(8,4,73,101,169,96,36,61),
+(8,4,74,103,172,97,37,62),
+(8,4,75,105,175,98,37,63),
+(8,4,76,106,178,99,37,64),
+(8,4,77,108,181,105,38,65),
+(8,4,78,110,185,107,38,66),
+(8,4,79,112,188,109,39,67),
+(8,4,80,114,191,110,39,68),
+(8,5,1,21,22,21,18,24),
+(8,5,2,21,22,21,19,25),
+(8,5,3,21,22,22,21,27),
+(8,5,4,21,23,22,22,28),
+(8,5,5,22,23,22,23,29),
+(8,5,6,22,23,23,25,31),
+(8,5,7,22,23,23,26,32),
+(8,5,8,22,24,24,27,34),
+(8,5,9,22,24,24,29,35),
+(8,5,10,22,24,24,30,37),
+(8,5,11,23,24,25,32,38),
+(8,5,12,23,24,25,33,40),
+(8,5,13,23,25,26,35,41),
+(8,5,14,23,25,26,36,43),
+(8,5,15,23,25,26,38,44),
+(8,5,16,24,26,27,39,46),
+(8,5,17,24,26,27,41,47),
+(8,5,18,24,26,28,42,49),
+(8,5,19,24,26,28,44,50),
+(8,5,20,24,27,29,45,52),
+(8,5,21,25,27,29,47,54),
+(8,5,22,25,27,30,48,55),
+(8,5,23,25,28,30,50,57),
+(8,5,24,25,28,31,52,59),
+(8,5,25,25,28,31,53,60),
+(8,5,26,26,28,32,55,62),
+(8,5,27,26,29,32,56,64),
+(8,5,28,26,29,33,58,65),
+(8,5,29,26,29,33,60,67),
+(8,5,30,27,30,34,62,69),
+(8,5,31,27,30,34,63,71),
+(8,5,32,27,30,35,65,73),
+(8,5,33,27,31,35,67,74),
+(8,5,34,28,31,36,68,76),
+(8,5,35,28,32,36,70,78),
+(8,5,36,28,32,37,72,80),
+(8,5,37,29,32,37,74,82),
+(8,5,38,29,33,38,76,84),
+(8,5,39,29,33,38,77,86),
+(8,5,40,29,33,39,79,87),
+(8,5,41,30,34,40,81,89),
+(8,5,42,30,34,40,83,91),
+(8,5,43,30,35,41,85,93),
+(8,5,44,31,35,41,87,95),
+(8,5,45,31,35,42,89,97),
+(8,5,46,31,36,43,91,99),
+(8,5,47,32,36,43,93,101),
+(8,5,48,32,37,44,94,103),
+(8,5,49,32,37,44,96,105),
+(8,5,50,33,37,45,98,107),
+(8,5,51,33,38,46,100,110),
+(8,5,52,33,38,46,102,112),
+(8,5,53,34,39,47,104,114),
+(8,5,54,34,39,48,106,116),
+(8,5,55,34,40,48,109,118),
+(8,5,56,35,40,49,111,120),
+(8,5,57,35,41,50,113,122),
+(8,5,58,35,41,50,115,125),
+(8,5,59,36,42,51,117,127),
+(8,5,60,36,42,52,119,129),
+(8,5,61,36,42,52,121,131),
+(8,5,62,37,43,53,123,133),
+(8,5,63,37,43,54,125,136),
+(8,5,64,38,44,55,128,138),
+(8,5,65,38,44,55,130,140),
+(8,5,66,38,45,56,132,143),
+(8,5,67,39,45,57,134,145),
+(8,5,68,39,46,58,136,147),
+(8,5,69,40,46,58,139,150),
+(8,5,70,40,47,59,141,152),
+(8,5,71,40,48,60,144,155),
+(8,5,72,41,48,60,147,158),
+(8,5,73,41,49,61,150,161),
+(8,5,74,42,49,62,152,164),
+(8,5,75,42,50,63,155,167),
+(8,5,76,42,51,64,158,170),
+(8,5,77,43,51,65,161,173),
+(8,5,78,43,52,66,164,176),
+(8,5,79,44,52,67,167,179),
+(8,5,80,44,53,68,170,182),
+(8,6,1,24,22,23,16,21),
+(8,6,2,25,23,24,16,21),
+(8,6,3,27,24,25,16,22),
+(8,6,4,28,24,26,16,22),
+(8,6,5,29,25,28,16,22),
+(8,6,6,31,26,29,16,22),
+(8,6,7,32,27,30,17,23),
+(8,6,8,33,28,31,17,23),
+(8,6,9,35,28,33,17,23),
+(8,6,10,36,29,34,17,24),
+(8,6,11,37,30,35,17,24),
+(8,6,12,39,31,36,17,24),
+(8,6,13,40,32,38,17,25),
+(8,6,14,42,33,39,17,25),
+(8,6,15,43,34,40,18,25),
+(8,6,16,45,35,42,18,26),
+(8,6,17,46,35,43,18,26),
+(8,6,18,48,36,44,18,26),
+(8,6,19,49,37,46,18,27),
+(8,6,20,51,38,47,18,27),
+(8,6,21,52,39,49,18,27),
+(8,6,22,54,40,50,18,28),
+(8,6,23,55,41,51,19,28),
+(8,6,24,57,42,53,19,29),
+(8,6,25,59,43,54,19,29),
+(8,6,26,60,44,56,19,29),
+(8,6,27,62,45,57,19,30),
+(8,6,28,63,46,59,19,30),
+(8,6,29,65,47,60,20,31),
+(8,6,30,67,48,62,20,31),
+(8,6,31,69,49,63,20,31),
+(8,6,32,70,50,65,20,32),
+(8,6,33,72,51,67,20,32),
+(8,6,34,74,53,68,20,33),
+(8,6,35,75,54,70,21,33),
+(8,6,36,77,55,71,21,34),
+(8,6,37,79,56,73,21,34),
+(8,6,38,81,57,75,21,35),
+(8,6,39,83,58,76,21,35),
+(8,6,40,84,59,78,22,35),
+(8,6,41,86,60,80,22,36),
+(8,6,42,88,62,81,22,36),
+(8,6,43,90,63,83,22,37),
+(8,6,44,92,64,85,22,37),
+(8,6,45,94,65,86,23,38),
+(8,6,46,96,66,88,23,38),
+(8,6,47,98,67,90,23,39),
+(8,6,48,100,69,92,23,39),
+(8,6,49,102,70,93,24,40),
+(8,6,50,103,71,95,24,40),
+(8,6,51,105,72,96,24,41),
+(8,6,52,106,74,97,24,42),
+(8,6,53,107,73,98,25,42),
+(8,6,54,108,74,99,25,43),
+(8,6,55,109,75,100,25,43),
+(8,6,56,112,77,103,25,44),
+(8,6,57,114,78,105,25,44),
+(8,6,58,118,79,107,26,45),
+(8,6,59,119,81,109,26,45),
+(8,6,60,121,82,111,26,46),
+(8,6,61,123,83,113,26,47),
+(8,6,62,126,85,115,26,47),
+(8,6,63,128,86,118,27,48),
+(8,6,64,131,88,120,27,48),
+(8,6,65,138,89,122,27,49),
+(8,6,66,140,91,125,27,50),
+(8,6,67,143,92,127,28,50),
+(8,6,68,145,94,129,28,51),
+(8,6,69,148,95,132,28,52),
+(8,6,70,151,97,134,28,52),
+(8,6,71,154,99,137,29,53),
+(8,6,72,156,100,139,29,54),
+(8,6,73,159,102,142,29,55),
+(8,6,74,162,104,144,29,55),
+(8,6,75,165,105,147,30,56),
+(8,6,76,168,107,150,30,57),
+(8,6,77,169,109,153,30,58),
+(8,6,78,170,110,155,30,58),
+(8,6,79,178,112,158,31,59),
+(8,6,80,181,114,161,31,60),
+(8,7,1,22,22,22,17,23),
+(8,7,2,23,22,23,18,24),
+(8,7,3,24,23,24,19,25),
+(8,7,4,25,23,25,20,26),
+(8,7,5,25,24,26,21,27),
+(8,7,6,26,24,27,22,28),
+(8,7,7,27,25,28,23,29),
+(8,7,8,28,25,29,24,30),
+(8,7,9,29,25,30,25,31),
+(8,7,10,30,26,31,26,33),
+(8,7,11,31,26,32,27,34),
+(8,7,12,32,27,33,28,35),
+(8,7,13,33,27,34,29,36),
+(8,7,14,34,28,35,30,37),
+(8,7,15,34,28,36,31,38),
+(8,7,16,35,29,38,32,39),
+(8,7,17,36,29,39,33,41),
+(8,7,18,37,30,40,34,42),
+(8,7,19,38,30,41,35,43),
+(8,7,20,39,31,42,36,44),
+(8,7,21,40,32,43,37,45),
+(8,7,22,41,32,45,38,47),
+(8,7,23,43,33,46,39,48),
+(8,7,24,44,33,47,40,49),
+(8,7,25,45,34,48,42,51),
+(8,7,26,46,34,49,43,52),
+(8,7,27,47,35,51,44,53),
+(8,7,28,48,35,52,45,54),
+(8,7,29,49,36,53,46,56),
+(8,7,30,50,37,54,48,57),
+(8,7,31,51,37,56,49,59),
+(8,7,32,52,38,57,50,60),
+(8,7,33,53,38,58,51,61),
+(8,7,34,55,39,60,52,63),
+(8,7,35,56,40,61,54,64),
+(8,7,36,57,40,62,55,66),
+(8,7,37,58,41,64,56,67),
+(8,7,38,59,42,65,57,68),
+(8,7,39,61,42,66,59,70),
+(8,7,40,62,43,68,60,71),
+(8,7,41,63,44,69,61,73),
+(8,7,42,64,44,71,63,74),
+(8,7,43,65,45,72,64,76),
+(8,7,44,67,46,74,65,77),
+(8,7,45,68,46,75,67,79),
+(8,7,46,69,47,76,68,80),
+(8,7,47,71,48,78,69,82),
+(8,7,48,72,49,79,71,83),
+(8,7,49,73,49,81,72,85),
+(8,7,50,74,50,82,74,87),
+(8,7,51,76,51,84,75,88),
+(8,7,52,77,51,85,77,90),
+(8,7,53,78,52,87,78,92),
+(8,7,54,80,53,89,79,93),
+(8,7,55,81,54,90,81,95),
+(8,7,56,83,55,92,82,96),
+(8,7,57,84,55,93,84,98),
+(8,7,58,85,56,95,85,100),
+(8,7,59,87,57,97,87,102),
+(8,7,60,88,58,98,88,103),
+(8,7,61,90,58,100,90,105),
+(8,7,62,91,59,101,91,107),
+(8,7,63,93,60,103,93,108),
+(8,7,64,94,61,105,94,110),
+(8,7,65,95,62,106,96,112),
+(8,7,66,97,63,108,98,114),
+(8,7,67,98,63,110,99,116),
+(8,7,68,100,64,112,101,117),
+(8,7,69,101,65,113,102,119),
+(8,7,70,103,66,115,104,121),
+(8,7,71,104,67,117,116,123),
+(8,7,72,106,68,119,118,126),
+(8,7,73,108,69,121,121,128),
+(8,7,74,110,70,124,123,130),
+(8,7,75,112,71,126,125,132),
+(8,7,76,114,72,128,127,135),
+(8,7,77,115,73,130,129,137),
+(8,7,78,117,74,132,132,139),
+(8,7,79,119,75,135,134,142),
+(8,7,80,121,76,137,136,144),
+(8,8,1,21,22,21,19,23),
+(8,8,2,21,22,21,20,24),
+(8,8,3,21,22,22,22,26),
+(8,8,4,21,22,22,23,27),
+(8,8,5,21,23,22,25,28),
+(8,8,6,21,23,22,26,30),
+(8,8,7,21,23,23,27,31),
+(8,8,8,22,23,23,29,32),
+(8,8,9,22,23,23,30,34),
+(8,8,10,22,23,24,32,35),
+(8,8,11,22,24,24,33,37),
+(8,8,12,22,24,24,35,38),
+(8,8,13,22,24,25,36,39),
+(8,8,14,22,24,25,38,41),
+(8,8,15,22,24,25,39,42),
+(8,8,16,22,24,26,41,44),
+(8,8,17,23,25,26,42,45),
+(8,8,18,23,25,26,44,47),
+(8,8,19,23,25,27,46,48),
+(8,8,20,23,25,27,47,50),
+(8,8,21,23,25,27,49,51),
+(8,8,22,23,26,28,51,53),
+(8,8,23,23,26,28,52,55),
+(8,8,24,24,26,29,54,56),
+(8,8,25,24,26,29,56,58),
+(8,8,26,24,27,29,57,60),
+(8,8,27,24,27,30,59,61),
+(8,8,28,24,27,30,61,63),
+(8,8,29,24,27,31,63,65),
+(8,8,30,24,28,31,64,66),
+(8,8,31,25,28,31,66,68),
+(8,8,32,25,28,32,68,70),
+(8,8,33,25,28,32,70,71),
+(8,8,34,25,29,33,71,73),
+(8,8,35,25,29,33,73,75),
+(8,8,36,26,29,34,75,77),
+(8,8,37,26,29,34,77,79),
+(8,8,38,26,30,35,79,80),
+(8,8,39,26,30,35,81,82),
+(8,8,40,26,30,35,83,84),
+(8,8,41,27,31,36,85,86),
+(8,8,42,27,31,36,87,88),
+(8,8,43,27,31,37,89,90),
+(8,8,44,27,32,37,91,91),
+(8,8,45,27,32,38,93,93),
+(8,8,46,28,32,38,95,95),
+(8,8,47,28,32,39,97,97),
+(8,8,48,28,33,39,99,99),
+(8,8,49,28,33,40,101,101),
+(8,8,50,29,33,40,103,103),
+(8,8,51,29,34,41,105,105),
+(8,8,52,29,34,42,107,107),
+(8,8,53,29,35,42,109,109),
+(8,8,54,30,35,43,111,111),
+(8,8,55,30,35,43,113,113),
+(8,8,56,30,36,44,115,115),
+(8,8,57,30,36,44,118,118),
+(8,8,58,31,36,45,120,120),
+(8,8,59,31,37,45,122,122),
+(8,8,60,31,37,46,124,124),
+(8,8,61,31,37,47,126,126),
+(8,8,62,32,38,47,129,128),
+(8,8,63,32,38,48,131,130),
+(8,8,64,32,39,48,133,133),
+(8,8,65,33,39,49,135,135),
+(8,8,66,33,39,50,138,137),
+(8,8,67,33,40,50,140,139),
+(8,8,68,33,40,51,142,141),
+(8,8,69,34,41,51,145,144),
+(8,8,70,34,41,52,147,146),
+(8,8,71,34,41,53,150,149),
+(8,8,72,34,42,54,153,152),
+(8,8,73,34,42,55,156,155),
+(8,8,74,35,43,55,159,157),
+(8,8,75,35,43,56,162,160),
+(8,8,76,35,43,57,168,163),
+(8,8,77,36,44,58,168,166),
+(8,8,78,36,44,58,171,169),
+(8,8,79,36,45,59,177,172),
+(8,8,80,37,45,60,177,175),
+(10,2,1,19,22,21,24,20),
+(10,2,2,20,23,22,25,21),
+(10,2,3,21,23,23,25,21),
+(10,2,4,22,24,24,26,22),
+(10,2,5,23,24,25,27,23),
+(10,2,6,25,25,26,27,24),
+(10,2,7,26,25,27,28,24),
+(10,2,8,27,26,28,29,25),
+(10,2,9,28,27,29,29,26),
+(10,2,10,29,27,31,30,26),
+(10,2,11,30,28,32,31,27),
+(10,2,12,32,29,33,31,28),
+(10,2,13,33,29,34,32,29),
+(10,2,14,34,30,35,33,30),
+(10,2,15,35,31,36,33,30),
+(10,2,16,37,31,37,34,31),
+(10,2,17,38,32,39,35,32),
+(10,2,18,39,33,40,36,33),
+(10,2,19,40,33,41,36,34),
+(10,2,20,42,34,42,37,35),
+(10,2,21,43,35,44,38,35),
+(10,2,22,44,35,45,39,36),
+(10,2,23,46,36,46,40,37),
+(10,2,24,47,37,47,40,38),
+(10,2,25,49,38,49,41,39),
+(10,2,26,50,38,50,42,40),
+(10,2,27,51,39,51,43,41),
+(10,2,28,53,40,53,44,42),
+(10,2,29,54,41,54,45,43),
+(10,2,30,56,41,55,45,43),
+(10,2,31,57,42,57,46,44),
+(10,2,32,58,43,58,47,45),
+(10,2,33,60,44,59,48,46),
+(10,2,34,61,45,61,49,47),
+(10,2,35,63,45,62,50,48),
+(10,2,36,64,46,64,51,49),
+(10,2,37,66,47,65,52,50),
+(10,2,38,67,48,67,53,51),
+(10,2,39,69,49,68,54,52),
+(10,2,40,71,50,69,55,53),
+(10,2,41,72,50,71,55,54),
+(10,2,42,74,51,72,56,55),
+(10,2,43,75,52,74,57,56),
+(10,2,44,77,53,75,58,57),
+(10,2,45,79,54,77,59,59),
+(10,2,46,80,55,78,60,60),
+(10,2,47,82,56,80,61,61),
+(10,2,48,83,57,82,62,62),
+(10,2,49,85,58,83,63,63),
+(10,2,50,87,59,85,64,64),
+(10,2,51,89,60,86,66,65),
+(10,2,52,90,61,88,67,66),
+(10,2,53,92,61,90,68,67),
+(10,2,54,94,62,91,69,69),
+(10,2,55,95,63,93,70,70),
+(10,2,56,97,64,95,71,71),
+(10,2,57,99,65,96,72,72),
+(10,2,58,101,66,98,73,73),
+(10,2,59,102,67,100,74,74),
+(10,2,60,104,68,101,75,76),
+(10,2,61,106,69,103,76,77),
+(10,2,62,108,70,105,78,78),
+(10,2,63,110,72,106,79,79),
+(10,2,64,112,73,108,80,80),
+(10,2,65,113,74,110,81,82),
+(10,2,66,115,75,112,82,83),
+(10,2,67,117,76,114,83,84),
+(10,2,68,119,77,115,85,85),
+(10,2,69,121,78,117,86,87),
+(10,2,70,123,79,119,87,88),
+(10,2,71,125,80,120,88,89),
+(10,2,72,128,81,123,90,91),
+(10,2,73,130,82,125,91,93),
+(10,2,74,133,84,127,93,94),
+(10,2,75,135,85,129,94,96),
+(10,2,76,137,86,132,96,97),
+(10,2,77,140,88,134,97,99),
+(10,2,78,143,89,136,99,101),
+(10,2,79,145,90,139,100,102),
+(10,2,80,148,92,141,102,104),
+(10,3,1,17,25,20,24,20),
+(10,3,2,17,26,21,25,21),
+(10,3,3,18,28,22,25,21),
+(10,3,4,18,29,23,26,22),
+(10,3,5,19,30,24,26,23),
+(10,3,6,19,32,25,27,23),
+(10,3,7,20,33,26,27,24),
+(10,3,8,20,35,27,28,25),
+(10,3,9,21,36,27,29,25),
+(10,3,10,21,38,28,29,26),
+(10,3,11,22,39,29,30,27),
+(10,3,12,22,41,30,31,27),
+(10,3,13,23,42,31,31,28),
+(10,3,14,23,44,32,32,29),
+(10,3,15,24,45,34,32,29),
+(10,3,16,24,47,35,33,30),
+(10,3,17,25,48,36,34,31),
+(10,3,18,25,50,37,34,32),
+(10,3,19,26,51,38,35,32),
+(10,3,20,26,53,39,36,33),
+(10,3,21,27,55,40,37,34),
+(10,3,22,27,56,41,37,35),
+(10,3,23,28,58,42,38,36),
+(10,3,24,28,60,43,39,36),
+(10,3,25,29,61,44,39,37),
+(10,3,26,30,63,46,40,38),
+(10,3,27,30,65,47,41,39),
+(10,3,28,31,66,48,42,40),
+(10,3,29,31,68,49,42,40),
+(10,3,30,32,70,50,43,41),
+(10,3,31,33,72,52,44,42),
+(10,3,32,33,73,53,45,43),
+(10,3,33,34,75,54,46,44),
+(10,3,34,34,77,55,46,45),
+(10,3,35,35,79,57,47,46),
+(10,3,36,36,81,58,48,47),
+(10,3,37,36,83,59,49,47),
+(10,3,38,37,85,60,50,48),
+(10,3,39,38,86,62,51,49),
+(10,3,40,38,88,63,51,50),
+(10,3,41,39,90,64,52,51),
+(10,3,42,40,92,66,53,52),
+(10,3,43,40,94,67,54,53),
+(10,3,44,41,96,68,55,54),
+(10,3,45,42,98,70,56,55),
+(10,3,46,42,100,71,57,56),
+(10,3,47,43,102,72,58,57),
+(10,3,48,44,104,74,59,58),
+(10,3,49,45,106,75,60,59),
+(10,3,50,45,108,77,61,60),
+(10,3,51,46,110,78,61,61),
+(10,3,52,47,113,79,62,62),
+(10,3,53,47,115,81,63,63),
+(10,3,54,48,117,82,64,64),
+(10,3,55,49,119,84,65,65),
+(10,3,56,50,121,85,66,66),
+(10,3,57,50,123,87,67,67),
+(10,3,58,51,126,88,68,68),
+(10,3,59,52,128,90,69,70),
+(10,3,60,53,130,91,70,71),
+(10,3,61,54,132,93,71,72),
+(10,3,62,54,134,94,72,73),
+(10,3,63,55,137,96,73,74),
+(10,3,64,56,139,97,75,75),
+(10,3,65,57,141,99,76,76),
+(10,3,66,58,144,101,77,77),
+(10,3,67,58,146,102,78,78),
+(10,3,68,59,148,104,79,80),
+(10,3,69,60,151,105,80,81),
+(10,3,70,61,153,107,81,82),
+(10,3,71,62,156,108,82,83),
+(10,3,72,63,159,110,83,84),
+(10,3,73,64,162,112,84,86),
+(10,3,74,65,165,114,86,87),
+(10,3,75,66,168,116,87,89),
+(10,3,76,67,171,118,89,90),
+(10,3,77,68,174,120,90,92),
+(10,3,78,69,177,122,91,93),
+(10,3,79,70,180,124,92,95),
+(10,3,80,71,183,126,94,96),
+(10,4,1,18,25,20,24,19),
+(10,4,2,19,26,21,24,19),
+(10,4,3,20,28,21,24,20),
+(10,4,4,20,29,22,24,20),
+(10,4,5,21,31,23,25,20),
+(10,4,6,22,32,24,25,21),
+(10,4,7,23,34,24,25,21),
+(10,4,8,24,35,25,25,22),
+(10,4,9,24,37,26,25,22),
+(10,4,10,25,38,26,25,22),
+(10,4,11,26,40,27,25,23),
+(10,4,12,27,41,28,26,23),
+(10,4,13,28,43,29,26,24),
+(10,4,14,29,45,30,26,24),
+(10,4,15,29,46,30,26,25),
+(10,4,16,30,48,31,26,25),
+(10,4,17,31,50,32,27,25),
+(10,4,18,32,51,33,27,26),
+(10,4,19,33,53,34,27,26),
+(10,4,20,34,55,35,27,27),
+(10,4,21,35,56,35,27,27),
+(10,4,22,36,58,36,28,28),
+(10,4,23,37,60,37,28,28),
+(10,4,24,38,62,38,28,29),
+(10,4,25,39,63,39,28,29),
+(10,4,26,40,65,40,29,30),
+(10,4,27,41,67,41,29,30),
+(10,4,28,42,69,42,29,31),
+(10,4,29,43,71,43,29,31),
+(10,4,30,44,72,43,29,32),
+(10,4,31,45,74,44,30,32),
+(10,4,32,46,76,45,30,33),
+(10,4,33,47,78,46,30,33),
+(10,4,34,48,80,47,31,34),
+(10,4,35,49,82,48,31,34),
+(10,4,36,50,84,49,31,35),
+(10,4,37,51,86,50,31,35),
+(10,4,38,52,88,51,32,36),
+(10,4,39,53,90,52,32,37),
+(10,4,40,54,92,53,32,37),
+(10,4,41,56,94,54,33,38),
+(10,4,42,57,96,55,33,38),
+(10,4,43,58,98,56,33,39),
+(10,4,44,59,100,57,33,39),
+(10,4,45,60,102,59,34,40),
+(10,4,46,61,104,60,34,41),
+(10,4,47,62,107,61,34,41),
+(10,4,48,64,109,62,35,42),
+(10,4,49,65,111,63,35,43),
+(10,4,50,66,113,64,35,43),
+(10,4,51,67,115,65,36,44),
+(10,4,52,68,117,66,36,44),
+(10,4,53,70,120,67,36,45),
+(10,4,54,71,122,69,37,46),
+(10,4,55,72,124,70,37,46),
+(10,4,56,73,126,71,37,47),
+(10,4,57,75,129,72,38,48),
+(10,4,58,76,131,73,38,48),
+(10,4,59,77,133,74,39,49),
+(10,4,60,79,136,76,39,50),
+(10,4,61,80,138,77,39,51),
+(10,4,62,81,140,78,40,51),
+(10,4,63,82,143,79,40,52),
+(10,4,64,84,145,80,41,53),
+(10,4,65,85,148,82,41,53),
+(10,4,66,87,150,83,41,54),
+(10,4,67,88,153,84,42,55),
+(10,4,68,89,155,85,42,56),
+(10,4,69,91,157,87,43,56),
+(10,4,70,92,160,88,43,57),
+(10,4,71,94,163,88,43,58),
+(10,4,72,96,166,90,44,58),
+(10,4,73,97,169,92,44,59),
+(10,4,74,99,172,93,45,60),
+(10,4,75,101,175,95,45,61),
+(10,4,76,102,178,96,45,62),
+(10,4,77,104,181,101,46,63),
+(10,4,78,106,185,104,46,64),
+(10,4,79,108,188,105,47,65),
+(10,4,80,110,191,107,47,66),
+(10,5,1,17,22,19,26,22),
+(10,5,2,17,22,19,27,23),
+(10,5,3,17,22,20,29,25),
+(10,5,4,17,23,20,30,26),
+(10,5,5,18,23,20,31,27),
+(10,5,6,18,23,21,33,29),
+(10,5,7,18,23,21,34,30),
+(10,5,8,18,24,22,35,32),
+(10,5,9,18,24,22,37,33),
+(10,5,10,19,24,22,38,35),
+(10,5,11,19,24,23,39,36),
+(10,5,12,19,24,23,41,38),
+(10,5,13,19,25,24,42,39),
+(10,5,14,19,25,24,44,41),
+(10,5,15,19,25,25,45,42),
+(10,5,16,20,26,25,47,44),
+(10,5,17,20,26,25,48,45),
+(10,5,18,20,26,26,50,47),
+(10,5,19,20,26,26,51,49),
+(10,5,20,21,27,27,53,50),
+(10,5,21,21,27,27,54,52),
+(10,5,22,21,27,28,56,53),
+(10,5,23,21,28,28,58,55),
+(10,5,24,21,28,29,59,57),
+(10,5,25,22,28,29,61,58),
+(10,5,26,22,28,30,62,60),
+(10,5,27,22,29,30,64,62),
+(10,5,28,22,29,31,66,64),
+(10,5,29,23,29,31,67,65),
+(10,5,30,23,30,32,69,67),
+(10,5,31,23,30,32,71,69),
+(10,5,32,23,30,33,72,71),
+(10,5,33,24,31,33,74,72),
+(10,5,34,24,31,34,76,74),
+(10,5,35,24,32,34,78,76),
+(10,5,36,24,32,35,80,78),
+(10,5,37,25,32,35,81,80),
+(10,5,38,25,33,36,83,82),
+(10,5,39,25,33,37,85,84),
+(10,5,40,26,33,37,87,86),
+(10,5,41,26,34,38,89,88),
+(10,5,42,26,34,38,91,89),
+(10,5,43,27,35,39,92,91),
+(10,5,44,27,35,39,94,93),
+(10,5,45,27,35,40,96,95),
+(10,5,46,27,36,41,98,97),
+(10,5,47,28,36,41,100,99),
+(10,5,48,28,37,42,102,101),
+(10,5,49,28,37,43,104,103),
+(10,5,50,29,37,43,106,106),
+(10,5,51,29,38,44,108,108),
+(10,5,52,29,38,44,110,110),
+(10,5,53,30,39,45,112,112),
+(10,5,54,30,39,46,114,114),
+(10,5,55,30,40,46,116,116),
+(10,5,56,31,40,47,118,118),
+(10,5,57,31,41,48,120,120),
+(10,5,58,31,41,48,123,123),
+(10,5,59,32,42,49,125,125),
+(10,5,60,32,42,50,127,127),
+(10,5,61,33,42,51,129,129),
+(10,5,62,33,43,51,131,131),
+(10,5,63,33,43,52,133,134),
+(10,5,64,34,44,53,135,136),
+(10,5,65,34,44,53,138,138),
+(10,5,66,34,45,54,140,141),
+(10,5,67,35,45,55,142,143),
+(10,5,68,35,46,56,144,145),
+(10,5,69,36,46,56,147,148),
+(10,5,70,36,47,57,149,150),
+(10,5,71,36,48,57,152,153),
+(10,5,72,37,48,57,155,156),
+(10,5,73,37,49,58,158,159),
+(10,5,74,38,49,59,160,163),
+(10,5,75,38,50,60,163,165),
+(10,5,76,38,51,61,166,170),
+(10,5,77,39,51,62,168,175),
+(10,5,78,39,52,63,172,174),
+(10,5,79,40,52,64,175,177),
+(10,5,80,40,53,65,178,180),
+(10,6,1,18,23,21,24,20),
+(10,6,2,19,24,22,24,20),
+(10,6,3,21,25,23,24,21),
+(10,6,4,22,25,25,24,21),
+(10,6,5,23,26,26,24,21),
+(10,6,6,25,27,27,24,21),
+(10,6,7,26,28,28,24,22),
+(10,6,8,27,29,29,25,22),
+(10,6,9,29,29,31,25,22),
+(10,6,10,30,30,32,25,23),
+(10,6,11,32,31,33,25,23),
+(10,6,12,33,32,34,25,23),
+(10,6,13,34,33,36,25,24),
+(10,6,14,36,34,37,25,24),
+(10,6,15,37,35,38,25,24),
+(10,6,16,39,36,40,25,25),
+(10,6,17,40,36,41,25,25),
+(10,6,18,42,37,43,26,25),
+(10,6,19,43,38,44,26,26),
+(10,6,20,45,39,45,26,26),
+(10,6,21,47,40,47,26,26),
+(10,6,22,48,41,48,26,27),
+(10,6,23,50,42,50,26,27),
+(10,6,24,51,43,51,26,28),
+(10,6,25,53,44,52,27,28),
+(10,6,26,55,45,54,27,28),
+(10,6,27,56,46,55,27,29),
+(10,6,28,58,47,57,27,29),
+(10,6,29,59,48,58,27,30),
+(10,6,30,61,49,60,27,30),
+(10,6,31,63,50,62,27,30),
+(10,6,32,65,51,63,28,31),
+(10,6,33,66,52,65,28,31),
+(10,6,34,68,53,66,28,32),
+(10,6,35,70,55,68,28,32),
+(10,6,36,72,56,69,28,33),
+(10,6,37,73,57,71,29,33),
+(10,6,38,75,58,73,29,34),
+(10,6,39,77,59,74,29,34),
+(10,6,40,79,60,76,29,35),
+(10,6,41,81,61,78,29,35),
+(10,6,42,82,62,79,30,35),
+(10,6,43,84,64,81,30,36),
+(10,6,44,86,65,83,30,36),
+(10,6,45,88,66,85,30,37),
+(10,6,46,90,67,86,30,37),
+(10,6,47,92,68,88,31,38),
+(10,6,48,94,69,90,31,38),
+(10,6,49,96,69,92,31,39),
+(10,6,50,98,70,93,31,40),
+(10,6,51,100,71,95,32,40),
+(10,6,52,102,72,96,32,41),
+(10,6,53,103,73,97,32,41),
+(10,6,54,104,74,98,32,41),
+(10,6,55,105,75,97,33,41),
+(10,6,56,108,77,100,33,42),
+(10,6,57,113,78,102,33,42),
+(10,6,58,115,79,104,34,43),
+(10,6,59,117,81,106,34,43),
+(10,6,60,118,82,108,34,44),
+(10,6,61,119,83,110,34,45),
+(10,6,62,121,85,112,34,45),
+(10,6,63,124,86,115,35,46),
+(10,6,64,127,88,117,35,46),
+(10,6,65,133,89,119,35,47),
+(10,6,66,135,91,122,35,48),
+(10,6,67,139,92,124,36,48),
+(10,6,68,141,94,126,36,49),
+(10,6,69,142,95,129,36,50),
+(10,6,70,145,97,131,36,50),
+(10,6,71,150,99,134,37,51),
+(10,6,72,152,100,136,37,52),
+(10,6,73,155,102,139,37,53),
+(10,6,74,158,104,141,37,53),
+(10,6,75,159,105,144,38,54),
+(10,6,76,160,107,147,38,55),
+(10,6,77,163,109,149,38,56),
+(10,6,78,166,110,152,38,56),
+(10,6,79,169,112,155,39,57),
+(10,6,80,172,114,158,39,58),
+(10,8,1,17,22,19,27,21),
+(10,8,2,17,22,19,28,22),
+(10,8,3,17,22,20,30,24),
+(10,8,4,17,22,20,31,25),
+(10,8,5,17,23,20,32,26),
+(10,8,6,17,23,20,34,28),
+(10,8,7,18,23,21,35,29),
+(10,8,8,18,23,21,37,30),
+(10,8,9,18,23,21,38,32),
+(10,8,10,18,23,22,40,33),
+(10,8,11,18,24,22,41,35),
+(10,8,12,18,24,22,42,36),
+(10,8,13,18,24,23,44,37),
+(10,8,14,18,24,23,45,39),
+(10,8,15,18,24,23,47,40),
+(10,8,16,19,24,24,49,42),
+(10,8,17,19,25,24,50,43),
+(10,8,18,19,25,24,52,45),
+(10,8,19,19,25,25,53,46),
+(10,8,20,19,25,25,55,48),
+(10,8,21,19,25,26,57,50),
+(10,8,22,19,26,26,58,51),
+(10,8,23,20,26,26,60,53),
+(10,8,24,20,26,27,61,54),
+(10,8,25,20,26,27,63,56),
+(10,8,26,20,27,27,65,58),
+(10,8,27,20,27,28,67,59),
+(10,8,28,20,27,28,68,61),
+(10,8,29,21,27,29,70,63),
+(10,8,30,21,28,29,72,64),
+(10,8,31,21,28,30,74,66),
+(10,8,32,21,28,30,75,68),
+(10,8,33,21,28,30,77,70),
+(10,8,34,21,29,31,79,71),
+(10,8,35,22,29,31,81,73),
+(10,8,36,22,29,32,83,75),
+(10,8,37,22,29,32,85,77),
+(10,8,38,22,30,33,86,78),
+(10,8,39,22,30,33,88,80),
+(10,8,40,23,30,34,90,82),
+(10,8,41,23,31,34,92,84),
+(10,8,42,23,31,35,94,86),
+(10,8,43,23,31,35,96,88),
+(10,8,44,23,32,36,98,90),
+(10,8,45,24,32,36,100,92),
+(10,8,46,24,32,37,102,93),
+(10,8,47,24,32,37,104,95),
+(10,8,48,24,33,38,106,97),
+(10,8,49,25,33,38,108,99),
+(10,8,50,25,33,39,110,101),
+(10,8,51,25,34,39,112,103),
+(10,8,52,25,34,40,114,105),
+(10,8,53,25,35,40,117,107),
+(10,8,54,26,35,41,119,109),
+(10,8,55,26,35,41,121,111),
+(10,8,56,26,36,42,123,113),
+(10,8,57,26,36,42,125,116),
+(10,8,58,27,36,43,127,118),
+(10,8,59,27,37,43,130,120),
+(10,8,60,27,37,44,132,122),
+(10,8,61,27,37,45,134,124),
+(10,8,62,28,38,45,136,126),
+(10,8,63,28,38,46,139,128),
+(10,8,64,28,39,46,141,131),
+(10,8,65,29,39,47,143,133),
+(10,8,66,29,39,48,146,135),
+(10,8,67,29,40,48,148,137),
+(10,8,68,29,40,49,150,139),
+(10,8,69,30,41,49,153,142),
+(10,8,70,30,41,50,155,144),
+(10,8,71,30,41,50,158,147),
+(10,8,72,30,42,51,161,150),
+(10,8,73,30,42,52,164,153),
+(10,8,74,31,43,52,167,155),
+(10,8,75,31,43,53,170,158),
+(10,8,76,31,43,54,173,161),
+(10,8,77,32,44,55,176,164),
+(10,8,78,32,44,55,179,167),
+(10,8,79,32,45,56,182,170),
+(10,8,80,33,45,57,185,173),
+(10,9,1,17,22,20,26,21),
+(10,9,2,17,22,21,27,22),
+(10,9,3,18,23,21,28,23),
+(10,9,4,18,23,22,29,24),
+(10,9,5,18,23,22,31,26),
+(10,9,6,18,24,23,32,27),
+(10,9,7,19,24,23,33,28),
+(10,9,8,19,25,24,34,29),
+(10,9,9,19,25,25,36,30),
+(10,9,10,20,25,25,37,32),
+(10,9,11,20,26,26,38,33),
+(10,9,12,20,26,26,39,34),
+(10,9,13,21,27,27,41,36),
+(10,9,14,21,27,28,42,37),
+(10,9,15,21,27,28,43,38),
+(10,9,16,22,28,29,45,39),
+(10,9,17,22,28,30,46,41),
+(10,9,18,23,29,30,47,42),
+(10,9,19,23,29,31,49,43),
+(10,9,20,23,30,32,50,45),
+(10,9,21,24,30,32,51,46),
+(10,9,22,24,31,33,53,48),
+(10,9,23,24,31,34,54,49),
+(10,9,24,25,31,34,56,50),
+(10,9,25,25,32,35,57,52),
+(10,9,26,26,32,36,59,53),
+(10,9,27,26,33,37,60,55),
+(10,9,28,26,33,37,62,56),
+(10,9,29,27,34,38,63,58),
+(10,9,30,27,34,39,65,59),
+(10,9,31,28,35,40,66,61),
+(10,9,32,28,36,40,68,62),
+(10,9,33,29,36,41,69,64),
+(10,9,34,29,37,42,71,65),
+(10,9,35,29,37,43,73,67),
+(10,9,36,30,38,43,74,69),
+(10,9,37,30,38,44,76,70),
+(10,9,38,31,39,45,77,72),
+(10,9,39,31,39,46,79,73),
+(10,9,40,32,40,47,81,75),
+(10,9,41,32,41,48,82,77),
+(10,9,42,33,41,48,84,78),
+(10,9,43,33,42,49,86,80),
+(10,9,44,34,42,50,88,82),
+(10,9,45,34,43,51,89,83),
+(10,9,46,35,44,52,91,85),
+(10,9,47,35,44,53,93,87),
+(10,9,48,36,45,54,95,89),
+(10,9,49,36,45,54,96,90),
+(10,9,50,37,46,55,98,92),
+(10,9,51,37,47,56,100,94),
+(10,9,52,38,47,57,102,96),
+(10,9,53,38,48,58,104,97),
+(10,9,54,39,49,59,105,99),
+(10,9,55,39,49,60,107,101),
+(10,9,56,40,50,61,109,103),
+(10,9,57,40,51,62,111,105),
+(10,9,58,41,51,63,113,107),
+(10,9,59,42,52,64,115,108),
+(10,9,60,42,53,65,117,110),
+(10,9,61,43,53,66,119,112),
+(10,9,62,43,54,67,121,114),
+(10,9,63,44,55,68,123,116),
+(10,9,64,44,56,69,125,118),
+(10,9,65,45,56,70,127,120),
+(10,9,66,46,57,71,129,122),
+(10,9,67,46,58,72,131,124),
+(10,9,68,47,58,73,133,126),
+(10,9,69,47,59,74,135,128),
+(10,9,70,48,60,75,137,130),
+(10,9,71,49,61,83,139,141),
+(10,9,72,50,61,84,142,143),
+(10,9,73,51,62,84,144,146),
+(10,9,74,51,63,86,147,149),
+(10,9,75,52,64,89,149,151),
+(10,9,76,53,65,90,155,154),
+(10,9,77,54,66,91,155,157),
+(10,9,78,54,67,93,157,160),
+(10,9,79,55,68,94,160,163),
+(10,9,80,56,69,95,163,165),
+(11,1,1,24,17,21,21,22),
+(11,1,2,25,18,22,21,22),
+(11,1,3,27,19,23,21,23),
+(11,1,4,28,19,25,21,23),
+(11,1,5,29,20,26,21,23),
+(11,1,6,31,21,27,21,23),
+(11,1,7,32,22,28,21,24),
+(11,1,8,33,23,29,22,24),
+(11,1,9,35,24,31,22,24),
+(11,1,10,36,24,32,22,25),
+(11,1,11,37,25,33,22,25),
+(11,1,12,39,26,34,22,25),
+(11,1,13,40,27,36,22,26),
+(11,1,14,42,28,37,22,26),
+(11,1,15,43,29,38,22,26),
+(11,1,16,45,30,40,22,27),
+(11,1,17,46,31,41,23,27),
+(11,1,18,48,32,43,23,27),
+(11,1,19,49,33,44,23,28),
+(11,1,20,51,34,45,23,28),
+(11,1,21,52,34,47,23,28),
+(11,1,22,54,35,48,23,29),
+(11,1,23,55,36,50,23,29),
+(11,1,24,57,37,51,24,30),
+(11,1,25,59,38,52,24,30),
+(11,1,26,60,39,54,24,30),
+(11,1,27,62,40,55,24,31),
+(11,1,28,63,41,57,24,31),
+(11,1,29,65,43,58,24,32),
+(11,1,30,67,44,60,24,32),
+(11,1,31,69,45,62,25,32),
+(11,1,32,70,46,63,25,33),
+(11,1,33,72,47,65,25,33),
+(11,1,34,74,48,66,25,34),
+(11,1,35,75,49,68,25,34),
+(11,1,36,77,50,69,26,35),
+(11,1,37,79,51,71,26,35),
+(11,1,38,81,52,73,26,35),
+(11,1,39,83,53,74,26,36),
+(11,1,40,84,55,76,26,36),
+(11,1,41,86,56,78,27,37),
+(11,1,42,88,57,79,27,37),
+(11,1,43,90,58,81,27,38),
+(11,1,44,92,59,83,27,38),
+(11,1,45,94,60,85,27,39),
+(11,1,46,96,62,86,28,39),
+(11,1,47,98,63,88,28,40),
+(11,1,48,100,64,90,28,40),
+(11,1,49,102,65,92,28,41),
+(11,1,50,103,66,93,29,41),
+(11,1,51,105,68,95,29,42),
+(11,1,52,107,69,97,29,42),
+(11,1,53,109,70,99,29,43),
+(11,1,54,112,71,101,30,44),
+(11,1,55,114,73,103,30,44),
+(11,1,56,116,74,104,30,45),
+(11,1,57,118,75,106,30,45),
+(11,1,58,120,77,108,31,46),
+(11,1,59,122,78,110,31,46),
+(11,1,60,124,79,112,31,47),
+(11,1,61,126,81,114,31,48),
+(11,1,62,128,82,116,32,48),
+(11,1,63,130,83,118,32,49),
+(11,1,64,133,85,120,32,49),
+(11,1,65,135,86,122,33,50),
+(11,1,66,137,87,124,33,51),
+(11,1,67,139,89,126,33,51),
+(11,1,68,141,90,128,33,52),
+(11,1,69,144,92,130,34,52),
+(11,1,70,146,93,132,34,53),
+(11,1,71,149,94,134,34,54),
+(11,1,72,151,96,137,34,55),
+(11,1,73,154,98,139,34,56),
+(11,1,74,157,99,142,35,56),
+(11,1,75,166,101,149,35,57),
+(11,1,76,172,103,155,35,58),
+(11,1,77,175,105,159,36,59),
+(11,1,78,179,106,161,36,59),
+(11,1,79,182,108,164,36,60),
+(11,1,80,185,110,167,37,61),
+(11,2,1,23,17,21,21,23),
+(11,2,2,24,18,22,22,24),
+(11,2,3,25,18,23,22,24),
+(11,2,4,26,19,24,23,25),
+(11,2,5,27,19,25,24,26),
+(11,2,6,29,20,26,24,26),
+(11,2,7,30,21,27,25,27),
+(11,2,8,31,21,28,26,28),
+(11,2,9,32,22,29,26,29),
+(11,2,10,33,22,31,27,29),
+(11,2,11,34,23,32,28,30),
+(11,2,12,36,24,33,28,31),
+(11,2,13,37,24,34,29,32),
+(11,2,14,38,25,35,30,32),
+(11,2,15,39,26,36,31,33),
+(11,2,16,40,26,37,31,34),
+(11,2,17,42,27,39,32,35),
+(11,2,18,43,28,40,33,36),
+(11,2,19,44,28,41,34,37),
+(11,2,20,46,29,42,34,37),
+(11,2,21,47,30,44,35,38),
+(11,2,22,48,31,45,36,39),
+(11,2,23,50,31,46,37,40),
+(11,2,24,51,32,47,38,41),
+(11,2,25,52,33,49,38,42),
+(11,2,26,54,34,50,39,43),
+(11,2,27,55,34,51,40,44),
+(11,2,28,56,35,53,41,44),
+(11,2,29,58,36,54,42,45),
+(11,2,30,59,37,55,43,46),
+(11,2,31,61,37,57,43,47),
+(11,2,32,62,38,58,44,48),
+(11,2,33,64,39,59,45,49),
+(11,2,34,65,40,61,46,50),
+(11,2,35,67,41,62,47,51),
+(11,2,36,68,42,64,48,52),
+(11,2,37,70,42,65,49,53),
+(11,2,38,71,43,67,50,54),
+(11,2,39,73,44,68,51,55),
+(11,2,40,74,45,69,52,56),
+(11,2,41,76,46,71,53,57),
+(11,2,42,78,47,72,54,58),
+(11,2,43,79,47,74,55,59),
+(11,2,44,81,48,75,56,60),
+(11,2,45,82,49,77,57,61),
+(11,2,46,84,50,78,58,62),
+(11,2,47,86,51,80,59,64),
+(11,2,48,87,52,82,60,65),
+(11,2,49,89,53,83,61,66),
+(11,2,50,91,54,85,62,67),
+(11,2,51,92,55,86,63,68),
+(11,2,52,94,56,88,64,69),
+(11,2,53,96,57,90,65,70),
+(11,2,54,97,58,91,66,71),
+(11,2,55,99,59,93,67,73),
+(11,2,56,101,60,95,68,74),
+(11,2,57,103,61,96,69,75),
+(11,2,58,105,62,98,70,76),
+(11,2,59,106,63,100,71,77),
+(11,2,60,108,64,101,72,78),
+(11,2,61,110,65,103,74,80),
+(11,2,62,112,66,105,75,81),
+(11,2,63,114,67,106,76,82),
+(11,2,64,116,68,108,77,83),
+(11,2,65,117,69,110,78,85),
+(11,2,66,119,70,112,79,86),
+(11,2,67,121,71,114,80,87),
+(11,2,68,123,72,115,82,88),
+(11,2,69,125,73,117,83,90),
+(11,2,70,127,74,119,84,91),
+(11,2,71,130,75,121,87,92),
+(11,2,72,132,76,124,90,94),
+(11,2,73,134,77,126,93,96),
+(11,2,74,137,79,128,97,97),
+(11,2,75,139,80,130,101,99),
+(11,2,76,142,81,133,106,100),
+(11,2,77,144,83,135,108,102),
+(11,2,78,147,84,137,110,104),
+(11,2,79,149,85,140,111,105),
+(11,2,80,152,87,142,113,107),
+(11,3,1,21,20,20,21,23),
+(11,3,2,21,21,21,22,24),
+(11,3,3,22,23,22,22,24),
+(11,3,4,22,24,23,23,25),
+(11,3,5,23,25,24,23,25),
+(11,3,6,23,27,25,24,26),
+(11,3,7,24,28,26,24,27),
+(11,3,8,24,30,27,25,27),
+(11,3,9,25,31,27,26,28),
+(11,3,10,25,33,28,26,29),
+(11,3,11,25,34,29,27,29),
+(11,3,12,26,36,30,28,30),
+(11,3,13,26,37,31,28,31),
+(11,3,14,27,39,32,29,32),
+(11,3,15,27,40,34,30,32),
+(11,3,16,28,42,35,30,33),
+(11,3,17,28,43,36,31,34),
+(11,3,18,29,45,37,32,35),
+(11,3,19,29,47,38,32,35),
+(11,3,20,30,48,39,33,36),
+(11,3,21,31,50,40,34,37),
+(11,3,22,31,51,41,34,38),
+(11,3,23,32,53,42,35,38),
+(11,3,24,32,55,43,36,39),
+(11,3,25,33,57,44,37,40),
+(11,3,26,33,58,46,37,41),
+(11,3,27,34,60,47,38,42),
+(11,3,28,35,62,48,39,42),
+(11,3,29,35,63,49,40,43),
+(11,3,30,36,65,50,40,44),
+(11,3,31,36,67,52,41,45),
+(11,3,32,37,69,53,42,46),
+(11,3,33,38,71,54,43,47),
+(11,3,34,38,72,55,44,48),
+(11,3,35,39,74,57,44,48),
+(11,3,36,39,76,58,45,49),
+(11,3,37,40,78,59,46,50),
+(11,3,38,41,80,60,47,51),
+(11,3,39,41,82,62,48,52),
+(11,3,40,42,84,63,49,53),
+(11,3,41,43,86,64,50,54),
+(11,3,42,43,88,66,50,55),
+(11,3,43,44,90,67,51,56),
+(11,3,44,45,91,68,52,57),
+(11,3,45,45,93,70,53,58),
+(11,3,46,46,95,71,54,59),
+(11,3,47,47,98,72,55,60),
+(11,3,48,48,100,74,56,61),
+(11,3,49,48,102,75,57,62),
+(11,3,50,49,104,77,58,63),
+(11,3,51,50,106,78,59,64),
+(11,3,52,51,108,79,60,65),
+(11,3,53,51,110,81,61,66),
+(11,3,54,52,112,82,61,67),
+(11,3,55,53,114,84,62,68),
+(11,3,56,54,116,85,63,69),
+(11,3,57,54,118,87,64,70),
+(11,3,58,55,121,88,65,71),
+(11,3,59,56,123,90,66,72),
+(11,3,60,57,125,91,67,74),
+(11,3,61,58,127,93,68,75),
+(11,3,62,58,130,94,69,76),
+(11,3,63,59,132,96,71,77),
+(11,3,64,60,134,97,72,78),
+(11,3,65,61,136,99,73,79),
+(11,3,66,62,139,101,74,80),
+(11,3,67,62,141,102,75,81),
+(11,3,68,63,143,104,76,83),
+(11,3,69,64,146,105,77,84),
+(11,3,70,65,148,107,78,85),
+(11,3,71,66,151,109,79,86),
+(11,3,72,67,154,111,80,87),
+(11,3,73,68,157,113,81,89),
+(11,3,74,69,160,115,83,90),
+(11,3,75,70,163,117,84,92),
+(11,3,76,71,166,119,85,93),
+(11,3,77,72,169,121,87,95),
+(11,3,78,73,172,123,88,96),
+(11,3,79,74,175,125,89,98),
+(11,3,80,75,178,127,91,99),
+(11,5,1,21,17,19,23,25),
+(11,5,2,21,17,19,24,26),
+(11,5,3,21,17,20,26,28),
+(11,5,4,21,18,20,27,29),
+(11,5,5,22,18,20,28,30),
+(11,5,6,22,18,21,30,32),
+(11,5,7,22,18,21,31,33),
+(11,5,8,22,19,22,32,35),
+(11,5,9,22,19,22,34,36),
+(11,5,10,22,19,22,35,38),
+(11,5,11,23,19,23,37,39),
+(11,5,12,23,20,23,38,41),
+(11,5,13,23,20,24,39,42),
+(11,5,14,23,20,24,41,44),
+(11,5,15,23,20,25,42,45),
+(11,5,16,24,21,25,44,47),
+(11,5,17,24,21,25,45,48),
+(11,5,18,24,21,26,47,50),
+(11,5,19,24,22,26,48,51),
+(11,5,20,24,22,27,50,53),
+(11,5,21,25,22,27,51,55),
+(11,5,22,25,22,28,53,56),
+(11,5,23,25,23,28,55,58),
+(11,5,24,25,23,29,56,60),
+(11,5,25,25,23,29,58,61),
+(11,5,26,26,24,30,60,63),
+(11,5,27,26,24,30,61,65),
+(11,5,28,26,24,31,63,66),
+(11,5,29,26,25,31,65,68),
+(11,5,30,27,25,32,66,70),
+(11,5,31,27,25,32,68,72),
+(11,5,32,27,26,33,70,73),
+(11,5,33,27,26,33,71,75),
+(11,5,34,28,26,34,73,77),
+(11,5,35,28,27,34,75,79),
+(11,5,36,28,27,35,77,81),
+(11,5,37,29,28,35,79,83),
+(11,5,38,29,28,36,80,85),
+(11,5,39,29,28,37,82,86),
+(11,5,40,29,29,37,84,88),
+(11,5,41,30,29,38,86,90),
+(11,5,42,30,29,38,88,92),
+(11,5,43,30,30,39,90,94),
+(11,5,44,31,30,39,91,96),
+(11,5,45,31,31,40,93,98),
+(11,5,46,31,31,41,95,100),
+(11,5,47,32,31,41,97,102),
+(11,5,48,32,32,42,99,104),
+(11,5,49,32,32,43,101,106),
+(11,5,50,33,33,43,103,108),
+(11,5,51,33,33,44,105,110),
+(11,5,52,33,34,44,107,113),
+(11,5,53,34,34,45,109,115),
+(11,5,54,34,34,46,111,117),
+(11,5,55,34,35,46,113,119),
+(11,5,56,35,35,47,115,121),
+(11,5,57,35,36,48,118,123),
+(11,5,58,35,36,48,120,126),
+(11,5,59,36,37,49,122,128),
+(11,5,60,36,37,50,124,130),
+(11,5,61,36,38,51,126,132),
+(11,5,62,37,38,51,128,134),
+(11,5,63,37,39,52,130,137),
+(11,5,64,38,39,53,133,139),
+(11,5,65,38,40,53,135,141),
+(11,5,66,38,40,54,137,144),
+(11,5,67,39,40,55,139,146),
+(11,5,68,39,41,56,141,148),
+(11,5,69,40,41,56,144,151),
+(11,5,70,40,42,57,146,153),
+(11,5,71,40,43,58,149,156),
+(11,5,72,41,43,58,155,159),
+(11,5,73,41,44,59,157,160),
+(11,5,74,42,44,61,160,163),
+(11,5,75,42,45,62,164,166),
+(11,5,76,42,46,62,167,169),
+(11,5,77,43,46,63,168,172),
+(11,5,78,43,47,64,169,177),
+(11,5,79,44,47,65,172,180),
+(11,5,80,44,48,66,175,183),
+(11,6,1,24,17,21,21,22),
+(11,6,2,25,18,22,21,22),
+(11,6,3,27,19,23,21,23),
+(11,6,4,28,19,25,21,23),
+(11,6,5,29,20,26,21,23),
+(11,6,6,31,21,27,21,23),
+(11,6,7,32,22,28,21,24),
+(11,6,8,33,23,29,22,24),
+(11,6,9,35,24,31,22,24),
+(11,6,10,36,24,32,22,25),
+(11,6,11,37,25,33,22,25),
+(11,6,12,39,26,34,22,25),
+(11,6,13,40,27,36,22,26),
+(11,6,14,42,28,37,22,26),
+(11,6,15,43,29,38,22,26),
+(11,6,16,45,30,40,22,27),
+(11,6,17,46,31,41,23,27),
+(11,6,18,48,32,43,23,27),
+(11,6,19,49,33,44,23,28),
+(11,6,20,51,34,45,23,28),
+(11,6,21,52,34,47,23,28),
+(11,6,22,54,35,48,23,29),
+(11,6,23,55,36,50,23,29),
+(11,6,24,57,37,51,24,30),
+(11,6,25,59,38,52,24,30),
+(11,6,26,60,39,54,24,30),
+(11,6,27,62,40,55,24,31),
+(11,6,28,63,41,57,24,31),
+(11,6,29,65,43,58,24,32),
+(11,6,30,67,44,60,24,32),
+(11,6,31,69,45,62,25,32),
+(11,6,32,70,46,63,25,33),
+(11,6,33,72,47,65,25,33),
+(11,6,34,74,48,66,25,34),
+(11,6,35,75,49,68,25,34),
+(11,6,36,77,50,69,26,35),
+(11,6,37,79,51,71,26,35),
+(11,6,38,81,52,73,26,35),
+(11,6,39,83,53,74,26,36),
+(11,6,40,84,55,76,26,36),
+(11,6,41,86,56,78,27,37),
+(11,6,42,88,57,79,27,37),
+(11,6,43,90,58,81,27,38),
+(11,6,44,92,59,83,27,38),
+(11,6,45,94,60,85,27,39),
+(11,6,46,96,62,86,28,39),
+(11,6,47,98,63,88,28,40),
+(11,6,48,100,64,90,28,40),
+(11,6,49,102,65,92,28,41),
+(11,6,50,103,65,93,29,41),
+(11,6,51,105,66,94,29,42),
+(11,6,52,106,67,95,29,42),
+(11,6,53,107,68,96,29,43),
+(11,6,54,108,69,97,30,44),
+(11,6,55,109,70,98,30,44),
+(11,6,56,112,72,101,30,45),
+(11,6,57,114,73,103,30,45),
+(11,6,58,117,74,105,31,46),
+(11,6,59,119,76,107,31,46),
+(11,6,60,121,77,109,31,47),
+(11,6,61,123,78,111,31,48),
+(11,6,62,126,80,113,31,48),
+(11,6,63,128,81,116,32,49),
+(11,6,64,131,83,118,32,49),
+(11,6,65,136,84,120,32,50),
+(11,6,66,140,86,123,32,51),
+(11,6,67,141,87,125,33,51),
+(11,6,68,141,89,127,33,52),
+(11,6,69,144,90,130,33,53),
+(11,6,70,147,92,132,33,53),
+(11,6,71,150,94,135,34,54),
+(11,6,72,152,95,137,34,55),
+(11,6,73,155,97,140,34,56),
+(11,6,74,162,99,142,34,56),
+(11,6,75,165,100,145,35,57),
+(11,6,76,167,102,146,35,58),
+(11,6,77,169,104,150,35,59),
+(11,6,78,170,105,152,35,59),
+(11,6,79,173,107,156,36,60),
+(11,6,80,176,109,159,36,61),
+(11,7,1,22,17,20,22,24),
+(11,7,2,23,17,21,23,25),
+(11,7,3,24,18,22,24,26),
+(11,7,4,25,18,23,25,27),
+(11,7,5,25,19,24,26,28),
+(11,7,6,26,19,25,27,29),
+(11,7,7,27,20,26,28,30),
+(11,7,8,28,20,27,28,31),
+(11,7,9,29,21,28,29,32),
+(11,7,10,30,21,29,30,33),
+(11,7,11,31,22,30,31,35),
+(11,7,12,32,22,31,32,36),
+(11,7,13,33,23,32,33,37),
+(11,7,14,34,23,33,34,38),
+(11,7,15,34,24,35,35,39),
+(11,7,16,35,24,36,36,40),
+(11,7,17,36,25,37,38,42),
+(11,7,18,37,25,38,39,43),
+(11,7,19,38,26,39,40,44),
+(11,7,20,39,26,40,41,45),
+(11,7,21,40,27,41,42,46),
+(11,7,22,41,27,43,43,48),
+(11,7,23,43,28,44,44,49),
+(11,7,24,44,28,45,45,50),
+(11,7,25,45,29,46,46,51),
+(11,7,26,46,30,47,48,53),
+(11,7,27,47,30,49,49,54),
+(11,7,28,48,31,50,50,55),
+(11,7,29,49,31,51,51,57),
+(11,7,30,50,32,53,52,58),
+(11,7,31,51,33,54,53,59),
+(11,7,32,52,33,55,55,61),
+(11,7,33,53,34,56,56,62),
+(11,7,34,55,34,58,57,64),
+(11,7,35,56,35,59,58,65),
+(11,7,36,57,36,60,60,66),
+(11,7,37,58,36,62,61,68),
+(11,7,38,59,37,63,62,69),
+(11,7,39,61,38,65,63,71),
+(11,7,40,62,38,66,65,72),
+(11,7,41,63,39,67,66,74),
+(11,7,42,64,40,69,67,75),
+(11,7,43,65,40,70,69,77),
+(11,7,44,67,41,72,70,78),
+(11,7,45,68,42,73,71,80),
+(11,7,46,69,42,75,73,81),
+(11,7,47,71,43,76,74,83),
+(11,7,48,72,44,78,76,84),
+(11,7,49,73,45,79,77,86),
+(11,7,50,74,45,81,78,88),
+(11,7,51,76,46,82,80,89),
+(11,7,52,77,47,84,81,91),
+(11,7,53,78,47,85,83,92),
+(11,7,54,80,48,87,84,94),
+(11,7,55,81,49,88,86,96),
+(11,7,56,83,50,90,87,97),
+(11,7,57,84,50,91,89,99),
+(11,7,58,85,51,93,90,101),
+(11,7,59,87,52,95,92,102),
+(11,7,60,88,53,96,93,104),
+(11,7,61,90,54,98,95,106),
+(11,7,62,91,54,99,96,108),
+(11,7,63,93,55,101,98,109),
+(11,7,64,94,56,103,99,111),
+(11,7,65,95,57,104,101,113),
+(11,7,66,97,58,106,103,115),
+(11,7,67,98,58,108,104,117),
+(11,7,68,100,59,110,106,118),
+(11,7,69,101,60,111,107,120),
+(11,7,70,103,61,113,109,122),
+(11,7,71,104,62,115,122,124),
+(11,7,72,106,63,117,124,127),
+(11,7,73,108,64,119,126,129),
+(11,7,74,110,65,122,128,131),
+(11,7,75,112,66,124,130,133),
+(11,7,76,114,67,126,133,136),
+(11,7,77,115,68,128,135,138),
+(11,7,78,117,69,130,137,140),
+(11,7,79,119,70,133,139,143),
+(11,7,80,121,71,135,141,145),
+(11,8,1,21,17,19,24,24),
+(11,8,2,21,17,19,25,25),
+(11,8,3,21,17,20,27,27),
+(11,8,4,21,17,20,28,28),
+(11,8,5,21,18,20,29,29),
+(11,8,6,21,18,20,31,31),
+(11,8,7,21,18,21,32,32),
+(11,8,8,22,18,21,34,33),
+(11,8,9,22,18,21,35,35),
+(11,8,10,22,19,22,37,36),
+(11,8,11,22,19,22,38,37),
+(11,8,12,22,19,22,40,39),
+(11,8,13,22,19,23,41,40),
+(11,8,14,22,19,23,43,42),
+(11,8,15,22,19,23,44,43),
+(11,8,16,22,20,24,46,45),
+(11,8,17,23,20,24,47,46),
+(11,8,18,23,20,24,49,48),
+(11,8,19,23,20,25,50,49),
+(11,8,20,23,21,25,52,51),
+(11,8,21,23,21,26,54,52),
+(11,8,22,23,21,26,55,54),
+(11,8,23,23,21,26,57,56),
+(11,8,24,24,21,27,59,57),
+(11,8,25,24,22,27,60,59),
+(11,8,26,24,22,27,62,60),
+(11,8,27,24,22,28,64,62),
+(11,8,28,24,22,28,65,64),
+(11,8,29,24,23,29,67,65),
+(11,8,30,24,23,29,69,67),
+(11,8,31,25,23,30,71,69),
+(11,8,32,25,23,30,73,71),
+(11,8,33,25,24,30,74,72),
+(11,8,34,25,24,31,76,74),
+(11,8,35,25,24,31,78,76),
+(11,8,36,26,24,32,80,78),
+(11,8,37,26,25,32,82,79),
+(11,8,38,26,25,33,84,81),
+(11,8,39,26,25,33,86,83),
+(11,8,40,26,26,34,87,85),
+(11,8,41,27,26,34,89,87),
+(11,8,42,27,26,35,91,89),
+(11,8,43,27,27,35,93,91),
+(11,8,44,27,27,36,95,92),
+(11,8,45,27,27,36,97,94),
+(11,8,46,28,27,37,99,96),
+(11,8,47,28,28,37,101,98),
+(11,8,48,28,28,38,103,100),
+(11,8,49,28,28,38,105,102),
+(11,8,50,29,29,39,107,104),
+(11,8,51,29,29,39,110,106),
+(11,8,52,29,29,40,112,108),
+(11,8,53,29,30,40,114,110),
+(11,8,54,30,30,41,116,112),
+(11,8,55,30,30,41,118,114),
+(11,8,56,30,31,42,120,116),
+(11,8,57,30,31,42,122,118),
+(11,8,58,31,31,43,125,121),
+(11,8,59,31,32,43,127,123),
+(11,8,60,31,32,44,129,125),
+(11,8,61,31,33,45,131,127),
+(11,8,62,32,33,45,133,129),
+(11,8,63,32,33,46,136,131),
+(11,8,64,32,34,46,138,134),
+(11,8,65,33,34,47,140,136),
+(11,8,66,33,34,48,143,138),
+(11,8,67,33,35,48,145,140),
+(11,8,68,33,35,49,147,142),
+(11,8,69,34,36,49,150,145),
+(11,8,70,34,36,50,152,147),
+(11,8,71,34,36,51,155,150),
+(11,8,72,34,37,52,161,153),
+(11,8,73,34,37,53,161,156),
+(11,8,74,35,38,53,164,158),
+(11,8,75,35,38,54,167,161),
+(11,8,76,35,38,55,170,164),
+(11,8,77,36,39,56,173,167),
+(11,8,78,36,39,56,176,170),
+(11,8,79,36,40,57,179,173),
+(11,8,80,37,40,58,182,176);
+/*!40000 ALTER TABLE `player_levelstats` ENABLE KEYS */;
+UNLOCK TABLES;
+
+-- ----------------------------
+-- Table structure for player_xp_for_level
+-- ----------------------------
+DROP TABLE IF EXISTS `player_xp_for_level`;
+CREATE TABLE `player_xp_for_level` (
+ `lvl` int(3) unsigned NOT NULL,
+ `xp_for_next_level` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`lvl`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `player_xp_for_level`
+--
+
+LOCK TABLES `player_xp_for_level` WRITE;
+/*!40000 ALTER TABLE `player_xp_for_level` DISABLE KEYS */;
+INSERT INTO `player_xp_for_level` VALUES
+('1', '400'),
+('2', '900'),
+('3', '1400'),
+('4', '2100'),
+('5', '2800'),
+('6', '3600'),
+('7', '4500'),
+('8', '5400'),
+('9', '6500'),
+('10', '7600'),
+('11', '8700'),
+('12', '9800'),
+('13', '11000'),
+('14', '12300'),
+('15', '13600'),
+('16', '15000'),
+('17', '16400'),
+('18', '17800'),
+('19', '19300'),
+('20', '20800'),
+('21', '22400'),
+('22', '24000'),
+('23', '25500'),
+('24', '27200'),
+('25', '28900'),
+('26', '30500'),
+('27', '32200'),
+('28', '33900'),
+('29', '36300'),
+('30', '38800'),
+('31', '41600'),
+('32', '44600'),
+('33', '48000'),
+('34', '51400'),
+('35', '55000'),
+('36', '58700'),
+('37', '62400'),
+('38', '66200'),
+('39', '70200'),
+('40', '74300'),
+('41', '78500'),
+('42', '82800'),
+('43', '87100'),
+('44', '91600'),
+('45', '96300'),
+('46', '101000'),
+('47', '105800'),
+('48', '110700'),
+('49', '115700'),
+('50', '120900'),
+('51', '126100'),
+('52', '131500'),
+('53', '137000'),
+('54', '142500'),
+('55', '148200'),
+('56', '154000'),
+('57', '159900'),
+('58', '165800'),
+('59', '172000'),
+('60', '290000'),
+('61', '317000'),
+('62', '349000'),
+('63', '386000'),
+('64', '428000'),
+('65', '475000'),
+('66', '527000'),
+('67', '585000'),
+('68', '648000'),
+('69', '717000'),
+('70', '1523800'),
+('71', '1539600'),
+('72', '1555700'),
+('73', '1571800'),
+('74', '1587900'),
+('75', '1604200'),
+('76', '1620700'),
+('77', '1637400'),
+('78', '1653900'),
+('79', '1670800');
+/*!40000 ALTER TABLE `player_xp_for_level` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `playercreateinfo`
+--
+
+DROP TABLE IF EXISTS `playercreateinfo`;
+CREATE TABLE `playercreateinfo` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `map` smallint(5) unsigned NOT NULL default '0',
+ `zone` mediumint(8) unsigned NOT NULL default '0',
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ PRIMARY KEY (`race`,`class`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `playercreateinfo`
+--
+
+LOCK TABLES `playercreateinfo` WRITE;
+/*!40000 ALTER TABLE `playercreateinfo` DISABLE KEYS */;
+INSERT INTO `playercreateinfo` VALUES
+(1,1,0,12,-8949,-132,84),
+(1,2,0,12,-8949,-132,84),
+(1,4,0,12,-8949,-132,84),
+(1,5,0,12,-8949,-132,84),
+(1,6,609,4298,2355.84,-5664.77,426.028),
+(1,8,0,12,-8949,-132,84),
+(1,9,0,12,-8949,-132,84),
+(2,1,1,14,-618,-4251,39),
+(2,3,1,14,-618,-4251,39),
+(2,4,1,14,-618,-4251,39),
+(2,6,609,4298,2358.44,-5666.9,426.023),
+(2,7,1,14,-618,-4251,39),
+(2,9,1,14,-618,-4251,39),
+(3,1,0,1,-6240,331,383),
+(3,2,0,1,-6240,331,383),
+(3,3,0,1,-6240,331,383),
+(3,4,0,1,-6240,331,383),
+(3,5,0,1,-6240,331,383),
+(3,6,609,4298,2358.44,-5666.9,426.023),
+(4,1,1,141,10311,832,1327),
+(4,3,1,141,10311,832,1327),
+(4,4,1,141,10311,832,1327),
+(4,5,1,141,10311,832,1327),
+(4,6,609,4298,2356.21,-5662.21,426.026),
+(4,11,1,141,10311,832,1327),
+(5,1,0,85,1676,1677,122),
+(5,4,0,85,1676,1677,122),
+(5,5,0,85,1676,1677,122),
+(5,8,0,85,1676,1677,122),
+(5,9,0,85,1676,1677,122),
+(5,6,609,4298,2356.21,-5662.21,426.026),
+(6,1,1,215,-2917,-257,53),
+(6,3,1,215,-2917,-257,53),
+(6,6,609,4298,2358.17,-5663.21,426.027),
+(6,7,1,215,-2917,-257,53),
+(6,11,1,215,-2917,-257,53),
+(7,1,0,1,-6240,331,383),
+(7,4,0,1,-6240,331,383),
+(7,6,609,4298,2355.05,-5661.7, 426.026),
+(7,8,0,1,-6240,331,383),
+(7,9,0,1,-6240,331,383),
+(8,1,1,14,-618,-4251,39),
+(8,3,1,14,-618,-4251,39),
+(8,4,1,14,-618,-4251,39),
+(8,5,1,14,-618,-4251,39),
+(8,6,609,4298,2355.05,-5661.7, 426.026),
+(8,7,1,14,-618,-4251,39),
+(8,8,1,14,-618,-4251,39),
+(10,2,530,3431,10349.6,-6357.29,33.4026),
+(10,3,530,3431,10349.6,-6357.29,33.4026),
+(10,4,530,3431,10349.6,-6357.29,33.4026),
+(10,5,530,3431,10349.6,-6357.29,33.4026),
+(10,6,609,4298,2355.84,-5664.77,426.028),
+(10,8,530,3431,10349.6,-6357.29,33.4026),
+(10,9,530,3431,10349.6,-6357.29,33.4026),
+(11,1,530,3526,-3961.64,-13931.2,100.615),
+(11,2,530,3526,-3961.64,-13931.2,100.615),
+(11,3,530,3526,-3961.64,-13931.2,100.615),
+(11,5,530,3526,-3961.64,-13931.2,100.615),
+(11,6,609,4298,2358.17,-5663.21,426.027),
+(11,7,530,3526,-3961.64,-13931.2,100.615),
+(11,8,530,3526,-3961.64,-13931.2,100.615);
+/*!40000 ALTER TABLE `playercreateinfo` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `playercreateinfo_action`
+--
+
+DROP TABLE IF EXISTS `playercreateinfo_action`;
+CREATE TABLE `playercreateinfo_action` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `button` smallint(5) unsigned NOT NULL default '0',
+ `action` smallint(5) unsigned NOT NULL default '0',
+ `type` smallint(5) unsigned NOT NULL default '0',
+ `misc` smallint(5) unsigned NOT NULL default '0',
+ KEY `playercreateinfo_race_class_index` (`race`,`class`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `playercreateinfo_action`
+--
+
+LOCK TABLES `playercreateinfo_action` WRITE;
+/*!40000 ALTER TABLE `playercreateinfo_action` DISABLE KEYS */;
+INSERT INTO `playercreateinfo_action` VALUES
+(1,1,1,78,0,0),
+(1,1,0,6603,0,0),
+(1,1,11,117,128,0),
+(1,2,2,635,0,0),
+(1,2,0,6603,0,0),
+(1,2,1,21084,0,0),
+(1,2,10,159,128,0),
+(1,2,11,2070,128,0),
+(1,4,1,1752,0,0),
+(1,4,2,2098,0,0),
+(1,4,3,2764,0,0),
+(1,4,0,6603,0,0),
+(1,4,11,2070,128,0),
+(1,5,1,585,0,0),
+(1,5,2,2050,0,0),
+(1,5,0,6603,0,0),
+(1,5,10,159,128,0),
+(1,5,11,2070,128,0),
+(1,6,0,6603,0,0),
+(1,6,1,49576,0,0),
+(1,6,2,45477,0,0),
+(1,6,3,45462,0,0),
+(1,6,4,45902,0,0),
+(1,6,5,47541,0,0),
+(1,6,11,59752,0,0),
+(1,8,1,133,0,0),
+(1,8,2,168,0,0),
+(1,8,0,6603,0,0),
+(1,8,10,159,128,0),
+(1,8,11,2070,128,0),
+(1,9,1,686,0,0),
+(1,9,2,687,0,0),
+(1,9,0,6603,0,0),
+(1,9,10,159,128,0),
+(1,9,11,4604,128,0),
+(2,1,1,78,0,0),
+(2,1,0,6603,0,0),
+(2,1,11,117,128,0),
+(2,3,2,75,0,0),
+(2,3,1,2973,0,0),
+(2,3,0,6603,0,0),
+(2,3,11,117,128,0),
+(2,3,10,159,128,0),
+(2,4,10,0,128,0),
+(2,4,1,1752,0,0),
+(2,4,2,2098,0,0),
+(2,4,0,6603,0,0),
+(2,4,11,117,128,0),
+(2,6,0,6603,0,0),
+(2,6,1,49576,0,0),
+(2,6,2,45477,0,0),
+(2,6,3,45462,0,0),
+(2,6,4,45902,0,0),
+(2,6,5,47541,0,0),
+(2,6,10,20572,0,0),
+(2,7,2,331,0,0),
+(2,7,1,403,0,0),
+(2,7,0,6603,0,0),
+(2,7,11,117,128,0),
+(2,7,10,159,128,0),
+(2,9,1,686,0,0),
+(2,9,2,687,0,0),
+(2,9,0,6603,0,0),
+(2,9,11,117,128,0),
+(2,9,10,159,128,0),
+(3,1,1,78,0,0),
+(3,1,0,6603,0,0),
+(3,1,11,117,128,0),
+(3,2,2,635,0,0),
+(3,2,0,6603,0,0),
+(3,2,1,21084,0,0),
+(3,2,10,159,128,0),
+(3,2,11,4540,128,0),
+(3,3,2,75,0,0),
+(3,3,1,2973,0,0),
+(3,3,0,6603,0,0),
+(3,3,11,117,128,0),
+(3,3,10,159,128,0),
+(3,4,1,1752,0,0),
+(3,4,2,2098,0,0),
+(3,4,3,2764,0,0),
+(3,4,0,6603,0,0),
+(3,4,11,4540,128,0),
+(3,5,1,585,0,0),
+(3,5,2,2050,0,0),
+(3,5,0,6603,0,0),
+(3,5,10,159,128,0),
+(3,5,11,4540,128,0),
+(3,6,0,6603,0,0),
+(3,6,1,49576,0,0),
+(3,6,2,45477,0,0),
+(3,6,3,45462,0,0),
+(3,6,4,45902,0,0),
+(3,6,5,47541,0,0),
+(3,6,10,2481,0,0),
+(4,1,1,78,0,0),
+(4,1,0,6603,0,0),
+(4,1,11,117,128,0),
+(4,3,2,75,0,0),
+(4,3,1,2973,0,0),
+(4,3,0,6603,0,0),
+(4,3,11,117,128,0),
+(4,3,10,159,128,0),
+(4,4,1,1752,0,0),
+(4,4,2,2098,0,0),
+(4,4,3,2764,0,0),
+(4,4,0,6603,0,0),
+(4,4,11,4540,128,0),
+(4,5,1,585,0,0),
+(4,5,2,2050,0,0),
+(4,5,0,6603,0,0),
+(4,5,10,159,128,0),
+(4,5,11,2070,128,0),
+(4,6,0,6603,0,0),
+(4,6,1,49576,0,0),
+(4,6,2,45477,0,0),
+(4,6,3,45462,0,0),
+(4,6,4,45902,0,0),
+(4,6,5,47541,0,0),
+(4,6,10,58984,0,0),
+(4,6,83,58984,0,0),
+(4,11,1,5176,0,0),
+(4,11,2,5185,0,0),
+(4,11,0,6603,0,0),
+(4,11,10,159,128,0),
+(4,11,11,4536,128,0),
+(5,1,11,4604,128,0),
+(5,1,0,6603,0,0),
+(5,1,1,78,0,0),
+(5,4,11,4604,128,0),
+(5,4,3,2764,0,0),
+(5,4,2,2098,0,0),
+(5,4,1,1752,0,0),
+(5,4,0,6603,0,0),
+(5,5,10,159,128,0),
+(5,5,2,2050,0,0),
+(5,5,1,585,0,0),
+(5,5,11,4604,128,0),
+(5,5,0,6603,0,0),
+(5,6,0,6603,0,0),
+(5,6,1,49576,0,0),
+(5,6,2,45477,0,0),
+(5,6,3,45462,0,0),
+(5,6,4,45902,0,0),
+(5,6,5,47541,0,0),
+(5,6,10,20577,0,0),
+(5,8,11,4604,128,0),
+(5,8,10,159,128,0),
+(5,8,2,168,0,0),
+(5,8,1,133,0,0),
+(5,8,0,6603,0,0),
+(5,9,1,686,0,0),
+(5,9,10,159,128,0),
+(5,9,2,687,0,0),
+(5,9,11,4604,128,0),
+(5,9,0,6603,0,0),
+(6,1,1,78,0,0),
+(6,1,2,20549,0,0),
+(6,1,11,4540,128,0),
+(6,1,0,6603,0,0),
+(6,3,1,2973,0,0),
+(6,3,10,159,128,0),
+(6,3,2,75,0,0),
+(6,3,3,20549,0,0),
+(6,3,11,117,128,0),
+(6,3,0,6603,0,0),
+(6,6,0,6603,0,0),
+(6,6,1,49576,0,0),
+(6,6,2,45477,0,0),
+(6,6,3,45462,0,0),
+(6,6,4,45902,0,0),
+(6,6,5,47541,0,0),
+(6,6,10,20549,0,0),
+(6,6,75,20549,0,0),
+(6,7,1,403,0,0),
+(6,7,10,159,128,0),
+(6,7,2,331,0,0),
+(6,7,3,20549,0,0),
+(6,7,11,4604,128,0),
+(6,7,0,6603,0,0),
+(6,11,1,5176,0,0),
+(6,11,10,159,128,0),
+(6,11,2,5185,0,0),
+(6,11,3,20549,0,0),
+(6,11,11,4536,128,0),
+(6,11,0,6603,0,0),
+(7,1,11,117,128,0),
+(7,1,1,78,0,0),
+(7,1,0,6603,0,0),
+(7,4,11,117,128,0),
+(7,4,3,2764,0,0),
+(7,4,1,1752,0,0),
+(7,4,2,2098,0,0),
+(7,4,0,6603,0,0),
+(7,6,0,6603,0,0),
+(7,6,1,49576,0,0),
+(7,6,2,45477,0,0),
+(7,6,3,45462,0,0),
+(7,6,4,45902,0,0),
+(7,6,5,47541,0,0),
+(7,6,10,20589,0,0),
+(7,6,72,6603,0,0),
+(7,6,83,117,128,0),
+(7,6,84,6603,0,0),
+(7,6,96,6603,0,0),
+(7,6,108,6603,0,0),
+(7,8,11,4536,128,0),
+(7,8,1,133,0,0),
+(7,8,2,168,0,0),
+(7,8,10,159,128,0),
+(7,8,0,6603,0,0),
+(7,9,11,4604,128,0),
+(7,9,1,686,0,0),
+(7,9,2,687,0,0),
+(7,9,10,159,128,0),
+(7,9,0,6603,0,0),
+(8,1,11,117,128,0),
+(8,1,1,78,0,0),
+(8,1,3,2764,0,0),
+(8,1,0,6603,0,0),
+(8,3,10,159,128,0),
+(8,3,11,4604,128,0),
+(8,3,1,2973,0,0),
+(8,3,2,75,0,0),
+(8,3,0,6603,0,0),
+(8,4,1,1752,0,0),
+(8,4,3,2764,0,0),
+(8,4,2,2098,0,0),
+(8,4,11,117,128,0),
+(8,4,0,6603,0,0),
+(8,5,1,585,0,0),
+(8,5,10,159,128,0),
+(8,5,2,2050,0,0),
+(8,5,11,4540,128,0),
+(8,5,0,6603,0,0),
+(8,6,0,6603,0,0),
+(8,6,1,49576,0,0),
+(8,6,2,45477,0,0),
+(8,6,3,45462,0,0),
+(8,6,4,45902,0,0),
+(8,6,5,47541,0,0),
+(8,6,10,50621,0,0),
+(8,7,1,403,0,0),
+(8,7,10,159,128,0),
+(8,7,2,331,0,0),
+(8,7,11,117,128,0),
+(8,7,0,6603,0,0),
+(8,8,1,133,0,0),
+(8,8,10,159,128,0),
+(8,8,2,168,0,0),
+(8,8,11,117,128,0),
+(8,8,0,6603,0,0),
+(10,2,0,6603,0,0),
+(10,2,1,21084,0,0),
+(10,2,2,635,0,0),
+(10,2,3,28734,0,0),
+(10,2,4,28730,0,0),
+(10,2,10,159,128,0),
+(10,2,11,20857,128,0),
+(10,3,0,6603,0,0),
+(10,3,1,2973,0,0),
+(10,3,2,75,0,0),
+(10,3,3,28734,0,0),
+(10,3,4,28730,0,0),
+(10,3,10,159,128,0),
+(10,3,11,20857,128,0),
+(10,4,0,6603,0,0),
+(10,4,1,1752,0,0),
+(10,4,2,2098,0,0),
+(10,4,3,2764,0,0),
+(10,4,4,28734,0,0),
+(10,4,5,25046,0,0),
+(10,4,11,20857,128,0),
+(10,5,0,6603,0,0),
+(10,5,1,585,0,0),
+(10,5,2,2050,0,0),
+(10,5,3,28734,0,0),
+(10,5,4,28730,0,0),
+(10,5,10,159,128,0),
+(10,5,11,20857,128,0),
+(10,6,0,6603,0,0),
+(10,6,1,49576,0,0),
+(10,6,2,45477,0,0),
+(10,6,3,45462,0,0),
+(10,6,4,45902,0,0),
+(10,6,5,47541,0,0),
+(10,6,6,50613,0,0),
+(10,8,0,6603,0,0),
+(10,8,1,133,0,0),
+(10,8,2,168,0,0),
+(10,8,3,28734,0,0),
+(10,8,4,28730,0,0),
+(10,8,10,159,128,0),
+(10,8,11,20857,128,0),
+(10,9,11,20857,128,0),
+(10,9,10,159,128,0),
+(10,9,4,28730,0,0),
+(10,9,3,28734,0,0),
+(10,9,2,687,0,0),
+(10,9,1,686,0,0),
+(10,9,0,6603,0,0),
+(11,1,0,6603,0,0),
+(11,1,72,6603,0,0),
+(11,1,73,78,0,0),
+(11,1,74,28880,0,0),
+(11,1,83,4540,128,0),
+(11,1,84,6603,0,0),
+(11,1,96,6603,0,0),
+(11,1,108,6603,0,0),
+(11,2,0,6603,0,0),
+(11,2,1,21084,0,0),
+(11,2,2,635,0,0),
+(11,2,3,59542,0,0),
+(11,2,10,159,128,0),
+(11,2,11,4540,128,0),
+(11,2,83,4540,128,0),
+(11,3,0,6603,0,0),
+(11,3,1,2973,0,0),
+(11,3,2,75,0,0),
+(11,3,3,59543,0,0),
+(11,3,10,159,128,0),
+(11,3,11,4540,128,0),
+(11,3,72,6603,0,0),
+(11,3,73,2973,0,0),
+(11,3,74,75,0,0),
+(11,3,82,159,128,0),
+(11,3,83,4540,128,0),
+(11,5,0,6603,0,0),
+(11,5,1,585,0,0),
+(11,5,2,2050,0,0),
+(11,5,3,59544,0,0),
+(11,5,10,159,128,0),
+(11,5,11,4540,128,0),
+(11,5,83,4540,128,0),
+(11,6,0,6603,0,0),
+(11,6,1,49576,0,0),
+(11,6,2,45477,0,0),
+(11,6,3,45462,0,0),
+(11,6,4,45902,0,0),
+(11,6,5,47541,0,0),
+(11,6,6,59545,0,0),
+(11,7,0,6603,0,0),
+(11,7,1,403,0,0),
+(11,7,2,331,0,0),
+(11,7,3,59547,0,0),
+(11,7,10,159,128,0),
+(11,7,11,4540,128,0),
+(11,8,0,6603,0,0),
+(11,8,1,133,0,0),
+(11,8,2,168,0,0),
+(11,8,3,59548,0,0),
+(11,8,10,159,128,0),
+(11,8,11,4540,128,0),
+(11,8,83,4540,128,0);
+/*!40000 ALTER TABLE `playercreateinfo_action` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `playercreateinfo_item`
+--
+
+DROP TABLE IF EXISTS `playercreateinfo_item`;
+CREATE TABLE `playercreateinfo_item` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `itemid` mediumint(8) unsigned NOT NULL default '0',
+ `amount` tinyint(3) unsigned NOT NULL default '1',
+ KEY `playercreateinfo_race_class_index` (`race`,`class`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `playercreateinfo_item`
+--
+
+LOCK TABLES `playercreateinfo_item` WRITE;
+/*!40000 ALTER TABLE `playercreateinfo_item` DISABLE KEYS */;
+/*!40000 ALTER TABLE `playercreateinfo_item` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `playercreateinfo_spell`
+--
+
+DROP TABLE IF EXISTS `playercreateinfo_spell`;
+CREATE TABLE `playercreateinfo_spell` (
+ `race` tinyint(3) unsigned NOT NULL default '0',
+ `class` tinyint(3) unsigned NOT NULL default '0',
+ `Spell` mediumint(8) unsigned NOT NULL default '0',
+ `Note` varchar(255) default NULL,
+ PRIMARY KEY (`race`,`class`,`Spell`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `playercreateinfo_spell`
+--
+
+LOCK TABLES `playercreateinfo_spell` WRITE;
+/*!40000 ALTER TABLE `playercreateinfo_spell` DISABLE KEYS */;
+INSERT INTO `playercreateinfo_spell` VALUES
+(1,1,78,'Heroic Strike'),
+(1,1,81,'Dodge'),
+(1,1,107,'Block'),
+(1,1,196,'One-Handed Axes'),
+(1,1,198,'One-Handed Maces'),
+(1,1,201,'One-Handed Swords'),
+(1,1,203,'Unarmed'),
+(1,1,204,'Defense'),
+(1,1,522,'SPELLDEFENSE (DND)'),
+(1,1,668,'Language Common'),
+(1,1,1843,'Disarm'),
+(1,1,2382,'Generic'),
+(1,1,2457,'Battle Stance'),
+(1,1,2479,'Honorless Target'),
+(1,1,3050,'Detect'),
+(1,1,3365,'Opening'),
+(1,1,5301,'Defensive State (DND)'),
+(1,1,6233,'Closing'),
+(1,1,6246,'Closing'),
+(1,1,6247,'Opening'),
+(1,1,6477,'Opening'),
+(1,1,6478,'Opening'),
+(1,1,6603,'Attack'),
+(1,1,7266,'Duel'),
+(1,1,7267,'Grovel'),
+(1,1,7355,'Stuck'),
+(1,1,8386,'Attacking'),
+(1,1,8737,'Mail'),
+(1,1,9077,'Leather'),
+(1,1,9078,'Cloth'),
+(1,1,9116,'Shield'),
+(1,1,9125,'Generic'),
+(1,1,20597,'Sword Specialization'),
+(1,1,20598,'The Human Spirit'),
+(1,1,20599,'Diplomacy'),
+(1,1,20864,'Mace Specialization'),
+(1,1,21651,'Opening'),
+(1,1,21652,'Closing'),
+(1,1,22027,'Remove Insignia'),
+(1,1,22810,'Opening - No Text'),
+(1,1,32215,'Victorious State'),
+(1,1,45927,'Summon Friend'),
+(1,1,58985,'Perception'),
+(1,1,59752,'Every Man for Himself'),
+(1,1,61437,'Opening'),
+(1,2,81,'Dodge'),
+(1,2,107,'Block'),
+(1,2,198,'One-Handed Maces'),
+(1,2,199,'Two-Handed Maces'),
+(1,2,203,'Unarmed'),
+(1,2,204,'Defense'),
+(1,2,522,'SPELLDEFENSE (DND)'),
+(1,2,635,'Holy Light'),
+(1,2,668,'Language Common'),
+(1,2,1843,'Disarm'),
+(1,2,2382,'Generic'),
+(1,2,2479,'Honorless Target'),
+(1,2,3050,'Detect'),
+(1,2,3365,'Opening'),
+(1,2,6233,'Closing'),
+(1,2,6246,'Closing'),
+(1,2,6247,'Opening'),
+(1,2,6477,'Opening'),
+(1,2,6478,'Opening'),
+(1,2,6603,'Attack'),
+(1,2,7266,'Duel'),
+(1,2,7267,'Grovel'),
+(1,2,7355,'Stuck'),
+(1,2,8386,'Attacking'),
+(1,2,8737,'Mail'),
+(1,2,9077,'Leather'),
+(1,2,9078,'Cloth'),
+(1,2,9116,'Shield'),
+(1,2,9125,'Generic'),
+(1,2,20154,'Seal of Righteousness'),
+(1,2,20597,'Sword Specialization'),
+(1,2,20598,'The Human Spirit'),
+(1,2,20599,'Diplomacy'),
+(1,2,20864,'Mace Specialization'),
+(1,2,21651,'Opening'),
+(1,2,21652,'Closing'),
+(1,2,22027,'Remove Insignia'),
+(1,2,22810,'Opening - No Text'),
+(1,2,27762,'Libram'),
+(1,2,45927,'Summon Friend'),
+(1,2,58985,'Perception'),
+(1,2,59752,'Every Man for Himself'),
+(1,2,61437,'Opening'),
+(1,4,81,'Dodge'),
+(1,4,203,'Unarmed'),
+(1,4,204,'Defense'),
+(1,4,522,'SPELLDEFENSE (DND)'),
+(1,4,668,'Language Common'),
+(1,4,1180,'Daggers'),
+(1,4,1752,'Sinister Strike'),
+(1,4,1843,'Disarm'),
+(1,4,2098,'Eviscerate'),
+(1,4,2382,'Generic'),
+(1,4,2479,'Honorless Target'),
+(1,4,2567,'Thrown'),
+(1,4,2764,'Throw'),
+(1,4,3050,'Detect'),
+(1,4,3365,'Opening'),
+(1,4,6233,'Closing'),
+(1,4,6246,'Closing'),
+(1,4,6247,'Opening'),
+(1,4,6477,'Opening'),
+(1,4,6478,'Opening'),
+(1,4,6603,'Attack'),
+(1,4,7266,'Duel'),
+(1,4,7267,'Grovel'),
+(1,4,7355,'Stuck'),
+(1,4,8386,'Attacking'),
+(1,4,9077,'Leather'),
+(1,4,9078,'Cloth'),
+(1,4,9125,'Generic'),
+(1,4,16092,'Defensive State (DND)'),
+(1,4,20597,'Sword Specialization'),
+(1,4,20598,'The Human Spirit'),
+(1,4,20599,'Diplomacy'),
+(1,4,20864,'Mace Specialization'),
+(1,4,21184,'Rogue Passive (DND)'),
+(1,4,21651,'Opening'),
+(1,4,21652,'Closing'),
+(1,4,22027,'Remove Insignia'),
+(1,4,22810,'Opening - No Text'),
+(1,4,45927,'Summon Friend'),
+(1,4,58985,'Perception'),
+(1,4,59752,'Every Man for Himself'),
+(1,4,61437,'Opening'),
+(1,5,81,'Dodge'),
+(1,5,198,'One-Handed Maces'),
+(1,5,203,'Unarmed'),
+(1,5,204,'Defense'),
+(1,5,522,'SPELLDEFENSE (DND)'),
+(1,5,585,'Smite'),
+(1,5,668,'Language Common'),
+(1,5,1843,'Disarm'),
+(1,5,2050,'Lesser Heal'),
+(1,5,2382,'Generic'),
+(1,5,2479,'Honorless Target'),
+(1,5,3050,'Detect'),
+(1,5,3365,'Opening'),
+(1,5,5009,'Wands'),
+(1,5,5019,'Shoot'),
+(1,5,6233,'Closing'),
+(1,5,6246,'Closing'),
+(1,5,6247,'Opening'),
+(1,5,6477,'Opening'),
+(1,5,6478,'Opening'),
+(1,5,6603,'Attack'),
+(1,5,7266,'Duel'),
+(1,5,7267,'Grovel'),
+(1,5,7355,'Stuck'),
+(1,5,8386,'Attacking'),
+(1,5,9078,'Cloth'),
+(1,5,9125,'Generic'),
+(1,5,20597,'Sword Specialization'),
+(1,5,20598,'The Human Spirit'),
+(1,5,20599,'Diplomacy'),
+(1,5,20864,'Mace Specialization'),
+(1,5,21651,'Opening'),
+(1,5,21652,'Closing'),
+(1,5,22027,'Remove Insignia'),
+(1,5,22810,'Opening - No Text'),
+(1,5,45927,'Summon Friend'),
+(1,5,58985,'Perception'),
+(1,5,59752,'Every Man for Himself'),
+(1,5,61437,'Opening'),
+(1,6,81,'Dodge'),
+(1,6,196,'One-Handed Axes'),
+(1,6,197,'Two-Handed Axes'),
+(1,6,200,'Polearms'),
+(1,6,201,'One-Handed Swords'),
+(1,6,202,'Two-Handed Swords'),
+(1,6,203,'Unarmed'),
+(1,6,204,'Defense'),
+(1,6,522,'SPELLDEFENSE (DND)'),
+(1,6,668,'Language Common'),
+(1,6,674,'Dual Wield'),
+(1,6,750,'Plate Mail'),
+(1,6,1843,'Disarm'),
+(1,6,2382,'Generic'),
+(1,6,2479,'Honorless Target'),
+(1,6,3050,'Detect'),
+(1,6,3127,'Parry'),
+(1,6,3275,'Linen Bandage'),
+(1,6,3276,'Heavy Linen Bandage'),
+(1,6,3277,'Wool Bandage'),
+(1,6,3278,'Heavy Wool Bandage'),
+(1,6,3365,'Opening'),
+(1,6,6233,'Closing'),
+(1,6,6246,'Closing'),
+(1,6,6247,'Opening'),
+(1,6,6477,'Opening'),
+(1,6,6478,'Opening'),
+(1,6,6603,'Attack'),
+(1,6,7266,'Duel'),
+(1,6,7267,'Grovel'),
+(1,6,7355,'Stuck'),
+(1,6,7928,'Silk Bandage'),
+(1,6,7929,'Heavy Silk Bandage'),
+(1,6,7934,'Anti-Venom'),
+(1,6,8386,'Attacking'),
+(1,6,8737,'Mail'),
+(1,6,9077,'Leather'),
+(1,6,9078,'Cloth'),
+(1,6,9125,'Generic'),
+(1,6,10840,'Mageweave Bandage'),
+(1,6,10841,'Heavy Mageweave Bandage'),
+(1,6,10846,'First Aid'),
+(1,6,18629,'Runecloth Bandage'),
+(1,6,18630,'Heavy Runecloth Bandage'),
+(1,6,20597,'Sword Specialization'),
+(1,6,20598,'The Human Spirit'),
+(1,6,20599,'Diplomacy'),
+(1,6,20864,'Mace Specialization'),
+(1,6,21651,'Opening'),
+(1,6,21652,'Closing'),
+(1,6,22027,'Remove Insignia'),
+(1,6,22810,'Opening - No Text'),
+(1,6,33391,'Journeyman Riding'),
+(1,6,45462,'Plague Strike'),
+(1,6,45477,'Icy Touch'),
+(1,6,45902,'Blood Strike'),
+(1,6,45903,'Offensive State (DND)'),
+(1,6,45927,'Summon Friend'),
+(1,6,47541,'Death Coil'),
+(1,6,48266,'Blood Presence'),
+(1,6,49410,'Forceful Deflection'),
+(1,6,49576,'Death Grip'),
+(1,6,52665,'Sigil'),
+(1,6,58985,'Perception'),
+(1,6,59752,'Every Man for Himself'),
+(1,6,59879,'Blood Plague'),
+(1,6,59921,'Frost Fever'),
+(1,6,61437,'Opening'),
+(1,6,61455,'Runic Focus'),
+(1,8,81,'Dodge'),
+(1,8,133,'Fireball'),
+(1,8,168,'Frost Armor'),
+(1,8,203,'Unarmed'),
+(1,8,204,'Defense'),
+(1,8,227,'Staves'),
+(1,8,522,'SPELLDEFENSE (DND)'),
+(1,8,668,'Language Common'),
+(1,8,1843,'Disarm'),
+(1,8,2382,'Generic'),
+(1,8,2479,'Honorless Target'),
+(1,8,3050,'Detect'),
+(1,8,3365,'Opening'),
+(1,8,5009,'Wands'),
+(1,8,5019,'Shoot'),
+(1,8,6233,'Closing'),
+(1,8,6246,'Closing'),
+(1,8,6247,'Opening'),
+(1,8,6477,'Opening'),
+(1,8,6478,'Opening'),
+(1,8,6603,'Attack'),
+(1,8,7266,'Duel'),
+(1,8,7267,'Grovel'),
+(1,8,7355,'Stuck'),
+(1,8,8386,'Attacking'),
+(1,8,9078,'Cloth'),
+(1,8,9125,'Generic'),
+(1,8,20597,'Sword Specialization'),
+(1,8,20598,'The Human Spirit'),
+(1,8,20599,'Diplomacy'),
+(1,8,20864,'Mace Specialization'),
+(1,8,21651,'Opening'),
+(1,8,21652,'Closing'),
+(1,8,22027,'Remove Insignia'),
+(1,8,22810,'Opening - No Text'),
+(1,8,45927,'Summon Friend'),
+(1,8,58985,'Perception'),
+(1,8,59752,'Every Man for Himself'),
+(1,8,61437,'Opening'),
+(1,9,81,'Dodge'),
+(1,9,203,'Unarmed'),
+(1,9,204,'Defense'),
+(1,9,522,'SPELLDEFENSE (DND)'),
+(1,9,668,'Language Common'),
+(1,9,686,'Shadow Bolt'),
+(1,9,687,'Demon Skin'),
+(1,9,1180,'Daggers'),
+(1,9,1843,'Disarm'),
+(1,9,2382,'Generic'),
+(1,9,2479,'Honorless Target'),
+(1,9,3050,'Detect'),
+(1,9,3365,'Opening'),
+(1,9,5009,'Wands'),
+(1,9,5019,'Shoot'),
+(1,9,6233,'Closing'),
+(1,9,6246,'Closing'),
+(1,9,6247,'Opening'),
+(1,9,6477,'Opening'),
+(1,9,6478,'Opening'),
+(1,9,6603,'Attack'),
+(1,9,7266,'Duel'),
+(1,9,7267,'Grovel'),
+(1,9,7355,'Stuck'),
+(1,9,8386,'Attacking'),
+(1,9,9078,'Cloth'),
+(1,9,9125,'Generic'),
+(1,9,20597,'Sword Specialization'),
+(1,9,20598,'The Human Spirit'),
+(1,9,20599,'Diplomacy'),
+(1,9,20864,'Mace Specialization'),
+(1,9,21651,'Opening'),
+(1,9,21652,'Closing'),
+(1,9,22027,'Remove Insignia'),
+(1,9,22810,'Opening - No Text'),
+(1,9,45927,'Summon Friend'),
+(1,9,58284,'Chaos Bolt Passive'),
+(1,9,58985,'Perception'),
+(1,9,59752,'Every Man for Himself'),
+(1,9,61437,'Opening'),
+(2,1,78,'Heroic Strike'),
+(2,1,81,'Dodge'),
+(2,1,107,'Block'),
+(2,1,196,'One-Handed Axes'),
+(2,1,197,'Two-Handed Axes'),
+(2,1,201,'One-Handed Swords'),
+(2,1,203,'Unarmed'),
+(2,1,204,'Defense'),
+(2,1,522,'SPELLDEFENSE (DND)'),
+(2,1,669,'Language Orcish'),
+(2,1,1843,'Disarm'),
+(2,1,2382,'Generic'),
+(2,1,2457,'Battle Stance'),
+(2,1,2479,'Honorless Target'),
+(2,1,3050,'Detect'),
+(2,1,3365,'Opening'),
+(2,1,5301,'Defensive State (DND)'),
+(2,1,6233,'Closing'),
+(2,1,6246,'Closing'),
+(2,1,6247,'Opening'),
+(2,1,6477,'Opening'),
+(2,1,6478,'Opening'),
+(2,1,6603,'Attack'),
+(2,1,7266,'Duel'),
+(2,1,7267,'Grovel'),
+(2,1,7355,'Stuck'),
+(2,1,8386,'Attacking'),
+(2,1,8737,'Mail'),
+(2,1,9077,'Leather'),
+(2,1,9078,'Cloth'),
+(2,1,9116,'Shield'),
+(2,1,9125,'Generic'),
+(2,1,20572,'Blood Fury'),
+(2,1,20573,'Hardiness'),
+(2,1,20574,'Axe Specialization'),
+(2,1,21563,'Command'),
+(2,1,21651,'Opening'),
+(2,1,21652,'Closing'),
+(2,1,22027,'Remove Insignia'),
+(2,1,22810,'Opening - No Text'),
+(2,1,32215,'Victorious State'),
+(2,1,45927,'Summon Friend'),
+(2,1,61437,'Opening'),
+(2,3,75,'Auto Shot'),
+(2,3,81,'Dodge'),
+(2,3,196,'One-Handed Axes'),
+(2,3,203,'Unarmed'),
+(2,3,204,'Defense'),
+(2,3,264,'Bows'),
+(2,3,522,'SPELLDEFENSE (DND)'),
+(2,3,669,'Language Orcish'),
+(2,3,1843,'Disarm'),
+(2,3,2382,'Generic'),
+(2,3,2479,'Honorless Target'),
+(2,3,2973,'Raptor Strike'),
+(2,3,3050,'Detect'),
+(2,3,3365,'Opening'),
+(2,3,6233,'Closing'),
+(2,3,6246,'Closing'),
+(2,3,6247,'Opening'),
+(2,3,6477,'Opening'),
+(2,3,6478,'Opening'),
+(2,3,6603,'Attack'),
+(2,3,7266,'Duel'),
+(2,3,7267,'Grovel'),
+(2,3,7355,'Stuck'),
+(2,3,8386,'Attacking'),
+(2,3,9077,'Leather'),
+(2,3,9078,'Cloth'),
+(2,3,9125,'Generic'),
+(2,3,13358,'Defensive State (DND)'),
+(2,3,20572,'Blood Fury'),
+(2,3,20573,'Hardiness'),
+(2,3,20574,'Axe Specialization'),
+(2,3,20576,'Command'),
+(2,3,21651,'Opening'),
+(2,3,21652,'Closing'),
+(2,3,22027,'Remove Insignia'),
+(2,3,22810,'Opening - No Text'),
+(2,3,24949,'Defensive State 2 (DND)'),
+(2,3,34082,'Advantaged State (DND)'),
+(2,3,45927,'Summon Friend'),
+(2,3,61437,'Opening'),
+(2,4,81,'Dodge'),
+(2,4,203,'Unarmed'),
+(2,4,204,'Defense'),
+(2,4,522,'SPELLDEFENSE (DND)'),
+(2,4,669,'Language Orcish'),
+(2,4,1180,'Daggers'),
+(2,4,1752,'Sinister Strike'),
+(2,4,1843,'Disarm'),
+(2,4,2098,'Eviscerate'),
+(2,4,2382,'Generic'),
+(2,4,2479,'Honorless Target'),
+(2,4,2567,'Thrown'),
+(2,4,2764,'Throw'),
+(2,4,3050,'Detect'),
+(2,4,3365,'Opening'),
+(2,4,6233,'Closing'),
+(2,4,6246,'Closing'),
+(2,4,6247,'Opening'),
+(2,4,6477,'Opening'),
+(2,4,6478,'Opening'),
+(2,4,6603,'Attack'),
+(2,4,7266,'Duel'),
+(2,4,7267,'Grovel'),
+(2,4,7355,'Stuck'),
+(2,4,8386,'Attacking'),
+(2,4,9077,'Leather'),
+(2,4,9078,'Cloth'),
+(2,4,9125,'Generic'),
+(2,4,16092,'Defensive State (DND)'),
+(2,4,20572,'Blood Fury'),
+(2,4,20573,'Hardiness'),
+(2,4,20574,'Axe Specialization'),
+(2,4,21184,'Rogue Passive (DND)'),
+(2,4,21563,'Command'),
+(2,4,21651,'Opening'),
+(2,4,21652,'Closing'),
+(2,4,22027,'Remove Insignia'),
+(2,4,22810,'Opening - No Text'),
+(2,4,45927,'Summon Friend'),
+(2,4,61437,'Opening'),
+(2,6,81,'Dodge'),
+(2,6,196,'One-Handed Axes'),
+(2,6,197,'Two-Handed Axes'),
+(2,6,200,'Polearms'),
+(2,6,201,'One-Handed Swords'),
+(2,6,202,'Two-Handed Swords'),
+(2,6,203,'Unarmed'),
+(2,6,204,'Defense'),
+(2,6,522,'SPELLDEFENSE (DND)'),
+(2,6,669,'Language Orcish'),
+(2,6,674,'Dual Wield'),
+(2,6,750,'Plate Mail'),
+(2,6,1843,'Disarm'),
+(2,6,2382,'Generic'),
+(2,6,2479,'Honorless Target'),
+(2,6,3050,'Detect'),
+(2,6,3127,'Parry'),
+(2,6,3275,'Linen Bandage'),
+(2,6,3276,'Heavy Linen Bandage'),
+(2,6,3277,'Wool Bandage'),
+(2,6,3278,'Heavy Wool Bandage'),
+(2,6,3365,'Opening'),
+(2,6,6233,'Closing'),
+(2,6,6246,'Closing'),
+(2,6,6247,'Opening'),
+(2,6,6477,'Opening'),
+(2,6,6478,'Opening'),
+(2,6,6603,'Attack'),
+(2,6,7266,'Duel'),
+(2,6,7267,'Grovel'),
+(2,6,7355,'Stuck'),
+(2,6,7928,'Silk Bandage'),
+(2,6,7929,'Heavy Silk Bandage'),
+(2,6,7934,'Anti-Venom'),
+(2,6,8386,'Attacking'),
+(2,6,8737,'Mail'),
+(2,6,9077,'Leather'),
+(2,6,9078,'Cloth'),
+(2,6,9125,'Generic'),
+(2,6,10840,'Mageweave Bandage'),
+(2,6,10841,'Heavy Mageweave Bandage'),
+(2,6,10846,'First Aid'),
+(2,6,18629,'Runecloth Bandage'),
+(2,6,18630,'Heavy Runecloth Bandage'),
+(2,6,20572,'Blood Fury'),
+(2,6,20573,'Hardiness'),
+(2,6,20574,'Axe Specialization'),
+(2,6,21651,'Opening'),
+(2,6,21652,'Closing'),
+(2,6,22027,'Remove Insignia'),
+(2,6,22810,'Opening - No Text'),
+(2,6,33391,'Journeyman Riding'),
+(2,6,45462,'Plague Strike'),
+(2,6,45477,'Icy Touch'),
+(2,6,45902,'Blood Strike'),
+(2,6,45903,'Offensive State (DND)'),
+(2,6,45927,'Summon Friend'),
+(2,6,47541,'Death Coil'),
+(2,6,48266,'Blood Presence'),
+(2,6,49410,'Forceful Deflection'),
+(2,6,49576,'Death Grip'),
+(2,6,52665,'Sigil'),
+(2,6,54562,'Command'),
+(2,6,59879,'Blood Plague'),
+(2,6,59921,'Frost Fever'),
+(2,6,61437,'Opening'),
+(2,6,61455,'Runic Focus'),
+(2,7,81,'Dodge'),
+(2,7,107,'Block'),
+(2,7,198,'One-Handed Maces'),
+(2,7,203,'Unarmed'),
+(2,7,204,'Defense'),
+(2,7,227,'Staves'),
+(2,7,331,'Healing Wave'),
+(2,7,403,'Lightning Bolt'),
+(2,7,522,'SPELLDEFENSE (DND)'),
+(2,7,669,'Language Orcish'),
+(2,7,1843,'Disarm'),
+(2,7,2382,'Generic'),
+(2,7,2479,'Honorless Target'),
+(2,7,3050,'Detect'),
+(2,7,3365,'Opening'),
+(2,7,6233,'Closing'),
+(2,7,6246,'Closing'),
+(2,7,6247,'Opening'),
+(2,7,6477,'Opening'),
+(2,7,6478,'Opening'),
+(2,7,6603,'Attack'),
+(2,7,7266,'Duel'),
+(2,7,7267,'Grovel'),
+(2,7,7355,'Stuck'),
+(2,7,8386,'Attacking'),
+(2,7,9077,'Leather'),
+(2,7,9078,'Cloth'),
+(2,7,9116,'Shield'),
+(2,7,9125,'Generic'),
+(2,7,20573,'Hardiness'),
+(2,7,20574,'Axe Specialization'),
+(2,7,21563,'Command'),
+(2,7,21651,'Opening'),
+(2,7,21652,'Closing'),
+(2,7,22027,'Remove Insignia'),
+(2,7,22810,'Opening - No Text'),
+(2,7,27763,'Totem'),
+(2,7,33697,'Blood Fury'),
+(2,7,45927,'Summon Friend'),
+(2,7,61437,'Opening'),
+(2,9,81,'Dodge'),
+(2,9,203,'Unarmed'),
+(2,9,204,'Defense'),
+(2,9,522,'SPELLDEFENSE (DND)'),
+(2,9,669,'Language Orcish'),
+(2,9,686,'Shadow Bolt'),
+(2,9,687,'Demon Skin'),
+(2,9,1180,'Daggers'),
+(2,9,1843,'Disarm'),
+(2,9,2382,'Generic'),
+(2,9,2479,'Honorless Target'),
+(2,9,3050,'Detect'),
+(2,9,3365,'Opening'),
+(2,9,5009,'Wands'),
+(2,9,5019,'Shoot'),
+(2,9,6233,'Closing'),
+(2,9,6246,'Closing'),
+(2,9,6247,'Opening'),
+(2,9,6477,'Opening'),
+(2,9,6478,'Opening'),
+(2,9,6603,'Attack'),
+(2,9,7266,'Duel'),
+(2,9,7267,'Grovel'),
+(2,9,7355,'Stuck'),
+(2,9,8386,'Attacking'),
+(2,9,9078,'Cloth'),
+(2,9,9125,'Generic'),
+(2,9,20573,'Hardiness'),
+(2,9,20574,'Axe Specialization'),
+(2,9,20575,'Command'),
+(2,9,21651,'Opening'),
+(2,9,21652,'Closing'),
+(2,9,22027,'Remove Insignia'),
+(2,9,22810,'Opening - No Text'),
+(2,9,33702,'Blood Fury'),
+(2,9,45927,'Summon Friend'),
+(2,9,58284,'Chaos Bolt Passive'),
+(2,9,61437,'Opening'),
+(3,1,78,'Heroic Strike'),
+(3,1,81,'Dodge'),
+(3,1,107,'Block'),
+(3,1,196,'One-Handed Axes'),
+(3,1,197,'Two-Handed Axes'),
+(3,1,198,'One-Handed Maces'),
+(3,1,203,'Unarmed'),
+(3,1,204,'Defense'),
+(3,1,522,'SPELLDEFENSE (DND)'),
+(3,1,668,'Language Common'),
+(3,1,672,'Language Dwarven'),
+(3,1,1843,'Disarm'),
+(3,1,2382,'Generic'),
+(3,1,2457,'Battle Stance'),
+(3,1,2479,'Honorless Target'),
+(3,1,2481,'Find Treasure'),
+(3,1,3050,'Detect'),
+(3,1,3365,'Opening'),
+(3,1,5301,'Defensive State (DND)'),
+(3,1,6233,'Closing'),
+(3,1,6246,'Closing'),
+(3,1,6247,'Opening'),
+(3,1,6477,'Opening'),
+(3,1,6478,'Opening'),
+(3,1,6603,'Attack'),
+(3,1,7266,'Duel'),
+(3,1,7267,'Grovel'),
+(3,1,7355,'Stuck'),
+(3,1,8386,'Attacking'),
+(3,1,8737,'Mail'),
+(3,1,9077,'Leather'),
+(3,1,9078,'Cloth'),
+(3,1,9116,'Shield'),
+(3,1,9125,'Generic'),
+(3,1,20594,'Stoneform'),
+(3,1,20595,'Gun Specialization'),
+(3,1,20596,'Frost Resistance'),
+(3,1,21651,'Opening'),
+(3,1,21652,'Closing'),
+(3,1,22027,'Remove Insignia'),
+(3,1,22810,'Opening - No Text'),
+(3,1,32215,'Victorious State'),
+(3,1,45927,'Summon Friend'),
+(3,1,59224,'Mace Specialization'),
+(3,1,61437,'Opening'),
+(3,2,81,'Dodge'),
+(3,2,107,'Block'),
+(3,2,198,'One-Handed Maces'),
+(3,2,199,'Two-Handed Maces'),
+(3,2,203,'Unarmed'),
+(3,2,204,'Defense'),
+(3,2,522,'SPELLDEFENSE (DND)'),
+(3,2,635,'Holy Light'),
+(3,2,668,'Language Common'),
+(3,2,672,'Language Dwarven'),
+(3,2,1843,'Disarm'),
+(3,2,2382,'Generic'),
+(3,2,2479,'Honorless Target'),
+(3,2,2481,'Find Treasure'),
+(3,2,3050,'Detect'),
+(3,2,3365,'Opening'),
+(3,2,6233,'Closing'),
+(3,2,6246,'Closing'),
+(3,2,6247,'Opening'),
+(3,2,6477,'Opening'),
+(3,2,6478,'Opening'),
+(3,2,6603,'Attack'),
+(3,2,7266,'Duel'),
+(3,2,7267,'Grovel'),
+(3,2,7355,'Stuck'),
+(3,2,8386,'Attacking'),
+(3,2,8737,'Mail'),
+(3,2,9077,'Leather'),
+(3,2,9078,'Cloth'),
+(3,2,9116,'Shield'),
+(3,2,9125,'Generic'),
+(3,2,20154,'Seal of Righteousness'),
+(3,2,20594,'Stoneform'),
+(3,2,20595,'Gun Specialization'),
+(3,2,20596,'Frost Resistance'),
+(3,2,21651,'Opening'),
+(3,2,21652,'Closing'),
+(3,2,22027,'Remove Insignia'),
+(3,2,22810,'Opening - No Text'),
+(3,2,27762,'Libram'),
+(3,2,45927,'Summon Friend'),
+(3,2,59224,'Mace Specialization'),
+(3,2,61437,'Opening'),
+(3,3,75,'Auto Shot'),
+(3,3,81,'Dodge'),
+(3,3,196,'One-Handed Axes'),
+(3,3,203,'Unarmed'),
+(3,3,204,'Defense'),
+(3,3,266,'Guns'),
+(3,3,522,'SPELLDEFENSE (DND)'),
+(3,3,668,'Language Common'),
+(3,3,672,'Language Dwarven'),
+(3,3,1843,'Disarm'),
+(3,3,2382,'Generic'),
+(3,3,2479,'Honorless Target'),
+(3,3,2481,'Find Treasure'),
+(3,3,2973,'Raptor Strike'),
+(3,3,3050,'Detect'),
+(3,3,3365,'Opening'),
+(3,3,6233,'Closing'),
+(3,3,6246,'Closing'),
+(3,3,6247,'Opening'),
+(3,3,6477,'Opening'),
+(3,3,6478,'Opening'),
+(3,3,6603,'Attack'),
+(3,3,7266,'Duel'),
+(3,3,7267,'Grovel'),
+(3,3,7355,'Stuck'),
+(3,3,8386,'Attacking'),
+(3,3,9077,'Leather'),
+(3,3,9078,'Cloth'),
+(3,3,9125,'Generic'),
+(3,3,13358,'Defensive State (DND)'),
+(3,3,20594,'Stoneform'),
+(3,3,20595,'Gun Specialization'),
+(3,3,20596,'Frost Resistance'),
+(3,3,21651,'Opening'),
+(3,3,21652,'Closing'),
+(3,3,22027,'Remove Insignia'),
+(3,3,22810,'Opening - No Text'),
+(3,3,24949,'Defensive State 2 (DND)'),
+(3,3,34082,'Advantaged State (DND)'),
+(3,3,45927,'Summon Friend'),
+(3,3,59224,'Mace Specialization'),
+(3,3,61437,'Opening'),
+(3,4,81,'Dodge'),
+(3,4,203,'Unarmed'),
+(3,4,204,'Defense'),
+(3,4,522,'SPELLDEFENSE (DND)'),
+(3,4,668,'Language Common'),
+(3,4,672,'Language Dwarven'),
+(3,4,1180,'Daggers'),
+(3,4,1752,'Sinister Strike'),
+(3,4,1843,'Disarm'),
+(3,4,2098,'Eviscerate'),
+(3,4,2382,'Generic'),
+(3,4,2479,'Honorless Target'),
+(3,4,2481,'Find Treasure'),
+(3,4,2567,'Thrown'),
+(3,4,2764,'Throw'),
+(3,4,3050,'Detect'),
+(3,4,3365,'Opening'),
+(3,4,6233,'Closing'),
+(3,4,6246,'Closing'),
+(3,4,6247,'Opening'),
+(3,4,6477,'Opening'),
+(3,4,6478,'Opening'),
+(3,4,6603,'Attack'),
+(3,4,7266,'Duel'),
+(3,4,7267,'Grovel'),
+(3,4,7355,'Stuck'),
+(3,4,8386,'Attacking'),
+(3,4,9077,'Leather'),
+(3,4,9078,'Cloth'),
+(3,4,9125,'Generic'),
+(3,4,16092,'Defensive State (DND)'),
+(3,4,20594,'Stoneform'),
+(3,4,20595,'Gun Specialization'),
+(3,4,20596,'Frost Resistance'),
+(3,4,21184,'Rogue Passive (DND)'),
+(3,4,21651,'Opening'),
+(3,4,21652,'Closing'),
+(3,4,22027,'Remove Insignia'),
+(3,4,22810,'Opening - No Text'),
+(3,4,45927,'Summon Friend'),
+(3,4,59224,'Mace Specialization'),
+(3,4,61437,'Opening'),
+(3,5,81,'Dodge'),
+(3,5,198,'One-Handed Maces'),
+(3,5,203,'Unarmed'),
+(3,5,204,'Defense'),
+(3,5,522,'SPELLDEFENSE (DND)'),
+(3,5,585,'Smite'),
+(3,5,668,'Language Common'),
+(3,5,672,'Language Dwarven'),
+(3,5,1843,'Disarm'),
+(3,5,2050,'Lesser Heal'),
+(3,5,2382,'Generic'),
+(3,5,2479,'Honorless Target'),
+(3,5,2481,'Find Treasure'),
+(3,5,3050,'Detect'),
+(3,5,3365,'Opening'),
+(3,5,5009,'Wands'),
+(3,5,5019,'Shoot'),
+(3,5,6233,'Closing'),
+(3,5,6246,'Closing'),
+(3,5,6247,'Opening'),
+(3,5,6477,'Opening'),
+(3,5,6478,'Opening'),
+(3,5,6603,'Attack'),
+(3,5,7266,'Duel'),
+(3,5,7267,'Grovel'),
+(3,5,7355,'Stuck'),
+(3,5,8386,'Attacking'),
+(3,5,9078,'Cloth'),
+(3,5,9125,'Generic'),
+(3,5,20594,'Stoneform'),
+(3,5,20595,'Gun Specialization'),
+(3,5,20596,'Frost Resistance'),
+(3,5,21651,'Opening'),
+(3,5,21652,'Closing'),
+(3,5,22027,'Remove Insignia'),
+(3,5,22810,'Opening - No Text'),
+(3,5,45927,'Summon Friend'),
+(3,5,59224,'Mace Specialization'),
+(3,5,61437,'Opening'),
+(3,6,81,'Dodge'),
+(3,6,196,'One-Handed Axes'),
+(3,6,197,'Two-Handed Axes'),
+(3,6,200,'Polearms'),
+(3,6,201,'One-Handed Swords'),
+(3,6,202,'Two-Handed Swords'),
+(3,6,203,'Unarmed'),
+(3,6,204,'Defense'),
+(3,6,522,'SPELLDEFENSE (DND)'),
+(3,6,668,'Language Common'),
+(3,6,672,'Language Dwarven'),
+(3,6,674,'Dual Wield'),
+(3,6,750,'Plate Mail'),
+(3,6,1843,'Disarm'),
+(3,6,2382,'Generic'),
+(3,6,2479,'Honorless Target'),
+(3,6,2481,'Find Treasure'),
+(3,6,3050,'Detect'),
+(3,6,3127,'Parry'),
+(3,6,3275,'Linen Bandage'),
+(3,6,3276,'Heavy Linen Bandage'),
+(3,6,3277,'Wool Bandage'),
+(3,6,3278,'Heavy Wool Bandage'),
+(3,6,3365,'Opening'),
+(3,6,6233,'Closing'),
+(3,6,6246,'Closing'),
+(3,6,6247,'Opening'),
+(3,6,6477,'Opening'),
+(3,6,6478,'Opening'),
+(3,6,6603,'Attack'),
+(3,6,7266,'Duel'),
+(3,6,7267,'Grovel'),
+(3,6,7355,'Stuck'),
+(3,6,7928,'Silk Bandage'),
+(3,6,7929,'Heavy Silk Bandage'),
+(3,6,7934,'Anti-Venom'),
+(3,6,8386,'Attacking'),
+(3,6,8737,'Mail'),
+(3,6,9077,'Leather'),
+(3,6,9078,'Cloth'),
+(3,6,9125,'Generic'),
+(3,6,10840,'Mageweave Bandage'),
+(3,6,10841,'Heavy Mageweave Bandage'),
+(3,6,10846,'First Aid'),
+(3,6,18629,'Runecloth Bandage'),
+(3,6,18630,'Heavy Runecloth Bandage'),
+(3,6,20594,'Stoneform'),
+(3,6,20595,'Gun Specialization'),
+(3,6,20596,'Frost Resistance'),
+(3,6,21651,'Opening'),
+(3,6,21652,'Closing'),
+(3,6,22027,'Remove Insignia'),
+(3,6,22810,'Opening - No Text'),
+(3,6,33391,'Journeyman Riding'),
+(3,6,45462,'Plague Strike'),
+(3,6,45477,'Icy Touch'),
+(3,6,45902,'Blood Strike'),
+(3,6,45903,'Offensive State (DND)'),
+(3,6,45927,'Summon Friend'),
+(3,6,47541,'Death Coil'),
+(3,6,48266,'Blood Presence'),
+(3,6,49410,'Forceful Deflection'),
+(3,6,49576,'Death Grip'),
+(3,6,52665,'Sigil'),
+(3,6,59224,'Mace Specialization'),
+(3,6,59879,'Blood Plague'),
+(3,6,59921,'Frost Fever'),
+(3,6,61437,'Opening'),
+(3,6,61455,'Runic Focus'),
+(4,1,78,'Heroic Strike'),
+(4,1,81,'Dodge'),
+(4,1,107,'Block'),
+(4,1,198,'One-Handed Maces'),
+(4,1,201,'One-Handed Swords'),
+(4,1,203,'Unarmed'),
+(4,1,204,'Defense'),
+(4,1,522,'SPELLDEFENSE (DND)'),
+(4,1,668,'Language Common'),
+(4,1,671,'Language Darnassian'),
+(4,1,1180,'Daggers'),
+(4,1,1843,'Disarm'),
+(4,1,2382,'Generic'),
+(4,1,2457,'Battle Stance'),
+(4,1,2479,'Honorless Target'),
+(4,1,3050,'Detect'),
+(4,1,3365,'Opening'),
+(4,1,5301,'Defensive State (DND)'),
+(4,1,6233,'Closing'),
+(4,1,6246,'Closing'),
+(4,1,6247,'Opening'),
+(4,1,6477,'Opening'),
+(4,1,6478,'Opening'),
+(4,1,6603,'Attack'),
+(4,1,7266,'Duel'),
+(4,1,7267,'Grovel'),
+(4,1,7355,'Stuck'),
+(4,1,8386,'Attacking'),
+(4,1,8737,'Mail'),
+(4,1,9077,'Leather'),
+(4,1,9078,'Cloth'),
+(4,1,9116,'Shield'),
+(4,1,9125,'Generic'),
+(4,1,20582,'Quickness'),
+(4,1,20583,'Nature Resistance'),
+(4,1,20585,'Wisp Spirit'),
+(4,1,21651,'Opening'),
+(4,1,21652,'Closing'),
+(4,1,22027,'Remove Insignia'),
+(4,1,22810,'Opening - No Text'),
+(4,1,32215,'Victorious State'),
+(4,1,45927,'Summon Friend'),
+(4,1,58984,'Shadowmelt'),
+(4,1,61437,'Opening'),
+(4,3,75,'Auto Shot'),
+(4,3,81,'Dodge'),
+(4,3,203,'Unarmed'),
+(4,3,204,'Defense'),
+(4,3,264,'Bows'),
+(4,3,522,'SPELLDEFENSE (DND)'),
+(4,3,668,'Language Common'),
+(4,3,671,'Language Darnassian'),
+(4,3,1180,'Daggers'),
+(4,3,1843,'Disarm'),
+(4,3,2382,'Generic'),
+(4,3,2479,'Honorless Target'),
+(4,3,2973,'Raptor Strike'),
+(4,3,3050,'Detect'),
+(4,3,3365,'Opening'),
+(4,3,6233,'Closing'),
+(4,3,6246,'Closing'),
+(4,3,6247,'Opening'),
+(4,3,6477,'Opening'),
+(4,3,6478,'Opening'),
+(4,3,6603,'Attack'),
+(4,3,7266,'Duel'),
+(4,3,7267,'Grovel'),
+(4,3,7355,'Stuck'),
+(4,3,8386,'Attacking'),
+(4,3,9077,'Leather'),
+(4,3,9078,'Cloth'),
+(4,3,9125,'Generic'),
+(4,3,13358,'Defensive State (DND)'),
+(4,3,20582,'Quickness'),
+(4,3,20583,'Nature Resistance'),
+(4,3,20585,'Wisp Spirit'),
+(4,3,21651,'Opening'),
+(4,3,21652,'Closing'),
+(4,3,22027,'Remove Insignia'),
+(4,3,22810,'Opening - No Text'),
+(4,3,24949,'Defensive State 2 (DND)'),
+(4,3,34082,'Advantaged State (DND)'),
+(4,3,45927,'Summon Friend'),
+(4,3,58984,'Shadowmelt'),
+(4,3,61437,'Opening'),
+(4,4,81,'Dodge'),
+(4,4,203,'Unarmed'),
+(4,4,204,'Defense'),
+(4,4,522,'SPELLDEFENSE (DND)'),
+(4,4,668,'Language Common'),
+(4,4,671,'Language Darnassian'),
+(4,4,1180,'Daggers'),
+(4,4,1752,'Sinister Strike'),
+(4,4,1843,'Disarm'),
+(4,4,2098,'Eviscerate'),
+(4,4,2382,'Generic'),
+(4,4,2479,'Honorless Target'),
+(4,4,2567,'Thrown'),
+(4,4,2764,'Throw'),
+(4,4,3050,'Detect'),
+(4,4,3365,'Opening'),
+(4,4,6233,'Closing'),
+(4,4,6246,'Closing'),
+(4,4,6247,'Opening'),
+(4,4,6477,'Opening'),
+(4,4,6478,'Opening'),
+(4,4,6603,'Attack'),
+(4,4,7266,'Duel'),
+(4,4,7267,'Grovel'),
+(4,4,7355,'Stuck'),
+(4,4,8386,'Attacking'),
+(4,4,9077,'Leather'),
+(4,4,9078,'Cloth'),
+(4,4,9125,'Generic'),
+(4,4,16092,'Defensive State (DND)'),
+(4,4,20582,'Quickness'),
+(4,4,20583,'Nature Resistance'),
+(4,4,20585,'Wisp Spirit'),
+(4,4,21184,'Rogue Passive (DND)'),
+(4,4,21651,'Opening'),
+(4,4,21652,'Closing'),
+(4,4,22027,'Remove Insignia'),
+(4,4,22810,'Opening - No Text'),
+(4,4,45927,'Summon Friend'),
+(4,4,58984,'Shadowmelt'),
+(4,4,61437,'Opening'),
+(4,5,81,'Dodge'),
+(4,5,198,'One-Handed Maces'),
+(4,5,203,'Unarmed'),
+(4,5,204,'Defense'),
+(4,5,522,'SPELLDEFENSE (DND)'),
+(4,5,585,'Smite'),
+(4,5,668,'Language Common'),
+(4,5,671,'Language Darnassian'),
+(4,5,1843,'Disarm'),
+(4,5,2050,'Lesser Heal'),
+(4,5,2382,'Generic'),
+(4,5,2479,'Honorless Target'),
+(4,5,3050,'Detect'),
+(4,5,3365,'Opening'),
+(4,5,5009,'Wands'),
+(4,5,5019,'Shoot'),
+(4,5,6233,'Closing'),
+(4,5,6246,'Closing'),
+(4,5,6247,'Opening'),
+(4,5,6477,'Opening'),
+(4,5,6478,'Opening'),
+(4,5,6603,'Attack'),
+(4,5,7266,'Duel'),
+(4,5,7267,'Grovel'),
+(4,5,7355,'Stuck'),
+(4,5,8386,'Attacking'),
+(4,5,9078,'Cloth'),
+(4,5,9125,'Generic'),
+(4,5,20582,'Quickness'),
+(4,5,20583,'Nature Resistance'),
+(4,5,20585,'Wisp Spirit'),
+(4,5,21651,'Opening'),
+(4,5,21652,'Closing'),
+(4,5,22027,'Remove Insignia'),
+(4,5,22810,'Opening - No Text'),
+(4,5,45927,'Summon Friend'),
+(4,5,58984,'Shadowmelt'),
+(4,5,61437,'Opening'),
+(4,6,81,'Dodge'),
+(4,6,196,'One-Handed Axes'),
+(4,6,197,'Two-Handed Axes'),
+(4,6,200,'Polearms'),
+(4,6,201,'One-Handed Swords'),
+(4,6,202,'Two-Handed Swords'),
+(4,6,203,'Unarmed'),
+(4,6,204,'Defense'),
+(4,6,522,'SPELLDEFENSE (DND)'),
+(4,6,668,'Language Common'),
+(4,6,671,'Language Darnassian'),
+(4,6,674,'Dual Wield'),
+(4,6,750,'Plate Mail'),
+(4,6,1843,'Disarm'),
+(4,6,2382,'Generic'),
+(4,6,2479,'Honorless Target'),
+(4,6,3050,'Detect'),
+(4,6,3127,'Parry'),
+(4,6,3275,'Linen Bandage'),
+(4,6,3276,'Heavy Linen Bandage'),
+(4,6,3277,'Wool Bandage'),
+(4,6,3278,'Heavy Wool Bandage'),
+(4,6,3365,'Opening'),
+(4,6,6233,'Closing'),
+(4,6,6246,'Closing'),
+(4,6,6247,'Opening'),
+(4,6,6477,'Opening'),
+(4,6,6478,'Opening'),
+(4,6,6603,'Attack'),
+(4,6,7266,'Duel'),
+(4,6,7267,'Grovel'),
+(4,6,7355,'Stuck'),
+(4,6,7928,'Silk Bandage'),
+(4,6,7929,'Heavy Silk Bandage'),
+(4,6,7934,'Anti-Venom'),
+(4,6,8386,'Attacking'),
+(4,6,8737,'Mail'),
+(4,6,9077,'Leather'),
+(4,6,9078,'Cloth'),
+(4,6,9125,'Generic'),
+(4,6,10840,'Mageweave Bandage'),
+(4,6,10841,'Heavy Mageweave Bandage'),
+(4,6,10846,'First Aid'),
+(4,6,18629,'Runecloth Bandage'),
+(4,6,18630,'Heavy Runecloth Bandage'),
+(4,6,20582,'Quickness'),
+(4,6,20583,'Nature Resistance'),
+(4,6,20585,'Wisp Spirit'),
+(4,6,21651,'Opening'),
+(4,6,21652,'Closing'),
+(4,6,22027,'Remove Insignia'),
+(4,6,22810,'Opening - No Text'),
+(4,6,33391,'Journeyman Riding'),
+(4,6,45462,'Plague Strike'),
+(4,6,45477,'Icy Touch'),
+(4,6,45902,'Blood Strike'),
+(4,6,45903,'Offensive State (DND)'),
+(4,6,45927,'Summon Friend'),
+(4,6,47541,'Death Coil'),
+(4,6,48266,'Blood Presence'),
+(4,6,49410,'Forceful Deflection'),
+(4,6,49576,'Death Grip'),
+(4,6,52665,'Sigil'),
+(4,6,58984,'Shadowmeld'),
+(4,6,59879,'Blood Plague'),
+(4,6,59921,'Frost Fever'),
+(4,6,61437,'Opening'),
+(4,6,61455,'Runic Focus'),
+(4,11,81,'Dodge'),
+(4,11,203,'Unarmed'),
+(4,11,204,'Defense'),
+(4,11,227,'Staves'),
+(4,11,522,'SPELLDEFENSE (DND)'),
+(4,11,668,'Language Common'),
+(4,11,671,'Language Darnassian'),
+(4,11,1180,'Daggers'),
+(4,11,1843,'Disarm'),
+(4,11,2382,'Generic'),
+(4,11,2479,'Honorless Target'),
+(4,11,3050,'Detect'),
+(4,11,3365,'Opening'),
+(4,11,5176,'Wrath'),
+(4,11,5185,'Healing Touch'),
+(4,11,6233,'Closing'),
+(4,11,6246,'Closing'),
+(4,11,6247,'Opening'),
+(4,11,6477,'Opening'),
+(4,11,6478,'Opening'),
+(4,11,6603,'Attack'),
+(4,11,7266,'Duel'),
+(4,11,7267,'Grovel'),
+(4,11,7355,'Stuck'),
+(4,11,8386,'Attacking'),
+(4,11,9077,'Leather'),
+(4,11,9078,'Cloth'),
+(4,11,9125,'Generic'),
+(4,11,20582,'Quickness'),
+(4,11,20583,'Nature Resistance'),
+(4,11,20585,'Wisp Spirit'),
+(4,11,21651,'Opening'),
+(4,11,21652,'Closing'),
+(4,11,22027,'Remove Insignia'),
+(4,11,22810,'Opening - No Text'),
+(4,11,27764,'Fetish'),
+(4,11,45927,'Summon Friend'),
+(4,11,58984,'Shadowmelt'),
+(4,11,61437,'Opening'),
+(5,1,78,'Heroic Strike'),
+(5,1,81,'Dodge'),
+(5,1,107,'Block'),
+(5,1,201,'One-Handed Swords'),
+(5,1,202,'Two-Handed Swords'),
+(5,1,203,'Unarmed'),
+(5,1,204,'Defense'),
+(5,1,522,'SPELLDEFENSE (DND)'),
+(5,1,669,'Language Orcish'),
+(5,1,1180,'Daggers'),
+(5,1,1843,'Disarm'),
+(5,1,2382,'Generic'),
+(5,1,2457,'Battle Stance'),
+(5,1,2479,'Honorless Target'),
+(5,1,3050,'Detect'),
+(5,1,3365,'Opening'),
+(5,1,5227,'Underwater Breathing'),
+(5,1,5301,'Defensive State (DND)'),
+(5,1,6233,'Closing'),
+(5,1,6246,'Closing'),
+(5,1,6247,'Opening'),
+(5,1,6477,'Opening'),
+(5,1,6478,'Opening'),
+(5,1,6603,'Attack'),
+(5,1,7266,'Duel'),
+(5,1,7267,'Grovel'),
+(5,1,7355,'Stuck'),
+(5,1,7744,'Will of the Forsaken'),
+(5,1,8386,'Attacking'),
+(5,1,8737,'Mail'),
+(5,1,9077,'Leather'),
+(5,1,9078,'Cloth'),
+(5,1,9116,'Shield'),
+(5,1,9125,'Generic'),
+(5,1,17737,'Language Gutterspeak'),
+(5,1,20577,'Cannibalize'),
+(5,1,20579,'Shadow Resistance'),
+(5,1,21651,'Opening'),
+(5,1,21652,'Closing'),
+(5,1,22027,'Remove Insignia'),
+(5,1,22810,'Opening - No Text'),
+(5,1,32215,'Victorious State'),
+(5,1,45927,'Summon Friend'),
+(5,1,61437,'Opening'),
+(5,4,81,'Dodge'),
+(5,4,203,'Unarmed'),
+(5,4,204,'Defense'),
+(5,4,522,'SPELLDEFENSE (DND)'),
+(5,4,669,'Language Orcish'),
+(5,4,1180,'Daggers'),
+(5,4,1752,'Sinister Strike'),
+(5,4,1843,'Disarm'),
+(5,4,2098,'Eviscerate'),
+(5,4,2382,'Generic'),
+(5,4,2479,'Honorless Target'),
+(5,4,2567,'Thrown'),
+(5,4,2764,'Throw'),
+(5,4,3050,'Detect'),
+(5,4,3365,'Opening'),
+(5,4,5227,'Underwater Breathing'),
+(5,4,6233,'Closing'),
+(5,4,6246,'Closing'),
+(5,4,6247,'Opening'),
+(5,4,6477,'Opening'),
+(5,4,6478,'Opening'),
+(5,4,6603,'Attack'),
+(5,4,7266,'Duel'),
+(5,4,7267,'Grovel'),
+(5,4,7355,'Stuck'),
+(5,4,7744,'Will of the Forsaken'),
+(5,4,8386,'Attacking'),
+(5,4,9077,'Leather'),
+(5,4,9078,'Cloth'),
+(5,4,9125,'Generic'),
+(5,4,16092,'Defensive State (DND)'),
+(5,4,17737,'Language Gutterspeak'),
+(5,4,20577,'Cannibalize'),
+(5,4,20579,'Shadow Resistance'),
+(5,4,21184,'Rogue Passive (DND)'),
+(5,4,21651,'Opening'),
+(5,4,21652,'Closing'),
+(5,4,22027,'Remove Insignia'),
+(5,4,22810,'Opening - No Text'),
+(5,4,45927,'Summon Friend'),
+(5,4,61437,'Opening'),
+(5,5,81,'Dodge'),
+(5,5,198,'One-Handed Maces'),
+(5,5,203,'Unarmed'),
+(5,5,204,'Defense'),
+(5,5,522,'SPELLDEFENSE (DND)'),
+(5,5,585,'Smite'),
+(5,5,669,'Language Orcish'),
+(5,5,1843,'Disarm'),
+(5,5,2050,'Lesser Heal'),
+(5,5,2382,'Generic'),
+(5,5,2479,'Honorless Target'),
+(5,5,3050,'Detect'),
+(5,5,3365,'Opening'),
+(5,5,5009,'Wands'),
+(5,5,5019,'Shoot'),
+(5,5,5227,'Underwater Breathing'),
+(5,5,6233,'Closing'),
+(5,5,6246,'Closing'),
+(5,5,6247,'Opening'),
+(5,5,6477,'Opening'),
+(5,5,6478,'Opening'),
+(5,5,6603,'Attack'),
+(5,5,7266,'Duel'),
+(5,5,7267,'Grovel'),
+(5,5,7355,'Stuck'),
+(5,5,7744,'Will of the Forsaken'),
+(5,5,8386,'Attacking'),
+(5,5,9078,'Cloth'),
+(5,5,9125,'Generic'),
+(5,5,17737,'Language Gutterspeak'),
+(5,5,20577,'Cannibalize'),
+(5,5,20579,'Shadow Resistance'),
+(5,5,21651,'Opening'),
+(5,5,21652,'Closing'),
+(5,5,22027,'Remove Insignia'),
+(5,5,22810,'Opening - No Text'),
+(5,5,45927,'Summon Friend'),
+(5,5,61437,'Opening'),
+(5,6,81,'Dodge'),
+(5,6,196,'One-Handed Axes'),
+(5,6,197,'Two-Handed Axes'),
+(5,6,200,'Polearms'),
+(5,6,201,'One-Handed Swords'),
+(5,6,202,'Two-Handed Swords'),
+(5,6,203,'Unarmed'),
+(5,6,204,'Defense'),
+(5,6,522,'SPELLDEFENSE (DND)'),
+(5,6,669,'Language Orcish'),
+(5,6,674,'Dual Wield'),
+(5,6,750,'Plate Mail'),
+(5,6,1843,'Disarm'),
+(5,6,2382,'Generic'),
+(5,6,2479,'Honorless Target'),
+(5,6,3050,'Detect'),
+(5,6,3127,'Parry'),
+(5,6,3275,'Linen Bandage'),
+(5,6,3276,'Heavy Linen Bandage'),
+(5,6,3277,'Wool Bandage'),
+(5,6,3278,'Heavy Wool Bandage'),
+(5,6,3365,'Opening'),
+(5,6,5227,'Underwater Breathing'),
+(5,6,6233,'Closing'),
+(5,6,6246,'Closing'),
+(5,6,6247,'Opening'),
+(5,6,6477,'Opening'),
+(5,6,6478,'Opening'),
+(5,6,6603,'Attack'),
+(5,6,7266,'Duel'),
+(5,6,7267,'Grovel'),
+(5,6,7355,'Stuck'),
+(5,6,7744,'Will of the Forsaken'),
+(5,6,7928,'Silk Bandage'),
+(5,6,7929,'Heavy Silk Bandage'),
+(5,6,7934,'Anti-Venom'),
+(5,6,8386,'Attacking'),
+(5,6,8737,'Mail'),
+(5,6,9077,'Leather'),
+(5,6,9078,'Cloth'),
+(5,6,9125,'Generic'),
+(5,6,10840,'Mageweave Bandage'),
+(5,6,10841,'Heavy Mageweave Bandage'),
+(5,6,10846,'First Aid'),
+(5,6,17737,'Language Gutterspeak'),
+(5,6,18629,'Runecloth Bandage'),
+(5,6,18630,'Heavy Runecloth Bandage'),
+(5,6,20577,'Cannibalize'),
+(5,6,20579,'Shadow Resistance'),
+(5,6,21651,'Opening'),
+(5,6,21652,'Closing'),
+(5,6,22027,'Remove Insignia'),
+(5,6,22810,'Opening - No Text'),
+(5,6,33391,'Journeyman Riding'),
+(5,6,45462,'Plague Strike'),
+(5,6,45477,'Icy Touch'),
+(5,6,45902,'Blood Strike'),
+(5,6,45903,'Offensive State (DND)'),
+(5,6,45927,'Summon Friend'),
+(5,6,47541,'Death Coil'),
+(5,6,48266,'Blood Presence'),
+(5,6,49410,'Forceful Deflection'),
+(5,6,49576,'Death Grip'),
+(5,6,52665,'Sigil'),
+(5,6,59879,'Blood Plague'),
+(5,6,59921,'Frost Fever'),
+(5,6,61437,'Opening'),
+(5,6,61455,'Runic Focus'),
+(5,8,81,'Dodge'),
+(5,8,133,'Fireball'),
+(5,8,168,'Frost Armor'),
+(5,8,203,'Unarmed'),
+(5,8,204,'Defense'),
+(5,8,227,'Staves'),
+(5,8,522,'SPELLDEFENSE (DND)'),
+(5,8,669,'Language Orcish'),
+(5,8,1843,'Disarm'),
+(5,8,2382,'Generic'),
+(5,8,2479,'Honorless Target'),
+(5,8,3050,'Detect'),
+(5,8,3365,'Opening'),
+(5,8,5009,'Wands'),
+(5,8,5019,'Shoot'),
+(5,8,5227,'Underwater Breathing'),
+(5,8,6233,'Closing'),
+(5,8,6246,'Closing'),
+(5,8,6247,'Opening'),
+(5,8,6477,'Opening'),
+(5,8,6478,'Opening'),
+(5,8,6603,'Attack'),
+(5,8,7266,'Duel'),
+(5,8,7267,'Grovel'),
+(5,8,7355,'Stuck'),
+(5,8,7744,'Will of the Forsaken'),
+(5,8,8386,'Attacking'),
+(5,8,9078,'Cloth'),
+(5,8,9125,'Generic'),
+(5,8,17737,'Language Gutterspeak'),
+(5,8,20577,'Cannibalize'),
+(5,8,20579,'Shadow Resistance'),
+(5,8,21651,'Opening'),
+(5,8,21652,'Closing'),
+(5,8,22027,'Remove Insignia'),
+(5,8,22810,'Opening - No Text'),
+(5,8,45927,'Summon Friend'),
+(5,8,61437,'Opening'),
+(5,9,81,'Dodge'),
+(5,9,203,'Unarmed'),
+(5,9,204,'Defense'),
+(5,9,522,'SPELLDEFENSE (DND)'),
+(5,9,669,'Language Orcish'),
+(5,9,686,'Shadow Bolt'),
+(5,9,687,'Demon Skin'),
+(5,9,1180,'Daggers'),
+(5,9,1843,'Disarm'),
+(5,9,2382,'Generic'),
+(5,9,2479,'Honorless Target'),
+(5,9,3050,'Detect'),
+(5,9,3365,'Opening'),
+(5,9,5009,'Wands'),
+(5,9,5019,'Shoot'),
+(5,9,5227,'Underwater Breathing'),
+(5,9,6233,'Closing'),
+(5,9,6246,'Closing'),
+(5,9,6247,'Opening'),
+(5,9,6477,'Opening'),
+(5,9,6478,'Opening'),
+(5,9,6603,'Attack'),
+(5,9,7266,'Duel'),
+(5,9,7267,'Grovel'),
+(5,9,7355,'Stuck'),
+(5,9,7744,'Will of the Forsaken'),
+(5,9,8386,'Attacking'),
+(5,9,9078,'Cloth'),
+(5,9,9125,'Generic'),
+(5,9,17737,'Language Gutterspeak'),
+(5,9,20577,'Cannibalize'),
+(5,9,20579,'Shadow Resistance'),
+(5,9,21651,'Opening'),
+(5,9,21652,'Closing'),
+(5,9,22027,'Remove Insignia'),
+(5,9,22810,'Opening - No Text'),
+(5,9,45927,'Summon Friend'),
+(5,9,58284,'Chaos Bolt Passive'),
+(5,9,61437,'Opening'),
+(6,1,78,'Heroic Strike'),
+(6,1,81,'Dodge'),
+(6,1,107,'Block'),
+(6,1,196,'One-Handed Axes'),
+(6,1,198,'One-Handed Maces'),
+(6,1,199,'Two-Handed Maces'),
+(6,1,203,'Unarmed'),
+(6,1,204,'Defense'),
+(6,1,522,'SPELLDEFENSE (DND)'),
+(6,1,669,'Language Orcish'),
+(6,1,670,'Language Taurahe'),
+(6,1,1843,'Disarm'),
+(6,1,2382,'Generic'),
+(6,1,2457,'Battle Stance'),
+(6,1,2479,'Honorless Target'),
+(6,1,3050,'Detect'),
+(6,1,3365,'Opening'),
+(6,1,5301,'Defensive State (DND)'),
+(6,1,6233,'Closing'),
+(6,1,6246,'Closing'),
+(6,1,6247,'Opening'),
+(6,1,6477,'Opening'),
+(6,1,6478,'Opening'),
+(6,1,6603,'Attack'),
+(6,1,7266,'Duel'),
+(6,1,7267,'Grovel'),
+(6,1,7355,'Stuck'),
+(6,1,8386,'Attacking'),
+(6,1,8737,'Mail'),
+(6,1,9077,'Leather'),
+(6,1,9078,'Cloth'),
+(6,1,9116,'Shield'),
+(6,1,9125,'Generic'),
+(6,1,20549,'War Stomp'),
+(6,1,20550,'Endurance'),
+(6,1,20551,'Nature Resistance'),
+(6,1,20552,'Cultivation'),
+(6,1,21651,'Opening'),
+(6,1,21652,'Closing'),
+(6,1,22027,'Remove Insignia'),
+(6,1,22810,'Opening - No Text'),
+(6,1,32215,'Victorious State'),
+(6,1,45927,'Summon Friend'),
+(6,1,61437,'Opening'),
+(6,3,75,'Auto Shot'),
+(6,3,81,'Dodge'),
+(6,3,196,'One-Handed Axes'),
+(6,3,203,'Unarmed'),
+(6,3,204,'Defense'),
+(6,3,266,'Guns'),
+(6,3,522,'SPELLDEFENSE (DND)'),
+(6,3,669,'Language Orcish'),
+(6,3,670,'Language Taurahe'),
+(6,3,1843,'Disarm'),
+(6,3,2382,'Generic'),
+(6,3,2479,'Honorless Target'),
+(6,3,2973,'Raptor Strike'),
+(6,3,3050,'Detect'),
+(6,3,3365,'Opening'),
+(6,3,6233,'Closing'),
+(6,3,6246,'Closing'),
+(6,3,6247,'Opening'),
+(6,3,6477,'Opening'),
+(6,3,6478,'Opening'),
+(6,3,6603,'Attack'),
+(6,3,7266,'Duel'),
+(6,3,7267,'Grovel'),
+(6,3,7355,'Stuck'),
+(6,3,8386,'Attacking'),
+(6,3,9077,'Leather'),
+(6,3,9078,'Cloth'),
+(6,3,9125,'Generic'),
+(6,3,13358,'Defensive State (DND)'),
+(6,3,20549,'War Stomp'),
+(6,3,20550,'Endurance'),
+(6,3,20551,'Nature Resistance'),
+(6,3,20552,'Cultivation'),
+(6,3,21651,'Opening'),
+(6,3,21652,'Closing'),
+(6,3,22027,'Remove Insignia'),
+(6,3,22810,'Opening - No Text'),
+(6,3,24949,'Defensive State 2 (DND)'),
+(6,3,34082,'Advantaged State (DND)'),
+(6,3,45927,'Summon Friend'),
+(6,3,61437,'Opening'),
+(6,6,81,'Dodge'),
+(6,6,196,'One-Handed Axes'),
+(6,6,197,'Two-Handed Axes'),
+(6,6,200,'Polearms'),
+(6,6,201,'One-Handed Swords'),
+(6,6,202,'Two-Handed Swords'),
+(6,6,203,'Unarmed'),
+(6,6,204,'Defense'),
+(6,6,522,'SPELLDEFENSE (DND)'),
+(6,6,669,'Language Orcish'),
+(6,6,670,'Language Taurahe'),
+(6,6,674,'Dual Wield'),
+(6,6,750,'Plate Mail'),
+(6,6,1843,'Disarm'),
+(6,6,2382,'Generic'),
+(6,6,2479,'Honorless Target'),
+(6,6,3050,'Detect'),
+(6,6,3127,'Parry'),
+(6,6,3275,'Linen Bandage'),
+(6,6,3276,'Heavy Linen Bandage'),
+(6,6,3277,'Wool Bandage'),
+(6,6,3278,'Heavy Wool Bandage'),
+(6,6,3365,'Opening'),
+(6,6,6233,'Closing'),
+(6,6,6246,'Closing'),
+(6,6,6247,'Opening'),
+(6,6,6477,'Opening'),
+(6,6,6478,'Opening'),
+(6,6,6603,'Attack'),
+(6,6,7266,'Duel'),
+(6,6,7267,'Grovel'),
+(6,6,7355,'Stuck'),
+(6,6,7928,'Silk Bandage'),
+(6,6,7929,'Heavy Silk Bandage'),
+(6,6,7934,'Anti-Venom'),
+(6,6,8386,'Attacking'),
+(6,6,8737,'Mail'),
+(6,6,9077,'Leather'),
+(6,6,9078,'Cloth'),
+(6,6,9125,'Generic'),
+(6,6,10840,'Mageweave Bandage'),
+(6,6,10841,'Heavy Mageweave Bandage'),
+(6,6,10846,'First Aid'),
+(6,6,18629,'Runecloth Bandage'),
+(6,6,18630,'Heavy Runecloth Bandage'),
+(6,6,20549,'War Stomp'),
+(6,6,20550,'Endurance'),
+(6,6,20551,'Nature Resistance'),
+(6,6,20552,'Cultivation'),
+(6,6,21651,'Opening'),
+(6,6,21652,'Closing'),
+(6,6,22027,'Remove Insignia'),
+(6,6,22810,'Opening - No Text'),
+(6,6,33391,'Journeyman Riding'),
+(6,6,45462,'Plague Strike'),
+(6,6,45477,'Icy Touch'),
+(6,6,45902,'Blood Strike'),
+(6,6,45903,'Offensive State (DND)'),
+(6,6,45927,'Summon Friend'),
+(6,6,47541,'Death Coil'),
+(6,6,48266,'Blood Presence'),
+(6,6,49410,'Forceful Deflection'),
+(6,6,49576,'Death Grip'),
+(6,6,52665,'Sigil'),
+(6,6,59879,'Blood Plague'),
+(6,6,59921,'Frost Fever'),
+(6,6,61437,'Opening'),
+(6,6,61455,'Runic Focus'),
+(6,7,81,'Dodge'),
+(6,7,107,'Block'),
+(6,7,198,'One-Handed Maces'),
+(6,7,203,'Unarmed'),
+(6,7,204,'Defense'),
+(6,7,227,'Staves'),
+(6,7,331,'Healing Wave'),
+(6,7,403,'Lightning Bolt'),
+(6,7,522,'SPELLDEFENSE (DND)'),
+(6,7,669,'Language Orcish'),
+(6,7,670,'Language Taurahe'),
+(6,7,1843,'Disarm'),
+(6,7,2382,'Generic'),
+(6,7,2479,'Honorless Target'),
+(6,7,3050,'Detect'),
+(6,7,3365,'Opening'),
+(6,7,6233,'Closing'),
+(6,7,6246,'Closing'),
+(6,7,6247,'Opening'),
+(6,7,6477,'Opening'),
+(6,7,6478,'Opening'),
+(6,7,6603,'Attack'),
+(6,7,7266,'Duel'),
+(6,7,7267,'Grovel'),
+(6,7,7355,'Stuck'),
+(6,7,8386,'Attacking'),
+(6,7,9077,'Leather'),
+(6,7,9078,'Cloth'),
+(6,7,9116,'Shield'),
+(6,7,9125,'Generic'),
+(6,7,20549,'War Stomp'),
+(6,7,20550,'Endurance'),
+(6,7,20551,'Nature Resistance'),
+(6,7,20552,'Cultivation'),
+(6,7,21651,'Opening'),
+(6,7,21652,'Closing'),
+(6,7,22027,'Remove Insignia'),
+(6,7,22810,'Opening - No Text'),
+(6,7,27763,'Totem'),
+(6,7,45927,'Summon Friend'),
+(6,7,61437,'Opening'),
+(6,11,81,'Dodge'),
+(6,11,198,'One-Handed Maces'),
+(6,11,203,'Unarmed'),
+(6,11,204,'Defense'),
+(6,11,227,'Staves'),
+(6,11,522,'SPELLDEFENSE (DND)'),
+(6,11,669,'Language Orcish'),
+(6,11,670,'Language Taurahe'),
+(6,11,1843,'Disarm'),
+(6,11,2382,'Generic'),
+(6,11,2479,'Honorless Target'),
+(6,11,3050,'Detect'),
+(6,11,3365,'Opening'),
+(6,11,5176,'Wrath'),
+(6,11,5185,'Healing Touch'),
+(6,11,6233,'Closing'),
+(6,11,6246,'Closing'),
+(6,11,6247,'Opening'),
+(6,11,6477,'Opening'),
+(6,11,6478,'Opening'),
+(6,11,6603,'Attack'),
+(6,11,7266,'Duel'),
+(6,11,7267,'Grovel'),
+(6,11,7355,'Stuck'),
+(6,11,8386,'Attacking'),
+(6,11,9077,'Leather'),
+(6,11,9078,'Cloth'),
+(6,11,9125,'Generic'),
+(6,11,20549,'War Stomp'),
+(6,11,20550,'Endurance'),
+(6,11,20551,'Nature Resistance'),
+(6,11,20552,'Cultivation'),
+(6,11,21651,'Opening'),
+(6,11,21652,'Closing'),
+(6,11,22027,'Remove Insignia'),
+(6,11,22810,'Opening - No Text'),
+(6,11,27764,'Fetish'),
+(6,11,45927,'Summon Friend'),
+(6,11,61437,'Opening'),
+(7,1,78,'Heroic Strike'),
+(7,1,81,'Dodge'),
+(7,1,107,'Block'),
+(7,1,198,'One-Handed Maces'),
+(7,1,201,'One-Handed Swords'),
+(7,1,203,'Unarmed'),
+(7,1,204,'Defense'),
+(7,1,522,'SPELLDEFENSE (DND)'),
+(7,1,668,'Language Common'),
+(7,1,1180,'Daggers'),
+(7,1,1843,'Disarm'),
+(7,1,2382,'Generic'),
+(7,1,2457,'Battle Stance'),
+(7,1,2479,'Honorless Target'),
+(7,1,3050,'Detect'),
+(7,1,3365,'Opening'),
+(7,1,5301,'Defensive State (DND)'),
+(7,1,6233,'Closing'),
+(7,1,6246,'Closing'),
+(7,1,6247,'Opening'),
+(7,1,6477,'Opening'),
+(7,1,6478,'Opening'),
+(7,1,6603,'Attack'),
+(7,1,7266,'Duel'),
+(7,1,7267,'Grovel'),
+(7,1,7340,'Language Gnomish'),
+(7,1,7355,'Stuck'),
+(7,1,8386,'Attacking'),
+(7,1,8737,'Mail'),
+(7,1,9077,'Leather'),
+(7,1,9078,'Cloth'),
+(7,1,9116,'Shield'),
+(7,1,9125,'Generic'),
+(7,1,20589,'Escape Artist'),
+(7,1,20591,'Expansive Mind'),
+(7,1,20592,'Arcane Resistance'),
+(7,1,20593,'Engineering Specialization'),
+(7,1,21651,'Opening'),
+(7,1,21652,'Closing'),
+(7,1,22027,'Remove Insignia'),
+(7,1,22810,'Opening - No Text'),
+(7,1,32215,'Victorious State'),
+(7,1,45927,'Summon Friend'),
+(7,1,61437,'Opening'),
+(7,4,81,'Dodge'),
+(7,4,203,'Unarmed'),
+(7,4,204,'Defense'),
+(7,4,522,'SPELLDEFENSE (DND)'),
+(7,4,668,'Language Common'),
+(7,4,1180,'Daggers'),
+(7,4,1752,'Sinister Strike'),
+(7,4,1843,'Disarm'),
+(7,4,2098,'Eviscerate'),
+(7,4,2382,'Generic'),
+(7,4,2479,'Honorless Target'),
+(7,4,2567,'Thrown'),
+(7,4,2764,'Throw'),
+(7,4,3050,'Detect'),
+(7,4,3365,'Opening'),
+(7,4,6233,'Closing'),
+(7,4,6246,'Closing'),
+(7,4,6247,'Opening'),
+(7,4,6477,'Opening'),
+(7,4,6478,'Opening'),
+(7,4,6603,'Attack'),
+(7,4,7266,'Duel'),
+(7,4,7267,'Grovel'),
+(7,4,7340,'Language Gnomish'),
+(7,4,7355,'Stuck'),
+(7,4,8386,'Attacking'),
+(7,4,9077,'Leather'),
+(7,4,9078,'Cloth'),
+(7,4,9125,'Generic'),
+(7,4,16092,'Defensive State (DND)'),
+(7,4,20589,'Escape Artist'),
+(7,4,20591,'Expansive Mind'),
+(7,4,20592,'Arcane Resistance'),
+(7,4,20593,'Engineering Specialization'),
+(7,4,21184,'Rogue Passive (DND)'),
+(7,4,21651,'Opening'),
+(7,4,21652,'Closing'),
+(7,4,22027,'Remove Insignia'),
+(7,4,22810,'Opening - No Text'),
+(7,4,45927,'Summon Friend'),
+(7,4,61437,'Opening'),
+(7,6,81,'Dodge'),
+(7,6,196,'One-Handed Axes'),
+(7,6,197,'Two-Handed Axes'),
+(7,6,200,'Polearms'),
+(7,6,201,'One-Handed Swords'),
+(7,6,202,'Two-Handed Swords'),
+(7,6,203,'Unarmed'),
+(7,6,204,'Defense'),
+(7,6,522,'SPELLDEFENSE (DND)'),
+(7,6,668,'Language Common'),
+(7,6,674,'Dual Wield'),
+(7,6,750,'Plate Mail'),
+(7,6,1843,'Disarm'),
+(7,6,2382,'Generic'),
+(7,6,2479,'Honorless Target'),
+(7,6,3050,'Detect'),
+(7,6,3127,'Parry'),
+(7,6,3275,'Linen Bandage'),
+(7,6,3276,'Heavy Linen Bandage'),
+(7,6,3277,'Wool Bandage'),
+(7,6,3278,'Heavy Wool Bandage'),
+(7,6,3365,'Opening'),
+(7,6,6233,'Closing'),
+(7,6,6246,'Closing'),
+(7,6,6247,'Opening'),
+(7,6,6477,'Opening'),
+(7,6,6478,'Opening'),
+(7,6,6603,'Attack'),
+(7,6,7266,'Duel'),
+(7,6,7267,'Grovel'),
+(7,6,7340,'Language Gnomish'),
+(7,6,7355,'Stuck'),
+(7,6,7928,'Silk Bandage'),
+(7,6,7929,'Heavy Silk Bandage'),
+(7,6,7934,'Anti-Venom'),
+(7,6,8386,'Attacking'),
+(7,6,8737,'Mail'),
+(7,6,9077,'Leather'),
+(7,6,9078,'Cloth'),
+(7,6,9125,'Generic'),
+(7,6,10840,'Mageweave Bandage'),
+(7,6,10841,'Heavy Mageweave Bandage'),
+(7,6,10846,'First Aid'),
+(7,6,18629,'Runecloth Bandage'),
+(7,6,18630,'Heavy Runecloth Bandage'),
+(7,6,20589,'Escape Artist'),
+(7,6,20591,'Expansive Mind'),
+(7,6,20592,'Arcane Resistance'),
+(7,6,20593,'Engineering Specialization'),
+(7,6,21651,'Opening'),
+(7,6,21652,'Closing'),
+(7,6,22027,'Remove Insignia'),
+(7,6,22810,'Opening - No Text'),
+(7,6,33391,'Journeyman Riding'),
+(7,6,45462,'Plague Strike'),
+(7,6,45477,'Icy Touch'),
+(7,6,45902,'Blood Strike'),
+(7,6,45903,'Offensive State (DND)'),
+(7,6,45927,'Summon Friend'),
+(7,6,47541,'Death Coil'),
+(7,6,48266,'Blood Presence'),
+(7,6,49410,'Forceful Deflection'),
+(7,6,49576,'Death Grip'),
+(7,6,52665,'Sigil'),
+(7,6,59879,'Blood Plague'),
+(7,6,59921,'Frost Fever'),
+(7,6,61437,'Opening'),
+(7,6,61455,'Runic Focus'),
+(7,8,81,'Dodge'),
+(7,8,133,'Fireball'),
+(7,8,168,'Frost Armor'),
+(7,8,203,'Unarmed'),
+(7,8,204,'Defense'),
+(7,8,227,'Staves'),
+(7,8,522,'SPELLDEFENSE (DND)'),
+(7,8,668,'Language Common'),
+(7,8,1843,'Disarm'),
+(7,8,2382,'Generic'),
+(7,8,2479,'Honorless Target'),
+(7,8,3050,'Detect'),
+(7,8,3365,'Opening'),
+(7,8,5009,'Wands'),
+(7,8,5019,'Shoot'),
+(7,8,6233,'Closing'),
+(7,8,6246,'Closing'),
+(7,8,6247,'Opening'),
+(7,8,6477,'Opening'),
+(7,8,6478,'Opening'),
+(7,8,6603,'Attack'),
+(7,8,7266,'Duel'),
+(7,8,7267,'Grovel'),
+(7,8,7340,'Language Gnomish'),
+(7,8,7355,'Stuck'),
+(7,8,8386,'Attacking'),
+(7,8,9078,'Cloth'),
+(7,8,9125,'Generic'),
+(7,8,20589,'Escape Artist'),
+(7,8,20591,'Expansive Mind'),
+(7,8,20592,'Arcane Resistance'),
+(7,8,20593,'Engineering Specialization'),
+(7,8,21651,'Opening'),
+(7,8,21652,'Closing'),
+(7,8,22027,'Remove Insignia'),
+(7,8,22810,'Opening - No Text'),
+(7,8,45927,'Summon Friend'),
+(7,8,61437,'Opening'),
+(7,9,81,'Dodge'),
+(7,9,203,'Unarmed'),
+(7,9,204,'Defense'),
+(7,9,522,'SPELLDEFENSE (DND)'),
+(7,9,668,'Language Common'),
+(7,9,686,'Shadow Bolt'),
+(7,9,687,'Demon Skin'),
+(7,9,1180,'Daggers'),
+(7,9,1843,'Disarm'),
+(7,9,2382,'Generic'),
+(7,9,2479,'Honorless Target'),
+(7,9,3050,'Detect'),
+(7,9,3365,'Opening'),
+(7,9,5009,'Wands'),
+(7,9,5019,'Shoot'),
+(7,9,6233,'Closing'),
+(7,9,6246,'Closing'),
+(7,9,6247,'Opening'),
+(7,9,6477,'Opening'),
+(7,9,6478,'Opening'),
+(7,9,6603,'Attack'),
+(7,9,7266,'Duel'),
+(7,9,7267,'Grovel'),
+(7,9,7340,'Language Gnomish'),
+(7,9,7355,'Stuck'),
+(7,9,8386,'Attacking'),
+(7,9,9078,'Cloth'),
+(7,9,9125,'Generic'),
+(7,9,20589,'Escape Artist'),
+(7,9,20591,'Expansive Mind'),
+(7,9,20592,'Arcane Resistance'),
+(7,9,20593,'Engineering Specialization'),
+(7,9,21651,'Opening'),
+(7,9,21652,'Closing'),
+(7,9,22027,'Remove Insignia'),
+(7,9,22810,'Opening - No Text'),
+(7,9,45927,'Summon Friend'),
+(7,9,58284,'Chaos Bolt Passive'),
+(7,9,61437,'Opening'),
+(8,1,78,'Heroic Strike'),
+(8,1,81,'Dodge'),
+(8,1,107,'Block'),
+(8,1,196,'One-Handed Axes'),
+(8,1,203,'Unarmed'),
+(8,1,204,'Defense'),
+(8,1,522,'SPELLDEFENSE (DND)'),
+(8,1,669,'Language Orcish'),
+(8,1,1180,'Daggers'),
+(8,1,1843,'Disarm'),
+(8,1,2382,'Generic'),
+(8,1,2457,'Battle Stance'),
+(8,1,2479,'Honorless Target'),
+(8,1,2567,'Thrown'),
+(8,1,2764,'Throw'),
+(8,1,3050,'Detect'),
+(8,1,3365,'Opening'),
+(8,1,5301,'Defensive State (DND)'),
+(8,1,6233,'Closing'),
+(8,1,6246,'Closing'),
+(8,1,6247,'Opening'),
+(8,1,6477,'Opening'),
+(8,1,6478,'Opening'),
+(8,1,6603,'Attack'),
+(8,1,7266,'Duel'),
+(8,1,7267,'Grovel'),
+(8,1,7341,'Language Troll'),
+(8,1,7355,'Stuck'),
+(8,1,8386,'Attacking'),
+(8,1,8737,'Mail'),
+(8,1,9077,'Leather'),
+(8,1,9078,'Cloth'),
+(8,1,9116,'Shield'),
+(8,1,9125,'Generic'),
+(8,1,20555,'Regeneration'),
+(8,1,20557,'Beast Slaying'),
+(8,1,20558,'Throwing Specialization'),
+(8,1,21651,'Opening'),
+(8,1,21652,'Closing'),
+(8,1,22027,'Remove Insignia'),
+(8,1,22810,'Opening - No Text'),
+(8,1,26290,'Bow Specialization'),
+(8,1,26296,'Berserking'),
+(8,1,32215,'Victorious State'),
+(8,1,45927,'Summon Friend'),
+(8,1,58943,'Da Voodoo Shuffle'),
+(8,1,61437,'Opening'),
+(8,3,75,'Auto Shot'),
+(8,3,81,'Dodge'),
+(8,3,196,'One-Handed Axes'),
+(8,3,203,'Unarmed'),
+(8,3,204,'Defense'),
+(8,3,264,'Bows'),
+(8,3,522,'SPELLDEFENSE (DND)'),
+(8,3,669,'Language Orcish'),
+(8,3,1843,'Disarm'),
+(8,3,2382,'Generic'),
+(8,3,2479,'Honorless Target'),
+(8,3,2973,'Raptor Strike'),
+(8,3,3050,'Detect'),
+(8,3,3365,'Opening'),
+(8,3,6233,'Closing'),
+(8,3,6246,'Closing'),
+(8,3,6247,'Opening'),
+(8,3,6477,'Opening'),
+(8,3,6478,'Opening'),
+(8,3,6603,'Attack'),
+(8,3,7266,'Duel'),
+(8,3,7267,'Grovel'),
+(8,3,7341,'Language Troll'),
+(8,3,7355,'Stuck'),
+(8,3,8386,'Attacking'),
+(8,3,9077,'Leather'),
+(8,3,9078,'Cloth'),
+(8,3,9125,'Generic'),
+(8,3,13358,'Defensive State (DND)'),
+(8,3,20554,'Berserking'),
+(8,3,20555,'Regeneration'),
+(8,3,20557,'Beast Slaying'),
+(8,3,20558,'Throwing Specialization'),
+(8,3,21651,'Opening'),
+(8,3,21652,'Closing'),
+(8,3,22027,'Remove Insignia'),
+(8,3,22810,'Opening - No Text'),
+(8,3,24949,'Defensive State 2 (DND)'),
+(8,3,26290,'Bow Specialization'),
+(8,3,34082,'Advantaged State (DND)'),
+(8,3,45927,'Summon Friend'),
+(8,3,58943,'Da Voodoo Shuffle'),
+(8,3,61437,'Opening'),
+(8,4,81,'Dodge'),
+(8,4,203,'Unarmed'),
+(8,4,204,'Defense'),
+(8,4,522,'SPELLDEFENSE (DND)'),
+(8,4,669,'Language Orcish'),
+(8,4,1180,'Daggers'),
+(8,4,1752,'Sinister Strike'),
+(8,4,1843,'Disarm'),
+(8,4,2098,'Eviscerate'),
+(8,4,2382,'Generic'),
+(8,4,2479,'Honorless Target'),
+(8,4,2567,'Thrown'),
+(8,4,2764,'Throw'),
+(8,4,3050,'Detect'),
+(8,4,3365,'Opening'),
+(8,4,6233,'Closing'),
+(8,4,6246,'Closing'),
+(8,4,6247,'Opening'),
+(8,4,6477,'Opening'),
+(8,4,6478,'Opening'),
+(8,4,6603,'Attack'),
+(8,4,7266,'Duel'),
+(8,4,7267,'Grovel'),
+(8,4,7341,'Language Troll'),
+(8,4,7355,'Stuck'),
+(8,4,8386,'Attacking'),
+(8,4,9077,'Leather'),
+(8,4,9078,'Cloth'),
+(8,4,9125,'Generic'),
+(8,4,16092,'Defensive State (DND)'),
+(8,4,20555,'Regeneration'),
+(8,4,20557,'Beast Slaying'),
+(8,4,20558,'Throwing Specialization'),
+(8,4,21184,'Rogue Passive (DND)'),
+(8,4,21651,'Opening'),
+(8,4,21652,'Closing'),
+(8,4,22027,'Remove Insignia'),
+(8,4,22810,'Opening - No Text'),
+(8,4,26290,'Bow Specialization'),
+(8,4,26297,'Berserking'),
+(8,4,45927,'Summon Friend'),
+(8,4,58943,'Da Voodoo Shuffle'),
+(8,4,61437,'Opening'),
+(8,5,81,'Dodge'),
+(8,5,198,'One-Handed Maces'),
+(8,5,203,'Unarmed'),
+(8,5,204,'Defense'),
+(8,5,522,'SPELLDEFENSE (DND)'),
+(8,5,585,'Smite'),
+(8,5,669,'Language Orcish'),
+(8,5,1843,'Disarm'),
+(8,5,2050,'Lesser Heal'),
+(8,5,2382,'Generic'),
+(8,5,2479,'Honorless Target'),
+(8,5,3050,'Detect'),
+(8,5,3365,'Opening'),
+(8,5,5009,'Wands'),
+(8,5,5019,'Shoot'),
+(8,5,6233,'Closing'),
+(8,5,6246,'Closing'),
+(8,5,6247,'Opening'),
+(8,5,6477,'Opening'),
+(8,5,6478,'Opening'),
+(8,5,6603,'Attack'),
+(8,5,7266,'Duel'),
+(8,5,7267,'Grovel'),
+(8,5,7341,'Language Troll'),
+(8,5,7355,'Stuck'),
+(8,5,8386,'Attacking'),
+(8,5,9078,'Cloth'),
+(8,5,9125,'Generic'),
+(8,5,20554,'Berserking'),
+(8,5,20555,'Regeneration'),
+(8,5,20557,'Beast Slaying'),
+(8,5,20558,'Throwing Specialization'),
+(8,5,21651,'Opening'),
+(8,5,21652,'Closing'),
+(8,5,22027,'Remove Insignia'),
+(8,5,22810,'Opening - No Text'),
+(8,5,26290,'Bow Specialization'),
+(8,5,45927,'Summon Friend'),
+(8,5,58943,'Da Voodoo Shuffle'),
+(8,5,61437,'Opening'),
+(8,6,81,'Dodge'),
+(8,6,196,'One-Handed Axes'),
+(8,6,197,'Two-Handed Axes'),
+(8,6,200,'Polearms'),
+(8,6,201,'One-Handed Swords'),
+(8,6,202,'Two-Handed Swords'),
+(8,6,203,'Unarmed'),
+(8,6,204,'Defense'),
+(8,6,522,'SPELLDEFENSE (DND)'),
+(8,6,669,'Language Orcish'),
+(8,6,674,'Dual Wield'),
+(8,6,750,'Plate Mail'),
+(8,6,1843,'Disarm'),
+(8,6,2382,'Generic'),
+(8,6,2479,'Honorless Target'),
+(8,6,3050,'Detect'),
+(8,6,3127,'Parry'),
+(8,6,3275,'Linen Bandage'),
+(8,6,3276,'Heavy Linen Bandage'),
+(8,6,3277,'Wool Bandage'),
+(8,6,3278,'Heavy Wool Bandage'),
+(8,6,3365,'Opening'),
+(8,6,6233,'Closing'),
+(8,6,6246,'Closing'),
+(8,6,6247,'Opening'),
+(8,6,6477,'Opening'),
+(8,6,6478,'Opening'),
+(8,6,6603,'Attack'),
+(8,6,7266,'Duel'),
+(8,6,7267,'Grovel'),
+(8,6,7341,'Language Troll'),
+(8,6,7355,'Stuck'),
+(8,6,7928,'Silk Bandage'),
+(8,6,7929,'Heavy Silk Bandage'),
+(8,6,7934,'Anti-Venom'),
+(8,6,8386,'Attacking'),
+(8,6,8737,'Mail'),
+(8,6,9077,'Leather'),
+(8,6,9078,'Cloth'),
+(8,6,9125,'Generic'),
+(8,6,10840,'Mageweave Bandage'),
+(8,6,10841,'Heavy Mageweave Bandage'),
+(8,6,10846,'First Aid'),
+(8,6,18629,'Runecloth Bandage'),
+(8,6,18630,'Heavy Runecloth Bandage'),
+(8,6,20555,'Regeneration'),
+(8,6,20557,'Beast Slaying'),
+(8,6,20558,'Throwing Specialization'),
+(8,6,21651,'Opening'),
+(8,6,21652,'Closing'),
+(8,6,22027,'Remove Insignia'),
+(8,6,22810,'Opening - No Text'),
+(8,6,26290,'Bow Specialization'),
+(8,6,33391,'Journeyman Riding'),
+(8,6,45462,'Plague Strike'),
+(8,6,45477,'Icy Touch'),
+(8,6,45902,'Blood Strike'),
+(8,6,45903,'Offensive State (DND)'),
+(8,6,45927,'Summon Friend'),
+(8,6,47541,'Death Coil'),
+(8,6,48266,'Blood Presence'),
+(8,6,49410,'Forceful Deflection'),
+(8,6,49576,'Death Grip'),
+(8,6,50621,'Berserking'),
+(8,6,52665,'Sigil'),
+(8,6,58943,'Da Voodoo Shuffle'),
+(8,6,59879,'Blood Plague'),
+(8,6,59921,'Frost Fever'),
+(8,6,61437,'Opening'),
+(8,6,61455,'Runic Focus'),
+(8,7,81,'Dodge'),
+(8,7,107,'Block'),
+(8,7,198,'One-Handed Maces'),
+(8,7,203,'Unarmed'),
+(8,7,204,'Defense'),
+(8,7,227,'Staves'),
+(8,7,331,'Healing Wave'),
+(8,7,403,'Lightning Bolt'),
+(8,7,522,'SPELLDEFENSE (DND)'),
+(8,7,669,'Language Orcish'),
+(8,7,1843,'Disarm'),
+(8,7,2382,'Generic'),
+(8,7,2479,'Honorless Target'),
+(8,7,3050,'Detect'),
+(8,7,3365,'Opening'),
+(8,7,6233,'Closing'),
+(8,7,6246,'Closing'),
+(8,7,6247,'Opening'),
+(8,7,6477,'Opening'),
+(8,7,6478,'Opening'),
+(8,7,6603,'Attack'),
+(8,7,7266,'Duel'),
+(8,7,7267,'Grovel'),
+(8,7,7341,'Language Troll'),
+(8,7,7355,'Stuck'),
+(8,7,8386,'Attacking'),
+(8,7,9077,'Leather'),
+(8,7,9078,'Cloth'),
+(8,7,9116,'Shield'),
+(8,7,9125,'Generic'),
+(8,7,20554,'Berserking'),
+(8,7,20555,'Regeneration'),
+(8,7,20557,'Beast Slaying'),
+(8,7,20558,'Throwing Specialization'),
+(8,7,21651,'Opening'),
+(8,7,21652,'Closing'),
+(8,7,22027,'Remove Insignia'),
+(8,7,22810,'Opening - No Text'),
+(8,7,26290,'Bow Specialization'),
+(8,7,27763,'Totem'),
+(8,7,45927,'Summon Friend'),
+(8,7,58943,'Da Voodoo Shuffle'),
+(8,7,61437,'Opening'),
+(8,8,81,'Dodge'),
+(8,8,133,'Fireball'),
+(8,8,168,'Frost Armor'),
+(8,8,203,'Unarmed'),
+(8,8,204,'Defense'),
+(8,8,227,'Staves'),
+(8,8,522,'SPELLDEFENSE (DND)'),
+(8,8,669,'Language Orcish'),
+(8,8,1843,'Disarm'),
+(8,8,2382,'Generic'),
+(8,8,2479,'Honorless Target'),
+(8,8,3050,'Detect'),
+(8,8,3365,'Opening'),
+(8,8,5009,'Wands'),
+(8,8,5019,'Shoot'),
+(8,8,6233,'Closing'),
+(8,8,6246,'Closing'),
+(8,8,6247,'Opening'),
+(8,8,6477,'Opening'),
+(8,8,6478,'Opening'),
+(8,8,6603,'Attack'),
+(8,8,7266,'Duel'),
+(8,8,7267,'Grovel'),
+(8,8,7341,'Language Troll'),
+(8,8,7355,'Stuck'),
+(8,8,8386,'Attacking'),
+(8,8,9078,'Cloth'),
+(8,8,9125,'Generic'),
+(8,8,20554,'Berserking'),
+(8,8,20555,'Regeneration'),
+(8,8,20557,'Beast Slaying'),
+(8,8,20558,'Throwing Specialization'),
+(8,8,21651,'Opening'),
+(8,8,21652,'Closing'),
+(8,8,22027,'Remove Insignia'),
+(8,8,22810,'Opening - No Text'),
+(8,8,26290,'Bow Specialization'),
+(8,8,45927,'Summon Friend'),
+(8,8,58943,'Da Voodoo Shuffle'),
+(8,8,61437,'Opening'),
+(10,2,81,'Dodge'),
+(10,2,107,'Block'),
+(10,2,201,'One-Handed Swords'),
+(10,2,202,'Two-Handed Swords'),
+(10,2,203,'Unarmed'),
+(10,2,204,'Defense'),
+(10,2,522,'SPELLDEFENSE (DND)'),
+(10,2,635,'Holy Light'),
+(10,2,669,'Language Orcish'),
+(10,2,813,'Language Thalassian'),
+(10,2,822,'Magic Resistance'),
+(10,2,2382,'Generic'),
+(10,2,2479,'Honorless Target'),
+(10,2,3050,'Detect'),
+(10,2,3365,'Opening'),
+(10,2,6233,'Closing'),
+(10,2,6246,'Closing'),
+(10,2,6247,'Opening'),
+(10,2,6477,'Opening'),
+(10,2,6478,'Opening'),
+(10,2,6603,'Attack'),
+(10,2,7266,'Duel'),
+(10,2,7267,'Grovel'),
+(10,2,7355,'Stuck'),
+(10,2,8386,'Attacking'),
+(10,2,8737,'Mail'),
+(10,2,9077,'Leather'),
+(10,2,9078,'Cloth'),
+(10,2,9116,'Shield'),
+(10,2,9125,'Generic'),
+(10,2,21084,'Seal of Righteousness'),
+(10,2,21651,'Opening'),
+(10,2,21652,'Closing'),
+(10,2,22027,'Remove Insignia'),
+(10,2,22810,'Opening - No Text'),
+(10,2,27762,'Libram'),
+(10,2,28730,'Arcane Torrent'),
+(10,2,28734,'Mana Tap'),
+(10,2,28877,'Arcane Affinity'),
+(10,3,75,'Auto Shot'),
+(10,3,81,'Dodge'),
+(10,3,203,'Unarmed'),
+(10,3,204,'Defense'),
+(10,3,264,'Bows'),
+(10,3,522,'SPELLDEFENSE (DND)'),
+(10,3,669,'Language Orcish'),
+(10,3,813,'Language Thalassian'),
+(10,3,822,'Magic Resistance'),
+(10,3,1180,'Daggers'),
+(10,3,2382,'Generic'),
+(10,3,2479,'Honorless Target'),
+(10,3,2973,'Raptor Strike'),
+(10,3,3050,'Detect'),
+(10,3,3365,'Opening'),
+(10,3,6233,'Closing'),
+(10,3,6246,'Closing'),
+(10,3,6247,'Opening'),
+(10,3,6477,'Opening'),
+(10,3,6478,'Opening'),
+(10,3,6603,'Attack'),
+(10,3,7266,'Duel'),
+(10,3,7267,'Grovel'),
+(10,3,7355,'Stuck'),
+(10,3,8386,'Attacking'),
+(10,3,9077,'Leather'),
+(10,3,9078,'Cloth'),
+(10,3,9125,'Generic'),
+(10,3,13358,'Defensive State (DND)'),
+(10,3,21651,'Opening'),
+(10,3,21652,'Closing'),
+(10,3,22027,'Remove Insignia'),
+(10,3,22810,'Opening - No Text'),
+(10,3,24949,'Defensive State 2 (DND)'),
+(10,3,28730,'Arcane Torrent'),
+(10,3,28734,'Mana Tap'),
+(10,3,28877,'Arcane Affinity'),
+(10,3,34082,'Advantaged State (DND)'),
+(10,4,81,'Dodge'),
+(10,4,203,'Unarmed'),
+(10,4,204,'Defense'),
+(10,4,522,'SPELLDEFENSE (DND)'),
+(10,4,669,'Language Orcish'),
+(10,4,813,'Language Thalassian'),
+(10,4,822,'Magic Resistance'),
+(10,4,1180,'Daggers'),
+(10,4,1752,'Sinister Strike'),
+(10,4,2098,'Eviscerate'),
+(10,4,2382,'Generic'),
+(10,4,2479,'Honorless Target'),
+(10,4,2567,'Thrown'),
+(10,4,2764,'Throw'),
+(10,4,3050,'Detect'),
+(10,4,3365,'Opening'),
+(10,4,6233,'Closing'),
+(10,4,6246,'Closing'),
+(10,4,6247,'Opening'),
+(10,4,6477,'Opening'),
+(10,4,6478,'Opening'),
+(10,4,6603,'Attack'),
+(10,4,7266,'Duel'),
+(10,4,7267,'Grovel'),
+(10,4,7355,'Stuck'),
+(10,4,8386,'Attacking'),
+(10,4,9077,'Leather'),
+(10,4,9078,'Cloth'),
+(10,4,9125,'Generic'),
+(10,4,16092,'Defensive State (DND)'),
+(10,4,21184,'Rogue Passive (DND)'),
+(10,4,21651,'Opening'),
+(10,4,21652,'Closing'),
+(10,4,22027,'Remove Insignia'),
+(10,4,22810,'Opening - No Text'),
+(10,4,25046,'Arcane Torrent'),
+(10,4,28734,'Mana Tap'),
+(10,4,28877,'Arcane Affinity'),
+(10,5,81,'Dodge'),
+(10,5,198,'One-Handed Maces'),
+(10,5,203,'Unarmed'),
+(10,5,204,'Defense'),
+(10,5,522,'SPELLDEFENSE (DND)'),
+(10,5,585,'Smite'),
+(10,5,669,'Language Orcish'),
+(10,5,813,'Language Thalassian'),
+(10,5,822,'Magic Resistance'),
+(10,5,2050,'Lesser Heal'),
+(10,5,2382,'Generic'),
+(10,5,2479,'Honorless Target'),
+(10,5,3050,'Detect'),
+(10,5,3365,'Opening'),
+(10,5,5009,'Wands'),
+(10,5,5019,'Shoot'),
+(10,5,6233,'Closing'),
+(10,5,6246,'Closing'),
+(10,5,6247,'Opening'),
+(10,5,6477,'Opening'),
+(10,5,6478,'Opening'),
+(10,5,6603,'Attack'),
+(10,5,7266,'Duel'),
+(10,5,7267,'Grovel'),
+(10,5,7355,'Stuck'),
+(10,5,8386,'Attacking'),
+(10,5,9078,'Cloth'),
+(10,5,9125,'Generic'),
+(10,5,21651,'Opening'),
+(10,5,21652,'Closing'),
+(10,5,22027,'Remove Insignia'),
+(10,5,22810,'Opening - No Text'),
+(10,5,28730,'Arcane Torrent'),
+(10,5,28734,'Mana Tap'),
+(10,5,28877,'Arcane Affinity'),
+(10,6,81,'Dodge'),
+(10,6,196,'One-Handed Axes'),
+(10,6,197,'Two-Handed Axes'),
+(10,6,200,'Polearms'),
+(10,6,201,'One-Handed Swords'),
+(10,6,202,'Two-Handed Swords'),
+(10,6,203,'Unarmed'),
+(10,6,204,'Defense'),
+(10,6,522,'SPELLDEFENSE (DND)'),
+(10,6,669,'Language Orcish'),
+(10,6,674,'Dual Wield'),
+(10,6,750,'Plate Mail'),
+(10,6,813,'Language Thalassian'),
+(10,6,822,'Magic Resistance'),
+(10,6,1843,'Disarm'),
+(10,6,2382,'Generic'),
+(10,6,2479,'Honorless Target'),
+(10,6,3050,'Detect'),
+(10,6,3127,'Parry'),
+(10,6,3275,'Linen Bandage'),
+(10,6,3276,'Heavy Linen Bandage'),
+(10,6,3277,'Wool Bandage'),
+(10,6,3278,'Heavy Wool Bandage'),
+(10,6,3365,'Opening'),
+(10,6,6233,'Closing'),
+(10,6,6246,'Closing'),
+(10,6,6247,'Opening'),
+(10,6,6477,'Opening'),
+(10,6,6478,'Opening'),
+(10,6,6603,'Attack'),
+(10,6,7266,'Duel'),
+(10,6,7267,'Grovel'),
+(10,6,7355,'Stuck'),
+(10,6,7928,'Silk Bandage'),
+(10,6,7929,'Heavy Silk Bandage'),
+(10,6,7934,'Anti-Venom'),
+(10,6,8386,'Attacking'),
+(10,6,8737,'Mail'),
+(10,6,9077,'Leather'),
+(10,6,9078,'Cloth'),
+(10,6,9125,'Generic'),
+(10,6,10840,'Mageweave Bandage'),
+(10,6,10841,'Heavy Mageweave Bandage'),
+(10,6,10846,'First Aid'),
+(10,6,18629,'Runecloth Bandage'),
+(10,6,18630,'Heavy Runecloth Bandage'),
+(10,6,21651,'Opening'),
+(10,6,21652,'Closing'),
+(10,6,22027,'Remove Insignia'),
+(10,6,22810,'Opening - No Text'),
+(10,6,28877,'Arcane Affinity'),
+(10,6,33391,'Journeyman Riding'),
+(10,6,45462,'Plague Strike'),
+(10,6,45477,'Icy Touch'),
+(10,6,45902,'Blood Strike'),
+(10,6,45903,'Offensive State (DND)'),
+(10,6,45927,'Summon Friend'),
+(10,6,47541,'Death Coil'),
+(10,6,48266,'Blood Presence'),
+(10,6,49410,'Forceful Deflection'),
+(10,6,49576,'Death Grip'),
+(10,6,50613,'Arcane Torrent'),
+(10,6,52665,'Sigil'),
+(10,6,59879,'Blood Plague'),
+(10,6,59921,'Frost Fever'),
+(10,6,61437,'Opening'),
+(10,6,61455,'Runic Focus'),
+(10,8,81,'Dodge'),
+(10,8,133,'Fireball'),
+(10,8,168,'Frost Armor'),
+(10,8,203,'Unarmed'),
+(10,8,204,'Defense'),
+(10,8,227,'Staves'),
+(10,8,522,'SPELLDEFENSE (DND)'),
+(10,8,669,'Language Orcish'),
+(10,8,813,'Language Thalassian'),
+(10,8,822,'Magic Resistance'),
+(10,8,2382,'Generic'),
+(10,8,2479,'Honorless Target'),
+(10,8,3050,'Detect'),
+(10,8,3365,'Opening'),
+(10,8,5009,'Wands'),
+(10,8,5019,'Shoot'),
+(10,8,6233,'Closing'),
+(10,8,6246,'Closing'),
+(10,8,6247,'Opening'),
+(10,8,6477,'Opening'),
+(10,8,6478,'Opening'),
+(10,8,6603,'Attack'),
+(10,8,7266,'Duel'),
+(10,8,7267,'Grovel'),
+(10,8,7355,'Stuck'),
+(10,8,8386,'Attacking'),
+(10,8,9078,'Cloth'),
+(10,8,9125,'Generic'),
+(10,8,21651,'Opening'),
+(10,8,21652,'Closing'),
+(10,8,22027,'Remove Insignia'),
+(10,8,22810,'Opening - No Text'),
+(10,8,28730,'Arcane Torrent'),
+(10,8,28734,'Mana Tap'),
+(10,8,28877,'Arcane Affinity'),
+(10,9,81,'Dodge'),
+(10,9,203,'Unarmed'),
+(10,9,204,'Defense'),
+(10,9,522,'SPELLDEFENSE (DND)'),
+(10,9,669,'Language Orcish'),
+(10,9,686,'Shadow Bolt'),
+(10,9,687,'Demon Skin'),
+(10,9,813,'Language Thalassian'),
+(10,9,822,'Magic Resistance'),
+(10,9,1180,'Daggers'),
+(10,9,2382,'Generic'),
+(10,9,2479,'Honorless Target'),
+(10,9,3050,'Detect'),
+(10,9,3365,'Opening'),
+(10,9,5009,'Wands'),
+(10,9,5019,'Shoot'),
+(10,9,6233,'Closing'),
+(10,9,6246,'Closing'),
+(10,9,6247,'Opening'),
+(10,9,6477,'Opening'),
+(10,9,6478,'Opening'),
+(10,9,6603,'Attack'),
+(10,9,7266,'Duel'),
+(10,9,7267,'Grovel'),
+(10,9,7355,'Stuck'),
+(10,9,8386,'Attacking'),
+(10,9,9078,'Cloth'),
+(10,9,9125,'Generic'),
+(10,9,21651,'Opening'),
+(10,9,21652,'Closing'),
+(10,9,22027,'Remove Insignia'),
+(10,9,22810,'Opening - No Text'),
+(10,9,28730,'Arcane Torrent'),
+(10,9,28734,'Mana Tap'),
+(10,9,28877,'Arcane Affinity'),
+(10,9,58284,'Chaos Bolt Passive'),
+(11,1,78,'Heroic Strike'),
+(11,1,81,'Dodge'),
+(11,1,107,'Block'),
+(11,1,198,'One-Handed Maces'),
+(11,1,201,'One-Handed Swords'),
+(11,1,202,'Two-Handed Swords'),
+(11,1,203,'Unarmed'),
+(11,1,204,'Defense'),
+(11,1,522,'SPELLDEFENSE (DND)'),
+(11,1,668,'Language Common'),
+(11,1,1843,'Disarm'),
+(11,1,2382,'Generic'),
+(11,1,2457,'Battle Stance'),
+(11,1,2479,'Honorless Target'),
+(11,1,3050,'Detect'),
+(11,1,3365,'Opening'),
+(11,1,5301,'Defensive State (DND)'),
+(11,1,6233,'Closing'),
+(11,1,6246,'Closing'),
+(11,1,6247,'Opening'),
+(11,1,6477,'Opening'),
+(11,1,6478,'Opening'),
+(11,1,6562,'Heroic Presence'),
+(11,1,6603,'Attack'),
+(11,1,7266,'Duel'),
+(11,1,7267,'Grovel'),
+(11,1,7355,'Stuck'),
+(11,1,8386,'Attacking'),
+(11,1,8737,'Mail'),
+(11,1,9077,'Leather'),
+(11,1,9078,'Cloth'),
+(11,1,9116,'Shield'),
+(11,1,9125,'Generic'),
+(11,1,21651,'Opening'),
+(11,1,21652,'Closing'),
+(11,1,22027,'Remove Insignia'),
+(11,1,22810,'Opening - No Text'),
+(11,1,28875,'Gemcutting'),
+(11,1,28880,'Gift of the Naaru'),
+(11,1,29932,'Language Draenei'),
+(11,1,32215,'Victorious State'),
+(11,1,45927,'Summon Friend'),
+(11,1,59221,'Shadow Resistance'),
+(11,1,61437,'Opening'),
+(11,2,81,'Dodge'),
+(11,2,107,'Block'),
+(11,2,198,'One-Handed Maces'),
+(11,2,199,'Two-Handed Maces'),
+(11,2,203,'Unarmed'),
+(11,2,204,'Defense'),
+(11,2,522,'SPELLDEFENSE (DND)'),
+(11,2,635,'Holy Light'),
+(11,2,668,'Language Common'),
+(11,2,1843,'Disarm'),
+(11,2,2382,'Generic'),
+(11,2,2479,'Honorless Target'),
+(11,2,3050,'Detect'),
+(11,2,3365,'Opening'),
+(11,2,6233,'Closing'),
+(11,2,6246,'Closing'),
+(11,2,6247,'Opening'),
+(11,2,6477,'Opening'),
+(11,2,6478,'Opening'),
+(11,2,6562,'Heroic Presence'),
+(11,2,6603,'Attack'),
+(11,2,7266,'Duel'),
+(11,2,7267,'Grovel'),
+(11,2,7355,'Stuck'),
+(11,2,8386,'Attacking'),
+(11,2,8737,'Mail'),
+(11,2,9077,'Leather'),
+(11,2,9078,'Cloth'),
+(11,2,9116,'Shield'),
+(11,2,9125,'Generic'),
+(11,2,21084,'Seal of Righteousness'),
+(11,2,21651,'Opening'),
+(11,2,21652,'Closing'),
+(11,2,22027,'Remove Insignia'),
+(11,2,22810,'Opening - No Text'),
+(11,2,27762,'Libram'),
+(11,2,28875,'Gemcutting'),
+(11,2,29932,'Language Draenei'),
+(11,2,45927,'Summon Friend'),
+(11,2,59221,'Shadow Resistance'),
+(11,2,59542,'Gift of the Naaru'),
+(11,2,61437,'Opening'),
+(11,3,75,'Auto Shot'),
+(11,3,81,'Dodge'),
+(11,3,201,'One-Handed Swords'),
+(11,3,203,'Unarmed'),
+(11,3,204,'Defense'),
+(11,3,522,'SPELLDEFENSE (DND)'),
+(11,3,668,'Language Common'),
+(11,3,1843,'Disarm'),
+(11,3,2382,'Generic'),
+(11,3,2479,'Honorless Target'),
+(11,3,2973,'Raptor Strike'),
+(11,3,3050,'Detect'),
+(11,3,3365,'Opening'),
+(11,3,5011,'Crossbows'),
+(11,3,6233,'Closing'),
+(11,3,6246,'Closing'),
+(11,3,6247,'Opening'),
+(11,3,6477,'Opening'),
+(11,3,6478,'Opening'),
+(11,3,6562,'Heroic Presence'),
+(11,3,6603,'Attack'),
+(11,3,7266,'Duel'),
+(11,3,7267,'Grovel'),
+(11,3,7355,'Stuck'),
+(11,3,8386,'Attacking'),
+(11,3,9077,'Leather'),
+(11,3,9078,'Cloth'),
+(11,3,9125,'Generic'),
+(11,3,13358,'Defensive State (DND)'),
+(11,3,21651,'Opening'),
+(11,3,21652,'Closing'),
+(11,3,22027,'Remove Insignia'),
+(11,3,22810,'Opening - No Text'),
+(11,3,24949,'Defensive State 2 (DND)'),
+(11,3,28875,'Gemcutting'),
+(11,3,29932,'Language Draenei'),
+(11,3,34082,'Advantaged State (DND)'),
+(11,3,45927,'Summon Friend'),
+(11,3,59221,'Shadow Resistance'),
+(11,3,59543,'Gift of the Naaru'),
+(11,3,61437,'Opening'),
+(11,5,81,'Dodge'),
+(11,5,198,'One-Handed Maces'),
+(11,5,203,'Unarmed'),
+(11,5,204,'Defense'),
+(11,5,522,'SPELLDEFENSE (DND)'),
+(11,5,585,'Smite'),
+(11,5,668,'Language Common'),
+(11,5,1843,'Disarm'),
+(11,5,2050,'Lesser Heal'),
+(11,5,2382,'Generic'),
+(11,5,2479,'Honorless Target'),
+(11,5,3050,'Detect'),
+(11,5,3365,'Opening'),
+(11,5,5009,'Wands'),
+(11,5,5019,'Shoot'),
+(11,5,6233,'Closing'),
+(11,5,6246,'Closing'),
+(11,5,6247,'Opening'),
+(11,5,6477,'Opening'),
+(11,5,6478,'Opening'),
+(11,5,6603,'Attack'),
+(11,5,7266,'Duel'),
+(11,5,7267,'Grovel'),
+(11,5,7355,'Stuck'),
+(11,5,8386,'Attacking'),
+(11,5,9078,'Cloth'),
+(11,5,9125,'Generic'),
+(11,5,21651,'Opening'),
+(11,5,21652,'Closing'),
+(11,5,22027,'Remove Insignia'),
+(11,5,22810,'Opening - No Text'),
+(11,5,28875,'Gemcutting'),
+(11,5,28878,'Inspiring Presence'),
+(11,5,29932,'Language Draenei'),
+(11,5,45927,'Summon Friend'),
+(11,5,59221,'Shadow Resistance'),
+(11,5,59544,'Gift of the Naaru'),
+(11,5,61437,'Opening'),
+(11,6,81,'Dodge'),
+(11,6,196,'One-Handed Axes'),
+(11,6,197,'Two-Handed Axes'),
+(11,6,200,'Polearms'),
+(11,6,201,'One-Handed Swords'),
+(11,6,202,'Two-Handed Swords'),
+(11,6,203,'Unarmed'),
+(11,6,204,'Defense'),
+(11,6,522,'SPELLDEFENSE (DND)'),
+(11,6,668,'Language Common'),
+(11,6,674,'Dual Wield'),
+(11,6,750,'Plate Mail'),
+(11,6,1843,'Disarm'),
+(11,6,2382,'Generic'),
+(11,6,2479,'Honorless Target'),
+(11,6,3050,'Detect'),
+(11,6,3127,'Parry'),
+(11,6,3275,'Linen Bandage'),
+(11,6,3276,'Heavy Linen Bandage'),
+(11,6,3277,'Wool Bandage'),
+(11,6,3278,'Heavy Wool Bandage'),
+(11,6,3365,'Opening'),
+(11,6,6233,'Closing'),
+(11,6,6246,'Closing'),
+(11,6,6247,'Opening'),
+(11,6,6477,'Opening'),
+(11,6,6478,'Opening'),
+(11,6,6562,'Heroic Presence'),
+(11,6,6603,'Attack'),
+(11,6,7266,'Duel'),
+(11,6,7267,'Grovel'),
+(11,6,7355,'Stuck'),
+(11,6,7928,'Silk Bandage'),
+(11,6,7929,'Heavy Silk Bandage'),
+(11,6,7934,'Anti-Venom'),
+(11,6,8386,'Attacking'),
+(11,6,8737,'Mail'),
+(11,6,9077,'Leather'),
+(11,6,9078,'Cloth'),
+(11,6,9125,'Generic'),
+(11,6,10840,'Mageweave Bandage'),
+(11,6,10841,'Heavy Mageweave Bandage'),
+(11,6,10846,'First Aid'),
+(11,6,18629,'Runecloth Bandage'),
+(11,6,18630,'Heavy Runecloth Bandage'),
+(11,6,21651,'Opening'),
+(11,6,21652,'Closing'),
+(11,6,22027,'Remove Insignia'),
+(11,6,22810,'Opening - No Text'),
+(11,6,28875,'Gemcutting'),
+(11,6,29932,'Language Draenei'),
+(11,6,33391,'Journeyman Riding'),
+(11,6,45462,'Plague Strike'),
+(11,6,45477,'Icy Touch'),
+(11,6,45902,'Blood Strike'),
+(11,6,45903,'Offensive State (DND)'),
+(11,6,45927,'Summon Friend'),
+(11,6,47541,'Death Coil'),
+(11,6,48266,'Blood Presence'),
+(11,6,49410,'Forceful Deflection'),
+(11,6,49576,'Death Grip'),
+(11,6,52665,'Sigil'),
+(11,6,59221,'Shadow Resistance'),
+(11,6,59539,'Shadow Resistance'),
+(11,6,59545,'Gift of the Naaru'),
+(11,6,59879,'Blood Plague'),
+(11,6,59921,'Frost Fever'),
+(11,6,61437,'Opening'),
+(11,6,61455,'Runic Focus'),
+(11,7,81,'Dodge'),
+(11,7,107,'Block'),
+(11,7,198,'One-Handed Maces'),
+(11,7,203,'Unarmed'),
+(11,7,204,'Defense'),
+(11,7,227,'Staves'),
+(11,7,331,'Healing Wave'),
+(11,7,403,'Lightning Bolt'),
+(11,7,522,'SPELLDEFENSE (DND)'),
+(11,7,668,'Language Common'),
+(11,7,1843,'Disarm'),
+(11,7,2382,'Generic'),
+(11,7,2479,'Honorless Target'),
+(11,7,3050,'Detect'),
+(11,7,3365,'Opening'),
+(11,7,6233,'Closing'),
+(11,7,6246,'Closing'),
+(11,7,6247,'Opening'),
+(11,7,6477,'Opening'),
+(11,7,6478,'Opening'),
+(11,7,6603,'Attack'),
+(11,7,7266,'Duel'),
+(11,7,7267,'Grovel'),
+(11,7,7355,'Stuck'),
+(11,7,8386,'Attacking'),
+(11,7,9077,'Leather'),
+(11,7,9078,'Cloth'),
+(11,7,9116,'Shield'),
+(11,7,9125,'Generic'),
+(11,7,21651,'Opening'),
+(11,7,21652,'Closing'),
+(11,7,22027,'Remove Insignia'),
+(11,7,22810,'Opening - No Text'),
+(11,7,27763,'Totem'),
+(11,7,28875,'Gemcutting'),
+(11,7,28878,'Inspiring Presence'),
+(11,7,29932,'Language Draenei'),
+(11,7,45927,'Summon Friend'),
+(11,7,59221,'Shadow Resistance'),
+(11,7,59547,'Gift of the Naaru'),
+(11,7,61437,'Opening'),
+(11,8,81,'Dodge'),
+(11,8,133,'Fireball'),
+(11,8,168,'Frost Armor'),
+(11,8,203,'Unarmed'),
+(11,8,204,'Defense'),
+(11,8,227,'Staves'),
+(11,8,522,'SPELLDEFENSE (DND)'),
+(11,8,668,'Language Common'),
+(11,8,1843,'Disarm'),
+(11,8,2382,'Generic'),
+(11,8,2479,'Honorless Target'),
+(11,8,3050,'Detect'),
+(11,8,3365,'Opening'),
+(11,8,5009,'Wands'),
+(11,8,5019,'Shoot'),
+(11,8,6233,'Closing'),
+(11,8,6246,'Closing'),
+(11,8,6247,'Opening'),
+(11,8,6477,'Opening'),
+(11,8,6478,'Opening'),
+(11,8,6603,'Attack'),
+(11,8,7266,'Duel'),
+(11,8,7267,'Grovel'),
+(11,8,7355,'Stuck'),
+(11,8,8386,'Attacking'),
+(11,8,9078,'Cloth'),
+(11,8,9125,'Generic'),
+(11,8,21651,'Opening'),
+(11,8,21652,'Closing'),
+(11,8,22027,'Remove Insignia'),
+(11,8,22810,'Opening - No Text'),
+(11,8,28875,'Gemcutting'),
+(11,8,28878,'Inspiring Presence'),
+(11,8,29932,'Language Draenei'),
+(11,8,45927,'Summon Friend'),
+(11,8,59221,'Shadow Resistance'),
+(11,8,59548,'Gift of the Naaru'),
+(11,8,61437,'Opening');
+/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `points_of_interest`
+--
+
+DROP TABLE IF EXISTS `points_of_interest`;
+CREATE TABLE `points_of_interest` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `icon` mediumint(8) unsigned NOT NULL default '0',
+ `flags` mediumint(8) unsigned NOT NULL default '0',
+ `data` mediumint(8) unsigned NOT NULL default '0',
+ `icon_name` text NOT NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `points_of_interest`
+--
+
+LOCK TABLES `points_of_interest` WRITE;
+/*!40000 ALTER TABLE `points_of_interest` DISABLE KEYS */;
+/*!40000 ALTER TABLE `points_of_interest` ENABLE KEYS */;
+UNLOCK TABLES;
+
+
+--
+-- Table structure for table `pool_creature`
+--
+
+DROP TABLE IF EXISTS `pool_creature`;
+CREATE TABLE `pool_creature` (
+ `guid` int(10) unsigned NOT NULL default '0',
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float unsigned NOT NULL default '0',
+ PRIMARY KEY (`pool_entry`,`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+--
+-- Dumping data for table `pool_creature`
+--
+
+LOCK TABLES `pool_creature` WRITE;
+/*!40000 ALTER TABLE `pool_creature` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pool_creature` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pool_gameobject`
+--
+
+DROP TABLE IF EXISTS `pool_gameobject`;
+CREATE TABLE `pool_gameobject` (
+ `guid` int(10) unsigned NOT NULL default '0',
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`,`pool_entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `pool_gameobject`
+--
+
+LOCK TABLES `pool_gameobject` WRITE;
+/*!40000 ALTER TABLE `pool_gameobject` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pool_gameobject` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pool_pool`
+--
+
+DROP TABLE IF EXISTS `pool_pool`;
+CREATE TABLE `pool_pool` (
+ `pool_id` mediumint(8) unsigned NOT NULL default '0',
+ `mother_pool` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float NOT NULL default '0',
+ PRIMARY KEY (`pool_id`,`mother_pool`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `pool_pool`
+--
+
+LOCK TABLES `pool_pool` WRITE;
+/*!40000 ALTER TABLE `pool_pool` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pool_pool` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pool_template`
+--
+
+DROP TABLE IF EXISTS `pool_template`;
+CREATE TABLE `pool_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Pool entry',
+ `max_limit` int(10) unsigned NOT NULL default '0' COMMENT 'Max number of objects (0) is no limit',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `pool_template`
+--
+
+LOCK TABLES `pool_template` WRITE;
+/*!40000 ALTER TABLE `pool_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `pool_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `game_event_pool`
+--
+
+DROP TABLE IF EXISTS `game_event_pool`;
+CREATE TABLE `game_event_pool` (
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Id of the pool',
+ `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
+ PRIMARY KEY (`pool_entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `game_event_pool`
+--
+
+LOCK TABLES `game_event_pool` WRITE;
+/*!40000 ALTER TABLE `game_event_pool` DISABLE KEYS */;
+/*!40000 ALTER TABLE `game_event_pool` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `prospecting_loot_template`
+--
+
+DROP TABLE IF EXISTS `prospecting_loot_template`;
+CREATE TABLE `prospecting_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `prospecting_loot_template`
+--
+
+LOCK TABLES `prospecting_loot_template` WRITE;
+/*!40000 ALTER TABLE `prospecting_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `prospecting_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `quest_end_scripts`
+--
+
+DROP TABLE IF EXISTS `quest_end_scripts`;
+CREATE TABLE `quest_end_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `quest_end_scripts`
+--
+
+LOCK TABLES `quest_end_scripts` WRITE;
+/*!40000 ALTER TABLE `quest_end_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `quest_start_scripts`
+--
+
+DROP TABLE IF EXISTS `quest_start_scripts`;
+CREATE TABLE `quest_start_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `quest_start_scripts`
+--
+
+LOCK TABLES `quest_start_scripts` WRITE;
+/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `quest_mail_loot_template`
+--
+
+DROP TABLE IF EXISTS `quest_mail_loot_template`;
+CREATE TABLE `quest_mail_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `quest_mail_loot_template`
+--
+
+LOCK TABLES `quest_mail_loot_template` WRITE;
+/*!40000 ALTER TABLE `quest_mail_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `quest_mail_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `quest_template`
+--
+
+DROP TABLE IF EXISTS `quest_template`;
+CREATE TABLE `quest_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `Method` tinyint(3) unsigned NOT NULL default '2',
+ `ZoneOrSort` smallint(6) NOT NULL default '0',
+ `SkillOrClass` smallint(6) NOT NULL default '0',
+ `MinLevel` tinyint(3) unsigned NOT NULL default '0',
+ `QuestLevel` tinyint(3) unsigned NOT NULL default '0',
+ `Type` smallint(5) unsigned NOT NULL default '0',
+ `RequiredRaces` smallint(5) unsigned NOT NULL default '0',
+ `RequiredSkillValue` smallint(5) unsigned NOT NULL default '0',
+ `RepObjectiveFaction` smallint(5) unsigned NOT NULL default '0',
+ `RepObjectiveValue` mediumint(9) NOT NULL default '0',
+ `RequiredMinRepFaction` smallint(5) unsigned NOT NULL default '0',
+ `RequiredMinRepValue` mediumint(9) NOT NULL default '0',
+ `RequiredMaxRepFaction` smallint(5) unsigned NOT NULL default '0',
+ `RequiredMaxRepValue` mediumint(9) NOT NULL default '0',
+ `SuggestedPlayers` tinyint(3) unsigned NOT NULL default '0',
+ `LimitTime` int(10) unsigned NOT NULL default '0',
+ `QuestFlags` smallint(5) unsigned NOT NULL default '0',
+ `SpecialFlags` tinyint(3) unsigned NOT NULL default '0',
+ `CharTitleId` tinyint(3) unsigned NOT NULL default '0',
+ `PlayersSlain` tinyint(3) unsigned NOT NULL default '0',
+ `BonusTalents` tinyint(3) unsigned NOT NULL default '0',
+ `PrevQuestId` mediumint(9) NOT NULL default '0',
+ `NextQuestId` mediumint(9) NOT NULL default '0',
+ `ExclusiveGroup` mediumint(9) NOT NULL default '0',
+ `NextQuestInChain` mediumint(8) unsigned NOT NULL default '0',
+ `SrcItemId` mediumint(8) unsigned NOT NULL default '0',
+ `SrcItemCount` tinyint(3) unsigned NOT NULL default '0',
+ `SrcSpell` mediumint(8) unsigned NOT NULL default '0',
+ `Title` text,
+ `Details` text,
+ `Objectives` text,
+ `OfferRewardText` text,
+ `RequestItemsText` text,
+ `EndText` text,
+ `ObjectiveText1` text,
+ `ObjectiveText2` text,
+ `ObjectiveText3` text,
+ `ObjectiveText4` text,
+ `ReqItemId1` mediumint(8) unsigned NOT NULL default '0',
+ `ReqItemId2` mediumint(8) unsigned NOT NULL default '0',
+ `ReqItemId3` mediumint(8) unsigned NOT NULL default '0',
+ `ReqItemId4` mediumint(8) unsigned NOT NULL default '0',
+ `ReqItemCount1` smallint(5) unsigned NOT NULL default '0',
+ `ReqItemCount2` smallint(5) unsigned NOT NULL default '0',
+ `ReqItemCount3` smallint(5) unsigned NOT NULL default '0',
+ `ReqItemCount4` smallint(5) unsigned NOT NULL default '0',
+ `ReqSourceId1` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSourceId2` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSourceId3` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSourceId4` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSourceCount1` smallint(5) unsigned NOT NULL default '0',
+ `ReqSourceCount2` smallint(5) unsigned NOT NULL default '0',
+ `ReqSourceCount3` smallint(5) unsigned NOT NULL default '0',
+ `ReqSourceCount4` smallint(5) unsigned NOT NULL default '0',
+ `ReqCreatureOrGOId1` mediumint(9) NOT NULL default '0',
+ `ReqCreatureOrGOId2` mediumint(9) NOT NULL default '0',
+ `ReqCreatureOrGOId3` mediumint(9) NOT NULL default '0',
+ `ReqCreatureOrGOId4` mediumint(9) NOT NULL default '0',
+ `ReqCreatureOrGOCount1` smallint(5) unsigned NOT NULL default '0',
+ `ReqCreatureOrGOCount2` smallint(5) unsigned NOT NULL default '0',
+ `ReqCreatureOrGOCount3` smallint(5) unsigned NOT NULL default '0',
+ `ReqCreatureOrGOCount4` smallint(5) unsigned NOT NULL default '0',
+ `ReqSpellCast1` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSpellCast2` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSpellCast3` mediumint(8) unsigned NOT NULL default '0',
+ `ReqSpellCast4` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId1` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId2` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId3` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId4` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId5` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemId6` mediumint(8) unsigned NOT NULL default '0',
+ `RewChoiceItemCount1` smallint(5) unsigned NOT NULL default '0',
+ `RewChoiceItemCount2` smallint(5) unsigned NOT NULL default '0',
+ `RewChoiceItemCount3` smallint(5) unsigned NOT NULL default '0',
+ `RewChoiceItemCount4` smallint(5) unsigned NOT NULL default '0',
+ `RewChoiceItemCount5` smallint(5) unsigned NOT NULL default '0',
+ `RewChoiceItemCount6` smallint(5) unsigned NOT NULL default '0',
+ `RewItemId1` mediumint(8) unsigned NOT NULL default '0',
+ `RewItemId2` mediumint(8) unsigned NOT NULL default '0',
+ `RewItemId3` mediumint(8) unsigned NOT NULL default '0',
+ `RewItemId4` mediumint(8) unsigned NOT NULL default '0',
+ `RewItemCount1` smallint(5) unsigned NOT NULL default '0',
+ `RewItemCount2` smallint(5) unsigned NOT NULL default '0',
+ `RewItemCount3` smallint(5) unsigned NOT NULL default '0',
+ `RewItemCount4` smallint(5) unsigned NOT NULL default '0',
+ `RewRepFaction1` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',
+ `RewRepFaction2` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',
+ `RewRepFaction3` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',
+ `RewRepFaction4` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',
+ `RewRepFaction5` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case',
+ `RewRepValue1` mediumint(9) NOT NULL default '0',
+ `RewRepValue2` mediumint(9) NOT NULL default '0',
+ `RewRepValue3` mediumint(9) NOT NULL default '0',
+ `RewRepValue4` mediumint(9) NOT NULL default '0',
+ `RewRepValue5` mediumint(9) NOT NULL default '0',
+ `RewHonorableKills` int unsigned NOT NULL default '0',
+ `RewOrReqMoney` int(11) NOT NULL default '0',
+ `RewMoneyMaxLevel` int(10) unsigned NOT NULL default '0',
+ `RewSpell` mediumint(8) unsigned NOT NULL default '0',
+ `RewSpellCast` mediumint(8) unsigned NOT NULL default '0',
+ `RewMailTemplateId` mediumint(8) unsigned NOT NULL default '0',
+ `RewMailDelaySecs` int(11) unsigned NOT NULL default '0',
+ `PointMapId` smallint(5) unsigned NOT NULL default '0',
+ `PointX` float NOT NULL default '0',
+ `PointY` float NOT NULL default '0',
+ `PointOpt` mediumint(8) unsigned NOT NULL default '0',
+ `DetailsEmote1` smallint(5) unsigned NOT NULL default '0',
+ `DetailsEmote2` smallint(5) unsigned NOT NULL default '0',
+ `DetailsEmote3` smallint(5) unsigned NOT NULL default '0',
+ `DetailsEmote4` smallint(5) unsigned NOT NULL default '0',
+ `IncompleteEmote` smallint(5) unsigned NOT NULL default '0',
+ `CompleteEmote` smallint(5) unsigned NOT NULL default '0',
+ `OfferRewardEmote1` smallint(5) unsigned NOT NULL default '0',
+ `OfferRewardEmote2` smallint(5) unsigned NOT NULL default '0',
+ `OfferRewardEmote3` smallint(5) unsigned NOT NULL default '0',
+ `OfferRewardEmote4` smallint(5) unsigned NOT NULL default '0',
+ `StartScript` mediumint(8) unsigned NOT NULL default '0',
+ `CompleteScript` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quest System';
+
+--
+-- Dumping data for table `quest_template`
+--
+
+LOCK TABLES `quest_template` WRITE;
+/*!40000 ALTER TABLE `quest_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `quest_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `reference_loot_template`
+--
+
+DROP TABLE IF EXISTS `reference_loot_template`;
+CREATE TABLE `reference_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `reference_loot_template`
+--
+
+LOCK TABLES `reference_loot_template` WRITE;
+/*!40000 ALTER TABLE `reference_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `reference_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `reserved_name`
+--
+
+DROP TABLE IF EXISTS `reserved_name`;
+CREATE TABLE `reserved_name` (
+ `name` varchar(12) NOT NULL default '',
+ PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player Reserved Names';
+
+--
+-- Dumping data for table `reserved_name`
+--
+
+LOCK TABLES `reserved_name` WRITE;
+/*!40000 ALTER TABLE `reserved_name` DISABLE KEYS */;
+/*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `skill_discovery_template`
+--
+
+DROP TABLE IF EXISTS `skill_discovery_template`;
+CREATE TABLE `skill_discovery_template` (
+ `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the discoverable spell',
+ `reqSpell` mediumint(8) unsigned NOT NULL default '0' COMMENT 'spell requirement',
+ `reqSkillValue` smallint(5) unsigned NOT NULL default '0' COMMENT 'skill points requirement',
+ `chance` float NOT NULL default '0' COMMENT 'chance to discover',
+ PRIMARY KEY (`spellId`,`reqSpell`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Discovery System';
+
+--
+-- Dumping data for table `skill_discovery_template`
+--
+
+LOCK TABLES `skill_discovery_template` WRITE;
+/*!40000 ALTER TABLE `skill_discovery_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `skill_discovery_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `skill_extra_item_template`
+--
+
+DROP TABLE IF EXISTS `skill_extra_item_template`;
+CREATE TABLE `skill_extra_item_template` (
+ `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the item creation spell',
+ `requiredSpecialization` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Specialization spell id',
+ `additionalCreateChance` float NOT NULL default '0' COMMENT 'chance to create add',
+ `additionalMaxNum` tinyint(3) unsigned NOT NULL default '0' COMMENT 'max num of adds',
+ PRIMARY KEY (`spellId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Specialization System';
+
+--
+-- Dumping data for table `skill_extra_item_template`
+--
+
+LOCK TABLES `skill_extra_item_template` WRITE;
+/*!40000 ALTER TABLE `skill_extra_item_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `skill_extra_item_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `skill_fishing_base_level`
+--
+
+DROP TABLE IF EXISTS `skill_fishing_base_level`;
+CREATE TABLE `skill_fishing_base_level` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Area identifier',
+ `skill` smallint(6) NOT NULL default '0' COMMENT 'Base skill level requirement',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Fishing system';
+
+--
+-- Dumping data for table `skill_fishing_base_level`
+--
+
+LOCK TABLES `skill_fishing_base_level` WRITE;
+/*!40000 ALTER TABLE `skill_fishing_base_level` DISABLE KEYS */;
+/*!40000 ALTER TABLE `skill_fishing_base_level` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `skinning_loot_template`
+--
+
+DROP TABLE IF EXISTS `skinning_loot_template`;
+CREATE TABLE `skinning_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `skinning_loot_template`
+--
+
+LOCK TABLES `skinning_loot_template` WRITE;
+/*!40000 ALTER TABLE `skinning_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `skinning_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_affect`
+--
+
+DROP TABLE IF EXISTS `spell_affect`;
+CREATE TABLE `spell_affect` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `effectId` tinyint(3) unsigned NOT NULL default '0',
+ `SpellClassMask0` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask1` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask2` int(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`effectId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `spell_affect`
+--
+
+LOCK TABLES `spell_affect` WRITE;
+/*!40000 ALTER TABLE `spell_affect` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_affect` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_area`
+--
+
+DROP TABLE IF EXISTS `spell_area`;
+CREATE TABLE `spell_area` (
+ `spell` mediumint(8) unsigned NOT NULL default '0',
+ `area` mediumint(8) unsigned NOT NULL default '0',
+ `quest_start` mediumint(8) unsigned NOT NULL default '0',
+ `quest_start_active` tinyint(1) unsigned NOT NULL default '0',
+ `quest_end` mediumint(8) unsigned NOT NULL default '0',
+ `aura_spell` mediumint(8) NOT NULL default '0',
+ `racemask` mediumint(8) unsigned NOT NULL default '0',
+ `gender` tinyint(1) unsigned NOT NULL default '2',
+ `autocast` tinyint(1) unsigned NOT NULL default '0',
+ PRIMARY KEY (`spell`,`area`,`quest_start`,`quest_start_active`,`aura_spell`,`racemask`,`gender`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `spell_area`
+--
+
+LOCK TABLES `spell_area` WRITE;
+/*!40000 ALTER TABLE `spell_area` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_area` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_chain`
+--
+
+DROP TABLE IF EXISTS `spell_chain`;
+CREATE TABLE `spell_chain` (
+ `spell_id` mediumint(9) NOT NULL default '0',
+ `prev_spell` mediumint(9) NOT NULL default '0',
+ `first_spell` mediumint(9) NOT NULL default '0',
+ `rank` tinyint(4) NOT NULL default '0',
+ `req_spell` mediumint(9) NOT NULL default '0',
+ PRIMARY KEY (`spell_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Additinal Data';
+
+--
+-- Dumping data for table `spell_chain`
+--
+
+LOCK TABLES `spell_chain` WRITE;
+/*!40000 ALTER TABLE `spell_chain` DISABLE KEYS */;
+INSERT INTO spell_chain VALUES
+/*------------------
+--(6) Frost
+------------------*/
+/*Blizzard*/
+(10,0,10,1,0),
+(6141,10,10,2,0),
+(8427,6141,10,3,0),
+(10185,8427,10,4,0),
+(10186,10185,10,5,0),
+(10187,10186,10,6,0),
+(27085,10187,10,7,0),
+(42939,27085,10,8,0),
+(42940,42939,10,9,0),
+/*ConeofCold*/
+(120,0,120,1,0),
+(8492,120,120,2,0),
+(10159,8492,120,3,0),
+(10160,10159,120,4,0),
+(10161,10160,120,5,0),
+(27087,10161,120,6,0),
+(42930,27087,120,7,0),
+(42931,42930,120,8,0),
+/*FrostArmor*/
+(168,0,168,1,0),
+(7300,168,168,2,0),
+(7301,7300,168,3,0),
+/*FrostNova*/
+(122,0,122,1,0),
+(865,122,122,2,0),
+(6131,865,122,3,0),
+(10230,6131,122,4,0),
+(27088,10230,122,5,0),
+(42917,27088,122,6,0),
+/*FrostWard*/
+(6143,0,6143,1,0),
+(8461,6143,6143,2,0),
+(8462,8461,6143,3,0),
+(10177,8462,6143,4,0),
+(28609,10177,6143,5,0),
+(32796,28609,6143,6,0),
+(43012,32796,6143,7,0),
+/*Frostbolt*/
+(116,0,116,1,0),
+(205,116,116,2,0),
+(837,205,116,3,0),
+(7322,837,116,4,0),
+(8406,7322,116,5,0),
+(8407,8406,116,6,0),
+(8408,8407,116,7,0),
+(10179,8408,116,8,0),
+(10180,10179,116,9,0),
+(10181,10180,116,10,0),
+(25304,10181,116,11,0),
+(27071,25304,116,12,0),
+(27072,27071,116,13,0),
+(38697,27072,116,14,0),
+(42841,38697,116,15,0),
+(42842,42841,116,16,0),
+/*IceArmor*/
+(7302,0,7302,1,0),
+(7320,7302,7302,2,0),
+(10219,7320,7302,3,0),
+(10220,10219,7302,4,0),
+(27124,10220,7302,5,0),
+(43008,27124,7302,6,0),
+/*IceBarrier*/
+(11426,0,11426,1,0),
+(13031,11426,11426,2,0),
+(13032,13031,11426,3,0),
+(13033,13032,11426,4,0),
+(27134,13033,11426,5,0),
+(33405,27134,11426,6,0),
+(43038,33405,11426,7,0),
+(43039,43038,11426,8,0),
+/*IceLance*/
+(30455,0,30455,1,0),
+(42913,30455,30455,2,0),
+(42914,42913,30455,3,0),
+/*------------------
+--(8)Fire
+------------------*/
+/*BlastWave*/
+(11113,0,11113,1,0),
+(13018,11113,11113,2,0),
+(13019,13018,11113,3,0),
+(13020,13019,11113,4,0),
+(13021,13020,11113,5,0),
+(27133,13021,11113,6,0),
+(33933,27133,11113,7,0),
+(42944,33933,11113,8,0),
+(42945,42944,11113,9,0),
+/*Dragon'sBreath*/
+(31661,0,31661,1,0),
+(33041,31661,31661,2,0),
+(33042,33041,31661,3,0),
+(33043,33042,31661,4,0),
+(42949,33043,31661,5,0),
+(42950,42949,31661,6,0),
+/*FireBlast*/
+(2136,0,2136,1,0),
+(2137,2136,2136,2,0),
+(2138,2137,2136,3,0),
+(8412,2138,2136,4,0),
+(8413,8412,2136,5,0),
+(10197,8413,2136,6,0),
+(10199,10197,2136,7,0),
+(27078,10199,2136,8,0),
+(27079,27078,2136,9,0),
+(42872,27079,2136,10,0),
+(42873,42872,2136,11,0),
+/*FireWard*/
+(543,0,543,1,0),
+(8457,543,543,2,0),
+(8458,8457,543,3,0),
+(10223,8458,543,4,0),
+(10225,10223,543,5,0),
+(27128,10225,543,6,0),
+(43010,27128,543,7,0),
+/*Fireball*/
+(133,0,133,1,0),
+(143,133,133,2,0),
+(145,143,133,3,0),
+(3140,145,133,4,0),
+(8400,3140,133,5,0),
+(8401,8400,133,6,0),
+(8402,8401,133,7,0),
+(10148,8402,133,8,0),
+(10149,10148,133,9,0),
+(10150,10149,133,10,0),
+(10151,10150,133,11,0),
+(25306,10151,133,12,0),
+(27070,25306,133,13,0),
+(38692,27070,133,14,0),
+(42832,38692,133,15,0),
+(42833,42832,133,16,0),
+/*Flamestrike*/
+(2120,0,2120,1,0),
+(2121,2120,2120,2,0),
+(8422,2121,2120,3,0),
+(8423,8422,2120,4,0),
+(10215,8423,2120,5,0),
+(10216,10215,2120,6,0),
+(27086,10216,2120,7,0),
+(42925,27086,2120,8,0),
+(42926,42925,2120,9,0),
+/*FrostfireBolt*/
+(44614,0,44614,1,0),
+(47610,44614,44614,2,0),
+/*LivingBomb*/
+(44457,0,44457,1,0),
+(55359,44457,44457,2,0),
+(55360,55359,44457,3,0),
+/*MoltenArmor*/
+(30482,0,30482,1,0),
+(43045,30482,30482,2,0),
+(43046,43045,30482,3,0),
+/*Pyroblast*/
+(11366,0,11366,1,0),
+(12505,11366,11366,2,0),
+(12522,12505,11366,3,0),
+(12523,12522,11366,4,0),
+(12524,12523,11366,5,0),
+(12525,12524,11366,6,0),
+(12526,12525,11366,7,0),
+(18809,12526,11366,8,0),
+(27132,18809,11366,9,0),
+(33938,27132,11366,10,0),
+(42890,33938,11366,11,0),
+(42891,42890,11366,12,0),
+/*Scorch*/
+(2948,0,2948,1,0),
+(8444,2948,2948,2,0),
+(8445,8444,2948,3,0),
+(8446,8445,2948,4,0),
+(10205,8446,2948,5,0),
+(10206,10205,2948,6,0),
+(10207,10206,2948,7,0),
+(27073,10207,2948,8,0),
+(27074,27073,2948,9,0),
+(42858,27074,2948,10,0),
+(42859,42858,2948,11,0),
+/*------------------
+--(26)Arms
+------------------*/
+/*Charge*/
+(100,0,100,1,0),
+(6178,100,100,2,0),
+(11578,6178,100,3,0),
+/*HeroicStrike*/
+(78,0,78,1,0),
+(284,78,78,2,0),
+(285,284,78,3,0),
+(1608,285,78,4,0),
+(11564,1608,78,5,0),
+(11565,11564,78,6,0),
+(11566,11565,78,7,0),
+(11567,11566,78,8,0),
+(25286,11567,78,9,0),
+(29707,25286,78,10,0),
+(30324,29707,78,11,0),
+(47449,30324,78,12,0),
+(47450,47449,78,13,0),
+/*MortalStrike*/
+(12294,0,12294,1,0),
+(21551,12294,12294,2,0),
+(21552,21551,12294,3,0),
+(21553,21552,12294,4,0),
+(25248,21553,12294,5,0),
+(30330,25248,12294,6,0),
+(47485,30330,12294,7,0),
+(47486,47485,12294,8,0),
+/*Rend*/
+(772,0,772,1,0),
+(6546,772,772,2,0),
+(6547,6546,772,3,0),
+(6548,6547,772,4,0),
+(11572,6548,772,5,0),
+(11573,11572,772,6,0),
+(11574,11573,772,7,0),
+(25208,11574,772,8,0),
+(46845,25208,772,9,0),
+(47465,46845,772,10,0),
+/*ThunderClap*/
+(6343,0,6343,1,0),
+(8198,6343,6343,2,0),
+(8204,8198,6343,3,0),
+(8205,8204,6343,4,0),
+(11580,8205,6343,5,0),
+(11581,11580,6343,6,0),
+(25264,11581,6343,7,0),
+(47501,25264,6343,8,0),
+(47502,47501,6343,9,0),
+/*------------------
+-- (38) Combat (Rogue)
+------------------*/
+/*Backstab*/
+(53,0,53,1,0),
+(2589,53,53,2,0),
+(2590,2589,53,3,0),
+(2591,2590,53,4,0),
+(8721,2591,53,5,0),
+(11279,8721,53,6,0),
+(11280,11279,53,7,0),
+(11281,11280,53,8,0),
+(25300,11281,53,9,0),
+(26863,25300,53,10,0),
+(48656,26863,53,11,0),
+(48657,48656,53,12,0),
+/*Evasion*/
+(5277,0,5277,1,0),
+(26669,5277,5277,2,0),
+/*Feint*/
+(1966,0,1966,1,0),
+(6768,1966,1966,2,0),
+(8637,6768,1966,3,0),
+(11303,8637,1966,4,0),
+(25302,11303,1966,5,0),
+(27448,25302,1966,6,0),
+(48658,27448,1966,7,0),
+(48659,48658,1966,8,0),
+/*Sinister Strike*/
+(1752,0,1752,1,0),
+(1757,1752,1752,2,0),
+(1758,1757,1752,3,0),
+(1759,1758,1752,4,0),
+(1760,1759,1752,5,0),
+(8621,1760,1752,6,0),
+(11293,8621,1752,7,0),
+(11294,11293,1752,8,0),
+(26861,11294,1752,9,0),
+(26862,26861,1752,10,0),
+(48637,26862,1752,11,0),
+(48638,48637,1752,12,0),
+/*Sprint*/
+(2983,0,2983,1,0),
+(8696,2983,2983,2,0),
+(11305,8696,2983,3,0),
+/*------------------
+--(39)Subtlety
+------------------*/
+/*Hemorrhage*/
+(16511,0,16511,1,0),
+(17347,16511,16511,2,0),
+(17348,17347,16511,3,0),
+(26864,17348,16511,4,0),
+(48660,26864,16511,5,0),
+/*Sap*/
+(6770,0,6770,1,0),
+(2070,6770,6770,2,0),
+(11297,2070,6770,3,0),
+(51724,11297,6770,4,0),
+/*Stealth*/
+(1784,0,1784,1,0),
+(1785,1784,1784,2,0),
+(1786,1785,1784,3,0),
+(1787,1786,1784,4,0),
+/*Vanish*/
+(1856,0,1856,1,0),
+(1857,1856,1856,2,0),
+(26889,1857,1856,3,0),
+/*------------------
+-- (50) Beast Mastery
+------------------*/
+/*Aspect of the Hawk*/
+(13165,0,13165,1,0),
+(14318,13165,13165,2,0),
+(14319,14318,13165,3,0),
+(14320,14319,13165,4,0),
+(14321,14320,13165,5,0),
+(14322,14321,13165,6,0),
+(25296,14322,13165,7,0),
+(27044,25296,13165,8,0),
+/*Aspect of the Wild*/
+(20043,0,20043,1,0),
+(20190,20043,20043,2,0),
+(27045,20190,20043,3,0),
+(49071,27045,20043,4,0),
+/*MendPet*/
+(136,0,136,1,0),
+(3111,136,136,2,0),
+(3661,3111,136,3,0),
+(3662,3661,136,4,0),
+(13542,3662,136,5,0),
+(13543,13542,136,6,0),
+(13544,13543,136,7,0),
+(27046,13544,136,8,0),
+(48989,27046,136,9,0),
+(48990,48989,136,10,0),
+/*ScareBeast*/
+(1513,0,1513,1,0),
+(14326,1513,1513,2,0),
+(14327,14326,1513,3,0),
+/*------------------
+--(51)Survival
+------------------*/
+/*Counterattack*/
+(19306,0,19306,1,0),
+(20909,19306,19306,2,0),
+(20910,20909,19306,3,0),
+(27067,20910,19306,4,0),
+(48998,27067,19306,5,0),
+(48999,48998,19306,6,0),
+/*ExplosiveShot*/
+(53301,0,53301,1,0),
+(60051,53301,53301,2,0),
+(60052,60051,53301,3,0),
+(60053,60052,53301,4,0),
+/*ExplosiveTrap*/
+(13813,0,13813,1,0),
+(14316,13813,13813,2,0),
+(14317,14316,13813,3,0),
+(27025,14317,13813,4,0),
+(49066,27025,13813,5,0),
+(49067,49066,13813,6,0),
+/*FreezingTrap*/
+(1499,0,1499,1,0),
+(14310,1499,1499,2,0),
+(14311,14310,1499,3,0),
+/*ImmolationTrap*/
+(13795,0,13795,1,0),
+(14302,13795,13795,2,0),
+(14303,14302,13795,3,0),
+(14304,14303,13795,4,0),
+(14305,14304,13795,5,0),
+(27023,14305,13795,6,0),
+(49055,27023,13795,7,0),
+(49056,49055,13795,8,0),
+/*MongooseBite*/
+(1495,0,1495,1,0),
+(14269,1495,1495,2,0),
+(14270,14269,1495,3,0),
+(14271,14270,1495,4,0),
+(36916,14271,1495,5,0),
+(53339,36916,1495,6,0),
+/*RaptorStrike*/
+(2973,0,2973,1,0),
+(14260,2973,2973,2,0),
+(14261,14260,2973,3,0),
+(14262,14261,2973,4,0),
+(14263,14262,2973,5,0),
+(14264,14263,2973,6,0),
+(14265,14264,2973,7,0),
+(14266,14265,2973,8,0),
+(27014,14266,2973,9,0),
+(48995,27014,2973,10,0),
+(48996,48995,2973,11,0),
+/*WyvernSting*/
+(19386,0,19386,1,0),
+(24132,19386,19386,2,0),
+(24133,24132,19386,3,0),
+(27068,24133,19386,4,0),
+(49011,27068,19386,5,0),
+(49012,49011,19386,6,0),
+/*------------------
+-- (56) Holy (Priest)
+------------------*/
+/*Binding Heal*/
+(32546,0,32546,1,0),
+(48119,32546,32546,2,0),
+(48120,48119,32546,3,0),
+/*Circle of Healing*/
+(34861,0,34861,1,0),
+(34863,34861,34861,2,0),
+(34864,34863,34861,3,0),
+(34865,34864,34861,4,0),
+(34866,34865,34861,5,0),
+(48088,34866,34861,6,0),
+(48089,48088,34861,7,0),
+/*DesperatePrayer*/
+(19236,0,19236,1,0),
+(19238,19236,19236,2,0),
+(19240,19238,19236,3,0),
+(19241,19240,19236,4,0),
+(19242,19241,19236,5,0),
+(19243,19242,19236,6,0),
+(25437,19243,19236,7,0),
+(48172,25437,19236,8,0),
+(48173,48172,19236,9,0),
+/*FlashHeal*/
+(2061,0,2061,1,0),
+(9472,2061,2061,2,0),
+(9473,9472,2061,3,0),
+(9474,9473,2061,4,0),
+(10915,9474,2061,5,0),
+(10916,10915,2061,6,0),
+(10917,10916,2061,7,0),
+(25233,10917,2061,8,0),
+(25235,25233,2061,9,0),
+(48070,25235,2061,10,0),
+(48071,48070,2061,11,0),
+/*GreaterHeal*/
+(2060,0,2060,1,0),
+(10963,2060,2060,2,0),
+(10964,10963,2060,3,0),
+(10965,10964,2060,4,0),
+(25314,10965,2060,5,0),
+(25210,25314,2060,6,0),
+(25213,25210,2060,7,0),
+(48062,25213,2060,8,0),
+(48063,48062,2060,9,0),
+/*Heal*/
+(2054,0,2054,1,0),
+(2055,2054,2054,2,0),
+(6063,2055,2054,3,0),
+(6064,6063,2054,4,0),
+/*Holy Fire*/
+(14914,0,14914,1,0),
+(15262,14914,14914,2,0),
+(15263,15262,14914,3,0),
+(15264,15263,14914,4,0),
+(15265,15264,14914,5,0),
+(15266,15265,14914,6,0),
+(15267,15266,14914,7,0),
+(15261,15267,14914,8,0),
+(25384,15261,14914,9,0),
+(48134,25384,14914,10,0),
+(48135,48134,14914,11,0),
+/*Holy Nova*/
+(15237,0,15237,1,0),
+(15430,15237,15237,2,0),
+(15431,15430,15237,3,0),
+(27799,15431,15237,4,0),
+(27800,27799,15237,5,0),
+(27801,27800,15237,6,0),
+(25331,27801,15237,7,0),
+(48077,25331,15237,8,0),
+(48078,48077,15237,9,0),
+/*LesserHeal*/
+(2050,0,2050,1,0),
+(2052,2050,2050,2,0),
+(2053,2052,2050,3,0),
+/*Lightwell*/
+(724,0,724,1,0),
+(27870,724,724,2,0),
+(27871,27870,724,3,0),
+(28275,27871,724,4,0),
+(48086,28275,724,5,0),
+(48087,48086,724,6,0),
+/*Prayer of Healing*/
+(596,0,596,1,0),
+(996,596,596,2,0),
+(10960,996,596,3,0),
+(10961,10960,596,4,0),
+(25316,10961,596,5,0),
+(25308,25316,596,6,0),
+(48072,25308,596,7,0),
+/*Prayer of Mending*/
+(33076,0,33076,1,0),
+(48112,33076,33076,2,0),
+(48113,48112,33076,3,0),
+/*Renew*/
+(139,0,139,1,0),
+(6074,139,139,2,0),
+(6075,6074,139,3,0),
+(6076,6075,139,4,0),
+(6077,6076,139,5,0),
+(6078,6077,139,6,0),
+(10927,6078,139,7,0),
+(10928,10927,139,8,0),
+(10929,10928,139,9,0),
+(25315,10929,139,10,0),
+(25221,25315,139,11,0),
+(25222,25221,139,12,0),
+(48067,25222,139,13,0),
+(48068,48067,139,14,0),
+/*Resurrection*/
+(2006,0,2006,1,0),
+(2010,2006,2006,2,0),
+(10880,2010,2006,3,0),
+(10881,10880,2006,4,0),
+(20770,10881,2006,5,0),
+(25435,20770,2006,6,0),
+(48171,25435,2006,7,0),
+/*Smite*/
+(585,0,585,1,0),
+(591,585,585,2,0),
+(598,591,585,3,0),
+(984,598,585,4,0),
+(1004,984,585,5,0),
+(6060,1004,585,6,0),
+(10933,6060,585,7,0),
+(10934,10933,585,8,0),
+(25363,10934,585,9,0),
+(25364,25363,585,10,0),
+(48122,25364,585,11,0),
+(48123,48122,585,12,0),
+/*------------------
+-- (78) Shadow Magic
+------------------*/
+/*Devouring Plague*/
+(2944,0,2944,1,0),
+(19276,2944,2944,2,0),
+(19277,19276,2944,3,0),
+(19278,19277,2944,4,0),
+(19279,19278,2944,5,0),
+(19280,19279,2944,6,0),
+(25467,19280,2944,7,0),
+(48299,25467,2944,8,0),
+(48300,48299,2944,9,0),
+/*Mind Blast*/
+(8092,0,8092,1,0),
+(8102,8092,8092,2,0),
+(8103,8102,8092,3,0),
+(8104,8103,8092,4,0),
+(8105,8104,8092,5,0),
+(8106,8105,8092,6,0),
+(10945,8106,8092,7,0),
+(10946,10945,8092,8,0),
+(10947,10946,8092,9,0),
+(25372,10947,8092,10,0),
+(25375,25372,8092,11,0),
+(48126,25375,8092,12,0),
+(48127,48126,8092,13,0),
+/*MindFlay*/
+(15407,0,15407,1,0),
+(17311,15407,15407,2,0),
+(17312,17311,15407,3,0),
+(17313,17312,15407,4,0),
+(17314,17313,15407,5,0),
+(18807,17314,15407,6,0),
+(25387,18807,15407,7,0),
+(48155,25387,15407,8,0),
+(48156,48155,15407,9,0),
+/*MindSear*/
+(48045,0,48045,1,0),
+(53023,48045,48045,2,0),
+/*MindVision*/
+(2096,0,2096,1,0),
+(10909,2096,2096,2,0),
+/*Prayer of Shadow Protection*/
+(27683,0,27683,1,0),
+(39374,27683,27683,2,0),
+(48170,39374,27683,3,0),
+/*PsychicScream*/
+(8122,0,8122,1,0),
+(8124,8122,8122,2,0),
+(10888,8124,8122,3,0),
+(10890,10888,8122,4,0),
+/*Shadow Protection*/
+(976,0,976,1,0),
+(10957,976,976,2,0),
+(10958,10957,976,3,0),
+(25433,10958,976,4,0),
+(48169,25433,976,5,0),
+/*ShadowWord:Death*/
+(32379,0,32379,1,0),
+(32996,32379,32379,2,0),
+(48157,32996,32379,3,0),
+(48158,48157,32379,4,0),
+/*ShadowWord:Pain*/
+(589,0,589,1,0),
+(594,589,589,2,0),
+(970,594,589,3,0),
+(992,970,589,4,0),
+(2767,992,589,5,0),
+(10892,2767,589,6,0),
+(10893,10892,589,7,0),
+(10894,10893,589,8,0),
+(25367,10894,589,9,0),
+(25368,25367,589,10,0),
+(48124,25368,589,11,0),
+(48125,48124,589,12,0),
+/*Vampiric Touch*/
+(34914,0,34914,1,0),
+(34916,34914,34914,2,0),
+(34917,34916,34914,3,0),
+(48159,34917,34914,4,0),
+(48160,48159,34914,5,0),
+/*------------------
+-- (129) First Aid
+------------------*/
+/*First Aid*/
+(3273,0,3273,1,0),
+(3274,3273,3273,2,0),
+(7924,3274,3273,3,0),
+(10846,7924,3273,4,0),
+(27028,10846,3273,5,0),
+(45542,27028,3273,6,0),
+/*------------------
+-- (134) Feral Combat (Druid)
+------------------*/
+/*Bash*/
+(5211,0,5211,1,0),
+(6798,5211,5211,2,0),
+(8983,6798,5211,3,0),
+/*Bear Form*/
+(5487,0,5487,1,0),
+(9634,5487,5487,2,0),
+/*Claw*/
+(1082,0,1082,1,0),
+(3029,1082,1082,2,0),
+(5201,3029,1082,3,0),
+(9849,5201,1082,4,0),
+(9850,9849,1082,5,0),
+(27000,9850,1082,6,0),
+(48569,27000,1082,7,0),
+(48570,48569,1082,8,0),
+/*Cower*/
+(8998,0,8998,1,0),
+(9000,8998,8998,2,0),
+(9892,9000,8998,3,0),
+(31709,9892,8998,4,0),
+(27004,31709,8998,5,0),
+(48575,27004,8998,6,0),
+/*Dash*/
+(1850,0,1850,1,0),
+(9821,1850,1850,2,0),
+(33357,9821,1850,3,0),
+/*Demoralizing Roar*/
+(99,0,99,1,0),
+(1735,99,99,2,0),
+(9490,1735,99,3,0),
+(9747,9490,99,4,0),
+(9898,9747,99,5,0),
+(26998,9898,99,6,0),
+(48559,26998,99,7,0),
+(48560,48559,99,8,0),
+/*Faerie Fire (Feral)*/
+(16857,0,16857,1,0),
+(17390,16857,16857,2,0),
+(17391,17390,16857,3,0),
+(17392,17391,16857,4,0),
+(27011,17392,16857,5,0),
+(48475,27011,16857,6,0),
+/*Ferocious Bite*/
+(22568,0,22568,1,0),
+(22827,22568,22568,2,0),
+(22828,22827,22568,3,0),
+(22829,22828,22568,4,0),
+(31018,22829,22568,5,0),
+(24248,31018,22568,6,0),
+(48576,24248,22568,7,0),
+(48577,48576,22568,8,0),
+/*Flight Form*/
+(33943,0,33943,1,0),
+(40120,33943,33943,2,0),
+/*Lacerate*/
+(33745,0,33745,1,0),
+(48567,33745,33745,2,0),
+(48568,48567,33745,3,0),
+/*Maim*/
+(22570,0,22570,1,0),
+(49802,22570,22570,2,0),
+/*Mangle-Bear*/
+(33878,0,33878,1,0),
+(33986,33878,33878,2,0),
+(33987,33986,33878,3,0),
+(48563,33987,33878,4,0),
+(48564,48563,33878,5,0),
+/*Mangle-Cat*/
+(33876,0,33876,1,0),
+(33982,33876,33876,2,0),
+(33983,33982,33876,3,0),
+(48565,33983,33876,4,0),
+(48566,48565,33876,5,0),
+/*Maul*/
+(6807,0,6807,1,0),
+(6808,6807,6807,2,0),
+(6809,6808,6807,3,0),
+(8972,6809,6807,4,0),
+(9745,8972,6807,5,0),
+(9880,9745,6807,6,0),
+(9881,9880,6807,7,0),
+(26996,9881,6807,8,0),
+(48479,26996,6807,9,0),
+(48480,48479,6807,10,0),
+/*Pounce*/
+(9005,0,9005,1,0),
+(9823,9005,9005,2,0),
+(9827,9823,9005,3,0),
+(27006,9827,9005,4,0),
+(49803,27006,9005,5,0),
+/*Prowl*/
+(5215,0,5215,1,0),
+(6783,5215,5215,2,0),
+(9913,6783,5215,3,0),
+/*Rake*/
+(1822,0,1822,1,0),
+(1823,1822,1822,2,0),
+(1824,1823,1822,3,0),
+(9904,1824,1822,4,0),
+(27003,9904,1822,5,0),
+(48573,27003,1822,6,0),
+(48574,48573,1822,7,0),
+/*Ravage*/
+(6785,0,6785,1,0),
+(6787,6785,6785,2,0),
+(9866,6787,6785,3,0),
+(9867,9866,6785,4,0),
+(27005,9867,6785,5,0),
+(48578,27005,6785,6,0),
+(48579,48578,6785,7,0),
+/*Rip*/
+(1079,0,1079,1,0),
+(9492,1079,1079,2,0),
+(9493,9492,1079,3,0),
+(9752,9493,1079,4,0),
+(9894,9752,1079,5,0),
+(9896,9894,1079,6,0),
+(27008,9896,1079,7,0),
+(49799,27008,1079,8,0),
+(49800,49799,1079,9,0),
+/*Shred*/
+(5221,0,5221,1,0),
+(6800,5221,5221,2,0),
+(8992,6800,5221,3,0),
+(9829,8992,5221,4,0),
+(9830,9829,5221,5,0),
+(27001,9830,5221,6,0),
+(27002,27001,5221,7,0),
+(48571,27002,5221,8,0),
+(48572,48571,5221,9,0),
+/*Swipe*/
+(779,0,779,1,0),
+(780,779,779,2,0),
+(769,780,779,3,0),
+(9754,769,779,4,0),
+(9908,9754,779,5,0),
+(26997,9908,779,6,0),
+(48561,26997,779,7,0),
+(48562,48561,779,8,0),
+/*Tiger's Fury*/
+(5217,0,5217,1,0),
+(6793,5217,5217,2,0),
+(9845,6793,5217,3,0),
+(9846,9845,5217,4,0),
+(50212,9846,5217,5,0),
+(50213,50212,5217,6,0),
+/*------------------
+--(163)Marksmanship
+------------------*/
+/*AimedShot*/
+(19434,0,19434,1,0),
+(20900,19434,19434,2,0),
+(20901,20900,19434,3,0),
+(20902,20901,19434,4,0),
+(20903,20902,19434,5,0),
+(20904,20903,19434,6,0),
+(27065,20904,19434,7,0),
+(49049,27065,19434,8,0),
+(49050,49049,19434,9,0),
+/*ArcaneShot*/
+(3044,0,3044,1,0),
+(14281,3044,3044,2,0),
+(14282,14281,3044,3,0),
+(14283,14282,3044,4,0),
+(14284,14283,3044,5,0),
+(14285,14284,3044,6,0),
+(14286,14285,3044,7,0),
+(14287,14286,3044,8,0),
+(27019,14287,3044,9,0),
+(49044,27019,3044,10,0),
+(49045,49044,3044,11,0),
+/*Hunter'sMark*/
+(1130,0,1130,1,0),
+(14323,1130,1130,2,0),
+(14324,14323,1130,3,0),
+(14325,14324,1130,4,0),
+(53338,14325,1130,5,0),
+/*KillShot*/
+(53351,0,53351,1,0),
+(61005,53351,53351,2,0),
+(61006,61005,53351,3,0),
+/*Multi-Shot*/
+(2643,0,2643,1,0),
+(14288,2643,2643,2,0),
+(14289,14288,2643,3,0),
+(14290,14289,2643,4,0),
+(25294,14290,2643,5,0),
+(27021,25294,2643,6,0),
+(49047,27021,2643,7,0),
+(49048,49047,2643,8,0),
+/*SerpentSting*/
+(1978,0,1978,1,0),
+(13549,1978,1978,2,0),
+(13550,13549,1978,3,0),
+(13551,13550,1978,4,0),
+(13552,13551,1978,5,0),
+(13553,13552,1978,6,0),
+(13554,13553,1978,7,0),
+(13555,13554,1978,8,0),
+(25295,13555,1978,9,0),
+(27016,25295,1978,10,0),
+(49000,27016,1978,11,0),
+(49001,49000,1978,12,0),
+/*SteadyShot*/
+(56641,0,56641,1,0),
+(34120,56641,56641,2,0),
+(49051,34120,56641,3,0),
+(49052,49051,56641,4,0),
+/*Volley*/
+(1510,0,1510,1,0),
+(14294,1510,1510,2,0),
+(14295,14294,1510,3,0),
+(27022,14295,1510,4,0),
+(58431,27022,1510,5,0),
+(58434,58431,1510,6,0),
+/*------------------
+-- (164) Blacksmithing
+------------------*/
+/*Blacksmithing*/
+(2018,0,2018,1,0),
+(3100,2018,2018,2,0),
+(3538,3100,2018,3,0),
+(9785,3538,2018,4,0),
+(9787,9785,2018,5,0),
+(9788,9785,2018,5,0),
+(29844,9785,2018,5,0),
+(17039,9787,2018,6,0),
+(17040,9787,2018,6,0),
+(17041,9787,2018,6,0),
+(51300,29844,2018,6,0),
+/*------------------
+-- (165) Leatherworking
+------------------*/
+/*Leatherworking*/
+(2108,0,2108,1,0),
+(3104,2108,2108,2,0),
+(3811,3104,2108,3,0),
+(10662,3811,2108,4,0),
+(10656,10662,2108,5,0),
+(10658,10662,2108,5,0),
+(10660,10662,2108,5,0),
+(32549,10662,2108,5,0),
+(51302,32549,2108,6,0),
+/*------------------
+-- (171) Alchemy
+------------------*/
+/* Alchemy */
+(2259,0,2259,1,0),
+(3101,2259,2259,2,0),
+(3464,3101,2259,3,0),
+(11611,3464,2259,4,0),
+(28596,11611,2259,5,0),
+(28672,11611,2259,5,0),
+(28675,11611,2259,5,0),
+(28677,11611,2259,5,0),
+(51304,28596,2259,6,0),
+/*------------------
+-- (182) Herbalizm
+------------------*/
+/*Herb Gathering*/
+(2366,0,2366,1,0),
+(2368,2366,2366,2,0),
+(3570,2368,2366,3,0),
+(11993,3570,2366,4,0),
+(28695,11993,2366,5,0),
+(50300,28695,2366,6,0),
+/*Lifeblood*/
+(55428,0,55428,1,0),
+(55480,55428,55428,2,0),
+(55500,55480,55428,3,0),
+(55501,55500,55428,4,0),
+(55502,55501,55428,5,0),
+(55503,55502,55428,6,0),
+/*------------------
+-- (184) Retribution (Paladin)
+------------------*/
+/*Blessingof Might*/
+(19740,0,19740,1,0),
+(19834,19740,19740,2,0),
+(19835,19834,19740,3,0),
+(19836,19835,19740,4,0),
+(19837,19836,19740,5,0),
+(19838,19837,19740,6,0),
+(25291,19838,19740,7,0),
+(27140,25291,19740,8,0),
+(48931,27140,19740,9,0),
+(48932,48931,19740,10,0),
+/*Greater Blessing of Might*/
+(25782,0,25782,1,19838),
+(25916,25782,25782,2,25291),
+(27141,25916,25782,3,27140),
+(48933,27141,25782,4,48931),
+(48934,48933,25782,5,48932),
+/*Hammer of Wrath*/
+(24275,0,24275,1,0),
+(24274,24275,24275,2,0),
+(24239,24274,24275,3,0),
+(27180,24239,24275,4,0),
+(48805,27180,24275,5,0),
+(48806,48805,24275,6,0),
+/*Retribution Aura*/
+(7294,0,7294,1,0),
+(10298,7294,7294,2,0),
+(10299,10298,7294,3,0),
+(10300,10299,7294,4,0),
+(10301,10300,7294,5,0),
+(27150,10301,7294,6,0),
+(54043,27150,7294,7,0),
+/*------------------
+-- (185) Cooking
+------------------*/
+/*Cooking*/
+(2550,0,2550,1,0),
+(3102,2550,2550,2,0),
+(3413,3102,2550,3,0),
+(18260,3413,2550,4,0),
+(33359,18260,2550,5,0),
+(51296,33359,2550,6,0),
+/*------------------
+-- (186) Mining
+------------------*/
+/*Mining*/
+(2575,0,2575,1,0),
+(2576,2575,2575,2,0),
+(3564,2576,2575,3,0),
+(10248,3564,2575,4,0),
+(29354,10248,2575,5,0),
+(50310,29354,2575,6,0),
+/*Toughness*/
+(53120,0,53120,1,0),
+(53121,53120,53120,2,0),
+(53122,53121,53120,3,0),
+(53123,53122,53120,4,0),
+(53124,53123,53120,5,0),
+(53040,53124,53120,6,0),
+/*------------------
+-- (188) Pet - Imp
+------------------*/
+/*Blood Pact*/
+(6307,0,6307,1,0),
+(7804,6307,6307,2,0),
+(7805,7804,6307,3,0),
+(11766,7805,6307,4,0),
+(11767,11766,6307,5,0),
+(27268,11767,6307,6,0),
+(47982,27268,6307,7,0),
+/*FireShield*/
+(2947,0,2947,1,0),
+(8316,2947,2947,2,0),
+(8317,8316,2947,3,0),
+(11770,8317,2947,4,0),
+(11771,11770,2947,5,0),
+(27269,11771,2947,6,0),
+(47983,27269,2947,7,0),
+/*Firebolt*/
+(3110,0,3110,1,0),
+(7799,3110,3110,2,0),
+(7800,7799,3110,3,0),
+(7801,7800,3110,4,0),
+(7802,7801,3110,5,0),
+(11762,7802,3110,6,0),
+(11763,11762,3110,7,0),
+(27267,11763,3110,8,0),
+(47964,27267,3110,9,0),
+/*------------------
+--(189)Pet-Felhunter
+------------------*/
+/*DevourMagic*/
+(19505,0,19505,1,0),
+(19731,19505,19505,2,0),
+(19734,19731,19505,3,0),
+(19736,19734,19505,4,0),
+(27276,19736,19505,5,0),
+(27277,27276,19505,6,0),
+(48011,27277,19505,7,0),
+/*ShadowBite*/
+(54049,0,54049,1,0),
+(54050,54049,54049,2,0),
+(54051,54050,54049,3,0),
+(54052,54051,54049,4,0),
+(54053,54052,54049,5,0),
+/*SpellLock*/
+(19244,0,19244,1,0),
+(19647,19244,19244,2,0),
+/*------------------
+-- (197) Tailoring
+------------------*/
+/*Tailoring*/
+(3908,0,3908,1,0),
+(3909,3908,3908,2,0),
+(3910,3909,3908,3,0),
+(12180,3910,3908,4,0),
+(26790,12180,3908,5,0),
+(26797,12180,3908,5,0),
+(26798,12180,3908,5,0),
+(26801,12180,3908,5,0),
+(51309,26790,3908,6,0),
+/*------------------
+--(203)Pet-Spider
+--(208)Pet-Wolf
+--(212)Pet-Crocolisk
+--(251)Pet-Turtle
+--(653)Pet-Bat
+--(766)Pet-WarpStalker
+--(767)Pet-Ravager
+------------------*/
+/*Bite*/
+(17253,0,17253,1,0),
+(17255,17253,17253,2,0),
+(17256,17255,17253,3,0),
+(17257,17256,17253,4,0),
+(17258,17257,17253,5,0),
+(17259,17258,17253,6,0),
+(17260,17259,17253,7,0),
+(17261,17260,17253,8,0),
+(27050,17261,17253,9,0),
+(52473,27050,17253,10,0),
+(52474,52473,17253,11,0),
+/*------------------
+-- (202) Engineering
+------------------*/
+/*Engineering*/
+(4036,0,4036,1,0),
+(4037,4036,4036,2,0),
+(4038,4037,4036,3,0),
+(12656,4038,4036,4,0),
+(20219,12656,4036,5,0),
+(20222,12656,4036,5,0),
+(30350,12656,4036,5,0),
+(51306,30350,4036,6,0),
+/*------------------
+-- (204) Pet - Voidwalker
+------------------*/
+/*Consume Shadows*/
+(17767,0,17767,1,0),
+(17850,17767,17767,2,0),
+(17851,17850,17767,3,0),
+(17852,17851,17767,4,0),
+(17853,17852,17767,5,0),
+(17854,17853,17767,6,0),
+(27272,17854,17767,7,0),
+(47987,27272,17767,8,0),
+(47988,47987,17767,9,0),
+/*Sacrifice*/
+(7812,0,7812,1,0),
+(19438,7812,7812,2,0),
+(19440,19438,7812,3,0),
+(19441,19440,7812,4,0),
+(19442,19441,7812,5,0),
+(19443,19442,7812,6,0),
+(27273,19443,7812,7,0),
+(47985,27273,7812,8,0),
+(47986,47985,7812,9,0),
+/*Suffering*/
+(17735,0,17735,1,0),
+(17750,17735,17735,2,0),
+(17751,17750,17735,3,0),
+(17752,17751,17735,4,0),
+(27271,17752,17735,5,0),
+(33701,27271,17735,6,0),
+(47989,33701,17735,7,0),
+(47990,47989,17735,8,0),
+/*Torment*/
+(3716,0,3716,1,0),
+(7809,3716,3716,2,0),
+(7810,7809,3716,3,0),
+(7811,7810,3716,4,0),
+(11774,7811,3716,5,0),
+(11775,11774,3716,6,0),
+(27270,11775,3716,7,0),
+(47984,27270,3716,8,0),
+/*------------------
+--(205)Pet-Succubus
+------------------*/
+/*LashofPain*/
+(7814,0,7814,1,0),
+(7815,7814,7814,2,0),
+(7816,7815,7814,3,0),
+(11778,7816,7814,4,0),
+(11779,11778,7814,5,0),
+(11780,11779,7814,6,0),
+(27274,11780,7814,7,0),
+(47991,27274,7814,8,0),
+(47992,47991,7814,9,0),
+/*SoothingKiss*/
+(6360,0,6360,1,0),
+(7813,6360,6360,2,0),
+(11784,7813,6360,3,0),
+(11785,11784,6360,4,0),
+(27275,11785,6360,5,0),
+/*------------------
+-- (209) Pet - Cat
+------------------*/
+/*Prowl*/
+(24450,0,24450,1,0),
+(24452,24450,24450,2,0),
+(24453,24452,24450,3,0),
+/*Rake*/
+(59881,0,59881,1,0),
+(59882,59881,59881,2,0),
+(59883,59882,59881,3,0),
+(59884,59883,59881,4,0),
+(59885,59884,59881,5,0),
+(59886,59885,59881,6,0),
+/*------------------
+--(210)Pet-Bear
+------------------*/
+/*Swipe*/
+(50256,0,50256,1,0),
+(53526,50256,50256,2,0),
+(53528,53526,50256,3,0),
+(53529,53528,50256,4,0),
+(53532,53529,50256,5,0),
+(53533,53532,50256,6,0),
+/*------------------
+--(211)Pet-Boar
+------------------*/
+/*Gore*/
+(35290,0,35290,1,0),
+(35291,35290,35290,2,0),
+(35292,35291,35290,3,0),
+(35293,35292,35290,4,0),
+(35294,35293,35290,5,0),
+(35295,35294,35290,6,0),
+/*------------------
+--(213)Pet-CarrionBird
+------------------*/
+/*DemoralizingScreech*/
+(24423,0,24423,1,0),
+(24577,24423,24423,2,0),
+(24578,24577,24423,3,0),
+(24579,24578,24423,4,0),
+(27051,24579,24423,5,0),
+(55487,27051,24423,6,0),
+/*------------------
+--(215)Pet-Gorilla
+--(786)Pet-ExoticRhino
+--(775)Pet-Moth
+------------------*/
+/*Smack*/
+(49966,0,49966,1,0),
+(49967,49966,49966,2,0),
+(49968,49967,49966,3,0),
+(49969,49968,49966,4,0),
+(49970,49969,49966,5,0),
+(49971,49970,49966,6,0),
+(49972,49971,49966,7,0),
+(49973,49972,49966,8,0),
+(49974,49973,49966,9,0),
+(52475,49974,49966,10,0),
+(52476,52475,49966,11,0),
+/*Thunderstomp*/
+(26090,0,26090,1,0),
+(26187,26090,26090,2,0),
+(26188,26187,26090,3,0),
+(27063,26188,26090,4,0),
+(55572,27063,26090,5,0),
+(55573,55572,26090,6,0),
+/*------------------
+--(217)Pet-Raptor
+------------------*/
+/*SavageRend*/
+(50498,0,50498,1,0),
+(53578,50498,50498,2,0),
+(53579,53578,50498,3,0),
+(53580,53579,50498,4,0),
+(53581,53580,50498,5,0),
+(53582,53581,50498,6,0),
+/*------------------
+--(214)Pet-Crab
+--(218)Pet-Tallstrider
+--(783)Pet-ExoticSilithid
+------------------*/
+/*Claw*/
+(16827,0,16827,1,0),
+(16828,16827,16827,2,0),
+(16829,16828,16827,3,0),
+(16830,16829,16827,4,0),
+(16831,16830,16827,5,0),
+(16832,16831,16827,6,0),
+(3010,16832,16827,7,0),
+(3009,3010,16827,8,0),
+(27049,3009,16827,9,0),
+(52471,27049,16827,10,0),
+(52472,52471,16827,11,0),
+/*------------------
+--(236)Pet-Scorpid
+------------------*/
+/*ScorpidPoison*/
+(24640,0,24640,1,0),
+(24583,24640,24640,2,0),
+(24586,24583,24640,3,0),
+(24587,24586,24640,4,0),
+(27060,24587,24640,5,0),
+(55728,27060,24640,6,0),
+/*------------------
+--(237)Arcane
+------------------*/
+/*AmplifyMagic*/
+(1008,0,1008,1,0),
+(8455,1008,1008,2,0),
+(10169,8455,1008,3,0),
+(10170,10169,1008,4,0),
+(27130,10170,1008,5,0),
+(33946,27130,1008,6,0),
+(43017,33946,1008,7,0),
+/*ArcaneBarrage*/
+(44425,0,44425,1,0),
+(44780,44425,44425,2,0),
+(44781,44780,44425,3,0),
+/*ArcaneBlast*/
+(30451,0,30451,1,0),
+(42894,30451,30451,2,0),
+(42896,42894,30451,3,0),
+(42897,42896,30451,4,0),
+/*ArcaneBrilliance*/
+(23028,0,23028,1,0),
+(27127,23028,23028,2,0),
+(43002,27127,23028,3,0),
+/*ArcaneExplosion*/
+(1449,0,1449,1,0),
+(8437,1449,1449,2,0),
+(8438,8437,1449,3,0),
+(8439,8438,1449,4,0),
+(10201,8439,1449,5,0),
+(10202,10201,1449,6,0),
+(27080,10202,1449,7,0),
+(27082,27080,1449,8,0),
+(42920,27082,1449,9,0),
+(42921,42920,1449,10,0),
+/*ArcaneIntellect*/
+(1459,0,1459,1,0),
+(1460,1459,1459,2,0),
+(1461,1460,1459,3,0),
+(10156,1461,1459,4,0),
+(10157,10156,1459,5,0),
+(27126,10157,1459,6,0),
+(42995,27126,1459,7,0),
+/*ArcaneMissiles*/
+(5143,0,5143,1,0),
+(5144,5143,5143,2,0),
+(5145,5144,5143,3,0),
+(8416,5145,5143,4,0),
+(8417,8416,5143,5,0),
+(10211,8417,5143,6,0),
+(10212,10211,5143,7,0),
+(25345,10212,5143,8,0),
+(27075,25345,5143,9,0),
+(38699,27075,5143,10,0),
+(38704,38699,5143,11,0),
+(42843,38704,5143,12,0),
+(42846,42843,5143,13,0),
+/*ConjureFood*/
+(587,0,587,1,0),
+(597,587,587,2,0),
+(990,597,587,3,0),
+(6129,990,587,4,0),
+(10144,6129,587,5,0),
+(10145,10144,587,6,0),
+(28612,10145,587,7,0),
+(33717,28612,587,8,0),
+/*ConjureManaGem*/
+(759,0,759,1,0),
+(3552,759,759,2,0),
+(10053,3552,759,3,0),
+(10054,10053,759,4,0),
+(27101,10054,759,5,0),
+(42985,27101,759,6,0),
+/*ConjureRefreshment*/
+(42955,0,42955,1,0),
+(42956,42955,42955,2,0),
+/*ConjureWater*/
+(5504,0,5504,1,0),
+(5505,5504,5504,2,0),
+(5506,5505,5504,3,0),
+(6127,5506,5504,4,0),
+(10138,6127,5504,5,0),
+(10139,10138,5504,6,0),
+(10140,10139,5504,7,0),
+(37420,10140,5504,8,0),
+(27090,37420,5504,9,0),
+/*DampenMagic*/
+(604,0,604,1,0),
+(8450,604,604,2,0),
+(8451,8450,604,3,0),
+(10173,8451,604,4,0),
+(10174,10173,604,5,0),
+(33944,10174,604,6,0),
+(43015,33944,604,7,0),
+/*MageArmor*/
+(6117,0,6117,1,0),
+(22782,6117,6117,2,0),
+(22783,22782,6117,3,0),
+(27125,22783,6117,4,0),
+(43023,27125,6117,5,0),
+(43024,43023,6117,6,0),
+/*ManaShield*/
+(1463,0,1463,1,0),
+(8494,1463,1463,2,0),
+(8495,8494,1463,3,0),
+(10191,8495,1463,4,0),
+(10192,10191,1463,5,0),
+(10193,10192,1463,6,0),
+(27131,10193,1463,7,0),
+(43019,27131,1463,8,0),
+(43020,43019,1463,9,0),
+/*Polymorph*/
+(118,0,118,1,0),
+(12824,118,118,2,0),
+(12825,12824,118,3,0),
+(12826,12825,118,4,0),
+/*RitualofRefreshment*/
+(43987,0,43987,1,0),
+(58659,43987,43987,2,0),
+/*------------------
+--(253)Assassination
+------------------*/
+/*Ambush*/
+(8676,0,8676,1,0),
+(8724,8676,8676,2,0),
+(8725,8724,8676,3,0),
+(11267,8725,8676,4,0),
+(11268,11267,8676,5,0),
+(11269,11268,8676,6,0),
+(27441,11269,8676,7,0),
+(48689,27441,8676,8,0),
+(48690,48689,8676,9,0),
+(48691,48690,8676,10,0),
+/*DeadlyThrow*/
+(26679,0,26679,1,0),
+(48673,26679,26679,2,0),
+(48674,48673,26679,3,0),
+/*Envenom*/
+(32645,0,32645,1,0),
+(32684,32645,32645,2,0),
+(57992,32684,32645,3,0),
+(57993,57992,32645,4,0),
+/*Eviscerate*/
+(2098,0,2098,1,0),
+(6760,2098,2098,2,0),
+(6761,6760,2098,3,0),
+(6762,6761,2098,4,0),
+(8623,6762,2098,5,0),
+(8624,8623,2098,6,0),
+(11299,8624,2098,7,0),
+(11300,11299,2098,8,0),
+(31016,11300,2098,9,0),
+(26865,31016,2098,10,0),
+(48667,26865,2098,11,0),
+(48668,48667,2098,12,0),
+/*ExposeArmor*/
+(8647,0,8647,1,0),
+(8649,8647,8647,2,0),
+(8650,8649,8647,3,0),
+(11197,8650,8647,4,0),
+(11198,11197,8647,5,0),
+(26866,11198,8647,6,0),
+(48669,26866,8647,7,0),
+/*Garrote*/
+(703,0,703,1,0),
+(8631,703,703,2,0),
+(8632,8631,703,3,0),
+(8633,8632,703,4,0),
+(11289,8633,703,5,0),
+(11290,11289,703,6,0),
+(26839,11290,703,7,0),
+(26884,26839,703,8,0),
+(48675,26884,703,9,0),
+(48676,48675,703,10,0),
+/*KidneyShot*/
+(408,0,408,1,0),
+(8643,408,408,2,0),
+/*Mutilate*/
+(1329,0,1329,1,0),
+(34411,1329,1329,2,0),
+(34412,34411,1329,3,0),
+(34413,34412,1329,4,0),
+(48663,34413,1329,5,0),
+(48666,48663,1329,6,0),
+/*Rupture*/
+(1943,0,1943,1,0),
+(8639,1943,1943,2,0),
+(8640,8639,1943,3,0),
+(11273,8640,1943,4,0),
+(11274,11273,1943,5,0),
+(11275,11274,1943,6,0),
+(26867,11275,1943,7,0),
+(48671,26867,1943,8,0),
+(48672,48671,1943,9,0),
+/*SliceandDice*/
+(5171,0,5171,1,0),
+(6774,5171,5171,2,0),
+/*------------------
+--(256)Fury
+------------------*/
+/*BattleShout*/
+(6673,0,6673,1,0),
+(5242,6673,6673,2,0),
+(6192,5242,6673,3,0),
+(11549,6192,6673,4,0),
+(11550,11549,6673,5,0),
+(11551,11550,6673,6,0),
+(25289,11551,6673,7,0),
+(2048,25289,6673,8,0),
+(47436,2048,6673,9,0),
+/*Cleave*/
+(845,0,845,1,0),
+(7369,845,845,2,0),
+(11608,7369,845,3,0),
+(11609,11608,845,4,0),
+(20569,11609,845,5,0),
+(25231,20569,845,6,0),
+(47519,25231,845,7,0),
+(47520,47519,845,8,0),
+/*CommandingShout*/
+(469,0,469,1,0),
+(47439,469,469,2,0),
+(47440,47439,469,3,0),
+/*DemoralizingShout*/
+(1160,0,1160,1,0),
+(6190,1160,1160,2,0),
+(11554,6190,1160,3,0),
+(11555,11554,1160,4,0),
+(11556,11555,1160,5,0),
+(25202,11556,1160,6,0),
+(25203,25202,1160,7,0),
+(47437,25203,1160,8,0),
+/*Execute*/
+(5308,0,5308,1,0),
+(20658,5308,5308,2,0),
+(20660,20658,5308,3,0),
+(20661,20660,5308,4,0),
+(20662,20661,5308,5,0),
+(25234,20662,5308,6,0),
+(25236,25234,5308,7,0),
+(47470,25236,5308,8,0),
+(47471,47470,5308,9,0),
+/*Slam*/
+(1464,0,1464,1,0),
+(8820,1464,1464,2,0),
+(11604,8820,1464,3,0),
+(11605,11604,1464,4,0),
+(25241,11605,1464,5,0),
+(25242,25241,1464,6,0),
+(47474,25242,1464,7,0),
+(47475,47474,1464,8,0),
+/*------------------
+--(257) Protection (Warrior)
+------------------*/
+/*Devastate*/
+(20243,0,20243,1,0),
+(30016,20243,20243,2,0),
+(30022,30016,20243,3,0),
+(47497,30022,20243,4,0),
+(47498,47497,20243,5,0),
+/*Revenge*/
+(6572,0,6572,1,0),
+(6574,6572,6572,2,0),
+(7379,6574,6572,3,0),
+(11600,7379,6572,4,0),
+(11601,11600,6572,5,0),
+(25288,11601,6572,6,0),
+(25269,25288,6572,7,0),
+(30357,25269,6572,8,0),
+(57823,30357,6572,9,0),
+/*ShieldSlam*/
+(23922,0,23922,1,0),
+(23923,23922,23922,2,0),
+(23924,23923,23922,3,0),
+(23925,23924,23922,4,0),
+(25258,23925,23922,5,0),
+(30356,25258,23922,6,0),
+(47487,30356,23922,7,0),
+(47488,47487,23922,8,0),
+/*SunderArmor*/
+(7386,0,7386,1,0),
+(7405,7386,7386,2,0),
+(8380,7405,7386,3,0),
+(11596,8380,7386,4,0),
+(11597,11596,7386,5,0),
+(25225,11597,7386,6,0),
+(47467,25225,7386,7,0),
+/*------------------
+-- (267) Protection (Paladin)
+------------------*/
+/*Avenger'sShield*/
+(31935,0,31935,1,0),
+(32699,31935,31935,2,0),
+(32700,32699,31935,3,0),
+(48826,32700,31935,4,0),
+(48827,48826,31935,5,0),
+/*Devotion Aura*/
+(465,0,465,1,0),
+(10290,465,465,2,0),
+(643,10290,465,3,0),
+(10291,643,465,4,0),
+(1032,10291,465,5,0),
+(10292,1032,465,6,0),
+(10293,10292,465,7,0),
+(27149,10293,465,8,0),
+(48941,27149,465,9,0),
+(48942,48941,465,10,0),
+/*Fire Resistance Aura*/
+(19891,0,19891,1,0),
+(19899,19891,19891,2,0),
+(19900,19899,19891,3,0),
+(27153,19900,19891,4,0),
+(48947,27153,19891,5,0),
+/*Frost Resistance Aura*/
+(19888,0,19888,1,0),
+(19897,19888,19888,2,0),
+(19898,19897,19888,3,0),
+(27152,19898,19888,4,0),
+(48945,27152,19888,5,0),
+/*Greater Blessing of Kings*/
+(20217,0,20217,1,0),
+(25898,20217,20217,2,0),
+/*Greater Blessing of Sanctuary*/
+(20911,0,20911,1,0),
+(25899,20911,20911,2,0),
+/*HammerofJustice*/
+(853,0,853,1,0),
+(5588,853,853,2,0),
+(5589,5588,853,3,0),
+(10308,5589,853,4,0),
+/*HandofProtection*/
+(1022,0,1022,1,0),
+(5599,1022,1022,2,0),
+(10278,5599,1022,3,0),
+/*Holy Shield*/
+(20925,0,20925,1,0),
+(20927,20925,20925,2,0),
+(20928,20927,20925,3,0),
+(27179,20928,20925,4,0),
+(48951,27179,20925,5,0),
+(48952,48951,20925,6,0),
+/*Shadow Resistance Aura*/
+(19876,0,19876,1,0),
+(19895,19876,19876,2,0),
+(19896,19895,19876,3,0),
+(27151,19896,19876,4,0),
+(48943,27151,19876,5,0),
+/*Shield of Righteousness*/
+(53600,0,53600,1,0),
+(61411,53600,53600,2,0),
+/*Spiritual Attunement*/
+(31785,0,31785,1,0),
+(33776,31785,31785,2,0),
+/*------------------
+--(270)Pet-GenericHunter
+------------------*/
+/*Cower*/
+(1742,0,1742,1,0),
+(1753,1742,1742,2,0),
+(1754,1753,1742,3,0),
+(1755,1754,1742,4,0),
+(1756,1755,1742,5,0),
+(16697,1756,1742,6,0),
+(27048,16697,1742,7,0),
+/*GreatResistance*/
+(53427,0,53427,1,0),
+(53429,53427,53427,2,0),
+(53430,53429,53427,3,0),
+/*Growl*/
+(2649,0,2649,1,0),
+(14916,2649,2649,2,0),
+(14917,14916,2649,3,0),
+(14918,14917,2649,4,0),
+(14919,14918,2649,5,0),
+(14920,14919,2649,6,0),
+(14921,14920,2649,7,0),
+(27047,14921,2649,8,0),
+(61676,27047,2649,9,0),
+/*------------------
+-- (333) Enchanting
+------------------*/
+/*Enchanting*/
+(7411,0,7411,1,0),
+(7412,7411,7411,2,0),
+(7413,7412,7411,3,0),
+(13920,7413,7411,4,0),
+(28029,13920,7411,5,0),
+(51313,28029,7411,6,0),
+/*------------------
+--(354)Demonology
+------------------*/
+/*Banish*/
+(710,0,710,1,0),
+(18647,710,710,2,0),
+/*CreateFirestone*/
+(6366,0,6366,1,0),
+(17951,6366,6366,2,0),
+(17952,17951,6366,3,0),
+(17953,17952,6366,4,0),
+(27250,17953,6366,5,0),
+(60219,27250,6366,6,0),
+(60220,60219,6366,7,0),
+/*CreateHealthstone*/
+(6201,0,6201,1,0),
+(6202,6201,6201,2,0),
+(5699,6202,6201,3,0),
+(11729,5699,6201,4,0),
+(11730,11729,6201,5,0),
+(27230,11730,6201,6,0),
+(47871,27230,6201,7,0),
+(47878,47871,6201,8,0),
+/*CreateSoulstone*/
+(693,0,693,1,0),
+(20752,693,693,2,0),
+(20755,20752,693,3,0),
+(20756,20755,693,4,0),
+(20757,20756,693,5,0),
+(27238,20757,693,6,0),
+(47884,27238,693,7,0),
+/*CreateSpellstone*/
+(2362,0,2362,1,0),
+(17727,2362,2362,2,0),
+(17728,17727,2362,3,0),
+(28172,17728,2362,4,0),
+(47886,28172,2362,5,0),
+(47888,47886,2362,6,0),
+/*DemonArmor*/
+(706,0,706,1,0),
+(1086,706,706,2,0),
+(11733,1086,706,3,0),
+(11734,11733,706,4,0),
+(11735,11734,706,5,0),
+(27260,11735,706,6,0),
+(47793,27260,706,7,0),
+(47889,47793,706,8,0),
+/*DemonSkin*/
+(687,0,687,1,0),
+(696,687,687,2,0),
+/*EnslaveDemon*/
+(1098,0,1098,1,0),
+(11725,1098,1098,2,0),
+(11726,11725,1098,3,0),
+(61191,11726,1098,4,0),
+/*FelArmor*/
+(28176,0,28176,1,0),
+(28189,28176,28176,2,0),
+(47892,28189,28176,3,0),
+(47893,47892,28176,4,0),
+/*HealthFunnel*/
+(755,0,755,1,0),
+(3698,755,755,2,0),
+(3699,3698,755,3,0),
+(3700,3699,755,4,0),
+(11693,3700,755,5,0),
+(11694,11693,755,6,0),
+(11695,11694,755,7,0),
+(27259,11695,755,8,0),
+(47856,27259,755,9,0),
+/*RitualofSouls*/
+(29893,0,29893,1,0),
+(58887,29893,29893,2,0),
+/*ShadowWard*/
+(6229,0,6229,1,0),
+(11739,6229,6229,2,0),
+(11740,11739,6229,3,0),
+(28610,11740,6229,4,0),
+(47890,28610,6229,5,0),
+(47891,47890,6229,6,0),
+/*------------------
+--(355)Affliction
+------------------*/
+/*Corruption*/
+(172,0,172,1,0),
+(6222,172,172,2,0),
+(6223,6222,172,3,0),
+(7648,6223,172,4,0),
+(11671,7648,172,5,0),
+(11672,11671,172,6,0),
+(25311,11672,172,7,0),
+(27216,25311,172,8,0),
+(47812,27216,172,9,0),
+(47813,47812,172,10,0),
+/*Curse of Agony*/
+(980,0,980,1,0),
+(1014,980,980,2,0),
+(6217,1014,980,3,0),
+(11711,6217,980,4,0),
+(11712,11711,980,5,0),
+(11713,11712,980,6,0),
+(27218,11713,980,7,0),
+(47863,27218,980,8,0),
+(47864,47863,980,9,0),
+/*Curse of Doom*/
+(603,0,603,1,0),
+(30910,603,603,2,0),
+(47867,30910,603,3,0),
+/*Curse of Recklessness*/
+(704,0,704,1,0),
+(7658,704,704,2,0),
+(7659,7658,704,3,0),
+(11717,7659,704,4,0),
+(27226,11717,704,5,0),
+(57595,27226,704,6,0),
+/*Curse of the Elements*/
+(1490,0,1490,1,0),
+(11721,1490,1490,2,0),
+(11722,11721,1490,3,0),
+(27228,11722,1490,4,0),
+(47865,27228,1490,5,0),
+/*Curse of Tongues*/
+(1714,0,1714,1,0),
+(11719,1714,1714,2,0),
+/*Curse of Weakness*/
+(702,0,702,1,0),
+(1108,702,702,2,0),
+(6205,1108,702,3,0),
+(7646,6205,702,4,0),
+(11707,7646,702,5,0),
+(11708,11707,702,6,0),
+(27224,11708,702,7,0),
+(30909,27224,702,8,0),
+(50511,30909,702,9,0),
+/*Dark Pact*/
+(18220,0, 18220,1,0),
+(18937,18220,18220,2,0),
+(18938,18937,18220,3,0),
+(27265,18938,18220,4,0),
+(59092,27265,18220,5,0),
+/*Death Coil*/
+(6789,0,6789,1,0),
+(17925,6789,6789,2,0),
+(17926,17925,6789,3,0),
+(27223,17926,6789,4,0),
+(47859,27223,6789,5,0),
+(47860,47859,6789,6,0),
+/*Drain Life*/
+(689,0,689,1,0),
+(699,689,689,2,0),
+(709,699,689,3,0),
+(7651,709,689,4,0),
+(11699,7651,689,5,0),
+(11700,11699,689,6,0),
+(27219,11700,689,7,0),
+(27220,27219,689,8,0),
+(47857,27220,689,9,0),
+/*DrainSoul*/
+(1120,0,1120,1,0),
+(8288,1120,1120,2,0),
+(8289,8288,1120,3,0),
+(11675,8289,1120,4,0),
+(27217,11675,1120,5,0),
+(47855,27217,1120,6,0),
+/*Fear*/
+(5782,0,5782,1,0),
+(6213,5782,5782,2,0),
+(6215,6213,5782,3,0),
+/*Haunt*/
+(48181,0,48181,1,0),
+(59161,48181,48181,2,0),
+(59163,59161,48181,3,0),
+(59164,59163,48181,4,0),
+/*HowlofTerror*/
+(5484,0,5484,1,0),
+(17928,5484,5484,2,0),
+/*SeedofCorruption*/
+(27243,0,27243,1,0),
+(47835,27243,27243,2,0),
+(47836,47835,27243,3,0),
+/*SiphonLife*/
+(18265,0,18265,1,0),
+(18879,18265,18265,2,0),
+(18880,18879,18265,3,0),
+(18881,18880,18265,4,0),
+(27264,18881,18265,5,0),
+(30911,27264,18265,6,0),
+(47861,30911,18265,7,0),
+(47862,47861,18265,8,0),
+/*UnstableAffliction*/
+(30108,0,30108,1,0),
+(30404,30108,30108,2,0),
+(30405,30404,30108,3,0),
+(47841,30405,30108,4,0),
+(47843,47841,30108,5,0),
+/*------------------
+-- (356) Fishing
+------------------*/
+/*Fishing*/
+(7620,0,7620,1,0),
+(7731,7620,7620,2,0),
+(7732,7731,7620,3,0),
+(18248,7732,7620,4,0),
+(33095,18248,7620,5,0),
+(51294,33095,7620,6,0),
+/*------------------
+--(373) Enhancement
+------------------*/
+/*Fire Resistance Totem*/
+(8184,0,8184,1,0),
+(10537,8184,8184,2,0),
+(10538,10537,8184,3,0),
+(25563,10538,8184,4,0),
+(58737,25563,8184,5,0),
+(58739,58737,8184,6,0),
+/*Flametongue Totem*/
+(8227,0,8227,1,0),
+(8249,8227,8227,2,0),
+(10526,8249,8227,3,0),
+(16387,10526,8227,4,0),
+(25557,16387,8227,5,0),
+(58649,25557,8227,6,0),
+(58652,58649,8227,7,0),
+(58656,58652,8227,8,0),
+/*Flametongue Weapon*/
+(8024,0,8024,1,0),
+(8027,8024,8024,2,0),
+(8030,8027,8024,3,0),
+(16339,8030,8024,4,0),
+(16341,16339,8024,5,0),
+(16342,16341,8024,6,0),
+(25489,16342,8024,7,0),
+(58785,25489,8024,8,0),
+(58789,58785,8024,9,0),
+(58790,58789,8024,10,0),
+/*Frost Resistance Totem*/
+(8181,0,8181,1,0),
+(10478,8181,8181,2,0),
+(10479,10478,8181,3,0),
+(25560,10479,8181,4,0),
+(58741,25560,8181,5,0),
+(58745,58741,8181,6,0),
+/*Frostbrand Weapon*/
+(8033,0,8033,1,0),
+(8038,8033,8033,2,0),
+(10456,8038,8033,3,0),
+(16355,10456,8033,4,0),
+(16356,16355,8033,5,0),
+(25500,16356,8033,6,0),
+(58794,25500,8033,7,0),
+(58795,58794,8033,8,0),
+(58796,58795,8033,9,0),
+/*Life Tap*/
+(1454,0,1454,1,0),
+(1455,1454,1454,2,0),
+(1456,1455,1454,3,0),
+(11687,1456,1454,4,0),
+(11688,11687,1454,5,0),
+(11689,11688,1454,6,0),
+(27222,11689,1454,7,0),
+(57946,27222,1454,8,0),
+/*Lightning Shield*/
+(324,0,324,1,0),
+(325,324,324,2,0),
+(905,325,324,3,0),
+(945,905,324,4,0),
+(8134,945,324,5,0),
+(10431,8134,324,6,0),
+(10432,10431,324,7,0),
+(25469,10432,324,8,0),
+(25472,25469,324,9,0),
+(49280,25472,324,10,0),
+(49281,49280,324,11,0),
+/*Nature Resistance Totem*/
+(10595,0,10595,1,0),
+(10600,10595,10595,2,0),
+(10601,10600,10595,3,0),
+(25574,10601,10595,4,0),
+(58746,25574,10595,5,0),
+(58749,58746,10595,6,0),
+/*Rockbiter Weapon*/
+(8017,0,8017,1,0),
+(8018,8017,8017,2,0),
+(8019,8018,8017,3,0),
+(10399,8019,8017,4,0),
+/*Stoneskin Totem*/
+(8071,0,8071,1,0),
+(8154,8071,8071,2,0),
+(8155,8154,8071,3,0),
+(10406,8155,8071,4,0),
+(10407,10406,8071,5,0),
+(10408,10407,8071,6,0),
+(25508,10408,8071,7,0),
+(25509,25508,8071,8,0),
+(58751,25509,8071,9,0),
+(58753,58751,8071,10,0),
+/*Strength of Earth Totem*/
+(8075,0,8075,1,0),
+(8160,8075,8075,2,0),
+(8161,8160,8075,3,0),
+(10442,8161,8075,4,0),
+(25361,10442,8075,5,0),
+(25528,25361,8075,6,0),
+(57622,25528,8075,7,0),
+(58643,57622,8075,8,0),
+/*WindfuryWeapon*/
+(8232,0,8232,1,0),
+(8235,8232,8232,2,0),
+(10486,8235,8232,3,0),
+(16362,10486,8232,4,0),
+(25505,16362,8232,5,0),
+(58801,25505,8232,6,0),
+(58803,58801,8232,7,0),
+(58804,58803,8232,8,0),
+/*------------------
+-- (374) Restoration (Shaman)
+------------------*/
+/*AncestralSpirit*/
+(2008,0,2008,1,0),
+(20609,2008,2008,2,0),
+(20610,20609,2008,3,0),
+(20776,20610,2008,4,0),
+(20777,20776,2008,5,0),
+(25590,20777,2008,6,0),
+(49277,25590,2008,7,0),
+/*ChainHeal*/
+(1064,0,1064,1,0),
+(10622,1064,1064,2,0),
+(10623,10622,1064,3,0),
+(25422,10623,1064,4,0),
+(25423,25422,1064,5,0),
+(55458,25423,1064,6,0),
+(55459,55458,1064,7,0),
+/*EarthShield*/
+(974,0,974,1,0),
+(32593,974,974,2,0),
+(32594,32593,974,3,0),
+(49283,32594,974,4,0),
+(49284,49283,974,5,0),
+/*EarthlivingWeapon*/
+(51730,0,51730,1,0),
+(51988,51730,51730,2,0),
+(51991,51988,51730,3,0),
+(51992,51991,51730,4,0),
+(51993,51992,51730,5,0),
+(51994,51993,51730,6,0),
+/*HealingStreamTotem*/
+(5394,0,5394,1,0),
+(6375,5394,5394,2,0),
+(6377,6375,5394,3,0),
+(10462,6377,5394,4,0),
+(10463,10462,5394,5,0),
+(25567,10463,5394,6,0),
+(58755,25567,5394,7,0),
+(58756,58755,5394,8,0),
+(58757,58756,5394,9,0),
+/*HealingWave*/
+(331,0,331,1,0),
+(332,331,331,2,0),
+(547,332,331,3,0),
+(913,547,331,4,0),
+(939,913,331,5,0),
+(959,939,331,6,0),
+(8005,959,331,7,0),
+(10395,8005,331,8,0),
+(10396,10395,331,9,0),
+(25357,10396,331,10,0),
+(25391,25357,331,11,0),
+(25396,25391,331,12,0),
+(49272,25396,331,13,0),
+(49273,49272,331,14,0),
+/*LesserHealingWave*/
+(8004,0,8004,1,0),
+(8008,8004,8004,2,0),
+(8010,8008,8004,3,0),
+(10466,8010,8004,4,0),
+(10467,10466,8004,5,0),
+(10468,10467,8004,6,0),
+(25420,10468,8004,7,0),
+(49275,25420,8004,8,0),
+(49276,49275,8004,9,0),
+/*Mana Spring Totem*/
+(5675,0,5675,1,0),
+(10495,5675,5675,2,0),
+(10496,10495,5675,3,0),
+(10497,10496,5675,4,0),
+(25570,10497,5675,5,0),
+(58771,25570,5675,6,0),
+(58773,58771,5675,7,0),
+(58774,58773,5675,8,0),
+/*Riptide*/
+(61295,0,61295,1,0),
+(61299,61295,61295,2,0),
+(61300,61299,61295,3,0),
+(61301,61300,61295,4,0),
+/*Water Shield*/
+(52127,0,52127,1,0),
+(52129,52127,52127,2,0),
+(52131,52129,52127,3,0),
+(52134,52131,52127,4,0),
+(52136,52134,52127,5,0),
+(52138,52136,52127,6,0),
+(24398,52138,52127,7,0),
+(33736,24398,52127,8,0),
+(57960,33736,52127,9,0),
+/*------------------
+-- (375) Elemental Combat
+------------------*/
+/*Chain Lightning*/
+(421,0,421,1,0),
+(930,421,421,2,0),
+(2860,930,421,3,0),
+(10605,2860,421,4,0),
+(25439,10605,421,5,0),
+(25442,25439,421,6,0),
+(49270,25442,421,7,0),
+(49271,49270,421,8,0),
+/*Earth Shock*/
+(8042,0,8042,1,0),
+(8044,8042,8042,2,0),
+(8045,8044,8042,3,0),
+(8046,8045,8042,4,0),
+(10412,8046,8042,5,0),
+(10413,10412,8042,6,0),
+(10414,10413,8042,7,0),
+(25454,10414,8042,8,0),
+(49230,25454,8042,9,0),
+(49231,49230,8042,10,0),
+/*Fire Nova Totem*/
+(1535,0,1535,1,0),
+(8498,1535,1535,2,0),
+(8499,8498,1535,3,0),
+(11314,8499,1535,4,0),
+(11315,11314,1535,5,0),
+(25546,11315,1535,6,0),
+(25547,25546,1535,7,0),
+(61649,25547,1535,8,0),
+(61657,61649,1535,9,0),
+/*Flame Shock*/
+(8050,0,8050,1,0),
+(8052,8050,8050,2,0),
+(8053,8052,8050,3,0),
+(10447,8053,8050,4,0),
+(10448,10447,8050,5,0),
+(29228,10448,8050,6,0),
+(25457,29228,8050,7,0),
+(49232,25457,8050,8,0),
+(49233,49232,8050,9,0),
+/*Frost Shock*/
+(8056,0,8056,1,0),
+(8058,8056,8056,2,0),
+(10472,8058,8056,3,0),
+(10473,10472,8056,4,0),
+(25464,10473,8056,5,0),
+(49235,25464,8056,6,0),
+(49236,49235,8056,7,0),
+/*Lava Burst*/
+(51505,0,51505,1,0),
+(60043,51505,51505,2,0),
+/*Lightning Bolt*/
+(403,0,403,1,0),
+(529,403,403,2,0),
+(548,529,403,3,0),
+(915,548,403,4,0),
+(943,915,403,5,0),
+(6041,943,403,6,0),
+(10391,6041,403,7,0),
+(10392,10391,403,8,0),
+(15207,10392,403,9,0),
+(15208,15207,403,10,0),
+(25448,15208,403,11,0),
+(25449,25448,403,12,0),
+(49237,25449,403,13,0),
+(49238,49237,403,14,0),
+/*Magma Totem*/
+(8190,0,8190,1,0),
+(10585,8190,8190,2,0),
+(10586,10585,8190,3,0),
+(10587,10586,8190,4,0),
+(25552,10587,8190,5,0),
+(58731,25552,8190,6,0),
+(58734,58731,8190,7,0),
+/*Purge*/
+(370,0,370,1,0),
+(8012,370,370,2,0),
+/*Searing Totem*/
+(3599,0,3599,1,0),
+(6363,3599,3599,2,0),
+(6364,6363,3599,3,0),
+(6365,6364,3599,4,0),
+(10437,6365,3599,5,0),
+(10438,10437,3599,6,0),
+(25533,10438,3599,7,0),
+(58699,25533,3599,8,0),
+(58703,58699,3599,9,0),
+(58704,58703,3599,10,0),
+/*Stoneclaw Totem*/
+(5730,0,5730,1,0),
+(6390,5730,5730,2,0),
+(6391,6390,5730,3,0),
+(6392,6391,5730,4,0),
+(10427,6392,5730,5,0),
+(10428,10427,5730,6,0),
+(25525,10428,5730,7,0),
+(58580,25525,5730,8,0),
+(58581,58580,5730,9,0),
+(58582,58581,5730,10,0),
+/*Totemof Wrath*/
+(30706,0,30706,1,0),
+(57720,30706,30706,2,0),
+(57721,57720,30706,3,0),
+(57722,57721,30706,4,0),
+/*Thunderstorm*/
+(51490,0,51490,1,0),
+(59156,51490,51490,2,0),
+(59158,59156,51490,3,0),
+(59159,59158,51490,4,0),
+/*------------------
+-- (393) Skinning
+------------------*/
+/*Skinning*/
+(8613,0,8613,1,0),
+(8617,8613,8613,2,0),
+(8618,8617,8613,3,0),
+(10768,8618,8613,4,0),
+(32678,10768,8613,5,0),
+(50305,32678,8613,6,0),
+/*Master of Anatomy*/
+(53125,0,53125,1,0),
+(53662,53125,53125,2,0),
+(53663,53662,53125,3,0),
+(53664,53663,53125,4,0),
+(53665,53664,53125,5,0),
+(53666,53665,53125,6,0),
+/*------------------
+--(573)Restoration
+------------------*/
+/*GiftoftheWild*/
+(21849,0,21849,1,0),
+(21850,21849,21849,2,0),
+(26991,21850,21849,3,0),
+(48470,26991,21849,4,0),
+/*HealingTouch*/
+(5185,0,5185,1,0),
+(5186,5185,5185,2,0),
+(5187,5186,5185,3,0),
+(5188,5187,5185,4,0),
+(5189,5188,5185,5,0),
+(6778,5189,5185,6,0),
+(8903,6778,5185,7,0),
+(9758,8903,5185,8,0),
+(9888,9758,5185,9,0),
+(9889,9888,5185,10,0),
+(25297,9889,5185,11,0),
+(26978,25297,5185,12,0),
+(26979,26978,5185,13,0),
+(48377,26979,5185,14,0),
+(48378,48377,5185,15,0),
+/*Lifebloom*/
+(33763,0,33763,1,0),
+(48450,33763,33763,2,0),
+(48451,48450,33763,3,0),
+/*MarkoftheWild*/
+(1126,0,1126,1,0),
+(5232,1126,1126,2,0),
+(6756,5232,1126,3,0),
+(5234,6756,1126,4,0),
+(8907,5234,1126,5,0),
+(9884,8907,1126,6,0),
+(9885,9884,1126,7,0),
+(26990,9885,1126,8,0),
+(48469,26990,1126,9,0),
+/*Nourish*/
+(50464,0,50464,1,0),
+/*Rebirth*/
+(20484,0,20484,1,0),
+(20739,20484,20484,2,0),
+(20742,20739,20484,3,0),
+(20747,20742,20484,4,0),
+(20748,20747,20484,5,0),
+(26994,20748,20484,6,0),
+(48477,26994,20484,7,0),
+/*Regrowth*/
+(8936,0,8936,1,0),
+(8938,8936,8936,2,0),
+(8939,8938,8936,3,0),
+(8940,8939,8936,4,0),
+(8941,8940,8936,5,0),
+(9750,8941,8936,6,0),
+(9856,9750,8936,7,0),
+(9857,9856,8936,8,0),
+(9858,9857,8936,9,0),
+(26980,9858,8936,10,0),
+(48442,26980,8936,11,0),
+(48443,48442,8936,12,0),
+/*Rejuvenation*/
+(774,0,774,1,0),
+(1058,774,774,2,0),
+(1430,1058,774,3,0),
+(2090,1430,774,4,0),
+(2091,2090,774,5,0),
+(3627,2091,774,6,0),
+(8910,3627,774,7,0),
+(9839,8910,774,8,0),
+(9840,9839,774,9,0),
+(9841,9840,774,10,0),
+(25299,9841,774,11,0),
+(26981,25299,774,12,0),
+(26982,26981,774,13,0),
+(48440,26982,774,14,0),
+(48441,48440,774,15,0),
+/*Revive*/
+(50769,0,50769,1,0),
+(50768,50769,50769,2,0),
+(50767,50768,50769,3,0),
+(50766,50767,50769,4,0),
+(50765,50766,50769,5,0),
+(50764,50765,50769,6,0),
+(50763,50764,50769,7,0),
+/*Tranquility*/
+(740,0,740,1,0),
+(8918,740,740,2,0),
+(9862,8918,740,3,0),
+(9863,9862,740,4,0),
+(26983,9863,740,5,0),
+(48446,26983,740,6,0),
+(48447,48446,740,7,0),
+/*WildGrowth*/
+(48438,0,48438,1,0),
+(53248,48438,48438,2,0),
+(53249,53248,48438,3,0),
+(53251,53249,48438,4,0),
+/*------------------
+--(574)Balance
+------------------*/
+/*EntanglingRoots*/
+(339,0,339,1,0),
+(1062,339,339,2,0),
+(5195,1062,339,3,0),
+(5196,5195,339,4,0),
+(9852,5196,339,5,0),
+(9853,9852,339,6,0),
+(26989,9853,339,7,0),
+(53308,26989,339,8,0),
+/*Nature'sGrasp*/
+(16689,0,16689,1,339),
+(16810,16689,16689,2,1062),
+(16811,16810,16689,3,5195),
+(16812,16811,16689,4,5196),
+(16813,16812,16689,5,9852),
+(17329,16813,16689,6,9853),
+(27009,17329,16689,7,26989),
+(53312,27009,16689,8,53308),
+/*FaerieFire*/
+(770,0,770,1,0),
+(778,770,770,2,0),
+(9749,778,770,3,0),
+(9907,9749,770,4,0),
+(26993,9907,770,5,0),
+(48476,26993,770,6,0),
+/*Hibernate*/
+(2637,0,2637,1,0),
+(18657,2637,2637,2,0),
+(18658,18657,2637,3,0),
+/*Hurricane*/
+(16914,0,16914,1,0),
+(17401,16914,16914,2,0),
+(17402,17401,16914,3,0),
+(27012,17402,16914,4,0),
+(48467,27012,16914,5,0),
+/*InsectSwarm*/
+(5570,0,5570,1,0),
+(24974,5570,5570,2,0),
+(24975,24974,5570,3,0),
+(24976,24975,5570,4,0),
+(24977,24976,5570,5,0),
+(27013,24977,5570,6,0),
+(48468,27013,5570,7,0),
+/*Moonfire*/
+(8921,0,8921,1,0),
+(8924,8921,8921,2,0),
+(8925,8924,8921,3,0),
+(8926,8925,8921,4,0),
+(8927,8926,8921,5,0),
+(8928,8927,8921,6,0),
+(8929,8928,8921,7,0),
+(9833,8929,8921,8,0),
+(9834,9833,8921,9,0),
+(9835,9834,8921,10,0),
+(26987,9835,8921,11,0),
+(26988,26987,8921,12,0),
+(48462,26988,8921,13,0),
+(48463,48462,8921,14,0),
+/*SootheAnimal*/
+(2908,0,2908,1,0),
+(8955,2908,2908,2,0),
+(9901,8955,2908,3,0),
+(26995,9901,2908,4,0),
+/*Starfall*/
+(48505,0,48505,1,0),
+(53199,48505,48505,2,0),
+(53200,53199,48505,3,0),
+(53201,53200,48505,4,0),
+/*Starfall AOE*/
+(50294,0,50294,1,0),
+(53188,50294,50294,2,0),
+(53189,53188,50294,3,0),
+(53190,53189,50294,4,0),
+/*Starfall Direct*/
+(50288,0,50288,1,0),
+(53191,50288,50288,2,0),
+(53194,53191,50288,3,0),
+(53195,53194,50288,4,0),
+/*Starfire*/
+(2912,0,2912,1,0),
+(8949,2912,2912,2,0),
+(8950,8949,2912,3,0),
+(8951,8950,2912,4,0),
+(9875,8951,2912,5,0),
+(9876,9875,2912,6,0),
+(25298,9876,2912,7,0),
+(26986,25298,2912,8,0),
+(48464,26986,2912,9,0),
+(48465,48464,2912,10,0),
+/*Thorns*/
+(467,0,467,1,0),
+(782,467,467,2,0),
+(1075,782,467,3,0),
+(8914,1075,467,4,0),
+(9756,8914,467,5,0),
+(9910,9756,467,6,0),
+(26992,9910,467,7,0),
+(53307,26992,467,8,0),
+/*Typhoon*/
+(50516,0,50516,1,0),
+(53223,50516,50516,2,0),
+(53225,53223,50516,3,0),
+(53226,53225,50516,4,0),
+(61384,53226,50516,5,0),
+/*Wrath*/
+(5176,0,5176,1,0),
+(5177,5176,5176,2,0),
+(5178,5177,5176,3,0),
+(5179,5178,5176,4,0),
+(5180,5179,5176,5,0),
+(6780,5180,5176,6,0),
+(8905,6780,5176,7,0),
+(9912,8905,5176,8,0),
+(26984,9912,5176,9,0),
+(26985,26984,5176,10,0),
+(48459,26985,5176,11,0),
+(48461,48459,5176,12,0),
+/*------------------
+--(593)Destruction
+------------------*/
+/*ChaosBolt*/
+(50796,0,50796,1,0),
+(59170,50796,50796,2,0),
+(59171,59170,50796,3,0),
+(59172,59171,50796,4,0),
+/*Conflagrate*/
+(17962,0,17962,1,0),
+(18930,17962,17962,2,0),
+(18931,18930,17962,3,0),
+(18932,18931,17962,4,0),
+(27266,18932,17962,5,0),
+(30912,27266,17962,6,0),
+(47828,30912,17962,7,0),
+(47829,47828,17962,8,0),
+/*Hellfire*/
+(1949,0,1949,1,0),
+(11683,1949,1949,2,0),
+(11684,11683,1949,3,0),
+(27213,11684,1949,4,0),
+(47823,27213,1949,5,0),
+/*Immolate*/
+(348,0,348,1,0),
+(707,348,348,2,0),
+(1094,707,348,3,0),
+(2941,1094,348,4,0),
+(11665,2941,348,5,0),
+(11667,11665,348,6,0),
+(11668,11667,348,7,0),
+(25309,11668,348,8,0),
+(27215,25309,348,9,0),
+(47810,27215,348,10,0),
+(47811,47810,348,11,0),
+/*Incinerate*/
+(29722,0,29722,1,0),
+(32231,29722,29722,2,0),
+(47837,32231,29722,3,0),
+(47838,47837,29722,4,0),
+/*RainofFire*/
+(5740,0,5740,1,0),
+(6219,5740,5740,2,0),
+(11677,6219,5740,3,0),
+(11678,11677,5740,4,0),
+(27212,11678,5740,5,0),
+(47819,27212,5740,6,0),
+(47820,47819,5740,7,0),
+/*SearingPain*/
+(5676,0,5676,1,0),
+(17919,5676,5676,2,0),
+(17920,17919,5676,3,0),
+(17921,17920,5676,4,0),
+(17922,17921,5676,5,0),
+(17923,17922,5676,6,0),
+(27210,17923,5676,7,0),
+(30459,27210,5676,8,0),
+(47814,30459,5676,9,0),
+(47815,47814,5676,10,0),
+/*ShadowBolt*/
+(686,0,686,1,0),
+(695,686,686,2,0),
+(705,695,686,3,0),
+(1088,705,686,4,0),
+(1106,1088,686,5,0),
+(7641,1106,686,6,0),
+(11659,7641,686,7,0),
+(11660,11659,686,8,0),
+(11661,11660,686,9,0),
+(25307,11661,686,10,0),
+(27209,25307,686,11,0),
+(47808,27209,686,12,0),
+(47809,47808,686,13,0),
+/*Shadowburn*/
+(17877,0,17877,1,0),
+(18867,17877,17877,2,0),
+(18868,18867,17877,3,0),
+(18869,18868,17877,4,0),
+(18870,18869,17877,5,0),
+(18871,18870,17877,6,0),
+(27263,18871,17877,7,0),
+(30546,27263,17877,8,0),
+(47826,30546,17877,9,0),
+(47827,47826,17877,10,0),
+/*Shadowflame*/
+(47897,0,47897,1,0),
+(61290,47897,47897,2,0),
+/*Shadowfury*/
+(30283,0,30283,1,0),
+(30413,30283,30283,2,0),
+(30414,30413,30283,3,0),
+(47846,30414,30283,4,0),
+(47847,47846,30283,5,0),
+/*SoulFire*/
+(6353,0,6353,1,0),
+(17924,6353,6353,2,0),
+(27211,17924,6353,3,0),
+(30545,27211,6353,4,0),
+(47824,30545,6353,5,0),
+(47825,47824,6353,6,0),
+/*------------------
+--(594) Holy (Paladin)
+------------------*/
+/*Blessing of Wisdom*/
+(19742,0,19742,1,0),
+(19850,19742,19742,2,0),
+(19852,19850,19742,3,0),
+(19853,19852,19742,4,0),
+(19854,19853,19742,5,0),
+(25290,19854,19742,6,0),
+(27142,25290,19742,7,0),
+(48935,27142,19742,8,0),
+(48936,48935,19742,9,0),
+/*Consecration*/
+(26573,0,26573,1,0),
+(20116,26573,26573,2,0),
+(20922,20116,26573,3,0),
+(20923,20922,26573,4,0),
+(20924,20923,26573,5,0),
+(27173,20924,26573,6,0),
+(48818,27173,26573,7,0),
+(48819,48818,26573,8,0),
+/*Exorcism*/
+(879,0,879,1,0),
+(5614,879,879,2,0),
+(5615,5614,879,3,0),
+(10312,5615,879,4,0),
+(10313,10312,879,5,0),
+(10314,10313,879,6,0),
+(27138,10314,879,7,0),
+(48800,27138,879,8,0),
+(48801,48800,879,9,0),
+/*Flash of Light*/
+(19750,0,19750,1,0),
+(19939,19750,19750,2,0),
+(19940,19939,19750,3,0),
+(19941,19940,19750,4,0),
+(19942,19941,19750,5,0),
+(19943,19942,19750,6,0),
+(27137,19943,19750,7,0),
+(48784,27137,19750,8,0),
+(48785,48784,19750,9,0),
+/*Greater Blessing of Wisdom*/
+(25894,0,25894,1,19854),
+(25918,25894,25894,2,25290),
+(27143,25918,25894,3,27142),
+(48937,27143,25894,4,48935),
+(48938,48937,25894,5,48936),
+/*Holy Light*/
+(635,0,635,1,0),
+(639,635,635,2,0),
+(647,639,635,3,0),
+(1026,647,635,4,0),
+(1042,1026,635,5,0),
+(3472,1042,635,6,0),
+(10328,3472,635,7,0),
+(10329,10328,635,8,0),
+(25292,10329,635,9,0),
+(27135,25292,635,10,0),
+(27136,27135,635,11,0),
+(48781,27136,635,12,0),
+(48782,48781,635,13,0),
+/*HolyShock*/
+(20473,0,20473,1,0),
+(20929,20473,20473,2,0),
+(20930,20929,20473,3,0),
+(27174,20930,20473,4,0),
+(33072,27174,20473,5,0),
+(48824,33072,20473,6,0),
+(48825,48824,20473,7,0),
+/*HolyWrath*/
+(2812,0,2812,1,0),
+(10318,2812,2812,2,0),
+(27139,10318,2812,3,0),
+(48816,27139,2812,4,0),
+(48817,48816,2812,5,0),
+/*Lay on Hands*/
+(633,0,633,1,0),
+(2800,633,633,2,0),
+(10310,2800,633,3,0),
+(27154,10310,633,4,0),
+(48788,27154,633,5,0),
+/*Redemption*/
+(7328,0,7328,1,0),
+(10322,7328,7328,2,0),
+(10324,10322,7328,3,0),
+(20772,10324,7328,4,0),
+(20773,20772,7328,5,0),
+(48949,20773,7328,6,0),
+(48950,48949,7328,7,0),
+/*------------------
+--(613)Discipline
+------------------*/
+/*DispelMagic*/
+(527,0,527,1,0),
+(988,527,527,2,0),
+/*DivineSpirit*/
+(14752,0,14752,1,0),
+(14818,14752,14752,2,0),
+(14819,14818,14752,3,0),
+(27841,14819,14752,4,0),
+(25312,27841,14752,5,0),
+(48073,25312,14752,6,0),
+/*InnerFire*/
+(588,0,588,1,0),
+(7128,588,588,2,0),
+(602,7128,588,3,0),
+(1006,602,588,4,0),
+(10951,1006,588,5,0),
+(10952,10951,588,6,0),
+(25431,10952,588,7,0),
+(48040,25431,588,8,0),
+(48168,48040,588,9,0),
+/*Penance*/
+(47540,0,47540,1,0),
+(53005,47540,47540,2,0),
+(53006,53005,47540,3,0),
+(53007,53006,47540,4,0),
+/*PowerWord:Fortitude*/
+(1243,0,1243,1,0),
+(1244,1243,1243,2,0),
+(1245,1244,1243,3,0),
+(2791,1245,1243,4,0),
+(10937,2791,1243,5,0),
+(10938,10937,1243,6,0),
+(25389,10938,1243,7,0),
+(48161,25389,1243,8,0),
+/*PowerWord:Shield*/
+(17,0,17,1,0),
+(592,17,17,2,0),
+(600,592,17,3,0),
+(3747,600,17,4,0),
+(6065,3747,17,5,0),
+(6066,6065,17,6,0),
+(10898,6066,17,7,0),
+(10899,10898,17,8,0),
+(10900,10899,17,9,0),
+(10901,10900,17,10,0),
+(25217,10901,17,11,0),
+(25218,25217,17,12,0),
+(48065,25218,17,13,0),
+(48066,48065,17,14,0),
+/*PrayerofFortitude*/
+(21562,0,21562,1,0),
+(21564,21562,21562,2,0),
+(25392,21564,21562,3,0),
+(48162,25392,21562,4,0),
+/*Prayer of Spirit*/
+(27681,0,27681,1,14752),
+(32999,27681,27681,2,0),
+(48074,32999,27681,3,0),
+/*ShackleUndead*/
+(9484,0,9484,1,0),
+(9485,9484,9484,2,0),
+(10955,9485,9484,3,0),
+/*------------------
+--(654)Pet-Hyena
+------------------*/
+/*TendonRip*/
+(50271,0,50271,1,0),
+(53571,50271,50271,2,0),
+(53572,53571,50271,3,0),
+(53573,53572,50271,4,0),
+(53574,53573,50271,5,0),
+(53575,53574,50271,6,0),
+/*------------------
+--(655)Pet-BirdofPrey
+------------------*/
+/*Snatch*/
+(50541,0,50541,1,0),
+(53537,50541,50541,2,0),
+(53538,53537,50541,3,0),
+(53540,53538,50541,4,0),
+(53542,53540,50541,5,0),
+(53543,53542,50541,6,0),
+/*------------------
+--(656)Pet-WindSerpent
+------------------*/
+/*LightningBreath*/
+(24844,0,24844,1,0),
+(25008,24844,24844,2,0),
+(25009,25008,24844,3,0),
+(25010,25009,24844,4,0),
+(25011,25010,24844,5,0),
+(25012,25011,24844,6,0),
+/*------------------
+-- (755) Jewelcrafting
+------------------*/
+/*Jewelcrafting*/
+(25229,0,25229,1,0),
+(25230,25229,25229,2,0),
+(28894,25230,25229,3,0),
+(28895,28894,25229,4,0),
+(28897,28895,25229,5,0),
+(51311,28897,25229,6,0),
+/*------------------
+--(761)Pet-Felguard
+------------------*/
+/*Anguish*/
+(33698,0,33698,1,0),
+(33699,33698,33698,2,0),
+(33700,33699,33698,3,0),
+(47993,33700,33698,4,0),
+/*Cleave*/
+(30213,0,30213,1,0),
+(30219,30213,30213,2,0),
+(30223,30219,30213,3,0),
+(47994,30223,30213,4,0),
+/*Intercept*/
+(30151,0,30151,1,0),
+(30194,30151,30151,2,0),
+(30198,30194,30151,3,0),
+(47996,30198,30151,4,0),
+/*------------------
+-- (762) Riding
+------------------*/
+/*Riding*/
+(33388,0,33388,1,0),
+(33391,33388,33388,2,0),
+(34090,33391,33388,3,0),
+(34091,34090,33388,4,0),
+/*------------------
+--(763)Pet-Dragonhawk
+------------------*/
+/*FireBreath*/
+(34889,0,34889,1,0),
+(35323,34889,34889,2,0),
+(55482,35323,34889,3,0),
+(55483,55482,34889,4,0),
+(55484,55483,34889,5,0),
+(55485,55484,34889,6,0),
+/*------------------
+--(764)Pet-NetherRay
+--(765)Pet-Sporebat
+------------------*/
+/*SporeCloud*/
+(50274,0,50274,1,0),
+(53593,50274,50274,2,0),
+(53594,53593,50274,3,0),
+(53596,53594,50274,4,0),
+(53597,53596,50274,5,0),
+(53598,53597,50274,6,0),
+/*------------------
+--(768)Pet-Serpent
+------------------*/
+/*PoisonSpit*/
+(35387,0,35387,1,0),
+(35389,35387,35387,2,0),
+(35392,35389,35387,3,0),
+(55555,35392,35387,4,0),
+(55556,55555,35387,5,0),
+(55557,55556,35387,6,0),
+/*------------------
+--(770)Blood
+------------------*/
+/*BloodBoil*/
+(48721,0,48721,1,0),
+(49939,48721,48721,2,0),
+(49940,49939,48721,3,0),
+(49941,49940,48721,4,0),
+/*BloodStrike*/
+(45902,0,45902,1,0),
+(49926,45902,45902,2,0),
+(49927,49926,45902,3,0),
+(49928,49927,45902,4,0),
+(49929,49928,45902,5,0),
+(49930,49929,45902,6,0),
+/*HeartStrike*/
+(55050,0,55050,1,0),
+(55258,55050,55050,2,0),
+(55259,55258,55050,3,0),
+(55260,55259,55050,4,0),
+(55261,55260,55050,5,0),
+(55262,55261,55050,6,0),
+/*ImprovedRuneTap*/
+(48985,0,48985,1,0),
+(49488,48985,48985,2,0),
+(49489,49488,48985,3,0),
+/*Pestilence*/
+(50842,0,50842,1,0),
+(51426,50842,50842,2,0),
+(51427,51426,50842,3,0),
+(51428,51427,50842,4,0),
+(51429,51428,50842,5,0),
+/*Strangulate*/
+(47476,0,47476,1,0),
+(49913,47476,47476,2,0),
+(49914,49913,47476,3,0),
+(49915,49914,47476,4,0),
+(49916,49915,47476,5,0),
+/*Vendetta*/
+(49015,0,49015,1,0),
+(50154,49015,49015,2,0),
+(55136,50154,49015,3,0),
+/*------------------
+--(771)Frost
+------------------*/
+/*FrostStrike*/
+(49143,0,49143,1,0),
+(51416,49143,49143,2,0),
+(51417,51416,49143,3,0),
+(51418,51417,49143,4,0),
+(51419,51418,49143,5,0),
+(55268,51419,49143,6,0),
+/*HornofWinter*/
+(57330,0,57330,1,0),
+(57623,57330,57330,2,0),
+/*HowlingBlast*/
+(49184,0,49184,1,0),
+(51408,49184,49184,2,0),
+(51409,51408,49184,3,0),
+(51410,51409,49184,4,0),
+(51411,51410,49184,5,0),
+/*IcyTalons*/
+(50880,0,50880,1,0),
+(50884,50880,50880,2,0),
+(50885,50884,50880,3,0),
+(50886,50885,50880,4,0),
+(50887,50886,50880,5,0),
+/*IcyTouch*/
+(45477,0,45477,1,0),
+(49896,45477,45477,2,0),
+(49903,49896,45477,3,0),
+(49904,49903,45477,4,0),
+(49909,49904,45477,5,0),
+/*ImprovedIcyTouch*/
+(49175,0,49175,1,0),
+(50031,49175,49175,2,0),
+(51456,50031,49175,3,0),
+/*Obliterate*/
+(49020,0,49020,1,0),
+(51423,49020,49020,2,0),
+(51424,51423,49020,3,0),
+(51425,51424,49020,4,0),
+/*------------------
+--(772)Unholy
+------------------*/
+/*CorpseExplosion*/
+(49158,0,49158,1,0),
+(51325,49158,49158,2,0),
+(51326,51325,49158,3,0),
+(51327,51326,49158,4,0),
+(51328,51327,49158,5,0),
+/*DeathandDecay*/
+(43265,0,43265,1,0),
+(49936,43265,43265,2,0),
+(49937,49936,43265,3,0),
+(49938,49937,43265,4,0),
+/*DeathCoil*/
+(47541,0,47541,1,0),
+(49892,47541,47541,2,0),
+(49893,49892,47541,3,0),
+(49894,49893,47541,4,0),
+(49895,49894,47541,5,0),
+/*DeathStrike*/
+(49998,0,49998,1,0),
+(49999,49998,49998,2,0),
+(45463,49999,49998,3,0),
+(49923,45463,49998,4,0),
+(49924,49923,49998,5,0),
+/*MagicSuppression*/
+(49224,0,49224,1,0),
+(49610,49224,49224,2,0),
+(49611,49610,49224,3,0),
+(49612,49611,49224,4,0),
+(49614,49612,49224,5,0),
+/*Outbreak*/
+(49013,0,49013,1,0),
+(55236,49013,49013,2,0),
+(55237,55236,49013,3,0),
+/*PlagueStrike*/
+(45462,0,45462,1,0),
+(49917,45462,45462,2,0),
+(49918,49917,45462,3,0),
+(49919,49918,45462,4,0),
+(49920,49919,45462,5,0),
+(49921,49920,45462,6,0),
+/*ScourgeStrike*/
+(55090,0,55090,1,0),
+(55265,55090,55090,2,0),
+(55270,55265,55090,3,0),
+(55271,55270,55090,4,0),
+/*UnholyBlight*/
+(49194,0,49194,1,0),
+(51376,49194,49194,2,0),
+(51378,51376,49194,3,0),
+(51379,51378,49194,4,0),
+/*------------------
+-- (773) Inscription
+------------------*/
+/*Inscription*/
+(45357,0,45357,1,0),
+(45358,45357,45357,2,0),
+(45359,45358,45357,3,0),
+(45360,45359,45357,4,0),
+(45361,45360,45357,5,0),
+(45363,45361,45357,6,0),
+/*------------------
+-- (777) Mounts
+------------------*/
+(13819,0,13819,1,0),
+(23214,13819,13819,2,33391),
+(34769,0,34769,1,0),
+(34767,34769,34769,2,33391),
+/*------------------
+--(780)Pet-ExoticChimaera
+------------------*/
+/*FroststormBreath*/
+(54644,0,54644,1,0),
+(55488,54644,54644,2,0),
+(55489,55488,54644,3,0),
+(55490,55489,54644,4,0),
+(55491,55490,54644,5,0),
+(55492,55491,54644,6,0),
+/*------------------
+--(781)Pet-ExoticDevlisaur
+------------------*/
+/*MonstrousBite*/
+(54680,0,54680,1,0),
+(55495,54680,54680,2,0),
+(55496,55495,54680,3,0),
+(55497,55496,54680,4,0),
+(55498,55497,54680,5,0),
+(55499,55498,54680,6,0),
+/*------------------
+--(784)Pet-ExoticWorm
+------------------*/
+/*AcidSpit*/
+(55749,0,55749,1,0),
+(55750,55749,55749,2,0),
+(55751,55750,55749,3,0),
+(55752,55751,55749,4,0),
+(55753,55752,55749,5,0),
+(55754,55753,55749,6,0),
+/*------------------
+--(785)Pet-Wasp
+------------------*/
+/*Sting*/
+(56626,0,56626,1,0),
+(56627,56626,56626,2,0),
+(56628,56627,56626,3,0),
+(56629,56628,56626,4,0),
+(56630,56629,56626,5,0),
+(56631,56630,56626,6,0),
+/*------------------
+--(787)Pet-ExoticCoreHound
+------------------*/
+/*LavaBreath*/
+(58604,0,58604,1,0),
+(58607,58604,58604,2,0),
+(58608,58607,58604,3,0),
+(58609,58608,58604,4,0),
+(58610,58609,58604,5,0),
+(58611,58610,58604,6,0),
+/*------------------
+--(788)Pet-ExoticSpiritBeast
+------------------*/
+/*SpiritStrike*/
+(61193,0,61193,1,0),
+(61194,61193,61193,2,0),
+(61195,61194,61193,3,0),
+(61196,61195,61193,4,0),
+(61197,61196,61193,5,0),
+(61198,61197,61193,6,0),
+
+/*Tranquility*/
+(44203, 0,44203,1,0),
+(44205,44203,44203,2,0),
+(44206,44205,44203,3,0),
+(44207,44206,44203,4,0),
+(44208,44207,44203,5,0),
+(48444,44208,44203,6,0),
+(48445,48444,44203,7,0),
+/*Hurricane*/
+(42231, 0,42231,1,0),
+(42232,42231,42231,2,0),
+(42233,42232,42231,3,0),
+(42230,42233,42231,4,0),
+(48466,42230,42231,5,0);
+/*!40000 ALTER TABLE `spell_chain` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_elixir`
+--
+
+DROP TABLE IF EXISTS `spell_elixir`;
+CREATE TABLE `spell_elixir` (
+ `entry` int(11) unsigned NOT NULL default '0' COMMENT 'SpellId of potion',
+ `mask` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Mask 0x1 battle 0x2 guardian 0x3 flask 0x7 unstable flasks 0xB shattrath flasks',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System';
+
+--
+-- Dumping data for table `spell_elixir`
+--
+
+LOCK TABLES `spell_elixir` WRITE;
+/*!40000 ALTER TABLE `spell_elixir` DISABLE KEYS */;
+INSERT INTO `spell_elixir` VALUES
+( 673,0x2),
+( 2367,0x1),
+( 2374,0x1),
+( 2378,0x2),
+( 2380,0x2),
+( 3160,0x1),
+( 3164,0x1),
+( 3166,0x2),
+( 3219,0x2),
+( 3220,0x2),
+( 3222,0x2),
+( 3223,0x2),
+( 3593,0x2),
+( 7844,0x1),
+( 8212,0x1),
+(10667,0x1),
+(10668,0x2),
+(10669,0x1),
+(10692,0x2),
+(10693,0x2),
+(11319,0x2),
+(11328,0x1),
+(11334,0x1),
+(11348,0x2),
+(11349,0x2),
+(11364,0x2),
+(11371,0x2),
+(11390,0x1),
+(11396,0x2),
+(11405,0x1),
+(11406,0x1),
+(11474,0x1),
+(15231,0x2),
+(15233,0x2),
+(16321,0x2),
+(16322,0x1),
+(16323,0x1),
+(16325,0x2),
+(16326,0x2),
+(16327,0x2),
+(16329,0x1),
+(17038,0x1),
+(17535,0x2),
+(17537,0x1),
+(17538,0x1),
+(17539,0x1),
+(17624,0x3),
+(17626,0x3),
+(17627,0x3),
+(17629,0x3),
+(17628,0x3),
+(21920,0x1),
+(24361,0x2),
+(24363,0x2),
+(24382,0x2),
+(24383,0x2),
+(24417,0x2),
+(26276,0x1),
+(27652,0x2),
+(27653,0x2),
+(28486,0x1),
+(28488,0x1),
+(28490,0x1),
+(28491,0x1),
+(28493,0x1),
+(28497,0x1),
+(28501,0x1),
+(28502,0x2),
+(28503,0x1),
+(28509,0x2),
+(28514,0x2),
+(28518,0x3),
+(28519,0x3),
+(28520,0x3),
+(28521,0x3),
+(28540,0x3),
+(29348,0x2),
+(33720,0x1),
+(33721,0x1),
+(33726,0x1),
+(38954,0x1),
+(39625,0x2),
+(39626,0x2),
+(39627,0x2),
+(39628,0x2),
+(40567,0x7),
+(40568,0x7),
+(40572,0x7),
+(40573,0x7),
+(40575,0x7),
+(40576,0x7),
+(41608,0xB),
+(41609,0xB),
+(41610,0xB),
+(41611,0xB),
+(42735,0x3),
+(45373,0x1),
+(46837,0xB),
+(46839,0xB);
+/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_learn_spell`
+--
+
+DROP TABLE IF EXISTS `spell_learn_spell`;
+CREATE TABLE `spell_learn_spell` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `SpellID` smallint(5) unsigned NOT NULL default '0',
+ `Active` tinyint(3) unsigned NOT NULL default '1',
+ PRIMARY KEY (`entry`,`SpellID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
+
+--
+-- Dumping data for table `spell_learn_spell`
+--
+
+LOCK TABLES `spell_learn_spell` WRITE;
+/*!40000 ALTER TABLE `spell_learn_spell` DISABLE KEYS */;
+INSERT INTO `spell_learn_spell` VALUES
+(71,7376,0),
+(768,3025,0),
+(783,5419,0),
+(1066,5421,0),
+(2457,21156,0),
+(2458,7381,0),
+(5487,1178,0),
+(5487,21178,0),
+(5784,33388,1),
+(9634,9635,0),
+(9634,21178,0),
+(13819,33388,1),
+(17002,24867,0),
+(23161,33391,1),
+(23214,33391,1),
+(24858,24905,0),
+(24866,24864,0),
+(33872,47179,0),
+(33873,47180,0),
+(33891,5420,0),
+(33891,34123,0),
+(33943,33948,0),
+(33943,34090,1),
+(33943,34764,0),
+(34767,33391,1),
+(34769,33388,1),
+(40123,40121,0),
+(40123,40122,0),
+(53428,53341,1),
+(53428,53343,1),
+(58984,21009,1);
+
+
+/*!40000 ALTER TABLE `spell_learn_spell` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_loot_template`
+--
+
+DROP TABLE IF EXISTS `spell_loot_template`;
+CREATE TABLE `spell_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `spell_loot_template`
+--
+
+LOCK TABLES `spell_loot_template` WRITE;
+/*!40000 ALTER TABLE `spell_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_pet_auras`
+--
+
+DROP TABLE IF EXISTS `spell_pet_auras`;
+CREATE TABLE `spell_pet_auras` (
+ `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id',
+ `pet` mediumint(8) unsigned NOT NULL default '0' COMMENT 'pet id; 0 = all',
+ `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id',
+ PRIMARY KEY (`spell`,`pet`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `spell_pet_auras`
+--
+
+LOCK TABLES `spell_pet_auras` WRITE;
+/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */;
+INSERT INTO `spell_pet_auras` VALUES
+(19028, 0, 25228),
+(19578, 0, 19579),
+(20895, 0, 24529),
+(28757, 0, 28758),
+(35029, 0, 35060),
+(35030, 0, 35061),
+(35691, 0, 35696),
+(35692, 0, 35696),
+(35693, 0, 35696),
+(23785, 416, 23759),
+(23822, 416, 23826),
+(23823, 416, 23827),
+(23824, 416, 23828),
+(23825, 416, 23829),
+(23785, 417, 23762),
+(23822, 417, 23837),
+(23823, 417, 23838),
+(23824, 417, 23839),
+(23825, 417, 23840),
+(23785, 1860, 23760),
+(23822, 1860, 23841),
+(23823, 1860, 23842),
+(23824, 1860, 23843),
+(23825, 1860, 23844),
+(23785, 1863, 23761),
+(23822, 1863, 23833),
+(23823, 1863, 23834),
+(23824, 1863, 23835),
+(23825, 1863, 23836),
+(23785, 17252, 35702),
+(23822, 17252, 35703),
+(23823, 17252, 35704),
+(23824, 17252, 35705),
+(23825, 17252, 35706);
+
+/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_proc_event`
+--
+
+DROP TABLE IF EXISTS `spell_proc_event`;
+CREATE TABLE `spell_proc_event` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `SchoolMask` tinyint(4) NOT NULL default '0',
+ `SpellFamilyName` smallint(5) unsigned NOT NULL default '0',
+ `SpellFamilyMask0` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask1` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask2` int(10) unsigned NOT NULL default '0',
+ `procFlags` int(10) unsigned NOT NULL default '0',
+ `procEx` int(10) unsigned NOT NULL default '0',
+ `ppmRate` float NOT NULL default '0',
+ `CustomChance` float NOT NULL default '0',
+ `Cooldown` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `spell_proc_event`
+--
+
+LOCK TABLES `spell_proc_event` WRITE;
+/*!40000 ALTER TABLE `spell_proc_event` DISABLE KEYS */;
+INSERT INTO `spell_proc_event` VALUES
+( 324, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 325, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 905, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 945, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 974, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 1463, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+( 3232, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+( 5952, 0x00000000, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+( 6346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+( 7383, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+( 7434, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+( 8134, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 8178, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+( 8494, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+( 8495, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+( 9452, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+( 9782, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+( 9784, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+( 9799, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(10191, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(10192, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(10193, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(10431, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(10432, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(11095, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11119, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(11120, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(11129, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11180, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11185, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
+(11255, 0x00000000, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12169, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12281, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12289, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12298, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12311, 0x00000000, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12317, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12319, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12322, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(12487, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
+(12488, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
+(12598, 0x00000000, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12668, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12724, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12725, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12726, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12727, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12797, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12799, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12812, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12813, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12814, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12815, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12834, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12846, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12847, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12848, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12849, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12867, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12872, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12873, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12958, 0x00000000, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12966, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12967, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12968, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12969, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12970, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12971, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12972, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12973, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12974, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12999, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
+(13000, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(13001, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 8.000000, 0.000000, 0),
+(13002, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10.000000, 0.000000, 0),
+(13045, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(13046, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(13047, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(13048, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(13163, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(13165, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(13754, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(13867, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(13983, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
+(14070, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
+(14071, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
+(14156, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14160, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14161, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14186, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14190, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14193, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14194, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14195, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14318, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14319, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14320, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14321, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14322, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14531, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14892, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15088, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15128, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15268, 0x00000020, 6, 0x06080000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15277, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(15286, 0x00000020, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15323, 0x00000020, 6, 0x06080000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15324, 0x00000020, 6, 0x06080000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15325, 0x00000020, 6, 0x06080000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15326, 0x00000020, 6, 0x06080000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15337, 0x00000000, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15338, 0x00000000, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(15362, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15363, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15600, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(16164, 0x00000000, 11, 0x901000C3, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16176, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16180, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16196, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16198, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16235, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16240, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16256, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16257, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16277, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16278, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16279, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16280, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16281, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16282, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16283, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16284, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16487, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16489, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16492, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16550, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16620, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(16624, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(16850, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(16864, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(16880, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16923, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(16924, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16958, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16961, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17106, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17107, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17108, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17364, 0x00000008, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17495, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(17793, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17794, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0.000000, 0.000000, 0),
+(17796, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17797, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17798, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17799, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17800, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17801, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17802, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17803, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(18073, 0x00000000, 5, 0x00000060, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18094, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18095, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18096, 0x00000000, 5, 0x00000060, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18119, 0x00000000, 5, 0x000003E5, 0x000010C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18120, 0x00000000, 5, 0x000003E5, 0x000010C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18820, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(19184, 0x00000000, 9, 0x00000014, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19228, 0x00000000, 0, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19232, 0x00000000, 9, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19233, 0x00000000, 9, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19387, 0x00000000, 9, 0x00000014, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19388, 0x00000000, 9, 0x00000014, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19572, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(19573, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(20049, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20056, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20057, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20131, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20132, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20164, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
+(20165, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20.000000, 0.000000, 0),
+(20166, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20.000000, 0.000000, 0),
+(20182, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20210, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20212, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20213, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20214, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20215, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20234, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20235, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20375, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(20500, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20501, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20705, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20911, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(20925, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20927, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20928, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(21185, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(21882, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(21890, 0x00000000, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(22007, 0x00000000, 3, 0x00200021, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(22618, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(22648, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(23547, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(23548, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(23551, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23552, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(23572, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23578, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23581, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23602, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(23686, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23688, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(23689, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
+(23695, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23721, 0x00000000, 9, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23920, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(24353, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(24389, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(24398, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(24658, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00014110, 0x00000000, 0.000000, 0.000000, 0),
+(24905, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 15.000000, 0.000000, 0),
+(24932, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 6),
+(25050, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(25296, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(25469, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(25472, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(25669, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(25899, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(25988, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(26016, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(26107, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000064, 0.000000, 0.000000, 0),
+(26119, 0x00000000, 10, 0x90100003, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(26128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(26135, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(26480, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(26605, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(27044, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(27131, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(27179, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(27419, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27498, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27521, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(27656, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(27787, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27811, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(27815, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(27816, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28592, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28593, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28716, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00048000, 0x00000000, 0.000000, 0.000000, 0),
+(28719, 0x00000000, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28744, 0x00000000, 7, 0x00000040, 0x00000000, 0x00000000, 0x00044000, 0x00000000, 0.000000, 0.000000, 0),
+(28752, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28789, 0x00000000, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28802, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(28809, 0x00000000, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28812, 0x00000000, 8, 0x02000006, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28816, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(28823, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28847, 0x00000000, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28849, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(29074, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29075, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29076, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29150, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29179, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29180, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29385, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(29441, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 1),
+(29444, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 1),
+(29455, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(29501, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29593, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(29594, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(29624, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29625, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29626, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29632, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29633, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29634, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29636, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29637, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29801, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29834, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(29838, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(29977, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30003, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(30160, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30293, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30295, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30296, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30299, 0x00000024, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30301, 0x00000024, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30302, 0x00000024, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30675, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30678, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30679, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30680, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30681, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30701, 0x0000001C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30705, 0x0000001C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30802, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30803, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30804, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30805, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30806, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30807, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30808, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30809, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30810, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30811, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30823, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10.500000, 0.000000, 0),
+(30881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(30883, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(30884, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(30885, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(30886, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(30937, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31124, 0x00000000, 8, 0x2000000E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31126, 0x00000000, 8, 0x2000000E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31244, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000004, 0.000000, 0.000000, 0),
+(31245, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000004, 0.000000, 0.000000, 0),
+(31394, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31569, 0x00000000, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31570, 0x00000000, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31785, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00008800, 0x00000000, 0.000000, 0.000000, 0),
+(31794, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(31801, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 20.000000, 0.000000, 0),
+(31833, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31835, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31836, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31871, 0x00000000, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(31872, 0x00000000, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(31876, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31877, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31878, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31904, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32385, 0x00000000, 5, 0x00000402, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32387, 0x00000000, 5, 0x00000402, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32392, 0x00000000, 5, 0x00000402, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32393, 0x00000000, 5, 0x00000402, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32394, 0x00000000, 5, 0x00000402, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32409, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32587, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32593, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(32594, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(32642, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32734, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(32748, 0x00000000, 8, 0x00000000, 0x00000001, 0x00000000, 0x00000140, 0x00000000, 0.000000, 0.000000, 0),
+(32776, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32777, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32837, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(32844, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(32885, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33076, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(33089, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(33127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(33142, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33145, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33146, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33150, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33151, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33154, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33191, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(33192, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(33193, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(33299, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(33510, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
+(33648, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33719, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(33736, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(33746, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(33757, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(33759, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(33776, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00008800, 0x00000000, 0.000000, 0.000000, 0),
+(33881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33882, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33883, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33953, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
+(34080, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(34138, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34139, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34258, 0x00000000, 10, 0x00000400, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34262, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(34320, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34355, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(34497, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34498, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34499, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34500, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34502, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34584, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(34586, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 0),
+(34598, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(34749, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(34753, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 20),
+(34783, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(34827, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(34859, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34860, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34914, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34916, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34917, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34935, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
+(34938, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
+(34939, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
+(34950, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34954, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(35077, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35080, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 60),
+(35083, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35086, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35100, 0x00000000, 9, 0x00003001, 0x00000000, 0x00000000, 0x00010140, 0x00000000, 0.000000, 0.000000, 0),
+(35102, 0x00000000, 9, 0x00003001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(35103, 0x00000000, 9, 0x00003001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(35121, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(36096, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(36111, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(36541, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37165, 0x00000000, 8, 0x00200400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37168, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37170, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(37173, 0x00000000, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(37189, 0x00000000, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
+(37193, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(37195, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37197, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(37213, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37214, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37227, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
+(37237, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37247, 0x00000008, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(37377, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37379, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37384, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37514, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(37516, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37519, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0.000000, 0.000000, 0),
+(37523, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(37528, 0x00000000, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37536, 0x00000000, 4, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37568, 0x00000000, 6, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37594, 0x00000000, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37600, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37603, 0x00000000, 6, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37655, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(37657, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 3),
+(38026, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+(38031, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(38290, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.600000, 0.000000, 0),
+(38326, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38327, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38334, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(38347, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38350, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38394, 0x00000000, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(38857, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39027, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(39372, 0x00000030, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(39437, 0x00000004, 5, 0x00001364, 0x000000C0, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39442, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0.000000, 0.000000, 0),
+(39443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(39530, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39958, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.700000, 0.000000, 40),
+(40407, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(40438, 0x00000000, 6, 0x00008040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40442, 0x00000000, 7, 0x00000014, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40444, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(40458, 0x00000000, 4, 0x02000000, 0x00000601, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40463, 0x00000000, 11, 0x00000081, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40470, 0x00000000, 10, 0xC0800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40475, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(40478, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40482, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(40485, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40899, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(41034, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(41260, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(41262, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(41381, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+(41393, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(41434, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 45),
+(41469, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(41635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(41989, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.500000, 0.000000, 0),
+(42083, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(42135, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
+(42136, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
+(42368, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(42370, 0x00000000, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(42770, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(43019, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(43020, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(43338, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(43443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(43726, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43728, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43737, 0x00000000, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(43739, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43741, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43745, 0x00000000, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43748, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43750, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43819, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(44394, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(44395, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(44396, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(44401, 0x00000000, 3, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0x00000FFF, 0.000000, 0.000000, 0),
+(44404, 0x00000000, 3, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44442, 0x00000000, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 1),
+(44443, 0x00000000, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 1),
+(44445, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44446, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44448, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44449, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44469, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44470, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44471, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44472, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44546, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44548, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44549, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44835, 0x00000000, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0.000000, 0.000000, 0),
+(45054, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
+(45057, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(45234, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(45243, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(45244, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(45354, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45481, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45482, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45483, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45484, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
+(46025, 0x00000020, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46092, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46098, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46569, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(46662, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 20),
+(46832, 0x00000000, 7, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(46854, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46855, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46867, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46913, 0x00000000, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46914, 0x00000000, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46915, 0x00000000, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46916, 0x00000000, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46951, 0x00000000, 4, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46952, 0x00000000, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46953, 0x00000000, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47195, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(47196, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(47197, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(47201, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47202, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47203, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47204, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47205, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47232, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47234, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47235, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47245, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47246, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47247, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47258, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47259, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47260, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47263, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47264, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47265, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47509, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47511, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47515, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47516, 0x00000000, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47517, 0x00000000, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47535, 0x00000000, 6, 0x00001800, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47536, 0x00000000, 6, 0x00001800, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47537, 0x00000000, 6, 0x00001800, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47538, 0x00000000, 6, 0x00001800, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47539, 0x00000000, 6, 0x00001800, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47549, 0x00000000, 6, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47551, 0x00000000, 6, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47552, 0x00000000, 6, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47555, 0x00000000, 6, 0x00001800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47556, 0x00000000, 6, 0x00001800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47557, 0x00000000, 6, 0x00001800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47572, 0x00000000, 6, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47580, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47581, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47582, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(48110, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48111, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48112, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48113, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48159, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48160, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48483, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48484, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48485, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48496, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(48499, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(48500, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(48506, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48510, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48511, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48516, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
+(48521, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
+(48525, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
+(48833, 0x00000000, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48835, 0x00000000, 10, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48837, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48951, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(48952, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(48988, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(49018, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49137, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49188, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49208, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49222, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49280, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49281, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49283, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49284, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(49504, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(49529, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49530, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49531, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49532, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49622, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(49657, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(50781, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51123, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51129, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51130, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51349, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51352, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51359, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51466, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51470, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51474, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(51478, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(51479, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(51556, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51557, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51558, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51562, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51563, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51564, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51565, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51566, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51625, 0x00000000, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51626, 0x00000000, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51627, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(51628, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(51629, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(51634, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51636, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51664, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51665, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51667, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51668, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51669, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51672, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 1),
+(51674, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 1),
+(51679, 0x00000000, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51692, 0x00000000, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51696, 0x00000000, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51698, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
+(51700, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
+(51701, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
+(51940, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(51989, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(52004, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(52005, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(52007, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(52008, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 20.000000, 0),
+(52020, 0x00000000, 7, 0x00008000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52129, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52131, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52134, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52136, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52138, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52420, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(52423, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(52795, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52797, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52798, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52799, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52800, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52898, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53137, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53138, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53215, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53216, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53217, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53221, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53222, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53224, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53228, 0x00000000, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53232, 0x00000000, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53256, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53259, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53260, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53290, 0x00000000, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53291, 0x00000000, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53292, 0x00000000, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53293, 0x00000000, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53294, 0x00000000, 9, 0x00000800, 0x7FFFFFFF, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53380, 0x00000000, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53381, 0x00000000, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53382, 0x00000000, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53383, 0x00000000, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53384, 0x00000000, 10, 0x00800000, 0x00020000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53486, 0x00000000, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53488, 0x00000000, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53501, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53502, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53551, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53552, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53553, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53569, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53576, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(53671, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53673, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54149, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54151, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54154, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54155, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54278, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54486, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54488, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54489, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54490, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54738, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54747, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(54749, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(54754, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54841, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54936, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54937, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54939, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55380, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55440, 0x00000000, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55620, 0x00000000, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55623, 0x00000000, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55640, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55666, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55667, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55668, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55669, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55670, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55677, 0x00000000, 6, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55680, 0x00000000, 6, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55689, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(55768, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55776, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(56218, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56333, 0x00000000, 9, 0x00000004, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56336, 0x00000000, 9, 0x00000004, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56337, 0x00000000, 9, 0x00000004, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56342, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56343, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56344, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56355, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(56364, 0x00000000, 3, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56451, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(56611, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(56612, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(56613, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(56614, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(56636, 0x00000000, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56637, 0x00000000, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56638, 0x00000000, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56821, 0x00000000, 8, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(56822, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56834, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56835, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(57878, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(57880, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(57881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(57960, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(58357, 0x00000000, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(58364, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58372, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58386, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(58435, 0x00000000, 5, 0x00000002, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58436, 0x00000000, 5, 0x00000002, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58437, 0x00000000, 5, 0x00000002, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58616, 0x00000000, 15, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58620, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58626, 0x00000000, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58631, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58642, 0x00000000, 15, 0x00000000, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58644, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58647, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58676, 0x00000000, 15, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58677, 0x00000000, 15, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58872, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(58874, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(58901, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(59057, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(59176, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(59327, 0x00000000, 15, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(59725, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(60132, 0x00000000, 15, 0x00000000, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60170, 0x00000000, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60172, 0x00000000, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(60493, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60503, 0x00000000, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60537, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(60564, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60571, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60572, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60573, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60574, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60575, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60617, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(60710, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60717, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60719, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60722, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60724, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60726, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60770, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60818, 0x00000000, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60826, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61188, 0x00000000, 5, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61257, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000202A8, 0x00010000, 0.000000, 0.000000, 0),
+(61324, 0x00000000, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61345, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(61346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(61356, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(61846, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(61847, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0);
+/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for spell_bonus_data
+--
+DROP TABLE IF EXISTS `spell_bonus_data`;
+CREATE TABLE `spell_bonus_data` (
+ `entry` smallint(5) unsigned NOT NULL,
+ `direct_bonus` float NOT NULL default '0',
+ `dot_bonus` float NOT NULL default '0',
+ `ap_bonus` float NOT NULL default '0',
+ `comments` varchar(255) default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+LOCK TABLES `spell_bonus_data` WRITE;
+/*!40000 ALTER TABLE `spell_bonus_data` DISABLE KEYS */;
+INSERT INTO `spell_bonus_data` VALUES
+('5185', '1.6104', '0', '0', 'Druid - Healing Touch'),
+('33763', '0', '0.09518', '0', 'Druid - Lifebloom'),
+('774', '0', '0.37604', '0', 'Druid - Rejuvenation'),
+('8936', '0.539', '0.188', '0', 'Druid - Regrowth'),
+('50288', '0.05', '0', '0', 'Druid - Starfall'),
+('50294', '0.012', '0', '0', 'Druid - Starfall AOE'),
+('18562', '0', '0', '0', 'Druid - Swiftmend'),
+('44203', '0.538', '0', '0', 'Druid - Tranquility Triggered'),
+('48438', '0', '0.11505', '0', 'Druid - Wild Growth'),
+('50464', '0.6611', '0', '0', 'Druid - Nourish'),
+('339', '0', '0.1', '0', 'Druid - Entangling Roots'),
+('42231', '0.12898', '0', '0', 'Druid - Hurricane Triggered'),
+('5570', '0', '0.127', '0', 'Druid - Insect Swarm'),
+('8921', '0.1515', '0.13', '0', 'Druid - Moonfire'),
+('2912', '1', '0', '0', 'Druid - Starfire'),
+('5176', '0.5714', '0', '0', 'Druid - Wrath'),
+('30451', '0.7143', '0', '0', 'Mage - Arcane Blast'),
+('1449', '0.2128', '0', '0', 'Mage - Arcane Explosion'),
+('7268', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 1'),
+('7269', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 2'),
+('7270', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 3'),
+('8419', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 4'),
+('8418', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 5'),
+('10273', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 6'),
+('10274', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 7'),
+('25346', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 8'),
+('27076', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 9'),
+('38700', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 10'),
+('38703', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 11'),
+('42844', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 12'),
+('42845', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 13'),
+('1463', '0.8053', '0', '0', 'Mage - Mana Shield'),
+('44425', '0.8571', '0', '0', 'Mage - Arcane Barrage'),
+('11113', '0.1357', '0', '0', 'Mage - Blast Wave Rank'),
+('31661', '0.1357', '0', '0', 'Mage - Dragons Breath'),
+('2136', '0.4286', '0', '0', 'Mage - Fire Blast'),
+('133', '1', '0', '0', 'Mage - Fire Ball'),
+('2120', '0.2357', '0.122', '0', 'Mage - Flamestrike'),
+('11366', '1.15', '0.05', '0', 'Mage - Pyroblast'),
+('2948', '0.4286', '0', '0', 'Mage - Scorch'),
+('44614', '0.8571', '0', '0', 'Mage - Frostfire Bolt'),
+('44457', '0.4', '0.2', '0', 'Mage - Living Bomb'),
+('42208', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 1'),
+('42209', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 2'),
+('42210', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 3'),
+('42211', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 4'),
+('42212', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 5'),
+('42213', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 6'),
+('42198', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 7'),
+('42937', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 8'),
+('42938', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 9'),
+('120', '0.1357', '0', '0', 'Mage - Cone of Cold'),
+('122', '0.193', '0', '0', 'Mage - Frost Nova'),
+('116', '0.8143', '0', '0', 'Mage - Frost Bolt'),
+('11426', '0.8053', '0', '0', 'Mage - Ice Barrier'),
+('30455', '0.1429', '0', '0', 'Mage - Ice Lance'),
+('34913','0', '0', '0', 'Mage - Molten Armor Triggered Rank 1'),
+('43043','0', '0', '0', 'Mage - Molten Armor Triggered Rank 2'),
+('43044','0', '0', '0', 'Mage - Molten Armor Triggered Rank 3'),
+('19750','0.4286', '0', '0', 'Paladin - Flash of Light'),
+('635', '0.7143', '0', '0', 'Paladin - Holy Light'),
+('25912', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 1'),
+('25911', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 2'),
+('25902', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 3'),
+('27176', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 4'),
+('33073', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 5'),
+('48822', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 6'),
+('48823', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 7'),
+('25914', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 1'),
+('25913', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 2'),
+('25903', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 3'),
+('27175', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 4'),
+('33074', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 5'),
+('48820', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 6'),
+('48821', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 7'),
+('31935', '0.07', '0', '0.07', 'Paladin - Avengers Shiled'),
+('26573', '0', '0.04', '0.04', 'Paladin - Consecration'),
+('879', '0.15', '0', '0.15', 'Paladin - Exorcism'),
+('24275', '0.15', '0', '0.15', 'Paladin - Hammer of Wrath'),
+('20925', '0.09', '0', '0.056', 'Paladin - Holy Shield'),
+('2812', '0.07', '0', '0.07', 'Paladin - Holy Wrath'),
+('31893', '0.25', '0', '0.16', 'Paladin - Seal of Blood Enemy Proc'),
+('32221', '0.25', '0', '0.16', 'Paladin - Seal of Blood Self Proc'),
+('20424', '0.25', '0', '0.16', 'Paladin - Seal of Command Proc'),
+('379', '0', '0', '0', 'Shaman - Earth Shield Triggered'),
+('20167', '0.25', '0', '0.16', 'Paladin - Seal of Light Proc'),
+('53719', '0.25', '0', '0.16', 'Paladin - Seal of The Martyr Enemy Proc'),
+('53718', '0.25', '0', '0.16', 'Paladin - Seal of The Martyr Self Proc'),
+('25742', '0.07', '0', '0.039', 'Paladin - Seal of Righteousness Dummy Proc'),
+('53595', '0', '0', '0','Paladin - Hammer of the Righteous'),
+('31803', '0', '0.013', '0.15', 'Paladin - Holy Vengeance'),
+('52042', '0.045', '0', '0', 'Shaman - Healing Stream Totem Triggered Heal'),
+('32546', '0.8068', '0', '0', 'Priest - Binding Heal'),
+('34861', '0.402', '0', '0', 'Priest - Circle of Healing'),
+('19236', '0.8068', '0', '0', 'Priest - Desperate Prayer'),
+('2061', '0.8068', '0', '0', 'Priest - Flash Heal'),
+('2060', '1.6135', '0', '0', 'Priest - Greater Heal'),
+('23455', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 1'),
+('23458', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 2'),
+('23459', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 3'),
+('27803', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 4'),
+('27804', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 5'),
+('27805', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 6'),
+('25329', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 7'),
+('17', '0.8068', '0', '0', 'Priest - Power Word: Shield'),
+('596', '0.8086', '0', '0', 'Priest - Prayer of Healing'),
+('33110', '0.8068', '0', '0', 'Priest - Prayer of Mending Heal Proc'),
+('139', '0', '0.376', '0', 'Priest - Renew'),
+('2944', '0.1849', '0', '0', 'Priest - Devouring Plague'),
+('14914', '0.5711', '0.024', '0', 'Priest - Holy Fire'),
+('15237', '0.1606', '0', '0', 'Priest - Holy Nova Damage'),
+('8129', '0', '0', '0', 'Priest - Mana Burn'),
+('8092', '0.4296', '0', '0', 'Priest - Mind Blast'),
+('15407', '0.257', '0', '0', 'Priest - Mind Flay'),
+('49821', '0.14286', '0', '0', 'Priest - Mind Sear Trigger Rank 1'),
+('53022', '0.14286', '0', '0', 'Priest - Mind Sear Trigger Rank 2'),
+('34433', '0.65', '0', '0', 'Priest - Shadowfiend'),
+('32379', '0.4296', '0', '0', 'Priest - Shadow Word: Death'),
+('589', '0', '0.1829', '0', 'Priest - Shadow Word: Pain'),
+('585', '0.714', '0', '0', 'Priest - Smite'),
+('34914', '0', '0.4', '0', 'Priest - Vampiric Touch'),
+('974', '0.4762', '0', '0', 'Shaman - Earth Shield'),
+('1064', '1.34', '0', '0', 'Shaman - Chain Heal'),
+('331', '1.6106', '0', '0', 'Shaman - Healing Wave'),
+('8004', '0.8082', '0', '0', 'Shaman - Lesser Healing Wave'),
+('61295', '0.4', '0.18', '0', 'Shaman - Riptide'),
+('421', '0.57', '0', '0', 'Shaman - Chain Lightning'),
+('8042', '0.3858', '0', '0', 'Shaman - Earth Shock'),
+('8443', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 1'),
+('8504', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 2'),
+('8505', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 3'),
+('11310', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 4'),
+('11311', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 5'),
+('25538', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 6'),
+('25539', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 7'),
+('61651', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 8'),
+('61660', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 9'),
+('8050', '0.2142', '0.1', '0', 'Shaman - Flame Shock'),
+('8026', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 1'),
+('8028', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 2'),
+('8029', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 3'),
+('10445', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 4'),
+('16343', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 5'),
+('16344', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 6'),
+('25488', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 7'),
+('58786', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 8'),
+('58787', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 9'),
+('58788', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 10'),
+('8056', '0.3858', '0', '0', 'Shaman - Frost Shock'),
+('8034', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 1'),
+('8037', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 2'),
+('10458', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 3'),
+('16352', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 4'),
+('16353', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 5'),
+('25501', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 6'),
+('58797', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 7'),
+('58798', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 8'),
+('58799', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 9'),
+('51505', '0.5714', '0', '0', 'Shaman - Lava Burst'),
+('403', '0.7143', '0', '0', 'Shaman - Lightning Bolt'),
+('26364', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 1'),
+('26365', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 2'),
+('26366', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 3'),
+('26367', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 4'),
+('26369', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 5'),
+('26370', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 6'),
+('26363', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 7'),
+('26371', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 8'),
+('26372', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 9'),
+('49278', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 10'),
+('49279', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 11'),
+('8188', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 1'),
+('10582', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 2'),
+('10583', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 3'),
+('10584', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 4'),
+('25551', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 5'),
+('58733', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 6'),
+('58736', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 7'),
+('3606', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 1'),
+('6350', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 2'),
+('6351', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 3'),
+('6352', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 4'),
+('10435', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 5'),
+('10436', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 6'),
+('25530', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 7'),
+('58700', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 8'),
+('58701', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 9'),
+('58702', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 10'),
+('980', '0', '0.1', '0', 'Warlock - Curse of Agony'),
+('603', '0', '2', '0', 'Warlock - Curse of Doom'),
+('172', '0', '0.3', '0', 'Warlock - Corruption'),
+('348', '0.2', '0.2', '0', 'Warlock - Immolate'),
+('27243', '0.22', '0.25', '0', 'Warlock - Seed of Corruption'),
+('18265', '0', '0.1', '0', 'Warlock - Siphon Life'),
+('30108', '0', '0.24', '0', 'Warlock - Unstable Affliction'),
+('31117', '1.8', '0', '0', 'Warlock - Unstable Affliction Dispell'),
+('17962', '0.4286', '0', '0', 'Warlock - Conflagrate'),
+('6789', '0.22', '0', '0', 'Warlock - Death Coil'),
+('28176', '0', '0', '0', 'Warlock - Fel Armor'),
+('48181', '0.4729', '0', '0', 'Warlock - Haunt'),
+('29722', '0.7143', '0', '0', 'Warlock - Incinerate'),
+('5676', '0.4286', '0', '0', 'Warlock - Searing Pain'),
+('686', '0.8571', '0', '0', 'Warlock - Shadow Bolt'),
+('17877', '0.4286', '0', '0', 'Warlock - Shadowburn'),
+('30283', '0.195', '0', '0', 'Warlock - Shadowfury'),
+('6353', '1.15', '0', '0', 'Warlock - Soul Fire'),
+('689', '0', '0.1428', '0', 'Warlock - Drain Life'),
+('5138', '0', '0', '0', 'Warlock - Drain Mana'),
+('1120', '0', '0.4286', '0', 'Warlock - Drain Soul'),
+('755', '0', '0.4485', '0', 'Warlock - Health Funnel'),
+('1949', '0', '0.0946', '0', 'Warlock - Hellfire'),
+('5857', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 1'),
+('11681', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 2'),
+('11682', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 3'),
+('27214', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 4'),
+('47822', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 5'),
+('42223', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 1'),
+('42224', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 2'),
+('42225', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 3'),
+('42226', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 4'),
+('42218', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 5'),
+('47817', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 6'),
+('47818', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 7'),
+('18220', '0.96', '0', '0', 'Warlock - Dark Pact Rank 1'),
+('18937', '0.96', '0', '0', 'Warlock - Dark Pact Rank 2'),
+('18938', '0.96', '0', '0', 'Warlock - Dark Pact Rank 3'),
+('27265', '0.96', '0', '0', 'Warlock - Dark Pact Rank 4'),
+('59092', '0.96', '0', '0', 'Warlock - Dark Pact Rank 5'),
+('6229', '0.3', '0', '0', 'Warlock - Shadow Ward');
+/*!40000 ALTER TABLE `spell_bonus_data` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_script_target`
+--
+
+DROP TABLE IF EXISTS `spell_script_target`;
+CREATE TABLE `spell_script_target` (
+ `entry` mediumint(8) unsigned NOT NULL,
+ `type` tinyint(3) unsigned NOT NULL default '0',
+ `targetEntry` mediumint(8) unsigned NOT NULL default '0',
+ UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Spell System';
+
+--
+-- Dumping data for table `spell_script_target`
+--
+
+LOCK TABLES `spell_script_target` WRITE;
+/*!40000 ALTER TABLE `spell_script_target` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_script_target` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_scripts`
+--
+
+DROP TABLE IF EXISTS `spell_scripts`;
+CREATE TABLE `spell_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `spell_scripts`
+--
+
+LOCK TABLES `spell_scripts` WRITE;
+/*!40000 ALTER TABLE `spell_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_target_position`
+--
+
+DROP TABLE IF EXISTS `spell_target_position`;
+CREATE TABLE `spell_target_position` (
+ `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier',
+ `target_map` smallint(5) unsigned NOT NULL default '0',
+ `target_position_x` float NOT NULL default '0',
+ `target_position_y` float NOT NULL default '0',
+ `target_position_z` float NOT NULL default '0',
+ `target_orientation` float NOT NULL default '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System';
+
+--
+-- Dumping data for table `spell_target_position`
+--
+
+LOCK TABLES `spell_target_position` WRITE;
+/*!40000 ALTER TABLE `spell_target_position` DISABLE KEYS */;
+/*!40000 ALTER TABLE `spell_target_position` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `spell_threat`
+--
+
+DROP TABLE IF EXISTS `spell_threat`;
+CREATE TABLE `spell_threat` (
+ `entry` mediumint(8) unsigned NOT NULL,
+ `Threat` smallint(6) NOT NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
+
+--
+-- Dumping data for table `spell_threat`
+--
+
+LOCK TABLES `spell_threat` WRITE;
+/*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */;
+INSERT INTO `spell_threat` VALUES
+(78,20),
+(284,39),
+(285,59),
+(770,108),
+(778,108),
+(1608,78),
+(1672,180),
+(1715,61),
+(2139,300),
+(6343,17),
+(6572,155),
+(6574,195),
+(6809,89),
+(7372,101),
+(7373,141),
+(7379,235),
+(7386,100),
+(7405,140),
+(8198,40),
+(8204,64),
+(8205,96),
+(8380,180),
+(8972,118),
+(9745,148),
+(9749,108),
+(9880,178),
+(9881,207),
+(9907,108),
+(11556,43),
+(11564,98),
+(11565,118),
+(11566,137),
+(11567,145),
+(11580,143),
+(11581,180),
+(11596,220),
+(11597,261),
+(11600,275),
+(11601,315),
+(11775,395),
+(14274,200),
+(14921,415),
+(15629,300),
+(15630,400),
+(15631,500),
+(15632,600),
+(16857,108),
+(17735,200),
+(17750,300),
+(17751,450),
+(17752,600),
+(17390,108),
+(17391,108),
+(17392,108),
+(20569,100),
+(20736,100),
+(20925,20),
+(20927,30),
+(20928,40),
+(23922,160),
+(23923,190),
+(23924,220),
+(23925,250),
+(24394,580),
+(24583,5),
+(25225,300),
+(25231,130),
+(25258,286),
+(25264,215),
+(25269,400),
+(25286,175),
+(25288,355),
+(25289,60),
+(26993,127),
+(26996,176),
+(27011,127),
+(27179,54),
+(29704,230),
+(29707,196),
+(30324,220),
+(30356,323),
+(30357,483),
+(33745,285),
+(33878,129),
+(33986,180),
+(33987,232);
+/*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `transports`
+--
+
+DROP TABLE IF EXISTS `transports`;
+CREATE TABLE `transports` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `name` text,
+ `period` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports';
+
+--
+-- Dumping data for table `transports`
+--
+
+LOCK TABLES `transports` WRITE;
+/*!40000 ALTER TABLE `transports` DISABLE KEYS */;
+/*!40000 ALTER TABLE `transports` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2008-03-30 15:34:54
diff --git a/sql/realmd.sql b/sql/realmd.sql
index 24875890718..fcd7d166359 100644
--- a/sql/realmd.sql
+++ b/sql/realmd.sql
@@ -2,7 +2,7 @@
--
-- Host: localhost Database: realmd
-- ------------------------------------------------------
--- Server version 5.0.34-log
+-- Server version 5.0.45-Debian_1ubuntu3.1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -22,7 +22,7 @@
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
`id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Identifier',
- `username` varchar(32) NOT NULL,
+ `username` varchar(32) NOT NULL default '',
`sha_pass_hash` varchar(40) NOT NULL default '',
`gmlevel` tinyint(3) unsigned NOT NULL default '0',
`sessionkey` longtext,
@@ -41,7 +41,7 @@ CREATE TABLE `account` (
PRIMARY KEY (`id`),
UNIQUE KEY `idx_username` (`username`),
KEY `idx_gmlevel` (`gmlevel`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System';
+) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='Account System';
--
-- Dumping data for table `account`
@@ -49,6 +49,11 @@ CREATE TABLE `account` (
LOCK TABLES `account` WRITE;
/*!40000 ALTER TABLE `account` DISABLE KEYS */;
+/*INSERT INTO `account` VALUES
+(1,'ADMINISTRATOR','a34b29541b87b7e4823683ce6c7bf6ae68beaaac',3,'','0','0','','2006-04-25 10:18:56','127.0.0.1',0,0,'0000-00-00 00:00:00',0,0,0,0),
+(2,'GAMEMASTER','7841e21831d7c6bc0b57fbe7151eb82bd65ea1f9',2,'','0','0','','2006-04-25 10:18:56','127.0.0.1',0,0,'0000-00-00 00:00:00',0,0,0,0),
+(3,'MODERATOR','a7f5fbff0b4eec2d6b6e78e38e8312e64d700008',1,'','0','0','','2006-04-25 10:19:35','127.0.0.1',0,0,'0000-00-00 00:00:00',0,0,0,0),
+(4,'PLAYER','3ce8a96d17c5ae88a30681024e86279f1a38c041',0,'','0','0','','2006-04-25 10:19:35','127.0.0.1',0,0,'0000-00-00 00:00:00',0,0,0,0);*/
/*!40000 ALTER TABLE `account` ENABLE KEYS */;
UNLOCK TABLES;
@@ -83,11 +88,11 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `ip_banned`;
CREATE TABLE `ip_banned` (
`ip` varchar(32) NOT NULL default '127.0.0.1',
- `bandate` int(11) NOT NULL,
- `unbandate` int(11) NOT NULL,
+ `bandate` bigint(40) NOT NULL,
+ `unbandate` bigint(40) NOT NULL,
`bannedby` varchar(50) NOT NULL default '[Console]',
- `banreason` varchar(50) NOT NULL default 'no reason',
- PRIMARY KEY (`ip`)
+ `banreason` varchar(255) NOT NULL default 'no reason',
+ PRIMARY KEY (`ip`,`bandate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs';
--
@@ -100,6 +105,27 @@ LOCK TABLES `ip_banned` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `logs`
+--
+
+DROP TABLE IF EXISTS `logs`;
+CREATE TABLE `logs` (
+ `time` int(14) NOT NULL,
+ `realm` int(4) NOT NULL,
+ `type` int(4) NOT NULL,
+ `string` text
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `logs`
+--
+
+LOCK TABLES `logs` WRITE;
+/*!40000 ALTER TABLE `logs` DISABLE KEYS */;
+/*!40000 ALTER TABLE `logs` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `realmcharacters`
--
@@ -137,7 +163,7 @@ CREATE TABLE `realmlist` (
`population` float unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_name` (`name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System';
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System';
--
-- Dumping data for table `realmlist`
@@ -145,8 +171,33 @@ CREATE TABLE `realmlist` (
LOCK TABLES `realmlist` WRITE;
/*!40000 ALTER TABLE `realmlist` DISABLE KEYS */;
+INSERT INTO `realmlist` VALUES
+(1,'Trinity','127.0.0.1',8085,1,0,1,0,0);
/*!40000 ALTER TABLE `realmlist` ENABLE KEYS */;
UNLOCK TABLES;
+
+--
+-- Table structure for table `uptime`
+--
+
+DROP TABLE IF EXISTS `uptime`;
+CREATE TABLE `uptime` (
+ `realmid` int(11) unsigned NOT NULL,
+ `starttime` bigint(20) unsigned NOT NULL default '0',
+ `startstring` varchar(64) NOT NULL default '',
+ `uptime` bigint(20) unsigned NOT NULL default '0',
+ `maxplayers` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`realmid`,`starttime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system';
+
+--
+-- Dumping data for table `uptime`
+--
+
+LOCK TABLES `uptime` WRITE;
+/*!40000 ALTER TABLE `uptime` DISABLE KEYS */;
+/*!40000 ALTER TABLE `uptime` ENABLE KEYS */;
+UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -157,5 +208,5 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2008-10-14 13:28:11
+-- Dump completed on 2008-01-10 11:37:06
diff --git a/sql/tools/CMakeLists.txt b/sql/tools/CMakeLists.txt
index bcf0c7a8343..d69a6cdbd2b 100644
--- a/sql/tools/CMakeLists.txt
+++ b/sql/tools/CMakeLists.txt
@@ -1,4 +1,6 @@
########### install files ###############
-install(FILES characters_item_duplicates_remove.sql characters_pet_data_cleanup.sql README DESTINATION share/trinity/sql/tools)
+FILE(GLOB _SQL_TOOLS *.sql)
+
+install(FILES ${_SQL_TOOLS} README DESTINATION share/trinity/sql/tools)
diff --git a/sql/tools/Makefile.am b/sql/tools/Makefile.am
new file mode 100644
index 00000000000..c15007f86ed
--- /dev/null
+++ b/sql/tools/Makefile.am
@@ -0,0 +1,38 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## Change installation location
+# datadir = trinity/sql/tools
+pkgdatadir = $(datadir)/trinity/sql/tools
+
+## Files to be installed
+# Install basic SQL files to datadir
+pkgdata_DATA = \
+ characters_item_duplicates_remove.sql \
+ characters_pet_data_cleanup.sql \
+ README
+
+## Additional files to include when running 'make dist'
+EXTRA_DIST = \
+ characters_item_duplicates_remove.sql \
+ characters_pet_data_cleanup.sql \
+ README
diff --git a/sql/trinityscript_script_texts.sql b/sql/trinityscript_script_texts.sql
index b2d0e8c1471..0fa44dca7c3 100644
--- a/sql/trinityscript_script_texts.sql
+++ b/sql/trinityscript_script_texts.sql
@@ -26,20 +26,331 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1000104,'%s coming in fast! Prepare to fight!',0,0,7,'defias traitor SAY_AGGRO_1'),
(-1000105,'Help!',0,0,7,'defias traitor SAY_AGGRO_2');
+-- 722_world_scripts.sql
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1000140,'Let\'s go.',0,0,1,'lilatha SAY_START'),
+(-1000141,'$N, let\'s use the antechamber to the right.',0,0,1,'lilatha SAY_PROGRESS1'),
+(-1000142,'I can see the light at the end of the tunnel!',0,0,1,'lilatha SAY_PROGRESS2'),
+(-1000143,'There\'s Farstrider Enclave now, $C. Not far to go... Look out! Troll ambush!!',0,0,1,'lilatha SAY_PROGRESS3'),
+(-1000144,'Thank you for saving my life and bringing me back to safety, $N',0,0,1,'lilatha SAY_END1'),
+(-1000145,'Captain Helios, I\'ve been rescued from the Amani Catacombs. Reporting for duty, sir!',0,0,1,'lilatha SAY_END2'),
+(-1000146,'Liatha, get someone to look at those injuries. Thank you for bringing her back safely.',0,0,1,'lilatha CAPTAIN_ANSWER');
+
+-- 773_world_scripts.sql
+INSERT INTO script_texts (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `comment`) VALUES
+(-1000147, 'Lets go $N. I am ready to start to Whitereach Post.', NULL, NULL, 'Gehen wir $N.Ich bin bereit,mich zum Weissgipfelposten aufzumachen.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL),
+(-1000148, 'This seems to me trusted. If we move to the east, we are probably... Aah! Wyvern attack !', NULL, NULL, 'Das kommt mir vertraut vor.Wenn wir nach Osten ziehen,können wir wahrscheinlich...Aah!Flügeldrachen im Angriff!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL),
+(-1000149, 'Thanks so much... From here I find the way back to the Whitereach Post. Speak with Motega Firemane, maybe you can persuade him to send me home.', NULL, NULL, 'Tausend Dank...Von hier aus finde ich den Rückweg zum Weissgipfelposten.Sprecht unbedingt mit Motega Feuermähne,vielleicht könnt ihr ihn überreden,mich nach Hause zu schicken.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL);
+
+-- 765_world_scripts.sql
+INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc2`, `type`, `language`, `comment`) VALUES
+(-1000150, 'Greetings, $N. I will guide you through the cavern. Please try and keep up.', 'Salutations, $N. Je vais vous guider a` travers cette grotte. Veuillez me suivre.', 4, 0, 'WHISPER_CUSTODIAN_1'),
+(-1000151, 'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.', 'Nous ne savons pas si les Grottes du Temps ont toujours été accessibles aux mortels. Vraiment, c\'est impossible a` dire étant donné que l\'Intemporel est en mouvement perpétuel, changeant nos spirales temporelles comme bon lui semble. Ce que vous voyez aujourd\'hui peut tre`s bien ne plus exister demain. Vous pourriez vous réveiller sans aucun souvenir de cet endroit.', 4, 0, 'WHISPER_CUSTODIAN_2'),
+(-1000152, 'It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality.', 'C\'est étrange, je sais... La plupart des mortels ne peuvent pas réellement comprendre ce qu\ils voient ici, comme souvent, ce qu\'ils voient n\'est pas ancré dans leur propre perception de la réalité.', 4, 0, 'WHISPER_CUSTODIAN_3'),
+(-1000153, 'Follow me, please.', 'Veuillez me suivre.', 4, 0, 'WHISPER_CUSTODIAN_4'),
+(-1000154, 'There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality.', 'Il n\'y a que deux vérités qui peuvent e^tre trouvées ici : premie`rement, ce temps est chaotique, toujours en mouvement, et comple`tement malléable, et ensuite, la perception ne détermine pas la réalité.', 4, 0, 'WHISPER_CUSTODIAN_5'),
+(-1000155, 'As custodians of time, we watch over and care for Nozdormu\'s realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard.', 'En tant que protecteurs du temps, nous observons et veillons sur le royaume de Nozdormu. Le maître est absent en ce moment, ce qui signifie que des tentatives sont faites pour altérer fortement le temps. Le maître ne se me^le jamais des affaires des mortels mais il corrige les altérations faites au temps par d\'autres. Il est réactionnaire a` cet égard.', 4, 0, 'WHISPER_CUSTODIAN_6'),
+(-1000156, 'For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present.', 'Pour le maintien normal du temps, les Gardiens du temps suffisent a` la tâche. Nous sommes capables de gérer les perturbations les plus ordinaires. Je parle de petites choses, comme des mages voleurs qui changent quelque chose dans le passé pour élever leur statut ou leur richesse dans le présent.', 4, 0, 'WHISPER_CUSTODIAN_7'),
+(-1000157, 'These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as \'trouble spots.\' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one...', 'Ces tunnels que vous voyez sont appelés Voies Temporelles. Leur nombre est infini. Ceux qui existent actuellement dans votre réalité sont ceux que le maître a considérés comme \'points sensibles\'. Ces points sensibles peuvent différer comple`tement de part leur the`me, mais partagent toujours une cause. C\'est-a`-dire, leur existence est le résultat des me^mes perturbations temporelles. Rappelez-vous en si vous osez vous aventurer dans l\'un d\'eux...', 4, 0, 'WHISPER_CUSTODIAN_8'),
+(-1000158, 'This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall\'s freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost.', 'Cette voie temporelle est en grand désarroi ! Nous avons actuellement des agents a` l\intérieur qui tentent de restaurer l\'ordre. Les informations que j\'ai indiquent que la liberté de Thrall est en péril. Une organisation malveillante connue sous le nom de Vol du Dragon Infini essaye d\'empe^cher son évasion. J\'ai peur que sans assistance extérieure, tout soit perdu.', 4, 0, 'WHISPER_CUSTODIAN_9'),
+(-1000159, 'We have very little information on this timeway. Sa\'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not...', 'Nous avons tre`s peu d\'informations sur cette voie. Sa\'at a été envoyé et est actuellement sur place. Les données que nous avons recueillies de sa correspondance est que le Vol du Dragon Infini tente une fois de plus d\'altérer le temps. Se pourrait-il que l\'ouverture de la Porte des Téne`bres soit la cible d\'un sabotage. Espérons que non...', 4, 0, 'WHISPER_CUSTODIAN_10'),
+(-1000160, 'This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown...', 'Cette voie est en train de s\'effondrer. Ce qu\'elle peut avoir contenu dans le passé, le présent et le futur nous est actuellement inconnu...', 4, 0, 'WHISPER_CUSTODIAN_11'),
+(-1000161, 'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.', 'Les voies sont pour le moment classées de la moins catastrophique a` la plus catastrophique, ce qui veut dire que la moindre de celles-ci qui s\'effondre signifierait la fin de votre monde. Nous les classons seulement de cette façon pour que les héros et aventuriers qui y sont envoyés sachent quelle voie est la plus adaptée a` leurs compétences.', 4, 0, 'WHISPER_CUSTODIAN_12'),
+(-1000162, 'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.', 'Tout ce que nous savons sur cette voie temporelle est qu\'elle me`ne au Mont Hyjal. Le Vol du Dragon Infini s\'est donné beaucoup de peine pour empe^cher notre participation. Soridormi est actuellement en train de tenter de briser les défenses de cette voie, mais ses efforts ont été vain jusqu\'ici. Vous pourriez e^tre notre seul espoir de les briser et de résoudre le conflit.', 4, 0, 'WHISPER_CUSTODIAN_13'),
+(-1000163, 'Our time is at an end $N. I would wish you luck, if such a thing existed.', 'Notre entretien touche a` sa fin, $N. Je vous souhaite bonne chance, si tant est qu\'une telle chose a jamais existé.', 4, 0, 'WHISPER_CUSTODIAN_14');
+
+-- 2139_world_scripts.sql
+(-1000164,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,0,2,'garments SAY_COMMON_HEALED'),
+(-1000165,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!',0,0,1,1,'garments SAY_DG_KEL_THANKS'),
+(-1000166,'Farewell to you, and may shadow always protect you!',0,0,1,3,'garments SAY_DG_KEL_GOODBYE'),
+(-1000167, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,1,'garments SAY_ROBERTS_THANKS'),
+(-1000168, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'),
+(-1000169, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,1,'garments SAY_KORJA_THANKS'),
+(-1000170, 'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'),
+(-1000171, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,1,'garments SAY_DOLF_THANKS'),
+(-1000172, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'),
+(-1000173, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,1,'garments SAY_SHAYA_THANKS'),
+(-1000174, 'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE');
+
+-- 817_world_scripts.sql
+INSERT INTO script_texts (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
+(-1000200, 'A-Me good.Good A-me.Follow...A-ME follow.Home.A-ME go home.', NULL, NULL, 'A-ME gut.Gut A-Me.Folgen...Heim.A-ME geht heim.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1000201, 'Bad Un´Goro Stomper.Stomper evil.', NULL, NULL, 'Böser Stampfer von Un´Goro. Stampfer von Un´Goro böse.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1000202, 'Good..good,A-ME. Home. Search way.', NULL, NULL, 'Gut...gut.A-ME.A-ME gut.Heim.Heim suchen.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1000203, 'A-Me home.A-ME go home!Tar Lord dont disturb A-ME.', NULL, NULL, 'A-ME daheim.A-ME geht heim!Teerfürst A-ME nicht aufhalten.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1000204, 'Tar Lord A-ME no hurt.A-ME good.', NULL, NULL, 'Teerfürst A-ME nicht wehtun.A-ME gut.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1000205, 'A-ME at home!A-ME good!Good A-ME.At home.Home.Home', NULL, NULL, 'A-ME daheim!A-ME gut!Gute A-ME.Daheim.Daheim.Daheim', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL);
+
+-- 945_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+(-1000206, 'Come, $N. Lord Stormrage awaits.', 0, 1, 'OVERLORD_SAY_1'),
+(-1000207, 'Lord Illidan will be here shortly.', 0, 1, 'OVERLORD_SAY_2'),
+(-1000208, 'Lord Illidan, this is the Dragonmaw that I, and others, have told you about. He will lead us to victory!', 0, 1, 'OVERLORD_SAY_3'),
+(-1000209, 'But... My lord, I do not understand. $N... He is the orc that has...', 0, 1, 'OVERLORD_SAY_4'),
+(-1000210, 'It will be done, my lord.', 0, 1, 'OVERLORD_SAY_5'),
+(-1000211, 'So you thought to make a fool of Mor\'ghor, eh? Before you are delivered to Lord Illidan, you will feel pain that you could not know to exist. I will take pleasure in exacting my own vengeance.', 0, 25, 'OVERLORD_SAY_6'),
+(-1000212, 'Warriors of Dragonmaw, gather \'round! One among you has attained the rank of highlord! Bow your heads in reverence! Show your respect and allegiance to Highlord $N!', 1, 22, 'OVERLORD_YELL_1'),
+(-1000213, 'All hail Lord Illidan!', 1, 66, 'OVERLORD_YELL_2'),
+(-1000214, 'What is the meaning of this, Mor\'ghor?', 0, 1, 'LORD_ILLIDAN_SAY_1'),
+(-1000215, 'SILENCE!', 0, 22, 'LORD_ILLIDAN_SAY_2'),
+(-1000216, 'Blathering idiot. You incomprehensibly incompetent buffoon...', 0, 1, 'LORD_ILLIDAN_SAY_3'),
+(-1000217, 'THIS is your hero?', 0, 6, 'LORD_ILLIDAN_SAY_4'),
+(-1000218, 'You have been deceived, imbecile.', 0, 1, 'LORD_ILLIDAN_SAY_5'),
+(-1000219, 'This... whole... operation... HAS BEEN COMPROMISED!', 0, 22, 'LORD_ILLIDAN_SAY_6'),
+(-1000220, 'I expect to see this insect\'s carcass in pieces in my lair within the hour. Fail and you will suffer a fate so much worse than death.', 0, 1, 'LORD_ILLIDAN_SAY_7'),
+(-1000221, 'You will not harm the boy, Mor\'ghor! Quickly, $N, climb on my back!', 0, 22, 'YARZILL_THE_MERC_SAY');
+
+DELETE FROM script_texts WHERE entry='-1000222';
+INSERT INTO script_texts (entry, content_default, type, language, emote, comment) VALUES
+(-1000222, 'Thank you, mortal.', 0, 11, 1, 'SAY_JUST_EATEN');
+
+DELETE FROM script_texts WHERE entry BETWEEN -1000234 and -1000223;
+INSERT INTO script_texts (entry, content_default, emote, comment) VALUES
+(-1000223, 'I sense the tortured spirits, $N. They are this way, come quickly!', 1, 'SAY_START'),
+(-1000224, 'Watch out!', 0, 'SAY_AGGRO1'),
+(-1000225, 'Naga attackers! Defend yourself!', 0, 'SAY_AGGRO2'),
+(-1000226, 'Kill them all!', 0, 'ASSASSIN_SAY_AGGRO1'),
+(-1000227, 'You will never essscape Coilssskarrr...', 0, 'ASSASSIN_SAY_AGGRO2'),
+(-1000228, 'Grant me protection $N, i must break trough their foul magic!', 0, 'SAY_PROGRESS1'),
+(-1000229, 'The naga of Coilskar are exceptionally cruel to their prisoners. It is a miracle that I survived inside that watery prison for as long as I did. Earthmother be praised.', 0, 'SAY_PROGRESS2'),
+(-1000230, 'Now we must find the exit.', 0, 'SAY_PROGRESS3'),
+(-1000231, 'Lady Vashj must answer for these atrocities. She must be brought to justice!', 0, 'SAY_PROGRESS4'),
+(-1000232, 'The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits.', 0, 'SAY_PROGRESS5'),
+(-1000233, 'It shouldn\'t be much further, $N. The exit is just up ahead.', 0, 'SAY_PROGRESS6'),
+(-1000234, 'Thank you, $N. Please return to my brethren at the Altar of Damnation, near the Hand of Gul\'dan, and tell them that Wilda is safe. May the Earthmother watch over you...', 0, 'SAY_END');
+
+-- 947_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+(-1000235, 'Ok, $N. Follow me to the cave where I\'ll attempt to harness the power of the rune stone into these goggles.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_1'),
+(-1000236, 'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_2'),
+(-1000237, 'I\'ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_3'),
+(-1000238, 'begins tinkering with the goggles before the stone.', 2, 0, 'phizzlethorpe - EMOTE_PROGRESS_4'),
+(-1000239, 'Help!!! Get these things off me so I can get my work done!', 0, 0, 'SAY_AGGRO'),
+(-1000240, 'Almost done! Just a little longer!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_5'),
+(-1000241, 'I\'ve done it! I have harnessed the power of the stone into the goggles! Let\'s get out of here!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_6'),
+(-1000242, 'Phew! Glad to be back from that creepy cave.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_7'),
+(-1000243, 'hands one glowing goggles over to Doctor Draxlegauge.', 2, 0, 'phizzlethorpe - EMOTE_PROGRESS_8'),
+(-1000244, 'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_9');
+
+-- 948_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000245, 'You, there! Hand over that moonstone and nobody gets hurt!', 1, 'SAY_RIZZLE_START'),
+(-1000246, 'Just chill!', 4, 'SAY_RIZZLE_GRENADE'),
+(-1000247, 'All right, you win! I surrender! Just don\'t hurt me!', 1, 'SAY_RIZZLE_FINAL');
+
+-- 950_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+(-1000248, 'The last thing I remember is the ship falling and us getting into the pods. I\'ll go see how I can help. Thank you!', 0, 0, 'draenei survivor - HEAL1'),
+(-1000249, '$C, Where am I? Who are you? Oh no! What happened to the ship?.', 0, 0, 'draenei survivor - HEAL2'),
+(-1000250, '$C You saved me! I owe you a debt that I can never repay. I\'ll go see if I can help the others.', 0, 0, 'draenei survivor - HEAL3'),
+(-1000251, 'Ugh... what is this place? Is that all that\'s left of the ship over there?', 0, 0, 'draenei survivor - HEAL4'),
+(-1000252, 'Oh, the pain...', 0, 0, 'draenei survivor - HELP1'),
+(-1000253, 'Everything hurts, Please make it stop...', 0, 0, 'draenei survivor - HELP2'),
+(-1000254, 'Ughhh... I hurt. Can you help me?', 0, 0, 'draenei survivor - HELP3'),
+(-1000255, 'I don\'t know if I can make it, please help me...', 0, 0, 'draenei survivor - HELP4'),
+
+(-1000256, 'Yes Master, all goes along as planned.', 0, 1, 'overgrind - SAY_TEXT'),
+(-1000257, 'puts the shell to his ear.', 2, 0, 'overgrind - SAY_EMOTE'),
+(-1000258, 'Now I cut you!', 1, 0, 'overgrind - YELL_ATTACK'),
+
+(-1000259, 'What\'s the big idea, Spark?', 0, 0, 'geezle - GEEZLE_SAY_1'),
+(-1000260, 'What\'s the big idea? You nearly blew my cover, idiot! I told you to put the compass and navigation maps somewhere safe - not out in the open for any fool to discover.', 0, 0, 'geezle - SPARK_SAY_2'),
+(-1000261, 'The Master has gone to great lengths to secure information about the whereabouts of the Exodar. You could have blown the entire operation, including the cover of our spy on the inside.', 0, 0, 'geezle - SPARK_SAY_3'),
+(-1000262, 'Relax, Spark! I have it all under control. We\'ll strip mine the Exodar right out from under \'em - making both you and I very, very rich in the process.', 0, 0, 'geezle - GEEZLE_SAY_4'),
+(-1000263, 'Relax? Do you know what Kael\'thas does to those that fail him, Geezle? Eternal suffering and pain... Do NOT screw this up, fool.', 0, 0, 'geezle - SPARK_SAY_5'),
+(-1000264, 'Our Bloodmyst scouts have located our contact. The fool, Velen, will soon leave himself open and defenseless -- long enough for us to strike! Now get out of my sight before I vaporize you...', 0, 0, 'geezle - SPARK_SAY_6'),
+(-1000265, 'Yes, sir. It won\'t happen again...', 0, 0, 'geezle - GEEZLE_SAY_7'),
+(-1000266, 'picks up the naga flag.', 2, 0, 'geezle - EMOTE_SPARK');
+
+-- 951_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000267, 'Ready when you are, warrior.', 1, 'flathead - SAY_BIG_WILL_READY'),
+(-1000268, 'The Affray has begun, get ready to fight!', 1, 'flathead - SAY_TWIGGY_FLATHEAD_BEGIN'),
+(-1000269, 'You! Enter the fray!', 1, 'flathead - SAY_TWIGGY_FLATHEAD_FRAY'),
+(-1000270, 'Challenger is down!', 1, 'flathead - SAY_TWIGGY_FLATHEAD_DOWN'),
+(-1000271, 'The Affray is over.', 1, 'flathead - SAY_TWIGGY_FLATHEAD_OVER'),
+
+(-1000272, 'Alright, alright I think I can figure out how to operate this thing...', 0, 'shredder - SAY_PROGRESS_1'),
+(-1000273, 'Arrrgh! This isn\'t right!', 0, 'shredder - SAY_PROGRESS_2'),
+(-1000274, 'Okay, I think I\'ve got it, now. Follow me, $N!', 0, 'shredder - SAY_PROGRESS_3'),
+(-1000275, 'There\'s the stolen shredder! Stop it or Lugwizzle will have our hides!', 1, 'shredder - SAY_MERCENARY_4'),
+(-1000276, 'Looks like we\'re out of woods, eh? Wonder what this does...', 0, 'shredder - SAY_PROGRESS_5'),
+(-1000277, 'Come on, don\'t break down on me now!', 0, 'shredder - SAY_PROGRESS_6'),
+(-1000278, 'That was a close one! Well, let\'s get going, it\'s still a ways to Ratchet!', 0, 'shredder - SAY_PROGRESS_7'),
+(-1000279, 'Hmm... I don\'t think this blinking red light is a good thing...', 0, 'shredder - SAY_PROGRESS_8');
+
+-- 952_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES
+(-1000280, 'Thank you, dear Paladin, you just saved my life.', 0, 7, 'faulk - SAY_HEAL'),
+
+(-1000281, 'Very well. Let\'s see what you have to show me, $N.', 0, 0, 'anvilvard - SAY_PR_1'),
+(-1000282, 'What manner of trick is this, $R? If you seek to ambush me, I warn you I will not go down quietly!', 0, 0, 'anvilvard - SAY_PR_2'),
+(-1000283, 'releases the last of its energies into the nerarby runestone, succesfully reactivating it.', 2, 0, 'crystal - EMOTE'),
+
+(-1000284, 'Deployment sucessful. Trespassers will be neutralized.', 0, 0, 'sentry - SAY_CONVERTED_1'),
+(-1000285, 'Objective acquired. Initiating security routines.', 0, 0, 'sentry - SAY_CONVERTED_1');
+
+-- 953_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+(-1000286, 'A shadowy, sinister presence has invader the Emerald Dream. Its power is poised to spill over into our world, $N. We must oppose it! That\'s why I cannot accompany you in person.', 0, 0, 'clintar_spirit'),
+(-1000287, 'The Emerald Dream will never be yours!', 0, 0, 'clintar_spirit'),
+(-1000288, 'Begone from this place!', 0, 0, 'clintar_spirit'),
+(-1000289, 'That\'s the first relic, but there are still two more. Follow me, $N.', 0, 0, 'clintar_spirit'),
+(-1000290, 'I\'ve recovered the second relic. Take a moment to rest, and then we\'ll continue to the last reliquary.', 0, 0, 'clintar_spirit'),
+(-1000291, 'We have all three of the relics, but my energy is rapidly fading. We must make our way back to Dreamwarden Lurosa! He will let you know what to do next.', 0, 0, 'clintar_spirit'),
+(-1000292, 'Lurosa, I am entrusting the Relics of Aviana to $N, who will take them to Morthis Whisperwing. I must return completely to the Emerald Dream now. Do not let $N fail!', 0, 0, 'clintar_spirit');
+
+-- 954_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000293, 'In Nagrand, food hunt ogre!', 0, 'LUMP_SAY0'),
+(-1000294, 'You taste good with maybe a little salt and pepper.', 0, 'LUMP_SAY1'),
+(-1000295, 'OK, OK! Lump give up!', 0, 'LUMP_DEFEAT'),
+
+(-1000296, 'Warning! Emergency shutdown process initiated by $N. Shutdown will complete in two minutes.', 2, 'npc_manaforge_control_console - EMOTE_START'),
+(-1000297, 'Emergency shutdown will complete in one minute.', 2, 'npc_manaforge_control_console - EMOTE_60'),
+(-1000298, 'Emergency shutdown will complete in thirty seconds.', 2, 'npc_manaforge_control_console - EMOTE_30'),
+(-1000299, 'Emergency shutdown will complete in ten seconds.', 2, 'npc_manaforge_control_console - EMOTE_10'),
+(-1000300, 'Emergency shutdown complete.', 2, 'npc_manaforge_control_console - EMOTE_COMPLETE'),
+(-1000301, 'Emergency shutdown aborted.', 2, 'npc_manaforge_control_console - EMOTE_ABORT'),
+
+(-1000302, 'Saeed is currently engaged or awaiting orders to engage. You may check directly east of me and see if Saeed is ready for you. If he is not present then he is off fighting another battle. I recommend that you wait for him to return before attacking Dimensius.', 4, 'npc_professor_dabiri - WHISPER_DABIRI'),
+
+(-1000303, 'is very weak', 2, 'mob_phase_hunter - EMOTE_WEAK'),
+
+(-1000304, 'Bessy, is that you?', 0, 'npc_bessy- SAY_THADELL_1'),
+(-1000305, 'Thank you for bringing back my Bessy, $N. I couldn\'t live without her!', 0, 'npc_bessy- SAY_THADELL_2');
+
+-- 955_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000306, 'Follow me, stranger. This won\'t take long.', 0, 'npc_kservant - SAY1'),
+(-1000307, 'Shattrath was once the draenei capital of this world. Its name means \"dwelling of light.\"', 4, 'npc_kservant - WHISP1'),
+(-1000308, 'When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell.', 4, 'npc_kservant - WHISP2'),
+(-1000309, 'The city was left in ruins and darkness... until the Sha\'tar arrived.', 4, 'npc_kservant - WHISP3'),
+(-1000310, 'Let us go into the Lower City. I will warn you that as one of the only safe havens in Outland, Shattrath has attracted droves of refugees from all wars, current and past.', 4, 'npc_kservant - WHISP4'),
+(-1000311, 'The Sha\'tar, or \"born from light\" are the naaru that came to Outland to fight the demons of the Burning Legion.', 4, 'npc_kservant - WHISP5'),
+(-1000312, 'They were drawn to the ruins of Shattrath City where a small remnant of the draenei priesthood conducted its rites inside a ruined temple on this very spot.', 4, 'npc_kservant - WHISP6'),
+(-1000313, 'The priesthood, known as the Aldor, quickly regained its strength as word spread that the naaru had returned and reconstruction soon began. The ruined temple is now used as an infirmary for injured refugees.', 4, 'npc_kservant - WHISP7'),
+(-1000314, 'It wouldn\'t be long, however, before the city came under attack once again. This time, the attack came from Illidan\'s armies. A large regiment of blood elves had been sent by Illidan\'s ally, Kael\'thas Sunstrider, to lay waste to the city.', 4, 'npc_kservant - WHISP8'),
+(-1000315, 'As the regiment of blood elves crossed this very bridge, the Aldor\'s exarchs and vindicators lined up to defend the Terrace of Light. But then the unexpected happened.', 4, 'npc_kservant - WHISP9'),
+(-1000316, 'The blood elves laid down their weapons in front of the city\'s defenders; their leader, a blood elf elder known as Voren\'thal, stormed into the Terrace of Light and demanded to speak to A\'dal.', 4, 'npc_kservant - WHISP10'),
+(-1000317, 'As the naaru approached him, Voren\'thal kneeled before him and uttered the following words: \"I\'ve seen you in a vision, naaru. My race\'s only hope for survival lies with you. My followers and I are here to serve you.\"', 4, 'npc_kservant - WHISP11'),
+(-1000318, 'The defection of Voren\'thal and his followers was the largest loss ever incurred by Kael\'s forces. And these weren\'t just any blood elves. Many of the best and brightest amongst Kael\'s scholars and magisters had been swayed by Voren\'thal\'s influence.', 4, 'npc_kservant - WHISP12'),
+(-1000319, 'The naaru accepted the defectors, who would become known as the Scryers; their dwelling lies in the platform above. Only those initiated with the Scryers are allowed there.', 4, 'npc_kservant - WHISP13'),
+(-1000320, 'The Aldor are followers of the Light and forgiveness and redemption are values they understand. However, they found hard to forget the deeds of the blood elves while under Kael\'s command.', 4, 'npc_kservant - WHISP14'),
+(-1000321, 'Many of the priesthood had been slain by the same magisters who now vowed to serve the naaru. They were not happy to share the city with their former enemies.', 4, 'npc_kservant - WHISP15'),
+(-1000322, 'The Aldor\'s most holy temple and its surrounding dwellings lie on the terrace above. As a holy site, only the initiated are welcome inside.', 4, 'npc_kservant - WHISP16'),
+(-1000323, 'The attacks against Shattrath continued, but the city did not fall, as you can see. On the contrary, the naaru known as Xi\'ri led a successful incursion into Shadowmoon Valley - Illidan\'s doorstep.', 4, 'npc_kservant - WHISP17'),
+(-1000324, 'There he continues to wage war on Illidan with the assistance of the Aldor and the Scryers. The two factions have not given up on their old feuds, though.', 4, 'npc_kservant - WHISP18'),
+(-1000325, 'Such is their animosity that they vie for the honor of being sent to assist the naaru there. Each day, that decision is made here by A\'dal. The armies gather here to receive A\'dal\'s blessing before heading to Shadowmoon.', 4, 'npc_kservant - WHISP19'),
+(-1000326, 'Khadgar should be ready to see you again. Just remember that to serve the Sha\'tar you will most likely have to ally with the Aldor or the Scryers. And seeking the favor of one group will cause the others\' dislike.', 4, 'npc_kservant - WHISP20'),
+(-1000327, 'Good luck stranger, and welcome to Shattrath City.', 4, 'npc_kservant - WHISP21'),
+(-1000328, 'Time to teach you a lesson in manners, little boy!', 0, ''),
+(-1000329, 'Now I\'m gonna give you to the count of \'3\' to get out of here before I sick the dogs on you.', 0, ''),
+(-1000330, '1...', 0, ''),
+(-1000331, '2...', 0, ''),
+(-1000332, 'Time to meet your maker!', 0, ''),
+(-1000333, 'Alright, we give up! Don\'t hurt us!', 0, '');
+
+DELETE FROM script_texts WHERE entry=-1000334;
+INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES
+(-1000334, 'Thank you, dear Paladin, you just saved my life.', 0, 10, 'stillblade - SAY_HEAL');
+
+DELETE FROM script_texts WHERE entry BETWEEN -1000349 and -1000335;
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000335, 'Let\'s get to the others, and keep an eye open for those wolves cutside...', 0, 'npc_deathstalker_erland
+- SAY_QUESTACCEPT'),
+(-1000336, 'Be careful, $N. Those wolves like to hide among the trees.', 0, 'npc_deathstalker_erland - SAY_START'),
+(-1000337, 'A $C attacks!', 0, 'npc_deathstalker_erland - SAY_AGGRO_1'),
+(-1000338, 'Beware! I am under attack!', 0, 'npc_deathstalker_erland - SAY_AGGRO_2'),
+(-1000339, 'We\'re almost there!', 0, 'npc_deathstalker_erland - SAY_LAST'),
+(-1000340, 'We made it! Thanks, $N. I couldn\'t have gotten without you.', 0, 'npc_deathstalker_erland - SAY_THANKS'),
+(-1000341, 'It\'s good to see you again, Erland. What is your report?', 0, 'npc_deathstalker_erland - SAY_RANE'),
+(-1000342, 'Masses of wolves are to the east, and whoever lived at Malden\'s Orchard is gone.', 0, 'npc_deathstalker_erland - SAY_ANSWER'),
+(-1000343, 'If I am excused, then I\'d like to check on Quinn...', 0, 'npc_deathstalker_erland - SAY_MOVE_QUINN'),
+(-1000344, 'Hello, Quinn. How are you faring?', 0, 'npc_deathstalker_erland - SAY_GREETINGS'),
+(-1000345, 'I\'ve been better. Ivar the Foul got the better of me...', 0, 'npc_deathstalker_erland - SAY_QUINN'),
+(-1000346, 'Try to take better care of yourself, Quinn. You were lucky this time.', 0, 'npc_deathstalker_erland - SAY_ON_BYE'),
+(-1000347, 'Let\'s go before they find out I\'m free!', 0, 'npc_kaya_flathoof - SAY_START'),
+(-1000348, 'Look out! We\'re under attack!', 0, 'npc_kaya_flathoof - SAY_AMBUSH'),
+(-1000349, 'Thank you for helping me. I know my way back from here.', 0, 'npc_kaya_flathoof - SAY_END');
+
+-- 956_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000350, 'Who dares awaken Aquementas?', 1, 'mob_aquementas - AGGRO_YELL_AQUE'),
+(-1000351, 'I give up! Please don\'t kill me!', 0, 'mob_unkor_the_ruthless - SAY_SUBMIT'),
+(-1000352, 'I choose the third option: KILLING YOU!', 0, 'npc_floon - SAY_FLOON_ATTACK'),
+(-1000353, 'Ok let\'s get out of here!', 0, 'npc_isla_starmane - SAY_PROGRESS_1'),
+(-1000354, 'You sure you\'re ready? Take a moment.', 0, 'npc_isla_starmane - SAY_PROGRESS_2'),
+(-1000355, 'Alright, let\'s do this!', 0, 'npc_isla_starmane - SAY_PROGRESS_3'),
+(-1000356, 'Ok, I think I can make it on my own from here. Thank you so much for breaking me out of there!', 0, 'npc_isla_starmane - SAY_PROGRESS_4'),
+(-1000357, 'Belore...', 0, 'npc_lady_sylvanas_windrunner - SAY_LAMENT_END'),
+(-1000358, 'kneels down and pick up the amulet.', 2, 'npc_lady_sylvanas_windrunner - EMOTE_LAMENT_END'),
+(-1000359, 'You have my blessing', 0, 'npcs_ashyen_and_keleth - GOSSIP_REWARD_BLESS'),
+(-1000360, 'Is the way clear? Let\'s get out while we can, $N.', 0, 'npc_kayra_longmane - SAY_PROGRESS_1'),
+(-1000361, 'Looks like we won\'t get away so easy. Get ready!', 0, 'npc_kayra_longmane - SAY_PROGRESS_2'),
+(-1000362, 'Let\'s keep moving. We\'re not safe here!', 0, 'npc_kayra_longmane - SAY_PROGRESS_3'),
+(-1000363, 'Look out, $N! Enemies ahead!', 0, 'npc_kayra_longmane - SAY_PROGRESS_4'),
+(-1000364, 'We\'re almost to the refuge! Let\'s go.', 0, 'npc_kayra_longmane - SAY_PROGRESS_5'),
+(-1000365, 'I can see my fellow druids from here. Thank you, $N. I\'m sure Ysiel will reward you for your actions!', 0, 'npc_kayra_longmane - SAY_PROGRESS_6');
+
+-- 963_world_scripts.sql
+INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+(-1000366, 'So you have defeated the Crimson Sigil. You now seek to challenge my rule? Not even Arthas could defeat me, yet you dare to even harbor such thoughts? Then I say to you, come! Come $N! The Black Temple awaits...', 1, 'Quest: Battle of the crimson watch - END_TEXT'),
+
+(-1000367, 'At your command, my liege...', 0, 'TorlothAnim - First'),
+(-1000368, 'Destroy them, Torloth. Let lose their blood like a river upon this hallowed ground.', 0, 'Quest: Battle of the crimson watch TorlothAnim - Second'),
+(-1000369, 'As you desire, Lord Illidan.', 0, 'Quest: Battle of the crimson watch TorlothAnim - Third'),
+(-1000370, 'Yes, Lord Illidan, I would sacrifice to you this magnificent physique. On this day you will fall - another victim of Torloth...', 0, 'Quest: Battle of the crimson watch TorlothAnim - Fourth'),
+
+(-1000371, 'What manner of fool dares stand before Illidan Stormrage? Soldiers, destroy these insects!', 1, 'Quest: Battle of the crimson watch WavesInfo - First'),
+(-1000372, 'You are no challenge for the Crimson Sigil. Mind breakers, end this nonsense.', 1, 'Quest: Battle of the crimson watch WavesInfo - Second'),
+(-1000373, 'Run while you still can. The highlords come soon...', 1, 'Quest: Battle of the crimson watch WavesInfo - Third'),
+(-1000374, 'Torloth your master calls!', 1, 'Quest: Battle of the crimson watch WavesInfo - Fourth');
+
-- -1 033 000 SHADOWFANG KEEP
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
(-1033000,'Thanks for freeing me, I\'ll open this door for you, then I will get out of here.',0,0,0,'shadowfang_prisoner SAY_FREE');
-- -1 034 000 STOCKADES
-
-- -1 036 000 DEADMINES
+-- -1 574 000 UTGARDE KEEP
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1574000, 'Your blood is mine!',13221,1,0,'keleseth SAY_AGGRO'),
+(-1574001, 'Darkness waits',13223,1,0, 'keleseth SAY_KILL'),
+(-1574002, 'I join... the night.',13225,1,0, 'keleseth SAY_DEATH'),
+(-1574003, 'Not so fast.',13222,1,0, 'keleseth SAY_FROST_TOMB'),
+(-1574004, 'Aranal, lidel! Their fate shall be yours!',13224,1,0, 'keleseth SAY_SKELETONS');
+
-- -1 043 000 WAILING CAVERNS
-- -1 047 000 RAZORFEN KRAUL
+INSERT INTO script_texts (entry, content_default, sound, type, language, comment) VALUES
+(-1047000, 'Phew! Finally,out here. However, it will not become easy. Detain your eyes after annoyance.', 0, 0, 0, 'Willix'),
+(-1047001, 'There on top resides Charlga Razorflank. The damned old Crone.', 0, 0, 0, 'Willix'),
+(-1047002, 'Help! Get this Raging Agam\'ar from me!', 0, 0, 0, 'Willix'),
+(-1047003, 'In this ditch there are Blueleaf Tuber! As if the gold waited only to be dug out, I say it you!', 0, 0, 0, 'Willix'),
+(-1047004, 'Danger is behind every corner.', 0, 0, 0, 'Willix'),
+(-1047005, 'I do not understand how these disgusting animals can live at such a place.... puh as this stinks!', 0, 0, 0, 'Willix'),
+(-1047006, 'I think, I see a way how we come out of this damned thorn tangle.', 0, 0, 0, 'Willix'),
+(-1047007, 'I am glad that we are out again from this damned ditch. However, up here it is not much better!', 0, 0, 0, 'Willix'),
+(-1047008, 'Finally! I am glad that I come, finally out here.', 0, 0, 0, 'Willix'),
+(-1047009, 'I will rather rest a moment and come again to breath, before I return to Ratchet.', 0, 0, 0, 'Willix'),
+(-1047010, 'Many thanks for your help.', 0, 0, 0, 'Willix');
-- -1 048 000 BLACKFATHOM DEEPS
+-- -1 060 000 863_world_scripts.sql
+INSERT INTO script_texts
+(`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`)
+VALUES
+(-1060000, 'Emergency power activated! Initializing ambulatory motor! CLUCK!', NULL, NULL, 'Notfallenergie aktiviert! Ambulatorenantrieb wird gestartet! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1060001, 'Physical threat detected! Evasive action! CLUCK!', NULL, NULL, 'Körperliche Bedrohung entdeckt! Ausweichmanöver! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1060002, 'Threat analyzed! Activating combat plan beta! CLUCK!', NULL, NULL, 'Bedrohung analysiert! Gefechtsplan Beta wird aktiviert! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1060003, 'CLUCK! Sensors detect spatial anomaly -- danger imminent! CLUCK', NULL, NULL, 'GLUCK! Sensoren haben räumliche Anomalie entdeckt - Gefahr im Verzug! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1060004, 'No one challenges the wastevander nomads -- not even robotic chickens! ATTACK!', NULL, NULL, 'Niemand fordert die Wüsenläufernomaden heraus - auch keine Robothühner! ANGRIFF!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
+(-1060005, 'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!', NULL, NULL, 'Tarnsysteme online! GLUCK! Tarnung für Transport nach Beutebucht wird aktiviert.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL);
+
-- -1 070 000 ULDAMAN
-- -1 090 000 GNOMEREGAN
@@ -49,12 +360,22 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
-- -1 129 000 RAZORFEN DOWNS
-- -1 189 000 SCARLET MONASTERY
+INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `comment`) VALUES
+(-1189001, 'It is over, your search is done! Let fate choose now, the righteous one',0,0,0,0,0,0,0,0,11961,1,0,'Headless Horseman SAY_ENTRANCE'),
+(-1189002, 'Here\'s my body, fit and pure! Now, your blackened souls I\'ll cure!',0,0,0,0,0,0,0,0,12567,1,0,'Headless Horseman SAY_REJOINED'),
+(-1189003, 'Over here, you idiot!',0,0,0,0,0,0,0,0,12569,1,0,'Headless Horseman SAY_LOST_HEAD'),
+(-1189004, 'Harken, cur! Tis you I spurn! Now, $N, feel the burn!',0,0,0,0,0,0,0,0,12573,1,0,'Headless Horseman SAY_CONFLAGRATION'),
+(-1189005, 'Soldiers arise, stand and fight! Bring victory at last to this fallen knight!',0,0,0,0,0,0,0,0,11963,1,0,'Headless Horseman SAY_SPROUTING_PUMPKINS'),
+(-1189006, 'Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken',0,0,0,0,0,0,0,0,11962,0,0,'Headless Horseman SAY_PLAYER_DEATH'),
+(-1189007, 'This end have I reached before. What new adventure lies in store?',0,0,0,0,0,0,0,0,11964,0,0,'Headless Horseman SAY_DEATH');
-- -1 209 000 ZUL'FARRAK
-- -1 229 000 BLACKROCK SPIRE
-- -1 230 000 BLACKROCK DEPTHS
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1230000,'Ah, hits the spot!',0,0,0,'rocknot SAY_GOT_BEER');
-- -1 249 000 ONYXIA'S LAIR
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
@@ -87,6 +408,19 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1269016,'No one can stop us! No one!',10404,1,0,'aeonus SAY_SLAY2'),
(-1269017,'It is only a matter...of time.',10405,1,0,'aeonus SAY_DEATH');
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1269018,'goes into a frenzy!',0,2,0,'aeonus EMOTE_FRENZY'),
+(-1269019,'Stop! Do not go further, mortals. You are ill-prepared to face the forces of the Infinite Dragonflight. Come, let me help you.',0,0,0,'saat SAY_SAAT_WELCOME'),
+(-1269020,'The time has come! Gul\'dan, order your warlocks to double their efforts! Moments from now the gateway will open, and your Horde will be released upon this ripe, unsuspecting world!',10435,1,0,'medivh SAY_ENTER'),
+(-1269021,'What is this? Champions, coming to my aid? I sense the hand of the dark one in this. Truly this sacred event bears his blessing?',10436,1,0,'medivh SAY_INTRO'),
+(-1269022,'Champions, my shield grows weak!',10437,1,0,'medivh SAY_WEAK75'),
+(-1269023,'My powers must be concentrated on the portal! I do not have time to hold the shield!',10438,1,0,'medivh SAY_WEAK50'),
+(-1269024,'The shield is nearly gone! All that I have worked for is in danger!',10439,1,0,'medivh SAY_WEAK25'),
+(-1269025,'No... damn this feeble mortal coil...',10441,1,0,'medivh SAY_DEATH'),
+(-1269026,'I am grateful for your aid, champions. Now, Gul\'dan\'s Horde will sweep across this world, like a locust swarm, and all my designs, all my carefully laid plans will at last fall into place.',10440,1,0,'medivh SAY_WIN'),
+(-1269027,'Orcs of the Horde! This portalis the gateway to your new destiny! Azeroth lies before you, ripe for the taking!',0,1,0,'medivh SAY_ORCS_ENTER'),
+(-1269028,'Gul\'dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back trought the portal!',0,1,0,'medivh SAY_ORCS_ANSWER');
+
-- -1 289 000 SCHOLOMANCE
-- -1 309 000 ZUL'GURUB
@@ -371,7 +705,126 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1532102,'I refuse to concede defeat. I am a prince of the Eredar! I am...',9221,1,0,'malchezaar SAY_DEATH');
-- -1 533 000 NAXXRAMAS
-
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'),
+(-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'),
+(-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'),
+(-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'),
+(-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'),
+(-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'),
+(-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'),
+(-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'),
+(-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'),
+(-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'),
+(-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'),
+(-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'),
+(-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'),
+(-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'),
+(-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'),
+(-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'),
+(-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'),
+(-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'),
+(-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'),
+(-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'),
+(-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'),
+(-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'),
+(-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'),
+(-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'),
+(-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'),
+(-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'),
+(-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'),
+(-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'),
+(-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'),
+(-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'),
+(-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'),
+(-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'),
+(-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'),
+(-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'),
+(-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'),
+(-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'),
+(-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'),
+(-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'),
+(-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'),
+(-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040;
+ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'),
+(-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'),
+(-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'),
+(-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'),
+(-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'),
+(-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'),
+(-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'),
+(-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'),
+(-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'),
+(-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'),
+(-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'),
+(-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'),
+(-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'),
+(-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'),
+(-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'),
+(-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'),
+(-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'),
+(-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'),
+(-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'),
+(-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'),
+(-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'),
+(-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'),
+(-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'),
+(-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'),
+(-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'),
+(-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'),
+(-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'),
+(-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'),
+(-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'),
+(-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'),
+(-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'),
+(-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'),
+(-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'),
+(-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'),
+(-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'),
+(-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'),
+(-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'),
+(-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'),
+(-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'),
+(-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'),
+(-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'),
+(-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'),
+(-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'),
+(-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'),
+(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
+(-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'),
+(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
+(-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'),
+(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'),
+(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'),
+(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'),
+(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'),
+(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'),
+(-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'),
+(-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'),
+(-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'),
+(-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'),
+(-1533098,'<Kel\'Thuzad cackles maniacally!>',14479,1,0,'kelthuzad SAY_SLAY2'),
+(-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'),
+(-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'),
+(-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'),
+(-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'),
+(-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'),
+(-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'),
+(-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'),
+(-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'),
+(-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'),
+(-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL');
+
+UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055;
+UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056;
+
-- -1 534 000 THE BATTLE OF MT. HYJAL
-- -1 540 000 SHATTERED HALLS
@@ -461,6 +914,17 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1543015,'It is... not over.',10284,1,0,'omor SAY_DIE'),
(-1543016,'I am victorious!',10283,1,0,'omor SAY_WIPE');
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+('-1543017','You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!',10292,1,0,'vazruden SAY_INTRO'),
+('-1543018','Is there no one left to test me?',10293,1,0,'vazruden SAY_WIPE'),
+('-1543019','Your time is running out!',10294,1,0,'vazruden SAY_AGGRO_1'),
+('-1543020','You are nothing, I answer a higher call!',10295,1,0,'vazruden SAY_AGGRO_2'),
+('-1543021','The Dark Lord laughs at you!',10296,1,0,'vazruden SAY_AGGRO_3'),
+('-1543022','It is over. Finished!',10297,1,0,'vazruden SAY_KILL_1'),
+('-1543023','Your days are done!',10298,1,0,'vazruden SAY_KILL_2'),
+('-1543024','My lord will be the end you all...',10299,1,0,'vazruden SAY_DIE'),
+('-1543025','descends from the sky',0,3,0,'vazruden EMOTE');
+
-- -1 544 000 MAGTHERIDON'S LAIR
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
(-1544000,'Wretched, meddling insects. Release me and perhaps i will grant you a merciful death!',10247,1,0,'magtheridon SAY_TAUNT1'),
@@ -1083,6 +1547,14 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1585028,'Do not... get too comfortable.',12420,1,0,'kaelthas MT SAY_RECAST_GRAVITY'),
(-1585029,'My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!',12421,1,0,'kaelthas MT SAY_DEATH');
+-- -1 645 000 377_word_scripts.sql
+INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `comment`) VALUES
+(-1645006,'Let the trial begin, Bloodwrath, attack!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE'),
+(-1645007,'Champion Lightrend, make me proud!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE'),
+(-1645008,'Show this upstart how a real Blood Knight fights, Swiftblade!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE'),
+(-1645009,'Show $N the meaning of pain, Sunstriker!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE');
+
+
--
-- Below just for beautiful view in table, run at own desire
--
diff --git a/sql/updates/1026_mangos_7113_01_characters_character_achievement_progress.sql b/sql/updates/1026_mangos_7113_01_characters_character_achievement_progress.sql
new file mode 100644
index 00000000000..6f125a6a2e6
--- /dev/null
+++ b/sql/updates/1026_mangos_7113_01_characters_character_achievement_progress.sql
@@ -0,0 +1,3 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7100_01_characters_character_spell required_7113_01_characters_character_achievement_progress bit;*/
+
+DELETE FROM character_achievement_progress WHERE counter=0; \ No newline at end of file
diff --git a/sql/updates/1028_mangos_7141_01_world_instance_template.sql b/sql/updates/1028_mangos_7141_01_world_instance_template.sql
new file mode 100644
index 00000000000..f86b9517a98
--- /dev/null
+++ b/sql/updates/1028_mangos_7141_01_world_instance_template.sql
@@ -0,0 +1,12 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7133_02_mangos_spell_loot_template required_7141_01_mangos_instance_template bit;*/
+
+ALTER TABLE instance_template ADD maxPlayersHeroic tinyint(3) unsigned NOT NULL default '0' AFTER maxPlayers;
+
+UPDATE instance_template SET maxPlayersHeroic = maxPlayers;
+
+DELETE FROM instance_template WHERE map IN (533,615,616,624);
+INSERT INTO instance_template VALUES
+(533,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
+(615,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
+(616,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
+(624,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''); \ No newline at end of file
diff --git a/sql/updates/1028_mangos_7147_01_world_creature_template.sql b/sql/updates/1028_mangos_7147_01_world_creature_template.sql
new file mode 100644
index 00000000000..385ec769156
--- /dev/null
+++ b/sql/updates/1028_mangos_7147_01_world_creature_template.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7141_01_mangos_instance_template required_7147_01_mangos_creature_template bit;*/
+
+UPDATE creature_template
+ SET family = 0 WHERE entry = 1; \ No newline at end of file
diff --git a/sql/updates/1028_mangos_7150_01_world_playercreateinfo_spell.sql b/sql/updates/1028_mangos_7150_01_world_playercreateinfo_spell.sql
new file mode 100644
index 00000000000..6d4a5993e58
--- /dev/null
+++ b/sql/updates/1028_mangos_7150_01_world_playercreateinfo_spell.sql
@@ -0,0 +1,10 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7149_01_mangos_spell_proc_event required_7150_01_mangos_playercreateinfo_spell bit;*/
+
+DELETE FROM `playercreateinfo_spell` WHERE Spell = 58284;
+
+INSERT INTO `playercreateinfo_spell` VALUES
+(1,9,58284,'Chaos Bolt Passive'),
+(2,9,58284,'Chaos Bolt Passive'),
+(5,9,58284,'Chaos Bolt Passive'),
+(7,9,58284,'Chaos Bolt Passive'),
+(10,9,58284,'Chaos Bolt Passive'); \ No newline at end of file
diff --git a/sql/updates/1073_world_scripts.sql b/sql/updates/1073_world_scripts.sql
deleted file mode 100644
index 038f5f79466..00000000000
--- a/sql/updates/1073_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname = 'npc_plains_vision' where entry = 2983;
-
diff --git a/sql/updates/1074_world_scripts.sql b/sql/updates/1074_world_scripts.sql
deleted file mode 100644
index 4ed882ffea5..00000000000
--- a/sql/updates/1074_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname = 'npc_plucky' where entry in (6626);
-
diff --git a/sql/updates/1084_mangos_7168_01_world_command.sql b/sql/updates/1084_mangos_7168_01_world_command.sql
new file mode 100644
index 00000000000..b9df9bca12d
--- /dev/null
+++ b/sql/updates/1084_mangos_7168_01_world_command.sql
@@ -0,0 +1,6 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7156_01_mangos_spell_proc_event required_7168_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('learn','unlearn');
+INSERT INTO `command` VALUES
+('learn',3,'Syntax: .learn #spell [all]\r\n\r\nSelected character learn a spell of id #spell. If \'all\' provided then all ranks learned.'),
+('unlearn',3,'Syntax: .unlearn #spell [all]\r\n\r\nUnlearn for selected player a spell #spell. If \'all\' provided then all ranks unlearned.'); \ No newline at end of file
diff --git a/sql/updates/1094_mangos_7193_01_world_trinity_string.sql b/sql/updates/1094_mangos_7193_01_world_trinity_string.sql
new file mode 100644
index 00000000000..44a390d20f6
--- /dev/null
+++ b/sql/updates/1094_mangos_7193_01_world_trinity_string.sql
@@ -0,0 +1,3 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7175_01_mangos_spell_proc_event required_7193_01_mangos_mangos_string bit;*/
+
+UPDATE mangos_string SET content_default = 'Unit Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.' WHERE entry = 542; \ No newline at end of file
diff --git a/sql/updates/1108_mangos_7196_02_world_spell_bonus_data.sql b/sql/updates/1108_mangos_7196_02_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..8f6fdbd1463
--- /dev/null
+++ b/sql/updates/1108_mangos_7196_02_world_spell_bonus_data.sql
@@ -0,0 +1,233 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7196_01_mangos_spell_chain required_7196_02_mangos_spell_bonus_data bit;*/
+
+-- ----------------------------
+-- Table structure for spell_bonus_data
+-- ----------------------------
+DROP TABLE IF EXISTS `spell_bonus_data`;
+CREATE TABLE `spell_bonus_data` (
+ `entry` smallint(5) unsigned NOT NULL,
+ `direct_bonus` float NOT NULL default '0',
+ `dot_bonus` float NOT NULL default '0',
+ `ap_bonus` float NOT NULL default '0',
+ `comments` varchar(255) default NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `spell_bonus_data` VALUES
+('5185', '1.6104', '0', '0', 'Druid - Healing Touch'),
+('33763', '0', '0.09518', '0', 'Druid - Lifebloom'),
+('774', '0', '0.37604', '0', 'Druid - Rejuvenation'),
+('8936', '0.539', '0.188', '0', 'Druid - Regrowth'),
+('18562', '0', '0', '0', 'Druid - Swiftmend'),
+('44203', '0.538', '0', '0', 'Druid - Tranquility Triggered'),
+('48438', '0', '0.11505', '0', 'Druid - Wild Growth'),
+('50464', '0.6611', '0', '0', 'Druid - Nourish'),
+('339', '0', '0.1', '0', 'Druid - Entangling Roots'),
+('42231', '0.12898', '0', '0', 'Druid - Hurricane Triggered'),
+('5570', '0', '0.127', '0', 'Druid - Insect Swarm'),
+('8921', '0.1515', '0.13', '0', 'Druid - Moonfire'),
+('2912', '1', '0', '0', 'Druid - Starfire'),
+('5176', '0.5714', '0', '0', 'Druid - Wrath'),
+('30451', '0.7143', '0', '0', 'Mage - Arcane Blast'),
+('1449', '0.2128', '0', '0', 'Mage - Arcane Explosion'),
+('7268', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 1'),
+('7269', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 2'),
+('7270', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 3'),
+('8419', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 4'),
+('8418', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 5'),
+('10273', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 6'),
+('10274', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 7'),
+('25346', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 8'),
+('27076', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 9'),
+('38700', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 10'),
+('38703', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 11'),
+('42844', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 12'),
+('42845', '0.2857', '0', '0', 'Mage - Arcane Missiles Triggered Spell Rank 13'),
+('1463', '0.8053', '0', '0', 'Mage - Mana Shield'),
+('44425', '0.8571', '0', '0', 'Mage - Arcane Barrage'),
+('11113', '0.1357', '0', '0', 'Mage - Blast Wave Rank'),
+('31661', '0.1357', '0', '0', 'Mage - Dragons Breath'),
+('2136', '0.4286', '0', '0', 'Mage - Fire Blast'),
+('133', '1', '0', '0', 'Mage - Fire Ball'),
+('2120', '0.2357', '0.122', '0', 'Mage - Flamestrike'),
+('11366', '1.15', '0.05', '0', 'Mage - Pyroblast'),
+('2948', '0.4286', '0', '0', 'Mage - Scorch'),
+('44614', '0.8571', '0', '0', 'Frostfire Bolt'),
+('44457', '0.4', '0.2', '0', 'Mage - Living Bomb'),
+('42208', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 1'),
+('42209', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 2'),
+('42210', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 3'),
+('42211', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 4'),
+('42212', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 5'),
+('42213', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 6'),
+('42198', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 7'),
+('42937', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 8'),
+('42938', '0.0952', '0', '0', 'Mage - Blizzard Triggered Spell Rank 9'),
+('120', '0.1357', '0', '0', 'Mage - Cone of Cold'),
+('122', '0.193', '0', '0', 'Mage - Frost Nova'),
+('116', '0.8143', '0', '0', 'Mage - Frost Bolt'),
+('11426', '0.8053', '0', '0', 'Mage - Ice Barrier'),
+('30455', '0.1429', '0', '0', 'Mage - Ice Lance'),
+('19750', '0.4286', '0', '0', 'Paladin - Flash of Light'),
+('635', '0.7143', '0', '0', 'Paladin - Holy Light'),
+('25912', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 1'),
+('25911', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 2'),
+('25902', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 3'),
+('27176', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 4'),
+('33073', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 5'),
+('48822', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 6'),
+('48823', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Hurt Rank 7'),
+('25914', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 1'),
+('25913', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 2'),
+('25903', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 3'),
+('27175', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 4'),
+('33074', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 5'),
+('48820', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 6'),
+('48821', '0.4286', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 7'),
+('31935', '0.07', '0', '0.07', 'Paladin - Avengers Shiled'),
+('26573', '0', '0.04', '0.04', 'Paladin - Consecration'),
+('879', '0.15', '0', '0.15', 'Paladin - Exorcism'),
+('24275', '0.15', '0', '0.15', 'Paladin - Hammer of Wrath'),
+('20925', '0.09', '0', '0.056', 'Paladin - Holy Shield'),
+('2812', '0.07', '0', '0.07', 'Paladin - Holy Wrath'),
+('31893', '0.25', '0', '0.16', 'Paladin - Seal of Blood Enemy Proc'),
+('32221', '0.25', '0', '0.16', 'Paladin - Seal of Blood Self Proc'),
+('20424', '0.25', '0', '0.16', 'Paladin - Seal of Command Proc'),
+('379', '0', '0', '0', 'Shaman - Earth Shield Triggered'),
+('20167', '0.25', '0', '0.16', 'Paladin - Seal of Light Proc'),
+('53719', '0.25', '0', '0.16', 'Paladin - Seal of The Martyr Enemy Proc'),
+('53718', '0.25', '0', '0.16', 'Paladin - Seal of The Martyr Self Proc'),
+('25742', '0.07', '0', '0.039', 'Paladin - Seal of Righteousness Dummy Proc'),
+('31803', '0', '0.013', '0.15', 'Paladin - Holy Vengeance'),
+('52042', '0.045', '0', '0', 'Shaman - Healing Stream Totem Triggered Heal'),
+('32546', '0.8068', '0', '0', 'Priest - Binding Heal'),
+('34861', '0.402', '0', '0', 'Priest - Circle of Healing'),
+('19236', '0.8068', '0', '0', 'Priest - Desperate Prayer'),
+('2061', '0.8068', '0', '0', 'Priest - Flash Heal'),
+('2060', '1.6135', '0', '0', 'Priest - Greater Heal'),
+('23455', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 1'),
+('23458', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 2'),
+('23459', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 3'),
+('27803', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 4'),
+('27804', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 5'),
+('27805', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 6'),
+('25329', '0.3035', '0', '0', 'Priest - Holy Nova Heal Rank 7'),
+('17', '0.8068', '0', '0', 'Priest - Power Word: Shield'),
+('596', '0.8086', '0', '0', 'Priest - Prayer of Healing'),
+('33110', '0.8068', '0', '0', 'Priest - Prayer of Mending Heal Proc'),
+('139', '1.88', '0', '0', 'Priest - Renew'),
+('2944', '0.1849', '0', '0', 'Priest - Devouring Plague'),
+('14914', '0.5711', '0.024', '0', 'Priest - Holy Fire'),
+('15237', '0.1606', '0', '0', 'Priest - Holy Nova Damage'),
+('8129', '0', '0', '0', 'Priest - Mana Burn'),
+('8092', '0.4296', '0', '0', 'Priest - Mind Blast'),
+('15407', '0.257', '0', '0', 'Priest - Mind Flay'),
+('49821', '0.7143', '0', '0', 'Priest - Mind Sear Trigger Rank 1'),
+('53022', '0.7143', '0', '0', 'Priest - Mind Sear Trigger Rank 2'),
+('34433', '0.65', '0', '0', 'Priest - Shadowfiend'),
+('32379', '0.4296', '0', '0', 'Priest - Shadow Word: Death'),
+('589', '0', '0.1829', '0', 'Priest - Shadow Word: Pain'),
+('585', '0.714', '0', '0', 'Priest - Smite'),
+('34914', '0', '0.4', '0', 'Priest - Vampiric Touch'),
+('974', '0.4762', '0', '0', 'Shaman - Earth Shield'),
+('1064', '1.34', '0', '0', 'Shaman - Chain Heal'),
+('331', '1.6106', '0', '0', 'Shaman - Healing Wave'),
+('8004', '0.8082', '0', '0', 'Shaman - Lesser Healing Wave'),
+('61295', '0.4', '0.18', '0', 'Shaman - Riptide'),
+('421', '0.57', '0', '0', 'Shaman - Chain Lightning'),
+('8042', '0.3858', '0', '0', 'Shaman - Earth Shock'),
+('8443', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 1'),
+('8504', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 2'),
+('8505', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 3'),
+('11310', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 4'),
+('11311', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 5'),
+('25538', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 6'),
+('25539', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 7'),
+('61651', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 8'),
+('61660', '0.2142', '0', '0', 'Shaman - Fire Nova Totem Casted by Totem Rank 9'),
+('8050', '0.2142', '0.1', '0', 'Shaman - Flame Shock'),
+('8026', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 1'),
+('8028', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 2'),
+('8029', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 3'),
+('10445', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 4'),
+('16343', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 5'),
+('16344', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 6'),
+('25488', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 7'),
+('58786', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 8'),
+('58787', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 9'),
+('58788', '0.1', '0', '0', 'Shaman - Flametongue Weapon Proc Rank 10'),
+('8056', '0.3858', '0', '0', 'Shaman - Frost Shock'),
+('8034', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 1'),
+('8037', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 2'),
+('10458', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 3'),
+('16352', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 4'),
+('16353', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 5'),
+('25501', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 6'),
+('58797', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 7'),
+('58798', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 8'),
+('58799', '0.1', '0', '0', 'Shaman - Frostbrand Attack Rank 9'),
+('51505', '0.5714', '0', '0', 'Shaman - Lava Burst'),
+('403', '0.7143', '0', '0', 'Shaman - Lightning Bolt'),
+('26364', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 1'),
+('26365', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 2'),
+('26366', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 3'),
+('26367', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 4'),
+('26369', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 5'),
+('26370', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 6'),
+('26363', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 7'),
+('26371', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 8'),
+('26372', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 9'),
+('49278', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 10'),
+('49279', '0.33', '0', '0', 'Shaman - Lightning Shield Proc Rank 11'),
+('8188', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 1'),
+('10582', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 2'),
+('10583', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 3'),
+('10584', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 4'),
+('25551', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 5'),
+('58733', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 6'),
+('58736', '0.1', '0', '0', 'Shaman - Magma Totam Passive Rank 7'),
+('3606', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 1'),
+('6350', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 2'),
+('6351', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 3'),
+('6352', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 4'),
+('10435', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 5'),
+('10436', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 6'),
+('25530', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 7'),
+('58700', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 8'),
+('58701', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 9'),
+('58702', '0.1667', '0', '0', 'Shaman - Searing Totem Attack Rank 10'),
+('980', '0', '0.1', '0', 'Warlock - Curse of Agony'),
+('603', '0', '2', '0', 'Warlock - Curse of Doom'),
+('172', '0', '0.3', '0', 'Warlock - Corruption'),
+('348', '0.2', '0.2', '0', 'Warlock - Immolate'),
+('27243', '0.22', '0.25', '0', 'Warlock - Seed of Corruption'),
+('18265', '0', '1', '0', 'Warlock - Siphon Life'),
+('30108', '0', '0.24', '0', 'Warlock - Unstable Affliction'),
+('17962', '0.4286', '0', '0', 'Warlock - Conflagrate'),
+('6789', '0.22', '0', '0', 'Warlock - Death Coil'),
+('48181', '0.4729', '0', '0', 'Warlock - Haunt'),
+('29722', '0.7143', '0', '0', 'Warlock - Incinerate'),
+('5676', '0.4286', '0', '0', 'Warlock - Searing Pain'),
+('686', '0.8571', '0', '0', 'Warlock - Shadow Bolt'),
+('17877', '0.4286', '0', '0', 'Warlock - Shadowburn'),
+('30283', '0.195', '0', '0', 'Warlock - Shadowfury'),
+('6353', '1.15', '0', '0', 'Warlock - Soul Fire'),
+('689', '0', '0.1428', '0', 'Warlock - Drain Life'),
+('5138', '0', '0', '0', 'Warlock - Drain Mana'),
+('1120', '0', '0.4286', '0', 'Warlock - Drain Soul'),
+('755', '0', '0.4485', '0', 'Warlock - Health Funnel'),
+('1949', '0', '0.0946', '0', 'Warlock - Hellfire'),
+('5857', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 1'),
+('11681', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 2'),
+('11682', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 3'),
+('27214', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 4'),
+('47822', '0.1428', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 5'),
+('42223', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 1'),
+('42224', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 2'),
+('42225', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 3'),
+('42226', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 4'),
+('42218', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 5'),
+('47817', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 6'),
+('47818', '0.952', '0', '0', 'Warlock - Rain of Fire Triggered Rank 7'),
+('18220', '0.96', '0', '0', 'Warlock - Dark Pact'),
+('6229', '0.3', '0', '0', 'Warlock - Shadow Ward'); \ No newline at end of file
diff --git a/sql/updates/1108_mangos_7198_01_characters_characters.sql b/sql/updates/1108_mangos_7198_01_characters_characters.sql
new file mode 100644
index 00000000000..104a31359df
--- /dev/null
+++ b/sql/updates/1108_mangos_7198_01_characters_characters.sql
@@ -0,0 +1,27 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7113_01_characters_character_achievement_progress required_7198_01_characters_characters bit;*/
+
+UPDATE `characters`.`item_instance` AS `t1`
+INNER JOIN `world`.`item_template` AS `t2` ON
+`t2`.`entry` = SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',4),' ',-1)
+SET `t1`.`data` = CONCAT(
+ SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',16),' ',-16), ' ',
+ IF (`t2`.`spellcharges_1` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',17),' ',-1) = 0, IF(`t2`.`spellcharges_1` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',17),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_2` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',18),' ',-1) = 0, IF(`t2`.`spellcharges_2` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',18),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_3` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',19),' ',-1) = 0, IF(`t2`.`spellcharges_3` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',19),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_4` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',20),' ',-1) = 0, IF(`t2`.`spellcharges_4` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',20),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_5` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',21),' ',-1) = 0, IF(`t2`.`spellcharges_5` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',21),' ',-1))), ' ',
+ SUBSTRING_INDEX(SUBSTRING_INDEX(`data`,' ',64),' ',-64+21),' ')
+WHERE (`t2`.`spellid_1` = 55884) AND (SUBSTRING_INDEX(data,' ',64) = data AND SUBSTRING_INDEX(data,' ',64-1) <> data);
+
+UPDATE `characters`.`item_instance` AS `t1`
+INNER JOIN `world`.`item_template` AS `t2` ON
+`t2`.`entry` = SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',4),' ',-1)
+SET `t1`.`data` = CONCAT(
+ SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',16),' ',-16), ' ',
+ IF (`t2`.`spellcharges_1` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',17),' ',-1) = 0, IF(`t2`.`spellcharges_1` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',17),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_2` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',18),' ',-1) = 0, IF(`t2`.`spellcharges_2` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',18),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_3` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',19),' ',-1) = 0, IF(`t2`.`spellcharges_3` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',19),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_4` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',20),' ',-1) = 0, IF(`t2`.`spellcharges_4` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',20),' ',-1))), ' ',
+ IF (`t2`.`spellcharges_5` = 0, 0, IF (SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',21),' ',-1) = 0, IF(`t2`.`spellcharges_5` < 0, 4294967295, 1), SUBSTRING_INDEX(SUBSTRING_INDEX(`t1`.`data`,' ',21),' ',-1))), ' ',
+ SUBSTRING_INDEX(SUBSTRING_INDEX(`data`,' ',138),' ',-138+21),' ')
+WHERE (`t2`.`spellid_1` = 55884) AND (SUBSTRING_INDEX(data,' ',138) = data AND SUBSTRING_INDEX(data,' ',138-1) <> data); \ No newline at end of file
diff --git a/sql/updates/1108_mangos_7199_01_world_spell_bonus_data.sql b/sql/updates/1108_mangos_7199_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..89bad64d3e1
--- /dev/null
+++ b/sql/updates/1108_mangos_7199_01_world_spell_bonus_data.sql
@@ -0,0 +1,11 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7196_02_mangos_spell_bonus_data required_7199_01_mangos_spell_bonus_data bit;*/
+
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (44614, 139, 49821, 53022, 18265, 31117, 28176);
+INSERT INTO `spell_bonus_data` VALUES
+('44614', '0.8571', '0', '0', 'Mage - Frostfire Bolt'),
+('139', '0', '0.376', '0', 'Priest - Renew'),
+('49821', '0.14286', '0', '0', 'Priest - Mind Sear Trigger Rank 1'),
+('53022', '0.14286', '0', '0', 'Priest - Mind Sear Trigger Rank 2'),
+('18265', '0', '0.1', '0', 'Warlock - Siphon Life'),
+('31117', '1.8', '0', '0', 'Warlock - Unstable Affliction Dispell'),
+('28176', '0', '0', '0', 'Warlock - Fel Armor'); \ No newline at end of file
diff --git a/sql/updates/1135_mangos_7207_01_world_creature.sql b/sql/updates/1135_mangos_7207_01_world_creature.sql
new file mode 100644
index 00000000000..7566ba87076
--- /dev/null
+++ b/sql/updates/1135_mangos_7207_01_world_creature.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7205_01_mangos_spell_chain required_7207_01_mangos_creature bit;*/
+
+ALTER TABLE creature
+ ADD COLUMN `phaseMask` smallint(5) unsigned NOT NULL default '1' AFTER `spawnMask`; \ No newline at end of file
diff --git a/sql/updates/1135_mangos_7207_02_world_gameobject.sql b/sql/updates/1135_mangos_7207_02_world_gameobject.sql
new file mode 100644
index 00000000000..aef9f853f54
--- /dev/null
+++ b/sql/updates/1135_mangos_7207_02_world_gameobject.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7207_01_mangos_creature required_7207_02_mangos_gameobject bit;*/
+
+ALTER TABLE gameobject
+ ADD COLUMN `phaseMask` smallint(5) unsigned NOT NULL default '1' AFTER `spawnMask`; \ No newline at end of file
diff --git a/sql/updates/1135_mangos_7207_03_characters_corpse.sql b/sql/updates/1135_mangos_7207_03_characters_corpse.sql
new file mode 100644
index 00000000000..b1fa98e2706
--- /dev/null
+++ b/sql/updates/1135_mangos_7207_03_characters_corpse.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7198_01_characters_characters required_7207_03_characters_corpse bit;*/
+
+ALTER TABLE corpse
+ ADD COLUMN `phaseMask` smallint(5) unsigned NOT NULL default '1' AFTER `map`; \ No newline at end of file
diff --git a/sql/updates/1140_mangos_7209_01_world_spell_bonus_data.sql b/sql/updates/1140_mangos_7209_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..d4863c51494
--- /dev/null
+++ b/sql/updates/1140_mangos_7209_01_world_spell_bonus_data.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7207_02_mangos_gameobject required_7209_01_mangos_spell_bonus_data bit;*/
+
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (53595);
+INSERT INTO `spell_bonus_data` VALUES
+('53595', '0', '0', '0','Paladin - Hammer of the Righteous'); \ No newline at end of file
diff --git a/sql/updates/1185_mangos_7214_01_world_command.sql b/sql/updates/1185_mangos_7214_01_world_command.sql
new file mode 100644
index 00000000000..841d538fa43
--- /dev/null
+++ b/sql/updates/1185_mangos_7214_01_world_command.sql
@@ -0,0 +1,8 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7209_01_mangos_spell_bonus_data required_7214_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('gps','modify phase','npc phase','gobject phase');
+INSERT INTO `command` VALUES
+('gps',1,'Syntax: .gps [$name|$shift-link]\r\n\r\nDisplay the position information for a selected character or creature (also if player name $name provided then for named player, or if creature/gameobject shift-link provided then pointed creature/gameobject if it loaded). Position information includes X, Y, Z, and orientation, map Id and zone Id'),
+('modify phase',3,'Syntax: .modify phase #phasemask\r\n\r\nSelected character phasemask changed to #phasemask with related world vision update. Change active until in game phase changed, or GM-mode enable/disable, or re-login. Character pts pasemask update to same value.'),
+('npc phase',3,'Syntax: .npc phase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'),
+('gobject phase',3,'Syntax: .gobject phase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'); \ No newline at end of file
diff --git a/sql/updates/1185_mangos_7214_02_world_trinity_string.sql b/sql/updates/1185_mangos_7214_02_world_trinity_string.sql
new file mode 100644
index 00000000000..90c39d42baa
--- /dev/null
+++ b/sql/updates/1185_mangos_7214_02_world_trinity_string.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7214_01_mangos_command required_7214_02_mangos_mangos_string bit;*/
+
+DELETE FROM `mangos_string` WHERE entry = 101;
+INSERT INTO `mangos_string` VALUES
+(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s) Phase: %u\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1185_mangos_7214_03_world_spell_proc_event.sql b/sql/updates/1185_mangos_7214_03_world_spell_proc_event.sql
new file mode 100644
index 00000000000..e93dcdc04a1
--- /dev/null
+++ b/sql/updates/1185_mangos_7214_03_world_spell_proc_event.sql
@@ -0,0 +1,865 @@
+DROP TABLE IF EXISTS `spell_proc_event`;
+CREATE TABLE IF NOT EXISTS `spell_proc_event` (
+ `entry` smallint(5) unsigned NOT NULL default '0',
+ `SchoolMask` tinyint(4) NOT NULL default '0',
+ `SpellFamilyName` smallint(5) unsigned NOT NULL default '0',
+ `SpellFamilyMask0` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask1` int(10) unsigned NOT NULL default '0',
+ `SpellFamilyMask2` int(10) unsigned NOT NULL default '0',
+ `procFlags` int(10) unsigned NOT NULL default '0',
+ `procEx` int(10) unsigned NOT NULL default '0',
+ `ppmRate` float NOT NULL default '0',
+ `CustomChance` float NOT NULL default '0',
+ `Cooldown` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(905, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(945, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(1463, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(3232, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(5952, 0, 8, 1, 1, 0, 0, 0, 0, 0, 0),
+(6346, 0, 0, 0, 0, 0, 0, 256, 0, 0, 0),
+(7383, 1, 0, 0, 0, 0, 0, 256, 0, 0, 0),
+(7434, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(8134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(8178, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(8494, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(8495, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(9452, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(9782, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(9784, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(9799, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(10191, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(10192, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(10193, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(10431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(10432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(11095, 0, 3, 16, 0, 0, 0, 0, 0, 0, 0),
+(11119, 4, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(11120, 4, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(11129, 0, 3, 12582935, 64, 0, 0, 0, 0, 0, 0),
+(11180, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0),
+(11185, 0, 3, 128, 0, 0, 327680, 0, 0, 0, 0),
+(11255, 0, 3, 16384, 0, 0, 0, 0, 0, 0, 0),
+(12169, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(12289, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0),
+(12298, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12311, 0, 4, 2048, 1, 0, 0, 0, 0, 0, 0),
+(12317, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12319, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12322, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(12487, 0, 3, 128, 0, 0, 327680, 0, 0, 0, 0),
+(12488, 0, 3, 128, 0, 0, 327680, 0, 0, 0, 0),
+(12598, 0, 3, 16384, 0, 0, 0, 0, 0, 0, 0),
+(12668, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0),
+(12724, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12725, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12726, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12727, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(12797, 0, 4, 1024, 0, 0, 0, 0, 0, 0, 0),
+(12799, 0, 4, 1024, 0, 0, 0, 0, 0, 0, 0),
+(12812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(12813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(12814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(12815, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(12834, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12846, 4, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(12847, 4, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(12848, 4, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(12849, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12867, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12872, 0, 3, 16, 0, 0, 0, 0, 0, 0, 0),
+(12873, 0, 3, 16, 0, 0, 0, 0, 0, 0, 0),
+(12958, 0, 4, 2048, 1, 0, 0, 0, 0, 0, 0),
+(12966, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(12967, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(12968, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(12969, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(12970, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(12971, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12972, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12973, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12974, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(12999, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0),
+(13000, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0),
+(13001, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0),
+(13002, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0),
+(13045, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(13046, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(13047, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(13048, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(13163, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0),
+(13165, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(13754, 0, 8, 16, 0, 0, 0, 0, 0, 0, 0),
+(13867, 0, 8, 16, 0, 0, 0, 0, 0, 0, 0),
+(13983, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0),
+(14070, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0),
+(14071, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0),
+(14156, 0, 8, 4063232, 0, 0, 0, 0, 0, 0, 0),
+(14160, 0, 8, 4063232, 0, 0, 0, 0, 0, 0, 0),
+(14161, 0, 8, 4063232, 0, 0, 0, 0, 0, 0, 0),
+(14186, 0, 8, 1082131720, 2, 0, 0, 2, 0, 0, 0),
+(14190, 0, 8, 1082131720, 2, 0, 0, 2, 0, 0, 0),
+(14193, 0, 8, 1082131720, 2, 0, 0, 2, 0, 0, 0),
+(14194, 0, 8, 1082131720, 2, 0, 0, 2, 0, 0, 0),
+(14195, 0, 8, 1082131720, 2, 0, 0, 2, 0, 0, 0),
+(14318, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(14319, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(14320, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(14321, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(14322, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(14531, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(14774, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(14892, 0, 6, 268443136, 65540, 0, 0, 2, 0, 0, 0),
+(15088, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(15128, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(15268, 32, 6, 101187584, 2, 0, 0, 0, 0, 0, 0),
+(15277, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0),
+(15286, 32, 6, 0, 0, 0, 0, 0, 0, 0, 0),
+(15323, 32, 6, 101187584, 2, 0, 0, 0, 0, 0, 0),
+(15324, 32, 6, 101187584, 2, 0, 0, 0, 0, 0, 0),
+(15325, 32, 6, 101187584, 2, 0, 0, 0, 0, 0, 0),
+(15326, 32, 6, 101187584, 2, 0, 0, 0, 0, 0, 0),
+(15337, 0, 6, 8192, 2, 0, 0, 2, 0, 0, 0),
+(15338, 0, 6, 8192, 2, 0, 0, 2, 0, 0, 0),
+(15346, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0),
+(15362, 0, 6, 268443136, 65540, 0, 0, 2, 0, 0, 0),
+(15363, 0, 6, 268443136, 65540, 0, 0, 2, 0, 0, 0),
+(15600, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0),
+(16164, 0, 11, 2416967875, 0, 0, 0, 2, 0, 0, 0),
+(16176, 0, 11, 448, 0, 0, 0, 2, 0, 0, 0),
+(16180, 0, 11, 192, 0, 0, 0, 2, 0, 0, 0),
+(16196, 0, 11, 192, 0, 0, 0, 2, 0, 0, 0),
+(16198, 0, 11, 192, 0, 0, 0, 2, 0, 0, 0),
+(16235, 0, 11, 448, 0, 0, 0, 2, 0, 0, 0),
+(16240, 0, 11, 448, 0, 0, 0, 2, 0, 0, 0),
+(16256, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16257, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(16277, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(16278, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(16279, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(16280, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(16281, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16282, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16283, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16284, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16487, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16489, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16492, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16550, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30),
+(16624, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(16850, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0),
+(16864, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(16880, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16923, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0),
+(16924, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0),
+(16952, 0, 7, 233472, 1024, 0, 0, 2, 0, 0, 0),
+(16954, 0, 7, 233472, 1024, 0, 0, 2, 0, 0, 0),
+(16958, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(16961, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(17106, 0, 7, 524288, 0, 0, 0, 0, 0, 0, 0),
+(17107, 0, 7, 524288, 0, 0, 0, 0, 0, 0, 0),
+(17108, 0, 7, 524288, 0, 0, 0, 0, 0, 0, 0),
+(17364, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(17495, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(17793, 0, 5, 1, 0, 0, 0, 2, 0, 0, 0),
+(17794, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0),
+(17796, 0, 5, 1, 0, 0, 0, 2, 0, 0, 0),
+(17797, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(17798, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(17799, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(17800, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(17801, 0, 5, 1, 0, 0, 0, 2, 0, 0, 0),
+(17802, 0, 5, 1, 0, 0, 0, 2, 0, 0, 0),
+(17803, 0, 5, 1, 0, 0, 0, 2, 0, 0, 0),
+(18073, 0, 5, 96, 128, 0, 0, 0, 0, 0, 0),
+(18094, 0, 5, 10, 0, 0, 0, 0, 0, 0, 0),
+(18095, 0, 5, 10, 0, 0, 0, 0, 0, 0, 0),
+(18096, 0, 5, 96, 128, 0, 0, 0, 0, 0, 0),
+(18119, 0, 5, 997, 4288, 0, 0, 0, 0, 0, 0),
+(18120, 0, 5, 997, 4288, 0, 0, 0, 0, 0, 0),
+(18820, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(19184, 0, 9, 20, 8192, 0, 0, 0, 0, 0, 0),
+(19228, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0),
+(19232, 0, 9, 64, 0, 0, 0, 0, 0, 0, 0),
+(19233, 0, 9, 64, 0, 0, 0, 0, 0, 0, 0),
+(19387, 0, 9, 20, 8192, 0, 0, 0, 0, 0, 0),
+(19388, 0, 9, 20, 8192, 0, 0, 0, 0, 0, 0),
+(19572, 0, 9, 8388608, 0, 0, 16384, 0, 0, 0, 0),
+(19573, 0, 9, 8388608, 0, 0, 16384, 0, 0, 0, 0),
+(20049, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(20056, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(20057, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(20128, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20131, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20132, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20164, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0),
+(20165, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0),
+(20166, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0),
+(20182, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20210, 0, 10, 3221225472, 65536, 0, 0, 2, 0, 0, 0),
+(20212, 0, 10, 3221225472, 65536, 0, 0, 2, 0, 0, 0),
+(20213, 0, 10, 3221225472, 65536, 0, 0, 2, 0, 0, 0),
+(20214, 0, 10, 3221225472, 65536, 0, 0, 2, 0, 0, 0),
+(20215, 0, 10, 3221225472, 65536, 0, 0, 2, 0, 0, 0),
+(20234, 0, 10, 32768, 0, 0, 0, 0, 0, 0, 0),
+(20235, 0, 10, 32768, 0, 0, 0, 0, 0, 0, 0),
+(20375, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0),
+(20500, 0, 4, 268435456, 0, 0, 0, 0, 0, 0, 0),
+(20501, 0, 4, 268435456, 0, 0, 0, 0, 0, 0, 0),
+(20705, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(20911, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(20925, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20927, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(20928, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(21185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(21882, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(21890, 0, 4, 712396527, 876, 0, 0, 0, 0, 0, 0),
+(22007, 0, 3, 2097185, 0, 0, 0, 65536, 0, 0, 0),
+(22618, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(22648, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(23547, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(23548, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(23551, 0, 11, 192, 0, 0, 0, 0, 0, 0, 0),
+(23552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(23572, 0, 11, 192, 0, 0, 0, 0, 0, 0, 0),
+(23578, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(23581, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(23602, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(23686, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(23688, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(23689, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0),
+(23695, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0),
+(23721, 0, 9, 2048, 0, 0, 0, 0, 0, 0, 0),
+(23920, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(24353, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(24389, 0, 3, 12582935, 64, 0, 0, 0, 0, 0, 0),
+(24398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(24658, 0, 0, 0, 0, 0, 82192, 0, 0, 0, 0),
+(24905, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0),
+(24932, 0, 0, 0, 0, 0, 0, 2, 0, 0, 6),
+(25050, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(25296, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(25469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(25472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(25669, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0),
+(25899, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(25988, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(26016, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(26107, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0),
+(26119, 0, 10, 2416967683, 0, 0, 0, 65536, 0, 0, 0),
+(26128, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0),
+(26135, 0, 10, 8388608, 0, 0, 0, 65536, 0, 0, 0),
+(26480, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(26605, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(27044, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(27131, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(27179, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(27419, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(27498, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(27521, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(27656, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(27774, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(27787, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(27811, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(27815, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(27816, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(28592, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0),
+(28593, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0),
+(28716, 0, 7, 16, 0, 0, 294912, 0, 0, 0, 0),
+(28719, 0, 7, 32, 0, 0, 0, 2, 0, 0, 0),
+(28744, 0, 7, 64, 0, 0, 278528, 0, 0, 0, 0),
+(28752, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(28789, 0, 10, 3221225472, 0, 0, 0, 0, 0, 0, 0),
+(28802, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(28809, 0, 6, 4096, 0, 0, 0, 2, 0, 0, 0),
+(28812, 0, 8, 33554438, 0, 0, 0, 2, 0, 0, 0),
+(28816, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(28823, 0, 11, 192, 0, 0, 0, 0, 0, 0, 0),
+(28847, 0, 7, 32, 0, 0, 0, 0, 0, 0, 0),
+(28849, 0, 11, 128, 0, 0, 0, 0, 0, 0, 0),
+(29074, 20, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(29075, 20, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(29076, 20, 3, 0, 0, 0, 0, 2, 0, 0, 0),
+(29150, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29179, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(29180, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(29385, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0),
+(29441, 0, 0, 0, 0, 0, 0, 8, 0, 0, 1),
+(29444, 0, 0, 0, 0, 0, 0, 8, 0, 0, 1),
+(29455, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(29501, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29593, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(29594, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(29624, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29625, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29626, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29632, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29633, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29634, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29635, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29636, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29637, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(29801, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(29834, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(29838, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(29977, 0, 3, 12582935, 64, 0, 0, 0, 0, 0, 0),
+(30003, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(30160, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30293, 0, 5, 897, 192, 0, 0, 0, 0, 0, 0),
+(30295, 0, 5, 897, 192, 0, 0, 0, 0, 0, 0),
+(30296, 0, 5, 897, 192, 0, 0, 0, 0, 0, 0),
+(30299, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(30301, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(30302, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(30675, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0),
+(30678, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0),
+(30679, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0),
+(30680, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0),
+(30681, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0),
+(30701, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(30705, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(30802, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30803, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30804, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30805, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30806, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30807, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30808, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30809, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30810, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30811, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(30823, 0, 0, 0, 0, 0, 0, 0, 10.5, 0, 0),
+(30881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5),
+(30883, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5),
+(30884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5),
+(30885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5),
+(30886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5),
+(30937, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(31124, 0, 8, 536870926, 0, 0, 0, 0, 0, 0, 0),
+(31126, 0, 8, 536870926, 0, 0, 0, 0, 0, 0, 0),
+(31244, 0, 8, 4063232, 9, 0, 0, 4, 0, 0, 0),
+(31245, 0, 8, 4063232, 9, 0, 0, 4, 0, 0, 0),
+(31394, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(31569, 0, 3, 65536, 0, 0, 0, 0, 0, 0, 0),
+(31570, 0, 3, 65536, 0, 0, 0, 0, 0, 0, 0),
+(31785, 0, 0, 0, 0, 0, 34816, 0, 0, 0, 0),
+(31794, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(31801, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0),
+(31833, 0, 10, 2147483648, 0, 0, 0, 0, 0, 0, 0),
+(31835, 0, 10, 2147483648, 0, 0, 0, 0, 0, 0, 0),
+(31836, 0, 10, 2147483648, 0, 0, 0, 0, 0, 0, 0),
+(31871, 0, 10, 16, 0, 0, 16384, 0, 0, 0, 0),
+(31872, 0, 10, 16, 0, 0, 16384, 0, 0, 0, 0),
+(31876, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(31877, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(31878, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(31904, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(32385, 0, 5, 1026, 17, 0, 0, 0, 0, 0, 0),
+(32387, 0, 5, 1026, 17, 0, 0, 0, 0, 0, 0),
+(32392, 0, 5, 1026, 17, 0, 0, 0, 0, 0, 0),
+(32393, 0, 5, 1026, 17, 0, 0, 0, 0, 0, 0),
+(32394, 0, 5, 1026, 17, 0, 0, 0, 0, 0, 0),
+(32409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(32587, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(32593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(32594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(32642, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(32734, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(32748, 0, 8, 0, 1, 0, 320, 0, 0, 0, 0),
+(32776, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(32777, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(32837, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 45),
+(32844, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0),
+(32885, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33076, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(33089, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(33127, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0),
+(33142, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33145, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33146, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33150, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33151, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33154, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33191, 0, 6, 8421376, 1024, 0, 0, 0, 0, 0, 0),
+(33192, 0, 6, 8421376, 1024, 0, 0, 0, 0, 0, 0),
+(33193, 0, 6, 8421376, 1024, 0, 0, 0, 0, 0, 0),
+(33299, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(33510, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0),
+(33648, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33719, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(33736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(33746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(33757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(33759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(33776, 0, 0, 0, 0, 0, 34816, 0, 0, 0, 0),
+(33881, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33882, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33883, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(33953, 0, 0, 0, 0, 0, 16384, 0, 0, 0, 45),
+(34080, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0),
+(34138, 0, 11, 128, 0, 0, 0, 0, 0, 0, 0),
+(34139, 0, 10, 1073741824, 0, 0, 0, 0, 0, 0, 0),
+(34258, 0, 10, 1024, 8, 0, 0, 0, 0, 0, 0),
+(34262, 0, 10, 8388608, 0, 0, 0, 65536, 0, 0, 0),
+(34320, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(34497, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34498, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34499, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34500, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34502, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34503, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30),
+(34586, 0, 0, 0, 0, 0, 0, 0, 1.5, 0, 0),
+(34598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(34749, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0),
+(34753, 0, 6, 6144, 4, 0, 0, 2, 0, 0, 0),
+(34774, 0, 0, 0, 0, 0, 0, 0, 1.5, 0, 20),
+(34783, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(34827, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(34859, 0, 6, 6144, 4, 0, 0, 2, 0, 0, 0),
+(34860, 0, 6, 6144, 4, 0, 0, 2, 0, 0, 0),
+(34914, 0, 6, 8192, 0, 0, 0, 0, 0, 0, 0),
+(34916, 0, 6, 8192, 0, 0, 0, 0, 0, 0, 0),
+(34917, 0, 6, 8192, 0, 0, 0, 0, 0, 0, 0),
+(34935, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8),
+(34938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8),
+(34939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8),
+(34950, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(34954, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(35077, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(35080, 0, 0, 0, 0, 0, 0, 0, 1, 0, 60),
+(35083, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(35086, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(35100, 0, 9, 12289, 0, 0, 65856, 0, 0, 0, 0),
+(35102, 0, 9, 12289, 0, 0, 0, 0, 0, 0, 0),
+(35103, 0, 9, 12289, 0, 0, 0, 0, 0, 0, 0),
+(35121, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(36096, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(36111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(36541, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(37165, 0, 8, 2098176, 0, 0, 0, 0, 0, 0, 0),
+(37168, 0, 8, 4063232, 9, 0, 0, 0, 0, 0, 0),
+(37170, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0),
+(37173, 0, 8, 750519704, 262, 0, 0, 0, 0, 0, 30),
+(37189, 0, 10, 3221225472, 0, 0, 0, 2, 0, 0, 60),
+(37193, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(37195, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(37197, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 45),
+(37213, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(37214, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(37227, 0, 11, 448, 0, 0, 0, 2, 0, 0, 60),
+(37237, 0, 11, 1, 0, 0, 0, 2, 0, 0, 0),
+(37247, 8, 0, 0, 0, 0, 0, 65536, 0, 0, 45),
+(37377, 32, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(37379, 32, 5, 0, 0, 0, 0, 0, 0, 0, 0),
+(37384, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0),
+(37443, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(37514, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(37516, 0, 4, 1024, 0, 0, 0, 0, 0, 0, 0),
+(37519, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0),
+(37523, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(37528, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0),
+(37536, 0, 4, 65536, 0, 0, 0, 0, 0, 0, 0),
+(37568, 0, 6, 2048, 0, 0, 0, 0, 0, 0, 0),
+(37594, 0, 6, 4096, 0, 0, 0, 0, 0, 0, 0),
+(37600, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(37601, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(37603, 0, 6, 32768, 0, 0, 0, 0, 0, 0, 0),
+(37655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(37657, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3),
+(38026, 1, 0, 0, 0, 0, 0, 256, 0, 0, 0),
+(38031, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(38290, 0, 0, 0, 0, 0, 0, 0, 1.6, 0, 0),
+(38326, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(38327, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(38334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(38347, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(38350, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(38394, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0),
+(38857, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(39027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(39372, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+(39437, 4, 5, 4964, 192, 0, 0, 65536, 0, 0, 0),
+(39442, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0),
+(39443, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(39530, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(39958, 0, 0, 0, 0, 0, 0, 0, 0.7, 0, 40),
+(40407, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0),
+(40438, 0, 6, 32832, 0, 0, 0, 0, 0, 0, 0),
+(40442, 0, 7, 20, 1088, 0, 0, 0, 0, 0, 0),
+(40444, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(40458, 0, 4, 33554432, 1537, 0, 0, 0, 0, 0, 0),
+(40463, 0, 11, 129, 16, 0, 0, 0, 0, 0, 0),
+(40470, 0, 10, 3229614080, 0, 0, 0, 0, 0, 0, 0),
+(40475, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0),
+(40478, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0),
+(40482, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(40485, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0),
+(40899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(41034, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(41260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(41262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(41381, 0, 0, 0, 0, 0, 0, 256, 0, 0, 0),
+(41393, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(41434, 0, 0, 0, 0, 0, 0, 0, 2, 0, 45),
+(41469, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0),
+(41635, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(41989, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0),
+(42083, 0, 0, 0, 0, 0, 0, 2, 0, 0, 45),
+(42135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90),
+(42136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90),
+(42368, 0, 10, 1073741824, 0, 0, 0, 0, 0, 0, 0),
+(42370, 0, 11, 64, 0, 0, 0, 0, 0, 0, 0),
+(42770, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(43019, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(43020, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(43338, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(43443, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(43726, 0, 10, 1073741824, 0, 0, 0, 0, 0, 0, 0),
+(43728, 0, 11, 128, 0, 0, 0, 0, 0, 0, 0),
+(43737, 0, 7, 0, 1088, 0, 0, 0, 0, 0, 10),
+(43739, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(43741, 0, 10, 2147483648, 0, 0, 0, 0, 0, 0, 0),
+(43745, 0, 10, 0, 512, 0, 0, 0, 0, 0, 0),
+(43748, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(43750, 0, 11, 1, 0, 0, 0, 0, 0, 0, 0),
+(43819, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(44394, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(44395, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(44396, 0, 0, 0, 0, 0, 0, 1024, 0, 0, 0),
+(44401, 0, 3, 2097152, 0, 0, 0, 4095, 0, 0, 0),
+(44404, 0, 3, 536870945, 36864, 0, 0, 0, 0, 0, 0),
+(44442, 0, 3, 8388608, 64, 0, 0, 65536, 0, 0, 1),
+(44443, 0, 3, 8388608, 64, 0, 0, 65536, 0, 0, 1),
+(44445, 0, 3, 19, 4096, 0, 0, 0, 0, 0, 0),
+(44446, 0, 3, 19, 4096, 0, 0, 0, 0, 0, 0),
+(44448, 0, 3, 19, 4096, 0, 0, 0, 0, 0, 0),
+(44449, 0, 3, 551686775, 102472, 0, 0, 2, 0, 0, 0),
+(44469, 0, 3, 551686775, 102472, 0, 0, 2, 0, 0, 0),
+(44470, 0, 3, 551686775, 102472, 0, 0, 2, 0, 0, 0),
+(44471, 0, 3, 551686775, 102472, 0, 0, 2, 0, 0, 0),
+(44472, 0, 3, 551686775, 102472, 0, 0, 2, 0, 0, 0),
+(44546, 0, 3, 33555104, 0, 0, 0, 0, 0, 0, 0),
+(44548, 0, 3, 33555104, 0, 0, 0, 0, 0, 0, 0),
+(44549, 0, 3, 33555104, 0, 0, 0, 0, 0, 0, 0),
+(44835, 0, 7, 0, 128, 0, 16, 0, 0, 0, 0),
+(45054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15),
+(45057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30),
+(45234, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(45243, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(45244, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(45354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(45481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(45482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(45483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(45484, 0, 0, 0, 0, 0, 16384, 0, 0, 0, 45),
+(46025, 32, 6, 0, 0, 0, 0, 0, 0, 0, 0),
+(46092, 0, 10, 1073741824, 0, 0, 0, 0, 0, 0, 0),
+(46098, 0, 11, 128, 0, 0, 0, 0, 0, 0, 0),
+(46569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(46662, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20),
+(46832, 0, 7, 1, 0, 0, 0, 65536, 0, 0, 0),
+(46854, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(46855, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(46867, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(46913, 0, 4, 0, 1024, 0, 0, 2, 0, 0, 0),
+(46914, 0, 4, 0, 1024, 0, 0, 2, 0, 0, 0),
+(46915, 0, 4, 0, 1024, 0, 0, 2, 0, 0, 0),
+(46916, 0, 4, 0, 1024, 0, 0, 2, 0, 0, 0),
+(46951, 0, 4, 1024, 64, 0, 0, 0, 0, 0, 0),
+(46952, 0, 0, 1024, 64, 0, 0, 0, 0, 0, 0),
+(46953, 0, 0, 1024, 64, 0, 0, 0, 0, 0, 0),
+(47195, 0, 5, 2, 0, 0, 0, 0, 0, 0, 30),
+(47196, 0, 5, 2, 0, 0, 0, 0, 0, 0, 30),
+(47197, 0, 5, 2, 0, 0, 0, 0, 0, 0, 30),
+(47201, 0, 5, 8, 262144, 0, 0, 65536, 0, 0, 0),
+(47202, 0, 5, 8, 262144, 0, 0, 0, 0, 0, 0),
+(47203, 0, 5, 8, 262144, 0, 0, 0, 0, 0, 0),
+(47204, 0, 5, 8, 262144, 0, 0, 0, 0, 0, 0),
+(47205, 0, 5, 8, 262144, 0, 0, 0, 0, 0, 0),
+(47232, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47234, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47235, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47245, 32, 5, 0, 0, 0, 0, 0, 0, 0, 0),
+(47246, 32, 5, 0, 0, 0, 0, 0, 0, 0, 0),
+(47247, 32, 5, 0, 0, 0, 0, 0, 0, 0, 0),
+(47258, 0, 5, 0, 8388608, 0, 0, 65536, 0, 0, 0),
+(47259, 0, 5, 0, 8388608, 0, 0, 65536, 0, 0, 0),
+(47260, 0, 5, 0, 8388608, 0, 0, 65536, 0, 0, 0),
+(47263, 32, 5, 0, 0, 0, 0, 2, 0, 0, 20),
+(47264, 32, 5, 0, 0, 0, 0, 2, 0, 0, 20),
+(47265, 32, 5, 0, 0, 0, 0, 2, 0, 0, 20),
+(47509, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47511, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47515, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(47516, 0, 6, 6144, 65536, 0, 0, 0, 0, 0, 0),
+(47517, 0, 6, 6144, 65536, 0, 0, 0, 0, 0, 0),
+(47535, 0, 6, 6144, 8388608, 0, 0, 0, 0, 0, 0),
+(47536, 0, 6, 6144, 8388608, 0, 0, 0, 0, 0, 0),
+(47537, 0, 6, 6144, 8388608, 0, 0, 0, 0, 0, 0),
+(47538, 0, 6, 6144, 8388608, 0, 0, 0, 0, 0, 0),
+(47539, 0, 6, 6144, 8388608, 0, 0, 0, 0, 0, 0),
+(47549, 0, 6, 0, 131072, 0, 0, 0, 0, 0, 0),
+(47551, 0, 6, 0, 131072, 0, 0, 0, 0, 0, 0),
+(47552, 0, 6, 0, 131072, 0, 0, 0, 0, 0, 0),
+(47555, 0, 6, 6144, 0, 0, 0, 0, 0, 0, 0),
+(47556, 0, 6, 6144, 0, 0, 0, 0, 0, 0, 0),
+(47557, 0, 6, 6144, 0, 0, 0, 0, 0, 0, 0),
+(47572, 0, 6, 65536, 0, 0, 0, 0, 0, 0, 0),
+(47580, 0, 6, 0, 0, 64, 0, 65536, 0, 0, 0),
+(47581, 0, 6, 0, 0, 64, 0, 65536, 0, 0, 0),
+(47582, 0, 6, 0, 0, 64, 0, 65536, 0, 0, 0),
+(48110, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(48111, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(48112, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(48113, 0, 0, 0, 0, 0, 656040, 0, 0, 0, 0),
+(48159, 0, 6, 8192, 0, 0, 0, 0, 0, 0, 0),
+(48160, 0, 6, 8192, 0, 0, 0, 0, 0, 0, 0),
+(48483, 0, 7, 34816, 1088, 0, 0, 0, 0, 0, 0),
+(48484, 0, 7, 34816, 1088, 0, 0, 0, 0, 0, 0),
+(48485, 0, 7, 34816, 1088, 0, 0, 0, 0, 0, 0),
+(48496, 0, 7, 96, 33554434, 0, 0, 2, 0, 0, 0),
+(48499, 0, 7, 96, 33554434, 0, 0, 2, 0, 0, 0),
+(48500, 0, 7, 96, 33554434, 0, 0, 2, 0, 0, 0),
+(48506, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0),
+(48510, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0),
+(48511, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0),
+(48516, 0, 7, 5, 0, 0, 0, 2, 0, 0, 30),
+(48521, 0, 7, 5, 0, 0, 0, 2, 0, 0, 30),
+(48525, 0, 7, 5, 0, 0, 0, 2, 0, 0, 30),
+(48833, 0, 7, 0, 1088, 0, 0, 0, 0, 0, 0),
+(48835, 0, 10, 0, 8, 0, 0, 0, 0, 0, 0),
+(48837, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(48951, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(48952, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(48988, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(49018, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(49137, 0, 15, 0, 16384, 0, 0, 0, 0, 0, 0),
+(49188, 0, 15, 2, 0, 0, 0, 0, 0, 0, 0),
+(49208, 0, 15, 4456448, 0, 0, 0, 0, 0, 0, 0),
+(49222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(49280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(49281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(49283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(49284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(49503, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(49504, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(49529, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(49530, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(49531, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(49532, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(49622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60),
+(49657, 0, 15, 0, 16384, 0, 0, 0, 0, 0, 0),
+(50781, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51123, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51127, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51128, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51129, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51130, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(51349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(51352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(51359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10),
+(51466, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51470, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51474, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(51478, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(51479, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(51556, 0, 11, 192, 0, 16, 0, 2, 0, 0, 0),
+(51557, 0, 11, 192, 0, 16, 0, 2, 0, 0, 0),
+(51558, 0, 11, 192, 0, 16, 0, 2, 0, 0, 0),
+(51562, 0, 11, 256, 0, 16, 0, 0, 0, 0, 0),
+(51563, 0, 11, 256, 0, 16, 0, 0, 0, 0, 0),
+(51564, 0, 11, 256, 0, 16, 0, 0, 0, 0, 0),
+(51565, 0, 11, 256, 0, 16, 0, 0, 0, 0, 0),
+(51566, 0, 11, 256, 0, 16, 0, 0, 0, 0, 0),
+(51625, 0, 8, 268476416, 0, 0, 0, 0, 0, 0, 0),
+(51626, 0, 8, 268476416, 0, 0, 0, 0, 0, 0, 0),
+(51627, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(51628, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(51629, 0, 0, 0, 0, 0, 0, 112, 0, 0, 0),
+(51634, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51635, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51636, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(51664, 0, 8, 131072, 8, 0, 0, 0, 0, 0, 0),
+(51665, 0, 8, 131072, 8, 0, 0, 0, 0, 0, 0),
+(51667, 0, 8, 131072, 8, 0, 0, 0, 0, 0, 0),
+(51668, 0, 8, 131072, 8, 0, 0, 0, 0, 0, 0),
+(51669, 0, 8, 131072, 8, 0, 0, 0, 0, 0, 0),
+(51672, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1),
+(51674, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1),
+(51679, 0, 8, 1, 1, 0, 0, 0, 0, 0, 0),
+(51692, 0, 8, 512, 0, 0, 0, 2, 0, 0, 0),
+(51696, 0, 8, 512, 0, 0, 0, 2, 0, 0, 0),
+(51698, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1),
+(51700, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1),
+(51701, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1),
+(51940, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(51989, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(52004, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(52005, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(52007, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(52008, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0),
+(52020, 0, 7, 32768, 1048576, 0, 0, 0, 0, 0, 0),
+(52127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(52420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30),
+(52423, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(52795, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0),
+(52797, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0),
+(52798, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0),
+(52799, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0),
+(52800, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0),
+(52898, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(53137, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(53138, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(53215, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(53216, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(53217, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0),
+(53221, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0),
+(53222, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0),
+(53224, 0, 9, 0, 1, 0, 0, 0, 0, 0, 0),
+(53228, 0, 9, 32, 16777216, 0, 0, 0, 0, 0, 0),
+(53232, 0, 9, 32, 16777216, 0, 0, 0, 0, 0, 0),
+(53256, 0, 9, 2048, 8388609, 0, 0, 2, 0, 0, 0),
+(53259, 0, 9, 2048, 8388609, 0, 0, 2, 0, 0, 0),
+(53260, 0, 9, 2048, 8388609, 0, 0, 2, 0, 0, 0),
+(53290, 0, 9, 2048, 2147483647, 0, 0, 2, 0, 0, 0),
+(53291, 0, 9, 2048, 2147483647, 0, 0, 2, 0, 0, 0),
+(53292, 0, 9, 2048, 2147483647, 0, 0, 2, 0, 0, 0),
+(53293, 0, 9, 2048, 2147483647, 0, 0, 2, 0, 0, 0),
+(53294, 0, 9, 2048, 2147483647, 0, 0, 2, 0, 0, 0),
+(53380, 0, 10, 8388608, 131072, 0, 0, 2, 0, 0, 0),
+(53381, 0, 10, 8388608, 131072, 0, 0, 2, 0, 0, 0),
+(53382, 0, 10, 8388608, 131072, 0, 0, 2, 0, 0, 0),
+(53383, 0, 10, 8388608, 131072, 0, 0, 2, 0, 0, 0),
+(53384, 0, 10, 8388608, 131072, 0, 0, 2, 0, 0, 0),
+(53486, 0, 10, 8388608, 163840, 0, 0, 2, 0, 0, 0),
+(53488, 0, 10, 8388608, 163840, 0, 0, 2, 0, 0, 0),
+(53501, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(53502, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(53503, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(53551, 0, 10, 4096, 0, 0, 0, 0, 0, 0, 0),
+(53552, 0, 10, 4096, 0, 0, 0, 0, 0, 0, 0),
+(53553, 0, 10, 4096, 0, 0, 0, 0, 0, 0, 0),
+(53569, 0, 10, 2097152, 0, 0, 0, 2, 0, 0, 0),
+(53576, 0, 10, 2097152, 0, 0, 0, 2, 0, 0, 0),
+(53601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6),
+(53671, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(53673, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(54149, 0, 10, 2097152, 0, 0, 0, 2, 0, 0, 0),
+(54151, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(54154, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(54155, 0, 10, 8388608, 0, 0, 0, 0, 0, 0, 0),
+(54278, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(54486, 0, 0, 536870945, 36864, 0, 0, 0, 0, 0, 0),
+(54488, 0, 0, 536870945, 36864, 0, 0, 0, 0, 0, 0),
+(54489, 0, 0, 536870945, 36864, 0, 0, 0, 0, 0, 0),
+(54490, 0, 0, 536870945, 36864, 0, 0, 0, 0, 0, 0),
+(54738, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(54747, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(54749, 0, 0, 0, 0, 0, 0, 65536, 0, 0, 0),
+(54754, 0, 7, 16, 0, 0, 0, 0, 0, 0, 0),
+(54841, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(54936, 0, 10, 1073741824, 0, 0, 0, 0, 0, 0, 0),
+(54937, 0, 10, 2147483648, 0, 0, 0, 0, 0, 0, 0),
+(54939, 0, 10, 32768, 0, 0, 0, 0, 0, 0, 0),
+(55440, 0, 11, 64, 0, 0, 0, 0, 0, 0, 0),
+(55620, 0, 15, 1, 134217728, 0, 0, 0, 0, 0, 0),
+(55623, 0, 15, 1, 134217728, 0, 0, 0, 0, 0, 0),
+(55666, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0),
+(55667, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0),
+(55668, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0),
+(55669, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0),
+(55670, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0),
+(55677, 0, 6, 0, 1, 0, 0, 0, 0, 0, 0),
+(55680, 0, 6, 512, 0, 0, 0, 0, 0, 0, 0),
+(55689, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(56218, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0),
+(56333, 0, 9, 4, 0, 512, 0, 0, 0, 0, 0),
+(56336, 0, 9, 4, 0, 512, 0, 0, 0, 0, 0),
+(56337, 0, 9, 4, 0, 512, 0, 0, 0, 0, 0),
+(56342, 0, 9, 16384, 0, 0, 0, 0, 0, 0, 0),
+(56343, 0, 9, 16384, 0, 0, 0, 0, 0, 0, 0),
+(56344, 0, 9, 16384, 0, 0, 0, 0, 0, 0, 0),
+(56364, 0, 3, 0, 16777216, 0, 0, 0, 0, 0, 0),
+(56451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(56611, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(56612, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(56613, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(56614, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(56636, 0, 4, 32, 0, 0, 0, 0, 0, 0, 0),
+(56637, 0, 4, 32, 0, 0, 0, 0, 0, 0, 0),
+(56638, 0, 4, 32, 0, 0, 0, 0, 0, 0, 0),
+(56821, 0, 8, 2, 0, 0, 0, 2, 0, 0, 0),
+(56822, 0, 15, 2, 0, 0, 0, 0, 0, 0, 0),
+(56834, 0, 15, 4456448, 0, 0, 0, 0, 0, 0, 0),
+(56835, 0, 15, 4456448, 0, 0, 0, 0, 0, 0, 0),
+(57878, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0),
+(57880, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0),
+(57881, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0),
+(57960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3),
+(58357, 0, 4, 64, 0, 0, 0, 2, 0, 0, 0),
+(58364, 0, 4, 1024, 0, 0, 0, 0, 0, 0, 0),
+(58372, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0),
+(58386, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(58435, 0, 5, 2, 256, 0, 0, 0, 0, 0, 0),
+(58436, 0, 5, 2, 256, 0, 0, 0, 0, 0, 0),
+(58437, 0, 5, 2, 256, 0, 0, 0, 0, 0, 0),
+(58616, 0, 15, 262144, 0, 0, 0, 0, 0, 0, 0),
+(58620, 0, 15, 0, 16384, 0, 0, 0, 0, 0, 0),
+(58626, 0, 15, 33554432, 0, 0, 0, 0, 0, 0, 0),
+(58631, 0, 15, 2, 0, 0, 0, 0, 0, 0, 0),
+(58642, 0, 15, 0, 134217728, 0, 0, 0, 0, 0, 0),
+(58644, 0, 15, 0, 4, 0, 0, 0, 0, 0, 0),
+(58647, 0, 15, 0, 4, 0, 0, 0, 0, 0, 0),
+(58676, 0, 15, 0, 8, 0, 0, 0, 0, 0, 0),
+(58677, 0, 15, 8192, 0, 0, 0, 0, 0, 0, 0),
+(58872, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(58874, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0),
+(58901, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(59057, 0, 15, 2, 0, 0, 0, 0, 0, 0, 0),
+(59176, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(59327, 0, 15, 134217728, 0, 0, 0, 0, 0, 0, 0),
+(59725, 0, 0, 0, 0, 0, 0, 2048, 0, 0, 0),
+(60132, 0, 15, 0, 134348800, 0, 0, 0, 0, 0, 0),
+(60170, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0),
+(60172, 0, 5, 262144, 0, 0, 0, 65536, 0, 0, 0),
+(60200, 0, 15, 4096, 0, 0, 0, 65536, 0, 0, 0),
+(60493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45),
+(60503, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0),
+(60537, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0),
+(60564, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60571, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60572, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60573, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60574, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60575, 0, 11, 2416967680, 0, 0, 0, 0, 0, 0, 0),
+(60617, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0),
+(60710, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60717, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60719, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60722, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60724, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60726, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0),
+(60770, 0, 11, 1, 0, 0, 0, 0, 0, 0, 0),
+(60818, 0, 10, 0, 512, 0, 0, 0, 0, 0, 0),
+(60826, 0, 15, 20971520, 0, 0, 0, 0, 0, 0, 0),
+(61188, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0),
+(61257, 0, 0, 0, 0, 0, 131752, 65536, 0, 0, 0),
+(61324, 0, 10, 0, 131072, 0, 0, 0, 0, 0, 0),
+(61846, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0),
+(61847, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0);
diff --git a/sql/updates/1206_world_scripts.sql b/sql/updates/1206_world_scripts.sql
new file mode 100644
index 00000000000..b35e054f57c
--- /dev/null
+++ b/sql/updates/1206_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `gameobject_template` SET `ScriptName`='go_legion_obelisk' WHERE `entry` IN (185193,185195,185196,185197,185198); \ No newline at end of file
diff --git a/sql/updates/1207_world_scripts.sql b/sql/updates/1207_world_scripts.sql
new file mode 100644
index 00000000000..070a4af8597
--- /dev/null
+++ b/sql/updates/1207_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `ScriptName`='npc_surristrasz' WHERE `entry`=24795;
+UPDATE `creature_template` SET `ScriptName`='npc_tiare' WHERE `entry`=30051; \ No newline at end of file
diff --git a/sql/updates/1211_world.sql b/sql/updates/1211_world.sql
deleted file mode 100644
index 437fd6ddaa1..00000000000
--- a/sql/updates/1211_world.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-DELETE FROM spell_proc_event where entry IN (31124, 31126);
-INSERT INTO spell_proc_event () VALUES
-(31124, 0, 8, 553648142, 0, 0, 0, 0, 0),
-(31126, 0, 8, 553648142, 0, 0, 0, 0, 0);
diff --git a/sql/updates/1234_world.sql b/sql/updates/1234_world.sql
deleted file mode 100644
index be2a0eaaef7..00000000000
--- a/sql/updates/1234_world.sql
+++ /dev/null
@@ -1,31 +0,0 @@
-DELETE FROM `spell_affect` WHERE `entry`='14177' AND `effectId`='0';
-INSERT INTO `spell_affect` VALUES ('14177', '0', '61741335326');
-
-DELETE FROM `spell_affect` WHERE `entry`='13733' AND `effectId`='1';
-DELETE FROM `spell_affect` WHERE `entry`='13865' AND `effectId`='1';
-DELETE FROM `spell_affect` WHERE `entry`='13866' AND `effectId`='1';
-INSERT INTO `spell_affect` VALUES ('13733', '1', '25769803776');
-INSERT INTO `spell_affect` VALUES ('13865', '1', '25769803776');
-INSERT INTO `spell_affect` VALUES ('13866', '1', '25769803776');
-
-DELETE FROM `spell_affect` WHERE `entry`='31234' AND `effectId`='0';
-DELETE FROM `spell_affect` WHERE `entry`='31235' AND `effectId`='0';
-DELETE FROM `spell_affect` WHERE `entry`='31236' AND `effectId`='0';
-DELETE FROM `spell_affect` WHERE `entry`='31237' AND `effectId`='0';
-DELETE FROM `spell_affect` WHERE `entry`='31238' AND `effectId`='0';
-INSERT INTO `spell_affect` VALUES ('31234', '0', '1125920146191');
-INSERT INTO `spell_affect` VALUES ('31235', '0', '1125920146191');
-INSERT INTO `spell_affect` VALUES ('31236', '0', '1125920146191');
-INSERT INTO `spell_affect` VALUES ('31237', '0', '1125920146191');
-INSERT INTO `spell_affect` VALUES ('31238', '0', '1125920146191');
-
-DELETE FROM `spell_proc_event` WHERE `entry`='14186';
-DELETE FROM `spell_proc_event` WHERE `entry`='14190';
-DELETE FROM `spell_proc_event` WHERE `entry`='14193';
-DELETE FROM `spell_proc_event` WHERE `entry`='14194';
-DELETE FROM `spell_proc_event` WHERE `entry`='14195';
-INSERT INTO `spell_proc_event` VALUES ('14186', '0', '8', '26851935496', '0', '2', '0', '0', '1');
-INSERT INTO `spell_proc_event` VALUES ('14190', '0', '8', '26851935496', '0', '2', '0', '0', '1');
-INSERT INTO `spell_proc_event` VALUES ('14193', '0', '8', '26851935496', '0', '2', '0', '0', '1');
-INSERT INTO `spell_proc_event` VALUES ('14194', '0', '8', '26851935496', '0', '2', '0', '0', '1');
-INSERT INTO `spell_proc_event` VALUES ('14195', '0', '8', '26851935496', '0', '2', '0', '0', '1');
diff --git a/sql/updates/1236_world.sql b/sql/updates/1236_world.sql
deleted file mode 100644
index 43d7d58d588..00000000000
--- a/sql/updates/1236_world.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-DELETE FROM `spell_proc_event` WHERE `entry` = 36070;
-INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
-(36070, 0x00, 0, 0x00000000, 0x00000008, 0x00000000, 0.000000, 0.000000, 0);
-
diff --git a/sql/updates/1237_mangos_7230_01_world_spell_bonus_data.sql b/sql/updates/1237_mangos_7230_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..4b12bf6c546
--- /dev/null
+++ b/sql/updates/1237_mangos_7230_01_world_spell_bonus_data.sql
@@ -0,0 +1,9 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7230_01_mangos_spell_chain required_7230_02_mangos_spell_bonus_data bit;*/
+
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (18220,18937,18938,27265,59092);
+INSERT INTO `spell_bonus_data` VALUES
+('18220', '0.96', '0', '0', 'Warlock - Dark Pact Rank 1'),
+('18937', '0.96', '0', '0', 'Warlock - Dark Pact Rank 2'),
+('18938', '0.96', '0', '0', 'Warlock - Dark Pact Rank 3'),
+('27265', '0.96', '0', '0', 'Warlock - Dark Pact Rank 4'),
+('59092', '0.96', '0', '0', 'Warlock - Dark Pact Rank 5'); \ No newline at end of file
diff --git a/sql/updates/1248_mangos_7235_01_world_command.sql b/sql/updates/1248_mangos_7235_01_world_command.sql
new file mode 100644
index 00000000000..0a28f49fc6e
--- /dev/null
+++ b/sql/updates/1248_mangos_7235_01_world_command.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7230_02_mangos_spell_bonus_data required_7235_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` = 'reset achievements';
+INSERT INTO `command` VALUES
+('reset achievements',3,'Syntax: .reset achievements [$playername]\r\n\r\nReset achievements data for selected or named (online or offline) character. Achievements for persistance progress data like completed quests/etc re-filled at reset. Achievements for events like kills/casts/etc will lost.'); \ No newline at end of file
diff --git a/sql/updates/1288_mangos_7242_01_world_spell_bonus_data.sql b/sql/updates/1288_mangos_7242_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..62ea0ef7771
--- /dev/null
+++ b/sql/updates/1288_mangos_7242_01_world_spell_bonus_data.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7235_01_mangos_command required_7242_01_mangos_spell_bonus_data bit;*/
+
+DELETE FROM spell_bonus_data WHERE entry IN (34913, 43043, 43044);
+INSERT INTO spell_bonus_data VALUES
+ (34913, 0, 0, 0, 'Mage - Molten Armor Triggered Rank 1'),
+ (43043, 0, 0, 0, 'Mage - Molten Armor Triggered Rank 2'),
+ (43044, 0, 0, 0, 'Mage - Molten Armor Triggered Rank 3'); \ No newline at end of file
diff --git a/sql/updates/1293_mangos_7249_01_world_spell_proc_event.sql b/sql/updates/1293_mangos_7249_01_world_spell_proc_event.sql
new file mode 100644
index 00000000000..dc4bab32473
--- /dev/null
+++ b/sql/updates/1293_mangos_7249_01_world_spell_proc_event.sql
@@ -0,0 +1,3 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7242_01_mangos_spell_bonus_data required_7249_01_mangos_spell_proc_event bit;*/
+
+DELETE FROM `spell_proc_event` WHERE `entry`='60200'; \ No newline at end of file
diff --git a/sql/updates/1296_mangos_7252_01_world_command.sql b/sql/updates/1296_mangos_7252_01_world_command.sql
new file mode 100644
index 00000000000..ffbdda8cfc0
--- /dev/null
+++ b/sql/updates/1296_mangos_7252_01_world_command.sql
@@ -0,0 +1,6 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7251_01_mangos_spell_chain required_7252_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('debug arena','debug bg');
+INSERT INTO `command` VALUES
+('debug arena',3,'Syntax: .debug arena\r\n\r\nToggle debug mode for arenas. In debug mode GM can start arena with single player.'),
+('debug bg',3,'Syntax: .debug bg\r\n\r\nToggle debug mode for battlegrounds. In debug mode GM can start battleground with single player.'); \ No newline at end of file
diff --git a/sql/updates/1296_mangos_7252_02_world_trinity_string.sql b/sql/updates/1296_mangos_7252_02_world_trinity_string.sql
new file mode 100644
index 00000000000..021508502b9
--- /dev/null
+++ b/sql/updates/1296_mangos_7252_02_world_trinity_string.sql
@@ -0,0 +1,14 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7252_01_mangos_command required_7252_02_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE entry IN (737,738,739,740,741,742,743,744,745,746);
+INSERT INTO `trinity_string` VALUES
+(737,'Arenas are set to 1v1 for debugging. So, don\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(738,'Arenas are set to normal playercount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(739,'Battlegrounds are set to 1v0 for debugging.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(740,'Battlegrounds are set to normal playercount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(741,'Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(742,'Distributing arena points to players...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(743,'Finished setting arena points for online players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(744,'Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(745,'Modification done.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(746,'Done flushing Arena points.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1299_mangos_7255_01_characters_characters.sql b/sql/updates/1299_mangos_7255_01_characters_characters.sql
new file mode 100644
index 00000000000..236339bd5a3
--- /dev/null
+++ b/sql/updates/1299_mangos_7255_01_characters_characters.sql
@@ -0,0 +1,10 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7251_02_characters_character_spell required_7255_01_characters_characters bit;*/
+
+ALTER TABLE `characters`
+ ADD COLUMN `bgid` int(10) unsigned NOT NULL default '0' AFTER `latency`,
+ ADD COLUMN `bgteam` int(10) unsigned NOT NULL default '0' AFTER `bgid`,
+ ADD COLUMN `bgmap` int(10) unsigned NOT NULL default '0' AFTER `bgteam`,
+ ADD COLUMN `bgx` float NOT NULL default '0' AFTER `bgmap`,
+ ADD COLUMN `bgy` float NOT NULL default '0' AFTER `bgx`,
+ ADD COLUMN `bgz` float NOT NULL default '0' AFTER `bgy`,
+ ADD COLUMN `bgo` float NOT NULL default '0' AFTER `bgz`; \ No newline at end of file
diff --git a/sql/updates/1304_world.sql b/sql/updates/1304_world.sql
deleted file mode 100644
index 9eff09829dc..00000000000
--- a/sql/updates/1304_world.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DELETE FROM command WHERE name IN ('reload spell_linked_spell');
-INSERT INTO command (name, security, help) VALUES
-('reload spell_linked_spell','3','Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.'); \ No newline at end of file
diff --git a/sql/updates/1307_world.sql b/sql/updates/1307_world.sql
new file mode 100644
index 00000000000..ec7c218c0a1
--- /dev/null
+++ b/sql/updates/1307_world.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_stormwind_harbor_taxi' WHERE `entry`=29154; \ No newline at end of file
diff --git a/sql/updates/1311_characters.sql b/sql/updates/1311_characters.sql
deleted file mode 100644
index 2ab9c8ecd93..00000000000
--- a/sql/updates/1311_characters.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP TABLE IF EXISTS `has_logged_in_before`;
diff --git a/sql/updates/1312_world.sql b/sql/updates/1312_world.sql
new file mode 100644
index 00000000000..01a27d0fa48
--- /dev/null
+++ b/sql/updates/1312_world.sql
@@ -0,0 +1,16 @@
+UPDATE `creature_template` SET `scriptname` = 'boss_keleseth' WHERE `entry` = '23953';
+UPDATE `creature_template` SET `scriptname` = 'mob_frost_tomb' WHERE `entry` = '23965';
+UPDATE `instance_template` SET `script`='instance_utgarde_keep' WHERE `map`= '574';
+
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1574000, 'Your blood is mine!',13221,1,0,'keleseth SAY_AGGRO'),
+(-1574001, 'Darkness waits',13223,1,0, 'keleseth SAY_KILL'),
+(-1574002, 'I join... the night.',13225,1,0, 'keleseth SAY_DEATH'),
+(-1574003, 'Not so fast.',13222,1,0, 'keleseth SAY_FROST_TOMB'),
+(-1574004, 'Aranal, lidel! Their fate shall be yours!',13224,1,0, 'keleseth SAY_SKELETONS');
+
+-- DB Data for testing
+-- REPLACE INTO `creature_template` (`entry`, `heroic_entry`, `modelid_A`, `modelid_A2`, `modelid_H`, `modelid_H2`, `name`, `subname`, `IconName`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `baseattacktime`, `rangeattacktime`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `class`, `race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `RacialLeader`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`) VALUES
+-- (23953, 0, 25338, 0, 25338, 0, 'Prince Keleseth', NULL, NULL, 70, 80, 192200, 417056, 0, 0, 6700, 16, 16, 2, 1, 1, 0, 445, 1200, 0, 58, 2000, 2200, 0, 0, 0, 0, 0, 0, 0, 1, 2, 100, 6, 76, 23953, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 3, 3, 0, 0, 0, 0, 'boss_keleseth'),
+-- (23965, 0, 25865, 0, 25865, 0, 'Frost Tomb', NULL, NULL, 70, 80, 7345, 10465, 0, 0, 6700, 16, 16, 0, 1, 1, 0, 445, 1200, 0, 58, 2000, 2200, 0, 0, 0, 0, 0, 0, 0, 1, 2, 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 3, 3, 0, 0, 0, 0, 'mob_frost_tomb'),
+-- (23970, 0, 27651, 0, 27651, 0, 'Vrykul Skeleton', NULL, NULL, 70, 80, 7345, 10465, 0, 0, 6700, 16, 16, 0, 1, 1, 0, 445, 1200, 0, 58, 2000, 2200, 0, 0, 0, 0, 0, 0, 0, 1, 2, 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0', 0, 3, 3, 0, 716, 0, 0, '0'); \ No newline at end of file
diff --git a/sql/updates/1327_world.sql b/sql/updates/1327_world.sql
new file mode 100644
index 00000000000..e7925102863
--- /dev/null
+++ b/sql/updates/1327_world.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `creature_template` ADD COLUMN `spell5` mediumint(8) unsigned NOT NULL default '0' AFTER `spell4`;
+ALTER TABLE `creature_template` ADD COLUMN `spell6` mediumint(8) unsigned NOT NULL default '0' AFTER `spell5`;
+ALTER TABLE `creature_template` ADD COLUMN `spell7` mediumint(8) unsigned NOT NULL default '0' AFTER `spell6`;
+ALTER TABLE `creature_template` ADD COLUMN `spell8` mediumint(8) unsigned NOT NULL default '0' AFTER `spell7`; \ No newline at end of file
diff --git a/sql/updates/1340_world.sql b/sql/updates/1340_world.sql
deleted file mode 100644
index eba0b719dbc..00000000000
--- a/sql/updates/1340_world.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-DELETE FROM `spell_affect` WHERE `entry`='12472' AND `effectId`='1';
-INSERT INTO `spell_affect` VALUES ('12472', '1', "18446744073709551615");
diff --git a/sql/updates/1351_world.sql b/sql/updates/1351_world.sql
new file mode 100644
index 00000000000..a3b797f8a4f
--- /dev/null
+++ b/sql/updates/1351_world.sql
@@ -0,0 +1,784 @@
+DROP TABLE IF EXISTS `trinity_string`;
+CREATE TABLE IF NOT EXISTS `trinity_string` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `mangos_string`
+--
+
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(1, 'You should select a character or a creature.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(2, 'You should select a creature.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(3, '|cffff0000[System Message]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(4, '|cffff0000[Event Message]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5, 'There is no help for that command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(6, 'There is no such command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(7, 'There is no such subcommand', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(8, 'Command %s have subcommands:%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(9, 'Commands available to you:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10, 'Incorrect syntax.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(11, 'Your account level is: %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(12, 'Online players: %u (max: %u) Queued players: %u (max: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(13, 'Server uptime: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(14, 'Player saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(15, 'All players saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(16, 'There are the following active GMs on this server:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(17, 'There are no GMs currently logged in on this server.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(18, 'Cannot do that while flying.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(19, 'Cannot do that in Battlegrounds.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(20, 'Target is flying you can''t do that.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(21, '%s is flying command failed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(22, 'You are not mounted so you can''t dismount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(23, 'Cannot do that while fighting.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(24, 'You used it recently.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(25, 'Password not changed (unknown error)!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(26, 'The password was changed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(27, 'The new passwords do not match or the old password is wrong', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(28, 'Your account is now locked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(29, 'Your account is now unlocked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(30, ', rank ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(31, ' [known]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(32, ' [learn]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(33, ' [passive]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(34, ' [talent]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(35, ' [active]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(36, ' [complete]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(37, ' (offline)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(38, 'on', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(39, 'off', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(40, 'You are: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(41, 'visible', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(42, 'invisible', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(43, 'done', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(44, 'You', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(45, ' <unknown> ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(46, '<error>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(47, '<non-existing character>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(48, 'UNKNOWN', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(49, 'You must be at least level %u to enter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(50, 'You must be at least level %u and have item %s to enter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(51, 'Hello! Ready for some training?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(52, 'Invaid item count (%u) for item %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(53, 'Mail can''t have more %u item stacks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(54, 'The new passwords do not match', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(55, 'Your password can''t be longer than 16 characters (client limit), password not changed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(56, 'Current Message of the day: \r\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(57, 'Using World DB: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(58, 'Using script library: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(100, 'Global notify: ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(101, 'Map: %u (%s) Zone: %u (%s) Area: %u (%s)\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(102, '%s is already being teleported.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(103, 'You can summon a player to your instance only if he is in your party with you as leader.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(104, 'You cannot go to the player''s instance because you are in a party now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(105, 'You can go to the player''s instance while not being in his party only if your GM mode is on.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(106, 'You can not go to player %s from instance to instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(107, 'You can not summon player %s from instance to instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(108, 'You are summoning %s%s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(109, 'You are being summoned by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(110, 'You are teleporting %s%s to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(111, 'You are being teleported by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(112, 'Player (%s) does not exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(113, 'Appearing at %s''s location.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(114, '%s is appearing to your location.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(115, 'Incorrect values.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(116, 'No character selected.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(117, '%s is not in a group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(118, 'You changed HP of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(119, '%s changed your HP to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(120, 'You changed MANA of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(121, '%s changed your MANA to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(122, 'You changed ENERGY of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(123, '%s changed your ENERGY to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(124, 'Current energy: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(125, 'You changed rage of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(126, '%s changed your rage to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(127, 'You changed level of %s to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(128, 'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(129, 'Wrong faction: %u (not found in factiontemplate.dbc).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(130, 'You changed GUID=%i ''s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(131, 'You changed the spellflatid=%i, val= %i, mark =%i to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(132, '%s changed your spellflatid=%i, val= %i, mark =%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(133, '%s has access to all taxi nodes now (until logout).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(134, '%s has no more access to all taxi nodes now (only visited accessible).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(135, '%s has given you access to all taxi nodes (until logout).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(136, '%s has removed access to all taxi nodes (only visited still accessible).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(137, 'You set all speeds to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(138, '%s set all your speeds to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(139, 'You set the speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(140, '%s set your speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(141, 'You set the swim speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(142, '%s set your swim speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(143, 'You set the backwards run speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(144, '%s set your backwards run speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(145, 'You set the fly speed to %2.2f from normal of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(146, '%s set your fly speed to %2.2f from normal.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(147, 'You set the size %2.2f of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(148, '%s set your size to %2.2f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(149, 'There is no such mount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(150, 'You give a mount to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(151, '%s gave you a mount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(152, 'USER1: %i, ADD: %i, DIF: %i\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(153, 'You take all copper of %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(154, '%s took you all of your copper.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(155, 'You take %i copper from %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(156, '%s took %i copper from you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(157, 'You give %i copper to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(158, '%s gave you %i copper.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(159, 'You hear sound %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(160, 'USER2: %i, ADD: %i, RESULT: %i\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(161, 'Removed bit %i in field %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(162, 'Set bit %i in field %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(163, 'Teleport location table is empty!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(164, 'Teleport location not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(165, 'Requires search parameter.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(166, 'There are no teleport locations matching your request.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(168, 'Locations found are:\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(169, 'Mail sent to %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(170, 'You try to hear sound %u but it doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(172, 'server console command', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(173, 'You changed runic power of %s to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(174, '%s changed your runic power to %i/%i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(200, 'No selection.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(201, 'Object GUID is: lowpart %u highpart %X', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(202, 'The name was too long by %i characters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(203, 'Error, name can only contain characters A-Z and a-z.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(204, 'The subname was too long by %i characters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(205, 'Not yet implemented', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(206, 'Item ''%i'' ''%s'' added to list with maxcount ''%i'' and incrtime ''%i'' and extendedcost ''%i''', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(207, 'Item ''%i'' not found in database.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(208, 'Item ''%i'' ''%s'' deleted from vendor list', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(209, 'Item ''%i'' not found in vendor list.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(210, 'Item ''%i'' already in vendor list.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(211, 'Spells of %s reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(212, 'Spells of %s will reset at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(213, 'Talents of %s reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(214, 'Talents of %s will reset at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(215, 'Your spells have been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(216, 'Your talents have been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(217, 'Unknown case ''%s'' for .resetall command. Type full correct case name.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(218, 'Spells will reset for all players at login. Strongly recommend re-login!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(219, 'Talents will reset for all players at login. Strongly recommend re-login!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(220, 'Creature (GUID: %u) No waypoint found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(221, 'Creature (GUID: %u) Last waypoint not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(222, 'Creature (GUID: %u) No waypoint found - used ''wpguid''. Now trying to find it by its position...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(223, 'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(224, 'Selected creature is ignored - provided GUID is used', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(225, 'Creature (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(226, 'You must select a visual waypoint.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(227, 'No visual waypoints found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(228, 'Could not create visual waypoint with creatureID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(229, 'All visual waypoints removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(230, 'Could not create waypoint-creature with ID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(231, 'No GUID provided.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(232, 'No waypoint number provided.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(233, 'Argument required for ''%s''.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(234, 'Waypoint %i added to GUID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(235, 'Waypoint %d added.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(236, 'Waypoint changed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(237, 'Waypoint %s modified.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(238, 'WP export successfull.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(239, 'No waypoints found inside the database.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(240, 'File imported.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(241, 'Waypoint removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(242, 'Warning: Could not delete WP from the world with ID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(243, 'This happens if the waypoint is too far away from your char.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(244, 'The WP is deleted from the database, but not from the world here.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(245, 'They will disappear after a server restart.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(246, 'Waypoint %d: Info for creature: %s, GUID: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(247, 'Waittime: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(248, 'Model %d: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(249, 'Emote: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(250, 'Spell: %d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(251, 'Text%d (ID: %i): %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(252, 'AIScript: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(253, 'Forced rename for player %s will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(254, 'Forced rename for player %s (GUID #%u) will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(255, 'Waypoint-Creature (GUID: %u) Not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(256, 'Could not find NPC...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(257, 'Creature movement type set to ''%s'', waypoints removed (if any).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(258, 'Creature movement type set to ''%s'', waypoints were not removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(259, 'Incorrect value, use on or off', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(260, 'Value saved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(261, 'Value saved, you may need to rejoin or clean your client cache.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(262, 'Areatrigger ID %u not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(263, 'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(264, 'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(265, 'Zone %u (%s) is part of instanceable map %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(266, 'Nothing found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(267, 'Object not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(268, 'Creature not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(269, 'Warning: Mob found more than once - you will be teleported to the first one found in DB.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(270, 'Creature Removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(271, 'Creature moved.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(272, 'Creature (GUID:%u) must be on the same map as player!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(273, 'Game Object (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(274, 'Game Object (GUID: %u) has references in not found creature %u GO list, can''t be deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(275, 'Game Object (GUID: %u) removed', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(276, 'Game Object (GUID: %u) turned', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(277, 'Game Object (GUID: %u) moved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(278, 'You must select a vendor', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(279, 'You must send id for item', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(280, 'Vendor has too many items (max 128)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(281, 'You can''t kick self, logout instead', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(282, 'Player %s kicked.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(283, 'Player %s not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(284, 'Accepting Whisper: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(285, 'Accepting Whisper: ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(286, 'Accepting Whisper: OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(287, 'Creature (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(288, 'Tickets count: %i show new tickets: %s\n', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(289, 'New ticket from %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(290, 'Ticket of %s (Last updated: %s):\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(291, 'New ticket show: ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(292, 'New ticket show: OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(293, 'Ticket %i doesn''t exist', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(294, 'All tickets deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(295, 'Character %s ticket deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(296, 'Ticket deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(297, 'Spawn distance changed to: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(298, 'Spawn time changed to: %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(299, 'The honor of %s was set to %u!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(300, 'Your chat has been disabled for %u minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(301, 'You have disabled %s''s chat for %u minutes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(302, 'Player''s chat is already enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(303, 'Your chat has been enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(304, 'You have enabled %s''s chat.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(305, 'Faction %s (%u) reputation of %s was set to %5d!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(306, 'The arena points of %s was set to %u!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(307, 'No faction found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(308, 'Faction %i unknown!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(309, 'Invalid parameter %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(310, 'delta must be between 0 and %d (inclusive)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(311, '%d - |cffffffff|Hfaction:%d|h[%s]|h|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(312, ' [visible]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(313, ' [at war]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(314, ' [peace forced]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(315, ' [hidden]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(316, ' [invisible forced]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(317, ' [inactive]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(318, 'Hated', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(319, 'Hostile', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(320, 'Unfriendly', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(321, 'Neutral', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(322, 'Friendly', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(323, 'Honored', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(324, 'Revered', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(325, 'Exalted', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(326, 'Faction %s (%u) can''not have reputation.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(327, ' [no reputation]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(328, 'Characters at account %s (Id: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(329, ' %s (GUID %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(330, 'No players found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(331, 'Extended item cost %u not exist', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(332, 'GM mode is ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(333, 'GM mode is OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(334, 'GM Chat Badge is ON', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(335, 'GM Chat Badge is OFF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(336, 'You repair all %s''s items.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(337, 'All your items repaired by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(338, 'You set waterwalk mode %s for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(339, 'Your waterwalk mode %s by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(340, '%s is now following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(341, '%s is not following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(342, '%s is now not following you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(343, 'Creature (Entry: %u) cannot be tamed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(344, 'You already have pet.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(345, 'Forced customize for player %s will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(346, 'Forced customize for player %s (GUID #%u) will be requested at next login.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(400, '|cffff0000[System Message]:|rScripts reloaded', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(401, 'You change security level of account %s to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(402, '%s changed your security level to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(403, 'You have low security level for this.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(404, 'Creature movement disabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(405, 'Creature movement enabled.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(406, 'Weather can''t be changed for this zone.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(407, 'Weather system disabled at server.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(408, '%s is banned for %s. Reason: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(409, '%s is banned permanently for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(410, '%s %s not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(411, '%s unbanned.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(412, 'There was an error removing the ban on %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(413, 'Account not exist: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(414, 'There is no such character.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(415, 'There is no such IP in banlist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(416, 'Account %s has never been banned', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(417, 'Ban history for account %s:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(418, 'Ban Date: %s Bantime: %s Still active: %s Reason: %s Set by: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(419, 'Inf.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(420, 'Never', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(421, 'Yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(422, 'No', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(423, 'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(424, 'There is no matching IPban.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(425, 'There is no matching account.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(426, 'There is no banned account owning a character matching this part.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(427, 'The following IPs match your pattern:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(428, 'The following accounts match your query:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(429, 'You learned many spells/skills.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(430, 'You learned all spells for class.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(431, 'You learned all talents for class.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(432, 'You learned all languages.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(433, 'You learned all craft skills and recipes.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(434, 'Could not find ''%s''', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(435, 'Invalid item id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(436, 'No items found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(437, 'Invalid gameobject id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(438, 'Found items %u: %u ( inventory %u mail %u auction %u guild %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(439, 'Found gameobjects %u: %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(440, 'Invalid creature id: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(441, 'Found creatures %u: %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(442, 'No area found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(443, 'No item sets found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(444, 'No skills found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(445, 'No spells found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(446, 'No quests found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(447, 'No creatures found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(448, 'No gameobjects found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(449, 'Graveyard #%u doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(450, 'Graveyard #%u already linked to zone #%u (current).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(451, 'Graveyard #%u linked to zone #%u (current).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(452, 'Graveyard #%u can''t be linked to subzone or not existed zone #%u (internal error).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(454, 'No faction in Graveyard with id= #%u , fix your DB', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(455, 'invalid team, please fix database', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(456, 'any', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(457, 'alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(458, 'horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(459, 'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(460, 'Zone #%u doesn''t have linked graveyards.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(461, 'Zone #%u doesn''t have linked graveyards for faction: %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(462, 'Teleport location already exists!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(463, 'Teleport location added.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(464, 'Teleport location NOT added: database error.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(465, 'Teleport location deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(467, 'Target unit has %d auras:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(468, 'id: %d eff: %d type: %d duration: %d maxduration: %d name: %s%s%s caster: %s %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(469, 'Target unit has %d auras of type %d:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(470, 'id: %d eff: %d name: %s%s%s caster: %s %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(471, 'Quest %u not found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(472, 'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(473, 'Quest removed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(474, ' [rewarded]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(475, ' [complete]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(476, ' [active]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(477, '%s''s Fly Mode %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(478, 'Opcode %u sent to %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(479, 'Character loaded successfully!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(480, 'Failed to load the character!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(481, 'Character dumped successfully!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(482, 'Character dump failed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(483, 'Spell %u broken and not allowed to cast or learn!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(484, 'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(485, 'Player %s must have skill %u (%s) before using this command.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(486, 'Invalid skill id (%u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(487, 'You learned default GM spells/skills.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(488, 'You already know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(489, 'Target(%s) already know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(490, '%s doesn''t know that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(491, 'You already forgot that spell.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(492, 'All spell cooldowns removed for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(493, 'Spell %u cooldown removed for %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(494, 'Command : Additem, itemId = %i, amount = %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(495, 'Command : Additemset, itemsetId = %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(496, 'Removed itemID = %i, amount = %i from %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(497, 'Cannot create item ''%i'' (amount: %i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(498, 'You need to provide a guild name!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(499, 'Player not found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(500, 'Player already has a guild!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(501, 'Guild not created! (already exists?)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(502, 'No items from itemset ''%u'' found.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(503, 'The distance is: (3D) %f (2D) %f yards.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(504, 'Item ''%i'' ''%s'' Item Slot %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(505, 'Item ''%i'' doesn''t exist.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(506, 'Item ''%i'' ''%s'' Added to Slot %i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(507, 'Item save failed!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(508, '%d - owner: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(509, '%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(510, '%d - owner: %s (guid: %u account: %u ) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(511, 'Wrong link type!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(512, '%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(513, '%d - |cffffffff|Hquest:%d|h[%s]|h|r %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(514, '%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(515, '%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(516, '%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(517, '%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(518, '%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(519, '|cffffffff|Htele:%s|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(520, '%d - |cffffffff|Hspell:%d|h[%s]|h|r ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(521, '%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(522, 'Game Object (GUID: %u) not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(523, '>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(524, 'Selected object:\n|cffffffff|Hitemset:%d|h[%s]|h|r\nGUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(525, '>> Add Game Object ''%i'' (%s) (GUID: %i) added at ''%f %f %f''.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(526, '%s (lowguid: %u) movement generators stack:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(527, ' Idle', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(528, ' Random', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(529, ' Waypoint', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(530, ' Animal random', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(531, ' Confused', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(532, ' Targeted to player %s (lowguid %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(533, ' Targeted to creature %s (lowguid %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(534, ' Targeted to <NULL>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(535, ' Home movement to (X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(536, ' Home movement used for player?!?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(537, ' Taxi flight', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(538, ' Unknown movement generator (%u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(539, 'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(540, 'Level: %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(541, 'Health (base): %u. (max): %u. (current): %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(542, 'Field Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(543, 'Loot: %u Pickpocket: %u Skinning: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(544, 'Position: %f %f %f.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(545, '*** Is a vendor!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(546, '*** Is a trainer!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(547, 'InstanceID: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(548, 'Player%s %s (guid: %u) Account: %s (id: %u) GMLevel: %u Last IP: %s Last login: %s Latency: %ums', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(549, 'Played time: %s Level: %u Money: %ug%us%uc', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(550, 'Command .pinfo doesn''t support ''rep'' option for offline players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(551, '%s has explored all zones now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(552, '%s has no more explored zones.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(553, '%s has explored all zones for you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(554, '%s has hidden all zones from you.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(555, 'Hover enabled', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(556, 'Hover disabled', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(557, 'You have been leveled up (%i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(558, 'You have been leveled down (%i)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(559, 'Your level progress has been reset.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(560, 'The area has been set as explored.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(561, 'The area has been set as not explored.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(562, 'GUID=%i ''s updateIndex: %i, value: %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(563, 'You change GUID=%i ''s UpdateIndex: %i value to %i.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(564, 'The value index %u is too big to %u(count: %u).', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(565, 'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(566, 'You Set %u Field:%u to uint32 Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(567, 'Set %u float Value:[OPCODE]:%u [VALUE]:%f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(568, 'You Set %u Field:%i to float Value: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(569, 'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(570, 'The uint32 value of %u in %u is: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(571, 'Get %u float Value:[OPCODE]:%u [VALUE]:%f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(572, 'The float of %u value in %u is: %f', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(573, '.Set32Bit:[OPCODE]:%u [VALUE]:%u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(574, 'You set Bit of Field:%u to Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(575, '.Mod32Value:[OPCODE]:%u [VALUE]:%i', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(576, 'You modified the value of Field:%u to Value: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(577, 'You are now invisible.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(578, 'You are now visible.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(579, 'Selected player or creature not have victim.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(580, 'Player %s learned all default spells for race/class and completed quests rewarded spells.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(581, 'Found near gameobjects (distance %f): %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(582, 'SpawnTime: Full:%s Remain:%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(583, '%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(584, 'No event found!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(585, 'Event not exist!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(586, 'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(587, 'Event %u already active!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(588, 'Event %u not active!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(589, ' Point movement to (X:%f Y:%f Z:%f)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(590, ' Fear movement', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(591, ' Distract movement', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(592, 'You have learned all spells in craft: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(593, 'Currently Banned Accounts:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(594, '| Account | BanDate | UnbanDate | Banned By | Ban Reason |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(595, 'Currently Banned IPs:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(596, '| IP | BanDate | UnbanDate | Banned By | Ban Reason |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(597, 'Current gamemasters:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(598, '| Account | GM |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(599, 'No gamemasters.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(600, 'The Alliance wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(601, 'The Horde wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(602, 'The battle for Warsong Gulch begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(603, 'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(604, 'Let the battle for Warsong Gulch begin!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(605, '$n captured the Horde flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(606, '$n captured the Alliance flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(607, 'The Horde flag was dropped by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(608, 'The Alliance Flag was dropped by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(609, 'The Alliance Flag was returned to its base by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(610, 'The Horde flag was returned to its base by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(611, 'The Horde flag was picked up by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(612, 'The Alliance Flag was picked up by $n!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(613, 'The flags are now placed at their bases.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(614, 'The Alliance flag has been respawned!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(615, 'The Horde flag has been respawned!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(636, 'The Battle for Eye of the Storm begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(637, 'The Battle for Eye of the Storm begins in 30 seconds.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(638, 'The Battle for Eye of the Storm has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(650, 'Alliance', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(651, 'Horde', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(652, 'stables', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(653, 'blacksmith', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(654, 'farm', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(655, 'lumber mill', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(656, 'mine', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(657, 'The %s has taken the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(658, '$n has defended the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(659, '$n has assaulted the %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(660, '$n claims the %s! If left unchallenged, the %s will control it in 1 minute!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(661, 'The Battle for Arathi Basin begins in 1 minute.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(662, 'The Battle for Arathi Basin begins in 30 seconds. Prepare yourselves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(663, 'The Battle for Arathi Basin has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(664, 'The Alliance has gathered $1776W resources, and is near victory!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(665, 'The Horde has gathered $1777W resources, and is near victory!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(666, 'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(667, 'The Alliance has taken control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(668, 'The Horde has taken control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(669, 'The Alliance has taken control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(670, 'The Horde has taken control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(671, 'The Alliance has taken control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(672, 'The Horde has taken control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(673, 'The Alliance has taken control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(674, 'The Horde has taken control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(675, 'The Alliance has lost control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(676, 'The Horde has lost control of the Mage Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(677, 'The Alliance has lost control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(678, 'The Horde has lost control of the Draenei Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(679, 'The Alliance has lost control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(680, 'The Horde has lost control of the Blood Elf Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(681, 'The Alliance has lost control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(682, 'The Horde has lost control of the Fel Reaver Ruins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(683, '$N has taken the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(684, 'The Alliance has captured the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(685, 'The Horde has captured the flag!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(686, 'The Flag has been dropped!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(687, 'The flag has been reset', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(700, 'You must be level %u to form an arena team', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(701, 'One minute until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(702, 'Thirty seconds until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(703, 'Fifteen seconds until the Arena battle begins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(704, 'The Arena battle has begun!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(705, 'You must wait %s before speaking again.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(706, 'This item(s) have problems with equipping/storing in inventory.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(707, '%s wishes to not be disturbed and cannot receive whisper messages: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(708, '%s is Away from Keyboard: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(709, 'Do not Disturb', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(710, 'Away from Keyboard', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(711, 'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(712, '|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u/%u, H: %u/%u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(713, 'You must be level %u to join an arena team!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(715, 'You don''t meet Battleground level requirements', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(717, '|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] Started!|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(718, '|cffff0000[Arena Queue Announcer]:|r %s -- Joined : %ux%u : %u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(719, '|cffff0000[Arena Queue Announcer]:|r %s -- Exited : %ux%u : %u|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(720, 'Your group is too large for this battleground. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(721, 'Your group is too large for this arena. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(722, 'Your group has members not in your arena team. Please regroup to join.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(723, 'Your group does not have enough players to join this match.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(724, 'The Gold Team wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(725, 'The Green Team wins!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(726, 'There aren''t enough players in this battleground. It will end soon unless some more players join to balance the fight.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(727, 'Your group has an offline member. Please remove him before joining.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(728, 'Your group has players from the opposing faction. You can''t join the battleground as a group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(729, 'Your group has players from different battleground brakets. You can''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(730, 'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(731, 'Someone in your party is Deserter. You can''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(732, 'Someone in your party is already in three battleground queues. You cannot join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(733, 'You cannot teleport to a battleground or arena map.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(734, 'You cannot summon players to a battleground or arena map.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(735, 'You must be in GM mode to teleport to a player in a battleground.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(736, 'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(737, 'Arenas are set to 1v1 for debugging. So, don''t join as group.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(738, 'Arenas are set to normal playercount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(739, 'Battlegrounds are set to 1v0 for debugging.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(740, 'Battlegrounds are set to normal playercount.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(741, 'Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(742, 'Distributing arena points to players...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(743, 'Finished setting arena points for online players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(744, 'Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(745, 'Modification done.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(746, 'Done flushing Arena points.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(785, 'Arena testing turned %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(786, '|cffff0000[Automatic]:|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(787, '|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(800, 'Invalid name', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(801, 'You do not have enough gold', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(802, 'You do not have enough free slots', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(803, 'Your partner does not have enough free bag slots', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(804, 'You do not have permission to perform that function', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(805, 'Unknown language', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(806, 'You don''t know that language', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(807, 'Please provide character name', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(808, 'Player %s not found or offline', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(809, 'Account for character %s not found', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1000, 'Exiting daemon...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1001, 'Account deleted: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1002, 'Account %s NOT deleted (probably sql file format was updated)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1003, 'Account %s NOT deleted (unknown error)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1004, 'Account created: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1005, 'Account name can''t be longer than 16 characters (client limit), account not created!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1006, 'Account with this name already exist!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1007, 'Account %s NOT created (probably sql file format was updated)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1008, 'Account %s NOT created (unknown error)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1009, 'Player %s (Guid: %u) Account %s (Id: %u) deleted.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1010, '| Account | Character | IP | GM | TBC |', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1011, '|<Error> | %20s |<Error> |<Er>|<Err>|', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1100, 'Account %s (Id: %u) have up to %u expansion allowed now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1101, 'Message of the day changed to:\r\n%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1102, 'Message sent to %s: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1103, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1104, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1105, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1106, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1107, '%d - %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1108, '%d - %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1109, '%d - %s %s %s %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1110, '%d - %s X:%f Y:%f Z:%f MapId:%d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1111, '%d - %s X:%f Y:%f Z:%f MapId:%d', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1112, 'Failed to open file: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1113, 'Account %s (%u) have max amount allowed characters (client limit)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1114, 'Dump file have broken data!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1115, 'Invalid character name!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1116, 'Invalid character guid!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1117, 'Character guid %u in use!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1118, '%d - guild: %s (guid: %u) %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1119, 'You must use male or female as gender.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1120, 'You change gender of %s to %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1121, 'Your gender changed to %s by %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(1122, '(%u/%u +perm %u +temp %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+
+(1200,'Alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1201,'Horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1202,'%s was destroyed by the %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1203,'The %s is under attack! If left unchecked, the %s will destroy it!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1204,'The %s was taken by the %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1205,'The %s was taken by the %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1206,'The %s was taken by the %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1207,'The %s is under attack! If left unchecked, the %s will capture it!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1208,'The %s has taken the %s! Its supplies will now be used for reinforcements!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1209,'Irondeep Mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1210,'Coldtooth Mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1211,'Stormpike Aid Station',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1212,'Dun Baldar South Bunker',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1213,'Dun Baldar North Bunker',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1214,'Stormpike Graveyard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1215,'Icewing Bunker',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1216,'Stonehearth Graveyard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1217,'Stonehearth Bunker',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1218,'Snowfall Graveyard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1219,'Iceblood Tower',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1220,'Iceblood Graveyard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1221,'Tower Point',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1222,'Frostwolf Graveyard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1223,'East Frostwolf Tower',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1224,'West Frostwolf Tower',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1225,'Frostwolf Relief Hut',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1226,'The Battle for Alterac Valley begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1227,'The Battle for Alterac Valley begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1228,'The Battle for Alterac Valley has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1229,'The Alliance Team is running out of reinforcements!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1230,'The Horde Team is running out of reinforcements!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1231,'The Frostwolf General is Dead!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1232,'The Stormpike General is Dead!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(2000, '|cff00ff00New ticket from|r|cffff00ff %s.|r |cff00ff00Ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2001, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00edited his/her ticket:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2002, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00abandoned ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2003, '|cff00ff00Closed by|r:|cff00ccff %s|r ', '', '', '', '', '', '', '', ''),
+(2004, '|cff00ff00Deleted by|r:|cff00ccff %s|r ', '', '', '', '', '', '', '', ''),
+(2005, 'Ticket not found.', '', '', '', '', '', '', '', ''),
+(2006, 'Please close ticket before deleting it permanently.', '', '', '', '', '', '', '', ''),
+(2007, 'Ticket %d is already assigned.', '', '', '', '', '', '', '', ''),
+(2008, '%u Tickets succesfully reloaded from the database.', '', '', '', '', '', '', '', ''),
+(2009, 'Showing list of open tickets.', '', '', '', '', '', '', '', ''),
+(2010, 'Showing list of open tickets whose creator is online.', '', '', '', '', '', '', '', ''),
+(2011, 'Showing list of closed tickets.', '', '', '', '', '', '', '', ''),
+(2012, 'Invalid name specified. Name should be that of an online Gamemaster.', '', '', '', '', '', '', '', ''),
+(2013, 'This ticket is already assigned to yourself. To unassign use .ticket unassign %d and then reassign.', '', '', '', '', '', '', '', ''),
+(2014, 'Ticket %d is not assigned, you cannot unassign it.', '', '', '', '', '', '', '', ''),
+(2015, 'You cannot unassign tickets from staffmembers with a higher security level than yourself.', '', '', '', '', '', '', '', ''),
+(2016, 'Cannot close ticket %d, it is assigned to another GM.', '', '', '', '', '', '', '', ''),
+(2017, '|cff00ff00Ticket|r:|cff00ccff %d.|r ', '', '', '', '', '', '', '', ''),
+(2018, '|cff00ff00Created by|r:|cff00ccff %s|r ', '', '', '', '', '', '', '', ''),
+(2019, '|cff00ff00Last change|r:|cff00ccff %s ago|r ', '', '', '', '', '', '', '', ''),
+(2020, '|cff00ff00Assigned to|r:|cff00ccff %s|r ', '', '', '', '', '', '', '', ''),
+(2021, '|cff00ff00Unassigned by|r:|cff00ccff %s|r ', '', '', '', '', '', '', '', ''),
+(2022, '\n|cff00ff00Message|r: \"%s\"|r ', '', '', '', '', '', '', '', ''),
+(2023, '\n|cff00ff00Comment|r: \"%s\"|r ', '', '', '', '', '', '', '', ''),
+(2024, '\n|cff00ccff%s|r |cff00ff00Added comment|r: \"%s\"|r ', '', '', '', '', '', '', '', ''),
+
+(5000, 'You froze player %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5001, 'It might be amusing but no... you cant freeze yourself!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5002, 'Invalid input check the name of target.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5003, 'You unfroze player %s.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5004, 'There are no frozen players.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5005, 'Following players are frozen on the server:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5006, '- %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(5009, 'Sound %u Played to server', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+
+(6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(6614, 'Notification to GM''s - ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+
+(10001, 'The Horde has taken The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10002, 'The Alliance has taken The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10003, 'The Horde has taken The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10004, 'The Alliance has taken The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10005, 'The Horde has taken Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10006, 'The Alliance has taken Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10007, 'The Horde lost The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10008, 'The Alliance lost The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10009, 'The Horde lost The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10010, 'The Alliance lost The Stadium!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10011, 'The Horde lost Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10012, 'The Alliance lost Broken Hill!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10013, 'The Horde has taken the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10014, 'The Alliance has taken the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10015, 'The Horde has taken the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10016, 'The Alliance has taken the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10017, 'The Horde has captured the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10018, 'The Alliance has captured the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10019, 'The Horde lost the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10020, 'The Alliance lost the West Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10021, 'The Horde lost the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10022, 'The Alliance lost the East Beacon!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10023, 'The Horde lost the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10024, 'The Alliance lost the Twin Spire Graveyard!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10025, 'The Horde has captured Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10026, 'The Alliance has captured Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10027, 'The Horde lost Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10028, 'The Alliance lost Halaa!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10029, 'The Horde has taken a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10030, 'The Alliance has taken a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10031, 'The Horde lost a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10032, 'The Alliance lost a Spirit Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10033, 'The Horde has taken the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10034, 'The Alliance has taken the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10035, 'The Horde has taken the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10036, 'The Alliance has taken the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10037, 'The Horde has taken the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10038, 'The Alliance has taken the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10039, 'The Horde has taken the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10040, 'The Alliance has taken the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10041, 'The Horde lost the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10042, 'The Alliance lost the Northpass Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10043, 'The Horde lost the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10044, 'The Alliance lost the Eastwall Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10045, 'The Horde lost the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10046, 'The Alliance lost the Crown Guard Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10047, 'The Horde lost the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10048, 'The Alliance lost the Plaguewood Tower!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10049, 'The Horde has collected 200 silithyst!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10050, 'The Alliance has collected 200 silithyst!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10051, 'Take me to Northpass Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10052, 'Take me to Eastwall Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10053, 'Take me to Crown Guard Tower.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10054, 'Give me the flag, I''ll take it to the central beacon for the glory of the Alliance!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10055, 'Give me the flag, I''ll take it to the central beacon for the glory of the Horde!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10056, 'You must be a member of the Horde to enter the Hall of Legends.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(10057, 'You must be a member of the Alliance to enter the Champion''s Hall.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file
diff --git a/sql/updates/1366_world.sql b/sql/updates/1366_world.sql
deleted file mode 100644
index a22254a9d2a..00000000000
--- a/sql/updates/1366_world.sql
+++ /dev/null
@@ -1 +0,0 @@
-insert into `command` (`name`, `security`, `help`) values('go ticket','1','Syntax: .go ticket #ticketid\r\nTeleports the user to the location where $ticketid was created.');
diff --git a/sql/updates/1396_mangos_7267_01_characters_auctionhouse.sql b/sql/updates/1396_mangos_7267_01_characters_auctionhouse.sql
new file mode 100644
index 00000000000..7f9e9758946
--- /dev/null
+++ b/sql/updates/1396_mangos_7267_01_characters_auctionhouse.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7255_01_characters_characters required_7267_01_characters_auctionhouse bit;*/
+
+ALTER TABLE auctionhouse
+ DROP COLUMN location; \ No newline at end of file
diff --git a/sql/updates/1414_world_scripts.sql b/sql/updates/1414_world_scripts.sql
new file mode 100644
index 00000000000..3ee9245bc51
--- /dev/null
+++ b/sql/updates/1414_world_scripts.sql
@@ -0,0 +1,121 @@
+-- r847_scriptdev2_script_texts.sql
+UPDATE `script_texts` SET emote=15 WHERE `entry`=-1000123;
+UPDATE `script_texts` SET emote=1 WHERE `entry`=-1560028;
+UPDATE `script_texts` SET emote=1 WHERE `entry`=-1560031;
+UPDATE `script_texts` SET emote=5 WHERE `entry`=-1560032;
+UPDATE `script_texts` SET emote=16 WHERE `entry`=-1000119;
+UPDATE `script_texts` SET emote=254 WHERE `entry`=-1249002;
+UPDATE `script_texts` SET emote=293 WHERE `entry`=-1249003;
+UPDATE `script_texts` SET emote=1 WHERE `entry`=-1033000;
+
+-- r848_scriptdev2_script_texts.sql
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1540047 AND -1540042;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1540042,'Ours is the true Horde! The only Horde!',10323,1,0,0,'kargath SAY_AGGRO1'),
+(-1540043,'I\'ll carve the meat from your bones!',10324,1,0,0,'kargath SAY_AGGRO2'),
+(-1540044,'I am called Bladefist for a reason, as you will see!',10325,1,0,0,'kargath SAY_AGGRO3'),
+(-1540045,'For the real Horde!',10326,1,0,0,'kargath SAY_SLAY1'),
+(-1540046,'I am the only Warchief!',10327,1,0,0,'kargath SAY_SLAY2'),
+(-1540047,'The true Horde... will.. prevail...',10328,1,0,0,'kargath SAY_DEATH');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533118 AND -1533109;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1533109,'You are mine now!',8825,1,0,0,'heigan SAY_AGGRO1'),
+(-1533110,'I see you!',8826,1,0,0,'heigan SAY_AGGRO2'),
+(-1533111,'You...are next!',8827,1,0,0,'heigan SAY_AGGRO3'),
+(-1533112,'Close your eyes... sleep!',8829,1,0,0,'heigan SAY_SLAY'),
+(-1533113,'The races of the world will perish. It is only a matter of time.',8830,1,0,0,'heigan SAY_TAUNT1'),
+(-1533114,'I see endless suffering, I see torment, I see rage. I see... everything!',8831,1,0,0,'heigan SAY_TAUNT2'),
+(-1533115,'Soon... the world will tremble!',8832,1,0,0,'heigan SAY_TAUNT3'),
+(-1533116,'The end is upon you.',8833,1,0,0,'heigan SAY_TAUNT4'),
+(-1533117,'Hungry worms will feast on your rotten flesh!',8834,1,0,0,'heigan SAY_TAUNT5'),
+(-1533118,'Noo... o...',8828,1,0,0,'heigan SAY_DEATH');
+
+-- r849_scriptdev2_script_texts.sql
+DELETE FROM `script_texts` WHERE `entry`=-1070000;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1070000,'None may steal the secrets of the makers!',5851,1,0,0,'ironaya SAY_AGGRO');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1129004 AND -1129000;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1129000,'You\'ll never leave this place... alive.',5825,1,0,0,'amnennar SAY_AGGRO'),
+(-1129001,'To me, my servants!',5828,1,0,0,'amnennar SAY_SUMMON60'),
+(-1129002,'Come, spirits, attend your master!',5829,1,0,0,'amnennar SAY_SUMMON30'),
+(-1129003,'I am the hand of the Lich King!',5827,1,0,0,'amnennar SAY_HP'),
+(-1129004,'Too...easy!',5826,1,0,0,'amnennar SAY_KILL');
+
+DELETE FROM `script_texts` WHERE `entry` IN (-1230002,-1230001);
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1230001,'Come to aid the Throne!',0,1,0,0,'dagran SAY_AGGRO'),
+(-1230002,'Hail to the king, baby!',0,1,0,0,'dagran SAY_SLAY');
+
+-- r852_scriptdev2_script_texts.sql
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1189021 AND -1189011;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1189011,'Tell me... tell me everything!',5847,1,0,0,'vishas SAY_AGGRO'),
+(-1189012,'Naughty secrets!',5849,1,0,0,'vishas SAY_HEALTH1'),
+(-1189013,'I\'ll rip the secrets from your flesh!',5850,1,0,0,'vishas SAY_HEALTH2'),
+(-1189014,'Purged by pain!',5848,1,0,0,'vishas SAY_KILL'),
+(-1189015,'The monster got what he deserved.',0,0,1,0,'vishas SAY_TRIGGER_VORREL'),
+(-1189016,'We hunger for vengeance.',5844,1,0,0,'thalnos SAY_AGGRO'),
+(-1189017,'No rest, for the angry dead.',5846,1,0,0,'thalnos SAY_HEALTH'),
+(-1189018,'More... More souls.',5845,1,0,0,'thalnos SAY_KILL'),
+(-1189019,'You will not defile these mysteries!',5842,1,0,0,'doan SAY_AGGRO'),
+(-1189020,'Burn in righteous fire!',5843,1,0,0,'doan SAY_SPECIALAE'),
+(-1189021,'Release the hounds!',5841,1,0,0,'loksey SAY_AGGRO');
+
+-- r854_scriptdev2_script_texts.sql
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1070006 AND -1070001;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1070001,'Taste blade, mongrel!',0,0,0,0,'SAY_GUARD_SIL_AGGRO1'),
+(-1070002,'Please tell me that you didn\'t just do what I think you just did. Please tell me that I\'m not going to have to hurt you...',0,0,0,0,'SAY_GUARD_SIL_AGGRO2'),
+(-1070003,'As if we don\'t have enough problems, you go and create more!',0,0,0,0,'SAY_GUARD_SIL_AGGRO3'),
+(-1070004,'looks up at you quizzically. Maybe you should inspect it?',0,2,0,0,'cluck EMOTE_A_HELLO'),
+(-1070005,'looks at you unexpectadly.',0,2,0,0,'cluck EMOTE_H_HELLO'),
+(-1070006,'starts pecking at the feed.',0,2,0,0,'cluck EMOTE_CLUCK_TEXT2');
+
+-- r855_scriptdev2_script_texts.sql
+DELETE FROM `script_texts` WHERE `entry` IN (-1000004,-1000001);
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1000001,'goes into a killing frenzy!',0,2,0,0,'EMOTE_GENERIC_FRENZY_KILL'),
+(-1000004,'goes into a berserker rage!',0,2,0,0,'EMOTE_GENERIC_BERSERK');
+
+DELETE FROM `script_texts` WHERE `entry` = -1000005;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1000005,'Greetings citizen',0,0,7,0,'general_marcus SAY_GREETING');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1329003 AND -1329000;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1329000,'Thanks to Egan',0,0,0,0,'freed_soul SAY_ZAPPED0'),
+(-1329001,'Rivendare must die',0,0,0,0,'freed_soul SAY_ZAPPED1'),
+(-1329002,'Who you gonna call?',0,0,0,0,'freed_soul SAY_ZAPPED2'),
+(-1329003,'Don\'t cross those beams!',0,0,0,0,'freed_soul SAY_ZAPPED3');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1999925 AND -1999900;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1999900,'Let the games begin.',8280,1,0,0,'example_creature SAY_AGGRO'),
+(-1999901,'I see endless suffering. I see torment. I see rage. I see everything.',8831,1,0,0,'example_creature SAY_RANDOM_0'),
+(-1999902,'Muahahahaha',8818,1,0,0,'example_creature SAY_RANDOM_1'),
+(-1999903,'These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets.',8041,1,0,0,'example_creature SAY_RANDOM_2'),
+(-1999904,'You are already dead.',8581,1,0,0,'example_creature SAY_RANDOM_3'),
+(-1999905,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,0,'example_creature SAY_RANDOM_4'),
+(-1999906,'$N, I sentance you to death!',8588,1,0,0,'example_creature SAY_BESERK'),
+(-1999907,'The suffering has just begun!',0,1,0,0,'example_creature SAY_PHASE'),
+(-1999908,'I always thought I was a good dancer.',0,0,0,0,'example_creature SAY_DANCE'),
+(-1999909,'Move out Soldier!',0,0,0,0,'example_creature SAY_SALUTE'),
+(-1999910,'Help $N! I\'m under attack!',0,0,0,0,'example_escort SAY_AGGRO1'),
+(-1999911,'Die scum!',0,0,0,0,'example_escort SAY_AGGRO2'),
+(-1999912,'Hmm a nice day for a walk alright',0,0,0,0,'example_escort SAY_WP_1'),
+(-1999913,'Wild Felboar attack!',0,0,0,0,'example_escort SAY_WP_2'),
+(-1999914,'Time for me to go! See ya around $N!',0,0,0,3,'example_escort SAY_WP_3'),
+(-1999915,'Bye Bye!',0,0,0,3,'example_escort SAY_WP_4'),
+(-1999916,'How dare you leave me like that! I hate you! =*(',0,3,0,0,'example_escort SAY_DEATH_1'),
+(-1999917,'...no...how could you let me die $N',0,0,0,0,'example_escort SAY_DEATH_2'),
+(-1999918,'ugh...',0,0,0,0,'example_escort SAY_DEATH_3'),
+(-1999919,'Taste death!',0,0,0,0,'example_escort SAY_SPELL'),
+(-1999920,'Fireworks!',0,0,0,0,'example_escort SAY_RAND_1'),
+(-1999921,'Hmm, I think I could use a buff.',0,0,0,0,'example_escort SAY_RAND_2'),
+(-1999922,'Normal select, guess you\'re not interested.',0,0,0,0,'example_gossip_codebox SAY_NOT_INTERESTED'),
+(-1999923,'Wrong!',0,0,0,0,'example_gossip_codebox SAY_WRONG'),
+(-1999924,'You\'re right, you are allowed to see my inner secrets.',0,0,0,0,'example_gossip_codebox SAY_CORRECT'),
+(-1999925,'Hi!',0,0,0,0,'example_areatrigger SAY_HI'); \ No newline at end of file
diff --git a/sql/updates/1423_mangos_7290_01_world_command.sql b/sql/updates/1423_mangos_7290_01_world_command.sql
new file mode 100644
index 00000000000..ededbe1f468
--- /dev/null
+++ b/sql/updates/1423_mangos_7290_01_world_command.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7252_02_mangos_mangos_string required_7290_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` = 'npc setdeathstate';
+INSERT INTO `command` VALUES
+('npc setdeathstate',2,'Syntax: .npc setdeathstate on/off\r\n\r\nSet default death state (dead/alive) for npc at spawn.'); \ No newline at end of file
diff --git a/sql/updates/1426_mangos_7292_01_world_points_of_interest.sql b/sql/updates/1426_mangos_7292_01_world_points_of_interest.sql
new file mode 100644
index 00000000000..be997458488
--- /dev/null
+++ b/sql/updates/1426_mangos_7292_01_world_points_of_interest.sql
@@ -0,0 +1,13 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7290_01_mangos_command required_7292_01_mangos_points_of_interest bit;*/
+
+DROP TABLE IF EXISTS `points_of_interest`;
+CREATE TABLE `points_of_interest` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `icon` mediumint(8) unsigned NOT NULL default '0',
+ `flags` mediumint(8) unsigned NOT NULL default '0',
+ `data` mediumint(8) unsigned NOT NULL default '0',
+ `icon_name` text NOT NULL,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/1426_mangos_7292_02_world_locales_points_of_interest.sql b/sql/updates/1426_mangos_7292_02_world_locales_points_of_interest.sql
new file mode 100644
index 00000000000..135fe1ce4d2
--- /dev/null
+++ b/sql/updates/1426_mangos_7292_02_world_locales_points_of_interest.sql
@@ -0,0 +1,15 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7292_01_mangos_points_of_interest required_7292_02_mangos_locales_points_of_interest bit;*/
+
+DROP TABLE IF EXISTS `locales_points_of_interest`;
+CREATE TABLE `locales_points_of_interest` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `icon_name_loc1` text,
+ `icon_name_loc2` text,
+ `icon_name_loc3` text,
+ `icon_name_loc4` text,
+ `icon_name_loc5` text,
+ `icon_name_loc6` text,
+ `icon_name_loc7` text,
+ `icon_name_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/1463_mangos_7303_01_world_pools.sql b/sql/updates/1463_mangos_7303_01_world_pools.sql
new file mode 100644
index 00000000000..39e45679dff
--- /dev/null
+++ b/sql/updates/1463_mangos_7303_01_world_pools.sql
@@ -0,0 +1,39 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7292_02_mangos_locales_points_of_interest required_7303_01_mangos_pools bit;*/
+
+DROP TABLE IF EXISTS `pool_creature`;
+CREATE TABLE `pool_creature` (
+ `guid` int(10) unsigned NOT NULL default '0',
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float unsigned NOT NULL default '0',
+ PRIMARY KEY (`pool_entry`,`guid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `pool_gameobject`;
+CREATE TABLE `pool_gameobject` (
+ `guid` int(10) unsigned NOT NULL default '0',
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float unsigned NOT NULL default '0',
+ PRIMARY KEY (`guid`,`pool_entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `pool_pool`;
+CREATE TABLE `pool_pool` (
+ `pool_id` mediumint(8) unsigned NOT NULL default '0',
+ `mother_pool` mediumint(8) unsigned NOT NULL default '0',
+ `chance` float NOT NULL default '0',
+ PRIMARY KEY (`pool_id`,`mother_pool`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `pool_template`;
+CREATE TABLE `pool_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Pool entry',
+ `max_limit` int(10) unsigned NOT NULL default '0' COMMENT 'Max number of objects (0) is no limit',
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `game_event_pool`;
+CREATE TABLE `game_event_pool` (
+ `pool_entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Id of the pool',
+ `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event',
+ PRIMARY KEY (`pool_entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/1470_world_scripts.sql b/sql/updates/1470_world_scripts.sql
new file mode 100644
index 00000000000..f0f4277fe95
--- /dev/null
+++ b/sql/updates/1470_world_scripts.sql
@@ -0,0 +1,4 @@
+-- Remove script for quest 8346. Note support for this quest will be added in next ACID release(25)
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN (15273,15274,15294,15298,15367);
+UPDATE `creature_template` SET `ScriptName`='mob_broggok_poisoncloud' WHERE `entry`=17662;
+-- UPDATE `creature_template` SET `ScriptName`='npc_draenei_survivor' WHERE `entry`=16483; \ No newline at end of file
diff --git a/sql/updates/1484_mangos_7307_01_characters_arena_team_member.sql b/sql/updates/1484_mangos_7307_01_characters_arena_team_member.sql
new file mode 100644
index 00000000000..b58027b06e5
--- /dev/null
+++ b/sql/updates/1484_mangos_7307_01_characters_arena_team_member.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7267_01_characters_auctionhouse required_7307_01_characters_arena_team_member bit;*/
+
+ALTER TABLE arena_team_member
+ ADD PRIMARY KEY (arenateamid,guid); \ No newline at end of file
diff --git a/sql/updates/1495_mangos_7312_01_world_trinity_string.sql b/sql/updates/1495_mangos_7312_01_world_trinity_string.sql
new file mode 100644
index 00000000000..ff873dc948a
--- /dev/null
+++ b/sql/updates/1495_mangos_7312_01_world_trinity_string.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7303_01_mangos_pools required_7312_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry`=810;
+INSERT INTO `trinity_string` VALUES
+(810,'|Hplayer:$N|h[$N]|h has earned the achievement $a!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1497_mangos_7314_01_characters_guild_rank.sql b/sql/updates/1497_mangos_7314_01_characters_guild_rank.sql
new file mode 100644
index 00000000000..80aa49c21c4
--- /dev/null
+++ b/sql/updates/1497_mangos_7314_01_characters_guild_rank.sql
@@ -0,0 +1,3 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7307_01_characters_arena_team_member required_7314_01_characters_guild_rank bit;*/
+
+UPDATE guild_rank SET rights = rights & ~0x00020000; \ No newline at end of file
diff --git a/sql/updates/1525_world_scripts.sql b/sql/updates/1525_world_scripts.sql
new file mode 100644
index 00000000000..3eb373009da
--- /dev/null
+++ b/sql/updates/1525_world_scripts.sql
@@ -0,0 +1,2 @@
+-- Script for Yrykul Skeleton - Prince Keleseth Event
+UPDATE `creature_template` SET `ScriptName`='mob_vrykul_skeleton' WHERE `entry`=23970; \ No newline at end of file
diff --git a/sql/updates/1531_mangos_7324_01_characters_character_spell.sql b/sql/updates/1531_mangos_7324_01_characters_character_spell.sql
new file mode 100644
index 00000000000..10c4317b457
--- /dev/null
+++ b/sql/updates/1531_mangos_7324_01_characters_character_spell.sql
@@ -0,0 +1,13 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7314_01_characters_guild_rank required_7324_01_characters_character_spell bit;*/
+
+/* remove some deleted spells or ranks from characters */
+/* Mana Tap no longer Blood Elf Racial */
+DELETE FROM `character_spell` WHERE `spell` = '28734';
+/* Hamstring is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_spell` WHERE `spell` IN ('7373', '7372', '25212');
+/* Intercept is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_spell` WHERE `spell` IN ('20616', '20617', '25272', '25275');
+/* Overpower is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_spell` WHERE `spell` IN ('7887', '11584', '11585');
+/* Shield Bash is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_spell` WHERE `spell` IN ('1671', '1672', '29704'); \ No newline at end of file
diff --git a/sql/updates/1531_mangos_7324_02_characters_character_aura.sql b/sql/updates/1531_mangos_7324_02_characters_character_aura.sql
new file mode 100644
index 00000000000..fd7e405f966
--- /dev/null
+++ b/sql/updates/1531_mangos_7324_02_characters_character_aura.sql
@@ -0,0 +1,13 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7324_01_characters_character_spell required_7324_02_characters_character_aura bit;*/
+
+/* remove some deleted spells or ranks from characters auras */
+/* Mana Tap no longer Blood Elf Racial */
+DELETE FROM `character_aura` WHERE `spell` = '28734';
+/* Hamstring is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_aura` WHERE `spell` IN ('7373', '7372', '25212');
+/* Intercept is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_aura` WHERE `spell` IN ('20616', '20617', '25272', '25275');
+/* Overpower is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_aura` WHERE `spell` IN ('7887', '11584', '11585');
+/* Shield Bash is only one rank now, need to delete these zzOLDRank spells */
+DELETE FROM `character_aura` WHERE `spell` IN ('1671', '1672', '29704'); \ No newline at end of file
diff --git a/sql/updates/1555_mangos_7331_01_world_command.sql b/sql/updates/1555_mangos_7331_01_world_command.sql
new file mode 100644
index 00000000000..b85942b71a9
--- /dev/null
+++ b/sql/updates/1555_mangos_7331_01_world_command.sql
@@ -0,0 +1,65 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7312_01_mangos_mangos_string required_7331_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` = 'account set addon';
+DELETE FROM `command` WHERE `name` = 'ban account';
+DELETE FROM `command` WHERE `name` = 'ban character';
+DELETE FROM `command` WHERE `name` = 'ban ip';
+DELETE FROM `command` WHERE `name` = 'baninfo account';
+DELETE FROM `command` WHERE `name` = 'baninfo character';
+DELETE FROM `command` WHERE `name` = 'baninfo ip';
+DELETE FROM `command` WHERE `name` = 'banlist account';
+DELETE FROM `command` WHERE `name` = 'banlist character';
+DELETE FROM `command` WHERE `name` = 'banlist ip';
+DELETE FROM `command` WHERE `name` = 'gm fly';
+/* next command deleted even in case it has been already corrected (trailing space) */
+DELETE FROM `command` WHERE `name` = 'gobject near ';
+DELETE FROM `command` WHERE `name` = 'gobject near';
+
+DELETE FROM `command` WHERE `name` = 'lookup player account';
+DELETE FROM `command` WHERE `name` = 'lookup player ip';
+DELETE FROM `command` WHERE `name` = 'lookup player email';
+DELETE FROM `command` WHERE `name` = 'modify money';
+DELETE FROM `command` WHERE `name` = 'modify mount';
+DELETE FROM `command` WHERE `name` = 'modify speed';
+DELETE FROM `command` WHERE `name` = 'modify titles';
+DELETE FROM `command` WHERE `name` = 'pdump write';
+DELETE FROM `command` WHERE `name` = 'pdump load';
+DELETE FROM `command` WHERE `name` = 'reset honor';
+DELETE FROM `command` WHERE `name` = 'reset level';
+DELETE FROM `command` WHERE `name` = 'reset spells';
+DELETE FROM `command` WHERE `name` = 'reset stats';
+DELETE FROM `command` WHERE `name` = 'reset talents';
+DELETE FROM `command` WHERE `name` = 'unban account';
+DELETE FROM `command` WHERE `name` = 'unban character';
+DELETE FROM `command` WHERE `name` = 'unban ip';
+
+INSERT INTO `command` VALUES
+('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
+('ban account',3,'Syntax: .ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban character',3,'Syntax: .ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban ip',3,'Syntax: .ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('baninfo account',3,'Syntax: .baninfo account\r\nWatch full information about a specific ban.'),
+('baninfo character',3,'Syntax: .baninfo character\r\nWatch full information about a specific ban.'),
+('baninfo ip',3,'Syntax: .baninfo ip\r\nWatch full information about a specific ban.'),
+('banlist account',3,'Syntax: .banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'),
+('banlist character',3,'Syntax: .banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'),
+('banlist ip',3,'Syntax: .banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'),
+('gm fly',3,'Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'),
+('gobject near',3,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),
+('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),
+('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),
+('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),
+('modify money',1,'Syntax: .modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'),
+('modify mount',1,'Syntax: .modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'),
+('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify titles',1,'Syntax: .modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
+('pdump write',3,'Syntax: .pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'),
+('pdump load',3,'Syntax: .pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'),
+('reset honor',3,'Syntax: .reset honor [Playername]\r\n Reset all honor data for targeted character.'),
+('reset level',3,'Syntax: .reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'),
+('reset spells',3,'Syntax: .reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'),
+('reset stats',3,'Syntax: .reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'),
+('reset talents',3,'Syntax: .reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'),
+('unban account',3,'Syntax: .unban account $Name\r\nUnban accounts for account name pattern.'),
+('unban character',3,'Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'),
+('unban ip',3,'Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.'); \ No newline at end of file
diff --git a/sql/updates/1558_world.sql b/sql/updates/1558_world.sql
new file mode 100644
index 00000000000..667d1c998cc
--- /dev/null
+++ b/sql/updates/1558_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = '44869' AND `spell_effect` = '-45018';
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = '46019' AND `spell_effect` = '-45018';
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(44869, -45018, 1, 'Remove Arcane Buffet'),
+(46019, -45018, 1, 'Remove Arcane Buffet'); \ No newline at end of file
diff --git a/sql/updates/1559_world.sql b/sql/updates/1559_world.sql
new file mode 100644
index 00000000000..4421d36e95c
--- /dev/null
+++ b/sql/updates/1559_world.sql
@@ -0,0 +1,11 @@
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(48077, 48075, 0, 'Holy Nova (rank8)'),
+(48078, 48076, 0, 'Holy Nova (rank9)'),
+(47585, 60069, 0, 'Dispersion (transform/regen)');
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (47549);
+INSERT INTO `spell_proc_event` VALUES (47549, 0x00, 6, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+DELETE FROM `spell_proc_event` WHERE `entry` IN (47551);
+INSERT INTO `spell_proc_event` VALUES (47551, 0x00, 6, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+DELETE FROM `spell_proc_event` WHERE `entry` IN (47552);
+INSERT INTO `spell_proc_event` VALUES (47552, 0x00, 6, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1576_mangos_7332_01_world_command.sql b/sql/updates/1576_mangos_7332_01_world_command.sql
new file mode 100644
index 00000000000..197934db8a0
--- /dev/null
+++ b/sql/updates/1576_mangos_7332_01_world_command.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7331_01_mangos_command required_7332_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` = 'distance';
+INSERT INTO `command` VALUES
+('distance',3,'Syntax: .distance [$name/$link]\r\n\r\nDisplay the distance from your character to the selected creature/player, or player with name $name, or player/creature/gameobject pointed to shift-link with guid.'); \ No newline at end of file
diff --git a/sql/updates/1605_mangos_7349_01_world_spell_area.sql b/sql/updates/1605_mangos_7349_01_world_spell_area.sql
new file mode 100644
index 00000000000..1e9e560412c
--- /dev/null
+++ b/sql/updates/1605_mangos_7349_01_world_spell_area.sql
@@ -0,0 +1,15 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7332_01_mangos_command required_7349_01_mangos_spell_area bit;*/
+
+DROP TABLE IF EXISTS `spell_area`;
+CREATE TABLE `spell_area` (
+ `spell` mediumint(8) unsigned NOT NULL default '0',
+ `area` mediumint(8) unsigned NOT NULL default '0',
+ `quest_start` mediumint(8) unsigned NOT NULL default '0',
+ `quest_start_active` tinyint(1) unsigned NOT NULL default '0',
+ `quest_end` mediumint(8) unsigned NOT NULL default '0',
+ `aura_spell` mediumint(8) unsigned NOT NULL default '0',
+ `racemask` mediumint(8) unsigned NOT NULL default '0',
+ `gender` tinyint(1) unsigned NOT NULL default '2',
+ `autocast` tinyint(1) unsigned NOT NULL default '0',
+ PRIMARY KEY (`spell`,`area`,`quest_start`,`quest_start_active`,`aura_spell`,`racemask`,`gender`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/1613_world_scripts.sql b/sql/updates/1613_world_scripts.sql
new file mode 100644
index 00000000000..dae1af2bfe9
--- /dev/null
+++ b/sql/updates/1613_world_scripts.sql
@@ -0,0 +1,3 @@
+-- Script for Skarvald and Dalronn
+UPDATE `creature_template` SET `ScriptName`= 'boss_skarvald_the_constructor' WHERE `entry` IN (24200,27390);
+UPDATE `creature_template` SET `ScriptName`= 'boss_dalronn_the_controller' WHERE `entry` IN (24201,27389); \ No newline at end of file
diff --git a/sql/updates/1614_characters_auctionhouse.sql b/sql/updates/1614_characters_auctionhouse.sql
new file mode 100644
index 00000000000..d49ecbe2cb1
--- /dev/null
+++ b/sql/updates/1614_characters_auctionhouse.sql
@@ -0,0 +1,24 @@
+ALTER TABLE `auctionhousebot`
+ ADD COLUMN `percentgreytradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Grey Trade Goods auction items' AFTER `maxtime`,
+ ADD COLUMN `percentorangetradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Orange Trade Goods auction items' AFTER `percentpurpletradegoods`,
+ ADD COLUMN `percentyellowtradegoods` int(11) default '0' COMMENT 'Sets the percentage of the Yellow Trade Goods auction items' AFTER `percentorangetradegoods`,
+ ADD COLUMN `percentgreyitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Grey auction items' AFTER `percentyellowtradegoods`,
+ ADD COLUMN `percentorangeitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Orange auction items' AFTER `percentpurpleitems`,
+ ADD COLUMN `percentyellowitems` int(11) default '0' COMMENT 'Sets the percentage of the non trade Yellow auction items' AFTER `percentorangeitems`,
+ ADD COLUMN `minpricegrey` int(11) default '100' COMMENT 'Minimum price of Grey items (percentage).' AFTER `percentyellowitems`,
+ ADD COLUMN `maxpricegrey` int(11) default '150' COMMENT 'Maximum price of Grey items (percentage).' AFTER `minpricegrey`,
+ ADD COLUMN `minpriceorange` int(11) default '3250' COMMENT 'Minimum price of Orange items (percentage).' AFTER `maxpricepurple`,
+ ADD COLUMN `maxpriceorange` int(11) default '5550' COMMENT 'Maximum price of Orange items (percentage).' AFTER `minpriceorange`,
+ ADD COLUMN `minpriceyellow` int(11) default '5250' COMMENT 'Minimum price of Yellow items (percentage).' AFTER `maxpriceorange`,
+ ADD COLUMN `maxpriceyellow` int(11) default '6550' COMMENT 'Maximum price of Yellow items (percentage).' AFTER `minpriceyellow`,
+ ADD COLUMN `minbidpricegrey` int(11) default '70' COMMENT 'Starting bid price of Grey items as a percentage of the randomly chosen buyout price. Default: 70' AFTER `maxpriceyellow`,
+ ADD COLUMN `maxbidpricegrey` int(11) default '100' COMMENT 'Starting bid price of Grey items as a percentage of the randomly chosen buyout price. Default: 100' AFTER `minbidpricegrey`,
+ ADD COLUMN `minbidpriceorange` int(11) default '80' COMMENT 'Starting bid price of Orange items as a percentage of the randomly chosen buyout price. Default: 80' AFTER `maxbidpricepurple`,
+ ADD COLUMN `maxbidpriceorange` int(11) default '100' COMMENT 'Starting bid price of Orange items as a percentage of the randomly chosen buyout price. Default: 100' AFTER `minbidpriceorange`,
+ ADD COLUMN `minbidpriceyellow` int(11) default '80' COMMENT 'Starting bid price of Yellow items as a percentage of the randomly chosen buyout price. Default: 80' AFTER `maxbidpriceorange`,
+ ADD COLUMN `maxbidpriceyellow` int(11) default '100' COMMENT 'Starting bid price of Yellow items as a percentage of the randomly chosen buyout price. Default: 100' AFTER `minbidpriceyellow`,
+ ADD COLUMN `maxstackgrey` int(11) default '0' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.' AFTER `maxbidpriceyellow`,
+ ADD COLUMN `maxstackorange` int(11) default '1' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.' AFTER `maxstackpurple`,
+ ADD COLUMN `maxstackyellow` int(11) default '1' COMMENT 'Stack size limits for item qualities - a value of 0 will disable a maximum stack size for that quality, which will allow the bot to create items in stack as large as the item allows.' AFTER `maxstackorange`,
+ ADD COLUMN `buyerpriceorange` int(11) default '20' COMMENT 'Multiplier to vendorprice when buying orange items from auctionhouse' AFTER `buyerpricepurple`,
+ ADD COLUMN `buyerpriceyellow` int(11) default '22' COMMENT 'Multiplier to vendorprice when buying yellow items from auctionhouse' AFTER `buyerpriceorange`; \ No newline at end of file
diff --git a/sql/updates/1618_world.sql b/sql/updates/1618_world.sql
new file mode 100644
index 00000000000..a07dd31f630
--- /dev/null
+++ b/sql/updates/1618_world.sql
@@ -0,0 +1,6 @@
+-- Glyph of power word: shield
+INSERT INTO `spell_proc_event` VALUES (55672, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0);
+
+-- Bloodsurge
+DELETE FROM `spell_proc_event` WHERE `entry` IN (46915);
+INSERT INTO `spell_proc_event` VALUES (46915, 0x00, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1646_mangos_7369_01_world_quest_template.sql b/sql/updates/1646_mangos_7369_01_world_quest_template.sql
new file mode 100644
index 00000000000..e3146993c01
--- /dev/null
+++ b/sql/updates/1646_mangos_7369_01_world_quest_template.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7349_01_mangos_spell_area required_7369_01_mangos_quest_template bit;*/
+
+ALTER TABLE quest_template
+ DROP COLUMN ReqSourceRef1,
+ DROP COLUMN ReqSourceRef2,
+ DROP COLUMN ReqSourceRef3,
+ DROP COLUMN ReqSourceRef4; \ No newline at end of file
diff --git a/sql/updates/1654_world.sql b/sql/updates/1654_world.sql
new file mode 100644
index 00000000000..3e45462aa7f
--- /dev/null
+++ b/sql/updates/1654_world.sql
@@ -0,0 +1 @@
+INSERT INTO `spell_proc_event` VALUES (17619, 0x00, 13, 0x00000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1657_world.sql b/sql/updates/1657_world.sql
new file mode 100644
index 00000000000..009a4079ddb
--- /dev/null
+++ b/sql/updates/1657_world.sql
@@ -0,0 +1,2 @@
+DELETE FROM `trinity_string` WHERE `entry`=1010;
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES(1010, "| Account | Character | IP | GM | EXP |"); \ No newline at end of file
diff --git a/sql/updates/1661_world.sql b/sql/updates/1661_world.sql
new file mode 100644
index 00000000000..a1a9932ffaf
--- /dev/null
+++ b/sql/updates/1661_world.sql
@@ -0,0 +1,2 @@
+-- Death Strike
+INSERT INTO `spell_proc_event` VALUES (45469, 0x00, 15, 0x00000010, 0x00000000, 0x00000000, 0x00000010, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1663_mangos_7376_01_world_spell_area.sql b/sql/updates/1663_mangos_7376_01_world_spell_area.sql
new file mode 100644
index 00000000000..943d79d4b72
--- /dev/null
+++ b/sql/updates/1663_mangos_7376_01_world_spell_area.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7369_01_mangos_quest_template required_7376_01_mangos_spell_area bit;*/
+
+ALTER TABLE spell_area
+ CHANGE COLUMN `aura_spell` `aura_spell` mediumint(8) NOT NULL default '0'; \ No newline at end of file
diff --git a/sql/updates/1688_mangos_7382_01_world_creature_template.sql b/sql/updates/1688_mangos_7382_01_world_creature_template.sql
new file mode 100644
index 00000000000..c4813b47714
--- /dev/null
+++ b/sql/updates/1688_mangos_7382_01_world_creature_template.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7376_01_mangos_spell_area required_7382_01_mangos_creature_template bit;*/
+
+ALTER TABLE creature_template
+ ADD COLUMN unk16 float NOT NULL default '1' AFTER InhabitType,
+ ADD COLUMN unk17 float NOT NULL default '1' AFTER unk16; \ No newline at end of file
diff --git a/sql/updates/1693_world.sql b/sql/updates/1693_world.sql
new file mode 100644
index 00000000000..51bf45011b7
--- /dev/null
+++ b/sql/updates/1693_world.sql
@@ -0,0 +1,87 @@
+-- Update Proc Rate
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+('60442', '0', '0', '0', '0', '0', '0', '0', '0', '0', '45'),
+('57345', '0', '0', '0', '0', '0', '0', '0', '0', '0', '45'),
+('61356', '0', '0', '0', '0', '0', '0', '0', '0', '0', '45'),
+('54707', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60'),
+('54808', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60');
+
+-- Update Spell Coefficients
+DELETE FROM `spell_bonus_data` WHERE `entry` IN ('689', '18790', '172', '42223', '42224', '42225', '42226', '42218', '47817', '47818', '1949', '5857', '11681', '11682', '27214', '47822', '27243', '30108', '17962', '6789', '48181', '29722', '5676', '686', '17877', '30283', '1120', '30294', '44425', '42208', '42209', '42210', '42211', '42212', '42213', '42198', '42937', '42938', '11113', '31661', '120', '19750', '635', '25914', '25913', '25903', '27175', '33074', '48820', '48821', '58597', '31803', '53742', '31893', '32221', '53719', '53718', '20167', '20424', '31804', '53733', '31898', '32220', '53726', '53725', '20267', '20187', '20467', '53600', '596', '2944', '8092', '27813', '27817', '27818', '33619');
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `comments`) VALUES
+('689', '0', '0.143', '0', 'Warlock - Drain Life'),
+('18790', '0', '0', '0','Warlock - Fel Stamina'),
+('172', '0', '0.2', '0', 'Warlock - Corruption'),
+('42223', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 1'),
+('42224', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 2'),
+('42225', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 3'),
+('42226', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 4'),
+('42218', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 5'),
+('47817', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 6'),
+('47818', '0.6932', '0', '0', 'Warlock - Rain of Fire Triggered Rank 7'),
+('1949', '0', '0.0949', '0', 'Warlock - Hellfire'),
+('5857', '0.1427', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 1'),
+('11681', '0.1427', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 2'),
+('11682', '0.1427', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 3'),
+('27214', '0.1427', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 4'),
+('47822', '0.1427', '0', '0', 'Warlock - Hellfire Effect on Enemy Rank 5'),
+('27243', '0.2129', '0.25', '0', 'Warlock - Seed of Corruption'),
+('30108', '0', '0.2', '0', 'Warlock - Unstable Affliction'),
+('17962', '0.4293', '0', '0', 'Warlock - Conflagrate'),
+('6789', '0.214', '0', '0', 'Warlock - Death Coil'),
+('48181', '0.4793', '0', '0', 'Warlock - Haunt'),
+('29722', '0.7139', '0', '0', 'Warlock - Incinerate'),
+('5676', '0.4293', '0', '0', 'Warlock - Searing Pain'),
+('686', '0.8569', '0', '0', 'Warlock - Shadow Bolt'),
+('17877', '0.4293', '0', '0', 'Warlock - Shadowburn'),
+('30283', '0.1932', '0', '0', 'Warlock - Shadowfury'),
+('1120', '0', '0.429', '0', 'Warlock - Drain Soul'),
+('30294', '0', '0', '0', 'Warlock - Soul Leech'),
+('44425', '0.7143', '0', '0', 'Mage - Arcane Barrage'),
+('42208', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 1'),
+('42209', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 2'),
+('42210', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 3'),
+('42211', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 4'),
+('42212', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 5'),
+('42213', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 6'),
+('42198', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 7'),
+('42937', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 8'),
+('42938', '0.1437', '0', '0', 'Mage - Blizzard Triggered Spell Rank 9'),
+('11113', '0.1936', '0', '0', 'Mage - Blast Wave Rank'),
+('31661', '0.1936', '0', '0', 'Mage - Dragons Breath'),
+('120', '0.214', '0', '0', 'Mage - Cone of Cold'),
+('19750', '1', '0', '0', 'Paladin - Flash of Light'),
+('635', '1.66', '0', '0', 'Paladin - Holy Light'),
+('25914', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 1'),
+('25913', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 2'),
+('25903', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 3'),
+('27175', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 4'),
+('33074', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 5'),
+('48820', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 6'),
+('48821', '0.81', '0', '0', 'Paladin - Holy Shock Triggered Heal Rank 7'),
+('58597', '0.75', '0', '0', 'Paladin - Sacred Shield'),
+('31803', '0', '0.018', '0.03', 'Paladin - Holy Vengeance'),
+('53742', '0', '0.018', '0.03', 'Paladin - Blood Corruption'),
+('31893', '0', '0', '0', 'Paladin - Seal of Blood Enemy Proc'),
+('32221', '0', '0', '0', 'Paladin - Seal of Blood Self Proc'),
+('53719', '0', '0', '0', 'Paladin - Seal of The Martyr Enemy Proc'),
+('53718', '0', '0', '0', 'Paladin - Seal of The Martyr Self Proc'),
+('20167', '0.15', '0', '0.15', 'Paladin - Seal of Light Proc'),
+('20424', '0.1035', '0', '0', 'Paladin - Seal of Command Proc'),
+('31804', '0.22', '0', '0.14', 'Paladin - Judgement of Vengeance'),
+('53733', '0.22', '0', '0.14', 'Paladin - Judgement of Corruption'),
+('31898', '0.25', '0', '0.16', 'Paladin - Judgement of Blood Enemy'),
+('32220', '0', '0', '0', 'Paladin - Judgement of Blood Self'),
+('53726', '0.25', '0', '0.16', 'Paladin - Judgement of the Martyr Enemy'),
+('53725', '0', '0', '0', 'Paladin - Judgement of the Martyr Self'),
+('20267', '0.1', '0', '0.1', 'Paladin - Judgement of Light Proc'),
+('20187', '0.4', '0', '0.25', 'Paladin - Judgement of Righteousness'),
+('20467', '0.25', '0', '0.16', 'Paladin - Judgement of Command'),
+('53600', '0', '0', '0', 'Paladin - Shield of Righteousness'),
+('596', '0.8068', '0', '0', 'Priest - Prayer of Healing'),
+('2944', '0.8149', '0', '0', 'Priest - Devouring Plague'),
+('8092', '0.428', '0', '0', 'Priest - Mind Blast'),
+('27813', '0', '0', '0', 'Priest - Blessed Recovery Rank 1'),
+('27817', '0', '0', '0', 'Priest - Blessed Recovery Rank 2'),
+('27818', '0', '0', '0', 'Priest - Blessed Recovery Rank 3'),
+('33619', '0', '0', '0', 'Priest - Reflective Shield'); \ No newline at end of file
diff --git a/sql/updates/1694_world.sql b/sql/updates/1694_world.sql
new file mode 100644
index 00000000000..4702c66ad49
--- /dev/null
+++ b/sql/updates/1694_world.sql
@@ -0,0 +1,16 @@
+-- Sanctified Wrath
+INSERT INTO `spell_proc_event` VALUES (57318, 0x00, 10, 0x00000000, 0x00002000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 6);
+INSERT INTO `spell_proc_event` VALUES (53375, 0x00, 10, 0x00000000, 0x00002000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 6);
+
+-- Star Sinner
+DELETE FROM `spell_proc_event` WHERE `entry` IN (54738);
+INSERT INTO `spell_proc_event` VALUES (54738, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45);
+
+-- Tentacles
+DELETE FROM `spell_proc_event` WHERE `entry` IN (61618);
+INSERT INTO `spell_proc_event` VALUES (61618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
+
+-- Demonic Sacrifice
+DELETE FROM `spell_bonus_data` WHERE `entry` = 18790;
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`comments`) VALUES
+('18790','0','0','0','Warlock - Fel Stamina'); \ No newline at end of file
diff --git a/sql/updates/1697_mangos_7388_01_world_trinity_string.sql b/sql/updates/1697_mangos_7388_01_world_trinity_string.sql
new file mode 100644
index 00000000000..eefddb97e63
--- /dev/null
+++ b/sql/updates/1697_mangos_7388_01_world_trinity_string.sql
@@ -0,0 +1,6 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7382_01_mangos_creature_template required_7388_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (750,751);
+INSERT INTO `trinity_string` VALUES
+(750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1703_world.sql b/sql/updates/1703_world.sql
new file mode 100644
index 00000000000..f25085cf05c
--- /dev/null
+++ b/sql/updates/1703_world.sql
@@ -0,0 +1,140 @@
+DROP TABLE IF EXISTS `access_requirement`;
+CREATE TABLE `access_requirement` (
+ `id` bigint(20) unsigned NOT NULL COMMENT 'Identifier',
+ `level_min` tinyint(3) unsigned NOT NULL default '0',
+ `level_max` tinyint(3) unsigned NOT NULL default '0',
+ `item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `item2` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `heroic_key` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `heroic_key2` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `quest_done` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `quest_failed_text` TEXT NULL DEFAULT NULL,
+ `heroic_quest_done` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `heroic_quest_failed_text` TEXT NULL DEFAULT NULL,
+ `comment` TEXT NULL DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Access Requirements';
+
+ALTER TABLE `instance_template`
+ DROP COLUMN `levelMin`,
+ DROP COLUMN `levelMax`,
+ ADD COLUMN `access_id` bigint(20) unsigned NOT NULL DEFAULT '0' AFTER `reset_delay`;
+
+ALTER TABLE `areatrigger_teleport`
+ DROP COLUMN `required_level`,
+ DROP COLUMN `required_item`,
+ DROP COLUMN `required_item2`,
+ DROP COLUMN `heroic_key`,
+ DROP COLUMN `heroic_key2`,
+ DROP COLUMN `heroic_required_quest_done`,
+ DROP COLUMN `heroic_required_failed_quest_text`,
+ DROP COLUMN `required_quest_done`,
+ DROP COLUMN `required_failed_text`,
+ ADD COLUMN `access_id` bigint(20) unsigned NOT NULL DEFAULT '0' AFTER `name`;
+
+INSERT INTO `access_requirement` VALUES
+('1','10','0','0','0','0','0','0',NULL,'0',NULL,'instance Shadowfang Keep (33)'),
+('2','15','0','0','0','0','0','0',NULL,'0',NULL,'instance The Stockade (34)'),
+('3','10','0','0','0','0','0','0',NULL,'0',NULL,'instance The Deadmines (36)'),
+('4','10','0','0','0','0','0','0',NULL,'0',NULL,'instance Wailing Caverns (43)'),
+('5','15','0','0','0','0','0','0',NULL,'0',NULL,'instance Razorfen Kraul (47)'),
+('6','10','0','0','0','0','0','0',NULL,'0',NULL,'instance Blackfathom Deeps (48)'),
+('7','30','0','0','0','0','0','0',NULL,'0',NULL,'instance Uldaman (70)'),
+('8','15','0','0','0','0','0','0',NULL,'0',NULL,'instance Gnomeregan (90)'),
+('9','35','0','0','0','0','0','0',NULL,'0',NULL,'instance Sunken Temple (109)'),
+('10','25','0','0','0','0','0','0',NULL,'0',NULL,'instance Razorfen Downs (129)'),
+('11','20','0','0','0','0','0','0',NULL,'0',NULL,'instance Scarlet Monastery (189)'),
+('12','35','0','0','0','0','0','0',NULL,'0',NULL,'instance Zul\'Farrak (209)'),
+('13','45','0','0','0','0','0','0',NULL,'0',NULL,'instance Blackrock Spire (229)'),
+('14','40','0','0','0','0','0','0',NULL,'0',NULL,'instance Blackrock Depths (230)'),
+('15','55','0','16309','0','0','0','0',NULL,'0',NULL,'instance Onyxia\'s Lair (249)'),
+('16','66','0','0','0','30635','0','10285','You can\'t enter Black Morass until you rescue Thrall from Durnholde Keep.','0',NULL,'instance The Black Morass (269)'),
+('17','45','0','13704','0','0','0','0',NULL,'0',NULL,'instance Scholomance (289)'),
+('18','50','0','0','0','0','0','0',NULL,'0',NULL,'instance Zul\'Gurub (309)'),
+('19','45','0','0','0','0','0','0',NULL,'0',NULL,'instance Stratholme (329)'),
+('20','30','0','0','0','0','0','0',NULL,'0',NULL,'instance Maraudon (349)'),
+('21','8','0','0','0','0','0','0',NULL,'0',NULL,'instance Ragefire Chasm (389)'),
+('22','50','0','0','0','0','0','7487',NULL,'0',NULL,'instance Molten Core (409)'),
+('23','45','0','0','0','0','0','0',NULL,'0',NULL,'instance Dire Maul (429)'),
+('24','60','0','0','0','0','0','7761',NULL,'0',NULL,'instance Blackwing Lair (469)'),
+('25','60','0','0','0','0','0','0',NULL,'0',NULL,'instance Ruins of Ahn\'Qiraj (509)'),
+('26','60','0','0','0','0','0','0',NULL,'0',NULL,'instance Temple of Ahn\'Qiraj (531)'),
+('27','68','0','0'/*'24490'*/,'0','0','0','0',NULL,'0',NULL,'instance Karazhan (532)'),
+('28','60','0','0','0','0','0','0',NULL,'0',NULL,'instance Naxxramas (533)'),
+('29','70','0','0','0','0','0','10445',NULL,'0',NULL,'instance Hyjal Summit (534)'),
+('30','55','0','0'/*'28395'*/,'0','30637','30622','0',NULL,'0',NULL,'instance The Shattered Halls (540)'),
+('31','55','0','0','0','30637','30622','0',NULL,'0',NULL,'instance The Blood Furnace (542)'),
+('32','55','0','0','0','30637','30622','0',NULL,'0',NULL,'instance Hellfire Ramparts (543)'),
+('33','65','0','0','0','0','0','0',NULL,'0',NULL,'instance Magtheridon\'s Lair (544)'),
+('34','55','0','0','0','30623','0','0',NULL,'0',NULL,'instance The Steamvault (545)'),
+('35','55','0','0','0','30623','0','0',NULL,'0',NULL,'instance The Underbog (546)'),
+('36','55','0','0','0','30623','0','0',NULL,'0',NULL,'instance The Slave Pens (547)'),
+('37','70','0','0','0','0','0','0'/*'10901'*/,NULL,'0',NULL,'instance Serpentshrine Cavern (548)'),
+('38','70','0','0'/*'31704'*/,'0','0','0','0',NULL,'0',NULL,'instance The Eye (550)'),
+('39','68','0','0'/*'31084'*/,'0','30634','0','0',NULL,'0',NULL,'instance The Arcatraz (552)'),
+('40','68','0','0','0','30634','0','0',NULL,'0',NULL,'instance The Botanica (553)'),
+('41','68','0','0','0','30634','0','0',NULL,'0',NULL,'instance The Mechanar (554)'),
+('42','65','0','27991','0','30633','0','0',NULL,'0',NULL,'instance Shadow Labyrinth (555)'),
+('43','55','0','0','0','30633','0','0',NULL,'0',NULL,'instance Sethekk Halls (556)'),
+('44','55','0','0','0','30633','0','0',NULL,'0',NULL,'instance Mana-Tombs (557)'),
+('45','55','0','0','0','30633','0','0',NULL,'0',NULL,'instance Auchenai Crypts (558)'),
+('46','66','0','0','0','30635','0','0',NULL,'0',NULL,'instance Old Hillsbrad Foothills (560)'),
+('47','70','0','32649','0','0','0','0',NULL,'0',NULL,'instance Black Temple (564)'),
+('48','65','0','0','0','0','0','0',NULL,'0',NULL,'instance Gruul\'s Lair (565)'),
+('49','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Zul\'Aman (568)'),
+('50','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Sunwell Plateau (580)'),
+('51','70','0','0','0','0','0','0',NULL,'11492','Heroic Difficulty requires completion of the "Hard to Kill" quest.','instance Magisters\' Terrace (585)'),
+('52','58','0','0','0','0','0','0',NULL,'0',NULL,'Dark Portal');
+
+UPDATE `instance_template` SET `access_id` = '1' WHERE `map` = '33';
+UPDATE `instance_template` SET `access_id` = '2' WHERE `map` = '34';
+UPDATE `instance_template` SET `access_id` = '3' WHERE `map` = '36';
+UPDATE `instance_template` SET `access_id` = '4' WHERE `map` = '43';
+UPDATE `instance_template` SET `access_id` = '5' WHERE `map` = '47';
+UPDATE `instance_template` SET `access_id` = '6' WHERE `map` = '48';
+UPDATE `instance_template` SET `access_id` = '7' WHERE `map` = '70';
+UPDATE `instance_template` SET `access_id` = '8' WHERE `map` = '90';
+UPDATE `instance_template` SET `access_id` = '9' WHERE `map` = '109';
+UPDATE `instance_template` SET `access_id` = '10' WHERE `map` = '129';
+UPDATE `instance_template` SET `access_id` = '11' WHERE `map` = '189';
+UPDATE `instance_template` SET `access_id` = '12' WHERE `map` = '209';
+UPDATE `instance_template` SET `access_id` = '13' WHERE `map` = '229';
+UPDATE `instance_template` SET `access_id` = '14' WHERE `map` = '230';
+UPDATE `instance_template` SET `access_id` = '15' WHERE `map` = '249';
+UPDATE `instance_template` SET `access_id` = '16' WHERE `map` = '269';
+UPDATE `instance_template` SET `access_id` = '17' WHERE `map` = '289';
+UPDATE `instance_template` SET `access_id` = '18' WHERE `map` = '309';
+UPDATE `instance_template` SET `access_id` = '19' WHERE `map` = '329';
+UPDATE `instance_template` SET `access_id` = '20' WHERE `map` = '349';
+UPDATE `instance_template` SET `access_id` = '21' WHERE `map` = '389';
+UPDATE `instance_template` SET `access_id` = '22' WHERE `map` = '409';
+UPDATE `instance_template` SET `access_id` = '23' WHERE `map` = '429';
+UPDATE `instance_template` SET `access_id` = '24' WHERE `map` = '469';
+UPDATE `instance_template` SET `access_id` = '25' WHERE `map` = '509';
+UPDATE `instance_template` SET `access_id` = '26' WHERE `map` = '531';
+UPDATE `instance_template` SET `access_id` = '27' WHERE `map` = '532';
+UPDATE `instance_template` SET `access_id` = '28' WHERE `map` = '533';
+UPDATE `instance_template` SET `access_id` = '29' WHERE `map` = '534';
+UPDATE `instance_template` SET `access_id` = '30' WHERE `map` = '540';
+UPDATE `instance_template` SET `access_id` = '31' WHERE `map` = '542';
+UPDATE `instance_template` SET `access_id` = '32' WHERE `map` = '543';
+UPDATE `instance_template` SET `access_id` = '33' WHERE `map` = '544';
+UPDATE `instance_template` SET `access_id` = '34' WHERE `map` = '545';
+UPDATE `instance_template` SET `access_id` = '35' WHERE `map` = '546';
+UPDATE `instance_template` SET `access_id` = '36' WHERE `map` = '547';
+UPDATE `instance_template` SET `access_id` = '37' WHERE `map` = '548';
+UPDATE `instance_template` SET `access_id` = '38' WHERE `map` = '550';
+UPDATE `instance_template` SET `access_id` = '39' WHERE `map` = '552';
+UPDATE `instance_template` SET `access_id` = '40' WHERE `map` = '553';
+UPDATE `instance_template` SET `access_id` = '41' WHERE `map` = '554';
+UPDATE `instance_template` SET `access_id` = '42' WHERE `map` = '555';
+UPDATE `instance_template` SET `access_id` = '43' WHERE `map` = '556';
+UPDATE `instance_template` SET `access_id` = '44' WHERE `map` = '557';
+UPDATE `instance_template` SET `access_id` = '45' WHERE `map` = '558';
+UPDATE `instance_template` SET `access_id` = '46' WHERE `map` = '560';
+UPDATE `instance_template` SET `access_id` = '47' WHERE `map` = '564';
+UPDATE `instance_template` SET `access_id` = '48' WHERE `map` = '565';
+UPDATE `instance_template` SET `access_id` = '49' WHERE `map` = '568';
+UPDATE `instance_template` SET `access_id` = '50' WHERE `map` = '580';
+UPDATE `instance_template` SET `access_id` = '51' WHERE `map` = '585';
+UPDATE `areatrigger_teleport` SET `access_id` = '52' WHERE `id` IN ('4352','4354'); \ No newline at end of file
diff --git a/sql/updates/1709_mangos_7393_01_world_game_event.sql b/sql/updates/1709_mangos_7393_01_world_game_event.sql
new file mode 100644
index 00000000000..5dcdaf3ce01
--- /dev/null
+++ b/sql/updates/1709_mangos_7393_01_world_game_event.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7390_01_mangos_areatrigger_teleport required_7393_01_mangos_game_event bit;*/
+
+ALTER TABLE `game_event`
+ ADD COLUMN `holiday` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Client side holiday id' AFTER `length`; \ No newline at end of file
diff --git a/sql/updates/1724_mangos_7399_01_world_trinity_string.sql b/sql/updates/1724_mangos_7399_01_world_trinity_string.sql
new file mode 100644
index 00000000000..de0ac0ed77d
--- /dev/null
+++ b/sql/updates/1724_mangos_7399_01_world_trinity_string.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7393_01_mangos_game_event required_7399_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (753, 754, 755);
+INSERT INTO `trinity_string` VALUES
+(753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(755,'The battle for Eye of the Storm begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1727_world.sql b/sql/updates/1727_world.sql
new file mode 100644
index 00000000000..07089e166b0
--- /dev/null
+++ b/sql/updates/1727_world.sql
@@ -0,0 +1 @@
+INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES (42857,1,23954); \ No newline at end of file
diff --git a/sql/updates/1727_world_script.sql b/sql/updates/1727_world_script.sql
new file mode 100644
index 00000000000..b1bd036c9ca
--- /dev/null
+++ b/sql/updates/1727_world_script.sql
@@ -0,0 +1,3 @@
+UPDATE `creature_template` SET `ScriptName`='boss_ingvar_the_plunderer' WHERE `entry`=23954;
+UPDATE `creature_template` SET `ScriptName`='mob_annhylde_the_caller' WHERE `entry`=24068;
+UPDATE `creature_template` SET `ScriptName`='mob_ingvar_throw_dummy' WHERE `entry`=23997; \ No newline at end of file
diff --git a/sql/updates/1729_world.sql b/sql/updates/1729_world.sql
new file mode 100644
index 00000000000..9691e1e7059
--- /dev/null
+++ b/sql/updates/1729_world.sql
@@ -0,0 +1,4 @@
+-- Judgements of the Wise
+REPLACE INTO `spell_proc_event` VALUES (31876, 0x00, 10, 0x20180400, 0x0000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (31877, 0x00, 10, 0x20180400, 0x0000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (31878, 0x00, 10, 0x20180400, 0x0000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1730_world.sql b/sql/updates/1730_world.sql
new file mode 100644
index 00000000000..7bf2425186f
--- /dev/null
+++ b/sql/updates/1730_world.sql
@@ -0,0 +1,4 @@
+-- Faerie fire
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `comments`) VALUES ('60089', '0', '0', '0.05', 'Druid - Faerie Fire (Bear Form)');
+-- Glyph of Devastate
+INSERT INTO `spell_proc_event` VALUES (58388, 0x00, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000110, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1732_world.sql b/sql/updates/1732_world.sql
new file mode 100644
index 00000000000..f5aae9117c9
--- /dev/null
+++ b/sql/updates/1732_world.sql
@@ -0,0 +1,7 @@
+-- Improved Cower
+INSERT INTO `spell_proc_event` VALUES (53180, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (53181, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+
+-- Guard Dog
+INSERT INTO `spell_proc_event` VALUES (53178, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (53179, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1755_world.sql b/sql/updates/1755_world.sql
new file mode 100644
index 00000000000..bd4bb50aad2
--- /dev/null
+++ b/sql/updates/1755_world.sql
@@ -0,0 +1,12 @@
+DELETE FROM spell_proc_event WHERE entry IN (47535, 47536, 47537, 47538, 47539);
+-- Rapture
+INSERT INTO `spell_proc_event` VALUES (47535, 0x00, 6, 0x1800, 0x10000, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (47536, 0x00, 6, 0x1800, 0x10000, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (47537, 0x00, 6, 0x1800, 0x10000, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (47538, 0x00, 6, 0x1800, 0x10000, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (47539, 0x00, 6, 0x1800, 0x10000, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
+-- Aspect of the viper
+INSERT INTO `spell_proc_event` VALUES (34074, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0.000000, 0.000000, 0);
+
+DELETE FROM `spell_bonus_data` WHERE entry=2944;
+INSERT INTO `spell_bonus_data` VALUES ('2944', '0', '0.1849', '0', 'Priest - Devouring Plague'); \ No newline at end of file
diff --git a/sql/updates/1764_world.sql b/sql/updates/1764_world.sql
new file mode 100644
index 00000000000..016066430b6
--- /dev/null
+++ b/sql/updates/1764_world.sql
@@ -0,0 +1,9 @@
+-- Infusion of Light
+REPLACE INTO `spell_proc_event` VALUES (54149, 0x00, 10, 2097152, 65536, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (53672, 0x00, 10, 2097152, 65536, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+-- Illumination
+REPLACE INTO `spell_proc_event` VALUES (20210, 0x00, 10, 3221225472, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (20212, 0x00, 10, 3221225472, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (20213, 0x00, 10, 3221225472, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (20214, 0x00, 10, 3221225472, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (20215, 0x00, 10, 3221225472, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1766_world.sql b/sql/updates/1766_world.sql
new file mode 100644
index 00000000000..7ef48e41ce2
--- /dev/null
+++ b/sql/updates/1766_world.sql
@@ -0,0 +1,2 @@
+REPLACE INTO `spell_proc_event` VALUES (33182, 0x00, 6, 32, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (33174, 0x00, 6, 32, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1791_mangos_7422_01_world_trinity_string.sql b/sql/updates/1791_mangos_7422_01_world_trinity_string.sql
new file mode 100644
index 00000000000..c1394e16ad8
--- /dev/null
+++ b/sql/updates/1791_mangos_7422_01_world_trinity_string.sql
@@ -0,0 +1,9 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7399_01_mangos_mangos_string required_7422_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (811, 812, 813, 814, 815);
+INSERT INTO `trinity_string` VALUES
+(811,'Guild Master',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(812,'Officer',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(813,'Veteran',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(814,'Member',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(815,'Initiate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1814_world.sql b/sql/updates/1814_world.sql
new file mode 100644
index 00000000000..fa403b5ac81
--- /dev/null
+++ b/sql/updates/1814_world.sql
@@ -0,0 +1,4 @@
+-- Improved Fire Nova Totem
+DELETE FROM `spell_proc_event` WHERE `entry` IN (16086, 16544);
+INSERT INTO `spell_proc_event` VALUES (16086, 0x00, 7, 0, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (16544, 0x00, 7, 0, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1825_world.sql b/sql/updates/1825_world.sql
new file mode 100644
index 00000000000..3b40e758455
--- /dev/null
+++ b/sql/updates/1825_world.sql
@@ -0,0 +1 @@
+INSERT INTO `spell_linked_spell` VALUES (-47953, 60406, 0, 'Divine hymn buff to enemies'); \ No newline at end of file
diff --git a/sql/updates/1828_world.sql b/sql/updates/1828_world.sql
new file mode 100644
index 00000000000..1b80fd33559
--- /dev/null
+++ b/sql/updates/1828_world.sql
@@ -0,0 +1,3 @@
+INSERT INTO `spell_linked_spell` VALUES (48265, 49772, 2, 'Unholy Presence');
+INSERT INTO `spell_linked_spell` VALUES (49772, 55222, 2, 'Unholy Presence');
+INSERT INTO `spell_linked_spell` VALUES (48263, 61261, 2, 'Frost Presence'); \ No newline at end of file
diff --git a/sql/updates/1877_mangos_7439_01_world_trinity_string.sql b/sql/updates/1877_mangos_7439_01_world_trinity_string.sql
new file mode 100644
index 00000000000..3389ff73ef4
--- /dev/null
+++ b/sql/updates/1877_mangos_7439_01_world_trinity_string.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7422_01_mangos_mangos_string required_7439_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (175);
+INSERT INTO `trinity_string` VALUES
+(175,'Liquid level: %f, ground: %f, type: %d, status: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1884_world.sql b/sql/updates/1884_world.sql
new file mode 100644
index 00000000000..227e9c826c3
--- /dev/null
+++ b/sql/updates/1884_world.sql
@@ -0,0 +1 @@
+DELETE FROM `trinity_string` WHERE `entry` IN (10056, 10057); \ No newline at end of file
diff --git a/sql/updates/1886_world.sql b/sql/updates/1886_world.sql
new file mode 100644
index 00000000000..8dbac159633
--- /dev/null
+++ b/sql/updates/1886_world.sql
@@ -0,0 +1,6 @@
+INSERT INTO `spell_linked_spell` VALUES (61847, 61848, 2, 'Aspect of te dragonhawk');
+INSERT INTO `spell_linked_spell` VALUES (61846, 61848, 2, 'Aspect of te dragonhawk');
+
+-- Glyph of Aspect of the Monkey
+REPLACE INTO `spell_proc_event` VALUES (13163, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000010, 0.000000, 0.000000, 0);
+REPLACE INTO `spell_proc_event` VALUES (61848, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000010, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1911_world.sql b/sql/updates/1911_world.sql
new file mode 100644
index 00000000000..9670819d7ea
--- /dev/null
+++ b/sql/updates/1911_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (44545, 44543);
+INSERT INTO `spell_proc_event` VALUES
+(44545, 0x00, 3, 1049120, 4096, 0x00000000, 0x0010000, 0x00000000, 15.000000, 0.000000, 0),
+(44543, 0x00, 3, 1049120, 4096, 0x00000000, 0x0010000, 0x00000000, 7.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1912_world.sql b/sql/updates/1912_world.sql
new file mode 100644
index 00000000000..4c8afaea8d9
--- /dev/null
+++ b/sql/updates/1912_world.sql
@@ -0,0 +1,5 @@
+-- Improved Fear
+DELETE FROM `spell_proc_event` WHERE `entry` IN (53754, 53759);
+INSERT INTO `spell_proc_event` VALUES
+(53754, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0),
+(53759, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1927_world.sql b/sql/updates/1927_world.sql
new file mode 100644
index 00000000000..8867c6cb24a
--- /dev/null
+++ b/sql/updates/1927_world.sql
@@ -0,0 +1,11 @@
+-- Nature's Grace --
+DELETE FROM `spell_proc_event` WHERE `entry` IN (16880, 61345, 61346);
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(16880, 0x48, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(61345, 0x48, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(61346, 0x48, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+-- Blade Twisting --
+DELETE FROM `spell_proc_event` WHERE `entry` IN (31124, 31126);
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(31124, 0x00, 8, 0x01000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31126, 0x00, 8, 0x01000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
diff --git a/sql/updates/1939_word.sql b/sql/updates/1939_word.sql
new file mode 100644
index 00000000000..dec33f94d59
--- /dev/null
+++ b/sql/updates/1939_word.sql
@@ -0,0 +1,5 @@
+-- Psychic Horror
+DELETE FROM `spell_proc_event` WHERE `entry` IN (47571, 47572);
+INSERT INTO `spell_proc_event` VALUES
+(47571, 0x00, 6, 65536, 0x00000000, 0x00000000, 0x00010000, 0x0006000, 0.000000, 50.000000, 0),
+(47572, 0x00, 6, 65536, 0x00000000, 0x00000000, 0x00010000, 0x0006000, 0.000000, 100.000000, 0);
diff --git a/sql/updates/1957_word.sql b/sql/updates/1957_word.sql
new file mode 100644
index 00000000000..acf7179f5ad
--- /dev/null
+++ b/sql/updates/1957_word.sql
@@ -0,0 +1,5 @@
+-- Furious Attacks
+DELETE FROM `spell_proc_event` WHERE `entry` IN (46910, 46911);
+INSERT INTO `spell_proc_event` VALUES
+(46910, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000001, 5.5000000, 0.000000, 0),
+(46911, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000001, 7.5000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1962_mangos_7472_01_world_trinity_string.sql b/sql/updates/1962_mangos_7472_01_world_trinity_string.sql
new file mode 100644
index 00000000000..ddb575590c7
--- /dev/null
+++ b/sql/updates/1962_mangos_7472_01_world_trinity_string.sql
@@ -0,0 +1,27 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7439_01_mangos_mangos_string required_7472_01_mangos_mangos_string bit;*/
+
+DELETE FROM trinity_string WHERE entry >= 667 and entry <= 687 or entry = 614 or entry = 615;
+INSERT INTO trinity_string VALUES
+(614,'The Alliance flag is now placed at its base.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(615,'The Horde flag is now placed at its base.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(667,'The Alliance has taken control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(668,'The Horde has taken control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(669,'The Alliance has taken control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(670,'The Horde has taken control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(671,'The Alliance has taken control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(672,'The Horde has taken control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(673,'The Alliance has taken control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(674,'The Horde has taken control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(675,'The Alliance has lost control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(676,'The Horde has lost control of the Mage Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(677,'The Alliance has lost control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(678,'The Horde has lost control of the Draenei Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(679,'The Alliance has lost control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(680,'The Horde has lost control of the Blood Elf Tower!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(681,'The Alliance has lost control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(682,'The Horde has lost control of the Fel Reaver Ruins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(683,'%s has taken the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(684,'The Alliance have captured the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(685,'The Horde have captured the flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(686,'The flag has been dropped.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(687,'The flag has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/1018_world.sql b/sql/updates/2.4.3_updates/1018_world.sql
index 89a13686d8a..d231eb168b9 100644
--- a/sql/updates/1018_world.sql
+++ b/sql/updates/2.4.3_updates/1018_world.sql
@@ -4,4 +4,3 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm
(41292, 42017, 2, 'Aura of Suffering'),
(44007, -43657, 2, 'Storm Eye Safe Zone Immune'),
(44867, -46019, 2, 'Spectral Exhaustion - Teleport: Spectral Realm');
-
diff --git a/sql/updates/1026_world.sql b/sql/updates/2.4.3_updates/1026_world.sql
index 1ed2e34316a..ae189469b41 100644
--- a/sql/updates/1026_world.sql
+++ b/sql/updates/2.4.3_updates/1026_world.sql
@@ -3,4 +3,3 @@ INSERT INTO `spell_linked_spell`(`spell_trigger`,`spell_effect`,`type`,`comment`
('-33711','33686','0','Murmur\'s Shockwave (Normal)'),
('-38794','33686','0','Murmur\'s Shockwave (Heroic)'),
('33686','31705','0','Murmur\'s Shockwave Jump');
-
diff --git a/sql/updates/1028_world_scripts.sql b/sql/updates/2.4.3_updates/1028_world_scripts.sql
index 21891693f29..9c821c7b093 100644
--- a/sql/updates/1028_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/1028_world_scripts.sql
@@ -1,2 +1 @@
UPDATE `creature_template` SET `ScriptName`='boss_the_black_stalker' WHERE `entry`='17882';
-
diff --git a/sql/updates/102_world.sql b/sql/updates/2.4.3_updates/102_world.sql
index b3818da5b9f..6cbf3d1a6b4 100644
--- a/sql/updates/102_world.sql
+++ b/sql/updates/2.4.3_updates/102_world.sql
@@ -1,3 +1,2 @@
ALTER TABLE `quest_template`
ADD `RewHonorableKills` mediumint(9) unsigned NOT NULL default '0' AFTER `RewRepValue5`;
-
diff --git a/sql/updates/1069_world_scripts.sql b/sql/updates/2.4.3_updates/1069_world_scripts.sql
index 1f3b7a728e9..0fafabf63f1 100644
--- a/sql/updates/1069_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/1069_world_scripts.sql
@@ -9,5 +9,4 @@ INSERT INTO `spell_script_target` (`entry`,`type`,`targetEntry`) VALUES
('32314', '2', '17138'),
('32314', '2', '18037'),
('32314', '2', '18064'),
-('32314', '2', '18065');
-
+('32314', '2', '18065'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/1073_world_scripts.sql b/sql/updates/2.4.3_updates/1073_world_scripts.sql
new file mode 100644
index 00000000000..5b75c1efad5
--- /dev/null
+++ b/sql/updates/2.4.3_updates/1073_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_plains_vision' WHERE `entry`='2983'; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/1074_world_scripts.sql b/sql/updates/2.4.3_updates/1074_world_scripts.sql
new file mode 100644
index 00000000000..2863a1fb6aa
--- /dev/null
+++ b/sql/updates/2.4.3_updates/1074_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName` = 'npc_plucky' WHERE `entry` = '6626'; \ No newline at end of file
diff --git a/sql/updates/112_world_scripts.sql b/sql/updates/2.4.3_updates/112_world_scripts.sql
index f812c6f3c68..e48ed250741 100644
--- a/sql/updates/112_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/112_world_scripts.sql
@@ -1,3 +1,2 @@
UPDATE `item_template` SET `ScriptName`='item_arcane_charges' WHERE `entry`='34475';
-UPDATE gameobject_template SET faction = 14 WHERE entry = 185134;
-
+UPDATE gameobject_template SET faction = 14 WHERE entry = 185134; \ No newline at end of file
diff --git a/sql/updates/1138_world.sql b/sql/updates/2.4.3_updates/1138_world.sql
index 610f97139a5..8ed14a211e2 100644
--- a/sql/updates/1138_world.sql
+++ b/sql/updates/2.4.3_updates/1138_world.sql
@@ -1 +1 @@
-INSERT INTO `spell_proc_event` VALUES (17619, 0x00, 13, 0x0000000000000000, 0x00008000, 0x00000000, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (17619, 0x00, 13, 0x0000000000000000, 0x00008000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1142_world.sql b/sql/updates/2.4.3_updates/1142_world.sql
index 2109d0f8ab7..3301200f2db 100644
--- a/sql/updates/1142_world.sql
+++ b/sql/updates/2.4.3_updates/1142_world.sql
@@ -5,4 +5,4 @@ INSERT INTO `spell_affect` VALUES (16999, 2, 0x1000001000);
DELETE from `spell_affect` where entry=16998 and effectId=0;
DELETE from `spell_affect` where entry=16998 and effectId=2;
INSERT INTO `spell_affect` VALUES (16998, 0, 0x1000001000);
-INSERT INTO `spell_affect` VALUES (16998, 2, 0x1000001000);
+INSERT INTO `spell_affect` VALUES (16998, 2, 0x1000001000); \ No newline at end of file
diff --git a/sql/updates/1159_world.sql b/sql/updates/2.4.3_updates/1159_world.sql
index b237e0422c4..0e9d98e9a9c 100644
--- a/sql/updates/1159_world.sql
+++ b/sql/updates/2.4.3_updates/1159_world.sql
@@ -5,6 +5,4 @@ INSERT INTO `spell_affect` VALUES (16998, 1, 0x40000001000);
INSERT INTO `spell_affect` VALUES (16998, 2, 0x40000001000);
INSERT INTO `spell_affect` VALUES (16999, 0, 0x40000001000);
INSERT INTO `spell_affect` VALUES (16999, 1, 0x40000001000);
-INSERT INTO `spell_affect` VALUES (16999, 2, 0x40000001000);
-
-
+INSERT INTO `spell_affect` VALUES (16999, 2, 0x40000001000); \ No newline at end of file
diff --git a/sql/updates/1160_world.sql b/sql/updates/2.4.3_updates/1160_world.sql
index 5c77aebdf41..f25085cf05c 100644
--- a/sql/updates/1160_world.sql
+++ b/sql/updates/2.4.3_updates/1160_world.sql
@@ -15,7 +15,6 @@ CREATE TABLE `access_requirement` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Access Requirements';
-
ALTER TABLE `instance_template`
DROP COLUMN `levelMin`,
DROP COLUMN `levelMax`,
@@ -62,7 +61,7 @@ INSERT INTO `access_requirement` VALUES
('26','60','0','0','0','0','0','0',NULL,'0',NULL,'instance Temple of Ahn\'Qiraj (531)'),
('27','68','0','0'/*'24490'*/,'0','0','0','0',NULL,'0',NULL,'instance Karazhan (532)'),
('28','60','0','0','0','0','0','0',NULL,'0',NULL,'instance Naxxramas (533)'),
-('29','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Hyjal Summit (534)'),
+('29','70','0','0','0','0','0','10445',NULL,'0',NULL,'instance Hyjal Summit (534)'),
('30','55','0','0'/*'28395'*/,'0','30637','30622','0',NULL,'0',NULL,'instance The Shattered Halls (540)'),
('31','55','0','0','0','30637','30622','0',NULL,'0',NULL,'instance The Blood Furnace (542)'),
('32','55','0','0','0','30637','30622','0',NULL,'0',NULL,'instance Hellfire Ramparts (543)'),
@@ -80,7 +79,7 @@ INSERT INTO `access_requirement` VALUES
('44','55','0','0','0','30633','0','0',NULL,'0',NULL,'instance Mana-Tombs (557)'),
('45','55','0','0','0','30633','0','0',NULL,'0',NULL,'instance Auchenai Crypts (558)'),
('46','66','0','0','0','30635','0','0',NULL,'0',NULL,'instance Old Hillsbrad Foothills (560)'),
-('47','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Black Temple (564)'),
+('47','70','0','32649','0','0','0','0',NULL,'0',NULL,'instance Black Temple (564)'),
('48','65','0','0','0','0','0','0',NULL,'0',NULL,'instance Gruul\'s Lair (565)'),
('49','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Zul\'Aman (568)'),
('50','70','0','0','0','0','0','0',NULL,'0',NULL,'instance Sunwell Plateau (580)'),
@@ -138,4 +137,4 @@ UPDATE `instance_template` SET `access_id` = '48' WHERE `map` = '565';
UPDATE `instance_template` SET `access_id` = '49' WHERE `map` = '568';
UPDATE `instance_template` SET `access_id` = '50' WHERE `map` = '580';
UPDATE `instance_template` SET `access_id` = '51' WHERE `map` = '585';
-UPDATE `areatrigger_teleport` SET `access_id` = '52' WHERE `id` IN ('4352','4354');
+UPDATE `areatrigger_teleport` SET `access_id` = '52' WHERE `id` IN ('4352','4354'); \ No newline at end of file
diff --git a/sql/updates/1164_characters.sql b/sql/updates/2.4.3_updates/1164_characters.sql
index bc552a4e617..bc552a4e617 100644
--- a/sql/updates/1164_characters.sql
+++ b/sql/updates/2.4.3_updates/1164_characters.sql
diff --git a/sql/updates/116_world.sql b/sql/updates/2.4.3_updates/116_world.sql
index 9923f7f4540..7627dfb4aa3 100644
--- a/sql/updates/116_world.sql
+++ b/sql/updates/2.4.3_updates/116_world.sql
@@ -5,5 +5,4 @@ INSERT INTO `spell_script_target` VALUES ('41455', '1', '22951');
INSERT INTO `spell_script_target` VALUES ('41455', '1', '22952');
INSERT INTO `spell_script_target` VALUES ('42471', '1', '23817');
INSERT INTO `spell_script_target` VALUES ('43734', '1', '23817');
-INSERT INTO `spell_script_target` VALUES ('42631', '1', '23920');
-
+INSERT INTO `spell_script_target` VALUES ('42631', '1', '23920'); \ No newline at end of file
diff --git a/sql/updates/117_world_scripts.sql b/sql/updates/2.4.3_updates/117_world_scripts.sql
index 669810b4685..794258ba710 100644
--- a/sql/updates/117_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/117_world_scripts.sql
@@ -62,4 +62,3 @@ UPDATE eventai_scripts SET action3_param3=(`action3_param3`) *-1 WHERE action3_t
UPDATE eventai_texts SET entry=(`entry`) *-1 WHERE entry>0;
ALTER TABLE script_texts MODIFY COLUMN `sound` mediumint(8) unsigned NOT NULL default '0';
-
diff --git a/sql/updates/11_characters.sql b/sql/updates/2.4.3_updates/11_characters.sql
index 489ee028dbc..a9a002270fb 100644
--- a/sql/updates/11_characters.sql
+++ b/sql/updates/2.4.3_updates/11_characters.sql
@@ -2,5 +2,4 @@ ALTER TABLE `arena_team_member` ADD COLUMN `points_to_add` int(10) UNSIGNED NOT
DROP TABLE IF EXISTS `saved_variables`;
CREATE TABLE `saved_variables` (
`NextArenaPointDistributionTime` timestamp NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Variable Saves';
-
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Variable Saves'; \ No newline at end of file
diff --git a/sql/updates/120_world.sql b/sql/updates/2.4.3_updates/120_world.sql
index f2ff5138745..3f3b231e830 100644
--- a/sql/updates/120_world.sql
+++ b/sql/updates/2.4.3_updates/120_world.sql
@@ -159,5 +159,4 @@ INSERT INTO command VALUES
('server exit',4,'Syntax: .server exit\r\n\r\nTerminate Trinity NOW.'),
('server motd',0,'Syntax: .server motd\r\n\r\nShow server Message of the day.'),
('server set loglevel',4,'Syntax: .server set loglevel #level\r\n\r\nSet server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'),
-('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.');
-
+('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.'); \ No newline at end of file
diff --git a/sql/updates/123_world_scripts.sql b/sql/updates/2.4.3_updates/123_world_scripts.sql
index 7281193a208..b5f9305e30e 100644
--- a/sql/updates/123_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/123_world_scripts.sql
@@ -213,4 +213,3 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
--
-- ALTER TABLE `script_texts` ORDER BY `entry` desc;
-
diff --git a/sql/updates/1247_world.sql b/sql/updates/2.4.3_updates/1247_world.sql
index 2e9a7088beb..324e4b142c1 100644
--- a/sql/updates/1247_world.sql
+++ b/sql/updates/2.4.3_updates/1247_world.sql
@@ -1 +1 @@
-UPDATE `gameobject_template` SET `ScriptName` = 'go_jump_a_tron' WHERE `entry` = 183146;
+UPDATE `gameobject_template` SET `ScriptName` = 'go_jump_a_tron' WHERE `entry` = 183146; \ No newline at end of file
diff --git a/sql/updates/1249_world.sql b/sql/updates/2.4.3_updates/1249_world.sql
index 6ce0e777210..4799b67e540 100644
--- a/sql/updates/1249_world.sql
+++ b/sql/updates/2.4.3_updates/1249_world.sql
@@ -1 +1 @@
-UPDATE `gameobject_template` SET `ScriptName` = 'go_ethereum_prison' WHERE `entry` = 184421;
+UPDATE `gameobject_template` SET `ScriptName` = 'go_ethereum_prison' WHERE `entry` = 184421; \ No newline at end of file
diff --git a/sql/updates/125_world_scripts.sql b/sql/updates/2.4.3_updates/125_world_scripts.sql
index 5d28ec325b5..9994c0e7af7 100644
--- a/sql/updates/125_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/125_world_scripts.sql
@@ -2,5 +2,4 @@ update creature_template set speed='0.01', scriptname='mob_toxic_sporebat' WHERE
update creature_template SET scriptname='npc_overlord_morghor' WHERE entry=23139;
update creature_template SET scriptname='npc_lord_illidan_stormrage' WHERE entry=22083;
update creature_template SET scriptname='npc_yarzill_the_merc' WHERE entry=23141;
-update quest_template SET StartScript=0 WHERE entry=11108;
-
+update quest_template SET StartScript=0 WHERE entry=11108; \ No newline at end of file
diff --git a/sql/updates/1261_world.sql b/sql/updates/2.4.3_updates/1261_world.sql
index 3f97153d3dd..8433b5137e3 100644
--- a/sql/updates/1261_world.sql
+++ b/sql/updates/2.4.3_updates/1261_world.sql
@@ -1 +1 @@
-UPDATE `gameobject_template` SET `scriptname` = 'go_sacred_fire_of_life' WHERE `entry` = 175944;
+UPDATE `gameobject_template` SET `scriptname` = 'go_sacred_fire_of_life' WHERE `entry` = 175944; \ No newline at end of file
diff --git a/sql/updates/1265_world.sql b/sql/updates/2.4.3_updates/1265_world.sql
index 5b5b87523cc..668718cd5f6 100644
--- a/sql/updates/1265_world.sql
+++ b/sql/updates/2.4.3_updates/1265_world.sql
@@ -1 +1 @@
-UPDATE `gameobject_template` SET `scriptname`='go_skull_pile' WHERE `entry`=185913;
+UPDATE `gameobject_template` SET `scriptname`='go_skull_pile' WHERE `entry`=185913; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/1304_world.sql b/sql/updates/2.4.3_updates/1304_world.sql
new file mode 100644
index 00000000000..7eec5331e50
--- /dev/null
+++ b/sql/updates/2.4.3_updates/1304_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `command` WHERE `name` IN ('reload spell_linked_spell');
+INSERT INTO `command` VALUES
+('reload spell_linked_spell','3','Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.'); \ No newline at end of file
diff --git a/sql/updates/133_world_scripts.sql b/sql/updates/2.4.3_updates/133_world_scripts.sql
index cd082ee2ad9..057f7c44e81 100644
--- a/sql/updates/133_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/133_world_scripts.sql
@@ -77,5 +77,4 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1560019,'Thrall will remain a slave. Taretha will die. You have failed.',10426,1,0,'epoch SAY_SLAY2'),
(-1560020,'Not so fast!',10423,1,0,'epoch SAY_BREATH1'),
(-1560021,'Struggle as much as you like!',10424,1,0,'epoch SAY_BREATH2'),
-(-1560022,'No!...The master... will not... be pleased.',10427,1,0,'epoch SAY_DEATH');
-
+(-1560022,'No!...The master... will not... be pleased.',10427,1,0,'epoch SAY_DEATH'); \ No newline at end of file
diff --git a/sql/updates/140_world.sql b/sql/updates/2.4.3_updates/140_world.sql
index a743fa69fee..6a7389602b6 100644
--- a/sql/updates/140_world.sql
+++ b/sql/updates/2.4.3_updates/140_world.sql
@@ -18,5 +18,4 @@ INSERT INTO trinity_string VALUES
(341,'%s is not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(342,'%s is now not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(810,'You must be in a raid group to enter the instance %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(811,'You cannot enter %s while in a ghost mode!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-
+(811,'You cannot enter %s while in a ghost mode!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/145_world_scripts.sql b/sql/updates/2.4.3_updates/145_world_scripts.sql
index 1d9341dd6a4..5ec3702b171 100644
--- a/sql/updates/145_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/145_world_scripts.sql
@@ -24,5 +24,4 @@ UPDATE `gameobject_template` SET `ScriptName` = 'go_kael_orb' WHERE `entry` = 18
UPDATE `gameobject_template` SET `ScriptName` = 'go_movie_orb' WHERE `entry` = 187578;
update creature_template SET spell1=6474 WHERE entry=22487;
-update creature_template SET spell1=3600 WHERE entry=22486;
-
+update creature_template SET spell1=3600 WHERE entry=22486; \ No newline at end of file
diff --git a/sql/updates/146_world.sql b/sql/updates/2.4.3_updates/146_world.sql
index bc419f47181..31999cd97e4 100644
--- a/sql/updates/146_world.sql
+++ b/sql/updates/2.4.3_updates/146_world.sql
@@ -90,5 +90,4 @@ VALUES
INSERT INTO spell_linked_spell
(`spell_trigger`, `spell_effect`, `type`, `comment`)
VALUES
- (45246, 45348, 1, 'Apply Flame Touched');
-
+ (45246, 45348, 1, 'Apply Flame Touched'); \ No newline at end of file
diff --git a/sql/updates/147_world.sql b/sql/updates/2.4.3_updates/147_world.sql
index a6dca5be3db..c6e75d41070 100644
--- a/sql/updates/147_world.sql
+++ b/sql/updates/2.4.3_updates/147_world.sql
@@ -1,4 +1,3 @@
-- Magtheridon Earthquake
DELETE FROM spell_script_target WHERE `entry` IN (30657);
-INSERT INTO spell_script_target VALUES ('30657', '1', '24136');
-
+INSERT INTO spell_script_target VALUES ('30657', '1', '24136'); \ No newline at end of file
diff --git a/sql/updates/152_world.sql b/sql/updates/2.4.3_updates/152_world.sql
index 52d02a13258..3b3d09c56d3 100644
--- a/sql/updates/152_world.sql
+++ b/sql/updates/2.4.3_updates/152_world.sql
@@ -5,5 +5,4 @@ insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm
insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) values('27799','27803','0','Holy Nova (rank4)');
insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) values('27800','27804','0','Holy Nova (rank5)');
insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) values('27801','27805','0','Holy Nova (rank6)');
-insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) values('25331','25329','0','Holy Nova (rank7)');
-
+insert into `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) values('25331','25329','0','Holy Nova (rank7)'); \ No newline at end of file
diff --git a/sql/updates/153_world.sql b/sql/updates/2.4.3_updates/153_world.sql
index 5b135c844d6..dbff1592850 100644
--- a/sql/updates/153_world.sql
+++ b/sql/updates/2.4.3_updates/153_world.sql
@@ -1,2 +1 @@
-update creature_template set flags_extra = 128 where entry = 12999;
-
+update creature_template set flags_extra = 128 where entry = 12999; \ No newline at end of file
diff --git a/sql/updates/171_world.sql b/sql/updates/2.4.3_updates/171_world.sql
index f7c9105eb38..fdcd98f4d6e 100644
--- a/sql/updates/171_world.sql
+++ b/sql/updates/2.4.3_updates/171_world.sql
@@ -14,5 +14,4 @@ INSERT INTO `command` (name,security,help) VALUES
('pet tp',2,'Syntax: .pet tp #\r\n\r\nChange pet\'s amount of training points.'),
('modify gender',2,'Syntax: .modify gender\r\n\r\n.modify gender #male/female - Turns selected player into a male or female'),
('gobject activate',2,'Syntax: .gobject activate #guid\r\n\r\nActivates an object like a door or a button.'),
-('playall',2,'Syntax: .playall #soundid\r\n\r\nPlayer a sound to whole server.');
-
+('playall',2,'Syntax: .playall #soundid\r\n\r\nPlayer a sound to whole server.'); \ No newline at end of file
diff --git a/sql/updates/172_world_scripts.sql b/sql/updates/2.4.3_updates/172_world_scripts.sql
index 82de4e3eb2a..358afe538ed 100644
--- a/sql/updates/172_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/172_world_scripts.sql
@@ -776,4 +776,3 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1000103,'You can go tell Stoutmantle this is where the Defias Gang is holed up, $N.',0,0,7,'defias traitor SAY_END'),
(-1000104,'%s coming in fast! Prepare to fight!',0,0,7,'defias traitor SAY_AGGRO_1'),
(-1000105,'Help!',0,0,7,'defias traitor SAY_AGGRO_2');
-
diff --git a/sql/updates/175_world_scripts.sql b/sql/updates/2.4.3_updates/175_world_scripts.sql
index dc46a67737f..d30601c4c9c 100644
--- a/sql/updates/175_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/175_world_scripts.sql
@@ -1,2 +1 @@
-UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`='467';
-
+UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`='467'; \ No newline at end of file
diff --git a/sql/updates/176_world.sql b/sql/updates/2.4.3_updates/176_world.sql
index 2cb80bd25a2..12df2a083ca 100644
--- a/sql/updates/176_world.sql
+++ b/sql/updates/2.4.3_updates/176_world.sql
@@ -30,4 +30,3 @@ CREATE TABLE `locales_npc_option` (
ALTER TABLE `creature_template`
CHANGE COLUMN `flags` `unit_flags` int(10) unsigned NOT NULL default '0',
CHANGE COLUMN `flag1` `type_flags` int(10) unsigned NOT NULL default '0';
-
diff --git a/sql/updates/182_world.sql b/sql/updates/2.4.3_updates/182_world.sql
index 70c200b5144..450b5394720 100644
--- a/sql/updates/182_world.sql
+++ b/sql/updates/2.4.3_updates/182_world.sql
@@ -2,4 +2,3 @@ DELETE FROM `command` WHERE name IN ('possess', 'unpossess');
INSERT INTO `command` (name,security,help) VALUES
('possess',3,'Syntax: .possess\r\n\r\nPossesses indefinitely the selected creature.'),
('unpossess',3,'Syntax: .unpossess\r\n\r\nIf you are possessed, unpossesses yourself; otherwise unpossesses current possessed target.');
-
diff --git a/sql/updates/212_world_scripts.sql b/sql/updates/2.4.3_updates/212_world_scripts.sql
index b1c6a4cad0e..1427efde6e3 100644
--- a/sql/updates/212_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/212_world_scripts.sql
@@ -2,5 +2,4 @@ UPDATE `creature_template` SET `ScriptName`='npc_clintar_dreamwalker' WHERE `ent
UPDATE `creature_template` SET `ScriptName`='npc_clintar_spirit' WHERE `entry` = 22916;
UPDATE `creature_template` SET `ScriptName`='mob_sparrowhawk' WHERE `entry`=22979;
UPDATE `creature_template` SET `ScriptName`='mob_rizzle_sprysprocket' WHERE `entry`=23002;
-UPDATE `creature_template` SET `ScriptName`='mob_depth_charge' WHERE `entry`=23025;
-
+UPDATE `creature_template` SET `ScriptName`='mob_depth_charge' WHERE `entry`=23025; \ No newline at end of file
diff --git a/sql/updates/220_characters.sql b/sql/updates/2.4.3_updates/220_characters.sql
index 5075f2e3b54..1d9e3f50a33 100644
--- a/sql/updates/220_characters.sql
+++ b/sql/updates/2.4.3_updates/220_characters.sql
@@ -1,3 +1,2 @@
ALTER TABLE `characters`
- ADD `latency` int(11) unsigned NOT NULL default '0' AFTER `taxi_path`;
-
+ ADD `latency` int(11) unsigned NOT NULL default '0' AFTER `taxi_path`; \ No newline at end of file
diff --git a/sql/updates/230_world.sql b/sql/updates/2.4.3_updates/230_world.sql
index edb46971753..3f3565e7800 100644
--- a/sql/updates/230_world.sql
+++ b/sql/updates/2.4.3_updates/230_world.sql
@@ -1,3 +1,2 @@
UPDATE `spell_proc_event` SET `procFlags` = '8396800' WHERE `entry` =14774;
UPDATE `spell_proc_event` SET `procFlags` = '8396800' WHERE `entry` =14531;
-
diff --git a/sql/updates/230_world_blacktemple.sql b/sql/updates/2.4.3_updates/230_world_blacktemple.sql
index 20823b188f6..74345a7c51f 100644
--- a/sql/updates/230_world_blacktemple.sql
+++ b/sql/updates/2.4.3_updates/230_world_blacktemple.sql
@@ -22,5 +22,4 @@ update creature_template set scriptname = 'mob_blade_of_azzinoth' where entry =
-- parasitic shadowfiend
update creature_template set scriptname = 'mob_parasitic_shadowfiend' where entry = 23498;
-- Maiev
-update creature_template set minlevel = 73, maxlevel = 73, minhealth = 500000, maxhealth = 500000, mindmg = 3000, maxdmg = 4000 where entry = 23197;
-
+update creature_template set minlevel = 73, maxlevel = 73, minhealth = 500000, maxhealth = 500000, mindmg = 3000, maxdmg = 4000 where entry = 23197; \ No newline at end of file
diff --git a/sql/updates/230_world_scripts.sql b/sql/updates/2.4.3_updates/230_world_scripts.sql
index a188fd28580..34d3ee5707f 100644
--- a/sql/updates/230_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/230_world_scripts.sql
@@ -1,2 +1 @@
-update gameobject_template set scriptname = 'go_gilded_brazier' where entry = 181956;
-
+update gameobject_template set scriptname = 'go_gilded_brazier' where entry = 181956; \ No newline at end of file
diff --git a/sql/updates/230_world_serpent_shrine.sql b/sql/updates/2.4.3_updates/230_world_serpent_shrine.sql
index c957af10acc..0e16bd6de2b 100644
--- a/sql/updates/230_world_serpent_shrine.sql
+++ b/sql/updates/2.4.3_updates/230_world_serpent_shrine.sql
@@ -11,4 +11,3 @@ UPDATE creature_model_info SET bounding_radius = '13', combat_reach = '20' WHERE
UPDATE creature_template SET InhabitType = '3', ScriptName = 'boss_the_lurker_below' WHERE entry = '21217';
UPDATE creature_template SET ScriptName = 'mob_coilfang_ambusher' WHERE entry = '21865';
UPDATE creature_template SET ScriptName = 'mob_coilfang_guardian' WHERE entry = '21873';
-
diff --git a/sql/updates/231_world_scripts.sql b/sql/updates/2.4.3_updates/231_world_scripts.sql
index 35d58244e43..b07f7b47fef 100644
--- a/sql/updates/231_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/231_world_scripts.sql
@@ -1,4 +1,3 @@
UPDATE `creature_template` SET `ScriptName`='boss_pathaleon_the_calculator' WHERE `entry`=19220;
UPDATE `creature_template` SET `ScriptName`='mob_nether_wraith' WHERE `entry`=21062;
-UPDATE `instance_template` SET `script`='instance_mechanar' WHERE `map`=554;
-
+UPDATE `instance_template` SET `script`='instance_mechanar' WHERE `map`=554; \ No newline at end of file
diff --git a/sql/updates/233_world.sql b/sql/updates/2.4.3_updates/233_world.sql
index 8d29b83a4fa..e77d057cae4 100644
--- a/sql/updates/233_world.sql
+++ b/sql/updates/2.4.3_updates/233_world.sql
@@ -1,2 +1 @@
UPDATE `spell_proc_event` SET `SchoolMask` = '1' WHERE `entry` = '41434';
-
diff --git a/sql/updates/2.4.3_updates/238_world.sql b/sql/updates/2.4.3_updates/238_world.sql
new file mode 100644
index 00000000000..c1180ca0abd
--- /dev/null
+++ b/sql/updates/2.4.3_updates/238_world.sql
@@ -0,0 +1 @@
+DELETE FROM trinity_string WHERE entry IN (453); \ No newline at end of file
diff --git a/sql/updates/240_world.sql b/sql/updates/2.4.3_updates/240_world.sql
index 44e7c518e83..9a91607fed0 100644
--- a/sql/updates/240_world.sql
+++ b/sql/updates/2.4.3_updates/240_world.sql
@@ -2,5 +2,4 @@ delete from `command` where `name` IN ('senditems','sendmail');
insert into `command` (`name`, `security`, `help`) values
('senditems',3,'Syntax: .senditems #playername "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in "". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),
('sendmail',1,'Syntax: .sendmail #playername "#subject" "#text"\r\n\r\nSend a mail to a player. Subject and mail text must be in "".');
-
-
+ \ No newline at end of file
diff --git a/sql/updates/241_world.sql b/sql/updates/2.4.3_updates/241_world.sql
index 4aa3ae99b94..2bc028b3eba 100644
--- a/sql/updates/241_world.sql
+++ b/sql/updates/2.4.3_updates/241_world.sql
@@ -2,4 +2,3 @@ DELETE FROM `command` WHERE name IN ('bindsight', 'unbindsight');
INSERT INTO `command` (name,security,help) VALUES
('bindsight',3,'Syntax: .bindsight\r\n\r\nBinds vision to the selected unit indefinitely. Cannot be used while currently possessing a target.'),
('unbindsight',3,'Syntax: .unbindsight\r\n\r\nRemoves bound vision. Cannot be used while currently possessing a target.');
-
diff --git a/sql/updates/247_world.sql b/sql/updates/2.4.3_updates/247_world.sql
index 95a087d1a20..a47e9733bcf 100644
--- a/sql/updates/247_world.sql
+++ b/sql/updates/2.4.3_updates/247_world.sql
@@ -26,5 +26,4 @@ INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `commen
DELETE FROM spell_target_position WHERE `id` IN (46019, 46020);
INSERT INTO spell_target_position () VALUES (46019, 580, 1704.34, 928.17, -74.558, 0);
-INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0);
-
+INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0); \ No newline at end of file
diff --git a/sql/updates/262_characters.sql b/sql/updates/2.4.3_updates/262_characters.sql
index 093078d148d..b3caa9704f0 100644
--- a/sql/updates/262_characters.sql
+++ b/sql/updates/2.4.3_updates/262_characters.sql
@@ -3,4 +3,3 @@ ALTER TABLE `guild_bank_tab`
ALTER TABLE `character_aura` ADD `stackcount` INT NOT NULL DEFAULT '1' AFTER `effect_index` ;
ALTER TABLE `pet_aura` ADD `stackcount` INT NOT NULL DEFAULT '1' AFTER `effect_index`;
-
diff --git a/sql/updates/262_realmd.sql b/sql/updates/2.4.3_updates/262_realmd.sql
index 28dc64111c1..1953f19fe28 100644
--- a/sql/updates/262_realmd.sql
+++ b/sql/updates/2.4.3_updates/262_realmd.sql
@@ -1,3 +1,2 @@
ALTER TABLE `account`
CHANGE COLUMN `email` `email` text;
-
diff --git a/sql/updates/262_world.sql b/sql/updates/2.4.3_updates/262_world.sql
index cd90a3df696..6c97d9798d5 100644
--- a/sql/updates/262_world.sql
+++ b/sql/updates/2.4.3_updates/262_world.sql
@@ -98,5 +98,4 @@ ALTER TABLE creature_movement
ADD COLUMN textid2 int(11) NOT NULL default '0' AFTER textid1,
ADD COLUMN textid3 int(11) NOT NULL default '0' AFTER textid2,
ADD COLUMN textid4 int(11) NOT NULL default '0' AFTER textid3,
- ADD COLUMN textid5 int(11) NOT NULL default '0' AFTER textid4;
-
+ ADD COLUMN textid5 int(11) NOT NULL default '0' AFTER textid4; \ No newline at end of file
diff --git a/sql/updates/273_world_scripts.sql b/sql/updates/2.4.3_updates/273_world_scripts.sql
index 800f181f882..2979197c734 100644
--- a/sql/updates/273_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/273_world_scripts.sql
@@ -1,4 +1,3 @@
UPDATE `creature_template` SET `ScriptName`='npc_wounded_blood_elf' WHERE `entry`='16993';
UPDATE `creature_template` SET `ScriptName` = 'mob_phase_hunter' WHERE `entry` = '18879';
-
diff --git a/sql/updates/285_world.sql b/sql/updates/2.4.3_updates/285_world.sql
index ab9c26ebccb..74825f4b75a 100644
--- a/sql/updates/285_world.sql
+++ b/sql/updates/2.4.3_updates/285_world.sql
@@ -37,4 +37,3 @@ INSERT INTO `trinity_string` VALUES
(749,'The Stormpike General is Dead!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
;
-
diff --git a/sql/updates/287_world_scripts.sql b/sql/updates/2.4.3_updates/287_world_scripts.sql
index f761f897e9d..4a0c5031188 100644
--- a/sql/updates/287_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/287_world_scripts.sql
@@ -1,4 +1,3 @@
UPDATE `creature_template` SET `ScriptName` = 'npc_steam_tonk' WHERE `entry` = '19405';
UPDATE `creature_template` SET `ScriptName` = 'npc_tonk_mine' WHERE `entry` = '15368';
-
diff --git a/sql/updates/329_world.sql b/sql/updates/2.4.3_updates/329_world.sql
index 42dd8012cb2..33f61416fb1 100644
--- a/sql/updates/329_world.sql
+++ b/sql/updates/2.4.3_updates/329_world.sql
@@ -583,4 +583,3 @@ INSERT INTO `spell_proc_event` VALUES ('28744', '0', '7', '64', '278528', '0', '
INSERT INTO `spell_proc_event` VALUES ('12488', '0', '3', '128', '327680', '0', '0', '0', '0');
INSERT INTO `spell_proc_event` VALUES ('19573', '0', '9', '8388608', '16384', '0', '0', '0', '0');
INSERT INTO `spell_proc_event` VALUES ('33757', '0', '0', '0', '0', '0', '0', '0', '3');
-
diff --git a/sql/updates/332_world.sql b/sql/updates/2.4.3_updates/332_world.sql
index c1864d6c03a..912173fcbbf 100644
--- a/sql/updates/332_world.sql
+++ b/sql/updates/2.4.3_updates/332_world.sql
@@ -1,4 +1,3 @@
DELETE FROM `spell_script_target` WHERE `entry` in (30659);
INSERT INTO `spell_script_target` VALUES (30659, 1, 17281);
-
diff --git a/sql/updates/333_world.sql b/sql/updates/2.4.3_updates/333_world.sql
index 77c2b476700..9bd405e3589 100644
--- a/sql/updates/333_world.sql
+++ b/sql/updates/2.4.3_updates/333_world.sql
@@ -9,4 +9,3 @@ INSERT INTO `spell_proc_event` VALUES ('10608', '0', '0', '0', '0', '0', '0', '0
INSERT INTO `spell_proc_event` VALUES ('10610', '0', '0', '0', '0', '0', '0', '0', '3');
INSERT INTO `spell_proc_event` VALUES ('25583', '0', '0', '0', '0', '0', '0', '0', '3');
INSERT INTO `spell_proc_event` VALUES ('25584', '0', '0', '0', '0', '0', '0', '0', '3');
-
diff --git a/sql/updates/334_world.sql b/sql/updates/2.4.3_updates/334_world.sql
index e7e1c4b328f..6cd6cb7714a 100644
--- a/sql/updates/334_world.sql
+++ b/sql/updates/2.4.3_updates/334_world.sql
@@ -17,5 +17,4 @@ INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_
(784,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(785,'Arena testing turned %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(786,'|cffff0000[Automatic]:|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(787,'|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-
+(787,'|cffffff00[|c1f40af20Announce by|r |cffff0000%s|cffffff00]:|r %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/341_world.sql b/sql/updates/2.4.3_updates/341_world.sql
new file mode 100644
index 00000000000..7d1eb4a0c8d
--- /dev/null
+++ b/sql/updates/2.4.3_updates/341_world.sql
@@ -0,0 +1 @@
+TRUNCATE TABLE playercreateinfo_item; \ No newline at end of file
diff --git a/sql/updates/356_world.sql b/sql/updates/2.4.3_updates/356_world.sql
index b7fc8258b7e..9db8a85d7cd 100644
--- a/sql/updates/356_world.sql
+++ b/sql/updates/2.4.3_updates/356_world.sql
@@ -1,3 +1,2 @@
DELETE FROM `spell_elixir` WHERE `entry` = 45373;
INSERT INTO `spell_elixir` VALUES (45373,0x1);
-
diff --git a/sql/updates/373_world_scripts.sql b/sql/updates/2.4.3_updates/373_world_scripts.sql
index 92623b3ec1b..db27ebe2441 100644
--- a/sql/updates/373_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/373_world_scripts.sql
@@ -1,4 +1,3 @@
UPDATE `creature_template` SET `ScriptName`='boss_warchief_kargath_bladefist' WHERE `entry`=16808;
UPDATE `instance_template` SET `script`='instance_deadmines' WHERE `map`=36;
UPDATE `item_template` SET `ScriptName`='item_defias_gunpowder' WHERE `entry`=5397;
-
diff --git a/sql/updates/377_world_scripts.sql b/sql/updates/2.4.3_updates/377_world_scripts.sql
index c7d5bf98e52..fe93962ef3a 100644
--- a/sql/updates/377_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/377_world_scripts.sql
@@ -8,4 +8,3 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content
(-1645007,'Champion Lightrend, make me proud!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE'),
(-1645008,'Show this upstart how a real Blood Knight fights, Swiftblade!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE'),
(-1645009,'Show $N the meaning of pain, Sunstriker!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,'master_kelerun_bloodmourn YELL_PHASE');
-
diff --git a/sql/updates/389_world.sql b/sql/updates/2.4.3_updates/389_world.sql
index 9e199c37726..89094143f64 100644
--- a/sql/updates/389_world.sql
+++ b/sql/updates/2.4.3_updates/389_world.sql
@@ -7,4 +7,3 @@ INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `commen
-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49011, 49009, 0, 'Wyvern Sting');
-- Rank 6 (not available till wotlk)
-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49012, 49010, 0, 'Wyvern Sting');
-
diff --git a/sql/updates/400_world.sql b/sql/updates/2.4.3_updates/400_world.sql
index 25a1d1a74e7..a2f7d1e6cea 100644
--- a/sql/updates/400_world.sql
+++ b/sql/updates/2.4.3_updates/400_world.sql
@@ -8,4 +8,3 @@ INSERT INTO `spell_script_target` VALUES (5628, 1, 2013);
INSERT INTO `spell_script_target` VALUES (5628, 1, 2014);
INSERT INTO `spell_script_target` VALUES (45109, 1, 25084);
INSERT INTO `spell_script_target` VALUES (45149, 0, 300154);
-
diff --git a/sql/updates/410_characters.sql b/sql/updates/2.4.3_updates/410_characters.sql
index 96bf01135d4..483b991e19e 100644
--- a/sql/updates/410_characters.sql
+++ b/sql/updates/2.4.3_updates/410_characters.sql
@@ -1,3 +1,2 @@
ALTER TABLE `guild_member` DROP INDEX `guid_key` ,
ADD UNIQUE `guid_key` ( `guid` );
-
diff --git a/sql/updates/426_world_scripts.sql b/sql/updates/2.4.3_updates/426_world_scripts.sql
index d7cec0efd7d..fde6ee6dbf2 100644
--- a/sql/updates/426_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/426_world_scripts.sql
@@ -11,4 +11,3 @@ UPDATE `creature_template` SET `ScriptName`='mob_archaedas_minions' WHERE `entry
-- Stone keepers
UPDATE `creature_template` SET `ScriptName`='mob_stonekeepers' WHERE `entry`=4857;
-
diff --git a/sql/updates/427_world_scripts.sql b/sql/updates/2.4.3_updates/427_world_scripts.sql
index abcff54ade6..b6fe5fb7acb 100644
--- a/sql/updates/427_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/427_world_scripts.sql
@@ -55,4 +55,3 @@ REPLACE INTO `script_texts` VALUES
(-1189006, 'Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken',0,0,0,0,0,0,0,0,11962,0,0,'Headless Horseman SAY_PLAYER_DEATH'),
(-1189007, 'This end have I reached before. What new adventure lies in store?',0,0,0,0,0,0,0,0,11964,0,0,'Headless Horseman SAY_DEATH');
-
diff --git a/sql/updates/444_world.sql b/sql/updates/2.4.3_updates/444_world.sql
index b5d588c39fa..004cf626f88 100644
--- a/sql/updates/444_world.sql
+++ b/sql/updates/2.4.3_updates/444_world.sql
@@ -34,4 +34,3 @@ ALTER TABLE `creature_addon`
ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `guid`;
ALTER TABLE `creature_template_addon`
ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `entry`;
-
diff --git a/sql/updates/452_world.sql b/sql/updates/2.4.3_updates/452_world.sql
index dbc7589e46f..3b549278fc7 100644
--- a/sql/updates/452_world.sql
+++ b/sql/updates/2.4.3_updates/452_world.sql
@@ -7,4 +7,3 @@ DELETE FROM `spell_chain` WHERE `spell_id` = 26991;
INSERT INTO `spell_chain` (spell_id,prev_spell,first_spell,rank,req_spell) VALUES (21849,0,1126,1,0);
INSERT INTO `spell_chain` (spell_id,prev_spell,first_spell,rank,req_spell) VALUES (21850,21849,1126,2,0);
INSERT INTO `spell_chain` (spell_id,prev_spell,first_spell,rank,req_spell) VALUES (26991,21850,1126,3,0);
-
diff --git a/sql/updates/455_world.sql b/sql/updates/2.4.3_updates/455_world.sql
index 5dec728d539..a5a23c5f5d6 100644
--- a/sql/updates/455_world.sql
+++ b/sql/updates/2.4.3_updates/455_world.sql
@@ -12,4 +12,3 @@ INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `commen
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43655, 0, 'Electrical Arc Visual');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43656, 0, 'Electrical Arc Visual');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43659, 0, 'Electrical Arc Visual');
-
diff --git a/sql/updates/45_characters.sql b/sql/updates/2.4.3_updates/45_characters.sql
index 99ef0dd5c9d..9f370ba909c 100644
--- a/sql/updates/45_characters.sql
+++ b/sql/updates/2.4.3_updates/45_characters.sql
@@ -11,4 +11,3 @@ CREATE TABLE `game_event_condition_save` (
`done` float default '0',
PRIMARY KEY (`event_id`,`condition_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
diff --git a/sql/updates/471_world.sql b/sql/updates/2.4.3_updates/471_world.sql
index c21757e2910..2db368326e8 100644
--- a/sql/updates/471_world.sql
+++ b/sql/updates/2.4.3_updates/471_world.sql
@@ -1,3 +1,2 @@
UPDATE `gameobject_template` SET `faction`=1375 WHERE `entry` IN (184203, 184204, 184205);
UPDATE `gameobject_template` SET `Scriptname`='go_bridge_console' WHERE entry=184568;
-
diff --git a/sql/updates/480_world_scripts.sql b/sql/updates/2.4.3_updates/480_world_scripts.sql
index 7eeaeb61fbf..203196a0f16 100644
--- a/sql/updates/480_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/480_world_scripts.sql
@@ -1,3 +1,2 @@
UPDATE `creature_template` SET `ScriptName`='npc_winter_reveler' WHERE `entry`=15760;
UPDATE `creature_template` SET `ScriptName`='npc_brewfest_reveler' WHERE `entry`=24484;
-
diff --git a/sql/updates/488_world_scripts.sql b/sql/updates/2.4.3_updates/488_world_scripts.sql
index 8aab8c464ed..41b264fb217 100644
--- a/sql/updates/488_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/488_world_scripts.sql
@@ -733,4 +733,3 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1000125, 'You! Enter the fray!', 0, 0, 0, 'twiggy SAY_TWIGGY_FRAY'),
(-1000126, 'Challenger is down!', 0, 0, 0, 'twiggy SAY_TWIGGY_DOWN'),
(-1000127, 'The Affray is over.', 0, 0, 0, 'twiggy SAY_TWIGGY_OVER');
-
diff --git a/sql/updates/502_world_scripts.sql b/sql/updates/2.4.3_updates/502_world_scripts.sql
index 6f0cc47bf63..458d8bb24ed 100644
--- a/sql/updates/502_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/502_world_scripts.sql
@@ -4,4 +4,3 @@ UPDATE `creature_template` SET `ScriptName` = 'mob_coilfang_ambusher' WHERE `ent
UPDATE `creature_template` SET `ScriptName` = 'mob_coilfang_guardian' WHERE `entry` = '21873';
UPDATE `creature_model_info` SET `bounding_radius` = '13', `combat_reach` = '20' WHERE `modelid` = '20216';
-
diff --git a/sql/updates/505_world.sql b/sql/updates/2.4.3_updates/505_world.sql
index 26812d4d3fb..fe3b3c850aa 100644
--- a/sql/updates/505_world.sql
+++ b/sql/updates/2.4.3_updates/505_world.sql
@@ -7,4 +7,3 @@ CREATE TABLE `creature_formations` (
`angle` float unsigned NOT NULL,
`groupAI` int(11) unsigned NOT NULL,
PRIMARY KEY (`follower`));
-
diff --git a/sql/updates/506_world.sql b/sql/updates/2.4.3_updates/506_world.sql
index 634aa33735f..069690c4da8 100644
--- a/sql/updates/506_world.sql
+++ b/sql/updates/2.4.3_updates/506_world.sql
@@ -81,4 +81,3 @@ INSERT INTO spell_chain (spell_id,prev_spell,first_spell,rank,req_spell) VALUES
INSERT INTO spell_chain (spell_id,prev_spell,first_spell,rank,req_spell) VALUES (31896,20184,20184,2,0);
ALTER TABLE spell_chain DROP COLUMN prev_spell;
-
diff --git a/sql/updates/513_world_scripts.sql b/sql/updates/2.4.3_updates/513_world_scripts.sql
index 8714057904f..21a57ea3316 100644
--- a/sql/updates/513_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/513_world_scripts.sql
@@ -17,4 +17,3 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1269026,'I am grateful for your aid, champions. Now, Gul\'dan\'s Horde will sweep across this world, like a locust swarm, and all my designs, all my carefully laid plans will at last fall into place.',10440,1,0,'medivh SAY_WIN'),
(-1269027,'Orcs of the Horde! This portalis the gateway to your new destiny! Azeroth lies before you, ripe for the taking!',0,1,0,'medivh SAY_ORCS_ENTER'),
(-1269028,'Gul\'dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back trought the portal!',0,1,0,'medivh SAY_ORCS_ANSWER');
-
diff --git a/sql/updates/519_world.sql b/sql/updates/2.4.3_updates/519_world.sql
index deddf74b42e..2423f94ec1c 100644
--- a/sql/updates/519_world.sql
+++ b/sql/updates/2.4.3_updates/519_world.sql
@@ -1,3 +1,2 @@
ALTER TABLE `creature_formations` CHANGE `leader` `leaderGUID` int(11) unsigned NOT NULL default '0';
ALTER TABLE `creature_formations` CHANGE `follower` `memberGUID` int(11) unsigned NOT NULL default '0';
-
diff --git a/sql/updates/537_world.sql b/sql/updates/2.4.3_updates/537_world.sql
index 7929f4dbc52..2401a5aeadd 100644
--- a/sql/updates/537_world.sql
+++ b/sql/updates/2.4.3_updates/537_world.sql
@@ -1,3 +1,2 @@
-- Removing the now unused creature_movement table
DROP TABLE IF EXISTS `creature_movement`;
-
diff --git a/sql/updates/541_characters.sql b/sql/updates/2.4.3_updates/541_characters.sql
index cddfb33519c..2651c069e05 100644
--- a/sql/updates/541_characters.sql
+++ b/sql/updates/2.4.3_updates/541_characters.sql
@@ -6,4 +6,3 @@ CREATE TABLE `saved_variables` (
ALTER TABLE `arena_team_member` DROP COLUMN `points_to_add`;
ALTER TABLE `arena_team_member` ADD COLUMN `personal_rating` int(10) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `characters` ADD COLUMN `arena_pending_points` int(10) UNSIGNED NOT NULL default '0' AFTER `taxi_path`;
-
diff --git a/sql/updates/541_world.sql b/sql/updates/2.4.3_updates/541_world.sql
index 676f9138bac..7d8e1fc8e1b 100644
--- a/sql/updates/541_world.sql
+++ b/sql/updates/2.4.3_updates/541_world.sql
@@ -23,5 +23,4 @@ INSERT INTO trinity_string (entry, content_default) VALUES
(1137, 'You must be in GM mode to teleport to a player in a battleground.'),
(1138, 'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.');
-DELETE FROM trinity_string WHERE entry = 714 OR entry = 716;
-
+DELETE FROM trinity_string WHERE entry = 714 OR entry = 716; \ No newline at end of file
diff --git a/sql/updates/542_characters.sql b/sql/updates/2.4.3_updates/542_characters.sql
index 9af0975e07f..4cc3bebea80 100644
--- a/sql/updates/542_characters.sql
+++ b/sql/updates/2.4.3_updates/542_characters.sql
@@ -72,4 +72,3 @@ SET
WHERE
`a`.`arenateamid` = `b`.`atid` AND
`a`.`guid` = `b`.`b_guid`;
-
diff --git a/sql/updates/54_world.sql b/sql/updates/2.4.3_updates/54_world.sql
index 761149b53af..2d5e984d9e7 100644
--- a/sql/updates/54_world.sql
+++ b/sql/updates/2.4.3_updates/54_world.sql
@@ -3,4 +3,3 @@ CREATE TABLE `game_event_battleground_holiday` (
`bgflag` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`event`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
diff --git a/sql/updates/551_world.sql b/sql/updates/2.4.3_updates/551_world.sql
index c064a8e990c..5a01d596ab4 100644
--- a/sql/updates/551_world.sql
+++ b/sql/updates/2.4.3_updates/551_world.sql
@@ -19,5 +19,4 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1000134, 'We\'ve had too many setbacks along the way: Hellfire Citadel, Fallen Sky Ridge, Firewing Point... Prince Kael\'thas will tolerate no further delays. I will tolerate nothing other than complete success!', 0, 0, 0, 'dawnforge PATHALEON_CULATOR_IMAGE_2_1'),
(-1000135, 'I am returning to Tempest Keep. See to it that I do not have reason to return!', 0, 0, 0, 'dawnforge PATHALEON_CULATOR_IMAGE_2_2' ),
(-1000136, 'Yes, my lord.', 0, 0, 0, 'dawnforge COMMANDER_DAWNFORGE_4 SAY_ARCANIST_ARDONIS_2'),
-(-1000137, 'See to it, Ardonis!', 0, 0, 0, 'dawnforge COMMANDER_DAWNFORGE_5');
-
+(-1000137, 'See to it, Ardonis!', 0, 0, 0, 'dawnforge COMMANDER_DAWNFORGE_5'); \ No newline at end of file
diff --git a/sql/updates/566_world.sql b/sql/updates/2.4.3_updates/566_world.sql
index 6ff3126aac0..6c176e1ad89 100644
--- a/sql/updates/566_world.sql
+++ b/sql/updates/2.4.3_updates/566_world.sql
@@ -22,4 +22,3 @@ INSERT INTO spell_script_target VALUES
(39011,1,20885),
(40106,1,22883),
(40105,1,22883);
-
diff --git a/sql/updates/571_world.sql b/sql/updates/2.4.3_updates/571_world.sql
index 2bd76e45769..115c210306b 100644
--- a/sql/updates/571_world.sql
+++ b/sql/updates/2.4.3_updates/571_world.sql
@@ -3,4 +3,3 @@ ALTER TABLE spell_chain DROP COLUMN rank;
ALTER TABLE spell_chain RENAME TO spell_required;
DELETE FROM spell_required WHERE req_spell=0;
-
diff --git a/sql/updates/572_world.sql b/sql/updates/2.4.3_updates/572_world.sql
index 033548f0367..33ce446b012 100644
--- a/sql/updates/572_world.sql
+++ b/sql/updates/2.4.3_updates/572_world.sql
@@ -5,4 +5,3 @@ DELETE FROM `script_texts` WHERE `entry` IN (-1000138,-1000139);
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
(-1000138, 'Avruu\'s magic... it still controls me. You must fight me, mortal. It\'s the only way to break the spell!', 0, 0, 0, 'aeranas SAY_SUMMON'),
(-1000139, 'Avruu\'s magic is broken! I\'m free once again!', 0, 0, 0, 'aeranas SAY_FREE');
-
diff --git a/sql/updates/575_world_scripts.sql b/sql/updates/2.4.3_updates/575_world_scripts.sql
index b084d2eac8b..85a75215f0e 100644
--- a/sql/updates/575_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/575_world_scripts.sql
@@ -1,2 +1 @@
UPDATE `item_template` SET `ScriptName` = "item_only_for_flight" WHERE `entry` IN (34475, 34489, 24538);
-
diff --git a/sql/updates/57_world_scripts.sql b/sql/updates/2.4.3_updates/57_world_scripts.sql
index b87c607a14c..2f76ae8c94f 100644
--- a/sql/updates/57_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/57_world_scripts.sql
@@ -36,5 +36,4 @@ INSERT INTO `spell_proc_event` VALUES ('43983', '0', '0', '0', '0', '0', '16384'
DELETE FROM `spell_script_target` WHERE `entry` = 42577;
INSERT INTO `spell_script_target` VALUES ('42577', '1', '24136');
-UPDATE `creature_template` SET `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001);
-
+UPDATE `creature_template` SET `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001); \ No newline at end of file
diff --git a/sql/updates/583_world_scripts.sql b/sql/updates/2.4.3_updates/583_world_scripts.sql
index 3ef0a2399af..45f8d80a244 100644
--- a/sql/updates/583_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/583_world_scripts.sql
@@ -1,2 +1 @@
-UPDATE creature_template SET Scriptname='npc_ranger_lilatha' WHERE entry=16295;
-
+UPDATE creature_template SET Scriptname='npc_ranger_lilatha' WHERE entry=16295; \ No newline at end of file
diff --git a/sql/updates/586_world_scripts.sql b/sql/updates/2.4.3_updates/586_world_scripts.sql
index d4102fdfef6..a86cec4951b 100644
--- a/sql/updates/586_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/586_world_scripts.sql
@@ -1,3 +1,2 @@
UPDATE `gameobject_template` SET `ScriptName` = 'go_mausoleum_trigger' WHERE `entry` = 104593;
-UPDATE `gameobject_template` SET `ScriptName` = 'go_mausoleum_door' WHERE `entry` = 176594;
-
+UPDATE `gameobject_template` SET `ScriptName` = 'go_mausoleum_door' WHERE `entry` = 176594; \ No newline at end of file
diff --git a/sql/updates/588_world.sql b/sql/updates/2.4.3_updates/588_world.sql
index 346101bdc0a..e85a034f344 100644
--- a/sql/updates/588_world.sql
+++ b/sql/updates/2.4.3_updates/588_world.sql
@@ -4,5 +4,4 @@ INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES ('6614','Notific
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES ('6615','|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r');
INSERT INTO `command` (`name`,`security`,`help`) VALUES ('gmnotify', 2, 'Syntax: .gmnotify $notification\r\nDisplays a notification on the screen of all online GM\'s.');
INSERT INTO `command` (`name`,`security`,`help`) VALUES ('gmnameannounce', 2, 'Syntax: .gmnameannounce $announcement.\r\nSend an announcement to all online GM\'s, displaying the name of the sender.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('gmannounce', 4, 'Syntax: .gmannounce $announcement\r\nSend an announcement to online Gamemasters.');
-
+INSERT INTO `command` (`name`,`security`,`help`) VALUES ('gmannounce', 4, 'Syntax: .gmannounce $announcement\r\nSend an announcement to online Gamemasters.'); \ No newline at end of file
diff --git a/sql/updates/608_world.sql b/sql/updates/2.4.3_updates/608_world.sql
index 6cb9665f394..5c052ecd078 100644
--- a/sql/updates/608_world.sql
+++ b/sql/updates/2.4.3_updates/608_world.sql
@@ -164,4 +164,3 @@ INSERT INTO `spell_script_target` VALUES
(46896,0,181605),
(47104,1,26401),
(49058,1,24968); -- Rocket Bot Attack
-
diff --git a/sql/updates/615_world.sql b/sql/updates/2.4.3_updates/615_world.sql
index 99ccb0cdaa3..28512e8511e 100644
--- a/sql/updates/615_world.sql
+++ b/sql/updates/2.4.3_updates/615_world.sql
@@ -5,4 +5,3 @@ DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (-49011, -49012);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (43468, 43648);
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43648, 44007, 1, 'Storm Eye Safe Zone');
-
diff --git a/sql/updates/636_world_scripts.sql b/sql/updates/2.4.3_updates/636_world_scripts.sql
index e8a0fec45b1..5527d639fb2 100644
--- a/sql/updates/636_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/636_world_scripts.sql
@@ -6,5 +6,4 @@ insert into event_scripts values
-- remove every Image from Medivh (should not be spawned by db)
delete from creature where id = 17651;
-- add script
-update creature_template set scriptname = 'npc_image_of_medivh' where entry = 17651;
-
+update creature_template set scriptname = 'npc_image_of_medivh' where entry = 17651; \ No newline at end of file
diff --git a/sql/updates/640_world.sql b/sql/updates/2.4.3_updates/640_world.sql
index b32ee6819bb..20253029d5b 100644
--- a/sql/updates/640_world.sql
+++ b/sql/updates/2.4.3_updates/640_world.sql
@@ -3,4 +3,3 @@ INSERT INTO `spell_script_target` VALUES
(33655,0,183350),
(33633,0,183351),
(44374,1,24722);
-
diff --git a/sql/updates/645_world_scripts.sql b/sql/updates/2.4.3_updates/645_world_scripts.sql
index 834efb390bc..f480a97e204 100644
--- a/sql/updates/645_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/645_world_scripts.sql
@@ -2,5 +2,4 @@ delete from creature where id=17318;
update creature_template set scriptname='npc_geezle' where entry=17318;
delete from event_scripts where id=10675;
insert into event_scripts () VALUES (10675, 0, 10, 17318, 120000, 0, -5134.3, -11250.3, 5.29568, 6.23554),
-(10675, 72, 7, 9531, 0, 0, 0, 0, 0, 0);
-
+(10675, 72, 7, 9531, 0, 0, 0, 0, 0, 0); \ No newline at end of file
diff --git a/sql/updates/667_world_scripts.sql b/sql/updates/2.4.3_updates/667_world_scripts.sql
index 4b2930cd74f..1da0cea44e1 100644
--- a/sql/updates/667_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/667_world_scripts.sql
@@ -1,2 +1 @@
-update creature_template set scriptname='npc_professor_dabiri' where entry=20907;
-
+update creature_template set scriptname='npc_professor_dabiri' where entry=20907; \ No newline at end of file
diff --git a/sql/updates/66_world_scripts.sql b/sql/updates/2.4.3_updates/66_world_scripts.sql
index fcdf65e4620..dfce2afedcc 100644
--- a/sql/updates/66_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/66_world_scripts.sql
@@ -15,5 +15,4 @@ INSERT INTO `spell_script_target` VALUES ('45388', '1', '25038');
INSERT INTO `spell_script_target` VALUES ('45389', '1', '25265');
INSERT INTO `spell_script_target` VALUES ('44885', '1', '25160');
INSERT INTO `spell_script_target` VALUES ('46350', '1', '25160');
-INSERT INTO `spell_script_target` VALUES ('45714', '1', '25038');
-
+INSERT INTO `spell_script_target` VALUES ('45714', '1', '25038'); \ No newline at end of file
diff --git a/sql/updates/676_world.sql b/sql/updates/2.4.3_updates/676_world.sql
index b023e01f0a6..2b9135c04bd 100644
--- a/sql/updates/676_world.sql
+++ b/sql/updates/2.4.3_updates/676_world.sql
@@ -1,3 +1,2 @@
UPDATE `trinity_string` SET `content_default`='Player |cffff0000%s|r kicked by |cffff0000%s|r. Reason: |cffff0000%s|r.' WHERE (`entry`='282');
-UPDATE `command` SET `help`='Syntax: .kick [$charactername] [$reason]\r\n\r\nKick the given character name from the world with or without reason. If no character name is provided then the selected player (except for yourself) will be kicked. If no reason is provided, default is \"No Reason\".' WHERE (`name`='kick');
-
+UPDATE `command` SET `help`='Syntax: .kick [$charactername] [$reason]\r\n\r\nKick the given character name from the world with or without reason. If no character name is provided then the selected player (except for yourself) will be kicked. If no reason is provided, default is \"No Reason\".' WHERE (`name`='kick'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/679_world_scripts.sql b/sql/updates/2.4.3_updates/679_world_scripts.sql
new file mode 100644
index 00000000000..408eb77b046
--- /dev/null
+++ b/sql/updates/2.4.3_updates/679_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_deathstalker_erland' WHERE `entry`=1978; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/683_world_scripts.sql b/sql/updates/2.4.3_updates/683_world_scripts.sql
new file mode 100644
index 00000000000..13f18008438
--- /dev/null
+++ b/sql/updates/2.4.3_updates/683_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `quest_template` SET `SpecialFlags`=2 WHERE `entry`=665;
+UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file
diff --git a/sql/updates/686_world_scripts.sql b/sql/updates/2.4.3_updates/686_world_scripts.sql
index f2b17d21173..e67accb70bf 100644
--- a/sql/updates/686_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/686_world_scripts.sql
@@ -1,7 +1,7 @@
UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE entry=4508;
-DELETE FROM script_texts WHERE entry BETWEEN -1047000 and -1047010;
-INSERT INTO script_texts (entry, content_default, sound, type, language, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1047010 and -1047000;
+INSERT INTO `script_texts` (entry, content_default, sound, type, language, comment) VALUES
(-1047000, 'Phew! Finally,out here. However, it will not become easy. Detain your eyes after annoyance.', 0, 0, 0, 'Willix'),
(-1047001, 'There on top resides Charlga Razorflank. The damned old Crone.', 0, 0, 0, 'Willix'),
(-1047002, 'Help! Get this Raging Agam\'ar from me!', 0, 0, 0, 'Willix'),
@@ -12,5 +12,4 @@ INSERT INTO script_texts (entry, content_default, sound, type, language, comment
(-1047007, 'I am glad that we are out again from this damned ditch. However, up here it is not much better!', 0, 0, 0, 'Willix'),
(-1047008, 'Finally! I am glad that I come, finally out here.', 0, 0, 0, 'Willix'),
(-1047009, 'I will rather rest a moment and come again to breath, before I return to Ratchet.', 0, 0, 0, 'Willix'),
-(-1047010, 'Many thanks for your help.', 0, 0, 0, 'Willix');
-
+(-1047010, 'Many thanks for your help.', 0, 0, 0, 'Willix'); \ No newline at end of file
diff --git a/sql/updates/68_world.sql b/sql/updates/2.4.3_updates/68_world.sql
index 40678a4a5b0..650f4ea3ca0 100644
--- a/sql/updates/68_world.sql
+++ b/sql/updates/2.4.3_updates/68_world.sql
@@ -13,5 +13,4 @@ INSERT INTO trinity_string VALUES
DELETE FROM `command` WHERE `name` = 'freeze' or `name` = 'unfreeze' or name = 'listfreeze';
INSERT INTO `command` (`name`,`security`,`help`) VALUES ('freeze','2','Syntax: .freeze (#player)\r\n\"Freezes\" #player and disables his chat. When using this without #name it will freeze your target.');
INSERT INTO `command` (`name`,`security`,`help`) VALUES ('unfreeze','2','Syntax: .unfreeze (#player)\r\n\"Unfreezes\" #player and enables his chat again. When using this without #name it will unfreeze your target.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('listfreeze','1','Syntax: .listfreeze\r\n\r\nSearch and output all frozen players.');
-
+INSERT INTO `command` (`name`,`security`,`help`) VALUES ('listfreeze','1','Syntax: .listfreeze\r\n\r\nSearch and output all frozen players.'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/691_world_scripts.sql b/sql/updates/2.4.3_updates/691_world_scripts.sql
new file mode 100644
index 00000000000..922f4b24fab
--- /dev/null
+++ b/sql/updates/2.4.3_updates/691_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_earthmender_wilda' WHERE `entry`=21027; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/692_world.sql b/sql/updates/2.4.3_updates/692_world.sql
new file mode 100644
index 00000000000..2149baa9488
--- /dev/null
+++ b/sql/updates/2.4.3_updates/692_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN ('38164','14144','14148');
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+('38164','0','0','0','0','1','0','0','60'),
+('14144','0','0','0','2','0','0','0','0'),
+('14148','0','0','0','2','0','0','0','0'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/708_world_scripts.sql b/sql/updates/2.4.3_updates/708_world_scripts.sql
new file mode 100644
index 00000000000..5d0d9a9a916
--- /dev/null
+++ b/sql/updates/2.4.3_updates/708_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `ScriptName`='boss_shirrak_the_dead_watcher' WHERE `entry`=18371;
+UPDATE `creature_template` SET `ScriptName`='mob_focus_fire' WHERE `entry`=18374; \ No newline at end of file
diff --git a/sql/updates/70_world_scripts.sql b/sql/updates/2.4.3_updates/70_world_scripts.sql
index 893edc00a5f..1bbf737c59c 100644
--- a/sql/updates/70_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/70_world_scripts.sql
@@ -24,5 +24,4 @@ UPDATE `creature_template` SET
`ScriptName` = 'npc_kservant' WHERE `entry` = '19685';
DELETE FROM `quest_start_scripts` WHERE `id`='10211';
-UPDATE `quest_template` SET `StartScript`='0' WHERE entry=10211;
-
+UPDATE `quest_template` SET `StartScript`='0' WHERE entry=10211; \ No newline at end of file
diff --git a/sql/updates/722_world_script_texts.sql b/sql/updates/2.4.3_updates/722_world_script_texts.sql
index 49788912023..8be4cd9a86f 100644
--- a/sql/updates/722_world_script_texts.sql
+++ b/sql/updates/2.4.3_updates/722_world_script_texts.sql
@@ -6,5 +6,4 @@ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,
(-1000143,'There\'s Farstrider Enclave now, $C. Not far to go... Look out! Troll ambush!!',0,0,1,'lilatha SAY_PROGRESS3'),
(-1000144,'Thank you for saving my life and bringing me back to safety, $N',0,0,1,'lilatha SAY_END1'),
(-1000145,'Captain Helios, I\'ve been rescued from the Amani Catacombs. Reporting for duty, sir!',0,0,1,'lilatha SAY_END2'),
-(-1000146,'Liatha, get someone to look at those injuries. Thank you for bringing her back safely.',0,0,1,'lilatha CAPTAIN_ANSWER');
-
+(-1000146,'Liatha, get someone to look at those injuries. Thank you for bringing her back safely.',0,0,1,'lilatha CAPTAIN_ANSWER'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/724_world.sql b/sql/updates/2.4.3_updates/724_world.sql
new file mode 100644
index 00000000000..6c57f8b4a22
--- /dev/null
+++ b/sql/updates/2.4.3_updates/724_world.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `custom_texts` ADD COLUMN `emote` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `language`;
+ALTER TABLE `eventai_texts` ADD COLUMN `emote` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `language`;
+ALTER TABLE `script_texts` ADD COLUMN `emote` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `language`; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/725_characters.sql b/sql/updates/2.4.3_updates/725_characters.sql
new file mode 100644
index 00000000000..675c6721602
--- /dev/null
+++ b/sql/updates/2.4.3_updates/725_characters.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `character_ticket` RENAME TO `gm_tickets`;
+ALTER TABLE `gm_tickets` CHANGE `guid` `playerGuid` int(11) unsigned NOT NULL default '0';
+ALTER TABLE `gm_tickets` CHANGE `ticket_id` `guid` int(11) unsigned NOT NULL default '0';
+ALTER TABLE `gm_tickets` CHANGE `ticket_text` `message` text(0) NOT NULL;
+ALTER TABLE `gm_tickets` CHANGE `ticket_lastchange` `timestamp` int(10) NOT NULL default '0'; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/725_world.sql b/sql/updates/2.4.3_updates/725_world.sql
new file mode 100644
index 00000000000..38eeead03cb
--- /dev/null
+++ b/sql/updates/2.4.3_updates/725_world.sql
@@ -0,0 +1,31 @@
+DELETE FROM `trinity_string` WHERE `entry` IN (290,296,289);
+DELETE FROM `trinity_string` WHERE `entry` BETWEEN 2000 AND 2016;
+INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(2000, '|cff00ff00New ticket from|r|cffff00ff %s.|r |cff00ff00Ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2001, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00edited his/her ticket:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2002, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00abandoned ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2003, '|cffff00ff %s|r |cff00ff00closed ticket|r |cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
+(2004, 'Ticket %d permanently deleted by %s.', '', '', '', '', '', '', '', ''),
+(2005, 'Ticket not found.', '', '', '', '', '', '', '', ''),
+(2007, 'Please close ticket before deleting it permanently.', '', '', '', '', '', '', '', ''),
+(2008, 'Ticket %d is already assigned to GM %s.', '', '', '', '', '', '', '', ''),
+(2009, '%u Tickets succesfully reloaded from the database.', '', '', '', '', '', '', '', ''),
+(2010, 'Showing list of open tickets.', '', '', '', '', '', '', '', ''),
+(2011, 'Showing list of open tickets whose creator is online.', '', '', '', '', '', '', '', ''),
+(2012, 'Invalid name specified. Name should be that of an online Gamemaster.', '', '', '', '', '', '', '', ''),
+(2013, 'This ticket is already assigned to yourself. To unassign use .ticket unassign %d and then reassign.', '', '', '', '', '', '', '', ''),
+(2014, 'Ticket %d is not assigned, you cannot unassign it.', '', '', '', '', '', '', '', ''),
+(2015, 'You cannot unassign tickets from staffmembers with a higher security level than yourself.', '', '', '', '', '', '', '', ''),
+(2016, 'Cannot close ticket %d, it is assigned to another GM.', '', '', '', '', '', '', '', '');
+DELETE FROM `command` WHERE (`name` LIKE '%ticket%');
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('ticket list','1','Displays a list of open GM tickets.'),
+('ticket onlinelist','1','Displays a list of open GM tickets whose owner is online.'),
+('ticket viewname','1','Usage: .ticket viewname $creatorname. \r\nReturns details about specified ticket. Ticket must be open and not deleted.'),
+('ticket viewid','1','Usage: .ticket viewid $ticketid.\r\nReturns details about specified ticket. Ticket must be open and not deleted.'),
+('ticket close','2','Usage: .ticket close $ticketid.\r\nCloses the specified ticket. Does not delete permanently.'),
+('ticket delete','3','Usage: .ticket delete $ticketid.\r\nDeletes the specified ticket permanently. Ticket must be closed first.'),
+('ticket assign','3','Usage: .ticket assign $ticketid $gmname.\r\nAssigns the specified ticket to the specified Game Master.'),
+('ticket unassign','3','Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.'),
+('ticket comment','2','Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.'),
+('reload tickets','4','Usage: .reload tickets.\r\nReloads GM Tickets from the database and re-caches them into memory.');
diff --git a/sql/updates/2.4.3_updates/728_world_scripts.sql b/sql/updates/2.4.3_updates/728_world_scripts.sql
new file mode 100644
index 00000000000..8ada5080463
--- /dev/null
+++ b/sql/updates/2.4.3_updates/728_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_apprentice_mirveda' WHERE `entry`=15402; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/733_characters.sql b/sql/updates/2.4.3_updates/733_characters.sql
new file mode 100644
index 00000000000..21c3d27e782
--- /dev/null
+++ b/sql/updates/2.4.3_updates/733_characters.sql
@@ -0,0 +1 @@
+ALTER TABLE `gm_tickets` ADD `name` varchar(15) NOT NULL AFTER `playerGuid`; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/739_characters.sql b/sql/updates/2.4.3_updates/739_characters.sql
new file mode 100644
index 00000000000..8a4e9197494
--- /dev/null
+++ b/sql/updates/2.4.3_updates/739_characters.sql
@@ -0,0 +1 @@
+ALTER TABLE `gm_tickets` ADD `comment` text(0) NOT NULL; \ No newline at end of file
diff --git a/sql/updates/741_characters.sql b/sql/updates/2.4.3_updates/741_characters.sql
index b7862c4f261..4ce094e3e5f 100644
--- a/sql/updates/741_characters.sql
+++ b/sql/updates/2.4.3_updates/741_characters.sql
@@ -1,4 +1,3 @@
ALTER TABLE `gm_tickets` ADD `closed` tinyint(1) NOT NULL default '0' AFTER `timestamp`;
ALTER TABLE `gm_tickets` ADD `assignedto` int(10) NOT NULL default '0' AFTER `timestamp`;
-
diff --git a/sql/updates/741_world.sql b/sql/updates/2.4.3_updates/741_world.sql
index da59a6d3633..a93d4e2bd01 100644
--- a/sql/updates/741_world.sql
+++ b/sql/updates/2.4.3_updates/741_world.sql
@@ -8,4 +8,3 @@ REPLACE INTO `command` (`name`,`security`,`help`) VALUES ('ticket assign','3','U
REPLACE INTO `command` (`name`,`security`,`help`) VALUES ('ticket unassign','3','Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.');
REPLACE INTO `command` (`name`,`security`,`help`) VALUES ('ticket comment','2','Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.');
REPLACE INTO `command` (`name`,`security`,`help`) VALUES ('reload tickets','4','Usage: .reload tickets.\r\nReloads GM Tickets from the database and re-caches them into memory.');
-
diff --git a/sql/updates/747_world.sql b/sql/updates/2.4.3_updates/747_world.sql
index 561f0adf91d..0fd9c3552e4 100644
--- a/sql/updates/747_world.sql
+++ b/sql/updates/2.4.3_updates/747_world.sql
@@ -1,2 +1 @@
-UPDATE `trinity_string` SET `content_default`='Ticket %d is already assigned.' WHERE (`entry`='2008');
-
+UPDATE `trinity_string` SET `content_default`='Ticket %d is already assigned.' WHERE `entry`=2008; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/748_world_scripts.sql b/sql/updates/2.4.3_updates/748_world_scripts.sql
new file mode 100644
index 00000000000..2c1f692056d
--- /dev/null
+++ b/sql/updates/2.4.3_updates/748_world_scripts.sql
@@ -0,0 +1,3 @@
+UPDATE `creature_template` SET `ScriptName`='npc_infused_crystal' WHERE `entry`=16364;
+UPDATE `creature_template` SET `flags_extra`=0 WHERE `entry`=16364;
+DELETE FROM `creature` WHERE `id`=17086; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/758_world_scripts.sql b/sql/updates/2.4.3_updates/758_world_scripts.sql
new file mode 100644
index 00000000000..3e8ca0f38b9
--- /dev/null
+++ b/sql/updates/2.4.3_updates/758_world_scripts.sql
@@ -0,0 +1,6 @@
+DELETE FROM `creature_template_addon` WHERE `entry`=17225;
+UPDATE `creature_template` SET `ScriptName`='boss_nightbane' WHERE `entry`=17225;
+UPDATE `creature_template` SET `unit_flags`=0 WHERE `entry`=17225;
+DELETE FROM `event_scripts` WHERE `id`=10951;
+INSERT INTO `event_scripts` VALUES
+(10951,0,10,17651,180000,0,-11159,-1907.22,91.48,0); \ No newline at end of file
diff --git a/sql/updates/762_world.sql b/sql/updates/2.4.3_updates/762_world.sql
index 7aaacedc464..6e69f078743 100644
--- a/sql/updates/762_world.sql
+++ b/sql/updates/2.4.3_updates/762_world.sql
@@ -2,6 +2,5 @@ DROP TABLE IF EXISTS `transport_events`;
CREATE TABLE `transport_events` (
`entry` int(11) unsigned NOT NULL default '0',
`waypoint_id` int(11) unsigned NOT NULL default '0',
- `event_id` int(11) unsigned NOT NULL default '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
+ `event_id` int(11) unsigned NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/764_world_scripts.sql b/sql/updates/2.4.3_updates/764_world_scripts.sql
new file mode 100644
index 00000000000..2a8e7b23b12
--- /dev/null
+++ b/sql/updates/2.4.3_updates/764_world_scripts.sql
@@ -0,0 +1,123 @@
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062;
+UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549;
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533039 AND -1533000;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'),
+(-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'),
+(-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'),
+(-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'),
+(-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'),
+(-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'),
+(-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'),
+(-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'),
+(-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'),
+(-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'),
+(-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'),
+(-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'),
+(-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'),
+(-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'),
+(-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'),
+(-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'),
+(-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'),
+(-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'),
+(-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'),
+(-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'),
+(-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'),
+(-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'),
+(-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'),
+(-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'),
+(-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'),
+(-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'),
+(-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'),
+(-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'),
+(-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'),
+(-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'),
+(-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'),
+(-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'),
+(-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'),
+(-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'),
+(-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'),
+(-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'),
+(-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'),
+(-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'),
+(-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'),
+(-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'),
+(-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'),
+(-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'),
+(-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'),
+(-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'),
+(-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'),
+(-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'),
+(-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'),
+(-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'),
+(-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'),
+(-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'),
+(-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'),
+(-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'),
+(-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'),
+(-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'),
+(-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'),
+(-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'),
+(-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'),
+(-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'),
+(-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'),
+(-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'),
+(-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'),
+(-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'),
+(-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'),
+(-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'),
+(-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'),
+(-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'),
+(-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'),
+(-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'),
+(-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'),
+(-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'),
+(-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'),
+(-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'),
+(-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'),
+(-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'),
+(-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'),
+(-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'),
+(-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'),
+(-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'),
+(-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'),
+(-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'),
+(-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'),
+(-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'),
+(-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'),
+(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
+(-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'),
+(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
+(-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'),
+(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'),
+(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'),
+(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'),
+(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'),
+(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'),
+(-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'),
+(-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'),
+(-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'),
+(-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'),
+(-1533098,'<Kel\'Thuzad cackles maniacally!>',14479,1,0,'kelthuzad SAY_SLAY2'),
+(-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'),
+(-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'),
+(-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'),
+(-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'),
+(-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'),
+(-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'),
+(-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'),
+(-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'),
+(-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'),
+(-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL');
+
+UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055;
+UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056; \ No newline at end of file
diff --git a/sql/updates/765_world_scripts.sql b/sql/updates/2.4.3_updates/765_world_scripts.sql
index 2cd56fa71a2..54f84c90157 100644
--- a/sql/updates/765_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/765_world_scripts.sql
@@ -1,7 +1,7 @@
-UPDATE `creature_template` SET `flags_extra` = 0 WHERE `entry` = 20129;
+UPDATE `creature_template` SET `flags_extra`=0 WHERE `entry`=20129;
-- Insert English and French dialogs in database
-DELETE FROM `script_texts` WHERE entry BETWEEN -1000150 and -1000163;
+DELETE FROM `script_texts` WHERE entry BETWEEN -1000163 and -1000150;
INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc2`, `type`, `language`, `comment`) VALUES
(-1000150, 'Greetings, $N. I will guide you through the cavern. Please try and keep up.', 'Salutations, $N. Je vais vous guider à travers cette grotte. Veuillez me suivre.', 4, 0, 'WHISPER_CUSTODIAN_1'),
(-1000151, 'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.', 'Nous ne savons pas si les Grottes du Temps ont toujours été accessibles aux mortels. Vraiment, c\'est impossible à dire étant donné que l\'Intemporel est en mouvement perpétuel, changeant nos spirales temporelles comme bon lui semble. Ce que vous voyez aujourd\'hui peut très bien ne plus exister demain. Vous pourriez vous réveiller sans aucun souvenir de cet endroit.', 4, 0, 'WHISPER_CUSTODIAN_2'),
@@ -16,5 +16,4 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc2`, `type`,
(-1000160, 'This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown...', 'Cette voie est en train de s\'effondrer. Ce qu\'elle peut avoir contenu dans le passé, le présent et le futur nous est actuellement inconnu...', 4, 0, 'WHISPER_CUSTODIAN_11'),
(-1000161, 'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.', 'Les voies sont pour le moment classées de la moins catastrophique à la plus catastrophique, ce qui veut dire que la moindre de celles-ci qui s\'effondre signifierait la fin de votre monde. Nous les classons seulement de cette façon pour que les héros et aventuriers qui y sont envoyés sachent quelle voie est la plus adaptée à leurs compétences.', 4, 0, 'WHISPER_CUSTODIAN_12'),
(-1000162, 'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.', 'Tout ce que nous savons sur cette voie temporelle est qu\'elle mène au Mont Hyjal. Le Vol du Dragon Infini s\'est donné beaucoup de peine pour empêcher notre participation. Soridormi est actuellement en train de tenter de briser les défenses de cette voie, mais ses efforts ont été vain jusqu\'ici. Vous pourriez être notre seul espoir de les briser et de résoudre le conflit.', 4, 0, 'WHISPER_CUSTODIAN_13'),
-(-1000163, 'Our time is at an end $N. I would wish you luck, if such a thing existed.', 'Notre entretien touche à sa fin, $N. Je vous souhaite bonne chance, si tant est qu\'une telle chose a jamais existé.', 4, 0, 'WHISPER_CUSTODIAN_14');
-
+(-1000163, 'Our time is at an end $N. I would wish you luck, if such a thing existed.', 'Notre entretien touche à sa fin, $N. Je vous souhaite bonne chance, si tant est qu\'une telle chose a jamais existé.', 4, 0, 'WHISPER_CUSTODIAN_14'); \ No newline at end of file
diff --git a/sql/updates/773_world_scripts.sql b/sql/updates/2.4.3_updates/773_world_scripts.sql
index 962905c0f65..adfb24e945c 100644
--- a/sql/updates/773_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/773_world_scripts.sql
@@ -1,10 +1,9 @@
-Update quest_template set SpecialFlags=2 where entry=4770;
-UPDATE `creature_template` SET `ScriptName` = 'npc_swiftmountain' WHERE `entry` = 10427;
+UPDATE `quest_template` SET `SpecialFlags`=2 WHERE `entry`=4770;
+UPDATE `creature_template` SET `ScriptName`='npc_swiftmountain' WHERE `entry`=10427;
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000149 AND -1000147;
-INSERT INTO script_texts
+INSERT INTO `script_texts`
(`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `comment`)
VALUES
(-1000147, 'Lets go $N. I am ready to start to Whitereach Post.', NULL, NULL, 'Gehen wir $N.Ich bin bereit,mich zum Weissgipfelposten aufzumachen.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL),
(-1000148, 'This seems to me trusted. If we move to the east, we are probably... Aah! Wyvern attack !', NULL, NULL, 'Das kommt mir vertraut vor.Wenn wir nach Osten ziehen,können wir wahrscheinlich...Aah!Flügeldrachen im Angriff!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL),
- (-1000149, 'Thanks so much... From here I find the way back to the Whitereach Post. Speak with Motega Firemane, maybe you can persuade him to send me home.', NULL, NULL, 'Tausend Dank...Von hier aus finde ich den Rückweg zum Weissgipfelposten.Sprecht unbedingt mit Motega Feuermähne,vielleicht könnt ihr ihn überreden,mich nach Hause zu schicken.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL);
-
+ (-1000149, 'Thanks so much... From here I find the way back to the Whitereach Post. Speak with Motega Firemane, maybe you can persuade him to send me home.', NULL, NULL, 'Tausend Dank...Von hier aus finde ich den Rückweg zum Weissgipfelposten.Sprecht unbedingt mit Motega Feuermähne,vielleicht könnt ihr ihn überreden,mich nach Hause zu schicken.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL); \ No newline at end of file
diff --git a/sql/updates/780_characters.sql b/sql/updates/2.4.3_updates/780_characters.sql
index 40c4d3cdce4..cbcb193c276 100644
--- a/sql/updates/780_characters.sql
+++ b/sql/updates/2.4.3_updates/780_characters.sql
@@ -1,3 +1,2 @@
ALTER TABLE `gm_tickets` CHANGE `guid` `guid` int(10) NOT NULL AUTO_INCREMENT;
-ALTER TABLE `gm_tickets` CHANGE `closed` `closed` int(10) NOT NULL;
-
+ALTER TABLE `gm_tickets` CHANGE `closed` `closed` int(10) NOT NULL; \ No newline at end of file
diff --git a/sql/updates/783_world.sql b/sql/updates/2.4.3_updates/783_world.sql
index f78f35e2951..7076956dd24 100644
--- a/sql/updates/783_world.sql
+++ b/sql/updates/2.4.3_updates/783_world.sql
@@ -1,5 +1,4 @@
-DELETE FROM trinity_string where entry IN (10056, 10057);
-INSERT INTO trinity_string (entry, content_default) VALUES
+DELETE FROM `trinity_string` WHERE `entry` IN (10056, 10057);
+INSERT INTO `trinity_string` (entry, content_default) VALUES
(10056, 'You must be a member of the Horde to enter the Hall of Legends.'),
-(10057, 'You must be a member of the Alliance to enter the Champion\'s Hall.');
-
+(10057, 'You must be a member of the Alliance to enter the Champion\'s Hall.'); \ No newline at end of file
diff --git a/sql/updates/785_world.sql b/sql/updates/2.4.3_updates/785_world.sql
index b4c11653a25..64ffa36957c 100644
--- a/sql/updates/785_world.sql
+++ b/sql/updates/2.4.3_updates/785_world.sql
@@ -1,5 +1,4 @@
-delete from command where name in ('gobject addtemp', 'npc addtemp');
-insert into command (name, security, help) values
+DELETE FROM `command` WHERE `name` IN ('gobject addtemp', 'npc addtemp');
+INSERT INTO `command` (name, security, help) VALUES
('gobject addtemp','2','Adds a temporary gameobject that is not saved to DB.'),
('npc addtemp','2','Adds temporary NPC, not saved to database.');
-
diff --git a/sql/updates/2.4.3_updates/789_world.sql b/sql/updates/2.4.3_updates/789_world.sql
new file mode 100644
index 00000000000..475e16538d1
--- /dev/null
+++ b/sql/updates/2.4.3_updates/789_world.sql
@@ -0,0 +1 @@
+ALTER TABLE `eventai_texts` DROP COLUMN `emote`; \ No newline at end of file
diff --git a/sql/updates/78_world.sql b/sql/updates/2.4.3_updates/78_world.sql
index 4a9cbd3846d..faa02e0e2a6 100644
--- a/sql/updates/78_world.sql
+++ b/sql/updates/2.4.3_updates/78_world.sql
@@ -21,4 +21,3 @@ INSERT INTO spell_proc_event (entry, SchoolMask, Category, SkillID, SpellFamilyN
(34598,0,0,0,0,0x0000000000000000,0x00020000,0,45),
(36488,0,0,0,0,0x0000000000000000,0x08000000,0,0),
(34584,0,0,0,0,0x0000000000000000,0x00004000,0,30);
-
diff --git a/sql/updates/79_characters.sql b/sql/updates/2.4.3_updates/79_characters.sql
index c7b76549e74..15b99f2f4b0 100644
--- a/sql/updates/79_characters.sql
+++ b/sql/updates/2.4.3_updates/79_characters.sql
@@ -1,3 +1,2 @@
ALTER TABLE characters
- CHANGE COLUMN gmstate extra_flags int(11) unsigned NOT NULL default '0';
-
+ CHANGE COLUMN gmstate extra_flags int(11) unsigned NOT NULL default '0'; \ No newline at end of file
diff --git a/sql/updates/79_world.sql b/sql/updates/2.4.3_updates/79_world.sql
index 1b5be949cf2..7b08a825311 100644
--- a/sql/updates/79_world.sql
+++ b/sql/updates/2.4.3_updates/79_world.sql
@@ -1,4 +1,3 @@
DELETE FROM spell_proc_event where entry = 42083;
INSERT INTO spell_proc_event (entry, SchoolMask, Category, SkillID, SpellFamilyName, SpellFamilyMask, procFlags, ppmRate, cooldown) VALUES
-(42083,0,0,0,0,0x0000000000000000,0x00401000,0,45);
-
+(42083,0,0,0,0,0x0000000000000000,0x00401000,0,45); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/807_world_scripts.sql b/sql/updates/2.4.3_updates/807_world_scripts.sql
new file mode 100644
index 00000000000..ee2cbee4fee
--- /dev/null
+++ b/sql/updates/2.4.3_updates/807_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' WHERE `entry`=18760; \ No newline at end of file
diff --git a/sql/updates/817_world_scripts.sql b/sql/updates/2.4.3_updates/817_world_scripts.sql
index 071fb2989ff..8cf97f7145a 100644
--- a/sql/updates/817_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/817_world_scripts.sql
@@ -1,5 +1,7 @@
+UPDATE `creature_template` SET `ScriptName`='npc_ame' WHERE `entry`=9623;
+
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000205 AND -1000200;
-INSERT INTO script_texts
+INSERT INTO `script_texts`
(`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`)
VALUES
(-1000200, 'A-Me good.Good A-me.Follow...A-ME follow.Home.A-ME go home.', NULL, NULL, 'A-ME gut.Gut A-Me.Folgen...Heim.A-ME geht heim.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
@@ -8,7 +10,4 @@ VALUES
(-1000203, 'A-Me home.A-ME go home!Tar Lord dont disturb A-ME.', NULL, NULL, 'A-ME daheim.A-ME geht heim!Teerfürst A-ME nicht aufhalten.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
(-1000204, 'Tar Lord A-ME no hurt.A-ME good.', NULL, NULL, 'Teerfürst A-ME nicht wehtun.A-ME gut.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
(-1000205, 'A-ME at home!A-ME good!Good A-ME.At home.Home.Home', NULL, NULL, 'A-ME daheim!A-ME gut!Gute A-ME.Daheim.Daheim.Daheim', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL);
-UPDATE `quest_template` SET `QuestFlags` = 2, `SpecialFlags` = 2 WHERE `entry` = 4245;
-
-UPDATE `creature_template` SET `ScriptName` = 'npc_ame' WHERE `entry` = 9623;
-
+UPDATE `quest_template` SET `QuestFlags` = 2, `SpecialFlags` = 2 WHERE `entry` = 4245; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/822_world_scripts.sql b/sql/updates/2.4.3_updates/822_world_scripts.sql
new file mode 100644
index 00000000000..942971f8d71
--- /dev/null
+++ b/sql/updates/2.4.3_updates/822_world_scripts.sql
@@ -0,0 +1,3 @@
+UPDATE `creature_template` SET `ScriptName`='npc_kayra_longmane' WHERE `entry`=17969;
+DELETE FROM `creature_template_addon` WHERE `entry`=17969;
+UPDATE `quest_template` SET specialflags=2 WHERE `entry`=9752; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/826_world_scripts.sql b/sql/updates/2.4.3_updates/826_world_scripts.sql
new file mode 100644
index 00000000000..487971d092c
--- /dev/null
+++ b/sql/updates/2.4.3_updates/826_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_ruul_snowhoof' WHERE `entry`=12818; \ No newline at end of file
diff --git a/sql/updates/82_world_scripts.sql b/sql/updates/2.4.3_updates/82_world_scripts.sql
index 276a3385ed6..acdfdd06a6f 100644
--- a/sql/updates/82_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/82_world_scripts.sql
@@ -1,2 +1 @@
-UPDATE `creature_template` SET `ScriptName` = 'npc_twiggy_flathead' WHERE `entry` =6248;
-
+UPDATE `creature_template` SET `ScriptName` = 'npc_twiggy_flathead' WHERE `entry` =6248; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/833_world_scripts.sql b/sql/updates/2.4.3_updates/833_world_scripts.sql
new file mode 100644
index 00000000000..12ed9ecced5
--- /dev/null
+++ b/sql/updates/2.4.3_updates/833_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `ScriptName`='npc_dirty_larry', `unit_flags`=0, `flags_extra`=0 WHERE `entry`=19720;
+UPDATE `creature_template` SET `unit_flags`=0, `flags_extra`=0 WHERE `entry` IN (19726, 19725); \ No newline at end of file
diff --git a/sql/updates/834_world_scripts.sql b/sql/updates/2.4.3_updates/834_world_scripts.sql
index 0b34f8be52f..14b3d74340e 100644
--- a/sql/updates/834_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/834_world_scripts.sql
@@ -1,2 +1 @@
-UPDATE `creature_template` SET `ScriptName`='npc_ishanah' WHERE `entry`=18538;
-
+UPDATE `creature_template` SET `ScriptName`='npc_ishanah' WHERE `entry`=18538; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/837_world_scripts.sql b/sql/updates/2.4.3_updates/837_world_scripts.sql
new file mode 100644
index 00000000000..5fc2abfc4df
--- /dev/null
+++ b/sql/updates/2.4.3_updates/837_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_khadgar' WHERE `entry`=18166; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/838_world_scripts.sql b/sql/updates/2.4.3_updates/838_world_scripts.sql
new file mode 100644
index 00000000000..6b93a03afa0
--- /dev/null
+++ b/sql/updates/2.4.3_updates/838_world_scripts.sql
@@ -0,0 +1,4 @@
+UPDATE `creature_template` SET `ScriptName`='npc_kyle_frenzied' WHERE `entry`='23616';
+DELETE FROM `spell_script_target` WHERE `entry`=42222;
+INSERT INTO `spell_script_target` VALUES
+('42222','1','23616'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/839_world_scripts.sql b/sql/updates/2.4.3_updates/839_world_scripts.sql
new file mode 100644
index 00000000000..7b4ef66ba92
--- /dev/null
+++ b/sql/updates/2.4.3_updates/839_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_wizzlecrank_shredder' WHERE `entry`=3439; \ No newline at end of file
diff --git a/sql/updates/83_realmd.sql b/sql/updates/2.4.3_updates/83_realmd.sql
index 5c47beaabc8..e3c74350735 100644
--- a/sql/updates/83_realmd.sql
+++ b/sql/updates/2.4.3_updates/83_realmd.sql
@@ -1,3 +1,2 @@
ALTER TABLE account
- CHANGE COLUMN tbc expansion tinyint(3) unsigned NOT NULL default '0';
-
+ CHANGE COLUMN tbc expansion tinyint(3) unsigned NOT NULL default '0'; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/840_world_scripts.sql b/sql/updates/2.4.3_updates/840_world_scripts.sql
new file mode 100644
index 00000000000..cfa3d492b9a
--- /dev/null
+++ b/sql/updates/2.4.3_updates/840_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `spell1`=0, `flags_extra`=0, `ScriptName`='npc_volcano' WHERE `entry`=23085; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/841_world_scripts.sql b/sql/updates/2.4.3_updates/841_world_scripts.sql
new file mode 100644
index 00000000000..86d73ba2019
--- /dev/null
+++ b/sql/updates/2.4.3_updates/841_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_greengill_slave' WHERE `entry`=25084; \ No newline at end of file
diff --git a/sql/updates/842_world.sql b/sql/updates/2.4.3_updates/842_world.sql
index 9f40ed71751..cf017877b5e 100644
--- a/sql/updates/842_world.sql
+++ b/sql/updates/2.4.3_updates/842_world.sql
@@ -2,5 +2,4 @@ ALTER TABLE `areatrigger_teleport`
ADD `heroic_required_quest_done` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `heroic_key2`,
ADD `heroic_required_failed_quest_text` TEXT NULL DEFAULT NULL AFTER `heroic_required_quest_done`;
-UPDATE `areatrigger_teleport` SET `heroic_required_quest_done` = 11492, `heroic_required_failed_quest_text` = 'Heroic Difficulty requires completion of the "Hard to Kill" quest.' WHERE `id` = 4887;
-
+UPDATE `areatrigger_teleport` SET `heroic_required_quest_done`=11492, `heroic_required_failed_quest_text`='Heroic Difficulty requires completion of the "Hard to Kill" quest.' WHERE `id`=4887; \ No newline at end of file
diff --git a/sql/updates/84_world.sql b/sql/updates/2.4.3_updates/84_world.sql
index 2dd20fd44bf..100185c0acd 100644
--- a/sql/updates/84_world.sql
+++ b/sql/updates/2.4.3_updates/84_world.sql
@@ -1,4 +1,3 @@
DELETE FROM command WHERE name = 'reload all_locales';
INSERT INTO `command` VALUES
('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.');
-
diff --git a/sql/updates/2.4.3_updates/850_world_scripts.sql b/sql/updates/2.4.3_updates/850_world_scripts.sql
new file mode 100644
index 00000000000..3027947cf14
--- /dev/null
+++ b/sql/updates/2.4.3_updates/850_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_bessy' WHERE `entry`=20415; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/852_world_scripts.sql b/sql/updates/2.4.3_updates/852_world_scripts.sql
new file mode 100644
index 00000000000..001b43c8820
--- /dev/null
+++ b/sql/updates/2.4.3_updates/852_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `ScriptName`='mob_nestlewood_owlkin' WHERE `entry`=16518;
+UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry`=22962; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/857_world_scripts.sql b/sql/updates/2.4.3_updates/857_world_scripts.sql
new file mode 100644
index 00000000000..acd712aecb9
--- /dev/null
+++ b/sql/updates/2.4.3_updates/857_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_kaya_flathoof' WHERE `entry`=11856; \ No newline at end of file
diff --git a/sql/updates/863_world_scripts.sql b/sql/updates/2.4.3_updates/863_world_scripts.sql
index 1c760bd5bb8..a7a214b8956 100644
--- a/sql/updates/863_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/863_world_scripts.sql
@@ -1,5 +1,7 @@
+UPDATE `creature_template` SET `ScriptName`='npc_OOX17' WHERE `entry`=7784;
+
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1060005 AND -1060000;
-INSERT INTO script_texts
+INSERT INTO `script_texts`
(`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`)
VALUES
(-1060000, 'Emergency power activated! Initializing ambulatory motor! CLUCK!', NULL, NULL, 'Notfallenergie aktiviert! Ambulatorenantrieb wird gestartet! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
@@ -7,7 +9,4 @@ VALUES
(-1060002, 'Threat analyzed! Activating combat plan beta! CLUCK!', NULL, NULL, 'Bedrohung analysiert! Gefechtsplan Beta wird aktiviert! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
(-1060003, 'CLUCK! Sensors detect spatial anomaly -- danger imminent! CLUCK', NULL, NULL, 'GLUCK! Sensoren haben räumliche Anomalie entdeckt - Gefahr im Verzug! GLUCK!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
(-1060004, 'No one challenges the wastevander nomads -- not even robotic chickens! ATTACK!', NULL, NULL, 'Niemand fordert die Wüsenläufernomaden heraus - auch keine Robothühner! ANGRIFF!', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL),
- (-1060005, 'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!', NULL, NULL, 'Tarnsysteme online! GLUCK! Tarnung für Transport nach Beutebucht wird aktiviert.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL);
-
-UPDATE `creature_template` SET `ScriptName` = 'npc_OOX17' WHERE `entry` = 7784;
-
+ (-1060005, 'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!', NULL, NULL, 'Tarnsysteme online! GLUCK! Tarnung für Transport nach Beutebucht wird aktiviert.', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL); \ No newline at end of file
diff --git a/sql/updates/86_world_scripts.sql b/sql/updates/2.4.3_updates/86_world_scripts.sql
index d3c17926ac7..8f3c6ac6265 100644
--- a/sql/updates/86_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/86_world_scripts.sql
@@ -3,5 +3,4 @@ update `creature_template` set `ScriptName`='mob_ember_of_alar' where `entry`='1
update `creature_template` set `ScriptName`='mob_flame_patch_alar' where `entry`='20602';
update gameobject_template set scriptname = "go_manticron_cube" where entry = 181713;
-update creature_template set scriptname = "mob_abyssal" where entry = 17454;
-
+update creature_template set scriptname = "mob_abyssal" where entry = 17454; \ No newline at end of file
diff --git a/sql/updates/871_world.sql b/sql/updates/2.4.3_updates/871_world.sql
index 0f4fa4245e7..114cd3101b7 100644
--- a/sql/updates/871_world.sql
+++ b/sql/updates/2.4.3_updates/871_world.sql
@@ -1,6 +1,6 @@
DELETE FROM `trinity_string` WHERE `entry` BETWEEN '288' AND '295';
DELETE FROM `trinity_string` WHERE `entry` BETWEEN '2000' AND '2029';
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
(2000, '|cff00ff00New ticket from|r|cffff00ff %s.|r |cff00ff00Ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
(2001, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00edited his/her ticket:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
(2002, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00abandoned ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', ''),
@@ -28,5 +28,4 @@ INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content
(2024, '\n|cff00ccff%s|r |cff00ff00Added comment|r: \"%s\"|r ', '', '', '', '', '', '', '', '');
DELETE FROM `command` WHERE (`name` LIKE '%ticket closedlist%');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket closedlist','1','Displays a list of closed GM tickets.');
-
+INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket closedlist','1','Displays a list of closed GM tickets.'); \ No newline at end of file
diff --git a/sql/updates/884_world.sql b/sql/updates/2.4.3_updates/884_world.sql
index cbcf89192bb..7d4588a711e 100644
--- a/sql/updates/884_world.sql
+++ b/sql/updates/2.4.3_updates/884_world.sql
@@ -1,5 +1,4 @@
-delete from command where name in ('gobject tempadd','npc tempadd');
-insert into command (name, security, help) values
+DELETE FROM `command` WHERE `name` IN ('gobject addtemp','npc addtemp');
+INSERT INTO `command` (name, security, help) VALUES
('gobject addtemp','2','Adds a temporary gameobject that is not saved to DB.'),
-('npc addtemp','2','Adds temporary NPC, not saved to database.');
-
+('npc addtemp','2','Adds temporary NPC, not saved to database.'); \ No newline at end of file
diff --git a/sql/updates/905_world_scripts.sql b/sql/updates/2.4.3_updates/905_world_scripts.sql
index aa52204e643..3e59e1f0e52 100644
--- a/sql/updates/905_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/905_world_scripts.sql
@@ -7,5 +7,4 @@ INSERT INTO `areatrigger_scripts` VALUES (1526,'at_ring_of_law');
DELETE FROM `script_texts` WHERE `entry`=-1230000;
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
-(-1230000,'Ah, hits the spot!',0,0,0,'rocknot SAY_GOT_BEER');
-
+(-1230000,'Ah, hits the spot!',0,0,0,'rocknot SAY_GOT_BEER'); \ No newline at end of file
diff --git a/sql/updates/90_world.sql b/sql/updates/2.4.3_updates/90_world.sql
index 529de4f712e..52ca028b6ac 100644
--- a/sql/updates/90_world.sql
+++ b/sql/updates/2.4.3_updates/90_world.sql
@@ -5,4 +5,3 @@ CREATE TABLE `spell_disabled` (
`comment` varchar(64) NOT NULL default '',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Disabled Spell System';
-
diff --git a/sql/updates/917_world.sql b/sql/updates/2.4.3_updates/917_world.sql
index 556276fa012..7c989ce7ca4 100644
--- a/sql/updates/917_world.sql
+++ b/sql/updates/2.4.3_updates/917_world.sql
@@ -3,7 +3,6 @@ CREATE TABLE `version` (
`db_version` varchar(120) default NULL COMMENT 'Version of world DB.',
`script_version` varchar(120) default NULL COMMENT 'Version of scripts DB.'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Version Notes';
-INSERT INTO version (core_version, db_version, script_version) VALUES ("",(SELECT version FROM db_version),(SELECT version FROM script_db_version));
-DROP TABLE IF EXISTS db_version;
-DROP TABLE IF EXISTS script_db_version;
-
+INSERT INTO `version` (core_version, db_version, script_version) VALUES ("",(SELECT version FROM db_version),(SELECT version FROM script_db_version));
+DROP TABLE IF EXISTS `db_version`;
+DROP TABLE IF EXISTS `script_db_version`; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/919_world.sql b/sql/updates/2.4.3_updates/919_world.sql
new file mode 100644
index 00000000000..4d4a6308576
--- /dev/null
+++ b/sql/updates/2.4.3_updates/919_world.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `version`
+ ADD `core_revision` BIGINT UNSIGNED AFTER `core_version`; \ No newline at end of file
diff --git a/sql/updates/927_characters.sql b/sql/updates/2.4.3_updates/927_characters.sql
index c3a0df39b8d..6cbcf21e7bd 100644
--- a/sql/updates/927_characters.sql
+++ b/sql/updates/2.4.3_updates/927_characters.sql
@@ -1,2 +1 @@
-ALTER TABLE `gm_tickets` CHANGE `closed` `closed` int(10) NOT NULL default '0';
-
+ALTER TABLE `gm_tickets` CHANGE `closed` `closed` int(10) NOT NULL default '0'; \ No newline at end of file
diff --git a/sql/updates/930_characters.sql b/sql/updates/2.4.3_updates/930_characters.sql
index 303bda03235..cc215786bb1 100644
--- a/sql/updates/930_characters.sql
+++ b/sql/updates/2.4.3_updates/930_characters.sql
@@ -50,8 +50,7 @@ CREATE TABLE IF NOT EXISTS `auctionhousebot` (
--
-- Data for table `auctionhousebot`
--
-insert into `auctionhousebot` (`auctionhouse`,`name`,`minitems`,`maxitems`,`mintime`,`maxtime`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerbiddinginterval`,`buyerbidsperinterval`) values
+INSERT IGNORE INTO `auctionhousebot` (`auctionhouse`,`name`,`minitems`,`maxitems`,`mintime`,`maxtime`,`percentwhitetradegoods`,`percentgreentradegoods`,`percentbluetradegoods`,`percentpurpletradegoods`,`percentwhiteitems`,`percentgreenitems`,`percentblueitems`,`percentpurpleitems`,`minpricewhite`,`maxpricewhite`,`minpricegreen`,`maxpricegreen`,`minpriceblue`,`maxpriceblue`,`minpricepurple`,`maxpricepurple`,`minbidpricewhite`,`maxbidpricewhite`,`minbidpricegreen`,`maxbidpricegreen`,`minbidpriceblue`,`maxbidpriceblue`,`minbidpricepurple`,`maxbidpricepurple`,`maxstackwhite`,`maxstackgreen`,`maxstackblue`,`maxstackpurple`,`buyerpricegrey`,`buyerpricewhite`,`buyerpricegreen`,`buyerpriceblue`,`buyerpricepurple`,`buyerbiddinginterval`,`buyerbidsperinterval`) values
(2,'Alliance',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
(6,'Horde',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1),
-(7,'Neutral',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1);
-
+(7,'Neutral',0,0,8,24,27,12,10,1,10,30,8,2,150,250,800,1400,1250,1750,2250,4550,70,100,80,100,75,100,80,100,0,3,2,1,1,1,5,12,15,1,1); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/933_world_scripts.sql b/sql/updates/2.4.3_updates/933_world_scripts.sql
new file mode 100644
index 00000000000..1a3e9d96f56
--- /dev/null
+++ b/sql/updates/2.4.3_updates/933_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_snake_trap_serpents' WHERE `entry` IN (19921, 19833); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/935_world_scripts.sql b/sql/updates/2.4.3_updates/935_world_scripts.sql
new file mode 100644
index 00000000000..934d3a7de23
--- /dev/null
+++ b/sql/updates/2.4.3_updates/935_world_scripts.sql
@@ -0,0 +1,6 @@
+DELETE FROM `creature` WHERE `id`='17653';
+
+UPDATE `gameobject_template` SET `flags`='4' WHERE `entry` IN ('181766','181823');
+UPDATE `gameobject` SET `SpawnMask`='3',`state`='1' WHERE `id` IN ('181766','181823');
+
+UPDATE `instance_template` SET `script`='instance_blood_furnace' WHERE `map`=542; \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/940_world_scripts.sql b/sql/updates/2.4.3_updates/940_world_scripts.sql
new file mode 100644
index 00000000000..c7f378c6360
--- /dev/null
+++ b/sql/updates/2.4.3_updates/940_world_scripts.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `custom_texts` CHANGE COLUMN `emote` `emote` smallint(5) unsigned NOT NULL DEFAULT '0';
+ALTER TABLE `script_texts` CHANGE COLUMN `emote` `emote` smallint(5) unsigned NOT NULL DEFAULT '0'; \ No newline at end of file
diff --git a/sql/updates/945_world_scripts.sql b/sql/updates/2.4.3_updates/945_world_scripts.sql
index 0831d5c0e6f..a96e7cc1a68 100644
--- a/sql/updates/945_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/945_world_scripts.sql
@@ -1,8 +1,8 @@
-update creature_template set scriptname='' where entry=22083;
-update creature_template set scriptname='npc_overlord_morghor' where entry=23139;
-update creature_template set scriptname='' where entry=23141;
-DELETE FROM script_texts WHERE entry BETWEEN -1000221 and -1000206;
-INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=22083;
+UPDATE `creature_template` SET `ScriptName`='npc_overlord_morghor' WHERE `entry`=23139;
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=23141;
+DELETE FROM `script_texts` WHERE entry BETWEEN -1000221 and -1000206;
+INSERT INTO `script_texts` (entry, content_default, type, emote, comment) VALUES
(-1000206, 'Come, $N. Lord Stormrage awaits.', 0, 1, 'OVERLORD_SAY_1'),
(-1000207, 'Lord Illidan will be here shortly.', 0, 1, 'OVERLORD_SAY_2'),
(-1000208, 'Lord Illidan, this is the Dragonmaw that I, and others, have told you about. He will lead us to victory!', 0, 1, 'OVERLORD_SAY_3'),
@@ -20,12 +20,12 @@ INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
(-1000220, 'I expect to see this insect\'s carcass in pieces in my lair within the hour. Fail and you will suffer a fate so much worse than death.', 0, 1, 'LORD_ILLIDAN_SAY_7'),
(-1000221, 'You will not harm the boy, Mor\'ghor! Quickly, $N, climb on my back!', 0, 22, 'YARZILL_THE_MERC_SAY');
-DELETE FROM script_texts WHERE entry='-1000222';
-INSERT INTO script_texts (entry, content_default, type, language, emote, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry`='-1000222';
+INSERT INTO `script_texts` (entry, content_default, type, language, emote, comment) VALUES
(-1000222, 'Thank you, mortal.', 0, 11, 1, 'SAY_JUST_EATEN');
-DELETE FROM script_texts WHERE entry BETWEEN -1000234 and -1000223;
-INSERT INTO script_texts (entry, content_default, emote, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000234 and -1000223;
+INSERT INTO `script_texts` (entry, content_default, emote, comment) VALUES
(-1000223, 'I sense the tortured spirits, $N. They are this way, come quickly!', 1, 'SAY_START'),
(-1000224, 'Watch out!', 0, 'SAY_AGGRO1'),
(-1000225, 'Naga attackers! Defend yourself!', 0, 'SAY_AGGRO2'),
@@ -37,6 +37,4 @@ INSERT INTO script_texts (entry, content_default, emote, comment) VALUES
(-1000231, 'Lady Vashj must answer for these atrocities. She must be brought to justice!', 0, 'SAY_PROGRESS4'),
(-1000232, 'The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits.', 0, 'SAY_PROGRESS5'),
(-1000233, 'It shouldn\'t be much further, $N. The exit is just up ahead.', 0, 'SAY_PROGRESS6'),
-(-1000234, 'Thank you, $N. Please return to my brethren at the Altar of Damnation, near the Hand of Gul\'dan, and tell them that Wilda is safe. May the Earthmother watch over you...', 0, 'SAY_END');
-
-
+(-1000234, 'Thank you, $N. Please return to my brethren at the Altar of Damnation, near the Hand of Gul\'dan, and tell them that Wilda is safe. May the Earthmother watch over you...', 0, 'SAY_END'); \ No newline at end of file
diff --git a/sql/updates/947_world_scripts.sql b/sql/updates/2.4.3_updates/947_world_scripts.sql
index 9e81f39a8c3..a62e3a24455 100644
--- a/sql/updates/947_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/947_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000244 and -1000235;
-INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000244 and -1000235;
+INSERT INTO `script_texts` (entry, content_default, type, emote, comment) VALUES
(-1000235, 'Ok, $N. Follow me to the cave where I\'ll attempt to harness the power of the rune stone into these goggles.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_1'),
(-1000236, 'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_2'),
(-1000237, 'I\'ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_3'),
@@ -9,5 +9,4 @@ INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
(-1000241, 'I\'ve done it! I have harnessed the power of the stone into the goggles! Let\'s get out of here!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_6'),
(-1000242, 'Phew! Glad to be back from that creepy cave.', 0, 1, 'phizzlethorpe - SAY_PROGRESS_7'),
(-1000243, 'hands one glowing goggles over to Doctor Draxlegauge.', 2, 0, 'phizzlethorpe - EMOTE_PROGRESS_8'),
-(-1000244, 'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_9');
-
+(-1000244, 'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!', 0, 1, 'phizzlethorpe - SAY_PROGRESS_9'); \ No newline at end of file
diff --git a/sql/updates/948_world_scripts.sql b/sql/updates/2.4.3_updates/948_world_scripts.sql
index 9270e5d994a..4828323f7e6 100644
--- a/sql/updates/948_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/948_world_scripts.sql
@@ -1,6 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000247 and -1000245;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000247 and -1000245;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000245, 'You, there! Hand over that moonstone and nobody gets hurt!', 1, 'SAY_RIZZLE_START'),
(-1000246, 'Just chill!', 4, 'SAY_RIZZLE_GRENADE'),
-(-1000247, 'All right, you win! I surrender! Just don\'t hurt me!', 1, 'SAY_RIZZLE_FINAL');
-
+(-1000247, 'All right, you win! I surrender! Just don\'t hurt me!', 1, 'SAY_RIZZLE_FINAL'); \ No newline at end of file
diff --git a/sql/updates/950_world_scripts.sql b/sql/updates/2.4.3_updates/950_world_scripts.sql
index c1058f4b9ee..df7fda62a4d 100644
--- a/sql/updates/950_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/950_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000266 and -1000248;
-INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000266 and -1000248;
+INSERT INTO `script_texts` (entry, content_default, type, emote, comment) VALUES
(-1000248, 'The last thing I remember is the ship falling and us getting into the pods. I\'ll go see how I can help. Thank you!', 0, 0, 'draenei survivor - HEAL1'),
(-1000249, '$C, Where am I? Who are you? Oh no! What happened to the ship?.', 0, 0, 'draenei survivor - HEAL2'),
(-1000250, '$C You saved me! I owe you a debt that I can never repay. I\'ll go see if I can help the others.', 0, 0, 'draenei survivor - HEAL3'),
@@ -20,5 +20,4 @@ INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
(-1000263, 'Relax? Do you know what Kael\'thas does to those that fail him, Geezle? Eternal suffering and pain... Do NOT screw this up, fool.', 0, 0, 'geezle - SPARK_SAY_5'),
(-1000264, 'Our Bloodmyst scouts have located our contact. The fool, Velen, will soon leave himself open and defenseless -- long enough for us to strike! Now get out of my sight before I vaporize you...', 0, 0, 'geezle - SPARK_SAY_6'),
(-1000265, 'Yes, sir. It won\'t happen again...', 0, 0, 'geezle - GEEZLE_SAY_7'),
-(-1000266, 'picks up the naga flag.', 2, 0, 'geezle - EMOTE_SPARK');
-
+(-1000266, 'picks up the naga flag.', 2, 0, 'geezle - EMOTE_SPARK'); \ No newline at end of file
diff --git a/sql/updates/951_world_scripts.sql b/sql/updates/2.4.3_updates/951_world_scripts.sql
index 93f877bdb55..c0d7a80d58c 100644
--- a/sql/updates/951_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/951_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000279 and -1000267;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000279 and -1000267;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000267, 'Ready when you are, warrior.', 1, 'flathead - SAY_BIG_WILL_READY'),
(-1000268, 'The Affray has begun, get ready to fight!', 1, 'flathead - SAY_TWIGGY_FLATHEAD_BEGIN'),
(-1000269, 'You! Enter the fray!', 1, 'flathead - SAY_TWIGGY_FLATHEAD_FRAY'),
@@ -13,5 +13,4 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000276, 'Looks like we\'re out of woods, eh? Wonder what this does...', 0, 'shredder - SAY_PROGRESS_5'),
(-1000277, 'Come on, don\'t break down on me now!', 0, 'shredder - SAY_PROGRESS_6'),
(-1000278, 'That was a close one! Well, let\'s get going, it\'s still a ways to Ratchet!', 0, 'shredder - SAY_PROGRESS_7'),
-(-1000279, 'Hmm... I don\'t think this blinking red light is a good thing...', 0, 'shredder - SAY_PROGRESS_8');
-
+(-1000279, 'Hmm... I don\'t think this blinking red light is a good thing...', 0, 'shredder - SAY_PROGRESS_8'); \ No newline at end of file
diff --git a/sql/updates/952_world_scripts.sql b/sql/updates/2.4.3_updates/952_world_scripts.sql
index 25a19a6972f..b252050d981 100644
--- a/sql/updates/952_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/952_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts where entry BETWEEN -1000285 and -1000280;
-INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000285 and -1000280;
+INSERT INTO `script_texts` (entry, content_default, type, language, comment) VALUES
(-1000280, 'Thank you, dear Paladin, you just saved my life.', 0, 7, 'faulk - SAY_HEAL'),
(-1000281, 'Very well. Let\'s see what you have to show me, $N.', 0, 0, 'anvilvard - SAY_PR_1'),
@@ -7,5 +7,4 @@ INSERT INTO script_texts (entry, content_default, type, language, comment) VALUE
(-1000283, 'releases the last of its energies into the nerarby runestone, succesfully reactivating it.', 2, 0, 'crystal - EMOTE'),
(-1000284, 'Deployment sucessful. Trespassers will be neutralized.', 0, 0, 'sentry - SAY_CONVERTED_1'),
-(-1000285, 'Objective acquired. Initiating security routines.', 0, 0, 'sentry - SAY_CONVERTED_1');
-
+(-1000285, 'Objective acquired. Initiating security routines.', 0, 0, 'sentry - SAY_CONVERTED_1'); \ No newline at end of file
diff --git a/sql/updates/953_world_scripts.sql b/sql/updates/2.4.3_updates/953_world_scripts.sql
index b90eb732658..3f0f46fd8e3 100644
--- a/sql/updates/953_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/953_world_scripts.sql
@@ -1,10 +1,9 @@
-DELETE FROM script_texts where entry BETWEEN -1000292 and -1000286;
-INSERT INTO script_texts (entry, content_default, type, emote, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000292 and -1000286;
+INSERT INTO `script_texts` (entry, content_default, type, emote, comment) VALUES
(-1000286, 'A shadowy, sinister presence has invader the Emerald Dream. Its power is poised to spill over into our world, $N. We must oppose it! That\'s why I cannot accompany you in person.', 0, 0, 'clintar_spirit'),
(-1000287, 'The Emerald Dream will never be yours!', 0, 0, 'clintar_spirit'),
(-1000288, 'Begone from this place!', 0, 0, 'clintar_spirit'),
(-1000289, 'That\'s the first relic, but there are still two more. Follow me, $N.', 0, 0, 'clintar_spirit'),
(-1000290, 'I\'ve recovered the second relic. Take a moment to rest, and then we\'ll continue to the last reliquary.', 0, 0, 'clintar_spirit'),
(-1000291, 'We have all three of the relics, but my energy is rapidly fading. We must make our way back to Dreamwarden Lurosa! He will let you know what to do next.', 0, 0, 'clintar_spirit'),
-(-1000292, 'Lurosa, I am entrusting the Relics of Aviana to $N, who will take them to Morthis Whisperwing. I must return completely to the Emerald Dream now. Do not let $N fail!', 0, 0, 'clintar_spirit');
-
+(-1000292, 'Lurosa, I am entrusting the Relics of Aviana to $N, who will take them to Morthis Whisperwing. I must return completely to the Emerald Dream now. Do not let $N fail!', 0, 0, 'clintar_spirit'); \ No newline at end of file
diff --git a/sql/updates/954_world_scripts.sql b/sql/updates/2.4.3_updates/954_world_scripts.sql
index 11c52b109ad..70a5a377dbd 100644
--- a/sql/updates/954_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/954_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000305 and -1000293;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000305 and -1000293;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000293, 'In Nagrand, food hunt ogre!', 0, 'LUMP_SAY0'),
(-1000294, 'You taste good with maybe a little salt and pepper.', 0, 'LUMP_SAY1'),
(-1000295, 'OK, OK! Lump give up!', 0, 'LUMP_DEFEAT'),
@@ -16,5 +16,4 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000303, 'is very weak', 2, 'mob_phase_hunter - EMOTE_WEAK'),
(-1000304, 'Bessy, is that you?', 0, 'npc_bessy- SAY_THADELL_1'),
-(-1000305, 'Thank you for bringing back my Bessy, $N. I couldn\'t live without her!', 0, 'npc_bessy- SAY_THADELL_2');
-
+(-1000305, 'Thank you for bringing back my Bessy, $N. I couldn\'t live without her!', 0, 'npc_bessy- SAY_THADELL_2'); \ No newline at end of file
diff --git a/sql/updates/955_world_scripts.sql b/sql/updates/2.4.3_updates/955_world_scripts.sql
index 1afcd46cb07..5978a4786ad 100644
--- a/sql/updates/955_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/955_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000333 and -1000306;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000333 and -1000306;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000306, 'Follow me, stranger. This won\'t take long.', 0, 'npc_kservant - SAY1'),
(-1000307, 'Shattrath was once the draenei capital of this world. Its name means \"dwelling of light.\"', 4, 'npc_kservant - WHISP1'),
(-1000308, 'When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell.', 4, 'npc_kservant - WHISP2'),
@@ -31,12 +31,12 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000332, 'Time to meet your maker!', 0, ''),
(-1000333, 'Alright, we give up! Don\'t hurt us!', 0, '');
-DELETE FROM script_texts WHERE entry=-1000334;
-INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry`=-1000334;
+INSERT INTO `script_texts` (entry, content_default, type, language, comment) VALUES
(-1000334, 'Thank you, dear Paladin, you just saved my life.', 0, 10, 'stillblade - SAY_HEAL');
-DELETE FROM script_texts WHERE entry BETWEEN -1000349 and -1000335;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000349 and -1000335;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000335, 'Let\'s get to the others, and keep an eye open for those wolves cutside...', 0, 'npc_deathstalker_erland
- SAY_QUESTACCEPT'),
(-1000336, 'Be careful, $N. Those wolves like to hide among the trees.', 0, 'npc_deathstalker_erland - SAY_START'),
@@ -56,5 +56,4 @@ SAY_ON_BYE'),
(-1000347, 'Let\'s go before they find out I\'m free!', 0, 'npc_kaya_flathoof - SAY_START'),
(-1000348, 'Look out! We\'re under attack!', 0, 'npc_kaya_flathoof - SAY_AMBUSH'),
-(-1000349, 'Thank you for helping me. I know my way back from here.', 0, 'npc_kaya_flathoof - SAY_END');
-
+(-1000349, 'Thank you for helping me. I know my way back from here.', 0, 'npc_kaya_flathoof - SAY_END'); \ No newline at end of file
diff --git a/sql/updates/956_world_scripts.sql b/sql/updates/2.4.3_updates/956_world_scripts.sql
index 1e9b5b6d2d5..8ac06a7ab97 100644
--- a/sql/updates/956_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/956_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000365 and -1000350;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000365 and -1000350;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000350, 'Who dares awaken Aquementas?', 1, 'mob_aquementas - AGGRO_YELL_AQUE'),
(-1000351, 'I give up! Please don\'t kill me!', 0, 'mob_unkor_the_ruthless - SAY_SUBMIT'),
@@ -9,9 +9,7 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000353, 'Ok let\'s get out of here!', 0, 'npc_isla_starmane - SAY_PROGRESS_1'),
(-1000354, 'You sure you\'re ready? Take a moment.', 0, 'npc_isla_starmane - SAY_PROGRESS_2'),
(-1000355, 'Alright, let\'s do this!', 0, 'npc_isla_starmane - SAY_PROGRESS_3'),
-(-1000356, 'Ok, I think I can make it on my own from here. Thank you so much for breaking me out of there!', 0,
-
-'npc_isla_starmane - SAY_PROGRESS_4'),
+(-1000356, 'Ok, I think I can make it on my own from here. Thank you so much for breaking me out of there!', 0, 'npc_isla_starmane - SAY_PROGRESS_4'),
(-1000357, 'Belore...', 0, 'npc_lady_sylvanas_windrunner - SAY_LAMENT_END'),
(-1000358, 'kneels down and pick up the amulet.', 2, 'npc_lady_sylvanas_windrunner - EMOTE_LAMENT_END'),
@@ -23,5 +21,4 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000362, 'Let\'s keep moving. We\'re not safe here!', 0, 'npc_kayra_longmane - SAY_PROGRESS_3'),
(-1000363, 'Look out, $N! Enemies ahead!', 0, 'npc_kayra_longmane - SAY_PROGRESS_4'),
(-1000364, 'We\'re almost to the refuge! Let\'s go.', 0, 'npc_kayra_longmane - SAY_PROGRESS_5'),
-(-1000365, 'I can see my fellow druids from here. Thank you, $N. I\'m sure Ysiel will reward you for your actions!', 0, 'npc_kayra_longmane - SAY_PROGRESS_6');
-
+(-1000365, 'I can see my fellow druids from here. Thank you, $N. I\'m sure Ysiel will reward you for your actions!', 0, 'npc_kayra_longmane - SAY_PROGRESS_6'); \ No newline at end of file
diff --git a/sql/updates/957_world_scripts.sql b/sql/updates/2.4.3_updates/957_world_scripts.sql
index 9ebc7b73b66..368bd1f5573 100644
--- a/sql/updates/957_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/957_world_scripts.sql
@@ -33,5 +33,4 @@ INSERT INTO `waypoint_data`(`id`,`point`,`position_x`,`position_y`,`position_z`)
('2081','4','-1430','1705','112'),
('2081','5','-1393.5','1705.5','112'),
('2081','6','-1369.8','1724.5','112'),
-('2081','7','-1377','1760','112');
-
+('2081','7','-1377','1760','112'); \ No newline at end of file
diff --git a/sql/updates/963_world_scripts.sql b/sql/updates/2.4.3_updates/963_world_scripts.sql
index ab46bba981c..9083b243064 100644
--- a/sql/updates/963_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/963_world_scripts.sql
@@ -1,13 +1,13 @@
-UPDATE creature_template set ScriptName='mob_illidari_spawn' WHERE entry IN (22075,22074,19797);
+UPDATE `creature_template` SET `ScriptName`='mob_illidari_spawn' WHERE `entry` IN (22075,22074,19797);
UPDATE `creature_template` SET `ScriptName`='mob_torloth_the_magnificent' WHERE `entry`='22076';
-UPDATE creature_template SET ScriptName='npc_lord_illidan_stormrage' WHERE entry=22083;
-delete from creature where id=22083;
-INSERT INTO creature (id, map, spawnMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, DeathState, MovementType)
+UPDATE `creature_template` SET `ScriptName`='npc_lord_illidan_stormrage' WHERE `entry`=22083;
+DELETE FROM `creature` WHERE `id`=22083;
+INSERT INTO `creature` (id, map, spawnMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, DeathState, MovementType)
VALUES (22083, 530, 1, 0, 0, -4635.75, 1386.32, 137.34, 5.72398, 25,0, 0, 9955, 6774, 0, 0);
-update gameobject_template set scriptname='go_crystal_prison' where entry=185126;
+UPDATE `gameobject_template` SET `ScriptName`='go_crystal_prison' WHERE `entry`=185126;
-DELETE FROM script_texts WHERE entry BETWEEN -1000374 and -1000366;
-INSERT INTO script_texts (entry, content_default, type, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000374 and -1000366;
+INSERT INTO `script_texts` (entry, content_default, type, comment) VALUES
(-1000366, 'So you have defeated the Crimson Sigil. You now seek to challenge my rule? Not even Arthas could defeat me, yet you dare to even harbor such thoughts? Then I say to you, come! Come $N! The Black Temple awaits...', 1, 'Quest: Battle of the crimson watch - END_TEXT'),
(-1000367, 'At your command, my liege...', 0, 'TorlothAnim - First'),
@@ -18,5 +18,4 @@ INSERT INTO script_texts (entry, content_default, type, comment) VALUES
(-1000371, 'What manner of fool dares stand before Illidan Stormrage? Soldiers, destroy these insects!', 1, 'Quest: Battle of the crimson watch WavesInfo - First'),
(-1000372, 'You are no challenge for the Crimson Sigil. Mind breakers, end this nonsense.', 1, 'Quest: Battle of the crimson watch WavesInfo - Second'),
(-1000373, 'Run while you still can. The highlords come soon...', 1, 'Quest: Battle of the crimson watch WavesInfo - Third'),
-(-1000374, 'Torloth your master calls!', 1, 'Quest: Battle of the crimson watch WavesInfo - Fourth');
-
+(-1000374, 'Torloth your master calls!', 1, 'Quest: Battle of the crimson watch WavesInfo - Fourth'); \ No newline at end of file
diff --git a/sql/updates/965_world_scripts.sql b/sql/updates/2.4.3_updates/965_world_scripts.sql
index 51ea41b94e5..e3160223d5a 100644
--- a/sql/updates/965_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/965_world_scripts.sql
@@ -14,5 +14,4 @@ REPLACE INTO `spell_script_target` VALUES
(21934,1,21934),
(43144,1,23817),
(12613,1,5843),
-(9095,1,1200);
-
+(9095,1,1200); \ No newline at end of file
diff --git a/sql/updates/966_world_scripts.sql b/sql/updates/2.4.3_updates/966_world_scripts.sql
index 78ecaa6eb73..f49411890f4 100644
--- a/sql/updates/966_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/966_world_scripts.sql
@@ -1,5 +1,5 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000395 AND -1000375;
-INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000395 AND -1000375;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
(-1000375 ,'I remember well the sting of defeat at the conclusion of the Third War. I have waited far too long for my revenge. Now the shadow of the Legion falls over this world. It is only a matter of time until all of your failed creation... is undone.',11332,1,0,0,'kazzak SAY_INTRO'),
(-1000376,'The Legion will conquer all!',11333,1,0,0,'kazzak SAY_AGGRO1'),
(-1000377,'All mortals will perish!',11334,1,0,0,'kazzak SAY_AGGRO2'),
@@ -21,5 +21,4 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1000392,'Threat level zero.',11349,1,0,0,'doomwalker SAY_SLAY_1'),
(-1000393,'Directive accomplished.',11350,1,0,0,'doomwalker SAY_SLAY_2'),
(-1000394,'Target exterminated.',11351,1,0,0,'doomwalker SAY_SLAY_3'),
-(-1000395,'System failure in five, f-o-u-r...',11352,1,0,0,'doomwalker SAY_DEATH');
-
+(-1000395,'System failure in five, f-o-u-r...',11352,1,0,0,'doomwalker SAY_DEATH'); \ No newline at end of file
diff --git a/sql/updates/970_world_scripts.sql b/sql/updates/2.4.3_updates/970_world_scripts.sql
index 6105fc5ccbe..5a9223cfc78 100644
--- a/sql/updates/970_world_scripts.sql
+++ b/sql/updates/2.4.3_updates/970_world_scripts.sql
@@ -1,10 +1,8 @@
-DELETE FROM script_texts WHERE entry BETWEEN -1000401 AND -1000396;
-INSERT INTO script_texts (entry, content_default, type, language, comment) VALUES
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000401 AND -1000396;
+INSERT INTO `script_texts` (entry, content_default, type, language, comment) VALUES
(-1000396, 'Muahahahaha! You fool! You\'ve released me from my banishment in the interstices between space and time!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_1'),
(-1000397, 'All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!', 0, 0, 'mobs_nether_drake - SAY_NIHIL_2'),
(-1000398, 'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!', 0, 0, 'mobs_nether_Drake - SAY_NIHIL_3'),
(-1000399, 'No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again.', 0, 0, 'mobs_nether_drake - SAY_NIHIL_4'),
(-1000400, 'NOOOOooooooo!', 1, 0, 'mobs_nether_drake - SAY_NIHIL_INTERRUPT'),
-
-(-1000401, 'Good $N, you are under the spell\'s influence. I must analyze it quickly, then we can talk.', 0, 7, 'npc_daranelle - SAY_DARANELLE');
-
+(-1000401, 'Good $N, you are under the spell\'s influence. I must analyze it quickly, then we can talk.', 0, 7, 'npc_daranelle - SAY_DARANELLE'); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/973_world_scripts.sql b/sql/updates/2.4.3_updates/973_world_scripts.sql
new file mode 100644
index 00000000000..ea997f917ff
--- /dev/null
+++ b/sql/updates/2.4.3_updates/973_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_enraged_spirit' WHERE `entry` IN (21050, 21061, 21060, 21059); \ No newline at end of file
diff --git a/sql/updates/2.4.3_updates/CMakeLists.txt b/sql/updates/2.4.3_updates/CMakeLists.txt
new file mode 100644
index 00000000000..fc28dd652cb
--- /dev/null
+++ b/sql/updates/2.4.3_updates/CMakeLists.txt
@@ -0,0 +1,5 @@
+FILE(GLOB _SQL_243 *.sql)
+
+INSTALL(FILES
+${_SQL_243}
+DESTINATION share/trinity/sql/updates/2.4.3_updates)
diff --git a/sql/updates/2013_world.sql b/sql/updates/2013_world.sql
new file mode 100644
index 00000000000..ac1179bd2c5
--- /dev/null
+++ b/sql/updates/2013_world.sql
@@ -0,0 +1,11 @@
+-- Shattered Barrier
+DELETE FROM `spell_proc_event` WHERE `entry` IN (44745, 54787, 58426, 31221, 31222, 31223);
+INSERT INTO `spell_proc_event` VALUES
+(44745, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00008000, 0x0002000, 0.000000, 0.000000, 0),
+(54787, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00008000, 0x0002000, 0.000000, 0.000000, 0),
+-- Overkill
+(58426, 0x00, 8, 0x400000, 0x00000000, 0x00000000, 0x00014000, 0x0004001, 0.000000, 0.000000, 0),
+-- Master of subtlety
+(31221, 0x00, 8, 0x400000, 0x00000000, 0x00000000, 0x00014000, 0x0004001, 0.000000, 0.000000, 0),
+(31222, 0x00, 8, 0x400000, 0x00000000, 0x00000000, 0x00014000, 0x0004001, 0.000000, 0.000000, 0),
+(31223, 0x00, 8, 0x400000, 0x00000000, 0x00000000, 0x00014000, 0x0004001, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2021_world.sql b/sql/updates/2021_world.sql
new file mode 100644
index 00000000000..38e86847763
--- /dev/null
+++ b/sql/updates/2021_world.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (30293, 30295, 30296);
+INSERT INTO `spell_proc_event` VALUES
+-- Soul Leech
+(30293, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0),
+(30295, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0),
+(30296, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2025_mangos_7493_01_world_command.sql b/sql/updates/2025_mangos_7493_01_world_command.sql
new file mode 100644
index 00000000000..ec319bd2728
--- /dev/null
+++ b/sql/updates/2025_mangos_7493_01_world_command.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7472_01_mangos_mangos_string required_7493_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('gobject near','gobject phase','gobject setphase');
+
+INSERT INTO `command` VALUES
+('gobject near',2,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),
+('gobject setphase',2,'Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'); \ No newline at end of file
diff --git a/sql/updates/2025_mangos_7495_01_world_trinity_string.sql b/sql/updates/2025_mangos_7495_01_world_trinity_string.sql
new file mode 100644
index 00000000000..29859083cb2
--- /dev/null
+++ b/sql/updates/2025_mangos_7495_01_world_trinity_string.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7493_01_mangos_command required_7495_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (276,277,524);
+INSERT INTO `trinity_string` VALUES
+(276,'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) turned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(277,'Game Object |cffffffff|Hgameobject:%d|h[%s]|h|r (GUID: %u) moved',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(524,'Selected object:\n|cffffffff|Hgameobject:%d|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2031_realmd.sql b/sql/updates/2031_realmd.sql
new file mode 100644
index 00000000000..fb81c0e99c8
--- /dev/null
+++ b/sql/updates/2031_realmd.sql
@@ -0,0 +1,8 @@
+DROP TABLE IF EXISTS `logs`;
+-- create logs table
+CREATE TABLE `logs` (
+ `time` int(14) NOT NULL,
+ `realm` int(4) NOT NULL,
+ `type` int(4) NOT NULL,
+ `string` text
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
diff --git a/sql/updates/2057_world.sql b/sql/updates/2057_world.sql
new file mode 100644
index 00000000000..0be46a18121
--- /dev/null
+++ b/sql/updates/2057_world.sql
@@ -0,0 +1,11 @@
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (15290, 39373, 33778, 379, 38395, 40972, 22845, 33504, 34299);
+INSERT INTO `spell_bonus_data` VALUES
+(15290, 0, 0, 0, 'Vampiric Embrace'),
+(39373, 0, 0, 0, 'Shadowmend'),
+(33778, 0, 0, 0, 'Lifebloom'),
+(379, 0, 0, 0, 'Earth Shield'),
+(38395, 0, 0, 0, 'Siphon Essence'),
+(40972, 0, 0, 0, 'Heal'),
+(22845, 0, 0, 0, 'Frenzied Regeneration'),
+(33504, 0, 0, 0, 'Mark of Conquest'),
+(34299, 0, 0, 0, 'Improved Leader of the Pack'); \ No newline at end of file
diff --git a/sql/updates/2064_world.sql b/sql/updates/2064_world.sql
new file mode 100644
index 00000000000..f1d3c8a9eb3
--- /dev/null
+++ b/sql/updates/2064_world.sql
@@ -0,0 +1,7 @@
+DELETE FROM `trinity_string` WHERE `entry` IN (7523,7524);
+INSERT INTO `trinity_string` VALUES
+(7523,'WORLD: Denying connections.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(7524,'WORLD: Accepting connections.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+DELETE FROM `command` WHERE `name` IN ('server set closed');
+INSERT INTO `command` VALUES ('server set closed', 3, 'Syntax: server set closed on/off\r\n\r\nSets whether the world accepts new client connectsions.'); \ No newline at end of file
diff --git a/sql/updates/2080_mangos_7503_01_world_command.sql b/sql/updates/2080_mangos_7503_01_world_command.sql
new file mode 100644
index 00000000000..36627860a7f
--- /dev/null
+++ b/sql/updates/2080_mangos_7503_01_world_command.sql
@@ -0,0 +1,15 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7495_01_mangos_mangos_string required_7503_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('addmove','allowmove','debug Mod32Value','debug standstate','go creature','go graveyard','go trigger','gobject phase','gobject setphase','Mod32Value','modify arena','modify standstate','npc addmove','npc allowmove','npc textemote','npc phase','npc setphase','showhonor');
+INSERT INTO `command` VALUES
+('debug Mod32Value',3,'Syntax: .debug Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'),
+('go creature',1,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),
+('go graveyard',1,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),
+('go trigger',1,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'),
+('gobject setphase',2,'Syntax: .gobject setphase #guid #phasemask\r\n\r\nGameobject with DB guid #guid phasemask changed to #phasemask with related world vision update for players. Gameobject state saved to DB and persistent.'),
+('modify arena',1,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),
+('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
+('npc addmove',2,'Syntax: .npc addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'),
+('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement creatures in world. Not implemented.'),
+('npc setphase',2,'Syntax: .npc setphase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'),
+('npc textemote',1,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'); \ No newline at end of file
diff --git a/sql/updates/2131_world.sql b/sql/updates/2131_world.sql
new file mode 100644
index 00000000000..0eec3a3d468
--- /dev/null
+++ b/sql/updates/2131_world.sql
@@ -0,0 +1,22 @@
+DELETE FROM `command` WHERE `name` IN ('server difftime', 'npc tempadd', 'gobject tempadd', 'gobject addtemp', 'npc addtemp');
+INSERT INTO `command` VALUES
+('gobject tempadd','2','Adds a temporary gameobject that is not saved to DB.'),
+('npc tempadd','2','Adds temporary NPC, not saved to database.');
+UPDATE `command` SET `name`="ahbotoption" WHERE `name`="ahbotoptions";
+DELETE FROM `command` WHERE `name` IN ('reload tickets');
+DELETE FROM `command` WHERE `name` LIKE "path%";
+DELETE FROM `command` WHERE `name` LIKE "wp%";
+INSERT INTO `command` VALUES
+('wp load',2,'Syntax: .wp load $pathid\nLoad pathid number for selected creature. Creature must have no waypoint data.'),
+('wp event',2,'Syntax: .wp event $subcommand\nType .path event to see the list of possible subcommands or .help path event $subcommand to see info on subcommands.'),
+('wp event add',2,'Syntax: .wp event add $subcommand\nAdd new waypoint action in DB.'),
+('wp event mod',2,'Syntax: .wp mod $eventid $parameter $parameter_value\nModify parameter value for specified eventid.\nPossible parameters: pos_x, pos_y, pos_z, command, datalong, datalon2, dataint.'),
+('wp event listid',2,'Syntax: .wp event listid $eventid\nShows specified eventid info.'),
+('wp unload',2,'Syntax: .wp unload\nUnload path for selected creature.'),
+('wp show',2,'Syntax: .wp show $option\nOptions:\non $pathid (or selected creature with loaded path) - Show path\noff - Hide path\ninfo $slected_waypoint - Show info for selected waypoint.'),
+('wp mod ',2,'Syntax: .wp mod\nType .path mod to see the list of possible subcommands or .help path mod $subcommand to see info on subcommands.'),
+('wp mod del',2,'Syntax: .wp mod del\nDelete selected waypoint.'),
+('wp mod move',2,'Syntax: .wp mod move\nChange selected waypoint coordinates to your position.'),
+('wp mod move_flag',2,'Syntax: .wp mod move_flag\nSet move/run flag.'),
+('wp mod action',2,'Syntax: .wp mod action\nAssign action (waypoint script id) to selected waypoint.'),
+('wp mod action_chance',2,'Syntax: .wp mod action_chance\nAssign chance.'); \ No newline at end of file
diff --git a/sql/updates/2138_world.sql b/sql/updates/2138_world.sql
new file mode 100644
index 00000000000..1d290154c33
--- /dev/null
+++ b/sql/updates/2138_world.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (55198, 34026);
+INSERT INTO `spell_proc_event` VALUES
+-- Tidial Force
+(55198, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00004000, 0x00000002, 0.000000, 0.000000, 0),
+-- Kill Command
+(34026, 0x00, 9, 0x00000000, 0x10000000, 0x00000000, 0x0000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2139_script_waypoint.sql b/sql/updates/2139_script_waypoint.sql
new file mode 100644
index 00000000000..430366eafdb
--- /dev/null
+++ b/sql/updates/2139_script_waypoint.sql
@@ -0,0 +1,49 @@
+DROP TABLE IF EXISTS script_waypoint;
+CREATE TABLE script_waypoint (
+ entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry',
+ pointid mediumint(8) unsigned NOT NULL DEFAULT '0',
+ location_x float NOT NULL DEFAULT '0',
+ location_y float NOT NULL DEFAULT '0',
+ location_z float NOT NULL DEFAULT '0',
+ waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs',
+ point_comment text,
+ PRIMARY KEY (entry, pointid)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
+
+DELETE FROM `script_waypoint` WHERE `entry`=16295;
+INSERT INTO `script_waypoint` VALUES
+(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'),
+(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''),
+(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''),
+(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''),
+(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''),
+(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'),
+(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''),
+(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''),
+(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''),
+(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''),
+(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''),
+(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'),
+(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''),
+(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''),
+(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''),
+(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''),
+(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''),
+(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''),
+(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'),
+(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''),
+(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''),
+(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''),
+(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''),
+(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''),
+(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''),
+(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''),
+(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''),
+(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''),
+(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''),
+(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''),
+(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'),
+(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''),
+(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'),
+(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'),
+(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, ''); \ No newline at end of file
diff --git a/sql/updates/2139_world.sql b/sql/updates/2139_world.sql
new file mode 100644
index 00000000000..dd7217e9bfd
--- /dev/null
+++ b/sql/updates/2139_world.sql
@@ -0,0 +1,2 @@
+UPDATE `gameobject_template` SET `ScriptName`='go_cat_figurine' WHERE `entry`=13873;
+UPDATE `creature_template` SET `ScriptName`='npc_garments_of_quests' WHERE `entry` IN (12429,12423,12427,12430,12428); \ No newline at end of file
diff --git a/sql/updates/2139_world_script.sql b/sql/updates/2139_world_script.sql
new file mode 100644
index 00000000000..3d40c497eae
--- /dev/null
+++ b/sql/updates/2139_world_script.sql
@@ -0,0 +1,13 @@
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000164 AND -1000174;
+INSERT INTO `script_texts` (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1000164,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,0,2,'garments SAY_COMMON_HEALED'),
+(-1000165,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!',0,0,1,1,'garments SAY_DG_KEL_THANKS'),
+(-1000166,'Farewell to you, and may shadow always protect you!',0,0,1,3,'garments SAY_DG_KEL_GOODBYE'),
+(-1000167, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,1,'garments SAY_ROBERTS_THANKS'),
+(-1000168, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'),
+(-1000169, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,1,'garments SAY_KORJA_THANKS'),
+(-1000170, 'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'),
+(-1000171, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,1,'garments SAY_DOLF_THANKS'),
+(-1000172, 'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'),
+(-1000173, 'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,1,'garments SAY_SHAYA_THANKS'),
+(-1000174, 'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE'); \ No newline at end of file
diff --git a/sql/updates/2160_world.sql b/sql/updates/2160_world.sql
new file mode 100644
index 00000000000..40d2c9d1bb6
--- /dev/null
+++ b/sql/updates/2160_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `command` WHERE `name` LIKE "ahbotoption %";
+DELETE FROM `command` WHERE `name` LIKE "ahbotoptions %";
+DELETE FROM `command` WHERE `name` IN ('gobject addtemp','npc addtemp'); \ No newline at end of file
diff --git a/sql/updates/2161_world.sql b/sql/updates/2161_world.sql
new file mode 100644
index 00000000000..1e45d6b33ed
--- /dev/null
+++ b/sql/updates/2161_world.sql
@@ -0,0 +1,2 @@
+DELETE FROM `command` WHERE `name` LIKE "wp mod %";
+DELETE FROM `command` WHERE `name` LIKE "wp event %"; \ No newline at end of file
diff --git a/sql/updates/2227_mangos_7544_01_world_uptime.sql b/sql/updates/2227_mangos_7544_01_world_uptime.sql
new file mode 100644
index 00000000000..0889d78c1a0
--- /dev/null
+++ b/sql/updates/2227_mangos_7544_01_world_uptime.sql
@@ -0,0 +1,3 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7536_01_mangos_spell_chain required_7544_01_mangos_uptime bit;*/
+
+DROP TABLE IF EXISTS `uptime`; \ No newline at end of file
diff --git a/sql/updates/2227_mangos_7546_02_realmd_uptime.sql b/sql/updates/2227_mangos_7546_02_realmd_uptime.sql
new file mode 100644
index 00000000000..6ba9b17deaf
--- /dev/null
+++ b/sql/updates/2227_mangos_7546_02_realmd_uptime.sql
@@ -0,0 +1,15 @@
+/*ALTER TABLE realmd_db_version CHANGE COLUMN required_6976_01_realmd_realmd_db_version required_7546_02_realmd_uptime bit;*/
+
+--
+-- Table structure for table `uptime`
+--
+
+DROP TABLE IF EXISTS `uptime`;
+CREATE TABLE `uptime` (
+ `realmid` int(11) unsigned NOT NULL,
+ `starttime` bigint(20) unsigned NOT NULL default '0',
+ `startstring` varchar(64) NOT NULL default '',
+ `uptime` bigint(20) unsigned NOT NULL default '0',
+ `maxplayers` smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (`realmid`,`starttime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; \ No newline at end of file
diff --git a/sql/updates/2254_world.sql b/sql/updates/2254_world.sql
new file mode 100644
index 00000000000..0ff79e5ca4b
--- /dev/null
+++ b/sql/updates/2254_world.sql
@@ -0,0 +1,13 @@
+DELETE FROM `command` WHERE `name` IN ('server difftime', 'addmove', 'Mod32Value', 'allowmove', 'reload tickets', 'npc tempadd', 'gobject tempadd', 'gobject addtemp', 'npc addtemp');
+INSERT INTO `command` VALUES
+('gobject tempadd','2','Adds a temporary gameobject that is not saved to DB.'),
+('npc tempadd','2','Adds temporary NPC, not saved to database.');
+UPDATE `command` SET `name`="ahbotoption" WHERE `name`="ahbotoptions";
+DELETE FROM `command` WHERE `name` LIKE "path%";
+DELETE FROM `command` WHERE `name` LIKE "wp%";
+INSERT INTO `command` VALUES
+('wp load',2,'Syntax: .wp load $pathid\nLoad pathid number for selected creature. Creature must have no waypoint data.'),
+('wp event',2,'Syntax: .wp event $subcommand\nType .path event to see the list of possible subcommands or .help path event $subcommand to see info on subcommands.'),
+('wp unload',2,'Syntax: .wp unload\nUnload path for selected creature.'),
+('wp show',2,'Syntax: .wp show $option\nOptions:\non $pathid (or selected creature with loaded path) - Show path\noff - Hide path\ninfo $slected_waypoint - Show info for selected waypoint.'),
+('wp mod',2,'Syntax: .wp mod\nType .path mod to see the list of possible subcommands or .help path mod $subcommand to see info on subcommands.'); \ No newline at end of file
diff --git a/sql/updates/2274_mangos_7558_01_world_trinity_string.sql b/sql/updates/2274_mangos_7558_01_world_trinity_string.sql
new file mode 100644
index 00000000000..a7776d74e35
--- /dev/null
+++ b/sql/updates/2274_mangos_7558_01_world_trinity_string.sql
@@ -0,0 +1,9 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7544_01_mangos_uptime required_7558_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (1123,1124,1125,1126,1127);
+INSERT INTO `trinity_string` VALUES
+(1123,'Not pet found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1124,'Wrong pet type',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1125,'Your pet learned all talents',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1126,'Your pet talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1127,'Talents of %s\'s pet reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2274_mangos_7558_02_world_command.sql b/sql/updates/2274_mangos_7558_02_world_command.sql
new file mode 100644
index 00000000000..b5e4558cada
--- /dev/null
+++ b/sql/updates/2274_mangos_7558_02_world_command.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7558_01_mangos_mangos_string required_7558_02_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('learn all_mypettalents');
+INSERT INTO `command` VALUES
+('learn all_mypettalents',3,'Syntax: .learn all_mypettalents\r\n\r\nLearn all talents for your pet available for his creature type (only for hunter pets).'); \ No newline at end of file
diff --git a/sql/updates/2276_mangos_7560_01_world_gameobject_template.sql b/sql/updates/2276_mangos_7560_01_world_gameobject_template.sql
new file mode 100644
index 00000000000..dd99f3820e4
--- /dev/null
+++ b/sql/updates/2276_mangos_7560_01_world_gameobject_template.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7558_02_mangos_command required_7560_01_mangos_gameobject_template bit;*/
+
+ALTER TABLE gameobject_template
+ ADD COLUMN IconName varchar(100) NOT NULL default '' AFTER name; \ No newline at end of file
diff --git a/sql/updates/2280_mangos_7565_01_world_trinity_string.sql b/sql/updates/2280_mangos_7565_01_world_trinity_string.sql
new file mode 100644
index 00000000000..c7ec3aaf725
--- /dev/null
+++ b/sql/updates/2280_mangos_7565_01_world_trinity_string.sql
@@ -0,0 +1,9 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7560_01_mangos_gameobject_template required_7565_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (1010,1011,1012,1013,1014);
+INSERT INTO `trinity_string` VALUES
+(1010,'| Account | Character | IP | GM | Expansion |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1011,'|<Error> | %20s |<Error> |<Er>| <Error> |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1012,'===========================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1013,'|%15s| %20s | %15s |%4d| %9d |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1014,'No online players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2284_mangos_7568_01_world_spell_proc_event.sql b/sql/updates/2284_mangos_7568_01_world_spell_proc_event.sql
new file mode 100644
index 00000000000..016b88eac27
--- /dev/null
+++ b/sql/updates/2284_mangos_7568_01_world_spell_proc_event.sql
@@ -0,0 +1,49 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7565_01_mangos_mangos_string required_7568_01_mangos_spell_proc_event bit;*/
+
+-- (53569) Infusion of Light (Rank 1)
+DELETE FROM `spell_proc_event` WHERE `entry` IN (53569);
+INSERT INTO `spell_proc_event` VALUES (53569, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (53576) Infusion of Light (Rank 2)
+DELETE FROM `spell_proc_event` WHERE `entry` IN (53576);
+INSERT INTO `spell_proc_event` VALUES (53576, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (54149) Infusion of Light (Rank 2)
+DELETE FROM `spell_proc_event` WHERE `entry` IN (54149);
+INSERT INTO `spell_proc_event` VALUES (54149, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (55776) Swordguard Embroidery ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (55776);
+INSERT INTO `spell_proc_event` VALUES (55776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
+
+-- (55768) Darkglow Embroidery ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (55768);
+INSERT INTO `spell_proc_event` VALUES (55768, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
+
+-- (55640) Lightweave Embroidery ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (55640);
+INSERT INTO `spell_proc_event` VALUES (55640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
+
+-- (55380) Skyflare Swiftness ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (55380);
+INSERT INTO `spell_proc_event` VALUES (55380, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45);
+
+-- (56355) Titanium Shield Spike ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (56355);
+INSERT INTO `spell_proc_event` VALUES (56355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0);
+
+-- (61345) Natures Grace ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (61345);
+INSERT INTO `spell_proc_event` VALUES (61345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (61346) Natures Grace ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (61346);
+INSERT INTO `spell_proc_event` VALUES (61346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (61356) Invigorating Earthsiege Diamond Passive ()
+DELETE FROM `spell_proc_event` WHERE `entry` IN (61356);
+INSERT INTO `spell_proc_event` VALUES (61356, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+
+-- (24905) Moonkin Form (Passive) (Passive)
+DELETE FROM `spell_proc_event` WHERE `entry` IN (24905);
+INSERT INTO `spell_proc_event` VALUES (24905, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 15.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2296_world.sql b/sql/updates/2296_world.sql
new file mode 100644
index 00000000000..716d6be4b82
--- /dev/null
+++ b/sql/updates/2296_world.sql
@@ -0,0 +1,2 @@
+ALTER TABLE creature_template
+ ADD COLUMN `VehicleId` mediumint(8) unsigned NOT NULL default '0' AFTER `PetSpellDataId`; \ No newline at end of file
diff --git a/sql/updates/2339_world.sql b/sql/updates/2339_world.sql
new file mode 100644
index 00000000000..4b7f08394c2
--- /dev/null
+++ b/sql/updates/2339_world.sql
@@ -0,0 +1,16 @@
+DELETE FROM `command` WHERE `name` LIKE "ahbotoption %";
+INSERT INTO `command`(`name`,`security`,`help`) VALUES
+('ahbotoption ahexpire', '3', '.Syntax: .ahbotoption ahexpire $ahMapID Expire all auctions started by AHbot.'),
+('ahbotoption minitems', '3', '.Syntax: .ahbotoption minitems $ahMapID $parameter Set minimum number of items to be sold in the auctionhouse. If value is 0 then minitems=maxitems. If minitems>maxitems then it will be set equal to maxitems.'),
+('ahbotoption maxitems', '3', '.Syntax: .ahbotoption maxitems $ahMapID $parameter Set maximum number of items to be sold in the auctionhouse.'),
+('ahbotoption mintime', '3', '.Syntax: .ahbotoption mintime $ahMapID $parameter Set minimum number of hours for the items\' auction.'),
+('ahbotoption maxtime', '3', '.Syntax: .ahbotoption maxtime $ahMapID $parameter Set maximum number of hours for the items\' auction.'),
+('ahbotoption percentages', '3', '.Syntax: .ahbotoption percentages $ahMapID $greytrade $whitetrade $greentrade $bluetrade $purpletrade $orangetrade $yellowtrade $greyitem $whiteitem $greenitem $blueitem $purpleitem $orangeitem $yellowitem Set percentages for item types to be sold. Percentages must add up to 100, no higher. If percentage is set to 0 then item type will be disabled.'),
+('ahbotoption minprice', '3', '.Syntax: .ahbotoption minprice $ahMapID $color $price Set rate for minimum selling price for item. 1=100%, 1.5=150%...'),
+('ahbotoption maxprice', '3', '.Syntax: .ahbotoption maxprice $ahMapID $color $price Set rate for maximum selling price for item. 1=100%, 1.5=150%...'),
+('ahbotoption minbidprice', '3', '.Syntax: .ahbotoption minbidprice $ahMapID $color $price Set minimum possible bid made considering buyoutprice. 30=30% of buyout price, 40%=40%...'),
+('ahbotoption maxbidprice', '3', '.Syntax: .ahbotoption maxbidprice $ahMapID $color $price Set maximum possible bid made considering buyoutprice. 70=70% of buyout price, 80%=80%...'),
+('ahbotoption maxstack', '3', '.Syntax: .ahbotoption maxstack $ahMapID $color $value Set maximum stacks for single item in auction. if set to 0 then item_template.stackable value will be considered $color: grey, white, green, blue, purple, orange, yellow.'),
+('ahbotoption buyerprice', '3', '.Syntax: .ahbotoption buyerprice $ahMapID $color $value Set rate for which Ahbot will be allowed to buy an item. 1=item_template.sellprice, 2=2*item_template.sellprice... $color: grey, white, green, blue, purple, orange, yellow.'),
+('ahbotoption bidinterval', '3', '.Syntax: .ahbotoption bidinterval $ahMapID $parameter Set number of minutes between bids'),
+('ahbotoption bidsperinterval', '3', '.Syntax: .ahbotoption bidsperinterval $ahMapID $parameter Set number of bids to be made per cycle.'); \ No newline at end of file
diff --git a/sql/updates/2343_world.sql b/sql/updates/2343_world.sql
new file mode 100644
index 00000000000..091ceb847e0
--- /dev/null
+++ b/sql/updates/2343_world.sql
@@ -0,0 +1,17 @@
+DELETE FROM `command` WHERE `name` LIKE "ahbotoption %";
+DELETE FROM `command` WHERE `name` LIKE "ahbotoptions %";
+INSERT INTO `command`(`name`,`security`,`help`) VALUES
+('ahbotoptions ahexpire', '3', '.Syntax: .ahbotoptions ahexpire $ahMapID Expire all auctions started by AHbot.'),
+('ahbotoptions minitems', '3', '.Syntax: .ahbotoptions minitems $ahMapID $parameter Set minimum number of items to be sold in the auctionhouse. If value is 0 then minitems=maxitems. If minitems>maxitems then it will be set equal to maxitems.'),
+('ahbotoptions maxitems', '3', '.Syntax: .ahbotoptions maxitems $ahMapID $parameter Set maximum number of items to be sold in the auctionhouse.'),
+('ahbotoptions mintime', '3', '.Syntax: .ahbotoptions mintime $ahMapID $parameter Set minimum number of hours for the items\' auction.'),
+('ahbotoptions maxtime', '3', '.Syntax: .ahbotoptions maxtime $ahMapID $parameter Set maximum number of hours for the items\' auction.'),
+('ahbotoptions percentages', '3', '.Syntax: .ahbotoptions percentages $ahMapID $greytrade $whitetrade $greentrade $bluetrade $purpletrade $orangetrade $yellowtrade $greyitem $whiteitem $greenitem $blueitem $purpleitem $orangeitem $yellowitem Set percentages for item types to be sold. Percentages must add up to 100, no higher. If percentage is set to 0 then item type will be disabled.'),
+('ahbotoptions minprice', '3', '.Syntax: .ahbotoptions minprice $ahMapID $color $price Set rate for minimum selling price for item. 1=100%, 1.5=150%...'),
+('ahbotoptions maxprice', '3', '.Syntax: .ahbotoptions maxprice $ahMapID $color $price Set rate for maximum selling price for item. 1=100%, 1.5=150%...'),
+('ahbotoptions minbidprice', '3', '.Syntax: .ahbotoptions minbidprice $ahMapID $color $price Set minimum possible bid made considering buyoutprice. 30=30% of buyout price, 40%=40%...'),
+('ahbotoptions maxbidprice', '3', '.Syntax: .ahbotoptions maxbidprice $ahMapID $color $price Set maximum possible bid made considering buyoutprice. 70=70% of buyout price, 80%=80%...'),
+('ahbotoptions maxstack', '3', '.Syntax: .ahbotoptions maxstack $ahMapID $color $value Set maximum stacks for single item in auction. if set to 0 then item_template.stackable value will be considered $color: grey, white, green, blue, purple, orange, yellow.'),
+('ahbotoptions buyerprice', '3', '.Syntax: .ahbotoptions buyerprice $ahMapID $color $value Set rate for which Ahbot will be allowed to buy an item. 1=item_template.sellprice, 2=2*item_template.sellprice... $color: grey, white, green, blue, purple, orange, yellow.'),
+('ahbotoptions bidinterval', '3', '.Syntax: .ahbotoptions bidinterval $ahMapID $parameter Set number of minutes between bids'),
+('ahbotoptions bidsperinterval', '3', '.Syntax: .ahbotoptions bidsperinterval $ahMapID $parameter Set number of bids to be made per cycle.'); \ No newline at end of file
diff --git a/sql/updates/2346_world.sql b/sql/updates/2346_world.sql
new file mode 100644
index 00000000000..9bbe8d96d9a
--- /dev/null
+++ b/sql/updates/2346_world.sql
@@ -0,0 +1,2 @@
+DELETE FROM `command` WHERE `name` LIKE "ahbotoption %";
+DELETE FROM `command` WHERE `name` LIKE "ahbotoptions %"; \ No newline at end of file
diff --git a/sql/updates/238_world.sql b/sql/updates/238_world.sql
deleted file mode 100644
index 1b70eeaf0ac..00000000000
--- a/sql/updates/238_world.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-DELETE FROM trinity_string WHERE entry IN (453);
-
diff --git a/sql/updates/2412_characters.sql b/sql/updates/2412_characters.sql
new file mode 100644
index 00000000000..e1f44c58ae3
--- /dev/null
+++ b/sql/updates/2412_characters.sql
@@ -0,0 +1,10 @@
+DELETE FROM `character_aura` WHERE 'effect_index'>'1';
+ ALTER TABLE `character_aura` CHANGE `effect_index` `effect_mask` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
+ ALTER TABLE `character_aura` CHANGE `amount` `amount0` INT( 11 ) NOT NULL DEFAULT '0';
+ ALTER TABLE `character_aura` ADD `amount1` INT( 11 ) NOT NULL DEFAULT '0' AFTER `amount0`;
+ ALTER TABLE `character_aura` ADD `amount2` INT( 11 ) NOT NULL DEFAULT '0' AFTER `amount1`;
+DELETE FROM `pet_aura` WHERE 'effect_index'>'1';
+ ALTER TABLE `pet_aura` CHANGE `effect_index` `effect_mask` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
+ ALTER TABLE `pet_aura` CHANGE `amount` `amount0` INT( 11 ) NOT NULL DEFAULT '0';
+ ALTER TABLE `pet_aura` ADD `amount1` INT( 11 ) NOT NULL DEFAULT '0' AFTER `amount0`;
+ ALTER TABLE `pet_aura` ADD `amount2` INT( 11 ) NOT NULL DEFAULT '0' AFTER `amount1`; \ No newline at end of file
diff --git a/sql/updates/2412_world.sql b/sql/updates/2412_world.sql
new file mode 100644
index 00000000000..c31c22b3d72
--- /dev/null
+++ b/sql/updates/2412_world.sql
@@ -0,0 +1,2 @@
+UPDATE `trinity_string` SET `content_default` = 'id: %d effmask: %d charges: %d stack: %d slot %d duration: %d maxduration: %d' WHERE `entry` =468;
+UPDATE `trinity_string` SET `content_default` = 'id: %d eff: %d amount: %d' WHERE `trinity_string`.`entry` =470; \ No newline at end of file
diff --git a/sql/updates/2432_mangos_7615_01_world_command.sql b/sql/updates/2432_mangos_7615_01_world_command.sql
new file mode 100644
index 00000000000..0f1d14d8520
--- /dev/null
+++ b/sql/updates/2432_mangos_7615_01_world_command.sql
@@ -0,0 +1,8 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7568_01_mangos_spell_proc_event required_7615_01_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('senditems','sendmail','sendmoney','sendmessage','send items','send mail','send money','send message');
+INSERT INTO `command` VALUES
+('send items',3,'Syntax: .send items #playername "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in "". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),
+('send mail',1,'Syntax: .send mail #playername "#subject" "#text"\r\n\r\nSend a mail to a player. Subject and mail text must be in "".'),
+('send message',3,'Syntax: .send message $playername $message\r\n\r\nSend screen message to player from ADMINISTRATOR.'),
+('send money','3','Syntax: .send money #playername "#subject" "#text" #money\r\n\r\nSend mail with money to a player. Subject and mail text must be in "".'); \ No newline at end of file
diff --git a/sql/updates/2433_mangos_7616_01_world_trinity_string.sql b/sql/updates/2433_mangos_7616_01_world_trinity_string.sql
new file mode 100644
index 00000000000..d358f72391e
--- /dev/null
+++ b/sql/updates/2433_mangos_7616_01_world_trinity_string.sql
@@ -0,0 +1,6 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7615_01_mangos_command required_7616_01_mangos_mangos_string bit;*/
+
+DELETE FROM `trinity_string` WHERE `entry` IN (1200,1201);
+INSERT INTO `trinity_string` VALUES
+(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2433_mangos_7616_02_world_command.sql b/sql/updates/2433_mangos_7616_02_world_command.sql
new file mode 100644
index 00000000000..405415ac311
--- /dev/null
+++ b/sql/updates/2433_mangos_7616_02_world_command.sql
@@ -0,0 +1,7 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7616_01_mangos_mangos_string required_7616_02_mangos_command bit;*/
+
+DELETE FROM `command` WHERE `name` IN ('debug playsound','debug play sound','debug play cinematic','debug play movie');
+INSERT INTO `command` VALUES
+('debug play cinematic',1,'Syntax: .debug play cinematic #cinematicid\r\n\r\nPlay cinematic #cinematicid for you. You stay at place while your mind fly.\r\n'),
+('debug play movie',1,'Syntax: .debug play movie #movieid\r\n\r\nPlay movie #movieid for you.'),
+('debug play sound',1,'Syntax: .debug play sound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'); \ No newline at end of file
diff --git a/sql/updates/2444_world.sql b/sql/updates/2444_world.sql
new file mode 100644
index 00000000000..7eec5331e50
--- /dev/null
+++ b/sql/updates/2444_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `command` WHERE `name` IN ('reload spell_linked_spell');
+INSERT INTO `command` VALUES
+('reload spell_linked_spell','3','Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.'); \ No newline at end of file
diff --git a/sql/updates/2450_world.sql b/sql/updates/2450_world.sql
new file mode 100644
index 00000000000..f5d90abfd18
--- /dev/null
+++ b/sql/updates/2450_world.sql
@@ -0,0 +1,7 @@
+UPDATE `gameobject_template` SET `ScriptName`='go_jump_a_tron' WHERE `entry`=183146;
+UPDATE `gameobject_template` SET `ScriptName`='go_ethereum_prison' WHERE `entry`=184421;
+UPDATE `gameobject_template` SET `scriptname`='go_sacred_fire_of_life' WHERE `entry`=175944;
+UPDATE `gameobject_template` SET `scriptname`='go_skull_pile' WHERE `entry`=185913;
+DELETE FROM `command` WHERE `name` IN ('reload spell_linked_spell');
+INSERT INTO `command` VALUES
+('reload spell_linked_spell','3','Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.');
diff --git a/sql/updates/2479_world.sql b/sql/updates/2479_world.sql
new file mode 100644
index 00000000000..28bb545b72f
--- /dev/null
+++ b/sql/updates/2479_world.sql
@@ -0,0 +1,2 @@
+DELETE FROM `trinity_string` WHERE `entry` = 5007;
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (5007, 'You must be in a raid group to enter this instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file
diff --git a/sql/updates/2492_mangos_7622_01_world_creature_ai_scripts.sql b/sql/updates/2492_mangos_7622_01_world_creature_ai_scripts.sql
new file mode 100644
index 00000000000..a657e359923
--- /dev/null
+++ b/sql/updates/2492_mangos_7622_01_world_creature_ai_scripts.sql
@@ -0,0 +1,29 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7616_02_mangos_command required_7622_01_mangos_creature_ai_scripts bit;*/
+
+DROP TABLE IF EXISTS `creature_ai_scripts`;
+CREATE TABLE `creature_ai_scripts` (
+ `id` int(11) unsigned NOT NULL COMMENT 'Identifier' AUTO_INCREMENT,
+ `creature_id` int(11) unsigned NOT NULL default '0' COMMENT 'Creature Template Identifier',
+ `event_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Event Type',
+ `event_inverse_phase_mask` int(11) signed NOT NULL default '0' COMMENT 'Mask which phases this event will not trigger in',
+ `event_chance` int(3) unsigned NOT NULL default '100',
+ `event_flags` int(3) unsigned NOT NULL default '0',
+ `event_param1` int(11) signed NOT NULL default '0',
+ `event_param2` int(11) signed NOT NULL default '0',
+ `event_param3` int(11) signed NOT NULL default '0',
+ `event_param4` int(11) signed NOT NULL default '0',
+ `action1_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action1_param1` int(11) signed NOT NULL default '0',
+ `action1_param2` int(11) signed NOT NULL default '0',
+ `action1_param3` int(11) signed NOT NULL default '0',
+ `action2_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action2_param1` int(11) signed NOT NULL default '0',
+ `action2_param2` int(11) signed NOT NULL default '0',
+ `action2_param3` int(11) signed NOT NULL default '0',
+ `action3_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type',
+ `action3_param1` int(11) signed NOT NULL default '0',
+ `action3_param2` int(11) signed NOT NULL default '0',
+ `action3_param3` int(11) signed NOT NULL default '0',
+ `comment` varchar(255) NOT NULL default '' COMMENT 'Event Comment',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts'; \ No newline at end of file
diff --git a/sql/updates/2492_mangos_7622_02_world_creature_ai_summons.sql b/sql/updates/2492_mangos_7622_02_world_creature_ai_summons.sql
new file mode 100644
index 00000000000..e9d6a0a48e4
--- /dev/null
+++ b/sql/updates/2492_mangos_7622_02_world_creature_ai_summons.sql
@@ -0,0 +1,13 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7622_01_mangos_creature_ai_scripts required_7622_02_mangos_creature_ai_summons bit;*/
+
+DROP TABLE IF EXISTS `creature_ai_summons`;
+CREATE TABLE `creature_ai_summons` (
+ `id` int(11) unsigned NOT NULL COMMENT 'Location Identifier' AUTO_INCREMENT,
+ `position_x` float NOT NULL default '0',
+ `position_y` float NOT NULL default '0',
+ `position_z` float NOT NULL default '0',
+ `orientation` float NOT NULL default '0',
+ `spawntimesecs` int(11) unsigned NOT NULL default '120',
+ `comment` varchar(255) NOT NULL default '' COMMENT 'Summon Comment',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; \ No newline at end of file
diff --git a/sql/updates/2492_mangos_7622_03_world_creature_ai_texts.sql b/sql/updates/2492_mangos_7622_03_world_creature_ai_texts.sql
new file mode 100644
index 00000000000..cdb4995367b
--- /dev/null
+++ b/sql/updates/2492_mangos_7622_03_world_creature_ai_texts.sql
@@ -0,0 +1,21 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7622_02_mangos_creature_ai_summons required_7622_03_mangos_creature_ai_texts bit;*/
+
+DROP TABLE IF EXISTS `creature_ai_texts`;
+CREATE TABLE `creature_ai_texts` (
+ `entry` mediumint(8) NOT NULL,
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ `sound` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `language` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `emote` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `comment` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; \ No newline at end of file
diff --git a/sql/updates/2508_characters.sql b/sql/updates/2508_characters.sql
new file mode 100644
index 00000000000..33d49010b93
--- /dev/null
+++ b/sql/updates/2508_characters.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS `has_logged_in_before`; \ No newline at end of file
diff --git a/sql/updates/1318_world_scripts.sql b/sql/updates/2515_world_scripts.sql
index bae41913997..e334e241585 100644
--- a/sql/updates/1318_world_scripts.sql
+++ b/sql/updates/2515_world_scripts.sql
@@ -8,26 +8,15 @@ UPDATE `creature_template` SET `ScriptName`='mob_fel_stalker' WHERE `entry`=1791
UPDATE `creature_template` SET `ScriptName`='mob_frost_wyrm' WHERE `entry`=17907;
UPDATE `creature_template` SET `ScriptName`='mob_gargoyle' WHERE `entry`=17906;
UPDATE `creature_template` SET `ScriptName`='alliance_rifleman' WHERE `entry`=17921;
-
UPDATE `creature_template` SET `ScriptName`='mob_towering_infernal' WHERE `entry`=17818;
UPDATE `creature_template` SET `ScriptName`='boss_anetheron' WHERE `entry`=17808;
-
UPDATE `creature_template` SET `ScriptName`='boss_azgalor' WHERE `entry`=17842;
UPDATE `creature_template` SET `ScriptName`='mob_lesser_doomguard' WHERE `entry`=17864;
-
UPDATE `creature_template` SET `ScriptName`='boss_kazrogal' WHERE `entry`=17888;
-
UPDATE `creature_template` SET `ScriptName`='boss_rage_winterchill' WHERE `entry`=17767;
-
UPDATE `creature_template` SET `scale`='0.5' WHERE `entry`=17968;
-
UPDATE `creature_template` SET `equipment_id`='17888' WHERE `entry`=17888;
UPDATE `creature_template` SET `equipment_id`='17921' WHERE `entry`=17921;
-
-DELETE FROM creature_equip_template WHERE `entry` IN (17888, 17921);
+/*DELETE FROM creature_equip_template WHERE `entry` IN (17888, 17921);
INSERT INTO creature_equip_template () VALUES (17888, 45776, 0, 0, 33490946, 0, 0, 0, 0, 0);
-INSERT INTO creature_equip_template () VALUES (17921, 20732, 0, 20732, 33489666, 0, 33489666, 26, 0, 26);
-
-
-
-
+INSERT INTO creature_equip_template () VALUES (17921, 20732, 0, 20732, 33489666, 0, 33489666, 26, 0, 26);*/ \ No newline at end of file
diff --git a/sql/updates/2522_mangos_7627_01_world_achievement_criteria_data.sql b/sql/updates/2522_mangos_7627_01_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..da2fecf8971
--- /dev/null
+++ b/sql/updates/2522_mangos_7627_01_world_achievement_criteria_data.sql
@@ -0,0 +1,10 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7622_03_mangos_creature_ai_texts required_7627_01_mangos_achievement_criteria_data bit;*/
+
+DROP TABLE IF EXISTS `achievement_criteria_data`;
+CREATE TABLE `achievement_criteria_data` (
+ `criteria_id` mediumint(8) NOT NULL,
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `value1` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `value2` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`criteria_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Achievment system'; \ No newline at end of file
diff --git a/sql/updates/2528_mangos_7633_01_world_achievement_criteria_data.sql b/sql/updates/2528_mangos_7633_01_world_achievement_criteria_data.sql
new file mode 100644
index 00000000000..4cc035e3169
--- /dev/null
+++ b/sql/updates/2528_mangos_7633_01_world_achievement_criteria_data.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7627_01_mangos_achievement_criteria_data required_7633_01_mangos_achievement_criteria_data bit;*/
+
+ALTER TABLE `achievement_criteria_data`
+ DROP PRIMARY KEY,
+ ADD PRIMARY KEY (`criteria_id`,`type`); \ No newline at end of file
diff --git a/sql/updates/2551_world_spell_bonus_data.sql b/sql/updates/2551_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..531f248a2ef
--- /dev/null
+++ b/sql/updates/2551_world_spell_bonus_data.sql
@@ -0,0 +1,4 @@
+-- Judgement
+DELETE FROM `spell_bonus_data` WHERE `entry` = 54158;
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`comments`) VALUES
+('54158','0.25','0','0.16','Paladin - Unleashing spell for Seal of Wisdom, Justice and Light'); \ No newline at end of file
diff --git a/sql/updates/2559_world_spell_proc_event.sql b/sql/updates/2559_world_spell_proc_event.sql
new file mode 100644
index 00000000000..50ebcb09e96
--- /dev/null
+++ b/sql/updates/2559_world_spell_proc_event.sql
@@ -0,0 +1,9 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (44544);
+-- Fingers of frost triggered spell
+INSERT INTO `spell_proc_event` VALUES (44544, 0x00, 0x00000003, 0x00000000, 0x00100000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0);
+
+-- Sudden Death
+DELETE FROM `spell_proc_event` WHERE `entry` IN (29723, 29725, 29724);
+INSERT INTO `spell_proc_event` VALUES (29723, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (29725, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
+INSERT INTO `spell_proc_event` VALUES (29724, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2565_world_SD2_scripts.sql b/sql/updates/2565_world_SD2_scripts.sql
new file mode 100644
index 00000000000..2b744ba549b
--- /dev/null
+++ b/sql/updates/2565_world_SD2_scripts.sql
@@ -0,0 +1,343 @@
+DROP TABLE IF EXISTS script_waypoint;
+CREATE TABLE script_waypoint (
+ entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry',
+ pointid mediumint(8) unsigned NOT NULL DEFAULT '0',
+ location_x float NOT NULL DEFAULT '0',
+ location_y float NOT NULL DEFAULT '0',
+ location_z float NOT NULL DEFAULT '0',
+ waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs',
+ point_comment text,
+ PRIMARY KEY (entry, pointid)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
+
+-- script waypoint
+DELETE FROM script_waypoint WHERE entry=467;
+INSERT INTO script_waypoint VALUES
+(467, 0, -10508.40, 1068.00, 55.21, 0, ''),
+(467, 1, -10518.30, 1074.84, 53.96, 0, ''),
+(467, 2, -10534.82, 1081.92, 49.88, 0, ''),
+(467, 3, -10546.51, 1084.88, 50.13, 0, ''),
+(467, 4, -10555.29, 1084.45, 45.75, 0, ''),
+(467, 5, -10566.57, 1083.53, 42.10, 0, ''),
+(467, 6, -10575.83, 1082.34, 39.46, 0, ''),
+(467, 7, -10585.67, 1081.08, 37.77, 0, ''),
+(467, 8, -10600.08, 1078.19, 36.23, 0, ''),
+(467, 9, -10608.69, 1076.08, 35.88, 0, ''),
+(467, 10, -10621.26, 1073.00, 35.40, 0, ''),
+(467, 11, -10638.12, 1060.18, 33.61, 0, ''),
+(467, 12, -10655.87, 1038.99, 33.48, 0, ''),
+(467, 13, -10664.68, 1030.54, 32.70, 0, ''),
+(467, 14, -10708.68, 1033.86, 33.32, 0, ''),
+(467, 15, -10754.43, 1017.93, 32.79, 0, ''),
+(467, 16, -10802.26, 1018.01, 32.16, 0, ''),
+(467, 17, -10832.60, 1009.04, 32.71, 0, ''),
+(467, 18, -10866.56, 1006.51, 31.71, 0, ''),
+(467, 19, -10879.98, 1005.10, 32.84, 0, ''),
+(467, 20, -10892.45, 1001.32, 34.46, 0, ''),
+(467, 21, -10906.14, 997.11, 36.15, 0, ''),
+(467, 22, -10922.26, 1002.23, 35.74, 0, ''),
+(467, 23, -10936.32, 1023.38, 36.52, 0, ''),
+(467, 24, -10933.35, 1052.61, 35.85, 0, ''),
+(467, 25, -10940.25, 1077.66, 36.49, 0, ''),
+(467, 26, -10957.09, 1099.33, 36.83, 0, ''),
+(467, 27, -10956.53, 1119.90, 36.73, 0, ''),
+(467, 28, -10939.30, 1150.75, 37.42, 0, ''),
+(467, 29, -10915.14, 1202.09, 36.55, 0, ''),
+(467, 30, -10892.59, 1257.03, 33.37, 0, ''),
+(467, 31, -10891.93, 1306.66, 35.45, 0, ''),
+(467, 32, -10896.17, 1327.86, 37.77, 0, ''),
+(467, 33, -10906.03, 1368.05, 40.91, 0, ''),
+(467, 34, -10910.18, 1389.33, 42.62, 0, ''),
+(467, 35, -10915.42, 1417.72, 42.93, 0, ''),
+(467, 36, -10926.37, 1421.18, 43.04, 0, 'walk here and say'),
+(467, 37, -10952.31, 1421.74, 43.40, 0, ''),
+(467, 38, -10980.04, 1411.38, 42.79, 0, ''),
+(467, 39, -11006.06, 1420.47, 43.26, 0, ''),
+(467, 40, -11021.98, 1450.59, 43.09, 0, ''),
+(467, 41, -11025.36, 1491.59, 43.15, 0, ''),
+(467, 42, -11036.09, 1508.32, 43.28, 0, ''),
+(467, 43, -11060.68, 1526.72, 43.19, 0, ''),
+(467, 44, -11072.75, 1527.77, 43.20, 5000, 'say and quest credit');
+
+DELETE FROM script_waypoint WHERE entry=2768;
+INSERT INTO script_waypoint VALUES
+(2768, 0, -2066.45, -2085.96, 9.08, 0, ''),
+(2768, 1, -2077.99, -2105.33, 13.24, 0, ''),
+(2768, 2, -2074.60, -2109.67, 14.24, 0, ''),
+(2768, 3, -2076.60, -2117.46, 16.67, 0, ''),
+(2768, 4, -2073.51, -2123.46, 18.42, 2000, ''),
+(2768, 5, -2073.51, -2123.46, 18.42, 4000, ''),
+(2768, 6, -2066.60, -2131.85, 21.56, 0, ''),
+(2768, 7, -2053.85, -2143.19, 20.31, 0, ''),
+(2768, 8, -2043.49, -2153.73, 20.20, 10000, ''),
+(2768, 9, -2043.49, -2153.73, 20.20, 20000, ''),
+(2768, 10, -2043.49, -2153.73, 20.20, 10000, ''),
+(2768, 11, -2043.49, -2153.73, 20.20, 2000, ''),
+(2768, 12, -2053.85, -2143.19, 20.31, 0, ''),
+(2768, 13, -2066.60, -2131.85, 21.56, 0, ''),
+(2768, 14, -2073.51, -2123.46, 18.42, 0, ''),
+(2768, 15, -2076.60, -2117.46, 16.67, 0, ''),
+(2768, 16, -2074.60, -2109.67, 14.24, 0, ''),
+(2768, 17, -2077.99, -2105.33, 13.24, 0, ''),
+(2768, 18, -2066.45, -2085.96, 9.08, 0, ''),
+(2768, 19, -2066.41, -2086.21, 8.97, 6000, ''),
+(2768, 20, -2066.41, -2086.21, 8.97, 2000, '');
+
+DELETE FROM script_waypoint WHERE entry=12818;
+INSERT INTO script_waypoint VALUES
+(12818, 0, 3347.250089, -694.700989, 159.925995, 0, ''),
+(12818, 1, 3341.527039, -694.725891, 161.124542, 4000, ''),
+(12818, 2, 3338.351074, -686.088138, 163.444000, 0, ''),
+(12818, 3, 3352.744873, -677.721741, 162.316269, 0, ''),
+(12818, 4, 3370.291016, -669.366943, 160.751358, 0, ''),
+(12818, 5, 3381.479492, -659.449097, 162.545303, 0, ''),
+(12818, 6, 3389.554199, -648.500000, 163.651825, 0, ''),
+(12818, 7, 3396.645020, -641.508911, 164.216019, 0, ''),
+(12818, 8, 3410.498535, -634.299622, 165.773453, 0, ''),
+(12818, 9, 3418.461426, -631.791992, 166.477615, 0, ''),
+(12818, 10, 3429.500000, -631.588745, 166.921265, 0, ''),
+(12818, 11,3434.950195, -629.245483, 168.333969, 0, ''),
+(12818, 12,3438.927979, -618.503235, 171.503143, 0, ''),
+(12818, 13,3444.217529, -609.293640, 173.077972, 1000, 'Ambush 1'),
+(12818, 14,3460.505127, -593.794189, 174.342255, 0, ''),
+(12818, 15,3480.283203, -578.210327, 176.652313, 0, ''),
+(12818, 16,3492.912842, -562.335449, 181.396301, 0, ''),
+(12818, 17,3495.230957, -550.977600, 184.652267, 0, ''),
+(12818, 18,3496.247070, -529.194214, 188.172028, 0, ''),
+(12818, 19,3497.619385, -510.411499, 188.345322, 1000, 'Ambush 2'),
+(12818, 20,3498.498047, -497.787506, 185.806274, 0, ''),
+(12818, 21,3484.218750, -489.717529, 182.389862, 4000, '');
+
+DELETE FROM script_waypoint WHERE entry=12858;
+INSERT INTO script_waypoint VALUES
+(12858, 0, 1782.63, -2241.11, 109.73, 5000, ''),
+(12858, 1, 1788.88, -2240.17, 111.71, 0, ''),
+(12858, 2, 1797.49, -2238.11, 112.31, 0, ''),
+(12858, 3, 1803.83, -2232.77, 111.22, 0, ''),
+(12858, 4, 1806.65, -2217.83, 107.36, 0, ''),
+(12858, 5, 1811.81, -2208.01, 107.45, 0, ''),
+(12858, 6, 1820.85, -2190.82, 100.49, 0, ''),
+(12858, 7, 1829.60, -2177.49, 96.44, 0, ''),
+(12858, 8, 1837.98, -2164.19, 96.71, 0, 'prepare'),
+(12858, 9, 1839.99, -2149.29, 96.78, 0, ''),
+(12858, 10, 1835.14, -2134.98, 96.80, 0, ''),
+(12858, 11, 1823.57, -2118.27, 97.43, 0, ''),
+(12858, 12, 1814.99, -2110.35, 98.38, 0, ''),
+(12858, 13, 1806.60, -2103.09, 99.19, 0, ''),
+(12858, 14, 1798.27, -2095.77, 100.04, 0, ''),
+(12858, 15, 1783.59, -2079.92, 100.81, 0, ''),
+(12858, 16, 1776.79, -2069.48, 101.77, 0, ''),
+(12858, 17, 1776.82, -2054.59, 109.82, 0, ''),
+(12858, 18, 1776.88, -2047.56, 109.83, 0, ''),
+(12858, 19, 1776.86, -2036.55, 109.83, 0, ''),
+(12858, 20, 1776.90, -2024.56, 109.83, 0, 'win'),
+(12858, 21, 1776.87, -2028.31, 109.83,60000, 'stay'),
+(12858, 22, 1776.90, -2028.30, 109.83, 0, '');
+
+DELETE FROM script_waypoint WHERE entry=15420;
+INSERT INTO script_waypoint VALUES
+(15420, 0, 9294.78, -6682.51, 22.42, 0, ''),
+(15420, 1, 9298.27, -6667.99, 22.42, 0, ''),
+(15420, 2, 9309.63, -6658.84, 22.43, 0, ''),
+(15420, 3, 9304.43, -6649.31, 26.46, 0, ''),
+(15420, 4, 9298.83, -6648.00, 28.61, 0, ''),
+(15420, 5, 9291.06, -6653.46, 31.83,2500, ''),
+(15420, 6, 9289.08, -6660.17, 31.85,5000, ''),
+(15420, 7, 9291.06, -6653.46, 31.83, 0, '');
+
+DELETE FROM script_waypoint WHERE entry=16993;
+INSERT INTO script_waypoint VALUES
+(16993, 0, -1137.72, 4272.10, 14.04, 5000, ''),
+(16993, 1, -1141.34, 4232.42, 14.63, 0, ''),
+(16993, 2, -1133.47, 4220.88, 11.78, 0, ''),
+(16993, 3, -1126.18, 4213.26, 13.51, 0, ''),
+(16993, 4, -1100.12, 4204.32, 16.41, 0, ''),
+(16993, 5, -1063.68, 4197.92, 15.51, 0, ''),
+(16993, 6, -1027.28, 4194.36, 15.52, 0, ''),
+(16993, 7, -995.68, 4189.59, 19.84, 0, ''),
+(16993, 8, -970.90, 4188.60, 24.61, 0, ''),
+(16993, 9, -961.93, 4193.34, 26.11, 15000, 'Summon 1'),
+(16993, 10, -935.52, 4210.99, 31.98, 0, ''),
+(16993, 11, -913.42, 4218.27, 37.29, 0, ''),
+(16993, 12, -896.53, 4207.73, 43.23, 0, ''),
+(16993, 13, -868.49, 4194.77, 46.75, 30000, 'Kneel and Rest Here'),
+(16993, 14, -852.83, 4198.29, 47.28, 15000, 'Summon 2'),
+(16993, 15, -819.85, 4200.50, 46.37, 0, ''),
+(16993, 16, -791.92, 4201.96, 44.19, 0, ''),
+(16993, 17, -774.42, 4202.46, 47.41, 0, ''),
+(16993, 18, -762.90, 4202.17, 48.81, 0, ''),
+(16993, 19, -728.25, 4195.35, 50.68, 0, ''),
+(16993, 20, -713.58, 4192.07, 53.98, 0, ''),
+(16993, 21, -703.09, 4189.74, 56.96, 0, ''),
+(16993, 22, -693.70, 4185.43, 57.06, 0, ''),
+(16993, 23, -686.38, 4159.81, 60.26, 0, ''),
+(16993, 24, -679.88, 4147.04, 64.20, 0, ''),
+(16993, 25, -656.74, 4147.72, 64.11, 0, ''),
+(16993, 26, -652.22, 4137.50, 64.58, 0, ''),
+(16993, 27, -649.99, 4136.38, 64.63, 30000, 'Quest Credit');
+
+DELETE FROM script_waypoint WHERE entry=17312;
+INSERT INTO script_waypoint VALUES
+(17312, 0, -4784.532227, -11051.060547, 3.484263, 0, ''),
+(17312, 1, -4805.509277, -11037.293945, 3.043942, 0, ''),
+(17312, 2, -4827.826172, -11034.398438, 1.741959, 0, ''),
+(17312, 3, -4852.630859, -11033.695313, 2.208656, 0, ''),
+(17312, 4, -4876.791992, -11034.517578, 3.175228, 0, ''),
+(17312, 5, -4895.486816, -11038.306641, 9.390890, 0, ''),
+(17312, 6, -4915.464844, -11048.402344, 12.369793, 0, ''),
+(17312, 7, -4937.288086, -11067.041992, 13.857983, 0, ''),
+(17312, 8, -4966.577637, -11067.507813, 15.754786, 0, ''),
+(17312, 9, -4993.799805, -11056.544922, 19.175295, 0, ''),
+(17312, 10, -5017.836426, -11052.569336, 22.476587, 0, ''),
+(17312, 11, -5039.706543, -11058.459961, 25.831593, 0, ''),
+(17312, 12, -5057.289063, -11045.474609, 26.972496, 0, ''),
+(17312, 13, -5078.828125, -11037.601563, 29.053417, 0, ''),
+(17312, 14, -5104.158691, -11039.195313, 29.440195, 0, ''),
+(17312, 15, -5120.780273, -11039.518555, 30.142139, 0, ''),
+(17312, 16, -5140.833008, -11039.810547, 28.788074, 0, ''),
+(17312, 17, -5161.201660, -11040.050781, 27.879545, 4000, ''),
+(17312, 18, -5171.842285, -11046.803711, 27.183821, 0, ''),
+(17312, 19, -5185.995117, -11056.359375, 20.234867, 0, ''),
+(17312, 20, -5198.485840, -11065.065430, 18.872593, 0, ''),
+(17312, 21, -5214.062500, -11074.653320, 19.215731, 0, ''),
+(17312, 22, -5220.157227, -11088.377930, 19.818476, 0, ''),
+(17312, 23, -5233.652832, -11098.846680, 18.349432, 0, ''),
+(17312, 24, -5250.163086, -11111.653320, 16.438959, 0, ''),
+(17312, 25, -5268.194336, -11125.639648, 12.668313, 0, ''),
+(17312, 26, -5286.270508, -11130.669922, 6.912246, 0, ''),
+(17312, 27, -5317.449707, -11137.392578, 4.963446, 0, ''),
+(17312, 28, -5334.854492, -11154.384766, 6.742664, 0, ''),
+(17312, 29, -5353.874512, -11171.595703, 6.903912, 20000, ''),
+(17312, 30, -5354.240000, -11171.940000, 6.890000, 0, '');
+
+DELETE FROM script_waypoint WHERE entry=19685;
+INSERT INTO script_waypoint VALUES
+(19685, 0, -1863.369019, 5419.517090, -10.463668, 5000, ''),
+(19685, 1, -1861.749023, 5416.465332, -10.508068, 0, ''),
+(19685, 2, -1857.036133, 5410.966309, -12.428039, 0, ''),
+(19685, 3, -1831.539185, 5365.472168, -12.428039, 0, ''),
+(19685, 4, -1813.416504, 5333.776855, -12.428039, 0, ''),
+(19685, 5, -1800.354370, 5313.290039, -12.428039, 0, ''),
+(19685, 6, -1775.624878, 5268.786133, -38.809181, 0, ''),
+(19685, 7, -1770.147339, 5259.268066, -38.829231, 0, ''),
+(19685, 8, -1762.814209, 5261.098145, -38.848995, 0, ''),
+(19685, 9, -1740.110474, 5268.858398, -40.208965, 0, ''),
+(19685, 10, -1725.837402, 5270.936035, -40.208965, 0, ''),
+(19685, 11, -1701.580322, 5290.323242, -40.209187, 0, ''),
+(19685, 12, -1682.877808, 5291.406738, -34.429646, 0, ''),
+(19685, 13, -1670.101685, 5291.201172, -32.786007, 0, ''),
+(19685, 14, -1656.666870, 5294.333496, -37.862648, 0, ''),
+(19685, 15, -1652.035767, 5295.413086, -40.245499, 0, ''),
+(19685, 16, -1620.860596, 5300.133301, -40.208992, 0, ''),
+(19685, 17, -1607.630981, 5293.983398, -38.577045, 5000, ''),
+(19685, 18, -1607.630981, 5293.983398, -38.577045, 5000, ''),
+(19685, 19, -1607.630981, 5293.983398, -38.577045, 5000, ''),
+(19685, 20, -1622.140869, 5301.955566, -40.208897, 0, ''),
+(19685, 21, -1621.131836, 5333.112793, -40.208897, 0, ''),
+(19685, 22, -1637.598999, 5342.134277, -40.208790, 0, ''),
+(19685, 23, -1648.521606, 5352.309570, -47.496170, 0, ''),
+(19685, 24, -1654.606934, 5357.419434, -45.870892, 0, ''),
+(19685, 25, -1633.670044, 5422.067871, -42.835541, 0, ''),
+(19685, 26, -1656.567505, 5426.236328, -40.405815, 0, ''),
+(19685, 27, -1664.932373, 5425.686523, -38.846405, 0, ''),
+(19685, 28, -1681.406006, 5425.871094, -38.810928, 0, ''),
+(19685, 29, -1730.875977, 5427.413574, -12.427910, 0, ''),
+(19685, 30, -1743.509521, 5369.599121, -12.427910, 0, ''),
+(19685, 31, -1877.217041, 5303.710449, -12.427989, 0, ''),
+(19685, 32, -1890.371216, 5289.273438, -12.428268, 0, ''),
+(19685, 33, -1905.505737, 5266.534668, 2.630672, 0, ''),
+(19685, 34, -1909.381348, 5273.008301, 1.663714, 10000, ''),
+(19685, 35, -1909.381348, 5273.008301, 1.663714, 12000, ''),
+(19685, 36, -1909.381348, 5273.008301, 1.663714, 8000, ''),
+(19685, 37, -1909.381348, 5273.008301, 1.663714, 15000, ''),
+(19685, 38, -1927.561401, 5275.324707, 1.984987, 0, ''),
+(19685, 39, -1927.385498, 5300.879883, -12.427236, 0, ''),
+(19685, 40, -1921.063965, 5314.318359, -12.427236, 0, ''),
+(19685, 41, -1965.425415, 5379.298828, -12.427236, 0, ''),
+(19685, 42, -1981.233154, 5450.743652, -12.427236, 0, ''),
+(19685, 43, -1958.022461, 5455.904297, 0.487659, 0, ''),
+(19685, 44, -1951.991455, 5463.580566, 0.874490, 10000, ''),
+(19685, 45, -1951.991455, 5463.580566, 0.874490, 12000, ''),
+(19685, 46, -1968.730225, 5481.752930, -12.427846, 0, ''),
+(19685, 47, -1881.839844, 5554.040039, -12.427846, 0, ''),
+(19685, 48, -1841.566650, 5545.965332, -12.427846, 0, ''),
+(19685, 49, -1837.658325, 5523.780273, 0.558756, 0, ''),
+(19685, 50, -1831.321777, 5534.821777, 1.221819, 6000, ''),
+(19685, 51, -1831.321777, 5534.821777, 1.221819, 8000, ''),
+(19685, 52, -1831.321777, 5534.821777, 1.221819, 5000, ''),
+(19685, 53, -1850.060669, 5472.610840, 0.857320, 6000, ''),
+(19685, 54, -1850.060669, 5472.610840, 0.857320, 8000, ''),
+(19685, 55, -1850.060669, 5472.610840, 0.857320, 9000, ''),
+(19685, 56, -1850.060669, 5472.610840, 0.857320, 9000, ''),
+(19685, 57, -1850.060669, 5472.610840, 0.857320, 4000, '');
+
+DELETE FROM script_waypoint WHERE entry=20129;
+INSERT INTO script_waypoint VALUES
+(20129, 0, -8374.93,-4250.21, -204.38,5000, ''),
+(20129, 1, -8374.93,-4250.21, -204.38,16000, ''),
+(20129, 2, -8374.93,-4250.21, -204.38,10000, ''),
+(20129, 3, -8374.93,-4250.21, -204.38,2000, ''),
+(20129, 4, -8439.40,-4180.05, -209.25, 0, ''),
+(20129, 5, -8437.82,-4120.84, -208.59,10000, ''),
+(20129, 6, -8437.82,-4120.84, -208.59,16000, ''),
+(20129, 7, -8437.82,-4120.84, -208.59,13000, ''),
+(20129, 8, -8437.82,-4120.84, -208.59,18000, ''),
+(20129, 9, -8437.82,-4120.84, -208.59,15000, ''),
+(20129, 10, -8437.82,-4120.84, -208.59,2000, ''),
+(20129, 11, -8467.26,-4198.63, -214.21, 0, ''),
+(20129, 12, -8667.76,-4252.13, -209.56, 0, ''),
+(20129, 13, -8703.71,-4234.58, -209.5,14000, ''),
+(20129, 14, -8703.71,-4234.58, -209.5,2000, ''),
+(20129, 15, -8642.81,-4304.37, -209.57, 0, ''),
+(20129, 16, -8649.06,-4394.36, -208.46,6000, ''),
+(20129, 17, -8649.06,-4394.36, -208.46,18000, ''),
+(20129, 18, -8649.06,-4394.36, -208.46,2000, ''),
+(20129, 19, -8468.72,-4437.67, -215.45, 0, ''),
+(20129, 20, -8427.54,-4426, -211.13, 0, ''),
+(20129, 21, -8364.83,-4393.32, -205.91, 0, ''),
+(20129, 22, -8304.54,-4357.2, -208.2,18000, ''),
+(20129, 23, -8304.54,-4357.2, -208.2,2000, ''),
+(20129, 24, -8375.42,-4250.41, -205.14,5000, ''),
+(20129, 25, -8375.42,-4250.41, -205.14,5000, '');
+
+DELETE FROM script_waypoint WHERE entry=6575;
+INSERT INTO script_waypoint VALUES
+(6575, 0, 1945.81, -431.54, 16.36, 0, ''),
+(6575, 1, 1946.21, -436.41, 16.36, 0, ''),
+(6575, 2, 1950.01, -444.11, 14.63, 0, ''),
+(6575, 3, 1956.08, -449.34, 13.12, 0, ''),
+(6575, 4, 1966.59, -450.55, 11.27, 0, ''),
+(6575, 5, 1976.09, -447.51, 11.27, 0, ''),
+(6575, 6, 1983.42, -435.85, 11.27, 0, ''),
+(6575, 7, 1978.17, -428.81, 11.27, 0, ''),
+(6575, 8, 1973.97, -422.08, 9.04, 0, ''),
+(6575, 9, 1963.84, -418.90, 6.17, 0, ''),
+(6575, 10, 1961.22, -422.74, 6.17, 0, ''),
+(6575, 11, 1964.80, -431.26, 6.17, 300000, '');
+
+DELETE FROM script_waypoint WHERE entry=3849;
+INSERT INTO script_waypoint VALUES
+(3849, 0, -252.92, 2126.82, 81.17, 0, ''),
+(3849, 1, -253.88, 2131.11, 81.21, 0, ''),
+(3849, 2, -249.66, 2142.45, 87.01, 0, ''),
+(3849, 3, -248.08, 2143.68, 87.01, 0, ''),
+(3849, 4, -238.87, 2139.93, 87.01, 0, ''),
+(3849, 5, -235.47, 2149.18, 90.59, 0, ''),
+(3849, 6, -239.89, 2156.06, 90.62, 20000, 'SAY_FREE');
+
+DELETE FROM script_waypoint WHERE entry=3850;
+INSERT INTO script_waypoint VALUES
+(3850, 0, -255.33, 2117.99, 81.17, 0, ''),
+(3850, 1, -253.88, 2131.11, 81.21, 0, ''),
+(3850, 2, -249.66, 2142.45, 87.01, 0, ''),
+(3850, 3, -248.08, 2143.68, 87.01, 0, ''),
+(3850, 4, -238.87, 2139.93, 87.01, 0, ''),
+(3850, 5, -235.47, 2149.18, 90.59, 0, ''),
+(3850, 6, -239.89, 2156.06, 90.62, 20000, 'SAY_FREE');
+
+-- Henry Stern
+UPDATE `creature_template` SET `ScriptName`='npc_henry_stern' WHERE `entry`=8696;
+
+DELETE FROM `trinity_string` WHERE `entry` IN (59);
+INSERT INTO `trinity_string` VALUES
+(59,'Using creature EventAI: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2570_world_spell_linked_spell.sql b/sql/updates/2570_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..0d87bfc80e8
--- /dev/null
+++ b/sql/updates/2570_world_spell_linked_spell.sql
@@ -0,0 +1,9 @@
+INSERT IGNORE INTO `spell_linked_spell` VALUES (47988, 54501, 2, 'Consume Shadows - Rank 9');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (47987, 54501, 2, 'Consume Shadows - Rank 8');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (27272, 54501, 2, 'Consume Shadows - Rank 7');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17854, 54501, 2, 'Consume Shadows - Rank 6');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17853, 54501, 2, 'Consume Shadows - Rank 5');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17852, 54501, 2, 'Consume Shadows - Rank 4');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17851, 54501, 2, 'Consume Shadows - Rank 3');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17850, 54501, 2, 'Consume Shadows - Rank 2');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17767, 54501, 2, 'Consume Shadows - Rank 1'); \ No newline at end of file
diff --git a/sql/updates/2582_mangos_7644_01_characters_character_pet.sql b/sql/updates/2582_mangos_7644_01_characters_character_pet.sql
new file mode 100644
index 00000000000..c9713aeb4b5
--- /dev/null
+++ b/sql/updates/2582_mangos_7644_01_characters_character_pet.sql
@@ -0,0 +1,5 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7546_01_characters_uptime required_7644_01_characters_character_pet bit;*/
+
+/* only hunter pets must be in stable */
+UPDATE `character_pet`
+ SET slot = 100 WHERE PetType <> 1 AND slot >= 1 AND slot <= 4; \ No newline at end of file
diff --git a/sql/updates/2586_world_spell_linked_spell.sql b/sql/updates/2586_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..489fe7bdb75
--- /dev/null
+++ b/sql/updates/2586_world_spell_linked_spell.sql
@@ -0,0 +1,4 @@
+INSERT IGNORE INTO `spell_linked_spell` VALUES (53563, 53651, 2, 'Beacon of Light');
+
+INSERT INTO `spell_proc_event` VALUES
+(53651, 0x00, 10, 0xC0008000, 0x00000000, 0x00000000, 0x00000000, 0x0000000, 0.000000, 0.000000, 0);
diff --git a/sql/updates/2591_world_spell_linked_spell.sql b/sql/updates/2591_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..63da911d5a4
--- /dev/null
+++ b/sql/updates/2591_world_spell_linked_spell.sql
@@ -0,0 +1,6 @@
+INSERT IGNORE INTO `spell_linked_spell` VALUES (16857, 60089, 0, 'Faerie Fire (Feral) Rank 1');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17390, 60089, 0, 'Faerie Fire (Feral) Rank 2');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17391, 60089, 0, 'Faerie Fire (Feral) Rank 3');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (17392, 60089, 0, 'Faerie Fire (Feral) Rank 4');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (27011, 60089, 0, 'Faerie Fire (Feral) Rank 5');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (48475, 60089, 0, 'Faerie Fire (Feral) Rank 6');
diff --git a/sql/updates/2617_world_spell_linked_spell.sql b/sql/updates/2617_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..392893de6da
--- /dev/null
+++ b/sql/updates/2617_world_spell_linked_spell.sql
@@ -0,0 +1,7 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (781, 57635, 60932, 61507, 49576);
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(781, 56446, 0, 'Disengage'),
+(57635, 57636, 0, 'Disengage'),
+(60932, 60934, 0, 'Disengage'),
+(61507, 61508, 0, 'Disengage'),
+(49576, 49560, 0, 'Death Grip'); \ No newline at end of file
diff --git a/sql/updates/2629_world_spell_linked_spell.sql b/sql/updates/2629_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..be4609b7d5e
--- /dev/null
+++ b/sql/updates/2629_world_spell_linked_spell.sql
@@ -0,0 +1,2 @@
+INSERT IGNORE INTO `spell_linked_spell` VALUES (47897, 47960, 1, 'Shadowflame Rank 1');
+INSERT IGNORE INTO `spell_linked_spell` VALUES (61290, 61291, 1, 'Shadowflame Rank 2');
diff --git a/sql/updates/2678_mangos_7662_01_world_spell_bonus_data.sql b/sql/updates/2678_mangos_7662_01_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..7950f336812
--- /dev/null
+++ b/sql/updates/2678_mangos_7662_01_world_spell_bonus_data.sql
@@ -0,0 +1,6 @@
+/*ALTER TABLE db_version CHANGE COLUMN required_7662_01_mangos_spell_chain required_7662_02_mangos_spell_bonus_data bit;*/
+
+DELETE FROM `spell_bonus_data` WHERE entry IN (50288, 50294);
+INSERT INTO `spell_bonus_data` VALUES
+(50288, 0.05, 0, 0, "Druid - Starfall"),
+(50294, 0.012, 0, 0, "Druid - Starfall AOE"); \ No newline at end of file
diff --git a/sql/updates/2682_world_SD2_scripts.sql b/sql/updates/2682_world_SD2_scripts.sql
new file mode 100644
index 00000000000..39ac367d097
--- /dev/null
+++ b/sql/updates/2682_world_SD2_scripts.sql
@@ -0,0 +1,46 @@
+DELETE FROM script_waypoint WHERE entry=3849;
+INSERT INTO script_waypoint VALUES
+(3849, 0, -250.923431, 2116.264160, 81.179, 0, 'SAY_FREE_AD'),
+(3849, 1, -255.048538, 2119.392578, 81.179, 0, ''),
+(3849, 2, -254.129105, 2123.454346, 81.179, 0, ''),
+(3849, 3, -253.897552, 2130.873535, 81.179, 0, ''),
+(3849, 4, -249.889435, 2142.307861, 86.972, 0, ''),
+(3849, 5, -248.204926, 2144.017090, 87.013, 0, ''),
+(3849, 6, -240.552826, 2140.552734, 87.012, 0, ''),
+(3849, 7, -237.513916, 2142.066650, 87.012, 0, ''),
+(3849, 8, -235.638138, 2149.231689, 90.587, 0, ''),
+(3849, 9, -237.188019, 2151.946045, 90.624, 0, ''),
+(3849, 10, -241.162064, 2153.649658, 90.624, 0, 'SAY_OPEN_DOOR_AD'),
+(3849, 11, -241.129700, 2154.562988, 90.624, 5000, ''),
+(3849, 12, -241.129700, 2154.562988, 90.624, 5000, 'SAY_POST1_DOOR_AD'),
+(3849, 13, -241.129700, 2154.562988, 90.624, 25000, 'SAY_POST2_DOOR_AD');
+
+DELETE FROM script_waypoint WHERE entry=3850;
+INSERT INTO script_waypoint VALUES
+(3850, 0, -241.816895, 2122.904053, 81.179, 0, 'SAY_FREE_AS'),
+(3850, 1, -247.139297, 2124.886475, 81.179, 0, ''),
+(3850, 2, -253.179184, 2127.406738, 81.179, 0, ''),
+(3850, 3, -253.897552, 2130.873535, 81.179, 0, ''),
+(3850, 4, -249.889435, 2142.307861, 86.972, 0, ''),
+(3850, 5, -248.204926, 2144.017090, 87.013, 0, ''),
+(3850, 6, -240.552826, 2140.552734, 87.012, 0, ''),
+(3850, 7, -237.513916, 2142.066650, 87.012, 0, ''),
+(3850, 8, -235.638138, 2149.231689, 90.587, 0, ''),
+(3850, 9, -237.188019, 2151.946045, 90.624, 0, ''),
+(3850, 10, -241.162064, 2153.649658, 90.624, 0, 'SAY_OPEN_DOOR_AS'),
+(3850, 11, -241.129700, 2154.562988, 90.624, 5000, 'cast'),
+(3850, 12, -241.129700, 2154.562988, 90.624, 5000, 'SAY_POST_DOOR_AS'),
+(3850, 13, -241.129700, 2154.562988, 90.624, 25000, '');
+
+UPDATE script_texts SET content_default='Follow me and I\'ll open the courtyard door for you.', language=7, comment='prisoner ashcrombe SAY_FREE_AS' WHERE entry=-1033000;
+
+DELETE FROM script_texts WHERE entry BETWEEN -1033008 AND -1033001;
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1033001,'I have just the spell to get this door open. Too bad the cell doors weren\'t locked so haphazardly.',0,0,7,1,'prisoner ashcrombe SAY_OPEN_DOOR_AS'),
+(-1033002,'There it is! Wide open. Good luck to you conquering what lies beyond. I must report back to the Kirin Tor at once!',0,0,7,1,'prisoner ashcrombe SAY_POST_DOOR_AS'),
+(-1033003,'Free from this wretched cell at last! Let me show you to the courtyard....',0,0,1,1,'prisoner adamant SAY_FREE_AD'),
+(-1033004,'You are indeed courageous for wanting to brave the horrors that lie beyond this door.',0,0,1,1,'prisoner adamant SAY_OPEN_DOOR_AD'),
+(-1033005,'There we go!',0,0,1,1,'prisoner adamant SAY_POST1_DOOR_AD'),
+(-1033006,'Good luck with Arugal. I must hurry back to Hadrec now.',0,0,1,1,'prisoner adamant SAY_POST2_DOOR_AD'),
+(-1033007,'About time someone killed the wretch.',0,0,1,1,'prisoner adamant SAY_BOSS_DIE_AD'),
+(-1033008,'For once I agree with you... scum.',0,0,7,1,'prisoner ashcrombe SAY_BOSS_DIE_AS'); \ No newline at end of file
diff --git a/sql/updates/1358_characters.sql b/sql/updates/2683_characters_gm_tickets.sql
index 688e151b430..d7a668c4b89 100644
--- a/sql/updates/1358_characters.sql
+++ b/sql/updates/2683_characters_gm_tickets.sql
@@ -1 +1 @@
-ALTER TABLE `gm_tickets` ADD COLUMN `createtime` int(10) NOT NULL after `message`;
+ALTER TABLE `gm_tickets` ADD COLUMN `createtime` int(10) NOT NULL after `message`; \ No newline at end of file
diff --git a/sql/updates/1358_world.sql b/sql/updates/2683_world_trinity_string.sql
index ead79e05b61..856f105c535 100644
--- a/sql/updates/1358_world.sql
+++ b/sql/updates/2683_world_trinity_string.sql
@@ -1,3 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=2025;
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
-('2025','|cff00ff00Created|r:|cff00ccff %s ago|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+('2025','|cff00ff00Created|r:|cff00ccff %s ago|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file
diff --git a/sql/updates/2685_world_spell_proc_event.sql b/sql/updates/2685_world_spell_proc_event.sql
new file mode 100644
index 00000000000..9c4ea8c1d43
--- /dev/null
+++ b/sql/updates/2685_world_spell_proc_event.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (56337, 56336, 56333);
+INSERT INTO `spell_proc_event` VALUES
+(56337, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00022200, 0x0000000, 0.000000, 0.000000, 0),
+(56336, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00022200, 0x0000000, 0.000000, 0.000000, 0),
+(56333, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00022200, 0x0000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/1366_characters.sql b/sql/updates/2686_characters_gm_tickets.sql
index 8a8d61c2b91..11a1e1f1498 100644
--- a/sql/updates/1366_characters.sql
+++ b/sql/updates/2686_characters_gm_tickets.sql
@@ -1,4 +1,4 @@
ALTER TABLE `gm_tickets` ADD COLUMN `map` INT NOT NULL DEFAULT '0' AFTER `createtime`;
ALTER TABLE `gm_tickets` ADD COLUMN `posX` FLOAT NOT NULL DEFAULT '0' AFTER `map`;
ALTER TABLE `gm_tickets` ADD COLUMN `posY` FLOAT NOT NULL DEFAULT '0' AFTER `posX`;
-ALTER TABLE `gm_tickets` ADD COLUMN `posZ` FLOAT NOT NULL DEFAULT '0' AFTER `posY`;
+ALTER TABLE `gm_tickets` ADD COLUMN `posZ` FLOAT NOT NULL DEFAULT '0' AFTER `posY`; \ No newline at end of file
diff --git a/sql/updates/2686_world_command.sql b/sql/updates/2686_world_command.sql
new file mode 100644
index 00000000000..5d25225dfe4
--- /dev/null
+++ b/sql/updates/2686_world_command.sql
@@ -0,0 +1,3 @@
+DELETE FROM `command` WHERE `name` IN ('go ticket');
+INSERT INTO `command` VALUES
+('go ticket','1','Syntax: .go ticket #ticketid\r\nTeleports the user to the location where $ticketid was created.'); \ No newline at end of file
diff --git a/sql/updates/2687_world_spell_proc_event.sql b/sql/updates/2687_world_spell_proc_event.sql
new file mode 100644
index 00000000000..fd8960d2714
--- /dev/null
+++ b/sql/updates/2687_world_spell_proc_event.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (44545, 44543);
+INSERT INTO `spell_proc_event` VALUES
+(44545, 0x00, 3, 1049120, 4096, 0, 65536, 0x0000000, 0.000000, 15.000000, 0),
+(44543, 0x00, 3, 1049120, 4096, 0, 65536, 0x0000000, 0.000000, 7.000000, 0); \ No newline at end of file
diff --git a/sql/updates/2689_world_spell_linked_spell.sql b/sql/updates/2689_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..8e077e70f01
--- /dev/null
+++ b/sql/updates/2689_world_spell_linked_spell.sql
@@ -0,0 +1,2 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (51723);
+INSERT INTO `spell_linked_spell` VALUES (51723, 52874, 0, 'Fan Of Knives'); \ No newline at end of file
diff --git a/sql/updates/2702_world_spell_proc_event.sql b/sql/updates/2702_world_spell_proc_event.sql
new file mode 100644
index 00000000000..a887d590c54
--- /dev/null
+++ b/sql/updates/2702_world_spell_proc_event.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (56337, 56336, 56333);
+INSERT INTO `spell_proc_event` VALUES
+(56337, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00011100, 0x0000000, 0.000000, 0.000000, 0),
+(56336, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00011100, 0x0000000, 0.000000, 0.000000, 0),
+(56333, 0x00, 9, 0x00000004, 0x00000000, 0x00000200, 0x00011100, 0x0000000, 0.000000, 0.000000, 0);
diff --git a/sql/updates/2706_world_SD2_scripts.sql b/sql/updates/2706_world_SD2_scripts.sql
new file mode 100644
index 00000000000..71f97997461
--- /dev/null
+++ b/sql/updates/2706_world_SD2_scripts.sql
@@ -0,0 +1,4 @@
+UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
+DELETE FROM spell_target_position WHERE id=53360;
+INSERT INTO spell_target_position VALUES
+(53360, 571, 5807.829, 587.960, 660.939, 1.663); \ No newline at end of file
diff --git a/sql/updates/1362_world.sql b/sql/updates/2715_TC1_1362_world_creature_linked_respawn.sql
index a6d786871d6..52adffa7bd8 100644
--- a/sql/updates/1362_world.sql
+++ b/sql/updates/2715_TC1_1362_world_creature_linked_respawn.sql
@@ -7,4 +7,4 @@ CREATE TABLE `creature_linked_respawn` (
DELETE FROM `trinity_string` WHERE `entry` = '750';
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
-('750', 'linkGUID: %u, Entry: %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+('750', 'linkGUID: %u, Entry: %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); \ No newline at end of file
diff --git a/sql/updates/1371.sql b/sql/updates/2724_TC1_world_1371_script.sql
index 39dab9882d0..c101373eb4e 100644
--- a/sql/updates/1371.sql
+++ b/sql/updates/2724_TC1_world_1371_script.sql
@@ -1 +1 @@
-UPDATE `creature_template` SET `ScriptName` = 'mob_unkor_the_ruthless' WHERE `entry` = 18262;
+UPDATE `creature_template` SET `ScriptName` = 'mob_unkor_the_ruthless' WHERE `entry` = 18262; \ No newline at end of file
diff --git a/sql/updates/341_world.sql b/sql/updates/341_world.sql
deleted file mode 100644
index ba02fe06468..00000000000
--- a/sql/updates/341_world.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-TRUNCATE TABLE playercreateinfo_item;
-
diff --git a/sql/updates/679_world_scripts.sql b/sql/updates/679_world_scripts.sql
deleted file mode 100644
index 0d725f85003..00000000000
--- a/sql/updates/679_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_deathstalker_erland' where entry=1978;
-
diff --git a/sql/updates/683_world_scripts.sql b/sql/updates/683_world_scripts.sql
deleted file mode 100644
index 50ca23c380e..00000000000
--- a/sql/updates/683_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-update quest_template set specialflags=2 where entry=665;
-update creature_template set scriptname='npc_professor_phizzlethorpe' where entry=2768;
-
diff --git a/sql/updates/691_world_scripts.sql b/sql/updates/691_world_scripts.sql
deleted file mode 100644
index 47037e5e091..00000000000
--- a/sql/updates/691_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_earthmender_wilda' where entry=21027;
-
diff --git a/sql/updates/692_world.sql b/sql/updates/692_world.sql
deleted file mode 100644
index 5879d754ff7..00000000000
--- a/sql/updates/692_world.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-DELETE FROM `spell_proc_event` WHERE `entry` IN ('14144','14148');
-INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
-('14144','0','0','0','2','0','0','0','0'),
-('14148','0','0','0','2','0','0','0','0');
-DELETE FROM `spell_proc_event` WHERE entry = 38164;
-INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES
- (38164,0,0,0,0,1,0,0,60);
-
diff --git a/sql/updates/708_world_scripts.sql b/sql/updates/708_world_scripts.sql
deleted file mode 100644
index c218f610b31..00000000000
--- a/sql/updates/708_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-UPDATE `creature_template` SET `ScriptName` = 'boss_shirrak_the_dead_watcher' WHERE `entry` = '18371';
-UPDATE `creature_template` SET `ScriptName` = 'mob_focus_fire', `unit_flags` = '33554434' WHERE `entry` = '18374';
-
diff --git a/sql/updates/724_world.sql b/sql/updates/724_world.sql
deleted file mode 100644
index c3850bc114d..00000000000
--- a/sql/updates/724_world.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-ALTER TABLE custom_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language;
-ALTER TABLE eventai_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language;
-ALTER TABLE script_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language;
-
diff --git a/sql/updates/725_characters.sql b/sql/updates/725_characters.sql
deleted file mode 100644
index 193868e906a..00000000000
--- a/sql/updates/725_characters.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-ALTER TABLE `character_ticket` RENAME TO `gm_tickets`;
-ALTER TABLE gm_tickets CHANGE `guid` `playerGuid` int(11) unsigned NOT NULL default '0';
-ALTER TABLE gm_tickets CHANGE `ticket_id` `guid` int(11) unsigned NOT NULL default '0';
-ALTER TABLE gm_tickets CHANGE `ticket_text` `message` text(0) NOT NULL;
-ALTER TABLE gm_tickets CHANGE `ticket_lastchange` `timestamp` int(10) NOT NULL default '0';
-
diff --git a/sql/updates/725_world.sql b/sql/updates/725_world.sql
deleted file mode 100644
index 3141da90872..00000000000
--- a/sql/updates/725_world.sql
+++ /dev/null
@@ -1,31 +0,0 @@
-DELETE FROM `trinity_string` WHERE (`entry`='290');
-DELETE FROM `trinity_string` WHERE (`entry`='296');
-DELETE FROM `trinity_string` WHERE (`entry`='289');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2000, '|cff00ff00New ticket from|r|cffff00ff %s.|r |cff00ff00Ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2001, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00edited his/her ticket:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2002, '|cff00ff00Character|r|cffff00ff %s |r|cff00ff00abandoned ticket entry:|r|cffff00ff %d.|r', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2003, '|cffff00ff %s|r |cff00ff00closed ticket|r |cffff00ff %d.|r', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2004, 'Ticket %d permanently deleted by %s.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2005, 'Ticket not found.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2007, 'Please close ticket before deleting it permanently.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2008, 'Ticket %d is already assigned to GM %s.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2009, '%u Tickets succesfully reloaded from the database.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2010, 'Showing list of open tickets.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2011, 'Showing list of open tickets whose creator is online.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2012, 'Invalid name specified. Name should be that of an online Gamemaster.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2013, 'This ticket is already assigned to yourself. To unassign use .ticket unassign %d and then reassign.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2014, 'Ticket %d is not assigned, you cannot unassign it.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2015, 'You cannot unassign tickets from staffmembers with a higher security level than yourself.', '', '', '', '', '', '', '', '');
-INSERT INTO trinity_string (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (2016, 'Cannot close ticket %d, it is assigned to another GM.', '', '', '', '', '', '', '', '');
-DELETE FROM `command` WHERE (`name` LIKE '%ticket%');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket list','1','Displays a list of open GM tickets.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket onlinelist','1','Displays a list of open GM tickets whose owner is online.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket viewname','1','Usage: .ticket viewname $creatorname. \r\nReturns details about specified ticket. Ticket must be open and not deleted.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket viewid','1','Usage: .ticket viewid $ticketid.\r\nReturns details about specified ticket. Ticket must be open and not deleted.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket close','2','Usage: .ticket close $ticketid.\r\nCloses the specified ticket. Does not delete permanently.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket delete','3','Usage: .ticket delete $ticketid.\r\nDeletes the specified ticket permanently. Ticket must be closed first.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket assign','3','Usage: .ticket assign $ticketid $gmname.\r\nAssigns the specified ticket to the specified Game Master.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket unassign','3','Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.ticket comment','2','Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.');
-INSERT INTO `command` (`name`,`security`,`help`) VALUES ('.reload tickets','4','Usage: .reload tickets.\r\nReloads GM Tickets from the database and re-caches them into memory.');
-
diff --git a/sql/updates/728_world_scripts.sql b/sql/updates/728_world_scripts.sql
deleted file mode 100644
index 027af8ede16..00000000000
--- a/sql/updates/728_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_apprentice_mirveda' where entry=15402;
-
diff --git a/sql/updates/733_characters.sql b/sql/updates/733_characters.sql
deleted file mode 100644
index d966b131d5f..00000000000
--- a/sql/updates/733_characters.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE gm_tickets ADD `name` varchar(15) NOT NULL AFTER `playerGuid`;
-
diff --git a/sql/updates/739_characters.sql b/sql/updates/739_characters.sql
deleted file mode 100644
index 96c5c597a84..00000000000
--- a/sql/updates/739_characters.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE gm_tickets ADD `comment` text(0) NOT NULL;
-
diff --git a/sql/updates/748_world_scripts.sql b/sql/updates/748_world_scripts.sql
deleted file mode 100644
index a9e079ec9e9..00000000000
--- a/sql/updates/748_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-update creature_template set scriptname='npc_infused_crystal', flags_extra=0 where entry=16364;
-delete from creature where id=17086;
-
diff --git a/sql/updates/758_world_scripts.sql b/sql/updates/758_world_scripts.sql
deleted file mode 100644
index cbb2a783264..00000000000
--- a/sql/updates/758_world_scripts.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-delete from creature_template_addon where entry = 17225;
-update creature_template set scriptname = 'boss_nightbane', unit_flags=0 where entry = 17225;
-delete from event_scripts where id = 10951;
-insert into event_scripts values
-(10951,0,10,17651,180000,0,-11159,-1907.22,91.48,0);
-
diff --git a/sql/updates/764_world_scripts.sql b/sql/updates/764_world_scripts.sql
deleted file mode 100644
index fb1d3a924c8..00000000000
--- a/sql/updates/764_world_scripts.sql
+++ /dev/null
@@ -1,124 +0,0 @@
-DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533039 AND -1533000;
-INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
-(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'),
- (-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'),
- (-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'),
- (-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'),
- (-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'),
- (-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'),
- (-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'),
- (-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'),
- (-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'),
- (-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'),
- (-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'),
- (-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'),
- (-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'),
- (-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'),
- (-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'),
- (-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'),
- (-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'),
- (-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'),
- (-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'),
- (-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'),
- (-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'),
- (-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'),
- (-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'),
- (-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'),
- (-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'),
- (-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'),
- (-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'),
- (-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'),
- (-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'),
- (-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'),
- (-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'),
- (-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'),
- (-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'),
- (-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'),
- (-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'),
- (-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'),
- (-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'),
- (-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'),
- (-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'),
- (-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4');
-
-DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040;
- INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
- (-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'),
- (-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'),
- (-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'),
- (-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'),
- (-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'),
- (-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'),
- (-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'),
- (-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'),
- (-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'),
- (-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'),
- (-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'),
- (-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'),
- (-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'),
- (-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'),
- (-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'),
- (-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'),
- (-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'),
- (-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'),
- (-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'),
- (-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'),
- (-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'),
- (-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'),
- (-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'),
- (-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'),
- (-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'),
- (-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'),
- (-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'),
- (-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'),
- (-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'),
- (-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'),
- (-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'),
- (-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'),
- (-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'),
- (-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'),
- (-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH');
-
-UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062;
-UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549;
-
-DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075;
- INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
- (-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'),
- (-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'),
- (-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'),
- (-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'),
- (-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'),
- (-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'),
- (-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'),
- (-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'),
- (-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'),
- (-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'),
- (-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
- (-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'),
- (-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
- (-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'),
- (-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'),
- (-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'),
- (-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'),
- (-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'),
- (-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'),
- (-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'),
- (-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'),
- (-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'),
- (-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'),
- (-1533098,'<Kel\'Thuzad cackles maniacally!>',14479,1,0,'kelthuzad SAY_SLAY2'),
- (-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'),
- (-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'),
- (-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'),
- (-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'),
- (-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'),
- (-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'),
- (-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'),
- (-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'),
- (-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'),
- (-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL');
-
- UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055;
- UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056;
-
diff --git a/sql/updates/789_world.sql b/sql/updates/789_world.sql
deleted file mode 100644
index 43e6bdc42d2..00000000000
--- a/sql/updates/789_world.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE eventai_texts DROP COLUMN emote;
-
diff --git a/sql/updates/805_world_scripts.sql b/sql/updates/805_world_scripts.sql
new file mode 100644
index 00000000000..743984d3ad0
--- /dev/null
+++ b/sql/updates/805_world_scripts.sql
@@ -0,0 +1,123 @@
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533039 AND -1533000;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'),
+(-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'),
+(-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'),
+(-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'),
+(-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'),
+(-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'),
+(-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'),
+(-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'),
+(-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'),
+(-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'),
+(-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'),
+(-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'),
+(-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'),
+(-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'),
+(-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'),
+(-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'),
+(-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'),
+(-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'),
+(-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'),
+(-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'),
+(-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'),
+(-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'),
+(-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'),
+(-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'),
+(-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'),
+(-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'),
+(-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'),
+(-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'),
+(-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'),
+(-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'),
+(-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'),
+(-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'),
+(-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'),
+(-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'),
+(-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'),
+(-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'),
+(-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'),
+(-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'),
+(-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'),
+(-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'),
+(-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'),
+(-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'),
+(-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'),
+(-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'),
+(-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'),
+(-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'),
+(-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'),
+(-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'),
+(-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'),
+(-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'),
+(-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'),
+(-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'),
+(-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'),
+(-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'),
+(-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'),
+(-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'),
+(-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'),
+(-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'),
+(-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'),
+(-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'),
+(-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'),
+(-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'),
+(-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'),
+(-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'),
+(-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'),
+(-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'),
+(-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'),
+(-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'),
+(-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'),
+(-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'),
+(-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'),
+(-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'),
+(-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'),
+(-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH');
+
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062;
+UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549;
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'),
+(-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'),
+(-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'),
+(-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'),
+(-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'),
+(-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'),
+(-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'),
+(-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'),
+(-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'),
+(-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'),
+(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
+(-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'),
+(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
+(-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'),
+(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'),
+(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'),
+(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'),
+(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'),
+(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'),
+(-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'),
+(-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'),
+(-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'),
+(-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'),
+(-1533098,'<Kel\'Thuzad cackles maniacally!>',14479,1,0,'kelthuzad SAY_SLAY2'),
+(-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'),
+(-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'),
+(-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'),
+(-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'),
+(-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'),
+(-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'),
+(-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'),
+(-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'),
+(-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'),
+(-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL');
+
+UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055;
+UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056; \ No newline at end of file
diff --git a/sql/updates/807_world_scripts.sql b/sql/updates/807_world_scripts.sql
deleted file mode 100644
index ee512619ee1..00000000000
--- a/sql/updates/807_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_isla_starmane' where entry=18760;
-
diff --git a/sql/updates/822_world_scripts.sql b/sql/updates/822_world_scripts.sql
deleted file mode 100644
index 117971d18a7..00000000000
--- a/sql/updates/822_world_scripts.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-update creature_template set scriptname='npc_kayra_longmane' where entry=17969;
-delete from creature_template_addon where entry=17969;
-update quest_template set specialflags=2 where entry=9752;
-
diff --git a/sql/updates/826_world_scripts.sql b/sql/updates/826_world_scripts.sql
deleted file mode 100644
index 7dc2cf77afa..00000000000
--- a/sql/updates/826_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-UPDATE `creature_template` SET `ScriptName` = 'npc_ruul_snowhoof' WHERE `entry` = 12818;
-
diff --git a/sql/updates/833_world_scripts.sql b/sql/updates/833_world_scripts.sql
deleted file mode 100644
index b8aed954f43..00000000000
--- a/sql/updates/833_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-update creature_template set scriptname='npc_dirty_larry', unit_flags=0, flags_extra=0 where entry=19720;
-update creature_template set unit_flags=0, flags_extra=0 where entry in (19726, 19725);
-
diff --git a/sql/updates/837_world_scripts.sql b/sql/updates/837_world_scripts.sql
deleted file mode 100644
index 810bd3510e0..00000000000
--- a/sql/updates/837_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_khadgar' where entry=18166;
-
diff --git a/sql/updates/838_world_scripts.sql b/sql/updates/838_world_scripts.sql
deleted file mode 100644
index 1ff400dc8c5..00000000000
--- a/sql/updates/838_world_scripts.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-delete from spell_script_target where entry=42222;
-insert into `spell_script_target` values
-('42222','1','23616');
-update `creature_template` set `scriptname`='npc_kyle_frenzied' where `entry`='23616';
-
diff --git a/sql/updates/839_world_scripts.sql b/sql/updates/839_world_scripts.sql
deleted file mode 100644
index 448cd44ca1e..00000000000
--- a/sql/updates/839_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_wizzlecrank_shredder' where entry=3439;
-
diff --git a/sql/updates/840_world_scripts.sql b/sql/updates/840_world_scripts.sql
deleted file mode 100644
index 8a334a578e1..00000000000
--- a/sql/updates/840_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-UPDATE `creature_template` SET `spell1` = 0, `flags_extra` = 0, `ScriptName` = 'npc_volcano' WHERE `entry` = 23085;
-
diff --git a/sql/updates/841_world_scripts.sql b/sql/updates/841_world_scripts.sql
deleted file mode 100644
index dac0cbd9857..00000000000
--- a/sql/updates/841_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_greengill_slave' where entry=25084;
-
diff --git a/sql/updates/850_world_scripts.sql b/sql/updates/850_world_scripts.sql
deleted file mode 100644
index e830d53f933..00000000000
--- a/sql/updates/850_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-UPDATE creature_template SET ScriptName = 'npc_bessy' WHERE entry = 20415;
-
diff --git a/sql/updates/852_world_scripts.sql b/sql/updates/852_world_scripts.sql
deleted file mode 100644
index 3fcdfc1f3c9..00000000000
--- a/sql/updates/852_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-update creature_template set scriptname='mob_nestlewood_owlkin' where entry=16518;
-update item_template set scriptname='item_inoculating_crystal' where entry=22962;
-
diff --git a/sql/updates/857_world_scripts.sql b/sql/updates/857_world_scripts.sql
deleted file mode 100644
index 78452693d44..00000000000
--- a/sql/updates/857_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_kaya_flathoof' where entry=11856;
-
diff --git a/sql/updates/875_mangos_7047_01_characters_character_spell.sql b/sql/updates/875_mangos_7047_01_characters_character_spell.sql
new file mode 100644
index 00000000000..b74900cfdba
--- /dev/null
+++ b/sql/updates/875_mangos_7047_01_characters_character_spell.sql
@@ -0,0 +1,10 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_6976_02_characters_character_db_version required_7047_01_characters_character_spell bit;*/
+
+DELETE FROM `character_spell` WHERE `spell` IN ('28880', 59542, 59543, 59544, 59545, 59547, 59548);
+INSERT INTO character_spell SELECT characters.guid as guid, 28880, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 1;
+INSERT INTO character_spell SELECT characters.guid as guid, 59542, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 2;
+INSERT INTO character_spell SELECT characters.guid as guid, 59543, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 3;
+INSERT INTO character_spell SELECT characters.guid as guid, 59544, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 5;
+INSERT INTO character_spell SELECT characters.guid as guid, 59545, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 6;
+INSERT INTO character_spell SELECT characters.guid as guid, 59547, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 7;
+INSERT INTO character_spell SELECT characters.guid as guid, 59548, 1, 0 FROM `characters` WHERE characters.race=11 AND characters.class = 8; \ No newline at end of file
diff --git a/sql/updates/875_mangos_7059_01_characters_pet_spell.sql b/sql/updates/875_mangos_7059_01_characters_pet_spell.sql
new file mode 100644
index 00000000000..11f1063ebc3
--- /dev/null
+++ b/sql/updates/875_mangos_7059_01_characters_pet_spell.sql
@@ -0,0 +1,4 @@
+/*ALTER TABLE character_db_version CHANGE COLUMN required_7059_01_characters_character_spell required_7059_02_characters_pet_spell bit;*/
+
+ALTER TABLE pet_spell
+ DROP slot; \ No newline at end of file
diff --git a/sql/updates/919_world.sql b/sql/updates/919_world.sql
deleted file mode 100644
index 5febe1ebdfc..00000000000
--- a/sql/updates/919_world.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE version
- ADD `core_revision` BIGINT UNSIGNED AFTER `core_version`;
-
diff --git a/sql/updates/933_world_scripts.sql b/sql/updates/933_world_scripts.sql
deleted file mode 100644
index 0918e8f1e9e..00000000000
--- a/sql/updates/933_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname='npc_snake_trap_serpents' where entry in (19921, 19833);
-
diff --git a/sql/updates/935_world_scripts.sql b/sql/updates/935_world_scripts.sql
deleted file mode 100644
index 5027cafa234..00000000000
--- a/sql/updates/935_world_scripts.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-DELETE FROM `creature` WHERE `id` = '17653';
-
-UPDATE `gameobject_template` SET `flags` = '4' WHERE `entry` IN ('181766','181823');
-UPDATE `gameobject` SET `SpawnMask` = '3',`state` = '1' WHERE `id` IN ('181766','181823');
-
-UPDATE `instance_template` SET `script` = 'instance_blood_furnace' WHERE `map` = '542';
-
diff --git a/sql/updates/940_world_scripts.sql b/sql/updates/940_world_scripts.sql
deleted file mode 100644
index a7f78170c35..00000000000
--- a/sql/updates/940_world_scripts.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE custom_texts CHANGE COLUMN emote emote smallint(5) unsigned NOT NULL DEFAULT '0';
-ALTER TABLE script_texts CHANGE COLUMN emote emote smallint(5) unsigned NOT NULL DEFAULT '0';
-
diff --git a/sql/updates/973_world_scripts.sql b/sql/updates/973_world_scripts.sql
deleted file mode 100644
index 35261fc7b02..00000000000
--- a/sql/updates/973_world_scripts.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-update creature_template set scriptname = 'npc_enraged_spirit' where entry in (21050, 21061, 21060, 21059);
-
diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt
index 8c89628da25..2300dd5c5f3 100644
--- a/sql/updates/CMakeLists.txt
+++ b/sql/updates/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_subdirectory(2.4.3_updates)
+
FILE(GLOB _SQL_UPDATES *.sql)
INSTALL(FILES
diff --git a/sql/world.sql b/sql/world.sql
index 36328704193..f11a5ca0411 100644
--- a/sql/world.sql
+++ b/sql/world.sql
@@ -2,7 +2,7 @@
--
-- Host: localhost Database: world
-- ------------------------------------------------------
--- Server version 5.0.34-log
+-- Server version 5.0.56-nt
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -41,10 +41,10 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `areatrigger_scripts`;
CREATE TABLE `areatrigger_scripts` (
- `entry` mediumint(8) NOT NULL,
- `ScriptName` char(64) NOT NULL,
- PRIMARY KEY (`entry`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ `entry` MEDIUMINT( 8 ) NOT NULL ,
+ `ScriptName` CHAR( 64 ) NOT NULL ,
+ PRIMARY KEY ( `entry` )
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `areatrigger_scripts`
@@ -155,6 +155,15 @@ CREATE TABLE `battleground_template` (
LOCK TABLES `battleground_template` WRITE;
/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */;
+INSERT INTO `battleground_template` VALUES
+(1,0,0,0,0,611,2.72532,610,2.27452),
+(2,0,0,0,0,769,3.14159,770,3.14159),
+(4,0,2,10,70,929,0,936,3.14159),
+(3,0,0,0,0,890,3.40156,889,0.263892),
+(5,0,2,10,70,939,0,940,3.14159),
+(6,0,2,10,70,0,0,0,0),
+(7,0,0,0,0,1103,3.40156,1104,0.263892),
+(8,0,2,10,70,1258,0,1259,3.14159);
/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */;
UNLOCK TABLES;
@@ -196,6 +205,252 @@ CREATE TABLE `command` (
LOCK TABLES `command` WRITE;
/*!40000 ALTER TABLE `command` DISABLE KEYS */;
+INSERT INTO `command` VALUES
+('account',0,'Syntax: .account\r\n\r\nDisplay the access level of your account.'),
+('account create',4,'Syntax: .account create $account $password\r\n\r\nCreate account and set password to it.'),
+('account delete',4,'Syntax: .account delete $account\r\n\r\nDelete account with all characters.'),
+('account onlinelist',4,'Syntax: .account onlinelist\r\n\r\nShow list of online accounts.'),
+('account set addon',3,'Syntax: .account set addon [$account] #addon\r\n\r\nSet user (posible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
+('account set gmlevel',4,'Syntax: .account set gmlevel [$account] #level\r\n\r\nSet the security level for targeted player (can''t be used at self) or for account $name to a level of #level.\r\n\r\n#level may range from 0 to 3.'),
+('account set password',4,'Syntax: .account set password $account $password $password\r\n\r\nSet password for account.'),
+('additem',3,'Syntax: .additem #itemid/[#itemname]/#shift-click-item-link #itemcount\r\n\r\nAdds the specified number of items of id #itemid (or exact (!) name $itemname in brackets, or link created by shift-click at item in inventory or recipe) to your or selected character inventory. If #itemcount is omitted, only one item will be added.\r\n.'),
+('additemset',3,'Syntax: .additemset #itemsetid\r\n\r\nAdd items from itemset of id #itemsetid to your or selected character inventory. Will add by one example each item from itemset.'),
+('addmove',2,'Syntax: .addmove #creature_guid [#waittime]\r\n\r\nAdd your current location as a waypoint for creature with guid #creature_guid. And optional add wait time.'),
+('announce',1,'Syntax: .announce $MessageToBroadcast\r\n\r\nSend a global message to all players online in chat log.'),
+('aura',3,'Syntax: .aura #spellid\r\n\r\nAdd the aura from spell #spellid to the selected Unit.'),
+('ban account',3,'Syntax is: ban account $Name $bantime $reason\r\nBan account kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban character',3,'Syntax is: ban character $Name $bantime $reason\r\nBan account and kick player.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('ban ip',3,'Syntax is: ban ip $Ip $bantime $reason\r\nBan IP.\r\n$bantime: negative value leads to permban, otherwise use a timestring like \"4d20h3s\".'),
+('baninfo account',3,'Syntax is: baninfo account\r\nWatch full information about a specific ban.'),
+('baninfo character',3,'Syntax is: baninfo character\r\nWatch full information about a specific ban.'),
+('baninfo ip',3,'Syntax is: baninfo ip\r\nWatch full information about a specific ban.'),
+('bank',3,'Syntax: .bank\r\n\r\nShow your bank inventory.'),
+('banlist account',3,'Syntax is: banlist account [$Name]\r\nSearches the banlist for a account name pattern or show full list account bans.'),
+('banlist character',3,'Syntax is: banlist character $Name\r\nSearches the banlist for a character name pattern. Pattern required.'),
+('banlist ip',3,'Syntax is: banlist ip [$Ip]\r\nSearches the banlist for a IP pattern or show full list of IP bans.'),
+('cast',3,'Syntax: .cast #spellid [triggered]\r\n Cast #spellid to selected target. If no target selected cast to self. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast back',3,'Syntax: .cast back #spellid [triggered]\r\n Selected target will cast #spellid to your character. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast dist',3,'Syntax: .cast dist #spellid [#dist [triggered]]\r\n You will cast spell to pint at distance #dist. If \'trigered\' or part provided then spell casted with triggered flag. Not all spells can be casted as area spells.'),
+('cast self',3,'Syntax: .cast self #spellid [triggered]\r\nCast #spellid by target at target itself. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('cast target',3,'Syntax: .cast target #spellid [triggered]\r\n Selected target will cast #spellid to his victim. If \'trigered\' or part provided then spell casted with triggered flag.'),
+('chardelete',4,'Syntax: .chardelete $charactername\r\n\r\nDelete character.'),
+('combatstop',2,'Syntax: .combatstop [$playername]\r\nStop combat for selected character. If selected non-player then command applied to self. If $playername provided then attempt applied to online player $playername.'),
+('commands',0,'Syntax: .commands\r\n\r\nDisplay a list of available commands for your account level.'),
+('cooldown',3,'Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or you (if no selection).'),
+('damage',3,'Syntax: .damage $damage_amount [$school [$spellid]]\r\n\r\nApply $damage to target. If not $school and $spellid provided then this flat clean melee damage without any modifiers. If $school provided then damage modified by armor reduction (if school physical), and target absorbing modifiers and result applied as melee damage to target. If spell provided then damage modified and applied as spell damage. $spellid can be shift-link.'),
+('debug anim',2,'Syntax: .debug anim #emoteid\r\n\r\nPlay emote #emoteid for your character.'),
+('debug getvalue',3,'Syntax: .debug getvalue #field #isInt\r\n\r\nGet the field #field of the selected creature. If no creature is selected, get the content of your field.\r\n\r\nUse a #isInt of value 1 if the expected field content is an integer.'),
+('debug playsound',1,'Syntax: .debug playsound #soundid\r\n\r\nPlay sound with #soundid.\r\nSound will be play only for you. Other players do not hear this.\r\nWarning: client may have more 5000 sounds...'),
+('debug setvalue',3,'Syntax: .debug setvalue #field #value #isInt\r\n\r\nSet the field #field of the selected creature with value #value. If no creature is selected, set the content of your field.\r\n\r\nUse a #isInt of value 1 if #value is an integer.'),
+('debug standstate',2,'Syntax: .debug standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'),
+('debug update',3,'Syntax: .debug update #field #value\r\n\r\nUpdate the field #field of the selected character or creature with value #value.\r\n\r\nIf no #value is provided, display the content of field #field.'),
+('delticket',2,'Syntax: .delticket all\r\n .delticket #num\r\n .delticket $character_name\r\n\rall to dalete all tickets at server, $character_name to delete ticket of this character, #num to delete ticket #num.'),
+('demorph',2,'Syntax: .demorph\r\n\r\nDemorph the selected player.'),
+('die',3,'Syntax: .die\r\n\r\nKill the selected player. If no player is selected, it will kill you.'),
+('dismount',0,'Syntax: .dismount\r\n\r\nDismount you, if you are mounted.'),
+('distance',3,'Syntax: .distance\r\n\r\nDisplay the distance from your character to the selected creature.'),
+('event',2,'Syntax: .event #event_id\r\nShow details about event with #event_id.'),
+('event activelist',2,'Syntax: .event activelist\r\nShow list of currently active events.'),
+('event start',2,'Syntax: .event start #event_id\r\nStart event #event_id. Set start time for event to current moment (change not saved in DB).'),
+('event stop',2,'Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'),
+('explorecheat',3,'Syntax: .explorecheat #flag\r\n\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),
+('flusharenapoints','3','Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'),
+('gm',1,'Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'),
+('gm chat',1,'Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'),
+('gm fly',3,'Syntax: .gm fly on/off\r\nEnable/disable gm fly mode.'),
+('gm ingame',0,'Syntax: .gm ingame\r\n\r\nDisplay a list of available in game Game Masters.'),
+('gm list',3,'Syntax: .gm list\r\n\r\nDisplay a list of all Game Masters accounts and security levels.'),
+('gm online',0,'Syntax: .gm online\r\n\r\nDisplay a list of available Game Masters.'),
+('gm visible',1,'Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'),
+('go creature',2,'Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),
+('go graveyard',2,'Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),
+('go grid',1,'Syntax: .go grid #gridX #gridY [#mapId]\r\n\r\nTeleport the gm to center of grid with provided indexes at map #mapId (or current map if it not provided).'),
+('go object',1,'Syntax: .go object #object_guid\r\nTeleport your character to gameobject with guid #object_guid'),
+('go trigger',2,'Syntax: .go trigger #trigger_id\r\n\r\nTeleport your character to areatrigger with id #trigger_id. Character will be teleported to trigger target if selected areatrigger is telporting trigger.'),
+('go xy',1,'Syntax: .go xy #x #y [#mapid]\r\n\r\nTeleport player to point with (#x,#y) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),
+('go xyz',1,'Syntax: .go xyz #x #y #z [#mapid]\r\n\r\nTeleport player to point with (#x,#y,#z) coordinates at ground(water) level at map #mapid or same map if #mapid not provided.'),
+('go zonexy',1,'Syntax: .go zonexy #x #y [#zone]\r\n\r\nTeleport player to point with (#x,#y) client coordinates at ground(water) level in zone #zoneid or current zone if #zoneid not provided. You can look up zone using .lookup area $namepart'),
+('gobject add',2,'Syntax: .gobject add #id <spawntimeSecs>\r\n\r\nAdd a game object from game object templates to the world at your current location using the #id.\r\nspawntimesecs sets the spawntime, it is optional.\r\n\r\nNote: this is a copy of .gameobject.'),
+('gobject delete',2,'Syntax: .gobject delete #go_guid\r\nDelete gameobject with guid #go_guid.'),
+('gobject move',2,'Syntax: .gobject move #goguid [#x #y #z]\r\n\r\nMove gameobject #goguid to character coordinates (or to (#x,#y,#z) coordinates if its provide).'),
+('gobject near ',3,'Syntax: .gobject near [#distance]\r\n\r\nOutput gameobjects at distance #distance from player. Output gameobject guids and coordinates sorted by distance from character. If #distance not provided use 10 as default value.'),
+('gobject turn',2,'Syntax: .gobject turn #goguid \r\n\r\nSet for gameobject #goguid orientation same as current character orientation.'),
+('gobject target',2,'Syntax: .gobject target [#go_id|#go_name_part]\r\n\r\nLocate and show position nearest gameobject. If #go_id or #go_name_part provide then locate and show position of nearest gameobject with gameobject template id #go_id or name included #go_name_part as part.'),
+('goname',1,'Syntax: .goname $charactername\r\n\r\nTeleport to the given character. Either specify the character name or click on the character\'s portrait, e.g. when you are in a group.'),
+('gps',1,'Syntax: .gps\r\n\r\nDisplay the position information for a selected character or creature. Position information includes X, Y, Z, and orientation, map Id and zone Id'),
+('groupgo',1,'Syntax: .groupgo $charactername\r\n\r\nTeleport the given character and his group to you.'),
+('guid',2,'Syntax: .guid\r\n\r\nDisplay the GUID for the selected character.'),
+('guild create',2,'Syntax: .guild create $GuildLeaderName $GuildName\r\n\r\nCreate a guild named $GuildName with the player $GuildLeaderName as leader.'),
+('guild delete',2,'Syntax: .guild delete $GuildName\r\n\r\nDelete guild $GuildName.'),
+('guild invite',2,'Syntax: .guild invite $CharacterName $GuildName\r\n\r\nAdd $CharacterName into a guild $GuildName.'),
+('guild rank',2,'Syntax: .guild rank $CharacterName #Rank\r\n\r\nSet for $CharacterName rank #Rank in a guild.'),
+('guild uninvite',2,'Syntax: .guild uninvite $CharacterName\r\n\r\nRemove $CharacterName from a guild.'),
+('help',0,'Syntax: .help [$command]\r\n\r\nDisplay usage instructions for the given $command. If no $command provided show list available commands.'),
+('hidearea',3,'Syntax: .hidearea #areaid\r\n\r\nHide the area of #areaid to the selected character. If no character is selected, hide this area to you.'),
+('honor add',2,'Syntax: .honor add $amount\r\n\r\nAdd a certain amount of honor (gained today) to the selected player.'),
+('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),
+('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),
+('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),
+('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected player\'s binds will be cleared.'),
+('instance listbinds',3,'Syntax: .instance listbinds\r\n Lists the binds of the selected player.'),
+('instance stats',3,'Syntax: .instance stats\r\n Shows statistics about instances.'),
+('instance savedata',3,'Syntax: .instance savedata\r\n Save the InstanceData for the current player\'s map to the DB.'),
+('itemmove',2,'Syntax: .itemmove #sourceslotid #destinationslotid\r\n\r\nMove an item from slots #sourceslotid to #destinationslotid in your inventory\r\n\r\nNot yet implemented'),
+('kick',2,'Syntax: .kick [$charactername]\r\n\r\nKick the given character name from the world. If no character name is provided then the selected player (except for yourself) will be kicked.'),
+('learn',3,'Syntax: .learn #parameter\r\n\r\nSelected character learn a spell of id #parameter.'),
+('learn all',3,'Syntax: .learn all\r\n\r\nLearn all big set different spell maybe useful for Administaror.'),
+('learn all_crafts',2,'Syntax: .learn crafts\r\n\r\nLearn all professions and recipes.'),
+('learn all_default',1,'Syntax: .learn all_default [$playername]\r\n\r\nLearn for selected/$playername player all default spells for his race/class and spells rewarded by completed quests.'),
+('learn all_gm',2,'Syntax: .learn all_gm\r\n\r\nLearn all default spells for Game Masters.'),
+('learn all_lang',1,'Syntax: .learn all_lang\r\n\r\nLearn all languages'),
+('learn all_myclass',3,'Syntax: .learn all_myclass\r\n\r\nLearn all spells and talents available for his class.'),
+('learn all_myspells',3,'Syntax: .learn all_myspells\r\n\r\nLearn all spells (except talents and spells with first rank learned as talent) available for his class.'),
+('learn all_mytalents',3,'Syntax: .learn all_mytalents\r\n\r\nLearn all talents (and spells with first rank learned as talent) available for his class.'),
+('learn all_recipes',2,'Syntax: .learn all_recipes [$profession]\r\rLearns all recipes of specified profession and sets skill level to max.\rExample: .learn all_recipes enchanting'),
+('levelup',3,'Syntax: .levelup [$playername] [#numberoflevels]\r\n\r\nIncrease/decrease the level of character with $playername (or the selected if not name provided) by #numberoflevels Or +1 if no #numberoflevels provided). If #numberoflevels is omitted, the level will be increase by 1. If #numberoflevels is 0, the same level will be restarted. If no character is selected and name not provided, increase your level. Command can be used for offline character. All stats and dependent VALUESrecalculated. At level decrease talents can be reset if need. Also at level decrease equipped items with greater level requirement can be lost.'),
+('linkgrave',3,'Syntax: .linkgrave #graveyard_id [alliance|horde]\r\n\r\nLink current zone to graveyard for any (or alliance/horde faction ghosts). This let character ghost from zone teleport to graveyard after die if graveyard is nearest from linked to zone and accept ghost of this faction. Add only single graveyard at another map and only if no graveyards linked (or planned linked at same map).'),
+('list creature',3,'Syntax: .list creature #creature_id [#max_count]\r\n\r\nOutput creatures with creature id #creature_id found in world. Output creature guids and coordinates sorted by distance from character. Will be output maximum #max_count creatures. If #max_count not provided use 10 as default value.'),
+('list item',3,'Syntax: .list item #item_id [#max_count]\r\n\r\nOutput items with item id #item_id found in all character inventories, mails, auctions, and guild banks. Output item guids, item owner guid, owner account and owner name (guild name and guid in case guild bank). Will be output maximum #max_count items. If #max_count not provided use 10 as default value.'),
+('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),
+('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),
+('lockaccount',0,'Syntax: .lockaccount [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'),
+('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),
+('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),
+('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'),
+('lookup faction',3,'Syntax: .lookup faction $name\r\nAttempts to find the ID of the faction with the provided $name.'),
+('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'),
+('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'),
+('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'),
+('lookup player account',2,'Syntax : .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),
+('lookup player ip',2,'Syntax : .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),
+('lookup player email',2,'Syntax : .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),
+('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'),
+('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'),
+('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),
+('lookup tele',1,'Syntax: .lookup tele $substring\r\n\r\nSearch and output all .tele command locations with provide $substring in name.'),
+('maxskill',3,'Syntax: .maxskill\r\nSets all skills of the targeted player to their maximum VALUESfor its current level.'),
+('Mod32Value',3,'Syntax: .Mod32Value #field #value\r\n\r\nAdd #value to field #field of your character.'),
+('modify arena',3,'Syntax: .modify arena #value\r\nAdd $amount arena points to the selected player.'),
+('modify aspeed',1,'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to \"normalbase speed for this move type\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify bit',1,'Syntax: .modify bit #field #bit\r\n\r\nToggle the #bit bit of the #field field for the selected player. If no player is selected, modify your character.'),
+('modify bwalk',1,'Syntax: .modify bwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to \"normal walk back speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify drunk',1,'Syntax: .modify drunk #value\r\n Set drunk level to #value (0..100). Value 0 remove drunk state, 100 is max drunked state.'),
+('modify energy',1,'Syntax: .modify energy #energy\r\n\r\nModify the energy of the selected player. If no player is selected, modify your energy.'),
+('modify faction',1,'Syntax: .modify faction #factionid #flagid #npcflagid #dynamicflagid\r\n\r\nModify the faction and flags of the selected creature. Without arguments, display the faction and flags of the selected creature.'),
+('modify gender',2,'Syntax: .modify gender male/female\r\n\r\nChange gender of selected player.'),
+('modify honor',1,'Syntax: .modify honor $amount\r\n\r\nAdd $amount honor points to the selected player.'),
+('modify hp',1,'Syntax: .modify hp #newhp\r\n\r\nModify the hp of the selected player. If no player is selected, modify your hp.'),
+('modify mana',1,'Syntax: .modify mana #newmana\r\n\r\nModify the mana of the selected player. If no player is selected, modify your mana.'),
+('modify money',1,'Syntax:\r\n.modify money #money\r\n.money #money\r\n\r\nAdd or remove money to the selected player. If no player is selected, modify your money.\r\n\r\n #gold can be negative to remove money.'),
+('modify morph',2,'Syntax: .modify morph #displayid\r\n\r\nChange your current model id to #displayid.'),
+('modify mount',1,'Syntax:\r\n.modify mount #id #speed\r\nDisplay selected player as mounted at #id creature and set speed to #speed value.'),
+('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'),
+('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.'),
+('modify scale',1,''),
+('modify speed',1,'Syntax:\r\n.modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify spell',1,''),
+('modify swim',1,'Syntax: .modify swim #rate\r\n\r\nModify the swim speed of the selected player to \"normal swim speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 10.'),
+('modify titles',1,'Syntax:\r\n.modify titles #mask\r\n\r\nAllows user to use all titles from #mask.\r\n\r\n #mask=0 disables the title-choose-field'),
+('movegens',3,'Syntax: .movegens\r\n Show movement generators stack for selected creature or player.'),
+('mute',1,'Syntax: .mute $playerName $timeInMinutes\r\n\r\nDisible chat messaging for any character from account of character $playerName at $timeInMinutes minutes.'),
+('namego',1,'Syntax: .namego $charactername\r\n\r\nTeleport the given character to you.'),
+('neargrave',3,'Syntax: .neargrave [alliance|horde]\r\n\r\nFind nearest graveyard linked to zone (or only nearest from accepts alliance or horde faction ghosts).'),
+('notify',1,'Syntax: .notify $MessageToBroadcast\r\n\r\nSend a global message to all players online in screen.'),
+('npc add',2,'Syntax: .npc add #creatureid\r\n\r\nSpawn a creature by the given template id of #creatureid.'),
+('npc additem',2,'Syntax: .npc additem #itemId <#maxcount><#incrtime><#extendedcost>r\r\n\r\nAdd item #itemid to item list of selected vendor. Also optionally set max count item in vendor item list and time to item count restoring and items ExtendedCost.'),
+('npc addweapon',3,'Not yet implemented.'),
+('npc allowmove',3,'Syntax: .npc allowmove\r\n\r\nEnable or disable movement for the selected creature.'),
+('npc changelevel',2,'Syntax: .npc changelevel #level\r\n\r\nChange the level of the selected creature to #level.\r\n\r\n#level may range from 1 to 63.'),
+('npc delete',2,'Syntax: .npc delete [#guid]\r\n\r\nDelete creature with guid #guid (or the selected if no guid is provided)'),
+('npc delitem',2,'Syntax: .npc delitem #itemId\r\n\r\nRemove item #itemid from item list of selected vendor.'),
+('npc factionid',2,'Syntax: .npc factionid #factionid\r\n\r\nSet the faction of the selected creature to #factionid.'),
+('npc flag',2,'Syntax: .npc flag #npcflag\r\n\r\nSet the NPC flags of creature template of the selected creature and selected creature to #npcflag. NPC flags will applied to all creatures of selected creature template after server restart or grid unload/load.'),
+('npc follow',2,'Syntax: .npc follow\r\n\r\nSelected creature start follow you until death/fight/etc.'),
+('npc info',3,'Syntax: .npc info\r\n\r\nDisplay a list of details for the selected creature.\r\n\r\nThe list includes:\r\n- GUID, Faction, NPC flags, Entry ID, Model ID,\r\n- Level,\r\n- Health (current/maximum),\r\n\r\n- Field flags, dynamic flags, faction template, \r\n- Position information,\r\n- and the creature type, e.g. if the creature is a vendor.'),
+('npc move',2,'Syntax: .npc move [#creature_guid]\r\n\r\nMove the targeted creature spawn point to your coordinates.'),
+('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),
+('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),
+('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),
+('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),
+('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),
+('npc spawntime',2,'Syntax: .npc spawntime #time \r\n\r\nAdjust spawntime of selected creature to time.'),
+('npc subname',2,'Syntax: .npc subname $Name\r\n\r\nChange the subname of the selected creature or player to $Name.\r\n\r\nCommand disabled.'),
+('npc tame',2,'Syntax: .npc tame\r\n\r\nTame selected creature (tameable non pet creature). You don''t must have pet.'),
+('npc textemote',3,'Syntax: .npc textemote #emoteid\r\n\r\nMake the selected creature to do textemote with an emote of id #emoteid.'),
+('npc whisper',1,'Syntax: .npc whisper #playerguid #text\r\nMake the selected npc whisper #text to #playerguid.'),
+('npc unfollow',2,'Syntax: .npc unfollow\r\n\r\nSelected creature (non pet) stop follow you.'),
+('password',0,'Syntax: .password $old_password $new_password $new_password\r\n\r\nChange your account password.'),
+('pdump write',3,'Syntax is: pdump write $filename $playerNameOrGUID\r\nWrite character dump with name/guid $playerNameOrGUID to file $filename.'),
+('pdump load',3,'Syntax is: pdump load $filename $account [$newname] [$newguid]\r\nLoad character dump from dump file into character list of $account with saved or $newname, with saved (or first free) or $newguid guid.'),
+('pinfo',2,'Syntax: .pinfo [$player_name] [rep]\r\n\r\nOutput account information for selected player or player find by $player_name. If \"rep\" parameter provided show reputation information for player.'),
+('plimit',3,'Syntax: .plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'),
+('quest add',3,'Syntax: .quest add #quest_id\r\n\r\nAdd to character quest log quest #quest_id. Quest started from item can\'t be added by this command but correct .additem call provided in command output.'),
+('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'),
+('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'),
+('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'),
+('reload',3,'Syntax: .reload table_name\r\n\r\nReload table `table_name` if reload support added for this table and this table can be _safe_ reloaded.'),
+('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'),
+('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'),
+('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),
+('reload all_quest',3,'Syntax: .reload all_quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'),
+('reload all_spell',3,'Syntax: .reload all_spell\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'),
+('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'),
+('reload config',3,'Syntax: .reload config\r\n\r\nReload config settings (by default stored in mangosd.conf). Not all settings can be change at reload: some new setting values will be ignored until restart, some values will applied with delay or only to new objects/maps, some values will explicitly rejected to change at reload.'),
+('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'),
+('reset all',3,'Syntax: .reset all spells\r\n\r\nSyntax: .reset all talents\r\n\r\nRequest reset spells or talents at next login each existed character.'),
+('reset honor',3,'Syntax:\r\n.reset honor [Playername]\r\n Reset all honor data for targeted character.'),
+('reset level',3,'Syntax:\r\n.reset level [Playername]\r\n Reset level to 1 including reset stats and talents. Equipped items with greater level requirement can be lost.'),
+('reset spells',3,'Syntax:\r\n.reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'),
+('reset stats',3,'Syntax:\r\n.reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'),
+('reset talents',3,'Syntax:\r\n.reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'),
+('respawn',3,'Syntax: .respawn\r\n\r\nRespawn selected creature or respawn all nearest creatures (if none selected) and GO without waiting respawn time expiration.'),
+('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'),
+('save',0,'Syntax: .save\r\n\r\nSaves your character.'),
+('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'),
+('senditems',3,'Syntax: .senditems #playername "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]\r\n\r\nSend a mail to a player. Subject and mail text must be in "". If for itemid not provided related count values then expected 1, if count > max items in stack then items will be send in required amount stacks. All stacks amount in mail limited to 12.'),
+('sendmail',1,'Syntax: .sendmail #playername "#subject" "#text"\r\n\r\nSend a mail to a player. Subject and mail text must be in "".'),
+('sendmoney','3','Syntax: .sendmoney #playername "#subject" "#text" #money\r\n\r\nSend mail with money to a player. Subject and mail text must be in "".'),
+('sendmessage',3,'Syntax: .sendmessage $playername $message\r\n\r\nSend screen message to player from ADMINISTRATOR.'),
+('server corpses',2,'Syntax: .server corpses\r\n\r\nTriggering corpses expire check in world.'),
+('server exit',4,'Syntax: .server exit\r\n\r\nTerminate mangosd NOW. Exit code 0.'),
+('server info',0,'Syntax: .server info\r\n\r\nDisplay server version and the number of connected players.'),
+('server idleshutdown',3,'Syntax: .server idleshutdown #delay [#exist_code]\r\n\r\nShut the server down after #delay seconds if no active connections are present (no players). Use #exist_code or 0 as program exist code.'),
+('server idleshutdown cancel',3,'Syntax: .server idleshutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server idlerestart',3,'Syntax: .server idlerestart #delay\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players). Use #exist_code or 2 as program exist code.'),
+('server idlerestart cancel',3,'Syntax: .server idlerestart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server motd',0,'Syntax: .server motd\r\n\r\nShow server Message of the day.'),
+('server restart',3,'Syntax: .server restart #delay\r\n\r\nRestart the server after #delay seconds. Use #exist_code or 2 as program exist code.'),
+('server restart cancel',3,'Syntax: .server restart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server set closed',3,'Syntax: server set closed on/off\r\n\r\nSets whether the world accepts new client connectsions.'),
+('server set loglevel',4,'Syntax: .server set loglevel #level\r\n\r\nSet server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'),
+('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.'),
+('server shutdown',3,'Syntax: .server shutdown #delay [#exist_code]\r\n\r\nShut the server down after #delay seconds. Use #exist_code or 0 as program exist code.'),
+('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),
+('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),
+('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),
+('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),
+('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),
+('tele add',3,'Syntax: .tele add $name\r\n\r\nAdd current your position to .tele command target locations list with name $name.'),
+('tele del',3,'Syntax: .tele del $name\r\n\r\nRemove location with name $name for .tele command locations list.'),
+('tele group',1,'Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),
+('tele name',1,'Syntax: .tele name #playername #location\r\n\r\nTeleport a player to a given location.'),
+('ticket',2,'Syntax: .ticket on\r\n .ticket off\r\n .ticket #num\r\n .ticket $character_name\r\n\r\non/off for GMs to show or not a new ticket directly, $character_name to show ticket of this character, #num to show ticket #num.'),
+('unaura',3,'Syntax: .unaura #spellid\r\n\r\nRemove aura due to spell #spellid from the selected Unit.'),
+('unban account',3,'Syntax is: unban account $Name\r\nUnban accounts for account name pattern.'),
+('unban character',3,'Syntax is: unban character $Name\r\nUnban accounts for character name pattern.'),
+('unban ip',3,'Syntax is: unban ip $Ip\r\nUnban accounts for IP pattern.'),
+('unlearn',3,'Syntax: .unlearn #startspell #endspell\r\n\r\nUnlearn for selected player the range of spells between id #startspell and #endspell. If no #endspell is provided, just unlearn spell of id #startspell.'),
+('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'),
+('waterwalk',2,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.'),
+('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'),
+('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'),
+('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'),
+('wp add',2,'Syntax: .wp add [#creature_guid or Select a Creature]'),
+('wp export',3,'Syntax: .wp export [#creature_guid or Select a Creature] $filename'),
+('wp import',3,'Syntax: .wp import $filename'),
+('wp modify',2,'Syntax: .wp modify [#creature_guid or Select a Creature]\r\nadd - Add a waypoint after the selected visual\r\nwaittime $time\r\nemote ID\r\nspell ID\r\ntext1| text2| text3| text4| text5 <text>\r\nmodel1 ID\r\nmodel2 ID\r\nmove(moves wp to player pos)\r\ndel (deletes the wp)\r\n\r\nOnly one parameter per time!'),
+('wp show',2,'Syntax: .wp show [#creature_guid or Select a Creature]\r\non\r\nfirst\r\nlast\r\noff\r\ninfo\r\n\r\nFor using info you have to do first show on and than select a Visual-Waypoint and do the show info!');
/*!40000 ALTER TABLE `command` ENABLE KEYS */;
UNLOCK TABLES;
@@ -224,7 +479,7 @@ CREATE TABLE `creature` (
`MovementType` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`guid`),
KEY `idx_map` (`map`),
- KEY `idx_id` (`id`)
+ KEY `index_id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System';
--
@@ -242,7 +497,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `creature_addon`;
CREATE TABLE `creature_addon` (
- `guid` int(10) unsigned NOT NULL default '0',
+ `guid` int(11) unsigned NOT NULL default '0',
`path_id` int(11) unsigned NOT NULL default '0',
`mount` mediumint(8) unsigned NOT NULL default '0',
`bytes0` int(10) unsigned NOT NULL default '0',
@@ -252,7 +507,7 @@ CREATE TABLE `creature_addon` (
`moveflags` int(10) unsigned NOT NULL default '0',
`auras` text,
PRIMARY KEY (`guid`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `creature_addon`
@@ -270,15 +525,9 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `creature_equip_template`;
CREATE TABLE `creature_equip_template` (
`entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Unique entry',
- `equipmodel1` mediumint(8) unsigned NOT NULL default '0',
- `equipmodel2` mediumint(8) unsigned NOT NULL default '0',
- `equipmodel3` mediumint(8) unsigned NOT NULL default '0',
- `equipinfo1` int(10) unsigned NOT NULL default '0',
- `equipinfo2` int(10) unsigned NOT NULL default '0',
- `equipinfo3` int(10) unsigned NOT NULL default '0',
- `equipslot1` int(11) NOT NULL default '0',
- `equipslot2` int(11) NOT NULL default '0',
- `equipslot3` int(11) NOT NULL default '0',
+ `equipentry1` mediumint(8) unsigned NOT NULL default '0',
+ `equipentry2` mediumint(8) unsigned NOT NULL default '0',
+ `equipentry3` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)';
@@ -350,7 +599,7 @@ CREATE TABLE `creature_loot_template` (
`condition_value1` mediumint(8) unsigned NOT NULL default '0',
`condition_value2` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`,`item`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System';
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
--
-- Dumping data for table `creature_loot_template`
@@ -479,7 +728,7 @@ CREATE TABLE `creature_template` (
`faction_A` smallint(5) unsigned NOT NULL default '0',
`faction_H` smallint(5) unsigned NOT NULL default '0',
`npcflag` int(10) unsigned NOT NULL default '0',
- `speed` float default '1',
+ `speed` float NOT NULL default '1',
`scale` float NOT NULL default '1',
`rank` tinyint(3) unsigned NOT NULL default '0',
`mindmg` float NOT NULL default '0',
@@ -488,7 +737,7 @@ CREATE TABLE `creature_template` (
`attackpower` int(10) unsigned NOT NULL default '0',
`baseattacktime` int(10) unsigned NOT NULL default '0',
`rangeattacktime` int(10) unsigned NOT NULL default '0',
- `flags` int(10) unsigned NOT NULL default '0',
+ `unit_flags` int(10) unsigned NOT NULL default '0',
`dynamicflags` int(10) unsigned NOT NULL default '0',
`family` tinyint(4) NOT NULL default '0',
`trainer_type` tinyint(4) NOT NULL default '0',
@@ -499,7 +748,7 @@ CREATE TABLE `creature_template` (
`maxrangedmg` float NOT NULL default '0',
`rangedattackpower` smallint(5) unsigned NOT NULL default '0',
`type` tinyint(3) unsigned NOT NULL default '0',
- `flag1` int(10) unsigned NOT NULL default '0',
+ `type_flags` int(10) unsigned NOT NULL default '0',
`lootid` mediumint(8) unsigned NOT NULL default '0',
`pickpocketloot` mediumint(8) unsigned NOT NULL default '0',
`skinloot` mediumint(8) unsigned NOT NULL default '0',
@@ -525,8 +774,7 @@ CREATE TABLE `creature_template` (
`mechanic_immune_mask` int(10) unsigned NOT NULL default '0',
`flags_extra` int(10) unsigned NOT NULL default '0',
`ScriptName` char(64) NOT NULL default '',
- PRIMARY KEY (`entry`),
- KEY `idx_name` (`name`)
+ PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System';
--
@@ -535,6 +783,8 @@ CREATE TABLE `creature_template` (
LOCK TABLES `creature_template` WRITE;
/*!40000 ALTER TABLE `creature_template` DISABLE KEYS */;
+INSERT INTO `creature_template` VALUES
+(1,1,10045,0,10045,0,'Waypoint(Only GM can see it)','Visual',NULL,1,1,64,64,0,0,0,35,35,0,0.91,1,0,14,15,0,100,2000,2200,4096,0,8,0,0,0,0,1.76,2.42,100,8,5242886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,3,0,1,0,0,0x82,'');
/*!40000 ALTER TABLE `creature_template` ENABLE KEYS */;
UNLOCK TABLES;
@@ -636,7 +886,7 @@ CREATE TABLE `event_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
- `datatext` text NOT NULL,
+ `dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
`z` float NOT NULL default '0',
@@ -795,6 +1045,78 @@ CREATE TABLE `exploration_basexp` (
LOCK TABLES `exploration_basexp` WRITE;
/*!40000 ALTER TABLE `exploration_basexp` DISABLE KEYS */;
+INSERT INTO `exploration_basexp` VALUES
+(0,0),
+(1,5),
+(2,15),
+(3,25),
+(4,35),
+(5,45),
+(6,55),
+(7,65),
+(8,70),
+(9,80),
+(10,85),
+(11,90),
+(12,90),
+(13,90),
+(14,100),
+(15,105),
+(16,115),
+(17,125),
+(18,135),
+(19,145),
+(20,155),
+(21,165),
+(22,175),
+(23,185),
+(24,195),
+(25,200),
+(26,210),
+(27,220),
+(28,230),
+(29,240),
+(30,245),
+(31,250),
+(32,255),
+(33,265),
+(34,270),
+(35,275),
+(36,280),
+(37,285),
+(38,285),
+(39,300),
+(40,315),
+(41,330),
+(42,345),
+(43,360),
+(44,375),
+(45,390),
+(46,405),
+(47,420),
+(48,440),
+(49,455),
+(50,470),
+(51,490),
+(52,510),
+(53,530),
+(54,540),
+(55,560),
+(56,580),
+(57,600),
+(58,620),
+(59,640),
+(60,660),
+(61,970),
+(62,1000),
+(63,1050),
+(64,1080),
+(65,1100),
+(66,1130),
+(67,1160),
+(68,1200),
+(69,1230),
+(70,1250);
/*!40000 ALTER TABLE `exploration_basexp` ENABLE KEYS */;
UNLOCK TABLES;
@@ -814,7 +1136,7 @@ CREATE TABLE `fishing_loot_template` (
`condition_value1` mediumint(8) unsigned NOT NULL default '0',
`condition_value2` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`,`item`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System';
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
--
-- Dumping data for table `fishing_loot_template`
@@ -1252,7 +1574,7 @@ CREATE TABLE `gameobject_loot_template` (
`condition_value1` mediumint(8) unsigned NOT NULL default '0',
`condition_value2` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`,`item`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System';
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
--
-- Dumping data for table `gameobject_loot_template`
@@ -1316,7 +1638,7 @@ CREATE TABLE `gameobject_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
- `datatext` text NOT NULL,
+ `dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
`z` float NOT NULL default '0',
@@ -1371,8 +1693,7 @@ CREATE TABLE `gameobject_template` (
`data22` int(10) unsigned NOT NULL default '0',
`data23` int(10) unsigned NOT NULL default '0',
`ScriptName` varchar(64) NOT NULL default '',
- PRIMARY KEY (`entry`),
- KEY `idx_name` (`name`)
+ PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System';
--
@@ -1409,6 +1730,33 @@ CREATE TABLE `instance_template` (
LOCK TABLES `instance_template` WRITE;
/*!40000 ALTER TABLE `instance_template` DISABLE KEYS */;
+INSERT INTO `instance_template` VALUES
+(33,0,22,30,10,7200,NULL,NULL,NULL,NULL,''),
+(34,0,24,32,10,7200,NULL,NULL,NULL,NULL,''),
+(36,0,15,20,10,7200,NULL,NULL,NULL,NULL,''),
+(43,0,15,21,10,7200,NULL,NULL,NULL,NULL,''),
+(47,0,29,38,10,7200,NULL,NULL,NULL,NULL,''),
+(48,0,24,32,10,7200,NULL,NULL,NULL,NULL,''),
+(70,0,35,47,10,7200,NULL,NULL,NULL,NULL,''),
+(90,0,29,38,10,7200,NULL,NULL,NULL,NULL,''),
+(109,0,45,55,10,7200,NULL,NULL,NULL,NULL,''),
+(129,0,37,46,10,7200,NULL,NULL,NULL,NULL,''),
+(189,0,34,45,10,7200,NULL,NULL,NULL,NULL,''),
+(209,0,44,54,10,7200,NULL,NULL,NULL,NULL,''),
+(229,0,58,0,10,120000,78.5083,-225.044,49.839,5.1,''),
+(230,0,52,0,5,7200,NULL,NULL,NULL,NULL,''),
+(249,0,60,0,40,432000,NULL,NULL,NULL,NULL,''),
+(289,0,57,0,5,7200,NULL,NULL,NULL,NULL,''),
+(309,0,60,0,20,259200,NULL,NULL,NULL,NULL,''),
+(329,0,58,60,5,7200,NULL,NULL,NULL,NULL,''),
+(349,0,46,55,10,7200,NULL,NULL,NULL,NULL,''),
+(389,0,13,18,10,7200,NULL,NULL,NULL,NULL,''),
+(409,0,60,0,40,604800,NULL,NULL,NULL,NULL,''),
+(429,0,55,60,5,7200,NULL,NULL,NULL,NULL,''),
+(469,0,60,0,40,604800,NULL,NULL,NULL,NULL,''),
+(509,0,60,0,20,259200,NULL,NULL,NULL,NULL,''),
+(531,0,60,0,40,604800,NULL,NULL,NULL,NULL,''),
+(533,0,60,0,40,604800,NULL,NULL,NULL,NULL,'');
/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1444,7 +1792,7 @@ CREATE TABLE `item_loot_template` (
`ChanceOrQuestChance` float NOT NULL default '100',
`groupid` tinyint(3) unsigned NOT NULL default '0',
`mincountOrRef` mediumint(9) NOT NULL default '1',
- `maxcount` smallint(5) unsigned NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
`lootcondition` tinyint(3) unsigned NOT NULL default '0',
`condition_value1` mediumint(8) unsigned NOT NULL default '0',
`condition_value2` mediumint(8) unsigned NOT NULL default '0',
@@ -1492,6 +1840,7 @@ CREATE TABLE `item_template` (
`maxcount` smallint(5) unsigned NOT NULL default '0',
`stackable` smallint(5) unsigned NOT NULL default '1',
`ContainerSlots` tinyint(3) unsigned NOT NULL default '0',
+ `StatsCount` tinyint(3) unsigned NOT NULL default '0',
`stat_type1` tinyint(3) unsigned NOT NULL default '0',
`stat_value1` smallint(6) NOT NULL default '0',
`stat_type2` tinyint(3) unsigned NOT NULL default '0',
@@ -1512,6 +1861,8 @@ CREATE TABLE `item_template` (
`stat_value9` smallint(6) NOT NULL default '0',
`stat_type10` tinyint(3) unsigned NOT NULL default '0',
`stat_value10` smallint(6) NOT NULL default '0',
+ `ScalingStatDistribution` smallint(6) NOT NULL default '0',
+ `ScalingStatValue` smallint(6) NOT NULL default '0',
`dmg_min1` float NOT NULL default '0',
`dmg_max1` float NOT NULL default '0',
`dmg_type1` tinyint(3) unsigned NOT NULL default '0',
@@ -1589,7 +1940,7 @@ CREATE TABLE `item_template` (
`area` mediumint(8) unsigned NOT NULL default '0',
`Map` smallint(6) NOT NULL default '0',
`BagFamily` mediumint(9) NOT NULL default '0',
- `TotemCategory` tinyint(4) NOT NULL default '0',
+ `TotemCategory` mediumint(9) NOT NULL default '0',
`socketColor_1` tinyint(4) NOT NULL default '0',
`socketContent_1` mediumint(9) NOT NULL default '0',
`socketColor_2` tinyint(4) NOT NULL default '0',
@@ -1600,14 +1951,14 @@ CREATE TABLE `item_template` (
`GemProperties` mediumint(9) NOT NULL default '0',
`RequiredDisenchantSkill` smallint(6) NOT NULL default '-1',
`ArmorDamageModifier` float NOT NULL default '0',
+ `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time',
+ `ItemLimitCategory` smallint(6) NOT NULL default '0',
`ScriptName` varchar(64) NOT NULL default '',
`DisenchantID` mediumint(8) unsigned NOT NULL default '0',
`FoodType` tinyint(3) unsigned NOT NULL default '0',
`minMoneyLoot` int(10) unsigned NOT NULL default '0',
`maxMoneyLoot` int(10) unsigned NOT NULL default '0',
- `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time',
PRIMARY KEY (`entry`),
- KEY `idx_name` (`name`),
KEY `items_index` (`class`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
@@ -1617,6 +1968,94 @@ CREATE TABLE `item_template` (
LOCK TABLES `item_template` WRITE;
/*!40000 ALTER TABLE `item_template` DISABLE KEYS */;
+INSERT INTO `item_template` VALUES
+(25,2,7,-1,'Worn Shortsword',1542,1,0,1,35,7,21,32767,511,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1900,0,0,0,0,0,0,-1,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,0,0,0,1,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(35,2,10,-1,'Bent Staff',472,1,0,1,47,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,2,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(36,2,4,-1,'Worn Mace',5194,1,0,1,38,7,21,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1900,0,0,0,0,0,0,-1,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,2,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(37,2,0,-1,'Worn Axe',14029,1,0,1,38,7,21,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,0,0,0,0,0,0,-1,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,3,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(38,4,0,-1,'Recruit\'s Shirt',9891,1,0,1,1,1,4,-1,-1,1,0,0,0,0,0,0,0,0,0,1,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,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(39,4,1,-1,'Recruit\'s Pants',9892,0,0,1,5,1,7,32767,511,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(40,4,0,-1,'Recruit\'s Boots',10141,1,0,1,4,1,8,32767,511,1,0,0,0,0,0,0,0,0,0,1,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,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(43,4,0,-1,'Squire\'s Boots',9938,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(44,4,1,-1,'Squire\'s Pants',9937,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(45,4,0,-1,'Squire\'s Shirt',3265,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(47,4,0,-1,'Footpad\'s Shoes',9915,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(48,4,1,-1,'Footpad\'s Pants',9913,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(49,4,0,-1,'Footpad\'s Shirt',9906,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(51,4,0,-1,'Neophyte\'s Boots',9946,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(52,4,1,-1,'Neophyte\'s Pants',9945,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(53,4,0,-1,'Neophyte\'s Shirt',9944,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(55,4,0,-1,'Apprentice\'s Boots',9929,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(56,4,1,-1,'Apprentice\'s Robe',12647,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(57,4,1,-1,'Acolyte\'s Robe',12645,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(59,4,0,-1,'Acolyte\'s Shoes',3261,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(117,0,0,-1,'Tough Jerky',2473,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,'internalItemHandler',0,0,0,0,0),
+(120,4,1,-1,'Thug Pants',10006,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(121,4,0,-1,'Thug Boots',10008,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(127,4,0,-1,'Trapper\'s Shirt',9996,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(139,4,1,-1,'Brawler\'s Pants',9988,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(140,4,0,-1,'Brawler\'s Boots',9992,1,0,1,4,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(147,4,1,-1,'Rugged Trapper\'s Pants',9975,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(148,4,0,-1,'Rugged Trapper\'s Shirt',9976,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(153,4,2,-1,'Primitive Kilt',10050,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,14,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,8,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(154,4,0,-1,'Primitive Mantle',10058,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(159,0,0,-1,'Refreshing Spring Water',18084,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,430,0,-1,0,-1,59,1000,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,0,0,'internalItemHandler',0,0,0,0,0),
+(1395,4,1,-1,'Apprentice\'s Pants',9924,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(1396,4,1,-1,'Acolyte\'s Pants',3260,0,0,1,4,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2070,0,0,-1,'Darnassian Bleu',6353,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,'internalItemHandler',0,0,0,0,0),
+(2092,2,15,-1,'Worn Dagger',6442,1,0,1,35,7,13,2047,255,2,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1600,0,0,0,0,0,0,-1,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,3,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2101,1,2,-1,'Light Quiver',21328,1,0,1,4,1,18,2047,255,1,1,0,0,0,0,0,0,0,0,1,6,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,1000,0,0,14824,1,0,0,-1,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,'',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,0,0,'internalItemHandler',0,0,0,0,0),
+(2102,1,3,-1,'Small Ammo Pouch',1816,1,0,1,4,1,18,2047,255,1,1,0,0,0,0,0,0,0,0,1,6,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,1000,0,0,14824,1,0,0,-1,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,'',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,0,0,'internalItemHandler',0,0,0,0,0),
+(2105,4,0,-1,'Thug Shirt',10005,1,0,1,5,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2361,2,5,-1,'Battleworn Hammer',8690,1,0,1,45,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,1,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2362,4,6,-1,'Worn Wooden Shield',18730,0,0,1,7,1,14,32767,511,1,1,0,0,0,0,0,0,0,0,1,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,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,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,4,0,0,1,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2504,2,2,-1,'Worn Shortbow',8106,1,0,1,29,5,15,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2300,2,0,0,0,0,0,-1,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,2,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2508,2,3,-1,'Old Blunderbuss',6606,1,0,1,27,5,26,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2300,3,0,0,0,0,0,-1,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,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2512,6,2,-1,'Rough Arrow',5996,1,0,1,10,0,24,2047,255,5,1,0,0,0,0,0,0,0,0,200,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3000,0,0,0,0,0,0,-1,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,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2516,6,3,-1,'Light Shot',5998,1,0,1,10,0,24,2047,255,5,1,0,0,0,0,0,0,0,0,200,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,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3000,0,0,0,0,0,0,-1,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,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(2947,2,16,-1,'Small Throwing Knife',16754,1,0,1,15,0,25,2047,255,3,1,0,0,0,0,0,0,0,0,200,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,4,0,0,0,0,0,-1,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(3661,2,10,-1,'Handcrafted Staff',18530,1,0,1,45,9,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,2,2,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(4536,0,0,-1,'Shiny Red Apple',6410,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,100,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,0,0,'internalItemHandler',0,0,0,0,0),
+(4540,0,0,-1,'Tough Hunk of Bread',6399,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,'internalItemHandler',0,0,0,0,0),
+(4604,0,0,-1,'Forest Mushroom Cap',15852,1,0,6,25,1,0,2047,255,5,1,0,0,0,0,0,0,0,0,20,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,1000,0,0,433,0,-1,0,-1,11,1000,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,0,0,'internalItemHandler',0,0,0,0,0),
+(6096,4,0,-1,'Apprentice\'s Shirt',2163,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6097,4,0,-1,'Acolyte\'s Shirt',2470,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6098,4,1,-1,'Neophyte\'s Robe',12679,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6119,4,1,-1,'Neophyte\'s Robe',12681,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6123,4,1,-1,'Novice\'s Robe',12683,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6124,4,1,-1,'Novice\'s Pants',9987,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6125,4,0,-1,'Brawler\'s Harness',9995,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6126,4,1,-1,'Trapper\'s Pants',10002,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,2,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6127,4,0,-1,'Trapper\'s Boots',10003,1,0,1,5,1,8,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6129,4,1,-1,'Acolyte\'s Robe',12646,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6134,4,0,-1,'Primitive Mantle',10108,1,0,1,1,1,4,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6135,4,2,-1,'Primitive Kilt',10109,0,0,1,5,1,7,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,14,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,8,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6139,4,1,-1,'Novice\'s Robe',12684,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6140,4,1,-1,'Apprentice\'s Robe',12649,0,0,1,4,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6144,4,1,-1,'Neophyte\'s Robe',12680,0,0,1,5,1,20,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,3,0,0,0,0,0,0,1000,0,0,0,0,0,0,-1,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,7,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(6948,15,0,-1,'Hearthstone',6418,1,64,1,0,0,0,32767,511,1,0,0,0,0,0,0,0,0,0,1,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,8690,0,0,0,-1,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,'',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,0,0,'internalItemHandler',0,0,0,0,0),
+(12282,2,1,-1,'Worn Battleaxe',22291,1,0,1,43,8,17,2047,255,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2900,0,0,0,0,0,0,-1,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,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14646,12,0,-1,'Northshire Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5805,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14647,12,0,-1,'Coldridge Valley Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5841,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14648,12,0,-1,'Shadowglen Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14649,12,0,-1,'Valley of Trials Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5843,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14650,12,0,-1,'Camp Narache Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(14651,12,0,-1,'Deathknell Gift Voucher',18499,1,0,1,0,0,0,2047,255,1,1,0,0,0,0,0,0,0,0,1,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,1000,0,0,0,0,0,0,-1,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,4,'',0,0,0,5847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(25861,2,16,-1,'Crude Throwing Axe',20777,1,0,1,15,0,25,2047,255,3,1,0,0,0,0,0,0,0,0,200,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,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2000,4,0,0,0,0,0,-1,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,'internalItemHandler',0,0,0,0,0),
+(34648,4,4,-1,'Acherus Knight\'s Greaves',51496,2,32768,1,51,10,8,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,10,7,12,3,7,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,392,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34649,4,4,-1,'Acherus Knight\'s Gauntlets',51498,2,32768,1,34,6,10,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,6,32,8,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,356,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34650,4,4,-1,'Acherus Knight\'s Tunic',51494,2,32768,1,69,13,5,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,20,7,11,32,7,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,570,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34651,4,4,-1,'Acherus Knight\'s Girdle',51497,2,32768,1,35,7,6,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,10,32,15,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,320,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34652,4,4,-1,'Acherus Knight\'s Hood',51495,2,32768,1,52,10,1,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,15,7,15,32,9,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,463,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34653,4,4,-1,'Acherus Knight\'s Wristguard',51500,2,32768,1,36,7,9,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,7,31,7,7,11,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,249,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34655,4,4,-1,'Acherus Knight\'s Pauldrons',51501,2,32768,1,54,10,3,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,9,7,11,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,427,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34656,4,4,-1,'Acherus Knight\'s Cover',51499,2,32768,1,73,14,7,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,13,3,10,7,15,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,499,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,6,0,0,0,0,0,85,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34657,4,0,-1,'Choker of Damnation',6539,2,32768,1,2303,575,2,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,9,7,8,31,6,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,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34658,4,0,-1,'Plague Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,7,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(34659,4,1,-1,'Acherus Knight\'s Shroud',49738,2,32768,1,31,6,16,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,2,4,12,7,7,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,39,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38145,1,0,-1,'Deathweave Bag',1282,1,32768,1,0,0,18,-1,-1,35,0,0,0,0,0,0,0,0,0,1,12,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(38147,4,0,-1,'Corrupted Band',963,2,32768,1,534,133,11,-1,-1,60,55,0,0,0,0,0,0,0,0,1,0,3,4,11,3,6,32,4,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,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0),
+(41751,0,5,-1,'Black Mushroom',36728,1,0,1,100,5,0,-1,-1,65,55,0,0,0,0,0,0,0,0,20,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,27094,0,-1,0,0,11,1000,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,'',0,0,0,0);
/*!40000 ALTER TABLE `item_template` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1725,6 +2164,7 @@ LOCK TABLES `locales_item` WRITE;
/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */;
UNLOCK TABLES;
+
--
-- Table structure for table `locales_npc_option`
--
@@ -2034,6 +2474,647 @@ LOCK TABLES `locales_quest` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `mangos_string`
+--
+
+DROP TABLE IF EXISTS `mangos_string`;
+CREATE TABLE `mangos_string` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `content_default` text NOT NULL,
+ `content_loc1` text,
+ `content_loc2` text,
+ `content_loc3` text,
+ `content_loc4` text,
+ `content_loc5` text,
+ `content_loc6` text,
+ `content_loc7` text,
+ `content_loc8` text,
+ PRIMARY KEY (`entry`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `mangos_string`
+--
+
+LOCK TABLES `mangos_string` WRITE;
+/*!40000 ALTER TABLE `mangos_string` DISABLE KEYS */;
+INSERT INTO `mangos_string` VALUES
+(1,'You should select a character or a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(2,'You should select a creature.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(3,'|cffff0000[System Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(4,'|cffff0000[Event Message]: %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(5,'There is no help for that command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(6,'There is no such command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(7,'There is no such subcommand',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(8,'Command %s have subcommands:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(9,'Commands available to you:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(10,'Incorrect syntax.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(11,'Your account level is: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(12,'Online players: %u (max: %u) Queued players: %u (max: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(13,'Server uptime: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(14,'Player saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(15,'All players saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(16,'There are the following active GMs on this server:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(17,'There are no GMs currently logged in on this server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(18,'Cannot do that while flying.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(19,'Cannot do that in Battlegrounds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(20,'Target is flying you can\'t do that.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(21,'%s is flying command failed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(22,'You are not mounted so you can\'t dismount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(23,'Cannot do that while fighting.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(24,'You used it recently.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(25,'Password not changed (unknown error)!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(26,'The password was changed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(27,'The new passwords do not match or the old password is wrong',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(28,'Your account is now locked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(29,'Your account is now unlocked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(30,', rank ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(31,' [known]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(32,' [learn]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(33,' [passive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(34,' [talent]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(35,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(36,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(37,' (offline)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(38,'on',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(39,'off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(40,'You are: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(41,'visible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(42,'invisible',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(43,'done',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(44,'You',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(45,' <unknown> ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(46,'<error>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(47,'<non-existing character>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(48,'UNKNOWN',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(49,'You must be at least level %u to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(50,'You must be at least level %u and have item %s to enter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(51,'Hello! Ready for some training?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(52,'Invaid item count (%u) for item %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(53,'Mail can\'t have more %u item stacks',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(54,'The new passwords do not match',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(55,'Your password can\'t be longer than 16 characters (client limit), password not changed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(56,'Current Message of the day: \r\n%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(57,'Using World DB: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(58,'Using script library: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(100,'Global notify: ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s)\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(102,'%s is already being teleported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(103,'You can summon a player to your instance only if he is in your party with you as leader.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(104,'You cannot go to the player\'s instance because you are in a party now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(105,'You can go to the player\'s instance while not being in his party only if your GM mode is on.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(106,'You can not go to player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(107,'You can not summon player %s from instance to instance.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(108,'You are summoning %s%s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(109,'You are being summoned by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(110,'You are teleporting %s%s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(111,'You are being teleported by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(112,'Player (%s) does not exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(113,'Appearing at %s\'s location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(114,'%s is appearing to your location.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(115,'Incorrect values.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(116,'No character selected.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(117,'%s is not in a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(118,'You changed HP of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(119,'%s changed your HP to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(120,'You changed MANA of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(121,'%s changed your MANA to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(122,'You changed ENERGY of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(123,'%s changed your ENERGY to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(124,'Current energy: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(125,'You changed rage of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(126,'%s changed your rage to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(127,'You changed level of %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(128,'GUID %i, faction is %i, flags is %i, npcflag is %i, DY flag is %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(129,'Wrong faction: %u (not found in factiontemplate.dbc).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(130,'You changed GUID=%i \'s Faction to %i, flags to %i, npcflag to %i, dyflag to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(131,'You changed the spellflatid=%i, val= %i, mark =%i to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(132,'%s changed your spellflatid=%i, val= %i, mark =%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(133,'%s has access to all taxi nodes now (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(134,'%s has no more access to all taxi nodes now (only visited accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(135,'%s has given you access to all taxi nodes (until logout).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(136,'%s has removed access to all taxi nodes (only visited still accessible).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(137,'You set all speeds to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(138,'%s set all your speeds to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(139,'You set the speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(140,'%s set your speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(141,'You set the swim speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(142,'%s set your swim speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(143,'You set the backwards run speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(144,'%s set your backwards run speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(145,'You set the fly speed to %2.2f from normal of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(146,'%s set your fly speed to %2.2f from normal.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(147,'You set the size %2.2f of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(148,'%s set your size to %2.2f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(149,'There is no such mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(150,'You give a mount to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(151,'%s gave you a mount.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(152,'USER1: %i, ADD: %i, DIF: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(153,'You take all copper of %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(154,'%s took you all of your copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(155,'You take %i copper from %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(156,'%s took %i copper from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(157,'You give %i copper to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(158,'%s gave you %i copper.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(159,'You hear sound %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(160,'USER2: %i, ADD: %i, RESULT: %i\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(161,'Removed bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(162,'Set bit %i in field %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(163,'Teleport location table is empty!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(164,'Teleport location not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(165,'Requires search parameter.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(166,'There are no teleport locations matching your request.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(168,'Locations found are:\n %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(169,'Mail sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(170,'You try to hear sound %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(172,'server console command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(200,'No selection.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(201,'Object GUID is: lowpart %u highpart %X',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(202,'The name was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(203,'Error, name can only contain characters A-Z and a-z.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(204,'The subname was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(205,'Not yet implemented',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(206,'Item \'%i\' \'%s\' added to list with maxcount \'%i\' and incrtime \'%i\' and extendedcost \'%i\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(207,'Item \'%i\' not found in database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(208,'Item \'%i\' \'%s\' deleted from vendor list',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(209,'Item \'%i\' not found in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(210,'Item \'%i\' already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(211,'Spells of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(212,'Spells of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(213,'Talents of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(214,'Talents of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(215,'Your spells have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(216,'Your talents have been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(217,'Unknown case \'%s\' for .resetall command. Type full correct case name.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(218,'Spells will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(219,'Talents will reset for all players at login. Strongly recommend re-login!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(220,'Creature (GUID: %u) No waypoint found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(221,'Creature (GUID: %u) Last waypoint not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(222,'Creature (GUID: %u) No waypoint found - used \'wpguid\'. Now trying to find it by its position...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(223,'Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(224,'Selected creature is ignored - provided GUID is used',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(225,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(226,'You must select a visual waypoint.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(227,'No visual waypoints found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(228,'Could not create visual waypoint with creatureID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(229,'All visual waypoints removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(230,'Could not create waypoint-creature with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(231,'No GUID provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(232,'No waypoint number provided.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(233,'Argument required for \'%s\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(234,'Waypoint %i added to GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(235,'Waypoint %d added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(236,'Waypoint changed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(237,'Waypoint %s modified.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(238,'WP export successfull.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(239,'No waypoints found inside the database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(240,'File imported.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(241,'Waypoint removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(242,'Warning: Could not delete WP from the world with ID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(243,'This happens if the waypoint is too far away from your char.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(244,'The WP is deleted from the database, but not from the world here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(245,'They will disappear after a server restart.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(246,'Waypoint %d: Info for creature: %s, GUID: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(247,'Waittime: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(248,'Model %d: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(249,'Emote: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(250,'Spell: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(251,'Text%d (ID: %i): %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(252,'AIScript: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(253,'Forced rename for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(254,'Forced rename for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(255,'Waypoint-Creature (GUID: %u) Not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(256,'Could not find NPC...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(257,'Creature movement type set to \'%s\', waypoints removed (if any).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(258,'Creature movement type set to \'%s\', waypoints were not removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(259,'Incorrect value, use on or off',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(260,'Value saved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(261,'Value saved, you may need to rejoin or clean your client cache.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(262,'Areatrigger ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(263,'Target map or coordinates is invalid (X: %f Y: %f MapId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(264,'Zone coordinates is invalid (X: %f Y: %f AreaId: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(265,'Zone %u (%s) is part of instanceable map %u (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(266,'Nothing found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(267,'Object not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(268,'Creature not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(269,'Warning: Mob found more than once - you will be teleported to the first one found in DB.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(270,'Creature Removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(271,'Creature moved.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(272,'Creature (GUID:%u) must be on the same map as player!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(273,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(274,'Game Object (GUID: %u) has references in not found creature %u GO list, can\'t be deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(275,'Game Object (GUID: %u) removed',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(276,'Game Object (GUID: %u) turned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(277,'Game Object (GUID: %u) moved',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(278,'You must select a vendor',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(279,'You must send id for item',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(280,'Vendor has too many items (max 128)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(281,'You can\'t kick self, logout instead',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(282,'Player %s kicked.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(283,'Player %s not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(284,'Accepting Whisper: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(285,'Accepting Whisper: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(286,'Accepting Whisper: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(287,'Creature (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(288,'Tickets count: %i show new tickets: %s\n',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(289,'New ticket from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(290,'Ticket of %s (Last updated: %s):\n%s ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(291,'New ticket show: ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(292,'New ticket show: OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(293,'Ticket %i doesn\'t exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(294,'All tickets deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(295,'Character %s ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(296,'Ticket deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(297,'Spawn distance changed to: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(298,'Spawn time changed to: %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(299,'The honor of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(300,'Your chat has been disabled for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(301,'You have disabled %s\'s chat for %u minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(302,'Player\'s chat is already enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(303,'Your chat has been enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(304,'You have enabled %s\'s chat.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(305, 'Faction %s (%u) reputation of %s was set to %5d!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(306, 'The arena points of %s was set to %u!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(307, 'No faction found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(308, 'Faction %i unknown!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(309, 'Invalid parameter %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(310, 'delta must be between 0 and %d (inclusive)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(311, '%d - |cffffffff|Hfaction:%d|h[%s]|h|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(312, ' [visible]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(313, ' [at war]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(314, ' [peace forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(315, ' [hidden]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(316, ' [invisible forced]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(317, ' [inactive]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(318, 'Hated',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(319, 'Hostile',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(320, 'Unfriendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(321, 'Neutral',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(322, 'Friendly',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(323, 'Honored',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(324, 'Revered',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(325, 'Exalted',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(326, 'Faction %s (%u) can\'not have reputation.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(327, ' [no reputation]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(328,'Characters at account %s (Id: %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(329,' %s (GUID %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(330,'No players found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(331,'Extended item cost %u not exist',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(332,'GM mode is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(333,'GM mode is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(334,'GM Chat Badge is ON',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(335,'GM Chat Badge is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(336,'You repair all %s''s items.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(337,'All your items repaired by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(338,'You set waterwalk mode %s for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(339,'Your waterwalk mode %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(340,'%s is now following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(341,'%s is not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(342,'%s is now not following you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(343,'Creature (Entry: %u) cannot be tamed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(344,'You already have pet.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(403,'You have low security level for this.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(404,'Creature movement disabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(405,'Creature movement enabled.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(406,'Weather can\'t be changed for this zone.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(407,'Weather system disabled at server.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(408,'%s is banned for %s. Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(409,'%s is banned permanently for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(410,'%s %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(411,'%s unbanned.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(412,'There was an error removing the ban on %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(413,'Account not exist: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(414,'There is no such character.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(415,'There is no such IP in banlist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(416,'Account %s has never been banned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(417,'Ban history for account %s:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(418,'Ban Date: %s Bantime: %s Still active: %s Reason: %s Set by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(419,'Inf.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(420,'Never',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(421,'Yes',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(422,'No',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(423,'IP: %s\nBan Date: %s\nUnban Date: %s\nRemaining: %s\nReason: %s\nSet by: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(424,'There is no matching IPban.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(425,'There is no matching account.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(426,'There is no banned account owning a character matching this part.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(427,'The following IPs match your pattern:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(428,'The following accounts match your query:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(429,'You learned many spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(430,'You learned all spells for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(431,'You learned all talents for class.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(432,'You learned all languages.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(433,'You learned all craft skills and recipes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(434,'Could not find \'%s\'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(435,'Invalid item id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(436,'No items found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(437,'Invalid gameobject id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(438,'Found items %u: %u ( inventory %u mail %u auction %u guild %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(439,'Found gameobjects %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(440,'Invalid creature id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(441,'Found creatures %u: %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(442,'No area found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(443,'No item sets found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(444,'No skills found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(445,'No spells found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(446,'No quests found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(447,'No creatures found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(448,'No gameobjects found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(449,'Graveyard #%u doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(457,'alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(458,'horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(459,'Graveyard #%u (faction: %s) is nearest from linked to zone #%u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(460,'Zone #%u doesn\'t have linked graveyards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(461,'Zone #%u doesn\'t have linked graveyards for faction: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(462,'Teleport location already exists!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(463,'Teleport location added.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(464,'Teleport location NOT added: database error.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(465,'Teleport location deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(467,'Target unit has %d auras:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(468,'id: %d eff: %d type: %d duration: %d maxduration: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(469,'Target unit has %d auras of type %d:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(470,'id: %d eff: %d name: %s%s%s caster: %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(471,'Quest %u not found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(472,'Quest %u started from item. For correct work, please, add item to inventory and start quest in normal way: .additem %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(473,'Quest removed.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(474,' [rewarded]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(475,' [complete]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(476,' [active]',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(477,'%s\'s Fly Mode %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(478,'Opcode %u sent to %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(479,'Character loaded successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(480,'Failed to load the character!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(481,'Character dumped successfully!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(482,'Character dump failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(483,'Spell %u broken and not allowed to cast or learn!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(484,'Skill %u (%s) for player %s set to %u and current maximum set to %u (without permanent (talent) bonuses).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(485,'Player %s must have skill %u (%s) before using this command.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(486,'Invalid skill id (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(487,'You learned default GM spells/skills.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(488,'You already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(489,'Target(%s) already know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(490,'%s doesn\'t know that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(491,'You already forgot that spell.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(492,'All spell cooldowns removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(493,'Spell %u cooldown removed for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(494,'Command : Additem, itemId = %i, amount = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(495,'Command : Additemset, itemsetId = %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(496,'Removed itemID = %i, amount = %i from %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(497,'Cannot create item \'%i\' (amount: %i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(498,'You need to provide a guild name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(499,'Player not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(500,'Player already has a guild!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(501,'Guild not created! (already exists?)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(502,'No items from itemset \'%u\' found.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(503,'The distance is: (3D) %f (2D) %f yards.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(504,'Item \'%i\' \'%s\' Item Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(505,'Item \'%i\' doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(506,'Item \'%i\' \'%s\' Added to Slot %i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(507,'Item save failed!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(508,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(509,'%d - sender: %s (guid: %u account: %u ) receiver: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(510,'%d - owner: %s (guid: %u account: %u ) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(511,'Wrong link type!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(512,'%d - |cffffffff|Hitem:%d:0:0:0:0:0:0:0|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(513,'%d - |cffffffff|Hquest:%d|h[%s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(514,'%d - |cffffffff|Hcreature_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(515,'%d - |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(516,'%d - |cffffffff|Hgameobject_entry:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(517,'%d - |cffffffff|Hgameobject:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(518,'%d - |cffffffff|Hitemset:%d|h[%s %s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(522,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(524,'Selected object:\n|cffffffff|Hitemset:%d|h[%s]|h|r\nGUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(526,'%s (lowguid: %u) movement generators stack:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(527,' Idle',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(528,' Random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(529,' Waypoint',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(530,' Animal random',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(531,' Confused',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(532,' Targeted to player %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(533,' Targeted to creature %s (lowguid %u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(534,' Targeted to <NULL>',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(535,' Home movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(536,' Home movement used for player?!?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(537,' Taxi flight',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(538,' Unknown movement generator (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(539,'Player selected NPC\nGUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(540,'Level: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(541,'Health (base): %u. (max): %u. (current): %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(542,'Field Flags: %u.\nDynamic Flags: %u.\nFaction Template: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(543,'Loot: %u Pickpocket: %u Skinning: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(544,'Position: %f %f %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(545,'*** Is a vendor!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(546,'*** Is a trainer!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(547,'InstanceID: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(548,'Player%s %s (guid: %u) Account: %s (id: %u) GMLevel: %u Last IP: %s Last login: %s Latency: %ums',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(549,'Played time: %s Level: %u Money: %ug%us%uc',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(550,'Command .pinfo doesn\'t support \'rep\' option for offline players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(551,'%s has explored all zones now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(552,'%s has no more explored zones.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(553,'%s has explored all zones for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(554,'%s has hidden all zones from you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(555,'Hover enabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(556,'Hover disabled',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(557,'You have been leveled up (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(558,'You have been leveled down (%i)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(559,'Your level progress has been reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(560,'The area has been set as explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(561,'The area has been set as not explored.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(562,'GUID=%i \'s updateIndex: %i, value: %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(563,'You change GUID=%i \'s UpdateIndex: %i value to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(564,'The value index %u is too big to %u(count: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(565,'Set %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(566,'You Set %u Field:%u to uint32 Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(567,'Set %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(568,'You Set %u Field:%i to float Value: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(569,'Get %u uint32 Value:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(570,'The uint32 value of %u in %u is: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(571,'Get %u float Value:[OPCODE]:%u [VALUE]:%f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(572,'The float of %u value in %u is: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(573,'.Set32Bit:[OPCODE]:%u [VALUE]:%u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(574,'You set Bit of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(575,'.Mod32Value:[OPCODE]:%u [VALUE]:%i',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(576,'You modified the value of Field:%u to Value: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(577,'You are now invisible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(578,'You are now visible.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(579,'Selected player or creature not have victim.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(580,'You learned all default spells for race/class and completed quests rewarded spells.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(581,'Found near gameobjects (distance %f): %u ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(582,'SpawnTime: Full:%s Remain:%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(583,'%d - |cffffffff|Hgameevent:%d|h[%s]|h|r%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(584,'No event found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(585,'Event not exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(586,'Event %u: %s%s\nStart: %s End: %s Occurence: %s Length: %s\nNext state change: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(587,'Event %u already active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(588,'Event %u not active!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(589,' Point movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(590,' Fear movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(591,' Distract movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(592,'You have learned all spells in craft: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(593,'Currently Banned Accounts:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(594,'| Account | BanDate | UnbanDate | Banned By | Ban Reason |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(595,'Currently Banned IPs:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(596,'| IP | BanDate | UnbanDate | Banned By | Ban Reason |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(597,'Current gamemasters:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(598,'| Account | GM |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(599,'No gamemasters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(600,'The Alliance wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(601,'The Horde wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(602,'The battle for Warsong Gulch begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(603,'The battle for Warsong Gulch begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(604,'Let the battle for Warsong Gulch begin!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(605,'$n captured the Horde flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(606,'$n captured the Alliance flag!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(607,'The Horde flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(608,'The Alliance Flag was dropped by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(609,'The Alliance Flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(610,'The Horde flag was returned to its base by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(611,'The Horde flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(612,'The Alliance Flag was picked up by $n!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(613,'The flags are now placed at their bases.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(636,'The Battle for Eye of the Storm begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(637,'The Battle for Eye of the Storm begins in 30 seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(638,'The Battle for Eye of the Storm has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(650,'Alliance',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(651,'Horde',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(652,'stables',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(653,'blacksmith',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(654,'farm',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(655,'lumber mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(656,'mine',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(657,'The %s has taken the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(658,'$n has defended the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(659,'$n has assaulted the %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(660,'$n claims the %s! If left unchallenged, the %s will control it in 1 minute!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(661,'The Battle for Arathi Basin begins in 1 minute.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(662,'The Battle for Arathi Basin begins in 30 seconds. Prepare yourselves!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(663,'The Battle for Arathi Basin has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(664,'The Alliance has gathered $1776W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(665,'The Horde has gathered $1777W resources, and is near victory!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(666,'After your recent battle in %s our best attempts to award you a Mark of Honor failed. Enclosed you will find the Mark of Honor we were not able to deliver to you at the time. Thanks for fighting in %s!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(700,'You must be level %u to form an arena team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(701,'One minute until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(702,'Thirty seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(703,'Fifteen seconds until the Arena battle begins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(704,'The Arena battle has begun!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(705,'You must wait %s before speaking again.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(706,'This item(s) have problems with equipping/storing in inventory.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(707,'%s wishes to not be disturbed and cannot receive whisper messages: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(708,'%s is Away from Keyboard: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(709,'Do not Disturb',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(710,'Away from Keyboard',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(711,'Queue status for %s (Lvl: %u to %u)\nQueued alliances: %u (Need at least %u more)\nQueued hordes: %u (Need at least %u more)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(712,'|cffff0000[BG Queue Announcer]:|r %s -- [%u-%u] A: %u (Need: %u), H: %u (Needs %u)|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(713,'You must be level %u to join an arena team!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(714,'%s is not high enough level to join your team',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(715,'You don\'t meet Battleground level requirements',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(716,'Your arena team is full, %s cannot join it.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(804,'You do not have permission to perform that function',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(805,'Unknown language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(806,'You don\'t know that language',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(807,'Please provide character name',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(808,'Player %s not found or offline',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(809,'Account for character %s not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1000,'Exiting daemon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1001,'Account deleted: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1002,'Account %s NOT deleted (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1003,'Account %s NOT deleted (unknown error)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1004,'Account created: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1005,'Account name can\'t be longer than 16 characters (client limit), account not created!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1006,'Account with this name already exist!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1007,'Account %s NOT created (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1008,'Account %s NOT created (unknown error)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1009,'Player %s (Guid: %u) Account %s (Id: %u) deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1010,'| Account | Character | IP | GM | TBC |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1011,'|<Error> | %20s |<Error> |<Er>|<Err>|',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1100,'Account %s (Id: %u) have up to %u expansion allowed now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1101,'Message of the day changed to:\r\n%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1102,'Message sent to %s: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1103,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1104,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1105,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1106,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1107,'%d - %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1108,'%d - %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1109,'%d - %s %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1110,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1111,'%d - %s X:%f Y:%f Z:%f MapId:%d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1112,'Failed to open file: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1113,'Account %s (%u) have max amount allowed characters (client limit)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1114,'Dump file have broken data!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1115,'Invalid character name!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1116,'Invalid character guid!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1117,'Character guid %u in use!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1118,'%d - guild: %s (guid: %u) %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1119,'You must use male or female as gender.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1120,'You change gender of %s to %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1121,'Your gender changed to %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1122,'Your group is too large for this battleground. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1123,'Your group is too large for this arena. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1124,'Your group has members not in your arena team. Please regroup to join.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1125,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1126,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1127,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1128,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1129,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1130,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1131,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1132,'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1133,'Someone in your party is Deserter. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1134,'Someone in your party is already in three battleground queues. You cannot join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1135,'You cannot teleport to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1136,'You cannot summon players to a battleground or arena map.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1137,'You must be in GM mode to teleport to a player in a battleground.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1138,'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `milling_loot_template`
+--
+
+DROP TABLE IF EXISTS `milling_loot_template`;
+CREATE TABLE `milling_loot_template` (
+ `entry` mediumint(8) unsigned NOT NULL default '0',
+ `item` mediumint(8) unsigned NOT NULL default '0',
+ `ChanceOrQuestChance` float NOT NULL default '100',
+ `groupid` tinyint(3) unsigned NOT NULL default '0',
+ `mincountOrRef` mediumint(9) NOT NULL default '1',
+ `maxcount` tinyint(3) unsigned NOT NULL default '1',
+ `lootcondition` tinyint(3) unsigned NOT NULL default '0',
+ `condition_value1` mediumint(8) unsigned NOT NULL default '0',
+ `condition_value2` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`entry`,`item`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
+
+--
+-- Dumping data for table `milling_loot_template`
+--
+
+LOCK TABLES `milling_loot_template` WRITE;
+/*!40000 ALTER TABLE `milling_loot_template` DISABLE KEYS */;
+/*!40000 ALTER TABLE `milling_loot_template` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `npc_gossip`
--
@@ -2080,11 +3161,11 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `npc_option`;
CREATE TABLE `npc_option` (
- `id` tinyint(3) unsigned NOT NULL default '0',
- `gossip_id` tinyint(3) unsigned NOT NULL default '0',
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `gossip_id` mediumint(8) unsigned NOT NULL default '0',
`npcflag` int(10) unsigned NOT NULL default '0',
`icon` tinyint(3) unsigned NOT NULL default '0',
- `action` tinyint(3) unsigned NOT NULL default '0',
+ `action` mediumint(8) unsigned NOT NULL default '0',
`box_money` int(10) unsigned NOT NULL default '0',
`coded` tinyint(3) unsigned NOT NULL default '0',
`option_text` text,
@@ -2212,7 +3293,7 @@ CREATE TABLE `npc_trainer` (
`reqskill` smallint(5) unsigned NOT NULL default '0',
`reqskillvalue` smallint(5) unsigned NOT NULL default '0',
`reqlevel` tinyint(3) unsigned NOT NULL default '0',
- PRIMARY KEY (`entry`,`spell`)
+ UNIQUE KEY `entry_spell` (`entry`,`spell`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
@@ -2257,7 +3338,7 @@ CREATE TABLE `page_text` (
`text` longtext NOT NULL,
`next_page` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Item System';
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System';
--
-- Dumping data for table `page_text`
@@ -2315,6 +3396,268 @@ CREATE TABLE `pet_name_generation` (
LOCK TABLES `pet_name_generation` WRITE;
/*!40000 ALTER TABLE `pet_name_generation` DISABLE KEYS */;
+INSERT INTO `pet_name_generation` (`word`,`entry`,`half`) VALUES
+('Aba',416,0),
+('Az',416,0),
+('Bel',416,0),
+('Biz',416,0),
+('Cho',416,0),
+('Dag',416,0),
+('Gak',416,0),
+('Gar',416,0),
+('Gel',416,0),
+('Gho',416,0),
+('Gob',416,0),
+('Gra',416,0),
+('Jak',416,0),
+('Jub',416,0),
+('Kar',416,0),
+('Kup',416,0),
+('Laz',416,0),
+('Nal',416,0),
+('Nok',416,0),
+('Pag',416,0),
+('Pig',416,0),
+('Pip',416,0),
+('Piz',416,0),
+('Quz',416,0),
+('Rui',416,0),
+('Rul',416,0),
+('Rup',416,0),
+('Tar',416,0),
+('Vol',416,0),
+('Yaz',416,0),
+('Zep',416,0),
+('Zig',416,0),
+('Zil',416,0),
+('Zor',416,0),
+('bis',416,1),
+('fip',416,1),
+('gup',416,1),
+('ham',416,1),
+('jub',416,1),
+('kin',416,1),
+('kol',416,1),
+('lop',416,1),
+('loz',416,1),
+('mat',416,1),
+('mir',416,1),
+('nam',416,1),
+('nar',416,1),
+('nik',416,1),
+('nip',416,1),
+('pad',416,1),
+('pep',416,1),
+('pit',416,1),
+('qua',416,1),
+('rai',416,1),
+('rin',416,1),
+('rot',416,1),
+('tai',416,1),
+('tal',416,1),
+('tik',416,1),
+('tip',416,1),
+('tog',416,1),
+('tuk',416,1),
+('uri',416,1),
+('yal',416,1),
+('yap',416,1),
+('Bhee',417,0),
+('Bruu',417,0),
+('Czaa',417,0),
+('Droo',417,0),
+('Flaa',417,0),
+('Fzuu',417,0),
+('Ghaa',417,0),
+('Gree',417,0),
+('Gzaa',417,0),
+('Haa',417,0),
+('Haad',417,0),
+('Haag',417,0),
+('Haap',417,0),
+('Jhaa',417,0),
+('Jhuu',417,0),
+('Khaa',417,0),
+('Khii',417,0),
+('Khuu',417,0),
+('Kree',417,0),
+('Luu',417,0),
+('Maa',417,0),
+('Nhee',417,0),
+('Phuu',417,0),
+('Pryy',417,0),
+('Rhuu',417,0),
+('Shaa',417,0),
+('Sloo',417,0),
+('Sruu',417,0),
+('Thoo',417,0),
+('Traa',417,0),
+('Wraa',417,0),
+('Zhaa',417,0),
+('dhon',417,1),
+('dhum',417,1),
+('dhun',417,1),
+('dom',417,1),
+('don',417,1),
+('drom',417,1),
+('dym',417,1),
+('fenn',417,1),
+('fum',417,1),
+('fun',417,1),
+('ghon',417,1),
+('ghun',417,1),
+('grom',417,1),
+('grym',417,1),
+('hom',417,1),
+('hon',417,1),
+('hun',417,1),
+('jhom',417,1),
+('kun',417,1),
+('lum',417,1),
+('mmon',417,1),
+('mon',417,1),
+('myn',417,1),
+('nam',417,1),
+('nem',417,1),
+('nhym',417,1),
+('nom',417,1),
+('num',417,1),
+('phom',417,1),
+('roon',417,1),
+('rym',417,1),
+('shon',417,1),
+('thun',417,1),
+('tom',417,1),
+('zhem',417,1),
+('zhum',417,1),
+('zun',417,1),
+('Bar',1860,0),
+('Bel',1860,0),
+('Char',1860,0),
+('Grak\'',1860,0),
+('Graz\'',1860,0),
+('Grim',1860,0),
+('Hath',1860,0),
+('Hel',1860,0),
+('Hok',1860,0),
+('Huk',1860,0),
+('Jhaz',1860,0),
+('Jhom',1860,0),
+('Juk\'',1860,0),
+('Kal\'',1860,0),
+('Klath',1860,0),
+('Kon',1860,0),
+('Krag',1860,0),
+('Krak',1860,0),
+('Mak',1860,0),
+('Mezz',1860,0),
+('Orm',1860,0),
+('Phan',1860,0),
+('Sar',1860,0),
+('Tang',1860,0),
+('Than',1860,0),
+('Thog',1860,0),
+('Thok',1860,0),
+('Thul',1860,0),
+('Zag\'',1860,0),
+('Zang',1860,0),
+('Zhar\'',1860,0),
+('kath',1860,1),
+('doc',1860,1),
+('dok',1860,1),
+('gak',1860,1),
+('garth',1860,1),
+('gore',1860,1),
+('gorg',1860,1),
+('grave',1860,1),
+('gron',1860,1),
+('juk',1860,1),
+('krast',1860,1),
+('kresh',1860,1),
+('krit',1860,1),
+('los',1860,1),
+('mon',1860,1),
+('mos',1860,1),
+('moth',1860,1),
+('nagma',1860,1),
+('nak',1860,1),
+('nar',1860,1),
+('nos',1860,1),
+('nuz',1860,1),
+('phog',1860,1),
+('rath',1860,1),
+('tast',1860,1),
+('taz',1860,1),
+('thak',1860,1),
+('thang',1860,1),
+('thyk',1860,1),
+('vhug',1860,1),
+('zazt',1860,1),
+('Ael',1863,0),
+('Aez',1863,0),
+('Ang',1863,0),
+('Ban',1863,0),
+('Bet',1863,0),
+('Bro',1863,0),
+('Bry',1863,0),
+('Cat',1863,0),
+('Dir',1863,0),
+('Dis',1863,0),
+('Dom',1863,0),
+('Drus',1863,0),
+('Fie',1863,0),
+('Fier',1863,0),
+('Gly',1863,0),
+('Hel',1863,0),
+('Hes',1863,0),
+('Kal',1863,0),
+('Lyn',1863,0),
+('Mir',1863,0),
+('Nim',1863,0),
+('Sar',1863,0),
+('Sel',1863,0),
+('Vil',1863,0),
+('Zah',1863,0),
+('aith',1863,1),
+('anda',1863,1),
+('antia',1863,1),
+('evere',1863,1),
+('lia',1863,1),
+('lissa',1863,1),
+('neri',1863,1),
+('neth',1863,1),
+('nia',1863,1),
+('nlissa',1863,1),
+('nora',1863,1),
+('nva',1863,1),
+('nys',1863,1),
+('ola',1863,1),
+('ona',1863,1),
+('ora',1863,1),
+('rah',1863,1),
+('riana',1863,1),
+('riel',1863,1),
+('rona',1863,1),
+('tai',1863,1),
+('tevere',1863,1),
+('thea',1863,1),
+('vina',1863,1),
+('wena',1863,1),
+('wyn',1863,1),
+('xia',1863,1),
+('yla',1863,1),
+('yssa',1863,1),
+('Flaa',17252,0),
+('Haa',17252,0),
+('Jhuu',17252,0),
+('Shaa',17252,0),
+('Thoo',17252,0),
+('dhun',17252,1),
+('ghun',17252,1),
+('roon',17252,1),
+('thun',17252,1),
+('tom',17252,1);
+
/*!40000 ALTER TABLE `pet_name_generation` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2387,6 +3730,807 @@ CREATE TABLE `player_classlevelstats` (
LOCK TABLES `player_classlevelstats` WRITE;
/*!40000 ALTER TABLE `player_classlevelstats` DISABLE KEYS */;
+INSERT INTO `player_classlevelstats` VALUES
+(1,1,20,0),
+(1,2,29,0),
+(1,3,38,0),
+(1,4,47,0),
+(1,5,56,0),
+(1,6,65,0),
+(1,7,74,0),
+(1,8,83,0),
+(1,9,92,0),
+(1,10,101,0),
+(1,11,100,0),
+(1,12,109,0),
+(1,13,118,0),
+(1,14,128,0),
+(1,15,139,0),
+(1,16,151,0),
+(1,17,154,0),
+(1,18,168,0),
+(1,19,183,0),
+(1,20,199,0),
+(1,21,206,0),
+(1,22,224,0),
+(1,23,243,0),
+(1,24,253,0),
+(1,25,274,0),
+(1,26,296,0),
+(1,27,309,0),
+(1,28,333,0),
+(1,29,348,0),
+(1,30,374,0),
+(1,31,401,0),
+(1,32,419,0),
+(1,33,448,0),
+(1,34,468,0),
+(1,35,499,0),
+(1,36,521,0),
+(1,37,545,0),
+(1,38,581,0),
+(1,39,609,0),
+(1,40,649,0),
+(1,41,681,0),
+(1,42,715,0),
+(1,43,761,0),
+(1,44,799,0),
+(1,45,839,0),
+(1,46,881,0),
+(1,47,935,0),
+(1,48,981,0),
+(1,49,1029,0),
+(1,50,1079,0),
+(1,51,1131,0),
+(1,52,1185,0),
+(1,53,1241,0),
+(1,54,1299,0),
+(1,55,1359,0),
+(1,56,1421,0),
+(1,57,1485,0),
+(1,58,1551,0),
+(1,59,1619,0),
+(1,60,1689,0),
+(1,61,1902,0),
+(1,62,2129,0),
+(1,63,2357,0),
+(1,64,2612,0),
+(1,65,2883,0),
+(1,66,3169,0),
+(1,67,3455,0),
+(1,68,3774,0),
+(1,69,4109,0),
+(1,70,4444,0),
+(1,71,4720,0),
+(1,72,5013,0),
+(1,73,5325,0),
+(1,74,5656,0),
+(1,75,6008,0),
+(1,76,6381,0),
+(1,77,6778,0),
+(1,78,7198,0),
+(1,79,7646,0),
+(1,80,8121,0),
+(2,1,28,60),
+(2,2,36,78),
+(2,3,44,98),
+(2,4,52,104),
+(2,5,60,111),
+(2,6,68,134),
+(2,7,76,143),
+(2,8,84,153),
+(2,9,92,179),
+(2,10,100,192),
+(2,11,108,205),
+(2,12,116,219),
+(2,13,124,249),
+(2,14,132,265),
+(2,15,131,282),
+(2,16,141,315),
+(2,17,152,334),
+(2,18,164,354),
+(2,19,177,390),
+(2,20,191,412),
+(2,21,206,435),
+(2,22,222,459),
+(2,23,239,499),
+(2,24,247,525),
+(2,25,266,552),
+(2,26,286,579),
+(2,27,307,621),
+(2,28,329,648),
+(2,29,342,675),
+(2,30,366,702),
+(2,31,391,729),
+(2,32,407,756),
+(2,33,434,798),
+(2,34,462,825),
+(2,35,481,852),
+(2,36,511,879),
+(2,37,542,906),
+(2,38,564,933),
+(2,39,597,960),
+(2,40,621,987),
+(2,41,656,1014),
+(2,42,682,1041),
+(2,43,719,1068),
+(2,44,747,1110),
+(2,45,786,1137),
+(2,46,816,1164),
+(2,47,857,1176),
+(2,48,889,1203),
+(2,49,922,1230),
+(2,50,966,1257),
+(2,51,1001,1284),
+(2,52,1037,1311),
+(2,53,1084,1338),
+(2,54,1122,1365),
+(2,55,1161,1392),
+(2,56,1201,1419),
+(2,57,1252,1446),
+(2,58,1294,1458),
+(2,59,1337,1485),
+(2,60,1381,1512),
+(2,61,1540,1656),
+(2,62,1708,1800),
+(2,63,1884,1944),
+(2,64,2068,2088),
+(2,65,2262,2232),
+(2,66,2466,2377),
+(2,67,2679,2521),
+(2,68,2901,2665),
+(2,69,3134,2809),
+(2,70,3377,2953),
+(2,71,3629,3097),
+(2,72,3900,3241),
+(2,73,4191,3385),
+(2,74,4503,3529),
+(2,75,4839,3673),
+(2,76,5200,3817),
+(2,77,5588,3962),
+(2,78,6005,4106),
+(2,79,6453,4250),
+(2,80,6934,4394),
+(3,1,46,65),
+(3,2,53,70),
+(3,3,60,76),
+(3,4,67,98),
+(3,5,74,106),
+(3,6,81,130),
+(3,7,88,140),
+(3,8,95,166),
+(3,9,102,193),
+(3,10,109,206),
+(3,11,116,235),
+(3,12,123,250),
+(3,13,130,266),
+(3,14,138,298),
+(3,15,147,316),
+(3,16,157,350),
+(3,17,168,370),
+(3,18,180,391),
+(3,19,193,428),
+(3,20,207,451),
+(3,21,222,475),
+(3,22,238,515),
+(3,23,255,541),
+(3,24,273,568),
+(3,25,292,611),
+(3,26,312,640),
+(3,27,333,670),
+(3,28,355,715),
+(3,29,378,745),
+(3,30,402,775),
+(3,31,417,805),
+(3,32,443,850),
+(3,33,470,880),
+(3,34,498,910),
+(3,35,527,940),
+(3,36,547,970),
+(3,37,578,1015),
+(3,38,610,1045),
+(3,39,643,1075),
+(3,40,667,1105),
+(3,41,702,1135),
+(3,42,738,1180),
+(3,43,775,1210),
+(3,44,803,1240),
+(3,45,842,1270),
+(3,46,872,1300),
+(3,47,913,1330),
+(3,48,955,1360),
+(3,49,994,1390),
+(3,50,1047,1420),
+(3,51,1067,1450),
+(3,52,1113,1480),
+(3,53,1150,1510),
+(3,54,1198,1540),
+(3,55,1237,1570),
+(3,56,1287,1600),
+(3,57,1328,1630),
+(3,58,1370,1660),
+(3,59,1423,1690),
+(3,60,1467,1720),
+(3,61,1633,1886),
+(3,62,1819,2053),
+(3,63,2003,2219),
+(3,64,2195,2385),
+(3,65,2397,2552),
+(3,66,2623,2718),
+(3,67,2844,2884),
+(3,68,3075,3050),
+(3,69,3316,3217),
+(3,70,3568,3383),
+(3,71,3834,3549),
+(3,72,4120,3716),
+(3,73,4427,3882),
+(3,74,4757,4048),
+(3,75,5112,4215),
+(3,76,5493,4381),
+(3,77,5903,4547),
+(3,78,6343,4713),
+(3,79,6816,4880),
+(3,80,7324,5046),
+(4,1,25,0),
+(4,2,32,0),
+(4,3,49,0),
+(4,4,56,0),
+(4,5,63,0),
+(4,6,70,0),
+(4,7,87,0),
+(4,8,94,0),
+(4,9,101,0),
+(4,10,118,0),
+(4,11,125,0),
+(4,12,142,0),
+(4,13,149,0),
+(4,14,156,0),
+(4,15,173,0),
+(4,16,181,0),
+(4,17,190,0),
+(4,18,200,0),
+(4,19,221,0),
+(4,20,233,0),
+(4,21,246,0),
+(4,22,260,0),
+(4,23,275,0),
+(4,24,301,0),
+(4,25,318,0),
+(4,26,336,0),
+(4,27,355,0),
+(4,28,375,0),
+(4,29,396,0),
+(4,30,428,0),
+(4,31,451,0),
+(4,32,475,0),
+(4,33,500,0),
+(4,34,526,0),
+(4,35,553,0),
+(4,36,581,0),
+(4,37,610,0),
+(4,38,640,0),
+(4,39,671,0),
+(4,40,703,0),
+(4,41,736,0),
+(4,42,770,0),
+(4,43,805,0),
+(4,44,841,0),
+(4,45,878,0),
+(4,46,916,0),
+(4,47,955,0),
+(4,48,995,0),
+(4,49,1026,0),
+(4,50,1068,0),
+(4,51,1111,0),
+(4,52,1155,0),
+(4,53,1200,0),
+(4,54,1246,0),
+(4,55,1283,0),
+(4,56,1331,0),
+(4,57,1380,0),
+(4,58,1430,0),
+(4,59,1471,0),
+(4,60,1523,0),
+(4,61,1702,0),
+(4,62,1879,0),
+(4,63,2077,0),
+(4,64,2285,0),
+(4,65,2489,0),
+(4,66,2717,0),
+(4,67,2941,0),
+(4,68,3190,0),
+(4,69,3450,0),
+(4,70,3704,0),
+(4,71,3980,0),
+(4,72,4277,0),
+(4,73,4596,0),
+(4,74,4939,0),
+(4,75,5307,0),
+(4,76,5703,0),
+(4,77,6128,0),
+(4,78,6585,0),
+(4,79,7076,0),
+(4,80,7604,0),
+(5,1,52,73),
+(5,2,57,76),
+(5,3,72,95),
+(5,4,77,114),
+(5,5,92,133),
+(5,6,97,152),
+(5,7,112,171),
+(5,8,117,190),
+(5,9,132,209),
+(5,10,137,212),
+(5,11,142,215),
+(5,12,157,234),
+(5,13,172,254),
+(5,14,177,260),
+(5,15,192,282),
+(5,16,197,305),
+(5,17,212,329),
+(5,18,227,339),
+(5,19,232,365),
+(5,20,247,377),
+(5,21,252,405),
+(5,22,268,434),
+(5,23,275,449),
+(5,24,293,480),
+(5,25,302,497),
+(5,26,322,530),
+(5,27,343,549),
+(5,28,355,584),
+(5,29,378,605),
+(5,30,392,627),
+(5,31,417,665),
+(5,32,433,689),
+(5,33,460,728),
+(5,34,478,752),
+(5,35,507,776),
+(5,36,527,800),
+(5,37,548,839),
+(5,38,580,863),
+(5,39,603,887),
+(5,40,637,911),
+(5,41,662,950),
+(5,42,698,974),
+(5,43,725,998),
+(5,44,763,1022),
+(5,45,792,1046),
+(5,46,822,1070),
+(5,47,863,1094),
+(5,48,895,1118),
+(5,49,928,1142),
+(5,50,972,1166),
+(5,51,1007,1190),
+(5,52,1053,1214),
+(5,53,1090,1238),
+(5,54,1128,1262),
+(5,55,1177,1271),
+(5,56,1217,1295),
+(5,57,1258,1319),
+(5,58,1300,1343),
+(5,59,1353,1352),
+(5,60,1397,1376),
+(5,61,1557,1500),
+(5,62,1738,1625),
+(5,63,1916,1749),
+(5,64,2101,1873),
+(5,65,2295,1998),
+(5,66,2495,2122),
+(5,67,2719,2247),
+(5,68,2936,2371),
+(5,69,3160,2495),
+(5,70,3391,2620),
+(5,71,3644,2744),
+(5,72,3916,2868),
+(5,73,4208,2993),
+(5,74,4522,3117),
+(5,75,4859,3242),
+(5,76,5221,3366),
+(5,77,5610,3490),
+(5,78,6028,3615),
+(5,79,6477,3739),
+(5,80,6960,3863),
+(6,1,22,0),
+(6,2,27,0),
+(6,3,32,0),
+(6,4,37,0),
+(6,5,42,0),
+(6,6,47,0),
+(6,7,52,0),
+(6,8,58,0),
+(6,9,64,0),
+(6,10,70,0),
+(6,11,77,0),
+(6,12,84,0),
+(6,13,92,0),
+(6,14,100,0),
+(6,15,117,0),
+(6,16,127,0),
+(6,17,138,0),
+(6,18,150,0),
+(6,19,163,0),
+(6,20,177,0),
+(6,21,192,0),
+(6,22,208,0),
+(6,23,225,0),
+(6,24,239,0),
+(6,25,258,0),
+(6,26,278,0),
+(6,27,299,0),
+(6,28,321,0),
+(6,29,344,0),
+(6,30,368,0),
+(6,31,393,0),
+(6,32,419,0),
+(6,33,446,0),
+(6,34,474,0),
+(6,35,503,0),
+(6,36,533,0),
+(6,37,564,0),
+(6,38,596,0),
+(6,39,629,0),
+(6,40,698,0),
+(6,41,698,0),
+(6,42,734,0),
+(6,43,771,0),
+(6,44,809,0),
+(6,45,849,0),
+(6,46,891,0),
+(6,47,935,0),
+(6,48,981,0),
+(6,49,1029,0),
+(6,50,1079,0),
+(6,51,1131,0),
+(6,52,1185,0),
+(6,53,1241,0),
+(6,54,1299,0),
+(6,55,1359,0),
+(6,56,1421,0),
+(6,57,1485,0),
+(6,58,1551,0),
+(6,59,1619,0),
+(6,60,1689,0),
+(6,61,1902,0),
+(6,62,2129,0),
+(6,63,2357,0),
+(6,64,2612,0),
+(6,65,2883,0),
+(6,66,3169,0),
+(6,67,3455,0),
+(6,68,3774,0),
+(6,69,4109,0),
+(6,70,4444,0),
+(6,71,4720,0),
+(6,72,5013,0),
+(6,73,5325,0),
+(6,74,5656,0),
+(6,75,6008,0),
+(6,76,6381,0),
+(6,77,6778,0),
+(6,78,7199,0),
+(6,79,7646,0),
+(6,80,8121,0),
+(7,1,37,85),
+(7,2,44,91),
+(7,3,51,98),
+(7,4,58,106),
+(7,5,65,115),
+(7,6,72,125),
+(7,7,79,136),
+(7,8,86,148),
+(7,9,93,161),
+(7,10,100,175),
+(7,11,107,190),
+(7,12,114,206),
+(7,13,121,223),
+(7,14,128,241),
+(7,15,135,260),
+(7,16,142,280),
+(7,17,150,301),
+(7,18,159,323),
+(7,19,169,346),
+(7,20,180,370),
+(7,21,192,395),
+(7,22,205,421),
+(7,23,219,448),
+(7,24,234,476),
+(7,25,240,505),
+(7,26,257,535),
+(7,27,275,566),
+(7,28,294,598),
+(7,29,314,631),
+(7,30,335,665),
+(7,31,347,699),
+(7,32,370,733),
+(7,33,394,767),
+(7,34,419,786),
+(7,35,435,820),
+(7,36,462,854),
+(7,37,490,888),
+(7,38,509,922),
+(7,39,539,941),
+(7,40,570,975),
+(7,41,592,1009),
+(7,42,625,1028),
+(7,43,649,1062),
+(7,44,684,1096),
+(7,45,710,1115),
+(7,46,747,1149),
+(7,47,775,1183),
+(7,48,814,1202),
+(7,49,844,1236),
+(7,50,885,1255),
+(7,51,917,1289),
+(7,52,960,1323),
+(7,53,994,1342),
+(7,54,1029,1376),
+(7,55,1075,1395),
+(7,56,1112,1414),
+(7,57,1150,1448),
+(7,58,1199,1467),
+(7,59,1239,1501),
+(7,60,1330,1520),
+(7,61,1428,1664),
+(7,62,1583,1808),
+(7,63,1760,1951),
+(7,64,1932,2095),
+(7,65,2114,2239),
+(7,66,2304,2383),
+(7,67,2504,2527),
+(7,68,2713,2670),
+(7,69,2931,2814),
+(7,70,3159,2958),
+(7,71,3395,3102),
+(7,72,3648,3246),
+(7,73,3920,3389),
+(7,74,4212,3533),
+(7,75,4526,3677),
+(7,76,4863,3821),
+(7,77,5226,3965),
+(7,78,5616,4108),
+(7,79,6035,4252),
+(7,80,6485,4396),
+(8,1,32,100),
+(8,2,47,110),
+(8,3,52,106),
+(8,4,67,118),
+(8,5,82,131),
+(8,6,97,130),
+(8,7,102,145),
+(8,8,117,146),
+(8,9,132,163),
+(8,10,137,196),
+(8,11,152,215),
+(8,12,167,220),
+(8,13,172,241),
+(8,14,187,263),
+(8,15,202,271),
+(8,16,207,295),
+(8,17,222,305),
+(8,18,237,331),
+(8,19,242,343),
+(8,20,257,371),
+(8,21,272,385),
+(8,22,277,415),
+(8,23,292,431),
+(8,24,298,463),
+(8,25,315,481),
+(8,26,333,515),
+(8,27,342,535),
+(8,28,362,556),
+(8,29,373,592),
+(8,30,395,613),
+(8,31,418,634),
+(8,32,432,670),
+(8,33,457,691),
+(8,34,473,712),
+(8,35,500,733),
+(8,36,518,754),
+(8,37,547,790),
+(8,38,577,811),
+(8,39,598,832),
+(8,40,630,853),
+(8,41,653,874),
+(8,42,687,895),
+(8,43,712,916),
+(8,44,748,937),
+(8,45,775,958),
+(8,46,813,979),
+(8,47,842,1000),
+(8,48,882,1021),
+(8,49,913,1042),
+(8,50,955,1048),
+(8,51,988,1069),
+(8,52,1032,1090),
+(8,53,1067,1111),
+(8,54,1103,1117),
+(8,55,1150,1138),
+(8,56,1188,1159),
+(8,57,1237,1165),
+(8,58,1277,1186),
+(8,59,1328,1192),
+(8,60,1370,1213),
+(8,61,1526,1316),
+(8,62,1702,1419),
+(8,63,1875,1521),
+(8,64,2070,1624),
+(8,65,2261,1727),
+(8,66,2461,1830),
+(8,67,2686,1932),
+(8,68,2906,2035),
+(8,69,3136,2138),
+(8,70,3393,2241),
+(8,71,3646,2343),
+(8,72,3918,2446),
+(8,73,4210,2549),
+(8,74,4524,2652),
+(8,75,4861,2754),
+(8,76,5223,2857),
+(8,77,5612,2960),
+(8,78,6030,3063),
+(8,79,6480,3165),
+(8,80,6963,3268),
+(9,1,23,90),
+(9,2,28,98),
+(9,3,43,107),
+(9,4,48,102),
+(9,5,63,113),
+(9,6,68,126),
+(9,7,83,144),
+(9,8,88,162),
+(9,9,93,180),
+(9,10,108,198),
+(9,11,123,200),
+(9,12,128,218),
+(9,13,143,237),
+(9,14,148,257),
+(9,15,153,278),
+(9,16,168,300),
+(9,17,173,308),
+(9,18,189,332),
+(9,19,196,357),
+(9,20,204,383),
+(9,21,223,395),
+(9,22,233,423),
+(9,23,244,452),
+(9,24,266,467),
+(9,25,279,498),
+(9,26,293,530),
+(9,27,318,548),
+(9,28,334,582),
+(9,29,351,602),
+(9,30,379,638),
+(9,31,398,674),
+(9,32,418,695),
+(9,33,439,731),
+(9,34,471,752),
+(9,35,494,788),
+(9,36,518,809),
+(9,37,543,830),
+(9,38,569,866),
+(9,39,606,887),
+(9,40,634,923),
+(9,41,663,944),
+(9,42,693,965),
+(9,43,724,1001),
+(9,44,756,1022),
+(9,45,799,1043),
+(9,46,832,1064),
+(9,47,868,1100),
+(9,48,904,1121),
+(9,49,941,1142),
+(9,50,979,1163),
+(9,51,1018,1184),
+(9,52,1058,1205),
+(9,53,1099,1226),
+(9,54,1141,1247),
+(9,55,1184,1268),
+(9,56,1228,1289),
+(9,57,1273,1310),
+(9,58,1319,1331),
+(9,59,1366,1352),
+(9,60,1414,1373),
+(9,61,1580,1497),
+(9,62,1755,1621),
+(9,63,1939,1745),
+(9,64,2133,1870),
+(9,65,2323,1994),
+(9,66,2535,2118),
+(9,67,2758,2242),
+(9,68,2991,2366),
+(9,69,3235,2490),
+(9,70,3490,2615),
+(9,71,3750,2739),
+(9,72,4025,2863),
+(9,73,4330,2987),
+(9,74,4646,3111),
+(9,75,4997,3235),
+(9,76,5373,3360),
+(9,77,5774,3483),
+(9,78,6207,3608),
+(9,79,6667,3732),
+(9,80,7136,3856),
+(11,1,44,60),
+(11,2,51,66),
+(11,3,58,73),
+(11,4,75,81),
+(11,5,82,90),
+(11,6,89,100),
+(11,7,106,111),
+(11,8,113,123),
+(11,9,120,136),
+(11,10,137,150),
+(11,11,144,165),
+(11,12,151,182),
+(11,13,168,200),
+(11,14,175,219),
+(11,15,182,239),
+(11,16,199,260),
+(11,17,206,282),
+(11,18,214,305),
+(11,19,233,329),
+(11,20,243,354),
+(11,21,254,380),
+(11,22,266,392),
+(11,23,289,420),
+(11,24,303,449),
+(11,25,318,479),
+(11,26,334,509),
+(11,27,361,524),
+(11,28,379,554),
+(11,29,398,584),
+(11,30,418,614),
+(11,31,439,629),
+(11,32,461,659),
+(11,33,494,689),
+(11,34,518,704),
+(11,35,543,734),
+(11,36,569,749),
+(11,37,596,779),
+(11,38,624,809),
+(11,39,653,824),
+(11,40,683,854),
+(11,41,714,869),
+(11,42,746,899),
+(11,43,779,914),
+(11,44,823,944),
+(11,45,858,959),
+(11,46,894,989),
+(11,47,921,1004),
+(11,48,959,1019),
+(11,49,998,1049),
+(11,50,1038,1064),
+(11,51,1079,1079),
+(11,52,1121,1109),
+(11,53,1164,1124),
+(11,54,1208,1139),
+(11,55,1253,1154),
+(11,56,1299,1169),
+(11,57,1346,1199),
+(11,58,1384,1214),
+(11,59,1433,1229),
+(11,60,1483,1244),
+(11,61,1657,1357),
+(11,62,1840,1469),
+(11,63,2020,1582),
+(11,64,2222,1694),
+(11,65,2433,1807),
+(11,66,2640,1919),
+(11,67,2872,2032),
+(11,68,3114,2145),
+(11,69,3351,2257),
+(11,70,3614,2370),
+(11,71,3883,2482),
+(11,72,4172,2595),
+(11,73,4483,2708),
+(11,74,4817,2820),
+(11,75,5176,2933),
+(11,76,5562,3045),
+(11,77,5977,3158),
+(11,78,6423,3270),
+(11,79,6902,3383),
+(11,80,7417,3496);
/*!40000 ALTER TABLE `player_classlevelstats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2413,6 +4557,4967 @@ CREATE TABLE `player_levelstats` (
LOCK TABLES `player_levelstats` WRITE;
/*!40000 ALTER TABLE `player_levelstats` DISABLE KEYS */;
+INSERT INTO `player_levelstats` VALUES
+(1,1,1,23,20,22,20,20),
+(1,1,2,24,21,23,20,20),
+(1,1,3,26,22,24,20,21),
+(1,1,4,27,22,26,20,21),
+(1,1,5,28,23,27,20,21),
+(1,1,6,30,24,28,20,21),
+(1,1,7,31,25,29,21,22),
+(1,1,8,32,26,30,21,22),
+(1,1,9,34,26,32,21,22),
+(1,1,10,35,27,33,21,23),
+(1,1,11,36,28,34,21,23),
+(1,1,12,38,29,35,21,23),
+(1,1,13,39,30,37,21,24),
+(1,1,14,41,31,38,21,24),
+(1,1,15,42,32,39,21,24),
+(1,1,16,44,33,41,21,25),
+(1,1,17,45,34,42,22,25),
+(1,1,18,47,34,43,22,25),
+(1,1,19,48,35,45,22,26),
+(1,1,20,50,36,46,22,26),
+(1,1,21,51,37,48,22,26),
+(1,1,22,53,38,49,22,27),
+(1,1,23,54,39,51,22,27),
+(1,1,24,56,40,52,23,28),
+(1,1,25,58,41,53,23,28),
+(1,1,26,59,42,55,23,28),
+(1,1,27,61,43,56,23,29),
+(1,1,28,63,44,58,23,29),
+(1,1,29,64,45,59,23,30),
+(1,1,30,66,46,61,24,30),
+(1,1,31,68,47,62,24,30),
+(1,1,32,69,48,64,24,31),
+(1,1,33,71,50,66,24,31),
+(1,1,34,73,51,67,24,32),
+(1,1,35,74,52,69,24,32),
+(1,1,36,76,53,70,25,33),
+(1,1,37,78,54,72,25,33),
+(1,1,38,80,55,74,25,34),
+(1,1,39,82,56,75,25,34),
+(1,1,40,83,57,77,25,35),
+(1,1,41,85,58,79,26,35),
+(1,1,42,87,60,80,26,35),
+(1,1,43,89,61,82,26,36),
+(1,1,44,91,62,84,26,36),
+(1,1,45,93,63,85,26,37),
+(1,1,46,95,64,87,27,37),
+(1,1,47,97,66,89,27,38),
+(1,1,48,99,67,91,27,38),
+(1,1,49,101,68,93,27,39),
+(1,1,50,103,69,94,28,40),
+(1,1,51,105,71,96,28,40),
+(1,1,52,107,72,98,28,41),
+(1,1,53,109,73,100,28,41),
+(1,1,54,111,74,102,29,42),
+(1,1,55,113,76,103,29,42),
+(1,1,56,115,77,105,29,43),
+(1,1,57,117,78,107,29,43),
+(1,1,58,119,79,109,30,44),
+(1,1,59,121,81,111,30,44),
+(1,1,60,123,82,113,30,45),
+(1,1,61,125,83,115,30,46),
+(1,1,62,127,85,117,31,46),
+(1,1,63,129,86,119,31,47),
+(1,1,64,132,88,121,31,47),
+(1,1,65,134,89,123,32,48),
+(1,1,66,136,90,125,32,49),
+(1,1,67,138,92,127,32,49),
+(1,1,68,140,93,129,32,50),
+(1,1,69,143,95,131,33,50),
+(1,1,70,145,96,133,33,51),
+(1,1,71,148,97,140,33,53),
+(1,1,72,156,99,143,33,54),
+(1,1,73,162,101,148,33,55),
+(1,1,74,162,102,148,34,55),
+(1,1,75,165,104,150,34,56),
+(1,1,76,171,106,156,34,57),
+(1,1,77,171,108,157,35,58),
+(1,1,78,174,109,159,35,58),
+(1,1,79,181,111,165,35,59),
+(1,1,80,184,113,168,36,60),
+(1,2,1,22,20,22,20,21),
+(1,2,2,23,21,23,21,22),
+(1,2,3,24,21,24,21,22),
+(1,2,4,25,22,25,22,23),
+(1,2,5,26,22,26,23,24),
+(1,2,6,28,23,27,23,25),
+(1,2,7,29,24,28,24,25),
+(1,2,8,30,24,29,25,26),
+(1,2,9,31,25,30,25,27),
+(1,2,10,32,25,32,26,27),
+(1,2,11,33,26,33,27,28),
+(1,2,12,35,27,34,27,29),
+(1,2,13,36,27,35,28,30),
+(1,2,14,37,28,36,29,31),
+(1,2,15,38,29,37,30,31),
+(1,2,16,40,29,38,30,32),
+(1,2,17,41,30,40,31,33),
+(1,2,18,42,31,41,32,34),
+(1,2,19,43,31,42,33,35),
+(1,2,20,45,32,43,33,35),
+(1,2,21,46,33,45,34,36),
+(1,2,22,47,33,46,35,37),
+(1,2,23,49,34,47,36,38),
+(1,2,24,50,35,48,37,39),
+(1,2,25,51,36,50,37,40),
+(1,2,26,53,36,51,38,41),
+(1,2,27,54,37,52,39,42),
+(1,2,28,56,38,54,40,43),
+(1,2,29,57,39,55,41,43),
+(1,2,30,58,39,56,42,44),
+(1,2,31,60,40,58,43,45),
+(1,2,32,61,41,59,43,46),
+(1,2,33,63,42,60,44,47),
+(1,2,34,64,43,62,45,48),
+(1,2,35,66,44,63,46,49),
+(1,2,36,67,44,65,47,50),
+(1,2,37,69,45,66,48,51),
+(1,2,38,70,46,67,49,52),
+(1,2,39,72,47,69,50,53),
+(1,2,40,73,48,70,51,54),
+(1,2,41,75,49,72,52,55),
+(1,2,42,77,49,73,53,56),
+(1,2,43,78,50,75,54,57),
+(1,2,44,80,51,76,55,58),
+(1,2,45,81,52,78,56,59),
+(1,2,46,83,53,79,57,61),
+(1,2,47,85,54,81,58,62),
+(1,2,48,86,55,83,59,63),
+(1,2,49,88,56,84,60,64),
+(1,2,50,90,57,86,61,65),
+(1,2,51,91,58,87,62,66),
+(1,2,52,93,59,89,63,67),
+(1,2,53,95,60,91,64,68),
+(1,2,54,97,61,92,65,69),
+(1,2,55,98,61,94,66,71),
+(1,2,56,100,62,95,67,72),
+(1,2,57,102,63,97,68,73),
+(1,2,58,104,64,99,69,74),
+(1,2,59,105,65,101,70,75),
+(1,2,60,107,66,102,71,77),
+(1,2,61,109,67,104,73,78),
+(1,2,62,111,69,106,74,79),
+(1,2,63,113,70,107,75,80),
+(1,2,64,115,71,109,76,81),
+(1,2,65,116,72,111,77,83),
+(1,2,66,118,73,113,78,84),
+(1,2,67,120,74,115,79,85),
+(1,2,68,122,75,116,81,86),
+(1,2,69,124,76,118,82,88),
+(1,2,70,126,77,120,83,89),
+(1,2,71,148,78,122,84,92),
+(1,2,72,150,79,125,86,94),
+(1,2,73,152,80,127,87,96),
+(1,2,74,156,82,129,89,97),
+(1,2,75,158,83,131,90,99),
+(1,2,76,162,84,134,92,100),
+(1,2,77,164,86,136,93,103),
+(1,2,78,167,87,138,95,105),
+(1,2,79,170,88,153,96,106),
+(1,2,80,173,90,160,98,108),
+(1,4,1,21,23,21,20,20),
+(1,4,2,22,24,22,20,20),
+(1,4,3,23,26,22,20,21),
+(1,4,4,23,27,23,20,21),
+(1,4,5,24,29,24,21,21),
+(1,4,6,25,30,25,21,22),
+(1,4,7,26,32,25,21,22),
+(1,4,8,26,33,26,21,23),
+(1,4,9,27,35,27,21,23),
+(1,4,10,28,36,27,21,23),
+(1,4,11,29,38,28,22,24),
+(1,4,12,30,39,29,22,24),
+(1,4,13,31,41,30,22,25),
+(1,4,14,31,43,31,22,25),
+(1,4,15,32,44,31,22,25),
+(1,4,16,33,46,32,23,26),
+(1,4,17,34,48,33,23,26),
+(1,4,18,35,49,34,23,27),
+(1,4,19,36,51,35,23,27),
+(1,4,20,37,53,35,23,28),
+(1,4,21,38,54,36,24,28),
+(1,4,22,39,56,37,24,29),
+(1,4,23,40,58,38,24,29),
+(1,4,24,41,60,39,24,30),
+(1,4,25,42,61,40,25,30),
+(1,4,26,43,63,41,25,31),
+(1,4,27,44,65,42,25,31),
+(1,4,28,45,67,43,25,32),
+(1,4,29,46,69,43,25,32),
+(1,4,30,47,71,44,26,33),
+(1,4,31,48,72,45,26,33),
+(1,4,32,49,74,46,26,34),
+(1,4,33,50,76,47,27,34),
+(1,4,34,51,78,48,27,35),
+(1,4,35,52,80,49,27,35),
+(1,4,36,53,82,50,27,36),
+(1,4,37,54,84,51,28,36),
+(1,4,38,55,86,52,28,37),
+(1,4,39,56,88,53,28,38),
+(1,4,40,57,90,54,28,38),
+(1,4,41,58,92,55,29,39),
+(1,4,42,60,94,56,29,39),
+(1,4,43,61,96,57,29,40),
+(1,4,44,62,98,58,30,40),
+(1,4,45,63,100,59,30,41),
+(1,4,46,64,103,61,30,42),
+(1,4,47,65,105,62,31,42),
+(1,4,48,66,107,63,31,43),
+(1,4,49,68,109,64,31,44),
+(1,4,50,69,111,65,32,44),
+(1,4,51,70,113,66,32,45),
+(1,4,52,71,116,67,32,45),
+(1,4,53,73,118,68,33,46),
+(1,4,54,74,120,69,33,47),
+(1,4,55,75,122,71,33,47),
+(1,4,56,76,125,72,34,48),
+(1,4,57,78,127,73,34,49),
+(1,4,58,79,129,74,34,49),
+(1,4,59,80,131,75,35,50),
+(1,4,60,81,134,77,35,51),
+(1,4,61,83,136,78,35,51),
+(1,4,62,84,138,79,36,52),
+(1,4,63,85,141,80,36,53),
+(1,4,64,87,143,81,37,54),
+(1,4,65,88,146,83,37,54),
+(1,4,66,89,148,84,37,55),
+(1,4,67,91,151,85,38,56),
+(1,4,68,92,153,86,38,57),
+(1,4,69,94,156,88,39,57),
+(1,4,70,95,158,89,39,58),
+(1,4,71,97,161,90,39,60),
+(1,4,72,99,164,92,40,60),
+(1,4,73,100,167,94,40,61),
+(1,4,74,102,170,95,41,62),
+(1,4,75,104,173,97,41,63),
+(1,4,76,105,176,98,41,64),
+(1,4,77,107,179,100,42,65),
+(1,4,78,109,183,106,42,66),
+(1,4,79,111,186,107,43,67),
+(1,4,80,113,189,109,43,69),
+(1,5,1,20,20,20,22,23),
+(1,5,2,20,20,20,23,24),
+(1,5,3,20,20,21,25,26),
+(1,5,4,20,21,21,26,27),
+(1,5,5,21,21,21,27,28),
+(1,5,6,21,21,22,29,30),
+(1,5,7,21,21,22,30,31),
+(1,5,8,21,22,23,31,33),
+(1,5,9,21,22,23,33,34),
+(1,5,10,21,22,23,34,36),
+(1,5,11,22,22,24,36,37),
+(1,5,12,22,23,24,37,39),
+(1,5,13,22,23,25,38,40),
+(1,5,14,22,23,25,40,42),
+(1,5,15,22,23,25,41,43),
+(1,5,16,23,24,26,43,45),
+(1,5,17,23,24,26,44,46),
+(1,5,18,23,24,27,46,48),
+(1,5,19,23,24,27,47,49),
+(1,5,20,23,25,28,49,51),
+(1,5,21,24,25,28,51,53),
+(1,5,22,24,25,29,52,54),
+(1,5,23,24,26,29,54,56),
+(1,5,24,24,26,30,55,58),
+(1,5,25,25,26,30,57,59),
+(1,5,26,25,27,31,59,61),
+(1,5,27,25,27,31,60,63),
+(1,5,28,25,27,32,62,65),
+(1,5,29,25,28,32,64,66),
+(1,5,30,26,28,33,65,68),
+(1,5,31,26,28,33,67,70),
+(1,5,32,26,29,34,69,72),
+(1,5,33,27,29,34,70,73),
+(1,5,34,27,29,35,72,75),
+(1,5,35,27,30,35,74,77),
+(1,5,36,27,30,36,76,79),
+(1,5,37,28,30,36,78,81),
+(1,5,38,28,31,37,79,83),
+(1,5,39,28,31,38,81,85),
+(1,5,40,28,31,38,83,87),
+(1,5,41,29,32,39,85,88),
+(1,5,42,29,32,39,87,90),
+(1,5,43,29,33,40,89,92),
+(1,5,44,30,33,40,91,94),
+(1,5,45,30,33,41,92,96),
+(1,5,46,30,34,42,94,98),
+(1,5,47,31,34,42,96,100),
+(1,5,48,31,35,43,98,102),
+(1,5,49,31,35,44,100,104),
+(1,5,50,32,36,44,102,106),
+(1,5,51,32,36,45,104,109),
+(1,5,52,32,36,45,106,111),
+(1,5,53,33,37,46,108,113),
+(1,5,54,33,37,47,110,115),
+(1,5,55,33,38,47,112,117),
+(1,5,56,34,38,48,114,119),
+(1,5,57,34,39,49,117,121),
+(1,5,58,34,39,49,119,124),
+(1,5,59,35,40,50,121,126),
+(1,5,60,35,40,51,123,128),
+(1,5,61,35,41,51,125,130),
+(1,5,62,36,41,52,127,132),
+(1,5,63,36,41,53,129,135),
+(1,5,64,37,42,54,132,137),
+(1,5,65,37,42,54,134,139),
+(1,5,66,37,43,55,136,142),
+(1,5,67,38,43,56,138,144),
+(1,5,68,38,44,57,140,146),
+(1,5,69,39,44,57,143,149),
+(1,5,70,39,45,58,145,151),
+(1,5,71,39,46,59,148,158),
+(1,5,72,40,46,59,151,161),
+(1,5,73,40,47,60,154,164),
+(1,5,74,41,47,61,156,167),
+(1,5,75,41,48,62,159,170),
+(1,5,76,41,49,63,162,174),
+(1,5,77,42,49,64,165,177),
+(1,5,78,42,50,65,168,180),
+(1,5,79,43,50,66,171,183),
+(1,5,80,43,51,67,174,186),
+(1,6,1,23,20,22,20,20),
+(1,6,2,24,21,23,20,20),
+(1,6,3,26,22,24,20,21),
+(1,6,4,27,22,26,20,21),
+(1,6,5,28,23,27,20,21),
+(1,6,6,30,24,28,20,21),
+(1,6,7,31,25,29,21,22),
+(1,6,8,32,26,30,21,22),
+(1,6,9,34,26,32,21,22),
+(1,6,10,35,27,33,21,23),
+(1,6,11,36,28,34,21,23),
+(1,6,12,38,29,35,21,23),
+(1,6,13,39,30,37,21,24),
+(1,6,14,41,31,38,21,24),
+(1,6,15,42,32,39,21,24),
+(1,6,16,44,33,41,21,25),
+(1,6,17,45,34,42,22,25),
+(1,6,18,47,34,43,22,25),
+(1,6,19,48,35,45,22,26),
+(1,6,20,50,36,46,22,26),
+(1,6,21,51,37,48,22,26),
+(1,6,22,53,38,49,22,27),
+(1,6,23,54,39,51,22,27),
+(1,6,24,56,40,52,23,28),
+(1,6,25,58,41,53,23,28),
+(1,6,26,59,42,55,23,28),
+(1,6,27,61,43,56,23,29),
+(1,6,28,63,44,58,23,29),
+(1,6,29,64,45,59,23,30),
+(1,6,30,66,46,61,24,30),
+(1,6,31,68,47,62,24,30),
+(1,6,32,69,48,64,24,31),
+(1,6,33,71,50,66,24,31),
+(1,6,34,73,51,67,24,32),
+(1,6,35,74,52,69,24,32),
+(1,6,36,76,53,70,25,33),
+(1,6,37,78,54,72,25,33),
+(1,6,38,80,55,74,25,34),
+(1,6,39,82,56,75,25,34),
+(1,6,40,83,57,77,25,35),
+(1,6,41,85,58,79,26,35),
+(1,6,42,87,60,80,26,35),
+(1,6,43,89,61,82,26,36),
+(1,6,44,91,62,84,26,36),
+(1,6,45,93,63,85,26,37),
+(1,6,46,95,64,87,27,37),
+(1,6,47,97,66,89,27,38),
+(1,6,48,99,67,91,27,38),
+(1,6,49,101,68,93,27,39),
+(1,6,50,103,69,94,28,40),
+(1,6,51,105,71,96,28,40),
+(1,6,52,106,72,97,28,41),
+(1,6,53,107,72,98,28,41),
+(1,6,54,107,73,98,29,42),
+(1,6,55,108,73,99,29,43),
+(1,6,56,111,75,102,29,44),
+(1,6,57,113,76,104,29,44),
+(1,6,58,118,77,106,30,45),
+(1,6,59,118,79,108,30,45),
+(1,6,60,123,80,110,30,46),
+(1,6,61,125,81,112,30,47),
+(1,6,62,128,83,114,30,47),
+(1,6,63,130,84,117,31,48),
+(1,6,64,130,86,119,31,48),
+(1,6,65,140,87,128,31,49),
+(1,6,66,143,89,131,31,50),
+(1,6,67,146,90,133,32,50),
+(1,6,68,148,92,135,32,51),
+(1,6,69,151,93,138,32,52),
+(1,6,70,154,95,140,32,52),
+(1,6,71,162,97,144,33,53),
+(1,6,72,164,98,146,33,54),
+(1,6,73,165,100,148,33,55),
+(1,6,74,166,102,151,33,55),
+(1,6,75,169,103,154,34,56),
+(1,6,76,172,105,157,34,57),
+(1,6,77,175,107,157,34,58),
+(1,6,78,176,108,157,34,58),
+(1,6,79,177,110,157,35,59),
+(1,6,80,180,112,160,35,60),
+(1,8,1,20,20,20,23,22),
+(1,8,2,20,20,20,24,23),
+(1,8,3,20,20,21,26,25),
+(1,8,4,20,20,21,27,26),
+(1,8,5,20,21,21,28,27),
+(1,8,6,20,21,21,30,29),
+(1,8,7,21,21,22,31,30),
+(1,8,8,21,21,22,33,31),
+(1,8,9,21,21,22,34,33),
+(1,8,10,21,21,23,36,34),
+(1,8,11,21,22,23,37,36),
+(1,8,12,21,22,23,39,37),
+(1,8,13,21,22,24,40,38),
+(1,8,14,21,22,24,42,40),
+(1,8,15,21,22,24,43,41),
+(1,8,16,21,23,25,45,43),
+(1,8,17,22,23,25,46,44),
+(1,8,18,22,23,25,48,46),
+(1,8,19,22,23,26,49,47),
+(1,8,20,22,23,26,51,49),
+(1,8,21,22,24,26,53,51),
+(1,8,22,22,24,27,54,52),
+(1,8,23,22,24,27,56,54),
+(1,8,24,23,24,28,58,55),
+(1,8,25,23,25,28,59,57),
+(1,8,26,23,25,28,61,59),
+(1,8,27,23,25,29,63,60),
+(1,8,28,23,25,29,65,62),
+(1,8,29,23,25,30,66,64),
+(1,8,30,24,26,30,68,65),
+(1,8,31,24,26,30,70,67),
+(1,8,32,24,26,31,72,69),
+(1,8,33,24,27,31,73,70),
+(1,8,34,24,27,32,75,72),
+(1,8,35,24,27,32,77,74),
+(1,8,36,25,27,33,79,76),
+(1,8,37,25,28,33,81,78),
+(1,8,38,25,28,34,83,79),
+(1,8,39,25,28,34,85,81),
+(1,8,40,25,28,35,87,83),
+(1,8,41,26,29,35,88,85),
+(1,8,42,26,29,35,90,87),
+(1,8,43,26,29,36,92,89),
+(1,8,44,26,30,36,94,91),
+(1,8,45,26,30,37,96,92),
+(1,8,46,27,30,37,98,94),
+(1,8,47,27,31,38,100,96),
+(1,8,48,27,31,38,102,98),
+(1,8,49,27,31,39,104,100),
+(1,8,50,28,32,40,106,102),
+(1,8,51,28,32,40,109,104),
+(1,8,52,28,32,41,111,106),
+(1,8,53,28,33,41,113,108),
+(1,8,54,29,33,42,115,110),
+(1,8,55,29,33,42,117,112),
+(1,8,56,29,34,43,119,114),
+(1,8,57,29,34,43,121,117),
+(1,8,58,30,34,44,124,119),
+(1,8,59,30,35,44,126,121),
+(1,8,60,30,35,45,128,123),
+(1,8,61,30,35,46,130,125),
+(1,8,62,31,36,46,132,127),
+(1,8,63,31,36,47,135,129),
+(1,8,64,31,37,47,137,132),
+(1,8,65,32,37,48,139,134),
+(1,8,66,32,37,49,142,136),
+(1,8,67,32,38,49,144,138),
+(1,8,68,32,38,50,146,140),
+(1,8,69,33,39,50,149,143),
+(1,8,70,33,39,51,151,145),
+(1,8,71,33,39,52,154,152),
+(1,8,72,33,40,53,160,155),
+(1,8,73,33,40,54,160,158),
+(1,8,74,34,41,54,163,160),
+(1,8,75,34,41,55,166,163),
+(1,8,76,34,41,56,169,166),
+(1,8,77,35,42,57,172,169),
+(1,8,78,35,42,57,175,173),
+(1,8,79,35,43,58,178,176),
+(1,8,80,36,43,59,181,179),
+(1,9,1,20,20,21,22,22),
+(1,9,2,20,20,22,23,23),
+(1,9,3,21,21,22,24,24),
+(1,9,4,21,21,23,26,25),
+(1,9,5,21,21,23,27,27),
+(1,9,6,21,22,24,28,28),
+(1,9,7,22,22,24,29,29),
+(1,9,8,22,23,25,30,30),
+(1,9,9,22,23,26,32,31),
+(1,9,10,23,23,26,33,33),
+(1,9,11,23,24,27,34,34),
+(1,9,12,23,24,27,35,35),
+(1,9,13,24,25,28,37,36),
+(1,9,14,24,25,29,38,38),
+(1,9,15,24,25,29,39,39),
+(1,9,16,25,26,30,41,40),
+(1,9,17,25,26,31,42,42),
+(1,9,18,25,27,31,43,43),
+(1,9,19,26,27,32,45,44),
+(1,9,20,26,28,33,46,46),
+(1,9,21,26,28,33,48,47),
+(1,9,22,27,29,34,49,49),
+(1,9,23,27,29,35,51,50),
+(1,9,24,28,30,35,52,51),
+(1,9,25,28,30,36,53,53),
+(1,9,26,28,31,37,55,54),
+(1,9,27,29,31,37,56,56),
+(1,9,28,29,32,38,58,57),
+(1,9,29,30,32,39,59,59),
+(1,9,30,30,33,40,61,60),
+(1,9,31,30,33,40,62,62),
+(1,9,32,31,34,41,64,63),
+(1,9,33,31,34,42,66,65),
+(1,9,34,32,35,43,67,66),
+(1,9,35,32,35,44,69,68),
+(1,9,36,33,36,44,70,69),
+(1,9,37,33,36,45,72,71),
+(1,9,38,34,37,46,74,73),
+(1,9,39,34,38,47,75,74),
+(1,9,40,35,38,48,77,76),
+(1,9,41,35,39,48,79,78),
+(1,9,42,35,39,49,80,79),
+(1,9,43,36,40,50,82,81),
+(1,9,44,36,40,51,84,83),
+(1,9,45,37,41,52,85,84),
+(1,9,46,37,42,53,87,86),
+(1,9,47,38,42,54,89,88),
+(1,9,48,38,43,55,91,89),
+(1,9,49,39,44,55,93,91),
+(1,9,50,40,44,56,94,93),
+(1,9,51,40,45,57,96,95),
+(1,9,52,41,45,58,98,97),
+(1,9,53,41,46,59,100,98),
+(1,9,54,42,47,60,102,100),
+(1,9,55,42,47,61,103,102),
+(1,9,56,43,48,62,105,104),
+(1,9,57,43,49,63,107,106),
+(1,9,58,44,49,64,109,108),
+(1,9,59,44,50,65,111,109),
+(1,9,60,45,51,66,113,111),
+(1,9,61,46,51,67,115,113),
+(1,9,62,46,52,68,117,115),
+(1,9,63,47,53,69,119,117),
+(1,9,64,47,54,70,121,119),
+(1,9,65,48,54,71,123,121),
+(1,9,66,49,55,72,125,123),
+(1,9,67,49,56,73,127,125),
+(1,9,68,50,57,74,129,127),
+(1,9,69,50,57,75,131,129),
+(1,9,70,51,58,76,133,131),
+(1,9,71,52,59,78,135,146),
+(1,9,72,53,59,79,138,148),
+(1,9,73,54,60,80,140,151),
+(1,9,74,54,61,89,143,154),
+(1,9,75,55,62,91,145,156),
+(1,9,76,56,63,92,148,159),
+(1,9,77,57,64,93,151,162),
+(1,9,78,57,65,95,153,165),
+(1,9,79,58,66,96,156,168),
+(1,9,80,59,67,97,159,170),
+(2,1,1,26,17,24,17,23),
+(2,1,2,27,18,25,17,23),
+(2,1,3,29,19,26,17,24),
+(2,1,4,30,19,27,17,24),
+(2,1,5,31,20,29,17,24),
+(2,1,6,32,21,30,17,24),
+(2,1,7,34,22,31,18,25),
+(2,1,8,35,23,32,18,25),
+(2,1,9,37,24,34,18,25),
+(2,1,10,38,24,35,18,26),
+(2,1,11,39,25,36,18,26),
+(2,1,12,41,26,37,18,26),
+(2,1,13,42,27,39,18,27),
+(2,1,14,44,28,40,18,27),
+(2,1,15,45,29,41,18,27),
+(2,1,16,47,30,43,19,28),
+(2,1,17,48,31,44,19,28),
+(2,1,18,50,32,45,19,28),
+(2,1,19,51,33,47,19,29),
+(2,1,20,53,34,48,19,29),
+(2,1,21,54,34,50,19,29),
+(2,1,22,56,35,51,19,30),
+(2,1,23,57,36,52,20,30),
+(2,1,24,59,37,54,20,30),
+(2,1,25,60,38,55,20,31),
+(2,1,26,62,39,57,20,31),
+(2,1,27,64,40,58,20,32),
+(2,1,28,65,41,60,20,32),
+(2,1,29,67,43,61,21,32),
+(2,1,30,69,44,63,21,33),
+(2,1,31,70,45,64,21,33),
+(2,1,32,72,46,66,21,34),
+(2,1,33,74,47,67,21,34),
+(2,1,34,76,48,69,21,35),
+(2,1,35,77,49,71,22,35),
+(2,1,36,79,50,72,22,36),
+(2,1,37,81,51,74,22,36),
+(2,1,38,83,52,76,22,36),
+(2,1,39,84,53,77,22,37),
+(2,1,40,86,55,79,23,37),
+(2,1,41,88,56,81,23,38),
+(2,1,42,90,57,82,23,38),
+(2,1,43,92,58,84,23,39),
+(2,1,44,94,59,86,23,39),
+(2,1,45,96,60,87,24,40),
+(2,1,46,98,62,89,24,40),
+(2,1,47,100,63,91,24,41),
+(2,1,48,101,64,93,24,41),
+(2,1,49,103,65,94,25,42),
+(2,1,50,105,66,96,25,42),
+(2,1,51,107,68,98,25,43),
+(2,1,52,109,69,100,25,43),
+(2,1,53,111,70,102,25,44),
+(2,1,54,113,71,104,26,45),
+(2,1,55,115,73,105,26,45),
+(2,1,56,118,74,107,26,46),
+(2,1,57,120,75,109,26,46),
+(2,1,58,122,77,111,27,47),
+(2,1,59,124,78,113,27,47),
+(2,1,60,126,79,115,27,48),
+(2,1,61,128,81,117,27,48),
+(2,1,62,130,82,119,28,49),
+(2,1,63,132,83,121,28,50),
+(2,1,64,135,85,123,28,50),
+(2,1,65,137,86,125,29,51),
+(2,1,66,139,87,127,29,52),
+(2,1,67,141,89,129,29,52),
+(2,1,68,143,90,131,29,53),
+(2,1,69,146,92,133,30,53),
+(2,1,70,148,93,135,30,54),
+(2,1,71,157,94,142,30,55),
+(2,1,72,162,96,148,30,56),
+(2,1,73,165,98,150,30,57),
+(2,1,74,168,99,153,31,57),
+(2,1,75,170,101,154,31,58),
+(2,1,76,172,103,156,31,59),
+(2,1,77,174,105,159,32,60),
+(2,1,78,179,106,162,32,60),
+(2,1,79,184,108,167,32,61),
+(2,1,80,187,110,170,33,62),
+(2,3,1,23,20,23,17,24),
+(2,3,2,23,21,24,18,25),
+(2,3,3,24,23,25,18,25),
+(2,3,4,24,24,26,19,26),
+(2,3,5,25,25,27,19,26),
+(2,3,6,25,27,28,20,27),
+(2,3,7,26,28,28,21,28),
+(2,3,8,26,30,29,21,28),
+(2,3,9,26,31,30,22,29),
+(2,3,10,27,33,31,22,30),
+(2,3,11,27,34,32,23,30),
+(2,3,12,28,36,33,24,31),
+(2,3,13,28,37,34,24,32),
+(2,3,14,29,39,35,25,33),
+(2,3,15,29,40,36,26,33),
+(2,3,16,30,42,37,26,34),
+(2,3,17,30,43,39,27,35),
+(2,3,18,31,45,40,28,35),
+(2,3,19,31,47,41,28,36),
+(2,3,20,32,48,42,29,37),
+(2,3,21,32,50,43,30,38),
+(2,3,22,33,51,44,31,39),
+(2,3,23,34,53,45,31,39),
+(2,3,24,34,55,46,32,40),
+(2,3,25,35,57,47,33,41),
+(2,3,26,35,58,48,34,42),
+(2,3,27,36,60,50,34,43),
+(2,3,28,36,62,51,35,43),
+(2,3,29,37,63,52,36,44),
+(2,3,30,38,65,53,37,45),
+(2,3,31,38,67,54,37,46),
+(2,3,32,39,69,56,38,47),
+(2,3,33,39,71,57,39,48),
+(2,3,34,40,72,58,40,49),
+(2,3,35,41,74,59,41,49),
+(2,3,36,41,76,61,42,50),
+(2,3,37,42,78,62,42,51),
+(2,3,38,43,80,63,43,52),
+(2,3,39,43,82,64,44,53),
+(2,3,40,44,84,66,45,54),
+(2,3,41,45,86,67,46,55),
+(2,3,42,45,88,68,47,56),
+(2,3,43,46,90,70,47,57),
+(2,3,44,47,91,71,48,58),
+(2,3,45,47,93,72,49,59),
+(2,3,46,48,95,74,50,60),
+(2,3,47,49,98,75,51,61),
+(2,3,48,50,100,77,52,62),
+(2,3,49,50,102,78,53,63),
+(2,3,50,51,104,79,54,64),
+(2,3,51,52,106,81,55,65),
+(2,3,52,52,108,82,56,66),
+(2,3,53,53,110,84,57,67),
+(2,3,54,54,112,85,58,68),
+(2,3,55,55,114,87,59,69),
+(2,3,56,55,116,88,60,70),
+(2,3,57,56,118,90,61,71),
+(2,3,58,57,121,91,62,72),
+(2,3,59,58,123,93,63,73),
+(2,3,60,59,125,94,64,74),
+(2,3,61,59,127,96,65,76),
+(2,3,62,60,130,97,66,77),
+(2,3,63,61,132,99,67,78),
+(2,3,64,62,134,100,68,79),
+(2,3,65,63,136,102,69,80),
+(2,3,66,64,139,104,70,81),
+(2,3,67,64,141,105,71,82),
+(2,3,68,65,143,107,72,84),
+(2,3,69,66,146,108,73,85),
+(2,3,70,67,148,110,74,86),
+(2,3,71,68,151,112,75,87),
+(2,3,72,69,154,114,76,88),
+(2,3,73,70,157,116,77,90),
+(2,3,74,71,160,118,79,91),
+(2,3,75,72,163,120,80,93),
+(2,3,76,73,166,122,81,94),
+(2,3,77,74,169,124,83,96),
+(2,3,78,75,172,126,84,97),
+(2,3,79,76,175,128,85,99),
+(2,3,80,77,178,130,87,100),
+(2,4,1,24,20,23,17,23),
+(2,4,2,25,21,24,17,23),
+(2,4,3,25,23,24,17,24),
+(2,4,4,26,24,25,17,24),
+(2,4,5,27,26,26,18,24),
+(2,4,6,28,27,26,18,25),
+(2,4,7,29,29,27,18,25),
+(2,4,8,29,30,28,18,26),
+(2,4,9,30,32,29,18,26),
+(2,4,10,31,33,29,19,26),
+(2,4,11,32,35,30,19,27),
+(2,4,12,33,37,31,19,27),
+(2,4,13,34,38,32,19,28),
+(2,4,14,34,40,32,19,28),
+(2,4,15,35,41,33,19,28),
+(2,4,16,36,43,34,20,29),
+(2,4,17,37,45,35,20,29),
+(2,4,18,38,46,36,20,30),
+(2,4,19,39,48,37,20,30),
+(2,4,20,40,50,37,21,31),
+(2,4,21,41,52,38,21,31),
+(2,4,22,42,53,39,21,31),
+(2,4,23,43,55,40,21,32),
+(2,4,24,43,57,41,21,32),
+(2,4,25,44,59,42,22,33),
+(2,4,26,45,60,43,22,33),
+(2,4,27,46,62,44,22,34),
+(2,4,28,47,64,44,22,34),
+(2,4,29,48,66,45,23,35),
+(2,4,30,49,68,46,23,35),
+(2,4,31,50,70,47,23,36),
+(2,4,32,51,72,48,23,36),
+(2,4,33,53,73,49,24,37),
+(2,4,34,54,75,50,24,38),
+(2,4,35,55,77,51,24,38),
+(2,4,36,56,79,52,24,39),
+(2,4,37,57,81,53,25,39),
+(2,4,38,58,83,54,25,40),
+(2,4,39,59,85,55,25,40),
+(2,4,40,60,87,56,26,41),
+(2,4,41,61,89,57,26,41),
+(2,4,42,62,91,58,26,42),
+(2,4,43,63,93,59,27,43),
+(2,4,44,65,95,60,27,43),
+(2,4,45,66,98,61,27,44),
+(2,4,46,67,100,62,27,44),
+(2,4,47,68,102,64,28,45),
+(2,4,48,69,104,65,28,46),
+(2,4,49,71,106,66,28,46),
+(2,4,50,72,108,67,29,47),
+(2,4,51,73,110,68,29,48),
+(2,4,52,74,113,69,29,48),
+(2,4,53,75,115,70,30,49),
+(2,4,54,77,117,71,30,50),
+(2,4,55,78,119,73,30,50),
+(2,4,56,79,122,74,31,51),
+(2,4,57,80,124,75,31,52),
+(2,4,58,82,126,76,31,52),
+(2,4,59,83,129,77,32,53),
+(2,4,60,84,131,78,32,54),
+(2,4,61,86,133,80,33,54),
+(2,4,62,87,136,81,33,55),
+(2,4,63,88,138,82,33,56),
+(2,4,64,90,140,83,34,57),
+(2,4,65,91,143,85,34,57),
+(2,4,66,92,145,86,34,58),
+(2,4,67,94,148,87,35,59),
+(2,4,68,95,150,88,35,59),
+(2,4,69,97,153,90,36,60),
+(2,4,70,98,155,91,36,61),
+(2,4,71,100,158,92,36,62),
+(2,4,72,102,161,94,37,62),
+(2,4,73,103,164,99,37,63),
+(2,4,74,105,167,100,38,64),
+(2,4,75,107,170,102,38,65),
+(2,4,76,108,173,102,38,66),
+(2,4,77,110,176,102,39,67),
+(2,4,78,112,180,103,39,68),
+(2,4,79,114,183,105,40,69),
+(2,4,80,116,186,107,40,70),
+(2,6,1,26,17,24,17,23),
+(2,6,2,27,18,25,17,23),
+(2,6,3,29,19,26,17,24),
+(2,6,4,30,19,27,17,24),
+(2,6,5,31,20,29,17,24),
+(2,6,6,32,21,30,17,24),
+(2,6,7,34,22,31,18,25),
+(2,6,8,35,23,32,18,25),
+(2,6,9,37,24,34,18,25),
+(2,6,10,38,24,35,18,26),
+(2,6,11,39,25,36,18,26),
+(2,6,12,41,26,37,18,26),
+(2,6,13,42,27,39,18,27),
+(2,6,14,44,28,40,18,27),
+(2,6,15,45,29,41,18,27),
+(2,6,16,47,30,43,19,28),
+(2,6,17,48,31,44,19,28),
+(2,6,18,50,32,45,19,28),
+(2,6,19,51,33,47,19,29),
+(2,6,20,53,34,48,19,29),
+(2,6,21,54,34,50,19,29),
+(2,6,22,56,35,51,19,30),
+(2,6,23,57,36,52,20,30),
+(2,6,24,59,37,54,20,30),
+(2,6,25,60,38,55,20,31),
+(2,6,26,62,39,57,20,31),
+(2,6,27,64,40,58,20,32),
+(2,6,28,65,41,60,20,32),
+(2,6,29,67,43,61,21,32),
+(2,6,30,69,44,63,21,33),
+(2,6,31,70,45,64,21,33),
+(2,6,32,72,46,66,21,34),
+(2,6,33,74,47,67,21,34),
+(2,6,34,76,48,69,21,35),
+(2,6,35,77,49,71,22,35),
+(2,6,36,79,50,72,22,36),
+(2,6,37,81,51,74,22,36),
+(2,6,38,83,52,76,22,36),
+(2,6,39,84,53,77,22,37),
+(2,6,40,86,55,79,23,37),
+(2,6,41,88,56,81,23,38),
+(2,6,42,90,57,82,23,38),
+(2,6,43,92,58,84,23,39),
+(2,6,44,94,59,86,23,39),
+(2,6,45,96,60,87,24,40),
+(2,6,46,98,62,89,24,40),
+(2,6,47,100,63,91,24,41),
+(2,6,48,101,64,93,24,41),
+(2,6,49,103,65,94,25,42),
+(2,6,50,105,66,96,25,42),
+(2,6,51,107,68,98,25,43),
+(2,6,52,109,69,100,25,43),
+(2,6,53,110,69,100,25,44),
+(2,6,54,111,70,101,26,45),
+(2,6,55,111,70,101,26,45),
+(2,6,56,114,72,104,26,46),
+(2,6,57,116,73,106,26,46),
+(2,6,58,118,74,108,27,47),
+(2,6,59,124,76,110,27,47),
+(2,6,60,126,77,112,27,48),
+(2,6,61,128,78,114,27,49),
+(2,6,62,131,80,116,27,49),
+(2,6,63,133,81,119,28,50),
+(2,6,64,136,83,121,28,50),
+(2,6,65,136,84,123,28,51),
+(2,6,66,142,86,126,28,52),
+(2,6,67,145,87,128,29,52),
+(2,6,68,147,89,130,29,53),
+(2,6,69,150,90,133,29,54),
+(2,6,70,157,92,135,29,54),
+(2,6,71,160,94,138,30,55),
+(2,6,72,163,95,140,30,56),
+(2,6,73,166,97,151,30,57),
+(2,6,74,169,99,154,30,57),
+(2,6,75,172,100,156,31,58),
+(2,6,76,175,102,160,31,59),
+(2,6,77,179,104,162,31,60),
+(2,6,78,182,105,165,31,60),
+(2,6,79,191,107,168,32,61),
+(2,6,80,194,109,171,32,62),
+(2,7,1,24,17,23,18,25),
+(2,7,2,25,17,24,19,26),
+(2,7,3,26,18,25,20,27),
+(2,7,4,26,18,26,21,28),
+(2,7,5,27,19,27,22,29),
+(2,7,6,28,19,28,23,30),
+(2,7,7,29,20,29,24,31),
+(2,7,8,30,20,30,25,32),
+(2,7,9,31,21,31,26,33),
+(2,7,10,32,21,32,27,34),
+(2,7,11,33,22,33,28,36),
+(2,7,12,34,22,34,29,37),
+(2,7,13,34,23,35,30,38),
+(2,7,14,35,23,36,31,39),
+(2,7,15,36,24,37,32,40),
+(2,7,16,37,24,39,33,41),
+(2,7,17,38,25,40,34,43),
+(2,7,18,39,25,41,35,44),
+(2,7,19,40,26,42,36,45),
+(2,7,20,41,26,43,37,46),
+(2,7,21,42,27,44,38,47),
+(2,7,22,43,27,45,39,49),
+(2,7,23,44,28,47,40,50),
+(2,7,24,45,28,48,41,51),
+(2,7,25,47,29,49,43,52),
+(2,7,26,48,30,50,44,54),
+(2,7,27,49,30,52,45,55),
+(2,7,28,50,31,53,46,56),
+(2,7,29,51,31,54,47,58),
+(2,7,30,52,32,55,48,59),
+(2,7,31,53,33,57,50,60),
+(2,7,32,54,33,58,51,62),
+(2,7,33,55,34,59,52,63),
+(2,7,34,57,34,61,53,65),
+(2,7,35,58,35,62,55,66),
+(2,7,36,59,36,63,56,67),
+(2,7,37,60,36,65,57,69),
+(2,7,38,61,37,66,58,70),
+(2,7,39,62,38,67,60,72),
+(2,7,40,64,38,69,61,73),
+(2,7,41,65,39,70,62,75),
+(2,7,42,66,40,72,64,76),
+(2,7,43,67,40,73,65,78),
+(2,7,44,69,41,74,66,79),
+(2,7,45,70,42,76,68,81),
+(2,7,46,71,42,77,69,82),
+(2,7,47,72,43,79,70,84),
+(2,7,48,74,44,80,72,85),
+(2,7,49,75,45,82,73,87),
+(2,7,50,76,45,83,75,89),
+(2,7,51,78,46,85,76,90),
+(2,7,52,79,47,86,77,92),
+(2,7,53,80,47,88,79,93),
+(2,7,54,82,48,90,80,95),
+(2,7,55,83,49,91,82,97),
+(2,7,56,85,50,93,83,98),
+(2,7,57,86,50,94,85,100),
+(2,7,58,87,51,96,86,102),
+(2,7,59,89,52,97,88,103),
+(2,7,60,90,53,99,89,105),
+(2,7,61,92,54,101,91,107),
+(2,7,62,93,54,102,92,109),
+(2,7,63,95,55,104,94,110),
+(2,7,64,96,56,106,95,112),
+(2,7,65,97,57,107,97,114),
+(2,7,66,99,58,109,99,116),
+(2,7,67,100,58,111,100,118),
+(2,7,68,102,59,113,102,119),
+(2,7,69,103,60,114,103,121),
+(2,7,70,105,61,116,105,123),
+(2,7,71,106,62,118,117,125),
+(2,7,72,108,63,120,119,128),
+(2,7,73,110,64,122,122,130),
+(2,7,74,112,65,125,124,132),
+(2,7,75,114,66,127,126,134),
+(2,7,76,116,67,129,128,137),
+(2,7,77,117,68,131,128,139),
+(2,7,78,119,69,133,133,141),
+(2,7,79,121,70,136,135,144),
+(2,7,80,123,71,138,137,146),
+(2,9,1,23,17,23,19,25),
+(2,9,2,23,17,24,20,26),
+(2,9,3,24,18,24,21,27),
+(2,9,4,24,18,25,23,28),
+(2,9,5,24,18,25,24,30),
+(2,9,6,24,19,26,25,31),
+(2,9,7,25,19,26,26,32),
+(2,9,8,25,20,27,27,33),
+(2,9,9,25,20,27,29,34),
+(2,9,10,26,20,28,30,36),
+(2,9,11,26,21,29,31,37),
+(2,9,12,26,21,29,33,38),
+(2,9,13,27,22,30,34,39),
+(2,9,14,27,22,31,35,41),
+(2,9,15,27,23,31,37,42),
+(2,9,16,28,23,32,38,43),
+(2,9,17,28,23,32,39,45),
+(2,9,18,28,24,33,41,46),
+(2,9,19,29,24,34,42,47),
+(2,9,20,29,25,34,43,49),
+(2,9,21,29,25,35,45,50),
+(2,9,22,30,26,36,46,51),
+(2,9,23,30,26,37,48,53),
+(2,9,24,30,27,37,49,54),
+(2,9,25,31,27,38,51,56),
+(2,9,26,31,28,39,52,57),
+(2,9,27,32,28,39,54,59),
+(2,9,28,32,29,40,55,60),
+(2,9,29,32,29,41,57,62),
+(2,9,30,33,30,42,58,63),
+(2,9,31,33,30,42,60,65),
+(2,9,32,34,31,43,61,66),
+(2,9,33,34,31,44,63,68),
+(2,9,34,35,32,45,64,69),
+(2,9,35,35,32,45,66,71),
+(2,9,36,36,33,46,68,72),
+(2,9,37,36,34,47,69,74),
+(2,9,38,36,34,48,71,76),
+(2,9,39,37,35,49,72,77),
+(2,9,40,37,35,50,74,79),
+(2,9,41,38,36,50,76,80),
+(2,9,42,38,36,51,77,82),
+(2,9,43,39,37,52,79,84),
+(2,9,44,39,38,53,81,85),
+(2,9,45,40,38,54,83,87),
+(2,9,46,40,39,55,84,89),
+(2,9,47,41,39,56,86,91),
+(2,9,48,41,40,56,88,92),
+(2,9,49,42,41,57,90,94),
+(2,9,50,42,41,58,91,96),
+(2,9,51,43,42,59,93,98),
+(2,9,52,43,43,60,95,99),
+(2,9,53,44,43,61,97,101),
+(2,9,54,45,44,62,99,103),
+(2,9,55,45,45,63,101,105),
+(2,9,56,46,45,64,102,107),
+(2,9,57,46,46,65,104,109),
+(2,9,58,47,47,66,106,110),
+(2,9,59,47,47,67,108,112),
+(2,9,60,48,48,68,110,114),
+(2,9,61,48,49,69,112,116),
+(2,9,62,49,49,70,114,118),
+(2,9,63,50,50,71,116,120),
+(2,9,64,50,51,72,118,122),
+(2,9,65,51,51,73,120,124),
+(2,9,66,52,52,74,122,126),
+(2,9,67,52,53,75,124,128),
+(2,9,68,53,54,76,126,130),
+(2,9,69,53,54,77,128,132),
+(2,9,70,54,55,78,130,134),
+(2,9,71,55,56,88,134,145),
+(2,9,72,56,56,89,135,147),
+(2,9,73,57,57,90,137,150),
+(2,9,74,57,58,91,142,153),
+(2,9,75,58,59,93,142,155),
+(2,9,76,59,60,94,145,158),
+(2,9,77,60,61,95,148,161),
+(2,9,78,60,62,97,150,164),
+(2,9,79,61,63,98,153,167),
+(2,9,80,62,64,99,156,169),
+(3,1,1,25,16,25,19,19),
+(3,1,2,26,17,26,19,19),
+(3,1,3,28,18,27,19,20),
+(3,1,4,29,18,28,19,20),
+(3,1,5,30,19,30,19,20),
+(3,1,6,31,20,31,19,20),
+(3,1,7,33,21,32,20,21),
+(3,1,8,34,22,33,20,21),
+(3,1,9,36,23,35,20,21),
+(3,1,10,37,23,36,20,22),
+(3,1,11,38,24,37,20,22),
+(3,1,12,40,25,38,20,22),
+(3,1,13,41,26,40,20,23),
+(3,1,14,43,27,41,20,23),
+(3,1,15,44,28,42,20,23),
+(3,1,16,46,29,44,21,24),
+(3,1,17,47,30,45,21,24),
+(3,1,18,49,31,46,21,24),
+(3,1,19,50,32,48,21,25),
+(3,1,20,52,33,49,21,25),
+(3,1,21,53,34,51,21,26),
+(3,1,22,55,34,52,21,26),
+(3,1,23,56,35,53,21,26),
+(3,1,24,58,36,55,22,27),
+(3,1,25,59,37,56,22,27),
+(3,1,26,61,38,58,22,27),
+(3,1,27,63,39,59,22,28),
+(3,1,28,64,41,61,22,28),
+(3,1,29,66,42,62,22,29),
+(3,1,30,68,43,64,23,29),
+(3,1,31,69,44,65,23,30),
+(3,1,32,71,45,67,23,30),
+(3,1,33,73,46,68,23,30),
+(3,1,34,75,47,70,23,31),
+(3,1,35,76,48,72,24,31),
+(3,1,36,78,49,73,24,32),
+(3,1,37,80,50,75,24,32),
+(3,1,38,82,51,76,24,33),
+(3,1,39,84,52,78,24,33),
+(3,1,40,85,54,80,24,34),
+(3,1,41,87,55,81,25,34),
+(3,1,42,89,56,83,25,35),
+(3,1,43,91,57,85,25,35),
+(3,1,44,93,58,87,25,36),
+(3,1,45,95,59,88,26,36),
+(3,1,46,97,61,90,26,37),
+(3,1,47,99,62,92,26,37),
+(3,1,48,101,63,94,26,38),
+(3,1,49,102,64,95,26,38),
+(3,1,50,104,65,97,27,39),
+(3,1,51,106,67,99,27,39),
+(3,1,52,108,68,101,27,40),
+(3,1,53,110,69,103,27,40),
+(3,1,54,112,70,104,28,41),
+(3,1,55,115,72,106,28,41),
+(3,1,56,117,73,108,28,42),
+(3,1,57,119,74,110,28,42),
+(3,1,58,121,76,112,29,43),
+(3,1,59,123,77,114,29,43),
+(3,1,60,125,78,116,29,44),
+(3,1,61,127,80,118,29,45),
+(3,1,62,129,81,120,30,45),
+(3,1,63,131,82,122,30,46),
+(3,1,64,134,84,124,30,46),
+(3,1,65,136,85,126,31,47),
+(3,1,66,138,86,128,31,48),
+(3,1,67,140,88,130,31,48),
+(3,1,68,142,89,132,31,49),
+(3,1,69,145,91,134,32,49),
+(3,1,70,147,92,136,32,50),
+(3,1,71,150,93,138,32,51),
+(3,1,72,152,95,141,32,52),
+(3,1,73,164,97,151,32,53),
+(3,1,74,164,98,151,33,53),
+(3,1,75,170,100,156,33,54),
+(3,1,76,173,102,160,33,55),
+(3,1,77,173,104,160,34,56),
+(3,1,78,176,105,162,34,56),
+(3,1,79,183,107,168,34,57),
+(3,1,80,186,109,171,35,58),
+(3,2,1,24,16,25,19,20),
+(3,2,2,25,17,26,20,21),
+(3,2,3,26,17,27,20,21),
+(3,2,4,27,18,28,21,22),
+(3,2,5,28,18,29,22,23),
+(3,2,6,29,19,30,22,24),
+(3,2,7,31,20,31,23,24),
+(3,2,8,32,20,32,24,25),
+(3,2,9,33,21,33,24,26),
+(3,2,10,34,21,34,25,26),
+(3,2,11,35,22,36,26,27),
+(3,2,12,36,23,37,26,28),
+(3,2,13,38,23,38,27,29),
+(3,2,14,39,24,39,28,30),
+(3,2,15,40,25,40,29,30),
+(3,2,16,41,25,41,29,31),
+(3,2,17,43,26,43,30,32),
+(3,2,18,44,27,44,31,33),
+(3,2,19,45,28,45,32,34),
+(3,2,20,47,28,46,32,35),
+(3,2,21,48,29,47,33,35),
+(3,2,22,49,30,49,34,36),
+(3,2,23,51,30,50,35,37),
+(3,2,24,52,31,51,36,38),
+(3,2,25,53,32,52,36,39),
+(3,2,26,55,33,54,37,40),
+(3,2,27,56,33,55,38,41),
+(3,2,28,57,34,56,39,42),
+(3,2,29,59,35,58,40,43),
+(3,2,30,60,36,59,41,43),
+(3,2,31,62,37,60,42,44),
+(3,2,32,63,37,62,42,45),
+(3,2,33,65,38,63,43,46),
+(3,2,34,66,39,65,44,47),
+(3,2,35,68,40,66,45,48),
+(3,2,36,69,41,67,46,49),
+(3,2,37,71,41,69,47,50),
+(3,2,38,72,42,70,48,51),
+(3,2,39,74,43,72,49,52),
+(3,2,40,75,44,73,50,53),
+(3,2,41,77,45,75,51,54),
+(3,2,42,78,46,76,52,55),
+(3,2,43,80,47,78,53,56),
+(3,2,44,82,47,79,54,57),
+(3,2,45,83,48,81,55,59),
+(3,2,46,85,49,82,56,60),
+(3,2,47,87,50,84,57,61),
+(3,2,48,88,51,85,58,62),
+(3,2,49,90,52,87,59,63),
+(3,2,50,92,53,89,60,64),
+(3,2,51,93,54,90,61,65),
+(3,2,52,95,55,92,62,66),
+(3,2,53,97,56,93,63,67),
+(3,2,54,98,57,95,64,69),
+(3,2,55,100,58,97,65,70),
+(3,2,56,102,59,98,66,71),
+(3,2,57,104,60,100,67,72),
+(3,2,58,106,61,102,68,73),
+(3,2,59,107,62,103,69,74),
+(3,2,60,109,63,105,70,76),
+(3,2,61,111,64,107,72,77),
+(3,2,62,113,65,109,73,78),
+(3,2,63,115,66,110,74,79),
+(3,2,64,117,67,112,75,80),
+(3,2,65,118,68,114,76,82),
+(3,2,66,120,69,116,77,83),
+(3,2,67,122,70,118,78,84),
+(3,2,68,124,71,119,80,85),
+(3,2,69,126,72,121,81,87),
+(3,2,70,128,73,123,82,88),
+(3,2,71,150,74,125,83,89),
+(3,2,72,152,75,128,85,91),
+(3,2,73,156,76,130,86,93),
+(3,2,74,158,78,132,88,94),
+(3,2,75,161,79,134,89,96),
+(3,2,76,164,80,137,91,97),
+(3,2,77,166,82,139,92,99),
+(3,2,78,170,83,141,94,101),
+(3,2,79,172,84,144,95,102),
+(3,2,80,175,86,146,97,104),
+(3,3,1,22,19,24,19,20),
+(3,3,2,22,20,25,20,21),
+(3,3,3,23,22,26,20,21),
+(3,3,4,23,23,27,21,22),
+(3,3,5,24,25,28,21,23),
+(3,3,6,24,26,29,22,23),
+(3,3,7,25,27,29,23,24),
+(3,3,8,25,29,30,23,25),
+(3,3,9,25,30,31,24,25),
+(3,3,10,26,32,32,24,26),
+(3,3,11,26,33,33,25,27),
+(3,3,12,27,35,34,26,27),
+(3,3,13,27,36,35,26,28),
+(3,3,14,28,38,36,27,29),
+(3,3,15,28,39,37,28,29),
+(3,3,16,29,41,38,28,30),
+(3,3,17,29,42,39,29,31),
+(3,3,18,30,44,41,30,32),
+(3,3,19,30,46,42,30,32),
+(3,3,20,31,47,43,31,33),
+(3,3,21,32,49,44,32,34),
+(3,3,22,32,51,45,33,35),
+(3,3,23,33,52,46,33,36),
+(3,3,24,33,54,47,34,36),
+(3,3,25,34,56,48,35,37),
+(3,3,26,34,57,49,35,38),
+(3,3,27,35,59,51,36,39),
+(3,3,28,35,61,52,37,40),
+(3,3,29,36,63,53,38,40),
+(3,3,30,37,64,54,39,41),
+(3,3,31,37,66,55,39,42),
+(3,3,32,38,68,57,40,43),
+(3,3,33,38,70,58,41,44),
+(3,3,34,39,71,59,42,45),
+(3,3,35,40,73,60,43,46),
+(3,3,36,40,75,62,43,47),
+(3,3,37,41,77,63,44,47),
+(3,3,38,42,79,64,45,48),
+(3,3,39,42,81,65,46,49),
+(3,3,40,43,83,67,47,50),
+(3,3,41,44,85,68,48,51),
+(3,3,42,44,87,69,49,52),
+(3,3,43,45,89,71,49,53),
+(3,3,44,46,91,72,50,54),
+(3,3,45,46,93,73,51,55),
+(3,3,46,47,95,75,52,56),
+(3,3,47,48,97,76,53,57),
+(3,3,48,49,99,78,54,58),
+(3,3,49,49,101,79,55,59),
+(3,3,50,50,103,80,56,60),
+(3,3,51,51,105,82,57,61),
+(3,3,52,51,107,83,58,62),
+(3,3,53,52,109,85,59,63),
+(3,3,54,53,111,86,60,64),
+(3,3,55,54,113,88,61,65),
+(3,3,56,55,115,89,62,66),
+(3,3,57,55,118,91,62,67),
+(3,3,58,56,120,92,63,68),
+(3,3,59,57,122,94,64,70),
+(3,3,60,58,124,95,65,71),
+(3,3,61,58,126,97,67,72),
+(3,3,62,59,129,98,68,73),
+(3,3,63,60,131,100,69,74),
+(3,3,64,61,133,101,70,75),
+(3,3,65,62,135,103,71,76),
+(3,3,66,63,138,105,72,77),
+(3,3,67,63,140,106,73,78),
+(3,3,68,64,142,108,74,80),
+(3,3,69,65,145,109,75,81),
+(3,3,70,66,147,111,76,82),
+(3,3,71,67,150,113,77,83),
+(3,3,72,68,153,115,78,84),
+(3,3,73,69,156,117,79,86),
+(3,3,74,70,159,119,81,87),
+(3,3,75,71,162,121,82,89),
+(3,3,76,72,165,123,83,90),
+(3,3,77,73,168,125,85,92),
+(3,3,78,74,171,127,86,93),
+(3,3,79,75,174,129,87,95),
+(3,3,80,76,177,131,89,96),
+(3,4,1,23,19,24,19,19),
+(3,4,2,24,20,25,19,19),
+(3,4,3,24,22,25,19,20),
+(3,4,4,25,23,26,19,20),
+(3,4,5,26,25,27,20,20),
+(3,4,6,27,26,27,20,21),
+(3,4,7,28,28,28,20,21),
+(3,4,8,28,29,29,20,22),
+(3,4,9,29,31,30,20,22),
+(3,4,10,30,32,30,20,22),
+(3,4,11,31,34,31,21,23),
+(3,4,12,32,36,32,21,23),
+(3,4,13,33,37,33,21,24),
+(3,4,14,33,39,33,21,24),
+(3,4,15,34,40,34,21,25),
+(3,4,16,35,42,35,22,25),
+(3,4,17,36,44,36,22,25),
+(3,4,18,37,45,37,22,26),
+(3,4,19,38,47,38,22,26),
+(3,4,20,39,49,38,22,27),
+(3,4,21,40,51,39,23,27),
+(3,4,22,41,52,40,23,28),
+(3,4,23,42,54,41,23,28),
+(3,4,24,43,56,42,23,29),
+(3,4,25,44,58,43,24,29),
+(3,4,26,44,59,44,24,30),
+(3,4,27,45,61,44,24,30),
+(3,4,28,46,63,45,24,31),
+(3,4,29,47,65,46,25,31),
+(3,4,30,48,67,47,25,32),
+(3,4,31,49,69,48,25,32),
+(3,4,32,51,71,49,25,33),
+(3,4,33,52,72,50,26,33),
+(3,4,34,53,74,51,26,34),
+(3,4,35,54,76,52,26,34),
+(3,4,36,55,78,53,26,35),
+(3,4,37,56,80,54,27,35),
+(3,4,38,57,82,55,27,36),
+(3,4,39,58,84,56,27,37),
+(3,4,40,59,86,57,28,37),
+(3,4,41,60,88,58,28,38),
+(3,4,42,61,90,59,28,38),
+(3,4,43,63,92,60,28,39),
+(3,4,44,64,95,61,29,39),
+(3,4,45,65,97,62,29,40),
+(3,4,46,66,99,63,29,41),
+(3,4,47,67,101,64,30,41),
+(3,4,48,68,103,66,30,42),
+(3,4,49,70,105,67,30,43),
+(3,4,50,71,107,68,31,43),
+(3,4,51,72,110,69,31,44),
+(3,4,52,73,112,70,31,44),
+(3,4,53,74,114,71,32,45),
+(3,4,54,76,116,72,32,46),
+(3,4,55,77,118,73,32,46),
+(3,4,56,78,121,75,33,47),
+(3,4,57,80,123,76,33,48),
+(3,4,58,81,125,77,33,48),
+(3,4,59,82,128,78,34,49),
+(3,4,60,83,130,79,34,50),
+(3,4,61,85,132,81,34,51),
+(3,4,62,86,135,82,35,51),
+(3,4,63,87,137,83,35,52),
+(3,4,64,89,139,84,36,53),
+(3,4,65,90,142,86,36,53),
+(3,4,66,91,144,87,36,54),
+(3,4,67,93,147,88,37,55),
+(3,4,68,94,149,89,37,56),
+(3,4,69,96,152,91,38,56),
+(3,4,70,97,154,92,38,57),
+(3,4,71,99,157,93,38,58),
+(3,4,72,101,160,96,39,58),
+(3,4,73,102,163,97,39,59),
+(3,4,74,104,166,98,40,60),
+(3,4,75,106,169,100,40,61),
+(3,4,76,107,172,101,40,62),
+(3,4,77,109,175,103,41,63),
+(3,4,78,111,179,105,41,64),
+(3,4,79,113,182,106,42,65),
+(3,4,80,115,185,108,42,66),
+(3,5,1,22,16,23,21,22),
+(3,5,2,22,16,23,22,23),
+(3,5,3,22,16,24,24,25),
+(3,5,4,22,17,24,25,26),
+(3,5,5,23,17,24,26,27),
+(3,5,6,23,17,25,28,29),
+(3,5,7,23,17,25,29,30),
+(3,5,8,23,18,26,30,32),
+(3,5,9,23,18,26,32,33),
+(3,5,10,23,18,26,33,35),
+(3,5,11,24,18,27,35,36),
+(3,5,12,24,19,27,36,38),
+(3,5,13,24,19,28,37,39),
+(3,5,14,24,19,28,39,41),
+(3,5,15,24,19,28,40,42),
+(3,5,16,24,20,29,42,44),
+(3,5,17,25,20,29,43,45),
+(3,5,18,25,20,30,45,47),
+(3,5,19,25,21,30,46,49),
+(3,5,20,25,21,31,48,50),
+(3,5,21,25,21,31,50,52),
+(3,5,22,26,22,31,51,53),
+(3,5,23,26,22,32,53,55),
+(3,5,24,26,22,32,54,57),
+(3,5,25,26,22,33,56,58),
+(3,5,26,27,23,33,58,60),
+(3,5,27,27,23,34,59,62),
+(3,5,28,27,23,34,61,64),
+(3,5,29,27,24,35,63,65),
+(3,5,30,28,24,35,64,67),
+(3,5,31,28,24,36,66,69),
+(3,5,32,28,25,36,68,71),
+(3,5,33,28,25,37,70,72),
+(3,5,34,29,26,38,71,74),
+(3,5,35,29,26,38,73,76),
+(3,5,36,29,26,39,75,78),
+(3,5,37,29,27,39,77,80),
+(3,5,38,30,27,40,78,82),
+(3,5,39,30,27,40,80,84),
+(3,5,40,30,28,41,82,86),
+(3,5,41,31,28,41,84,88),
+(3,5,42,31,29,42,86,89),
+(3,5,43,31,29,43,88,91),
+(3,5,44,32,29,43,90,93),
+(3,5,45,32,30,44,92,95),
+(3,5,46,32,30,44,93,97),
+(3,5,47,32,30,45,95,99),
+(3,5,48,33,31,46,97,101),
+(3,5,49,33,31,46,99,103),
+(3,5,50,33,32,47,101,106),
+(3,5,51,34,32,48,103,108),
+(3,5,52,34,33,48,105,110),
+(3,5,53,35,33,49,107,112),
+(3,5,54,35,33,50,109,114),
+(3,5,55,35,34,50,111,116),
+(3,5,56,36,34,51,113,118),
+(3,5,57,36,35,52,116,120),
+(3,5,58,36,35,52,118,123),
+(3,5,59,37,36,53,120,125),
+(3,5,60,37,36,54,122,127),
+(3,5,61,37,37,54,124,129),
+(3,5,62,38,37,55,126,131),
+(3,5,63,38,38,56,128,134),
+(3,5,64,39,38,57,131,136),
+(3,5,65,39,39,57,133,138),
+(3,5,66,39,39,58,135,141),
+(3,5,67,40,40,59,137,143),
+(3,5,68,40,40,59,139,145),
+(3,5,69,41,40,60,142,148),
+(3,5,70,41,41,61,144,150),
+(3,5,71,41,42,62,147,153),
+(3,5,72,42,42,62,150,163),
+(3,5,73,42,43,63,153,166),
+(3,5,74,43,43,64,155,170),
+(3,5,75,43,44,65,158,173),
+(3,5,76,43,45,66,161,176),
+(3,5,77,44,45,67,164,179),
+(3,5,78,44,46,68,167,182),
+(3,5,79,45,46,69,170,184),
+(3,5,80,45,47,70,173,189),
+(3,6,1,25,16,25,19,19),
+(3,6,2,26,17,26,19,19),
+(3,6,3,28,18,27,19,20),
+(3,6,4,29,18,28,19,20),
+(3,6,5,30,19,30,19,20),
+(3,6,6,31,20,31,19,20),
+(3,6,7,33,21,32,20,21),
+(3,6,8,34,22,33,20,21),
+(3,6,9,36,23,35,20,21),
+(3,6,10,37,23,36,20,22),
+(3,6,11,38,24,37,20,22),
+(3,6,12,40,25,38,20,22),
+(3,6,13,41,26,40,20,23),
+(3,6,14,43,27,41,20,23),
+(3,6,15,44,28,42,20,23),
+(3,6,16,46,29,44,21,24),
+(3,6,17,47,30,45,21,24),
+(3,6,18,49,31,46,21,24),
+(3,6,19,50,32,48,21,25),
+(3,6,20,52,33,49,21,25),
+(3,6,21,53,34,51,21,26),
+(3,6,22,55,34,52,21,26),
+(3,6,23,56,35,53,21,26),
+(3,6,24,58,36,55,22,27),
+(3,6,25,59,37,56,22,27),
+(3,6,26,61,38,58,22,27),
+(3,6,27,63,39,59,22,28),
+(3,6,28,64,41,61,22,28),
+(3,6,29,66,42,62,22,29),
+(3,6,30,68,43,64,23,29),
+(3,6,31,69,44,65,23,30),
+(3,6,32,71,45,67,23,30),
+(3,6,33,73,46,68,23,30),
+(3,6,34,75,47,70,23,31),
+(3,6,35,76,48,72,24,31),
+(3,6,36,78,49,73,24,32),
+(3,6,37,80,50,75,24,32),
+(3,6,38,82,51,76,24,33),
+(3,6,39,84,52,78,24,33),
+(3,6,40,85,54,80,24,34),
+(3,6,41,87,55,81,25,34),
+(3,6,42,89,56,83,25,35),
+(3,6,43,91,57,85,25,35),
+(3,6,44,93,58,87,25,36),
+(3,6,45,95,59,88,26,36),
+(3,6,46,97,61,90,26,37),
+(3,6,47,99,62,92,26,37),
+(3,6,48,101,63,94,26,38),
+(3,6,49,102,64,95,26,38),
+(3,6,50,104,65,97,27,39),
+(3,6,51,106,67,99,27,39),
+(3,6,52,108,68,99,27,40),
+(3,6,53,109,68,101,27,40),
+(3,6,54,110,69,101,28,41),
+(3,6,55,110,69,102,28,41),
+(3,6,56,113,71,105,28,42),
+(3,6,57,118,72,107,28,42),
+(3,6,58,120,73,109,29,43),
+(3,6,59,123,75,111,29,43),
+(3,6,60,125,76,113,29,44),
+(3,6,61,126,77,115,29,45),
+(3,6,62,127,79,117,29,45),
+(3,6,63,129,80,120,30,46),
+(3,6,64,132,82,122,30,46),
+(3,6,65,135,83,124,30,47),
+(3,6,66,137,85,127,30,48),
+(3,6,67,144,86,129,31,48),
+(3,6,68,146,88,131,31,49),
+(3,6,69,149,89,133,31,50),
+(3,6,70,152,91,136,31,50),
+(3,6,71,154,93,139,32,51),
+(3,6,72,157,94,141,32,52),
+(3,6,73,160,96,144,32,53),
+(3,6,74,163,98,146,32,53),
+(3,6,75,166,99,150,33,54),
+(3,6,76,169,101,152,33,55),
+(3,6,77,172,103,155,33,56),
+(3,6,78,176,104,157,33,56),
+(3,6,79,179,106,160,34,57),
+(3,6,80,182,108,163,34,58),
+(4,1,1,20,25,21,20,20),
+(4,1,2,21,26,22,20,20),
+(4,1,3,23,27,23,20,21),
+(4,1,4,24,27,25,20,21),
+(4,1,5,25,28,26,20,21),
+(4,1,6,27,29,27,20,21),
+(4,1,7,28,30,28,21,22),
+(4,1,8,29,31,29,21,22),
+(4,1,9,31,31,31,21,22),
+(4,1,10,32,32,32,21,23),
+(4,1,11,33,33,33,21,23),
+(4,1,12,35,34,34,21,23),
+(4,1,13,36,35,36,21,24),
+(4,1,14,38,36,37,21,24),
+(4,1,15,39,37,38,21,24),
+(4,1,16,41,37,40,21,25),
+(4,1,17,42,38,41,22,25),
+(4,1,18,44,39,43,22,25),
+(4,1,19,45,40,44,22,26),
+(4,1,20,47,41,45,22,26),
+(4,1,21,48,42,47,22,26),
+(4,1,22,50,43,48,22,27),
+(4,1,23,52,44,50,22,27),
+(4,1,24,53,45,51,23,28),
+(4,1,25,55,46,52,23,28),
+(4,1,26,56,47,54,23,28),
+(4,1,27,58,48,55,23,29),
+(4,1,28,60,49,57,23,29),
+(4,1,29,61,50,58,23,30),
+(4,1,30,63,51,60,24,30),
+(4,1,31,65,52,62,24,30),
+(4,1,32,66,53,63,24,31),
+(4,1,33,68,54,65,24,31),
+(4,1,34,70,55,66,24,32),
+(4,1,35,72,56,68,24,32),
+(4,1,36,73,58,69,25,33),
+(4,1,37,75,59,71,25,33),
+(4,1,38,77,60,73,25,34),
+(4,1,39,79,61,74,25,34),
+(4,1,40,81,62,76,25,35),
+(4,1,41,82,63,78,26,35),
+(4,1,42,84,64,79,26,35),
+(4,1,43,86,66,81,26,36),
+(4,1,44,88,67,83,26,36),
+(4,1,45,90,68,85,26,37),
+(4,1,46,92,69,86,27,37),
+(4,1,47,94,70,88,27,38),
+(4,1,48,96,72,90,27,38),
+(4,1,49,98,73,92,27,39),
+(4,1,50,100,74,93,28,40),
+(4,1,51,102,75,95,28,40),
+(4,1,52,104,77,97,28,41),
+(4,1,53,106,78,99,28,41),
+(4,1,54,108,79,101,29,42),
+(4,1,55,110,80,103,29,42),
+(4,1,56,112,82,104,29,43),
+(4,1,57,114,83,106,29,43),
+(4,1,58,116,84,108,30,44),
+(4,1,59,118,86,110,30,44),
+(4,1,60,120,87,112,30,45),
+(4,1,61,122,88,114,30,46),
+(4,1,62,124,90,116,31,46),
+(4,1,63,127,91,118,31,47),
+(4,1,64,129,92,120,31,47),
+(4,1,65,131,94,122,32,48),
+(4,1,66,133,95,124,32,49),
+(4,1,67,135,97,126,32,49),
+(4,1,68,138,98,128,32,50),
+(4,1,69,140,100,130,33,50),
+(4,1,70,142,101,132,33,51),
+(4,1,71,145,102,134,33,52),
+(4,1,72,147,104,137,33,53),
+(4,1,73,150,106,139,33,54),
+(4,1,74,153,107,142,34,54),
+(4,1,75,156,109,144,34,55),
+(4,1,76,159,111,148,34,56),
+(4,1,77,162,113,150,35,57),
+(4,1,78,165,114,152,35,57),
+(4,1,79,178,116,164,35,58),
+(4,1,80,181,118,167,36,59),
+(4,3,1,17,28,20,20,21),
+(4,3,2,17,29,21,21,22),
+(4,3,3,18,31,22,21,22),
+(4,3,4,18,32,23,22,23),
+(4,3,5,19,33,24,22,24),
+(4,3,6,19,35,25,23,24),
+(4,3,7,20,36,26,24,25),
+(4,3,8,20,38,27,24,25),
+(4,3,9,21,39,27,25,26),
+(4,3,10,21,40,28,25,27),
+(4,3,11,22,42,29,26,28),
+(4,3,12,22,43,30,27,28),
+(4,3,13,23,45,31,27,29),
+(4,3,14,23,46,32,28,30),
+(4,3,15,24,48,34,29,30),
+(4,3,16,24,50,35,29,31),
+(4,3,17,25,51,36,30,32),
+(4,3,18,25,53,37,31,33),
+(4,3,19,26,54,38,31,33),
+(4,3,20,26,56,39,32,34),
+(4,3,21,27,57,40,33,35),
+(4,3,22,27,59,41,33,36),
+(4,3,23,28,61,42,34,36),
+(4,3,24,28,62,43,35,37),
+(4,3,25,29,64,44,36,38),
+(4,3,26,30,66,46,36,39),
+(4,3,27,30,68,47,37,40),
+(4,3,28,31,69,48,38,41),
+(4,3,29,31,71,49,39,41),
+(4,3,30,32,73,50,39,42),
+(4,3,31,33,75,52,40,43),
+(4,3,32,33,76,53,41,44),
+(4,3,33,34,78,54,42,45),
+(4,3,34,34,80,55,43,46),
+(4,3,35,35,82,57,44,47),
+(4,3,36,36,84,58,44,48),
+(4,3,37,36,86,59,45,48),
+(4,3,38,37,87,60,46,49),
+(4,3,39,38,89,62,47,50),
+(4,3,40,38,91,63,48,51),
+(4,3,41,39,93,64,49,52),
+(4,3,42,40,95,66,49,53),
+(4,3,43,40,97,67,50,54),
+(4,3,44,41,99,68,51,55),
+(4,3,45,42,101,70,52,56),
+(4,3,46,42,103,71,53,57),
+(4,3,47,43,105,72,54,58),
+(4,3,48,44,107,74,55,59),
+(4,3,49,45,109,75,56,60),
+(4,3,50,45,111,77,57,61),
+(4,3,51,46,113,78,58,62),
+(4,3,52,47,115,79,59,63),
+(4,3,53,47,118,81,60,64),
+(4,3,54,48,120,82,61,65),
+(4,3,55,49,122,84,61,66),
+(4,3,56,50,124,85,62,67),
+(4,3,57,50,126,87,63,68),
+(4,3,58,51,128,88,64,69),
+(4,3,59,52,131,90,65,70),
+(4,3,60,53,133,91,66,72),
+(4,3,61,54,135,93,67,73),
+(4,3,62,54,137,94,69,74),
+(4,3,63,55,140,96,70,75),
+(4,3,64,56,142,97,71,76),
+(4,3,65,57,144,99,72,77),
+(4,3,66,58,147,101,73,78),
+(4,3,67,58,149,102,74,79),
+(4,3,68,59,151,104,75,81),
+(4,3,69,60,154,105,76,82),
+(4,3,70,61,156,107,77,83),
+(4,3,71,62,159,109,78,84),
+(4,3,72,63,162,111,79,85),
+(4,3,73,64,165,113,80,87),
+(4,3,74,65,168,115,82,88),
+(4,3,75,66,171,117,83,90),
+(4,3,76,67,174,119,84,91),
+(4,3,77,68,177,121,86,93),
+(4,3,78,69,180,123,87,94),
+(4,3,79,70,190,125,91,96),
+(4,3,80,71,193,127,93,97),
+(4,4,1,18,28,20,20,20),
+(4,4,2,19,29,21,20,20),
+(4,4,3,20,31,21,20,21),
+(4,4,4,20,32,22,20,21),
+(4,4,5,21,34,23,21,21),
+(4,4,6,22,35,24,21,22),
+(4,4,7,23,37,24,21,22),
+(4,4,8,24,38,25,21,23),
+(4,4,9,24,40,26,21,23),
+(4,4,10,25,41,26,21,23),
+(4,4,11,26,43,27,22,24),
+(4,4,12,27,44,28,22,24),
+(4,4,13,28,46,29,22,25),
+(4,4,14,29,48,30,22,25),
+(4,4,15,29,49,30,22,25),
+(4,4,16,30,51,31,23,26),
+(4,4,17,31,52,32,23,26),
+(4,4,18,32,54,33,23,27),
+(4,4,19,33,56,34,23,27),
+(4,4,20,34,57,35,23,28),
+(4,4,21,35,59,35,24,28),
+(4,4,22,36,61,36,24,29),
+(4,4,23,37,63,37,24,29),
+(4,4,24,38,64,38,24,30),
+(4,4,25,39,66,39,25,30),
+(4,4,26,40,68,40,25,31),
+(4,4,27,41,70,41,25,31),
+(4,4,28,42,72,42,25,32),
+(4,4,29,43,73,43,25,32),
+(4,4,30,44,75,43,26,33),
+(4,4,31,45,77,44,26,33),
+(4,4,32,46,79,45,26,34),
+(4,4,33,47,81,46,27,34),
+(4,4,34,48,83,47,27,35),
+(4,4,35,49,85,48,27,35),
+(4,4,36,50,87,49,27,36),
+(4,4,37,51,89,50,28,36),
+(4,4,38,52,91,51,28,37),
+(4,4,39,53,93,52,28,38),
+(4,4,40,54,95,53,28,38),
+(4,4,41,56,97,54,29,39),
+(4,4,42,57,99,55,29,39),
+(4,4,43,58,101,56,29,40),
+(4,4,44,59,103,57,30,40),
+(4,4,45,60,105,59,30,41),
+(4,4,46,61,107,60,30,42),
+(4,4,47,62,109,61,31,42),
+(4,4,48,64,112,62,31,43),
+(4,4,49,65,114,63,31,44),
+(4,4,50,66,116,64,32,44),
+(4,4,51,67,118,65,32,45),
+(4,4,52,68,120,66,32,45),
+(4,4,53,70,123,67,33,46),
+(4,4,54,71,125,69,33,47),
+(4,4,55,72,127,70,33,47),
+(4,4,56,73,129,71,34,48),
+(4,4,57,75,132,72,34,49),
+(4,4,58,76,134,73,34,49),
+(4,4,59,77,136,74,35,50),
+(4,4,60,79,139,76,35,51),
+(4,4,61,80,141,77,35,51),
+(4,4,62,81,143,78,36,52),
+(4,4,63,82,146,79,36,53),
+(4,4,64,84,148,80,37,54),
+(4,4,65,85,151,82,37,54),
+(4,4,66,87,153,83,37,55),
+(4,4,67,88,156,84,38,56),
+(4,4,68,89,158,85,38,57),
+(4,4,69,91,160,87,39,57),
+(4,4,70,92,163,88,39,58),
+(4,4,71,94,166,90,39,59),
+(4,4,72,96,169,91,40,59),
+(4,4,73,97,172,93,40,60),
+(4,4,74,99,175,94,41,61),
+(4,4,75,101,178,96,41,62),
+(4,4,76,102,181,97,41,63),
+(4,4,77,104,184,99,42,64),
+(4,4,78,106,188,101,42,65),
+(4,4,79,108,191,102,43,66),
+(4,4,80,110,194,104,43,67),
+(4,5,1,17,25,19,22,23),
+(4,5,2,17,25,19,23,24),
+(4,5,3,17,25,20,25,26),
+(4,5,4,17,26,20,26,27),
+(4,5,5,18,26,20,27,28),
+(4,5,6,18,26,21,29,30),
+(4,5,7,18,26,21,30,31),
+(4,5,8,18,26,22,31,33),
+(4,5,9,18,27,22,33,34),
+(4,5,10,19,27,22,34,36),
+(4,5,11,19,27,23,36,37),
+(4,5,12,19,27,23,37,39),
+(4,5,13,19,28,24,38,40),
+(4,5,14,19,28,24,40,42),
+(4,5,15,19,28,25,41,43),
+(4,5,16,20,28,25,43,45),
+(4,5,17,20,29,25,44,46),
+(4,5,18,20,29,26,46,48),
+(4,5,19,20,29,26,47,49),
+(4,5,20,21,30,27,49,51),
+(4,5,21,21,30,27,51,53),
+(4,5,22,21,30,28,52,54),
+(4,5,23,21,30,28,54,56),
+(4,5,24,21,31,29,55,58),
+(4,5,25,22,31,29,57,59),
+(4,5,26,22,31,30,59,61),
+(4,5,27,22,32,30,60,63),
+(4,5,28,22,32,31,62,65),
+(4,5,29,23,32,31,64,66),
+(4,5,30,23,33,32,65,68),
+(4,5,31,23,33,32,67,70),
+(4,5,32,23,33,33,69,72),
+(4,5,33,24,34,33,70,73),
+(4,5,34,24,34,34,72,75),
+(4,5,35,24,34,34,74,77),
+(4,5,36,24,35,35,76,79),
+(4,5,37,25,35,35,78,81),
+(4,5,38,25,35,36,79,83),
+(4,5,39,25,36,37,81,85),
+(4,5,40,26,36,37,83,87),
+(4,5,41,26,37,38,85,88),
+(4,5,42,26,37,38,87,90),
+(4,5,43,27,37,39,89,92),
+(4,5,44,27,38,39,91,94),
+(4,5,45,27,38,40,92,96),
+(4,5,46,27,39,41,94,98),
+(4,5,47,28,39,41,96,100),
+(4,5,48,28,39,42,98,102),
+(4,5,49,28,40,43,100,104),
+(4,5,50,29,40,43,102,106),
+(4,5,51,29,41,44,104,109),
+(4,5,52,29,41,44,106,111),
+(4,5,53,30,42,45,108,113),
+(4,5,54,30,42,46,110,115),
+(4,5,55,30,43,46,112,117),
+(4,5,56,31,43,47,114,119),
+(4,5,57,31,43,48,117,121),
+(4,5,58,31,44,48,119,124),
+(4,5,59,32,44,49,121,126),
+(4,5,60,32,45,50,123,128),
+(4,5,61,33,45,51,125,130),
+(4,5,62,33,46,51,127,132),
+(4,5,63,33,46,52,129,135),
+(4,5,64,34,47,53,132,137),
+(4,5,65,34,47,53,134,139),
+(4,5,66,34,48,54,136,142),
+(4,5,67,35,48,55,138,144),
+(4,5,68,35,49,56,140,146),
+(4,5,69,36,49,56,143,149),
+(4,5,70,36,50,57,145,151),
+(4,5,71,36,51,58,148,161),
+(4,5,72,37,51,58,151,164),
+(4,5,73,37,52,59,154,168),
+(4,5,74,38,52,60,156,171),
+(4,5,75,38,53,61,159,174),
+(4,5,76,38,54,62,162,177),
+(4,5,77,39,54,63,165,180),
+(4,5,78,39,55,64,168,183),
+(4,5,79,40,55,65,171,186),
+(4,5,80,40,56,66,200,191),
+(4,6,1,20,25,21,20,20),
+(4,6,2,21,26,22,20,20),
+(4,6,3,23,27,23,20,21),
+(4,6,4,24,27,25,20,21),
+(4,6,5,25,28,26,20,21),
+(4,6,6,27,29,27,20,21),
+(4,6,7,28,30,28,21,22),
+(4,6,8,29,31,29,21,22),
+(4,6,9,31,31,31,21,22),
+(4,6,10,32,32,32,21,23),
+(4,6,11,33,33,33,21,23),
+(4,6,12,35,34,34,21,23),
+(4,6,13,36,35,36,21,24),
+(4,6,14,38,36,37,21,24),
+(4,6,15,39,37,38,21,24),
+(4,6,16,41,37,40,21,25),
+(4,6,17,42,38,41,22,25),
+(4,6,18,44,39,43,22,25),
+(4,6,19,45,40,44,22,26),
+(4,6,20,47,41,45,22,26),
+(4,6,21,48,42,47,22,26),
+(4,6,22,50,43,48,22,27),
+(4,6,23,52,44,50,22,27),
+(4,6,24,53,45,51,23,28),
+(4,6,25,55,46,52,23,28),
+(4,6,26,56,47,54,23,28),
+(4,6,27,58,48,55,23,29),
+(4,6,28,60,49,57,23,29),
+(4,6,29,61,50,58,23,30),
+(4,6,30,63,51,60,24,30),
+(4,6,31,65,52,62,24,30),
+(4,6,32,66,53,63,24,31),
+(4,6,33,68,54,65,24,31),
+(4,6,34,70,55,66,24,32),
+(4,6,35,72,56,68,24,32),
+(4,6,36,73,58,69,25,33),
+(4,6,37,75,59,71,25,33),
+(4,6,38,77,60,73,25,34),
+(4,6,39,79,61,74,25,34),
+(4,6,40,81,62,76,25,35),
+(4,6,41,82,63,78,26,35),
+(4,6,42,84,64,79,26,35),
+(4,6,43,86,66,81,26,36),
+(4,6,44,88,67,83,26,36),
+(4,6,45,90,68,85,26,37),
+(4,6,46,92,69,86,27,37),
+(4,6,47,94,70,88,27,38),
+(4,6,48,96,72,90,27,38),
+(4,6,49,98,73,92,27,39),
+(4,6,50,100,74,93,28,40),
+(4,6,51,101,75,94,28,40),
+(4,6,52,102,76,95,28,41),
+(4,6,53,103,77,96,28,41),
+(4,6,54,104,77,97,29,42),
+(4,6,55,105,78,98,29,42),
+(4,6,56,108,80,101,29,43),
+(4,6,57,113,81,103,29,43),
+(4,6,58,115,82,105,30,44),
+(4,6,59,115,84,107,30,44),
+(4,6,60,120,85,109,30,45),
+(4,6,61,122,86,111,30,46),
+(4,6,62,122,88,113,30,46),
+(4,6,63,127,89,116,31,47),
+(4,6,64,127,91,118,31,47),
+(4,6,65,133,92,120,31,48),
+(4,6,66,135,94,123,31,49),
+(4,6,67,136,95,125,32,49),
+(4,6,68,137,97,127,32,50),
+(4,6,69,140,98,130,32,51),
+(4,6,70,147,100,132,32,51),
+(4,6,71,154,102,135,33,52),
+(4,6,72,156,103,137,33,53),
+(4,6,73,157,105,140,33,54),
+(4,6,74,158,107,142,33,54),
+(4,6,75,161,108,145,34,55),
+(4,6,76,164,110,148,34,56),
+(4,6,77,167,112,150,34,57),
+(4,6,78,170,113,153,34,57),
+(4,6,79,172,115,156,35,58),
+(4,6,80,177,117,159,35,59),
+(4,11,1,18,25,19,22,22),
+(4,11,2,19,25,20,23,23),
+(4,11,3,19,26,20,24,24),
+(4,11,4,20,26,21,25,26),
+(4,11,5,20,27,22,26,27),
+(4,11,6,21,27,22,27,28),
+(4,11,7,21,28,23,28,29),
+(4,11,8,22,28,24,29,30),
+(4,11,9,23,29,24,30,32),
+(4,11,10,23,29,25,32,33),
+(4,11,11,24,30,26,33,34),
+(4,11,12,24,31,26,34,35),
+(4,11,13,25,31,27,35,37),
+(4,11,14,26,32,28,36,38),
+(4,11,15,26,32,29,37,39),
+(4,11,16,27,33,29,38,41),
+(4,11,17,28,33,30,40,42),
+(4,11,18,28,34,31,41,43),
+(4,11,19,29,35,32,42,45),
+(4,11,20,30,35,32,43,46),
+(4,11,21,30,36,33,45,48),
+(4,11,22,31,36,34,46,49),
+(4,11,23,32,37,35,47,51),
+(4,11,24,32,38,36,48,52),
+(4,11,25,33,38,36,50,53),
+(4,11,26,34,39,37,51,55),
+(4,11,27,35,40,38,52,56),
+(4,11,28,35,40,39,54,58),
+(4,11,29,36,41,40,55,59),
+(4,11,30,37,42,41,56,61),
+(4,11,31,38,42,42,58,62),
+(4,11,32,38,43,42,59,64),
+(4,11,33,39,44,43,60,66),
+(4,11,34,40,44,44,62,67),
+(4,11,35,41,45,45,63,69),
+(4,11,36,42,46,46,65,70),
+(4,11,37,42,47,47,66,72),
+(4,11,38,43,47,48,67,74),
+(4,11,39,44,48,49,69,75),
+(4,11,40,45,49,50,70,77),
+(4,11,41,46,50,51,72,79),
+(4,11,42,46,50,52,73,80),
+(4,11,43,47,51,53,75,82),
+(4,11,44,48,52,54,76,84),
+(4,11,45,49,53,55,78,85),
+(4,11,46,50,54,56,79,87),
+(4,11,47,51,54,57,81,89),
+(4,11,48,52,55,58,83,91),
+(4,11,49,53,56,59,84,93),
+(4,11,50,53,57,60,86,94),
+(4,11,51,54,58,61,87,96),
+(4,11,52,55,59,62,89,98),
+(4,11,53,56,59,63,91,100),
+(4,11,54,57,60,64,92,102),
+(4,11,55,58,61,65,94,103),
+(4,11,56,59,62,66,95,105),
+(4,11,57,60,63,67,97,107),
+(4,11,58,61,64,68,99,109),
+(4,11,59,62,65,69,101,111),
+(4,11,60,63,66,70,102,113),
+(4,11,61,64,66,72,104,115),
+(4,11,62,65,67,73,106,117),
+(4,11,63,66,68,74,107,119),
+(4,11,64,67,69,75,109,121),
+(4,11,65,68,70,76,111,123),
+(4,11,66,69,71,77,113,125),
+(4,11,67,70,72,78,115,127),
+(4,11,68,71,73,80,116,129),
+(4,11,69,72,74,81,118,131),
+(4,11,70,73,75,82,120,133),
+(4,11,71,75,76,83,122,135),
+(4,11,72,76,78,85,125,138),
+(4,11,73,77,79,86,127,140),
+(4,11,74,78,80,88,131,143),
+(4,11,75,80,81,89,133,145),
+(4,11,76,81,82,91,134,148),
+(4,11,77,82,83,92,136,151),
+(4,11,78,84,85,94,138,153),
+(4,11,79,85,86,95,141,156),
+(4,11,80,86,87,97,143,159),
+(5,1,1,22,18,23,18,25),
+(5,1,2,23,19,24,18,25),
+(5,1,3,25,20,25,18,26),
+(5,1,4,26,20,26,18,26),
+(5,1,5,27,21,28,18,26),
+(5,1,6,29,22,29,18,26),
+(5,1,7,30,23,30,19,27),
+(5,1,8,31,24,31,19,27),
+(5,1,9,33,25,33,19,27),
+(5,1,10,34,25,34,19,28),
+(5,1,11,35,26,35,19,28),
+(5,1,12,37,27,36,19,28),
+(5,1,13,38,28,38,19,28),
+(5,1,14,40,29,39,19,29),
+(5,1,15,41,30,40,19,29),
+(5,1,16,43,31,42,20,29),
+(5,1,17,44,32,43,20,30),
+(5,1,18,46,33,44,20,30),
+(5,1,19,47,34,46,20,31),
+(5,1,20,49,34,47,20,31),
+(5,1,21,50,35,49,20,31),
+(5,1,22,52,36,50,20,32),
+(5,1,23,53,37,51,21,32),
+(5,1,24,55,38,53,21,32),
+(5,1,25,57,39,54,21,33),
+(5,1,26,58,40,56,21,33),
+(5,1,27,60,41,57,21,34),
+(5,1,28,62,42,59,21,34),
+(5,1,29,63,43,60,21,34),
+(5,1,30,65,44,62,22,35),
+(5,1,31,67,46,63,22,35),
+(5,1,32,68,47,65,22,36),
+(5,1,33,70,48,67,22,36),
+(5,1,34,72,49,68,22,36),
+(5,1,35,74,50,70,23,37),
+(5,1,36,75,51,71,23,37),
+(5,1,37,77,52,73,23,38),
+(5,1,38,79,53,75,23,38),
+(5,1,39,81,54,76,23,39),
+(5,1,40,83,55,78,24,39),
+(5,1,41,84,57,80,24,40),
+(5,1,42,86,58,81,24,40),
+(5,1,43,88,59,83,24,41),
+(5,1,44,90,60,85,24,41),
+(5,1,45,92,61,86,25,42),
+(5,1,46,94,62,88,25,42),
+(5,1,47,96,64,90,25,43),
+(5,1,48,98,65,92,25,43),
+(5,1,49,100,66,93,25,44),
+(5,1,50,102,67,95,26,44),
+(5,1,51,104,69,97,26,45),
+(5,1,52,106,70,99,26,45),
+(5,1,53,108,71,101,26,46),
+(5,1,54,110,72,103,27,46),
+(5,1,55,112,74,104,27,47),
+(5,1,56,114,75,106,27,48),
+(5,1,57,116,76,108,27,48),
+(5,1,58,118,78,110,28,49),
+(5,1,59,120,79,112,28,49),
+(5,1,60,122,80,114,28,50),
+(5,1,61,124,82,116,28,50),
+(5,1,62,126,83,118,29,51),
+(5,1,63,128,84,120,29,52),
+(5,1,64,131,86,122,29,52),
+(5,1,65,133,87,124,30,53),
+(5,1,66,135,88,126,30,53),
+(5,1,67,137,90,128,30,54),
+(5,1,68,139,91,130,30,55),
+(5,1,69,142,93,132,31,55),
+(5,1,70,144,94,134,31,56),
+(5,1,71,147,95,136,31,57),
+(5,1,72,150,97,139,31,58),
+(5,1,73,152,99,141,31,59),
+(5,1,74,155,100,144,32,59),
+(5,1,75,158,102,146,32,60),
+(5,1,76,163,104,149,32,61),
+(5,1,77,167,106,152,33,62),
+(5,1,78,167,107,154,33,62),
+(5,1,79,170,109,157,33,63),
+(5,1,80,173,111,160,34,64),
+(5,4,1,20,21,22,18,25),
+(5,4,2,21,22,23,18,25),
+(5,4,3,22,24,23,18,26),
+(5,4,4,22,25,24,18,26),
+(5,4,5,23,27,25,19,26),
+(5,4,6,24,28,25,19,27),
+(5,4,7,25,30,26,19,27),
+(5,4,8,25,31,27,19,27),
+(5,4,9,26,33,28,19,28),
+(5,4,10,27,34,28,19,28),
+(5,4,11,28,36,29,20,29),
+(5,4,12,29,38,30,20,29),
+(5,4,13,30,39,31,20,29),
+(5,4,14,31,41,32,20,30),
+(5,4,15,31,42,32,20,30),
+(5,4,16,32,44,33,21,31),
+(5,4,17,33,46,34,21,31),
+(5,4,18,34,47,35,21,32),
+(5,4,19,35,49,36,21,32),
+(5,4,20,36,51,36,21,32),
+(5,4,21,37,52,37,22,33),
+(5,4,22,38,54,38,22,33),
+(5,4,23,39,56,39,22,34),
+(5,4,24,40,58,40,22,34),
+(5,4,25,41,60,41,23,35),
+(5,4,26,42,61,42,23,35),
+(5,4,27,43,63,43,23,36),
+(5,4,28,44,65,44,23,36),
+(5,4,29,45,67,44,24,37),
+(5,4,30,46,69,45,24,37),
+(5,4,31,47,71,46,24,38),
+(5,4,32,48,72,47,24,38),
+(5,4,33,49,74,48,25,39),
+(5,4,34,50,76,49,25,39),
+(5,4,35,51,78,50,25,40),
+(5,4,36,52,80,51,25,41),
+(5,4,37,53,82,52,26,41),
+(5,4,38,54,84,53,26,42),
+(5,4,39,55,86,54,26,42),
+(5,4,40,56,88,55,27,43),
+(5,4,41,57,90,56,27,43),
+(5,4,42,59,92,57,27,44),
+(5,4,43,60,94,58,27,45),
+(5,4,44,61,96,59,28,45),
+(5,4,45,62,99,60,28,46),
+(5,4,46,63,101,61,28,46),
+(5,4,47,64,103,63,29,47),
+(5,4,48,66,105,64,29,48),
+(5,4,49,67,107,65,29,48),
+(5,4,50,68,109,66,30,49),
+(5,4,51,69,111,67,30,50),
+(5,4,52,70,114,68,30,50),
+(5,4,53,72,116,69,31,51),
+(5,4,54,73,118,70,31,52),
+(5,4,55,74,120,72,31,52),
+(5,4,56,75,123,73,32,53),
+(5,4,57,77,125,74,32,54),
+(5,4,58,78,127,75,32,54),
+(5,4,59,79,130,76,33,55),
+(5,4,60,81,132,77,33,56),
+(5,4,61,82,134,79,34,56),
+(5,4,62,83,137,80,34,57),
+(5,4,63,84,139,81,34,58),
+(5,4,64,86,141,82,35,59),
+(5,4,65,87,144,84,35,59),
+(5,4,66,88,146,85,35,60),
+(5,4,67,90,149,86,36,61),
+(5,4,68,91,151,87,36,61),
+(5,4,69,93,154,89,37,62),
+(5,4,70,94,156,90,37,63),
+(5,4,71,96,159,91,37,64),
+(5,4,72,98,162,93,38,64),
+(5,4,73,99,165,95,38,65),
+(5,4,74,101,168,96,39,66),
+(5,4,75,103,171,98,39,67),
+(5,4,76,104,174,99,39,68),
+(5,4,77,106,177,101,40,69),
+(5,4,78,108,181,103,40,70),
+(5,4,79,110,184,104,41,71),
+(5,4,80,112,187,106,41,72),
+(5,5,1,19,18,21,20,28),
+(5,5,2,19,18,21,21,29),
+(5,5,3,19,18,22,23,31),
+(5,5,4,19,19,22,24,32),
+(5,5,5,20,19,22,25,33),
+(5,5,6,20,19,23,27,35),
+(5,5,7,20,19,23,28,36),
+(5,5,8,20,20,24,29,38),
+(5,5,9,20,20,24,31,39),
+(5,5,10,20,20,24,32,40),
+(5,5,11,21,20,25,34,42),
+(5,5,12,21,21,25,35,43),
+(5,5,13,21,21,26,37,45),
+(5,5,14,21,21,26,38,46),
+(5,5,15,21,21,26,39,48),
+(5,5,16,22,22,27,41,50),
+(5,5,17,22,22,27,42,51),
+(5,5,18,22,22,28,44,53),
+(5,5,19,22,23,28,46,54),
+(5,5,20,22,23,29,47,56),
+(5,5,21,23,23,29,49,57),
+(5,5,22,23,23,30,50,59),
+(5,5,23,23,24,30,52,61),
+(5,5,24,23,24,31,53,62),
+(5,5,25,24,24,31,55,64),
+(5,5,26,24,25,32,57,66),
+(5,5,27,24,25,32,58,68),
+(5,5,28,24,25,33,60,69),
+(5,5,29,25,26,33,62,71),
+(5,5,30,25,26,34,63,73),
+(5,5,31,25,26,34,65,75),
+(5,5,32,25,27,35,67,76),
+(5,5,33,26,27,35,69,78),
+(5,5,34,26,27,36,70,80),
+(5,5,35,26,28,36,72,82),
+(5,5,36,26,28,37,74,84),
+(5,5,37,27,28,37,76,86),
+(5,5,38,27,29,38,77,87),
+(5,5,39,27,29,38,79,89),
+(5,5,40,28,30,39,81,91),
+(5,5,41,28,30,40,83,93),
+(5,5,42,28,30,40,85,95),
+(5,5,43,28,31,41,87,97),
+(5,5,44,29,31,41,89,99),
+(5,5,45,29,32,42,91,101),
+(5,5,46,29,32,43,92,103),
+(5,5,47,30,32,43,94,105),
+(5,5,48,30,33,44,96,107),
+(5,5,49,30,33,44,98,109),
+(5,5,50,31,34,45,100,111),
+(5,5,51,31,34,46,102,113),
+(5,5,52,31,35,46,104,115),
+(5,5,53,32,35,47,106,118),
+(5,5,54,32,35,48,108,120),
+(5,5,55,32,36,48,110,122),
+(5,5,56,33,36,49,113,124),
+(5,5,57,33,37,50,115,126),
+(5,5,58,33,37,50,117,128),
+(5,5,59,34,38,51,119,131),
+(5,5,60,34,38,52,121,133),
+(5,5,61,34,39,52,123,135),
+(5,5,62,35,39,53,125,137),
+(5,5,63,35,40,54,127,140),
+(5,5,64,36,40,55,130,142),
+(5,5,65,36,41,55,132,144),
+(5,5,66,36,41,56,134,147),
+(5,5,67,37,41,57,136,149),
+(5,5,68,37,42,58,138,151),
+(5,5,69,38,42,58,141,154),
+(5,5,70,38,43,59,143,156),
+(5,5,71,38,44,60,146,159),
+(5,5,72,39,44,60,149,162),
+(5,5,73,39,45,61,152,165),
+(5,5,74,40,45,62,157,168),
+(5,5,75,40,46,63,157,171),
+(5,5,76,40,47,64,160,174),
+(5,5,77,41,47,65,163,177),
+(5,5,78,41,48,66,166,180),
+(5,5,79,42,48,67,169,183),
+(5,5,80,42,49,68,172,186),
+(5,6,1,22,18,23,18,25),
+(5,6,2,23,19,24,18,25),
+(5,6,3,25,20,25,18,26),
+(5,6,4,26,20,26,18,26),
+(5,6,5,27,21,28,18,26),
+(5,6,6,29,22,29,18,26),
+(5,6,7,30,23,30,19,27),
+(5,6,8,31,24,31,19,27),
+(5,6,9,33,25,33,19,27),
+(5,6,10,34,25,34,19,28),
+(5,6,11,35,26,35,19,28),
+(5,6,12,37,27,36,19,28),
+(5,6,13,38,28,38,19,28),
+(5,6,14,40,29,39,19,29),
+(5,6,15,41,30,40,19,29),
+(5,6,16,43,31,42,20,29),
+(5,6,17,44,32,43,20,30),
+(5,6,18,46,33,44,20,30),
+(5,6,19,47,34,46,20,31),
+(5,6,20,49,34,47,20,31),
+(5,6,21,50,35,49,20,31),
+(5,6,22,52,36,50,20,32),
+(5,6,23,53,37,51,21,32),
+(5,6,24,55,38,53,21,32),
+(5,6,25,57,39,54,21,33),
+(5,6,26,58,40,56,21,33),
+(5,6,27,60,41,57,21,34),
+(5,6,28,62,42,59,21,34),
+(5,6,29,63,43,60,21,34),
+(5,6,30,65,44,62,22,35),
+(5,6,31,67,46,63,22,35),
+(5,6,32,68,47,65,22,36),
+(5,6,33,70,48,67,22,36),
+(5,6,34,72,49,68,22,36),
+(5,6,35,74,50,70,23,37),
+(5,6,36,75,51,71,23,37),
+(5,6,37,77,52,73,23,38),
+(5,6,38,79,53,75,23,38),
+(5,6,39,81,54,76,23,39),
+(5,6,40,83,55,78,24,39),
+(5,6,41,84,57,80,24,40),
+(5,6,42,86,58,81,24,40),
+(5,6,43,88,59,83,24,41),
+(5,6,44,90,60,85,24,41),
+(5,6,45,92,61,86,25,42),
+(5,6,46,94,62,88,25,42),
+(5,6,47,96,64,90,25,43),
+(5,6,48,98,65,92,25,43),
+(5,6,49,100,66,93,25,44),
+(5,6,50,102,67,95,26,44),
+(5,6,51,103,67,96,26,45),
+(5,6,52,104,68,97,26,45),
+(5,6,53,105,69,98,26,46),
+(5,6,54,106,70,99,27,46),
+(5,6,55,107,71,100,27,47),
+(5,6,56,110,73,103,27,48),
+(5,6,57,112,74,105,27,48),
+(5,6,58,114,75,107,28,49),
+(5,6,59,119,77,109,28,49),
+(5,6,60,122,78,111,28,50),
+(5,6,61,124,79,113,28,51),
+(5,6,62,127,81,115,28,51),
+(5,6,63,129,82,118,29,52),
+(5,6,64,136,84,120,29,52),
+(5,6,65,137,85,123,29,53),
+(5,6,66,138,87,125,29,54),
+(5,6,67,141,88,127,30,54),
+(5,6,68,143,90,129,30,55),
+(5,6,69,146,91,132,30,56),
+(5,6,70,149,93,134,30,56),
+(5,6,71,152,95,137,31,57),
+(5,6,72,154,96,139,31,58),
+(5,6,73,157,98,142,31,59),
+(5,6,74,158,100,145,31,59),
+(5,6,75,159,101,147,32,60),
+(5,6,76,162,103,150,32,61),
+(5,6,77,167,105,152,32,62),
+(5,6,78,173,106,155,32,62),
+(5,6,79,174,108,158,33,63),
+(5,6,80,174,110,161,33,64),
+(5,8,1,19,18,21,21,27),
+(5,8,2,19,18,21,22,28),
+(5,8,3,19,18,22,24,30),
+(5,8,4,19,18,22,25,31),
+(5,8,5,19,19,22,26,32),
+(5,8,6,19,19,22,28,34),
+(5,8,7,20,19,23,29,35),
+(5,8,8,20,19,23,31,36),
+(5,8,9,20,19,23,32,38),
+(5,8,10,20,19,24,34,39),
+(5,8,11,20,20,24,35,40),
+(5,8,12,20,20,24,37,42),
+(5,8,13,20,20,25,38,43),
+(5,8,14,20,20,25,40,45),
+(5,8,15,20,20,25,41,46),
+(5,8,16,21,21,26,43,48),
+(5,8,17,21,21,26,44,49),
+(5,8,18,21,21,26,46,51),
+(5,8,19,21,21,27,48,52),
+(5,8,20,21,21,27,49,54),
+(5,8,21,21,22,27,51,55),
+(5,8,22,21,22,28,52,57),
+(5,8,23,21,22,28,54,58),
+(5,8,24,22,22,29,56,60),
+(5,8,25,22,23,29,57,62),
+(5,8,26,22,23,29,59,63),
+(5,8,27,22,23,30,61,65),
+(5,8,28,22,23,30,63,67),
+(5,8,29,22,24,31,64,68),
+(5,8,30,23,24,31,66,70),
+(5,8,31,23,24,31,68,72),
+(5,8,32,23,24,32,70,73),
+(5,8,33,23,25,32,72,75),
+(5,8,34,23,25,33,73,77),
+(5,8,35,24,25,33,75,79),
+(5,8,36,24,25,34,77,80),
+(5,8,37,24,26,34,79,82),
+(5,8,38,24,26,35,81,84),
+(5,8,39,24,26,35,83,86),
+(5,8,40,24,27,35,85,88),
+(5,8,41,25,27,36,87,90),
+(5,8,42,25,27,36,89,91),
+(5,8,43,25,27,37,90,93),
+(5,8,44,25,28,37,92,95),
+(5,8,45,26,28,38,94,97),
+(5,8,46,26,28,38,96,99),
+(5,8,47,26,29,39,98,101),
+(5,8,48,26,29,39,100,103),
+(5,8,49,26,29,40,103,105),
+(5,8,50,27,30,40,105,107),
+(5,8,51,27,30,41,107,109),
+(5,8,52,27,30,42,109,111),
+(5,8,53,27,31,42,111,113),
+(5,8,54,28,31,43,113,115),
+(5,8,55,28,31,43,115,117),
+(5,8,56,28,32,44,117,119),
+(5,8,57,28,32,44,119,121),
+(5,8,58,29,32,45,122,123),
+(5,8,59,29,33,45,124,126),
+(5,8,60,29,33,46,126,128),
+(5,8,61,29,34,47,128,130),
+(5,8,62,30,34,47,131,132),
+(5,8,63,30,34,48,133,134),
+(5,8,64,30,35,48,135,136),
+(5,8,65,31,35,49,137,139),
+(5,8,66,31,35,50,140,141),
+(5,8,67,31,36,50,142,143),
+(5,8,68,31,36,51,144,145),
+(5,8,69,32,37,51,147,148),
+(5,8,70,32,37,52,149,150),
+(5,8,71,32,37,53,152,153),
+(5,8,72,32,38,54,155,156),
+(5,8,73,32,38,55,158,159),
+(5,8,74,33,39,55,161,161),
+(5,8,75,33,39,56,164,164),
+(5,8,76,33,39,57,167,167),
+(5,8,77,34,40,58,170,170),
+(5,8,78,34,40,58,173,173),
+(5,8,79,34,41,59,176,176),
+(5,8,80,35,41,60,179,179),
+(5,9,1,19,18,22,20,27),
+(5,9,2,19,18,23,21,28),
+(5,9,3,20,19,23,22,29),
+(5,9,4,20,19,24,24,30),
+(5,9,5,20,19,24,25,32),
+(5,9,6,20,20,25,26,33),
+(5,9,7,21,20,25,27,34),
+(5,9,8,21,21,26,28,35),
+(5,9,9,21,21,26,30,36),
+(5,9,10,22,21,27,31,38),
+(5,9,11,22,22,28,32,39),
+(5,9,12,22,22,28,34,40),
+(5,9,13,23,23,29,35,41),
+(5,9,14,23,23,30,36,43),
+(5,9,15,23,24,30,37,44),
+(5,9,16,24,24,31,39,45),
+(5,9,17,24,24,31,40,47),
+(5,9,18,24,25,32,42,48),
+(5,9,19,25,25,33,43,49),
+(5,9,20,25,26,33,44,51),
+(5,9,21,26,26,34,46,52),
+(5,9,22,26,27,35,47,53),
+(5,9,23,26,27,36,49,55),
+(5,9,24,27,28,36,50,56),
+(5,9,25,27,28,37,52,58),
+(5,9,26,27,29,38,53,59),
+(5,9,27,28,29,38,55,60),
+(5,9,28,28,30,39,56,62),
+(5,9,29,29,30,40,58,63),
+(5,9,30,29,31,41,59,65),
+(5,9,31,30,31,41,61,66),
+(5,9,32,30,32,42,62,68),
+(5,9,33,30,32,43,64,69),
+(5,9,34,31,33,44,65,71),
+(5,9,35,31,33,45,67,73),
+(5,9,36,32,34,45,69,74),
+(5,9,37,32,34,46,70,76),
+(5,9,38,33,35,47,72,77),
+(5,9,39,33,36,48,73,79),
+(5,9,40,34,36,49,75,81),
+(5,9,41,34,37,49,77,82),
+(5,9,42,35,37,50,78,84),
+(5,9,43,35,38,51,80,86),
+(5,9,44,36,39,52,82,87),
+(5,9,45,36,39,53,84,89),
+(5,9,46,37,40,54,85,91),
+(5,9,47,37,40,55,87,92),
+(5,9,48,38,41,55,89,94),
+(5,9,49,38,42,56,91,96),
+(5,9,50,39,42,57,92,98),
+(5,9,51,39,43,58,94,100),
+(5,9,52,40,44,59,96,101),
+(5,9,53,40,44,60,98,103),
+(5,9,54,41,45,61,100,105),
+(5,9,55,41,45,62,102,107),
+(5,9,56,42,46,63,103,109),
+(5,9,57,42,47,64,105,111),
+(5,9,58,43,47,65,107,112),
+(5,9,59,43,48,66,109,114),
+(5,9,60,44,49,67,111,116),
+(5,9,61,45,50,68,113,118),
+(5,9,62,45,50,69,115,120),
+(5,9,63,46,51,70,117,122),
+(5,9,64,46,52,71,119,124),
+(5,9,65,47,52,72,121,126),
+(5,9,66,48,53,73,123,128),
+(5,9,67,48,54,74,125,130),
+(5,9,68,49,55,75,127,132),
+(5,9,69,49,55,76,129,134),
+(5,9,70,50,56,77,131,136),
+(5,9,71,51,57,86,135,147),
+(5,9,72,52,57,88,136,149),
+(5,9,73,53,58,89,138,152),
+(5,9,74,53,59,90,141,155),
+(5,9,75,54,60,92,143,157),
+(5,9,76,55,61,93,146,160),
+(5,9,77,56,62,94,149,163),
+(5,9,78,56,63,96,151,166),
+(5,9,79,57,64,97,154,169),
+(5,9,80,58,65,99,157,171),
+(6,1,1,28,15,24,15,22),
+(6,1,2,29,16,25,15,22),
+(6,1,3,31,17,26,15,23),
+(6,1,4,32,17,27,15,23),
+(6,1,5,33,18,29,15,23),
+(6,1,6,34,19,30,15,23),
+(6,1,7,36,20,31,16,24),
+(6,1,8,37,21,32,16,24),
+(6,1,9,38,22,34,16,24),
+(6,1,10,40,22,35,16,25),
+(6,1,11,41,23,36,16,25),
+(6,1,12,43,24,37,16,25),
+(6,1,13,44,25,39,16,26),
+(6,1,14,46,26,40,16,26),
+(6,1,15,47,27,41,17,26),
+(6,1,16,48,28,43,17,27),
+(6,1,17,50,29,44,17,27),
+(6,1,18,51,30,45,17,27),
+(6,1,19,53,31,47,17,28),
+(6,1,20,54,32,48,17,28),
+(6,1,21,56,33,50,17,28),
+(6,1,22,58,34,51,18,29),
+(6,1,23,59,35,52,18,29),
+(6,1,24,61,36,54,18,30),
+(6,1,25,62,37,55,18,30),
+(6,1,26,64,38,57,18,30),
+(6,1,27,66,39,58,18,31),
+(6,1,28,67,40,60,18,31),
+(6,1,29,69,41,61,19,32),
+(6,1,30,71,42,63,19,32),
+(6,1,31,72,43,64,19,32),
+(6,1,32,74,44,66,19,33),
+(6,1,33,76,45,67,19,33),
+(6,1,34,77,46,69,20,34),
+(6,1,35,79,47,71,20,34),
+(6,1,36,81,48,72,20,35),
+(6,1,37,83,49,74,20,35),
+(6,1,38,85,50,76,20,35),
+(6,1,39,86,51,77,21,36),
+(6,1,40,88,53,79,21,36),
+(6,1,41,90,54,81,21,37),
+(6,1,42,92,55,82,21,37),
+(6,1,43,94,56,84,21,38),
+(6,1,44,96,57,86,22,38),
+(6,1,45,98,58,87,22,39),
+(6,1,46,99,60,89,22,39),
+(6,1,47,101,61,91,22,40),
+(6,1,48,103,62,93,22,40),
+(6,1,49,105,63,94,23,41),
+(6,1,50,107,65,96,23,41),
+(6,1,51,109,66,98,23,42),
+(6,1,52,111,67,100,23,42),
+(6,1,53,113,68,102,24,43),
+(6,1,54,115,70,104,24,44),
+(6,1,55,117,71,105,24,44),
+(6,1,56,119,72,107,24,45),
+(6,1,57,122,73,109,25,45),
+(6,1,58,124,75,111,25,46),
+(6,1,59,126,76,113,25,46),
+(6,1,60,128,77,115,25,47),
+(6,1,61,130,79,117,26,48),
+(6,1,62,132,80,119,26,48),
+(6,1,63,134,81,121,26,49),
+(6,1,64,137,83,123,26,49),
+(6,1,65,139,84,125,27,50),
+(6,1,66,141,85,127,27,51),
+(6,1,67,143,87,129,27,51),
+(6,1,68,145,88,131,27,52),
+(6,1,69,148,90,133,28,52),
+(6,1,70,150,91,135,28,53),
+(6,1,71,153,92,137,28,54),
+(6,1,72,155,94,140,28,55),
+(6,1,73,158,96,142,28,56),
+(6,1,74,161,97,145,29,56),
+(6,1,75,164,99,147,29,57),
+(6,1,76,167,101,150,29,58),
+(6,1,77,170,103,153,30,59),
+(6,1,78,173,104,155,30,59),
+(6,1,79,176,106,164,30,60),
+(6,1,80,179,108,170,31,61),
+(6,3,1,25,18,23,15,23),
+(6,3,2,25,19,24,16,24),
+(6,3,3,26,21,25,16,24),
+(6,3,4,26,22,26,17,25),
+(6,3,5,27,24,27,17,25),
+(6,3,6,27,25,28,18,26),
+(6,3,7,28,26,28,19,27),
+(6,3,8,28,28,29,19,27),
+(6,3,9,28,29,30,20,28),
+(6,3,10,29,31,31,20,29),
+(6,3,11,29,32,32,21,29),
+(6,3,12,30,34,33,22,30),
+(6,3,13,30,35,34,22,31),
+(6,3,14,31,37,35,23,32),
+(6,3,15,31,38,36,24,32),
+(6,3,16,32,40,37,24,33),
+(6,3,17,32,41,39,25,34),
+(6,3,18,33,43,40,26,35),
+(6,3,19,33,45,41,27,35),
+(6,3,20,34,46,42,27,36),
+(6,3,21,34,48,43,28,37),
+(6,3,22,35,50,44,29,38),
+(6,3,23,35,51,45,29,38),
+(6,3,24,36,53,46,30,39),
+(6,3,25,37,55,47,31,40),
+(6,3,26,37,56,48,32,41),
+(6,3,27,38,58,50,32,42),
+(6,3,28,38,60,51,33,42),
+(6,3,29,39,62,52,34,43),
+(6,3,30,39,63,53,35,44),
+(6,3,31,40,65,54,36,45),
+(6,3,32,41,67,56,36,46),
+(6,3,33,41,69,57,37,47),
+(6,3,34,42,71,58,38,48),
+(6,3,35,43,72,59,39,48),
+(6,3,36,43,74,61,40,49),
+(6,3,37,44,76,62,40,50),
+(6,3,38,45,78,63,41,51),
+(6,3,39,45,80,64,42,52),
+(6,3,40,46,82,66,43,53),
+(6,3,41,47,84,67,44,54),
+(6,3,42,47,86,68,45,55),
+(6,3,43,48,88,70,46,56),
+(6,3,44,49,90,71,46,57),
+(6,3,45,49,92,72,47,58),
+(6,3,46,50,94,74,48,59),
+(6,3,47,51,96,75,49,60),
+(6,3,48,51,98,77,50,61),
+(6,3,49,52,100,78,51,62),
+(6,3,50,53,102,79,52,63),
+(6,3,51,54,104,81,53,64),
+(6,3,52,54,106,82,54,65),
+(6,3,53,55,108,84,55,66),
+(6,3,54,56,110,85,56,67),
+(6,3,55,57,112,87,57,68),
+(6,3,56,57,114,88,58,69),
+(6,3,57,58,117,90,59,70),
+(6,3,58,59,119,91,60,71),
+(6,3,59,60,121,93,61,72),
+(6,3,60,61,123,94,62,74),
+(6,3,61,61,125,96,63,75),
+(6,3,62,62,128,97,64,76),
+(6,3,63,63,130,99,65,77),
+(6,3,64,64,132,100,66,78),
+(6,3,65,65,134,102,67,79),
+(6,3,66,66,137,104,68,80),
+(6,3,67,66,139,105,69,81),
+(6,3,68,67,141,107,70,83),
+(6,3,69,68,144,108,71,84),
+(6,3,70,69,146,110,72,85),
+(6,3,71,70,149,112,73,86),
+(6,3,72,71,152,114,74,87),
+(6,3,73,72,155,116,75,89),
+(6,3,74,73,158,118,77,90),
+(6,3,75,74,161,120,78,92),
+(6,3,76,75,164,122,79,93),
+(6,3,77,76,167,124,81,95),
+(6,3,78,77,176,126,85,96),
+(6,3,79,78,179,128,86,98),
+(6,3,80,79,183,130,88,99),
+(6,6,1,28,15,24,15,22),
+(6,6,2,29,16,25,15,22),
+(6,6,3,31,17,26,15,23),
+(6,6,4,32,17,27,15,23),
+(6,6,5,33,18,29,15,23),
+(6,6,6,34,19,30,15,23),
+(6,6,7,36,20,31,16,24),
+(6,6,8,37,21,32,16,24),
+(6,6,9,38,22,34,16,24),
+(6,6,10,40,22,35,16,25),
+(6,6,11,41,23,36,16,25),
+(6,6,12,43,24,37,16,25),
+(6,6,13,44,25,39,16,26),
+(6,6,14,46,26,40,16,26),
+(6,6,15,47,27,41,17,26),
+(6,6,16,48,28,43,17,27),
+(6,6,17,50,29,44,17,27),
+(6,6,18,51,30,45,17,27),
+(6,6,19,53,31,47,17,28),
+(6,6,20,54,32,48,17,28),
+(6,6,21,56,33,50,17,28),
+(6,6,22,58,34,51,18,29),
+(6,6,23,59,35,52,18,29),
+(6,6,24,61,36,54,18,30),
+(6,6,25,62,37,55,18,30),
+(6,6,26,64,38,57,18,30),
+(6,6,27,66,39,58,18,31),
+(6,6,28,67,40,60,18,31),
+(6,6,29,69,41,61,19,32),
+(6,6,30,71,42,63,19,32),
+(6,6,31,72,43,64,19,32),
+(6,6,32,74,44,66,19,33),
+(6,6,33,76,45,67,19,33),
+(6,6,34,77,46,69,20,34),
+(6,6,35,79,47,71,20,34),
+(6,6,36,81,48,72,20,35),
+(6,6,37,83,49,74,20,35),
+(6,6,38,85,50,76,20,35),
+(6,6,39,86,51,77,21,36),
+(6,6,40,88,53,79,21,36),
+(6,6,41,90,54,81,21,37),
+(6,6,42,92,55,82,21,37),
+(6,6,43,94,56,84,21,38),
+(6,6,44,96,57,86,22,38),
+(6,6,45,98,58,87,22,39),
+(6,6,46,99,60,89,22,39),
+(6,6,47,101,60,91,22,40),
+(6,6,48,103,61,93,22,40),
+(6,6,49,105,62,94,23,41),
+(6,6,50,107,63,96,23,41),
+(6,6,51,109,64,97,23,42),
+(6,6,52,110,65,98,23,42),
+(6,6,53,111,66,99,24,43),
+(6,6,54,112,67,100,24,44),
+(6,6,55,113,68,101,24,44),
+(6,6,56,116,70,104,24,45),
+(6,6,57,121,71,106,24,45),
+(6,6,58,123,72,108,25,46),
+(6,6,59,123,74,110,25,46),
+(6,6,60,125,75,112,25,47),
+(6,6,61,127,76,114,25,48),
+(6,6,62,133,78,116,25,48),
+(6,6,63,135,79,119,26,49),
+(6,6,64,139,81,121,26,49),
+(6,6,65,142,82,123,26,50),
+(6,6,66,146,84,126,26,51),
+(6,6,67,150,85,132,27,51),
+(6,6,68,153,87,137,27,52),
+(6,6,69,157,88,140,27,53),
+(6,6,70,160,90,143,27,53),
+(6,6,71,163,92,146,28,54),
+(6,6,72,165,93,148,28,55),
+(6,6,73,167,95,150,28,56),
+(6,6,74,171,97,153,28,56),
+(6,6,75,174,98,156,29,57),
+(6,6,76,178,100,156,29,58),
+(6,6,77,179,102,156,29,59),
+(6,6,78,179,103,156,29,59),
+(6,6,79,182,105,159,30,60),
+(6,6,80,185,107,162,30,61),
+(6,7,1,26,15,23,16,24),
+(6,7,2,27,15,24,17,25),
+(6,7,3,28,16,25,18,26),
+(6,7,4,28,16,26,19,27),
+(6,7,5,29,17,27,20,28),
+(6,7,6,30,17,28,21,29),
+(6,7,7,31,18,29,22,30),
+(6,7,8,32,18,30,23,31),
+(6,7,9,33,19,31,24,32),
+(6,7,10,34,19,32,25,33),
+(6,7,11,35,20,33,26,35),
+(6,7,12,35,20,34,27,36),
+(6,7,13,36,21,35,28,37),
+(6,7,14,37,21,36,29,38),
+(6,7,15,38,22,37,30,39),
+(6,7,16,39,22,39,31,40),
+(6,7,17,40,23,40,32,42),
+(6,7,18,41,23,41,33,43),
+(6,7,19,42,24,42,34,44),
+(6,7,20,43,24,43,35,45),
+(6,7,21,44,25,44,36,46),
+(6,7,22,45,25,45,37,48),
+(6,7,23,46,26,47,38,49),
+(6,7,24,47,27,48,40,50),
+(6,7,25,48,27,49,41,51),
+(6,7,26,49,28,50,42,53),
+(6,7,27,51,28,52,43,54),
+(6,7,28,52,29,53,44,55),
+(6,7,29,53,29,54,45,57),
+(6,7,30,54,30,55,47,58),
+(6,7,31,55,31,57,48,59),
+(6,7,32,56,31,58,49,61),
+(6,7,33,57,32,59,50,62),
+(6,7,34,58,33,61,51,64),
+(6,7,35,60,33,62,53,65),
+(6,7,36,61,34,63,54,66),
+(6,7,37,62,34,65,55,68),
+(6,7,38,63,35,66,57,69),
+(6,7,39,64,36,67,58,71),
+(6,7,40,66,36,69,59,72),
+(6,7,41,67,37,70,60,74),
+(6,7,42,68,38,72,62,75),
+(6,7,43,69,38,73,63,77),
+(6,7,44,70,39,74,64,78),
+(6,7,45,72,40,76,66,80),
+(6,7,46,73,41,77,67,81),
+(6,7,47,74,41,79,69,83),
+(6,7,48,76,42,80,70,84),
+(6,7,49,77,43,82,71,86),
+(6,7,50,78,43,83,73,88),
+(6,7,51,80,44,85,74,89),
+(6,7,52,81,45,86,76,91),
+(6,7,53,82,46,88,77,92),
+(6,7,54,84,46,90,78,94),
+(6,7,55,85,47,91,80,96),
+(6,7,56,86,48,93,81,97),
+(6,7,57,88,49,94,83,99),
+(6,7,58,89,49,96,84,101),
+(6,7,59,91,50,97,86,102),
+(6,7,60,92,51,99,87,104),
+(6,7,61,94,52,101,89,106),
+(6,7,62,95,52,102,90,108),
+(6,7,63,96,53,104,92,109),
+(6,7,64,98,54,106,93,111),
+(6,7,65,99,55,107,95,113),
+(6,7,66,101,56,109,97,115),
+(6,7,67,102,57,111,98,117),
+(6,7,68,104,57,113,100,118),
+(6,7,69,105,58,114,101,120),
+(6,7,70,107,59,116,103,122),
+(6,7,71,108,60,118,113,124),
+(6,7,72,110,61,120,117,127),
+(6,7,73,112,62,122,119,129),
+(6,7,74,114,63,125,122,131),
+(6,7,75,116,64,127,124,133),
+(6,7,76,118,65,129,126,136),
+(6,7,77,119,66,131,128,138),
+(6,7,78,121,67,133,130,140),
+(6,7,79,123,68,136,133,143),
+(6,7,80,125,69,138,135,145),
+(6,11,1,26,15,22,17,24),
+(6,11,2,27,16,23,18,25),
+(6,11,3,27,16,23,19,26),
+(6,11,4,28,17,24,20,27),
+(6,11,5,28,17,25,21,29),
+(6,11,6,29,18,25,22,30),
+(6,11,7,29,18,26,23,31),
+(6,11,8,30,19,27,24,32),
+(6,11,9,30,19,27,26,34),
+(6,11,10,31,20,28,27,35),
+(6,11,11,32,20,29,28,36),
+(6,11,12,32,21,29,29,37),
+(6,11,13,33,21,30,30,39),
+(6,11,14,33,22,31,31,40),
+(6,11,15,34,23,32,32,41),
+(6,11,16,35,23,32,34,43),
+(6,11,17,35,24,33,35,44),
+(6,11,18,36,24,34,36,45),
+(6,11,19,37,25,35,37,47),
+(6,11,20,37,26,35,39,48),
+(6,11,21,38,26,36,40,50),
+(6,11,22,39,27,37,41,51),
+(6,11,23,39,28,38,42,52),
+(6,11,24,40,28,39,44,54),
+(6,11,25,41,29,39,45,55),
+(6,11,26,41,30,40,46,57),
+(6,11,27,42,30,41,47,58),
+(6,11,28,43,31,42,49,60),
+(6,11,29,44,32,43,50,61),
+(6,11,30,44,32,44,52,63),
+(6,11,31,45,33,44,53,64),
+(6,11,32,46,34,45,54,66),
+(6,11,33,47,34,46,56,67),
+(6,11,34,47,35,47,57,69),
+(6,11,35,48,36,48,58,71),
+(6,11,36,49,36,49,60,72),
+(6,11,37,50,37,50,61,74),
+(6,11,38,51,38,51,63,76),
+(6,11,39,52,39,52,64,77),
+(6,11,40,52,39,53,66,79),
+(6,11,41,53,40,54,67,81),
+(6,11,42,54,41,55,69,82),
+(6,11,43,55,42,56,70,84),
+(6,11,44,56,43,57,72,86),
+(6,11,45,57,43,57,73,87),
+(6,11,46,57,44,58,75,89),
+(6,11,47,58,45,60,76,91),
+(6,11,48,59,46,61,78,93),
+(6,11,49,60,47,62,79,94),
+(6,11,50,61,47,63,81,96),
+(6,11,51,62,48,64,83,98),
+(6,11,52,63,49,65,84,100),
+(6,11,53,64,50,66,86,102),
+(6,11,54,65,51,67,87,104),
+(6,11,55,66,51,68,89,105),
+(6,11,56,67,52,69,91,107),
+(6,11,57,68,53,70,92,109),
+(6,11,58,69,54,71,94,111),
+(6,11,59,70,55,72,96,113),
+(6,11,60,71,56,73,97,115),
+(6,11,61,72,57,74,99,117),
+(6,11,62,73,58,76,101,119),
+(6,11,63,74,59,77,103,121),
+(6,11,64,75,59,78,104,123),
+(6,11,65,76,60,79,106,125),
+(6,11,66,77,61,80,108,127),
+(6,11,67,78,62,81,110,129),
+(6,11,68,79,63,83,111,131),
+(6,11,69,80,64,84,113,133),
+(6,11,70,81,65,85,115,135),
+(6,11,71,83,66,86,117,137),
+(6,11,72,84,68,88,120,140),
+(6,11,73,85,69,89,122,142),
+(6,11,74,86,70,91,124,145),
+(6,11,75,88,71,92,126,147),
+(6,11,76,89,72,94,128,150),
+(6,11,77,90,73,95,131,153),
+(6,11,78,92,75,97,133,155),
+(6,11,79,93,76,98,136,158),
+(6,11,80,94,77,100,138,185),
+(7,1,1,18,23,21,24,20),
+(7,1,2,19,24,22,24,20),
+(7,1,3,21,25,23,24,21),
+(7,1,4,22,25,25,24,21),
+(7,1,5,23,26,26,24,21),
+(7,1,6,25,27,27,24,21),
+(7,1,7,26,28,28,24,22),
+(7,1,8,27,29,29,25,22),
+(7,1,9,29,29,31,25,22),
+(7,1,10,30,30,32,25,23),
+(7,1,11,32,31,33,25,23),
+(7,1,12,33,32,34,25,23),
+(7,1,13,34,33,36,25,24),
+(7,1,14,36,34,37,25,24),
+(7,1,15,37,35,38,25,24),
+(7,1,16,39,36,40,25,25),
+(7,1,17,40,36,41,25,25),
+(7,1,18,42,37,43,26,25),
+(7,1,19,43,38,44,26,26),
+(7,1,20,45,39,45,26,26),
+(7,1,21,47,40,47,26,26),
+(7,1,22,48,41,48,26,27),
+(7,1,23,50,42,50,26,27),
+(7,1,24,51,43,51,26,28),
+(7,1,25,53,44,52,27,28),
+(7,1,26,55,45,54,27,28),
+(7,1,27,56,46,55,27,29),
+(7,1,28,58,47,57,27,29),
+(7,1,29,59,48,58,27,30),
+(7,1,30,61,49,60,27,30),
+(7,1,31,63,50,62,27,30),
+(7,1,32,65,51,63,28,31),
+(7,1,33,66,52,65,28,31),
+(7,1,34,68,53,66,28,32),
+(7,1,35,70,55,68,28,32),
+(7,1,36,72,56,69,28,33),
+(7,1,37,73,57,71,29,33),
+(7,1,38,75,58,73,29,34),
+(7,1,39,77,59,74,29,34),
+(7,1,40,79,60,76,29,35),
+(7,1,41,81,61,78,29,35),
+(7,1,42,82,62,79,30,35),
+(7,1,43,84,64,81,30,36),
+(7,1,44,86,65,83,30,36),
+(7,1,45,88,66,85,30,37),
+(7,1,46,90,67,86,30,37),
+(7,1,47,92,68,88,31,38),
+(7,1,48,94,70,90,31,38),
+(7,1,49,96,71,92,31,39),
+(7,1,50,98,72,93,31,40),
+(7,1,51,100,73,95,32,40),
+(7,1,52,102,75,97,32,41),
+(7,1,53,104,76,99,32,41),
+(7,1,54,106,77,101,32,42),
+(7,1,55,108,78,103,33,42),
+(7,1,56,110,80,104,33,43),
+(7,1,57,112,81,106,33,43),
+(7,1,58,114,82,108,33,44),
+(7,1,59,116,84,110,34,44),
+(7,1,60,118,85,112,34,45),
+(7,1,61,120,86,114,34,46),
+(7,1,62,122,88,116,35,46),
+(7,1,63,125,89,118,35,47),
+(7,1,64,127,91,120,35,47),
+(7,1,65,129,92,122,35,48),
+(7,1,66,131,93,124,36,49),
+(7,1,67,133,95,126,36,49),
+(7,1,68,136,96,128,36,50),
+(7,1,69,138,98,130,37,50),
+(7,1,70,140,99,132,37,51),
+(7,1,71,143,100,134,37,52),
+(7,1,72,145,102,137,37,53),
+(7,1,73,148,104,139,37,54),
+(7,1,74,151,105,142,38,54),
+(7,1,75,154,107,144,38,55),
+(7,1,76,157,109,147,38,56),
+(7,1,77,163,111,153,39,57),
+(7,1,78,169,112,158,39,57),
+(7,1,79,172,114,161,39,58),
+(7,1,80,175,116,164,40,59),
+(7,4,1,16,26,20,24,20),
+(7,4,2,17,27,21,24,20),
+(7,4,3,18,29,21,24,21),
+(7,4,4,18,30,22,24,21),
+(7,4,5,19,32,23,25,21),
+(7,4,6,20,33,24,25,22),
+(7,4,7,21,35,24,25,22),
+(7,4,8,22,36,25,25,23),
+(7,4,9,22,38,26,25,23),
+(7,4,10,23,39,26,25,23),
+(7,4,11,24,41,27,25,24),
+(7,4,12,25,42,28,26,24),
+(7,4,13,26,44,29,26,25),
+(7,4,14,27,46,30,26,25),
+(7,4,15,28,47,30,26,25),
+(7,4,16,28,49,31,26,26),
+(7,4,17,29,50,32,27,26),
+(7,4,18,30,52,33,27,27),
+(7,4,19,31,54,34,27,27),
+(7,4,20,32,56,35,27,28),
+(7,4,21,33,57,35,27,28),
+(7,4,22,34,59,36,28,29),
+(7,4,23,35,61,37,28,29),
+(7,4,24,36,62,38,28,30),
+(7,4,25,37,64,39,28,30),
+(7,4,26,38,66,40,29,31),
+(7,4,27,39,68,41,29,31),
+(7,4,28,40,70,42,29,32),
+(7,4,29,41,72,43,29,32),
+(7,4,30,42,73,43,29,33),
+(7,4,31,43,75,44,30,33),
+(7,4,32,44,77,45,30,34),
+(7,4,33,45,79,46,30,34),
+(7,4,34,46,81,47,31,35),
+(7,4,35,47,83,48,31,35),
+(7,4,36,48,85,49,31,36),
+(7,4,37,49,87,50,31,36),
+(7,4,38,50,89,51,32,37),
+(7,4,39,51,91,52,32,38),
+(7,4,40,53,93,53,32,38),
+(7,4,41,54,95,54,33,39),
+(7,4,42,55,97,55,33,39),
+(7,4,43,56,99,56,33,40),
+(7,4,44,57,101,57,33,40),
+(7,4,45,58,103,59,34,41),
+(7,4,46,59,105,60,34,42),
+(7,4,47,61,107,61,34,42),
+(7,4,48,62,110,62,35,43),
+(7,4,49,63,112,63,35,44),
+(7,4,50,64,114,64,35,44),
+(7,4,51,65,116,65,36,45),
+(7,4,52,67,118,66,36,45),
+(7,4,53,68,121,67,36,46),
+(7,4,54,69,123,69,37,47),
+(7,4,55,70,125,70,37,47),
+(7,4,56,72,127,71,37,48),
+(7,4,57,73,130,72,38,49),
+(7,4,58,74,132,73,38,49),
+(7,4,59,75,134,74,39,50),
+(7,4,60,77,137,76,39,51),
+(7,4,61,78,139,77,39,51),
+(7,4,62,79,141,78,40,52),
+(7,4,63,81,144,79,40,53),
+(7,4,64,82,146,80,41,54),
+(7,4,65,83,149,82,41,54),
+(7,4,66,85,151,83,41,55),
+(7,4,67,86,154,84,42,56),
+(7,4,68,87,156,85,42,57),
+(7,4,69,89,158,87,43,57),
+(7,4,70,90,161,88,43,58),
+(7,4,71,92,164,89,44,59),
+(7,4,72,94,167,91,45,59),
+(7,4,73,95,170,93,45,60),
+(7,4,74,97,173,94,46,61),
+(7,4,75,99,176,96,46,62),
+(7,4,76,100,179,97,46,63),
+(7,4,77,102,182,102,47,64),
+(7,4,78,104,186,105,47,65),
+(7,4,79,106,189,106,48,66),
+(7,4,80,108,192,108,48,67),
+(7,6,1,18,23,21,24,20),
+(7,6,2,19,24,22,24,20),
+(7,6,3,21,25,23,24,21),
+(7,6,4,22,25,25,24,21),
+(7,6,5,23,26,26,24,21),
+(7,6,6,25,27,27,24,21),
+(7,6,7,26,28,28,24,22),
+(7,6,8,27,29,29,25,22),
+(7,6,9,29,29,31,25,22),
+(7,6,10,30,30,32,25,23),
+(7,6,11,32,31,33,25,23),
+(7,6,12,33,32,34,25,23),
+(7,6,13,34,33,36,25,24),
+(7,6,14,36,34,37,25,24),
+(7,6,15,37,35,38,25,24),
+(7,6,16,39,36,40,25,25),
+(7,6,17,40,36,41,25,25),
+(7,6,18,42,37,43,26,25),
+(7,6,19,43,38,44,26,26),
+(7,6,20,45,39,45,26,26),
+(7,6,21,47,40,47,26,26),
+(7,6,22,48,41,48,26,27),
+(7,6,23,50,42,50,26,27),
+(7,6,24,51,43,51,26,28),
+(7,6,25,53,44,52,27,28),
+(7,6,26,55,45,54,27,28),
+(7,6,27,56,46,55,27,29),
+(7,6,28,58,47,57,27,29),
+(7,6,29,59,48,58,27,30),
+(7,6,30,61,49,60,27,30),
+(7,6,31,63,50,62,27,30),
+(7,6,32,65,51,63,28,31),
+(7,6,33,66,52,65,28,31),
+(7,6,34,68,53,66,28,32),
+(7,6,35,70,55,68,28,32),
+(7,6,36,72,56,69,28,33),
+(7,6,37,73,57,71,29,33),
+(7,6,38,75,58,73,29,34),
+(7,6,39,77,59,74,29,34),
+(7,6,40,79,60,76,29,35),
+(7,6,41,81,61,78,29,35),
+(7,6,42,82,62,79,30,35),
+(7,6,43,84,64,81,30,36),
+(7,6,44,86,65,83,30,36),
+(7,6,45,88,66,85,30,37),
+(7,6,46,90,67,86,30,37),
+(7,6,47,92,68,88,31,38),
+(7,6,48,94,70,90,31,38),
+(7,6,49,96,71,92,31,39),
+(7,6,50,98,72,93,31,40),
+(7,6,51,99,72,93,32,40),
+(7,6,52,100,73,95,32,41),
+(7,6,53,101,74,96,32,41),
+(7,6,54,102,75,97,32,42),
+(7,6,55,103,76,98,33,42),
+(7,6,56,106,78,101,33,43),
+(7,6,57,111,79,103,33,43),
+(7,6,58,113,80,105,34,44),
+(7,6,59,116,82,107,34,44),
+(7,6,60,118,83,109,34,45),
+(7,6,61,120,84,111,34,46),
+(7,6,62,127,86,119,34,46),
+(7,6,63,129,87,122,35,47),
+(7,6,64,132,89,125,35,47),
+(7,6,65,135,90,127,35,48),
+(7,6,66,137,92,130,35,49),
+(7,6,67,138,93,130,36,49),
+(7,6,68,140,95,131,36,50),
+(7,6,69,142,96,131,36,51),
+(7,6,70,145,98,132,36,51),
+(7,6,71,148,100,135,37,52),
+(7,6,72,150,101,137,37,53),
+(7,6,73,153,103,140,37,54),
+(7,6,74,154,105,142,37,54),
+(7,6,75,155,106,145,38,55),
+(7,6,76,158,108,151,38,56),
+(7,6,77,161,110,157,38,57),
+(7,6,78,164,111,162,38,57),
+(7,6,79,167,113,165,39,58),
+(7,6,80,170,115,168,39,59),
+(7,8,1,15,23,19,27,22),
+(7,8,2,15,23,19,28,23),
+(7,8,3,15,23,20,30,25),
+(7,8,4,15,23,20,31,26),
+(7,8,5,15,24,20,32,27),
+(7,8,6,15,24,20,34,29),
+(7,8,7,16,24,21,35,30),
+(7,8,8,16,24,21,37,31),
+(7,8,9,16,24,21,38,33),
+(7,8,10,16,24,22,40,34),
+(7,8,11,16,25,22,41,36),
+(7,8,12,16,25,22,42,37),
+(7,8,13,16,25,23,44,38),
+(7,8,14,16,25,23,45,40),
+(7,8,15,17,25,23,47,41),
+(7,8,16,17,25,24,49,43),
+(7,8,17,17,26,24,50,44),
+(7,8,18,17,26,24,52,46),
+(7,8,19,17,26,25,53,47),
+(7,8,20,17,26,25,55,49),
+(7,8,21,17,26,26,57,51),
+(7,8,22,18,27,26,58,52),
+(7,8,23,18,27,26,60,54),
+(7,8,24,18,27,27,61,55),
+(7,8,25,18,27,27,63,57),
+(7,8,26,18,28,27,65,59),
+(7,8,27,18,28,28,67,60),
+(7,8,28,18,28,28,68,62),
+(7,8,29,19,28,29,70,64),
+(7,8,30,19,29,29,72,65),
+(7,8,31,19,29,30,74,67),
+(7,8,32,19,29,30,75,69),
+(7,8,33,19,29,30,77,70),
+(7,8,34,20,30,31,79,72),
+(7,8,35,20,30,31,81,74),
+(7,8,36,20,30,32,83,76),
+(7,8,37,20,30,32,85,78),
+(7,8,38,20,31,33,86,79),
+(7,8,39,21,31,33,88,81),
+(7,8,40,21,31,34,90,83),
+(7,8,41,21,32,34,92,85),
+(7,8,42,21,32,35,94,87),
+(7,8,43,21,32,35,96,89),
+(7,8,44,22,32,36,98,91),
+(7,8,45,22,33,36,100,92),
+(7,8,46,22,33,37,102,94),
+(7,8,47,22,33,37,104,96),
+(7,8,48,22,34,38,106,98),
+(7,8,49,23,34,38,108,100),
+(7,8,50,23,34,39,110,102),
+(7,8,51,23,35,39,112,104),
+(7,8,52,23,35,40,114,106),
+(7,8,53,24,35,40,117,108),
+(7,8,54,24,36,41,119,110),
+(7,8,55,24,36,41,121,112),
+(7,8,56,24,37,42,123,114),
+(7,8,57,25,37,42,125,117),
+(7,8,58,25,37,43,127,119),
+(7,8,59,25,38,43,130,121),
+(7,8,60,25,38,44,132,123),
+(7,8,61,26,38,45,134,125),
+(7,8,62,26,39,45,136,127),
+(7,8,63,26,39,46,139,129),
+(7,8,64,26,40,46,141,132),
+(7,8,65,27,40,47,143,134),
+(7,8,66,27,40,48,146,136),
+(7,8,67,27,41,48,148,138),
+(7,8,68,27,41,49,150,140),
+(7,8,69,28,42,49,153,143),
+(7,8,70,28,42,50,155,145),
+(7,8,71,28,42,51,168,148),
+(7,8,72,28,43,52,168,151),
+(7,8,73,28,43,53,171,154),
+(7,8,74,29,44,53,174,156),
+(7,8,75,29,44,54,177,159),
+(7,8,76,29,44,55,180,162),
+(7,8,77,30,45,56,183,165),
+(7,8,78,30,45,56,186,168),
+(7,8,79,30,46,57,190,171),
+(7,8,80,31,46,58,193,174),
+(7,9,1,15,23,20,26,22),
+(7,9,2,15,23,21,27,23),
+(7,9,3,16,24,21,28,24),
+(7,9,4,16,24,22,29,25),
+(7,9,5,16,24,22,31,27),
+(7,9,6,17,25,23,32,28),
+(7,9,7,17,25,23,33,29),
+(7,9,8,17,26,24,34,30),
+(7,9,9,17,26,25,36,31),
+(7,9,10,18,26,25,37,33),
+(7,9,11,18,27,26,38,34),
+(7,9,12,18,27,26,39,35),
+(7,9,13,19,28,27,41,36),
+(7,9,14,19,28,28,42,38),
+(7,9,15,20,28,28,43,39),
+(7,9,16,20,29,29,45,40),
+(7,9,17,20,29,30,46,42),
+(7,9,18,21,30,30,47,43),
+(7,9,19,21,30,31,49,44),
+(7,9,20,21,31,32,50,46),
+(7,9,21,22,31,32,51,47),
+(7,9,22,22,31,33,53,49),
+(7,9,23,23,32,34,54,50),
+(7,9,24,23,32,34,56,51),
+(7,9,25,23,33,35,57,53),
+(7,9,26,24,33,36,59,54),
+(7,9,27,24,34,37,60,56),
+(7,9,28,25,34,37,62,57),
+(7,9,29,25,35,38,63,59),
+(7,9,30,25,35,39,65,60),
+(7,9,31,26,36,40,66,62),
+(7,9,32,26,36,40,68,63),
+(7,9,33,27,37,41,69,65),
+(7,9,34,27,38,42,71,66),
+(7,9,35,28,38,43,73,68),
+(7,9,36,28,39,43,74,69),
+(7,9,37,28,39,44,76,71),
+(7,9,38,29,40,45,77,73),
+(7,9,39,29,40,46,79,74),
+(7,9,40,30,41,47,81,76),
+(7,9,41,30,41,48,82,78),
+(7,9,42,31,42,48,84,79),
+(7,9,43,31,43,49,86,81),
+(7,9,44,32,43,50,88,83),
+(7,9,45,32,44,51,89,84),
+(7,9,46,33,44,52,91,86),
+(7,9,47,33,45,53,93,88),
+(7,9,48,34,46,54,95,89),
+(7,9,49,34,46,54,96,91),
+(7,9,50,35,47,55,98,93),
+(7,9,51,35,48,56,100,95),
+(7,9,52,36,48,57,102,97),
+(7,9,53,36,49,58,104,98),
+(7,9,54,37,50,59,105,100),
+(7,9,55,37,50,60,107,102),
+(7,9,56,38,51,61,109,104),
+(7,9,57,38,52,62,111,106),
+(7,9,58,39,52,63,113,108),
+(7,9,59,40,53,64,115,109),
+(7,9,60,40,54,65,117,111),
+(7,9,61,41,54,66,119,113),
+(7,9,62,41,55,67,121,115),
+(7,9,63,42,56,68,123,117),
+(7,9,64,42,57,69,125,119),
+(7,9,65,43,57,70,127,121),
+(7,9,66,44,58,71,129,123),
+(7,9,67,44,59,72,131,125),
+(7,9,68,45,59,73,133,127),
+(7,9,69,45,60,74,135,129),
+(7,9,70,46,61,75,137,131),
+(7,9,71,47,62,84,147,142),
+(7,9,72,48,62,85,148,144),
+(7,9,73,49,63,85,153,147),
+(7,9,74,49,64,88,153,150),
+(7,9,75,50,65,90,155,152),
+(7,9,76,51,66,91,158,155),
+(7,9,77,52,67,92,161,158),
+(7,9,78,52,68,93,163,161),
+(7,9,79,53,69,95,166,164),
+(7,9,80,54,70,96,170,166),
+(8,1,1,24,22,23,16,21),
+(8,1,2,25,23,24,16,21),
+(8,1,3,27,24,25,16,22),
+(8,1,4,28,24,26,16,22),
+(8,1,5,29,25,28,16,22),
+(8,1,6,31,26,29,16,22),
+(8,1,7,32,27,30,17,23),
+(8,1,8,33,28,31,17,23),
+(8,1,9,35,28,33,17,23),
+(8,1,10,36,29,34,17,24),
+(8,1,11,37,30,35,17,24),
+(8,1,12,39,31,36,17,24),
+(8,1,13,40,32,38,17,25),
+(8,1,14,42,33,39,17,25),
+(8,1,15,43,34,40,18,25),
+(8,1,16,45,35,42,18,26),
+(8,1,17,46,35,43,18,26),
+(8,1,18,48,36,44,18,26),
+(8,1,19,49,37,46,18,27),
+(8,1,20,51,38,47,18,27),
+(8,1,21,52,39,49,18,27),
+(8,1,22,54,40,50,18,28),
+(8,1,23,55,41,51,19,28),
+(8,1,24,57,42,53,19,29),
+(8,1,25,59,43,54,19,29),
+(8,1,26,60,44,56,19,29),
+(8,1,27,62,45,57,19,30),
+(8,1,28,63,46,59,19,30),
+(8,1,29,65,47,60,20,31),
+(8,1,30,67,48,62,20,31),
+(8,1,31,69,49,63,20,31),
+(8,1,32,70,50,65,20,32),
+(8,1,33,72,51,67,20,32),
+(8,1,34,74,53,68,20,33),
+(8,1,35,75,54,70,21,33),
+(8,1,36,77,55,71,21,34),
+(8,1,37,79,56,73,21,34),
+(8,1,38,81,57,75,21,35),
+(8,1,39,83,58,76,21,35),
+(8,1,40,84,59,78,22,35),
+(8,1,41,86,60,80,22,36),
+(8,1,42,88,62,81,22,36),
+(8,1,43,90,63,83,22,37),
+(8,1,44,92,64,85,22,37),
+(8,1,45,94,65,86,23,38),
+(8,1,46,96,66,88,23,38),
+(8,1,47,98,67,90,23,39),
+(8,1,48,100,69,92,23,39),
+(8,1,49,102,70,93,24,40),
+(8,1,50,103,71,95,24,40),
+(8,1,51,105,72,97,24,41),
+(8,1,52,107,74,99,24,42),
+(8,1,53,109,75,101,25,42),
+(8,1,54,112,76,103,25,43),
+(8,1,55,114,78,104,25,43),
+(8,1,56,116,79,106,25,44),
+(8,1,57,118,80,108,25,44),
+(8,1,58,120,81,110,26,45),
+(8,1,59,122,83,112,26,45),
+(8,1,60,124,84,114,26,46),
+(8,1,61,126,85,116,27,47),
+(8,1,62,128,87,118,27,47),
+(8,1,63,130,88,120,27,48),
+(8,1,64,133,90,122,27,48),
+(8,1,65,135,91,124,28,49),
+(8,1,66,137,92,126,28,50),
+(8,1,67,139,94,128,28,50),
+(8,1,68,141,95,130,28,51),
+(8,1,69,144,97,132,29,51),
+(8,1,70,146,98,134,29,52),
+(8,1,71,149,99,136,29,53),
+(8,1,72,151,101,139,29,54),
+(8,1,73,154,103,141,29,55),
+(8,1,74,157,104,144,30,55),
+(8,1,75,166,106,151,30,56),
+(8,1,76,172,108,157,30,57),
+(8,1,77,175,110,161,31,58),
+(8,1,78,179,111,163,31,58),
+(8,1,79,182,113,164,31,59),
+(8,1,80,185,115,169,32,60),
+(8,3,1,21,25,22,16,22),
+(8,3,2,21,26,23,17,23),
+(8,3,3,22,28,24,17,23),
+(8,3,4,22,29,25,18,24),
+(8,3,5,23,30,26,18,25),
+(8,3,6,23,32,27,19,25),
+(8,3,7,24,33,28,20,26),
+(8,3,8,24,35,28,20,26),
+(8,3,9,25,36,29,21,27),
+(8,3,10,25,38,30,21,28),
+(8,3,11,25,39,31,22,29),
+(8,3,12,26,41,32,23,29),
+(8,3,13,26,42,33,23,30),
+(8,3,14,27,44,34,24,31),
+(8,3,15,27,45,35,25,31),
+(8,3,16,28,47,36,25,32),
+(8,3,17,28,48,38,26,33),
+(8,3,18,29,50,39,27,34),
+(8,3,19,29,51,40,28,34),
+(8,3,20,30,53,41,28,35),
+(8,3,21,31,55,42,29,36),
+(8,3,22,31,56,43,30,37),
+(8,3,23,32,58,44,30,37),
+(8,3,24,32,60,45,31,38),
+(8,3,25,33,61,46,32,39),
+(8,3,26,33,63,48,33,40),
+(8,3,27,34,65,49,33,41),
+(8,3,28,35,66,50,34,41),
+(8,3,29,35,68,51,35,42),
+(8,3,30,36,70,52,36,43),
+(8,3,31,36,72,53,37,44),
+(8,3,32,37,73,55,37,45),
+(8,3,33,38,75,56,38,46),
+(8,3,34,38,77,57,39,47),
+(8,3,35,39,79,58,40,48),
+(8,3,36,39,81,60,41,48),
+(8,3,37,40,83,61,41,49),
+(8,3,38,41,85,62,42,50),
+(8,3,39,41,86,63,43,51),
+(8,3,40,42,88,65,44,52),
+(8,3,41,43,90,66,45,53),
+(8,3,42,43,92,67,46,54),
+(8,3,43,44,94,69,47,55),
+(8,3,44,45,96,70,47,56),
+(8,3,45,45,98,71,48,57),
+(8,3,46,46,100,73,49,58),
+(8,3,47,47,102,74,50,59),
+(8,3,48,48,104,76,51,60),
+(8,3,49,48,106,77,52,61),
+(8,3,50,49,108,78,53,62),
+(8,3,51,50,110,80,54,63),
+(8,3,52,51,113,81,55,64),
+(8,3,53,51,115,83,56,65),
+(8,3,54,52,117,84,57,66),
+(8,3,55,53,119,86,58,67),
+(8,3,56,54,121,87,59,68),
+(8,3,57,54,123,89,60,69),
+(8,3,58,55,126,90,61,70),
+(8,3,59,56,128,92,62,71),
+(8,3,60,57,130,93,63,73),
+(8,3,61,58,132,95,64,74),
+(8,3,62,58,134,96,65,75),
+(8,3,63,59,137,98,66,76),
+(8,3,64,60,139,99,67,77),
+(8,3,65,61,141,101,68,78),
+(8,3,66,62,144,103,69,79),
+(8,3,67,62,146,104,70,80),
+(8,3,68,63,148,106,71,82),
+(8,3,69,64,151,107,72,83),
+(8,3,70,65,153,109,73,84),
+(8,3,71,66,156,111,74,85),
+(8,3,72,67,159,113,75,86),
+(8,3,73,68,162,115,76,88),
+(8,3,74,69,165,117,78,89),
+(8,3,75,70,174,119,82,91),
+(8,3,76,71,177,121,83,92),
+(8,3,77,72,180,123,85,94),
+(8,3,78,73,184,125,86,95),
+(8,3,79,74,187,127,87,97),
+(8,3,80,75,190,129,89,98),
+(8,4,1,22,25,22,16,21),
+(8,4,2,23,26,23,16,21),
+(8,4,3,24,28,23,16,22),
+(8,4,4,24,29,24,16,22),
+(8,4,5,25,31,25,17,22),
+(8,4,6,26,32,25,17,23),
+(8,4,7,27,34,26,17,23),
+(8,4,8,27,35,27,17,24),
+(8,4,9,28,37,28,17,24),
+(8,4,10,29,38,28,18,24),
+(8,4,11,30,40,29,18,25),
+(8,4,12,31,41,30,18,25),
+(8,4,13,32,43,31,18,26),
+(8,4,14,32,45,32,18,26),
+(8,4,15,33,46,32,19,26),
+(8,4,16,34,48,33,19,27),
+(8,4,17,35,50,34,19,27),
+(8,4,18,36,51,35,19,28),
+(8,4,19,37,53,36,19,28),
+(8,4,20,38,55,36,20,29),
+(8,4,21,39,56,37,20,29),
+(8,4,22,40,58,38,20,30),
+(8,4,23,41,60,39,20,30),
+(8,4,24,42,62,40,20,31),
+(8,4,25,43,63,41,21,31),
+(8,4,26,44,65,42,21,32),
+(8,4,27,45,67,43,21,32),
+(8,4,28,46,69,44,21,33),
+(8,4,29,47,71,44,22,33),
+(8,4,30,48,72,45,22,34),
+(8,4,31,49,74,46,22,34),
+(8,4,32,50,76,47,22,35),
+(8,4,33,51,78,48,23,35),
+(8,4,34,52,80,49,23,36),
+(8,4,35,53,82,50,23,36),
+(8,4,36,54,84,51,24,37),
+(8,4,37,55,86,52,24,37),
+(8,4,38,56,88,53,24,38),
+(8,4,39,57,90,54,24,38),
+(8,4,40,58,92,55,25,39),
+(8,4,41,59,94,56,25,40),
+(8,4,42,60,96,57,25,40),
+(8,4,43,62,98,58,26,41),
+(8,4,44,63,100,59,26,41),
+(8,4,45,64,102,60,26,42),
+(8,4,46,65,104,61,27,43),
+(8,4,47,66,107,63,27,43),
+(8,4,48,67,109,64,27,44),
+(8,4,49,69,111,65,27,44),
+(8,4,50,70,113,66,28,45),
+(8,4,51,71,115,67,28,46),
+(8,4,52,72,117,68,28,46),
+(8,4,53,74,120,69,29,47),
+(8,4,54,75,122,70,29,48),
+(8,4,55,76,124,72,29,48),
+(8,4,56,77,126,73,30,49),
+(8,4,57,79,129,74,30,50),
+(8,4,58,80,131,75,30,50),
+(8,4,59,81,133,76,31,51),
+(8,4,60,82,136,77,31,52),
+(8,4,61,84,138,79,32,52),
+(8,4,62,85,140,80,32,53),
+(8,4,63,86,143,81,32,54),
+(8,4,64,88,145,82,33,55),
+(8,4,65,89,148,84,33,55),
+(8,4,66,90,150,85,33,56),
+(8,4,67,92,153,86,34,57),
+(8,4,68,93,155,87,34,58),
+(8,4,69,95,157,89,35,58),
+(8,4,70,96,160,90,35,59),
+(8,4,71,98,163,94,35,60),
+(8,4,72,100,166,96,36,60),
+(8,4,73,101,169,96,36,61),
+(8,4,74,103,172,97,37,62),
+(8,4,75,105,175,98,37,63),
+(8,4,76,106,178,99,37,64),
+(8,4,77,108,181,105,38,65),
+(8,4,78,110,185,107,38,66),
+(8,4,79,112,188,109,39,67),
+(8,4,80,114,191,110,39,68),
+(8,5,1,21,22,21,18,24),
+(8,5,2,21,22,21,19,25),
+(8,5,3,21,22,22,21,27),
+(8,5,4,21,23,22,22,28),
+(8,5,5,22,23,22,23,29),
+(8,5,6,22,23,23,25,31),
+(8,5,7,22,23,23,26,32),
+(8,5,8,22,24,24,27,34),
+(8,5,9,22,24,24,29,35),
+(8,5,10,22,24,24,30,37),
+(8,5,11,23,24,25,32,38),
+(8,5,12,23,24,25,33,40),
+(8,5,13,23,25,26,35,41),
+(8,5,14,23,25,26,36,43),
+(8,5,15,23,25,26,38,44),
+(8,5,16,24,26,27,39,46),
+(8,5,17,24,26,27,41,47),
+(8,5,18,24,26,28,42,49),
+(8,5,19,24,26,28,44,50),
+(8,5,20,24,27,29,45,52),
+(8,5,21,25,27,29,47,54),
+(8,5,22,25,27,30,48,55),
+(8,5,23,25,28,30,50,57),
+(8,5,24,25,28,31,52,59),
+(8,5,25,25,28,31,53,60),
+(8,5,26,26,28,32,55,62),
+(8,5,27,26,29,32,56,64),
+(8,5,28,26,29,33,58,65),
+(8,5,29,26,29,33,60,67),
+(8,5,30,27,30,34,62,69),
+(8,5,31,27,30,34,63,71),
+(8,5,32,27,30,35,65,73),
+(8,5,33,27,31,35,67,74),
+(8,5,34,28,31,36,68,76),
+(8,5,35,28,32,36,70,78),
+(8,5,36,28,32,37,72,80),
+(8,5,37,29,32,37,74,82),
+(8,5,38,29,33,38,76,84),
+(8,5,39,29,33,38,77,86),
+(8,5,40,29,33,39,79,87),
+(8,5,41,30,34,40,81,89),
+(8,5,42,30,34,40,83,91),
+(8,5,43,30,35,41,85,93),
+(8,5,44,31,35,41,87,95),
+(8,5,45,31,35,42,89,97),
+(8,5,46,31,36,43,91,99),
+(8,5,47,32,36,43,93,101),
+(8,5,48,32,37,44,94,103),
+(8,5,49,32,37,44,96,105),
+(8,5,50,33,37,45,98,107),
+(8,5,51,33,38,46,100,110),
+(8,5,52,33,38,46,102,112),
+(8,5,53,34,39,47,104,114),
+(8,5,54,34,39,48,106,116),
+(8,5,55,34,40,48,109,118),
+(8,5,56,35,40,49,111,120),
+(8,5,57,35,41,50,113,122),
+(8,5,58,35,41,50,115,125),
+(8,5,59,36,42,51,117,127),
+(8,5,60,36,42,52,119,129),
+(8,5,61,36,42,52,121,131),
+(8,5,62,37,43,53,123,133),
+(8,5,63,37,43,54,125,136),
+(8,5,64,38,44,55,128,138),
+(8,5,65,38,44,55,130,140),
+(8,5,66,38,45,56,132,143),
+(8,5,67,39,45,57,134,145),
+(8,5,68,39,46,58,136,147),
+(8,5,69,40,46,58,139,150),
+(8,5,70,40,47,59,141,152),
+(8,5,71,40,48,60,144,155),
+(8,5,72,41,48,60,147,158),
+(8,5,73,41,49,61,150,161),
+(8,5,74,42,49,62,152,164),
+(8,5,75,42,50,63,155,167),
+(8,5,76,42,51,64,158,170),
+(8,5,77,43,51,65,161,173),
+(8,5,78,43,52,66,164,176),
+(8,5,79,44,52,67,167,179),
+(8,5,80,44,53,68,170,182),
+(8,6,1,24,22,23,16,21),
+(8,6,2,25,23,24,16,21),
+(8,6,3,27,24,25,16,22),
+(8,6,4,28,24,26,16,22),
+(8,6,5,29,25,28,16,22),
+(8,6,6,31,26,29,16,22),
+(8,6,7,32,27,30,17,23),
+(8,6,8,33,28,31,17,23),
+(8,6,9,35,28,33,17,23),
+(8,6,10,36,29,34,17,24),
+(8,6,11,37,30,35,17,24),
+(8,6,12,39,31,36,17,24),
+(8,6,13,40,32,38,17,25),
+(8,6,14,42,33,39,17,25),
+(8,6,15,43,34,40,18,25),
+(8,6,16,45,35,42,18,26),
+(8,6,17,46,35,43,18,26),
+(8,6,18,48,36,44,18,26),
+(8,6,19,49,37,46,18,27),
+(8,6,20,51,38,47,18,27),
+(8,6,21,52,39,49,18,27),
+(8,6,22,54,40,50,18,28),
+(8,6,23,55,41,51,19,28),
+(8,6,24,57,42,53,19,29),
+(8,6,25,59,43,54,19,29),
+(8,6,26,60,44,56,19,29),
+(8,6,27,62,45,57,19,30),
+(8,6,28,63,46,59,19,30),
+(8,6,29,65,47,60,20,31),
+(8,6,30,67,48,62,20,31),
+(8,6,31,69,49,63,20,31),
+(8,6,32,70,50,65,20,32),
+(8,6,33,72,51,67,20,32),
+(8,6,34,74,53,68,20,33),
+(8,6,35,75,54,70,21,33),
+(8,6,36,77,55,71,21,34),
+(8,6,37,79,56,73,21,34),
+(8,6,38,81,57,75,21,35),
+(8,6,39,83,58,76,21,35),
+(8,6,40,84,59,78,22,35),
+(8,6,41,86,60,80,22,36),
+(8,6,42,88,62,81,22,36),
+(8,6,43,90,63,83,22,37),
+(8,6,44,92,64,85,22,37),
+(8,6,45,94,65,86,23,38),
+(8,6,46,96,66,88,23,38),
+(8,6,47,98,67,90,23,39),
+(8,6,48,100,69,92,23,39),
+(8,6,49,102,70,93,24,40),
+(8,6,50,103,71,95,24,40),
+(8,6,51,105,72,96,24,41),
+(8,6,52,106,74,97,24,42),
+(8,6,53,107,73,98,25,42),
+(8,6,54,108,74,99,25,43),
+(8,6,55,109,75,100,25,43),
+(8,6,56,112,77,103,25,44),
+(8,6,57,114,78,105,25,44),
+(8,6,58,118,79,107,26,45),
+(8,6,59,119,81,109,26,45),
+(8,6,60,121,82,111,26,46),
+(8,6,61,123,83,113,26,47),
+(8,6,62,126,85,115,26,47),
+(8,6,63,128,86,118,27,48),
+(8,6,64,131,88,120,27,48),
+(8,6,65,138,89,122,27,49),
+(8,6,66,140,91,125,27,50),
+(8,6,67,143,92,127,28,50),
+(8,6,68,145,94,129,28,51),
+(8,6,69,148,95,132,28,52),
+(8,6,70,151,97,134,28,52),
+(8,6,71,154,99,137,29,53),
+(8,6,72,156,100,139,29,54),
+(8,6,73,159,102,142,29,55),
+(8,6,74,162,104,144,29,55),
+(8,6,75,165,105,147,30,56),
+(8,6,76,168,107,150,30,57),
+(8,6,77,169,109,153,30,58),
+(8,6,78,170,110,155,30,58),
+(8,6,79,178,112,158,31,59),
+(8,6,80,181,114,161,31,60),
+(8,7,1,22,22,22,17,23),
+(8,7,2,23,22,23,18,24),
+(8,7,3,24,23,24,19,25),
+(8,7,4,25,23,25,20,26),
+(8,7,5,25,24,26,21,27),
+(8,7,6,26,24,27,22,28),
+(8,7,7,27,25,28,23,29),
+(8,7,8,28,25,29,24,30),
+(8,7,9,29,25,30,25,31),
+(8,7,10,30,26,31,26,33),
+(8,7,11,31,26,32,27,34),
+(8,7,12,32,27,33,28,35),
+(8,7,13,33,27,34,29,36),
+(8,7,14,34,28,35,30,37),
+(8,7,15,34,28,36,31,38),
+(8,7,16,35,29,38,32,39),
+(8,7,17,36,29,39,33,41),
+(8,7,18,37,30,40,34,42),
+(8,7,19,38,30,41,35,43),
+(8,7,20,39,31,42,36,44),
+(8,7,21,40,32,43,37,45),
+(8,7,22,41,32,45,38,47),
+(8,7,23,43,33,46,39,48),
+(8,7,24,44,33,47,40,49),
+(8,7,25,45,34,48,42,51),
+(8,7,26,46,34,49,43,52),
+(8,7,27,47,35,51,44,53),
+(8,7,28,48,35,52,45,54),
+(8,7,29,49,36,53,46,56),
+(8,7,30,50,37,54,48,57),
+(8,7,31,51,37,56,49,59),
+(8,7,32,52,38,57,50,60),
+(8,7,33,53,38,58,51,61),
+(8,7,34,55,39,60,52,63),
+(8,7,35,56,40,61,54,64),
+(8,7,36,57,40,62,55,66),
+(8,7,37,58,41,64,56,67),
+(8,7,38,59,42,65,57,68),
+(8,7,39,61,42,66,59,70),
+(8,7,40,62,43,68,60,71),
+(8,7,41,63,44,69,61,73),
+(8,7,42,64,44,71,63,74),
+(8,7,43,65,45,72,64,76),
+(8,7,44,67,46,74,65,77),
+(8,7,45,68,46,75,67,79),
+(8,7,46,69,47,76,68,80),
+(8,7,47,71,48,78,69,82),
+(8,7,48,72,49,79,71,83),
+(8,7,49,73,49,81,72,85),
+(8,7,50,74,50,82,74,87),
+(8,7,51,76,51,84,75,88),
+(8,7,52,77,51,85,77,90),
+(8,7,53,78,52,87,78,92),
+(8,7,54,80,53,89,79,93),
+(8,7,55,81,54,90,81,95),
+(8,7,56,83,55,92,82,96),
+(8,7,57,84,55,93,84,98),
+(8,7,58,85,56,95,85,100),
+(8,7,59,87,57,97,87,102),
+(8,7,60,88,58,98,88,103),
+(8,7,61,90,58,100,90,105),
+(8,7,62,91,59,101,91,107),
+(8,7,63,93,60,103,93,108),
+(8,7,64,94,61,105,94,110),
+(8,7,65,95,62,106,96,112),
+(8,7,66,97,63,108,98,114),
+(8,7,67,98,63,110,99,116),
+(8,7,68,100,64,112,101,117),
+(8,7,69,101,65,113,102,119),
+(8,7,70,103,66,115,104,121),
+(8,7,71,104,67,117,116,123),
+(8,7,72,106,68,119,118,126),
+(8,7,73,108,69,121,121,128),
+(8,7,74,110,70,124,123,130),
+(8,7,75,112,71,126,125,132),
+(8,7,76,114,72,128,127,135),
+(8,7,77,115,73,130,129,137),
+(8,7,78,117,74,132,132,139),
+(8,7,79,119,75,135,134,142),
+(8,7,80,121,76,137,136,144),
+(8,8,1,21,22,21,19,23),
+(8,8,2,21,22,21,20,24),
+(8,8,3,21,22,22,22,26),
+(8,8,4,21,22,22,23,27),
+(8,8,5,21,23,22,25,28),
+(8,8,6,21,23,22,26,30),
+(8,8,7,21,23,23,27,31),
+(8,8,8,22,23,23,29,32),
+(8,8,9,22,23,23,30,34),
+(8,8,10,22,23,24,32,35),
+(8,8,11,22,24,24,33,37),
+(8,8,12,22,24,24,35,38),
+(8,8,13,22,24,25,36,39),
+(8,8,14,22,24,25,38,41),
+(8,8,15,22,24,25,39,42),
+(8,8,16,22,24,26,41,44),
+(8,8,17,23,25,26,42,45),
+(8,8,18,23,25,26,44,47),
+(8,8,19,23,25,27,46,48),
+(8,8,20,23,25,27,47,50),
+(8,8,21,23,25,27,49,51),
+(8,8,22,23,26,28,51,53),
+(8,8,23,23,26,28,52,55),
+(8,8,24,24,26,29,54,56),
+(8,8,25,24,26,29,56,58),
+(8,8,26,24,27,29,57,60),
+(8,8,27,24,27,30,59,61),
+(8,8,28,24,27,30,61,63),
+(8,8,29,24,27,31,63,65),
+(8,8,30,24,28,31,64,66),
+(8,8,31,25,28,31,66,68),
+(8,8,32,25,28,32,68,70),
+(8,8,33,25,28,32,70,71),
+(8,8,34,25,29,33,71,73),
+(8,8,35,25,29,33,73,75),
+(8,8,36,26,29,34,75,77),
+(8,8,37,26,29,34,77,79),
+(8,8,38,26,30,35,79,80),
+(8,8,39,26,30,35,81,82),
+(8,8,40,26,30,35,83,84),
+(8,8,41,27,31,36,85,86),
+(8,8,42,27,31,36,87,88),
+(8,8,43,27,31,37,89,90),
+(8,8,44,27,32,37,91,91),
+(8,8,45,27,32,38,93,93),
+(8,8,46,28,32,38,95,95),
+(8,8,47,28,32,39,97,97),
+(8,8,48,28,33,39,99,99),
+(8,8,49,28,33,40,101,101),
+(8,8,50,29,33,40,103,103),
+(8,8,51,29,34,41,105,105),
+(8,8,52,29,34,42,107,107),
+(8,8,53,29,35,42,109,109),
+(8,8,54,30,35,43,111,111),
+(8,8,55,30,35,43,113,113),
+(8,8,56,30,36,44,115,115),
+(8,8,57,30,36,44,118,118),
+(8,8,58,31,36,45,120,120),
+(8,8,59,31,37,45,122,122),
+(8,8,60,31,37,46,124,124),
+(8,8,61,31,37,47,126,126),
+(8,8,62,32,38,47,129,128),
+(8,8,63,32,38,48,131,130),
+(8,8,64,32,39,48,133,133),
+(8,8,65,33,39,49,135,135),
+(8,8,66,33,39,50,138,137),
+(8,8,67,33,40,50,140,139),
+(8,8,68,33,40,51,142,141),
+(8,8,69,34,41,51,145,144),
+(8,8,70,34,41,52,147,146),
+(8,8,71,34,41,53,150,149),
+(8,8,72,34,42,54,153,152),
+(8,8,73,34,42,55,156,155),
+(8,8,74,35,43,55,159,157),
+(8,8,75,35,43,56,162,160),
+(8,8,76,35,43,57,168,163),
+(8,8,77,36,44,58,168,166),
+(8,8,78,36,44,58,171,169),
+(8,8,79,36,45,59,177,172),
+(8,8,80,37,45,60,177,175),
+(10,2,1,19,22,21,24,20),
+(10,2,2,20,23,22,25,21),
+(10,2,3,21,23,23,25,21),
+(10,2,4,22,24,24,26,22),
+(10,2,5,23,24,25,27,23),
+(10,2,6,25,25,26,27,24),
+(10,2,7,26,25,27,28,24),
+(10,2,8,27,26,28,29,25),
+(10,2,9,28,27,29,29,26),
+(10,2,10,29,27,31,30,26),
+(10,2,11,30,28,32,31,27),
+(10,2,12,32,29,33,31,28),
+(10,2,13,33,29,34,32,29),
+(10,2,14,34,30,35,33,30),
+(10,2,15,35,31,36,33,30),
+(10,2,16,37,31,37,34,31),
+(10,2,17,38,32,39,35,32),
+(10,2,18,39,33,40,36,33),
+(10,2,19,40,33,41,36,34),
+(10,2,20,42,34,42,37,35),
+(10,2,21,43,35,44,38,35),
+(10,2,22,44,35,45,39,36),
+(10,2,23,46,36,46,40,37),
+(10,2,24,47,37,47,40,38),
+(10,2,25,49,38,49,41,39),
+(10,2,26,50,38,50,42,40),
+(10,2,27,51,39,51,43,41),
+(10,2,28,53,40,53,44,42),
+(10,2,29,54,41,54,45,43),
+(10,2,30,56,41,55,45,43),
+(10,2,31,57,42,57,46,44),
+(10,2,32,58,43,58,47,45),
+(10,2,33,60,44,59,48,46),
+(10,2,34,61,45,61,49,47),
+(10,2,35,63,45,62,50,48),
+(10,2,36,64,46,64,51,49),
+(10,2,37,66,47,65,52,50),
+(10,2,38,67,48,67,53,51),
+(10,2,39,69,49,68,54,52),
+(10,2,40,71,50,69,55,53),
+(10,2,41,72,50,71,55,54),
+(10,2,42,74,51,72,56,55),
+(10,2,43,75,52,74,57,56),
+(10,2,44,77,53,75,58,57),
+(10,2,45,79,54,77,59,59),
+(10,2,46,80,55,78,60,60),
+(10,2,47,82,56,80,61,61),
+(10,2,48,83,57,82,62,62),
+(10,2,49,85,58,83,63,63),
+(10,2,50,87,59,85,64,64),
+(10,2,51,89,60,86,66,65),
+(10,2,52,90,61,88,67,66),
+(10,2,53,92,61,90,68,67),
+(10,2,54,94,62,91,69,69),
+(10,2,55,95,63,93,70,70),
+(10,2,56,97,64,95,71,71),
+(10,2,57,99,65,96,72,72),
+(10,2,58,101,66,98,73,73),
+(10,2,59,102,67,100,74,74),
+(10,2,60,104,68,101,75,76),
+(10,2,61,106,69,103,76,77),
+(10,2,62,108,70,105,78,78),
+(10,2,63,110,72,106,79,79),
+(10,2,64,112,73,108,80,80),
+(10,2,65,113,74,110,81,82),
+(10,2,66,115,75,112,82,83),
+(10,2,67,117,76,114,83,84),
+(10,2,68,119,77,115,85,85),
+(10,2,69,121,78,117,86,87),
+(10,2,70,123,79,119,87,88),
+(10,2,71,125,80,120,88,89),
+(10,2,72,128,81,123,90,91),
+(10,2,73,130,82,125,91,93),
+(10,2,74,133,84,127,93,94),
+(10,2,75,135,85,129,94,96),
+(10,2,76,137,86,132,96,97),
+(10,2,77,140,88,134,97,99),
+(10,2,78,143,89,136,99,101),
+(10,2,79,145,90,139,100,102),
+(10,2,80,148,92,141,102,104),
+(10,3,1,17,25,20,24,20),
+(10,3,2,17,26,21,25,21),
+(10,3,3,18,28,22,25,21),
+(10,3,4,18,29,23,26,22),
+(10,3,5,19,30,24,26,23),
+(10,3,6,19,32,25,27,23),
+(10,3,7,20,33,26,27,24),
+(10,3,8,20,35,27,28,25),
+(10,3,9,21,36,27,29,25),
+(10,3,10,21,38,28,29,26),
+(10,3,11,22,39,29,30,27),
+(10,3,12,22,41,30,31,27),
+(10,3,13,23,42,31,31,28),
+(10,3,14,23,44,32,32,29),
+(10,3,15,24,45,34,32,29),
+(10,3,16,24,47,35,33,30),
+(10,3,17,25,48,36,34,31),
+(10,3,18,25,50,37,34,32),
+(10,3,19,26,51,38,35,32),
+(10,3,20,26,53,39,36,33),
+(10,3,21,27,55,40,37,34),
+(10,3,22,27,56,41,37,35),
+(10,3,23,28,58,42,38,36),
+(10,3,24,28,60,43,39,36),
+(10,3,25,29,61,44,39,37),
+(10,3,26,30,63,46,40,38),
+(10,3,27,30,65,47,41,39),
+(10,3,28,31,66,48,42,40),
+(10,3,29,31,68,49,42,40),
+(10,3,30,32,70,50,43,41),
+(10,3,31,33,72,52,44,42),
+(10,3,32,33,73,53,45,43),
+(10,3,33,34,75,54,46,44),
+(10,3,34,34,77,55,46,45),
+(10,3,35,35,79,57,47,46),
+(10,3,36,36,81,58,48,47),
+(10,3,37,36,83,59,49,47),
+(10,3,38,37,85,60,50,48),
+(10,3,39,38,86,62,51,49),
+(10,3,40,38,88,63,51,50),
+(10,3,41,39,90,64,52,51),
+(10,3,42,40,92,66,53,52),
+(10,3,43,40,94,67,54,53),
+(10,3,44,41,96,68,55,54),
+(10,3,45,42,98,70,56,55),
+(10,3,46,42,100,71,57,56),
+(10,3,47,43,102,72,58,57),
+(10,3,48,44,104,74,59,58),
+(10,3,49,45,106,75,60,59),
+(10,3,50,45,108,77,61,60),
+(10,3,51,46,110,78,61,61),
+(10,3,52,47,113,79,62,62),
+(10,3,53,47,115,81,63,63),
+(10,3,54,48,117,82,64,64),
+(10,3,55,49,119,84,65,65),
+(10,3,56,50,121,85,66,66),
+(10,3,57,50,123,87,67,67),
+(10,3,58,51,126,88,68,68),
+(10,3,59,52,128,90,69,70),
+(10,3,60,53,130,91,70,71),
+(10,3,61,54,132,93,71,72),
+(10,3,62,54,134,94,72,73),
+(10,3,63,55,137,96,73,74),
+(10,3,64,56,139,97,75,75),
+(10,3,65,57,141,99,76,76),
+(10,3,66,58,144,101,77,77),
+(10,3,67,58,146,102,78,78),
+(10,3,68,59,148,104,79,80),
+(10,3,69,60,151,105,80,81),
+(10,3,70,61,153,107,81,82),
+(10,3,71,62,156,108,82,83),
+(10,3,72,63,159,110,83,84),
+(10,3,73,64,162,112,84,86),
+(10,3,74,65,165,114,86,87),
+(10,3,75,66,168,116,87,89),
+(10,3,76,67,171,118,89,90),
+(10,3,77,68,174,120,90,92),
+(10,3,78,69,177,122,91,93),
+(10,3,79,70,180,124,92,95),
+(10,3,80,71,183,126,94,96),
+(10,4,1,18,25,20,24,19),
+(10,4,2,19,26,21,24,19),
+(10,4,3,20,28,21,24,20),
+(10,4,4,20,29,22,24,20),
+(10,4,5,21,31,23,25,20),
+(10,4,6,22,32,24,25,21),
+(10,4,7,23,34,24,25,21),
+(10,4,8,24,35,25,25,22),
+(10,4,9,24,37,26,25,22),
+(10,4,10,25,38,26,25,22),
+(10,4,11,26,40,27,25,23),
+(10,4,12,27,41,28,26,23),
+(10,4,13,28,43,29,26,24),
+(10,4,14,29,45,30,26,24),
+(10,4,15,29,46,30,26,25),
+(10,4,16,30,48,31,26,25),
+(10,4,17,31,50,32,27,25),
+(10,4,18,32,51,33,27,26),
+(10,4,19,33,53,34,27,26),
+(10,4,20,34,55,35,27,27),
+(10,4,21,35,56,35,27,27),
+(10,4,22,36,58,36,28,28),
+(10,4,23,37,60,37,28,28),
+(10,4,24,38,62,38,28,29),
+(10,4,25,39,63,39,28,29),
+(10,4,26,40,65,40,29,30),
+(10,4,27,41,67,41,29,30),
+(10,4,28,42,69,42,29,31),
+(10,4,29,43,71,43,29,31),
+(10,4,30,44,72,43,29,32),
+(10,4,31,45,74,44,30,32),
+(10,4,32,46,76,45,30,33),
+(10,4,33,47,78,46,30,33),
+(10,4,34,48,80,47,31,34),
+(10,4,35,49,82,48,31,34),
+(10,4,36,50,84,49,31,35),
+(10,4,37,51,86,50,31,35),
+(10,4,38,52,88,51,32,36),
+(10,4,39,53,90,52,32,37),
+(10,4,40,54,92,53,32,37),
+(10,4,41,56,94,54,33,38),
+(10,4,42,57,96,55,33,38),
+(10,4,43,58,98,56,33,39),
+(10,4,44,59,100,57,33,39),
+(10,4,45,60,102,59,34,40),
+(10,4,46,61,104,60,34,41),
+(10,4,47,62,107,61,34,41),
+(10,4,48,64,109,62,35,42),
+(10,4,49,65,111,63,35,43),
+(10,4,50,66,113,64,35,43),
+(10,4,51,67,115,65,36,44),
+(10,4,52,68,117,66,36,44),
+(10,4,53,70,120,67,36,45),
+(10,4,54,71,122,69,37,46),
+(10,4,55,72,124,70,37,46),
+(10,4,56,73,126,71,37,47),
+(10,4,57,75,129,72,38,48),
+(10,4,58,76,131,73,38,48),
+(10,4,59,77,133,74,39,49),
+(10,4,60,79,136,76,39,50),
+(10,4,61,80,138,77,39,51),
+(10,4,62,81,140,78,40,51),
+(10,4,63,82,143,79,40,52),
+(10,4,64,84,145,80,41,53),
+(10,4,65,85,148,82,41,53),
+(10,4,66,87,150,83,41,54),
+(10,4,67,88,153,84,42,55),
+(10,4,68,89,155,85,42,56),
+(10,4,69,91,157,87,43,56),
+(10,4,70,92,160,88,43,57),
+(10,4,71,94,163,88,43,58),
+(10,4,72,96,166,90,44,58),
+(10,4,73,97,169,92,44,59),
+(10,4,74,99,172,93,45,60),
+(10,4,75,101,175,95,45,61),
+(10,4,76,102,178,96,45,62),
+(10,4,77,104,181,101,46,63),
+(10,4,78,106,185,104,46,64),
+(10,4,79,108,188,105,47,65),
+(10,4,80,110,191,107,47,66),
+(10,5,1,17,22,19,26,22),
+(10,5,2,17,22,19,27,23),
+(10,5,3,17,22,20,29,25),
+(10,5,4,17,23,20,30,26),
+(10,5,5,18,23,20,31,27),
+(10,5,6,18,23,21,33,29),
+(10,5,7,18,23,21,34,30),
+(10,5,8,18,24,22,35,32),
+(10,5,9,18,24,22,37,33),
+(10,5,10,19,24,22,38,35),
+(10,5,11,19,24,23,39,36),
+(10,5,12,19,24,23,41,38),
+(10,5,13,19,25,24,42,39),
+(10,5,14,19,25,24,44,41),
+(10,5,15,19,25,25,45,42),
+(10,5,16,20,26,25,47,44),
+(10,5,17,20,26,25,48,45),
+(10,5,18,20,26,26,50,47),
+(10,5,19,20,26,26,51,49),
+(10,5,20,21,27,27,53,50),
+(10,5,21,21,27,27,54,52),
+(10,5,22,21,27,28,56,53),
+(10,5,23,21,28,28,58,55),
+(10,5,24,21,28,29,59,57),
+(10,5,25,22,28,29,61,58),
+(10,5,26,22,28,30,62,60),
+(10,5,27,22,29,30,64,62),
+(10,5,28,22,29,31,66,64),
+(10,5,29,23,29,31,67,65),
+(10,5,30,23,30,32,69,67),
+(10,5,31,23,30,32,71,69),
+(10,5,32,23,30,33,72,71),
+(10,5,33,24,31,33,74,72),
+(10,5,34,24,31,34,76,74),
+(10,5,35,24,32,34,78,76),
+(10,5,36,24,32,35,80,78),
+(10,5,37,25,32,35,81,80),
+(10,5,38,25,33,36,83,82),
+(10,5,39,25,33,37,85,84),
+(10,5,40,26,33,37,87,86),
+(10,5,41,26,34,38,89,88),
+(10,5,42,26,34,38,91,89),
+(10,5,43,27,35,39,92,91),
+(10,5,44,27,35,39,94,93),
+(10,5,45,27,35,40,96,95),
+(10,5,46,27,36,41,98,97),
+(10,5,47,28,36,41,100,99),
+(10,5,48,28,37,42,102,101),
+(10,5,49,28,37,43,104,103),
+(10,5,50,29,37,43,106,106),
+(10,5,51,29,38,44,108,108),
+(10,5,52,29,38,44,110,110),
+(10,5,53,30,39,45,112,112),
+(10,5,54,30,39,46,114,114),
+(10,5,55,30,40,46,116,116),
+(10,5,56,31,40,47,118,118),
+(10,5,57,31,41,48,120,120),
+(10,5,58,31,41,48,123,123),
+(10,5,59,32,42,49,125,125),
+(10,5,60,32,42,50,127,127),
+(10,5,61,33,42,51,129,129),
+(10,5,62,33,43,51,131,131),
+(10,5,63,33,43,52,133,134),
+(10,5,64,34,44,53,135,136),
+(10,5,65,34,44,53,138,138),
+(10,5,66,34,45,54,140,141),
+(10,5,67,35,45,55,142,143),
+(10,5,68,35,46,56,144,145),
+(10,5,69,36,46,56,147,148),
+(10,5,70,36,47,57,149,150),
+(10,5,71,36,48,57,152,153),
+(10,5,72,37,48,57,155,156),
+(10,5,73,37,49,58,158,159),
+(10,5,74,38,49,59,160,163),
+(10,5,75,38,50,60,163,165),
+(10,5,76,38,51,61,166,170),
+(10,5,77,39,51,62,168,175),
+(10,5,78,39,52,63,172,174),
+(10,5,79,40,52,64,175,177),
+(10,5,80,40,53,65,178,180),
+(10,6,1,18,23,21,24,20),
+(10,6,2,19,24,22,24,20),
+(10,6,3,21,25,23,24,21),
+(10,6,4,22,25,25,24,21),
+(10,6,5,23,26,26,24,21),
+(10,6,6,25,27,27,24,21),
+(10,6,7,26,28,28,24,22),
+(10,6,8,27,29,29,25,22),
+(10,6,9,29,29,31,25,22),
+(10,6,10,30,30,32,25,23),
+(10,6,11,32,31,33,25,23),
+(10,6,12,33,32,34,25,23),
+(10,6,13,34,33,36,25,24),
+(10,6,14,36,34,37,25,24),
+(10,6,15,37,35,38,25,24),
+(10,6,16,39,36,40,25,25),
+(10,6,17,40,36,41,25,25),
+(10,6,18,42,37,43,26,25),
+(10,6,19,43,38,44,26,26),
+(10,6,20,45,39,45,26,26),
+(10,6,21,47,40,47,26,26),
+(10,6,22,48,41,48,26,27),
+(10,6,23,50,42,50,26,27),
+(10,6,24,51,43,51,26,28),
+(10,6,25,53,44,52,27,28),
+(10,6,26,55,45,54,27,28),
+(10,6,27,56,46,55,27,29),
+(10,6,28,58,47,57,27,29),
+(10,6,29,59,48,58,27,30),
+(10,6,30,61,49,60,27,30),
+(10,6,31,63,50,62,27,30),
+(10,6,32,65,51,63,28,31),
+(10,6,33,66,52,65,28,31),
+(10,6,34,68,53,66,28,32),
+(10,6,35,70,55,68,28,32),
+(10,6,36,72,56,69,28,33),
+(10,6,37,73,57,71,29,33),
+(10,6,38,75,58,73,29,34),
+(10,6,39,77,59,74,29,34),
+(10,6,40,79,60,76,29,35),
+(10,6,41,81,61,78,29,35),
+(10,6,42,82,62,79,30,35),
+(10,6,43,84,64,81,30,36),
+(10,6,44,86,65,83,30,36),
+(10,6,45,88,66,85,30,37),
+(10,6,46,90,67,86,30,37),
+(10,6,47,92,68,88,31,38),
+(10,6,48,94,69,90,31,38),
+(10,6,49,96,69,92,31,39),
+(10,6,50,98,70,93,31,40),
+(10,6,51,100,71,95,32,40),
+(10,6,52,102,72,96,32,41),
+(10,6,53,103,73,97,32,41),
+(10,6,54,104,74,98,32,41),
+(10,6,55,105,75,97,33,41),
+(10,6,56,108,77,100,33,42),
+(10,6,57,113,78,102,33,42),
+(10,6,58,115,79,104,34,43),
+(10,6,59,117,81,106,34,43),
+(10,6,60,118,82,108,34,44),
+(10,6,61,119,83,110,34,45),
+(10,6,62,121,85,112,34,45),
+(10,6,63,124,86,115,35,46),
+(10,6,64,127,88,117,35,46),
+(10,6,65,133,89,119,35,47),
+(10,6,66,135,91,122,35,48),
+(10,6,67,139,92,124,36,48),
+(10,6,68,141,94,126,36,49),
+(10,6,69,142,95,129,36,50),
+(10,6,70,145,97,131,36,50),
+(10,6,71,150,99,134,37,51),
+(10,6,72,152,100,136,37,52),
+(10,6,73,155,102,139,37,53),
+(10,6,74,158,104,141,37,53),
+(10,6,75,159,105,144,38,54),
+(10,6,76,160,107,147,38,55),
+(10,6,77,163,109,149,38,56),
+(10,6,78,166,110,152,38,56),
+(10,6,79,169,112,155,39,57),
+(10,6,80,172,114,158,39,58),
+(10,8,1,17,22,19,27,21),
+(10,8,2,17,22,19,28,22),
+(10,8,3,17,22,20,30,24),
+(10,8,4,17,22,20,31,25),
+(10,8,5,17,23,20,32,26),
+(10,8,6,17,23,20,34,28),
+(10,8,7,18,23,21,35,29),
+(10,8,8,18,23,21,37,30),
+(10,8,9,18,23,21,38,32),
+(10,8,10,18,23,22,40,33),
+(10,8,11,18,24,22,41,35),
+(10,8,12,18,24,22,42,36),
+(10,8,13,18,24,23,44,37),
+(10,8,14,18,24,23,45,39),
+(10,8,15,18,24,23,47,40),
+(10,8,16,19,24,24,49,42),
+(10,8,17,19,25,24,50,43),
+(10,8,18,19,25,24,52,45),
+(10,8,19,19,25,25,53,46),
+(10,8,20,19,25,25,55,48),
+(10,8,21,19,25,26,57,50),
+(10,8,22,19,26,26,58,51),
+(10,8,23,20,26,26,60,53),
+(10,8,24,20,26,27,61,54),
+(10,8,25,20,26,27,63,56),
+(10,8,26,20,27,27,65,58),
+(10,8,27,20,27,28,67,59),
+(10,8,28,20,27,28,68,61),
+(10,8,29,21,27,29,70,63),
+(10,8,30,21,28,29,72,64),
+(10,8,31,21,28,30,74,66),
+(10,8,32,21,28,30,75,68),
+(10,8,33,21,28,30,77,70),
+(10,8,34,21,29,31,79,71),
+(10,8,35,22,29,31,81,73),
+(10,8,36,22,29,32,83,75),
+(10,8,37,22,29,32,85,77),
+(10,8,38,22,30,33,86,78),
+(10,8,39,22,30,33,88,80),
+(10,8,40,23,30,34,90,82),
+(10,8,41,23,31,34,92,84),
+(10,8,42,23,31,35,94,86),
+(10,8,43,23,31,35,96,88),
+(10,8,44,23,32,36,98,90),
+(10,8,45,24,32,36,100,92),
+(10,8,46,24,32,37,102,93),
+(10,8,47,24,32,37,104,95),
+(10,8,48,24,33,38,106,97),
+(10,8,49,25,33,38,108,99),
+(10,8,50,25,33,39,110,101),
+(10,8,51,25,34,39,112,103),
+(10,8,52,25,34,40,114,105),
+(10,8,53,25,35,40,117,107),
+(10,8,54,26,35,41,119,109),
+(10,8,55,26,35,41,121,111),
+(10,8,56,26,36,42,123,113),
+(10,8,57,26,36,42,125,116),
+(10,8,58,27,36,43,127,118),
+(10,8,59,27,37,43,130,120),
+(10,8,60,27,37,44,132,122),
+(10,8,61,27,37,45,134,124),
+(10,8,62,28,38,45,136,126),
+(10,8,63,28,38,46,139,128),
+(10,8,64,28,39,46,141,131),
+(10,8,65,29,39,47,143,133),
+(10,8,66,29,39,48,146,135),
+(10,8,67,29,40,48,148,137),
+(10,8,68,29,40,49,150,139),
+(10,8,69,30,41,49,153,142),
+(10,8,70,30,41,50,155,144),
+(10,8,71,30,41,50,158,147),
+(10,8,72,30,42,51,161,150),
+(10,8,73,30,42,52,164,153),
+(10,8,74,31,43,52,167,155),
+(10,8,75,31,43,53,170,158),
+(10,8,76,31,43,54,173,161),
+(10,8,77,32,44,55,176,164),
+(10,8,78,32,44,55,179,167),
+(10,8,79,32,45,56,182,170),
+(10,8,80,33,45,57,185,173),
+(10,9,1,17,22,20,26,21),
+(10,9,2,17,22,21,27,22),
+(10,9,3,18,23,21,28,23),
+(10,9,4,18,23,22,29,24),
+(10,9,5,18,23,22,31,26),
+(10,9,6,18,24,23,32,27),
+(10,9,7,19,24,23,33,28),
+(10,9,8,19,25,24,34,29),
+(10,9,9,19,25,25,36,30),
+(10,9,10,20,25,25,37,32),
+(10,9,11,20,26,26,38,33),
+(10,9,12,20,26,26,39,34),
+(10,9,13,21,27,27,41,36),
+(10,9,14,21,27,28,42,37),
+(10,9,15,21,27,28,43,38),
+(10,9,16,22,28,29,45,39),
+(10,9,17,22,28,30,46,41),
+(10,9,18,23,29,30,47,42),
+(10,9,19,23,29,31,49,43),
+(10,9,20,23,30,32,50,45),
+(10,9,21,24,30,32,51,46),
+(10,9,22,24,31,33,53,48),
+(10,9,23,24,31,34,54,49),
+(10,9,24,25,31,34,56,50),
+(10,9,25,25,32,35,57,52),
+(10,9,26,26,32,36,59,53),
+(10,9,27,26,33,37,60,55),
+(10,9,28,26,33,37,62,56),
+(10,9,29,27,34,38,63,58),
+(10,9,30,27,34,39,65,59),
+(10,9,31,28,35,40,66,61),
+(10,9,32,28,36,40,68,62),
+(10,9,33,29,36,41,69,64),
+(10,9,34,29,37,42,71,65),
+(10,9,35,29,37,43,73,67),
+(10,9,36,30,38,43,74,69),
+(10,9,37,30,38,44,76,70),
+(10,9,38,31,39,45,77,72),
+(10,9,39,31,39,46,79,73),
+(10,9,40,32,40,47,81,75),
+(10,9,41,32,41,48,82,77),
+(10,9,42,33,41,48,84,78),
+(10,9,43,33,42,49,86,80),
+(10,9,44,34,42,50,88,82),
+(10,9,45,34,43,51,89,83),
+(10,9,46,35,44,52,91,85),
+(10,9,47,35,44,53,93,87),
+(10,9,48,36,45,54,95,89),
+(10,9,49,36,45,54,96,90),
+(10,9,50,37,46,55,98,92),
+(10,9,51,37,47,56,100,94),
+(10,9,52,38,47,57,102,96),
+(10,9,53,38,48,58,104,97),
+(10,9,54,39,49,59,105,99),
+(10,9,55,39,49,60,107,101),
+(10,9,56,40,50,61,109,103),
+(10,9,57,40,51,62,111,105),
+(10,9,58,41,51,63,113,107),
+(10,9,59,42,52,64,115,108),
+(10,9,60,42,53,65,117,110),
+(10,9,61,43,53,66,119,112),
+(10,9,62,43,54,67,121,114),
+(10,9,63,44,55,68,123,116),
+(10,9,64,44,56,69,125,118),
+(10,9,65,45,56,70,127,120),
+(10,9,66,46,57,71,129,122),
+(10,9,67,46,58,72,131,124),
+(10,9,68,47,58,73,133,126),
+(10,9,69,47,59,74,135,128),
+(10,9,70,48,60,75,137,130),
+(10,9,71,49,61,83,139,141),
+(10,9,72,50,61,84,142,143),
+(10,9,73,51,62,84,144,146),
+(10,9,74,51,63,86,147,149),
+(10,9,75,52,64,89,149,151),
+(10,9,76,53,65,90,155,154),
+(10,9,77,54,66,91,155,157),
+(10,9,78,54,67,93,157,160),
+(10,9,79,55,68,94,160,163),
+(10,9,80,56,69,95,163,165),
+(11,1,1,24,17,21,21,22),
+(11,1,2,25,18,22,21,22),
+(11,1,3,27,19,23,21,23),
+(11,1,4,28,19,25,21,23),
+(11,1,5,29,20,26,21,23),
+(11,1,6,31,21,27,21,23),
+(11,1,7,32,22,28,21,24),
+(11,1,8,33,23,29,22,24),
+(11,1,9,35,24,31,22,24),
+(11,1,10,36,24,32,22,25),
+(11,1,11,37,25,33,22,25),
+(11,1,12,39,26,34,22,25),
+(11,1,13,40,27,36,22,26),
+(11,1,14,42,28,37,22,26),
+(11,1,15,43,29,38,22,26),
+(11,1,16,45,30,40,22,27),
+(11,1,17,46,31,41,23,27),
+(11,1,18,48,32,43,23,27),
+(11,1,19,49,33,44,23,28),
+(11,1,20,51,34,45,23,28),
+(11,1,21,52,34,47,23,28),
+(11,1,22,54,35,48,23,29),
+(11,1,23,55,36,50,23,29),
+(11,1,24,57,37,51,24,30),
+(11,1,25,59,38,52,24,30),
+(11,1,26,60,39,54,24,30),
+(11,1,27,62,40,55,24,31),
+(11,1,28,63,41,57,24,31),
+(11,1,29,65,43,58,24,32),
+(11,1,30,67,44,60,24,32),
+(11,1,31,69,45,62,25,32),
+(11,1,32,70,46,63,25,33),
+(11,1,33,72,47,65,25,33),
+(11,1,34,74,48,66,25,34),
+(11,1,35,75,49,68,25,34),
+(11,1,36,77,50,69,26,35),
+(11,1,37,79,51,71,26,35),
+(11,1,38,81,52,73,26,35),
+(11,1,39,83,53,74,26,36),
+(11,1,40,84,55,76,26,36),
+(11,1,41,86,56,78,27,37),
+(11,1,42,88,57,79,27,37),
+(11,1,43,90,58,81,27,38),
+(11,1,44,92,59,83,27,38),
+(11,1,45,94,60,85,27,39),
+(11,1,46,96,62,86,28,39),
+(11,1,47,98,63,88,28,40),
+(11,1,48,100,64,90,28,40),
+(11,1,49,102,65,92,28,41),
+(11,1,50,103,66,93,29,41),
+(11,1,51,105,68,95,29,42),
+(11,1,52,107,69,97,29,42),
+(11,1,53,109,70,99,29,43),
+(11,1,54,112,71,101,30,44),
+(11,1,55,114,73,103,30,44),
+(11,1,56,116,74,104,30,45),
+(11,1,57,118,75,106,30,45),
+(11,1,58,120,77,108,31,46),
+(11,1,59,122,78,110,31,46),
+(11,1,60,124,79,112,31,47),
+(11,1,61,126,81,114,31,48),
+(11,1,62,128,82,116,32,48),
+(11,1,63,130,83,118,32,49),
+(11,1,64,133,85,120,32,49),
+(11,1,65,135,86,122,33,50),
+(11,1,66,137,87,124,33,51),
+(11,1,67,139,89,126,33,51),
+(11,1,68,141,90,128,33,52),
+(11,1,69,144,92,130,34,52),
+(11,1,70,146,93,132,34,53),
+(11,1,71,149,94,134,34,54),
+(11,1,72,151,96,137,34,55),
+(11,1,73,154,98,139,34,56),
+(11,1,74,157,99,142,35,56),
+(11,1,75,166,101,149,35,57),
+(11,1,76,172,103,155,35,58),
+(11,1,77,175,105,159,36,59),
+(11,1,78,179,106,161,36,59),
+(11,1,79,182,108,164,36,60),
+(11,1,80,185,110,167,37,61),
+(11,2,1,23,17,21,21,23),
+(11,2,2,24,18,22,22,24),
+(11,2,3,25,18,23,22,24),
+(11,2,4,26,19,24,23,25),
+(11,2,5,27,19,25,24,26),
+(11,2,6,29,20,26,24,26),
+(11,2,7,30,21,27,25,27),
+(11,2,8,31,21,28,26,28),
+(11,2,9,32,22,29,26,29),
+(11,2,10,33,22,31,27,29),
+(11,2,11,34,23,32,28,30),
+(11,2,12,36,24,33,28,31),
+(11,2,13,37,24,34,29,32),
+(11,2,14,38,25,35,30,32),
+(11,2,15,39,26,36,31,33),
+(11,2,16,40,26,37,31,34),
+(11,2,17,42,27,39,32,35),
+(11,2,18,43,28,40,33,36),
+(11,2,19,44,28,41,34,37),
+(11,2,20,46,29,42,34,37),
+(11,2,21,47,30,44,35,38),
+(11,2,22,48,31,45,36,39),
+(11,2,23,50,31,46,37,40),
+(11,2,24,51,32,47,38,41),
+(11,2,25,52,33,49,38,42),
+(11,2,26,54,34,50,39,43),
+(11,2,27,55,34,51,40,44),
+(11,2,28,56,35,53,41,44),
+(11,2,29,58,36,54,42,45),
+(11,2,30,59,37,55,43,46),
+(11,2,31,61,37,57,43,47),
+(11,2,32,62,38,58,44,48),
+(11,2,33,64,39,59,45,49),
+(11,2,34,65,40,61,46,50),
+(11,2,35,67,41,62,47,51),
+(11,2,36,68,42,64,48,52),
+(11,2,37,70,42,65,49,53),
+(11,2,38,71,43,67,50,54),
+(11,2,39,73,44,68,51,55),
+(11,2,40,74,45,69,52,56),
+(11,2,41,76,46,71,53,57),
+(11,2,42,78,47,72,54,58),
+(11,2,43,79,47,74,55,59),
+(11,2,44,81,48,75,56,60),
+(11,2,45,82,49,77,57,61),
+(11,2,46,84,50,78,58,62),
+(11,2,47,86,51,80,59,64),
+(11,2,48,87,52,82,60,65),
+(11,2,49,89,53,83,61,66),
+(11,2,50,91,54,85,62,67),
+(11,2,51,92,55,86,63,68),
+(11,2,52,94,56,88,64,69),
+(11,2,53,96,57,90,65,70),
+(11,2,54,97,58,91,66,71),
+(11,2,55,99,59,93,67,73),
+(11,2,56,101,60,95,68,74),
+(11,2,57,103,61,96,69,75),
+(11,2,58,105,62,98,70,76),
+(11,2,59,106,63,100,71,77),
+(11,2,60,108,64,101,72,78),
+(11,2,61,110,65,103,74,80),
+(11,2,62,112,66,105,75,81),
+(11,2,63,114,67,106,76,82),
+(11,2,64,116,68,108,77,83),
+(11,2,65,117,69,110,78,85),
+(11,2,66,119,70,112,79,86),
+(11,2,67,121,71,114,80,87),
+(11,2,68,123,72,115,82,88),
+(11,2,69,125,73,117,83,90),
+(11,2,70,127,74,119,84,91),
+(11,2,71,130,75,121,87,92),
+(11,2,72,132,76,124,90,94),
+(11,2,73,134,77,126,93,96),
+(11,2,74,137,79,128,97,97),
+(11,2,75,139,80,130,101,99),
+(11,2,76,142,81,133,106,100),
+(11,2,77,144,83,135,108,102),
+(11,2,78,147,84,137,110,104),
+(11,2,79,149,85,140,111,105),
+(11,2,80,152,87,142,113,107),
+(11,3,1,21,20,20,21,23),
+(11,3,2,21,21,21,22,24),
+(11,3,3,22,23,22,22,24),
+(11,3,4,22,24,23,23,25),
+(11,3,5,23,25,24,23,25),
+(11,3,6,23,27,25,24,26),
+(11,3,7,24,28,26,24,27),
+(11,3,8,24,30,27,25,27),
+(11,3,9,25,31,27,26,28),
+(11,3,10,25,33,28,26,29),
+(11,3,11,25,34,29,27,29),
+(11,3,12,26,36,30,28,30),
+(11,3,13,26,37,31,28,31),
+(11,3,14,27,39,32,29,32),
+(11,3,15,27,40,34,30,32),
+(11,3,16,28,42,35,30,33),
+(11,3,17,28,43,36,31,34),
+(11,3,18,29,45,37,32,35),
+(11,3,19,29,47,38,32,35),
+(11,3,20,30,48,39,33,36),
+(11,3,21,31,50,40,34,37),
+(11,3,22,31,51,41,34,38),
+(11,3,23,32,53,42,35,38),
+(11,3,24,32,55,43,36,39),
+(11,3,25,33,57,44,37,40),
+(11,3,26,33,58,46,37,41),
+(11,3,27,34,60,47,38,42),
+(11,3,28,35,62,48,39,42),
+(11,3,29,35,63,49,40,43),
+(11,3,30,36,65,50,40,44),
+(11,3,31,36,67,52,41,45),
+(11,3,32,37,69,53,42,46),
+(11,3,33,38,71,54,43,47),
+(11,3,34,38,72,55,44,48),
+(11,3,35,39,74,57,44,48),
+(11,3,36,39,76,58,45,49),
+(11,3,37,40,78,59,46,50),
+(11,3,38,41,80,60,47,51),
+(11,3,39,41,82,62,48,52),
+(11,3,40,42,84,63,49,53),
+(11,3,41,43,86,64,50,54),
+(11,3,42,43,88,66,50,55),
+(11,3,43,44,90,67,51,56),
+(11,3,44,45,91,68,52,57),
+(11,3,45,45,93,70,53,58),
+(11,3,46,46,95,71,54,59),
+(11,3,47,47,98,72,55,60),
+(11,3,48,48,100,74,56,61),
+(11,3,49,48,102,75,57,62),
+(11,3,50,49,104,77,58,63),
+(11,3,51,50,106,78,59,64),
+(11,3,52,51,108,79,60,65),
+(11,3,53,51,110,81,61,66),
+(11,3,54,52,112,82,61,67),
+(11,3,55,53,114,84,62,68),
+(11,3,56,54,116,85,63,69),
+(11,3,57,54,118,87,64,70),
+(11,3,58,55,121,88,65,71),
+(11,3,59,56,123,90,66,72),
+(11,3,60,57,125,91,67,74),
+(11,3,61,58,127,93,68,75),
+(11,3,62,58,130,94,69,76),
+(11,3,63,59,132,96,71,77),
+(11,3,64,60,134,97,72,78),
+(11,3,65,61,136,99,73,79),
+(11,3,66,62,139,101,74,80),
+(11,3,67,62,141,102,75,81),
+(11,3,68,63,143,104,76,83),
+(11,3,69,64,146,105,77,84),
+(11,3,70,65,148,107,78,85),
+(11,3,71,66,151,109,79,86),
+(11,3,72,67,154,111,80,87),
+(11,3,73,68,157,113,81,89),
+(11,3,74,69,160,115,83,90),
+(11,3,75,70,163,117,84,92),
+(11,3,76,71,166,119,85,93),
+(11,3,77,72,169,121,87,95),
+(11,3,78,73,172,123,88,96),
+(11,3,79,74,175,125,89,98),
+(11,3,80,75,178,127,91,99),
+(11,5,1,21,17,19,23,25),
+(11,5,2,21,17,19,24,26),
+(11,5,3,21,17,20,26,28),
+(11,5,4,21,18,20,27,29),
+(11,5,5,22,18,20,28,30),
+(11,5,6,22,18,21,30,32),
+(11,5,7,22,18,21,31,33),
+(11,5,8,22,19,22,32,35),
+(11,5,9,22,19,22,34,36),
+(11,5,10,22,19,22,35,38),
+(11,5,11,23,19,23,37,39),
+(11,5,12,23,20,23,38,41),
+(11,5,13,23,20,24,39,42),
+(11,5,14,23,20,24,41,44),
+(11,5,15,23,20,25,42,45),
+(11,5,16,24,21,25,44,47),
+(11,5,17,24,21,25,45,48),
+(11,5,18,24,21,26,47,50),
+(11,5,19,24,22,26,48,51),
+(11,5,20,24,22,27,50,53),
+(11,5,21,25,22,27,51,55),
+(11,5,22,25,22,28,53,56),
+(11,5,23,25,23,28,55,58),
+(11,5,24,25,23,29,56,60),
+(11,5,25,25,23,29,58,61),
+(11,5,26,26,24,30,60,63),
+(11,5,27,26,24,30,61,65),
+(11,5,28,26,24,31,63,66),
+(11,5,29,26,25,31,65,68),
+(11,5,30,27,25,32,66,70),
+(11,5,31,27,25,32,68,72),
+(11,5,32,27,26,33,70,73),
+(11,5,33,27,26,33,71,75),
+(11,5,34,28,26,34,73,77),
+(11,5,35,28,27,34,75,79),
+(11,5,36,28,27,35,77,81),
+(11,5,37,29,28,35,79,83),
+(11,5,38,29,28,36,80,85),
+(11,5,39,29,28,37,82,86),
+(11,5,40,29,29,37,84,88),
+(11,5,41,30,29,38,86,90),
+(11,5,42,30,29,38,88,92),
+(11,5,43,30,30,39,90,94),
+(11,5,44,31,30,39,91,96),
+(11,5,45,31,31,40,93,98),
+(11,5,46,31,31,41,95,100),
+(11,5,47,32,31,41,97,102),
+(11,5,48,32,32,42,99,104),
+(11,5,49,32,32,43,101,106),
+(11,5,50,33,33,43,103,108),
+(11,5,51,33,33,44,105,110),
+(11,5,52,33,34,44,107,113),
+(11,5,53,34,34,45,109,115),
+(11,5,54,34,34,46,111,117),
+(11,5,55,34,35,46,113,119),
+(11,5,56,35,35,47,115,121),
+(11,5,57,35,36,48,118,123),
+(11,5,58,35,36,48,120,126),
+(11,5,59,36,37,49,122,128),
+(11,5,60,36,37,50,124,130),
+(11,5,61,36,38,51,126,132),
+(11,5,62,37,38,51,128,134),
+(11,5,63,37,39,52,130,137),
+(11,5,64,38,39,53,133,139),
+(11,5,65,38,40,53,135,141),
+(11,5,66,38,40,54,137,144),
+(11,5,67,39,40,55,139,146),
+(11,5,68,39,41,56,141,148),
+(11,5,69,40,41,56,144,151),
+(11,5,70,40,42,57,146,153),
+(11,5,71,40,43,58,149,156),
+(11,5,72,41,43,58,155,159),
+(11,5,73,41,44,59,157,160),
+(11,5,74,42,44,61,160,163),
+(11,5,75,42,45,62,164,166),
+(11,5,76,42,46,62,167,169),
+(11,5,77,43,46,63,168,172),
+(11,5,78,43,47,64,169,177),
+(11,5,79,44,47,65,172,180),
+(11,5,80,44,48,66,175,183),
+(11,6,1,24,17,21,21,22),
+(11,6,2,25,18,22,21,22),
+(11,6,3,27,19,23,21,23),
+(11,6,4,28,19,25,21,23),
+(11,6,5,29,20,26,21,23),
+(11,6,6,31,21,27,21,23),
+(11,6,7,32,22,28,21,24),
+(11,6,8,33,23,29,22,24),
+(11,6,9,35,24,31,22,24),
+(11,6,10,36,24,32,22,25),
+(11,6,11,37,25,33,22,25),
+(11,6,12,39,26,34,22,25),
+(11,6,13,40,27,36,22,26),
+(11,6,14,42,28,37,22,26),
+(11,6,15,43,29,38,22,26),
+(11,6,16,45,30,40,22,27),
+(11,6,17,46,31,41,23,27),
+(11,6,18,48,32,43,23,27),
+(11,6,19,49,33,44,23,28),
+(11,6,20,51,34,45,23,28),
+(11,6,21,52,34,47,23,28),
+(11,6,22,54,35,48,23,29),
+(11,6,23,55,36,50,23,29),
+(11,6,24,57,37,51,24,30),
+(11,6,25,59,38,52,24,30),
+(11,6,26,60,39,54,24,30),
+(11,6,27,62,40,55,24,31),
+(11,6,28,63,41,57,24,31),
+(11,6,29,65,43,58,24,32),
+(11,6,30,67,44,60,24,32),
+(11,6,31,69,45,62,25,32),
+(11,6,32,70,46,63,25,33),
+(11,6,33,72,47,65,25,33),
+(11,6,34,74,48,66,25,34),
+(11,6,35,75,49,68,25,34),
+(11,6,36,77,50,69,26,35),
+(11,6,37,79,51,71,26,35),
+(11,6,38,81,52,73,26,35),
+(11,6,39,83,53,74,26,36),
+(11,6,40,84,55,76,26,36),
+(11,6,41,86,56,78,27,37),
+(11,6,42,88,57,79,27,37),
+(11,6,43,90,58,81,27,38),
+(11,6,44,92,59,83,27,38),
+(11,6,45,94,60,85,27,39),
+(11,6,46,96,62,86,28,39),
+(11,6,47,98,63,88,28,40),
+(11,6,48,100,64,90,28,40),
+(11,6,49,102,65,92,28,41),
+(11,6,50,103,65,93,29,41),
+(11,6,51,105,66,94,29,42),
+(11,6,52,106,67,95,29,42),
+(11,6,53,107,68,96,29,43),
+(11,6,54,108,69,97,30,44),
+(11,6,55,109,70,98,30,44),
+(11,6,56,112,72,101,30,45),
+(11,6,57,114,73,103,30,45),
+(11,6,58,117,74,105,31,46),
+(11,6,59,119,76,107,31,46),
+(11,6,60,121,77,109,31,47),
+(11,6,61,123,78,111,31,48),
+(11,6,62,126,80,113,31,48),
+(11,6,63,128,81,116,32,49),
+(11,6,64,131,83,118,32,49),
+(11,6,65,136,84,120,32,50),
+(11,6,66,140,86,123,32,51),
+(11,6,67,141,87,125,33,51),
+(11,6,68,141,89,127,33,52),
+(11,6,69,144,90,130,33,53),
+(11,6,70,147,92,132,33,53),
+(11,6,71,150,94,135,34,54),
+(11,6,72,152,95,137,34,55),
+(11,6,73,155,97,140,34,56),
+(11,6,74,162,99,142,34,56),
+(11,6,75,165,100,145,35,57),
+(11,6,76,167,102,146,35,58),
+(11,6,77,169,104,150,35,59),
+(11,6,78,170,105,152,35,59),
+(11,6,79,173,107,156,36,60),
+(11,6,80,176,109,159,36,61),
+(11,7,1,22,17,20,22,24),
+(11,7,2,23,17,21,23,25),
+(11,7,3,24,18,22,24,26),
+(11,7,4,25,18,23,25,27),
+(11,7,5,25,19,24,26,28),
+(11,7,6,26,19,25,27,29),
+(11,7,7,27,20,26,28,30),
+(11,7,8,28,20,27,28,31),
+(11,7,9,29,21,28,29,32),
+(11,7,10,30,21,29,30,33),
+(11,7,11,31,22,30,31,35),
+(11,7,12,32,22,31,32,36),
+(11,7,13,33,23,32,33,37),
+(11,7,14,34,23,33,34,38),
+(11,7,15,34,24,35,35,39),
+(11,7,16,35,24,36,36,40),
+(11,7,17,36,25,37,38,42),
+(11,7,18,37,25,38,39,43),
+(11,7,19,38,26,39,40,44),
+(11,7,20,39,26,40,41,45),
+(11,7,21,40,27,41,42,46),
+(11,7,22,41,27,43,43,48),
+(11,7,23,43,28,44,44,49),
+(11,7,24,44,28,45,45,50),
+(11,7,25,45,29,46,46,51),
+(11,7,26,46,30,47,48,53),
+(11,7,27,47,30,49,49,54),
+(11,7,28,48,31,50,50,55),
+(11,7,29,49,31,51,51,57),
+(11,7,30,50,32,53,52,58),
+(11,7,31,51,33,54,53,59),
+(11,7,32,52,33,55,55,61),
+(11,7,33,53,34,56,56,62),
+(11,7,34,55,34,58,57,64),
+(11,7,35,56,35,59,58,65),
+(11,7,36,57,36,60,60,66),
+(11,7,37,58,36,62,61,68),
+(11,7,38,59,37,63,62,69),
+(11,7,39,61,38,65,63,71),
+(11,7,40,62,38,66,65,72),
+(11,7,41,63,39,67,66,74),
+(11,7,42,64,40,69,67,75),
+(11,7,43,65,40,70,69,77),
+(11,7,44,67,41,72,70,78),
+(11,7,45,68,42,73,71,80),
+(11,7,46,69,42,75,73,81),
+(11,7,47,71,43,76,74,83),
+(11,7,48,72,44,78,76,84),
+(11,7,49,73,45,79,77,86),
+(11,7,50,74,45,81,78,88),
+(11,7,51,76,46,82,80,89),
+(11,7,52,77,47,84,81,91),
+(11,7,53,78,47,85,83,92),
+(11,7,54,80,48,87,84,94),
+(11,7,55,81,49,88,86,96),
+(11,7,56,83,50,90,87,97),
+(11,7,57,84,50,91,89,99),
+(11,7,58,85,51,93,90,101),
+(11,7,59,87,52,95,92,102),
+(11,7,60,88,53,96,93,104),
+(11,7,61,90,54,98,95,106),
+(11,7,62,91,54,99,96,108),
+(11,7,63,93,55,101,98,109),
+(11,7,64,94,56,103,99,111),
+(11,7,65,95,57,104,101,113),
+(11,7,66,97,58,106,103,115),
+(11,7,67,98,58,108,104,117),
+(11,7,68,100,59,110,106,118),
+(11,7,69,101,60,111,107,120),
+(11,7,70,103,61,113,109,122),
+(11,7,71,104,62,115,122,124),
+(11,7,72,106,63,117,124,127),
+(11,7,73,108,64,119,126,129),
+(11,7,74,110,65,122,128,131),
+(11,7,75,112,66,124,130,133),
+(11,7,76,114,67,126,133,136),
+(11,7,77,115,68,128,135,138),
+(11,7,78,117,69,130,137,140),
+(11,7,79,119,70,133,139,143),
+(11,7,80,121,71,135,141,145),
+(11,8,1,21,17,19,24,24),
+(11,8,2,21,17,19,25,25),
+(11,8,3,21,17,20,27,27),
+(11,8,4,21,17,20,28,28),
+(11,8,5,21,18,20,29,29),
+(11,8,6,21,18,20,31,31),
+(11,8,7,21,18,21,32,32),
+(11,8,8,22,18,21,34,33),
+(11,8,9,22,18,21,35,35),
+(11,8,10,22,19,22,37,36),
+(11,8,11,22,19,22,38,37),
+(11,8,12,22,19,22,40,39),
+(11,8,13,22,19,23,41,40),
+(11,8,14,22,19,23,43,42),
+(11,8,15,22,19,23,44,43),
+(11,8,16,22,20,24,46,45),
+(11,8,17,23,20,24,47,46),
+(11,8,18,23,20,24,49,48),
+(11,8,19,23,20,25,50,49),
+(11,8,20,23,21,25,52,51),
+(11,8,21,23,21,26,54,52),
+(11,8,22,23,21,26,55,54),
+(11,8,23,23,21,26,57,56),
+(11,8,24,24,21,27,59,57),
+(11,8,25,24,22,27,60,59),
+(11,8,26,24,22,27,62,60),
+(11,8,27,24,22,28,64,62),
+(11,8,28,24,22,28,65,64),
+(11,8,29,24,23,29,67,65),
+(11,8,30,24,23,29,69,67),
+(11,8,31,25,23,30,71,69),
+(11,8,32,25,23,30,73,71),
+(11,8,33,25,24,30,74,72),
+(11,8,34,25,24,31,76,74),
+(11,8,35,25,24,31,78,76),
+(11,8,36,26,24,32,80,78),
+(11,8,37,26,25,32,82,79),
+(11,8,38,26,25,33,84,81),
+(11,8,39,26,25,33,86,83),
+(11,8,40,26,26,34,87,85),
+(11,8,41,27,26,34,89,87),
+(11,8,42,27,26,35,91,89),
+(11,8,43,27,27,35,93,91),
+(11,8,44,27,27,36,95,92),
+(11,8,45,27,27,36,97,94),
+(11,8,46,28,27,37,99,96),
+(11,8,47,28,28,37,101,98),
+(11,8,48,28,28,38,103,100),
+(11,8,49,28,28,38,105,102),
+(11,8,50,29,29,39,107,104),
+(11,8,51,29,29,39,110,106),
+(11,8,52,29,29,40,112,108),
+(11,8,53,29,30,40,114,110),
+(11,8,54,30,30,41,116,112),
+(11,8,55,30,30,41,118,114),
+(11,8,56,30,31,42,120,116),
+(11,8,57,30,31,42,122,118),
+(11,8,58,31,31,43,125,121),
+(11,8,59,31,32,43,127,123),
+(11,8,60,31,32,44,129,125),
+(11,8,61,31,33,45,131,127),
+(11,8,62,32,33,45,133,129),
+(11,8,63,32,33,46,136,131),
+(11,8,64,32,34,46,138,134),
+(11,8,65,33,34,47,140,136),
+(11,8,66,33,34,48,143,138),
+(11,8,67,33,35,48,145,140),
+(11,8,68,33,35,49,147,142),
+(11,8,69,34,36,49,150,145),
+(11,8,70,34,36,50,152,147),
+(11,8,71,34,36,51,155,150),
+(11,8,72,34,37,52,161,153),
+(11,8,73,34,37,53,161,156),
+(11,8,74,35,38,53,164,158),
+(11,8,75,35,38,54,167,161),
+(11,8,76,35,38,55,170,164),
+(11,8,77,36,39,56,173,167),
+(11,8,78,36,39,56,176,170),
+(11,8,79,36,40,57,179,173),
+(11,8,80,37,40,58,182,176);
/*!40000 ALTER TABLE `player_levelstats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2438,6 +9543,69 @@ CREATE TABLE `playercreateinfo` (
LOCK TABLES `playercreateinfo` WRITE;
/*!40000 ALTER TABLE `playercreateinfo` DISABLE KEYS */;
+INSERT INTO `playercreateinfo` VALUES
+(1,1,0,12,-8949,-132,84),
+(1,2,0,12,-8949,-132,84),
+(1,4,0,12,-8949,-132,84),
+(1,5,0,12,-8949,-132,84),
+(1,6,609,4298,2355.84,-5664.77,426.028),
+(1,8,0,12,-8949,-132,84),
+(1,9,0,12,-8949,-132,84),
+(2,1,1,14,-618,-4251,39),
+(2,3,1,14,-618,-4251,39),
+(2,4,1,14,-618,-4251,39),
+(2,6,609,4298,2358.44,-5666.9,426.023),
+(2,7,1,14,-618,-4251,39),
+(2,9,1,14,-618,-4251,39),
+(3,1,0,1,-6240,331,383),
+(3,2,0,1,-6240,331,383),
+(3,3,0,1,-6240,331,383),
+(3,4,0,1,-6240,331,383),
+(3,5,0,1,-6240,331,383),
+(3,6,609,4298,2358.44,-5666.9,426.023),
+(4,1,1,141,10311,832,1327),
+(4,3,1,141,10311,832,1327),
+(4,4,1,141,10311,832,1327),
+(4,5,1,141,10311,832,1327),
+(4,6,609,4298,2356.21,-5662.21,426.026),
+(4,11,1,141,10311,832,1327),
+(5,1,0,85,1676,1677,122),
+(5,4,0,85,1676,1677,122),
+(5,5,0,85,1676,1677,122),
+(5,8,0,85,1676,1677,122),
+(5,9,0,85,1676,1677,122),
+(5,6,609,4298,2356.21,-5662.21,426.026),
+(6,1,1,215,-2917,-257,53),
+(6,3,1,215,-2917,-257,53),
+(6,6,609,4298,2358.17,-5663.21,426.027),
+(6,7,1,215,-2917,-257,53),
+(6,11,1,215,-2917,-257,53),
+(7,1,0,1,-6240,331,383),
+(7,4,0,1,-6340,331,383),
+(7,6,609,4298,2355.05,-5661.7, 426.026),
+(7,8,0,1,-6340,331,383),
+(7,9,0,1,-6340,331,383),
+(8,1,1,14,-618,-4251,39),
+(8,3,1,14,-618,-4251,39),
+(8,4,1,14,-618,-4251,39),
+(8,5,1,14,-618,-4251,39),
+(8,6,609,4298,2355.05,-5661.7, 426.026),
+(8,7,1,14,-618,-4251,39),
+(8,8,1,14,-618,-4251,39),
+(10,2,530,3431,10349.6,-6357.29,33.4026),
+(10,3,530,3431,10349.6,-6357.29,33.4026),
+(10,4,530,3431,10349.6,-6357.29,33.4026),
+(10,5,530,3431,10349.6,-6357.29,33.4026),
+(10,6,609,4298,2355.84,-5664.77,426.028),
+(10,8,530,3431,10349.6,-6357.29,33.4026),
+(10,9,530,3431,10349.6,-6357.29,33.4026),
+(11,1,530,3526,-3961.64,-13931.2,100.615),
+(11,2,530,3526,-3961.64,-13931.2,100.615),
+(11,3,530,3526,-3961.64,-13931.2,100.615),
+(11,5,530,3526,-3961.64,-13931.2,100.615),
+(11,6,609,4298,2358.17,-5663.21,426.027),
+(11,7,530,3526,-3961.64,-13931.2,100.615),
+(11,8,530,3526,-3961.64,-13931.2,100.615);
/*!40000 ALTER TABLE `playercreateinfo` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2462,6 +9630,360 @@ CREATE TABLE `playercreateinfo_action` (
LOCK TABLES `playercreateinfo_action` WRITE;
/*!40000 ALTER TABLE `playercreateinfo_action` DISABLE KEYS */;
+INSERT INTO `playercreateinfo_action` VALUES
+(1,1,1,78,0,0),
+(1,1,0,6603,0,0),
+(1,1,11,117,128,0),
+(1,2,2,635,0,0),
+(1,2,0,6603,0,0),
+(1,2,1,21084,0,0),
+(1,2,10,159,128,0),
+(1,2,11,2070,128,0),
+(1,4,1,1752,0,0),
+(1,4,2,2098,0,0),
+(1,4,3,2764,0,0),
+(1,4,0,6603,0,0),
+(1,4,11,2070,128,0),
+(1,5,1,585,0,0),
+(1,5,2,2050,0,0),
+(1,5,0,6603,0,0),
+(1,5,10,159,128,0),
+(1,5,11,2070,128,0),
+(1,6,0,6603,0,0),
+(1,6,1,49576,0,0),
+(1,6,2,45477,0,0),
+(1,6,3,45462,0,0),
+(1,6,4,45902,0,0),
+(1,6,5,47541,0,0),
+(1,6,11,59752,0,0),
+(1,8,1,133,0,0),
+(1,8,2,168,0,0),
+(1,8,0,6603,0,0),
+(1,8,10,159,128,0),
+(1,8,11,2070,128,0),
+(1,9,1,686,0,0),
+(1,9,2,687,0,0),
+(1,9,0,6603,0,0),
+(1,9,10,159,128,0),
+(1,9,11,4604,128,0),
+(2,1,1,78,0,0),
+(2,1,0,6603,0,0),
+(2,1,11,117,128,0),
+(2,3,2,75,0,0),
+(2,3,1,2973,0,0),
+(2,3,0,6603,0,0),
+(2,3,11,117,128,0),
+(2,3,10,159,128,0),
+(2,4,10,0,128,0),
+(2,4,1,1752,0,0),
+(2,4,2,2098,0,0),
+(2,4,0,6603,0,0),
+(2,4,11,117,128,0),
+(2,6,0,6603,0,0),
+(2,6,1,49576,0,0),
+(2,6,2,45477,0,0),
+(2,6,3,45462,0,0),
+(2,6,4,45902,0,0),
+(2,6,5,47541,0,0),
+(2,6,10,20572,0,0),
+(2,7,2,331,0,0),
+(2,7,1,403,0,0),
+(2,7,0,6603,0,0),
+(2,7,11,117,128,0),
+(2,7,10,159,128,0),
+(2,9,1,686,0,0),
+(2,9,2,687,0,0),
+(2,9,0,6603,0,0),
+(2,9,11,117,128,0),
+(2,9,10,159,128,0),
+(3,1,1,78,0,0),
+(3,1,0,6603,0,0),
+(3,1,11,117,128,0),
+(3,2,2,635,0,0),
+(3,2,0,6603,0,0),
+(3,2,1,21084,0,0),
+(3,2,10,159,128,0),
+(3,2,11,4540,128,0),
+(3,3,2,75,0,0),
+(3,3,1,2973,0,0),
+(3,3,0,6603,0,0),
+(3,3,11,117,128,0),
+(3,3,10,159,128,0),
+(3,4,1,1752,0,0),
+(3,4,2,2098,0,0),
+(3,4,3,2764,0,0),
+(3,4,0,6603,0,0),
+(3,4,11,4540,128,0),
+(3,5,1,585,0,0),
+(3,5,2,2050,0,0),
+(3,5,0,6603,0,0),
+(3,5,10,159,128,0),
+(3,5,11,4540,128,0),
+(3,6,0,6603,0,0),
+(3,6,1,49576,0,0),
+(3,6,2,45477,0,0),
+(3,6,3,45462,0,0),
+(3,6,4,45902,0,0),
+(3,6,5,47541,0,0),
+(3,6,10,2481,0,0),
+(4,1,1,78,0,0),
+(4,1,0,6603,0,0),
+(4,1,11,117,128,0),
+(4,3,2,75,0,0),
+(4,3,1,2973,0,0),
+(4,3,0,6603,0,0),
+(4,3,11,117,128,0),
+(4,3,10,159,128,0),
+(4,4,1,1752,0,0),
+(4,4,2,2098,0,0),
+(4,4,3,2764,0,0),
+(4,4,0,6603,0,0),
+(4,4,11,4540,128,0),
+(4,5,1,585,0,0),
+(4,5,2,2050,0,0),
+(4,5,0,6603,0,0),
+(4,5,10,159,128,0),
+(4,5,11,2070,128,0),
+(4,6,0,6603,0,0),
+(4,6,1,49576,0,0),
+(4,6,2,45477,0,0),
+(4,6,3,45462,0,0),
+(4,6,4,45902,0,0),
+(4,6,5,47541,0,0),
+(4,6,10,58984,0,0),
+(4,6,83,58984,0,0),
+(4,11,1,5176,0,0),
+(4,11,2,5185,0,0),
+(4,11,0,6603,0,0),
+(4,11,10,159,128,0),
+(4,11,11,4536,128,0),
+(5,1,11,4604,128,0),
+(5,1,0,6603,0,0),
+(5,1,1,78,0,0),
+(5,4,11,4604,128,0),
+(5,4,3,2764,0,0),
+(5,4,2,2098,0,0),
+(5,4,1,1752,0,0),
+(5,4,0,6603,0,0),
+(5,5,10,159,128,0),
+(5,5,2,2050,0,0),
+(5,5,1,585,0,0),
+(5,5,11,4604,128,0),
+(5,5,0,6603,0,0),
+(5,6,0,6603,0,0),
+(5,6,1,49576,0,0),
+(5,6,2,45477,0,0),
+(5,6,3,45462,0,0),
+(5,6,4,45902,0,0),
+(5,6,5,47541,0,0),
+(5,6,10,20577,0,0),
+(5,8,11,4604,128,0),
+(5,8,10,159,128,0),
+(5,8,2,168,0,0),
+(5,8,1,133,0,0),
+(5,8,0,6603,0,0),
+(5,9,1,686,0,0),
+(5,9,10,159,128,0),
+(5,9,2,687,0,0),
+(5,9,11,4604,128,0),
+(5,9,0,6603,0,0),
+(6,1,1,78,0,0),
+(6,1,2,20549,0,0),
+(6,1,11,4540,128,0),
+(6,1,0,6603,0,0),
+(6,3,1,2973,0,0),
+(6,3,10,159,128,0),
+(6,3,2,75,0,0),
+(6,3,3,20549,0,0),
+(6,3,11,117,128,0),
+(6,3,0,6603,0,0),
+(6,6,0,6603,0,0),
+(6,6,1,49576,0,0),
+(6,6,2,45477,0,0),
+(6,6,3,45462,0,0),
+(6,6,4,45902,0,0),
+(6,6,5,47541,0,0),
+(6,6,10,20549,0,0),
+(6,6,75,20549,0,0),
+(6,7,1,403,0,0),
+(6,7,10,159,128,0),
+(6,7,2,331,0,0),
+(6,7,3,20549,0,0),
+(6,7,11,4604,128,0),
+(6,7,0,6603,0,0),
+(6,11,1,5176,0,0),
+(6,11,10,159,128,0),
+(6,11,2,5185,0,0),
+(6,11,3,20549,0,0),
+(6,11,11,4536,128,0),
+(6,11,0,6603,0,0),
+(7,1,11,117,128,0),
+(7,1,1,78,0,0),
+(7,1,0,6603,0,0),
+(7,4,11,117,128,0),
+(7,4,3,2764,0,0),
+(7,4,1,1752,0,0),
+(7,4,2,2098,0,0),
+(7,4,0,6603,0,0),
+(7,6,0,6603,0,0),
+(7,6,1,49576,0,0),
+(7,6,2,45477,0,0),
+(7,6,3,45462,0,0),
+(7,6,4,45902,0,0),
+(7,6,5,47541,0,0),
+(7,6,10,20589,0,0),
+(7,6,72,6603,0,0),
+(7,6,83,117,128,0),
+(7,6,84,6603,0,0),
+(7,6,96,6603,0,0),
+(7,6,108,6603,0,0),
+(7,8,11,4536,128,0),
+(7,8,1,133,0,0),
+(7,8,2,168,0,0),
+(7,8,10,159,128,0),
+(7,8,0,6603,0,0),
+(7,9,11,4604,128,0),
+(7,9,1,686,0,0),
+(7,9,2,687,0,0),
+(7,9,10,159,128,0),
+(7,9,0,6603,0,0),
+(8,1,11,117,128,0),
+(8,1,1,78,0,0),
+(8,1,3,2764,0,0),
+(8,1,0,6603,0,0),
+(8,3,10,159,128,0),
+(8,3,11,4604,128,0),
+(8,3,1,2973,0,0),
+(8,3,2,75,0,0),
+(8,3,0,6603,0,0),
+(8,4,1,1752,0,0),
+(8,4,3,2764,0,0),
+(8,4,2,2098,0,0),
+(8,4,11,117,128,0),
+(8,4,0,6603,0,0),
+(8,5,1,585,0,0),
+(8,5,10,159,128,0),
+(8,5,2,2050,0,0),
+(8,5,11,4540,128,0),
+(8,5,0,6603,0,0),
+(8,6,0,6603,0,0),
+(8,6,1,49576,0,0),
+(8,6,2,45477,0,0),
+(8,6,3,45462,0,0),
+(8,6,4,45902,0,0),
+(8,6,5,47541,0,0),
+(8,6,10,50621,0,0),
+(8,7,1,403,0,0),
+(8,7,10,159,128,0),
+(8,7,2,331,0,0),
+(8,7,11,117,128,0),
+(8,7,0,6603,0,0),
+(8,8,1,133,0,0),
+(8,8,10,159,128,0),
+(8,8,2,168,0,0),
+(8,8,11,117,128,0),
+(8,8,0,6603,0,0),
+(10,2,0,6603,0,0),
+(10,2,1,21084,0,0),
+(10,2,2,635,0,0),
+(10,2,3,28734,0,0),
+(10,2,4,28730,0,0),
+(10,2,10,159,128,0),
+(10,2,11,20857,128,0),
+(10,3,0,6603,0,0),
+(10,3,1,2973,0,0),
+(10,3,2,75,0,0),
+(10,3,3,28734,0,0),
+(10,3,4,28730,0,0),
+(10,3,10,159,128,0),
+(10,3,11,20857,128,0),
+(10,4,0,6603,0,0),
+(10,4,1,1752,0,0),
+(10,4,2,2098,0,0),
+(10,4,3,2764,0,0),
+(10,4,4,28734,0,0),
+(10,4,5,25046,0,0),
+(10,4,11,20857,128,0),
+(10,5,0,6603,0,0),
+(10,5,1,585,0,0),
+(10,5,2,2050,0,0),
+(10,5,3,28734,0,0),
+(10,5,4,28730,0,0),
+(10,5,10,159,128,0),
+(10,5,11,20857,128,0),
+(10,6,0,6603,0,0),
+(10,6,1,49576,0,0),
+(10,6,2,45477,0,0),
+(10,6,3,45462,0,0),
+(10,6,4,45902,0,0),
+(10,6,5,47541,0,0),
+(10,6,6,50613,0,0),
+(10,8,0,6603,0,0),
+(10,8,1,133,0,0),
+(10,8,2,168,0,0),
+(10,8,3,28734,0,0),
+(10,8,4,28730,0,0),
+(10,8,10,159,128,0),
+(10,8,11,20857,128,0),
+(10,9,11,20857,128,0),
+(10,9,10,159,128,0),
+(10,9,4,28730,0,0),
+(10,9,3,28734,0,0),
+(10,9,2,687,0,0),
+(10,9,1,686,0,0),
+(10,9,0,6603,0,0),
+(11,1,0,6603,0,0),
+(11,1,72,6603,0,0),
+(11,1,73,78,0,0),
+(11,1,74,28880,0,0),
+(11,1,83,4540,128,0),
+(11,1,84,6603,0,0),
+(11,1,96,6603,0,0),
+(11,1,108,6603,0,0),
+(11,2,0,6603,0,0),
+(11,2,1,21084,0,0),
+(11,2,2,635,0,0),
+(11,2,3,28880,0,0),
+(11,2,10,159,128,0),
+(11,2,11,4540,128,0),
+(11,2,83,4540,128,0),
+(11,3,0,6603,0,0),
+(11,3,1,2973,0,0),
+(11,3,2,75,0,0),
+(11,3,3,28880,0,0),
+(11,3,10,159,128,0),
+(11,3,11,4540,128,0),
+(11,3,72,6603,0,0),
+(11,3,73,2973,0,0),
+(11,3,74,75,0,0),
+(11,3,82,159,128,0),
+(11,3,83,4540,128,0),
+(11,5,0,6603,0,0),
+(11,5,1,585,0,0),
+(11,5,2,2050,0,0),
+(11,5,3,28880,0,0),
+(11,5,10,159,128,0),
+(11,5,11,4540,128,0),
+(11,5,83,4540,128,0),
+(11,6,0,6603,0,0),
+(11,6,1,49576,0,0),
+(11,6,2,45477,0,0),
+(11,6,3,45462,0,0),
+(11,6,4,45902,0,0),
+(11,6,5,47541,0,0),
+(11,7,0,6603,0,0),
+(11,7,1,403,0,0),
+(11,7,2,331,0,0),
+(11,7,3,28880,0,0),
+(11,7,10,159,128,0),
+(11,7,11,4540,128,0),
+(11,8,0,6603,0,0),
+(11,8,1,133,0,0),
+(11,8,2,168,0,0),
+(11,8,3,28880,0,0),
+(11,8,10,159,128,0),
+(11,8,11,4540,128,0),
+(11,8,83,4540,128,0);
/*!40000 ALTER TABLE `playercreateinfo_action` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2507,6 +10029,2694 @@ CREATE TABLE `playercreateinfo_spell` (
LOCK TABLES `playercreateinfo_spell` WRITE;
/*!40000 ALTER TABLE `playercreateinfo_spell` DISABLE KEYS */;
+INSERT INTO `playercreateinfo_spell` VALUES
+(1,1,78,'Heroic Strike',1),
+(1,1,81,'Dodge',1),
+(1,1,107,'Block',1),
+(1,1,196,'One-Handed Axes',1),
+(1,1,198,'One-Handed Maces',1),
+(1,1,201,'One-Handed Swords',1),
+(1,1,203,'Unarmed',1),
+(1,1,204,'Defense',1),
+(1,1,522,'SPELLDEFENSE(DND)',1),
+(1,1,668,'Language Common',1),
+(1,1,2382,'Generic',1),
+(1,1,2457,'Battle Stance',1),
+(1,1,2479,'Honorless Target',1),
+(1,1,3050,'Detect',1),
+(1,1,3365,'Opening',1),
+(1,1,5301,'Defensive State(DND)',1),
+(1,1,6233,'Closing',1),
+(1,1,6246,'Closing',1),
+(1,1,6247,'Opening',1),
+(1,1,6477,'Opening',1),
+(1,1,6478,'Opening',1),
+(1,1,6603,'Attack',1),
+(1,1,7266,'Duel',1),
+(1,1,7267,'Grovel',1),
+(1,1,7355,'Stuck',1),
+(1,1,7376,'Defensive Stance Passive',0),
+(1,1,7381,'Berserker Stance Passive',0),
+(1,1,8386,'Attacking',1),
+(1,1,8737,'Mail',1),
+(1,1,9077,'Leather',1),
+(1,1,9078,'Cloth',1),
+(1,1,9116,'Shield',1),
+(1,1,9125,'Generic',1),
+(1,1,20597,'Sword Specialization',1),
+(1,1,20598,'The Human Spirit',1),
+(1,1,20599,'Diplomacy',1),
+(1,1,20600,'Perception',1),
+(1,1,20864,'Mace Specialization',1),
+(1,1,21156,'Battle Stance Passive',0),
+(1,1,21651,'Opening',1),
+(1,1,21652,'Closing',1),
+(1,1,22027,'Remove Insignia',1),
+(1,1,22810,'Opening - No Text',1),
+(1,1,32215,'Victorious State',1),
+(1,2,81,'Dodge',1),
+(1,2,107,'Block',1),
+(1,2,198,'One-Handed Maces',1),
+(1,2,199,'Two-Handed Maces',1),
+(1,2,203,'Unarmed',1),
+(1,2,204,'Defense',1),
+(1,2,522,'SPELLDEFENSE(DND)',1),
+(1,2,635,'Holy Light',1),
+(1,2,668,'Language Common',1),
+(1,2,2382,'Generic',1),
+(1,2,2479,'Honorless Target',1),
+(1,2,3050,'Detect',1),
+(1,2,3365,'Opening',1),
+(1,2,6233,'Closing',1),
+(1,2,6246,'Closing',1),
+(1,2,6247,'Opening',1),
+(1,2,6477,'Opening',1),
+(1,2,6478,'Opening',1),
+(1,2,6603,'Attack',1),
+(1,2,7266,'Duel',1),
+(1,2,7267,'Grovel',1),
+(1,2,7355,'Stuck',1),
+(1,2,8386,'Attacking',1),
+(1,2,8737,'Mail',1),
+(1,2,9077,'Leather',1),
+(1,2,9078,'Cloth',1),
+(1,2,9116,'Shield',1),
+(1,2,9125,'Generic',1),
+(1,2,21084,'Seal of Righteousness',1),
+(1,2,20597,'Sword Specialization',1),
+(1,2,20598,'The Human Spirit',1),
+(1,2,20599,'Diplomacy',1),
+(1,2,20600,'Perception',1),
+(1,2,20864,'Mace Specialization',1),
+(1,2,21651,'Opening',1),
+(1,2,21652,'Closing',1),
+(1,2,22027,'Remove Insignia',1),
+(1,2,22810,'Opening - No Text',1),
+(1,2,27762,'Libram',1),
+(1,4,81,'Dodge',1),
+(1,4,203,'Unarmed',1),
+(1,4,204,'Defense',1),
+(1,4,522,'SPELLDEFENSE(DND)',1),
+(1,4,668,'Language Common',1),
+(1,4,1180,'Daggers',1),
+(1,4,1752,'Sinister Strike',1),
+(1,4,2098,'Eviscerate',1),
+(1,4,2382,'Generic',1),
+(1,4,2479,'Honorless Target',1),
+(1,4,2567,'Thrown',1),
+(1,4,2764,'Throw',1),
+(1,4,3050,'Detect',1),
+(1,4,3365,'Opening',1),
+(1,4,6233,'Closing',1),
+(1,4,6246,'Closing',1),
+(1,4,6247,'Opening',1),
+(1,4,6477,'Opening',1),
+(1,4,6478,'Opening',1),
+(1,4,6603,'Attack',1),
+(1,4,7266,'Duel',1),
+(1,4,7267,'Grovel',1),
+(1,4,7355,'Stuck',1),
+(1,4,8386,'Attacking',1),
+(1,4,9077,'Leather',1),
+(1,4,9078,'Cloth',1),
+(1,4,9125,'Generic',1),
+(1,4,16092,'Defensive State(DND)',1),
+(1,4,20597,'Sword Specialization',1),
+(1,4,20598,'The Human Spirit',1),
+(1,4,20599,'Diplomacy',1),
+(1,4,20600,'Perception',1),
+(1,4,20864,'Mace Specialization',1),
+(1,4,21184,'Rogue Passive(DND)',1),
+(1,4,21651,'Opening',1),
+(1,4,21652,'Closing',1),
+(1,4,22027,'Remove Insignia',1),
+(1,4,22810,'Opening - No Text',1),
+(1,5,81,'Dodge',1),
+(1,5,198,'One-Handed Maces',1),
+(1,5,203,'Unarmed',1),
+(1,5,204,'Defense',1),
+(1,5,522,'SPELLDEFENSE(DND)',1),
+(1,5,585,'Smite',1),
+(1,5,668,'Language Common',1),
+(1,5,2050,'Lesser Heal',1),
+(1,5,2382,'Generic',1),
+(1,5,2479,'Honorless Target',1),
+(1,5,3050,'Detect',1),
+(1,5,3365,'Opening',1),
+(1,5,5009,'Wands',1),
+(1,5,5019,'Shoot',1),
+(1,5,6233,'Closing',1),
+(1,5,6246,'Closing',1),
+(1,5,6247,'Opening',1),
+(1,5,6477,'Opening',1),
+(1,5,6478,'Opening',1),
+(1,5,6603,'Attack',1),
+(1,5,7266,'Duel',1),
+(1,5,7267,'Grovel',1),
+(1,5,7355,'Stuck',1),
+(1,5,8386,'Attacking',1),
+(1,5,9078,'Cloth',1),
+(1,5,9125,'Generic',1),
+(1,5,20597,'Sword Specialization',1),
+(1,5,20598,'The Human Spirit',1),
+(1,5,20599,'Diplomacy',1),
+(1,5,20600,'Perception',1),
+(1,5,20864,'Mace Specialization',1),
+(1,5,21651,'Opening',1),
+(1,5,21652,'Closing',1),
+(1,5,22027,'Remove Insignia',1),
+(1,5,22810,'Opening - No Text',1),
+(1,6,81,'Dodge',1),
+(1,6,196,'One-Handed Axes',1),
+(1,6,197,'Two-Handed Axes',1),
+(1,6,200,'Polearms',1),
+(1,6,201,'One-Handed Swords',1),
+(1,6,202,'Two-Handed Swords',1),
+(1,6,203,'Unarmed',1),
+(1,6,204,'Defense',1),
+(1,6,522,'SPELLDEFENSE (DND)',1),
+(1,6,668,'Language Common',1),
+(1,6,674,'Dual Wield',1),
+(1,6,750,'Plate Mail',1),
+(1,6,1843,'Disarm',1),
+(1,6,2382,'Generic',1),
+(1,6,2479,'Honorless Target',1),
+(1,6,3050,'Detect',1),
+(1,6,3127,'Parry',1),
+(1,6,3275,'Linen Bandage',1),
+(1,6,3276,'Heavy Linen Bandage',1),
+(1,6,3277,'Wool Bandage',1),
+(1,6,3278,'Heavy Wool Bandage',1),
+(1,6,3365,'Opening',1),
+(1,6,6233,'Closing',1),
+(1,6,6246,'Closing',1),
+(1,6,6247,'Opening',1),
+(1,6,6477,'Opening',1),
+(1,6,6478,'Opening',1),
+(1,6,6603,'Attack',1),
+(1,6,7266,'Duel',1),
+(1,6,7267,'Grovel',1),
+(1,6,7355,'Stuck',1),
+(1,6,7928,'Silk Bandage',1),
+(1,6,7929,'Heavy Silk Bandage',1),
+(1,6,7934,'Anti-Venom',1),
+(1,6,8386,'Attacking',1),
+(1,6,8737,'Mail',1),
+(1,6,9077,'Leather',1),
+(1,6,9078,'Cloth',1),
+(1,6,9125,'Generic',1),
+(1,6,10840,'Mageweave Bandage',1),
+(1,6,10841,'Heavy Mageweave Bandage',1),
+(1,6,10846,'First Aid',1),
+(1,6,18629,'Runecloth Bandage',1),
+(1,6,18630,'Heavy Runecloth Bandage',1),
+(1,6,20597,'Sword Specialization',1),
+(1,6,20598,'The Human Spirit',1),
+(1,6,20599,'Diplomacy',1),
+(1,6,20864,'Mace Specialization',1),
+(1,6,21651,'Opening',1),
+(1,6,21652,'Closing',1),
+(1,6,22027,'Remove Insignia',1),
+(1,6,22810,'Opening - No Text',1),
+(1,6,33391,'Journeyman Riding',1),
+(1,6,45462,'Plague Strike',1),
+(1,6,45477,'Icy Touch',1),
+(1,6,45902,'Blood Strike',1),
+(1,6,45903,'Offensive State (DND)',1),
+(1,6,45927,'Summon Friend',1),
+(1,6,47541,'Death Coil',1),
+(1,6,48266,'Blood Presence',1),
+(1,6,49410,'Forceful Deflection',1),
+(1,6,49576,'Death Grip',1),
+(1,6,52665,'Sigil',1),
+(1,6,58985,'Perception',1),
+(1,6,59752,'Every Man for Himself',1),
+(1,6,59879,'Blood Plague',1),
+(1,6,59921,'Frost Fever',1),
+(1,6,61437,'Opening',1),
+(1,6,61455,'Runic Focus',1),
+(1,8,81,'Dodge',1),
+(1,8,133,'Fireball',1),
+(1,8,168,'Frost Armor',1),
+(1,8,203,'Unarmed',1),
+(1,8,204,'Defense',1),
+(1,8,227,'Staves',1),
+(1,8,522,'SPELLDEFENSE(DND)',1),
+(1,8,668,'Language Common',1),
+(1,8,2382,'Generic',1),
+(1,8,2479,'Honorless Target',1),
+(1,8,3050,'Detect',1),
+(1,8,3365,'Opening',1),
+(1,8,5009,'Wands',1),
+(1,8,5019,'Shoot',1),
+(1,8,6233,'Closing',1),
+(1,8,6246,'Closing',1),
+(1,8,6247,'Opening',1),
+(1,8,6477,'Opening',1),
+(1,8,6478,'Opening',1),
+(1,8,6603,'Attack',1),
+(1,8,7266,'Duel',1),
+(1,8,7267,'Grovel',1),
+(1,8,7355,'Stuck',1),
+(1,8,8386,'Attacking',1),
+(1,8,9078,'Cloth',1),
+(1,8,9125,'Generic',1),
+(1,8,20597,'Sword Specialization',1),
+(1,8,20598,'The Human Spirit',1),
+(1,8,20599,'Diplomacy',1),
+(1,8,20600,'Perception',1),
+(1,8,20864,'Mace Specialization',1),
+(1,8,21651,'Opening',1),
+(1,8,21652,'Closing',1),
+(1,8,22027,'Remove Insignia',1),
+(1,8,22810,'Opening - No Text',1),
+(1,9,81,'Dodge',1),
+(1,9,203,'Unarmed',1),
+(1,9,204,'Defense',1),
+(1,9,522,'SPELLDEFENSE(DND)',1),
+(1,9,668,'Language Common',1),
+(1,9,686,'Shadow Bolt',1),
+(1,9,687,'Demon Skin',1),
+(1,9,1180,'Daggers',1),
+(1,9,2382,'Generic',1),
+(1,9,2479,'Honorless Target',1),
+(1,9,3050,'Detect',1),
+(1,9,3365,'Opening',1),
+(1,9,5009,'Wands',1),
+(1,9,5019,'Shoot',1),
+(1,9,6233,'Closing',1),
+(1,9,6246,'Closing',1),
+(1,9,6247,'Opening',1),
+(1,9,6477,'Opening',1),
+(1,9,6478,'Opening',1),
+(1,9,6603,'Attack',1),
+(1,9,7266,'Duel',1),
+(1,9,7267,'Grovel',1),
+(1,9,7355,'Stuck',1),
+(1,9,8386,'Attacking',1),
+(1,9,9078,'Cloth',1),
+(1,9,9125,'Generic',1),
+(1,9,20597,'Sword Specialization',1),
+(1,9,20598,'The Human Spirit',1),
+(1,9,20599,'Diplomacy',1),
+(1,9,20600,'Perception',1),
+(1,9,20864,'Mace Specialization',1),
+(1,9,21651,'Opening',1),
+(1,9,21652,'Closing',1),
+(1,9,22027,'Remove Insignia',1),
+(1,9,22810,'Opening - No Text',1),
+(2,1,78,'Heroic Strike',1),
+(2,1,81,'Dodge',1),
+(2,1,107,'Block',1),
+(2,1,196,'One-Handed Axes',1),
+(2,1,197,'Two-Handed Axes',1),
+(2,1,201,'One-Handed Swords',1),
+(2,1,203,'Unarmed',1),
+(2,1,204,'Defense',1),
+(2,1,522,'SPELLDEFENSE(DND)',1),
+(2,1,669,'Language Orcish',1),
+(2,1,2382,'Generic',1),
+(2,1,2457,'Battle Stance',1),
+(2,1,2479,'Honorless Target',1),
+(2,1,3050,'Detect',1),
+(2,1,3365,'Opening',1),
+(2,1,5301,'Defensive State(DND)',1),
+(2,1,6233,'Closing',1),
+(2,1,6246,'Closing',1),
+(2,1,6247,'Opening',1),
+(2,1,6477,'Opening',1),
+(2,1,6478,'Opening',1),
+(2,1,6603,'Attack',1),
+(2,1,7266,'Duel',1),
+(2,1,7267,'Grovel',1),
+(2,1,7355,'Stuck',1),
+(2,1,7376,'Defensive Stance Passive',0),
+(2,1,7381,'Berserker Stance Passive',0),
+(2,1,8386,'Attacking',1),
+(2,1,8737,'Mail',1),
+(2,1,9077,'Leather',1),
+(2,1,9078,'Cloth',1),
+(2,1,9116,'Shield',1),
+(2,1,9125,'Generic',1),
+(2,1,20572,'Blood Fury',1),
+(2,1,20573,'Hardiness',1),
+(2,1,20574,'Axe Specialization',1),
+(2,1,21156,'Battle Stance Passive',0),
+(2,1,21563,'Command',1),
+(2,1,21651,'Opening',1),
+(2,1,21652,'Closing',1),
+(2,1,22027,'Remove Insignia',1),
+(2,1,22810,'Opening - No Text',1),
+(2,1,32215,'Victorious State',1),
+(2,3,75,'Auto Shot',1),
+(2,3,81,'Dodge',1),
+(2,3,196,'One-Handed Axes',1),
+(2,3,203,'Unarmed',1),
+(2,3,204,'Defense',1),
+(2,3,264,'Bows',1),
+(2,3,522,'SPELLDEFENSE(DND)',1),
+(2,3,669,'Language Orcish',1),
+(2,3,2382,'Generic',1),
+(2,3,2479,'Honorless Target',1),
+(2,3,2973,'Raptor Strike',1),
+(2,3,3050,'Detect',1),
+(2,3,3365,'Opening',1),
+(2,3,6233,'Closing',1),
+(2,3,6246,'Closing',1),
+(2,3,6247,'Opening',1),
+(2,3,6477,'Opening',1),
+(2,3,6478,'Opening',1),
+(2,3,6603,'Attack',1),
+(2,3,7266,'Duel',1),
+(2,3,7267,'Grovel',1),
+(2,3,7355,'Stuck',1),
+(2,3,8386,'Attacking',1),
+(2,3,9077,'Leather',1),
+(2,3,9078,'Cloth',1),
+(2,3,9125,'Generic',1),
+(2,3,13358,'Defensive State(DND)',1),
+(2,3,20572,'Blood Fury',1),
+(2,3,20573,'Hardiness',1),
+(2,3,20574,'Axe Specialization',1),
+(2,3,20576,'Command',1),
+(2,3,21651,'Opening',1),
+(2,3,21652,'Closing',1),
+(2,3,22027,'Remove Insignia',1),
+(2,3,22810,'Opening - No Text',1),
+(2,3,24949,'Defensive State 2(DND)',1),
+(2,3,34082,'Advantaged State(DND)',1),
+(2,4,81,'Dodge',1),
+(2,4,203,'Unarmed',1),
+(2,4,204,'Defense',1),
+(2,4,522,'SPELLDEFENSE(DND)',1),
+(2,4,669,'Language Orcish',1),
+(2,4,1180,'Daggers',1),
+(2,4,1752,'Sinister Strike',1),
+(2,4,2098,'Eviscerate',1),
+(2,4,2382,'Generic',1),
+(2,4,2479,'Honorless Target',1),
+(2,4,2567,'Thrown',1),
+(2,4,2764,'Throw',1),
+(2,4,3050,'Detect',1),
+(2,4,3365,'Opening',1),
+(2,4,6233,'Closing',1),
+(2,4,6246,'Closing',1),
+(2,4,6247,'Opening',1),
+(2,4,6477,'Opening',1),
+(2,4,6478,'Opening',1),
+(2,4,6603,'Attack',1),
+(2,4,7266,'Duel',1),
+(2,4,7267,'Grovel',1),
+(2,4,7355,'Stuck',1),
+(2,4,8386,'Attacking',1),
+(2,4,9077,'Leather',1),
+(2,4,9078,'Cloth',1),
+(2,4,9125,'Generic',1),
+(2,4,16092,'Defensive State(DND)',1),
+(2,4,20572,'Blood Fury',1),
+(2,4,20573,'Hardiness',1),
+(2,4,20574,'Axe Specialization',1),
+(2,4,21184,'Rogue Passive(DND)',1),
+(2,4,21563,'Command',1),
+(2,4,21651,'Opening',1),
+(2,4,21652,'Closing',1),
+(2,4,22027,'Remove Insignia',1),
+(2,4,22810,'Opening - No Text',1),
+(2,6,81,'Dodge',1),
+(2,6,196,'One-Handed Axes',1),
+(2,6,197,'Two-Handed Axes',1),
+(2,6,200,'Polearms',1),
+(2,6,201,'One-Handed Swords',1),
+(2,6,202,'Two-Handed Swords',1),
+(2,6,203,'Unarmed',1),
+(2,6,204,'Defense',1),
+(2,6,522,'SPELLDEFENSE (DND)',1),
+(2,6,669,'Language Orcish',1),
+(2,6,674,'Dual Wield',1),
+(2,6,750,'Plate Mail',1),
+(2,6,1843,'Disarm',1),
+(2,6,2382,'Generic',1),
+(2,6,2479,'Honorless Target',1),
+(2,6,3050,'Detect',1),
+(2,6,3127,'Parry',1),
+(2,6,3275,'Linen Bandage',1),
+(2,6,3276,'Heavy Linen Bandage',1),
+(2,6,3277,'Wool Bandage',1),
+(2,6,3278,'Heavy Wool Bandage',1),
+(2,6,3365,'Opening',1),
+(2,6,6233,'Closing',1),
+(2,6,6246,'Closing',1),
+(2,6,6247,'Opening',1),
+(2,6,6477,'Opening',1),
+(2,6,6478,'Opening',1),
+(2,6,6603,'Attack',1),
+(2,6,7266,'Duel',1),
+(2,6,7267,'Grovel',1),
+(2,6,7355,'Stuck',1),
+(2,6,7928,'Silk Bandage',1),
+(2,6,7929,'Heavy Silk Bandage',1),
+(2,6,7934,'Anti-Venom',1),
+(2,6,8386,'Attacking',1),
+(2,6,8737,'Mail',1),
+(2,6,9077,'Leather',1),
+(2,6,9078,'Cloth',1),
+(2,6,9125,'Generic',1),
+(2,6,10840,'Mageweave Bandage',1),
+(2,6,10841,'Heavy Mageweave Bandage',1),
+(2,6,10846,'First Aid',1),
+(2,6,18629,'Runecloth Bandage',1),
+(2,6,18630,'Heavy Runecloth Bandage',1),
+(2,6,20572,'Blood Fury',1),
+(2,6,20573,'Hardiness',1),
+(2,6,20574,'Axe Specialization',1),
+(2,6,21651,'Opening',1),
+(2,6,21652,'Closing',1),
+(2,6,22027,'Remove Insignia',1),
+(2,6,22810,'Opening - No Text',1),
+(2,6,33391,'Journeyman Riding',1),
+(2,6,45462,'Plague Strike',1),
+(2,6,45477,'Icy Touch',1),
+(2,6,45902,'Blood Strike',1),
+(2,6,45903,'Offensive State (DND)',1),
+(2,6,45927,'Summon Friend',1),
+(2,6,47541,'Death Coil',1),
+(2,6,48266,'Blood Presence',1),
+(2,6,49410,'Forceful Deflection',1),
+(2,6,49576,'Death Grip',1),
+(2,6,52665,'Sigil',1),
+(2,6,54562,'Command',1),
+(2,6,59879,'Blood Plague',1),
+(2,6,59921,'Frost Fever',1),
+(2,6,61437,'Opening',1),
+(2,6,61455,'Runic Focus',1),
+(2,7,81,'Dodge',1),
+(2,7,107,'Block',1),
+(2,7,198,'One-Handed Maces',1),
+(2,7,203,'Unarmed',1),
+(2,7,204,'Defense',1),
+(2,7,227,'Staves',1),
+(2,7,331,'Healing Wave',1),
+(2,7,403,'Lightning Bolt',1),
+(2,7,522,'SPELLDEFENSE(DND)',1),
+(2,7,669,'Language Orcish',1),
+(2,7,2382,'Generic',1),
+(2,7,2479,'Honorless Target',1),
+(2,7,3050,'Detect',1),
+(2,7,3365,'Opening',1),
+(2,7,6233,'Closing',1),
+(2,7,6246,'Closing',1),
+(2,7,6247,'Opening',1),
+(2,7,6477,'Opening',1),
+(2,7,6478,'Opening',1),
+(2,7,6603,'Attack',1),
+(2,7,7266,'Duel',1),
+(2,7,7267,'Grovel',1),
+(2,7,7355,'Stuck',1),
+(2,7,8386,'Attacking',1),
+(2,7,9077,'Leather',1),
+(2,7,9078,'Cloth',1),
+(2,7,9116,'Shield',1),
+(2,7,9125,'Generic',1),
+(2,7,20573,'Hardiness',1),
+(2,7,20574,'Axe Specialization',1),
+(2,7,21563,'Command',1),
+(2,7,21651,'Opening',1),
+(2,7,21652,'Closing',1),
+(2,7,22027,'Remove Insignia',1),
+(2,7,22810,'Opening - No Text',1),
+(2,7,27763,'Totem',1),
+(2,7,33697,'Blood Fury',1),
+(2,9,81,'Dodge',1),
+(2,9,203,'Unarmed',1),
+(2,9,204,'Defense',1),
+(2,9,522,'SPELLDEFENSE(DND)',1),
+(2,9,669,'Language Orcish',1),
+(2,9,686,'Shadow Bolt',1),
+(2,9,687,'Demon Skin',1),
+(2,9,1180,'Daggers',1),
+(2,9,2382,'Generic',1),
+(2,9,2479,'Honorless Target',1),
+(2,9,3050,'Detect',1),
+(2,9,3365,'Opening',1),
+(2,9,5009,'Wands',1),
+(2,9,5019,'Shoot',1),
+(2,9,6233,'Closing',1),
+(2,9,6246,'Closing',1),
+(2,9,6247,'Opening',1),
+(2,9,6477,'Opening',1),
+(2,9,6478,'Opening',1),
+(2,9,6603,'Attack',1),
+(2,9,7266,'Duel',1),
+(2,9,7267,'Grovel',1),
+(2,9,7355,'Stuck',1),
+(2,9,8386,'Attacking',1),
+(2,9,9078,'Cloth',1),
+(2,9,9125,'Generic',1),
+(2,9,20573,'Hardiness',1),
+(2,9,20574,'Axe Specialization',1),
+(2,9,20575,'Command',1),
+(2,9,21651,'Opening',1),
+(2,9,21652,'Closing',1),
+(2,9,22027,'Remove Insignia',1),
+(2,9,22810,'Opening - No Text',1),
+(2,9,33702,'Blood Fury',1),
+(3,1,78,'Heroic Strike',1),
+(3,1,81,'Dodge',1),
+(3,1,107,'Block',1),
+(3,1,196,'One-Handed Axes',1),
+(3,1,197,'Two-Handed Axes',1),
+(3,1,198,'One-Handed Maces',1),
+(3,1,203,'Unarmed',1),
+(3,1,204,'Defense',1),
+(3,1,522,'SPELLDEFENSE(DND)',1),
+(3,1,668,'Language Common',1),
+(3,1,672,'Language Dwarven',1),
+(3,1,2382,'Generic',1),
+(3,1,2457,'Battle Stance',1),
+(3,1,2479,'Honorless Target',1),
+(3,1,2481,'Find Treasure',1),
+(3,1,3050,'Detect',1),
+(3,1,3365,'Opening',1),
+(3,1,5301,'Defensive State(DND)',1),
+(3,1,6233,'Closing',1),
+(3,1,6246,'Closing',1),
+(3,1,6247,'Opening',1),
+(3,1,6477,'Opening',1),
+(3,1,6478,'Opening',1),
+(3,1,6603,'Attack',1),
+(3,1,7266,'Duel',1),
+(3,1,7267,'Grovel',1),
+(3,1,7355,'Stuck',1),
+(3,1,7376,'Defensive Stance Passive',0),
+(3,1,7381,'Berserker Stance Passive',0),
+(3,1,8386,'Attacking',1),
+(3,1,8737,'Mail',1),
+(3,1,9077,'Leather',1),
+(3,1,9078,'Cloth',1),
+(3,1,9116,'Shield',1),
+(3,1,9125,'Generic',1),
+(3,1,20594,'Stoneform',1),
+(3,1,20595,'Gun Specialization',1),
+(3,1,20596,'Frost Resistance',1),
+(3,1,21156,'Battle Stance Passive',0),
+(3,1,21651,'Opening',1),
+(3,1,21652,'Closing',1),
+(3,1,22027,'Remove Insignia',1),
+(3,1,22810,'Opening - No Text',1),
+(3,1,32215,'Victorious State',1),
+(3,2,81,'Dodge',1),
+(3,2,107,'Block',1),
+(3,2,198,'One-Handed Maces',1),
+(3,2,199,'Two-Handed Maces',1),
+(3,2,203,'Unarmed',1),
+(3,2,204,'Defense',1),
+(3,2,522,'SPELLDEFENSE(DND)',1),
+(3,2,635,'Holy Light',1),
+(3,2,668,'Language Common',1),
+(3,2,672,'Language Dwarven',1),
+(3,2,2382,'Generic',1),
+(3,2,2479,'Honorless Target',1),
+(3,2,2481,'Find Treasure',1),
+(3,2,3050,'Detect',1),
+(3,2,3365,'Opening',1),
+(3,2,6233,'Closing',1),
+(3,2,6246,'Closing',1),
+(3,2,6247,'Opening',1),
+(3,2,6477,'Opening',1),
+(3,2,6478,'Opening',1),
+(3,2,6603,'Attack',1),
+(3,2,7266,'Duel',1),
+(3,2,7267,'Grovel',1),
+(3,2,7355,'Stuck',1),
+(3,2,8386,'Attacking',1),
+(3,2,8737,'Mail',1),
+(3,2,9077,'Leather',1),
+(3,2,9078,'Cloth',1),
+(3,2,9116,'Shield',1),
+(3,2,9125,'Generic',1),
+(3,2,21084,'Seal of Righteousness',1),
+(3,2,20594,'Stoneform',1),
+(3,2,20595,'Gun Specialization',1),
+(3,2,20596,'Frost Resistance',1),
+(3,2,21651,'Opening',1),
+(3,2,21652,'Closing',1),
+(3,2,22027,'Remove Insignia',1),
+(3,2,22810,'Opening - No Text',1),
+(3,2,27762,'Libram',1),
+(3,3,75,'Auto Shot',1),
+(3,3,81,'Dodge',1),
+(3,3,196,'One-Handed Axes',1),
+(3,3,203,'Unarmed',1),
+(3,3,204,'Defense',1),
+(3,3,266,'Guns',1),
+(3,3,522,'SPELLDEFENSE(DND)',1),
+(3,3,668,'Language Common',1),
+(3,3,672,'Language Dwarven',1),
+(3,3,2382,'Generic',1),
+(3,3,2479,'Honorless Target',1),
+(3,3,2481,'Find Treasure',1),
+(3,3,2973,'Raptor Strike',1),
+(3,3,3050,'Detect',1),
+(3,3,3365,'Opening',1),
+(3,3,6233,'Closing',1),
+(3,3,6246,'Closing',1),
+(3,3,6247,'Opening',1),
+(3,3,6477,'Opening',1),
+(3,3,6478,'Opening',1),
+(3,3,6603,'Attack',1),
+(3,3,7266,'Duel',1),
+(3,3,7267,'Grovel',1),
+(3,3,7355,'Stuck',1),
+(3,3,8386,'Attacking',1),
+(3,3,9077,'Leather',1),
+(3,3,9078,'Cloth',1),
+(3,3,9125,'Generic',1),
+(3,3,13358,'Defensive State(DND)',1),
+(3,3,20594,'Stoneform',1),
+(3,3,20595,'Gun Specialization',1),
+(3,3,20596,'Frost Resistance',1),
+(3,3,21651,'Opening',1),
+(3,3,21652,'Closing',1),
+(3,3,22027,'Remove Insignia',1),
+(3,3,22810,'Opening - No Text',1),
+(3,3,24949,'Defensive State 2(DND)',1),
+(3,3,34082,'Advantaged State(DND)',1),
+(3,4,81,'Dodge',1),
+(3,4,203,'Unarmed',1),
+(3,4,204,'Defense',1),
+(3,4,522,'SPELLDEFENSE(DND)',1),
+(3,4,668,'Language Common',1),
+(3,4,672,'Language Dwarven',1),
+(3,4,1180,'Daggers',1),
+(3,4,1752,'Sinister Strike',1),
+(3,4,2098,'Eviscerate',1),
+(3,4,2382,'Generic',1),
+(3,4,2479,'Honorless Target',1),
+(3,4,2481,'Find Treasure',1),
+(3,4,2567,'Thrown',1),
+(3,4,2764,'Throw',1),
+(3,4,3050,'Detect',1),
+(3,4,3365,'Opening',1),
+(3,4,6233,'Closing',1),
+(3,4,6246,'Closing',1),
+(3,4,6247,'Opening',1),
+(3,4,6477,'Opening',1),
+(3,4,6478,'Opening',1),
+(3,4,6603,'Attack',1),
+(3,4,7266,'Duel',1),
+(3,4,7267,'Grovel',1),
+(3,4,7355,'Stuck',1),
+(3,4,8386,'Attacking',1),
+(3,4,9077,'Leather',1),
+(3,4,9078,'Cloth',1),
+(3,4,9125,'Generic',1),
+(3,4,16092,'Defensive State(DND)',1),
+(3,4,20594,'Stoneform',1),
+(3,4,20595,'Gun Specialization',1),
+(3,4,20596,'Frost Resistance',1),
+(3,4,21184,'Rogue Passive(DND)',1),
+(3,4,21651,'Opening',1),
+(3,4,21652,'Closing',1),
+(3,4,22027,'Remove Insignia',1),
+(3,4,22810,'Opening - No Text',1),
+(3,5,81,'Dodge',1),
+(3,5,198,'One-Handed Maces',1),
+(3,5,203,'Unarmed',1),
+(3,5,204,'Defense',1),
+(3,5,522,'SPELLDEFENSE(DND)',1),
+(3,5,585,'Smite',1),
+(3,5,668,'Language Common',1),
+(3,5,672,'Language Dwarven',1),
+(3,5,2050,'Lesser Heal',1),
+(3,5,2382,'Generic',1),
+(3,5,2479,'Honorless Target',1),
+(3,5,2481,'Find Treasure',1),
+(3,5,3050,'Detect',1),
+(3,5,3365,'Opening',1),
+(3,5,5009,'Wands',1),
+(3,5,5019,'Shoot',1),
+(3,5,6233,'Closing',1),
+(3,5,6246,'Closing',1),
+(3,5,6247,'Opening',1),
+(3,5,6477,'Opening',1),
+(3,5,6478,'Opening',1),
+(3,5,6603,'Attack',1),
+(3,5,7266,'Duel',1),
+(3,5,7267,'Grovel',1),
+(3,5,7355,'Stuck',1),
+(3,5,8386,'Attacking',1),
+(3,5,9078,'Cloth',1),
+(3,5,9125,'Generic',1),
+(3,5,20594,'Stoneform',1),
+(3,5,20595,'Gun Specialization',1),
+(3,5,20596,'Frost Resistance',1),
+(3,5,21651,'Opening',1),
+(3,5,21652,'Closing',1),
+(3,5,22027,'Remove Insignia',1),
+(3,5,22810,'Opening - No Text',1),
+(3,6,81,'Dodge',1),
+(3,6,196,'One-Handed Axes',1),
+(3,6,197,'Two-Handed Axes',1),
+(3,6,200,'Polearms',1),
+(3,6,201,'One-Handed Swords',1),
+(3,6,202,'Two-Handed Swords',1),
+(3,6,203,'Unarmed',1),
+(3,6,204,'Defense',1),
+(3,6,522,'SPELLDEFENSE (DND)',1),
+(3,6,668,'Language Common',1),
+(3,6,672,'Language Dwarven',1),
+(3,6,674,'Dual Wield',1),
+(3,6,750,'Plate Mail',1),
+(3,6,1843,'Disarm',1),
+(3,6,2382,'Generic',1),
+(3,6,2479,'Honorless Target',1),
+(3,6,2481,'Find Treasure',1),
+(3,6,3050,'Detect',1),
+(3,6,3127,'Parry',1),
+(3,6,3275,'Linen Bandage',1),
+(3,6,3276,'Heavy Linen Bandage',1),
+(3,6,3277,'Wool Bandage',1),
+(3,6,3278,'Heavy Wool Bandage',1),
+(3,6,3365,'Opening',1),
+(3,6,6233,'Closing',1),
+(3,6,6246,'Closing',1),
+(3,6,6247,'Opening',1),
+(3,6,6477,'Opening',1),
+(3,6,6478,'Opening',1),
+(3,6,6603,'Attack',1),
+(3,6,7266,'Duel',1),
+(3,6,7267,'Grovel',1),
+(3,6,7355,'Stuck',1),
+(3,6,7928,'Silk Bandage',1),
+(3,6,7929,'Heavy Silk Bandage',1),
+(3,6,7934,'Anti-Venom',1),
+(3,6,8386,'Attacking',1),
+(3,6,8737,'Mail',1),
+(3,6,9077,'Leather',1),
+(3,6,9078,'Cloth',1),
+(3,6,9125,'Generic',1),
+(3,6,10840,'Mageweave Bandage',1),
+(3,6,10841,'Heavy Mageweave Bandage',1),
+(3,6,10846,'First Aid',1),
+(3,6,18629,'Runecloth Bandage',1),
+(3,6,18630,'Heavy Runecloth Bandage',1),
+(3,6,20594,'Stoneform',1),
+(3,6,20595,'Gun Specialization',1),
+(3,6,20596,'Frost Resistance',1),
+(3,6,21651,'Opening',1),
+(3,6,21652,'Closing',1),
+(3,6,22027,'Remove Insignia',1),
+(3,6,22810,'Opening - No Text',1),
+(3,6,33391,'Journeyman Riding',1),
+(3,6,45462,'Plague Strike',1),
+(3,6,45477,'Icy Touch',1),
+(3,6,45902,'Blood Strike',1),
+(3,6,45903,'Offensive State (DND)',1),
+(3,6,45927,'Summon Friend',1),
+(3,6,47541,'Death Coil',1),
+(3,6,48266,'Blood Presence',1),
+(3,6,49410,'Forceful Deflection',1),
+(3,6,49576,'Death Grip',1),
+(3,6,52665,'Sigil',1),
+(3,6,59224,'Mace Specialization',1),
+(3,6,59879,'Blood Plague',1),
+(3,6,59921,'Frost Fever',1),
+(3,6,61437,'Opening',1),
+(3,6,61455,'Runic Focus',1),
+(4,1,78,'Heroic Strike',1),
+(4,1,81,'Dodge',1),
+(4,1,107,'Block',1),
+(4,1,198,'One-Handed Maces',1),
+(4,1,201,'One-Handed Swords',1),
+(4,1,203,'Unarmed',1),
+(4,1,204,'Defense',1),
+(4,1,522,'SPELLDEFENSE(DND)',1),
+(4,1,668,'Language Common',1),
+(4,1,671,'Language Darnassian',1),
+(4,1,1180,'Daggers',1),
+(4,1,2382,'Generic',1),
+(4,1,2457,'Battle Stance',1),
+(4,1,2479,'Honorless Target',1),
+(4,1,3050,'Detect',1),
+(4,1,3365,'Opening',1),
+(4,1,5301,'Defensive State(DND)',1),
+(4,1,6233,'Closing',1),
+(4,1,6246,'Closing',1),
+(4,1,6247,'Opening',1),
+(4,1,6477,'Opening',1),
+(4,1,6478,'Opening',1),
+(4,1,6603,'Attack',1),
+(4,1,7266,'Duel',1),
+(4,1,7267,'Grovel',1),
+(4,1,7355,'Stuck',1),
+(4,1,7376,'Defensive Stance Passive',0),
+(4,1,7381,'Berserker Stance Passive',0),
+(4,1,8386,'Attacking',1),
+(4,1,8737,'Mail',1),
+(4,1,9077,'Leather',1),
+(4,1,9078,'Cloth',1),
+(4,1,9116,'Shield',1),
+(4,1,9125,'Generic',1),
+(4,1,20580,'Shadowmeld',1),
+(4,1,20582,'Quickness',1),
+(4,1,20583,'Nature Resistance',1),
+(4,1,20585,'Wisp Spirit',1),
+(4,1,21009,'Shadowmeld Passive',1),
+(4,1,21156,'Battle Stance Passive',0),
+(4,1,21651,'Opening',1),
+(4,1,21652,'Closing',1),
+(4,1,22027,'Remove Insignia',1),
+(4,1,22810,'Opening - No Text',1),
+(4,1,32215,'Victorious State',1),
+(4,3,75,'Auto Shot',1),
+(4,3,81,'Dodge',1),
+(4,3,203,'Unarmed',1),
+(4,3,204,'Defense',1),
+(4,3,264,'Bows',1),
+(4,3,522,'SPELLDEFENSE(DND)',1),
+(4,3,668,'Language Common',1),
+(4,3,671,'Language Darnassian',1),
+(4,3,1180,'Daggers',1),
+(4,3,2382,'Generic',1),
+(4,3,2479,'Honorless Target',1),
+(4,3,2973,'Raptor Strike',1),
+(4,3,3050,'Detect',1),
+(4,3,3365,'Opening',1),
+(4,3,6233,'Closing',1),
+(4,3,6246,'Closing',1),
+(4,3,6247,'Opening',1),
+(4,3,6477,'Opening',1),
+(4,3,6478,'Opening',1),
+(4,3,6603,'Attack',1),
+(4,3,7266,'Duel',1),
+(4,3,7267,'Grovel',1),
+(4,3,7355,'Stuck',1),
+(4,3,8386,'Attacking',1),
+(4,3,9077,'Leather',1),
+(4,3,9078,'Cloth',1),
+(4,3,9125,'Generic',1),
+(4,3,13358,'Defensive State(DND)',1),
+(4,3,20580,'Shadowmeld',1),
+(4,3,20582,'Quickness',1),
+(4,3,20583,'Nature Resistance',1),
+(4,3,20585,'Wisp Spirit',1),
+(4,3,21009,'Shadowmeld Passive',1),
+(4,3,21651,'Opening',1),
+(4,3,21652,'Closing',1),
+(4,3,22027,'Remove Insignia',1),
+(4,3,22810,'Opening - No Text',1),
+(4,3,24949,'Defensive State 2(DND)',1),
+(4,3,34082,'Advantaged State(DND)',1),
+(4,4,81,'Dodge',1),
+(4,4,203,'Unarmed',1),
+(4,4,204,'Defense',1),
+(4,4,522,'SPELLDEFENSE(DND)',1),
+(4,4,668,'Language Common',1),
+(4,4,671,'Language Darnassian',1),
+(4,4,1180,'Daggers',1),
+(4,4,1752,'Sinister Strike',1),
+(4,4,2098,'Eviscerate',1),
+(4,4,2382,'Generic',1),
+(4,4,2479,'Honorless Target',1),
+(4,4,2567,'Thrown',1),
+(4,4,2764,'Throw',1),
+(4,4,3050,'Detect',1),
+(4,4,3365,'Opening',1),
+(4,4,6233,'Closing',1),
+(4,4,6246,'Closing',1),
+(4,4,6247,'Opening',1),
+(4,4,6477,'Opening',1),
+(4,4,6478,'Opening',1),
+(4,4,6603,'Attack',1),
+(4,4,7266,'Duel',1),
+(4,4,7267,'Grovel',1),
+(4,4,7355,'Stuck',1),
+(4,4,8386,'Attacking',1),
+(4,4,9077,'Leather',1),
+(4,4,9078,'Cloth',1),
+(4,4,9125,'Generic',1),
+(4,4,16092,'Defensive State(DND)',1),
+(4,4,20580,'Shadowmeld',1),
+(4,4,20582,'Quickness',1),
+(4,4,20583,'Nature Resistance',1),
+(4,4,20585,'Wisp Spirit',1),
+(4,4,21009,'Shadowmeld Passive',1),
+(4,4,21184,'Rogue Passive(DND)',1),
+(4,4,21651,'Opening',1),
+(4,4,21652,'Closing',1),
+(4,4,22027,'Remove Insignia',1),
+(4,4,22810,'Opening - No Text',1),
+(4,5,81,'Dodge',1),
+(4,5,198,'One-Handed Maces',1),
+(4,5,203,'Unarmed',1),
+(4,5,204,'Defense',1),
+(4,5,522,'SPELLDEFENSE(DND)',1),
+(4,5,585,'Smite',1),
+(4,5,668,'Language Common',1),
+(4,5,671,'Language Darnassian',1),
+(4,5,2050,'Lesser Heal',1),
+(4,5,2382,'Generic',1),
+(4,5,2479,'Honorless Target',1),
+(4,5,3050,'Detect',1),
+(4,5,3365,'Opening',1),
+(4,5,5009,'Wands',1),
+(4,5,5019,'Shoot',1),
+(4,5,6233,'Closing',1),
+(4,5,6246,'Closing',1),
+(4,5,6247,'Opening',1),
+(4,5,6477,'Opening',1),
+(4,5,6478,'Opening',1),
+(4,5,6603,'Attack',1),
+(4,5,7266,'Duel',1),
+(4,5,7267,'Grovel',1),
+(4,5,7355,'Stuck',1),
+(4,5,8386,'Attacking',1),
+(4,5,9078,'Cloth',1),
+(4,5,9125,'Generic',1),
+(4,5,20580,'Shadowmeld',1),
+(4,5,20582,'Quickness',1),
+(4,5,20583,'Nature Resistance',1),
+(4,5,20585,'Wisp Spirit',1),
+(4,5,21009,'Shadowmeld Passive',1),
+(4,5,21651,'Opening',1),
+(4,5,21652,'Closing',1),
+(4,5,22027,'Remove Insignia',1),
+(4,5,22810,'Opening - No Text',1),
+(4,6,81,'Dodge',1),
+(4,6,196,'One-Handed Axes',1),
+(4,6,197,'Two-Handed Axes',1),
+(4,6,200,'Polearms',1),
+(4,6,201,'One-Handed Swords',1),
+(4,6,202,'Two-Handed Swords',1),
+(4,6,203,'Unarmed',1),
+(4,6,204,'Defense',1),
+(4,6,522,'SPELLDEFENSE (DND)',1),
+(4,6,668,'Language Common',1),
+(4,6,671,'Language Darnassian',1),
+(4,6,674,'Dual Wield',1),
+(4,6,750,'Plate Mail',1),
+(4,6,1843,'Disarm',1),
+(4,6,2382,'Generic',1),
+(4,6,2479,'Honorless Target',1),
+(4,6,3050,'Detect',1),
+(4,6,3127,'Parry',1),
+(4,6,3275,'Linen Bandage',1),
+(4,6,3276,'Heavy Linen Bandage',1),
+(4,6,3277,'Wool Bandage',1),
+(4,6,3278,'Heavy Wool Bandage',1),
+(4,6,3365,'Opening',1),
+(4,6,6233,'Closing',1),
+(4,6,6246,'Closing',1),
+(4,6,6247,'Opening',1),
+(4,6,6477,'Opening',1),
+(4,6,6478,'Opening',1),
+(4,6,6603,'Attack',1),
+(4,6,7266,'Duel',1),
+(4,6,7267,'Grovel',1),
+(4,6,7355,'Stuck',1),
+(4,6,7928,'Silk Bandage',1),
+(4,6,7929,'Heavy Silk Bandage',1),
+(4,6,7934,'Anti-Venom',1),
+(4,6,8386,'Attacking',1),
+(4,6,8737,'Mail',1),
+(4,6,9077,'Leather',1),
+(4,6,9078,'Cloth',1),
+(4,6,9125,'Generic',1),
+(4,6,10840,'Mageweave Bandage',1),
+(4,6,10841,'Heavy Mageweave Bandage',1),
+(4,6,10846,'First Aid',1),
+(4,6,18629,'Runecloth Bandage',1),
+(4,6,18630,'Heavy Runecloth Bandage',1),
+(4,6,20582,'Quickness',1),
+(4,6,20583,'Nature Resistance',1),
+(4,6,20585,'Wisp Spirit',1),
+(4,6,21651,'Opening',1),
+(4,6,21652,'Closing',1),
+(4,6,22027,'Remove Insignia',1),
+(4,6,22810,'Opening - No Text',1),
+(4,6,33391,'Journeyman Riding',1),
+(4,6,45462,'Plague Strike',1),
+(4,6,45477,'Icy Touch',1),
+(4,6,45902,'Blood Strike',1),
+(4,6,45903,'Offensive State (DND)',1),
+(4,6,45927,'Summon Friend',1),
+(4,6,47541,'Death Coil',1),
+(4,6,48266,'Blood Presence',1),
+(4,6,49410,'Forceful Deflection',1),
+(4,6,49576,'Death Grip',1),
+(4,6,52665,'Sigil',1),
+(4,6,58984,'Shadowmeld',1),
+(4,6,59879,'Blood Plague',1),
+(4,6,59921,'Frost Fever',1),
+(4,6,61437,'Opening',1),
+(4,6,61455,'Runic Focus',1),
+(4,11,81,'Dodge',1),
+(4,11,203,'Unarmed',1),
+(4,11,204,'Defense',1),
+(4,11,227,'Staves',1),
+(4,11,522,'SPELLDEFENSE(DND)',1),
+(4,11,668,'Language Common',1),
+(4,11,671,'Language Darnassian',1),
+(4,11,1178,'Bear Form(Passive)',0),
+(4,11,1180,'Daggers',1),
+(4,11,2382,'Generic',1),
+(4,11,2479,'Honorless Target',1),
+(4,11,3025,'Cat Form(Passive)',0),
+(4,11,3050,'Detect',1),
+(4,11,3365,'Opening',1),
+(4,11,5176,'Wrath',1),
+(4,11,5185,'Healing Touch',1),
+(4,11,5419,'Travel Form(Passive)',0),
+(4,11,5420,'Tree of Life',0),
+(4,11,5421,'Aquatic Form(Passive)',0),
+(4,11,6233,'Closing',1),
+(4,11,6246,'Closing',1),
+(4,11,6247,'Opening',1),
+(4,11,6477,'Opening',1),
+(4,11,6478,'Opening',1),
+(4,11,6603,'Attack',1),
+(4,11,7266,'Duel',1),
+(4,11,7267,'Grovel',1),
+(4,11,7355,'Stuck',1),
+(4,11,8386,'Attacking',1),
+(4,11,9077,'Leather',1),
+(4,11,9078,'Cloth',1),
+(4,11,9125,'Generic',1),
+(4,11,9635,'Dire Bear Form(Passive)',0),
+(4,11,20580,'Shadowmeld',1),
+(4,11,20582,'Quickness',1),
+(4,11,20583,'Nature Resistance',1),
+(4,11,20585,'Wisp Spirit',1),
+(4,11,21009,'Shadowmeld Passive',1),
+(4,11,21178,'Bear Form(Passive2)',0),
+(4,11,21651,'Opening',1),
+(4,11,21652,'Closing',1),
+(4,11,22027,'Remove Insignia',1),
+(4,11,22810,'Opening - No Text',1),
+(4,11,24905,'Moonkin Form(Passive)',0),
+(4,11,27764,'Fetish',1),
+(4,11,33948,'Flight Form(Passive)',0),
+(4,11,34123,'Tree of Life(Passive)',0),
+(4,11,40121,'Swift Flight Form(Passive)',0),
+(5,1,78,'Heroic Strike',1),
+(5,1,81,'Dodge',1),
+(5,1,107,'Block',1),
+(5,1,201,'One-Handed Swords',1),
+(5,1,202,'Two-Handed Swords',1),
+(5,1,203,'Unarmed',1),
+(5,1,204,'Defense',1),
+(5,1,522,'SPELLDEFENSE(DND)',1),
+(5,1,669,'Language Orcish',1),
+(5,1,1180,'Daggers',1),
+(5,1,2382,'Generic',1),
+(5,1,2457,'Battle Stance',1),
+(5,1,2479,'Honorless Target',1),
+(5,1,3050,'Detect',1),
+(5,1,3365,'Opening',1),
+(5,1,5227,'Underwater Breathing',1),
+(5,1,5301,'Defensive State(DND)',1),
+(5,1,6233,'Closing',1),
+(5,1,6246,'Closing',1),
+(5,1,6247,'Opening',1),
+(5,1,6477,'Opening',1),
+(5,1,6478,'Opening',1),
+(5,1,6603,'Attack',1),
+(5,1,7266,'Duel',1),
+(5,1,7267,'Grovel',1),
+(5,1,7355,'Stuck',1),
+(5,1,7376,'Defensive Stance Passive',0),
+(5,1,7381,'Berserker Stance Passive',0),
+(5,1,7744,'Will of the Forsaken',1),
+(5,1,8386,'Attacking',1),
+(5,1,8737,'Mail',1),
+(5,1,9077,'Leather',1),
+(5,1,9078,'Cloth',1),
+(5,1,9116,'Shield',1),
+(5,1,9125,'Generic',1),
+(5,1,17737,'Language Gutterspeak',1),
+(5,1,20577,'Cannibalize',1),
+(5,1,20579,'Shadow Resistance',1),
+(5,1,21156,'Battle Stance Passive',0),
+(5,1,21651,'Opening',1),
+(5,1,21652,'Closing',1),
+(5,1,22027,'Remove Insignia',1),
+(5,1,22810,'Opening - No Text',1),
+(5,1,32215,'Victorious State',1),
+(5,4,81,'Dodge',1),
+(5,4,203,'Unarmed',1),
+(5,4,204,'Defense',1),
+(5,4,522,'SPELLDEFENSE(DND)',1),
+(5,4,669,'Language Orcish',1),
+(5,4,1180,'Daggers',1),
+(5,4,1752,'Sinister Strike',1),
+(5,4,2098,'Eviscerate',1),
+(5,4,2382,'Generic',1),
+(5,4,2479,'Honorless Target',1),
+(5,4,2567,'Thrown',1),
+(5,4,2764,'Throw',1),
+(5,4,3050,'Detect',1),
+(5,4,3365,'Opening',1),
+(5,4,5227,'Underwater Breathing',1),
+(5,4,6233,'Closing',1),
+(5,4,6246,'Closing',1),
+(5,4,6247,'Opening',1),
+(5,4,6477,'Opening',1),
+(5,4,6478,'Opening',1),
+(5,4,6603,'Attack',1),
+(5,4,7266,'Duel',1),
+(5,4,7267,'Grovel',1),
+(5,4,7355,'Stuck',1),
+(5,4,7744,'Will of the Forsaken',1),
+(5,4,8386,'Attacking',1),
+(5,4,9077,'Leather',1),
+(5,4,9078,'Cloth',1),
+(5,4,9125,'Generic',1),
+(5,4,16092,'Defensive State(DND)',1),
+(5,4,17737,'Language Gutterspeak',1),
+(5,4,20577,'Cannibalize',1),
+(5,4,20579,'Shadow Resistance',1),
+(5,4,21184,'Rogue Passive(DND)',1),
+(5,4,21651,'Opening',1),
+(5,4,21652,'Closing',1),
+(5,4,22027,'Remove Insignia',1),
+(5,4,22810,'Opening - No Text',1),
+(5,5,81,'Dodge',1),
+(5,5,198,'One-Handed Maces',1),
+(5,5,203,'Unarmed',1),
+(5,5,204,'Defense',1),
+(5,5,522,'SPELLDEFENSE(DND)',1),
+(5,5,585,'Smite',1),
+(5,5,669,'Language Orcish',1),
+(5,5,2050,'Lesser Heal',1),
+(5,5,2382,'Generic',1),
+(5,5,2479,'Honorless Target',1),
+(5,5,3050,'Detect',1),
+(5,5,3365,'Opening',1),
+(5,5,5009,'Wands',1),
+(5,5,5019,'Shoot',1),
+(5,5,5227,'Underwater Breathing',1),
+(5,5,6233,'Closing',1),
+(5,5,6246,'Closing',1),
+(5,5,6247,'Opening',1),
+(5,5,6477,'Opening',1),
+(5,5,6478,'Opening',1),
+(5,5,6603,'Attack',1),
+(5,5,7266,'Duel',1),
+(5,5,7267,'Grovel',1),
+(5,5,7355,'Stuck',1),
+(5,5,7744,'Will of the Forsaken',1),
+(5,5,8386,'Attacking',1),
+(5,5,9078,'Cloth',1),
+(5,5,9125,'Generic',1),
+(5,5,17737,'Language Gutterspeak',1),
+(5,5,20577,'Cannibalize',1),
+(5,5,20579,'Shadow Resistance',1),
+(5,5,21651,'Opening',1),
+(5,5,21652,'Closing',1),
+(5,5,22027,'Remove Insignia',1),
+(5,5,22810,'Opening - No Text',1),
+(5,6,81,'Dodge',1),
+(5,6,196,'One-Handed Axes',1),
+(5,6,197,'Two-Handed Axes',1),
+(5,6,200,'Polearms',1),
+(5,6,201,'One-Handed Swords',1),
+(5,6,202,'Two-Handed Swords',1),
+(5,6,203,'Unarmed',1),
+(5,6,204,'Defense',1),
+(5,6,522,'SPELLDEFENSE (DND)',1),
+(5,6,669,'Language Orcish',1),
+(5,6,674,'Dual Wield',1),
+(5,6,750,'Plate Mail',1),
+(5,6,1843,'Disarm',1),
+(5,6,2382,'Generic',1),
+(5,6,2479,'Honorless Target',1),
+(5,6,3050,'Detect',1),
+(5,6,3127,'Parry',1),
+(5,6,3275,'Linen Bandage',1),
+(5,6,3276,'Heavy Linen Bandage',1),
+(5,6,3277,'Wool Bandage',1),
+(5,6,3278,'Heavy Wool Bandage',1),
+(5,6,3365,'Opening',1),
+(5,6,5227,'Underwater Breathing',1),
+(5,6,6233,'Closing',1),
+(5,6,6246,'Closing',1),
+(5,6,6247,'Opening',1),
+(5,6,6477,'Opening',1),
+(5,6,6478,'Opening',1),
+(5,6,6603,'Attack',1),
+(5,6,7266,'Duel',1),
+(5,6,7267,'Grovel',1),
+(5,6,7355,'Stuck',1),
+(5,6,7744,'Will of the Forsaken',1),
+(5,6,7928,'Silk Bandage',1),
+(5,6,7929,'Heavy Silk Bandage',1),
+(5,6,7934,'Anti-Venom',1),
+(5,6,8386,'Attacking',1),
+(5,6,8737,'Mail',1),
+(5,6,9077,'Leather',1),
+(5,6,9078,'Cloth',1),
+(5,6,9125,'Generic',1),
+(5,6,10840,'Mageweave Bandage',1),
+(5,6,10841,'Heavy Mageweave Bandage',1),
+(5,6,10846,'First Aid',1),
+(5,6,17737,'Language Gutterspeak',1),
+(5,6,18629,'Runecloth Bandage',1),
+(5,6,18630,'Heavy Runecloth Bandage',1),
+(5,6,20577,'Cannibalize',1),
+(5,6,20579,'Shadow Resistance',1),
+(5,6,21651,'Opening',1),
+(5,6,21652,'Closing',1),
+(5,6,22027,'Remove Insignia',1),
+(5,6,22810,'Opening - No Text',1),
+(5,6,33391,'Journeyman Riding',1),
+(5,6,45462,'Plague Strike',1),
+(5,6,45477,'Icy Touch',1),
+(5,6,45902,'Blood Strike',1),
+(5,6,45903,'Offensive State (DND)',1),
+(5,6,45927,'Summon Friend',1),
+(5,6,47541,'Death Coil',1),
+(5,6,48266,'Blood Presence',1),
+(5,6,49410,'Forceful Deflection',1),
+(5,6,49576,'Death Grip',1),
+(5,6,52665,'Sigil',1),
+(5,6,59879,'Blood Plague',1),
+(5,6,59921,'Frost Fever',1),
+(5,6,61437,'Opening',1),
+(5,6,61455,'Runic Focus',1),
+(5,8,81,'Dodge',1),
+(5,8,133,'Fireball',1),
+(5,8,168,'Frost Armor',1),
+(5,8,203,'Unarmed',1),
+(5,8,204,'Defense',1),
+(5,8,227,'Staves',1),
+(5,8,522,'SPELLDEFENSE(DND)',1),
+(5,8,669,'Language Orcish',1),
+(5,8,2382,'Generic',1),
+(5,8,2479,'Honorless Target',1),
+(5,8,3050,'Detect',1),
+(5,8,3365,'Opening',1),
+(5,8,5009,'Wands',1),
+(5,8,5019,'Shoot',1),
+(5,8,5227,'Underwater Breathing',1),
+(5,8,6233,'Closing',1),
+(5,8,6246,'Closing',1),
+(5,8,6247,'Opening',1),
+(5,8,6477,'Opening',1),
+(5,8,6478,'Opening',1),
+(5,8,6603,'Attack',1),
+(5,8,7266,'Duel',1),
+(5,8,7267,'Grovel',1),
+(5,8,7355,'Stuck',1),
+(5,8,7744,'Will of the Forsaken',1),
+(5,8,8386,'Attacking',1),
+(5,8,9078,'Cloth',1),
+(5,8,9125,'Generic',1),
+(5,8,17737,'Language Gutterspeak',1),
+(5,8,20577,'Cannibalize',1),
+(5,8,20579,'Shadow Resistance',1),
+(5,8,21651,'Opening',1),
+(5,8,21652,'Closing',1),
+(5,8,22027,'Remove Insignia',1),
+(5,8,22810,'Opening - No Text',1),
+(5,9,81,'Dodge',1),
+(5,9,203,'Unarmed',1),
+(5,9,204,'Defense',1),
+(5,9,522,'SPELLDEFENSE(DND)',1),
+(5,9,669,'Language Orcish',1),
+(5,9,686,'Shadow Bolt',1),
+(5,9,687,'Demon Skin',1),
+(5,9,1180,'Daggers',1),
+(5,9,2382,'Generic',1),
+(5,9,2479,'Honorless Target',1),
+(5,9,3050,'Detect',1),
+(5,9,3365,'Opening',1),
+(5,9,5009,'Wands',1),
+(5,9,5019,'Shoot',1),
+(5,9,5227,'Underwater Breathing',1),
+(5,9,6233,'Closing',1),
+(5,9,6246,'Closing',1),
+(5,9,6247,'Opening',1),
+(5,9,6477,'Opening',1),
+(5,9,6478,'Opening',1),
+(5,9,6603,'Attack',1),
+(5,9,7266,'Duel',1),
+(5,9,7267,'Grovel',1),
+(5,9,7355,'Stuck',1),
+(5,9,7744,'Will of the Forsaken',1),
+(5,9,8386,'Attacking',1),
+(5,9,9078,'Cloth',1),
+(5,9,9125,'Generic',1),
+(5,9,17737,'Language Gutterspeak',1),
+(5,9,20577,'Cannibalize',1),
+(5,9,20579,'Shadow Resistance',1),
+(5,9,21651,'Opening',1),
+(5,9,21652,'Closing',1),
+(5,9,22027,'Remove Insignia',1),
+(5,9,22810,'Opening - No Text',1),
+(6,1,78,'Heroic Strike',1),
+(6,1,81,'Dodge',1),
+(6,1,107,'Block',1),
+(6,1,196,'One-Handed Axes',1),
+(6,1,198,'One-Handed Maces',1),
+(6,1,199,'Two-Handed Maces',1),
+(6,1,203,'Unarmed',1),
+(6,1,204,'Defense',1),
+(6,1,522,'SPELLDEFENSE(DND)',1),
+(6,1,669,'Language Orcish',1),
+(6,1,670,'Language Taurahe',1),
+(6,1,2382,'Generic',1),
+(6,1,2457,'Battle Stance',1),
+(6,1,2479,'Honorless Target',1),
+(6,1,3050,'Detect',1),
+(6,1,3365,'Opening',1),
+(6,1,5301,'Defensive State(DND)',1),
+(6,1,6233,'Closing',1),
+(6,1,6246,'Closing',1),
+(6,1,6247,'Opening',1),
+(6,1,6477,'Opening',1),
+(6,1,6478,'Opening',1),
+(6,1,6603,'Attack',1),
+(6,1,7266,'Duel',1),
+(6,1,7267,'Grovel',1),
+(6,1,7355,'Stuck',1),
+(6,1,7376,'Defensive Stance Passive',0),
+(6,1,7381,'Berserker Stance Passive',0),
+(6,1,8386,'Attacking',1),
+(6,1,8737,'Mail',1),
+(6,1,9077,'Leather',1),
+(6,1,9078,'Cloth',1),
+(6,1,9116,'Shield',1),
+(6,1,9125,'Generic',1),
+(6,1,20549,'War Stomp',1),
+(6,1,20550,'Endurance',1),
+(6,1,20551,'Nature Resistance',1),
+(6,1,20552,'Cultivation',1),
+(6,1,21156,'Battle Stance Passive',0),
+(6,1,21651,'Opening',1),
+(6,1,21652,'Closing',1),
+(6,1,22027,'Remove Insignia',1),
+(6,1,22810,'Opening - No Text',1),
+(6,1,32215,'Victorious State',1),
+(6,3,75,'Auto Shot',1),
+(6,3,81,'Dodge',1),
+(6,3,196,'One-Handed Axes',1),
+(6,3,203,'Unarmed',1),
+(6,3,204,'Defense',1),
+(6,3,266,'Guns',1),
+(6,3,522,'SPELLDEFENSE(DND)',1),
+(6,3,669,'Language Orcish',1),
+(6,3,670,'Language Taurahe',1),
+(6,3,2382,'Generic',1),
+(6,3,2479,'Honorless Target',1),
+(6,3,2973,'Raptor Strike',1),
+(6,3,3050,'Detect',1),
+(6,3,3365,'Opening',1),
+(6,3,6233,'Closing',1),
+(6,3,6246,'Closing',1),
+(6,3,6247,'Opening',1),
+(6,3,6477,'Opening',1),
+(6,3,6478,'Opening',1),
+(6,3,6603,'Attack',1),
+(6,3,7266,'Duel',1),
+(6,3,7267,'Grovel',1),
+(6,3,7355,'Stuck',1),
+(6,3,8386,'Attacking',1),
+(6,3,9077,'Leather',1),
+(6,3,9078,'Cloth',1),
+(6,3,9125,'Generic',1),
+(6,3,13358,'Defensive State(DND)',1),
+(6,3,20549,'War Stomp',1),
+(6,3,20550,'Endurance',1),
+(6,3,20551,'Nature Resistance',1),
+(6,3,20552,'Cultivation',1),
+(6,3,21651,'Opening',1),
+(6,3,21652,'Closing',1),
+(6,3,22027,'Remove Insignia',1),
+(6,3,22810,'Opening - No Text',1),
+(6,3,24949,'Defensive State 2(DND)',1),
+(6,3,34082,'Advantaged State(DND)',1),
+(6,6,81,'Dodge',1),
+(6,6,196,'One-Handed Axes',1),
+(6,6,197,'Two-Handed Axes',1),
+(6,6,200,'Polearms',1),
+(6,6,201,'One-Handed Swords',1),
+(6,6,202,'Two-Handed Swords',1),
+(6,6,203,'Unarmed',1),
+(6,6,204,'Defense',1),
+(6,6,522,'SPELLDEFENSE (DND)',1),
+(6,6,669,'Language Orcish',1),
+(6,6,670,'Language Taurahe',1),
+(6,6,674,'Dual Wield',1),
+(6,6,750,'Plate Mail',1),
+(6,6,1843,'Disarm',1),
+(6,6,2382,'Generic',1),
+(6,6,2479,'Honorless Target',1),
+(6,6,3050,'Detect',1),
+(6,6,3127,'Parry',1),
+(6,6,3275,'Linen Bandage',1),
+(6,6,3276,'Heavy Linen Bandage',1),
+(6,6,3277,'Wool Bandage',1),
+(6,6,3278,'Heavy Wool Bandage',1),
+(6,6,3365,'Opening',1),
+(6,6,6233,'Closing',1),
+(6,6,6246,'Closing',1),
+(6,6,6247,'Opening',1),
+(6,6,6477,'Opening',1),
+(6,6,6478,'Opening',1),
+(6,6,6603,'Attack',1),
+(6,6,7266,'Duel',1),
+(6,6,7267,'Grovel',1),
+(6,6,7355,'Stuck',1),
+(6,6,7928,'Silk Bandage',1),
+(6,6,7929,'Heavy Silk Bandage',1),
+(6,6,7934,'Anti-Venom',1),
+(6,6,8386,'Attacking',1),
+(6,6,8737,'Mail',1),
+(6,6,9077,'Leather',1),
+(6,6,9078,'Cloth',1),
+(6,6,9125,'Generic',1),
+(6,6,10840,'Mageweave Bandage',1),
+(6,6,10841,'Heavy Mageweave Bandage',1),
+(6,6,10846,'First Aid',1),
+(6,6,18629,'Runecloth Bandage',1),
+(6,6,18630,'Heavy Runecloth Bandage',1),
+(6,6,20549,'War Stomp',1),
+(6,6,20550,'Endurance',1),
+(6,6,20551,'Nature Resistance',1),
+(6,6,20552,'Cultivation',1),
+(6,6,21651,'Opening',1),
+(6,6,21652,'Closing',1),
+(6,6,22027,'Remove Insignia',1),
+(6,6,22810,'Opening - No Text',1),
+(6,6,33391,'Journeyman Riding',1),
+(6,6,45462,'Plague Strike',1),
+(6,6,45477,'Icy Touch',1),
+(6,6,45902,'Blood Strike',1),
+(6,6,45903,'Offensive State (DND)',1),
+(6,6,45927,'Summon Friend',1),
+(6,6,47541,'Death Coil',1),
+(6,6,48266,'Blood Presence',1),
+(6,6,49410,'Forceful Deflection',1),
+(6,6,49576,'Death Grip',1),
+(6,6,52665,'Sigil',1),
+(6,6,59879,'Blood Plague',1),
+(6,6,59921,'Frost Fever',1),
+(6,6,61437,'Opening',1),
+(6,6,61455,'Runic Focus',1),
+(6,7,81,'Dodge',1),
+(6,7,107,'Block',1),
+(6,7,198,'One-Handed Maces',1),
+(6,7,203,'Unarmed',1),
+(6,7,204,'Defense',1),
+(6,7,227,'Staves',1),
+(6,7,331,'Healing Wave',1),
+(6,7,403,'Lightning Bolt',1),
+(6,7,522,'SPELLDEFENSE(DND)',1),
+(6,7,669,'Language Orcish',1),
+(6,7,670,'Language Taurahe',1),
+(6,7,2382,'Generic',1),
+(6,7,2479,'Honorless Target',1),
+(6,7,3050,'Detect',1),
+(6,7,3365,'Opening',1),
+(6,7,6233,'Closing',1),
+(6,7,6246,'Closing',1),
+(6,7,6247,'Opening',1),
+(6,7,6477,'Opening',1),
+(6,7,6478,'Opening',1),
+(6,7,6603,'Attack',1),
+(6,7,7266,'Duel',1),
+(6,7,7267,'Grovel',1),
+(6,7,7355,'Stuck',1),
+(6,7,8386,'Attacking',1),
+(6,7,9077,'Leather',1),
+(6,7,9078,'Cloth',1),
+(6,7,9116,'Shield',1),
+(6,7,9125,'Generic',1),
+(6,7,20549,'War Stomp',1),
+(6,7,20550,'Endurance',1),
+(6,7,20551,'Nature Resistance',1),
+(6,7,20552,'Cultivation',1),
+(6,7,21651,'Opening',1),
+(6,7,21652,'Closing',1),
+(6,7,22027,'Remove Insignia',1),
+(6,7,22810,'Opening - No Text',1),
+(6,7,27763,'Totem',1),
+(6,11,81,'Dodge',1),
+(6,11,198,'One-Handed Maces',1),
+(6,11,203,'Unarmed',1),
+(6,11,204,'Defense',1),
+(6,11,227,'Staves',1),
+(6,11,522,'SPELLDEFENSE(DND)',1),
+(6,11,669,'Language Orcish',1),
+(6,11,670,'Language Taurahe',1),
+(6,11,1178,'Bear Form(Passive)',0),
+(6,11,2382,'Generic',1),
+(6,11,2479,'Honorless Target',1),
+(6,11,3025,'Cat Form(Passive)',0),
+(6,11,3050,'Detect',1),
+(6,11,3365,'Opening',1),
+(6,11,5176,'Wrath',1),
+(6,11,5185,'Healing Touch',1),
+(6,11,5419,'Travel Form(Passive)',0),
+(6,11,5420,'Tree of Life',0),
+(6,11,5421,'Aquatic Form(Passive)',0),
+(6,11,6233,'Closing',1),
+(6,11,6246,'Closing',1),
+(6,11,6247,'Opening',1),
+(6,11,6477,'Opening',1),
+(6,11,6478,'Opening',1),
+(6,11,6603,'Attack',1),
+(6,11,7266,'Duel',1),
+(6,11,7267,'Grovel',1),
+(6,11,7355,'Stuck',1),
+(6,11,8386,'Attacking',1),
+(6,11,9077,'Leather',1),
+(6,11,9078,'Cloth',1),
+(6,11,9125,'Generic',1),
+(6,11,9635,'Dire Bear Form(Passive)',0),
+(6,11,20549,'War Stomp',1),
+(6,11,20550,'Endurance',1),
+(6,11,20551,'Nature Resistance',1),
+(6,11,20552,'Cultivation',1),
+(6,11,21178,'Bear Form(Passive2)',0),
+(6,11,21651,'Opening',1),
+(6,11,21652,'Closing',1),
+(6,11,22027,'Remove Insignia',1),
+(6,11,22810,'Opening - No Text',1),
+(6,11,24905,'Moonkin Form(Passive)',0),
+(6,11,27764,'Fetish',1),
+(6,11,33948,'Flight Form(Passive)',0),
+(6,11,34123,'Tree of Life(Passive)',0),
+(6,11,40121,'Swift Flight Form(Passive)',0),
+(7,1,78,'Heroic Strike',1),
+(7,1,81,'Dodge',1),
+(7,1,107,'Block',1),
+(7,1,198,'One-Handed Maces',1),
+(7,1,201,'One-Handed Swords',1),
+(7,1,203,'Unarmed',1),
+(7,1,204,'Defense',1),
+(7,1,522,'SPELLDEFENSE(DND)',1),
+(7,1,668,'Language Common',1),
+(7,1,1180,'Daggers',1),
+(7,1,2382,'Generic',1),
+(7,1,2457,'Battle Stance',1),
+(7,1,2479,'Honorless Target',1),
+(7,1,3050,'Detect',1),
+(7,1,3365,'Opening',1),
+(7,1,5301,'Defensive State(DND)',1),
+(7,1,6233,'Closing',1),
+(7,1,6246,'Closing',1),
+(7,1,6247,'Opening',1),
+(7,1,6477,'Opening',1),
+(7,1,6478,'Opening',1),
+(7,1,6603,'Attack',1),
+(7,1,7266,'Duel',1),
+(7,1,7267,'Grovel',1),
+(7,1,7340,'Language Gnomish',1),
+(7,1,7355,'Stuck',1),
+(7,1,7376,'Defensive Stance Passive',0),
+(7,1,7381,'Berserker Stance Passive',0),
+(7,1,8386,'Attacking',1),
+(7,1,8737,'Mail',1),
+(7,1,9077,'Leather',1),
+(7,1,9078,'Cloth',1),
+(7,1,9116,'Shield',1),
+(7,1,9125,'Generic',1),
+(7,1,20589,'Escape Artist',1),
+(7,1,20591,'Expansive Mind',1),
+(7,1,20592,'Arcane Resistance',1),
+(7,1,20593,'Engineering Specialization',1),
+(7,1,21156,'Battle Stance Passive',0),
+(7,1,21651,'Opening',1),
+(7,1,21652,'Closing',1),
+(7,1,22027,'Remove Insignia',1),
+(7,1,22810,'Opening - No Text',1),
+(7,1,32215,'Victorious State',1),
+(7,4,81,'Dodge',1),
+(7,4,203,'Unarmed',1),
+(7,4,204,'Defense',1),
+(7,4,522,'SPELLDEFENSE(DND)',1),
+(7,4,668,'Language Common',1),
+(7,4,1180,'Daggers',1),
+(7,4,1752,'Sinister Strike',1),
+(7,4,2098,'Eviscerate',1),
+(7,4,2382,'Generic',1),
+(7,4,2479,'Honorless Target',1),
+(7,4,2567,'Thrown',1),
+(7,4,2764,'Throw',1),
+(7,4,3050,'Detect',1),
+(7,4,3365,'Opening',1),
+(7,4,6233,'Closing',1),
+(7,4,6246,'Closing',1),
+(7,4,6247,'Opening',1),
+(7,4,6477,'Opening',1),
+(7,4,6478,'Opening',1),
+(7,4,6603,'Attack',1),
+(7,4,7266,'Duel',1),
+(7,4,7267,'Grovel',1),
+(7,4,7340,'Language Gnomish',1),
+(7,4,7355,'Stuck',1),
+(7,4,8386,'Attacking',1),
+(7,4,9077,'Leather',1),
+(7,4,9078,'Cloth',1),
+(7,4,9125,'Generic',1),
+(7,4,16092,'Defensive State(DND)',1),
+(7,4,20589,'Escape Artist',1),
+(7,4,20591,'Expansive Mind',1),
+(7,4,20592,'Arcane Resistance',1),
+(7,4,20593,'Engineering Specialization',1),
+(7,4,21184,'Rogue Passive(DND)',1),
+(7,4,21651,'Opening',1),
+(7,4,21652,'Closing',1),
+(7,4,22027,'Remove Insignia',1),
+(7,4,22810,'Opening - No Text',1),
+(7,6,81,'Dodge',1),
+(7,6,196,'One-Handed Axes',1),
+(7,6,197,'Two-Handed Axes',1),
+(7,6,200,'Polearms',1),
+(7,6,201,'One-Handed Swords',1),
+(7,6,202,'Two-Handed Swords',1),
+(7,6,203,'Unarmed',1),
+(7,6,204,'Defense',1),
+(7,6,522,'SPELLDEFENSE (DND)',1),
+(7,6,668,'Language Common',1),
+(7,6,674,'Dual Wield',1),
+(7,6,750,'Plate Mail',1),
+(7,6,1843,'Disarm',1),
+(7,6,2382,'Generic',1),
+(7,6,2479,'Honorless Target',1),
+(7,6,3050,'Detect',1),
+(7,6,3127,'Parry',1),
+(7,6,3275,'Linen Bandage',1),
+(7,6,3276,'Heavy Linen Bandage',1),
+(7,6,3277,'Wool Bandage',1),
+(7,6,3278,'Heavy Wool Bandage',1),
+(7,6,3365,'Opening',1),
+(7,6,6233,'Closing',1),
+(7,6,6246,'Closing',1),
+(7,6,6247,'Opening',1),
+(7,6,6477,'Opening',1),
+(7,6,6478,'Opening',1),
+(7,6,6603,'Attack',1),
+(7,6,7266,'Duel',1),
+(7,6,7267,'Grovel',1),
+(7,6,7340,'Language Gnomish',1),
+(7,6,7355,'Stuck',1),
+(7,6,7928,'Silk Bandage',1),
+(7,6,7929,'Heavy Silk Bandage',1),
+(7,6,7934,'Anti-Venom',1),
+(7,6,8386,'Attacking',1),
+(7,6,8737,'Mail',1),
+(7,6,9077,'Leather',1),
+(7,6,9078,'Cloth',1),
+(7,6,9125,'Generic',1),
+(7,6,10840,'Mageweave Bandage',1),
+(7,6,10841,'Heavy Mageweave Bandage',1),
+(7,6,10846,'First Aid',1),
+(7,6,18629,'Runecloth Bandage',1),
+(7,6,18630,'Heavy Runecloth Bandage',1),
+(7,6,20589,'Escape Artist',1),
+(7,6,20591,'Expansive Mind',1),
+(7,6,20592,'Arcane Resistance',1),
+(7,6,20593,'Engineering Specialization',1),
+(7,6,21651,'Opening',1),
+(7,6,21652,'Closing',1),
+(7,6,22027,'Remove Insignia',1),
+(7,6,22810,'Opening - No Text',1),
+(7,6,33391,'Journeyman Riding',1),
+(7,6,45462,'Plague Strike',1),
+(7,6,45477,'Icy Touch',1),
+(7,6,45902,'Blood Strike',1),
+(7,6,45903,'Offensive State (DND)',1),
+(7,6,45927,'Summon Friend',1),
+(7,6,47541,'Death Coil',1),
+(7,6,48266,'Blood Presence',1),
+(7,6,49410,'Forceful Deflection',1),
+(7,6,49576,'Death Grip',1),
+(7,6,52665,'Sigil',1),
+(7,6,59879,'Blood Plague',1),
+(7,6,59921,'Frost Fever',1),
+(7,6,61437,'Opening',1),
+(7,6,61455,'Runic Focus',1),
+(7,8,81,'Dodge',1),
+(7,8,133,'Fireball',1),
+(7,8,168,'Frost Armor',1),
+(7,8,203,'Unarmed',1),
+(7,8,204,'Defense',1),
+(7,8,227,'Staves',1),
+(7,8,522,'SPELLDEFENSE(DND)',1),
+(7,8,668,'Language Common',1),
+(7,8,2382,'Generic',1),
+(7,8,2479,'Honorless Target',1),
+(7,8,3050,'Detect',1),
+(7,8,3365,'Opening',1),
+(7,8,5009,'Wands',1),
+(7,8,5019,'Shoot',1),
+(7,8,6233,'Closing',1),
+(7,8,6246,'Closing',1),
+(7,8,6247,'Opening',1),
+(7,8,6477,'Opening',1),
+(7,8,6478,'Opening',1),
+(7,8,6603,'Attack',1),
+(7,8,7266,'Duel',1),
+(7,8,7267,'Grovel',1),
+(7,8,7340,'Language Gnomish',1),
+(7,8,7355,'Stuck',1),
+(7,8,8386,'Attacking',1),
+(7,8,9078,'Cloth',1),
+(7,8,9125,'Generic',1),
+(7,8,20589,'Escape Artist',1),
+(7,8,20591,'Expansive Mind',1),
+(7,8,20592,'Arcane Resistance',1),
+(7,8,20593,'Engineering Specialization',1),
+(7,8,21651,'Opening',1),
+(7,8,21652,'Closing',1),
+(7,8,22027,'Remove Insignia',1),
+(7,8,22810,'Opening - No Text',1),
+(7,9,81,'Dodge',1),
+(7,9,203,'Unarmed',1),
+(7,9,204,'Defense',1),
+(7,9,522,'SPELLDEFENSE(DND)',1),
+(7,9,668,'Language Common',1),
+(7,9,686,'Shadow Bolt',1),
+(7,9,687,'Demon Skin',1),
+(7,9,1180,'Daggers',1),
+(7,9,2382,'Generic',1),
+(7,9,2479,'Honorless Target',1),
+(7,9,3050,'Detect',1),
+(7,9,3365,'Opening',1),
+(7,9,5009,'Wands',1),
+(7,9,5019,'Shoot',1),
+(7,9,6233,'Closing',1),
+(7,9,6246,'Closing',1),
+(7,9,6247,'Opening',1),
+(7,9,6477,'Opening',1),
+(7,9,6478,'Opening',1),
+(7,9,6603,'Attack',1),
+(7,9,7266,'Duel',1),
+(7,9,7267,'Grovel',1),
+(7,9,7340,'Language Gnomish',1),
+(7,9,7355,'Stuck',1),
+(7,9,8386,'Attacking',1),
+(7,9,9078,'Cloth',1),
+(7,9,9125,'Generic',1),
+(7,9,20589,'Escape Artist',1),
+(7,9,20591,'Expansive Mind',1),
+(7,9,20592,'Arcane Resistance',1),
+(7,9,20593,'Engineering Specialization',1),
+(7,9,21651,'Opening',1),
+(7,9,21652,'Closing',1),
+(7,9,22027,'Remove Insignia',1),
+(7,9,22810,'Opening - No Text',1),
+(8,1,78,'Heroic Strike',1),
+(8,1,81,'Dodge',1),
+(8,1,107,'Block',1),
+(8,1,196,'One-Handed Axes',1),
+(8,1,203,'Unarmed',1),
+(8,1,204,'Defense',1),
+(8,1,522,'SPELLDEFENSE(DND)',1),
+(8,1,669,'Language Orcish',1),
+(8,1,1180,'Daggers',1),
+(8,1,2382,'Generic',1),
+(8,1,2457,'Battle Stance',1),
+(8,1,2479,'Honorless Target',1),
+(8,1,2567,'Thrown',1),
+(8,1,2764,'Throw',1),
+(8,1,3050,'Detect',1),
+(8,1,3365,'Opening',1),
+(8,1,5301,'Defensive State(DND)',1),
+(8,1,6233,'Closing',1),
+(8,1,6246,'Closing',1),
+(8,1,6247,'Opening',1),
+(8,1,6477,'Opening',1),
+(8,1,6478,'Opening',1),
+(8,1,6603,'Attack',1),
+(8,1,7266,'Duel',1),
+(8,1,7267,'Grovel',1),
+(8,1,7341,'Language Troll',1),
+(8,1,7355,'Stuck',1),
+(8,1,7376,'Defensive Stance Passive',0),
+(8,1,7381,'Berserker Stance Passive',0),
+(8,1,8386,'Attacking',1),
+(8,1,8737,'Mail',1),
+(8,1,9077,'Leather',1),
+(8,1,9078,'Cloth',1),
+(8,1,9116,'Shield',1),
+(8,1,9125,'Generic',1),
+(8,1,20555,'Regeneration',1),
+(8,1,20557,'Beast Slaying',1),
+(8,1,20558,'Throwing Specialization',1),
+(8,1,21156,'Battle Stance Passive',0),
+(8,1,21651,'Opening',1),
+(8,1,21652,'Closing',1),
+(8,1,22027,'Remove Insignia',1),
+(8,1,22810,'Opening - No Text',1),
+(8,1,26290,'Bow Specialization',1),
+(8,1,26296,'Berserking',1),
+(8,1,32215,'Victorious State',1),
+(8,3,75,'Auto Shot',1),
+(8,3,81,'Dodge',1),
+(8,3,196,'One-Handed Axes',1),
+(8,3,203,'Unarmed',1),
+(8,3,204,'Defense',1),
+(8,3,264,'Bows',1),
+(8,3,522,'SPELLDEFENSE(DND)',1),
+(8,3,669,'Language Orcish',1),
+(8,3,2382,'Generic',1),
+(8,3,2479,'Honorless Target',1),
+(8,3,2973,'Raptor Strike',1),
+(8,3,3050,'Detect',1),
+(8,3,3365,'Opening',1),
+(8,3,6233,'Closing',1),
+(8,3,6246,'Closing',1),
+(8,3,6247,'Opening',1),
+(8,3,6477,'Opening',1),
+(8,3,6478,'Opening',1),
+(8,3,6603,'Attack',1),
+(8,3,7266,'Duel',1),
+(8,3,7267,'Grovel',1),
+(8,3,7341,'Language Troll',1),
+(8,3,7355,'Stuck',1),
+(8,3,8386,'Attacking',1),
+(8,3,9077,'Leather',1),
+(8,3,9078,'Cloth',1),
+(8,3,9125,'Generic',1),
+(8,3,13358,'Defensive State(DND)',1),
+(8,3,20554,'Berserking',1),
+(8,3,20555,'Regeneration',1),
+(8,3,20557,'Beast Slaying',1),
+(8,3,20558,'Throwing Specialization',1),
+(8,3,21651,'Opening',1),
+(8,3,21652,'Closing',1),
+(8,3,22027,'Remove Insignia',1),
+(8,3,22810,'Opening - No Text',1),
+(8,3,24949,'Defensive State 2(DND)',1),
+(8,3,26290,'Bow Specialization',1),
+(8,3,34082,'Advantaged State(DND)',1),
+(8,4,81,'Dodge',1),
+(8,4,203,'Unarmed',1),
+(8,4,204,'Defense',1),
+(8,4,522,'SPELLDEFENSE(DND)',1),
+(8,4,669,'Language Orcish',1),
+(8,4,1180,'Daggers',1),
+(8,4,1752,'Sinister Strike',1),
+(8,4,2098,'Eviscerate',1),
+(8,4,2382,'Generic',1),
+(8,4,2479,'Honorless Target',1),
+(8,4,2567,'Thrown',1),
+(8,4,2764,'Throw',1),
+(8,4,3050,'Detect',1),
+(8,4,3365,'Opening',1),
+(8,4,6233,'Closing',1),
+(8,4,6246,'Closing',1),
+(8,4,6247,'Opening',1),
+(8,4,6477,'Opening',1),
+(8,4,6478,'Opening',1),
+(8,4,6603,'Attack',1),
+(8,4,7266,'Duel',1),
+(8,4,7267,'Grovel',1),
+(8,4,7341,'Language Troll',1),
+(8,4,7355,'Stuck',1),
+(8,4,8386,'Attacking',1),
+(8,4,9077,'Leather',1),
+(8,4,9078,'Cloth',1),
+(8,4,9125,'Generic',1),
+(8,4,16092,'Defensive State(DND)',1),
+(8,4,20555,'Regeneration',1),
+(8,4,20557,'Beast Slaying',1),
+(8,4,20558,'Throwing Specialization',1),
+(8,4,21184,'Rogue Passive(DND)',1),
+(8,4,21651,'Opening',1),
+(8,4,21652,'Closing',1),
+(8,4,22027,'Remove Insignia',1),
+(8,4,22810,'Opening - No Text',1),
+(8,4,26290,'Bow Specialization',1),
+(8,4,26297,'Berserking',1),
+(8,5,81,'Dodge',1),
+(8,5,198,'One-Handed Maces',1),
+(8,5,203,'Unarmed',1),
+(8,5,204,'Defense',1),
+(8,5,522,'SPELLDEFENSE(DND)',1),
+(8,5,585,'Smite',1),
+(8,5,669,'Language Orcish',1),
+(8,5,2050,'Lesser Heal',1),
+(8,5,2382,'Generic',1),
+(8,5,2479,'Honorless Target',1),
+(8,5,3050,'Detect',1),
+(8,5,3365,'Opening',1),
+(8,5,5009,'Wands',1),
+(8,5,5019,'Shoot',1),
+(8,5,6233,'Closing',1),
+(8,5,6246,'Closing',1),
+(8,5,6247,'Opening',1),
+(8,5,6477,'Opening',1),
+(8,5,6478,'Opening',1),
+(8,5,6603,'Attack',1),
+(8,5,7266,'Duel',1),
+(8,5,7267,'Grovel',1),
+(8,5,7341,'Language Troll',1),
+(8,5,7355,'Stuck',1),
+(8,5,8386,'Attacking',1),
+(8,5,9078,'Cloth',1),
+(8,5,9125,'Generic',1),
+(8,5,20554,'Berserking',1),
+(8,5,20555,'Regeneration',1),
+(8,5,20557,'Beast Slaying',1),
+(8,5,20558,'Throwing Specialization',1),
+(8,5,21651,'Opening',1),
+(8,5,21652,'Closing',1),
+(8,5,22027,'Remove Insignia',1),
+(8,5,22810,'Opening - No Text',1),
+(8,5,26290,'Bow Specialization',1),
+(8,6,81,'Dodge',1),
+(8,6,196,'One-Handed Axes',1),
+(8,6,197,'Two-Handed Axes',1),
+(8,6,200,'Polearms',1),
+(8,6,201,'One-Handed Swords',1),
+(8,6,202,'Two-Handed Swords',1),
+(8,6,203,'Unarmed',1),
+(8,6,204,'Defense',1),
+(8,6,522,'SPELLDEFENSE (DND)',1),
+(8,6,669,'Language Orcish',1),
+(8,6,674,'Dual Wield',1),
+(8,6,750,'Plate Mail',1),
+(8,6,1843,'Disarm',1),
+(8,6,2382,'Generic',1),
+(8,6,2479,'Honorless Target',1),
+(8,6,3050,'Detect',1),
+(8,6,3127,'Parry',1),
+(8,6,3275,'Linen Bandage',1),
+(8,6,3276,'Heavy Linen Bandage',1),
+(8,6,3277,'Wool Bandage',1),
+(8,6,3278,'Heavy Wool Bandage',1),
+(8,6,3365,'Opening',1),
+(8,6,6233,'Closing',1),
+(8,6,6246,'Closing',1),
+(8,6,6247,'Opening',1),
+(8,6,6477,'Opening',1),
+(8,6,6478,'Opening',1),
+(8,6,6603,'Attack',1),
+(8,6,7266,'Duel',1),
+(8,6,7267,'Grovel',1),
+(8,6,7341,'Language Troll',1),
+(8,6,7355,'Stuck',1),
+(8,6,7928,'Silk Bandage',1),
+(8,6,7929,'Heavy Silk Bandage',1),
+(8,6,7934,'Anti-Venom',1),
+(8,6,8386,'Attacking',1),
+(8,6,8737,'Mail',1),
+(8,6,9077,'Leather',1),
+(8,6,9078,'Cloth',1),
+(8,6,9125,'Generic',1),
+(8,6,10840,'Mageweave Bandage',1),
+(8,6,10841,'Heavy Mageweave Bandage',1),
+(8,6,10846,'First Aid',1),
+(8,6,18629,'Runecloth Bandage',1),
+(8,6,18630,'Heavy Runecloth Bandage',1),
+(8,6,20555,'Regeneration',1),
+(8,6,20557,'Beast Slaying',1),
+(8,6,20558,'Throwing Specialization',1),
+(8,6,21651,'Opening',1),
+(8,6,21652,'Closing',1),
+(8,6,22027,'Remove Insignia',1),
+(8,6,22810,'Opening - No Text',1),
+(8,6,26290,'Bow Specialization',1),
+(8,6,33391,'Journeyman Riding',1),
+(8,6,45462,'Plague Strike',1),
+(8,6,45477,'Icy Touch',1),
+(8,6,45902,'Blood Strike',1),
+(8,6,45903,'Offensive State (DND)',1),
+(8,6,45927,'Summon Friend',1),
+(8,6,47541,'Death Coil',1),
+(8,6,48266,'Blood Presence',1),
+(8,6,49410,'Forceful Deflection',1),
+(8,6,49576,'Death Grip',1),
+(8,6,50621,'Berserking',1),
+(8,6,52665,'Sigil',1),
+(8,6,58943,'Da Voodoo Shuffle',1),
+(8,6,59879,'Blood Plague',1),
+(8,6,59921,'Frost Fever',1),
+(8,6,61437,'Opening',1),
+(8,6,61455,'Runic Focus',1),
+(8,7,81,'Dodge',1),
+(8,7,107,'Block',1),
+(8,7,198,'One-Handed Maces',1),
+(8,7,203,'Unarmed',1),
+(8,7,204,'Defense',1),
+(8,7,227,'Staves',1),
+(8,7,331,'Healing Wave',1),
+(8,7,403,'Lightning Bolt',1),
+(8,7,522,'SPELLDEFENSE(DND)',1),
+(8,7,669,'Language Orcish',1),
+(8,7,2382,'Generic',1),
+(8,7,2479,'Honorless Target',1),
+(8,7,3050,'Detect',1),
+(8,7,3365,'Opening',1),
+(8,7,6233,'Closing',1),
+(8,7,6246,'Closing',1),
+(8,7,6247,'Opening',1),
+(8,7,6477,'Opening',1),
+(8,7,6478,'Opening',1),
+(8,7,6603,'Attack',1),
+(8,7,7266,'Duel',1),
+(8,7,7267,'Grovel',1),
+(8,7,7341,'Language Troll',1),
+(8,7,7355,'Stuck',1),
+(8,7,8386,'Attacking',1),
+(8,7,9077,'Leather',1),
+(8,7,9078,'Cloth',1),
+(8,7,9116,'Shield',1),
+(8,7,9125,'Generic',1),
+(8,7,20554,'Berserking',1),
+(8,7,20555,'Regeneration',1),
+(8,7,20557,'Beast Slaying',1),
+(8,7,20558,'Throwing Specialization',1),
+(8,7,21651,'Opening',1),
+(8,7,21652,'Closing',1),
+(8,7,22027,'Remove Insignia',1),
+(8,7,22810,'Opening - No Text',1),
+(8,7,26290,'Bow Specialization',1),
+(8,7,27763,'Totem',1),
+(8,8,81,'Dodge',1),
+(8,8,133,'Fireball',1),
+(8,8,168,'Frost Armor',1),
+(8,8,203,'Unarmed',1),
+(8,8,204,'Defense',1),
+(8,8,227,'Staves',1),
+(8,8,522,'SPELLDEFENSE(DND)',1),
+(8,8,669,'Language Orcish',1),
+(8,8,2382,'Generic',1),
+(8,8,2479,'Honorless Target',1),
+(8,8,3050,'Detect',1),
+(8,8,3365,'Opening',1),
+(8,8,5009,'Wands',1),
+(8,8,5019,'Shoot',1),
+(8,8,6233,'Closing',1),
+(8,8,6246,'Closing',1),
+(8,8,6247,'Opening',1),
+(8,8,6477,'Opening',1),
+(8,8,6478,'Opening',1),
+(8,8,6603,'Attack',1),
+(8,8,7266,'Duel',1),
+(8,8,7267,'Grovel',1),
+(8,8,7341,'Language Troll',1),
+(8,8,7355,'Stuck',1),
+(8,8,8386,'Attacking',1),
+(8,8,9078,'Cloth',1),
+(8,8,9125,'Generic',1),
+(8,8,20554,'Berserking',1),
+(8,8,20555,'Regeneration',1),
+(8,8,20557,'Beast Slaying',1),
+(8,8,20558,'Throwing Specialization',1),
+(8,8,21651,'Opening',1),
+(8,8,21652,'Closing',1),
+(8,8,22027,'Remove Insignia',1),
+(8,8,22810,'Opening - No Text',1),
+(8,8,26290,'Bow Specialization',1),
+(10,2,81,'Dodge',1),
+(10,2,107,'Block',1),
+(10,2,201,'One-Handed Swords',1),
+(10,2,202,'Two-Handed Swords',1),
+(10,2,203,'Unarmed',1),
+(10,2,204,'Defense',1),
+(10,2,522,'SPELLDEFENSE(DND)',1),
+(10,2,635,'Holy Light',1),
+(10,2,669,'Language Orcish',1),
+(10,2,813,'Language Thalassian',1),
+(10,2,822,'Magic Resistance',1),
+(10,2,2382,'Generic',1),
+(10,2,2479,'Honorless Target',1),
+(10,2,3050,'Detect',1),
+(10,2,3365,'Opening',1),
+(10,2,6233,'Closing',1),
+(10,2,6246,'Closing',1),
+(10,2,6247,'Opening',1),
+(10,2,6477,'Opening',1),
+(10,2,6478,'Opening',1),
+(10,2,6603,'Attack',1),
+(10,2,7266,'Duel',1),
+(10,2,7267,'Grovel',1),
+(10,2,7355,'Stuck',1),
+(10,2,8386,'Attacking',1),
+(10,2,8737,'Mail',1),
+(10,2,9077,'Leather',1),
+(10,2,9078,'Cloth',1),
+(10,2,9116,'Shield',1),
+(10,2,9125,'Generic',1),
+(10,2,21084,'Seal of Righteousness',1),
+(10,2,21651,'Opening',1),
+(10,2,21652,'Closing',1),
+(10,2,22027,'Remove Insignia',1),
+(10,2,22810,'Opening - No Text',1),
+(10,2,27762,'Libram',1),
+(10,2,28730,'Arcane Torrent',1),
+(10,2,28734,'Mana Tap',1),
+(10,2,28877,'Arcane Affinity',1),
+(10,3,75,'Auto Shot',1),
+(10,3,81,'Dodge',1),
+(10,3,203,'Unarmed',1),
+(10,3,204,'Defense',1),
+(10,3,264,'Bows',1),
+(10,3,522,'SPELLDEFENSE(DND)',1),
+(10,3,669,'Language Orcish',1),
+(10,3,813,'Language Thalassian',1),
+(10,3,822,'Magic Resistance',1),
+(10,3,1180,'Daggers',1),
+(10,3,2382,'Generic',1),
+(10,3,2479,'Honorless Target',1),
+(10,3,2973,'Raptor Strike',1),
+(10,3,3050,'Detect',1),
+(10,3,3365,'Opening',1),
+(10,3,6233,'Closing',1),
+(10,3,6246,'Closing',1),
+(10,3,6247,'Opening',1),
+(10,3,6477,'Opening',1),
+(10,3,6478,'Opening',1),
+(10,3,6603,'Attack',1),
+(10,3,7266,'Duel',1),
+(10,3,7267,'Grovel',1),
+(10,3,7355,'Stuck',1),
+(10,3,8386,'Attacking',1),
+(10,3,9077,'Leather',1),
+(10,3,9078,'Cloth',1),
+(10,3,9125,'Generic',1),
+(10,3,13358,'Defensive State(DND)',1),
+(10,3,21651,'Opening',1),
+(10,3,21652,'Closing',1),
+(10,3,22027,'Remove Insignia',1),
+(10,3,22810,'Opening - No Text',1),
+(10,3,24949,'Defensive State 2(DND)',1),
+(10,3,28730,'Arcane Torrent',1),
+(10,3,28734,'Mana Tap',1),
+(10,3,28877,'Arcane Affinity',1),
+(10,3,34082,'Advantaged State(DND)',1),
+(10,4,81,'Dodge',1),
+(10,4,203,'Unarmed',1),
+(10,4,204,'Defense',1),
+(10,4,522,'SPELLDEFENSE(DND)',1),
+(10,4,669,'Language Orcish',1),
+(10,4,813,'Language Thalassian',1),
+(10,4,822,'Magic Resistance',1),
+(10,4,1180,'Daggers',1),
+(10,4,1752,'Sinister Strike',1),
+(10,4,2098,'Eviscerate',1),
+(10,4,2382,'Generic',1),
+(10,4,2479,'Honorless Target',1),
+(10,4,2567,'Thrown',1),
+(10,4,2764,'Throw',1),
+(10,4,3050,'Detect',1),
+(10,4,3365,'Opening',1),
+(10,4,6233,'Closing',1),
+(10,4,6246,'Closing',1),
+(10,4,6247,'Opening',1),
+(10,4,6477,'Opening',1),
+(10,4,6478,'Opening',1),
+(10,4,6603,'Attack',1),
+(10,4,7266,'Duel',1),
+(10,4,7267,'Grovel',1),
+(10,4,7355,'Stuck',1),
+(10,4,8386,'Attacking',1),
+(10,4,9077,'Leather',1),
+(10,4,9078,'Cloth',1),
+(10,4,9125,'Generic',1),
+(10,4,16092,'Defensive State(DND)',1),
+(10,4,21184,'Rogue Passive(DND)',1),
+(10,4,21651,'Opening',1),
+(10,4,21652,'Closing',1),
+(10,4,22027,'Remove Insignia',1),
+(10,4,22810,'Opening - No Text',1),
+(10,4,25046,'Arcane Torrent',1),
+(10,4,28734,'Mana Tap',1),
+(10,4,28877,'Arcane Affinity',1),
+(10,5,81,'Dodge',1),
+(10,5,198,'One-Handed Maces',1),
+(10,5,203,'Unarmed',1),
+(10,5,204,'Defense',1),
+(10,5,522,'SPELLDEFENSE(DND)',1),
+(10,5,585,'Smite',1),
+(10,5,669,'Language Orcish',1),
+(10,5,813,'Language Thalassian',1),
+(10,5,822,'Magic Resistance',1),
+(10,5,2050,'Lesser Heal',1),
+(10,5,2382,'Generic',1),
+(10,5,2479,'Honorless Target',1),
+(10,5,3050,'Detect',1),
+(10,5,3365,'Opening',1),
+(10,5,5009,'Wands',1),
+(10,5,5019,'Shoot',1),
+(10,5,6233,'Closing',1),
+(10,5,6246,'Closing',1),
+(10,5,6247,'Opening',1),
+(10,5,6477,'Opening',1),
+(10,5,6478,'Opening',1),
+(10,5,6603,'Attack',1),
+(10,5,7266,'Duel',1),
+(10,5,7267,'Grovel',1),
+(10,5,7355,'Stuck',1),
+(10,5,8386,'Attacking',1),
+(10,5,9078,'Cloth',1),
+(10,5,9125,'Generic',1),
+(10,5,21651,'Opening',1),
+(10,5,21652,'Closing',1),
+(10,5,22027,'Remove Insignia',1),
+(10,5,22810,'Opening - No Text',1),
+(10,5,28730,'Arcane Torrent',1),
+(10,5,28734,'Mana Tap',1),
+(10,5,28877,'Arcane Affinity',1),
+(10,6,81,'Dodge',1),
+(10,6,196,'One-Handed Axes',1),
+(10,6,197,'Two-Handed Axes',1),
+(10,6,200,'Polearms',1),
+(10,6,201,'One-Handed Swords',1),
+(10,6,202,'Two-Handed Swords',1),
+(10,6,203,'Unarmed',1),
+(10,6,204,'Defense',1),
+(10,6,522,'SPELLDEFENSE (DND)',1),
+(10,6,669,'Language Orcish',1),
+(10,6,674,'Dual Wield',1),
+(10,6,750,'Plate Mail',1),
+(10,6,813,'Language Thalassian',1),
+(10,6,822,'Magic Resistance',1),
+(10,6,1843,'Disarm',1),
+(10,6,2382,'Generic',1),
+(10,6,2479,'Honorless Target',1),
+(10,6,3050,'Detect',1),
+(10,6,3127,'Parry',1),
+(10,6,3275,'Linen Bandage',1),
+(10,6,3276,'Heavy Linen Bandage',1),
+(10,6,3277,'Wool Bandage',1),
+(10,6,3278,'Heavy Wool Bandage',1),
+(10,6,3365,'Opening',1),
+(10,6,6233,'Closing',1),
+(10,6,6246,'Closing',1),
+(10,6,6247,'Opening',1),
+(10,6,6477,'Opening',1),
+(10,6,6478,'Opening',1),
+(10,6,6603,'Attack',1),
+(10,6,7266,'Duel',1),
+(10,6,7267,'Grovel',1),
+(10,6,7355,'Stuck',1),
+(10,6,7928,'Silk Bandage',1),
+(10,6,7929,'Heavy Silk Bandage',1),
+(10,6,7934,'Anti-Venom',1),
+(10,6,8386,'Attacking',1),
+(10,6,8737,'Mail',1),
+(10,6,9077,'Leather',1),
+(10,6,9078,'Cloth',1),
+(10,6,9125,'Generic',1),
+(10,6,10840,'Mageweave Bandage',1),
+(10,6,10841,'Heavy Mageweave Bandage',1),
+(10,6,10846,'First Aid',1),
+(10,6,18629,'Runecloth Bandage',1),
+(10,6,18630,'Heavy Runecloth Bandage',1),
+(10,6,21651,'Opening',1),
+(10,6,21652,'Closing',1),
+(10,6,22027,'Remove Insignia',1),
+(10,6,22810,'Opening - No Text',1),
+(10,6,28877,'Arcane Affinity',1),
+(10,6,33391,'Journeyman Riding',1),
+(10,6,45462,'Plague Strike',1),
+(10,6,45477,'Icy Touch',1),
+(10,6,45902,'Blood Strike',1),
+(10,6,45903,'Offensive State (DND)',1),
+(10,6,45927,'Summon Friend',1),
+(10,6,47541,'Death Coil',1),
+(10,6,48266,'Blood Presence',1),
+(10,6,49410,'Forceful Deflection',1),
+(10,6,49576,'Death Grip',1),
+(10,6,50613,'Arcane Torrent',1),
+(10,6,52665,'Sigil',1),
+(10,6,59879,'Blood Plague',1),
+(10,6,59921,'Frost Fever',1),
+(10,6,61437,'Opening',1),
+(10,6,61455,'Runic Focus',1),
+(10,8,81,'Dodge',1),
+(10,8,133,'Fireball',1),
+(10,8,168,'Frost Armor',1),
+(10,8,203,'Unarmed',1),
+(10,8,204,'Defense',1),
+(10,8,227,'Staves',1),
+(10,8,522,'SPELLDEFENSE(DND)',1),
+(10,8,669,'Language Orcish',1),
+(10,8,813,'Language Thalassian',1),
+(10,8,822,'Magic Resistance',1),
+(10,8,2382,'Generic',1),
+(10,8,2479,'Honorless Target',1),
+(10,8,3050,'Detect',1),
+(10,8,3365,'Opening',1),
+(10,8,5009,'Wands',1),
+(10,8,5019,'Shoot',1),
+(10,8,6233,'Closing',1),
+(10,8,6246,'Closing',1),
+(10,8,6247,'Opening',1),
+(10,8,6477,'Opening',1),
+(10,8,6478,'Opening',1),
+(10,8,6603,'Attack',1),
+(10,8,7266,'Duel',1),
+(10,8,7267,'Grovel',1),
+(10,8,7355,'Stuck',1),
+(10,8,8386,'Attacking',1),
+(10,8,9078,'Cloth',1),
+(10,8,9125,'Generic',1),
+(10,8,21651,'Opening',1),
+(10,8,21652,'Closing',1),
+(10,8,22027,'Remove Insignia',1),
+(10,8,22810,'Opening - No Text',1),
+(10,8,28730,'Arcane Torrent',1),
+(10,8,28734,'Mana Tap',1),
+(10,8,28877,'Arcane Affinity',1),
+(10,9,81,'Dodge',1),
+(10,9,203,'Unarmed',1),
+(10,9,204,'Defense',1),
+(10,9,522,'SPELLDEFENSE(DND)',1),
+(10,9,669,'Language Orcish',1),
+(10,9,686,'Shadow Bolt',1),
+(10,9,687,'Demon Skin',1),
+(10,9,813,'Language Thalassian',1),
+(10,9,822,'Magic Resistance',1),
+(10,9,1180,'Daggers',1),
+(10,9,2382,'Generic',1),
+(10,9,2479,'Honorless Target',1),
+(10,9,3050,'Detect',1),
+(10,9,3365,'Opening',1),
+(10,9,5009,'Wands',1),
+(10,9,5019,'Shoot',1),
+(10,9,6233,'Closing',1),
+(10,9,6246,'Closing',1),
+(10,9,6247,'Opening',1),
+(10,9,6477,'Opening',1),
+(10,9,6478,'Opening',1),
+(10,9,6603,'Attack',1),
+(10,9,7266,'Duel',1),
+(10,9,7267,'Grovel',1),
+(10,9,7355,'Stuck',1),
+(10,9,8386,'Attacking',1),
+(10,9,9078,'Cloth',1),
+(10,9,9125,'Generic',1),
+(10,9,21651,'Opening',1),
+(10,9,21652,'Closing',1),
+(10,9,22027,'Remove Insignia',1),
+(10,9,22810,'Opening - No Text',1),
+(10,9,28730,'Arcane Torrent',1),
+(10,9,28734,'Mana Tap',1),
+(10,9,28877,'Arcane Affinity',1),
+(11,1,78,'Heroic Strike',1),
+(11,1,81,'Dodge',1),
+(11,1,107,'Block',1),
+(11,1,198,'One-Handed Maces',1),
+(11,1,201,'One-Handed Swords',1),
+(11,1,202,'Two-Handed Swords',1),
+(11,1,203,'Unarmed',1),
+(11,1,204,'Defense',1),
+(11,1,522,'SPELLDEFENSE(DND)',1),
+(11,1,668,'Language Common',1),
+(11,1,2382,'Generic',1),
+(11,1,2457,'Battle Stance',1),
+(11,1,2479,'Honorless Target',1),
+(11,1,3050,'Detect',1),
+(11,1,3365,'Opening',1),
+(11,1,5301,'Defensive State(DND)',1),
+(11,1,6233,'Closing',1),
+(11,1,6246,'Closing',1),
+(11,1,6247,'Opening',1),
+(11,1,6477,'Opening',1),
+(11,1,6478,'Opening',1),
+(11,1,6562,'Heroic Presence',1),
+(11,1,6603,'Attack',1),
+(11,1,7266,'Duel',1),
+(11,1,7267,'Grovel',1),
+(11,1,7355,'Stuck',1),
+(11,1,7376,'Defensive Stance Passive',0),
+(11,1,7381,'Berserker Stance Passive',0),
+(11,1,8386,'Attacking',1),
+(11,1,8737,'Mail',1),
+(11,1,9077,'Leather',1),
+(11,1,9078,'Cloth',1),
+(11,1,9116,'Shield',1),
+(11,1,9125,'Generic',1),
+(11,1,20579,'Shadow Resistance',1),
+(11,1,21156,'Battle Stance Passive',0),
+(11,1,21651,'Opening',1),
+(11,1,21652,'Closing',1),
+(11,1,22027,'Remove Insignia',1),
+(11,1,22810,'Opening - No Text',1),
+(11,1,28875,'Gemcutting',1),
+(11,1,28880,'Gift of the Naaru',1),
+(11,1,29932,'Language Draenei',1),
+(11,1,32215,'Victorious State',1),
+(11,2,81,'Dodge',1),
+(11,2,107,'Block',1),
+(11,2,198,'One-Handed Maces',1),
+(11,2,199,'Two-Handed Maces',1),
+(11,2,203,'Unarmed',1),
+(11,2,204,'Defense',1),
+(11,2,522,'SPELLDEFENSE(DND)',1),
+(11,2,635,'Holy Light',1),
+(11,2,668,'Language Common',1),
+(11,2,2382,'Generic',1),
+(11,2,2479,'Honorless Target',1),
+(11,2,3050,'Detect',1),
+(11,2,3365,'Opening',1),
+(11,2,6233,'Closing',1),
+(11,2,6246,'Closing',1),
+(11,2,6247,'Opening',1),
+(11,2,6477,'Opening',1),
+(11,2,6478,'Opening',1),
+(11,2,6562,'Heroic Presence',1),
+(11,2,6603,'Attack',1),
+(11,2,7266,'Duel',1),
+(11,2,7267,'Grovel',1),
+(11,2,7355,'Stuck',1),
+(11,2,8386,'Attacking',1),
+(11,2,8737,'Mail',1),
+(11,2,9077,'Leather',1),
+(11,2,9078,'Cloth',1),
+(11,2,9116,'Shield',1),
+(11,2,9125,'Generic',1),
+(11,2,21084,'Seal of Righteousness',1),
+(11,2,20579,'Shadow Resistance',1),
+(11,2,21651,'Opening',1),
+(11,2,21652,'Closing',1),
+(11,2,22027,'Remove Insignia',1),
+(11,2,22810,'Opening - No Text',1),
+(11,2,27762,'Libram',1),
+(11,2,28875,'Gemcutting',1),
+(11,2,28880,'Gift of the Naaru',1),
+(11,2,29932,'Language Draenei',1),
+(11,3,75,'Auto Shot',1),
+(11,3,81,'Dodge',1),
+(11,3,201,'One-Handed Swords',1),
+(11,3,203,'Unarmed',1),
+(11,3,204,'Defense',1),
+(11,3,522,'SPELLDEFENSE(DND)',1),
+(11,3,668,'Language Common',1),
+(11,3,2382,'Generic',1),
+(11,3,2479,'Honorless Target',1),
+(11,3,2973,'Raptor Strike',1),
+(11,3,3050,'Detect',1),
+(11,3,3365,'Opening',1),
+(11,3,5011,'Crossbows',1),
+(11,3,6233,'Closing',1),
+(11,3,6246,'Closing',1),
+(11,3,6247,'Opening',1),
+(11,3,6477,'Opening',1),
+(11,3,6478,'Opening',1),
+(11,3,6562,'Heroic Presence',1),
+(11,3,6603,'Attack',1),
+(11,3,7266,'Duel',1),
+(11,3,7267,'Grovel',1),
+(11,3,7355,'Stuck',1),
+(11,3,8386,'Attacking',1),
+(11,3,9077,'Leather',1),
+(11,3,9078,'Cloth',1),
+(11,3,9125,'Generic',1),
+(11,3,13358,'Defensive State(DND)',1),
+(11,3,20579,'Shadow Resistance',1),
+(11,3,21651,'Opening',1),
+(11,3,21652,'Closing',1),
+(11,3,22027,'Remove Insignia',1),
+(11,3,22810,'Opening - No Text',1),
+(11,3,24949,'Defensive State 2(DND)',1),
+(11,3,28875,'Gemcutting',1),
+(11,3,28880,'Gift of the Naaru',1),
+(11,3,29932,'Language Draenei',1),
+(11,3,34082,'Advantaged State(DND)',1),
+(11,5,81,'Dodge',1),
+(11,5,198,'One-Handed Maces',1),
+(11,5,203,'Unarmed',1),
+(11,5,204,'Defense',1),
+(11,5,522,'SPELLDEFENSE(DND)',1),
+(11,5,585,'Smite',1),
+(11,5,668,'Language Common',1),
+(11,5,2050,'Lesser Heal',1),
+(11,5,2382,'Generic',1),
+(11,5,2479,'Honorless Target',1),
+(11,5,3050,'Detect',1),
+(11,5,3365,'Opening',1),
+(11,5,5009,'Wands',1),
+(11,5,5019,'Shoot',1),
+(11,5,6233,'Closing',1),
+(11,5,6246,'Closing',1),
+(11,5,6247,'Opening',1),
+(11,5,6477,'Opening',1),
+(11,5,6478,'Opening',1),
+(11,5,6603,'Attack',1),
+(11,5,7266,'Duel',1),
+(11,5,7267,'Grovel',1),
+(11,5,7355,'Stuck',1),
+(11,5,8386,'Attacking',1),
+(11,5,9078,'Cloth',1),
+(11,5,9125,'Generic',1),
+(11,5,20579,'Shadow Resistance',1),
+(11,5,21651,'Opening',1),
+(11,5,21652,'Closing',1),
+(11,5,22027,'Remove Insignia',1),
+(11,5,22810,'Opening - No Text',1),
+(11,5,28875,'Gemcutting',1),
+(11,5,28878,'Inspiring Presence',1),
+(11,5,28880,'Gift of the Naaru',1),
+(11,5,29932,'Language Draenei',1),
+(11,6,81,'Dodge',1),
+(11,6,196,'One-Handed Axes',1),
+(11,6,197,'Two-Handed Axes',1),
+(11,6,200,'Polearms',1),
+(11,6,201,'One-Handed Swords',1),
+(11,6,202,'Two-Handed Swords',1),
+(11,6,203,'Unarmed',1),
+(11,6,204,'Defense',1),
+(11,6,522,'SPELLDEFENSE (DND)',1),
+(11,6,668,'Language Common',1),
+(11,6,674,'Dual Wield',1),
+(11,6,750,'Plate Mail',1),
+(11,6,1843,'Disarm',1),
+(11,6,2382,'Generic',1),
+(11,6,2479,'Honorless Target',1),
+(11,6,3050,'Detect',1),
+(11,6,3127,'Parry',1),
+(11,6,3275,'Linen Bandage',1),
+(11,6,3276,'Heavy Linen Bandage',1),
+(11,6,3277,'Wool Bandage',1),
+(11,6,3278,'Heavy Wool Bandage',1),
+(11,6,3365,'Opening',1),
+(11,6,6233,'Closing',1),
+(11,6,6246,'Closing',1),
+(11,6,6247,'Opening',1),
+(11,6,6477,'Opening',1),
+(11,6,6478,'Opening',1),
+(11,6,6562,'Heroic Presence',1),
+(11,6,6603,'Attack',1),
+(11,6,7266,'Duel',1),
+(11,6,7267,'Grovel',1),
+(11,6,7355,'Stuck',1),
+(11,6,7928,'Silk Bandage',1),
+(11,6,7929,'Heavy Silk Bandage',1),
+(11,6,7934,'Anti-Venom',1),
+(11,6,8386,'Attacking',1),
+(11,6,8737,'Mail',1),
+(11,6,9077,'Leather',1),
+(11,6,9078,'Cloth',1),
+(11,6,9125,'Generic',1),
+(11,6,10840,'Mageweave Bandage',1),
+(11,6,10841,'Heavy Mageweave Bandage',1),
+(11,6,10846,'First Aid',1),
+(11,6,18629,'Runecloth Bandage',1),
+(11,6,18630,'Heavy Runecloth Bandage',1),
+(11,6,21651,'Opening',1),
+(11,6,21652,'Closing',1),
+(11,6,22027,'Remove Insignia',1),
+(11,6,22810,'Opening - No Text',1),
+(11,6,28875,'Gemcutting',1),
+(11,6,29932,'Language Draenei',1),
+(11,6,33391,'Journeyman Riding',1),
+(11,6,45462,'Plague Strike',1),
+(11,6,45477,'Icy Touch',1),
+(11,6,45902,'Blood Strike',1),
+(11,6,45903,'Offensive State (DND)',1),
+(11,6,45927,'Summon Friend',1),
+(11,6,47541,'Death Coil',1),
+(11,6,48266,'Blood Presence',1),
+(11,6,49410,'Forceful Deflection',1),
+(11,6,49576,'Death Grip',1),
+(11,6,52665,'Sigil',1),
+(11,6,59539,'Shadow Resistance',1),
+(11,6,59545,'Gift of the Naaru',1),
+(11,6,59879,'Blood Plague',1),
+(11,6,59921,'Frost Fever',1),
+(11,6,61437,'Opening',1),
+(11,6,61455,'Runic Focus',1),
+(11,7,81,'Dodge',1),
+(11,7,107,'Block',1),
+(11,7,198,'One-Handed Maces',1),
+(11,7,203,'Unarmed',1),
+(11,7,204,'Defense',1),
+(11,7,227,'Staves',1),
+(11,7,331,'Healing Wave',1),
+(11,7,403,'Lightning Bolt',1),
+(11,7,522,'SPELLDEFENSE(DND)',1),
+(11,7,668,'Language Common',1),
+(11,7,2382,'Generic',1),
+(11,7,2479,'Honorless Target',1),
+(11,7,3050,'Detect',1),
+(11,7,3365,'Opening',1),
+(11,7,6233,'Closing',1),
+(11,7,6246,'Closing',1),
+(11,7,6247,'Opening',1),
+(11,7,6477,'Opening',1),
+(11,7,6478,'Opening',1),
+(11,7,6603,'Attack',1),
+(11,7,7266,'Duel',1),
+(11,7,7267,'Grovel',1),
+(11,7,7355,'Stuck',1),
+(11,7,8386,'Attacking',1),
+(11,7,9077,'Leather',1),
+(11,7,9078,'Cloth',1),
+(11,7,9116,'Shield',1),
+(11,7,9125,'Generic',1),
+(11,7,20579,'Shadow Resistance',1),
+(11,7,21651,'Opening',1),
+(11,7,21652,'Closing',1),
+(11,7,22027,'Remove Insignia',1),
+(11,7,22810,'Opening - No Text',1),
+(11,7,27763,'Totem',1),
+(11,7,28875,'Gemcutting',1),
+(11,7,28878,'Inspiring Presence',1),
+(11,7,28880,'Gift of the Naaru',1),
+(11,7,29932,'Language Draenei',1),
+(11,8,81,'Dodge',1),
+(11,8,133,'Fireball',1),
+(11,8,168,'Frost Armor',1),
+(11,8,203,'Unarmed',1),
+(11,8,204,'Defense',1),
+(11,8,227,'Staves',1),
+(11,8,522,'SPELLDEFENSE(DND)',1),
+(11,8,668,'Language Common',1),
+(11,8,2382,'Generic',1),
+(11,8,2479,'Honorless Target',1),
+(11,8,3050,'Detect',1),
+(11,8,3365,'Opening',1),
+(11,8,5009,'Wands',1),
+(11,8,5019,'Shoot',1),
+(11,8,6233,'Closing',1),
+(11,8,6246,'Closing',1),
+(11,8,6247,'Opening',1),
+(11,8,6477,'Opening',1),
+(11,8,6478,'Opening',1),
+(11,8,6603,'Attack',1),
+(11,8,7266,'Duel',1),
+(11,8,7267,'Grovel',1),
+(11,8,7355,'Stuck',1),
+(11,8,8386,'Attacking',1),
+(11,8,9078,'Cloth',1),
+(11,8,9125,'Generic',1),
+(11,8,20579,'Shadow Resistance',1),
+(11,8,21651,'Opening',1),
+(11,8,21652,'Closing',1),
+(11,8,22027,'Remove Insignia',1),
+(11,8,22810,'Opening - No Text',1),
+(11,8,28875,'Gemcutting',1),
+(11,8,28878,'Inspiring Presence',1),
+(11,8,28880,'Gift of the Naaru',1),
+(11,8,29932,'Language Draenei',1);
/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2571,7 +12781,7 @@ CREATE TABLE `quest_end_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
- `datatext` text NOT NULL,
+ `dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
`z` float NOT NULL default '0',
@@ -2588,6 +12798,33 @@ LOCK TABLES `quest_end_scripts` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `quest_start_scripts`
+--
+
+DROP TABLE IF EXISTS `quest_start_scripts`;
+CREATE TABLE `quest_start_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `quest_start_scripts`
+--
+
+LOCK TABLES `quest_start_scripts` WRITE;
+/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `quest_mail_loot_template`
--
@@ -2615,33 +12852,6 @@ LOCK TABLES `quest_mail_loot_template` WRITE;
UNLOCK TABLES;
--
--- Table structure for table `quest_start_scripts`
---
-
-DROP TABLE IF EXISTS `quest_start_scripts`;
-CREATE TABLE `quest_start_scripts` (
- `id` mediumint(8) unsigned NOT NULL default '0',
- `delay` int(10) unsigned NOT NULL default '0',
- `command` mediumint(8) unsigned NOT NULL default '0',
- `datalong` mediumint(8) unsigned NOT NULL default '0',
- `datalong2` int(10) unsigned NOT NULL default '0',
- `datatext` text NOT NULL,
- `x` float NOT NULL default '0',
- `y` float NOT NULL default '0',
- `z` float NOT NULL default '0',
- `o` float NOT NULL default '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Dumping data for table `quest_start_scripts`
---
-
-LOCK TABLES `quest_start_scripts` WRITE;
-/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */;
-UNLOCK TABLES;
-
---
-- Table structure for table `quest_template`
--
@@ -2667,6 +12877,8 @@ CREATE TABLE `quest_template` (
`QuestFlags` smallint(5) unsigned NOT NULL default '0',
`SpecialFlags` tinyint(3) unsigned NOT NULL default '0',
`CharTitleId` tinyint(3) unsigned NOT NULL default '0',
+ `PlayersSlain` tinyint(3) unsigned NOT NULL default '0',
+ `BonusTalents` tinyint(3) unsigned NOT NULL default '0',
`PrevQuestId` mediumint(9) NOT NULL default '0',
`NextQuestId` mediumint(9) NOT NULL default '0',
`ExclusiveGroup` mediumint(9) NOT NULL default '0',
@@ -2746,7 +12958,7 @@ CREATE TABLE `quest_template` (
`RewRepValue3` mediumint(9) NOT NULL default '0',
`RewRepValue4` mediumint(9) NOT NULL default '0',
`RewRepValue5` mediumint(9) NOT NULL default '0',
- `RewHonorableKills` mediumint(9) unsigned NOT NULL default '0',
+ `RewHonorableKills` int unsigned NOT NULL default '0',
`RewOrReqMoney` int(11) NOT NULL default '0',
`RewMoneyMaxLevel` int(10) unsigned NOT NULL default '0',
`RewSpell` mediumint(8) unsigned NOT NULL default '0',
@@ -2861,6 +13073,22 @@ LOCK TABLES `script_texts` WRITE;
UNLOCK TABLES;
--
+-- Table structure for table `script_waypoint`
+--
+
+DROP TABLE IF EXISTS script_waypoint;
+CREATE TABLE script_waypoint (
+ entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry',
+ pointid mediumint(8) unsigned NOT NULL DEFAULT '0',
+ location_x float NOT NULL DEFAULT '0',
+ location_y float NOT NULL DEFAULT '0',
+ location_z float NOT NULL DEFAULT '0',
+ waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs',
+ point_comment text,
+ PRIMARY KEY (entry, pointid)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
+
+--
-- Table structure for table `skill_discovery_template`
--
@@ -2958,7 +13186,9 @@ DROP TABLE IF EXISTS `spell_affect`;
CREATE TABLE `spell_affect` (
`entry` smallint(5) unsigned NOT NULL default '0',
`effectId` tinyint(3) unsigned NOT NULL default '0',
- `SpellFamilyMask` bigint(20) unsigned NOT NULL default '0',
+ `SpellClassMask0` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask1` int(5) unsigned NOT NULL default '0',
+ `SpellClassMask2` int(5) unsigned NOT NULL default '0',
PRIMARY KEY (`entry`,`effectId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -3030,6 +13260,106 @@ CREATE TABLE `spell_elixir` (
LOCK TABLES `spell_elixir` WRITE;
/*!40000 ALTER TABLE `spell_elixir` DISABLE KEYS */;
+INSERT INTO `spell_elixir` VALUES
+( 673,0x2),
+( 2367,0x1),
+( 2374,0x1),
+( 2378,0x2),
+( 2380,0x2),
+( 3160,0x1),
+( 3164,0x1),
+( 3166,0x2),
+( 3219,0x2),
+( 3220,0x2),
+( 3222,0x2),
+( 3223,0x2),
+( 3593,0x2),
+( 7844,0x1),
+( 8212,0x1),
+(10667,0x1),
+(10668,0x2),
+(10669,0x1),
+(10692,0x2),
+(10693,0x2),
+(11319,0x2),
+(11328,0x1),
+(11334,0x1),
+(11348,0x2),
+(11349,0x2),
+(11364,0x2),
+(11371,0x2),
+(11390,0x1),
+(11396,0x2),
+(11405,0x1),
+(11406,0x1),
+(11474,0x1),
+(15231,0x2),
+(15233,0x2),
+(16321,0x2),
+(16322,0x1),
+(16323,0x1),
+(16325,0x2),
+(16326,0x2),
+(16327,0x2),
+(16329,0x1),
+(17038,0x1),
+(17535,0x2),
+(17537,0x1),
+(17538,0x1),
+(17539,0x1),
+(17624,0x3),
+(17626,0x3),
+(17627,0x3),
+(17629,0x3),
+(17628,0x3),
+(21920,0x1),
+(24361,0x2),
+(24363,0x2),
+(24382,0x2),
+(24383,0x2),
+(24417,0x2),
+(26276,0x1),
+(27652,0x2),
+(27653,0x2),
+(28486,0x1),
+(28488,0x1),
+(28490,0x1),
+(28491,0x1),
+(28493,0x1),
+(28497,0x1),
+(28501,0x1),
+(28502,0x2),
+(28503,0x1),
+(28509,0x2),
+(28514,0x2),
+(28518,0x3),
+(28519,0x3),
+(28520,0x3),
+(28521,0x3),
+(28540,0x3),
+(29348,0x2),
+(33720,0x1),
+(33721,0x1),
+(33726,0x1),
+(38954,0x1),
+(39625,0x2),
+(39626,0x2),
+(39627,0x2),
+(39628,0x2),
+(40567,0x7),
+(40568,0x7),
+(40572,0x7),
+(40573,0x7),
+(40575,0x7),
+(40576,0x7),
+(41608,0xB),
+(41609,0xB),
+(41610,0xB),
+(41611,0xB),
+(42735,0x3),
+(45373,0x1),
+(46837,0xB),
+(46839,0xB);
/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3050,6 +13380,20 @@ CREATE TABLE `spell_learn_spell` (
LOCK TABLES `spell_learn_spell` WRITE;
/*!40000 ALTER TABLE `spell_learn_spell` DISABLE KEYS */;
+INSERT INTO `spell_learn_spell` VALUES
+(2842,8681),
+(5784,33388),
+(13819,33388),
+(17002,24867),
+(23161,33391),
+(23214,33391),
+(24866,24864),
+(33872,47179),
+(33873,47180),
+(33943,34090),
+(34767,33391),
+(34769,33388);
+
/*!40000 ALTER TABLE `spell_learn_spell` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3071,6 +13415,42 @@ CREATE TABLE `spell_pet_auras` (
LOCK TABLES `spell_pet_auras` WRITE;
/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */;
+INSERT INTO `spell_pet_auras` VALUES
+(19028, 0, 25228),
+(19578, 0, 19579),
+(20895, 0, 24529),
+(28757, 0, 28758),
+(35029, 0, 35060),
+(35030, 0, 35061),
+(35691, 0, 35696),
+(35692, 0, 35696),
+(35693, 0, 35696),
+(23785, 416, 23759),
+(23822, 416, 23826),
+(23823, 416, 23827),
+(23824, 416, 23828),
+(23825, 416, 23829),
+(23785, 417, 23762),
+(23822, 417, 23837),
+(23823, 417, 23838),
+(23824, 417, 23839),
+(23825, 417, 23840),
+(23785, 1860, 23760),
+(23822, 1860, 23841),
+(23823, 1860, 23842),
+(23824, 1860, 23843),
+(23825, 1860, 23844),
+(23785, 1863, 23761),
+(23822, 1863, 23833),
+(23823, 1863, 23834),
+(23824, 1863, 23835),
+(23825, 1863, 23836),
+(23785, 17252, 35702),
+(23822, 17252, 35703),
+(23823, 17252, 35704),
+(23824, 17252, 35705),
+(23825, 17252, 35706);
+
/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3111,7 +13491,7 @@ CREATE TABLE `spell_script_target` (
`type` tinyint(3) unsigned NOT NULL default '0',
`targetEntry` mediumint(8) unsigned NOT NULL default '0',
UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Spell System';
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Spell System';
--
-- Dumping data for table `spell_script_target`
@@ -3133,7 +13513,7 @@ CREATE TABLE `spell_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
- `datatext` text character set latin1 NOT NULL,
+ `dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
`z` float NOT NULL default '0',
@@ -3190,6 +13570,93 @@ CREATE TABLE `spell_threat` (
LOCK TABLES `spell_threat` WRITE;
/*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */;
+INSERT INTO `spell_threat` VALUES
+(78,20),
+(284,39),
+(285,59),
+(770,108),
+(778,108),
+(1608,78),
+(1672,180),
+(1715,61),
+(2139,300),
+(6343,17),
+(6572,155),
+(6574,195),
+(6809,89),
+(7372,101),
+(7373,141),
+(7379,235),
+(7386,100),
+(7405,140),
+(8198,40),
+(8204,64),
+(8205,96),
+(8380,180),
+(8972,118),
+(9745,148),
+(9749,108),
+(9880,178),
+(9881,207),
+(9907,108),
+(11556,43),
+(11564,98),
+(11565,118),
+(11566,137),
+(11567,145),
+(11580,143),
+(11581,180),
+(11596,220),
+(11597,261),
+(11600,275),
+(11601,315),
+(11775,395),
+(14274,200),
+(14921,415),
+(15629,300),
+(15630,400),
+(15631,500),
+(15632,600),
+(16857,108),
+(17735,200),
+(17750,300),
+(17751,450),
+(17752,600),
+(17390,108),
+(17391,108),
+(17392,108),
+(20569,100),
+(20736,100),
+(20925,20),
+(20927,30),
+(20928,40),
+(23922,160),
+(23923,190),
+(23924,220),
+(23925,250),
+(24394,580),
+(24583,5),
+(25225,300),
+(25231,130),
+(25258,286),
+(25264,215),
+(25269,400),
+(25286,175),
+(25288,355),
+(25289,60),
+(26993,127),
+(26996,176),
+(27011,127),
+(27179,54),
+(29704,230),
+(29707,196),
+(30324,220),
+(30356,323),
+(30357,483),
+(33745,285),
+(33878,129),
+(33986,180),
+(33987,232);
/*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3371,5 +13838,5 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2008-10-14 13:23:35
+-- Dump completed on 2008-03-30 15:34:54
diff --git a/sql/world_script_waypoints.sql b/sql/world_script_waypoints.sql
new file mode 100644
index 00000000000..701de8ee4b0
--- /dev/null
+++ b/sql/world_script_waypoints.sql
@@ -0,0 +1,44 @@
+-- This file contains all waypoints used by escortAI scripts
+
+/* GHOSTLANDS */
+
+DELETE FROM script_waypoint WHERE entry=16295;
+INSERT INTO script_waypoint VALUES
+(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'),
+(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''),
+(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''),
+(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''),
+(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''),
+(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'),
+(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''),
+(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''),
+(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''),
+(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''),
+(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''),
+(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'),
+(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''),
+(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''),
+(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''),
+(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''),
+(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''),
+(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''),
+(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'),
+(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''),
+(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''),
+(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''),
+(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''),
+(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''),
+(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''),
+(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''),
+(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''),
+(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''),
+(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''),
+(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''),
+(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'),
+(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''),
+(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'),
+(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'),
+(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, '');
+
+/* EOF */
+
diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql
index d2795bd4554..b05d40238a4 100644
--- a/sql/world_scripts_full.sql
+++ b/sql/world_scripts_full.sql
@@ -1,4 +1,3 @@
-/* */
/* WORLD BOSS */
UPDATE `creature_template` SET `ScriptName`='boss_ysondre' WHERE `entry`=14887;
@@ -10,18 +9,24 @@ UPDATE `creature_template` SET `ScriptName`='boss_azuregos' WHERE `entry`=6109;
UPDATE `creature_template` SET `ScriptName`='mob_dementeddruids' WHERE `entry`=15260;
/* GO */
+UPDATE `gameobject_template` SET `ScriptName`='go_cat_figurine' WHERE `entry`=13873;
UPDATE `gameobject_template` SET `ScriptName`='go_northern_crystal_pylon' WHERE `entry`=164955;
UPDATE `gameobject_template` SET `ScriptName`='go_western_crystal_pylon' WHERE `entry`=164956;
UPDATE `gameobject_template` SET `ScriptName`='go_eastern_crystal_pylon' WHERE `entry`=164957;
UPDATE `gameobject_template` SET `ScriptName`='go_barov_journal' WHERE `entry`=180794;
-UPDATE `gameobject_template` SET `ScriptName`='go_field_repair_bot_74A' where `entry`= 179552;
+UPDATE `gameobject_template` SET `ScriptName`='go_field_repair_bot_74A' WHERE `entry`=179552;
UPDATE `gameobject_template` SET `ScriptName`='go_orb_of_command' WHERE `entry`=179879;
UPDATE `gameobject_template` SET `ScriptName`='go_tablet_of_madness' WHERE `entry`=180368;
UPDATE `gameobject_template` SET `ScriptName`='go_tablet_of_the_seven' WHERE `entry`=169294;
-UPDATE `gameobject_template` set `ScriptName`='go_manticron_cube' where entry = 181713;
-UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_trigger' WHERE `entry` = 104593;
-UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_door' WHERE `entry` = 176594;
-UPDATE `gameobject_template` SET `scriptname`='go_crystal_prison' WHERE `entry`=185126;
+UPDATE `gameobject_template` SET `ScriptName`='go_manticron_cube' WHERE `entry`=181713;
+UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_trigger' WHERE `entry`=104593;
+UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_door' WHERE `entry`=176594;
+UPDATE `gameobject_template` SET `ScriptName`='go_crystal_prison' WHERE `entry`=185126;
+UPDATE `gameobject_template` SET `ScriptName`='go_legion_obelisk' WHERE `entry` IN (185193,185195,185196,185197,185198);
+UPDATE `gameobject_template` SET `ScriptName`='go_jump_a_tron' WHERE `entry`=183146;
+UPDATE `gameobject_template` SET `ScriptName`='go_ethereum_prison' WHERE `entry`=184421;
+UPDATE `gameobject_template` SET `scriptname`='go_sacred_fire_of_life' WHERE `entry`=175944;
+UPDATE `gameobject_template` SET `scriptname`='go_skull_pile' WHERE `entry`=185913;
/* GUARD */
UPDATE `creature_template` SET `ScriptName`='guard_azuremyst' WHERE `entry`=18038;
@@ -66,11 +71,13 @@ UPDATE `item_template` SET `ScriptName`='item_voodoo_charm' WHERE `entry`=8149;
UPDATE `item_template` SET `ScriptName`='item_vorenthals_presence' WHERE `entry`=30259;
UPDATE `item_template` SET `ScriptName`='item_yehkinyas_bramble' WHERE `entry`=10699;
UPDATE `item_template` SET `ScriptName`='item_zezzaks_shard' WHERE `entry`=31463;
-UPDATE `item_template` SET `ScriptName` = "item_only_for_flight" WHERE `entry` IN (34475, 34489, 24538);
+UPDATE `item_template` SET `ScriptName`='item_only_for_flight' WHERE `entry` IN (34475, 34489, 24538);
+UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry`=22962;
/* NPC (usually creatures to be found in more than one specific zone) */
UPDATE `creature_template` SET `ScriptName`='npc_chicken_cluck' WHERE `entry`=620;
UPDATE `creature_template` SET `ScriptName`='npc_dancing_flames' WHERE `entry`=25305;
+UPDATE `creature_template` SET `ScriptName`='npc_garments_of_quests' WHERE `entry` IN (12429,12423,12427,12430,12428);
UPDATE `creature_template` SET `ScriptName`='npc_guardian' WHERE `entry`=5764;
UPDATE `creature_template` SET `ScriptName`='npc_mount_vendor' WHERE `entry` IN (384,1261,1460,2357,3362,3685,4730,4731,4885,7952,7955,16264,17584);
UPDATE `creature_template` SET `ScriptName`='npc_doctor' WHERE `entry` IN (12939,12920);
@@ -81,11 +88,11 @@ UPDATE `creature_template` SET `ScriptName`='npc_prof_leather' WHERE `entry` IN
UPDATE `creature_template` SET `ScriptName`='npc_prof_tailor' WHERE `entry` IN (22208,22212,22213);
UPDATE `creature_template` SET `ScriptName`='npc_rogue_trainer' WHERE `entry` IN (918,4163,3328,4583,5165,5167,13283,16684);
UPDATE `creature_template` SET `ScriptName`='npc_sayge' WHERE `entry`=14822;
-UPDATE `creature_template` SET `ScriptName`='npc_steam_tonk' WHERE `entry` = 19405;
-UPDATE `creature_template` SET `ScriptName`='npc_tonk_mine' WHERE `entry` = 15368;
+UPDATE `creature_template` SET `ScriptName`='npc_steam_tonk' WHERE `entry`=19405;
+UPDATE `creature_template` SET `ScriptName`='npc_tonk_mine' WHERE `entry`=15368;
UPDATE `creature_template` SET `ScriptName`='npc_winter_reveler' WHERE `entry`=15760;
UPDATE `creature_template` SET `ScriptName`='npc_brewfest_reveler' WHERE `entry`=24484;
-UPDATE `creature_template` SET `ScriptName`='npc_snake_trap_serpents' where entry in (19921, 19833);
+UPDATE `creature_template` SET `ScriptName`='npc_snake_trap_serpents' WHERE `entry` IN (19921, 19833);
/* */
/* ZONE */
@@ -96,17 +103,14 @@ UPDATE `creature_template` SET `ScriptName`='npc_ravenholdt' WHERE `entry`=13936
/* ALTERAC VALLEY */
-
/* ARATHI HIGHLANDS */
-UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' where entry=2768;
+UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768;
/* ASHENVALE */
UPDATE `creature_template` SET `ScriptName`='npc_torek' WHERE `entry`=12858;
-UPDATE `creature_template` SET `ScriptName`='npc_ruul_snowhoof' WHERE `entry` = 12818;
+UPDATE `creature_template` SET `ScriptName`='npc_ruul_snowhoof' WHERE `entry`=12818;
-/* */
/* AUCHINDOUN */
-/* */
/* MANA TOMBS */
UPDATE `creature_template` SET `ScriptName`='boss_pandemonius' WHERE `entry`=18341;
@@ -117,8 +121,8 @@ UPDATE `creature_template` SET `ScriptName`='mob_ethereal_beacon' WHERE `entry`=
UPDATE `creature_template` SET `ScriptName`='boss_exarch_maladaar' WHERE `entry`=18373;
UPDATE `creature_template` SET `ScriptName`='mob_avatar_of_martyred' WHERE `entry`=18478;
UPDATE `creature_template` SET `ScriptName`='mob_stolen_soul' WHERE `entry`=18441;
-UPDATE `creature_template` SET `ScriptName`='boss_shirrak_the_dead_watcher' WHERE `entry` = '18371';
-UPDATE `creature_template` SET `ScriptName`='mob_focus_fire' WHERE `entry` = '18374';
+UPDATE `creature_template` SET `ScriptName`='boss_shirrak_the_dead_watcher' WHERE `entry`=18371;
+UPDATE `creature_template` SET `ScriptName`='mob_focus_fire' WHERE `entry`=18374;
/* SETHEKK HALLS */
UPDATE `instance_template` SET `script`='instance_sethekk_halls' WHERE `map`=556;
@@ -147,25 +151,24 @@ UPDATE `creature_template` SET `ScriptName`='npc_engineer_spark_overgrind' WHERE
UPDATE `creature_template` SET `ScriptName`='npc_injured_draenei' WHERE `entry`=16971;
UPDATE `creature_template` SET `ScriptName`='npc_susurrus' WHERE `entry`=17435;
UPDATE `creature_template` SET `ScriptName`='npc_magwin' WHERE `entry`=17312;
-UPDATE `creature_template` SET `ScriptName`='npc_geezle' where entry=17318;
-UPDATE `creature_template` SET `ScriptName`='mob_nestlewood_owlkin' where entry=16518;
+UPDATE `creature_template` SET `ScriptName`='npc_geezle' WHERE `entry`=17318;
+UPDATE `creature_template` SET `ScriptName`='mob_nestlewood_owlkin' WHERE `entry`=16518;
/* BADLANDS */
-
/* BARRENS */
UPDATE `creature_template` SET `ScriptName`='npc_beaten_corpse' WHERE `entry`=10668;
UPDATE `creature_template` SET `ScriptName`='npc_sputtervalve' WHERE `entry`=3442;
UPDATE `creature_template` SET `ScriptName`='npc_taskmaster_fizzule' WHERE `entry`=7233;
-UPDATE `creature_template` SET `ScriptName`='npc_twiggy_flathead' WHERE `entry` =6248;
-UPDATE `creature_template` SET `ScriptName`='npc_wizzlecrank_shredder' where entry=3439;
+UPDATE `creature_template` SET `ScriptName`='npc_twiggy_flathead' WHERE `entry`=6248;
+UPDATE `creature_template` SET `ScriptName`='npc_wizzlecrank_shredder' WHERE `entry`=3439;
/* BLACK TEMPLE */
UPDATE `instance_template` SET `script`='instance_black_temple' WHERE `map`=564;
UPDATE `creature_template` SET `ScriptName`='npc_akama_shade' WHERE `entry`=22990; -- Akama at Shade of Akama
UPDATE `creature_template` SET `ScriptName`='npc_akama_illidan' WHERE `entry`=23089; -- Akama at Illidan
UPDATE `creature_template` SET `ScriptName`='mob_illidari_council' WHERE `entry`=23426; -- Illidari Council controller mob
-UPDATE `creature_template` SET `ScriptName`='mob_blood_elf_council_voice_trigger' WHERE `entry` = 23499; -- Voice Trigger Mob (Controls Aggro + Enrage yells)
+UPDATE `creature_template` SET `ScriptName`='mob_blood_elf_council_voice_trigger' WHERE `entry` =23499; -- Voice Trigger Mob (Controls Aggro + Enrage yells)
UPDATE `creature_template` SET `ScriptName`='boss_veras_darkshadow' WHERE `entry`=22952; -- Rogue of Illidari Council
UPDATE `creature_template` SET `ScriptName`='boss_teron_gorefiend' WHERE `entry`=22871; -- Teron Gorefiend
UPDATE `creature_template` SET `ScriptName`='boss_supremus' WHERE `entry`=22898; -- Supremus
@@ -201,7 +204,6 @@ UPDATE `creature_template` SET `ScriptName`='npc_spirit_of_olum' WHERE `entry`=2
/* BLACKFATHOM DEPTHS */
-
/* BLACKROCK DEPTHS */
UPDATE `creature_template` SET `ScriptName`='boss_emperor_dagran_thaurissan' WHERE `entry`=9019;
UPDATE `creature_template` SET `ScriptName`='boss_moira_bronzebeard' WHERE `entry`=8929;
@@ -219,13 +221,14 @@ UPDATE `creature_template` SET `ScriptName`='boss_high_interrogator_gerstahn' WH
UPDATE `creature_template` SET `ScriptName`='boss_magmus' WHERE `entry`=9938;
UPDATE `creature_template` SET `ScriptName`='boss_seethrel' WHERE `entry`=9038;
UPDATE `creature_template` SET `ScriptName`='boss_vilerel' WHERE `entry`=9036;
-UPDATE `creature_template` SET `ScriptName`='phalanx' WHERE `entry`=9502;
UPDATE `creature_template` SET `ScriptName`='npc_lokhtos_darkbargainer' WHERE `entry`=12944;
UPDATE `creature_template` SET `ScriptName`='npc_kharan_mighthammer' WHERE `entry`=9021;
UPDATE `creature_template` SET `ScriptName`='npc_grimstone' WHERE `entry`=10096;
UPDATE `creature_template` SET `ScriptName`='npc_rocknot' WHERE `entry`=9503;
+UPDATE `creature_template` SET `ScriptName`='mob_phalanx' WHERE `entry`=9502;
/* BLACKROCK SPIRE */
+
/* BLACKROCK SPIRE Lower bosses */
UPDATE `creature_template` SET `ScriptName`='boss_highlord_omokk' WHERE `entry`=9196;
UPDATE `creature_template` SET `ScriptName`='boss_shadow_hunter_voshgajin' WHERE `entry`=9236;
@@ -269,6 +272,10 @@ UPDATE `creature_template` SET `ScriptName`='npc_fallen_hero_of_horde' WHERE `en
UPDATE `creature_template` SET `ScriptName`='mob_webbed_creature' WHERE `entry`=17680;
UPDATE `creature_template` SET `ScriptName`='npc_captured_sunhawk_agent' WHERE `entry`=17824;
+/* BOREAN TUNDRA */
+UPDATE `creature_template` SET `ScriptName`='npc_surristrasz' WHERE `entry`=24795;
+UPDATE `creature_template` SET `ScriptName`='npc_tiare' WHERE `entry`=30051;
+
/* BURNING STEPPES */
UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563;
@@ -285,6 +292,22 @@ UPDATE `creature_template` SET `ScriptName`='boss_archimonde' WHERE `entry`=1796
UPDATE `creature_template` SET `ScriptName`='mob_doomfire' WHERE `entry`=18095;
UPDATE `creature_template` SET `ScriptName`='mob_doomfire_targetting' WHERE `entry`=18104;
UPDATE `creature_template` SET `ScriptName`='mob_ancient_wisp' WHERE `entry`=17946;
+UPDATE `creature_template` SET `ScriptName`='mob_giant_infernal' WHERE `entry`=17908;
+UPDATE `creature_template` SET `ScriptName`='mob_abomination' WHERE `entry`=17898;
+UPDATE `creature_template` SET `ScriptName`='mob_ghoul' WHERE `entry`=17895;
+UPDATE `creature_template` SET `ScriptName`='mob_necromancer' WHERE `entry`=17899;
+UPDATE `creature_template` SET `ScriptName`='mob_banshee' WHERE `entry`=17905;
+UPDATE `creature_template` SET `ScriptName`='mob_crypt_fiend' WHERE `entry`=17897;
+UPDATE `creature_template` SET `ScriptName`='mob_fel_stalker' WHERE `entry`=17916;
+UPDATE `creature_template` SET `ScriptName`='mob_frost_wyrm' WHERE `entry`=17907;
+UPDATE `creature_template` SET `ScriptName`='mob_gargoyle' WHERE `entry`=17906;
+UPDATE `creature_template` SET `ScriptName`='alliance_rifleman' WHERE `entry`=17921;
+UPDATE `creature_template` SET `ScriptName`='mob_towering_infernal' WHERE `entry`=17818;
+UPDATE `creature_template` SET `ScriptName`='boss_anetheron' WHERE `entry`=17808;
+UPDATE `creature_template` SET `ScriptName`='boss_azgalor' WHERE `entry`=17842;
+UPDATE `creature_template` SET `ScriptName`='mob_lesser_doomguard' WHERE `entry`=17864;
+UPDATE `creature_template` SET `ScriptName`='boss_kazrogal' WHERE `entry`=17888;
+UPDATE `creature_template` SET `ScriptName`='boss_rage_winterchill' WHERE `entry`=17767;
/* OLD HILLSBRAD */
UPDATE `instance_template` SET `script`='instance_old_hillsbrad' WHERE `map`=560;
@@ -306,10 +329,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_medivh_bm' WHERE `entry`=15608;
UPDATE `creature_template` SET `ScriptName`='npc_time_rift' WHERE `entry`=17838;
UPDATE `creature_template` SET `ScriptName`='npc_saat' WHERE `entry`=20201;
-
-/* */
/* COILFANG RESERVOIR */
-/* */
/* THE SLAVE PENS */
@@ -333,7 +353,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_hydross_the_unstable' WHERE `e
/* Leotheras the Blind event */
UPDATE `creature_template` SET `ScriptName`='boss_leotheras_the_blind' WHERE `entry`=21215;
UPDATE `creature_template` SET `ScriptName`='boss_leotheras_the_blind_demonform' WHERE `entry`=21845;
-UPDATE `creature_template` SET `ScriptName`='mob_greyheart_spellbinder' WHERE `entry` = '21806';
+UPDATE `creature_template` SET `ScriptName`='mob_greyheart_spellbinder' WHERE `entry`='21806';
/* Fathom-lord Karathress event */
UPDATE `creature_template` SET `ScriptName`='boss_fathomlord_karathress' WHERE `entry`=21214;
UPDATE `creature_template` SET `ScriptName`='boss_fathomguard_sharkkis' WHERE `entry`=21966;
@@ -343,9 +363,9 @@ UPDATE `creature_template` SET `ScriptName`='boss_fathomguard_caribdis' WHERE `e
UPDATE `creature_template` SET `ScriptName`='boss_morogrim_tidewalker' WHERE `entry`=21213;
UPDATE `creature_template` SET `ScriptName`='mob_water_globule' WHERE `entry`=21913;
/* The Lurker Below */
-UPDATE `creature_template` SET `ScriptName`='boss_the_lurker_below' WHERE `entry` = '21217';
-UPDATE `creature_template` SET `ScriptName`='mob_coilfang_ambusher' WHERE `entry` = '21865';
-UPDATE `creature_template` SET `ScriptName`='mob_coilfang_guardian' WHERE `entry` = '21873';
+UPDATE `creature_template` SET `ScriptName`='boss_the_lurker_below' WHERE `entry`=21217;
+UPDATE `creature_template` SET `ScriptName`='mob_coilfang_ambusher' WHERE `entry`=21865;
+UPDATE `creature_template` SET `ScriptName`='mob_coilfang_guardian' WHERE `entry`=21873;
/* Lady Vashj event */
UPDATE `creature_template` SET `ScriptName`='boss_lady_vashj' WHERE `entry`=21212;
UPDATE `creature_template` SET `ScriptName`='mob_enchanted_elemental' WHERE `entry`=21958;
@@ -355,10 +375,8 @@ UPDATE `creature_template` SET `ScriptName`='mob_coilfang_strider' WHERE `entry`
UPDATE `creature_template` SET `ScriptName`='mob_toxic_sporebat' WHERE entry=22140;
UPDATE `creature_template` SET `ScriptName`='mob_shield_generator_channel' WHERE `entry`=19870;
-
/* DARKSHORE */
-
/* DEADMINES */
UPDATE `instance_template` SET `script`='instance_deadmines' WHERE `map`=36;
UPDATE `item_template` SET `ScriptName`='item_defias_gunpowder' WHERE `entry`=5397;
@@ -368,23 +386,17 @@ UPDATE `gameobject_template` SET `ScriptName`='go_main_chambers_access_panel' WH
/* DEADWIND PASS */
-
/* DESOLACE */
-
/* DIRE MAUL */
-
/* DUN MOROGH */
UPDATE `creature_template` SET `ScriptName`='npc_narm_faulk' WHERE `entry`=6177;
-
/* DUROTAR */
-
/* DUSKWOOD */
-
/* DUSTWALLOW MARSH */
UPDATE `creature_template` SET `ScriptName`='mobs_risen_husk_spirit' WHERE `entry` IN (23554,23555);
UPDATE `creature_template` SET `ScriptName`='npc_deserter_agitator' WHERE `entry`=23602;
@@ -402,12 +414,11 @@ UPDATE `creature_template` SET `ScriptName`='npc_tirion_fordring' WHERE `entry`=
UPDATE `creature_template` SET `ScriptName`='npc_henze_faulk' WHERE `entry`=6172;
/* EVERSONG WOODS */
-UPDATE `creature_template` SET `ScriptName`='mobs_mana_tapped' WHERE `entry` IN (15273,15274,15294,15298,15367);
UPDATE `creature_template` SET `ScriptName`='npc_prospector_anvilward' WHERE `entry`=15420;
UPDATE `creature_template` SET `ScriptName`='npc_second_trial_paladin' WHERE `entry` IN (17809,17810,17811,17812);
UPDATE `creature_template` SET `ScriptName`='npc_second_trial_controller' WHERE `entry` IN (17807);
-UPDATE `creature_template` SET `ScriptName`='npc_apprentice_mirveda' where entry=15402;
-UPDATE `creature_template` SET `ScriptName`='npc_infused_crystal' where entry=16364;
+UPDATE `creature_template` SET `ScriptName`='npc_apprentice_mirveda' WHERE `entry`=15402;
+UPDATE `creature_template` SET `ScriptName`='npc_infused_crystal' WHERE `entry`=16364;
UPDATE `gameobject_template` SET `ScriptName`='go_second_trial' WHERE `entry` IN (182052);
/* FELWOOD */
@@ -421,12 +432,11 @@ UPDATE `creature_template` SET `ScriptName`='npc_screecher_spirit' WHERE `entry`
UPDATE `creature_template` SET `ScriptName`='npc_blood_knight_dawnstar' WHERE `entry`=17832;
UPDATE `creature_template` SET `ScriptName`='npc_budd_nedreck' WHERE `entry`=23559;
UPDATE `creature_template` SET `ScriptName`='npc_rathis_tomber' WHERE `entry`=16224;
-UPDATE `creature_template` SET `Scriptname`='npc_ranger_lilatha' WHERE entry=16295;
-update `gameobject_template` SET `ScriptName`='go_gilded_brazier' where entry = 181956;
+UPDATE `creature_template` SET `Scriptname`='npc_ranger_lilatha' WHERE `entry`=16295;
+UPDATE `gameobject_template` SET `ScriptName`='go_gilded_brazier' WHERE `entry`=181956;
/* GNOMEREGAN */
-
/* GRUUL'S LAIR */
UPDATE `instance_template` SET `script`='instance_gruuls_lair' WHERE `map` =565;
UPDATE `creature_template` SET `ScriptName`='boss_gruul' WHERE `entry`=19044;
@@ -437,13 +447,11 @@ UPDATE `creature_template` SET `ScriptName`='boss_blindeye_the_seer' WHERE `entr
UPDATE `creature_template` SET `ScriptName`='boss_olm_the_summoner' WHERE `entry`=18834;
UPDATE `creature_template` SET `ScriptName`='boss_krosh_firehand' WHERE `entry`=18832;
-/* */
/* HELLFIRE CITADEL */
-/* */
/* BLOOD FURNACE */
/* The Maker,Broggok,Kelidan,Broggok's cloud */
-UPDATE `instance_template` SET `script` = 'instance_blood_furnace' WHERE `map` = '542';
+UPDATE `instance_template` SET `script`='instance_blood_furnace' WHERE `map`=542;
UPDATE `creature_template` SET `ScriptName`='boss_the_maker' WHERE `entry`=17381;
UPDATE `creature_template` SET `ScriptName`='boss_broggok' WHERE `entry`=17380;
UPDATE `creature_template` SET `ScriptName`='boss_kelidan_the_breaker' WHERE `entry`=17377;
@@ -454,10 +462,10 @@ UPDATE `creature_template` SET `ScriptName`='mob_shadowmoon_channeler' WHERE `en
/* Vazruden,Omor the Unscarred,Watchkeeper Gargolmar */
UPDATE `creature_template` SET `ScriptName`='boss_omor_the_unscarred' WHERE `entry`=17308;
UPDATE `creature_template` SET `ScriptName`='boss_watchkeeper_gargolmar' WHERE `entry`=17306;
-UPDATE `creature_template` SET `ScriptName`='boss_vazruden_the_herald' WHERE `entry` = '17307';
-UPDATE `creature_template` SET `ScriptName`='boss_vazruden' WHERE `entry` = '17537';
-UPDATE `creature_template` SET `ScriptName`='boss_nazan' WHERE `entry` = '17536';
-UPDATE `creature_template` SET `ScriptName`='mob_hellfire_sentry' WHERE `entry` = '17517';
+UPDATE `creature_template` SET `ScriptName`='boss_vazruden_the_herald' WHERE `entry`=17307;
+UPDATE `creature_template` SET `ScriptName`='boss_vazruden' WHERE `entry`=17537;
+UPDATE `creature_template` SET `ScriptName`='boss_nazan' WHERE `entry`=17536;
+UPDATE `creature_template` SET `ScriptName`='mob_hellfire_sentry' WHERE `entry`=17517;
/* SHATTERED HALLS */
/* Nethekurse and his spawned shadowfissure */
@@ -472,9 +480,9 @@ UPDATE `instance_template` SET `script`='instance_shattered_halls' WHERE `map`=5
/* MAGTHERIDON'S LAIR */
UPDATE `instance_template` SET `script`='instance_magtheridons_lair' WHERE `map`=544;
UPDATE `gameobject_template` SET `ScriptName`='go_manticron_cube' WHERE `entry`=181713;
-UPDATE `creature_template` SET `ScriptName`='boss_magtheridon' WHERE `entry` =17257;
+UPDATE `creature_template` SET `ScriptName`='boss_magtheridon' WHERE `entry`=17257;
UPDATE `creature_template` SET `ScriptName`='mob_hellfire_channeler' WHERE `entry`=17256;
-update `creature_template` SET `ScriptName`='mob_abyssal' where entry = 17454;
+UPDATE `creature_template` SET `ScriptName`='mob_abyssal' WHERE `entry`=17454;
/* HELLFIRE PENINSULA */
UPDATE `creature_template` SET `ScriptName`='boss_doomlord_kazzak' WHERE `entry`=18728;
@@ -485,10 +493,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_wounded_blood_elf' WHERE `entry
/* HILLSBRAD FOOTHILLS */
-
/* HINTERLANDS */
-
/* IRONFORGE */
UPDATE `creature_template` SET `ScriptName`='npc_royal_historian_archesonus' WHERE `entry`=8879;
@@ -496,7 +502,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_royal_historian_archesonus' WHE
UPDATE `creature_template` SET `ScriptName`='npc_ayren_cloudbreaker' WHERE `entry`=25059;
UPDATE `creature_template` SET `ScriptName`='npc_converted_sentry' WHERE `entry`=24981;
UPDATE `creature_template` SET `ScriptName`='npc_unrestrained_dragonhawk' WHERE `entry`=25236;
-UPDATE `creature_template` SET `ScriptName`='npc_greengill_slave' where entry=25084;
+UPDATE `creature_template` SET `ScriptName`='npc_greengill_slave' WHERE `entry`=25084;
/* KARAZHAN */
UPDATE `instance_template` SET `script`='instance_karazhan' WHERE `map`=532;
@@ -536,7 +542,7 @@ UPDATE `creature_template` SET `ScriptName`='netherspite_infernal' WHERE `entry`
UPDATE `creature_template` SET `ScriptName`='npc_berthold' WHERE `entry`=16153;
UPDATE `creature_template` SET `ScriptName`='npc_barnes' WHERE `entry`=16812;
UPDATE `creature_template` SET `ScriptName`='npc_grandmother' WHERE `entry`=17603;
-UPDATE `creature_template` SET `ScriptName`='npc_image_of_medivh' where entry = 17651;
+UPDATE `creature_template` SET `ScriptName`='npc_image_of_medivh' WHERE `entry`=17651;
/* LOCH MODAN */
UPDATE `creature_template` SET `ScriptName`='npc_mountaineer_pebblebitty' WHERE `entry`=3836;
@@ -591,7 +597,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_bunthen_plainswind' WHERE `entr
UPDATE `creature_template` SET `ScriptName`='npc_great_bear_spirit' WHERE `entry`=11956;
UPDATE `creature_template` SET `ScriptName`='npc_silva_filnaveth' WHERE `entry`=11800;
UPDATE `creature_template` SET `ScriptName`='npc_clintar_dreamwalker' WHERE `entry`=22834;
-UPDATE `creature_template` SET `ScriptName`='npc_clintar_spirit' WHERE `entry` = 22916;
+UPDATE `creature_template` SET `ScriptName`='npc_clintar_spirit' WHERE `entry`=22916;
/* MULGORE */
UPDATE `creature_template` SET `ScriptName`='npc_skorn_whitecloud' WHERE `entry`=3052;
@@ -618,7 +624,6 @@ UPDATE `creature_template` SET `ScriptName`='boss_heigan' WHERE `entry`=15936;
UPDATE `creature_template` SET `ScriptName`='boss_loatheb' WHERE `entry`=16011;
UPDATE `creature_template` SET `ScriptName`='boss_razuvious' WHERE `entry`=16061;
UPDATE `creature_template` SET `ScriptName`='boss_gothik' WHERE `entry`=16060;
-UPDATE `creature_template` SET `ScriptName`='boss_highlord_mograine' WHERE `entry`=16062;
UPDATE `creature_template` SET `ScriptName`='boss_thane_korthazz' WHERE `entry`=16064;
UPDATE `creature_template` SET `ScriptName`='boss_sir_zeliek' WHERE `entry`=16063;
UPDATE `creature_template` SET `ScriptName`='boss_lady_blaumeux' WHERE `entry`=16065;
@@ -630,15 +635,17 @@ UPDATE `creature_template` SET `ScriptName`='boss_stalagg' WHERE `entry`=15929;
UPDATE `creature_template` SET `ScriptName`='boss_fugen' WHERE `entry`=15930;
UPDATE `creature_template` SET `ScriptName`='boss_sapphiron' WHERE `entry`=15989;
UPDATE `creature_template` SET `ScriptName`='boss_kelthuzad' WHERE `entry`=15990;
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062;
+UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549;
/* NETHERSTORM */
UPDATE `gameobject_template` SET `ScriptName`='go_manaforge_control_console' WHERE `entry` IN (183770,183956,184311,184312);
UPDATE `creature_template` SET `ScriptName`='npc_manaforge_control_console' WHERE `entry` IN (20209,20417,20418,20440);
UPDATE `creature_template` SET `ScriptName`='npc_protectorate_nether_drake' WHERE `entry`=20903;
UPDATE `creature_template` SET `ScriptName`='npc_veronia' WHERE `entry`=20162;
-UPDATE `creature_template` SET `ScriptName`='mob_phase_hunter' WHERE `entry` =18879;
-UPDATE `creature_template` SET `ScriptName`='npc_professor_dabiri' where entry=20907;
-UPDATE `creature_template` SET `ScriptName`='npc_bessy' WHERE entry = 20415;
+UPDATE `creature_template` SET `ScriptName`='mob_phase_hunter' WHERE `entry`=18879;
+UPDATE `creature_template` SET `ScriptName`='npc_professor_dabiri' WHERE `entry`=20907;
+UPDATE `creature_template` SET `ScriptName`='npc_bessy' WHERE `entry`=20415;
/* ONYXIA'S LAIR */
UPDATE `creature_template` SET `ScriptName`='boss_onyxia' WHERE `entry`=10184;
@@ -650,14 +657,14 @@ UPDATE `creature_template` SET `ScriptName`='npc_thrall_warchief' WHERE `entry`=
/* RAGEFIRE CHASM */
-
/* RAZORFEN DOWNS */
UPDATE `creature_template` SET `ScriptName`='boss_amnennar_the_coldbringer' WHERE `entry`=7358;
+UPDATE `creature_template` SET `ScriptName`='npc_henry_stern' WHERE `entry`=8696;
/* RAZORFEN KRAUL */
-UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE entry=4508;
-/* REDRIDGE MOUNTAINS */
+UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE `entry`=4508;
+/* REDRIDGE MOUNTAINS */
/* RUINS OF AHN'QIRAJ */
UPDATE `instance_template` SET `script`='instance_ruins_of_ahnqiraj' WHERE `map`=509;
@@ -674,9 +681,9 @@ UPDATE `creature_template` SET `ScriptName`='boss_houndmaster_loksey' WHERE `ent
UPDATE `creature_template` SET `ScriptName`='boss_interrogator_vishas' WHERE `entry`=3983;
UPDATE `creature_template` SET `ScriptName`='boss_scarlet_commander_mograine' WHERE `entry`=3976;
UPDATE `creature_template` SET `ScriptName`='boss_scorn' WHERE `entry`=14693;
-UPDATE `creature_template` SET `ScriptName`='boss_headless_horseman' WHERE `entry` = 23682;
-UPDATE `creature_template` SET `ScriptName`='mob_head' WHERE `entry` = 23775;
-UPDATE `creature_template` SET `ScriptName`='mob_pulsing_pumpkin' WHERE `entry` = 23694;
+UPDATE `creature_template` SET `ScriptName`='boss_headless_horseman' WHERE `entry`=23682;
+UPDATE `creature_template` SET `ScriptName`='mob_head' WHERE `entry`=23775;
+UPDATE `creature_template` SET `ScriptName`='mob_pulsing_pumpkin' WHERE `entry`=23694;
UPDATE `creature_template` SET `ScriptName`='mob_wisp_invis' WHERE `entry`=23686;
UPDATE `creature_template` SET `ScriptName`='mob_wisp_invis' WHERE `entry`=24034;
UPDATE `creature_template` SET `ScriptName`='mob_scarlet_trainee' WHERE `entry`=6575;
@@ -717,9 +724,9 @@ UPDATE `creature_template` SET `ScriptName`='npc_neltharaku' WHERE `entry`=21657
UPDATE `creature_template` SET `ScriptName`='npc_oronok_tornheart' WHERE `entry`=21183;
UPDATE `creature_template` SET `ScriptName`='mob_mature_netherwing_drake' WHERE `entry`=21648;
UPDATE `creature_template` SET `ScriptName`='mob_enslaved_netherwing_drake' WHERE `entry`=21722;
-UPDATE `creature_template` SET `ScriptName`='npc_overlord_morghor' WHERE entry= 23139;
+UPDATE `creature_template` SET `ScriptName`='npc_overlord_morghor' WHERE `entry`=23139;
UPDATE `creature_template` SET `ScriptName`='mob_illidari_spawn' WHERE `entry` IN (22075, 22074, 19797);
-UPDATE `creature_template` SET `ScriptName`='mob_torloth_the_magnificent' WHERE `entry`='22076';
+UPDATE `creature_template` SET `ScriptName`='mob_torloth_the_magnificent' WHERE `entry`=22076;
UPDATE `creature_template` SET `ScriptName`='npc_lord_illidan_stormrage' WHERE `entry`='22083';
UPDATE `creature_template` SET `ScriptName`='npc_earthmender_wilda' WHERE `entry`='21027';
UPDATE `creature_template` SET `ScriptName`='npc_enraged_spirit' WHERE `entry` IN (21050, 21061, 21060, 21059);
@@ -732,7 +739,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_zephyr' WHERE `entry`='25967';
UPDATE `creature_template` SET `ScriptName`='npc_kservant' WHERE `entry`='19685';
UPDATE `creature_template` SET `ScriptName`='npc_dirty_larry' WHERE `entry`='19720';
UPDATE `creature_template` SET `ScriptName`='npc_ishanah' WHERE `entry`=18538;
-UPDATE `creature_template` SET `ScriptName`='npc_khadgar' where entry=18166;
+UPDATE `creature_template` SET `ScriptName`='npc_khadgar' WHERE `entry`=18166;
/* SILITHUS */
UPDATE `creature_template` SET `ScriptName`='npcs_rutgar_and_frankal' WHERE `entry` IN (15170,15171);
@@ -758,6 +765,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_bartleby' WHERE `entry`=6090;
UPDATE `creature_template` SET `ScriptName`='npc_dashel_stonefist' WHERE `entry`=4961;
UPDATE `creature_template` SET `ScriptName`='npc_general_marcus_jonathan' WHERE `entry`=466;
UPDATE `creature_template` SET `ScriptName`='npc_lady_katrana_prestor' WHERE `entry`=1749;
+UPDATE `creature_template` SET `ScriptName`='npc_stormwind_harbor_taxi' WHERE `entry`=29154;
/* STRANGLETHORN VALE */
UPDATE `creature_template` SET `ScriptName`='mob_yenniku' WHERE `entry`=2530;
@@ -784,32 +792,28 @@ UPDATE `creature_template` SET `ScriptName`='mob_freed_soul' WHERE `entry`=11136
/* SUNKEN TEMPLE */
/* SUNWELL PLATEAU */
-update `instance_template` set `script` = 'instance_sunwell_plateau' where map = 580;
-UPDATE `creature_template` SET `ScriptName` = 'boss_brutallus' WHERE entry = 24882;
-UPDATE `creature_template` SET `ScriptName` = 'boss_felmyst' WHERE `entry` = 25038;
-UPDATE `creature_template` SET `ScriptName` = 'mob_felmyst_vapor' WHERE `entry` = 25265;
-UPDATE `creature_template` SET `ScriptName` = 'mob_felmyst_trail' WHERE `entry` = 25267;
-update `creature_template` set `ScriptName` = 'boss_sacrolash' where entry = 25165;
-update `creature_template` set `ScriptName` = 'boss_alythess' where entry = 25166;
-update `creature_template` set `ScriptName` = 'mob_shadow_image' where entry = 25214;
+UPDATE `instance_template` SET `script` ='instance_sunwell_plateau' WHERE map =580;
+UPDATE `creature_template` SET `ScriptName`='boss_brutallus' WHERE `entry` =24882;
+UPDATE `creature_template` SET `ScriptName`='boss_felmyst' WHERE `entry`=25038;
+UPDATE `creature_template` SET `ScriptName`='mob_felmyst_vapor' WHERE `entry`=25265;
+UPDATE `creature_template` SET `ScriptName`='mob_felmyst_trail' WHERE `entry`=25267;
+UPDATE `creature_template` SET `ScriptName`='boss_sacrolash' WHERE `entry`=25165;
+UPDATE `creature_template` SET `ScriptName`='boss_alythess' WHERE `entry`=25166;
+UPDATE `creature_template` SET `ScriptName`='mob_shadow_image' WHERE `entry`=25214;
/* SWAMP OF SORROWS */
-
/* TANARIS */
UPDATE `creature_template` SET `ScriptName`='mob_aquementas' WHERE `entry`=9453;
UPDATE `creature_template` SET `ScriptName`='npc_custodian_of_time' WHERE `entry`=20129;
UPDATE `creature_template` SET `ScriptName`='npc_marin_noggenfogger' WHERE `entry`=7564;
UPDATE `creature_template` SET `ScriptName`='npc_steward_of_time' WHERE `entry`=20142;
UPDATE `creature_template` SET `ScriptName`='npc_stone_watcher_of_norgannon' WHERE `entry`=7918;
-UPDATE `creature_template` SET `ScriptName` = 'npc_OOX17' WHERE `entry` = 7784;
+UPDATE `creature_template` SET `ScriptName`='npc_OOX17' WHERE `entry`=7784;
/* TELDRASSIL */
-
-/* */
/* TEMPEST KEEP */
-/* */
/* THE MECHANAR */
UPDATE `creature_template` SET `ScriptName`='boss_gatewatcher_iron_hand' WHERE `entry`=19710;
@@ -835,8 +839,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_millhouse_manastorm' WHERE `ent
/* THE EYE */
UPDATE `instance_template` SET `script`='instance_the_eye' WHERE `map`=550;
-UPDATE `gameobject_template` SET `ScriptName` = 'go_kael_orb' WHERE `entry` = 188173;
-UPDATE `gameobject_template` SET `ScriptName` = 'go_movie_orb' WHERE `entry` = 187578;
+UPDATE `gameobject_template` SET `ScriptName`='go_kael_orb' WHERE `entry`=188173;
+UPDATE `gameobject_template` SET `ScriptName`='go_movie_orb' WHERE `entry`=187578;
/* The Eye Trash Mobs */
UPDATE `creature_template` SET `ScriptName`='mob_crystalcore_devastator' WHERE `entry`=20040;
/* Void Reaver event */
@@ -854,9 +858,9 @@ UPDATE `creature_template` SET `ScriptName`='mob_phoenix_tk' WHERE `entry`=21362
UPDATE `creature_template` SET `ScriptName`='mob_phoenix_egg_tk' WHERE `entry`=21364;
UPDATE `creature_template` SET `ScriptName`='mob_nether_vapor' WHERE `entry`=21002;
UPDATE `creature_template` SET `ScriptName`='mob_kael_flamestrike' WHERE `entry`=21369;
-update `creature_template` set `ScriptName`='boss_alar' where `entry`=19514;
-update `creature_template` set `ScriptName`='mob_ember_of_alar' where `entry`=19551;
-update `creature_template` set `ScriptName`='mob_flame_patch_alar' where `entry`=20602;
+UPDATE `creature_template` SET `ScriptName`='boss_alar' WHERE `entry`=19514;
+UPDATE `creature_template` SET `ScriptName`='mob_ember_of_alar' WHERE `entry`=19551;
+UPDATE `creature_template` SET `ScriptName`='mob_flame_patch_alar' WHERE `entry`=20602;
/* TEMPLE OF AHN'QIRAJ */
UPDATE `instance_template` SET `script`='instance_temple_of_ahnqiraj' WHERE `map`=531;
@@ -889,12 +893,12 @@ UPDATE `creature_template` SET `ScriptName`='mob_netherweb_victim' WHERE `entry`
UPDATE `creature_template` SET `ScriptName`='mob_rotting_forest_rager' WHERE `entry`=22307;
UPDATE `creature_template` SET `ScriptName`='npc_floon' WHERE `entry`=18588;
UPDATE `creature_template` SET `ScriptName`='npc_skyguard_handler_irena' WHERE `entry`=23413;
-UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' where entry=18760;
-UPDATE `creature_template` SET `ScriptName` = 'mob_unkor_the_ruthless' WHERE `entry` = 18262;
+UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' WHERE `entry`=18760;
+UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
/* THOUSAND NEEDLES */
-UPDATE `creature_template` SET `ScriptName` = 'npc_swiftmountain' WHERE `entry` = 10427;
-UPDATE `creature_template` SET `ScriptName` = 'npc_plucky' WHERE `entry` = '6626';
+UPDATE `creature_template` SET `ScriptName`='npc_swiftmountain' WHERE `entry`=10427;
+UPDATE `creature_template` SET `ScriptName` ='npc_plucky' WHERE `entry`='6626';
/* THUNDER BLUFF */
UPDATE `creature_template` SET `ScriptName`='npc_cairne_bloodhoof' WHERE `entry`=3057;
@@ -908,32 +912,41 @@ UPDATE `creature_template` SET `ScriptName`='boss_ironaya' WHERE `entry`=7228;
UPDATE `creature_template` SET `ScriptName`='mob_jadespine_basilisk' WHERE `entry`=4863;
UPDATE `creature_template` SET `ScriptName`='npc_lore_keeper_of_norgannon' WHERE `entry`=7172;
UPDATE `creature_template` SET `ScriptName`='boss_archaedas' WHERE `entry`=2748;
-UPDATE `creature_template` SET `ScriptName`='mob_archaedas_minions' WHERE `entry` IN ('7309', '7077', '7076', '10120');
+UPDATE `creature_template` SET `ScriptName`='mob_archaedas_minions' WHERE `entry` IN (7309, 7077, 7076, 10120);
UPDATE `creature_template` SET `ScriptName`='mob_stonekeepers' WHERE `entry`=4857;
UPDATE `gameobject_template` SET `ScriptName`='go_altar_of_the_keepers' WHERE `entry`=130511;
UPDATE `gameobject_template` SET `ScriptName`='go_altar_of_archaedas' WHERE `entry`=133234;
/* UN'GORO CRATER */
-UPDATE `creature_template` SET `ScriptName` = 'npc_ame' WHERE `entry` = 9623;
+UPDATE `creature_template` SET `ScriptName`='npc_ame' WHERE `entry`=9623;
/* UNDERCITY */
UPDATE `creature_template` SET `ScriptName`='npc_lady_sylvanas_windrunner' WHERE `entry`=10181;
UPDATE `creature_template` SET `ScriptName`='npc_highborne_lamenter' WHERE `entry`=21628;
UPDATE `creature_template` SET `ScriptName`='npc_parqual_fintallas' WHERE `entry`=4488;
-/* WAILING CAVERNS */
+/* UTGARDE KEEP */
+UPDATE `creature_template` SET `scriptname`='boss_keleseth' WHERE `entry`='23953';
+UPDATE `creature_template` SET `scriptname`='mob_frost_tomb' WHERE `entry`='23965';
+UPDATE `instance_template` SET `script`='instance_utgarde_keep' WHERE `map`= '574';
+UPDATE `creature_template` SET `ScriptName`='mob_vrykul_skeleton' WHERE `entry`=23970;
+UPDATE `creature_template` SET `ScriptName`= 'boss_skarvald_the_constructor' WHERE `entry` IN (24200,27390);
+UPDATE `creature_template` SET `ScriptName`= 'boss_dalronn_the_controller' WHERE `entry` IN (24201,27389);
+UPDATE `creature_template` SET `ScriptName`='boss_ingvar_the_plunderer' WHERE `entry`=23954;
+UPDATE `creature_template` SET `ScriptName`='mob_annhylde_the_caller' WHERE `entry`=24068;
+UPDATE `creature_template` SET `ScriptName`='mob_ingvar_throw_dummy' WHERE `entry`=23997;
+/* WAILING CAVERNS */
/* WESTERN PLAGUELANDS */
UPDATE `creature_template` SET `ScriptName`='npcs_dithers_and_arbington' WHERE `entry` IN (11056,11057);
UPDATE `creature_template` SET `ScriptName`='npc_the_scourge_cauldron' WHERE `entry`=11152;
/* WESTFALL */
-UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`='467';
+UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=467;
/* WETLANDS */
-
/* WINTERSPRING */
UPDATE `creature_template` SET `ScriptName`='npc_lorax' WHERE `entry`=10918;
UPDATE `creature_template` SET `ScriptName`='npc_rivern_frostwind' WHERE `entry`=10618;
@@ -944,34 +957,34 @@ UPDATE `creature_template` SET `ScriptName`='npcs_ashyen_and_keleth' WHERE `entr
UPDATE `creature_template` SET `ScriptName`='npc_cooshcoosh' WHERE `entry`=18586;
UPDATE `creature_template` SET `ScriptName`='npc_elder_kuruti' WHERE `entry`=18197;
UPDATE `creature_template` SET `ScriptName`='npc_mortog_steamhead' WHERE `entry`=23373;
-UPDATE `creature_template` SET `ScriptName`='npc_kayra_longmane' where entry=17969;
+UPDATE `creature_template` SET `ScriptName`='npc_kayra_longmane' WHERE `entry`=17969;
/* ZUL'AMAN */
-UPDATE `instance_template` SET `script` = 'instance_zulaman' WHERE `map`=568;
-UPDATE `creature_template` SET `ScriptName` = 'boss_janalai' WHERE `entry`=23578;
-UPDATE `creature_template` SET `ScriptName` = 'boss_nalorakk' WHERE `entry`=23576;
-UPDATE `creature_template` SET `ScriptName` = 'mob_janalai_firebomb' WHERE `entry`=23920;
-UPDATE `creature_template` SET `ScriptName` = 'mob_janalai_hatcher' WHERE `entry`=23818;
-UPDATE `creature_template` SET `ScriptName` = 'mob_janalai_hatchling' WHERE `entry`=23598;
-UPDATE `creature_template` SET `ScriptName` = 'mob_janalai_egg' WHERE `entry`=23817;
-UPDATE `creature_template` SET `ScriptName` = 'npc_forest_frog' WHERE `entry`=24396;
-UPDATE `creature_template` SET `ScriptName` = 'boss_akilzon' where entry = 23574;
-UPDATE `creature_template` SET `ScriptName` = 'mob_akilzon_eagle' where `entry`=24858;
-UPDATE `creature_template` SET `ScriptName` = 'boss_halazzi' WHERE `entry` = '23577';
-UPDATE `creature_template` SET `ScriptName` = 'mob_halazzi_lynx' WHERE `entry` = '24143';
-UPDATE `creature_template` SET `ScriptName` = 'boss_hexlord_malacrass' WHERE `entry` =24239;
-UPDATE `creature_template` SET `ScriptName` = 'boss_alyson_antille' WHERE `entry` =24240;
-UPDATE `creature_template` SET `ScriptName` = 'boss_thurg' WHERE `entry` =24241;
-UPDATE `creature_template` SET `ScriptName` = 'boss_slither' WHERE `entry` =24242;
-UPDATE `creature_template` SET `ScriptName` = 'boss_lord_raadan' WHERE `entry` =24243;
-UPDATE `creature_template` SET `ScriptName` = 'boss_gazakroth' WHERE `entry` =24244;
-UPDATE `creature_template` SET `ScriptName` = 'boss_fenstalker' WHERE `entry` =24245;
-UPDATE `creature_template` SET `ScriptName` = 'boss_darkheart' WHERE `entry` =24246;
-UPDATE `creature_template` SET `ScriptName` = 'boss_koragg' WHERE `entry` =24247;
-UPDATE `creature_template` SET `ScriptName` = 'boss_zuljin' WHERE `entry` =23863;
-UPDATE `creature_template` SET `ScriptName` = 'do_nothing' WHERE `entry` = '24187';
-UPDATE `creature_template` SET `ScriptName` = 'mob_zuljin_vortex' WHERE `entry` = '24136';
-UPDATE `creature_template` SET `ScriptName`='npc_zulaman_hostage' WHERE entry IN ('24001','23790','23999','24024');
+UPDATE `instance_template` SET `script`='instance_zulaman' WHERE `map`=568;
+UPDATE `creature_template` SET `ScriptName`='boss_janalai' WHERE `entry`=23578;
+UPDATE `creature_template` SET `ScriptName`='boss_nalorakk' WHERE `entry`=23576;
+UPDATE `creature_template` SET `ScriptName`='mob_janalai_firebomb' WHERE `entry`=23920;
+UPDATE `creature_template` SET `ScriptName`='mob_janalai_hatcher' WHERE `entry`=23818;
+UPDATE `creature_template` SET `ScriptName`='mob_janalai_hatchling' WHERE `entry`=23598;
+UPDATE `creature_template` SET `ScriptName`='mob_janalai_egg' WHERE `entry`=23817;
+UPDATE `creature_template` SET `ScriptName`='npc_forest_frog' WHERE `entry`=24396;
+UPDATE `creature_template` SET `ScriptName`='boss_akilzon' WHERE entry = 23574;
+UPDATE `creature_template` SET `ScriptName`='mob_akilzon_eagle' WHERE `entry`=24858;
+UPDATE `creature_template` SET `ScriptName`='boss_halazzi' WHERE `entry`='23577';
+UPDATE `creature_template` SET `ScriptName`='mob_halazzi_lynx' WHERE `entry`='24143';
+UPDATE `creature_template` SET `ScriptName`='boss_hexlord_malacrass' WHERE `entry` =24239;
+UPDATE `creature_template` SET `ScriptName`='boss_alyson_antille' WHERE `entry` =24240;
+UPDATE `creature_template` SET `ScriptName`='boss_thurg' WHERE `entry` =24241;
+UPDATE `creature_template` SET `ScriptName`='boss_slither' WHERE `entry` =24242;
+UPDATE `creature_template` SET `ScriptName`='boss_lord_raadan' WHERE `entry` =24243;
+UPDATE `creature_template` SET `ScriptName`='boss_gazakroth' WHERE `entry` =24244;
+UPDATE `creature_template` SET `ScriptName`='boss_fenstalker' WHERE `entry` =24245;
+UPDATE `creature_template` SET `ScriptName`='boss_darkheart' WHERE `entry` =24246;
+UPDATE `creature_template` SET `ScriptName`='boss_koragg' WHERE `entry` =24247;
+UPDATE `creature_template` SET `ScriptName`='boss_zuljin' WHERE `entry` =23863;
+UPDATE `creature_template` SET `ScriptName`='do_nothing' WHERE `entry`='24187';
+UPDATE `creature_template` SET `ScriptName`='mob_zuljin_vortex' WHERE `entry`='24136';
+UPDATE `creature_template` SET `ScriptName`='npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001);
/* ZUL'FARRAK */
UPDATE `creature_template` SET `ScriptName`='npc_sergeant_bly' WHERE `entry`=7604;
diff --git a/sql/world_scripts_structure.sql b/sql/world_scripts_structure.sql
index 9ce15a2d1bb..7ac482bb493 100644
--- a/sql/world_scripts_structure.sql
+++ b/sql/world_scripts_structure.sql
@@ -1,5 +1,5 @@
DROP TABLE IF EXISTS `custom_texts`;
-CREATE TABLE `custom_texts` (
+CREATE TABLE IF NOT EXISTS `custom_texts` (
`entry` mediumint(8) NOT NULL,
`content_default` text NOT NULL,
`content_loc1` text,
@@ -10,9 +10,9 @@ CREATE TABLE `custom_texts` (
`content_loc6` text,
`content_loc7` text,
`content_loc8` text,
- `sound` mediumint(8) unsigned NOT NULL default '0',
- `type` tinyint unsigned NOT NULL default '0',
- `language` tinyint unsigned NOT NULL default '0',
+ `sound` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `language` tinyint(3) unsigned NOT NULL DEFAULT '0',
`emote` tinyint(3) unsigned NOT NULL DEFAULT '0',
`comment` text,
PRIMARY KEY (`entry`)
@@ -70,16 +70,16 @@ CREATE TABLE `eventai_texts` (
`content_loc6` text,
`content_loc7` text,
`content_loc8` text,
- `sound` mediumint(8) unsigned NOT NULL default '0',
- `type` tinyint unsigned NOT NULL default '0',
- `language` tinyint unsigned NOT NULL default '0',
+ `sound` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `language` tinyint(3) unsigned NOT NULL DEFAULT '0',
`emote` tinyint(3) unsigned NOT NULL DEFAULT '0',
`comment` text,
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts';
DROP TABLE IF EXISTS `script_texts`;
-CREATE TABLE `script_texts` (
+CREATE TABLE IF NOT EXISTS `script_texts` (
`entry` mediumint(8) NOT NULL,
`content_default` text NOT NULL,
`content_loc1` text,
@@ -90,16 +90,29 @@ CREATE TABLE `script_texts` (
`content_loc6` text,
`content_loc7` text,
`content_loc8` text,
- `sound` mediumint(8) unsigned NOT NULL default '0',
- `type` tinyint unsigned NOT NULL default '0',
- `language` tinyint unsigned NOT NULL default '0',
+ `sound` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `language` tinyint(3) unsigned NOT NULL DEFAULT '0',
`emote` tinyint(3) unsigned NOT NULL DEFAULT '0',
`comment` text,
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts';
+DROP TABLE IF EXISTS script_waypoint;
+CREATE TABLE script_waypoint (
+ entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry',
+ pointid mediumint(8) unsigned NOT NULL DEFAULT '0',
+ location_x float NOT NULL DEFAULT '0',
+ location_y float NOT NULL DEFAULT '0',
+ location_z float NOT NULL DEFAULT '0',
+ waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs',
+ point_comment text,
+ PRIMARY KEY (entry, pointid)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
+
+
+DROP TABLE IF EXISTS `sd2_db_version`;
DROP TABLE IF EXISTS `script_db_version`;
CREATE TABLE `script_db_version` (
- `version` varchar(255) NOT NULL default '' COMMENT 'Script Database version string'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
+`version` varchar(255) NOT NULL default '' COMMENT 'Database version string'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql
index c33b05c168c..46659d875dc 100644
--- a/sql/world_spell_full.sql
+++ b/sql/world_spell_full.sql
@@ -84,7 +84,9 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm
(45342, 45348, 1, 'Apply Flame Touched'),
(46771, 45348, 1, 'Apply Flame Touched'),
(45271, 45347, 1, 'Apply Dark Touched'),
-(45246, 45348, 1, 'Apply Flame Touched');
+(45246, 45348, 1, 'Apply Flame Touched'),
+(44869, -45018, 1, 'Remove Arcane Buffet'),
+(46019, -45018, 1, 'Remove Arcane Buffet');
-- --------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8c8b9e0126f..6620f48f933 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,6 @@
+add_subdirectory(bindings)
add_subdirectory(framework)
-add_subdirectory(shared)
-add_subdirectory(trinityrealm)
add_subdirectory(game)
-add_subdirectory(bindings)
+add_subdirectory(shared)
add_subdirectory(trinitycore)
+add_subdirectory(trinityrealm)
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 00000000000..7309b10db83
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,25 @@
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# Thanks to the original authors: MaNGOS <http://getmangos.com/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = tools framework shared realmd game bindings mangosd
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am
new file mode 100644
index 00000000000..26914e8fde1
--- /dev/null
+++ b/src/bindings/Makefile.am
@@ -0,0 +1,25 @@
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# Thanks to the original authors: MaNGOS <http://getmangos.com/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# interface folder is disabled for now
+
+#if USE_TSCRIPTS
+SUBDIRS = scripts
+#else
+#SUBDIRS = interface
+#endif
diff --git a/src/bindings/interface/Makefile.am b/src/bindings/interface/Makefile.am
new file mode 100644
index 00000000000..9bb53f98454
--- /dev/null
+++ b/src/bindings/interface/Makefile.am
@@ -0,0 +1,55 @@
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# Thanks to the original authors: MaNGOS <http://getmangos.com/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## Build MaNGOS script library as shared library.
+# libmangosscript shared library will later be reused by world server daemon.
+lib_LTLIBRARIES = libtrinityscript.la
+
+libtrinityscript_la_CPPFLAGS = \
+$(MYSQL_INCLUDES) \
+$(POSTGRE_INCLUDES) \
+$(TRINI_INCLUDES) \
+-I$(top_srcdir)/dep/include \
+-I$(top_srcdir)/src/shared \
+-I$(top_srcdir)/src/framework \
+-I$(top_srcdir)/src/game
+
+libtrinityscript_la_SOURCES = \
+$(srcdir)/ScriptMgr.cpp \
+$(srcdir)/ScriptMgr.h \
+$(srcdir)/config.h \
+$(srcdir)/system.cpp \
+$(srcdir)/Scripts/sc_default.cpp \
+$(srcdir)/Scripts/sc_defines.cpp \
+$(srcdir)/Scripts/sc_defines.h
+
+## libtool settings
+# API versioning
+libtrinityscript_la_LIBFLAGS = -version-info 0:0:0
+libtrinityscript_la_LIBADD = $(MYSQL_LIBS) $(POSTGRE_LIBS)
+
+## Additional files to include when running 'make dist'
+# Scripts defaults.
+EXTRA_DIST = \
+ Readme.txt
+
+
diff --git a/src/bindings/interface/Readme.txt b/src/bindings/interface/Readme.txt
index e152162de8e..821f2367be4 100644
--- a/src/bindings/interface/Readme.txt
+++ b/src/bindings/interface/Readme.txt
@@ -2,7 +2,7 @@
** HOW TO SCRIPT IN C++ **
1 - create a file myscript.cpp in scripts folder.
-2 - copy the content of script_default.cpp, it as the structure on how the scripting fuctions are organized.
+2 - copy the content of script_default.cpp, it as the structure on how the scripting fuctions are organized.
dont forget to change the name of fuctions, like GossipHello_default to GossipHello_myscript.
3 - in fuction AddSC_default change to AddSC_myscript.
@@ -14,7 +14,7 @@ add your AddSC_myscript in here
// -- Scripts to be added --
extern void AddSC_default();
-// -------------------
+// -------------------
and here
diff --git a/src/bindings/interface/ScriptMgr.cpp b/src/bindings/interface/ScriptMgr.cpp
index 7ef38997ace..3cb45d8170b 100644
--- a/src/bindings/interface/ScriptMgr.cpp
+++ b/src/bindings/interface/ScriptMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/ScriptMgr.h b/src/bindings/interface/ScriptMgr.h
index 8c6c91ec362..97b75f07db2 100644
--- a/src/bindings/interface/ScriptMgr.h
+++ b/src/bindings/interface/ScriptMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/Scripts/sc_default.cpp b/src/bindings/interface/Scripts/sc_default.cpp
index 495de39c270..56ec01c4205 100644
--- a/src/bindings/interface/Scripts/sc_default.cpp
+++ b/src/bindings/interface/Scripts/sc_default.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/Scripts/sc_defines.cpp b/src/bindings/interface/Scripts/sc_defines.cpp
index 5665a299106..922beebfc46 100644
--- a/src/bindings/interface/Scripts/sc_defines.cpp
+++ b/src/bindings/interface/Scripts/sc_defines.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/Scripts/sc_defines.h b/src/bindings/interface/Scripts/sc_defines.h
index e942e755ae0..f9bac67683c 100644
--- a/src/bindings/interface/Scripts/sc_defines.h
+++ b/src/bindings/interface/Scripts/sc_defines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/config.h b/src/bindings/interface/config.h
index eaef18f9aa4..3899d7892a1 100644
--- a/src/bindings/interface/config.h
+++ b/src/bindings/interface/config.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/interface/system.cpp b/src/bindings/interface/system.cpp
index 3cf3c7acf33..05e932ca3ae 100644
--- a/src/bindings/interface/system.cpp
+++ b/src/bindings/interface/system.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index efee966da48..fd941cd8164 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -20,15 +20,15 @@ SET(trinityscript_LIB_SRCS
scripts/creature/mob_generic_creature.cpp
scripts/creature/simple_ai.cpp
scripts/creature/simple_ai.h
- scripts/custom/custom_example.cpp
- scripts/custom/custom_gossip_codebox.cpp
- scripts/custom/test.cpp
+ scripts/examples/example_creature.cpp
+ scripts/examples/example_escort.cpp
+ scripts/examples/example_gossip_codebox.cpp
+ scripts/examples/example_misc.cpp
scripts/go/go_scripts.cpp
scripts/guard/guard_ai.cpp
scripts/guard/guard_ai.h
scripts/guard/guards.cpp
scripts/item/item_scripts.cpp
- scripts/item/item_test.cpp
scripts/npc/npc_escortAI.cpp
scripts/npc/npc_escortAI.h
scripts/npc/npc_innkeeper.cpp
@@ -67,19 +67,19 @@ SET(trinityscript_LIB_SRCS
scripts/zone/black_temple/def_black_temple.h
scripts/zone/black_temple/illidari_council.cpp
scripts/zone/black_temple/instance_black_temple.cpp
- scripts/zone/blackrock_depths/blackrock_depths.cpp
- scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
- scripts/zone/blackrock_depths/boss_anubshiah.cpp
- scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
- scripts/zone/blackrock_depths/boss_general_angerforge.cpp
+ scripts/zone/blackrock_depths/blackrock_depths.cpp
+ scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
+ scripts/zone/blackrock_depths/boss_anubshiah.cpp
+ scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
+ scripts/zone/blackrock_depths/boss_general_angerforge.cpp
scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
- scripts/zone/blackrock_depths/boss_grizzle.cpp
- scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
- scripts/zone/blackrock_depths/boss_magmus.cpp
- scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
- scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp
- scripts/zone/blackrock_depths/def_blackrock_depths.h
- scripts/zone/blackrock_depths/instance_blackrock_depths.cpp
+ scripts/zone/blackrock_depths/boss_grizzle.cpp
+ scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
+ scripts/zone/blackrock_depths/boss_magmus.cpp
+ scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
+ scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp
+ scripts/zone/blackrock_depths/def_blackrock_depths.h
+ scripts/zone/blackrock_depths/instance_blackrock_depths.cpp
scripts/zone/blackrock_spire/boss_drakkisath.cpp
scripts/zone/blackrock_spire/boss_gyth.cpp
scripts/zone/blackrock_spire/boss_halycon.cpp
@@ -106,6 +106,7 @@ SET(trinityscript_LIB_SRCS
scripts/zone/blasted_lands/blasted_lands.cpp
scripts/zone/blasted_lands/boss_kruul.cpp
scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
+ scripts/zone/borean_tundra/borean_tundra.cpp
scripts/zone/burning_steppes/burning_steppes.cpp
scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h
scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp
@@ -227,7 +228,6 @@ SET(trinityscript_LIB_SRCS
scripts/zone/naxxramas/boss_gothik.cpp
scripts/zone/naxxramas/boss_grobbulus.cpp
scripts/zone/naxxramas/boss_heigan.cpp
- scripts/zone/naxxramas/boss_highlord_mograine.cpp
scripts/zone/naxxramas/boss_kelthuzad.cpp
scripts/zone/naxxramas/boss_four_horsemen.cpp
scripts/zone/naxxramas/boss_loatheb.cpp
@@ -242,7 +242,8 @@ SET(trinityscript_LIB_SRCS
scripts/zone/onyxias_lair/boss_onyxia.cpp
scripts/zone/orgrimmar/orgrimmar.cpp
scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
- scripts/zone/razorfen_kraul/razorfen_kraul.cpp
+ scripts/zone/razorfen_downs/razorfen_downs.cpp
+ scripts/zone/razorfen_kraul/razorfen_kraul.cpp
scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
@@ -382,6 +383,91 @@ SET(trinityscript_LIB_SRCS
scripts/zone/zulgurub/boss_wushoolay.cpp
scripts/zone/zulgurub/def_zulgurub.h
scripts/zone/zulgurub/instance_zulgurub.cpp
+ scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp
+ scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp
+ scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
+ scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
+ scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h
+ scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp
+ scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
+ scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
+ scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
+ scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
+ scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h
+ scripts/zone/nexus/nexus/instance_nexus.cpp
+ scripts/zone/nexus/nexus/boss_magus_telestra.cpp
+ scripts/zone/nexus/nexus/boss_anomalus.cpp
+ scripts/zone/nexus/nexus/boss_ormorok.cpp
+ scripts/zone/nexus/nexus/boss_keristrasza.cpp
+ scripts/zone/nexus/nexus/commander_stoutbeard.cpp
+ scripts/zone/nexus/nexus/commander_kolurg.cpp
+ scripts/zone/nexus/nexus/def_nexus.h
+ scripts/zone/nexus/oculus/instance_oculus.cpp
+ scripts/zone/nexus/oculus/boss_drakos.cpp
+ scripts/zone/nexus/oculus/boss_urom.cpp
+ scripts/zone/nexus/oculus/boss_varos.cpp
+ scripts/zone/nexus/oculus/boss_eregos.cpp
+ scripts/zone/nexus/oculus/def_oculus.h
+ scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp
+ scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
+ scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp
+ scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp
+ scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h
+ scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp
+ scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
+ scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
+ scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
+ scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
+ scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp
+ scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h
+ scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp
+ scripts/zone/draktharon_keep/boss_trollgore.cpp
+ scripts/zone/draktharon_keep/boss_novos.cpp
+ scripts/zone/draktharon_keep/boss_dred.cpp
+ scripts/zone/draktharon_keep/boss_tharon_ja.cpp
+ scripts/zone/draktharon_keep/def_drak_tharon_keep.h
+ scripts/zone/violet_hold/instance_violet_hold.cpp
+ scripts/zone/violet_hold/boss_cyanigosa.cpp
+ scripts/zone/violet_hold/boss_erekem.cpp
+ scripts/zone/violet_hold/boss_ichoron.cpp
+ scripts/zone/violet_hold/boss_lavanthor.cpp
+ scripts/zone/violet_hold/boss_moragg.cpp
+ scripts/zone/violet_hold/boss_xevozz.cpp
+ scripts/zone/violet_hold/boss_zuramat.cpp
+ scripts/zone/violet_hold/def_violet_hold.h
+ scripts/zone/gundrak/instance_gundrak.cpp
+ scripts/zone/gundrak/boss_slad_ran.cpp
+ scripts/zone/gundrak/boss_moorabi.cpp
+ scripts/zone/gundrak/boss_drakkari_colossus.cpp
+ scripts/zone/gundrak/boss_gal_darah.cpp
+ scripts/zone/gundrak/boss_eck.cpp
+ scripts/zone/gundrak/def_gundrak.h
+ scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp
+ scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
+ scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp
+ scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp
+ scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h
+ scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp
+ scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp
+ scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp
+ scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp
+ scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp
+ scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h
+ scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp
+ scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
+ scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
+ scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
+ scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
+ scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h
+ scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp
+ scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp
+ scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h
+ scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp
+ scripts/zone/obsidian_sanctum/boss_sartharion.cpp
+ scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h
+ scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp
+ scripts/zone/vault_of_archavon/boss_archavon.cpp
+ scripts/zone/vault_of_archavon/def_vault_of_archavon.h
system.cpp
)
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am
new file mode 100644
index 00000000000..764843f3714
--- /dev/null
+++ b/src/bindings/scripts/Makefile.am
@@ -0,0 +1,445 @@
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# Thanks to the original authors: MaNGOS <http://getmangos.com/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+## SUBDIRS = sql
+
+# build shared library
+lib_LTLIBRARIES = libtrinityscript.la
+
+libtrinityscript_la_CPPFLAGS = \
+$(MYSQL_INCLUDES) \
+$(POSTGRE_INCLUDES) \
+-I$(top_srcdir)/dep/include \
+-I$(top_srcdir)/src/shared \
+-I$(top_srcdir)/src/framework \
+-I$(top_srcdir)/src/game \
+-I$(srcdir)/include \
+$(TRINI_INCLUDES) \
+-D_TRINITY_SCRIPT_CONFIG='"$(sysconfdir)/trinitycore.conf"'
+
+libtrinityscript_la_SOURCES = \
+ScriptMgr.cpp \
+ScriptMgr.h \
+include/precompiled.cpp \
+include/precompiled.h \
+include/sc_creature.cpp \
+include/sc_creature.h \
+include/sc_gossip.h \
+include/sc_instance.h \
+scripts/areatrigger/areatrigger_scripts.cpp \
+scripts/boss/boss_emeriss.cpp \
+scripts/boss/boss_lethon.cpp \
+scripts/boss/boss_taerar.cpp \
+scripts/boss/boss_ysondre.cpp \
+scripts/creature/mob_event_ai.cpp \
+scripts/creature/mob_event_ai.h \
+scripts/creature/mob_generic_creature.cpp \
+scripts/creature/simple_ai.cpp \
+scripts/creature/simple_ai.h \
+scripts/examples/example_creature.cpp \
+scripts/examples/example_escort.cpp \
+scripts/examples/example_gossip_codebox.cpp \
+scripts/examples/example_misc.cpp \
+scripts/go/go_scripts.cpp \
+scripts/guard/guard_ai.cpp \
+scripts/guard/guard_ai.h \
+scripts/guard/guards.cpp \
+scripts/item/item_scripts.cpp \
+scripts/npc/npc_escortAI.cpp \
+scripts/npc/npc_escortAI.h \
+scripts/npc/npc_innkeeper.cpp \
+scripts/npc/npc_professions.cpp \
+scripts/npc/npcs_special.cpp \
+scripts/zone/alterac_mountains/alterac_mountains.cpp \
+scripts/zone/arathi_highlands/arathi_highlands.cpp \
+scripts/zone/ashenvale_forest/ashenvale.cpp\
+scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \
+scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp \
+scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \
+scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp \
+scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp \
+scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp \
+scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h \
+scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp \
+scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp \
+scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp \
+scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp \
+scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp \
+scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h \
+scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp \
+scripts/zone/azshara/azshara.cpp \
+scripts/zone/azshara/boss_azuregos.cpp \
+scripts/zone/azuremyst_isle/azuremyst_isle.cpp \
+scripts/zone/barrens/the_barrens.cpp \
+scripts/zone/black_temple/black_temple.cpp \
+scripts/zone/black_temple/boss_bloodboil.cpp \
+scripts/zone/black_temple/boss_illidan.cpp \
+scripts/zone/black_temple/boss_mother_shahraz.cpp \
+scripts/zone/black_temple/boss_reliquary_of_souls.cpp \
+scripts/zone/black_temple/boss_shade_of_akama.cpp \
+scripts/zone/black_temple/boss_supremus.cpp \
+scripts/zone/black_temple/boss_teron_gorefiend.cpp \
+scripts/zone/black_temple/boss_warlord_najentus.cpp \
+scripts/zone/black_temple/def_black_temple.h \
+scripts/zone/black_temple/illidari_council.cpp \
+scripts/zone/black_temple/instance_black_temple.cpp \
+scripts/zone/blackrock_depths/blackrock_depths.cpp \
+scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp \
+scripts/zone/blackrock_depths/boss_anubshiah.cpp \
+scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp \
+scripts/zone/blackrock_depths/boss_general_angerforge.cpp \
+scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp \
+scripts/zone/blackrock_depths/boss_grizzle.cpp \
+scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp \
+scripts/zone/blackrock_depths/boss_magmus.cpp \
+scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp \
+scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp \
+scripts/zone/blackrock_depths/def_blackrock_depths.h \
+scripts/zone/blackrock_depths/instance_blackrock_depths.cpp \
+scripts/zone/blackrock_spire/boss_drakkisath.cpp \
+scripts/zone/blackrock_spire/boss_gyth.cpp \
+scripts/zone/blackrock_spire/boss_halycon.cpp \
+scripts/zone/blackrock_spire/boss_highlord_omokk.cpp \
+scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp \
+scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp \
+scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp \
+scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp \
+scripts/zone/blackrock_spire/boss_rend_blackhand.cpp \
+scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp \
+scripts/zone/blackrock_spire/boss_the_beast.cpp \
+scripts/zone/blackrock_spire/boss_warmaster_voone.cpp \
+scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp \
+scripts/zone/blackwing_lair/boss_chromaggus.cpp \
+scripts/zone/blackwing_lair/boss_ebonroc.cpp \
+scripts/zone/blackwing_lair/boss_firemaw.cpp \
+scripts/zone/blackwing_lair/boss_flamegor.cpp \
+scripts/zone/blackwing_lair/boss_nefarian.cpp \
+scripts/zone/blackwing_lair/boss_razorgore.cpp \
+scripts/zone/blackwing_lair/boss_vaelastrasz.cpp \
+scripts/zone/blackwing_lair/boss_victor_nefarius.cpp \
+scripts/zone/blackwing_lair/instance_blackwing_lair.cpp \
+scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp \
+scripts/zone/blasted_lands/blasted_lands.cpp \
+scripts/zone/blasted_lands/boss_kruul.cpp \
+scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp \
+scripts/zone/borean_tundra/borean_tundra.cpp \
+scripts/zone/burning_steppes/burning_steppes.cpp \
+scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp \
+scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp \
+scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp \
+scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp \
+scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h \
+scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp \
+scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp \
+scripts/zone/caverns_of_time/hyjal/def_hyjal.h \
+scripts/zone/caverns_of_time/hyjal/hyjal.cpp \
+scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp \
+scripts/zone/caverns_of_time/hyjal/hyjalAI.h \
+scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp \
+scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp \
+scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp \
+scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp \
+scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h \
+scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp \
+scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp \
+scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h \
+scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp \
+scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp \
+scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp \
+scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp \
+scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h \
+scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp \
+scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp \
+scripts/zone/darkshore/darkshore.cpp \
+scripts/zone/deadmines/deadmines.cpp \
+scripts/zone/deadmines/def_deadmines.h \
+scripts/zone/dun_morogh/dun_morogh.cpp \
+scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp \
+scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp \
+scripts/zone/elwynn_forest/elwynn_forest.cpp \
+scripts/zone/eversong_woods/eversong_woods.cpp \
+scripts/zone/felwood/felwood.cpp \
+scripts/zone/feralas/feralas.cpp \
+scripts/zone/ghostlands/ghostlands.cpp \
+scripts/zone/gruuls_lair/boss_gruul.cpp \
+scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp \
+scripts/zone/gruuls_lair/def_gruuls_lair.h \
+scripts/zone/gruuls_lair/instance_gruuls_lair.cpp \
+scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp \
+scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp \
+scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp \
+scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \
+scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \
+scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \
+scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \
+scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp \
+scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \
+scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h \
+scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp \
+scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp \
+scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp \
+scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp \
+scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h \
+scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp \
+scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp \
+scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp \
+scripts/zone/ironforge/ironforge.cpp \
+scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp \
+scripts/zone/karazhan/boss_curator.cpp \
+scripts/zone/karazhan/boss_maiden_of_virtue.cpp \
+scripts/zone/karazhan/boss_midnight.cpp \
+scripts/zone/karazhan/boss_moroes.cpp \
+scripts/zone/karazhan/boss_netherspite.cpp \
+scripts/zone/karazhan/boss_nightbane.cpp \
+scripts/zone/karazhan/boss_prince_malchezaar.cpp \
+scripts/zone/karazhan/boss_shade_of_aran.cpp \
+scripts/zone/karazhan/boss_terestian_illhoof.cpp \
+scripts/zone/karazhan/bosses_opera.cpp \
+scripts/zone/karazhan/def_karazhan.h \
+scripts/zone/karazhan/instance_karazhan.cpp \
+scripts/zone/karazhan/karazhan.cpp \
+scripts/zone/loch_modan/loch_modan.cpp \
+scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp \
+scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp \
+scripts/zone/magisters_terrace/boss_selin_fireheart.cpp \
+scripts/zone/magisters_terrace/boss_vexallus.cpp \
+scripts/zone/magisters_terrace/def_magisters_terrace.h \
+scripts/zone/magisters_terrace/instance_magisters_terrace.cpp \
+scripts/zone/maraudon/boss_celebras_the_cursed.cpp \
+scripts/zone/maraudon/boss_landslide.cpp \
+scripts/zone/maraudon/boss_noxxion.cpp \
+scripts/zone/maraudon/boss_princess_theradras.cpp \
+scripts/zone/molten_core/boss_baron_geddon.cpp \
+scripts/zone/molten_core/boss_garr.cpp \
+scripts/zone/molten_core/boss_gehennas.cpp \
+scripts/zone/molten_core/boss_golemagg.cpp \
+scripts/zone/molten_core/boss_lucifron.cpp \
+scripts/zone/molten_core/boss_magmadar.cpp \
+scripts/zone/molten_core/boss_majordomo_executus.cpp \
+scripts/zone/molten_core/boss_ragnaros.cpp \
+scripts/zone/molten_core/boss_shazzrah.cpp \
+scripts/zone/molten_core/boss_sulfuron_harbinger.cpp \
+scripts/zone/molten_core/def_molten_core.h \
+scripts/zone/molten_core/instance_molten_core.cpp \
+scripts/zone/molten_core/molten_core.cpp \
+scripts/zone/moonglade/moonglade.cpp \
+scripts/zone/mulgore/mulgore.cpp \
+scripts/zone/nagrand/nagrand.cpp \
+scripts/zone/naxxramas/boss_anubrekhan.cpp \
+scripts/zone/naxxramas/boss_faerlina.cpp \
+scripts/zone/naxxramas/boss_gluth.cpp \
+scripts/zone/naxxramas/boss_gothik.cpp \
+scripts/zone/naxxramas/boss_grobbulus.cpp \
+scripts/zone/naxxramas/boss_heigan.cpp \
+scripts/zone/naxxramas/boss_kelthuzad.cpp \
+scripts/zone/naxxramas/boss_four_horsemen.cpp \
+scripts/zone/naxxramas/boss_loatheb.cpp \
+scripts/zone/naxxramas/boss_maexxna.cpp \
+scripts/zone/naxxramas/boss_noth.cpp \
+scripts/zone/naxxramas/boss_patchwerk.cpp \
+scripts/zone/naxxramas/boss_razuvious.cpp \
+scripts/zone/naxxramas/boss_sapphiron.cpp \
+scripts/zone/naxxramas/boss_thaddius.cpp \
+scripts/zone/naxxramas/instance_naxxramas.cpp \
+scripts/zone/netherstorm/netherstorm.cpp \
+scripts/zone/onyxias_lair/boss_onyxia.cpp \
+scripts/zone/orgrimmar/orgrimmar.cpp \
+scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \
+scripts/zone/razorfen_downs/razorfen_downs.cpp \
+scripts/zone/razorfen_kraul/razorfen_kraul.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp \
+scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp \
+scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp \
+scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp \
+scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp \
+scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp \
+scripts/zone/scarlet_monastery/boss_herod.cpp \
+scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp \
+scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp \
+scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp \
+scripts/zone/scarlet_monastery/boss_scorn.cpp \
+scripts/zone/scarlet_monastery/boss_headless_horseman.cpp \
+scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp \
+scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp \
+scripts/zone/scarlet_monastery/def_scarlet_monastery.h \
+scripts/zone/scholomance/boss_darkmaster_gandling.cpp \
+scripts/zone/scholomance/boss_death_knight_darkreaver.cpp \
+scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp \
+scripts/zone/scholomance/boss_illucia_barov.cpp \
+scripts/zone/scholomance/boss_instructor_malicia.cpp \
+scripts/zone/scholomance/boss_jandice_barov.cpp \
+scripts/zone/scholomance/boss_kormok.cpp \
+scripts/zone/scholomance/boss_lord_alexei_barov.cpp \
+scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp \
+scripts/zone/scholomance/boss_ras_frostwhisper.cpp \
+scripts/zone/scholomance/boss_the_ravenian.cpp \
+scripts/zone/scholomance/boss_vectus.cpp \
+scripts/zone/scholomance/def_scholomance.h \
+scripts/zone/scholomance/instance_scholomance.cpp \
+scripts/zone/searing_gorge/searing_gorge.cpp \
+scripts/zone/shadowfang_keep/def_shadowfang_keep.h \
+scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp \
+scripts/zone/shadowfang_keep/shadowfang_keep.cpp \
+scripts/zone/shadowmoon_valley/boss_doomwalker.cpp \
+scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp \
+scripts/zone/shattrath/shattrath_city.cpp \
+scripts/zone/silithus/silithus.cpp \
+scripts/zone/silvermoon/silvermoon_city.cpp \
+scripts/zone/silverpine_forest/silverpine_forest.cpp \
+scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp \
+scripts/zone/stormwind/stormwind_city.cpp \
+scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp \
+scripts/zone/stratholme/boss_baron_rivendare.cpp \
+scripts/zone/stratholme/boss_baroness_anastari.cpp \
+scripts/zone/stratholme/boss_cannon_master_willey.cpp \
+scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp \
+scripts/zone/stratholme/boss_magistrate_barthilas.cpp \
+scripts/zone/stratholme/boss_maleki_the_pallid.cpp \
+scripts/zone/stratholme/boss_nerubenkan.cpp \
+scripts/zone/stratholme/boss_order_of_silver_hand.cpp \
+scripts/zone/stratholme/boss_postmaster_malown.cpp \
+scripts/zone/stratholme/boss_ramstein_the_gorger.cpp \
+scripts/zone/stratholme/boss_timmy_the_cruel.cpp \
+scripts/zone/stratholme/def_stratholme.h \
+scripts/zone/stratholme/instance_stratholme.cpp \
+scripts/zone/stratholme/stratholme.cpp \
+scripts/zone/sunwell_plateau/boss_eredar_twins.cpp \
+scripts/zone/sunwell_plateau/boss_felmyst.cpp \
+scripts/zone/sunwell_plateau/boss_brutallus.cpp \
+scripts/zone/sunwell_plateau/boss_kalecgos.cpp \
+scripts/zone/sunwell_plateau/def_sunwell_plateau.h \
+scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp \
+scripts/zone/tanaris/tanaris.cpp \
+scripts/zone/tempest_keep/arcatraz/arcatraz.cpp \
+scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp \
+scripts/zone/tempest_keep/arcatraz/def_arcatraz.h \
+scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp \
+scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp \
+scripts/zone/tempest_keep/botanica/boss_laj.cpp \
+scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp \
+scripts/zone/tempest_keep/the_eye/boss_alar.cpp \
+scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp \
+scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp \
+scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp \
+scripts/zone/tempest_keep/the_eye/def_the_eye.h \
+scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp \
+scripts/zone/tempest_keep/the_eye/the_eye.cpp \
+scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp \
+scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp \
+scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp \
+scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp \
+scripts/zone/tempest_keep/the_mechanar/def_mechanar.h \
+scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp \
+scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp \
+scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h \
+scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp \
+scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp \
+scripts/zone/terokkar_forest/terokkar_forest.cpp \
+scripts/zone/thunder_bluff/thunder_bluff.cpp \
+scripts/zone/tirisfal_glades/tirisfal_glades.cpp \
+scripts/zone/thousand_needles/thousand_needles.cpp \
+scripts/zone/uldaman/boss_archaedas.cpp \
+scripts/zone/uldaman/instance_uldaman.cpp \
+scripts/zone/uldaman/boss_ironaya.cpp \
+scripts/zone/uldaman/uldaman.cpp \
+scripts/zone/undercity/undercity.cpp \
+scripts/zone/ungoro_crater/ungoro_crater.cpp \
+scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp \
+scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp \
+scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp \
+scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp \
+scripts/zone/wailing_caverns/instance_wailing_caverns.cpp \
+scripts/zone/western_plaguelands/western_plaguelands.cpp \
+scripts/zone/westfall/westfall.cpp \
+scripts/zone/winterspring/winterspring.cpp \
+scripts/zone/zangarmarsh/zangarmarsh.cpp \
+scripts/zone/zulaman/boss_akilzon.cpp \
+scripts/zone/zulaman/boss_halazzi.cpp \
+scripts/zone/zulaman/boss_hexlord.cpp \
+scripts/zone/zulaman/boss_janalai.cpp \
+scripts/zone/zulaman/boss_nalorakk.cpp \
+scripts/zone/zulaman/boss_zuljin.cpp \
+scripts/zone/zulaman/def_zulaman.h \
+scripts/zone/zulaman/instance_zulaman.cpp \
+scripts/zone/zulaman/zulaman.cpp \
+scripts/zone/zulfarrak/zulfarrak.cpp \
+scripts/zone/zulgurub/boss_arlokk.cpp \
+scripts/zone/zulgurub/boss_gahzranka.cpp \
+scripts/zone/zulgurub/boss_grilek.cpp \
+scripts/zone/zulgurub/boss_hakkar.cpp \
+scripts/zone/zulgurub/boss_hazzarah.cpp \
+scripts/zone/zulgurub/boss_jeklik.cpp \
+scripts/zone/zulgurub/boss_jindo.cpp \
+scripts/zone/zulgurub/boss_mandokir.cpp \
+scripts/zone/zulgurub/boss_marli.cpp \
+scripts/zone/zulgurub/boss_renataki.cpp \
+scripts/zone/zulgurub/boss_thekal.cpp \
+scripts/zone/zulgurub/boss_venoxis.cpp \
+scripts/zone/zulgurub/boss_wushoolay.cpp \
+scripts/zone/zulgurub/def_zulgurub.h \
+scripts/zone/zulgurub/instance_zulgurub.cpp \
+system.cpp
+
+## libtool settings
+# API versioning
+# Increase the last number, if you do bug fixes only, no interface change.
+# Increase the middle number when you augmented the interface ( aka add new exported functions ).
+# Increase the first number when you break old interface. ( aka remove/change previously exported functions ).
+libtrinityscript_la_LIBFLAGS = -version-info 0:0:1
+libtrinityscript_la_LIBADD = $(MYSQL_LIBS) $(POSTGRE_LIBS)
+
+## Additional files to install
+## sysconf_DATA =
+
+## EXTRA_DIST =
+
+## Prevend overwrite of the config file, if its already installed
+install-data-hook:
+ @list='$(sysconf_DATA)'; for p in $$list; do \
+ dest=`echo $$p | sed -e s/.dist//`; \
+ if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \
+ echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \
+ else \
+ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$dest"; \
+ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$dest; \
+ fi; \
+ done
+
+
+
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index b176c763f1f..1591f53922b 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -5,10 +5,9 @@
#include "precompiled.h"
#include "Config/Config.h"
#include "Database/DatabaseEnv.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "ObjectMgr.h"
#include "ProgressBar.h"
-#include "scripts/creature/mob_event_ai.h"
#define _FULLVERSION "TrinityScript"
@@ -16,7 +15,6 @@
# define _TRINITY_SCRIPT_CONFIG "trinitycore.conf"
#endif _TRINITY_SCRIPT_CONFIG
-//*** Global data ***
int num_sc_scripts;
Script *m_scripts[MAX_SCRIPTS];
@@ -32,36 +30,13 @@ struct StringTextData
uint32 Emote;
};
-// Enums used by StringTextData::Type
-enum ChatType
-{
- CHAT_TYPE_SAY = 0,
- CHAT_TYPE_YELL = 1,
- CHAT_TYPE_TEXT_EMOTE = 2,
- CHAT_TYPE_BOSS_EMOTE = 3,
- CHAT_TYPE_WHISPER = 4,
- CHAT_TYPE_BOSS_WHISPER = 5,
-};
-
#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
// Text Maps
UNORDERED_MAP<int32, StringTextData> TextMap;
-//*** End Global data ***
-
-//*** EventAI data ***
-//Event AI structure. Used exclusivly by mob_event_ai.cpp (60 bytes each)
-UNORDERED_MAP<uint32, std::vector<EventAI_Event> > EventAI_Event_Map;
-
-//Event AI summon structure. Used exclusivly by mob_event_ai.cpp.
-UNORDERED_MAP<uint32, EventAI_Summon> EventAI_Summon_Map;
-
-//Event AI error prevention structure. Used at runtime to prevent error log spam of same creature id.
-//UNORDERED_MAP<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList;
-
-uint32 EAI_ErrorLevel;
-//*** End EventAI data ***
+// Waypoint map (escorts)
+UNORDERED_MAP<uint32, std::vector<PointMovement> > PointMovementMap;
void FillSpellSummary();
void LoadOverridenSQLData();
@@ -78,13 +53,15 @@ extern void AddSC_boss_taerar();
extern void AddSC_boss_ysondre();
// -- Creature --
-extern void AddSC_mob_event();
extern void AddSC_generic_creature();
// -- Custom --
-extern void AddSC_custom_example();
-extern void AddSC_custom_gossip_codebox();
-extern void AddSC_test();
+
+// -- Examples --
+extern void AddSC_example_creature();
+extern void AddSC_example_escort();
+extern void AddSC_example_gossip_codebox();
+extern void AddSC_example_misc();
// -- GO --
extern void AddSC_go_scripts();
@@ -96,7 +73,6 @@ extern void AddSC_guards();
// -- Item --
extern void AddSC_item_scripts();
-extern void AddSC_item_test();
// -- NPC --
extern void AddSC_npc_professions();
@@ -211,6 +187,9 @@ extern void AddSC_blasted_lands();
//Bloodmyst Isle
extern void AddSC_bloodmyst_isle();
+//Borean Tundra
+extern void AddSC_borean_tundra();
+
//Burning steppes
extern void AddSC_burning_steppes();
@@ -395,14 +374,13 @@ extern void AddSC_boss_anubrekhan();
extern void AddSC_boss_maexxna();
extern void AddSC_boss_patchwerk();
extern void AddSC_boss_razuvious();
-extern void AddSC_boss_highlord_mograine();
extern void AddSC_boss_kelthuzad();
-extern void AddSC_boss_faerlina();
extern void AddSC_boss_loatheb();
extern void AddSC_boss_noth();
extern void AddSC_boss_gluth();
extern void AddSC_boss_sapphiron();
extern void AddSC_boss_four_horsemen();
+extern void AddSC_boss_faerlina();
//Netherstorm
extern void AddSC_netherstorm();
@@ -416,6 +394,7 @@ extern void AddSC_orgrimmar();
//Ragefire Chasm
//Razorfen Downs
extern void AddSC_boss_amnennar_the_coldbringer();
+extern void AddSC_razorfen_downs();
//Razorfen Kraul
extern void AddSC_razorfen_kraul();
@@ -571,6 +550,13 @@ extern void AddSC_undercity();
extern void AddSC_ungoro_crater();
//Upper blackrock spire
+
+//Utgarde Keep
+extern void AddSC_boss_keleseth();
+extern void AddSC_boss_skarvald_dalronn();
+extern void AddSC_boss_ingvar_the_plunderer();
+extern void AddSC_instance_utgarde_keep();
+
//Wailing caverns
//Western plaguelands
@@ -619,17 +605,17 @@ extern void AddSC_zulaman();
void LoadDatabase()
{
//Get db string from file
- char const* dbstring = NULL;
+ std::string dbstring = TScriptConfig.GetStringDefault("WorldDatabaseInfo", "");
- if (!TScriptConfig.GetString("WorldDatabaseInfo", &dbstring) )
+ if (dbstring.empty() )
{
error_log("TSCR: Missing world database info from configuration file. Load database aborted.");
return;
}
//Initialize connection to DB
- if (dbstring && TScriptDB.Initialize(dbstring) )
- outstring_log("TSCR: TrinityScript database: %s",dbstring);
+ if (!dbstring.empty() && TScriptDB.Initialize(dbstring.c_str()) )
+ outstring_log("TSCR: TrinityScript database: %s",dbstring.c_str());
else
{
error_log("TSCR: Unable to connect to Database. Load database aborted.");
@@ -660,11 +646,10 @@ void LoadDatabase()
// Load EventAI Text
outstring_log("TSCR: Loading EventAI Texts...");
- LoadTrinityStrings(TScriptDB,"eventai_texts",-1,1+(TEXT_SOURCE_RANGE));
+ LoadTrinityStrings(TScriptDB,"creature_ai_texts",-1,1+(TEXT_SOURCE_RANGE));
// Gather Additional data from EventAI Texts
- //result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM eventai_texts");
- result = TScriptDB.PQuery("SELECT entry, sound, type, language FROM eventai_texts");
+ result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
outstring_log("TSCR: Loading EventAI Texts additional data...");
if (result)
@@ -682,31 +667,31 @@ void LoadDatabase()
temp.SoundId = fields[1].GetInt32();
temp.Type = fields[2].GetInt32();
temp.Language = fields[3].GetInt32();
- temp.Emote = 0;//fields[4].GetInt32();
+ temp.Emote = fields[4].GetInt32();
if (i >= 0)
{
- error_db_log("TSCR: Entry %i in table `eventai_texts` is not a negative value.",i);
+ error_db_log("TSCR: Entry %i in table `creature_ai_texts` is not a negative value.",i);
continue;
}
if (i <= TEXT_SOURCE_RANGE)
{
- error_db_log("TSCR: Entry %i in table `eventai_texts` is out of accepted entry range for table.",i);
+ error_db_log("TSCR: Entry %i in table `creature_ai_texts` is out of accepted entry range for table.",i);
continue;
}
if (temp.SoundId)
{
if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId))
- error_db_log("TSCR: Entry %i in table `eventai_texts` has soundId %u but sound does not exist.",i,temp.SoundId);
+ error_db_log("TSCR: Entry %i in table `creature_ai_texts` has soundId %u but sound does not exist.",i,temp.SoundId);
}
if (!GetLanguageDescByID(temp.Language))
- error_db_log("TSCR: Entry %i in table `eventai_texts` using Language %u but Language does not exist.",i,temp.Language);
+ error_db_log("TSCR: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language);
if (temp.Type > CHAT_TYPE_BOSS_WHISPER)
- error_db_log("TSCR: Entry %i in table `eventai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
+ error_db_log("TSCR: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
TextMap[i] = temp;
++count;
@@ -721,7 +706,7 @@ void LoadDatabase()
barGoLink bar(1);
bar.step();
outstring_log("");
- outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `eventai_texts` is empty.");
+ outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `creature_ai_texts` is empty.");
}
// Load Script Text
@@ -854,455 +839,66 @@ void LoadDatabase()
outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
}
- //Gather additional data for EventAI
- result = TScriptDB.PQuery("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM eventai_summons");
-
- //Drop Existing EventSummon Map
- EventAI_Summon_Map.clear();
+ // Drop Existing Waypoint list
+ PointMovementMap.clear();
+ uint64 uiCreatureCount = 0;
- outstring_log("TSCR: Loading EventAI Summons...");
+ // Load Waypoints
+ result = TScriptDB.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry");
if (result)
{
- barGoLink bar(result->GetRowCount());
- uint32 Count = 0;
-
- do
- {
- bar.step();
- Field *fields = result->Fetch();
-
- EventAI_Summon temp;
-
- uint32 i = fields[0].GetUInt32();
- temp.position_x = fields[1].GetFloat();
- temp.position_y = fields[2].GetFloat();
- temp.position_z = fields[3].GetFloat();
- temp.orientation = fields[4].GetFloat();
- temp.SpawnTimeSecs = fields[5].GetUInt32();
-
- //Add to map
- EventAI_Summon_Map[i] = temp;
- ++Count;
- }while (result->NextRow());
-
+ uiCreatureCount = result->GetRowCount();
delete result;
-
- outstring_log("");
- outstring_log(">> Loaded %u EventAI summon definitions", Count);
- }else
- {
- barGoLink bar(1);
- bar.step();
- outstring_log("");
- outstring_log(">> Loaded 0 EventAI Summon definitions. DB table `eventai_summons` is empty.");
}
- //Gather event data
- result = TScriptDB.PQuery("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, "
- "event_param1, event_param2, event_param3, event_param4, "
- "action1_type, action1_param1, action1_param2, action1_param3, "
- "action2_type, action2_param1, action2_param2, action2_param3, "
- "action3_type, action3_param1, action3_param2, action3_param3 "
- "FROM eventai_scripts");
+ outstring_log("SD2: Loading Script Waypoints for %u creature(s)...", uiCreatureCount);
- //Drop Existing EventAI List
- EventAI_Event_Map.clear();
+ result = TScriptDB.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
- outstring_log("TSCR: Loading EventAI scripts...");
if (result)
{
barGoLink bar(result->GetRowCount());
- uint32 Count = 0;
+ uint32 uiNodeCount = 0;
do
{
bar.step();
- Field *fields = result->Fetch();
-
- EventAI_Event temp;
-
- temp.event_id = fields[0].GetUInt32();
- uint32 i = temp.event_id;
- temp.creature_id = fields[1].GetUInt32();
- uint32 creature_id = temp.creature_id;
- temp.event_type = fields[2].GetUInt16();
- temp.event_inverse_phase_mask = fields[3].GetUInt32();
- temp.event_chance = fields[4].GetUInt8();
- temp.event_flags = fields[5].GetUInt8();
- temp.event_param1 = fields[6].GetUInt32();
- temp.event_param2 = fields[7].GetUInt32();
- temp.event_param3 = fields[8].GetUInt32();
- temp.event_param4 = fields[9].GetUInt32();
-
- //Creature does not exist in database
- if (!GetCreatureTemplateStore(temp.creature_id))
- error_db_log("TSCR: Event %u has script for non-existing creature.", i);
-
- //Report any errors in event
- if (temp.event_type >= EVENT_T_END)
- error_db_log("TSCR: Event %u has incorrect event type. Maybe DB requires updated version of SD2.", i);
-
- //No chance of this event occuring
- if (temp.event_chance == 0)
- error_db_log("TSCR: Event %u has 0 percent chance. Event will never trigger!", i);
-
- //Chance above 100, force it to be 100
- if (temp.event_chance > 100)
- {
- error_db_log("TSCR: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
- temp.event_chance = 100;
- }
-
- //Individual event checks
- switch (temp.event_type)
+ Field* pFields = result->Fetch();
+ PointMovement pTemp;
+
+ pTemp.m_uiCreatureEntry = pFields[0].GetUInt32();
+ uint32 uiCreatureEntry = pTemp.m_uiCreatureEntry;
+ pTemp.m_uiPointId = pFields[1].GetUInt32();
+ pTemp.m_fX = pFields[2].GetFloat();
+ pTemp.m_fY = pFields[3].GetFloat();
+ pTemp.m_fZ = pFields[4].GetFloat();
+ pTemp.m_uiWaitTime = pFields[5].GetUInt32();
+
+ CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.m_uiCreatureEntry);
+ if (!pCInfo)
{
- case EVENT_T_HP:
- case EVENT_T_MANA:
- case EVENT_T_TARGET_HP:
- {
- if (temp.event_param2 > 100)
- error_db_log("TSCR: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
-
- if (temp.event_param1 <= temp.event_param2)
- error_db_log("TSCR: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
-
- if (temp.event_flags & EFLAG_REPEATABLE && !temp.event_param3 && !temp.event_param4)
- {
- error_db_log("TSCR: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
- temp.event_flags &= ~EFLAG_REPEATABLE;
- }
- }
- break;
-
- case EVENT_T_SPELLHIT:
- {
- if (temp.event_param1)
- {
- SpellEntry const* pSpell = GetSpellStore()->LookupEntry(temp.event_param1);
- if (!pSpell)
- {
- error_db_log("TSCR: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.event_param1, i);
- continue;
- }
-
- if (temp.event_param2_s != -1 && temp.event_param2 != pSpell->SchoolMask)
- error_db_log("TSCR: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.event_param1, i);
- }
-
- //TODO: fix this system with SPELL_SCHOOL_MASK. Current complicate things, using int32(-1) instead of just 0
- //SPELL_SCHOOL_MASK_NONE = 0 and does not exist, thus it can not ever trigger or be used in SpellHit()
- if (temp.event_param2_s != -1 && temp.event_param2_s > SPELL_SCHOOL_MASK_ALL)
- error_db_log("TSCR: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.event_param2, i);
-
- if (temp.event_param4 < temp.event_param3)
- error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
- }
- break;
-
- case EVENT_T_RANGE:
- case EVENT_T_OOC_LOS:
- case EVENT_T_FRIENDLY_HP:
- case EVENT_T_FRIENDLY_IS_CC:
- case EVENT_T_FRIENDLY_MISSING_BUFF:
- {
- if (temp.event_param4 < temp.event_param3)
- error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
- }
- break;
-
- case EVENT_T_TIMER:
- case EVENT_T_TIMER_OOC:
- {
- if (temp.event_param2 < temp.event_param1)
- error_db_log("TSCR: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
-
- if (temp.event_param4 < temp.event_param3)
- error_db_log("TSCR: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
- }
- break;
-
- case EVENT_T_KILL:
- case EVENT_T_TARGET_CASTING:
- {
- if (temp.event_param2 < temp.event_param1)
- error_db_log("TSCR: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
- }
- break;
-
- case EVENT_T_AGGRO:
- case EVENT_T_DEATH:
- case EVENT_T_EVADE:
- case EVENT_T_SPAWNED:
- case EVENT_T_REACHED_HOME:
- {
- if (temp.event_flags & EFLAG_REPEATABLE)
- {
- error_db_log("TSCR: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
- temp.event_flags &= ~EFLAG_REPEATABLE;
- }
- }
- break;
- }
-
- for (uint32 j = 0; j < MAX_ACTIONS; j++)
- {
- temp.action[j].type = fields[10+(j*4)].GetUInt16();
- temp.action[j].param1 = fields[11+(j*4)].GetUInt32();
- temp.action[j].param2 = fields[12+(j*4)].GetUInt32();
- temp.action[j].param3 = fields[13+(j*4)].GetUInt32();
-
- //Report any errors in actions
- switch (temp.action[j].type)
- {
- case ACTION_T_TEXT:
- {
- if (temp.action[j].param1_s < 0)
- {
- if (TextMap.find(temp.action[j].param1_s) == TextMap.end())
- error_db_log("TSCR: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
- }
- if (temp.action[j].param2_s < 0)
- {
- if (TextMap.find(temp.action[j].param2_s) == TextMap.end())
- error_db_log("TSCR: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
-
- if (!temp.action[j].param1_s)
- error_db_log("TSCR: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
- }
- if (temp.action[j].param3_s < 0)
- {
- if (TextMap.find(temp.action[j].param3_s) == TextMap.end())
- error_db_log("TSCR: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
-
- if (!temp.action[j].param1_s || !temp.action[j].param2_s)
- error_db_log("TSCR: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
- }
- }
- break;
- case ACTION_T_SET_FACTION:
- /*if (temp.action[j].param1 !=0 && !GetFactionStore()->LookupEntry(temp.action[j].param1))
- {
- error_db_log("SD2: Event %u Action %u uses non-existant FactionId %u.", i, j+1, temp.action[j].param1);
- temp.action[j].param1 = 0;
- }*/
- break;
- case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
- if (temp.action[j].param1 !=0 || temp.action[j].param2 !=0)
- {
- if (temp.action[j].param1 && !GetCreatureTemplateStore(temp.action[j].param1))
- {
- error_db_log("TSCR: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, temp.action[j].param1);
- temp.action[j].param1 = 0;
- }
-
- /*if (temp.action[j].param2 && !GetCreatureDisplayStore()->LookupEntry(temp.action[j].param2))
- {
- error_db_log("TSCR: Event %u Action %u uses non-existant ModelId %u.", i, j+1, temp.action[j].param2);
- temp.action[j].param2 = 0;
- }*/
- }
- break;
- case ACTION_T_SOUND:
- if (!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1))
- error_db_log("TSCR: Event %u Action %u uses non-existant SoundID %u.", i, j+1, temp.action[j].param1);
- break;
-
- /*case ACTION_T_RANDOM_SOUND:
- {
- if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1))
- error_db_log("TSCR: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, temp.action[j].param1);
- if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param2))
- error_db_log("TSCR: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, temp.action[j].param2);
- if(!GetSoundEntriesStore()->LookupEntry(temp.action[j].param3))
- error_db_log("TSCR: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, temp.action[j].param3);
- }
- break;*/
-
- case ACTION_T_CAST:
- {
- const SpellEntry *spell = GetSpellStore()->LookupEntry(temp.action[j].param1);
- if (!spell)
- error_db_log("SD2: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1);
- else
- {
- if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE)
- {
- //output as debug for now, also because there's no general rule all spells have RecoveryTime
- if (temp.event_param3 < spell->RecoveryTime)
- debug_log("SD2: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,temp.action[j].param1, spell->RecoveryTime, temp.event_param3);
- }
- }
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
-
- case ACTION_T_REMOVEAURASFROMSPELL:
- {
- if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
- error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
-
- if (temp.action[j].param1 >= TARGET_T_END)
- error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_QUEST_EVENT:
- {
- if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1))
- {
- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- error_db_log("SD2: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
- }
- else
- error_db_log("SD2: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_QUEST_EVENT_ALL:
- {
- if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1))
- {
- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- error_db_log("SD2: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
- }
- else
- error_db_log("SD2: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
- }
- break;
- case ACTION_T_CASTCREATUREGO:
- {
- if (!GetCreatureTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
-
- if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
- error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
-
- if (temp.action[j].param3 >= TARGET_T_END)
- error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_CASTCREATUREGO_ALL:
- {
- if (!GetQuestTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
-
- if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
- error_db_log("SD2: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
- }
- break;
-
- //2nd param target
- case ACTION_T_SUMMON_ID:
- {
- if (!GetCreatureTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
-
- if (EventAI_Summon_Map.find(temp.action[j].param3) == EventAI_Summon_Map.end())
- error_db_log("TSCR: Event %u Action %u summons missing EventAI_Summon %u", i, j+1, temp.action[j].param3);
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_KILLED_MONSTER:
- {
- if (!GetCreatureTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_SUMMON:
- {
- if (!GetCreatureTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_THREAT_SINGLE_PCT:
- case ACTION_T_SET_UNIT_FLAG:
- case ACTION_T_REMOVE_UNIT_FLAG:
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
- break;
-
- //3rd param target
- case ACTION_T_SET_UNIT_FIELD:
- if (temp.action[j].param1 < OBJECT_END || temp.action[j].param1 >= UNIT_END)
- error_db_log("SD2: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
- if (temp.action[j].param3 >= TARGET_T_END)
- error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
- break;
-
- case ACTION_T_SET_PHASE:
- if (temp.action[j].param1 > 31)
- error_db_log("TSCR: Event %u Action %u attempts to set phase > 31. Phase mask cannot be used past phase 31.", i, j+1);
- break;
-
- case ACTION_T_INC_PHASE:
- if (!temp.action[j].param1)
- error_db_log("SD2: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
- break;
-
- case ACTION_T_SET_INST_DATA:
- {
- if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
- error_db_log("SD2: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
-
- if (temp.action[j].param2 > SPECIAL)
- error_db_log("SD2: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
- }
- break;
- case ACTION_T_SET_INST_DATA64:
- {
- if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
- error_db_log("SD2: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
-
- if (temp.action[j].param2 >= TARGET_T_END)
- error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
- }
- break;
- case ACTION_T_UPDATE_TEMPLATE:
- {
- if (!GetCreatureTemplateStore(temp.action[j].param1))
- error_db_log("SD2: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
- }
- break;
- case ACTION_T_RANDOM_SAY:
- case ACTION_T_RANDOM_YELL:
- case ACTION_T_RANDOM_TEXTEMOTE:
- error_db_log("TSCR: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
- break;
-
- default:
- if (temp.action[j].type >= ACTION_T_END)
- error_db_log("TSCR: Event %u Action %u has incorrect action type. Maybe DB requires updated version of SD2.", i, j+1);
- break;
- }
+ error_db_log("SD2: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.m_uiCreatureEntry);
+ continue;
}
- //Add to list
- EventAI_Event_Map[creature_id].push_back(temp);
+ if (!pCInfo->ScriptID)
+ error_db_log("SD2: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.m_uiCreatureEntry);
- ++Count;
+ PointMovementMap[uiCreatureEntry].push_back(pTemp);
+ ++uiNodeCount;
} while (result->NextRow());
delete result;
outstring_log("");
- outstring_log(">> Loaded %u EventAI scripts", Count);
- }else
+ outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount);
+ }
+ else
{
barGoLink bar(1);
bar.step();
outstring_log("");
- outstring_log(">> Loaded 0 EventAI scripts. DB table `eventai_scripts` is empty.");
+ outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
}
//Free database thread and resources
@@ -1322,7 +918,7 @@ void ScriptsFree()
delete []SpellSummary;
// Free resources before library unload
- for(int i=0;i<num_sc_scripts;i++)
+ for(int i=0;i<MAX_SCRIPTS;i++)
delete m_scripts[i];
num_sc_scripts = 0;
@@ -1351,25 +947,6 @@ void ScriptsInit()
}
else outstring_log("TSCR: Using configuration file %s",_TRINITY_SCRIPT_CONFIG);
- EAI_ErrorLevel = TScriptConfig.GetIntDefault("EAIErrorLevel", 1);
-
- switch (EAI_ErrorLevel)
- {
- case 0:
- outstring_log("TSCR: EventAI Error Reporting level set to 0 (Startup Errors only)");
- break;
- case 1:
- outstring_log("TSCR: EventAI Error Reporting level set to 1 (Startup errors and Runtime event errors)");
- break;
- case 2:
- outstring_log("TSCR: EventAI Error Reporting level set to 2 (Startup errors, Runtime event errors, and Creation errors)");
- break;
- default:
- outstring_log("TSCR: Unknown EventAI Error Reporting level. Defaulting to 1 (Startup errors and Runtime event errors)");
- EAI_ErrorLevel = 1;
- break;
- }
-
outstring_log("");
//Load database (must be called after TScriptConfig.SetSource). In case it failed, no need to even try load.
@@ -1397,13 +974,15 @@ void ScriptsInit()
AddSC_boss_ysondre();
// -- Creature --
- AddSC_mob_event();
AddSC_generic_creature();
// -- Custom --
- AddSC_custom_example();
- AddSC_custom_gossip_codebox();
- AddSC_test();
+
+ // -- Examples --
+ AddSC_example_creature();
+ AddSC_example_escort();
+ AddSC_example_gossip_codebox();
+ AddSC_example_misc();
// -- GO --
AddSC_go_scripts();
@@ -1415,7 +994,6 @@ void ScriptsInit()
// -- Item --
AddSC_item_scripts();
- AddSC_item_test();
// -- NPC --
AddSC_npc_professions();
@@ -1529,6 +1107,9 @@ void ScriptsInit()
//Bloodmyst Isle
AddSC_bloodmyst_isle();
+
+ //Borean Tundra
+ AddSC_borean_tundra();
//Burning steppes
AddSC_burning_steppes();
@@ -1710,12 +1291,11 @@ void ScriptsInit()
//Naxxramas
AddSC_boss_anubrekhan();
+ AddSC_boss_faerlina();
AddSC_boss_maexxna();
AddSC_boss_patchwerk();
AddSC_boss_razuvious();
- AddSC_boss_highlord_mograine();
AddSC_boss_kelthuzad();
- AddSC_boss_faerlina();
AddSC_boss_loatheb();
AddSC_boss_noth();
AddSC_boss_gluth();
@@ -1734,6 +1314,7 @@ void ScriptsInit()
//Ragefire Chasm
//Razorfen Downs
AddSC_boss_amnennar_the_coldbringer();
+ AddSC_razorfen_downs();
//Razorfen Kraul
AddSC_razorfen_kraul();
@@ -1889,6 +1470,13 @@ void ScriptsInit()
AddSC_ungoro_crater();
//Upper blackrock spire
+
+ //Utgarde Keep
+ AddSC_boss_keleseth();
+ AddSC_boss_skarvald_dalronn();
+ AddSC_boss_ingvar_the_plunderer();
+ AddSC_instance_utgarde_keep();
+
//Wailing caverns
//Western plaguelands
@@ -2016,6 +1604,9 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
pSource->MonsterWhisper(textEntry, target->GetGUID(), true);
else error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
}break;
+ case CHAT_TYPE_ZONE_YELL:
+ pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
+ break;
}
}
@@ -2029,8 +1620,12 @@ void Script::RegisterSelf()
{
m_scripts[id] = this;
++num_sc_scripts;
- } else
- debug_log("SD2: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
+ }
+ else
+ {
+ debug_log("TSCR: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
+ delete this;
+ }
}
//********************************
@@ -2237,12 +1832,34 @@ bool ItemUse( Player *player, Item* _Item, SpellCastTargets const& targets)
}
TRINITY_DLL_EXPORT
-bool ReceiveEmote( Player *player, Creature *_Creature, uint32 emote )
+bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget )
{
- Script *tmpscript = m_scripts[_Creature->GetScriptId()];
- if (!tmpscript || !tmpscript->pReceiveEmote) return false;
+ Script *tmpscript = m_scripts[crTarget->GetScriptId()];
+
+ if (!tmpscript || !tmpscript->pEffectDummyCreature) return false;
+
+ return tmpscript->pEffectDummyCreature(caster, spellId,effIndex,crTarget);
+}
+
+TRINITY_DLL_EXPORT
+bool EffectDummyGameObj(Unit *caster, uint32 spellId, uint32 effIndex, GameObject *gameObjTarget )
+{
+ Script *tmpscript = m_scripts[gameObjTarget->GetGOInfo()->ScriptId];
+
+ if (!tmpscript || !tmpscript->pEffectDummyGameObj) return false;
+
+ return tmpscript->pEffectDummyGameObj(caster, spellId,effIndex,gameObjTarget);
+}
+
+
+TRINITY_DLL_EXPORT
+bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget )
+{
+ Script *tmpscript = m_scripts[itemTarget->GetProto()->ScriptId];
+
+ if (!tmpscript || !tmpscript->pEffectDummyItem) return false;
- return tmpscript->pReceiveEmote(player, _Creature, emote);
+ return tmpscript->pEffectDummyItem(caster, spellId,effIndex,itemTarget);
}
TRINITY_DLL_EXPORT
diff --git a/src/bindings/scripts/ScriptMgr.h b/src/bindings/scripts/ScriptMgr.h
index 87a557779a2..719cf7932e9 100644
--- a/src/bindings/scripts/ScriptMgr.h
+++ b/src/bindings/scripts/ScriptMgr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
@@ -10,7 +10,7 @@
#include "Common.h"
#include "Platform/CompilerDefs.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
class Player;
class Creature;
@@ -32,9 +32,11 @@ struct Script
{
Script() :
pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL),
- pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL),
- pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL),
- pGOChooseReward(NULL),pReceiveEmote(NULL),pItemUse(NULL), GetAI(NULL), GetInstanceData(NULL)
+ pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL),
+ pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL),
+ pGOQuestAccept(NULL), pGOChooseReward(NULL),pItemUse(NULL),
+ pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
+ GetAI(NULL), GetInstanceData(NULL)
{}
std::string Name;
@@ -57,8 +59,10 @@ struct Script
bool (*pItemQuestAccept )(Player*, Item *, Quest const* );
bool (*pGOQuestAccept )(Player*, GameObject*, Quest const* );
bool (*pGOChooseReward )(Player*, GameObject*, Quest const*, uint32 );
- bool (*pReceiveEmote )(Player*, Creature*, uint32 );
bool (*pItemUse )(Player*, Item*, SpellCastTargets const& );
+ bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* );
+ bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* );
+ bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* );
CreatureAI* (*GetAI)(Creature*);
InstanceData* (*GetInstanceData)(Map*);
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index 57ee9dad9f3..ef03a6069ec 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -43,7 +43,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -51,7 +51,7 @@
PrecompiledHeaderThrough="precompiled.h"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
+ DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -69,7 +69,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC71\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC71\trinitycore__$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb"
+ ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
@@ -231,6 +231,26 @@
</File>
</Filter>
<Filter
+ Name="examples"
+ >
+ <File
+ RelativePath="..\scripts\examples\example_creature.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_escort.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_gossip_codebox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_misc.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
Name="guard"
>
<File
@@ -281,18 +301,6 @@
<Filter
Name="custom"
>
- <File
- RelativePath="..\scripts\custom\custom_example.cpp"
- >
- </File>
- <File
- RelativePath="..\scripts\custom\custom_gossip_codebox.cpp"
- >
- </File>
- <File
- RelativePath="..\scripts\custom\test.cpp"
- >
- </File>
</Filter>
<Filter
Name="areatrigger"
@@ -317,10 +325,6 @@
RelativePath="..\scripts\item\item_scripts.cpp"
>
</File>
- <File
- RelativePath="..\scripts\item\item_test.cpp"
- >
- </File>
</Filter>
<Filter
Name="zone"
@@ -578,6 +582,190 @@
>
</Filter>
<Filter
+ Name="Borean Tundra"
+ >
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Howling Fjord"
+ >
+ </Filter>
+ <Filter
+ Name="Crystalsong Forest"
+ >
+ </Filter>
+ <Filter
+ Name="Dalaran"
+ >
+ </Filter>
+ <Filter
+ Name="Dragonblight"
+ >
+ </Filter>
+ <Filter
+ Name="Grizzly Hills"
+ >
+ </Filter>
+ <Filter
+ Name="Icecrown"
+ >
+ </Filter>
+ <Filter
+ Name="Sholazar Basin"
+ >
+ </Filter>
+ <Filter
+ Name="The Storm Peaks"
+ >
+ </Filter>
+ <Filter
+ Name="Zul&apos;Drak"
+ >
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <Filter
+ Name="Ahn&apos;kahet"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_amanitar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_elder_nadox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_herald_volazj.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_jedoga_shadowseeker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_prince_taldaram.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\def_ahnkahet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\instance_ahnkahet.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_anubarak.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_hadronox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_krikthir_the_gatewatcher.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\def_azjol_nerub.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\instance_azjol_nerub.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Drak&apos;Tharon Keep"
+ >
+ </Filter>
+ <Filter
+ Name="Gundrak"
+ >
+ </Filter>
+ <Filter
+ Name="Nexus"
+ >
+ <Filter
+ Name="Nexus"
+ >
+ </Filter>
+ <Filter
+ Name="Oculus"
+ >
+ </Filter>
+ <Filter
+ Name="Eye of Eternity"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Violet Hold"
+ >
+ </Filter>
+ <Filter
+ Name="Ulduar"
+ >
+ <Filter
+ Name="Halls of Stone"
+ >
+ </Filter>
+ <Filter
+ Name="Halls of Lightning"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_ingvar_the_plunderer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_skarvald_dalronn.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Utgarde Pinnacle"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Obsidian Sanctum"
+ >
+ </Filter>
+ <Filter
+ Name="Vault of Archavon"
+ >
+ </Filter>
+ <Filter
Name="Scarlet Monastery"
>
<File
@@ -849,10 +1037,6 @@
>
</File>
<File
- RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
- >
- </File>
- <File
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
>
</File>
@@ -908,6 +1092,10 @@
RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_downs\razorfen_downs.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Shadowfang Keep"
@@ -1073,9 +1261,9 @@
Name="Thousand Needles"
>
<File
- RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp"
- >
- </File>
+ RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Silithus"
@@ -1237,9 +1425,9 @@
Name="Un&apos;Goro Crater"
>
<File
- RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp"
- >
- </File>
+ RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Aunchindoun"
@@ -1464,11 +1652,11 @@
>
</File>
<File
- RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp"
+ RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp"
>
</File>
<File
- RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp"
+ RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp"
>
</File>
</Filter>
@@ -1934,6 +2122,10 @@
</Filter>
<Filter
+ Name="Culling of Stratholme"
+ >
+ </Filter>
+ <Filter
Name="Old Hillsbrad"
>
<File
@@ -2130,21 +2322,13 @@
>
</File>
<File
- RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
- >
- </File>
- <File
- RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
- >
- </File>
- <File
RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp"
>
@@ -2152,7 +2336,7 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp"
>
@@ -2160,7 +2344,7 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp"
>
@@ -2172,11 +2356,19 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Loch Modan"
@@ -2237,10 +2429,6 @@
</File>
</Filter>
<File
- RelativePath="..\config.h"
- >
- </File>
- <File
RelativePath="..\ScriptMgr.cpp"
>
</File>
@@ -2249,10 +2437,6 @@
>
</File>
<File
- RelativePath="..\svn_revision.h"
- >
- </File>
- <File
RelativePath="..\system.cpp"
>
</File>
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index a2fcfb26af0..8fd97430dbc 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -47,15 +47,15 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="precompiled.h"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -73,7 +73,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb"
+ ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
@@ -215,7 +215,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -241,7 +241,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC80\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC80\trinitycore__$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb"
+ ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/TrinityScript.lib"
TargetMachine="17"
@@ -408,6 +408,26 @@
</File>
</Filter>
<Filter
+ Name="examples"
+ >
+ <File
+ RelativePath="..\scripts\examples\example_creature.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_escort.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_gossip_codebox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_misc.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
Name="guard"
>
<File
@@ -458,18 +478,6 @@
<Filter
Name="custom"
>
- <File
- RelativePath="..\scripts\custom\custom_example.cpp"
- >
- </File>
- <File
- RelativePath="..\scripts\custom\custom_gossip_codebox.cpp"
- >
- </File>
- <File
- RelativePath="..\scripts\custom\test.cpp"
- >
- </File>
</Filter>
<Filter
Name="areatrigger"
@@ -494,10 +502,6 @@
RelativePath="..\scripts\item\item_scripts.cpp"
>
</File>
- <File
- RelativePath="..\scripts\item\item_test.cpp"
- >
- </File>
</Filter>
<Filter
Name="zone"
@@ -755,6 +759,190 @@
>
</Filter>
<Filter
+ Name="Borean Tundra"
+ >
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Howling Fjord"
+ >
+ </Filter>
+ <Filter
+ Name="Crystalsong Forest"
+ >
+ </Filter>
+ <Filter
+ Name="Dalaran"
+ >
+ </Filter>
+ <Filter
+ Name="Dragonblight"
+ >
+ </Filter>
+ <Filter
+ Name="Grizzly Hills"
+ >
+ </Filter>
+ <Filter
+ Name="Icecrown"
+ >
+ </Filter>
+ <Filter
+ Name="Sholazar Basin"
+ >
+ </Filter>
+ <Filter
+ Name="The Storm Peaks"
+ >
+ </Filter>
+ <Filter
+ Name="Zul&apos;Drak"
+ >
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <Filter
+ Name="Ahn&apos;kahet"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_amanitar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_elder_nadox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_herald_volazj.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_jedoga_shadowseeker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_prince_taldaram.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\def_ahnkahet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\instance_ahnkahet.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_anubarak.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_hadronox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_krikthir_the_gatewatcher.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\def_azjol_nerub.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\instance_azjol_nerub.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Drak&apos;Tharon Keep"
+ >
+ </Filter>
+ <Filter
+ Name="Gundrak"
+ >
+ </Filter>
+ <Filter
+ Name="Nexus"
+ >
+ <Filter
+ Name="Nexus"
+ >
+ </Filter>
+ <Filter
+ Name="Oculus"
+ >
+ </Filter>
+ <Filter
+ Name="Eye of Eternity"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Violet Hold"
+ >
+ </Filter>
+ <Filter
+ Name="Ulduar"
+ >
+ <Filter
+ Name="Halls of Stone"
+ >
+ </Filter>
+ <Filter
+ Name="Halls of Lightning"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_ingvar_the_plunderer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_skarvald_dalronn.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Utgarde Pinnacle"
+ >
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Obsidian Sanctum"
+ >
+ </Filter>
+ <Filter
+ Name="Vault of Archavon"
+ >
+ </Filter>
+ <Filter
Name="Scarlet Monastery"
>
<File
@@ -1026,10 +1214,6 @@
>
</File>
<File
- RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
- >
- </File>
- <File
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
>
</File>
@@ -1085,6 +1269,10 @@
RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_downs\razorfen_downs.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Shadowfang Keep"
@@ -1250,9 +1438,9 @@
Name="Thousand Needles"
>
<File
- RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp"
- >
- </File>
+ RelativePath="..\scripts\zone\thousand_needles\thousand_needles.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Silithus"
@@ -1414,9 +1602,9 @@
Name="Un&apos;Goro Crater"
>
<File
- RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp"
- >
- </File>
+ RelativePath="..\scripts\zone\ungoro_crater\ungoro_crater.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Aunchindoun"
@@ -1641,11 +1829,11 @@
>
</File>
<File
- RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp"
+ RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp"
>
</File>
<File
- RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_vazruden_the_herald.cpp"
+ RelativePath="..\scripts\zone\hellfire_citadel\hellfire_ramparts\boss_watchkeeper_gargolmar.cpp"
>
</File>
</Filter>
@@ -2111,6 +2299,10 @@
</Filter>
<Filter
+ Name="Culling of Stratholme"
+ >
+ </Filter>
+ <Filter
Name="Old Hillsbrad"
>
<File
@@ -2307,21 +2499,13 @@
>
</File>
<File
- RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
- >
- </File>
- <File
- RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
- >
- </File>
- <File
RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp"
>
@@ -2329,7 +2513,7 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp"
>
@@ -2337,7 +2521,7 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp"
>
@@ -2349,11 +2533,19 @@
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp"
>
- </File>
+ </File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Loch Modan"
@@ -2430,10 +2622,6 @@
</File>
</Filter>
<File
- RelativePath="..\config.h"
- >
- </File>
- <File
RelativePath="..\ScriptMgr.cpp"
>
</File>
@@ -2442,10 +2630,6 @@
>
</File>
<File
- RelativePath="..\svn_revision.h"
- >
- </File>
- <File
RelativePath="..\system.cpp"
>
</File>
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 8e8c9b58ca4..57b7db8f253 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="TrinityScript"
ProjectGUID="{4295C8A9-79B7-4354-8064-F05FB9CA0C96}"
RootNamespace="ScriptDev2"
@@ -47,7 +47,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -55,7 +55,7 @@
PrecompiledHeaderThrough="precompiled.h"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
+ DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -73,7 +73,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb"
+ ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
@@ -216,7 +216,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\..\..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_WINDOWS;_USRDLL;SCRIPT"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -242,7 +242,7 @@
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\zthread__$(PlatformName)_$(ConfigurationName);..\..\..\..\win\VC90\trinitycore__$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/MaNGOSScript.pdb"
+ ProgramDatabaseFile="$(OutDir)/TrinityScript.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
@@ -267,6 +267,9 @@
<Tool
Name="VCAppVerifierTool"
/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
</Configuration>
<Configuration
Name="Release|x64"
@@ -348,6 +351,9 @@
<Tool
Name="VCAppVerifierTool"
/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
</Configuration>
</Configurations>
<References>
@@ -401,6 +407,26 @@
</File>
</Filter>
<Filter
+ Name="examples"
+ >
+ <File
+ RelativePath="..\scripts\examples\example_creature.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_escort.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_gossip_codebox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\examples\example_misc.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
Name="guard"
>
<File
@@ -452,15 +478,11 @@
Name="custom"
>
<File
- RelativePath="..\scripts\custom\custom_example.cpp"
- >
- </File>
- <File
- RelativePath="..\scripts\custom\custom_gossip_codebox.cpp"
+ RelativePath="..\scripts\custom\npc_acherus_taxi.cpp"
>
</File>
<File
- RelativePath="..\scripts\custom\test.cpp"
+ RelativePath="..\scripts\custom\npc_wyrmresttempel_taxi.cpp"
>
</File>
</Filter>
@@ -487,10 +509,6 @@
RelativePath="..\scripts\item\item_scripts.cpp"
>
</File>
- <File
- RelativePath="..\scripts\item\item_test.cpp"
- >
- </File>
</Filter>
<Filter
Name="zone"
@@ -748,6 +766,438 @@
>
</Filter>
<Filter
+ Name="Borean Tundra"
+ >
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Howling Fjord"
+ >
+ </Filter>
+ <Filter
+ Name="Crystalsong Forest"
+ >
+ </Filter>
+ <Filter
+ Name="Dalaran"
+ >
+ </Filter>
+ <Filter
+ Name="Dragonblight"
+ >
+ </Filter>
+ <Filter
+ Name="Grizzly Hills"
+ >
+ </Filter>
+ <Filter
+ Name="Icecrown"
+ >
+ </Filter>
+ <Filter
+ Name="Sholazar Basin"
+ >
+ </Filter>
+ <Filter
+ Name="The Storm Peaks"
+ >
+ </Filter>
+ <Filter
+ Name="Zul&apos;Drak"
+ >
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <Filter
+ Name="Ahn&apos;kahet"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_amanitar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_elder_nadox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_herald_volazj.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_jedoga_shadowseeker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\boss_prince_taldaram.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\def_ahnkahet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\ahnkahet\instance_ahnkahet.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Azjol-Nerub"
+ >
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_anubarak.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_hadronox.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\boss_krikthir_the_gatewatcher.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\def_azjol_nerub.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\azjol_nerub\azjol_nerub\instance_azjol_nerub.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Drak&apos;Tharon Keep"
+ >
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\boss_dred.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\boss_novos.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\boss_tharon_ja.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\boss_trollgore.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\def_drak_tharon_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\draktharon_keep\instance_drak_tharon_keep.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Gundrak"
+ >
+ <File
+ RelativePath="..\scripts\zone\gundrak\boss_drakkari_colossus.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\boss_eck.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\boss_gal_darah.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\boss_moorabi.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\boss_slad_ran.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\def_gundrak.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\gundrak\instance_gundrak.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Nexus"
+ >
+ <Filter
+ Name="Nexus"
+ >
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Oculus"
+ >
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\boss_drakos.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\boss_eregos.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\boss_urom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\boss_varos.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\def_oculus.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\oculus\instance_oculus.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Eye of Eternity"
+ >
+ <File
+ RelativePath="..\scripts\zone\nexus\eye_of_eternity\boss_malygos.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\eye_of_eternity\def_eye_of_eternity.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\nexus\eye_of_eternity\instance_eye_of_eternity.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Violet Hold"
+ >
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_cyanigosa.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_erekem.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_ichoron.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_lavanthor.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_moragg.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_xevozz.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\boss_zuramat.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\def_violet_hold.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\violet_hold\instance_violet_hold.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ulduar"
+ >
+ <Filter
+ Name="Halls of Stone"
+ >
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_krystallus.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_maiden_of_grief.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_stone\boss_sjonnir.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_stone\def_halls_of_stone.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_stone\instance_halls_of_stone.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Halls of Lightning"
+ >
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_bjarngrim.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_ionar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_loken.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\boss_volkhan.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\def_halls_of_lightning.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\ulduar\halls_of_lightning\instance_halls_of_lightning.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <Filter
+ Name="Utgarde Keep"
+ >
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_ingvar_the_plunderer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_keleseth.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\boss_skarvald_dalronn.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\instance_utgarde_keep.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Utgarde Pinnacle"
+ >
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_palehoof.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_skadi.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_svala.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\boss_ymiron.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\def_pinnacle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\utgarde_keep\utgarde_pinnacle\instance_pinnacle.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Obsidian Sanctum"
+ >
+ <File
+ RelativePath="..\scripts\zone\obsidian_sanctum\boss_sartharion.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\obsidian_sanctum\def_obsidian_sanctum.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\obsidian_sanctum\instance_obsidian_sanctum.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Vault of Archavon"
+ >
+ <File
+ RelativePath="..\scripts\zone\vault_of_archavon\boss_archavon.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\vault_of_archavon\def_vault_of_archavon.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\vault_of_archavon\instance_vault_of_archavon.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
Name="Scarlet Monastery"
>
<File
@@ -1019,10 +1469,6 @@
>
</File>
<File
- RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
- >
- </File>
- <File
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
>
</File>
@@ -1078,6 +1524,10 @@
RelativePath="..\scripts\zone\razorfen_downs\boss_amnennar_the_coldbringer.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\razorfen_downs\razorfen_downs.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Shadowfang Keep"
@@ -2102,7 +2552,34 @@
>
</File>
</Filter>
-
+ <Filter
+ Name="Culling of Stratholme"
+ >
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_epoch.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_mal_ganis.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_meathook.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\boss_salramm.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\def_culling_of_stratholme.h"
+ >
+ </File>
+ <File
+ RelativePath="..\scripts\zone\caverns_of_time\culling_of_stratholme\instance_culling_of_stratholme.cpp"
+ >
+ </File>
+ </Filter>
<Filter
Name="Old Hillsbrad"
>
@@ -2423,10 +2900,6 @@
</File>
</Filter>
<File
- RelativePath="..\config.h"
- >
- </File>
- <File
RelativePath="..\ScriptMgr.cpp"
>
</File>
@@ -2435,10 +2908,6 @@
>
</File>
<File
- RelativePath="..\svn_revision.h"
- >
- </File>
- <File
RelativePath="..\system.cpp"
>
</File>
diff --git a/src/bindings/scripts/docs/EventAI.txt b/src/bindings/scripts/docs/EventAI.txt
index 37064b63e8b..3dac5c271e8 100644
--- a/src/bindings/scripts/docs/EventAI.txt
+++ b/src/bindings/scripts/docs/EventAI.txt
@@ -42,7 +42,7 @@ action3_param3
All params are signed 32 bit values (+/- 2147483647). If param specifies time then time is in milliseconds. If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%)
-*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase).
+*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase).
=========================================
Event Types
@@ -56,22 +56,24 @@ Events will not repeat until the creature exits combat unless EFLAG_REPEATABLE i
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only in combat.
1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only out of combat.
-2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
-3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
-4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat).
+2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat).
5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between every (Param1) and (Param2).
-6 EVENT_T_DEATH NONE Expires upon Death of the Creature.
+6 EVENT_T_DEATH NONE Expires upon Death of the Creature.
7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode().
8 EVENT_T_SPELLHIT SpellID, School, RepeatMin, RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school (-1 for all). Will repeat every (Param3) and (Param4) .
9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) .
-10 EVENT_T_OOC_LOS NoHostile, NoFriendly, RepeatMin, RepeatMax Expires when a Player moves within visible distance to creature. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4) . Does not expire for creatures or pet or when the creature is in combat.
+10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a Unit moves within distance(MaxAllowedRange) to creature. If Param1=0 it will expire if Unit are Hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction). Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat.
11 EVENT_T_SPAWNED NONE Expires at initial spawn and at creature respawn (useful for setting ranged movement type)
-12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) .
+12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) .
13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) .
14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (param1) hp missing. Will repeat every (Param3) and (Param4) .
15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) .
16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) .
-17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
+17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3).
+18 EVENT_T_TARGET_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax
+21 EVENT_T_REACHED_HOME NONE Expires when creature reach it's home(spawn) location after Evade.
=========================================
Action Types
@@ -83,8 +85,8 @@ Params are always read from Param1, then Param2, then Param3.
(# Internal Name Param usage Discription)
0 ACTION_T_NONE No Action Does Nothing
1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the text table itself(say, yell, whisper, etc) along with other options for the text. All values are required to be negative.
-2 ACTION_T_YELL UNUSED
-3 ACTION_T_TEXTEMOTE UNUSED
+2 ACTION_T_SET_FACTION FactionId Change faction for creature. If param1==0, creature will revert to default faction.
+3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set model from creature_template.entry(param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature.
4 ACTION_T_SOUND SoundId Plays Sound
5 ACTION_T_EMOTE EmoteId Does emote
6 ACTION_T_RANDOM_SAY UNUSED
@@ -93,7 +95,7 @@ Params are always read from Param1, then Param2, then Param3.
9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays random sound between 3 params*
10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes random emote between 3 params
11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types)
-12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature.
+12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature.
13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies threat by (param1) on target type (param2)
14 ACTION_T_THREAT_ALL_PCT Threat% Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump)
15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (param1) for target type (Param2)
@@ -113,7 +115,7 @@ Params are always read from Param1, then Param2, then Param3.
29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance.
30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets the phase to the id between 3 params*
31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin.
-32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
+32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (param1) for target of type (param2)
34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (param1) and data (param2)
35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
@@ -135,7 +137,7 @@ BOTH - This event can trigger both in and out of combat.
Events that do not have lables on them are events that are directly involved with the in and out of combat state.
------------------
-0 = EVENT_T_TIMER:
+0 = EVENT_T_TIMER:
------------------
Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
@@ -153,7 +155,7 @@ Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
+OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
This is commonly used for events that occur and repeat outside of combat.
---------------
@@ -164,7 +166,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee).
-----------------
@@ -175,7 +177,7 @@ Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee).
------------------
@@ -189,7 +191,7 @@ This Event Expires upon initial aggro (does not repeat).
Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2).
+COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2).
This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player.
------------------
@@ -201,7 +203,7 @@ This is commonly used for NPC's who have a yell on death or cast some kind if su
------------------
7 = EVENT_T_EVADE:
------------------
-This Event Expires upon the creature EnterEvadeMode().
+This Event Expires upon the creature EnterEvadeMode().
This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior.
---------------------
@@ -224,7 +226,7 @@ Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
-This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance.
+This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance.
---------------------
10 = EVENT_T_OOC_LOS:
@@ -234,7 +236,7 @@ Parameter 2: NoFriendly - This Value is to Prevent this Action from Expiring Whe
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-OUT OF COMBAT ONLY! - Expires when a Player moves within visible distance to the NPC. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4). Does not expire for creatures or pets when they are in combat.
+OUT OF COMBAT ONLY! - Expires when a Player moves within visible distance to the NPC. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4). Does not expire for creatures or pets when they are in combat.
This Event is commonly used for NPC's who Do Something or Say Something when you walk past them Out of Combat.
---------------------
@@ -251,7 +253,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
+COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low.
----------------------------
@@ -260,7 +262,7 @@ This Event is commonly used for NPC's who have a special ability (Like Execute)
Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
+COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell.
-------------------------
@@ -282,7 +284,7 @@ Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Fr
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
+COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled
--------------------------
@@ -303,9 +305,15 @@ Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to tr
Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
-BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
+BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events.
+---------------------------
+21 = EVENT_T_REACHED_HOME:
+---------------------------
+Expires only when creature has returned to it's home location after Evade. Out of combat event.
+Most commonly used to cast spells that can not be casted in EVENT_T_EVADE and other effects that does not fit in while still running back to spawn/home location.
+
=========================================
Action Types
@@ -322,15 +330,20 @@ Parameter 1: The entry of the text that the NPC should use from eventai_texts ta
Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
+See Text-tables.txt for documentation of eventai_texts-table.
+
------------------
-2 = ACTION_T_YELL:
+2 = ACTION_T_SET_FACTION:
------------------
-UNUSED Can be reused to create new action type
+Parameter 1: FactionId from Faction.dbc OR 0. Changes faction for creature. If 0, creature will revert to it's default faction if previously changed.
-----------------------
-3 = ACTION_T_TEXTEMOTE:
+3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
-----------------------
-UNUSED Can be reused to create new action type
+Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using.
+Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used)
+
+If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model.
-------------------
4 = ACTION_T_SOUND:
@@ -368,16 +381,16 @@ UNUSED Can be reused to create new action type
--------------------------
Parameter 1: The Sound ID to be played as Random Choice #1.
Parameter 2: The Sound ID to be played as Random Choice #2.
-Parameter 3: The Sound ID to be played as Random Choice #3.
+Parameter 3: The Sound ID to be played as Random Choice #3.
-Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
+Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
---------------------------
10 = ACTION_T_RANDOM_EMOTE:
---------------------------
Parameter 1: The Emote ID to be played as Random Choice #1.
Parameter 2: The Emote ID to be played as Random Choice #2.
-Parameter 3: The Emote ID to be played as Random Choice #3.
+Parameter 3: The Emote ID to be played as Random Choice #3.
Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform.
@@ -388,26 +401,26 @@ Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used i
Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below.
Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0.
-The creature will cast a spell specified by a spell ID on a target specified by the target type.
+The creature will cast a spell specified by a spell ID on a target specified by the target type.
This is commonly used for NPC's who cast spells.
---------------------
12 = ACTION_T_SUMMON:
---------------------
Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
-Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below.
-Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0.
+Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0.
-The NPC will Summon another creature at the same spot as itself that will attack the specified target.
+The NPC will Summon another creature at the same spot as itself that will attack the specified target.
NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works.
NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone.
-NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
+NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
This is used as a manual way to force an NPC to Summon.
--------------------------------
13 = ACTION_T_THREAT_SINGLE_PCT:
--------------------------------
Parameter 1: Threat% - Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added.
-Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below.
This action will modify the threat of a target in the creature's threat list by the specified percent.
This is commonly used to allow an NPC to adjust the Threat to a single player.
@@ -415,7 +428,7 @@ This is commonly used to allow an NPC to adjust the Threat to a single player.
-----------------------------
14 = ACTION_T_THREAT_ALL_PCT:
-----------------------------
-Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100.
+Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100.
This action will modify the threat for everyone in the creature's threat list by the specified percent.
NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list.
@@ -425,10 +438,10 @@ This is commonly used to allow an NPC to drop threat for all players to zero.
15 = ACTION_T_QUEST_EVENT:
--------------------------
Parameter 1: QuestID - The Quest Template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action.
-Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below.
-This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
-NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
+This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
+NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
This is commonly used for Quests where only ONE player will gain credit for the quest.
-----------------------------
@@ -436,9 +449,9 @@ This is commonly used for Quests where only ONE player will gain credit for the
-----------------------------
Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID.
-Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
-This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
+This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest.
-----------------------------
@@ -446,7 +459,7 @@ This is commonly used for NPC's who have a special requirement to have a Spell c
-----------------------------
Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields.
Parameter 2: Value - The new value to be put in the field.
-Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data)
@@ -454,31 +467,31 @@ When activated, this action can change the target's unit field values. More info
18 = ACTION_T_SET_UNIT_FLAG:
----------------------------
Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
-Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
-When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used.
+When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used.
-------------------------------
19 = ACTION_T_REMOVE_UNIT_FLAG:
-------------------------------
Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
-Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
+Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below.
-When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used.
+When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used.
--------------------------
20 = ACTION_T_AUTO_ATTACK:
--------------------------
-Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped.
+Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped.
-This action controls whether or not the creature should stop or start the auto melee attack.
+This action controls whether or not the creature should stop or start the auto melee attack.
NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee).
This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters.
------------------------------
21 = ACTION_T_COMBAT_MOVEMENT:
------------------------------
-Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
+Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
This action controls whether or not the creature will always move towards its target.
NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
@@ -487,7 +500,7 @@ This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who
------------------------
22 = ACTION_T_SET_PHASE:
------------------------
-Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error.
+Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error.
When activated, this action sets the creature's event to the specified value.
NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET.
@@ -497,20 +510,20 @@ This is commonly used for complex scripts with several phases and you need to sw
------------------------
23 = ACTION_T_INC_PHASE:
------------------------
-Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
+Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
-When activated, this action will increase (or decrease) the current creature's phase.
-NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
+When activated, this action will increase (or decrease) the current creature's phase.
+NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases.
--------------------
24 = ACTION_T_EVADE:
--------------------
-When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter.
+When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter.
NOTE: All Param Values Are 0 for this Action.
-------------------
-25 = ACTION_T_FLEE:
+25 = ACTION_T_FLEE:
-------------------
When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away". A Better Flee system is in Development but will take time before it is implimented.
NOTE: All Param Values Are 0 for this Action.
@@ -518,47 +531,47 @@ NOTE: All Param Values Are 0 for this Action.
------------------------------
26 = ACTION_T_QUEST_EVENT_ALL:
------------------------------
-Parameter 1: QuestId - The quest ID to finish for everyone.
+Parameter 1: QuestId - The quest ID to finish for everyone.
-This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list.
-NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
+This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list.
+NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
---------------------------------
27 = ACTION_T_CASTCREATUREGO_ALL:
---------------------------------
Parameter 1: QuestId - The quest template ID.
-Parameter 2: SpellId - The spell ID used to simulate the cast.
+Parameter 2: SpellId - The spell ID used to simulate the cast.
-This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list.
-NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
+This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list.
+NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
-----------------------------------
28 = ACTION_T_REMOVEAURASFROMSPELL:
-----------------------------------
Parameter 1: Target - The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
-Parameter 2: SpellId - The spell ID whose auras will be removed.
+Parameter 2: SpellId - The spell ID whose auras will be removed.
-This action will remove all auras from a specific spell from the target.
+This action will remove all auras from a specific spell from the target.
This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift)
------------------------------
29 = ACTION_T_RANGED_MOVEMENT:
------------------------------
Parameter 1: Distance - The distance the mob should keep between it and its target.
-Parameter 2: Angle - The angle the mob should use.
+Parameter 2: Angle - The angle the mob should use.
-This action changes the movement type generator to ranged type using the specified values for angle and distance.
-NOTE: Specifying zero angle and distance will make it just melee instead.
-This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
+This action changes the movement type generator to ranged type using the specified values for angle and distance.
+NOTE: Specifying zero angle and distance will make it just melee instead.
+This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
---------------------------
30 = ACTION_T_RANDOM_PHASE:
---------------------------
Parameter 1: PhaseId1 - A possible random phase choice.
Parameter 2: PhaseId2 - A possible random phase choice.
-Parameter 3: PhaseId3 - A possible random phase choice.
+Parameter 3: PhaseId3 - A possible random phase choice.
-Randomly sets the phase to one from the three parameter choices.
+Randomly sets the phase to one from the three parameter choices.
NOTE: Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2)
NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases.
@@ -567,9 +580,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a
31 = ACTION_T_RANDOM_PHASE_RANGE:
---------------------------------
Parameter 1: PhaseMin - The minimum of the phase range.
-Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
+Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
-Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax).
+Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax).
NOTE: PhaseMax must be greater than PhaseMin.
NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30.
@@ -579,9 +592,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a
---------------------
Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID.
Parameter 2: Target - The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone.
-Parameter 3: SummonID - The summon ID from the eventai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at.
+Parameter 3: SummonID - The summon ID from the eventai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at.
-Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
+Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
NOTE: Param3 Value is the ID Value used for the entry used in EventAI_Summons for this action. You MUST have an EventAI_Summons entry to use this action.
This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events)
@@ -589,9 +602,9 @@ This is commonly used for NPC's who need to Summon a creature at a specific loca
33 = ACTION_T_KILLED_MONSTER:
-----------------------------
Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID.
-Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
-When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates).
+When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates).
NOTE: It can be ANY creature including certain quest specific triggers
This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit)
@@ -601,7 +614,7 @@ This is commonly used for giving the player Quest Credits for NPC kills (Many NP
Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
Parameter 2: Data - The value to put at that field index.
-Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
+Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
NOTE: Param1 Value is located in "def_<instance name>.h" SD2 File and Param2 value is generally found in the "sc_instance.h" file in SD2
This is commonly used to link an ACID script with a SD2 C++ Script. You make make things happen like opening doors on specific events that happen. ACID Just triggers the C++ Script to function.
@@ -609,30 +622,30 @@ This is commonly used to link an ACID script with a SD2 C++ Script. You make mak
35 = ACTION_T_SET_INST_DATA64:
------------------------------
Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
-Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below.
+Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below.
-Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
+Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
------------------------------
36 = ACTION_T_UPDATE_TEMPLATE:
------------------------------
Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID.
-Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
+Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
-This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry.
+This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry.
Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
------------------
37 = ACTION_T_DIE:
------------------
Kills the creature
-This is commonly used if you need to Instakill the creature for one reason or another.
+This is commonly used if you need to Instakill the creature for one reason or another.
--------------------------------
38 = ACTION_T_ZONE_COMBAT_PULSE:
--------------------------------
-Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
+Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
=========================================
@@ -666,7 +679,7 @@ Another example: the number "5" (101 in Binary, selecting first and third option
4 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself
5 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already.
-NOTE: You can add the numbers in the decimal column to combine flags.
+NOTE: You can add the numbers in the decimal column to combine flags.
For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10).
=========================================
@@ -684,4 +697,4 @@ Below is the list of current Event Flags that EventAI can handle. Event flags ar
6 64
7 128 EFLAG_DEBUG_ONLY Prevents events from occuring on Release builds of ScriptDev2. Useful for testing new features.
-NOTE: You can add the numbers in the decimal column to combine flags.
+NOTE: You can add the numbers in the decimal column to combine flags. \ No newline at end of file
diff --git a/src/bindings/scripts/docs/Text-tables.txt b/src/bindings/scripts/docs/Text-tables.txt
index 6db1ce9d852..2a539a72874 100644
--- a/src/bindings/scripts/docs/Text-tables.txt
+++ b/src/bindings/scripts/docs/Text-tables.txt
@@ -52,8 +52,8 @@ Below is the list of current Text types that texts tables can handle. These were
-----------------------------------------------------------
0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble).
1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID.
-2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log.
-3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses).
+2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log.
+3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses).
4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log.
5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses).
@@ -65,7 +65,7 @@ Below is the list of current Language types that are allowed.
This is the Race Language that the text is native to (So it will display properly)
# Internal Name Description
------------------------------------------------------------
+-----------------------------------------------------------
0 UNIVERSAL Text in this language is understood by ALL Races.
1 ORCISH Text in this language is understood ONLY by Horde Races.
2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race.
diff --git a/src/bindings/scripts/include/precompiled.cpp b/src/bindings/scripts/include/precompiled.cpp
index 9753d023374..75bfae9e1c4 100644
--- a/src/bindings/scripts/include/precompiled.cpp
+++ b/src/bindings/scripts/include/precompiled.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/include/precompiled.h b/src/bindings/scripts/include/precompiled.h
index cd6d68f9f31..2c36cc924e0 100644
--- a/src/bindings/scripts/include/precompiled.h
+++ b/src/bindings/scripts/include/precompiled.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -12,6 +12,7 @@
#include "GridNotifiersImpl.h"
#include "Unit.h"
#include "GameObject.h"
+#include "TemporarySummon.h"
#include "sc_creature.h"
#include "sc_gossip.h"
#include "sc_instance.h"
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index f04f757d43e..fcd44d94842 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
@@ -108,9 +108,9 @@ void ScriptedAI::AttackStart(Unit* who)
void ScriptedAI::UpdateAI(const uint32 diff)
{
//Check if we have a current target
- if (m_creature->isAlive() && UpdateVictim())
+ if (UpdateVictim())
{
- if (m_creature->isAttackReady() )
+ if (m_creature->isAttackReady())
{
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
@@ -206,23 +206,23 @@ void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target, bool Say
{
if (target)
{
- m_creature->Say(text, language, target->GetGUID());
+ m_creature->MonsterSay(text, language, target->GetGUID());
if(SayEmote)
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
}
- else m_creature->Say(text, language, 0);
+ else m_creature->MonsterSay(text, language, 0);
}
void ScriptedAI::DoYell(const char* text, uint32 language, Unit* target)
{
- if (target) m_creature->Yell(text, language, target->GetGUID());
- else m_creature->Yell(text, language, 0);
+ if (target) m_creature->MonsterYell(text, language, target->GetGUID());
+ else m_creature->MonsterYell(text, language, 0);
}
void ScriptedAI::DoTextEmote(const char* text, Unit* target, bool IsBossEmote)
{
- if (target) m_creature->TextEmote(text, target->GetGUID(), IsBossEmote);
- else m_creature->TextEmote(text, 0, IsBossEmote);
+ if (target) m_creature->MonsterTextEmote(text, target->GetGUID(), IsBossEmote);
+ else m_creature->MonsterTextEmote(text, 0, IsBossEmote);
}
void ScriptedAI::DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper)
@@ -230,24 +230,21 @@ void ScriptedAI::DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper)
if (!reciever || reciever->GetTypeId() != TYPEID_PLAYER)
return;
- m_creature->Whisper(text, reciever->GetGUID(), IsBossWhisper);
+ m_creature->MonsterWhisper(text, reciever->GetGUID(), IsBossWhisper);
}
-void ScriptedAI::DoPlaySoundToSet(Unit* unit, uint32 sound)
+void ScriptedAI::DoPlaySoundToSet(Unit* pSource, uint32 uiSoundId)
{
- if (!unit)
+ if (!pSource)
return;
- if (!GetSoundEntriesStore()->LookupEntry(sound))
+ if (!GetSoundEntriesStore()->LookupEntry(uiSoundId))
{
- error_log("SD2: Invalid soundId %u used in DoPlaySoundToSet (by unit TypeId %u, guid %u)", sound, unit->GetTypeId(), unit->GetGUID());
+ error_log("SD2: Invalid soundId %u used in DoPlaySoundToSet (by unit TypeId %u, guid %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUID());
return;
}
- WorldPacket data(4);
- data.SetOpcode(SMSG_PLAY_SOUND);
- data << uint32(sound);
- unit->SendMessageToSet(&data,false);
+ pSource->PlayDirectSound(uiSoundId);
}
Creature* ScriptedAI::DoSpawnCreature(uint32 id, float x, float y, float z, float angle, uint32 type, uint32 despawntime)
@@ -437,11 +434,9 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech
return false;
//Using the extended script system we first create a list of viable spells
- SpellEntry const* Spell[4];
- Spell[0] = 0;
- Spell[1] = 0;
- Spell[2] = 0;
- Spell[3] = 0;
+ SpellEntry const* Spell[CREATURE_MAX_SPELLS];
+ for (uint8 i=0;i<CREATURE_MAX_SPELLS;i++)
+ Spell[i] = 0;
uint32 SpellCount = 0;
@@ -449,7 +444,7 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech
SpellRangeEntry const* TempRange;
//Check if each spell is viable(set it to null if not)
- for (uint32 i = 0; i < 4; i++)
+ for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
{
TempSpell = GetSpellStore()->LookupEntry(m_creature->m_spells[i]);
@@ -493,13 +488,13 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* Target, int32 School, int32 Mech
continue;
//Check if the spell meets our range requirements
- if (RangeMin && TempRange->maxRange < RangeMin)
+ if (RangeMin && m_creature->GetSpellMinRangeForTarget(Target, TempRange) < RangeMin)
continue;
- if (RangeMax && TempRange->maxRange > RangeMax)
+ if (RangeMax && m_creature->GetSpellMaxRangeForTarget(Target, TempRange) > RangeMax)
continue;
//Check if our target is in range
- if (m_creature->IsWithinDistInMap(Target, TempRange->minRange) || !m_creature->IsWithinDistInMap(Target, TempRange->maxRange))
+ if (m_creature->IsWithinDistInMap(Target, m_creature->GetSpellMinRangeForTarget(Target, TempRange)) || !m_creature->IsWithinDistInMap(Target, m_creature->GetSpellMaxRangeForTarget(Target, TempRange)))
continue;
//All good so lets add it to the spell list
@@ -521,11 +516,11 @@ bool ScriptedAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered)
return false;
//Silenced so we can't cast
- if (!Triggered && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ if (!Triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return false;
//Check for power
- if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell->manaCost)
+ if (!Triggered && me->GetPower((Powers)Spell->powerType) < Spell->manaCost)
return false;
SpellRangeEntry const *TempRange = NULL;
@@ -537,20 +532,21 @@ bool ScriptedAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered)
return false;
//Unit is out of range of this spell
- if (m_creature->GetDistance(Target) > TempRange->maxRange || m_creature->GetDistance(Target) < TempRange->minRange)
+ if (me->GetDistance(Target) > me->GetSpellMaxRangeForTarget(Target, TempRange)
+ || me->GetDistance(Target) < me->GetSpellMinRangeForTarget(Target, TempRange))
return false;
return true;
}
-float GetSpellMaxRange(uint32 id)
+float GetSpellMaxRangeForHostile(uint32 id)
{
SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(id);
if(!spellInfo) return 0;
SpellRangeEntry const *range = GetSpellRangeStore()->LookupEntry(spellInfo->rangeIndex);
if(!range) return 0;
- return range->maxRange;
+ return range->maxRangeHostile;
}
void FillSpellSummary()
@@ -583,7 +579,7 @@ void FillSpellSummary()
//Spell targets AoE at enemy
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT ||
- TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_AROUND_CASTER ||
+ TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_CHANNELED )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_ENEMY-1);
@@ -592,7 +588,7 @@ void FillSpellSummary()
TempSpell->EffectImplicitTargetA[j] == TARGET_CURRENT_ENEMY_COORDINATES ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT ||
- TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_AROUND_CASTER ||
+ TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_CHANNELED )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_ENEMY-1);
@@ -605,7 +601,7 @@ void FillSpellSummary()
//Spell targets aoe friends
if ( TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER ||
TempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY ||
- TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_AROUND_CASTER)
+ TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER)
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_FRIEND-1);
//Spell targets any friend(or self)
@@ -614,7 +610,7 @@ void FillSpellSummary()
TempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_PARTY ||
TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER ||
TempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY ||
- TempSpell->EffectImplicitTargetA[j] == TARGET_ALL_AROUND_CASTER)
+ TempSpell->EffectImplicitTargetA[j] == TARGET_DEST_CASTER)
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_FRIEND-1);
//Make sure that this spell includes a damage effect
@@ -638,39 +634,6 @@ void FillSpellSummary()
}
}
-void ScriptedAI::DoZoneInCombat(Unit* pUnit)
-{
- if (!pUnit)
- pUnit = m_creature;
-
- Map *map = pUnit->GetMap();
-
- if (!map->IsDungeon()) //use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated
- {
- error_log("SD2: DoZoneInCombat call for map that isn't an instance (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0);
- return;
- }
-
- if (!pUnit->CanHaveThreatList() || pUnit->getThreatManager().isThreatListEmpty())
- {
- error_log("SD2: DoZoneInCombat called for creature that either cannot have threat list or has empty threat list (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0);
-
- return;
- }
-
- Map::PlayerList const &PlayerList = map->GetPlayers();
- for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (Player* i_pl = i->getSource())
- if (i_pl->isAlive())
- {
- pUnit->SetInCombatWith(i_pl);
- i_pl->SetInCombatWith(pUnit);
- pUnit->AddThreat(i_pl, 0.0f);
- }
- }
-}
-
void ScriptedAI::DoResetThreat()
{
if (!m_creature->CanHaveThreatList() || m_creature->getThreatManager().isThreatListEmpty())
@@ -741,7 +704,7 @@ Unit* FindCreature(uint32 entry, float range, Unit* Finder)
return NULL;
Creature* target = NULL;
Trinity::AllCreaturesOfEntryInRange check(Finder, entry, range);
- Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(target, check);
+ Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(Finder, target, check);
Finder->VisitNearbyObject(range, searcher);
return target;
}
@@ -752,7 +715,7 @@ GameObject* FindGameObject(uint32 entry, float range, Unit* Finder)
return NULL;
GameObject* target = NULL;
Trinity::AllGameObjectsWithEntryInGrid go_check(entry);
- Trinity::GameObjectSearcher<Trinity::AllGameObjectsWithEntryInGrid> searcher(target, go_check);
+ Trinity::GameObjectSearcher<Trinity::AllGameObjectsWithEntryInGrid> searcher(Finder, target, go_check);
Finder->VisitNearbyGridObject(range, searcher);
return target;
}
@@ -761,7 +724,7 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
{
Unit* pUnit = NULL;
Trinity::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
- Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(pUnit, u_check);
+ Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
m_creature->VisitNearbyObject(range, searcher);
return pUnit;
}
@@ -770,7 +733,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
{
std::list<Creature*> pList;
Trinity::FriendlyCCedInRange u_check(m_creature, range);
- Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(pList, u_check);
+ Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(m_creature, pList, u_check);
m_creature->VisitNearbyObject(range, searcher);
return pList;
}
@@ -779,7 +742,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s
{
std::list<Creature*> pList;
Trinity::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
- Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(pList, u_check);
+ Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(m_creature, pList, u_check);
m_creature->VisitNearbyObject(range, searcher);
return pList;
}
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index 40a331b7d6b..03194e9a3a9 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
@@ -11,7 +11,7 @@
#include "CreatureAI.h"
#include "Creature.h"
-float GetSpellMaxRange(uint32 id);
+float GetSpellMaxRangeForHostile(uint32 id);
class SummonList : std::list<uint64>
{
@@ -31,6 +31,16 @@ Unit* FindCreature(uint32 entry, float range, Unit* Finder);
//Get a single gameobject of given entry
GameObject* FindGameObject(uint32 entry, float range, Unit* Finder);
+struct PointMovement
+{
+ uint32 m_uiCreatureEntry;
+ uint32 m_uiPointId;
+ float m_fX;
+ float m_fY;
+ float m_fZ;
+ uint32 m_uiWaitTime;
+};
+
struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
{
ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), InCombat(false), IsFleeing(false) {}
@@ -138,9 +148,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
//Plays a sound to all nearby players
void DoPlaySoundToSet(Unit* unit, uint32 sound);
- //Places the entire map into combat with creature
- void DoZoneInCombat(Unit* pUnit = 0);
-
//Drops all threat to 0%. Does not remove players from the threat list
void DoResetThreat();
diff --git a/src/bindings/scripts/include/sc_gossip.h b/src/bindings/scripts/include/sc_gossip.h
index 74bc93694af..9665a7e1123 100644
--- a/src/bindings/scripts/include/sc_gossip.h
+++ b/src/bindings/scripts/include/sc_gossip.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+/* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
@@ -16,29 +16,38 @@
#define GOSSIP_TEXT_BROWSE_GOODS "I'd like to browse your goods."
#define GOSSIP_TEXT_TRAIN "Train me!"
-#define GOSSIP_TEXT_BANK "The Bank"
-#define GOSSIP_TEXT_WINDRIDER "Wind rider master"
-#define GOSSIP_TEXT_GRYPHON "Gryphon Master"
-#define GOSSIP_TEXT_BATHANDLER "Bat Handler"
-#define GOSSIP_TEXT_HIPPOGRYPH "Hippogryph Master"
-#define GOSSIP_TEXT_FLIGHTMASTER "Flight Master"
-#define GOSSIP_TEXT_AUCTIONHOUSE "Auction House"
-#define GOSSIP_TEXT_GUILDMASTER "Guild Master"
-#define GOSSIP_TEXT_INN "The Inn"
-#define GOSSIP_TEXT_MAILBOX "Mailbox"
-#define GOSSIP_TEXT_STABLEMASTER "Stable Master"
-#define GOSSIP_TEXT_WEAPONMASTER "Weapons Trainer"
-#define GOSSIP_TEXT_BATTLEMASTER "Battlemaster"
-#define GOSSIP_TEXT_CLASSTRAINER "Class Trainer"
-#define GOSSIP_TEXT_PROFTRAINER "Profession Trainer"
-#define GOSSIP_TEXT_OFFICERS "The officers` lounge"
+#define GOSSIP_TEXT_BANK "The bank"
+#define GOSSIP_TEXT_IRONFORGE_BANK "The bank of Ironforge"
+#define GOSSIP_TEXT_STORMWIND_BANK "The bank of Stormwind"
+#define GOSSIP_TEXT_WINDRIDER "The wind rider master"
+#define GOSSIP_TEXT_GRYPHON "The gryphon master"
+#define GOSSIP_TEXT_BATHANDLER "The bat handler"
+#define GOSSIP_TEXT_HIPPOGRYPH "The hippogryph master"
+#define GOSSIP_TEXT_ZEPPLINMASTER "The zeppelin master"
+#define GOSSIP_TEXT_DEEPRUNTRAM "The Deeprun Tram"
+#define GOSSIP_TEXT_FERRY "The Rut'theran Ferry"
+#define GOSSIP_TEXT_FLIGHTMASTER "The flight master"
+#define GOSSIP_TEXT_AUCTIONHOUSE "The auction house"
+#define GOSSIP_TEXT_GUILDMASTER "The guild master"
+#define GOSSIP_TEXT_INN "The inn"
+#define GOSSIP_TEXT_MAILBOX "The mailbox"
+#define GOSSIP_TEXT_STABLEMASTER "The stable master"
+#define GOSSIP_TEXT_WEAPONMASTER "The weapon master"
+#define GOSSIP_TEXT_OFFICERS "The officers' lounge"
+#define GOSSIP_TEXT_BATTLEMASTER "The battlemaster"
+#define GOSSIP_TEXT_BARBER "Barber"
+#define GOSSIP_TEXT_CLASSTRAINER "A class trainer"
+#define GOSSIP_TEXT_PROFTRAINER "A profession trainer"
+#define GOSSIP_TEXT_LEXICON "Lexicon of Power"
#define GOSSIP_TEXT_ALTERACVALLEY "Alterac Valley"
#define GOSSIP_TEXT_ARATHIBASIN "Arathi Basin"
#define GOSSIP_TEXT_WARSONGULCH "Warsong Gulch"
#define GOSSIP_TEXT_ARENA "Arena"
#define GOSSIP_TEXT_EYEOFTHESTORM "Eye of The Storm"
+#define GOSSIP_TEXT_STRANDOFANCIENT "Strand of the Ancients"
+#define GOSSIP_TEXT_DEATH_KNIGHT "Death Knight"
#define GOSSIP_TEXT_DRUID "Druid"
#define GOSSIP_TEXT_HUNTER "Hunter"
#define GOSSIP_TEXT_PRIEST "Priest"
@@ -57,18 +66,12 @@
#define GOSSIP_TEXT_FIRSTAID "First Aid"
#define GOSSIP_TEXT_HERBALISM "Herbalism"
#define GOSSIP_TEXT_LEATHERWORKING "Leatherworking"
-#define GOSSIP_TEXT_POISONS "Poisons"
#define GOSSIP_TEXT_TAILORING "Tailoring"
#define GOSSIP_TEXT_MINING "Mining"
#define GOSSIP_TEXT_FISHING "Fishing"
#define GOSSIP_TEXT_SKINNING "Skinning"
#define GOSSIP_TEXT_JEWELCRAFTING "Jewelcrafting"
-
-#define GOSSIP_TEXT_IRONFORGE_BANK "Bank of Ironforge"
-#define GOSSIP_TEXT_STORMWIND_BANK "Bank of Stormwind"
-#define GOSSIP_TEXT_DEEPRUNTRAM "Deeprun Tram"
-#define GOSSIP_TEXT_ZEPPLINMASTER "Zeppelin master"
-#define GOSSIP_TEXT_FERRY "Rut'theran Ferry"
+#define GOSSIP_TEXT_INSCRIPTION "Inscription"
// Skill defines
@@ -86,6 +89,7 @@
#define TRADESKILL_FISHING 12
#define TRADESKILL_SKINNING 13
#define TRADESKILL_JEWLCRAFTING 14
+#define TRADESKILL_INSCRIPTION 15
#define TRADESKILL_LEVEL_NONE 0
#define TRADESKILL_LEVEL_APPRENTICE 1
@@ -93,6 +97,7 @@
#define TRADESKILL_LEVEL_EXPERT 3
#define TRADESKILL_LEVEL_ARTISAN 4
#define TRADESKILL_LEVEL_MASTER 5
+#define TRADESKILL_LEVEL_GRAND_MASTER 6
// Gossip defines
diff --git a/src/bindings/scripts/include/sc_instance.h b/src/bindings/scripts/include/sc_instance.h
index 75a25490419..2f1cd3a16a6 100644
--- a/src/bindings/scripts/include/sc_instance.h
+++ b/src/bindings/scripts/include/sc_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
index 6767a8fe88b..1c1b7312cb3 100644
--- a/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
+++ b/src/bindings/scripts/scripts/areatrigger/areatrigger_scripts.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,7 +23,6 @@ EndScriptData */
/* ContentData
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
-at_test script test only
EndContentData */
#include "precompiled.h"
@@ -56,12 +55,6 @@ bool AreaTrigger_at_legion_teleporter(Player *player, AreaTriggerEntry *at)
return false;
}
-bool ATtest(Player *player, AreaTriggerEntry *at)
-{
- player->Say("Hi!",LANG_UNIVERSAL);
- return true;
-}
-
void AddSC_areatrigger_scripts()
{
Script *newscript;
@@ -70,10 +63,5 @@ void AddSC_areatrigger_scripts()
newscript->Name = "at_legion_teleporter";
newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter;
newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name="at_test";
- newscript->pAreaTrigger = &ATtest;
- newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
index eecd2595a68..08b374c443e 100644
--- a/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_emeriss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/boss/boss_lethon.cpp b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
index 721009ac68c..e387891efed 100644
--- a/src/bindings/scripts/scripts/boss/boss_lethon.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_lethon.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/boss/boss_taerar.cpp b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
index 57184aa4b98..0d046456523 100644
--- a/src/bindings/scripts/scripts/boss/boss_taerar.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_taerar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
index fca9bc4b15b..0cfbc37b374 100644
--- a/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
+++ b/src/bindings/scripts/scripts/boss/boss_ysondre.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index b1af88b948f..dc88ed98679 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1,1005 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Mob_Event_AI
-SD%Complete: 90
-SDComment: Database Event AI
-SDCategory: Creatures
-EndScriptData */
-
#include "precompiled.h"
-#include "mob_event_ai.h"
-#include "ObjectMgr.h"
-
-#define EVENT_UPDATE_TIME 500
-#define SPELL_RUN_AWAY 8225
-
-struct EventHolder
-{
- EventHolder(EventAI_Event p) : Event(p), Time(0), Enabled(true){}
-
- EventAI_Event Event;
- uint32 Time;
- bool Enabled;
-};
-
-struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
-{
- Mob_EventAI(Creature *c, std::list<EventHolder> pEventList) : ScriptedAI(c)
- {
- EventList = pEventList;
- Phase = 0;
- CombatMovementEnabled = true;
- MeleeEnabled = true;
- AttackDistance = 0;
- AttackAngle = 0.0f;
-
- //Handle Spawned Events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- ~Mob_EventAI()
- {
- EventList.clear();
- }
-
- //Variables used by EventAI for handling events
- std::list<EventHolder> EventList; //Holder for events (stores enabled, time, and eventid)
- uint32 EventUpdateTime; //Time between event updates
- uint32 EventDiff; //Time between the last event call
-
- //Variables used by Events themselves
- uint8 Phase; //Current phase, max 32 phases
- bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
- bool MeleeEnabled; //If we allow melee auto attack
- uint32 AttackDistance; //Distance to attack from
- float AttackAngle; //Angle of attack
- uint32 TimetoFleeLeft; //For fleeing
-
- bool ProcessEvent(EventHolder& pHolder, Unit* pActionInvoker = NULL)
- {
- if (!pHolder.Enabled || pHolder.Time)
- return false;
-
- //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
- if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
- return false;
-
- //Store random here so that all random actions match up
- uint32 rnd = rand();
-
- //Return if chance for event is not met
- if (pHolder.Event.event_chance <= rnd % 100)
- return false;
-
- union
- {
- uint32 param1;
- int32 param1_s;
- };
-
- union
- {
- uint32 param2;
- int32 param2_s;
- };
-
- union
- {
- uint32 param3;
- int32 param3_s;
- };
-
- union
- {
- uint32 param4;
- int32 param4_s;
- };
-
- param1 = pHolder.Event.event_param1;
- param2 = pHolder.Event.event_param2;
- param3 = pHolder.Event.event_param3;
- param4 = pHolder.Event.event_param4;
-
- //Check event conditions based on the event type, also reset events
- switch (pHolder.Event.event_type)
- {
- case EVENT_T_TIMER:
- {
- if (!InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TIMER_OOC:
- {
- if (InCombat)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_HP:
- {
- if (!InCombat || !m_creature->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_MANA:
- {
- if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
- return false;
-
- uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_AGGRO:
- {
- }
- break;
- case EVENT_T_KILL:
- {
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- case EVENT_T_DEATH:
- {
- }
- break;
- case EVENT_T_EVADE:
- {
- }
- break;
- case EVENT_T_SPELLHIT:
- {
- //Spell hit is special case, param1 and param2 handled within EventAI::SpellHit
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_RANGE:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_OOC_LOS:
- {
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SPAWNED:
- {
- }
- break;
- case EVENT_T_TARGET_HP:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
- return false;
-
- uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
-
- if (perc > param1 || perc < param2)
- return false;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_TARGET_CASTING:
- {
- if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
- return false;
-
- //Repeat Timers
- if (param1 == param2)
- {
- pHolder.Time = param1;
-
- }else if (param2 > param1)
- pHolder.Time = urand(param1, param2);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_HP:
- {
- if (!InCombat)
- return false;
-
- Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
-
- if (!pUnit)
- return false;
-
- pActionInvoker = pUnit;
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_IS_CC:
- {
- if (!InCombat)
- return false;
-
- std::list<Creature*> pList = DoFindFriendlyCC(param2);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_FRIENDLY_MISSING_BUFF:
- {
- std::list<Creature*> pList = DoFindFriendlyMissingBuff(param2, param1);
-
- //List is empty
- if (pList.empty())
- return false;
-
- //We don't really care about the whole list, just return first available
- pActionInvoker = *(pList.begin());
-
- //Repeat Timers
- if (param3 == param4)
- {
- pHolder.Time = param3;
-
- }else if (param4 > param3)
- pHolder.Time = urand(param3, param4);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_SUMMONED_UNIT:
- {
- //Prevent event from occuring on no unit or non creatures
- if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
- return false;
-
- //Creature id doesn't match up
- if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
- return false;
-
- //Repeat Timers
- if (param2 == param3)
- {
- pHolder.Time = param2;
-
- }else if (param3 > param2)
- pHolder.Time = urand(param2, param3);
- else
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- pHolder.Enabled = false;
- }
- }
- break;
- case EVENT_T_REACHED_HOME:
- {
- }
- break;
- default:
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
- break;
- }
-
- //Disable non-repeatable events
- if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
- pHolder.Enabled = false;
-
- //Process actions
- for (uint32 j = 0; j < MAX_ACTIONS; j++)
- ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
-
- return true;
- }
-
- inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
- {
- switch (rnd % 3)
- {
- case 0:
- return param1;
- break;
- case 1:
- return param2;
- break;
- case 2:
- return param3;
- break;
- }
- return 0;
- }
-
- inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker)
- {
- switch (Target)
- {
- case TARGET_T_SELF:
- return m_creature;
- break;
- case TARGET_T_HOSTILE:
- return m_creature->getVictim();
- break;
- case TARGET_T_HOSTILE_SECOND_AGGRO:
- return SelectUnit(SELECT_TARGET_TOPAGGRO,1);
- break;
- case TARGET_T_HOSTILE_LAST_AGGRO:
- return SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0);
- break;
- case TARGET_T_HOSTILE_RANDOM:
- return SelectUnit(SELECT_TARGET_RANDOM,0);
- break;
- case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
- return SelectUnit(SELECT_TARGET_RANDOM,1);
- break;
- case TARGET_T_ACTION_INVOKER:
- return pActionInvoker;
- break;
- default:
- return NULL;
- break;
- };
- }
-
- void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
- {
- switch (type)
- {
- case ACTION_T_TEXT:
- {
- if (!param1)
- return;
-
- uint32 temp = 0;
-
- if (param2 && param3)
- {
- switch( rand()%3 )
- {
- case 0: temp = param1; break;
- case 2: temp = param2; break;
- case 3: temp = param3; break;
- }
- }else if ( param2 && urand(0,1) )
- {
- temp = param2;
- }else
- {
- temp = param1;
- }
-
- if (temp)
- {
- Unit* target = NULL;
- Unit* owner = NULL;
-
- if (pActionInvoker)
- {
- if (pActionInvoker->GetTypeId() == TYPEID_PLAYER)
- target = pActionInvoker;
- else if (owner = pActionInvoker->GetOwner())
- {
- if (owner->GetTypeId() == TYPEID_PLAYER)
- target = owner;
- }
- }
- else if (target = m_creature->getVictim())
- {
- if (target->GetTypeId() != TYPEID_PLAYER)
- {
- if (owner = target->GetOwner())
- {
- if (owner->GetTypeId() == TYPEID_PLAYER)
- target = owner;
- }
- }
- }
-
- DoScriptText(temp, m_creature, target);
- }
- }
- break;
- case ACTION_T_SET_FACTION:
- {
- if (param1)
- m_creature->setFaction(param1);
- else
- {
- if (CreatureInfo const* ci = GetCreatureTemplateStore(m_creature->GetEntry()))
- {
- //if no id provided, assume reset and then use default
- if (m_creature->getFaction() != ci->faction_A)
- m_creature->setFaction(ci->faction_A);
- }
- }
- }
- break;
- case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
- {
- if (param1 || param2)
- {
- //set model based on entry from creature_template
- if (param1)
- {
- if (CreatureInfo const* ci = GetCreatureTemplateStore(param1))
- {
- //use default display
- if (ci->Modelid_A1)
- m_creature->SetDisplayId(ci->Modelid_A1);
- }
- }
- //if no param1, then use value from param2 (modelId)
- else
- m_creature->SetDisplayId(param2);
- }
- else
- m_creature->DeMorph();
- }
- break;
- case ACTION_T_SOUND:
- DoPlaySoundToSet(m_creature, param1);
- break;
- case ACTION_T_EMOTE:
- m_creature->HandleEmoteCommand(param1);
- break;
- case ACTION_T_RANDOM_SOUND:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- DoPlaySoundToSet(m_creature, temp);
- }
- break;
- case ACTION_T_RANDOM_EMOTE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- if (temp != 0xffffffff)
- m_creature->HandleEmoteCommand(temp);
- }
- break;
- case ACTION_T_CAST:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
- Unit* caster = m_creature;
-
- if (!target)
- return;
-
- //Cast is always triggered if target is forced to cast on self
- if (param3 & CAST_FORCE_TARGET_SELF)
- {
- param3 |= CAST_TRIGGERED;
- caster = target;
- }
-
- //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
- bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
-
- // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
- if(param3 & CAST_AURA_NOT_PRESENT)
- {
- for(uint8 i = 0; i < 3; ++i)
- if(target->HasAura(param1, i))
- return;
- }
-
- if (canCast)
- {
- const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
-
- //Verify that spell exists
- if (tSpell)
- {
- //Check if cannot cast spell
- if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
- !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
- {
- //Melee current victim if flag not set
- if (!(param3 & CAST_NO_MELEE_IF_OOM))
- {
- AttackDistance = 0;
- AttackAngle = 0;
-
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
-
- }else
- {
- //Interrupt any previous spell
- if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
- caster->InterruptNonMeleeSpells(false);
-
- caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
- }
-
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
- }
- }
- break;
- case ACTION_T_SUMMON:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- Creature* pCreature = NULL;
-
- if (param3)
- pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
- else pCreature = pCreature = DoSpawnCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_THREAT_SINGLE_PCT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- DoModifyThreatPercent(target, param1);
- }
- break;
- case ACTION_T_THREAT_ALL_PCT:
- {
- Unit* Temp = NULL;
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp)
- DoModifyThreatPercent(Temp, param1);
- }
- }
- break;
- case ACTION_T_QUEST_EVENT:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->AreaExploredOrEventHappens(param1);
- }
- break;
- case ACTION_T_CASTCREATUREGO:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- break;
- case ACTION_T_SET_UNIT_FIELD:
- {
- Unit* target = GetTargetByType(param3, pActionInvoker);
-
- if (param1 < OBJECT_END || param1 >= UNIT_END)
- return;
-
- if (target)
- target->SetUInt32Value(param1, param2);
- }
- break;
- case ACTION_T_SET_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->SetFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_REMOVE_UNIT_FLAG:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target)
- target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
- }
- break;
- case ACTION_T_AUTO_ATTACK:
- {
- if (param1)
- MeleeEnabled = true;
- else MeleeEnabled = false;
- }
- break;
- case ACTION_T_COMBAT_MOVEMENT:
- {
- CombatMovementEnabled = param1;
-
- //Allow movement (create new targeted movement gen if none exist already)
- if (CombatMovementEnabled)
- {
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- else
- {
- m_creature->GetMotionMaster()->MoveIdle();
- }
- }
- break;
- case ACTION_T_SET_PHASE:
- {
- Phase = param1;
- }
- break;
- case ACTION_T_INC_PHASE:
- {
- Phase += param1;
-
- if (Phase > 31)
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_EVADE:
- {
- EnterEvadeMode();
- }
- break;
- case ACTION_T_FLEE:
- {
- if(m_creature->HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
- break;
- TimetoFleeLeft = 8000;
- m_creature->DoFleeToGetAssistance();
- IsFleeing = true;
- }
- break;
- case ACTION_T_QUEST_EVENT_ALL:
- {
- Unit* Temp = NULL;
- if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
- {
- Temp = Unit::GetUnit((*m_creature),pActionInvoker->GetGUID());
- if( Temp )
- ((Player*)Temp)->GroupEventHappens(param1,m_creature);
- }
- }
- break;
- case ACTION_T_CASTCREATUREGO_ALL:
- {
- Unit* Temp = NULL;
-
- std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
- for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
- {
- Temp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
- if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
- ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
- }
- }
- break;
- case ACTION_T_REMOVEAURASFROMSPELL:
- {
- Unit* target = GetTargetByType(param1, pActionInvoker);
-
- if (target)
- target->RemoveAurasDueToSpell(param2);
- }
- break;
- case ACTION_T_RANGED_MOVEMENT:
- {
- AttackDistance = param1;
- AttackAngle = ((float)param2/180)*M_PI;
-
- if (CombatMovementEnabled)
- {
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
- }
- }
- break;
- case ACTION_T_RANDOM_PHASE:
- {
- uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
-
- Phase = temp;
- }
- break;
- case ACTION_T_RANDOM_PHASE_RANGE:
- {
- if (param2 > param1)
- {
- Phase = param1 + (rnd % (param2 - param1));
- }
- else if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
- }
- break;
- case ACTION_T_SUMMON_ID:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- //Duration
- Creature* pCreature = NULL;
-
- UNORDERED_MAP<uint32, EventAI_Summon>::iterator i = EventAI_Summon_Map.find(param3);
-
- if (i == EventAI_Summon_Map.end())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
- return;
- }
-
- if ((*i).second.SpawnTimeSecs)
- pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
- else pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!pCreature)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log( "SD2: EventAI failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
- }
- else if (param2 != TARGET_T_SELF && target)
- pCreature->AI()->AttackStart(target);
- }
- break;
- case ACTION_T_KILLED_MONSTER:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)target)->KilledMonster(param1, m_creature->GetGUID());
- }
- break;
- case ACTION_T_SET_INST_DATA:
- {
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData(param1, param2);
- }
- break;
- case ACTION_T_SET_INST_DATA64:
- {
- Unit* target = GetTargetByType(param2, pActionInvoker);
-
- if (!target)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- ScriptedInstance* pInst = (ScriptedInstance*)m_creature->GetInstanceData();
-
- if (!pInst)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- pInst->SetData64(param1, target->GetGUID());
- }
- break;
- case ACTION_T_UPDATE_TEMPLATE:
- {
- if (m_creature->GetEntry() == param1)
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
- }
- break;
- case ACTION_T_DIE:
- {
- if (m_creature->isDead())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
- m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- break;
- case ACTION_T_ZONE_COMBAT_PULSE:
- {
- if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
- {
- if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
- return;
- }
-
- DoZoneInCombat();
- }
- break;
case ACTION_T_SUMMON_GO:
{
GameObject* pObject = NULL;
@@ -1014,432 +13,3 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
}
}
break;
-
- // TRINITY ONLY
- case ACTION_T_SET_ACTIVE:
- m_creature->setActive(param1 ? true : false);
- break;
- case ACTION_T_SET_AGGRESSIVE:
- m_creature->SetReactState(ReactStates(param1));
- break;
- case ACTION_T_ATTACK_START_PULSE:
- AttackStart(m_creature->SelectNearestTarget((float)param1));
- break;
- }
- }
-
- void JustRespawned()
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Spawned Events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_SPAWNED:
- ProcessEvent(*i);
- break;
- }
- }
- }
-
- void Reset()
- {
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
-
- //Reset all events to enabled
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Reset all out of combat timers
- case EVENT_T_TIMER_OOC:
- {
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- }
- break;
- //default:
- //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
- //(*i).Enabled = true;
- //(*i).Time = 0;
- //break;
- }
- }
- }
-
- //when creature reach home after EnterEvadeMode
- void JustReachedHome()
- {
- m_creature->LoadCreaturesAddon();
-
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- if ((*i).Event.event_type == EVENT_T_REACHED_HOME)
- ProcessEvent(*i);
- }
-
- Reset();
- }
-
- void EnterEvadeMode()
- {
- ScriptedAI::EnterEvadeMode();
-
- IsFleeing = false;
-
- //Handle Evade events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- if ((*i).Event.event_type == EVENT_T_EVADE)
- ProcessEvent(*i);
- }
- }
-
- void JustDied(Unit* killer)
- {
- InCombat = false;
- IsFleeing = false;
- Reset();
-
- //Handle Evade events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Evade
- case EVENT_T_DEATH:
- ProcessEvent(*i, killer);
- break;
- }
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
-
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Kill
- case EVENT_T_KILL:
- ProcessEvent(*i, victim);
- break;
- }
- }
-
- }
-
- void JustSummoned(Creature* pUnit)
- {
- if (!pUnit)
- return;
-
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Summoned
- case EVENT_T_SUMMONED_UNIT:
- ProcessEvent(*i, pUnit);
- break;
- }
- }
- }
-
- void Aggro(Unit *who)
- {
- //Check for on combat start events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_AGGRO:
- (*i).Enabled = true;
- ProcessEvent(*i, who);
- break;
- //Reset all in combat timers
- case EVENT_T_TIMER:
- if ((*i).Event.event_param2 == (*i).Event.event_param1)
- {
- (*i).Time = (*i).Event.event_param1;
- (*i).Enabled = true;
- }else if ((*i).Event.event_param2 > (*i).Event.event_param1)
- {
- (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
- (*i).Enabled = true;
- }else if (EAI_ErrorLevel > 0)
- error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
- break;
- //All normal events need to be re-enabled and their time set to 0
- default:
- (*i).Enabled = true;
- (*i).Time = 0;
- break;
- }
- }
-
- EventUpdateTime = EVENT_UPDATE_TIME;
- EventDiff = 0;
- }
-
- void AttackStart(Unit *who)
- {
- if (!who)
- return;
-
- if (m_creature->Attack(who, MeleeEnabled))
- {
- //Begin melee attack if we are within range
-
- if (!InCombat)
- {
- InCombat = true;
- Aggro(who);
- }
-
- if (CombatMovementEnabled)
- {
- m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
- }
- else
- {
- m_creature->GetMotionMaster()->MoveIdle();
- }
- }
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || InCombat)
- return;
-
- //Check for OOC LOS Event
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_OOC_LOS:
- {
- if ((*i).Event.event_param1 && m_creature->IsHostileTo(who))
- break;
-
- if ((*i).Event.event_param2 && !m_creature->IsHostileTo(who))
- break;
-
- ProcessEvent(*i, who);
- }
- break;
- }
- }
-
- // do we need this?
- //if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
- // return;
-
- if(m_creature->canStartAttack(who))
- AttackStart(who);
- }
-
- void SpellHit(Unit* pUnit, const SpellEntry* pSpell)
- {
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- //Spell hit
- case EVENT_T_SPELLHIT:
- {
- //If spell id matches (or no spell id) & if spell school matches (or no spell school)
- if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
- if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
- ProcessEvent(*i, pUnit);
- }
- break;
- }
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Check if we are in combat (also updates calls threat update code)
- bool Combat = InCombat ? UpdateVictim() : false;
-
- //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
- if (!m_creature->isAlive())
- return;
-
- if (IsFleeing)
- {
- if(TimetoFleeLeft < diff)
- {
- m_creature->SetControlled(false, UNIT_STAT_FLEEING);
- m_creature->SetNoCallAssistance(false);
- m_creature->CallAssistance();
- if(m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- IsFleeing = false;
- }
- else
- TimetoFleeLeft -= diff;
-
- return;
- }
-
- //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
- if (EventUpdateTime < diff)
- {
- EventDiff += diff;
-
- //Check for range based events
- //if (m_creature->GetDistance(m_creature->getVictim()) >
- if (Combat)
- {
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- switch ((*i).Event.event_type)
- {
- case EVENT_T_RANGE:
- // in some cases this is called twice and victim may not exist in the second time
- if(m_creature->getVictim())
- {
- float dist = m_creature->GetDistance(m_creature->getVictim());
- if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
- ProcessEvent(*i);
- }
- break;
- }
- }
- }
-
- //Check for time based events
- for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
- {
- //Decrement Timers
- if ((*i).Time)
- {
- if ((*i).Time > EventDiff)
- {
- //Do not decrement timers if event cannot trigger in this phase
- if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
- (*i).Time -= EventDiff;
-
- //Skip processing of events that have time remaining
- continue;
- }
- else (*i).Time = 0;
- }
-
- //Events that are updated every EVENT_UPDATE_TIME
- switch ((*i).Event.event_type)
- {
- case EVENT_T_TIMER_OOC:
- ProcessEvent(*i);
- break;
- case EVENT_T_TIMER:
- case EVENT_T_MANA:
- case EVENT_T_HP:
- case EVENT_T_TARGET_HP:
- case EVENT_T_TARGET_CASTING:
- case EVENT_T_FRIENDLY_HP:
- if (Combat)
- ProcessEvent(*i);
- break;
- case EVENT_T_RANGE:
- if (Combat)
- {
- if (m_creature->IsWithinDistInMap(m_creature->getVictim(),(float)(*i).Event.event_param2))
- {
- if (m_creature->GetDistance(m_creature->getVictim()) >= (float)(*i).Event.event_param1)
- ProcessEvent(*i);
- }
- }
- break;
- }
- }
-
- EventDiff = 0;
- EventUpdateTime = EVENT_UPDATE_TIME;
- }
- else
- {
- EventDiff += diff;
- EventUpdateTime -= diff;
- }
-
- //Melee Auto-Attack
- if (Combat && MeleeEnabled)
- DoMeleeAttackIfReady();
-
- }
-};
-
-CreatureAI* GetAI_Mob_EventAI(Creature *pCreature)
-{
- //Select events by creature id
- std::list<EventHolder> EventList;
-
- //Find creature id in the Event map
- UNORDERED_MAP<uint32, std::vector<EventAI_Event> >::iterator CreatureEvents = EventAI_Event_Map.find(pCreature->GetEntry());
-
- if (CreatureEvents != EventAI_Event_Map.end())
- {
- std::vector<EventAI_Event>::iterator i;
-
- for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
- {
- //Debug check
-#ifndef _DEBUG
- if ((*i).event_flags & EFLAG_DEBUG_ONLY)
- continue;
-#endif
- if( pCreature->GetMap()->IsDungeon() )
- {
- if ((pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) || (!pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL))
- EventList.push_back(EventHolder(*i));
- continue;
- }
-
- EventList.push_back(EventHolder(*i));
- }
-
- //EventMap had events but they were not added because they must be for instance
- if (EventList.empty())
- {
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: CreatureId has events but no events added to list because of instance flags.", pCreature->GetEntry());
- }
- }
- else
- {
- if (EAI_ErrorLevel > 1)
- error_db_log("SD2: EventMap for Creature %u is empty but creature is using Mob_EventAI.", pCreature->GetEntry());
- }
-
- return new Mob_EventAI (pCreature, EventList);
-}
-
-void AddSC_mob_event()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "mob_eventai";
- newscript->GetAI = &GetAI_Mob_EventAI;
- newscript->RegisterSelf();
-}
-
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h
index 7b00d9d7942..9dc89f8cad3 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.h
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h
@@ -1,223 +1,5 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
-
#ifndef SC_EVENTAI_H
#define SC_EVENTAI_H
-
-#define MAX_ACTIONS 3
-
-enum Event_Types
-{
- EVENT_T_TIMER = 0, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_TIMER_OOC = 1, //InitialMin, InitialMax, RepeatMin, RepeatMax
- EVENT_T_HP = 2, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_MANA = 3, //ManaMax%,ManaMin% RepeatMin, RepeatMax
- EVENT_T_AGGRO = 4, //NONE
- EVENT_T_KILL = 5, //RepeatMin, RepeatMax
- EVENT_T_DEATH = 6, //NONE
- EVENT_T_EVADE = 7, //NONE
- EVENT_T_SPELLHIT = 8, //SpellID, School, RepeatMin, RepeatMax
- EVENT_T_RANGE = 9, //MinDist, MaxDist, RepeatMin, RepeatMax
- EVENT_T_OOC_LOS = 10, //NoHostile, NoFriendly, RepeatMin, RepeatMax
- EVENT_T_SPAWNED = 11, //NONE
- EVENT_T_TARGET_HP = 12, //HPMax%, HPMin%, RepeatMin, RepeatMax
- EVENT_T_TARGET_CASTING = 13, //RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_HP = 14, //HPDeficit, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_IS_CC = 15, //DispelType, Radius, RepeatMin, RepeatMax
- EVENT_T_FRIENDLY_MISSING_BUFF = 16, //SpellId, Radius, RepeatMin, RepeatMax
- EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
- EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
- EVENT_T_QUEST_ACCEPT = 19, //QuestID
- EVENT_T_QUEST_COMPLETE = 20, //
- EVENT_T_REACHED_HOME = 21, //NONE
-
- EVENT_T_END,
-};
-
-enum Action_Types
-{
- ACTION_T_NONE = 0, //No action
- ACTION_T_TEXT = 1, //-TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values.
- ACTION_T_SET_FACTION = 2, //FactionId (or 0 for default)
- ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3, //Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
- ACTION_T_SOUND = 4, //SoundId
- ACTION_T_EMOTE = 5, //EmoteId
- ACTION_T_RANDOM_SAY = 6, //UNUSED
- ACTION_T_RANDOM_YELL = 7, //UNUSED
- ACTION_T_RANDOM_TEXTEMOTE = 8, //UNUSED
- ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
- ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
- ACTION_T_CAST = 11, //SpellId, Target, CastFlags
- ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
- ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
- ACTION_T_THREAT_ALL_PCT = 14, //Threat%
- ACTION_T_QUEST_EVENT = 15, //QuestID, Target
- ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
- ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
- ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
- ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
- ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
- ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
- ACTION_T_SET_PHASE = 22, //Phase
- ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
- ACTION_T_EVADE = 24, //No Params
- ACTION_T_FLEE = 25, //No Params
- ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
- ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
- ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
- ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
- ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
- ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
- ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
- ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
- ACTION_T_SET_INST_DATA = 34, //Field, Data
- ACTION_T_SET_INST_DATA64 = 35, //Field, Target
- ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
- ACTION_T_DIE = 37, //No Params
- ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
ACTION_T_SUMMON_GO = 39, //GameObjectID, DespawnTime in ms
-
- ACTION_T_SET_ACTIVE = 101, //Apply
- ACTION_T_SET_AGGRESSIVE = 102, //Apply
- ACTION_T_ATTACK_START_PULSE = 103, //Distance
-
- ACTION_T_END,
-};
-
-enum Target
-{
- //Self (m_creature)
- TARGET_T_SELF = 0, //Self cast
-
- //Hostile targets (if pet then returns pet owner)
- TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
- TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
-
- //Invoker targets (if pet then returns pet owner)
- TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
-
- //Hostile targets (including pets)
- TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
- TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
- TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
-
- TARGET_T_ACTION_INVOKER_WPET,
-
- TARGET_T_END
-};
-
-enum CastFlags
-{
- CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
- CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
- CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
- CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
- CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
- CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
-};
-
-enum EventFlags
-{
- EFLAG_REPEATABLE = 0x01, //Event repeats
- EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
- EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
- EFLAG_RESERVED_3 = 0x08,
- EFLAG_RESERVED_4 = 0x10,
- EFLAG_RESERVED_5 = 0x20,
- EFLAG_RESERVED_6 = 0x40,
- EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build of SD2 only
-};
-
-struct EventAI_Event
-{
- uint32 event_id;
-
- uint32 creature_id;
-
- uint16 event_type;
- uint32 event_inverse_phase_mask;
- uint8 event_chance;
- uint8 event_flags;
- union
- {
- uint32 event_param1;
- int32 event_param1_s;
- };
- union
- {
- uint32 event_param2;
- int32 event_param2_s;
- };
- union
- {
- uint32 event_param3;
- int32 event_param3_s;
- };
- union
- {
- uint32 event_param4;
- int32 event_param4_s;
- };
-
- struct _action
- {
- uint16 type;
- union
- {
- uint32 param1;
- int32 param1_s;
- };
- union
- {
- uint32 param2;
- int32 param2_s;
- };
- union
- {
- uint32 param3;
- int32 param3_s;
- };
- }action[MAX_ACTIONS];
-};
-
-//Event_Map
-extern UNORDERED_MAP<uint32, std::vector<EventAI_Event> > EventAI_Event_Map;
-
-struct EventAI_Summon
-{
- uint32 id;
-
- float position_x;
- float position_y;
- float position_z;
- float orientation;
- uint32 SpawnTimeSecs;
-};
-
-//EventSummon_Map
-extern UNORDERED_MAP<uint32, EventAI_Summon> EventAI_Summon_Map;
-
-//EventAI Error handling
-extern uint32 EAI_ErrorLevel;
-/*
-
-struct EventAI_CreatureError
-{
- bool ListEmpty;
- bool NoInstance;
-};
-
-//Error prevention list
-extern UNORDERED_MAP<uint32, EventAI_CreatureError> EventAI_CreatureErrorPreventionList;
-
-//Defines
-#define EVENTAI_EMPTY_EVENTLIST "SD2: Eventlist for Creature %i is empty but creature is using Mob_EventAI. Preventing EventAI on this creature."
-*/
#endif
diff --git a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
index d3395327aa7..a912e6af17f 100644
--- a/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_generic_creature.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.cpp b/src/bindings/scripts/scripts/creature/simple_ai.cpp
index 96583c4ee39..5dd299e0a14 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/simple_ai.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -27,34 +27,25 @@ EndScriptData */
SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
{
//Clear all data
- Aggro_Text[0] = NULL;
- Aggro_Text[1] = NULL;
- Aggro_Text[2] = NULL;
- Aggro_Say[0] = false;
- Aggro_Say[1] = false;
- Aggro_Say[2] = false;
+ Aggro_TextId[0] = 0;
+ Aggro_TextId[1] = 0;
+ Aggro_TextId[2] = 0;
Aggro_Sound[0] = 0;
Aggro_Sound[1] = 0;
Aggro_Sound[2] = 0;
- Death_Text[0] = NULL;
- Death_Text[1] = NULL;
- Death_Text[2] = NULL;
- Death_Say[0] = false;
- Death_Say[1] = false;
- Death_Say[2] = false;
+ Death_TextId[0] = 0;
+ Death_TextId[1] = 0;
+ Death_TextId[2] = 0;
Death_Sound[0] = 0;
Death_Sound[1] = 0;
Death_Sound[2] = 0;
Death_Spell = 0;
Death_Target_Type = 0;
- Kill_Text[0] = NULL;
- Kill_Text[1] = NULL;
- Kill_Text[2] = NULL;
- Kill_Say[0] = false;
- Kill_Say[1] = false;
- Kill_Say[2] = false;
+ Kill_TextId[0] = 0;
+ Kill_TextId[1] = 0;
+ Kill_TextId[2] = 0;
Kill_Sound[0] = 0;
Kill_Sound[1] = 0;
Kill_Sound[2] = 0;
@@ -106,11 +97,9 @@ void SimpleAI::Aggro(Unit *who)
uint32 random_text = rand()%3;
- //Random yell
- if (Aggro_Text[random_text])
- if (Aggro_Say[random_text])
- DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
- else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
+ //Random text
+ if (Aggro_TextId[random_text])
+ DoScriptText(Aggro_TextId[random_text], m_creature, who);
//Random sound
if (Aggro_Sound[random_text])
@@ -122,10 +111,8 @@ void SimpleAI::KilledUnit(Unit *victim)
uint32 random_text = rand()%3;
//Random yell
- if (Kill_Text[random_text])
- if (Kill_Say[random_text])
- DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
- else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
+ if (Kill_TextId[random_text])
+ DoScriptText(Kill_TextId[random_text], m_creature, victim);
//Random sound
if (Kill_Sound[random_text])
@@ -172,10 +159,8 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
uint32 random_text = rand()%3;
//Random yell
- if (Death_Text[random_text])
- if (Death_Say[random_text])
- DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
- else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
+ if (Death_TextId[random_text])
+ DoScriptText(Death_TextId[random_text], m_creature, killer);
//Random sound
if (Death_Sound[random_text])
@@ -269,10 +254,8 @@ void SimpleAI::UpdateAI(const uint32 diff)
uint32 random_text = rand()%3;
//Random yell
- if (Spell[i].Text[random_text])
- if (Spell[i].Say[random_text])
- DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
- else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
+ if (Spell[i].TextId[random_text])
+ DoScriptText(Spell[i].TextId[random_text], m_creature, target);
//Random sound
if (Spell[i].Text_Sound[random_text])
diff --git a/src/bindings/scripts/scripts/creature/simple_ai.h b/src/bindings/scripts/scripts/creature/simple_ai.h
index 8745d78ad41..44cadef1f33 100644
--- a/src/bindings/scripts/scripts/creature/simple_ai.h
+++ b/src/bindings/scripts/scripts/creature/simple_ai.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -35,18 +35,15 @@ struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
public:
- char* Aggro_Text[3];
- bool Aggro_Say[3];
+ int32 Aggro_TextId[3];
uint32 Aggro_Sound[3];
- char* Death_Text[3];
- bool Death_Say[3];
+ int32 Death_TextId[3];
uint32 Death_Sound[3];
uint32 Death_Spell;
uint32 Death_Target_Type;
- char* Kill_Text[3];
- bool Kill_Say[3];
+ int32 Kill_TextId[3];
uint32 Kill_Sound[3];
uint32 Kill_Spell;
uint32 Kill_Target_Type;
@@ -62,8 +59,7 @@ public:
bool Enabled; //Spell enabled or disabled (default: false)
//3 texts to many?
- char* Text[3];
- bool Say[3];
+ int32 TextId[3];
uint32 Text_Sound[3];
}Spell[10];
diff --git a/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp b/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp
new file mode 100644
index 00000000000..3e58efa345b
--- /dev/null
+++ b/src/bindings/scripts/scripts/custom/npc_acherus_taxi.cpp
@@ -0,0 +1,39 @@
+#include "precompiled.h"
+#include "WorldPacket.h"
+
+#define GOSSIP_FLIGHT "I need a ride"
+
+bool GossipHello_npc_acherus_taxi(Player *player, Creature *_Creature)
+{
+player->SetTaxiCheater(true);
+
+player->ADD_GOSSIP_ITEM(0, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(9978,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_acherus_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ if (player->GetPositionZ() >=316)
+ {
+ player->GetSession()->SendDoFlight(24446, 1053);
+ }else{
+ player->GetSession()->SendDoFlight(24446, 1054);
+ }
+
+ }
+ return true;
+}
+
+void AddSC_npc_acherus_taxi()
+{
+ Script *newscript;
+
+newscript = new Script;
+newscript->Name="npc_acherus_taxi";
+newscript->pGossipHello = &GossipHello_npc_acherus_taxi;
+newscript->pGossipSelect = &GossipSelect_npc_acherus_taxi;
+newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp b/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp
new file mode 100644
index 00000000000..2e9ab3f412d
--- /dev/null
+++ b/src/bindings/scripts/scripts/custom/npc_wyrmresttempel_taxi.cpp
@@ -0,0 +1,116 @@
+#include "precompiled.h"
+#include "WorldPacket.h"
+
+#define GOSSIP_UP "My Lord, I must go to the upper floor of the temple."
+#define GOSSIP_DOWN "I would like to take a flight to the ground, Lord Afrasastrasz."
+#define GOSSIP_MIDDLE "Can you spare a drake to travel to Lord Afrasastrasz, in the middle of the temple?"
+#define GOSSIP_TOP "Please, Let me take one of these dragons to the top floor of the temple."
+#define GOSSIP_BOTTOM "Yes, Please. I would like to return to the ground floor of the temple."
+#define GOSSIP_ONEDOWN "I would like to see Lord Afrasastrasz, in the middle of the temple."
+
+bool GossipHello_npc_wyrmresttempel_middle_taxi(Player *player, Creature *_Creature)
+{
+player->SetTaxiCheater(true);
+
+player->ADD_GOSSIP_ITEM(0, GOSSIP_UP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+player->ADD_GOSSIP_ITEM(0, GOSSIP_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->SEND_GOSSIP_MENU(12887,_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_wyrmresttempel_middle_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ player->GetSession()->SendDoFlight(6376, 881);
+ }
+
+
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ player->GetSession()->SendDoFlight(6376, 882);
+
+ }
+return true;
+}
+
+bool GossipHello_npc_wyrmresttempel_bottom_taxi(Player *player, Creature *_Creature)
+{
+player->SetTaxiCheater(true);
+
+player->ADD_GOSSIP_ITEM(0, GOSSIP_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+player->ADD_GOSSIP_ITEM(0, GOSSIP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(12713,_Creature->GetGUID());
+
+ return true;
+}
+
+
+
+bool GossipSelect_npc_wyrmresttempel_bottom_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 4)
+ {
+ player->GetSession()->SendDoFlight(6376, 878);
+ }
+
+
+ if (action == GOSSIP_ACTION_INFO_DEF + 3)
+ {
+ player->GetSession()->SendDoFlight(6376, 883);
+
+ }
+return true;
+}
+
+bool GossipHello_npc_wyrmresttempel_top_taxi(Player *player, Creature *_Creature)
+{
+player->SetTaxiCheater(true);
+
+player->ADD_GOSSIP_ITEM(0, GOSSIP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+player->ADD_GOSSIP_ITEM(0, GOSSIP_ONEDOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(12714,_Creature->GetGUID());
+
+ return true;
+}
+
+bool GossipSelect_npc_wyrmresttempel_top_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 5)
+ {
+ player->GetSession()->SendDoFlight(6376, 879);
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF + 6)
+
+ {
+ player->GetSession()->SendDoFlight(6376, 880);
+
+ }
+return true;
+}
+
+void AddSC_npc_wyrmresttempel_taxi()
+{
+ Script *newscript;
+
+newscript = new Script;
+newscript->Name="npc_wyrmresttempelmiddle_taxi";
+newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_middle_taxi;
+newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_middle_taxi;
+newscript->RegisterSelf();
+
+newscript = new Script;
+newscript->Name="npc_wyrmresttempelbottom_taxi";
+newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_bottom_taxi;
+newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_bottom_taxi;
+newscript->RegisterSelf();
+
+newscript = new Script;
+newscript->Name="npc_wyrmresttempeltop_taxi";
+newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_top_taxi;
+newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_top_taxi;
+newscript->RegisterSelf();
+
+}
diff --git a/src/bindings/scripts/scripts/examples/example_creature.cpp b/src/bindings/scripts/scripts/examples/example_creature.cpp
new file mode 100644
index 00000000000..140e477441d
--- /dev/null
+++ b/src/bindings/scripts/scripts/examples/example_creature.cpp
@@ -0,0 +1,258 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Example_Creature
+SD%Complete: 100
+SDComment: Short custom scripting example
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+
+// **** This script is designed as an example for others to build on ****
+// **** Please modify whatever you'd like to as this script is only for developement ****
+
+// **** Script Info ****
+// This script is written in a way that it can be used for both friendly and hostile monsters
+// Its primary purpose is to show just how much you can really do with scripts
+// I recommend trying it out on both an agressive NPC and on friendly npc
+
+// **** Quick Info ****
+// Functions with Handled Function marked above them are functions that are called automatically by the core
+// Functions that are marked Custom Function are functions I've created to simplify code
+
+//List of text id's. The text is stored in database, also in a localized version
+//(if translation not exist for the textId, default english text will be used)
+//Not required to define in this way, but simplify if changes are needed.
+#define SAY_AGGRO -1999900
+#define SAY_RANDOM_0 -1999901
+#define SAY_RANDOM_1 -1999902
+#define SAY_RANDOM_2 -1999903
+#define SAY_RANDOM_3 -1999904
+#define SAY_RANDOM_4 -1999905
+#define SAY_BESERK -1999906
+#define SAY_PHASE -1999907
+#define SAY_DANCE -1999908
+#define SAY_SALUTE -1999909
+
+//List of gossip item texts. Items will appear in the gossip window.
+#define GOSSIP_ITEM "I'm looking for a fight"
+
+//List of spells. Not required to define them in this way, but will make it easier to maintain in case spellId change
+#define SPELL_BUFF 25661
+#define SPELL_ONE 12555
+#define SPELL_ONE_ALT 24099
+#define SPELL_TWO 10017
+#define SPELL_THREE 26027
+#define SPELL_ENRAGE 23537
+#define SPELL_BESERK 32309
+
+struct TRINITY_DLL_DECL example_creatureAI : public ScriptedAI
+{
+ //*** HANDLED FUNCTION ***
+ //This is the constructor, called only once when the creature is first created
+ example_creatureAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ //*** CUSTOM VARIABLES ****
+ //These variables are for use only by this individual script.
+ //Nothing else will ever call them but us.
+
+ uint32 Say_Timer; //Timer for random chat
+ uint32 Rebuff_Timer; //Timer for rebuffing
+ uint32 Spell_1_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_2_Timer; //Timer for spell 1 when in combat
+ uint32 Spell_3_Timer; //Timer for spell 1 when in combat
+ uint32 Beserk_Timer; //Timer until we go into Beserk (enraged) mode
+ uint32 Phase; //The current battle phase we are in
+ uint32 Phase_Timer; //Timer until phase transition
+
+ //*** HANDLED FUNCTION ***
+ //This is called whenever the core decides we need to evade
+ void Reset()
+ {
+ Phase = 1; //Start in phase 1
+ Phase_Timer = 60000; //60 seconds
+ Spell_1_Timer = 5000; //5 seconds
+ Spell_2_Timer = 37000; //37 seconds
+ Spell_3_Timer = 19000; //19 seconds
+ Beserk_Timer = 120000; //2 minutes
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Attack Start is called whenever someone hits us.
+ void Aggro(Unit *who)
+ {
+ //Say some stuff
+ DoScriptText(SAY_AGGRO, m_creature, who);
+ }
+
+ //*** HANDLED FUNCTION ***
+ //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid)
+ void UpdateAI(const uint32 diff)
+ {
+ //Out of combat timers
+ if (!m_creature->getVictim())
+ {
+ //Random Say timer
+ if (Say_Timer < diff)
+ {
+ //Random switch between 5 outcomes
+ switch (rand()%5)
+ {
+ case 0: DoScriptText(SAY_RANDOM_0, m_creature); break;
+ case 1: DoScriptText(SAY_RANDOM_1, m_creature); break;
+ case 2: DoScriptText(SAY_RANDOM_2, m_creature); break;
+ case 3: DoScriptText(SAY_RANDOM_3, m_creature); break;
+ case 4: DoScriptText(SAY_RANDOM_4, m_creature); break;
+ }
+
+ Say_Timer = 45000; //Say something agian in 45 seconds
+ }else Say_Timer -= diff;
+
+ //Rebuff timer
+ if (Rebuff_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_BUFF);
+ Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
+ }else Rebuff_Timer -= diff;
+ }
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //Spell 1 timer
+ if (Spell_1_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ if (rand()%50 > 10)
+ DoCast(m_creature->getVictim(),SPELL_ONE_ALT);
+ else if (m_creature->GetDistance(m_creature->getVictim()) < 25)
+ DoCast(m_creature->getVictim(),SPELL_ONE);
+
+ Spell_1_Timer = 5000;
+ }else Spell_1_Timer -= diff;
+
+ //Spell 2 timer
+ if (Spell_2_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_TWO);
+
+ Spell_2_Timer = 37000;
+ }else Spell_2_Timer -= diff;
+
+ //Spell 3 timer
+ if (Phase > 1)
+ if (Spell_3_Timer < diff)
+ {
+ //Cast spell one on our current target.
+ DoCast(m_creature->getVictim(),SPELL_THREE);
+
+ Spell_3_Timer = 19000;
+ }else Spell_3_Timer -= diff;
+
+ //Beserk timer
+ if (Phase > 1)
+ if (Beserk_Timer < diff)
+ {
+ //Say our line then cast uber death spell
+ DoScriptText(SAY_BESERK, m_creature, m_creature->getVictim());
+ DoCast(m_creature->getVictim(),SPELL_BESERK);
+
+ //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
+ Beserk_Timer = 12000;
+ }else Beserk_Timer -= diff;
+
+ //Phase timer
+ if (Phase == 1)
+ if (Phase_Timer < diff)
+ {
+ //Go to next phase
+ Phase++;
+ DoScriptText(SAY_PHASE, m_creature);
+ DoCast(m_creature,SPELL_ENRAGE);
+ }else Phase_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ //Our Recive emote function
+ void ReceiveEmote(Player *player, uint32 emote)
+ {
+ m_creature->HandleEmoteCommand(emote);
+
+ if (emote == TEXTEMOTE_DANCE)
+ DoScriptText(SAY_DANCE, m_creature);
+
+ if (emote == TEXTEMOTE_SALUTE)
+ DoScriptText(SAY_SALUTE, m_creature);
+ }
+};
+
+//This is the GetAI method used by all scripts that involve AI
+//It is called every time a new creature using this script is created
+CreatureAI* GetAI_example_creature(Creature *_Creature)
+{
+ return new example_creatureAI (_Creature);
+}
+
+//This function is called when the player clicks an option on the gossip menu
+void SendDefaultMenu_example_creature(Player *player, Creature *_Creature, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
+ {
+ //Set our faction to hostile twoards all
+ _Creature->setFaction(24);
+ _Creature->Attack(player, true);
+ player->PlayerTalkClass->CloseGossip();
+ }
+}
+
+//This function is called when the player clicks an option on the gossip menu
+bool GossipSelect_example_creature(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (sender == GOSSIP_SENDER_MAIN)
+ SendDefaultMenu_example_creature(player, _Creature, action);
+
+ return true;
+}
+
+//This function is called when the player opens the gossip menu
+bool GossipHello_example_creature(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+
+ return true;
+}
+
+//This is the actual function called only once durring InitScripts()
+//It must define all handled functions that are to be run in this script
+//For example if you want this Script to handle Emotes you must include
+//newscript->ReciveEmote = My_Emote_Function;
+void AddSC_example_creature()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "example_creature";
+ newscript->GetAI = &GetAI_example_creature;
+ newscript->pGossipHello = &GossipHello_example_creature;
+ newscript->pGossipSelect = &GossipSelect_example_creature;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp
new file mode 100644
index 00000000000..1cc5356a9ac
--- /dev/null
+++ b/src/bindings/scripts/scripts/examples/example_escort.cpp
@@ -0,0 +1,220 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Example_Escort
+SD%Complete: 100
+SDComment: Script used for testing escortAI
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include "../npc/npc_escortAI.h"
+
+#define SAY_AGGRO1 -1999910
+#define SAY_AGGRO2 -1999911
+#define SAY_WP_1 -1999912
+#define SAY_WP_2 -1999913
+#define SAY_WP_3 -1999914
+#define SAY_WP_4 -1999915
+#define SAY_DEATH_1 -1999916
+#define SAY_DEATH_2 -1999917
+#define SAY_DEATH_3 -1999918
+#define SAY_SPELL -1999919
+#define SAY_RAND_1 -1999920
+#define SAY_RAND_2 -1999921
+
+#define GOSSIP_ITEM_1 "Click to Test Escort(Attack, Defend, Run)"
+#define GOSSIP_ITEM_2 "Click to Test Escort(NoAttack, NoDefend, Walk)"
+#define GOSSIP_ITEM_3 "Click to Test Escort(NoAttack, Defend, Walk)"
+
+struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI
+{
+ public:
+
+ // CreatureAI functions
+ example_escortAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ uint32 DeathCoilTimer;
+ uint32 ChatTimer;
+
+ // Pure Virtual Functions
+ void WaypointReached(uint32 i)
+ {
+ switch (i)
+ {
+ case 1:
+ DoScriptText(SAY_WP_1, m_creature);
+ break;
+
+ case 3:
+ {
+ DoScriptText(SAY_WP_2, m_creature);
+ Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
+ if(temp)
+ temp->AI()->AttackStart(m_creature);
+ }
+ break;
+
+ case 4:
+ {
+ Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID);
+ if (temp)
+ {
+ //temp is the target of the text
+ DoScriptText(SAY_WP_3, m_creature, temp);
+ //temp is the source of the text
+ DoScriptText(SAY_WP_4, temp);
+ }
+ }
+ break;
+ }
+ }
+
+ void Aggro(Unit* who)
+ {
+ if (IsBeingEscorted)
+ {
+ if (Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID))
+ DoScriptText(SAY_AGGRO1, m_creature, temp);
+ }
+ else DoScriptText(SAY_AGGRO2, m_creature);
+ }
+
+ void Reset()
+ {
+ DeathCoilTimer = 4000;
+ ChatTimer = 4000;
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (IsBeingEscorted)
+ {
+ Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID);
+ //killer = m_creature when player got to far from creature
+ if (killer == m_creature)
+ {
+ //This is actually a whisper. You control the text type in database
+ if (pTemp)
+ DoScriptText(SAY_DEATH_1, m_creature, pTemp);
+ }
+ else if (pTemp) DoScriptText(SAY_DEATH_2, m_creature, pTemp);
+ }
+ else DoScriptText(SAY_DEATH_3, m_creature);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Must update npc_escortAI
+ npc_escortAI::UpdateAI(diff);
+
+ //Combat check
+ if (InCombat && m_creature->getVictim())
+ {
+ if (DeathCoilTimer < diff)
+ {
+ DoScriptText(SAY_SPELL, m_creature);
+ m_creature->CastSpell(m_creature->getVictim(), 33130, false);
+
+ DeathCoilTimer = 4000;
+ }else DeathCoilTimer -= diff;
+ }else
+ {
+ //Out of combat but being escorted
+ if (IsBeingEscorted)
+ if (ChatTimer < diff)
+ {
+ if (m_creature->HasAura(3593))
+ {
+ DoScriptText(SAY_RAND_1, m_creature);
+ m_creature->CastSpell(m_creature, 11540, false);
+ }else
+ {
+ DoScriptText(SAY_RAND_2, m_creature);
+ m_creature->CastSpell(m_creature, 3593, false);
+ }
+
+ ChatTimer = 12000;
+ }else ChatTimer -= diff;
+ }
+ }
+};
+
+CreatureAI* GetAI_example_escort(Creature *_Creature)
+{
+ example_escortAI* testAI = new example_escortAI(_Creature);
+
+ testAI->AddWaypoint(0, 1231, -4419, 23);
+ testAI->AddWaypoint(1, 1198, -4440, 23, 0);
+ testAI->AddWaypoint(2, 1208, -4392, 23);
+ testAI->AddWaypoint(3, 1231, -4419, 23, 5000);
+ testAI->AddWaypoint(4, 1208, -4392, 23, 5000);
+
+ return (CreatureAI*)testAI;
+}
+
+bool GossipHello_example_escort(Player *player, Creature *_Creature)
+{
+ player->TalkedToCreature(_Creature->GetEntry(),_Creature->GetGUID());
+ _Creature->prepareGossipMenu(player,0);
+
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+
+ _Creature->sendPreparedGossip( player );
+ return true;
+}
+
+bool GossipSelect_example_escort(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(true, true, true, player->GetGUID());
+
+ return true; // prevent mangos core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID());
+
+ return true; // prevent mangos core handling
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF+3)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(_Creature->AI()))->Start(false, true, false, player->GetGUID());
+
+ return true; // prevent mangos core handling
+ }
+ return false;
+}
+
+void AddSC_example_escort()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "example_escort";
+ newscript->GetAI = &GetAI_example_escort;
+ newscript->pGossipHello = &GossipHello_example_escort;
+ newscript->pGossipSelect = &GossipSelect_example_escort;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp b/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp
new file mode 100644
index 00000000000..5d05197fd7a
--- /dev/null
+++ b/src/bindings/scripts/scripts/examples/example_gossip_codebox.cpp
@@ -0,0 +1,88 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Example_Gossip_Codebox
+SD%Complete: 100
+SDComment: Show a codebox in gossip option
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+#include <cstring>
+
+#define SAY_NOT_INTERESTED -1999922
+#define SAY_WRONG -1999923
+#define SAY_CORRECT -1999924
+
+#define GOSSIP_ITEM_1 "A quiz: what's your name?"
+#define GOSSIP_ITEM_2 "I'm not interested"
+
+//This function is called when the player opens the gossip menubool
+bool GossipHello_example_gossip_codebox(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+
+ player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
+ return true;
+}
+
+//This function is called when the player clicks an option on the gossip menubool
+bool GossipSelect_example_gossip_codebox(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if(action == GOSSIP_ACTION_INFO_DEF+2)
+ {
+ DoScriptText(SAY_NOT_INTERESTED, _Creature);
+ player->CLOSE_GOSSIP_MENU();
+ }
+ return true;
+}
+
+bool GossipSelectWithCode_example_gossip_codebox( Player *player, Creature *_Creature, uint32 sender, uint32 action, const char* sCode )
+{
+ if(sender == GOSSIP_SENDER_MAIN)
+ {
+ if(action == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ if(std::strcmp(sCode, player->GetName())!=0)
+ {
+ DoScriptText(SAY_WRONG, _Creature);
+ _Creature->CastSpell(player, 12826, true);
+ }
+ else
+ {
+ DoScriptText(SAY_CORRECT, _Creature);
+ _Creature->CastSpell(player, 26990, true);
+ }
+ player->CLOSE_GOSSIP_MENU();
+ return true;
+ }
+ }
+ return false;
+}
+
+void AddSC_example_gossip_codebox()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "example_gossip_codebox";
+ newscript->pGossipHello = &GossipHello_example_gossip_codebox;
+ newscript->pGossipSelect = &GossipSelect_example_gossip_codebox;
+ newscript->pGossipSelectWithCode = &GossipSelectWithCode_example_gossip_codebox;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/examples/example_misc.cpp b/src/bindings/scripts/scripts/examples/example_misc.cpp
new file mode 100644
index 00000000000..63136c6bc5d
--- /dev/null
+++ b/src/bindings/scripts/scripts/examples/example_misc.cpp
@@ -0,0 +1,65 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Example_Misc
+SD%Complete: 100
+SDComment: Item, Areatrigger and other small code examples
+SDCategory: Script Examples
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SAY_HI -1999925
+
+bool AT_example_areatrigger(Player *player, AreaTriggerEntry *at)
+{
+ DoScriptText(SAY_HI, player);
+ return true;
+}
+
+extern void LoadDatabase();
+bool ItemUse_example_item(Player *player, Item* _Item, SpellCastTargets const& targets)
+{
+ LoadDatabase();
+ return true;
+}
+
+bool GOHello_example_go_teleporter(Player *player, GameObject* _GO)
+{
+ player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
+ return false;
+}
+
+void AddSC_example_misc()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "example_areatrigger";
+ newscript->pAreaTrigger = &AT_example_areatrigger;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "example_item";
+ newscript->pItemUse = &ItemUse_example_item;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "example_go_teleporter";
+ newscript->pGOHello = &GOHello_example_go_teleporter;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp
index 9aacd2487e9..5613ccdd9b7 100644
--- a/src/bindings/scripts/scripts/go/go_scripts.cpp
+++ b/src/bindings/scripts/scripts/go/go_scripts.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -22,6 +22,7 @@ SDCategory: Game Objects
EndScriptData */
/* ContentData
+go_cat_figurine (the "trap" version of GO, two different exist)
go_northern_crystal_pylon
go_eastern_crystal_pylon
go_western_crystal_pylon
@@ -30,12 +31,26 @@ go_field_repair_bot_74A
go_orb_of_command
go_tablet_of_madness
go_tablet_of_the_seven
-go_teleporter
EndContentData */
#include "precompiled.h"
/*######
+## go_cat_figurine
+######*/
+
+enum
+{
+ SPELL_SUMMON_GHOST_SABER = 5968,
+};
+
+bool GOHello_go_cat_figurine(Player *player, GameObject* _GO)
+{
+ player->CastSpell(player,SPELL_SUMMON_GHOST_SABER,true);
+ return false;
+}
+
+/*######
## go_crystal_pylons (3x)
######*/
@@ -108,6 +123,26 @@ bool GOHello_go_field_repair_bot_74A(Player *player, GameObject* _GO)
}
/*######
+## go_gilded_brazier
+######*/
+
+enum
+{
+ NPC_STILLBLADE = 17716,
+};
+
+bool GOHello_go_gilded_brazier(Player* pPlayer, GameObject* pGO)
+{
+ if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
+ {
+ if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632, -7542.740, 151.568, 0.122, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
+ pCreature->AI()->AttackStart(pPlayer);
+ }
+
+ return true;
+}
+
+/*######
## go_orb_of_command
######*/
@@ -148,16 +183,6 @@ bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
return true;
}
-/*######
-## go_teleporter
-######*/
-
-bool GOHello_go_teleporter(Player *player, GameObject* _GO)
-{
- player->TeleportTo(0, 1807.07f,336.105f,70.3975f,0.0f);
- return false;
-}
-
/*#####
## go_jump_a_tron
######*/
@@ -173,7 +198,7 @@ bool GOHello_go_jump_a_tron(Player *player, GameObject* _GO)
/*######
## go_ethereum_prison
######*/
-
+
float ethereum_NPC[2][7] =
{
{20785,20790,20789,20784,20786,20783,20788}, // hostile npc
@@ -184,7 +209,7 @@ bool GOHello_go_ethereum_prison(Player *player, GameObject* _GO)
{
_GO->SetGoState(0);
switch(rand()%2){
- case 0:
+ case 0:
_GO->SummonCreature(ethereum_NPC[0][rand()%6],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
break;
case 1:
@@ -213,6 +238,11 @@ void AddSC_go_scripts()
Script *newscript;
newscript = new Script;
+ newscript->Name = "go_cat_figurine";
+ newscript->pGOHello = &GOHello_go_cat_figurine;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="go_northern_crystal_pylon";
newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
newscript->RegisterSelf();
@@ -238,6 +268,11 @@ void AddSC_go_scripts()
newscript->RegisterSelf();
newscript = new Script;
+ newscript->Name = "go_gilded_brazier";
+ newscript->pGOHello = &GOHello_go_gilded_brazier;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="go_orb_of_command";
newscript->pGOHello = &GOHello_go_orb_of_command;
newscript->RegisterSelf();
@@ -253,11 +288,6 @@ void AddSC_go_scripts()
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="go_teleporter";
- newscript->pGOHello = &GOHello_go_teleporter;
- newscript->RegisterSelf();
-
- newscript = new Script;
newscript->Name="go_jump_a_tron";
newscript->pGOHello = &GOHello_go_jump_a_tron;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp
index f28820eb7ee..b635ae74b2d 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.cpp
+++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -28,6 +28,10 @@ EndScriptData */
#define GENERIC_CREATURE_COOLDOWN 5000
+#define SAY_GUARD_SIL_AGGRO1 -1070001
+#define SAY_GUARD_SIL_AGGRO2 -1070002
+#define SAY_GUARD_SIL_AGGRO3 -1070003
+
void guardAI::Reset()
{
GlobalCooldown = 0;
@@ -40,15 +44,9 @@ void guardAI::Aggro(Unit *who)
{
switch(rand()%3)
{
- case 0:
- DoSay("Taste blade, mongrel!", LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoSay("Please tell me that you didn't just do what I think you just did. Please tell me that I'm not going to have to hurt you...", LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoSay("As if we don't have enough problems, you go and create more!", LANG_UNIVERSAL,NULL);
- break;
+ case 0: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break;
+ case 1: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break;
+ case 2: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, who); break;
}
}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.h b/src/bindings/scripts/scripts/guard/guard_ai.h
index 7952040b5e2..d7cd6cd6318 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.h
+++ b/src/bindings/scripts/scripts/guard/guard_ai.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp
index ff6ec258b22..2a7f171a4a4 100644
--- a/src/bindings/scripts/scripts/guard/guards.cpp
+++ b/src/bindings/scripts/scripts/guard/guards.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -115,23 +115,23 @@ void SendDefaultMenu_guard_azuremyst(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-3918.95, -11544.7, 6, 6, 0, "Bank");
+ player->SEND_POI(-3918.95, -11544.7, 7, 6, 0, "Bank");
player->SEND_GOSSIP_MENU(10067,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hippogryph Master
- player->SEND_POI(-4057.15, -11788.6, 6, 6, 0, "Stephanos");
+ player->SEND_POI(-4057.15, -11788.6, 7, 6, 0, "Stephanos");
player->SEND_GOSSIP_MENU(10071,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.43, -11626.6, 6, 6, 0, "Funaam");
+ player->SEND_POI(-4092.43, -11626.6, 7, 6, 0, "Funaam");
player->SEND_GOSSIP_MENU(10073,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-4129.43, -12469, 6, 6, 0, "Caregiver Chellan");
+ player->SEND_POI(-4129.43, -12469, 7, 6, 0, "Caregiver Chellan");
player->SEND_GOSSIP_MENU(10074,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-4146.42, -12492.7, 6, 6, 0, "Esbina");
+ player->SEND_POI(-4146.42, -12492.7, 7, 6, 0, "Esbina");
player->SEND_GOSSIP_MENU(10075,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
@@ -168,31 +168,31 @@ void SendClassTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4274.81, -11495.3, 6, 6, 0, "Shalannius");
+ player->SEND_POI(-4274.81, -11495.3, 7, 6, 0, "Shalannius");
player->SEND_GOSSIP_MENU(10077,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4203.65, -12526.5, 6, 6, 0, "Acteon");
+ player->SEND_POI(-4203.65, -12526.5, 7, 6, 0, "Acteon");
player->SEND_GOSSIP_MENU(10078,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4149.62, -12530.1, 6, 6, 0, "Semid");
+ player->SEND_POI(-4149.62, -12530.1, 7, 6, 0, "Semid");
player->SEND_GOSSIP_MENU(10081,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4138.98, -12468.5, 6, 6, 0, "Tullas");
+ player->SEND_POI(-4138.98, -12468.5, 7, 6, 0, "Tullas");
player->SEND_GOSSIP_MENU(10083,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-4131.66, -12478.6, 6, 6, 0, "Guvan");
+ player->SEND_POI(-4131.66, -12478.6, 7, 6, 0, "Guvan");
player->SEND_GOSSIP_MENU(10084,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-4162.33, -12456.1, 6, 6, 0, "Tuluun");
+ player->SEND_POI(-4162.33, -12456.1, 7, 6, 0, "Tuluun");
player->SEND_GOSSIP_MENU(10085,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4165.05, -12536.4, 6, 6, 0, "Ruada");
+ player->SEND_POI(-4165.05, -12536.4, 7, 6, 0, "Ruada");
player->SEND_GOSSIP_MENU(10086,_Creature->GetGUID());
break;
}
@@ -203,54 +203,54 @@ void SendProfTrainerMenu_guard_azuremyst(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4191.15, -12470, 6, 6, 0, "Daedal");
+ player->SEND_POI(-4191.15, -12470, 7, 6, 0, "Daedal");
player->SEND_GOSSIP_MENU(10088,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4726.29, -12387, 6, 6, 0, "Blacksmith Calypso");
+ player->SEND_POI(-4726.29, -12387, 7, 6, 0, "Blacksmith Calypso");
player->SEND_GOSSIP_MENU(10089,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4710.87, -12400.6, 6, 6, 0, "'Cookie' McWeaksauce");
+ player->SEND_POI(-4710.87, -12400.6, 7, 6, 0, "'Cookie' McWeaksauce");
player->SEND_GOSSIP_MENU(10090,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3882.85, -11496.7, 6, 6, 0, "Nahogg");
+ player->SEND_POI(-3882.85, -11496.7, 7, 6, 0, "Nahogg");
player->SEND_GOSSIP_MENU(10091,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4157.57, -12470.2, 6, 6, 0, "Artificer Daelo");
+ player->SEND_POI(-4157.57, -12470.2, 7, 6, 0, "Artificer Daelo");
player->SEND_GOSSIP_MENU(10092,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4199.11, -12469.9, 6, 6, 0, "Anchorite Fateema");
+ player->SEND_POI(-4199.11, -12469.9, 7, 6, 0, "Anchorite Fateema");
player->SEND_GOSSIP_MENU(10093,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4266.38, -12985.1, 6, 6, 0, "Diktynna");
+ player->SEND_POI(-4266.38, -12985.1, 7, 6, 0, "Diktynna");
player->SEND_GOSSIP_MENU(10094,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
player->SEND_GOSSIP_MENU(10095,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Jewelcrafting
- player->SEND_POI(-3781.55, -11541.8, 6, 6, 0, "Farii");
+ player->SEND_POI(-3781.55, -11541.8, 7, 6, 0, "Farii");
player->SEND_GOSSIP_MENU(10096,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-3442.68, -12322.2, 6, 6, 0, "Moordo");
+ player->SEND_POI(-3442.68, -12322.2, 7, 6, 0, "Moordo");
player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4179.89, -12493.1, 6, 6, 0, "Dulvi");
+ player->SEND_POI(-4179.89, -12493.1, 7, 6, 0, "Dulvi");
player->SEND_GOSSIP_MENU(10097,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-3431.17, -12316.5, 6, 6, 0, "Gurf");
+ player->SEND_POI(-3431.17, -12316.5, 7, 6, 0, "Gurf");
player->SEND_GOSSIP_MENU(10098,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4711.54, -12386.7, 6, 6, 0, "Erin Kelly");
+ player->SEND_POI(-4711.54, -12386.7, 7, 6, 0, "Erin Kelly");
player->SEND_GOSSIP_MENU(10099,_Creature->GetGUID());
break;
}
@@ -302,35 +302,35 @@ void SendDefaultMenu_guard_bluffwatcher(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(-1257.8, 24.14, 6, 6, 0, "Thunder Bluff Bank");
+ player->SEND_POI(-1257.8, 24.14, 7, 6, 0, "Thunder Bluff Bank");
player->SEND_GOSSIP_MENU(1292,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Wind master
- player->SEND_POI(-1196.43, 28.26, 6, 6, 0, "Wind Rider Roost");
+ player->SEND_POI(-1196.43, 28.26, 7, 6, 0, "Wind Rider Roost");
player->SEND_GOSSIP_MENU(1293,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-1296.5, 127.57, 6, 6, 0, "Thunder Bluff Civic Information");
+ player->SEND_POI(-1296.5, 127.57, 7, 6, 0, "Thunder Bluff Civic Information");
player->SEND_GOSSIP_MENU(1291,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-1296, 39.7, 6, 6, 0, "Thunder Bluff Inn");
+ player->SEND_POI(-1296, 39.7, 7, 6, 0, "Thunder Bluff Inn");
player->SEND_GOSSIP_MENU(3153,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-1263.59, 44.36, 6, 6, 0, "Thunder Bluff Mailbox");
+ player->SEND_POI(-1263.59, 44.36, 7, 6, 0, "Thunder Bluff Mailbox");
player->SEND_GOSSIP_MENU(3154,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1381.77, -4371.16, 6, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
+ player->SEND_POI(1381.77, -4371.16, 7, 6, 0, GOSSIP_TEXT_AUCTIONHOUSE);
player->SEND_GOSSIP_MENU(3155,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Weapon master
- player->SEND_POI(-1282.31, 89.56, 6, 6, 0, "Ansekhwa");
+ player->SEND_POI(-1282.31, 89.56, 7, 6, 0, "Ansekhwa");
player->SEND_GOSSIP_MENU(4520,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Stable master
- player->SEND_POI(-1270.19, 48.84, 6, 6, 0, "Bulrug");
+ player->SEND_POI(-1270.19, 48.84, 7, 6, 0, "Bulrug");
player->SEND_GOSSIP_MENU(5977,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //battlemaster
@@ -370,15 +370,15 @@ void SendBattleMasterMenu_guard_bluffwatcher(Player *player, Creature *_Creature
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-1387.82, -97.55, 6, 6, 0, "Taim Ragetotem");
+ player->SEND_POI(-1387.82, -97.55, 7, 6, 0, "Taim Ragetotem");
player->SEND_GOSSIP_MENU(7522,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-997, 214.12, 6, 6, 0, "Martin Lindsey");
+ player->SEND_POI(-997, 214.12, 7, 6, 0, "Martin Lindsey");
player->SEND_GOSSIP_MENU(7648,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-1384.94, -75.91, 6, 6, 0, "Kergul Bloodaxe");
+ player->SEND_POI(-1384.94, -75.91, 7, 6, 0, "Kergul Bloodaxe");
player->SEND_GOSSIP_MENU(7523,_Creature->GetGUID());
break;
}
@@ -389,27 +389,27 @@ void SendClassTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-1054.47, -285, 6, 6, 0, "Hall of Elders");
+ player->SEND_POI(-1054.47, -285, 7, 6, 0, "Hall of Elders");
player->SEND_GOSSIP_MENU(1294,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_POI(-1416.32, -114.28, 7, 6, 0, "Hunter's Hall");
player->SEND_GOSSIP_MENU(1295,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_POI(-1061.2, 195.5, 7, 6, 0, "Pools of Vision");
player->SEND_GOSSIP_MENU(1296,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-1061.2, 195.5, 6, 6, 0, "Pools of Vision");
+ player->SEND_POI(-1061.2, 195.5, 7, 6, 0, "Pools of Vision");
player->SEND_GOSSIP_MENU(1297,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(-989.54, 278.25, 6, 6, 0, "Hall of Spirits");
+ player->SEND_POI(-989.54, 278.25, 7, 6, 0, "Hall of Spirits");
player->SEND_GOSSIP_MENU(1298,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Warrior
- player->SEND_POI(-1416.32, -114.28, 6, 6, 0, "Hunter's Hall");
+ player->SEND_POI(-1416.32, -114.28, 7, 6, 0, "Hunter's Hall");
player->SEND_GOSSIP_MENU(1299,_Creature->GetGUID());
break;
}
@@ -420,47 +420,47 @@ void SendProfTrainerMenu_guard_bluffwatcher(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1085.56, 27.29, 6, 6, 0, "Bena's Alchemy");
+ player->SEND_POI(-1085.56, 27.29, 7, 6, 0, "Bena's Alchemy");
player->SEND_GOSSIP_MENU(1332,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1239.75, 104.88, 6, 6, 0, "Karn's Smithy");
+ player->SEND_POI(-1239.75, 104.88, 7, 6, 0, "Karn's Smithy");
player->SEND_GOSSIP_MENU(1333,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-1214.5, -21.23, 6, 6, 0, "Aska's Kitchen");
+ player->SEND_POI(-1214.5, -21.23, 7, 6, 0, "Aska's Kitchen");
player->SEND_GOSSIP_MENU(1334,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-1112.65, 48.26, 6, 6, 0, "Dawnstrider Enchanters");
+ player->SEND_POI(-1112.65, 48.26, 7, 6, 0, "Dawnstrider Enchanters");
player->SEND_GOSSIP_MENU(1335,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-996.58, 200.5, 6, 6, 0, "Spiritual Healing");
+ player->SEND_POI(-996.58, 200.5, 7, 6, 0, "Spiritual Healing");
player->SEND_GOSSIP_MENU(1336,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-1169.35, -68.87, 6, 6, 0, "Mountaintop Bait & Tackle");
+ player->SEND_POI(-1169.35, -68.87, 7, 6, 0, "Mountaintop Bait & Tackle");
player->SEND_GOSSIP_MENU(1337,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(-1137.7, -1.51, 6, 6, 0, "Holistic Herbalism");
+ player->SEND_POI(-1137.7, -1.51, 7, 6, 0, "Holistic Herbalism");
player->SEND_GOSSIP_MENU(1338,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_POI(-1156.22, 66.86, 7, 6, 0, "Thunder Bluff Armorers");
player->SEND_GOSSIP_MENU(1339,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Mining
- player->SEND_POI(-1249.17, 155, 6, 6, 0, "Stonehoof Geology");
+ player->SEND_POI(-1249.17, 155, 7, 6, 0, "Stonehoof Geology");
player->SEND_GOSSIP_MENU(1340,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-1148.56, 51.18, 6, 6, 0, "Mooranta");
+ player->SEND_POI(-1148.56, 51.18, 7, 6, 0, "Mooranta");
player->SEND_GOSSIP_MENU(1343,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
- player->SEND_POI(-1156.22, 66.86, 6, 6, 0, "Thunder Bluff Armorers");
+ player->SEND_POI(-1156.22, 66.86, 7, 6, 0, "Thunder Bluff Armorers");
player->SEND_GOSSIP_MENU(1341,_Creature->GetGUID());
break;
}
@@ -525,35 +525,35 @@ void SendDefaultMenu_guard_darnassus(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(9861.23, 2334.55, 6, 6, 0, "Darnassus Auction House");
+ player->SEND_POI(9861.23, 2334.55, 7, 6, 0, "Darnassus Auction House");
player->SEND_GOSSIP_MENU(3833, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9938.45, 2512.35, 6, 6, 0, "Darnassus Bank");
+ player->SEND_POI(9938.45, 2512.35, 7, 6, 0, "Darnassus Bank");
player->SEND_GOSSIP_MENU(3017, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Wind master
- player->SEND_POI(9945.65, 2618.94, 6, 6, 0, "Rut'theran Village");
+ player->SEND_POI(9945.65, 2618.94, 7, 6, 0, "Rut'theran Village");
player->SEND_GOSSIP_MENU(3018, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Guild master
- player->SEND_POI(10076.40, 2199.59, 6, 6, 0, "Darnassus Guild Master");
+ player->SEND_POI(10076.40, 2199.59, 7, 6, 0, "Darnassus Guild Master");
player->SEND_GOSSIP_MENU(3019, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(10133.29, 2222.52, 6, 6, 0, "Darnassus Inn");
+ player->SEND_POI(10133.29, 2222.52, 7, 6, 0, "Darnassus Inn");
player->SEND_GOSSIP_MENU(3020, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(9942.17, 2495.48, 6, 6, 0, "Darnassus Mailbox");
+ player->SEND_POI(9942.17, 2495.48, 7, 6, 0, "Darnassus Mailbox");
player->SEND_GOSSIP_MENU(3021, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(10167.20, 2522.66, 6, 6, 0, "Alassin");
+ player->SEND_POI(10167.20, 2522.66, 7, 6, 0, "Alassin");
player->SEND_GOSSIP_MENU(5980, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(9907.11, 2329.70, 6, 6, 0, "Ilyenia Moonfire");
+ player->SEND_POI(9907.11, 2329.70, 7, 6, 0, "Ilyenia Moonfire");
player->SEND_GOSSIP_MENU(4517, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
@@ -590,15 +590,15 @@ void SendBattleMasterMenu_guard_darnassus(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9923.61, 2327.43, 6, 6, 0, "Brogun Stoneshield");
+ player->SEND_POI(9923.61, 2327.43, 7, 6, 0, "Brogun Stoneshield");
player->SEND_GOSSIP_MENU(7518, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9977.37, 2324.39, 6, 6, 0, "Keras Wolfheart");
+ player->SEND_POI(9977.37, 2324.39, 7, 6, 0, "Keras Wolfheart");
player->SEND_GOSSIP_MENU(7651, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(9979.84, 2315.79, 6, 6, 0, "Aethalas");
+ player->SEND_POI(9979.84, 2315.79, 7, 6, 0, "Aethalas");
player->SEND_GOSSIP_MENU(7482, _Creature->GetGUID());
break;
}
@@ -609,23 +609,23 @@ void SendClassTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(10186, 2570.46, 6, 6, 0, "Darnassus Druid Trainer");
+ player->SEND_POI(10186, 2570.46, 7, 6, 0, "Darnassus Druid Trainer");
player->SEND_GOSSIP_MENU(3024, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(10177.29, 2511.10, 6, 6, 0, "Darnassus Hunter Trainer");
+ player->SEND_POI(10177.29, 2511.10, 7, 6, 0, "Darnassus Hunter Trainer");
player->SEND_GOSSIP_MENU(3023, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9659.12, 2524.88, 6, 6, 0, "Temple of the Moon");
+ player->SEND_POI(9659.12, 2524.88, 7, 6, 0, "Temple of the Moon");
player->SEND_GOSSIP_MENU(3025, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(10122, 2599.12, 6, 6, 0, "Darnassus Rogue Trainer");
+ player->SEND_POI(10122, 2599.12, 7, 6, 0, "Darnassus Rogue Trainer");
player->SEND_GOSSIP_MENU(3026, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9951.91, 2280.38, 6, 6, 0, "Warrior's Terrace");
+ player->SEND_POI(9951.91, 2280.38, 7, 6, 0, "Warrior's Terrace");
player->SEND_GOSSIP_MENU(3033, _Creature->GetGUID());
break;
}
@@ -636,39 +636,39 @@ void SendProfTrainerMenu_guard_darnassus(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(10075.90, 2356.76, 6, 6, 0, "Darnassus Alchemy Trainer");
+ player->SEND_POI(10075.90, 2356.76, 7, 6, 0, "Darnassus Alchemy Trainer");
player->SEND_GOSSIP_MENU(3035, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(10088.59, 2419.21, 6, 6, 0, "Darnassus Cooking Trainer");
+ player->SEND_POI(10088.59, 2419.21, 7, 6, 0, "Darnassus Cooking Trainer");
player->SEND_GOSSIP_MENU(3036, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10146.09, 2313.42, 6, 6, 0, "Darnassus Enchanting Trainer");
+ player->SEND_POI(10146.09, 2313.42, 7, 6, 0, "Darnassus Enchanting Trainer");
player->SEND_GOSSIP_MENU(3337, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(10150.09, 2390.43, 6, 6, 0, "Darnassus First Aid Trainer");
+ player->SEND_POI(10150.09, 2390.43, 7, 6, 0, "Darnassus First Aid Trainer");
player->SEND_GOSSIP_MENU(3037, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
- player->SEND_POI(9836.20, 2432.17, 6, 6, 0, "Darnassus Fishing Trainer");
+ player->SEND_POI(9836.20, 2432.17, 7, 6, 0, "Darnassus Fishing Trainer");
player->SEND_GOSSIP_MENU(3038, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9757.17, 2430.16, 6, 6, 0, "Darnassus Herbalism Trainer");
+ player->SEND_POI(9757.17, 2430.16, 7, 6, 0, "Darnassus Herbalism Trainer");
player->SEND_GOSSIP_MENU(3039, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10086.59, 2255.77, 6, 6, 0, "Darnassus Leatherworking Trainer");
+ player->SEND_POI(10086.59, 2255.77, 7, 6, 0, "Darnassus Leatherworking Trainer");
player->SEND_GOSSIP_MENU(3040, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10081.40, 2257.18, 6, 6, 0, "Darnassus Skinning Trainer");
+ player->SEND_POI(10081.40, 2257.18, 7, 6, 0, "Darnassus Skinning Trainer");
player->SEND_GOSSIP_MENU(3042, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
- player->SEND_POI(10079.70, 2268.19, 6, 6, 0, "Darnassus Tailor");
+ player->SEND_POI(10079.70, 2268.19, 7, 6, 0, "Darnassus Tailor");
player->SEND_GOSSIP_MENU(3044, _Creature->GetGUID());
break;
}
@@ -727,11 +727,11 @@ void SendDefaultMenu_guard_dunmorogh(Player *player, Creature *_Creature, uint32
player->SEND_GOSSIP_MENU(4290,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-5582.66, -525.89, 6, 6, 0, "Thunderbrew Distillery");
+ player->SEND_POI(-5582.66, -525.89, 7, 6, 0, "Thunderbrew Distillery");
player->SEND_GOSSIP_MENU(4291,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-5604, -509.58, 6, 6, 0, "Shelby Stoneflint");
+ player->SEND_POI(-5604, -509.58, 7, 6, 0, "Shelby Stoneflint");
player->SEND_GOSSIP_MENU(5985,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
@@ -767,31 +767,31 @@ void SendClassTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5618.29, -454.25, 6, 6, 0, "Grif Wildheart");
+ player->SEND_POI(-5618.29, -454.25, 7, 6, 0, "Grif Wildheart");
player->SEND_GOSSIP_MENU(4293,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Magis Sparkmantle");
+ player->SEND_POI(-5585.6, -539.99, 7, 6, 0, "Magis Sparkmantle");
player->SEND_GOSSIP_MENU(4294,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-5585.6, -539.99, 6, 6, 0, "Azar Stronghammer");
+ player->SEND_POI(-5585.6, -539.99, 7, 6, 0, "Azar Stronghammer");
player->SEND_GOSSIP_MENU(4295,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-5591.74, -525.61, 6, 6, 0, "Maxan Anvol");
+ player->SEND_POI(-5591.74, -525.61, 7, 6, 0, "Maxan Anvol");
player->SEND_GOSSIP_MENU(4296,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-5602.75, -542.4, 6, 6, 0, "Hogral Bakkan");
+ player->SEND_POI(-5602.75, -542.4, 7, 6, 0, "Hogral Bakkan");
player->SEND_GOSSIP_MENU(4297,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-5641.97, -523.76, 6, 6, 0, "Gimrizz Shadowcog");
+ player->SEND_POI(-5641.97, -523.76, 7, 6, 0, "Gimrizz Shadowcog");
player->SEND_GOSSIP_MENU(4298,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5604.79, -529.38, 6, 6, 0, "Granis Swiftaxe");
+ player->SEND_POI(-5604.79, -529.38, 7, 6, 0, "Granis Swiftaxe");
player->SEND_GOSSIP_MENU(4299,_Creature->GetGUID());
break;
}
@@ -805,26 +805,26 @@ void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, ui
player->SEND_GOSSIP_MENU(4301,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-5584.72, -428.41, 6, 6, 0, "Tognus Flintfire");
+ player->SEND_POI(-5584.72, -428.41, 7, 6, 0, "Tognus Flintfire");
player->SEND_GOSSIP_MENU(4302,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-5596.85, -541.43, 6, 6, 0, "Gremlock Pilsnor");
+ player->SEND_POI(-5596.85, -541.43, 7, 6, 0, "Gremlock Pilsnor");
player->SEND_GOSSIP_MENU(4303,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
player->SEND_GOSSIP_MENU(4304,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Bronk Guzzlegear");
+ player->SEND_POI(-5531, -666.53, 7, 6, 0, "Bronk Guzzlegear");
player->SEND_GOSSIP_MENU(4305,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-5603.67, -523.57, 6, 6, 0, "Thamner Pol");
+ player->SEND_POI(-5603.67, -523.57, 7, 6, 0, "Thamner Pol");
player->SEND_GOSSIP_MENU(4306,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-5199.9, 58.58, 6, 6, 0, "Paxton Ganter");
+ player->SEND_POI(-5199.9, 58.58, 7, 6, 0, "Paxton Ganter");
player->SEND_GOSSIP_MENU(4307,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
@@ -834,7 +834,7 @@ void SendProfTrainerMenu_guard_dunmorogh(Player *player, Creature *_Creature, ui
player->SEND_GOSSIP_MENU(4310,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-5531, -666.53, 6, 6, 0, "Yarr Hamerstone");
+ player->SEND_POI(-5531, -666.53, 7, 6, 0, "Yarr Hamerstone");
player->SEND_GOSSIP_MENU(4311,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
@@ -893,11 +893,11 @@ void SendDefaultMenu_guard_durotar(Player *player, Creature *_Creature, uint32 a
player->SEND_GOSSIP_MENU(4033,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(338.7, -4688.87, 6, 6, 0, "Razor Hill Inn");
+ player->SEND_POI(338.7, -4688.87, 7, 6, 0, "Razor Hill Inn");
player->SEND_GOSSIP_MENU(4034,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(330.31, -4710.66, 6, 6, 0, "Shoja'my");
+ player->SEND_POI(330.31, -4710.66, 7, 6, 0, "Shoja'my");
player->SEND_GOSSIP_MENU(5973,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
@@ -933,31 +933,31 @@ void SendClassTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(276, -4706.72, 6, 6, 0, "Thotar");
+ player->SEND_POI(276, -4706.72, 7, 6, 0, "Thotar");
player->SEND_GOSSIP_MENU(4013,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-839.33, -4935.6, 6, 6, 0, "Un'Thuwa");
+ player->SEND_POI(-839.33, -4935.6, 7, 6, 0, "Un'Thuwa");
player->SEND_GOSSIP_MENU(4014,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(296.22, -4828.1, 6, 6, 0, "Tai'jin");
+ player->SEND_POI(296.22, -4828.1, 7, 6, 0, "Tai'jin");
player->SEND_GOSSIP_MENU(4015,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(265.76, -4709, 6, 6, 0, "Kaplak");
+ player->SEND_POI(265.76, -4709, 7, 6, 0, "Kaplak");
player->SEND_GOSSIP_MENU(4016,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Shaman
- player->SEND_POI(307.79, -4836.97, 6, 6, 0, "Swart");
+ player->SEND_POI(307.79, -4836.97, 7, 6, 0, "Swart");
player->SEND_GOSSIP_MENU(4017,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(355.88, -4836.45, 6, 6, 0, "Dhugru Gorelust");
+ player->SEND_POI(355.88, -4836.45, 7, 6, 0, "Dhugru Gorelust");
player->SEND_GOSSIP_MENU(4018,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(312.3, -4824.66, 6, 6, 0, "Tarshaw Jaggedscar");
+ player->SEND_POI(312.3, -4824.66, 7, 6, 0, "Tarshaw Jaggedscar");
player->SEND_GOSSIP_MENU(4019,_Creature->GetGUID());
break;
}
@@ -968,11 +968,11 @@ void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-800.25, -4894.33, 6, 6, 0, "Miao'zan");
+ player->SEND_POI(-800.25, -4894.33, 7, 6, 0, "Miao'zan");
player->SEND_GOSSIP_MENU(4020,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(373.24, -4716.45, 6, 6, 0, "Dwukk");
+ player->SEND_POI(373.24, -4716.45, 7, 6, 0, "Dwukk");
player->SEND_GOSSIP_MENU(4021,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
@@ -982,26 +982,26 @@ void SendProfTrainerMenu_guard_durotar(Player *player, Creature *_Creature, uint
player->SEND_GOSSIP_MENU(4023,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(368.95, -4723.95, 6, 6, 0, "Mukdrak");
+ player->SEND_POI(368.95, -4723.95, 7, 6, 0, "Mukdrak");
player->SEND_GOSSIP_MENU(4024,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(327.17, -4825.62, 6, 6, 0, "Rawrk");
+ player->SEND_POI(327.17, -4825.62, 7, 6, 0, "Rawrk");
player->SEND_GOSSIP_MENU(4025,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-1065.48, -4777.43, 6, 6, 0, "Lau'Tiki");
+ player->SEND_POI(-1065.48, -4777.43, 7, 6, 0, "Lau'Tiki");
player->SEND_GOSSIP_MENU(4026,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-836.25, -4896.89, 6, 6, 0, "Mishiki");
+ player->SEND_POI(-836.25, -4896.89, 7, 6, 0, "Mishiki");
player->SEND_GOSSIP_MENU(4027,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
player->SEND_GOSSIP_MENU(4028,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(366.94, -4705, 6, 6, 0, "Krunn");
+ player->SEND_POI(366.94, -4705, 7, 6, 0, "Krunn");
player->SEND_GOSSIP_MENU(4029,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
@@ -1064,11 +1064,11 @@ void SendDefaultMenu_guard_elwynnforest(Player *player, Creature *_Creature, uin
player->SEND_GOSSIP_MENU(4262,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-9459.34, 42.08, 6, 6, 0, "Lion's Pride Inn");
+ player->SEND_POI(-9459.34, 42.08, 7, 6, 0, "Lion's Pride Inn");
player->SEND_GOSSIP_MENU(4263,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Stable Master
- player->SEND_POI(-9466.62, 45.87, 6, 6, 0, "Erma");
+ player->SEND_POI(-9466.62, 45.87, 7, 6, 0, "Erma");
player->SEND_GOSSIP_MENU(5983,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Class trainer
@@ -1111,27 +1111,27 @@ void SendClassTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature
player->SEND_GOSSIP_MENU(4266,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-9471.12, 33.44, 6, 6, 0, "Zaldimar Wefhellt");
+ player->SEND_POI(-9471.12, 33.44, 7, 6, 0, "Zaldimar Wefhellt");
player->SEND_GOSSIP_MENU(4268,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-9469, 108.05, 6, 6, 0, "Brother Wilhelm");
+ player->SEND_POI(-9469, 108.05, 7, 6, 0, "Brother Wilhelm");
player->SEND_GOSSIP_MENU(4269,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-9461.07, 32.6, 6, 6, 0, "Priestess Josetta");
+ player->SEND_POI(-9461.07, 32.6, 7, 6, 0, "Priestess Josetta");
player->SEND_GOSSIP_MENU(4267,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(-9465.13, 13.29, 6, 6, 0, "Keryn Sylvius");
+ player->SEND_POI(-9465.13, 13.29, 7, 6, 0, "Keryn Sylvius");
player->SEND_GOSSIP_MENU(4270,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(-9473.21, -4.08, 6, 6, 0, "Maximillian Crowe");
+ player->SEND_POI(-9473.21, -4.08, 7, 6, 0, "Maximillian Crowe");
player->SEND_GOSSIP_MENU(4272,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Warrior
- player->SEND_POI(-9461.82, 109.50, 6, 6, 0, "Lyria Du Lac");
+ player->SEND_POI(-9461.82, 109.50, 7, 6, 0, "Lyria Du Lac");
player->SEND_GOSSIP_MENU(4271,_Creature->GetGUID());
break;
}
@@ -1142,15 +1142,15 @@ void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-9057.04, 153.63, 6, 6, 0, "Alchemist Mallory");
+ player->SEND_POI(-9057.04, 153.63, 7, 6, 0, "Alchemist Mallory");
player->SEND_GOSSIP_MENU(4274,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-9456.58, 87.90, 6, 6, 0, "Smith Argus");
+ player->SEND_POI(-9456.58, 87.90, 7, 6, 0, "Smith Argus");
player->SEND_GOSSIP_MENU(4275,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-9467.54, -3.16, 6, 6, 0, "Tomas");
+ player->SEND_POI(-9467.54, -3.16, 7, 6, 0, "Tomas");
player->SEND_GOSSIP_MENU(4276,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
@@ -1160,30 +1160,30 @@ void SendProfTrainerMenu_guard_elwynnforest(Player *player, Creature *_Creature,
player->SEND_GOSSIP_MENU(4278,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-9456.82, 30.49, 6, 6, 0, "Michelle Belle");
+ player->SEND_POI(-9456.82, 30.49, 7, 6, 0, "Michelle Belle");
player->SEND_GOSSIP_MENU(4279,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-9386.54, -118.73, 6, 6, 0, "Lee Brown");
+ player->SEND_POI(-9386.54, -118.73, 7, 6, 0, "Lee Brown");
player->SEND_GOSSIP_MENU(4280,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-9060.70, 149.23, 6, 6, 0, "Herbalist Pomeroy");
+ player->SEND_POI(-9060.70, 149.23, 7, 6, 0, "Herbalist Pomeroy");
player->SEND_GOSSIP_MENU(4281,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Adele Fielder");
+ player->SEND_POI(-9376.12, -75.23, 7, 6, 0, "Adele Fielder");
player->SEND_GOSSIP_MENU(4282,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
player->SEND_GOSSIP_MENU(4283,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-9536.91, -1212.76, 6, 6, 0, "Helene Peltskinner");
+ player->SEND_POI(-9536.91, -1212.76, 7, 6, 0, "Helene Peltskinner");
player->SEND_GOSSIP_MENU(4284,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-9376.12, -75.23, 6, 6, 0, "Eldrin");
+ player->SEND_POI(-9376.12, -75.23, 7, 6, 0, "Eldrin");
player->SEND_GOSSIP_MENU(4285,_Creature->GetGUID());
break;
}
@@ -1230,18 +1230,18 @@ void SendDefaultMenu_guard_eversong(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Bat Handler
- player->SEND_POI(9371.93, -7164.80, 6, 6, 0, "Skymistress Gloaming");
+ player->SEND_POI(9371.93, -7164.80, 7, 6, 0, "Skymistress Gloaming");
player->SEND_GOSSIP_MENU(10181,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Guild master
player->SEND_GOSSIP_MENU(10182,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(9483.74, -6844.58, 6, 6, 0, "Delaniel's inn");
+ player->SEND_POI(9483.74, -6844.58, 7, 6, 0, "Delaniel's inn");
player->SEND_GOSSIP_MENU(10183,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(9489.62, -6829.93, 6, 6, 0, "Anathos");
+ player->SEND_POI(9489.62, -6829.93, 7, 6, 0, "Anathos");
player->SEND_GOSSIP_MENU(10184,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
@@ -1280,27 +1280,27 @@ void SendClassTrainerMenu_guard_eversong(Player *player, Creature *_Creature, ui
player->SEND_GOSSIP_MENU(10185,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9527.44, -6865.25, 6, 6, 0, "Hannovia");
+ player->SEND_POI(9527.44, -6865.25, 7, 6, 0, "Hannovia");
player->SEND_GOSSIP_MENU(10186,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9464.24, -6855.52, 6, 6, 0, "Garridel");
+ player->SEND_POI(9464.24, -6855.52, 7, 6, 0, "Garridel");
player->SEND_GOSSIP_MENU(10187,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9517.61, -6871.04, 6, 6, 0, "Noellene");
+ player->SEND_POI(9517.61, -6871.04, 7, 6, 0, "Noellene");
player->SEND_GOSSIP_MENU(10189,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9467.39, -6845.72, 6, 6, 0, "Ponaris");
+ player->SEND_POI(9467.39, -6845.72, 7, 6, 0, "Ponaris");
player->SEND_GOSSIP_MENU(10190,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9533.67, -6877.39, 6, 6, 0, "Tannaria");
+ player->SEND_POI(9533.67, -6877.39, 7, 6, 0, "Tannaria");
player->SEND_GOSSIP_MENU(10191,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9468.99, -6865.60, 6, 6, 0, "Celoenus");
+ player->SEND_POI(9468.99, -6865.60, 7, 6, 0, "Celoenus");
player->SEND_GOSSIP_MENU(10192,_Creature->GetGUID());
break;
}
@@ -1311,48 +1311,48 @@ void SendProfTrainerMenu_guard_eversong(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(8659.90, -6368.12, 6, 6, 0, "Arcanist Sheynathren");
+ player->SEND_POI(8659.90, -6368.12, 7, 6, 0, "Arcanist Sheynathren");
player->SEND_GOSSIP_MENU(10193,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(8984.21, -7419.21, 6, 6, 0, "Arathel Sunforge");
+ player->SEND_POI(8984.21, -7419.21, 7, 6, 0, "Arathel Sunforge");
player->SEND_GOSSIP_MENU(10194,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9494.04, -6881.51, 6, 6, 0, "Quarelestra");
+ player->SEND_POI(9494.04, -6881.51, 7, 6, 0, "Quarelestra");
player->SEND_GOSSIP_MENU(10195,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Engineering
player->SEND_GOSSIP_MENU(10197,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(9479.46, -6879.16, 6, 6, 0, "Kanaria");
+ player->SEND_POI(9479.46, -6879.16, 7, 6, 0, "Kanaria");
player->SEND_GOSSIP_MENU(10198,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
player->SEND_GOSSIP_MENU(10199,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
- player->SEND_POI(8678.92, -6329.09, 6, 6, 0, "Botanist Tyniarrel");
+ player->SEND_POI(8678.92, -6329.09, 7, 6, 0, "Botanist Tyniarrel");
player->SEND_GOSSIP_MENU(10200,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9484.32, -6874.98, 6, 6, 0, "Aleinia");
+ player->SEND_POI(9484.32, -6874.98, 7, 6, 0, "Aleinia");
player->SEND_GOSSIP_MENU(10203,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Sathein");
+ player->SEND_POI(9362.04, -7130.33, 7, 6, 0, "Sathein");
player->SEND_GOSSIP_MENU(10204,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
player->SEND_GOSSIP_MENU(10205,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(9362.04, -7130.33, 6, 6, 0, "Mathreyn");
+ player->SEND_POI(9362.04, -7130.33, 7, 6, 0, "Mathreyn");
player->SEND_GOSSIP_MENU(10206,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(8680.36, -6327.51, 6, 6, 0, "Sempstress Ambershine");
+ player->SEND_POI(8680.36, -6327.51, 7, 6, 0, "Sempstress Ambershine");
player->SEND_GOSSIP_MENU(10207,_Creature->GetGUID());
break;
}
@@ -1404,35 +1404,35 @@ void SendDefaultMenu_guard_exodar(Player *player, Creature *_Creature, uint32 ac
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Auction house
- player->SEND_POI(-4023.6, -11739.3, 6, 6, 0, "Exodar Auction House");
+ player->SEND_POI(-4023.6, -11739.3, 7, 6, 0, "Exodar Auction House");
player->SEND_GOSSIP_MENU(9528, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-3923.89, -11544.5, 6, 6, 0, "Exodar Bank");
+ player->SEND_POI(-3923.89, -11544.5, 7, 6, 0, "Exodar Bank");
player->SEND_GOSSIP_MENU(9529, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(-4092.57, -11626.5, 6, 6, 0, "Exodar Guild Master");
+ player->SEND_POI(-4092.57, -11626.5, 7, 6, 0, "Exodar Guild Master");
player->SEND_GOSSIP_MENU(9539, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Hippogryph master
- player->SEND_POI(-4060.46, -11787.1, 6, 6, 0, "Exodar Hippogryph Master");
+ player->SEND_POI(-4060.46, -11787.1, 7, 6, 0, "Exodar Hippogryph Master");
player->SEND_GOSSIP_MENU(9530, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Inn
- player->SEND_POI(-3741.87, -11695.1, 6, 6, 0, "Exodar Inn");
+ player->SEND_POI(-3741.87, -11695.1, 7, 6, 0, "Exodar Inn");
player->SEND_GOSSIP_MENU(9545, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Mailbox
- player->SEND_POI(-3972.5, -11696.0, 6, 6, 0, "Mailbox");
+ player->SEND_POI(-3972.5, -11696.0, 7, 6, 0, "Mailbox");
player->SEND_GOSSIP_MENU(10254, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Stable master
- player->SEND_POI(-3786.5, -11702.5, 6, 6, 0, "Stable Master Arthaid");
+ player->SEND_POI(-3786.5, -11702.5, 7, 6, 0, "Stable Master Arthaid");
player->SEND_GOSSIP_MENU(9558, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Weapon trainer
- player->SEND_POI(-4215.68, -11628.9, 6, 6, 0, "Weapon Master Handiir");
+ player->SEND_POI(-4215.68, -11628.9, 7, 6, 0, "Weapon Master Handiir");
player->SEND_GOSSIP_MENU(9565, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
@@ -1477,23 +1477,23 @@ void SendBattleMasterMenu_guard_exodar(Player *player, Creature *_Creature, uint
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Alterac Valley Battlemaster");
+ player->SEND_POI(-3978.1, -11357, 7, 6, 0, "Alterac Valley Battlemaster");
player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-3998.9, -11345.2, 6, 6, 0, "Arathi Basin Battlemaster");
+ player->SEND_POI(-3998.9, -11345.2, 7, 6, 0, "Arathi Basin Battlemaster");
player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(-3759.27, -11695.63, 6, 6, 0, "Miglik Blotstrom");
+ player->SEND_POI(-3759.27, -11695.63, 7, 6, 0, "Miglik Blotstrom");
player->SEND_GOSSIP_MENU(10223, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(-3978.1, -11357, 6, 6, 0, "Eye Of The Storm Battlemaster");
+ player->SEND_POI(-3978.1, -11357, 7, 6, 0, "Eye Of The Storm Battlemaster");
player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(-3977.5, -11381.2, 6, 6, 0, "Warsong Gulch Battlemaster");
+ player->SEND_POI(-3977.5, -11381.2, 7, 6, 0, "Warsong Gulch Battlemaster");
player->SEND_GOSSIP_MENU(9531, _Creature->GetGUID());
break;
}
@@ -1504,31 +1504,31 @@ void SendClassTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-4276.0, -11495, 6, 6, 0, "Exodar Druid Trainer");
+ player->SEND_POI(-4276.0, -11495, 7, 6, 0, "Exodar Druid Trainer");
player->SEND_GOSSIP_MENU(9534, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-4210.6, -11575.2, 6, 6, 0, "Exodar Hunter Trainer");
+ player->SEND_POI(-4210.6, -11575.2, 7, 6, 0, "Exodar Hunter Trainer");
player->SEND_GOSSIP_MENU(9544, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(-4057.32, -11556.5, 6, 6, 0, "Exodar Mage Trainer");
+ player->SEND_POI(-4057.32, -11556.5, 7, 6, 0, "Exodar Mage Trainer");
player->SEND_GOSSIP_MENU(9550, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(-4191.2, -11470.4, 6, 6, 0, "Exodar Paladin Trainer");
+ player->SEND_POI(-4191.2, -11470.4, 7, 6, 0, "Exodar Paladin Trainer");
player->SEND_GOSSIP_MENU(9553, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-3969.63, -11482.8, 6, 6, 0, "Exodar Priest Trainer");
+ player->SEND_POI(-3969.63, -11482.8, 7, 6, 0, "Exodar Priest Trainer");
player->SEND_GOSSIP_MENU(9554, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Shaman
- player->SEND_POI(-3805.5, -11380.7, 6, 6, 0, "Exodar Shaman Trainer");
+ player->SEND_POI(-3805.5, -11380.7, 7, 6, 0, "Exodar Shaman Trainer");
player->SEND_GOSSIP_MENU(9556, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-4189.43, -11653.7, 6, 6, 0, "Exodar Warrior Trainer");
+ player->SEND_POI(-4189.43, -11653.7, 7, 6, 0, "Exodar Warrior Trainer");
player->SEND_GOSSIP_MENU(9562, _Creature->GetGUID());
break;
}
@@ -1539,55 +1539,55 @@ void SendProfTrainerMenu_guard_exodar(Player *player, Creature *_Creature, uint3
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Alchemy Trainer");
+ player->SEND_POI(-4040.6, -11364.5, 7, 6, 0, "Exodar Alchemy Trainer");
player->SEND_GOSSIP_MENU(9527, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4229.5, -11706, 6, 6, 0, "Exodar Blacksmithing Trainer");
+ player->SEND_POI(-4229.5, -11706, 7, 6, 0, "Exodar Blacksmithing Trainer");
player->SEND_GOSSIP_MENU(9532, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-3798.3, -11651.7, 6, 6, 0, "Exodar Cooking Trainer");
+ player->SEND_POI(-3798.3, -11651.7, 7, 6, 0, "Exodar Cooking Trainer");
player->SEND_GOSSIP_MENU(9551, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-3889.3, -11495, 6, 6, 0, "Exodar Enchanting Trainer");
+ player->SEND_POI(-3889.3, -11495, 7, 6, 0, "Exodar Enchanting Trainer");
player->SEND_GOSSIP_MENU(9535, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4257.68, -11640.3, 6, 6, 0, "Exodar Engineering Trainer");
+ player->SEND_POI(-4257.68, -11640.3, 7, 6, 0, "Exodar Engineering Trainer");
player->SEND_GOSSIP_MENU(9536, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-3769.5, -11479.6, 6, 6, 0, "Exodar First Aid Trainer");
+ player->SEND_POI(-3769.5, -11479.6, 7, 6, 0, "Exodar First Aid Trainer");
player->SEND_GOSSIP_MENU(9537, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-3725.5, -11385.2, 6, 6, 0, "Exodar Fishing Trainer");
+ player->SEND_POI(-3725.5, -11385.2, 7, 6, 0, "Exodar Fishing Trainer");
player->SEND_GOSSIP_MENU(9538, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(-3783, -11546, 6, 6, 0, "Exodar Jewelcrafting Trainer");
+ player->SEND_POI(-3783, -11546, 7, 6, 0, "Exodar Jewelcrafting Trainer");
player->SEND_GOSSIP_MENU(9547, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(-4040.6, -11364.5, 6, 6, 0, "Exodar Herbalist Trainer");
+ player->SEND_POI(-4040.6, -11364.5, 7, 6, 0, "Exodar Herbalist Trainer");
player->SEND_GOSSIP_MENU(9543, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(-4140.6, -11776.7, 6, 6, 0, "Exodar Leatherworking Trainer");
+ player->SEND_POI(-4140.6, -11776.7, 7, 6, 0, "Exodar Leatherworking Trainer");
player->SEND_GOSSIP_MENU(9549, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(-4228, -11697, 6, 6, 0, "Exodar Mining Trainer");
+ player->SEND_POI(-4228, -11697, 7, 6, 0, "Exodar Mining Trainer");
player->SEND_GOSSIP_MENU(9552, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(-4134.97, -11760.5, 6, 6, 0, "Exodar Skinning Trainer");
+ player->SEND_POI(-4134.97, -11760.5, 7, 6, 0, "Exodar Skinning Trainer");
player->SEND_GOSSIP_MENU(9557, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(-4092.5, -11744.5, 6, 6, 0, "Exodar Tailor Trainer");
+ player->SEND_POI(-4092.5, -11744.5, 7, 6, 0, "Exodar Tailor Trainer");
player->SEND_GOSSIP_MENU(9559, _Creature->GetGUID());
break;
}
@@ -1641,39 +1641,39 @@ void SendDefaultMenu_guard_ironforge(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-4957.39, -911.6, 6, 6, 0, "Ironforge Auction House");
+ player->SEND_POI(-4957.39, -911.6, 7, 6, 0, "Ironforge Auction House");
player->SEND_GOSSIP_MENU(3014, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-4891.91, -991.47, 6, 6, 0, "The Vault");
+ player->SEND_POI(-4891.91, -991.47, 7, 6, 0, "The Vault");
player->SEND_GOSSIP_MENU(2761, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Tram
- player->SEND_POI(-4835.27, -1294.69, 6, 6, 0, "Deeprun Tram");
+ player->SEND_POI(-4835.27, -1294.69, 7, 6, 0, "Deeprun Tram");
player->SEND_GOSSIP_MENU(3814, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Gryphon Master
- player->SEND_POI(-4821.52, -1152.3, 6, 6, 0, "Ironforge Gryphon Master");
+ player->SEND_POI(-4821.52, -1152.3, 7, 6, 0, "Ironforge Gryphon Master");
player->SEND_GOSSIP_MENU(2762, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Guild Master
- player->SEND_POI(-5021, -996.45, 6, 6, 0, "Ironforge Visitor's Center");
+ player->SEND_POI(-5021, -996.45, 7, 6, 0, "Ironforge Visitor's Center");
player->SEND_GOSSIP_MENU(2764, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Inn
- player->SEND_POI(-4850.47, -872.57, 6, 6, 0, "Stonefire Tavern");
+ player->SEND_POI(-4850.47, -872.57, 7, 6, 0, "Stonefire Tavern");
player->SEND_GOSSIP_MENU(2768, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-4845.7, -880.55, 6, 6, 0, "Ironforge Mailbox");
+ player->SEND_POI(-4845.7, -880.55, 7, 6, 0, "Ironforge Mailbox");
player->SEND_GOSSIP_MENU(2769, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-5010.2, -1262, 6, 6, 0, "Ulbrek Firehand");
+ player->SEND_POI(-5010.2, -1262, 7, 6, 0, "Ulbrek Firehand");
player->SEND_GOSSIP_MENU(5986, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Weapons Trainer
- player->SEND_POI(-5040, -1201.88, 6, 6, 0, "Bixi and Buliwyf");
+ player->SEND_POI(-5040, -1201.88, 7, 6, 0, "Bixi and Buliwyf");
player->SEND_GOSSIP_MENU(4518, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
@@ -1716,15 +1716,15 @@ void SendBattleMasterMenu_guard_ironforge(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-5047.87, -1263.77, 6, 6, 0, "Glordrum Steelbeard");
+ player->SEND_POI(-5047.87, -1263.77, 7, 6, 0, "Glordrum Steelbeard");
player->SEND_GOSSIP_MENU(7483, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-5038.37, -1266.39, 6, 6, 0, "Donal Osgood");
+ player->SEND_POI(-5038.37, -1266.39, 7, 6, 0, "Donal Osgood");
player->SEND_GOSSIP_MENU(7649, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-5037.24, -1274.82, 6, 6, 0, "Lylandris");
+ player->SEND_POI(-5037.24, -1274.82, 7, 6, 0, "Lylandris");
player->SEND_GOSSIP_MENU(7528, _Creature->GetGUID());
break;
}
@@ -1735,35 +1735,35 @@ void SendClassTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(-5023, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_POI(-5023, -1253.68, 7, 6, 0, "Hall of Arms");
player->SEND_GOSSIP_MENU(2770, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_POI(-4627, -926.45, 7, 6, 0, "Hall of Mysteries");
player->SEND_GOSSIP_MENU(2771, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Paladin
- player->SEND_POI(-4627.02, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_POI(-4627.02, -926.45, 7, 6, 0, "Hall of Mysteries");
player->SEND_GOSSIP_MENU(2773, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Priest
- player->SEND_POI(-4627, -926.45, 6, 6, 0, "Hall of Mysteries");
+ player->SEND_POI(-4627, -926.45, 7, 6, 0, "Hall of Mysteries");
player->SEND_GOSSIP_MENU(2772, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(-4647.83, -1124, 6, 6, 0, "Ironforge Rogue Trainer");
+ player->SEND_POI(-4647.83, -1124, 7, 6, 0, "Ironforge Rogue Trainer");
player->SEND_GOSSIP_MENU(2774, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(-4605, -1110.45, 6, 6, 0, "Ironforge Warlock Trainer");
+ player->SEND_POI(-4605, -1110.45, 7, 6, 0, "Ironforge Warlock Trainer");
player->SEND_GOSSIP_MENU(2775, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(-5023.08, -1253.68, 6, 6, 0, "Hall of Arms");
+ player->SEND_POI(-5023.08, -1253.68, 7, 6, 0, "Hall of Arms");
player->SEND_GOSSIP_MENU(2776, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Shaman
- player->SEND_POI(-4732, -1147, 6, 6, 0, "Ironforge Shaman Trainer");
+ player->SEND_POI(-4732, -1147, 7, 6, 0, "Ironforge Shaman Trainer");
//incorrect id
player->SEND_GOSSIP_MENU(2766, _Creature->GetGUID());
break;
@@ -1775,51 +1775,51 @@ void SendProfTrainerMenu_guard_ironforge(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-4858.5, -1241.83, 6, 6, 0, "Berryfizz's Potions and Mixed Drinks");
+ player->SEND_POI(-4858.5, -1241.83, 7, 6, 0, "Berryfizz's Potions and Mixed Drinks");
player->SEND_GOSSIP_MENU(2794, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-4796.97, -1110.17, 6, 6, 0, "The Great Forge");
+ player->SEND_POI(-4796.97, -1110.17, 7, 6, 0, "The Great Forge");
player->SEND_GOSSIP_MENU(2795, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-4767.83, -1184.59, 6, 6, 0, "The Bronze Kettle");
+ player->SEND_POI(-4767.83, -1184.59, 7, 6, 0, "The Bronze Kettle");
player->SEND_GOSSIP_MENU(2796, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-4803.72, -1196.53, 6, 6, 0, "Thistlefuzz Arcanery");
+ player->SEND_POI(-4803.72, -1196.53, 7, 6, 0, "Thistlefuzz Arcanery");
player->SEND_GOSSIP_MENU(2797, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-4799.56, -1250.23, 6, 6, 0, "Springspindle's Gadgets");
+ player->SEND_POI(-4799.56, -1250.23, 7, 6, 0, "Springspindle's Gadgets");
player->SEND_GOSSIP_MENU(2798, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-4881.6, -1153.13, 6, 6, 0, "Ironforge Physician");
+ player->SEND_POI(-4881.6, -1153.13, 7, 6, 0, "Ironforge Physician");
player->SEND_GOSSIP_MENU(2799, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-4597.91, -1091.93, 6, 6, 0, "Traveling Fisherman");
+ player->SEND_POI(-4597.91, -1091.93, 7, 6, 0, "Traveling Fisherman");
player->SEND_GOSSIP_MENU(2800, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-4876.9, -1151.92, 6, 6, 0, "Ironforge Physician");
+ player->SEND_POI(-4876.9, -1151.92, 7, 6, 0, "Ironforge Physician");
player->SEND_GOSSIP_MENU(2801, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_POI(-4745, -1027.57, 7, 6, 0, "Finespindle's Leather Goods");
player->SEND_GOSSIP_MENU(2802, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Minning
- player->SEND_POI(-4705.06, -1116.43, 6, 6, 0, "Deepmountain Mining Guild");
+ player->SEND_POI(-4705.06, -1116.43, 7, 6, 0, "Deepmountain Mining Guild");
player->SEND_GOSSIP_MENU(2804, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-4745, -1027.57, 6, 6, 0, "Finespindle's Leather Goods");
+ player->SEND_POI(-4745, -1027.57, 7, 6, 0, "Finespindle's Leather Goods");
player->SEND_GOSSIP_MENU(2805, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-4719.60, -1056.96, 6, 6, 0, "Stonebrow's Clothier");
+ player->SEND_POI(-4719.60, -1056.96, 7, 6, 0, "Stonebrow's Clothier");
player->SEND_GOSSIP_MENU(2807, _Creature->GetGUID());
break;
}
@@ -1873,11 +1873,11 @@ void SendDefaultMenu_guard_mulgore(Player *player, Creature *_Creature, uint32 a
player->SEND_GOSSIP_MENU(4052,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2361.38, -349.19, 6, 6, 0, "Bloodhoof Village Inn");
+ player->SEND_POI(-2361.38, -349.19, 7, 6, 0, "Bloodhoof Village Inn");
player->SEND_GOSSIP_MENU(4053,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Stable master
- player->SEND_POI(-2338.86, -357.56, 6, 6, 0, "Seikwa");
+ player->SEND_POI(-2338.86, -357.56, 7, 6, 0, "Seikwa");
player->SEND_GOSSIP_MENU(5976,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
@@ -1909,19 +1909,19 @@ void SendClassTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(-2312.15, -443.69, 6, 6, 0, "Gennia Runetotem");
+ player->SEND_POI(-2312.15, -443.69, 7, 6, 0, "Gennia Runetotem");
player->SEND_GOSSIP_MENU(4054,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(-2178.14, -406.14, 6, 6, 0, "Yaw Sharpmane");
+ player->SEND_POI(-2178.14, -406.14, 7, 6, 0, "Yaw Sharpmane");
player->SEND_GOSSIP_MENU(4055,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Shaman
- player->SEND_POI(-2301.5, -439.87, 6, 6, 0, "Narm Skychaser");
+ player->SEND_POI(-2301.5, -439.87, 7, 6, 0, "Narm Skychaser");
player->SEND_GOSSIP_MENU(4056,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Warrior
- player->SEND_POI(-2345.43, -494.11, 6, 6, 0, "Krang Stonehoof");
+ player->SEND_POI(-2345.43, -494.11, 7, 6, 0, "Krang Stonehoof");
player->SEND_GOSSIP_MENU(4057,_Creature->GetGUID());
break;
}
@@ -1938,32 +1938,32 @@ void SendProfTrainerMenu_guard_mulgore(Player *player, Creature *_Creature, uint
player->SEND_GOSSIP_MENU(4059,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2263.34, -287.91, 6, 6, 0, "Pyall Silentstride");
+ player->SEND_POI(-2263.34, -287.91, 7, 6, 0, "Pyall Silentstride");
player->SEND_GOSSIP_MENU(4060,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
player->SEND_GOSSIP_MENU(4061,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-2353.52, -355.82, 6, 6, 0, "Vira Younghoof");
+ player->SEND_POI(-2353.52, -355.82, 7, 6, 0, "Vira Younghoof");
player->SEND_GOSSIP_MENU(4062,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Fishing
- player->SEND_POI(-2349.21, -241.37, 6, 6, 0, "Uthan Stillwater");
+ player->SEND_POI(-2349.21, -241.37, 7, 6, 0, "Uthan Stillwater");
player->SEND_GOSSIP_MENU(4063,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Herbalism
player->SEND_GOSSIP_MENU(4064,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Leatherworking
- player->SEND_POI(-2257.12, -288.63, 6, 6, 0, "Chaw Stronghide");
+ player->SEND_POI(-2257.12, -288.63, 7, 6, 0, "Chaw Stronghide");
player->SEND_GOSSIP_MENU(4065,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Mining
player->SEND_GOSSIP_MENU(4066,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Skinning
- player->SEND_POI(-2252.94, -291.32, 6, 6, 0, "Yonn Deepcut");
+ player->SEND_POI(-2252.94, -291.32, 7, 6, 0, "Yonn Deepcut");
player->SEND_GOSSIP_MENU(4067,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Tailoring
@@ -2021,43 +2021,43 @@ void SendDefaultMenu_guard_orgrimmar(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1631.51, -4375.33, 6, 6, 0, "Bank of Orgrimmar");
+ player->SEND_POI(1631.51, -4375.33, 7, 6, 0, "Bank of Orgrimmar");
player->SEND_GOSSIP_MENU(2554,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //wind rider
- player->SEND_POI(1676.6, -4332.72, 6, 6, 0, "The Sky Tower");
+ player->SEND_POI(1676.6, -4332.72, 7, 6, 0, "The Sky Tower");
player->SEND_GOSSIP_MENU(2555,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //guild master
- player->SEND_POI(1576.93, -4294.75, 6, 6, 0, "Horde Embassy");
+ player->SEND_POI(1576.93, -4294.75, 7, 6, 0, "Horde Embassy");
player->SEND_GOSSIP_MENU(2556,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1644.51, -4447.27, 6, 6, 0, "Orgrimmar Inn");
+ player->SEND_POI(1644.51, -4447.27, 7, 6, 0, "Orgrimmar Inn");
player->SEND_GOSSIP_MENU(2557,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //mailbox
- player->SEND_POI(1622.53, -4388.79, 6, 6, 0, "Orgrimmar Mailbox");
+ player->SEND_POI(1622.53, -4388.79, 7, 6, 0, "Orgrimmar Mailbox");
player->SEND_GOSSIP_MENU(2558,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //auction house
- player->SEND_POI(1679.21, -4450.1, 6, 6, 0, "Orgrimmar Auction House");
+ player->SEND_POI(1679.21, -4450.1, 7, 6, 0, "Orgrimmar Auction House");
player->SEND_GOSSIP_MENU(3075,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //zeppelin
- player->SEND_POI(1337.36, -4632.7, 6, 6, 0, "Orgrimmar Zeppelin Tower");
+ player->SEND_POI(1337.36, -4632.7, 7, 6, 0, "Orgrimmar Zeppelin Tower");
player->SEND_GOSSIP_MENU(3173,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //weapon master
- player->SEND_POI(2092.56, -4823.95, 6, 6, 0, "Sayoc & Hanashi");
+ player->SEND_POI(2092.56, -4823.95, 7, 6, 0, "Sayoc & Hanashi");
player->SEND_GOSSIP_MENU(4519,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //stable master
- player->SEND_POI(2133.12, -4663.93, 6, 6, 0, "Xon'cha");
+ player->SEND_POI(2133.12, -4663.93, 7, 6, 0, "Xon'cha");
player->SEND_GOSSIP_MENU(5974,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //officers lounge
- player->SEND_POI(1633.56, -4249.37, 6, 6, 0, "Hall of Legends");
+ player->SEND_POI(1633.56, -4249.37, 7, 6, 0, "Hall of Legends");
player->SEND_GOSSIP_MENU(7046,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //battlemaster
@@ -2100,15 +2100,15 @@ void SendBattleMasterMenu_guard_orgrimmar(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave");
player->SEND_GOSSIP_MENU(7484,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave");
player->SEND_GOSSIP_MENU(7644,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave");
player->SEND_GOSSIP_MENU(7520,_Creature->GetGUID());
break;
}
@@ -2119,35 +2119,35 @@ void SendClassTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Hunter
- player->SEND_POI(2114.84, -4625.31, 6, 6, 0, "Orgrimmar Hunter's Hall");
+ player->SEND_POI(2114.84, -4625.31, 7, 6, 0, "Orgrimmar Hunter's Hall");
player->SEND_GOSSIP_MENU(2559,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Mage
- player->SEND_POI(1451.26, -4223.33, 6, 6, 0, "Darkbriar Lodge");
+ player->SEND_POI(1451.26, -4223.33, 7, 6, 0, "Darkbriar Lodge");
player->SEND_GOSSIP_MENU(2560,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(1442.21, -4183.24, 6, 6, 0, "Spirit Lodge");
+ player->SEND_POI(1442.21, -4183.24, 7, 6, 0, "Spirit Lodge");
player->SEND_GOSSIP_MENU(2561,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Shaman
- player->SEND_POI(1925.34, -4181.89, 6, 6, 0, "Thrall's Fortress");
+ player->SEND_POI(1925.34, -4181.89, 7, 6, 0, "Thrall's Fortress");
player->SEND_GOSSIP_MENU(2562,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Rogue
- player->SEND_POI(1773.39, -4278.97, 6, 6, 0, "Shadowswift Brotherhood");
+ player->SEND_POI(1773.39, -4278.97, 7, 6, 0, "Shadowswift Brotherhood");
player->SEND_GOSSIP_MENU(2563,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Warlock
- player->SEND_POI(1849.57, -4359.68, 6, 6, 0, "Darkfire Enclave");
+ player->SEND_POI(1849.57, -4359.68, 7, 6, 0, "Darkfire Enclave");
player->SEND_GOSSIP_MENU(2564,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warrior
- player->SEND_POI(1983.92, -4794.2, 6, 6, 0, "Hall of the Brave");
+ player->SEND_POI(1983.92, -4794.2, 7, 6, 0, "Hall of the Brave");
player->SEND_GOSSIP_MENU(2565,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Paladin
- player->SEND_POI(1906.65, -4134.26, 6, 6, 0, "Valley of Wisdom");
+ player->SEND_POI(1906.65, -4134.26, 7, 6, 0, "Valley of Wisdom");
player->SEND_GOSSIP_MENU(10843,_Creature->GetGUID());
break;
}
@@ -2158,51 +2158,51 @@ void SendProfTrainerMenu_guard_orgrimmar(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1955.17, -4475.79, 6, 6, 0, "Yelmak's Alchemy and Potions");
+ player->SEND_POI(1955.17, -4475.79, 7, 6, 0, "Yelmak's Alchemy and Potions");
player->SEND_GOSSIP_MENU(2497,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(2054.34, -4831.85, 6, 6, 0, "The Burning Anvil");
+ player->SEND_POI(2054.34, -4831.85, 7, 6, 0, "The Burning Anvil");
player->SEND_GOSSIP_MENU(2499,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1780.96, -4481.31, 6, 6, 0, "Borstan's Firepit");
+ player->SEND_POI(1780.96, -4481.31, 7, 6, 0, "Borstan's Firepit");
player->SEND_GOSSIP_MENU(2500,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1917.5, -4434.95, 6, 6, 0, "Godan's Runeworks");
+ player->SEND_POI(1917.5, -4434.95, 7, 6, 0, "Godan's Runeworks");
player->SEND_GOSSIP_MENU(2501,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(2038.45, -4744.75, 6, 6, 0, "Nogg's Machine Shop");
+ player->SEND_POI(2038.45, -4744.75, 7, 6, 0, "Nogg's Machine Shop");
player->SEND_GOSSIP_MENU(2653,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1485.21, -4160.91, 6, 6, 0, "Survival of the Fittest");
+ player->SEND_POI(1485.21, -4160.91, 7, 6, 0, "Survival of the Fittest");
player->SEND_GOSSIP_MENU(2502,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1994.15, -4655.7, 6, 6, 0, "Lumak's Fishing");
+ player->SEND_POI(1994.15, -4655.7, 7, 6, 0, "Lumak's Fishing");
player->SEND_GOSSIP_MENU(2503,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1898.61, -4454.93, 6, 6, 0, "Jandi's Arboretum");
+ player->SEND_POI(1898.61, -4454.93, 7, 6, 0, "Jandi's Arboretum");
player->SEND_GOSSIP_MENU(2504,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_POI(1852.82, -4562.31, 7, 6, 0, "Kodohide Leatherworkers");
player->SEND_GOSSIP_MENU(2513,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(2029.79, -4704, 6, 6, 0, "Red Canyon Mining");
+ player->SEND_POI(2029.79, -4704, 7, 6, 0, "Red Canyon Mining");
player->SEND_GOSSIP_MENU(2515,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1852.82, -4562.31, 6, 6, 0, "Kodohide Leatherworkers");
+ player->SEND_POI(1852.82, -4562.31, 7, 6, 0, "Kodohide Leatherworkers");
player->SEND_GOSSIP_MENU(2516,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1802.66, -4560.66, 6, 6, 0, "Magar's Cloth Goods");
+ player->SEND_POI(1802.66, -4560.66, 7, 6, 0, "Magar's Cloth Goods");
player->SEND_GOSSIP_MENU(2518,_Creature->GetGUID());
break;
}
@@ -2263,7 +2263,7 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern");
player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
@@ -2277,7 +2277,7 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32
player->SEND_GOSSIP_MENU(10382, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Flight Master");
+ player->SEND_POI(-1832, 5299, 7, 6, 0, "Flight Master");
player->SEND_GOSSIP_MENU(10385, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
@@ -2310,11 +2310,11 @@ void SendDefaultMenu_guard_shattrath(Player *player, Creature *_Creature, uint32
player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom");
player->SEND_GOSSIP_MENU(10503, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab");
player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
@@ -2329,12 +2329,12 @@ void SendBankMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 ac
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank");
player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_POI(-1997.7, 5363, 7, 6, 0, "Scyers Bank");
player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
}
}
@@ -2343,12 +2343,12 @@ void SendInnMenu_guard_shattrath(Player *player, Creature *_Creature, uint32 act
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn");
player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_POI(-2178, 5405, 7, 6, 0, "Scyers Inn");
player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
}
}
@@ -2358,19 +2358,19 @@ void SendMailboxMenu_guard_shattrath(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank");
player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn");
player->SEND_GOSSIP_MENU(10383, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1997.7, 5363, 6, 6, 0, "Scyers Bank");
+ player->SEND_POI(-1997.7, 5363, 7, 6, 0, "Scyers Bank");
player->SEND_GOSSIP_MENU(10381, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4:
- player->SEND_POI(-2178, 5405, 6, 6, 0, "Scyers Inn");
+ player->SEND_POI(-2178, 5405, 7, 6, 0, "Scyers Inn");
player->SEND_GOSSIP_MENU(10384, _Creature->GetGUID());
break;
}
@@ -2380,12 +2380,12 @@ void SendStableMasterMenu_guard_shattrath(Player *player, Creature *_Creature, u
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable");
+ player->SEND_POI(-1888.5, 5761, 7, 6, 0, "Aldor Stable");
player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(-2170, 5404, 6, 6, 0, "Scyers Stable");
+ player->SEND_POI(-2170, 5404, 7, 6, 0, "Scyers Stable");
player->SEND_GOSSIP_MENU(10321, _Creature->GetGUID());
}
}
@@ -2395,15 +2395,15 @@ void SendBattleMasterMenu_guard_shattrath(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- player->SEND_POI(-1774, 5251, 6, 6, 0, "Alliance Battlemasters");
+ player->SEND_POI(-1774, 5251, 7, 6, 0, "Alliance Battlemasters");
player->SEND_GOSSIP_MENU(10389, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_POI(-1963, 5263, 6, 6, 0, "Horde Battlemasters");
+ player->SEND_POI(-1963, 5263, 7, 6, 0, "Horde Battlemasters");
player->SEND_GOSSIP_MENU(10390, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_POI(-1960, 5175, 6, 6, 0, "Arena Battlemasters");
+ player->SEND_POI(-1960, 5175, 7, 6, 0, "Arena Battlemasters");
player->SEND_GOSSIP_MENU(12510, _Creature->GetGUID());
break;
}
@@ -2414,35 +2414,35 @@ void SendProfTrainerMenu_guard_shattrath(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem");
player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury");
player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper");
player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan");
player->SEND_GOSSIP_MENU(10395, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher");
player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar");
player->SEND_GOSSIP_MENU(10397, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari");
player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour");
player->SEND_GOSSIP_MENU(10398, _Creature->GetGUID());
break;
}
@@ -2452,12 +2452,12 @@ void SendGemMerchantMenu_guard_shattrath(Player *player, Creature *_Creature, ui
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Aldor Gem Merchant");
player->SEND_GOSSIP_MENU(10698, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(-2193, 5424.5, 6, 6, 0, "Scyers Gem Merchant");
+ player->SEND_POI(-2193, 5424.5, 7, 6, 0, "Scyers Gem Merchant");
player->SEND_GOSSIP_MENU(10699, _Creature->GetGUID());
}
}
@@ -2573,28 +2573,28 @@ void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern");
player->SEND_GOSSIP_MENU(10394, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1730.5, 5496, 6, 6, 0, "Aldor Bank");
+ player->SEND_POI(-1730.5, 5496, 7, 6, 0, "Aldor Bank");
player->SEND_GOSSIP_MENU(10380, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-1895, 5767, 6, 6, 0, "Aldor Inn");
+ player->SEND_POI(-1895, 5767, 7, 6, 0, "Aldor Inn");
player->SEND_GOSSIP_MENU(10525, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_POI(-1832, 5299, 7, 6, 0, "Shattrath Flight Master");
player->SEND_GOSSIP_MENU(10402, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(0, 0, 6, 6, 0, "Aldor Mailbox");
+ player->SEND_POI(0, 0, 7, 6, 0, "Aldor Mailbox");
//unknown
player->SEND_GOSSIP_MENU(10524, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-1888.5, 5761, 6, 6, 0, "Aldor Stable Master");
+ player->SEND_POI(-1888.5, 5761, 7, 6, 0, "Aldor Stable Master");
player->SEND_GOSSIP_MENU(10527, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
@@ -2615,15 +2615,15 @@ void SendDefaultMenu_guard_shattrath_aldor(Player *player, Creature *_Creature,
player->SEND_GOSSIP_MENU(10391, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom");
player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab");
player->SEND_GOSSIP_MENU(10696, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Aldor Gem Merchant");
+ player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Aldor Gem Merchant");
player->SEND_GOSSIP_MENU(10411, _Creature->GetGUID());
break;
}
@@ -2634,35 +2634,35 @@ void SendProfTrainerMenu_guard_shattrath_aldor(Player *player, Creature *_Creatu
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem");
player->SEND_GOSSIP_MENU(10392, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury");
player->SEND_GOSSIP_MENU(10400, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper");
player->SEND_GOSSIP_MENU(10393, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan");
player->SEND_GOSSIP_MENU(10528, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher");
player->SEND_GOSSIP_MENU(10396, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar");
player->SEND_GOSSIP_MENU(10529, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari");
player->SEND_GOSSIP_MENU(10399, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour");
player->SEND_GOSSIP_MENU(10419, _Creature->GetGUID());
break;
}
@@ -2769,27 +2769,27 @@ void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Tavern
- player->SEND_POI(-1759.5, 5165, 6, 6, 0, "Worlds End Tavern");
+ player->SEND_POI(-1759.5, 5165, 7, 6, 0, "Worlds End Tavern");
player->SEND_GOSSIP_MENU(10431, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-1996.6, 5363.7, 6, 6, 0, "Scryer Bank");
+ player->SEND_POI(-1996.6, 5363.7, 7, 6, 0, "Scryer Bank");
player->SEND_GOSSIP_MENU(10432, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(-2176.6, 5405.8, 6, 6, 0, "Scryer Inn");
+ player->SEND_POI(-2176.6, 5405.8, 7, 6, 0, "Scryer Inn");
player->SEND_GOSSIP_MENU(10433, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Flight master
- player->SEND_POI(-1832, 5299, 6, 6, 0, "Shattrath Flight Master");
+ player->SEND_POI(-1832, 5299, 7, 6, 0, "Shattrath Flight Master");
player->SEND_GOSSIP_MENU(10435, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(-2174.3, 5411.4, 6, 6, 0, "Scryer Mailbox");
+ player->SEND_POI(-2174.3, 5411.4, 7, 6, 0, "Scryer Mailbox");
player->SEND_GOSSIP_MENU(10436, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(-2169.9, 5405.1, 6, 6, 0, "Scryer Stable Master");
+ player->SEND_POI(-2169.9, 5405.1, 7, 6, 0, "Scryer Stable Master");
player->SEND_GOSSIP_MENU(10437, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Battlemaster
@@ -2810,15 +2810,15 @@ void SendDefaultMenu_guard_shattrath_scryer(Player *player, Creature *_Creature,
player->SEND_GOSSIP_MENU(10504, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Mana Loom
- player->SEND_POI(-2070, 5265.5, 6, 6, 0, "Mana Loom");
+ player->SEND_POI(-2070, 5265.5, 7, 6, 0, "Mana Loom");
player->SEND_GOSSIP_MENU(10522, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Alchemy Lab
- player->SEND_POI(-1648.5, 5540, 6, 6, 0, "Alchemy Lab");
+ player->SEND_POI(-1648.5, 5540, 7, 6, 0, "Alchemy Lab");
player->SEND_GOSSIP_MENU(10701, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Gem Merchant
- player->SEND_POI(-1645, 5669.5, 6, 6, 0, "Scryer Gem Merchant");
+ player->SEND_POI(-1645, 5669.5, 7, 6, 0, "Scryer Gem Merchant");
player->SEND_GOSSIP_MENU(10702, _Creature->GetGUID());
break;
}
@@ -2829,35 +2829,35 @@ void SendProfTrainerMenu_guard_shattrath_scryer(Player *player, Creature *_Creat
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-1648.5, 5534, 6, 6, 0, "Lorokeem");
+ player->SEND_POI(-1648.5, 5534, 7, 6, 0, "Lorokeem");
player->SEND_GOSSIP_MENU(10516, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-1847, 5222, 6, 6, 0, "Kradu Grimblade and Zula Slagfury");
+ player->SEND_POI(-1847, 5222, 7, 6, 0, "Kradu Grimblade and Zula Slagfury");
player->SEND_GOSSIP_MENU(10517, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-2067.4, 5316.5, 6, 6, 0, "Jack Trapper");
+ player->SEND_POI(-2067.4, 5316.5, 7, 6, 0, "Jack Trapper");
player->SEND_GOSSIP_MENU(10518, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-2263.5, 5563.5, 6, 6, 0, "High Enchanter Bardolan");
+ player->SEND_POI(-2263.5, 5563.5, 7, 6, 0, "High Enchanter Bardolan");
player->SEND_GOSSIP_MENU(10519, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //First Aid
- player->SEND_POI(-1591, 5265.5, 6, 6, 0, "Mildred Fletcher");
+ player->SEND_POI(-1591, 5265.5, 7, 6, 0, "Mildred Fletcher");
player->SEND_GOSSIP_MENU(10520, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Jewelcrafting
- player->SEND_POI(-1654, 5667.5, 6, 6, 0, "Hamanar");
+ player->SEND_POI(-1654, 5667.5, 7, 6, 0, "Hamanar");
player->SEND_GOSSIP_MENU(10521, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(-2060.5, 5256.5, 6, 6, 0, "Darmari");
+ player->SEND_POI(-2060.5, 5256.5, 7, 6, 0, "Darmari");
player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(-2048, 5300, 6, 6, 0, "Seymour");
+ player->SEND_POI(-2048, 5300, 7, 6, 0, "Seymour");
player->SEND_GOSSIP_MENU(10523, _Creature->GetGUID());
break;
}
@@ -2914,11 +2914,11 @@ void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint3
player->SEND_GOSSIP_MENU(9317, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(9808.4, -7488.16, 6, 6, 0, "Silvermoon Bank");
+ player->SEND_POI(9808.4, -7488.16, 7, 6, 0, "Silvermoon Bank");
player->SEND_GOSSIP_MENU(9322, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(9474.97, -7345.21, 6, 6, 0, "Tandrine");
+ player->SEND_POI(9474.97, -7345.21, 7, 6, 0, "Tandrine");
player->SEND_GOSSIP_MENU(9324, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
@@ -2927,19 +2927,19 @@ void SendDefaultMenu_guard_silvermoon(Player *player, Creature *_Creature, uint3
player->SEND_GOSSIP_MENU(9602, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(9658.33, -7492.17, 6, 6, 0, "Silvermoon Mailbox");
+ player->SEND_POI(9658.33, -7492.17, 7, 6, 0, "Silvermoon Mailbox");
player->SEND_GOSSIP_MENU(9326, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Stable master
- player->SEND_POI(9904.95, -7404.31, 6, 6, 0, "Shalenn");
+ player->SEND_POI(9904.95, -7404.31, 7, 6, 0, "Shalenn");
player->SEND_GOSSIP_MENU(9327, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Weapon trainer
- player->SEND_POI(9841.17, -7505.13, 6, 6, 0, "Ileda");
+ player->SEND_POI(9841.17, -7505.13, 7, 6, 0, "Ileda");
player->SEND_GOSSIP_MENU(9328, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Wind master
- player->SEND_POI(9378.45, -7163.94, 6, 6, 0, "Silvermoon Wind Master");
+ player->SEND_POI(9378.45, -7163.94, 7, 6, 0, "Silvermoon Wind Master");
player->SEND_GOSSIP_MENU(10181, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Battlemaster
@@ -2983,12 +2983,12 @@ void SendAuctionhouseMenu_guard_silvermoon(Player *player, Creature *_Creature,
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(9644.47, -7140.22, 6, 6, 0, "Western Auction House");
+ player->SEND_POI(9644.47, -7140.22, 7, 6, 0, "Western Auction House");
player->SEND_GOSSIP_MENU(9318, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(9683.27, -7521.22, 6, 6, 0, "Royal Exchange Auction House");
+ player->SEND_POI(9683.27, -7521.22, 7, 6, 0, "Royal Exchange Auction House");
player->SEND_GOSSIP_MENU(9319, _Creature->GetGUID());
}
}
@@ -2997,12 +2997,12 @@ void SendInnMenu_guard_silvermoon(Player *player, Creature *_Creature, uint32 ac
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
- player->SEND_POI(9677.7, -7368, 6, 6, 0, "Silvermoon City Inn");
+ player->SEND_POI(9677.7, -7368, 7, 6, 0, "Silvermoon City Inn");
player->SEND_GOSSIP_MENU(9325, _Creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF + 2)
{
- player->SEND_POI(9561.1, -7517.5, 6, 6, 0, "Wayfarer's Rest tavern");
+ player->SEND_POI(9561.1, -7517.5, 7, 6, 0, "Wayfarer's Rest tavern");
player->SEND_GOSSIP_MENU(9603, _Creature->GetGUID());
}
}
@@ -3012,23 +3012,23 @@ void SendBattleMasterMenu_guard_silvermoon(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(9850.49, -7572.26, 6, 6, 0, "Gurak");
+ player->SEND_POI(9850.49, -7572.26, 7, 6, 0, "Gurak");
player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_POI(9857.18, -7564.36, 7, 6, 0, "Karen Wentworth");
player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //A
- player->SEND_POI(9850.6, -7559.25, 6, 6, 0, "Bipp Glizzitor");
+ player->SEND_POI(9850.6, -7559.25, 7, 6, 0, "Bipp Glizzitor");
player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //EOS
- player->SEND_POI(9857.18, -7564.36, 6, 6, 0, "Karen Wentworth");
+ player->SEND_POI(9857.18, -7564.36, 7, 6, 0, "Karen Wentworth");
player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //WSG
- player->SEND_POI(9845.45, -7562.58, 6, 6, 0, "Krukk");
+ player->SEND_POI(9845.45, -7562.58, 7, 6, 0, "Krukk");
player->SEND_GOSSIP_MENU(9329, _Creature->GetGUID());
break;
}
@@ -3039,31 +3039,31 @@ void SendClassTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9700.55, -7262.57, 6, 6, 0, "Harene Plainwalker");
+ player->SEND_POI(9700.55, -7262.57, 7, 6, 0, "Harene Plainwalker");
player->SEND_GOSSIP_MENU(9330, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9927.48, -7426.14, 6, 6, 0, "Zandine");
+ player->SEND_POI(9927.48, -7426.14, 7, 6, 0, "Zandine");
player->SEND_GOSSIP_MENU(9332, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Mage
- player->SEND_POI(9995.07, -7118.17, 6, 6, 0, "Quithas");
+ player->SEND_POI(9995.07, -7118.17, 7, 6, 0, "Quithas");
player->SEND_GOSSIP_MENU(9333, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Paladin
- player->SEND_POI(9850.22, -7516.93, 6, 6, 0, "Champion Bachi");
+ player->SEND_POI(9850.22, -7516.93, 7, 6, 0, "Champion Bachi");
player->SEND_GOSSIP_MENU(9334, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(9926.79, -7066.66, 6, 6, 0, "Belestra");
+ player->SEND_POI(9926.79, -7066.66, 7, 6, 0, "Belestra");
player->SEND_GOSSIP_MENU(9335, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Rogue
- player->SEND_POI(9739.88, -7374.33, 6, 6, 0, "Zelanis");
+ player->SEND_POI(9739.88, -7374.33, 7, 6, 0, "Zelanis");
player->SEND_GOSSIP_MENU(9336, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Warlock
- player->SEND_POI(9787.57, -7284.63, 6, 6, 0, "Alamma");
+ player->SEND_POI(9787.57, -7284.63, 7, 6, 0, "Alamma");
player->SEND_GOSSIP_MENU(9337, _Creature->GetGUID());
break;
}
@@ -3074,55 +3074,55 @@ void SendProfTrainerMenu_guard_silvermoon(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9998.09, -7214.36, 6, 6, 0, "Silvermoon Alchemy Trainer");
+ player->SEND_POI(9998.09, -7214.36, 7, 6, 0, "Silvermoon Alchemy Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(9841.43, -7361.53, 6, 6, 0, "Silvermoon Blacksmithing Trainer");
+ player->SEND_POI(9841.43, -7361.53, 7, 6, 0, "Silvermoon Blacksmithing Trainer");
player->SEND_GOSSIP_MENU(9340, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(9577.26, -7243.6, 6, 6, 0, "Silvermoon Cooking Trainer");
+ player->SEND_POI(9577.26, -7243.6, 7, 6, 0, "Silvermoon Cooking Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(9962.57, -7246.18, 6, 6, 0, "Silvermoon Enchanting Trainer");
+ player->SEND_POI(9962.57, -7246.18, 7, 6, 0, "Silvermoon Enchanting Trainer");
player->SEND_GOSSIP_MENU(9341, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(9820.18, -7329.56, 6, 6, 0, "Silvermoon Engineering Trainer");
+ player->SEND_POI(9820.18, -7329.56, 7, 6, 0, "Silvermoon Engineering Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(9579.8, -7343.71, 6, 6, 0, "Silvermoon First Aid Trainer");
+ player->SEND_POI(9579.8, -7343.71, 7, 6, 0, "Silvermoon First Aid Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(9602.73, -7328.3, 6, 6, 0, "Silvermoon Fishing Trainer");
+ player->SEND_POI(9602.73, -7328.3, 7, 6, 0, "Silvermoon Fishing Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Jewelcrafting
- player->SEND_POI(9553.54, -7506.43, 6, 6, 0, "Silvermoon Jewelcrafting Trainer");
+ player->SEND_POI(9553.54, -7506.43, 7, 6, 0, "Silvermoon Jewelcrafting Trainer");
player->SEND_GOSSIP_MENU(9346, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Herbalism
- player->SEND_POI(10004.4, -7216.86, 6, 6, 0, "Silvermoon Herbalism Trainer");
+ player->SEND_POI(10004.4, -7216.86, 7, 6, 0, "Silvermoon Herbalism Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Leatherworking
- player->SEND_POI(9503.72, -7430.16, 6, 6, 0, "Silvermoon Leatherworking Trainer");
+ player->SEND_POI(9503.72, -7430.16, 7, 6, 0, "Silvermoon Leatherworking Trainer");
player->SEND_GOSSIP_MENU(9347, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Mining
- player->SEND_POI(9805.1, -7355.56, 6, 6, 0, "Silvermoon Mining Trainer");
+ player->SEND_POI(9805.1, -7355.56, 7, 6, 0, "Silvermoon Mining Trainer");
player->SEND_GOSSIP_MENU(9348, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Skinning
- player->SEND_POI(9513.37, -7429.4, 6, 6, 0, "Silvermoon Skinning Trainer");
+ player->SEND_POI(9513.37, -7429.4, 7, 6, 0, "Silvermoon Skinning Trainer");
player->SEND_GOSSIP_MENU(9316, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 13: //Tailoring
- player->SEND_POI(9750.55, -7095.28, 6, 6, 0, "Silvermoon Tailor");
+ player->SEND_POI(9750.55, -7095.28, 7, 6, 0, "Silvermoon Tailor");
player->SEND_GOSSIP_MENU(9350, _Creature->GetGUID());
break;
}
@@ -3179,43 +3179,43 @@ void SendDefaultMenu_guard_stormwind(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Auction House
- player->SEND_POI(-8811.46, 667.46, 6, 6, 0, "Stormwind Auction House");
+ player->SEND_POI(-8811.46, 667.46, 7, 6, 0, "Stormwind Auction House");
player->SEND_GOSSIP_MENU(3834,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bank
- player->SEND_POI(-8916.87, 622.87, 6, 6, 0, "Stormwind Bank");
+ player->SEND_POI(-8916.87, 622.87, 7, 6, 0, "Stormwind Bank");
player->SEND_GOSSIP_MENU(764,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Deeprun tram
- player->SEND_POI(-8378.88, 554.23, 6, 6, 0, "The Deeprun Tram");
+ player->SEND_POI(-8378.88, 554.23, 7, 6, 0, "The Deeprun Tram");
player->SEND_GOSSIP_MENU(3813,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(-8869.0, 675.4, 6, 6, 0, "The Gilded Rose");
+ player->SEND_POI(-8869.0, 675.4, 7, 6, 0, "The Gilded Rose");
player->SEND_GOSSIP_MENU(3860,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Gryphon Master
- player->SEND_POI(-8837.0, 493.5, 6, 6, 0, "Stormwind Gryphon Master");
+ player->SEND_POI(-8837.0, 493.5, 7, 6, 0, "Stormwind Gryphon Master");
player->SEND_GOSSIP_MENU(879,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Guild Master
- player->SEND_POI(-8894.0, 611.2, 6, 6, 0, "Stormwind Vistor`s Center");
+ player->SEND_POI(-8894.0, 611.2, 7, 6, 0, "Stormwind Vistor`s Center");
player->SEND_GOSSIP_MENU(882,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Mailbox
- player->SEND_POI(-8876.48, 649.18, 6, 6, 0, "Stormwind Mailbox");
+ player->SEND_POI(-8876.48, 649.18, 7, 6, 0, "Stormwind Mailbox");
player->SEND_GOSSIP_MENU(3861,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Stable Master
- player->SEND_POI(-8433.0, 554.7, 6, 6, 0, "Jenova Stoneshield");
+ player->SEND_POI(-8433.0, 554.7, 7, 6, 0, "Jenova Stoneshield");
player->SEND_GOSSIP_MENU(5984,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Weapon Trainer
- player->SEND_POI(-8797.0, 612.8, 6, 6, 0, "Woo Ping");
+ player->SEND_POI(-8797.0, 612.8, 7, 6, 0, "Woo Ping");
player->SEND_GOSSIP_MENU(4516,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Officers Lounge
- player->SEND_POI(-8759.92, 399.69, 6, 6, 0, "Champions` Hall");
+ player->SEND_POI(-8759.92, 399.69, 7, 6, 0, "Champions` Hall");
player->SEND_GOSSIP_MENU(7047,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Battlemasters
@@ -3259,15 +3259,15 @@ void SendBattleMasterMenu_guard_stormwind(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Thelman Slatefist");
+ player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Thelman Slatefist");
player->SEND_GOSSIP_MENU(7500, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Lady Hoteshem");
+ player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Lady Hoteshem");
player->SEND_GOSSIP_MENU(7650, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(-8443.88, 335.99, 6, 6, 0, "Elfarran");
+ player->SEND_POI(-8443.88, 335.99, 7, 6, 0, "Elfarran");
player->SEND_GOSSIP_MENU(7501, _Creature->GetGUID());
break;
}
@@ -3278,39 +3278,39 @@ void SendClassTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(-9012.0, 867.6, 6, 6, 0, "Wizard`s Sanctum");
+ player->SEND_POI(-9012.0, 867.6, 7, 6, 0, "Wizard`s Sanctum");
player->SEND_GOSSIP_MENU(899,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Rogue
- player->SEND_POI(-8753.0, 367.8, 6, 6, 0, "Stormwind - Rogue House");
+ player->SEND_POI(-8753.0, 367.8, 7, 6, 0, "Stormwind - Rogue House");
player->SEND_GOSSIP_MENU(900,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Warrior
- player->SEND_POI(-8690.11, 324.85, 6, 6, 0, "Command Center");
+ player->SEND_POI(-8690.11, 324.85, 7, 6, 0, "Command Center");
player->SEND_GOSSIP_MENU(901,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Druid
- player->SEND_POI(-8751.0, 1124.5, 6, 6, 0, "The Park");
+ player->SEND_POI(-8751.0, 1124.5, 7, 6, 0, "The Park");
player->SEND_GOSSIP_MENU(902,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Priest
- player->SEND_POI(-8512.0, 862.4, 6, 6, 0, "Catedral Of Light");
+ player->SEND_POI(-8512.0, 862.4, 7, 6, 0, "Catedral Of Light");
player->SEND_GOSSIP_MENU(903,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Paladin
- player->SEND_POI(-8577.0, 881.7, 6, 6, 0, "Catedral Of Light");
+ player->SEND_POI(-8577.0, 881.7, 7, 6, 0, "Catedral Of Light");
player->SEND_GOSSIP_MENU(904,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Hunter
- player->SEND_POI(-8413.0, 541.5, 6, 6, 0, "Hunter Lodge");
+ player->SEND_POI(-8413.0, 541.5, 7, 6, 0, "Hunter Lodge");
player->SEND_GOSSIP_MENU(905,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Warlock
- player->SEND_POI(-8948.91, 998.35, 6, 6, 0, "The Slaughtered Lamb");
+ player->SEND_POI(-8948.91, 998.35, 7, 6, 0, "The Slaughtered Lamb");
player->SEND_GOSSIP_MENU(906,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Shaman
- player->SEND_POI(-9033, 550, 6, 6, 0, "Valley Of Heroes");
+ player->SEND_POI(-9033, 550, 7, 6, 0, "Valley Of Heroes");
//incorrect id
player->SEND_GOSSIP_MENU(2593,_Creature->GetGUID());
break;
@@ -3322,51 +3322,51 @@ void SendProfTrainerMenu_guard_stormwind(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(-8988.0, 759.60, 6, 6, 0, "Alchemy Needs");
+ player->SEND_POI(-8988.0, 759.60, 7, 6, 0, "Alchemy Needs");
player->SEND_GOSSIP_MENU(919,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(-8424.0, 616.9, 6, 6, 0, "Therum Deepforge");
+ player->SEND_POI(-8424.0, 616.9, 7, 6, 0, "Therum Deepforge");
player->SEND_GOSSIP_MENU(920,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(-8611.0, 364.6, 6, 6, 0, "Pig and Whistle Tavern");
+ player->SEND_POI(-8611.0, 364.6, 7, 6, 0, "Pig and Whistle Tavern");
player->SEND_GOSSIP_MENU(921,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(-8858.0, 803.7, 6, 6, 0, "Lucan Cordell");
+ player->SEND_POI(-8858.0, 803.7, 7, 6, 0, "Lucan Cordell");
player->SEND_GOSSIP_MENU(941,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(-8347.0, 644.1, 6, 6, 0, "Lilliam Sparkspindle");
+ player->SEND_POI(-8347.0, 644.1, 7, 6, 0, "Lilliam Sparkspindle");
player->SEND_GOSSIP_MENU(922,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(-8513.0, 801.8, 6, 6, 0, "Shaina Fuller");
+ player->SEND_POI(-8513.0, 801.8, 7, 6, 0, "Shaina Fuller");
player->SEND_GOSSIP_MENU(923,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(-8803.0, 767.5, 6, 6, 0, "Arnold Leland");
+ player->SEND_POI(-8803.0, 767.5, 7, 6, 0, "Arnold Leland");
player->SEND_GOSSIP_MENU(940,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(-8967.0, 779.5, 6, 6, 0, "Alchemy Needs");
+ player->SEND_POI(-8967.0, 779.5, 7, 6, 0, "Alchemy Needs");
player->SEND_GOSSIP_MENU(924,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(-8726.0, 477.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_POI(-8726.0, 477.4, 7, 6, 0, "The Protective Hide");
player->SEND_GOSSIP_MENU(925,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(-8434.0, 692.8, 6, 6, 0, "Gelman Stonehand");
+ player->SEND_POI(-8434.0, 692.8, 7, 6, 0, "Gelman Stonehand");
player->SEND_GOSSIP_MENU(927,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(-8716.0, 469.4, 6, 6, 0, "The Protective Hide");
+ player->SEND_POI(-8716.0, 469.4, 7, 6, 0, "The Protective Hide");
player->SEND_GOSSIP_MENU(928,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(-8938.0, 800.7, 6, 6, 0, "Duncan`s Textiles");
+ player->SEND_POI(-8938.0, 800.7, 7, 6, 0, "Duncan`s Textiles");
player->SEND_GOSSIP_MENU(929,_Creature->GetGUID());
break;
}
@@ -3431,11 +3431,11 @@ void SendDefaultMenu_guard_teldrassil(Player *player, Creature *_Creature, uint3
player->SEND_GOSSIP_MENU(4319,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(9821.49, 960.13, 6, 6, 0, "Dolanaar Inn");
+ player->SEND_POI(9821.49, 960.13, 7, 6, 0, "Dolanaar Inn");
player->SEND_GOSSIP_MENU(4320,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //stable master
- player->SEND_POI(9808.37, 931.1, 6, 6, 0, "Seriadne");
+ player->SEND_POI(9808.37, 931.1, 7, 6, 0, "Seriadne");
player->SEND_GOSSIP_MENU(5982,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //class trainer
@@ -3466,23 +3466,23 @@ void SendClassTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature,
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Druid
- player->SEND_POI(9741.58, 963.7, 6, 6, 0, "Kal");
+ player->SEND_POI(9741.58, 963.7, 7, 6, 0, "Kal");
player->SEND_GOSSIP_MENU(4323,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Hunter
- player->SEND_POI(9815.12, 926.28, 6, 6, 0, "Dazalar");
+ player->SEND_POI(9815.12, 926.28, 7, 6, 0, "Dazalar");
player->SEND_GOSSIP_MENU(4324,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Priest
- player->SEND_POI(9906.16, 986.63, 6, 6, 0, "Laurna Morninglight");
+ player->SEND_POI(9906.16, 986.63, 7, 6, 0, "Laurna Morninglight");
player->SEND_GOSSIP_MENU(4325,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Rogue
- player->SEND_POI(9789, 942.86, 6, 6, 0, "Jannok Breezesong");
+ player->SEND_POI(9789, 942.86, 7, 6, 0, "Jannok Breezesong");
player->SEND_GOSSIP_MENU(4326,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(9821.96, 950.61, 6, 6, 0, "Kyra Windblade");
+ player->SEND_POI(9821.96, 950.61, 7, 6, 0, "Kyra Windblade");
player->SEND_GOSSIP_MENU(4327,_Creature->GetGUID());
break;
}
@@ -3493,34 +3493,34 @@ void SendProfTrainerMenu_guard_teldrassil(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(9767.59, 878.81, 6, 6, 0, "Cyndra Kindwhisper");
+ player->SEND_POI(9767.59, 878.81, 7, 6, 0, "Cyndra Kindwhisper");
player->SEND_GOSSIP_MENU(4329,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Cooking
- player->SEND_POI(9751.19, 906.13, 6, 6, 0, "Zarrin");
+ player->SEND_POI(9751.19, 906.13, 7, 6, 0, "Zarrin");
player->SEND_GOSSIP_MENU(4330,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Enchanting
- player->SEND_POI(10677.59, 1946.56, 6, 6, 0, "Alanna Raveneye");
+ player->SEND_POI(10677.59, 1946.56, 7, 6, 0, "Alanna Raveneye");
player->SEND_GOSSIP_MENU(4331,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //First Aid
- player->SEND_POI(9903.12, 999, 6, 6, 0, "Byancie");
+ player->SEND_POI(9903.12, 999, 7, 6, 0, "Byancie");
player->SEND_GOSSIP_MENU(4332,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Fishing
player->SEND_GOSSIP_MENU(4333,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Herbalism
- player->SEND_POI(9773.78, 875.88, 6, 6, 0, "Malorne Bladeleaf");
+ player->SEND_POI(9773.78, 875.88, 7, 6, 0, "Malorne Bladeleaf");
player->SEND_GOSSIP_MENU(4334,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Leatherworking
- player->SEND_POI(10152.59, 1681.46, 6, 6, 0, "Nadyia Maneweaver");
+ player->SEND_POI(10152.59, 1681.46, 7, 6, 0, "Nadyia Maneweaver");
player->SEND_GOSSIP_MENU(4335,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Skinning
- player->SEND_POI(10135.59, 1673.18, 6, 6, 0, "Radnaal Maneweaver");
+ player->SEND_POI(10135.59, 1673.18, 7, 6, 0, "Radnaal Maneweaver");
player->SEND_GOSSIP_MENU(4336,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Tailoring
@@ -3576,11 +3576,11 @@ void SendDefaultMenu_guard_tirisfal(Player *player, Creature *_Creature, uint32
player->SEND_GOSSIP_MENU(4075,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Inn
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Gallows` End Tavern");
+ player->SEND_POI(2246.68, 241.89, 7, 6, 0, "Gallows` End Tavern");
player->SEND_GOSSIP_MENU(4076,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Stable Master
- player->SEND_POI(2267.66, 319.32, 6, 6, 0, "Morganus");
+ player->SEND_POI(2267.66, 319.32, 7, 6, 0, "Morganus");
player->SEND_GOSSIP_MENU(5978,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Class trainer
@@ -3614,23 +3614,23 @@ void SendClassTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Cain Firesong");
+ player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Cain Firesong");
player->SEND_GOSSIP_MENU(4077,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Dark Cleric Beryl");
+ player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Dark Cleric Beryl");
player->SEND_GOSSIP_MENU(4078,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Marion Call");
+ player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Marion Call");
player->SEND_GOSSIP_MENU(4079,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(2259.18, 240.93, 6, 6, 0, "Rupert Boch");
+ player->SEND_POI(2259.18, 240.93, 7, 6, 0, "Rupert Boch");
player->SEND_GOSSIP_MENU(4080,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(2256.48, 240.32, 6, 6, 0, "Austil de Mon");
+ player->SEND_POI(2256.48, 240.32, 7, 6, 0, "Austil de Mon");
player->SEND_GOSSIP_MENU(4081,_Creature->GetGUID());
break;
}
@@ -3641,7 +3641,7 @@ void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(2263.25, 344.23, 6, 6, 0, "Carolai Anise");
+ player->SEND_POI(2263.25, 344.23, 7, 6, 0, "Carolai Anise");
player->SEND_GOSSIP_MENU(4082,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
@@ -3651,37 +3651,37 @@ void SendProfTrainerMenu_guard_tirisfal(Player *player, Creature *_Creature, uin
player->SEND_GOSSIP_MENU(4084,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(2250.35, 249.12, 6, 6, 0, "Vance Undergloom");
+ player->SEND_POI(2250.35, 249.12, 7, 6, 0, "Vance Undergloom");
player->SEND_GOSSIP_MENU(4085,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
player->SEND_GOSSIP_MENU(4086,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(2246.68, 241.89, 6, 6, 0, "Nurse Neela");
+ player->SEND_POI(2246.68, 241.89, 7, 6, 0, "Nurse Neela");
player->SEND_GOSSIP_MENU(4087,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(2292.37, -10.72, 6, 6, 0, "Clyde Kellen");
+ player->SEND_POI(2292.37, -10.72, 7, 6, 0, "Clyde Kellen");
player->SEND_GOSSIP_MENU(4088,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(2268.21, 331.69, 6, 6, 0, "Faruza");
+ player->SEND_POI(2268.21, 331.69, 7, 6, 0, "Faruza");
player->SEND_GOSSIP_MENU(4089,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Shelene Rhobart");
+ player->SEND_POI(2027, 78.72, 7, 6, 0, "Shelene Rhobart");
player->SEND_GOSSIP_MENU(4090,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
player->SEND_GOSSIP_MENU(4091,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(2027, 78.72, 6, 6, 0, "Rand Rhobart");
+ player->SEND_POI(2027, 78.72, 7, 6, 0, "Rand Rhobart");
player->SEND_GOSSIP_MENU(4092,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(2160.45, 659.93, 6, 6, 0, "Bowen Brisboise");
+ player->SEND_POI(2160.45, 659.93, 7, 6, 0, "Bowen Brisboise");
player->SEND_GOSSIP_MENU(4093,_Creature->GetGUID());
break;
}
@@ -3734,39 +3734,39 @@ void SendDefaultMenu_guard_undercity(Player *player, Creature *_Creature, uint32
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Bank
- player->SEND_POI(1595.64, 232.45, 6, 6, 0, "Undercity Bank");
+ player->SEND_POI(1595.64, 232.45, 7, 6, 0, "Undercity Bank");
player->SEND_GOSSIP_MENU(3514,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Bat handler
- player->SEND_POI(1565.9, 271.43, 6, 6, 0, "Undercity Bat Handler");
+ player->SEND_POI(1565.9, 271.43, 7, 6, 0, "Undercity Bat Handler");
player->SEND_GOSSIP_MENU(3515,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Guild master
- player->SEND_POI(1594.17, 205.57, 6, 6, 0, "Undercity Guild Master");
+ player->SEND_POI(1594.17, 205.57, 7, 6, 0, "Undercity Guild Master");
player->SEND_GOSSIP_MENU(3516,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Inn
- player->SEND_POI(1639.43, 220.99, 6, 6, 0, "Undercity Inn");
+ player->SEND_POI(1639.43, 220.99, 7, 6, 0, "Undercity Inn");
player->SEND_GOSSIP_MENU(3517,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Mailbox
- player->SEND_POI(1632.68, 219.4, 6, 6, 0, "Undercity Mailbox");
+ player->SEND_POI(1632.68, 219.4, 7, 6, 0, "Undercity Mailbox");
player->SEND_GOSSIP_MENU(3518,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //Auction House
- player->SEND_POI(1647.9, 258.49, 6, 6, 0, "Undercity Auction House");
+ player->SEND_POI(1647.9, 258.49, 7, 6, 0, "Undercity Auction House");
player->SEND_GOSSIP_MENU(3519,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Zeppelin
- player->SEND_POI(2059, 274.86, 6, 6, 0, "Undercity Zeppelin");
+ player->SEND_POI(2059, 274.86, 7, 6, 0, "Undercity Zeppelin");
player->SEND_GOSSIP_MENU(3520,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Weapon Master
- player->SEND_POI(1670.31, 324.66, 6, 6, 0, "Archibald");
+ player->SEND_POI(1670.31, 324.66, 7, 6, 0, "Archibald");
player->SEND_GOSSIP_MENU(4521,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Stable master
- player->SEND_POI(1634.18, 226.76, 6, 6, 0, "Anya Maulray");
+ player->SEND_POI(1634.18, 226.76, 7, 6, 0, "Anya Maulray");
player->SEND_GOSSIP_MENU(5979,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Battlemaster
@@ -3806,15 +3806,15 @@ void SendBattleMasterMenu_guard_undercity(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //AV
- player->SEND_POI(1329, 333.92, 6, 6, 0, "Grizzle Halfmane");
+ player->SEND_POI(1329, 333.92, 7, 6, 0, "Grizzle Halfmane");
player->SEND_GOSSIP_MENU(7525,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //AB
- player->SEND_POI(1283.3, 287.16, 6, 6, 0, "Sir Malory Wheeler");
+ player->SEND_POI(1283.3, 287.16, 7, 6, 0, "Sir Malory Wheeler");
player->SEND_GOSSIP_MENU(7646,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //WSG
- player->SEND_POI(1265, 351.18, 6, 6, 0, "Kurden Bloodclaw");
+ player->SEND_POI(1265, 351.18, 7, 6, 0, "Kurden Bloodclaw");
player->SEND_GOSSIP_MENU(7526,_Creature->GetGUID());
break;
}
@@ -3825,23 +3825,23 @@ void SendClassTrainerMenu_guard_undercity(Player *player, Creature *_Creature, u
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Mage
- player->SEND_POI(1781, 53, 6, 6, 0, "Undercity Mage Trainers");
+ player->SEND_POI(1781, 53, 7, 6, 0, "Undercity Mage Trainers");
player->SEND_GOSSIP_MENU(3513,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Priest
- player->SEND_POI(1758.33, 401.5, 6, 6, 0, "Undercity Priest Trainers");
+ player->SEND_POI(1758.33, 401.5, 7, 6, 0, "Undercity Priest Trainers");
player->SEND_GOSSIP_MENU(3521,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Rogue
- player->SEND_POI(1418.56, 65, 6, 6, 0, "Undercity Rogue Trainers");
+ player->SEND_POI(1418.56, 65, 7, 6, 0, "Undercity Rogue Trainers");
player->SEND_GOSSIP_MENU(3524,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Warlock
- player->SEND_POI(1780.92, 53.16, 6, 6, 0, "Undercity Warlock Trainers");
+ player->SEND_POI(1780.92, 53.16, 7, 6, 0, "Undercity Warlock Trainers");
player->SEND_GOSSIP_MENU(3526,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Warrior
- player->SEND_POI(1775.59, 418.19, 6, 6, 0, "Undercity Warrior Trainers");
+ player->SEND_POI(1775.59, 418.19, 7, 6, 0, "Undercity Warrior Trainers");
player->SEND_GOSSIP_MENU(3527,_Creature->GetGUID());
break;
}
@@ -3852,51 +3852,51 @@ void SendProfTrainerMenu_guard_undercity(Player *player, Creature *_Creature, ui
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1: //Alchemy
- player->SEND_POI(1419.82, 417.19, 6, 6, 0, "The Apothecarium");
+ player->SEND_POI(1419.82, 417.19, 7, 6, 0, "The Apothecarium");
player->SEND_GOSSIP_MENU(3528,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2: //Blacksmithing
- player->SEND_POI(1696, 285, 6, 6, 0, "Undercity Blacksmithing Trainer");
+ player->SEND_POI(1696, 285, 7, 6, 0, "Undercity Blacksmithing Trainer");
player->SEND_GOSSIP_MENU(3529,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3: //Cooking
- player->SEND_POI(1596.34, 274.68, 6, 6, 0, "Undercity Cooking Trainer");
+ player->SEND_POI(1596.34, 274.68, 7, 6, 0, "Undercity Cooking Trainer");
player->SEND_GOSSIP_MENU(3530,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4: //Enchanting
- player->SEND_POI(1488.54, 280.19, 6, 6, 0, "Undercity Enchanting Trainer");
+ player->SEND_POI(1488.54, 280.19, 7, 6, 0, "Undercity Enchanting Trainer");
player->SEND_GOSSIP_MENU(3531,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5: //Engineering
- player->SEND_POI(1408.58, 143.43, 6, 6, 0, "Undercity Engineering Trainer");
+ player->SEND_POI(1408.58, 143.43, 7, 6, 0, "Undercity Engineering Trainer");
player->SEND_GOSSIP_MENU(3532,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6: //First Aid
- player->SEND_POI(1519.65, 167.19, 6, 6, 0, "Undercity First Aid Trainer");
+ player->SEND_POI(1519.65, 167.19, 7, 6, 0, "Undercity First Aid Trainer");
player->SEND_GOSSIP_MENU(3533,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7: //Fishing
- player->SEND_POI(1679.9, 89, 6, 6, 0, "Undercity Fishing Trainer");
+ player->SEND_POI(1679.9, 89, 7, 6, 0, "Undercity Fishing Trainer");
player->SEND_GOSSIP_MENU(3534,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 8: //Herbalism
- player->SEND_POI(1558, 349.36, 6, 6, 0, "Undercity Herbalism Trainer");
+ player->SEND_POI(1558, 349.36, 7, 6, 0, "Undercity Herbalism Trainer");
player->SEND_GOSSIP_MENU(3535,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 9: //Leatherworking
- player->SEND_POI(1498.76, 196.43, 6, 6, 0, "Undercity Leatherworking Trainer");
+ player->SEND_POI(1498.76, 196.43, 7, 6, 0, "Undercity Leatherworking Trainer");
player->SEND_GOSSIP_MENU(3536,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 10: //Mining
- player->SEND_POI(1642.88, 335.58, 6, 6, 0, "Undercity Mining Trainer");
+ player->SEND_POI(1642.88, 335.58, 7, 6, 0, "Undercity Mining Trainer");
player->SEND_GOSSIP_MENU(3537,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11: //Skinning
- player->SEND_POI(1498.6, 196.46, 6, 6, 0, "Undercity Skinning Trainer");
+ player->SEND_POI(1498.6, 196.46, 7, 6, 0, "Undercity Skinning Trainer");
player->SEND_GOSSIP_MENU(3538,_Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12: //Tailoring
- player->SEND_POI(1689.55, 193, 6, 6, 0, "Undercity Tailoring Trainer");
+ player->SEND_POI(1689.55, 193, 7, 6, 0, "Undercity Tailoring Trainer");
player->SEND_GOSSIP_MENU(3539,_Creature->GetGUID());
break;
}
@@ -4010,7 +4010,7 @@ void AddSC_guards()
newscript->Name="guard_orgrimmar";
newscript->pGossipHello = &GossipHello_guard_orgrimmar;
newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
- newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
+ //newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
newscript->GetAI = &GetAI_guard_orgrimmar;
newscript->RegisterSelf();
@@ -4046,7 +4046,7 @@ void AddSC_guards()
newscript->Name="guard_stormwind";
newscript->pGossipHello = &GossipHello_guard_stormwind;
newscript->pGossipSelect = &GossipSelect_guard_stormwind;
- newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
+ //newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
newscript->GetAI = &GetAI_guard_stormwind;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp
index a2e02069e15..0d09d7a67ed 100644
--- a/src/bindings/scripts/scripts/item/item_scripts.cpp
+++ b/src/bindings/scripts/scripts/item/item_scripts.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -223,7 +223,7 @@ bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets c
bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
{
if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
- targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
+ targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578) )
return false;
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
index 9699505f293..1b047c624cd 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -13,6 +13,7 @@ EndScriptData */
#include "npc_escortAI.h"
#define WP_LAST_POINT -1
+extern std::list<PointMovement> PointMovementList;
bool npc_escortAI::IsVisible(Unit* who) const
{
@@ -115,16 +116,23 @@ void npc_escortAI::UpdateAI(const uint32 diff)
//Correct movement speed
if (Run)
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ else
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
//Continue with waypoints
if( !IsOnHold )
{
- m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
- debug_log("SD2: EscortAI Reconnect WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- WaitTimer = 0;
- ReconnectWP = false;
- return;
+ if (CurrentWP != WaypointList.end())
+ {
+ m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
+ debug_log("TSCR: EscortAI Reconnect WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+
+ WaitTimer = 0;
+ ReconnectWP = false;
+ return;
+ }
+ else
+ debug_log("TSCR: EscortAI Reconnected to end of WP list");
}
}
@@ -271,6 +279,22 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait
WaypointList.push_back(t);
}
+void npc_escortAI::FillPointMovementListForCreature()
+{
+ UNORDERED_MAP<uint32, std::vector<PointMovement> >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry());
+
+ if (pPointsEntries != PointMovementMap.end())
+ {
+ std::vector<PointMovement>::iterator itr;
+
+ for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr)
+ {
+ Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime);
+ WaypointList.push_back(pPoint);
+ }
+ }
+}
+
void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
{
if (InCombat)
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h
index a2ec7fc50ed..503ff614171 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.h
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -7,6 +7,8 @@
#define DEFAULT_MAX_PLAYER_DISTANCE 50
+extern UNORDERED_MAP<uint32, std::vector<PointMovement> > PointMovementMap;
+
struct Escort_Waypoint
{
Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
@@ -58,6 +60,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
// EscortAI functions
void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
+ void FillPointMovementListForCreature();
+
void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
diff --git a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
index f96011266b9..ccd2b69f8bf 100644
--- a/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_innkeeper.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -52,7 +52,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
- if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID()))
{
char* localizedEntry;
switch (player->GetSession()->GetSessionDbLocaleIndex())
@@ -83,7 +83,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
- if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
+ if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID()))
{
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
diff --git a/src/bindings/scripts/scripts/npc/npc_professions.cpp b/src/bindings/scripts/scripts/npc/npc_professions.cpp
index a13dc927603..e121e598528 100644
--- a/src/bindings/scripts/scripts/npc/npc_professions.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_professions.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -634,8 +634,6 @@ void SendActionMenu_npc_prof_blacksmith(Player *player, Creature *_Creature, uin
{
//unknown textID (TALK_MUST_UNLEARN_WEAPON)
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
- //Temporary, not offilike
- _Creature->MonsterSay(TALK_MUST_UNLEARN_WEAPON,0,player->GetGUID());
}
else if( EquippedOk(player,S_UNLEARN_WEAPON) )
{
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index eae009edd24..8257fa60596 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Npcs_Special
SD%Complete: 100
-SDComment: To be used for special NPCs that are located globally. Support for quest 3861 (Cluck!), 6622 and 6624 (Triage)
+SDComment: To be used for special NPCs that are located globally.
SDCategory: NPCs
EndScriptData
*/
@@ -26,8 +26,10 @@ EndScriptData
npc_chicken_cluck 100% support for quest 3861 (Cluck!)
npc_dancing_flames 100% midsummer event NPC
npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
+npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565
npc_injured_patient 100% patients for triage-quests (6622 and 6624)
npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
+npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796
npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
@@ -40,10 +42,11 @@ EndContentData */
# npc_chicken_cluck
#########*/
+#define EMOTE_A_HELLO -1070004
+#define EMOTE_H_HELLO -1070005
+#define EMOTE_CLUCK_TEXT2 -1070006
+
#define QUEST_CLUCK 3861
-#define EMOTE_A_HELLO "looks up at you quizzically. Maybe you should inspect it?"
-#define EMOTE_H_HELLO "looks at you unexpectadly."
-#define CLUCK_TEXT2 "starts pecking at the feed."
#define FACTION_FRIENDLY 84
#define FACTION_CHICKEN 31
@@ -76,40 +79,37 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
if(UpdateVictim())
DoMeleeAttackIfReady();
}
-};
-
-CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
-{
- return new npc_chicken_cluckAI(_Creature);
-}
-bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
-{
- if( emote == TEXTEMOTE_CHICKEN )
+ void ReceiveEmote( Player *player, uint32 emote )
{
- if( player->GetTeam() == ALLIANCE )
+ if( emote == TEXTEMOTE_CHICKEN )
{
- if( rand()%30 == 1 )
+ if( player->GetTeam() == ALLIANCE )
{
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
+ if( rand()%30 == 1 )
{
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(EMOTE_A_HELLO, 0);
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
+ {
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ m_creature->setFaction(FACTION_FRIENDLY);
+ DoScriptText(EMOTE_A_HELLO, m_creature);
+ }
}
- }
- } else
- _Creature->MonsterTextEmote(EMOTE_H_HELLO,0);
- }
- if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
- {
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->setFaction(FACTION_FRIENDLY);
- _Creature->MonsterTextEmote(CLUCK_TEXT2, 0);
+ } else DoScriptText(EMOTE_H_HELLO,m_creature);
+ }
+ if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
+ {
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ m_creature->setFaction(FACTION_FRIENDLY);
+ DoScriptText(EMOTE_CLUCK_TEXT2, m_creature);
+ }
}
+};
- return true;
+CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
+{
+ return new npc_chicken_cluckAI(_Creature);
}
bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
@@ -172,114 +172,83 @@ struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI
}
void Aggro(Unit* who){}
-};
-CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature)
-{
- return new npc_dancing_flamesAI(_Creature);
-}
-
-bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 emote )
-{
- if ( ((npc_dancing_flamesAI*)flame->AI())->active &&
- flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f))
+ void ReceiveEmote( Player *player, uint32 emote )
{
- flame->SetInFront(player);
- ((npc_dancing_flamesAI*)flame->AI())->active = false;
-
- WorldPacket data;
- flame->BuildHeartBeatMsg(&data);
- flame->SendMessageToSet(&data,true);
- switch(emote)
+ if (m_creature->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && m_creature->IsWithinDistInMap(player,30.0f))
{
- case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
- case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
- case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
- case TEXTEMOTE_DANCE:
+ m_creature->SetInFront(player);
+ active = false;
+
+ WorldPacket data;
+ m_creature->BuildHeartBeatMsg(&data);
+ m_creature->SendMessageToSet(&data,true);
+ switch(emote)
{
- if (!player->HasAura(SPELL_SEDUCTION,0))
- flame->CastSpell(player,SPELL_SEDUCTION,true);
+ case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
+ case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_BOW: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_JOKE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
+ case TEXTEMOTE_DANCE:
+ {
+ if (!player->HasAura(SPELL_SEDUCTION))
+ m_creature->CastSpell(player,SPELL_SEDUCTION,true);
+ }
+ break;
}
- break;
}
}
- return true;
+};
+
+CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature)
+{
+ return new npc_dancing_flamesAI(_Creature);
}
/*######
## Triage quest
######*/
-#define SAY_DOC1 "I'm saved! Thank you, doctor!"
-#define SAY_DOC2 "HOORAY! I AM SAVED!"
-#define SAY_DOC3 "Sweet, sweet embrace... take me..."
+#define SAY_DOC1 -1000201
+#define SAY_DOC2 -1000202
+#define SAY_DOC3 -1000203
+
+#define DOCTOR_ALLIANCE 12939
+#define DOCTOR_HORDE 12920
+#define ALLIANCE_COORDS 7
+#define HORDE_COORDS 6
struct Location
{
float x, y, z, o;
};
-#define DOCTOR_ALLIANCE 12939
-
static Location AllianceCoords[]=
{
- { // Top-far-right bunk as seen from entrance
- -3757.38, -4533.05, 14.16, 3.62
- },
- { // Top-far-left bunk
- -3754.36, -4539.13, 14.16, 5.13
- },
- { // Far-right bunk
- -3749.54, -4540.25, 14.28, 3.34
- },
- { // Right bunk near entrance
- -3742.10, -4536.85, 14.28, 3.64
- },
- { // Far-left bunk
- -3755.89, -4529.07, 14.05, 0.57
- },
- { // Mid-left bunk
- -3749.51, -4527.08, 14.07, 5.26
- },
- { // Left bunk near entrance
- -3746.37, -4525.35, 14.16, 5.22
- },
+ {-3757.38, -4533.05, 14.16, 3.62}, // Top-far-right bunk as seen from entrance
+ {-3754.36, -4539.13, 14.16, 5.13}, // Top-far-left bunk
+ {-3749.54, -4540.25, 14.28, 3.34}, // Far-right bunk
+ {-3742.10, -4536.85, 14.28, 3.64}, // Right bunk near entrance
+ {-3755.89, -4529.07, 14.05, 0.57}, // Far-left bunk
+ {-3749.51, -4527.08, 14.07, 5.26}, // Mid-left bunk
+ {-3746.37, -4525.35, 14.16, 5.22}, // Left bunk near entrance
};
-#define ALLIANCE_COORDS 7
-
//alliance run to where
#define A_RUNTOX -3742.96
#define A_RUNTOY -4531.52
#define A_RUNTOZ 11.91
-#define DOCTOR_HORDE 12920
-
static Location HordeCoords[]=
{
- { // Left, Behind
- -1013.75, -3492.59, 62.62, 4.34
- },
- { // Right, Behind
- -1017.72, -3490.92, 62.62, 4.34
- },
- { // Left, Mid
- -1015.77, -3497.15, 62.82, 4.34
- },
- { // Right, Mid
- -1019.51, -3495.49, 62.82, 4.34
- },
- { // Left, front
- -1017.25, -3500.85, 62.98, 4.34
- },
- { // Right, Front
- -1020.95, -3499.21, 62.98, 4.34
- }
+ {-1013.75, -3492.59, 62.62, 4.34}, // Left, Behind
+ {-1017.72, -3490.92, 62.62, 4.34}, // Right, Behind
+ {-1015.77, -3497.15, 62.82, 4.34}, // Left, Mid
+ {-1019.51, -3495.49, 62.82, 4.34}, // Right, Mid
+ {-1017.25, -3500.85, 62.98, 4.34}, // Left, front
+ {-1020.95, -3499.21, 62.98, 4.34} // Right, Front
};
-#define HORDE_COORDS 6
-
//horde run to where
#define H_RUNTOX -1016.44
#define H_RUNTOY -3508.48
@@ -305,6 +274,8 @@ const uint32 HordeSoldierId[3] =
struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
{
+ npc_doctorAI(Creature *c) : ScriptedAI(c) {}
+
uint64 Playerguid;
uint32 SummonPatient_Timer;
@@ -317,9 +288,17 @@ struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
std::list<uint64> Patients;
std::vector<Location*> Coordinates;
- npc_doctorAI(Creature *c) : ScriptedAI(c) {}
+ void Reset()
+ {
+ Playerguid = 0;
- void Reset(){}
+ SummonPatient_Timer = 10000;
+ SummonPatientCount = 0;
+ PatientDiedCount = 0;
+ PatientSavedCount = 0;
+
+ Event = false;
+ }
void BeginEvent(Player* player);
void PatientDied(Location* Point);
@@ -338,20 +317,21 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
npc_injured_patientAI(Creature *c) : ScriptedAI(c) {}
uint64 Doctorguid;
-
Location* Coord;
void Reset()
{
Doctorguid = 0;
-
Coord = NULL;
- //no select
+
+ //no select
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //no regen health
+
+ //no regen health
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //to make them lay with face down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+
+ //to make them lay with face down
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
uint32 mobId = m_creature->GetEntry();
@@ -378,25 +358,34 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
{
if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
{
- if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ if((((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
{
- if(Doctorguid)
+ if (Doctorguid)
{
- Creature* Doctor = (Unit::GetCreature((*m_creature), Doctorguid));
- if(Doctor)
+ if(Creature* Doctor = Unit::GetCreature(*m_creature, Doctorguid))
((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
}
}
- //make not selectable
+
+ //make not selectable
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- //regen health
+
+ //regen health
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //stand up
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
- DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL);
+
+ //stand up
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_DOC1,m_creature); break;
+ case 1: DoScriptText(SAY_DOC2,m_creature); break;
+ case 2: DoScriptText(SAY_DOC3,m_creature); break;
+ }
uint32 mobId = m_creature->GetEntry();
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+
switch (mobId)
{
case 12923:
@@ -416,8 +405,9 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
+ //lower HP on every world tick makes it a useful counter, not officlone though
if (m_creature->isAlive() && m_creature->GetHealth() > 6)
- { //lower HP on every world tick makes it a useful counter, not officlone though
+ {
m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
}
@@ -428,10 +418,9 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
m_creature->setDeathState(JUST_DIED);
m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
- if(Doctorguid)
+ if (Doctorguid)
{
- Creature* Doctor = (Unit::GetCreature((*m_creature), Doctorguid));
- if(Doctor)
+ if(Creature* Doctor = Unit::GetCreature((*m_creature), Doctorguid))
((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
}
}
@@ -462,7 +451,6 @@ void npc_doctorAI::BeginEvent(Player* player)
for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
Coordinates.push_back(&AllianceCoords[i]);
break;
-
case DOCTOR_HORDE:
for(uint8 i = 0; i < HORDE_COORDS; ++i)
Coordinates.push_back(&HordeCoords[i]);
@@ -470,7 +458,6 @@ void npc_doctorAI::BeginEvent(Player* player)
}
Event = true;
-
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -489,6 +476,7 @@ void npc_doctorAI::PatientDied(Location* Point)
Event = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Reset();
}
Coordinates.push_back(Point);
@@ -497,31 +485,31 @@ void npc_doctorAI::PatientDied(Location* Point)
void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
{
- if(player && Playerguid == player->GetGUID())
+ if (player && Playerguid == player->GetGUID())
{
- if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
+ if ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
{
PatientSavedCount++;
- if(PatientSavedCount == 15)
+ if (PatientSavedCount == 15)
{
- if(!Patients.empty())
+ if (!Patients.empty())
{
std::list<uint64>::iterator itr;
for(itr = Patients.begin(); itr != Patients.end(); ++itr)
{
- Creature* Patient = (Unit::GetCreature((*m_creature), *itr));
- if( Patient )
+ if(Creature* Patient = Unit::GetCreature((*m_creature), *itr))
Patient->setDeathState(JUST_DIED);
}
}
- if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
player->AreaExploredOrEventHappens(6624);
- else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
+ else if (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
player->AreaExploredOrEventHappens(6622);
Event = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Reset();
}
Coordinates.push_back(Point);
@@ -531,53 +519,61 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Poi
void npc_doctorAI::UpdateAI(const uint32 diff)
{
- if(Event && SummonPatientCount >= 20)
+ if (Event && SummonPatientCount >= 20)
{
Event = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Reset();
}
- if(Event)
- if(SummonPatient_Timer < diff)
+ if (Event)
{
- Creature* Patient = NULL;
- Location* Point = NULL;
+ if (SummonPatient_Timer < diff)
+ {
+ Creature* Patient = NULL;
+ Location* Point = NULL;
- if(Coordinates.empty())
- return;
+ if (Coordinates.empty())
+ return;
- std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
- uint32 patientEntry = 0;
+ std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
+ uint32 patientEntry = 0;
- switch(m_creature->GetEntry())
- {
- case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
- case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
- default:
- error_log("SD2: Invalid entry for Triage doctor. Please check your database");
- return;
- }
+ switch(m_creature->GetEntry())
+ {
+ case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
+ case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
+ default:
+ error_log("SD2: Invalid entry for Triage doctor. Please check your database");
+ return;
+ }
- Point = *itr;
+ Point = *itr;
- Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if(Patient)
- {
- Patients.push_back(Patient->GetGUID());
- ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
- if(Point)
- ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
- Coordinates.erase(itr);
- }
- SummonPatient_Timer = 10000;
- SummonPatientCount++;
- }else SummonPatient_Timer -= diff;
+ if (Patient)
+ {
+ //303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND)
+ Patient->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+
+ Patients.push_back(Patient->GetGUID());
+ ((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
+
+ if (Point)
+ ((npc_injured_patientAI*)Patient->AI())->Coord = Point;
+
+ Coordinates.erase(itr);
+ }
+ SummonPatient_Timer = 10000;
+ SummonPatientCount++;
+ }else SummonPatient_Timer -= diff;
+ }
}
bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
{
- if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
+ if ((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
((npc_doctorAI*)creature->AI())->BeginEvent(player);
return true;
@@ -589,11 +585,262 @@ CreatureAI* GetAI_npc_doctor(Creature *_Creature)
}
/*######
+## npc_garments_of_quests
+######*/
+
+//TODO: get text for each NPC
+
+enum
+{
+ SPELL_LESSER_HEAL_R2 = 2052,
+ SPELL_FORTITUDE_R1 = 1243,
+
+ QUEST_MOON = 5621,
+ QUEST_LIGHT_1 = 5624,
+ QUEST_LIGHT_2 = 5625,
+ QUEST_SPIRIT = 5648,
+ QUEST_DARKNESS = 5650,
+
+ ENTRY_SHAYA = 12429,
+ ENTRY_ROBERTS = 12423,
+ ENTRY_DOLF = 12427,
+ ENTRY_KORJA = 12430,
+ ENTRY_DG_KEL = 12428,
+
+ SAY_COMMON_HEALED = -1000164,
+ SAY_DG_KEL_THANKS = -1000165,
+ SAY_DG_KEL_GOODBYE = -1000166,
+ SAY_ROBERTS_THANKS = -1000167,
+ SAY_ROBERTS_GOODBYE = -1000168,
+ SAY_KORJA_THANKS = -1000169,
+ SAY_KORJA_GOODBYE = -1000170,
+ SAY_DOLF_THANKS = -1000171,
+ SAY_DOLF_GOODBYE = -1000172,
+ SAY_SHAYA_THANKS = -1000173,
+ SAY_SHAYA_GOODBYE = -1000174,
+};
+
+float fRunTo[5][3]=
+{
+ {9661.724, 869.803, 1270.742}, //shaya
+ {-9543.747, -117.770, 57.893}, //roberts
+ {-5650.226, -473.517, 397.027}, //dolf
+ {189.175, -4747.069, 11.215}, //kor'ja
+ {2471.303, 371.101, 30.919}, //kel
+};
+
+struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
+{
+ npc_garments_of_questsAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ uint64 caster;
+
+ bool bIsHealed;
+ bool bCanRun;
+
+ uint32 RunAwayTimer;
+
+ void Reset()
+ {
+ caster = 0;
+
+ bIsHealed = false;
+ bCanRun = false;
+
+ RunAwayTimer = 5000;
+
+ m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
+ //expect database to have RegenHealth=0
+ m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7));
+ m_creature->SetVisibility(VISIBILITY_ON);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void SpellHit(Unit* pCaster, const SpellEntry *Spell)
+ {
+ if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ //not while in combat
+ if (InCombat)
+ return;
+
+ //nothing to be done now
+ if (bIsHealed && bCanRun)
+ return;
+
+ if (pCaster->GetTypeId() == TYPEID_PLAYER)
+ {
+ switch(m_creature->GetEntry())
+ {
+ case ENTRY_SHAYA:
+ if (((Player*)pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ DoScriptText(SAY_SHAYA_THANKS,m_creature,pCaster);
+ bCanRun = true;
+ }
+ else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2)
+ {
+ caster = pCaster->GetGUID();
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster);
+ bIsHealed = true;
+ }
+ }
+ break;
+ case ENTRY_ROBERTS:
+ if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ DoScriptText(SAY_ROBERTS_THANKS,m_creature,pCaster);
+ bCanRun = true;
+ }
+ else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2)
+ {
+ caster = pCaster->GetGUID();
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster);
+ bIsHealed = true;
+ }
+ }
+ break;
+ case ENTRY_DOLF:
+ if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ DoScriptText(SAY_DOLF_THANKS,m_creature,pCaster);
+ bCanRun = true;
+ }
+ else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2)
+ {
+ caster = pCaster->GetGUID();
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster);
+ bIsHealed = true;
+ }
+ }
+ break;
+ case ENTRY_KORJA:
+ if (((Player*)pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ DoScriptText(SAY_KORJA_THANKS,m_creature,pCaster);
+ bCanRun = true;
+ }
+ else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2)
+ {
+ caster = pCaster->GetGUID();
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster);
+ bIsHealed = true;
+ }
+ }
+ break;
+ case ENTRY_DG_KEL:
+ if (((Player*)pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
+ {
+ DoScriptText(SAY_DG_KEL_THANKS,m_creature,pCaster);
+ bCanRun = true;
+ }
+ else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2)
+ {
+ caster = pCaster->GetGUID();
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster);
+ bIsHealed = true;
+ }
+ }
+ break;
+ }
+
+ //give quest credit, not expect any special quest objectives
+ if (bCanRun)
+ ((Player*)pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
+ }
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ //we reached destination, kill ourselves
+ if (id == 0)
+ {
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->RemoveCorpse();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (bCanRun && !InCombat)
+ {
+ if (RunAwayTimer <= diff)
+ {
+ if (Unit *pUnit = Unit::GetUnit(*m_creature,caster))
+ {
+ switch(m_creature->GetEntry())
+ {
+ case ENTRY_SHAYA:
+ DoScriptText(SAY_SHAYA_GOODBYE,m_creature,pUnit);
+ m_creature->GetMotionMaster()->MovePoint(0, fRunTo[0][0], fRunTo[0][1], fRunTo[0][2]);
+ break;
+ case ENTRY_ROBERTS:
+ DoScriptText(SAY_ROBERTS_GOODBYE,m_creature,pUnit);
+ m_creature->GetMotionMaster()->MovePoint(0, fRunTo[1][0], fRunTo[1][1], fRunTo[1][2]);
+ break;
+ case ENTRY_DOLF:
+ DoScriptText(SAY_DOLF_GOODBYE,m_creature,pUnit);
+ m_creature->GetMotionMaster()->MovePoint(0, fRunTo[2][0], fRunTo[2][1], fRunTo[2][2]);
+ break;
+ case ENTRY_KORJA:
+ DoScriptText(SAY_KORJA_GOODBYE,m_creature,pUnit);
+ m_creature->GetMotionMaster()->MovePoint(0, fRunTo[3][0], fRunTo[3][1], fRunTo[3][2]);
+ break;
+ case ENTRY_DG_KEL:
+ DoScriptText(SAY_DG_KEL_GOODBYE,m_creature,pUnit);
+ m_creature->GetMotionMaster()->MovePoint(0, fRunTo[4][0], fRunTo[4][1], fRunTo[4][2]);
+ break;
+ }
+ }
+ else
+ EnterEvadeMode(); //something went wrong
+
+ RunAwayTimer = 30000;
+ }else RunAwayTimer -= diff;
+ }
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_garments_of_quests(Creature* pCreature)
+{
+ return new npc_garments_of_questsAI(pCreature);
+}
+
+/*######
## npc_guardian
######*/
#define SPELL_DEATHTOUCH 5
-#define SAY_AGGRO "This area is closed!"
struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
{
@@ -606,7 +853,6 @@ struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
}
void UpdateAI(const uint32 diff)
@@ -628,6 +874,44 @@ CreatureAI* GetAI_npc_guardian(Creature *_Creature)
}
/*######
+## npc_kingdom_of_dalaran_quests
+######*/
+
+enum
+{
+ SPELL_TELEPORT_DALARAN = 53360,
+ ITEM_KT_SIGNET = 39740,
+ QUEST_MAGICAL_KINGDOM_A = 12794,
+ QUEST_MAGICAL_KINGDOM_H = 12791,
+ QUEST_MAGICAL_KINGDOM_N = 12796
+};
+
+#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran."
+
+bool GossipHello_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature)
+{
+ if (pCreature->isQuestGiver())
+ pPlayer->PrepareQuestMenu(pCreature->GetGUID());
+
+ if (pPlayer->HasItemCount(ITEM_KT_SIGNET,1) && (!pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) ||
+ !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N)))
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
+{
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ {
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_DALARAN,false);
+ }
+ return true;
+}
+
+/*######
## npc_mount_vendor
######*/
@@ -964,7 +1248,7 @@ CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature)
bool ReceiveEmote_npc_winter_reveler( Player *player, Creature *_Creature, uint32 emote )
{
//TODO: check auralist.
- if(player->HasAura(26218, 0))
+ if(player->HasAura(26218))
return false;
if( emote == TEXTEMOTE_KISS )
@@ -1136,7 +1420,6 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_chicken_cluck";
newscript->GetAI = &GetAI_npc_chicken_cluck;
- newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
newscript->RegisterSelf();
@@ -1144,7 +1427,6 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_dancing_flames";
newscript->GetAI = &GetAI_npc_dancing_flames;
- newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
newscript->RegisterSelf();
newscript = new Script;
@@ -1159,11 +1441,22 @@ void AddSC_npcs_special()
newscript->RegisterSelf();
newscript = new Script;
+ newscript->Name = "npc_garments_of_quests";
+ newscript->GetAI = &GetAI_npc_garments_of_quests;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="npc_guardian";
newscript->GetAI = &GetAI_npc_guardian;
newscript->RegisterSelf();
newscript = new Script;
+ newscript->Name="npc_kingdom_of_dalaran_quests";
+ newscript->pGossipHello = &GossipHello_npc_kingdom_of_dalaran_quests;
+ newscript->pGossipSelect = &GossipSelect_npc_kingdom_of_dalaran_quests;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="npc_mount_vendor";
newscript->pGossipHello = &GossipHello_npc_mount_vendor;
newscript->pGossipSelect = &GossipSelect_npc_mount_vendor;
@@ -1193,12 +1486,12 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_winter_reveler";
- newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler;
+ //newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_brewfest_reveler";
- newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler;
+ //newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
index 72dda8dd835..13f8bdd3fbf 100644
--- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp
index d83cb9b3281..084e958a92a 100644
--- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp
+++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -127,27 +127,7 @@ CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
{
npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature);
- professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08);
- professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24);
- professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24);
- professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67);
- professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
- professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
- professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56);
- professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31);
- professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000);
- professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
- professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000);
- professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
- professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31);
- professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56);
- professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42);
- professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67);
- professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24);
- professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24);
- professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08);
- professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
- professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000);
+ professor_phizzlethorpeAI->FillPointMovementListForCreature();
return (CreatureAI*)professor_phizzlethorpeAI;
}
diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp
index 16de0d2a8c3..fb7b5c30545 100644
--- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp
+++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -108,6 +108,9 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
void JustDied(Unit* killer)
{
+ if (killer->GetEntry() == m_creature->GetEntry())
+ return;
+
if (PlayerGUID && !Completed)
{
if (Player* player = Unit::GetPlayer(PlayerGUID))
@@ -149,34 +152,12 @@ bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* ques
return true;
}
-CreatureAI* GetAI_npc_torek(Creature *_Creature)
+CreatureAI* GetAI_npc_torek(Creature* pCreature)
{
- npc_torekAI* thisAI = new npc_torekAI(_Creature);
-
- thisAI->AddWaypoint(0, 1782.63, -2241.11, 109.73, 5000);
- thisAI->AddWaypoint(1, 1788.88, -2240.17, 111.71);
- thisAI->AddWaypoint(2, 1797.49, -2238.11, 112.31);
- thisAI->AddWaypoint(3, 1803.83, -2232.77, 111.22);
- thisAI->AddWaypoint(4, 1806.65, -2217.83, 107.36);
- thisAI->AddWaypoint(5, 1811.81, -2208.01, 107.45);
- thisAI->AddWaypoint(6, 1820.85, -2190.82, 100.49);
- thisAI->AddWaypoint(7, 1829.60, -2177.49, 96.44);
- thisAI->AddWaypoint(8, 1837.98, -2164.19, 96.71); //prepare
- thisAI->AddWaypoint(9, 1839.99, -2149.29, 96.78);
- thisAI->AddWaypoint(10, 1835.14, -2134.98, 96.80);
- thisAI->AddWaypoint(11, 1823.57, -2118.27, 97.43);
- thisAI->AddWaypoint(12, 1814.99, -2110.35, 98.38);
- thisAI->AddWaypoint(13, 1806.60, -2103.09, 99.19);
- thisAI->AddWaypoint(14, 1798.27, -2095.77, 100.04);
- thisAI->AddWaypoint(15, 1783.59, -2079.92, 100.81);
- thisAI->AddWaypoint(16, 1776.79, -2069.48, 101.77);
- thisAI->AddWaypoint(17, 1776.82, -2054.59, 109.82);
- thisAI->AddWaypoint(18, 1776.88, -2047.56, 109.83);
- thisAI->AddWaypoint(19, 1776.86, -2036.55, 109.83);
- thisAI->AddWaypoint(20, 1776.90, -2024.56, 109.83); //win
- thisAI->AddWaypoint(21, 1776.87, -2028.31, 109.83,60000);//stay
- thisAI->AddWaypoint(22, 1776.90, -2028.30, 109.83);
+ npc_torekAI* thisAI = new npc_torekAI(pCreature);
+ thisAI->FillPointMovementListForCreature();
+
return (CreatureAI*)thisAI;
}
@@ -272,28 +253,7 @@ CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature)
{
npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature);
- ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995);
- ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000);
- ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000);
- ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269);
- ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358);
- ruul_snowhoofAI->AddWaypoint(5, 3381.479492, -659.449097, 162.545303);
- ruul_snowhoofAI->AddWaypoint(6, 3389.554199, -648.500000, 163.651825);
- ruul_snowhoofAI->AddWaypoint(7, 3396.645020, -641.508911, 164.216019);
- ruul_snowhoofAI->AddWaypoint(8, 3410.498535, -634.299622, 165.773453);
- ruul_snowhoofAI->AddWaypoint(9, 3418.461426, -631.791992, 166.477615);
- ruul_snowhoofAI->AddWaypoint(10, 3429.500000, -631.588745, 166.921265);
- ruul_snowhoofAI->AddWaypoint(11,3434.950195, -629.245483, 168.333969);
- ruul_snowhoofAI->AddWaypoint(12,3438.927979, -618.503235, 171.503143);
- ruul_snowhoofAI->AddWaypoint(13,3444.217529, -609.293640, 173.077972, 1000); // Ambush 1
- ruul_snowhoofAI->AddWaypoint(14,3460.505127, -593.794189, 174.342255);
- ruul_snowhoofAI->AddWaypoint(15,3480.283203, -578.210327, 176.652313);
- ruul_snowhoofAI->AddWaypoint(16,3492.912842, -562.335449, 181.396301);
- ruul_snowhoofAI->AddWaypoint(17,3495.230957, -550.977600, 184.652267);
- ruul_snowhoofAI->AddWaypoint(18,3496.247070, -529.194214, 188.172028);
- ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2
- ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274);
- ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End
+ ruul_snowhoofAI->FillPointMovementListForCreature();
return (CreatureAI*)ruul_snowhoofAI;
}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
index e469dc6f618..986413cdf0f 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -299,7 +299,7 @@ CreatureAI* GetAI_boss_exarch_maladaar(Creature *_Creature)
}
#define SPELL_AV_MORTAL_STRIKE 16856
-#define SPELL_AV_MORTAL_STRIKE 16856
+#define SPELL_AV_SUNDER_ARMOR 16145
struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI
{
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
index 86ae13e29c6..c7323267b2f 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
index 325b5aeb8dd..8e2d4cea736 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -201,7 +201,7 @@ CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
{
- mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
+ mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c), CanEvade(false)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
CanEvade = false;
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
index d366400b97d..d3ca37b445e 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
index dbf41ed777d..758596ca55d 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
index e1d1e98206e..94257e0aa37 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
if (ArcaneVolley_Timer < diff)
{
DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY);
- ArcaneVolley_Timer = 10000+rand()%5000;
+ ArcaneVolley_Timer = 7000+rand()%5000;
}else ArcaneVolley_Timer -= diff;
if (Sheep_Timer < diff)
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
index 52ba2206c21..698571faecc 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
index e22ac68ff02..3d53f7b29e8 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
index 5a9b8e8b2a3..6c64a255370 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -38,7 +38,7 @@ EndScriptData */
#define SAY_DEATH -1555007
#define SPELL_BANISH 30231
-#define SPELL_CORROSIVE_ACID 23313
+#define SPELL_CORROSIVE_ACID 33551
#define SPELL_FEAR 33547
#define SPELL_ENRAGE 0 //need to find proper spell
@@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
if (pInstance->GetData(TYPE_OVERSEER) == DONE)
{
- if (m_creature->HasAura(SPELL_BANISH,0))
+ if (m_creature->HasAura(SPELL_BANISH))
m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
Intro = true;
}
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (m_creature->HasAura(SPELL_BANISH,0))
+ if (m_creature->HasAura(SPELL_BANISH))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
{
DoScriptText(SAY_INTRO, m_creature);
- if (m_creature->HasAura(SPELL_BANISH,0))
+ if (m_creature->HasAura(SPELL_BANISH))
m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
IsBanished = false;
@@ -168,14 +168,14 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
if (CorrosiveAcid_Timer < diff)
{
- DoCast(m_creature,SPELL_CORROSIVE_ACID);
- CorrosiveAcid_Timer = 25000;
+ DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID);
+ CorrosiveAcid_Timer = 15000 + rand()%10000;
}else CorrosiveAcid_Timer -= diff;
if (Fear_Timer < diff)
{
DoCast(m_creature,SPELL_FEAR);
- Fear_Timer = 35000;
+ Fear_Timer = 20000 + rand()%15000;
}else Fear_Timer -= diff;
/*if (HeroicMode)
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
index 43b01ba752f..5aa71a80825 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -148,14 +148,14 @@ struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI
{
if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_CHARGE);
- Charge_Timer = 25000;
+ Charge_Timer = 15000 + rand()%10000;
}else Charge_Timer -= diff;
//Knockback_Timer
if (Knockback_Timer < diff)
{
DoCast(m_creature, SPELL_WAR_STOMP);
- Knockback_Timer = 20000;
+ Knockback_Timer = 18000 + rand()%6000;
}else Knockback_Timer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
index 32aa9c3e844..c58bae35137 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
@@ -60,12 +60,6 @@ float VoidPortalCoords[5][3] =
{-261.4533, -297.3298, 17.1}
};
-class EmpoweringShadowsAura: public Aura
-{
- public:
- EmpoweringShadowsAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) {}
-};
-
struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
{
mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
@@ -100,7 +94,7 @@ struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
{
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS);
if( spell )
- Vorpil->AddAura(new EmpoweringShadowsAura(spell, 0, NULL, Vorpil, m_creature));
+ Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature));
Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25);
DoCast(m_creature, SPELL_SHADOW_NOVA, true);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -150,7 +144,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
void Reset()
{
- ShadowBoltVolley_Timer = 15000;
+ ShadowBoltVolley_Timer = 7000 + rand()%7000;
DrawShadows_Timer = 45000;
summonTraveler_Timer = 90000;
banish_Timer = 17000;
@@ -258,7 +252,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
if (ShadowBoltVolley_Timer < diff)
{
DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY);
- ShadowBoltVolley_Timer = 15000;
+ ShadowBoltVolley_Timer = 15000 + rand()%15000;;
}else ShadowBoltVolley_Timer -= diff;
if (HeroicMode && banish_Timer < diff)
@@ -277,7 +271,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
Map::PlayerList const &PlayerList = map->GetPlayers();
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
- if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH,0))
+ if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
m_creature->Relocate(VorpilPosition[0],VorpilPosition[1],VorpilPosition[2]);
@@ -286,7 +280,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE);
ShadowBoltVolley_Timer = 6000;
- DrawShadows_Timer = 30000;
+ DrawShadows_Timer = 3000;
}else DrawShadows_Timer -= diff;
if ( summonTraveler_Timer < diff)
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
index aae194de9b8..defaaa51a5d 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -52,9 +52,9 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
void Reset()
{
SonicBoom_Timer = 30000;
- MurmursTouch_Timer = 20000;
- Resonance_Timer = 10000;
- MagneticPull_Timer = 20000;
+ MurmursTouch_Timer = 8000 + rand()%12000;
+ Resonance_Timer = 5000;
+ MagneticPull_Timer = 15000 + rand()%15000;
ThunderingStorm_Timer = 15000;
SonicShock_Timer = 10000;
SonicBoom = false;
@@ -64,6 +64,24 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
if (hp) m_creature->SetHealth(hp);
}
+ void SonicBoomEffect()
+ {
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ for( std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr )
+ {
+ Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ //Not do anything without aura, spell can be resisted!
+ if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f))
+ {
+ //This will be wrong calculation. Also, comments suggest it must deal damage
+ target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8));
+ }
+ }
+ }
+ }
+
void Aggro(Unit *who) { }
// Sonic Boom instant damage (needs core fix instead of this)
@@ -83,12 +101,14 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
if(SonicBoom)
{
DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true);
+ SonicBoomEffect();
+
SonicBoom = false;
Resonance_Timer = 1500;
}
if (SonicBoom_Timer < diff)
{
- DoScriptText(EMOTE_SONIC_BOOM, m_creature);
+ DoScriptText(EMOTE_SONIC_BOOM, m_creature);
DoCast(m_creature, SPELL_SONIC_BOOM_CAST);
SonicBoom_Timer = 30000;
SonicBoom = true;
@@ -100,16 +120,18 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0,80,true))
DoCast(target, SPELL_MURMURS_TOUCH);
- MurmursTouch_Timer = 30000;
+ MurmursTouch_Timer = 25000 + rand()%10000;
}else MurmursTouch_Timer -= diff;
// Resonance
- if (Resonance_Timer < diff)
+ if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim())))
{
- if (!m_creature->IsWithinMeleeRange(SelectUnit(SELECT_TARGET_NEAREST,0,20,true)))
+ if (Resonance_Timer < diff)
+ {
DoCast(m_creature, SPELL_RESONANCE);
- Resonance_Timer = 5000;
- }else Resonance_Timer -= diff;
+ Resonance_Timer = 5000;
+ }else Resonance_Timer -= diff;
+ }
// Magnetic Pull
if (MagneticPull_Timer < diff)
@@ -118,7 +140,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
{
DoCast(target, SPELL_MAGNETIC_PULL);
- MagneticPull_Timer = 20000+rand()%15000;
+ MagneticPull_Timer = 15000+rand()%15000;
return;
}
MagneticPull_Timer = 500;
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
index d03c9270181..a78955368bf 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
index a3966975f95..33a0ec3320f 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 18732:
GrandmasterVorpil = creature->GetGUID();
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp
new file mode 100644
index 00000000000..9431880921c
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* Script Data Start
+SDName: boss_amanitar
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment: Only appears in heroic mode
+SDCategory: Ahn'kahet
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_amanitar' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+#define SPELL_BASH 57094
+#define SPELL_ENTANGLING_ROOTS 57095
+#define SPELL_MINI 57055
+#define SPELL_VENOM_BOLT_VOLLEY 57088
+
+struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI
+{
+ boss_amanitarAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer) {}
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+ }
+};
+
+CreatureAI* GetAI_boss_amanitar(Creature *_Creature)
+{
+ return new boss_amanitarAI (_Creature);
+}
+
+void AddSC_boss_amanitar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_amanitar";
+ newscript->GetAI = GetAI_boss_amanitar;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
new file mode 100644
index 00000000000..468aa8e10a7
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_elder_nadox
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment:
+SDCategory: Ahn'kahet
+EndScriptData */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_nadox' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+#define SPELL_BROOD_PLAGUE 56130
+#define H_SPELL_BROOD_PLAGUE 59467
+#define SPELL_BROOD_RAGE 59465 //--> Heroic -- Enrages a Swarmer, increasing size and damage done.
+
+#define MOB_AHNKAHAR_SWARMER 30178
+#define SPELL_SUMMON_SWARMERS 56119//2x 30178
+
+#define MOB_AHNKAHAR_SWARMER 30178
+#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176
+#define SPELL_DEADLY_POISON 56145// Proc trigger
+#define H_SPELL_DEADLY_POISON 59479// Proc trigger
+#define SPELL_GUARDIAN_AURA 56151
+
+//randomly summons NPC 30178 and 30176 they can cast Sprint (56354)
+
+//Yell
+#define SAY_AGGRO -1619014
+#define SAY_SLAY_1 -1619015
+#define SAY_SLAY_2 -1619016
+#define SAY_SLAY_3 -1619017
+#define SAY_DEATH -1619018
+#define SAY_EGG_SAC_1 -1619019
+#define SAY_EGG_SAC_2 -1619020
+
+struct TRINITY_DLL_DECL boss_nadoxAI : public ScriptedAI
+{
+ boss_nadoxAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 plague,
+ summon;
+
+ void Reset() {}
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+
+ void summon_swarmer(){}
+ void summon_guardian(){}
+};
+
+CreatureAI* GetAI_boss_nadox(Creature *_Creature)
+{
+ return new boss_nadoxAI (_Creature);
+}
+
+void AddSC_boss_nadox()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_nadox";
+ newscript->GetAI = GetAI_boss_nadox;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
new file mode 100644
index 00000000000..8e0b1a4744d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_herald_volazj
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment:
+SDCategory: Ahn'kahet
+EndScriptData */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_volazj' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+//Spells
+#define SPELL_INSANITY 57496 //Dummy
+#define INSANITY_VISUAL 57561
+#define SPELL_MIND_FLAY_N 57941
+#define SPELL_MIND_FLAY_H 59974
+#define SPELL_SHADOW_BOLT_VOLLEY_1 57942
+#define SPELL_SHADOW_BOLT_VOLLEY_2 59975
+#define SPELL_SHIVER_N 57949
+#define SPELL_SHIVER_H 59978
+
+//Yell
+#define SAY_AGGRO -1619030
+#define SAY_SLAY_1 -1619031
+#define SAY_SLAY_2 -1619032
+#define SAY_SLAY_3 -1619033
+#define SAY_DEATH_1 -1619034
+#define SAY_DEATH_2 -1619035
+#define SAY_PHASE -1619036
+
+struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI
+{
+ boss_volazjAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase =1;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ if(phase == 1)
+ DoScriptText(SAY_DEATH_1, m_creature);
+ else
+ DoScriptText(SAY_DEATH_2, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_volazj(Creature *_Creature)
+{
+ return new boss_volazjAI (_Creature);
+}
+
+void AddSC_boss_volazj()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_volazj";
+ newscript->GetAI = GetAI_boss_volazj;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
new file mode 100644
index 00000000000..145c017679e
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_jedoga_shadowseeker
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment:
+SDCategory: Ahn'kahet
+EndScriptData */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_jedoga' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+#define SPELL_CYCLONE_STRIKE 56855
+#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist
+#define SPELL_LIGHTNING_BOLT 56891
+#define H_SPELL_LIGHTNING_BOLT 60032
+#define SPELL_THUNDERSHOCK 56926//AOE works
+#define H_SPELL_THUNDERSHOCK 60029//AOE works
+#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed
+
+#define SAY_AGGRO -1619000
+#define SAY_C_SACRIFICE_1 -1619001
+#define SAY_C_SACRIFICE_2 -1619002
+#define SAY_SACRIFICE_1 -1619003
+#define SAY_SACRIFICE_2 -1619004
+#define SAY_SLAY_1 -1619005
+#define SAY_SLAY_2 -1619006
+#define SAY_SLAY_3 -1619007
+#define SAY_DEATH -1619008
+#define SAY_PREACHING_1 -1619009
+#define SAY_PREACHING_2 -1619010
+#define SAY_PREACHING_3 -1619011
+#define SAY_PREACHING_4 -1619012
+#define SAY_PREACHING_5 -1619013
+
+struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI
+{
+ boss_jedogaAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_jedoga(Creature *_Creature)
+{
+ return new boss_jedogaAI (_Creature);
+}
+
+void AddSC_boss_jedoga()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_jedoga";
+ newscript->GetAI = GetAI_boss_jedoga;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
new file mode 100644
index 00000000000..36e68862f0c
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_prince_taldaram
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment:
+SDCategory: Ahn'kahet
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura
+#define SPELL_CONJURE_FLAME_SPHERE 55931
+
+#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106
+#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686
+#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687
+#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891
+#define SPELL_FLAME_SPHERE_VISUAL 55928
+#define SPELL_FLAME_SPHERE_PERIODIC 55926
+#define H_SPELL_FLAME_SPHERE_PERIODIC 59508
+#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947
+
+#define SPELL_EMBRACE_OF_THE_VAMPYR 55959
+#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513
+
+#define SPELL_VANISH 55964
+
+//Yell
+#define SAY_AGGRO -1619021
+#define SAY_SLAY_1 -1619022
+#define SAY_SLAY_2 -1619023
+#define SAY_SLAY_3 -1619024
+#define SAY_DEATH -1619025
+#define SAY_FEED_1 -1619026
+#define SAY_FEED_2 -1619027
+#define SAY_VANISH_1 -1619028
+#define SAY_VANISH_2 -1619029
+
+struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI
+{
+ boss_taldaramAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_taldaram(Creature *_Creature)
+{
+ return new boss_taldaramAI (_Creature);
+}
+
+void AddSC_boss_taldaram()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_taldaram";
+ newscript->GetAI = GetAI_boss_taldaram;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h
new file mode 100644
index 00000000000..97c0db55d72
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DEF_AHNKAHET_H
+#define DEF_AHNKAHET_H
+
+#define DATA_ELDER_NADOX 1
+#define DATA_PRINCE_TALDARAM 2
+#define DATA_JEDOGA_SHADOWSEEKER 3
+#define DATA_HERALD_VOLAZJ 4
+#define DATA_AMANITAR 5
+
+#define DATA_ELDER_NADOX_EVENT 6
+#define DATA_PRINCE_TALDARAM_EVENT 7
+#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8
+#define DATA_HERALD_VOLAZJ_EVENT 9
+#define DATA_AMANITAR_EVENT 10
+#endif
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp
new file mode 100644
index 00000000000..41cb91f86b7
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Azjol_Nerub
+SD%Complete: 0
+SDComment:
+SDCategory: Azjol Nerub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_ahnkahet.h"
+
+#define ENCOUNTERS 5
+
+/* Ahn'kahet encounters:
+0 - Elder Nadox
+1 - Prince Taldaram
+2 - Jedoga Shadowseeker
+3 - Herald Volazj
+4 - Amanitar (Heroic only)
+*/
+
+struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
+{
+ instance_ahnkahet(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Elder_Nadox;
+ uint64 Prince_Taldaram;
+ uint64 Jedoga_Shadowseeker;
+ uint64 Herald_Volazj;
+ uint64 Amanitar;
+
+ uint32 Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ Elder_Nadox =0;
+ Prince_Taldaram =0;
+ Jedoga_Shadowseeker =0;
+ Herald_Volazj =0;
+ Amanitar =0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 29309: Elder_Nadox = creature->GetGUID(); break;
+ case 29308: Prince_Taldaram = creature->GetGUID(); break;
+ case 29310: Jedoga_Shadowseeker = creature->GetGUID(); break;
+ case 29311: Herald_Volazj = creature->GetGUID(); break;
+ case 30258: Amanitar = creature->GetGUID(); break;
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_ELDER_NADOX: return Elder_Nadox;
+ case DATA_PRINCE_TALDARAM: return Prince_Taldaram;
+ case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker;
+ case DATA_HERALD_VOLAZJ: return Herald_Volazj;
+ case DATA_AMANITAR: return Amanitar;
+ }
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_ELDER_NADOX_EVENT:
+ Encounters[0] = data;break;
+ case DATA_PRINCE_TALDARAM_EVENT:
+ Encounters[1] = data; break;
+ case DATA_JEDOGA_SHADOWSEEKER_EVENT:
+ Encounters[2] = data; break;
+ case DATA_HERALD_VOLAZJ:
+ Encounters[3] = data; break;
+ case DATA_AMANITAR:
+ Encounters[4] = data; break;
+ }
+
+ if (data == DONE)
+ {
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_ELDER_NADOX_EVENT: return Encounters[0];
+ case DATA_PRINCE_TALDARAM_EVENT: return Encounters[1];
+ case DATA_JEDOGA_SHADOWSEEKER_EVENT: return Encounters[2];
+ case DATA_HERALD_VOLAZJ: return Encounters[3];
+ case DATA_AMANITAR: return Encounters[4];
+ }
+ return 0;
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::string str_data;
+
+ std::ostringstream saveStream;
+ saveStream << "A K " << Encounters[0] << " " << Encounters[1] << " "
+ << Encounters[2] << Encounters[3] << Encounters[4];
+
+ str_data = saveStream.str();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return str_data.c_str();
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0,data1,data2,data3,data4;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4;
+
+ if( dataHead1 == 'A' && dataHead2 == 'K')
+ {
+ Encounters[0] = data0;
+ Encounters[1] = data1;
+ Encounters[2] = data2;
+ Encounters[3] = data3;
+ Encounters[4] = data4;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if (Encounters[i] == IN_PROGRESS)
+ Encounters[i] = NOT_STARTED;
+
+ }else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_ahnkahet(Map* map)
+{
+ return new instance_ahnkahet(map);
+}
+
+void AddSC_instance_ahnkahet()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_ahnkahet";
+ newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp
new file mode 100644
index 00000000000..c479e17d162
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_anubarak
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment:
+SDCategory: Azjol Nerub
+EndScriptData */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_anub_arak' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_azjol_nerub.h"
+
+//Spells
+#define SPELL_CARRION_BEETLES 53520
+#define SPELL_LOCUST_SWARM 53467
+#define SPELL_IMPALE 53454
+#define SPELL_POUND 53472
+
+//Yell
+#define SAY_INTRO -1601010
+#define SAY_AGGRO -1601000
+#define SAY_SLAY_1 -1601001
+#define SAY_SLAY_2 -1601002
+#define SAY_SLAY_3 -1601003
+#define SAY_LOCUST_1 -1601005
+#define SAY_LOCUST_2 -1601006
+#define SAY_LOCUST_3 -1601007
+#define SAY_SUBMERGE_1 -1601008
+#define SAY_SUBMERGE_2 -1601009
+#define SAY_DEATH -1601004
+
+struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI
+{
+ boss_anub_arakAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase =1;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33)
+ phase = 2;
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15)
+ phase = 3;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_anub_arak(Creature *_Creature)
+{
+ return new boss_anub_arakAI (_Creature);
+}
+
+void AddSC_boss_anub_arak()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_anub_arak";
+ newscript->GetAI = GetAI_boss_anub_arak;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp
new file mode 100644
index 00000000000..e72ccd6436f
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_hadronox
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Azjol Nerub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_azjol_nerub.h"
+
+#define SPELL_WEB_FRONT_DOORS 53177//dummy
+
+#define SPELL_ACID_CLOUD 53400
+#define H_SPELL_ACID_CLOUD 59419
+#define SPELL_LEECH_POISON 53030
+#define H_SPELL_LEECH_POISON 59417
+#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal
+#define SPELL_PIECE_ARMOR 53418
+#define SPELL_WEB_GRAB 53406
+#define H_SPELL_WEB_GRAB 59420
+
+/* Script Data Start
+SDName: Boss hadronox
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_hadronox' where entry = '';
+*** SQL END ***/
+
+//Spells
+#define SPELL_LEECH_POISON 53030
+#define SPELL_ACID_CLOUD 53400
+#define SPELL_PIERCE_ARMOR 53418 //Source SUN++
+#define SPELL_WEB_GRAB 53406
+
+//Phase 0 => Gauntlet Event described below
+//Phase 1 => Boss Encounter
+
+/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians.
+When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back,
+so you don't aggro all 3. Hadronox will be under you, fighting Nerubians.
+
+This is the timed gauntlet - waves of non-elite spiders
+ will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the
+ main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for
+ Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/
+
+struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI
+{
+ boss_hadronoxAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase =1;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
+ }
+};
+
+CreatureAI* GetAI_boss_hadronox(Creature *_Creature)
+{
+ return new boss_hadronoxAI (_Creature);
+}
+
+void AddSC_boss_hadronox()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_hadronox";
+ newscript->GetAI = GetAI_boss_hadronox;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
new file mode 100644
index 00000000000..43ae13d0b9d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: boss_krikthir_the_gatewatcher
+SDAuthor: LordVanMartin
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Azjol Nerub
+EndScriptData */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_krik_thir' where entry = '';
+*** SQL END ***/
+
+#include "precompiled.h"
+#include "def_azjol_nerub.h"
+
+#define SPELL_MIND_FLAY 52586
+#define H_SPELL_MIND_FLAY 59367
+#define SPELL_CURSE_OF_FATIGUE 52592
+#define H_SPELL_CURSE_OF_FATIGUE 59368
+#define SPELL_FRENZY 28747 // maybe 53361
+
+#define MOB_SKITTERING_SWARMER 28735
+#define MOB_SKITTERING_SWARMER_CONTROLLER 32593
+
+#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439
+#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735
+
+//Yell
+#define SAY_AGGRO -1601011
+#define SAY_SLAY_1 -1601012
+#define SAY_SLAY_2 -1601013
+#define SAY_SLAY_3 -1601014
+#define SAY_DEATH -1601015
+#define SAY_SEND_GROUP_1 -1601018
+#define SAY_SEND_GROUP_2 -1601019
+#define SAY_SEND_GROUP_3 -1601020
+#define SAY_SWARM_1 -1601016
+#define SAY_SWARM_2 -1601017
+#define SAY_PREFIGHT_1 -1601021
+#define SAY_PREFIGHT_2 -1601022
+#define SAY_PREFIGHT_3 -1601023
+
+struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI
+{
+ boss_krik_thirAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10)
+ {
+ //Frenzy
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_krik_thir(Creature *_Creature)
+{
+ return new boss_krik_thirAI (_Creature);
+}
+
+void AddSC_boss_krik_thir()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_krik_thir";
+ newscript->GetAI = GetAI_boss_krik_thir;
+ newscript->RegisterSelf();
+
+}
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h
new file mode 100644
index 00000000000..9e319e8fde0
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DEF_AZJOL_NERUB_H
+#define DEF_AZJOL_NERUB_H
+
+#define DATA_KRIKTHIR_THE_GATEWATCHER 1
+#define DATA_HADRONOX 2
+#define DATA_ANUBARAK 3
+
+#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4
+#define DATA_HADRONOX_EVENT 5
+#define DATA_ANUBARAK_EVENT 6
+#endif
diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp
new file mode 100644
index 00000000000..bd3fccd98d9
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Azjol_Nerub
+SD%Complete: 0
+SDComment: Placeholder
+SDCategory: Azjol Nerub
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_azjol_nerub.h"
+
+#define ENCOUNTERS 3
+
+/* Azjol Nerub encounters:
+0 - Krik'thir the Gatewatcher
+1 - Hadronox
+2 - Anub'arak
+*/
+
+struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
+{
+ instance_azjol_nerub(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Krikthir;
+ uint64 Hadronox;
+ uint64 Anubarak;
+
+ uint32 Encounters[ENCOUNTERS];
+
+ void Initialize()
+ {
+ Krikthir = 0;
+ Hadronox = 0;
+ Anubarak =0;
+
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 28684: Krikthir = creature->GetGUID(); break;
+ case 28921: Hadronox = creature->GetGUID(); break;
+ case 29120: Anubarak = creature->GetGUID(); break;
+
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_KRIKTHIR_THE_GATEWATCHER: return Krikthir;
+ case DATA_HADRONOX: return Hadronox;
+ case DATA_ANUBARAK: return Anubarak;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
+ Encounters[0] = data;break;
+ case DATA_HADRONOX_EVENT:
+ Encounters[1] = data; break;
+ case DATA_ANUBARAK_EVENT:
+ Encounters[2] = data; break;
+ }
+
+ if (data == DONE)
+ {
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return Encounters[0];
+ case DATA_HADRONOX_EVENT: return Encounters[1];
+ case DATA_ANUBARAK_EVENT: return Encounters[2];
+ }
+
+ return 0;
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::string str_data;
+
+ std::ostringstream saveStream;
+ saveStream << "A N " << Encounters[0] << " " << Encounters[1] << " "
+ << Encounters[2];
+
+ str_data = saveStream.str();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return str_data.c_str();
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0,data1,data2;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
+
+ if( dataHead1 == 'A' && dataHead2 == 'N')
+ {
+ Encounters[0] = data0;
+ Encounters[1] = data1;
+ Encounters[2] = data2;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if (Encounters[i] == IN_PROGRESS)
+ Encounters[i] = NOT_STARTED;
+
+ }else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_azjol_nerub(Map* map)
+{
+ return new instance_azjol_nerub(map);
+}
+
+void AddSC_instance_azjol_nerub()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_azjol_nerub";
+ newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
index a94d3e003b7..d94579361de 100644
--- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
index 97e21ccbe1b..34aa388c4c7 100644
--- a/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/boss_azuregos.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
index d87cf571baf..febf52effd1 100644
--- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -39,155 +39,140 @@ EndContentData */
## npc_draenei_survivor
######*/
-#define HEAL1 -1000248
-#define HEAL2 -1000249
-#define HEAL3 -1000250
-#define HEAL4 -1000251
+#define SAY_HEAL1 -1000248
+#define SAY_HEAL2 -1000249
+#define SAY_HEAL3 -1000250
+#define SAY_HEAL4 -1000251
-#define HELP1 -1000252
-#define HELP2 -1000253
-#define HELP3 -1000254
-#define HELP4 -1000255
+#define SAY_HELP1 -1000252
+#define SAY_HELP2 -1000253
+#define SAY_HELP3 -1000254
+#define SAY_HELP4 -1000255
+
+#define SPELL_IRRIDATION 35046
+#define SPELL_STUNNED 28630
struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
{
npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {}
- uint32 UnSpawnTimer;
- uint32 ResetlifeTimer;
- uint32 SayingTimer;
- uint32 HealSayTimer;
- bool UnSpawn;
- bool say;
- bool HealSay;
- bool isRun;
- bool isMove;
+ uint64 pCaster;
+
+ uint32 SayThanksTimer;
+ uint32 RunAwayTimer;
+ uint32 SayHelpTimer;
+
+ bool CanSayHelp;
void Reset()
{
- UnSpawnTimer = 2500;
- ResetlifeTimer= 60000;
- SayingTimer = 5000;
- HealSayTimer = 6000;
- say = false;
- isRun = false;
- isMove = false;
- UnSpawn = false;
- HealSay = false;
+ pCaster = 0;
+
+ SayThanksTimer = 0;
+ RunAwayTimer = 0;
+ SayHelpTimer = 10000;
+
+ CanSayHelp = true;
+
+ m_creature->CastSpell(m_creature, SPELL_IRRIDATION, true);
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //cast red shining
- m_creature->CastSpell(m_creature, 29152, false, NULL);
- //set creature health
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
}
void Aggro(Unit *who) {}
- void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
+ void MoveInLineOfSight(Unit *who)
{
- if (!who)
- return;
-
- if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
+ if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f))
{
- switch (rand()%4) //Random switch between 4 texts
+ //Random switch between 4 texts
+ switch (rand()%4)
{
- case 0:
- DoScriptText(HELP1, m_creature);
- SayingTimer = 15000;
- say = false;
- break;
- case 1:
- DoScriptText(HELP2, m_creature);
- SayingTimer = 15000;
- say = false;
- break;
- case 2:
- DoScriptText(HELP3, m_creature);
- SayingTimer = 15000;
- say = false;
- break;
- case 3:
- DoScriptText(HELP4, m_creature);
- SayingTimer = 15000;
- say = false;
- break;
- }
- }
- else
- {
- isRun = false;
+ case 0: DoScriptText(SAY_HELP1, m_creature, who); break;
+ case 1: DoScriptText(SAY_HELP2, m_creature, who); break;
+ case 2: DoScriptText(SAY_HELP3, m_creature, who); break;
+ case 3: DoScriptText(SAY_HELP4, m_creature, who); break;
+ }
+
+ SayHelpTimer = 20000;
+ CanSayHelp = false;
}
}
- void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
+ void SpellHit(Unit *Caster, const SpellEntry *Spell)
{
- if (m_creature->GetHealth() > 50)
+ if (Spell->SpellFamilyFlags[2] & 0x080000000)
{
- if(ResetlifeTimer < diff)
- {
- ResetlifeTimer = 60000;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
- // ley down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
- }
- else ResetlifeTimer -= diff;
- }
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
- if(HealSay)
- {
- if (HealSayTimer < diff)
- {
- UnSpawn = true;
- isRun = true;
- isMove = true;
- }else HealSayTimer -= diff;
+ m_creature->CastSpell(m_creature, SPELL_STUNNED, true);
+
+ pCaster = Caster->GetGUID();
+
+ SayThanksTimer = 5000;
}
+ }
- if(UnSpawn)
+ void UpdateAI(const uint32 diff)
+ {
+ if (SayThanksTimer)
{
- if(isMove)
+ if (SayThanksTimer <= diff)
{
+ m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION);
+
+ if (Player *pPlayer = Unit::GetPlayer(pCaster))
+ {
+ if (pPlayer->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ switch (rand()%4)
+ {
+ case 0: DoScriptText(SAY_HEAL1, m_creature, pPlayer); break;
+ case 1: DoScriptText(SAY_HEAL2, m_creature, pPlayer); break;
+ case 2: DoScriptText(SAY_HEAL3, m_creature, pPlayer); break;
+ case 3: DoScriptText(SAY_HEAL4, m_creature, pPlayer); break;
+ }
+
+ pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
+ }
+
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
- isMove = false;
- }
- if (UnSpawnTimer < diff)
- {
- m_creature->StopMoving();
- EnterEvadeMode();
- //set creature health
- m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
+ RunAwayTimer = 10000;
+ SayThanksTimer = 0;
+ }else SayThanksTimer -= diff;
- }else UnSpawnTimer -= diff;
+ return;
}
- if(SayingTimer < diff)
- {
- say = true;
- }else SayingTimer -= diff;
- }
-
- void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
- {
- if (Hitter && Spellkind->Id == 28880)
+ if (RunAwayTimer)
{
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- m_creature->HandleEmoteCommand(ANIM_RISE);
- switch (rand()%4) //This switch doesn't work at all, creature say nothing!
+ if (RunAwayTimer <= diff)
{
- case 0: DoScriptText(HEAL1, m_creature, Hitter); break;
- case 1: DoScriptText(HEAL2, m_creature, Hitter); break;
- case 2: DoScriptText(HEAL3, m_creature, Hitter); break;
- case 3: DoScriptText(HEAL4, m_creature, Hitter); break;
- }
- HealSay = true;
+ m_creature->RemoveAllAuras();
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->RemoveCorpse();
+ }else RunAwayTimer -= diff;
+
+ return;
}
+
+ if (SayHelpTimer < diff)
+ {
+ CanSayHelp = true;
+ SayHelpTimer = 20000;
+ }else SayHelpTimer -= diff;
}
};
CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
@@ -288,8 +273,8 @@ struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
switch (rand()%2)
{
- case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
- case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
+ case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break;
+ case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break;
}
}
@@ -322,7 +307,7 @@ CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
#define SAY_END2 -1000115
#define EMOTE_HUG -1000116
-#define QUEST_A_CRY_FOR_HELP 9528
+#define QUEST_A_CRY_FOR_SAY_HELP 9528
struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
{
@@ -351,7 +336,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
DoScriptText(EMOTE_HUG, m_creature, player);
DoScriptText(SAY_END2, m_creature, player);
if (player && player->GetTypeId() == TYPEID_PLAYER)
- ((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_HELP,m_creature);
+ ((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature);
break;
}
}
@@ -373,7 +358,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
{
Player* player = Unit::GetPlayer(PlayerGUID);
if (player)
- ((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP);
+ ((Player*)player)->FailQuest(QUEST_A_CRY_FOR_SAY_HELP);
}
}
@@ -385,7 +370,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* quest)
{
- if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP)
+ if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP)
{
creature->setFaction(113);
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
@@ -393,41 +378,11 @@ bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* que
return true;
}
-CreatureAI* GetAI_npc_magwinAI(Creature *_Creature)
+CreatureAI* GetAI_npc_magwinAI(Creature* pCreature)
{
- npc_magwinAI* magwinAI = new npc_magwinAI(_Creature);
-
- magwinAI->AddWaypoint(0, -4784.532227, -11051.060547, 3.484263);
- magwinAI->AddWaypoint(1, -4805.509277, -11037.293945, 3.043942);
- magwinAI->AddWaypoint(2, -4827.826172, -11034.398438, 1.741959);
- magwinAI->AddWaypoint(3, -4852.630859, -11033.695313, 2.208656);
- magwinAI->AddWaypoint(4, -4876.791992, -11034.517578, 3.175228);
- magwinAI->AddWaypoint(5, -4895.486816, -11038.306641, 9.390890);
- magwinAI->AddWaypoint(6, -4915.464844, -11048.402344, 12.369793);
- magwinAI->AddWaypoint(7, -4937.288086, -11067.041992, 13.857983);
- magwinAI->AddWaypoint(8, -4966.577637, -11067.507813, 15.754786);
- magwinAI->AddWaypoint(9, -4993.799805, -11056.544922, 19.175295);
- magwinAI->AddWaypoint(10, -5017.836426, -11052.569336, 22.476587);
- magwinAI->AddWaypoint(11, -5039.706543, -11058.459961, 25.831593);
- magwinAI->AddWaypoint(12, -5057.289063, -11045.474609, 26.972496);
- magwinAI->AddWaypoint(13, -5078.828125, -11037.601563, 29.053417);
- magwinAI->AddWaypoint(14, -5104.158691, -11039.195313, 29.440195);
- magwinAI->AddWaypoint(15, -5120.780273, -11039.518555, 30.142139);
- magwinAI->AddWaypoint(16, -5140.833008, -11039.810547, 28.788074);
- magwinAI->AddWaypoint(17, -5161.201660, -11040.050781, 27.879545, 4000);
- magwinAI->AddWaypoint(18, -5171.842285, -11046.803711, 27.183821);
- magwinAI->AddWaypoint(19, -5185.995117, -11056.359375, 20.234867);
- magwinAI->AddWaypoint(20, -5198.485840, -11065.065430, 18.872593);
- magwinAI->AddWaypoint(21, -5214.062500, -11074.653320, 19.215731);
- magwinAI->AddWaypoint(22, -5220.157227, -11088.377930, 19.818476);
- magwinAI->AddWaypoint(23, -5233.652832, -11098.846680, 18.349432);
- magwinAI->AddWaypoint(24, -5250.163086, -11111.653320, 16.438959);
- magwinAI->AddWaypoint(25, -5268.194336, -11125.639648, 12.668313);
- magwinAI->AddWaypoint(26, -5286.270508, -11130.669922, 6.912246);
- magwinAI->AddWaypoint(27, -5317.449707, -11137.392578, 4.963446);
- magwinAI->AddWaypoint(28, -5334.854492, -11154.384766, 6.742664);
- magwinAI->AddWaypoint(29, -5353.874512, -11171.595703, 6.903912, 20000);
- magwinAI->AddWaypoint(30, -5354.240000, -11171.940000, 6.890000);
+ npc_magwinAI* magwinAI = new npc_magwinAI(pCreature);
+
+ magwinAI->FillPointMovementListForCreature();
return (CreatureAI*)magwinAI;
}
@@ -562,7 +517,7 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllGameObjectsWithEntryInGrid go_check(GO_NAGA_FLAG);
- Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(FlagList, go_check);
+ Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(m_creature, FlagList, go_check);
TypeContainerVisitor
<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search);
CellLock<GridReadGuard> cell_lock(cell, pair);
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index 37d0ee089f5..e944d25ad70 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -89,50 +89,54 @@ bool GossipSelect_npc_sputtervalve(Player *player, Creature *_Creature, uint32 s
## npc_taskmaster_fizzule
######*/
-//#define FACTION_HOSTILE_F 430
-#define FACTION_HOSTILE_F 16
-#define FACTION_FRIENDLY_F 35
-
-#define SPELL_FLARE 10113
-#define SPELL_FOLLY 10137
+enum
+{
+ FACTION_FRIENDLY_F = 35,
+ SPELL_FLARE = 10113,
+ SPELL_FOLLY = 10137,
+};
struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
{
- npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) {}
+ npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c)
+ {
+ factionNorm = c->getFaction();
+ }
+ uint32 factionNorm;
bool IsFriend;
uint32 Reset_Timer;
- uint32 FlareCount;
+ uint8 FlareCount;
void Reset()
{
IsFriend = false;
Reset_Timer = 120000;
FlareCount = 0;
- m_creature->setFaction(FACTION_HOSTILE_F);
- m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ m_creature->setFaction(factionNorm);
}
- //This is a hack. Spellcast will make creature aggro but that is not
- //supposed to happen (Trinity not implemented/not found way to detect this spell kind)
- void DoUglyHack()
+ void DoFriend()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
+
+ m_creature->StopMoving();
+ m_creature->GetMotionMaster()->MoveIdle();
+
+ m_creature->setFaction(FACTION_FRIENDLY_F);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if( spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY )
+ if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY)
{
- DoUglyHack();
++FlareCount;
- if( FlareCount >= 2 )
- {
- m_creature->setFaction(FACTION_FRIENDLY_F);
+
+ if (FlareCount >= 2)
IsFriend = true;
- }
}
}
@@ -140,9 +144,9 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if( IsFriend )
+ if (IsFriend)
{
- if( Reset_Timer < diff )
+ if (Reset_Timer < diff)
{
EnterEvadeMode();
} else Reset_Timer -= diff;
@@ -153,24 +157,27 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
DoMeleeAttackIfReady();
}
-};
-CreatureAI* GetAI_npc_taskmaster_fizzule(Creature *_Creature)
-{
- return new npc_taskmaster_fizzuleAI (_Creature);
-}
-bool ReciveEmote_npc_taskmaster_fizzule(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE )
+ void ReciveEmote(Player* pPlayer, uint32 emote)
{
- if( ((npc_taskmaster_fizzuleAI*)_Creature->AI())->FlareCount >= 2 )
+ if (emote == TEXTEMOTE_SALUTE)
{
- _Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ if (FlareCount >= 2)
+ {
+ if (m_creature->getFaction() == FACTION_FRIENDLY_F)
+ return;
+ else
+ DoFriend();
+ }
}
}
- return true;
+};
+
+CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature)
+{
+ return new npc_taskmaster_fizzuleAI(pCreature);
}
+
/*#####
## npc_twiggy_flathead
#####*/
@@ -357,7 +364,6 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
//pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
//pCreature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78);
pCreature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79);
- //pCreature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
pCreature->HandleEmoteCommand(EMOTE_STATE_READYUNARMED);
EventBigWill = true;
Wave_Timer = 1000;
@@ -543,7 +549,6 @@ void AddSC_the_barrens()
newscript = new Script;
newscript->Name="npc_taskmaster_fizzule";
newscript->GetAI = &GetAI_npc_taskmaster_fizzule;
- newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains b/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains
new file mode 100644
index 00000000000..327b670c6d3
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/black_temple/.boss_teron_gorefiend.cpp-woains
@@ -0,0 +1,536 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Teron_Gorefiend
+SD%Complete: 60
+SDComment: Requires Mind Control support for Ghosts.
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+ //Speech'n'sound
+#define SAY_INTRO -1564037
+#define SAY_AGGRO -1564038
+#define SAY_SLAY1 -1564039
+#define SAY_SLAY2 -1564040
+#define SAY_SPELL1 -1564041
+#define SAY_SPELL2 -1564042
+#define SAY_SPECIAL1 -1564043
+#define SAY_SPECIAL2 -1564044
+#define SAY_ENRAGE -1564045
+#define SAY_DEATH -1564046
+
+//Spells
+#define SPELL_INCINERATE 40239
+#define SPELL_CRUSHING_SHADOWS 40243
+#define SPELL_SHADOWBOLT 40185
+#define SPELL_PASSIVE_SHADOWFORM 40326
+#define SPELL_SHADOW_OF_DEATH 40251
+#define SPELL_BERSERK 45078
+
+#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player
+
+#define CREATURE_DOOM_BLOSSOM 23123
+#define CREATURE_SHADOWY_CONSTRUCT 23111
+
+struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
+{
+ mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 CheckTeronTimer;
+ uint32 ShadowBoltTimer;
+ uint64 TeronGUID;
+
+ void Reset()
+ {
+ CheckTeronTimer = 5000;
+ ShadowBoltTimer = 12000;
+ TeronGUID = 0;
+ }
+
+ void Aggro(Unit *who) { }
+ void AttackStart(Unit* who) { }
+ void MoveInLineOfSight(Unit* who) { }
+
+ void Despawn()
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckTeronTimer < diff)
+ {
+ if(TeronGUID)
+ {
+ DoZoneInCombat();
+
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
+ Despawn();
+ }
+ else
+ Despawn();
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+
+ if(ShadowBoltTimer < diff && InCombat)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
+ ShadowBoltTimer = 10000;
+ }else ShadowBoltTimer -= diff;
+ return;
+ }
+
+ void SetTeronGUID(uint64 guid){ TeronGUID = guid; }
+};
+
+//This is used to sort the players by distance for Constructs to see who to cast Atrophy on
+struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
+{
+ const Unit* MainTarget;
+ TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
+ // functor for operator "<"
+ bool operator()(const Unit* _Left, const Unit* _Right) const
+ {
+ return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
+ }
+};
+
+struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
+{
+ mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {}
+
+ uint64 GhostGUID;
+ uint64 TeronGUID;
+
+ uint32 CheckPlayerTimer;
+ uint32 CheckTeronTimer;
+
+ void Reset()
+ {
+ GhostGUID = 0;
+ TeronGUID = 0;
+
+ CheckPlayerTimer = 2000;
+ CheckTeronTimer = 5000;
+ }
+
+ void Aggro(Unit* who) { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED
+ void DamageTaken(Unit* done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() != GhostGUID)
+ damage = 0; // Only the ghost can deal damage.
+ }
+ */
+
+ void CheckPlayers()
+ {
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ if(m_threatlist.empty())
+ return; // No threat list. Don't continue.
+ std::list<HostilReference*>::iterator itr = m_threatlist.begin();
+ std::list<Unit*> targets;
+ for( ; itr != m_threatlist.end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ targets.push_back(pUnit);
+ }
+ targets.sort(TargetDistanceOrder(m_creature));
+ Unit* target = targets.front();
+ if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ {
+ DoCast(target, SPELL_ATROPHY);
+ m_creature->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(CheckPlayerTimer < diff)
+ {
+ CheckPlayers();
+ CheckPlayerTimer = 3000;
+ }else CheckPlayerTimer -= diff;
+
+ if(CheckTeronTimer < diff)
+ {
+ Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
+ if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CheckTeronTimer = 5000;
+ }else CheckTeronTimer -= diff;
+ }
+};
+
+struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
+{
+ boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 IncinerateTimer;
+ uint32 SummonDoomBlossomTimer;
+ uint32 EnrageTimer;
+ uint32 CrushingShadowsTimer;
+ uint32 ShadowOfDeathTimer;
+ uint32 SummonShadowsTimer;
+ uint32 RandomYellTimer;
+ uint32 AggroTimer;
+
+ uint64 AggroTargetGUID;
+ uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost
+
+ bool Intro;
+
+ void Reset()
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED);
+
+ IncinerateTimer = 20000 + rand()%11000;
+ SummonDoomBlossomTimer = 12000;
+ EnrageTimer = 600000;
+ CrushingShadowsTimer = 22000;
+ SummonShadowsTimer = 60000;
+ RandomYellTimer = 50000;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ // Start off unattackable so that the intro is done properly
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ AggroTimer = 20000;
+ AggroTargetGUID = 0;
+ Intro = false;
+ }
+
+ void Aggro(Unit *who) {}
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if(!who || (!who->isAlive())) return;
+
+ if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
+ {
+ float attackRadius = m_creature->GetAttackDistance(who);
+
+ if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
+ {
+ //if(who->HasStealthAura())
+ // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+
+ m_creature->AddThreat(who, 1.0f);
+ }
+
+ if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER))
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
+
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoScriptText(SAY_INTRO, m_creature);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
+ AggroTargetGUID = who->GetGUID();
+ Intro = true;
+ }
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoScriptText(SAY_SLAY1, m_creature); break;
+ case 1: DoScriptText(SAY_SLAY2, m_creature); break;
+ }
+ }
+
+ void JustDied(Unit *victim)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE);
+
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ float CalculateRandomLocation(float Loc, uint32 radius)
+ {
+ float coord = Loc;
+ switch(rand()%2)
+ {
+ case 0:
+ coord += rand()%radius;
+ break;
+ case 1:
+ coord -= rand()%radius;
+ break;
+ }
+ return coord;
+ }
+
+ void SetThreatList(Creature* Blossom)
+ {
+ if(!Blossom) return;
+
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if(pUnit && pUnit->isAlive())
+ {
+ float threat = DoGetThreat(pUnit);
+ Blossom->AddThreat(pUnit, threat);
+ }
+ }
+ }
+
+ void MindControlGhost()
+ {
+ /************************************************************************/
+ /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/
+ /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/
+ /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/
+ /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
+ /************************************************************************/
+
+ Unit* Ghost = NULL;
+ if(GhostGUID)
+ Ghost = Unit::GetUnit((*m_creature), GhostGUID);
+ if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
+ {
+ /*float x,y,z;
+ Ghost->GetPosition(x,y,z);
+ Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
+ if(control)
+ {
+ ((Player*)Ghost)->Possess(control);
+ Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
+ false);
+ }*/
+ for(uint8 i = 0; i < 4; ++i)
+ {
+ Creature* Construct = NULL;
+ float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
+ float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
+ Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ if(Construct)
+ {
+ Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
+ SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
+ ((mob_shadowy_constructAI*)Construct->AI())->GhostGUID = GhostGUID;
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target) // someone's trying to solo.
+ target = m_creature->getVictim();
+
+ if(target)
+ Construct->GetMotionMaster()->MoveChase(target);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(Intro)
+ {
+ if(AggroTimer < diff)
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ DoScriptText(SAY_AGGRO, m_creature);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ Intro = false;
+ if(AggroTargetGUID)
+ {
+ Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
+ if(pUnit)
+ AttackStart(pUnit);
+
+ DoZoneInCombat();
+ }else EnterEvadeMode();
+
+ }else AggroTimer -= diff;
+ }
+
+ if(!UpdateVictim() || Intro)
+ return;
+
+ if(SummonShadowsTimer < diff)
+ {
+ //MindControlGhost();
+
+ for(uint8 i = 0; i < 2; ++i)
+ {
+ Creature* Shadow = NULL;
+ float X = CalculateRandomLocation(m_creature->GetPositionX(), 10);
+ Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
+ if(Shadow)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ Shadow->AI()->AttackStart(target);
+ }
+ }
+ SummonShadowsTimer = 60000;
+ }else SummonShadowsTimer -= diff;
+
+ if(SummonDoomBlossomTimer < diff)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ {
+ float X = CalculateRandomLocation(target->GetPositionX(), 20);
+ float Y = CalculateRandomLocation(target->GetPositionY(), 20);
+ float Z = target->GetPositionZ();
+ Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true);
+ Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
+ if(DoomBlossom)
+ {
+ DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoomBlossom->setFaction(m_creature->getFaction());
+ DoomBlossom->AddThreat(target, 1.0f);
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
+ ((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
+ SetThreatList(DoomBlossom);
+ SummonDoomBlossomTimer = 35000;
+ }
+ }
+ }else SummonDoomBlossomTimer -= diff;
+
+ if(IncinerateTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoScriptText(SAY_SPECIAL1, m_creature); break;
+ case 1: DoScriptText(SAY_SPECIAL2, m_creature); break;
+ }
+ DoCast(target, SPELL_INCINERATE);
+ IncinerateTimer = 20000 + rand()%31 * 1000;
+ }
+ }else IncinerateTimer -= diff;
+
+ if(CrushingShadowsTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target && target->isAlive())
+ DoCast(target, SPELL_CRUSHING_SHADOWS);
+ CrushingShadowsTimer = 10000 + rand()%16 * 1000;
+ }else CrushingShadowsTimer -= diff;
+
+ /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
+ /*if(ShadowOfDeathTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+
+ if(!target)
+ target = m_creature->getVictim();
+
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(target, SPELL_SHADOW_OF_DEATH);
+ GhostGUID = target->GetGUID();
+ ShadowOfDeathTimer = 30000;
+ SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
+ }
+ }else ShadowOfDeathTimer -= diff;*/
+
+ if(RandomYellTimer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoScriptText(SAY_SPELL1, m_creature); break;
+ case 1: DoScriptText(SAY_SPELL2, m_creature); break;
+ }
+ RandomYellTimer = 50000 + rand()%51 * 1000;
+ }else RandomYellTimer -= diff;
+
+ if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ {
+ if(EnrageTimer < diff)
+ {
+ DoCast(m_creature, SPELL_BERSERK);
+ DoScriptText(SAY_ENRAGE, m_creature);
+ }else EnrageTimer -= diff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_doom_blossom(Creature *_Creature)
+{
+ return new mob_doom_blossomAI(_Creature);
+}
+
+CreatureAI* GetAI_mob_shadowy_construct(Creature *_Creature)
+{
+ return new mob_shadowy_constructAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_teron_gorefiend(Creature *_Creature)
+{
+ return new boss_teron_gorefiendAI (_Creature);
+}
+
+void AddSC_boss_teron_gorefiend()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "mob_doom_blossom";
+ newscript->GetAI = &GetAI_mob_doom_blossom;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "mob_shadowy_construct";
+ newscript->GetAI = &GetAI_mob_shadowy_construct;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="boss_teron_gorefiend";
+ newscript->GetAI = &GetAI_boss_teron_gorefiend;
+ newscript->RegisterSelf();
+}
+
diff --git a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu
new file mode 100644
index 00000000000..43646746505
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu
@@ -0,0 +1,347 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/* ScriptData
+SDName: Instance_Black_Temple
+SD%Complete: 100
+SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts
+SDCategory: Black Temple
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_black_temple.h"
+
+#define ENCOUNTERS 9
+
+/* Black Temple encounters:
+0 - High Warlord Naj'entus event
+1 - Supremus Event
+2 - Shade of Akama Event
+3 - Teron Gorefiend Event
+4 - Gurtogg Bloodboil Event
+5 - Reliquary Of Souls Event
+6 - Mother Shahraz Event
+7 - Illidari Council Event
+8 - Illidan Stormrage Event
+*/
+
+struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
+{
+ instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();};
+
+ uint32 Encounters[ENCOUNTERS];
+ std::string str_data;
+
+ uint64 Najentus;
+ uint64 Akama; // This is the Akama that starts the Illidan encounter.
+ uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
+ uint64 ShadeOfAkama;
+ uint64 Supremus;
+ uint64 LadyMalande;
+ uint64 GathiosTheShatterer;
+ uint64 HighNethermancerZerevor;
+ uint64 VerasDarkshadow;
+ uint64 IllidariCouncil;
+ uint64 BloodElfCouncilVoice;
+ uint64 IllidanStormrage;
+
+ uint64 NajentusGate;
+ uint64 MainTempleDoors;
+ uint64 ShadeOfAkamaDoor;
+ uint64 CommonDoor;//Teron
+ uint64 TeronDoor;
+ uint64 GuurtogDoor;
+ uint64 MotherDoor;
+ uint64 TempleDoor;//Befor mother
+ uint64 CouncilDoor;
+ uint64 SimpleDoor;//council
+ uint64 IllidanGate;
+ uint64 IllidanDoor[2];
+
+ void Initialize()
+ {
+ Najentus = 0;
+ Akama = 0;
+ Akama_Shade = 0;
+ ShadeOfAkama = 0;
+ Supremus = 0;
+ LadyMalande = 0;
+ GathiosTheShatterer = 0;
+ HighNethermancerZerevor = 0;
+ VerasDarkshadow = 0;
+ IllidariCouncil = 0;
+ BloodElfCouncilVoice = 0;
+ IllidanStormrage = 0;
+
+ NajentusGate = 0;
+ MainTempleDoors = 0;
+ ShadeOfAkamaDoor= 0;
+ CommonDoor = 0;//teron
+ TeronDoor = 0;
+ GuurtogDoor = 0;
+ MotherDoor = 0;
+ TempleDoor = 0;
+ SimpleDoor = 0;//Bycouncil
+ CouncilDoor = 0;
+ IllidanGate = 0;
+ IllidanDoor[0] = 0;
+ IllidanDoor[1] = 0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ Player* GetPlayerInMap()
+ {
+ Map::PlayerList const& players = instance->GetPlayers();
+
+ if (!players.isEmpty())
+ {
+ for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ {
+ if (Player* plr = itr->getSource())
+ return plr;
+ }
+ }
+
+ debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
+ return NULL;
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature->GetEntry())
+ {
+ case 22887: Najentus = creature->GetGUID(); break;
+ case 23089: Akama = creature->GetGUID(); break;
+ case 22990: Akama_Shade = creature->GetGUID(); break;
+ case 22841: ShadeOfAkama = creature->GetGUID(); break;
+ case 22898: Supremus = creature->GetGUID(); break;
+ case 22917: IllidanStormrage = creature->GetGUID(); break;
+ case 22949: GathiosTheShatterer = creature->GetGUID(); break;
+ case 22950: HighNethermancerZerevor = creature->GetGUID(); break;
+ case 22951: LadyMalande = creature->GetGUID(); break;
+ case 22952: VerasDarkshadow = creature->GetGUID(); break;
+ case 23426: IllidariCouncil = creature->GetGUID(); break;
+ case 23499: BloodElfCouncilVoice = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ switch(go->GetEntry())
+ {
+ case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards)
+ if(Encounters[0] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus)
+ if(Encounters[1] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185478: ShadeOfAkamaDoor = go->GetGUID();break;
+ case 185480: CommonDoor = go->GetGUID();
+ if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break;
+ case 186153: TeronDoor = go->GetGUID();
+ if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break;
+ case 185892: GuurtogDoor = go->GetGUID();
+ if(Encounters[4] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185479: TempleDoor = go->GetGUID();
+ if(Encounters[5] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185482: MotherDoor = go->GetGUID();
+ if(Encounters[6] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185481: CouncilDoor = go->GetGUID();
+ if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break;
+ case 186152: SimpleDoor = go->GetGUID();
+ if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break;
+ case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit
+ case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit
+ case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit
+ }
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_HIGHWARLORDNAJENTUS: return Najentus;
+ case DATA_AKAMA: return Akama;
+ case DATA_AKAMA_SHADE: return Akama_Shade;
+ case DATA_SHADEOFAKAMA: return ShadeOfAkama;
+ case DATA_SUPREMUS: return Supremus;
+ case DATA_ILLIDANSTORMRAGE: return IllidanStormrage;
+ case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer;
+ case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor;
+ case DATA_LADYMALANDE: return LadyMalande;
+ case DATA_VERASDARKSHADOW: return VerasDarkshadow;
+ case DATA_ILLIDARICOUNCIL: return IllidariCouncil;
+ case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate;
+ case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate;
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0];
+ case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1];
+ case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors;
+ case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT:
+ if(data == DONE)
+ {
+ HandleGameObject(NajentusGate, true);
+ }
+ Encounters[0] = data;break;
+ case DATA_SUPREMUSEVENT:
+ if(data == DONE)
+ {
+ HandleGameObject(NajentusGate, true);
+ }
+ Encounters[1] = data; break;
+ case DATA_SHADEOFAKAMAEVENT:
+ if(data == IN_PROGRESS)
+ {
+ HandleGameObject(ShadeOfAkamaDoor, false);
+ }else HandleGameObject(ShadeOfAkamaDoor, true);
+ Encounters[2] = data; break;
+ case DATA_TERONGOREFIENDEVENT:
+ if(data == IN_PROGRESS)
+ {
+ HandleGameObject(TeronDoor, false);
+ HandleGameObject(CommonDoor, false);
+ }else
+ {
+ HandleGameObject(TeronDoor, true);
+ HandleGameObject(CommonDoor, true);
+ }
+ Encounters[3] = data; break;
+ case DATA_GURTOGGBLOODBOILEVENT:
+ if(data == DONE)
+ {
+ HandleGameObject(GuurtogDoor, true);
+ }
+ Encounters[4] = data; break;
+ case DATA_RELIQUARYOFSOULSEVENT:
+ if(data == DONE)
+ {
+ HandleGameObject(TempleDoor, true);
+ }
+ Encounters[5] = data; break;
+ case DATA_MOTHERSHAHRAZEVENT:
+ if(data == DONE)
+ {
+ HandleGameObject(MotherDoor, true);
+ }
+ Encounters[6] = data; break;
+ case DATA_ILLIDARICOUNCILEVENT:
+ if(data == IN_PROGRESS)
+ {
+ HandleGameObject(CouncilDoor, false);
+ HandleGameObject(SimpleDoor, false);
+ }else
+ {
+ HandleGameObject(CouncilDoor, true);
+ HandleGameObject(SimpleDoor, true);
+ }
+ Encounters[7] = data; break;
+ case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break;
+ }
+
+ if (data == DONE)
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << Encounters[0] << " " << Encounters[1] << " "
+ << Encounters[2] << " " << Encounters[3] << " " << Encounters[4]
+ << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7]
+ << " " << Encounters[8];
+
+ str_data = saveStream.str();
+
+ SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0];
+ case DATA_SUPREMUSEVENT: return Encounters[1];
+ case DATA_SHADEOFAKAMAEVENT: return Encounters[2];
+ case DATA_TERONGOREFIENDEVENT: return Encounters[3];
+ case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4];
+ case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5];
+ case DATA_MOTHERSHAHRAZEVENT: return Encounters[6];
+ case DATA_ILLIDARICOUNCILEVENT: return Encounters[7];
+ case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8];
+ }
+
+ return 0;
+ }
+
+ const char* Save()
+ {
+ return str_data.c_str();
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ std::istringstream loadStream(in);
+ loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2]
+ >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6]
+ >> Encounters[7] >> Encounters[8];
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if (Encounters[i] == IN_PROGRESS)
+ Encounters[i] = NOT_STARTED;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_black_temple(Map* map)
+{
+ return new instance_black_temple(map);
+}
+
+void AddSC_instance_black_temple()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_black_temple";
+ newscript->GetInstanceData = &GetInstanceData_instance_black_temple;
+ newscript->RegisterSelf();
+}
+
diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
index da9b20ef63e..738c58eab2e 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
index 656496c268f..b181f50f69b 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
FelAcidTimer = 25000;
}else FelAcidTimer -= diff;
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(!m_creature->HasAura(SPELL_BERSERK))
{
if(EnrageTimer < diff)
{
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
index 4b0190c1dd5..6d36e208a70 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -137,6 +137,9 @@ EndScriptData */
#define FLAME_ENRAGE_DISTANCE 30
#define FLAME_CHARGE_DISTANCE 50
+#define ITEM_ID_MAIN_HAND 32837
+#define ITEM_ID_OFF_HAND 32838
+
/**** Creature Summon and Recognition IDs ****/
enum CreatureEntry
{
@@ -365,6 +368,10 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
+
+ SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHADOWFIEND_PASSIVE);
+ if(TempSpell)
+ TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends
}
ScriptedInstance* pInstance;
@@ -454,7 +461,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
{
GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(i));
if(Door)
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0); // Open Doors
+ Door->SetGoState(0); // Open Doors
}
}
@@ -487,10 +494,10 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
{
if(spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
{
- if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY))
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479);
+ if(!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 45479);
else
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 45481);
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
}
}
@@ -524,7 +531,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(Conversation[count].emote)
creature->HandleEmoteCommand(Conversation[count].emote); // Make the creature do some animation!
if(Conversation[count].text)
- creature->Yell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
+ creature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the creature yell out some text
if(Conversation[count].sound)
DoPlaySoundToSet(creature, Conversation[count].sound); // Play some sound on the creature
}
@@ -567,8 +574,8 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
Timer[EVENT_FLIGHT_SEQUENCE] = 700;
break;
case 4://throw another
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
{
uint8 i=0;
Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -653,14 +660,14 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(DemonTransformation[TransformCount].equip)
{
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Requip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 45479); // Requip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 45481);
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
}
else
{
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); // Unequip warglaives if needed
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 0); // Unequip warglaives if needed
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
switch(TransformCount)
@@ -741,7 +748,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(m_creature->IsNonMeleeSpellCasted(false))
return;
- if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
+ if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED))
{
switch(Event)
{
@@ -926,7 +933,7 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
AttackStart(m_creature->getVictim());
}
}
- else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
+ else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL))
{
Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
@@ -998,10 +1005,10 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ Gate->SetGoState(1);
for(uint8 i = 0; i < 2; i++)
if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ Door->SetGoState(1);
}
else
{
@@ -1071,7 +1078,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
for(uint8 i = 0; i < 2; i++)
if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 1);
+ Door->SetGoState(1);
if(GETCRE(Illidan, IllidanGUID))
{
@@ -1186,7 +1193,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
if(GETCRE(Illidan, IllidanGUID))
{
((boss_illidan_stormrageAI*)Illidan->AI())->Timer[EVENT_TAUNT] += 30000;
- Illidan->Yell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
+ Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION);
}
Timer = 8000;
@@ -1237,7 +1244,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
Spirit[0]->InterruptNonMeleeSpells(true);
Spirit[1]->InterruptNonMeleeSpells(true);
if(GETGO(Gate, GateGUID))
- Gate->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ Gate->SetGoState(0);
Timer = 2000;
break;
case 4:
@@ -1268,7 +1275,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
case 6:
for(uint8 i = 0; i < 2; i++)
if(GETGO(Door, DoorGUID[i]))
- Door->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ Door->SetGoState(0);
break;
case 8:
if(Phase == PHASE_WALK)
@@ -1378,9 +1385,9 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
Timer[EVENT_MAIEV_STEALTH] = 0;
Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000;
Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 44850);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 2, 45738);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 44850);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738);
}
void Aggro(Unit *who) {}
@@ -1618,12 +1625,12 @@ struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
{
if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
{
- if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
+ if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED)))
{
IllidanGUID = who->GetGUID();
who->CastSpell(who, SPELL_CAGED, true);
DespawnTimer = 5000;
- if(who->HasAura(SPELL_ENRAGE, 0))
+ if(who->HasAura(SPELL_ENRAGE))
who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
//if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
// CageTrap->SetLootState(GO_JUST_DEACTIVATED);
@@ -1663,7 +1670,7 @@ bool GOHello_cage_trap(Player* plr, GameObject* go)
// Grid search for nearest live creature of entry 23304 within 10 yards
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck check(*plr, 23304, true, 10);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(trigger, check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(plr, trigger, check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> cSearcher(searcher);
@@ -1671,7 +1678,7 @@ bool GOHello_cage_trap(Player* plr, GameObject* go)
cell_lock->Visit(cell_lock, cSearcher, *(plr->GetMap()));
((cage_trap_triggerAI*)trigger->AI())->Active = true;
- go->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ go->SetGoState(0);
return true;
}
@@ -1701,7 +1708,7 @@ struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
- if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
+ if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE))
{
TargetGUID = m_creature->getVictim()->GetGUID();
m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
@@ -1743,8 +1750,8 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
{
if( m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
- if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
- && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
+ if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
+ && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
}
@@ -1834,8 +1841,8 @@ void boss_illidan_stormrageAI::Reset()
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT);
m_creature->setActive(false);
Summons.DespawnAll();
@@ -1855,8 +1862,8 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
return;
}
Unit *target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true);
- if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
- || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
+ if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND)
+ || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true);
if(target)
summon->AI()->AttackStart(target);
@@ -1892,8 +1899,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
case 8:
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 45479); // Equip our warglaives!
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 45481);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 45479); // Equip our warglaives!
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 45481);
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
@@ -1953,7 +1960,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
{
Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
Maiev->setDeathState(JUST_DIED);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
break;
case 21: // Kill ourself.
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
index 4b63b092c53..e459e1aa687 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
}else SaberTimer -= diff;
//Enrage
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(!m_creature->HasAura(SPELL_BERSERK))
if(EnrageTimer < diff)
{
DoCast(m_creature, SPELL_BERSERK);
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
index 76aa7196300..353a16fe0e7 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
index 21227969cdf..00358be80f3 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -291,7 +291,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
++DeathCount;
- m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
+ m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
if(guid)
{
if(Sorcerers.empty())
@@ -346,7 +346,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
std::list<Creature*> ChannelerList;
Trinity::AllCreaturesOfEntryInRange check(m_creature, CREATURE_CHANNELER, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(ChannelerList, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, ChannelerList, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
index 994f3d500ad..0985e7b61e3 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
@@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
if (!UpdateVictim())
return;
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(!m_creature->HasAura(SPELL_BERSERK))
{
if(BerserkTimer < diff)
DoCast(m_creature, SPELL_BERSERK);
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
}
else if(Eruption && ((boss_supremusAI*)Supremus->AI())->Phase1)
{
- m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0);
+ m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION);
}
CheckTimer = 1500;
}else CheckTimer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
index a1800a4a951..33a0f20a23e 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
Despawn();
CheckTeronTimer = 5000;
- }else CheckTeronTimer -= diff;
+ }else CheckTeronTimer -= diff;
if(ShadowBoltTimer < diff && InCombat)
{
@@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
Unit* Ghost = NULL;
if(GhostGUID)
Ghost = Unit::GetUnit((*m_creature), GhostGUID);
- if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
+ if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
{
/*float x,y,z;
Ghost->GetPosition(x,y,z);
@@ -487,7 +487,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
RandomYellTimer = 50000 + rand()%51 * 1000;
}else RandomYellTimer -= diff;
- if(!m_creature->HasAura(SPELL_BERSERK, 0))
+ if(!m_creature->HasAura(SPELL_BERSERK))
{
if(EnrageTimer < diff)
{
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
index 538c94decf2..9233cc53fca 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
+ if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD))
{
m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
@@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
{
if(!SpineTargetGUID) return false;
Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
- if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
+ if(target && target->HasAura(SPELL_IMPALING_SPINE))
target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
SpineTargetGUID=0;
return true;
@@ -154,7 +154,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
SelectUnitList(target, 3, SELECT_TARGET_RANDOM, 80, true);
for(std::list<Unit*>::iterator i = target.begin(); i != target.end(); ++i)
m_creature->CastSpell(*i, 39835, true);
- NeedleSpineTimer = 20000+rand()%5000;
+ NeedleSpineTimer = 2000+rand()%1000;
}else NeedleSpineTimer -= diff;
if(SpecialYellTimer < diff)
@@ -199,7 +199,7 @@ bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
{
player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
_GO->SetLootState(GO_NOT_READY);
- _GO->SetRespawnTime(0);
+ _GO->Delete();
}
return true;
}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
index 0d5bb184792..4779f92fa4d 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
+++ b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
index bbf1c600f59..3c063ff30c5 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
index 80a749faa12..43646746505 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -42,6 +42,9 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
{
instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();};
+ uint32 Encounters[ENCOUNTERS];
+ std::string str_data;
+
uint64 Najentus;
uint64 Akama; // This is the Akama that starts the Illidan encounter.
uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter.
@@ -68,9 +71,6 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
uint64 IllidanGate;
uint64 IllidanDoor[2];
- uint32 Encounters[ENCOUNTERS];
- std::string str_data;
-
void Initialize()
{
Najentus = 0;
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 22887: Najentus = creature->GetGUID(); break;
case 23089: Akama = creature->GetGUID(); break;
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
index b16add3e46a..fa1b86da5c8 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
index b0c4bafb290..bf698aff507 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
index ad9330528b9..7cc38998a9e 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
index 978f4d8e9d7..e5b279d65ef 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,12 +23,12 @@ EndScriptData */
#include "precompiled.h"
+#define SAY_AGGRO -1230001
+#define SAY_SLAY -1230002
+
#define SPELL_HANDOFTHAURISSAN 17492
#define SPELL_AVATAROFFLAME 15636
-#define SAY_AGGRO "Come to aid the Throne!"
-#define SAY_SLAY "Hail to the king, baby!"
-
struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
{
boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {}
@@ -46,12 +46,12 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoScriptText(SAY_AGGRO, m_creature);
}
void KilledUnit(Unit* victim)
{
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
+ DoScriptText(SAY_SLAY, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -62,9 +62,8 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
if (HandOfThaurissan_Timer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_HANDOFTHAURISSAN);
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(target,SPELL_HANDOFTHAURISSAN);
//3 Hands of Thaurissan will be casted
//if (Counter < 3)
@@ -89,6 +88,7 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_boss_draganthaurissan(Creature *_Creature)
{
return new boss_draganthaurissanAI (_Creature);
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
index 80df7fec20b..c0ea7cac901 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
index 25367c6f4dd..3fd45e6eed7 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
index 389b2bc5b4d..df109c24001 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,6 +23,8 @@ EndScriptData */
#include "precompiled.h"
+#define EMOTE_GENERIC_FRENZY_KILL -1000001
+
#define SPELL_GROUNDTREMOR 6524
#define SPELL_FRENZY 28371
@@ -62,7 +64,7 @@ struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
if (Frenzy_Timer < diff)
{
DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 15000;
}else Frenzy_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
index 422f0f25532..5921cc8419a 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
index 25f7f890e3f..c4230b5f557 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
index 26c72404355..bc90aeb17cf 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp
index 2d5615779a7..e056f732158 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
index 45e5184e1d3..69ca2482357 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
index 09656309e5c..919643a34e9 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
index 61ce2ea2cc4..81e872b1ffa 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
index 6069bad85ed..79ebd4fa098 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
index 7188ae17770..c2df5796f48 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
index 85113c9a1ab..ecb0a71db82 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -103,8 +103,10 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
target = SelectUnit(SELECT_TARGET_RANDOM,0);
SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ if(SummonedCreature)
((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000);
+ if(SummonedCreature)
((CreatureAI*)SummonedCreature->AI())->AttackStart(target);
Summoned = true;
}
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
index ea320b40b4d..532a719bbe3 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
index b4b14ac5f89..af158d97de6 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
index ee41701667b..d43de67fa56 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
index 7a1080226ea..6563aa8a929 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
index 6eead9d4162..c9ba2a77921 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
index 625bbc0d28a..d701edc6d40 100644
--- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
+++ b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
index 5c0b2a8d2f2..b59be12f8eb 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
index 8e89a3aeed4..4e54fe2ce35 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -258,11 +258,11 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
DoCast(pUnit, SpellAfflict, true);
//Chromatic mutation if target is effected by all afflictions
- if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
- && pUnit->HasAura(SPELL_BROODAF_BLACK,0)
- && pUnit->HasAura(SPELL_BROODAF_RED,0)
- && pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
- && pUnit->HasAura(SPELL_BROODAF_GREEN,0))
+ if (pUnit->HasAura(SPELL_BROODAF_BLUE)
+ && pUnit->HasAura(SPELL_BROODAF_BLACK)
+ && pUnit->HasAura(SPELL_BROODAF_RED)
+ && pUnit->HasAura(SPELL_BROODAF_BRONZE)
+ && pUnit->HasAura(SPELL_BROODAF_GREEN))
{
//target->RemoveAllAuras();
//DoCast(target,SPELL_CHROMATIC_MUT_1);
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
index c30485ac327..54348dd86c4 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
ShadowOfEbonroc_Timer = 25000 + rand()%10000;
}else ShadowOfEbonroc_Timer -= diff;
- if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
+ if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
{
if (Heal_Timer < diff)
{
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
index 64a01b228f0..dfae4f31662 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
index 49dfdaa896f..def9af062be 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
index d91714c0246..4abe9265828 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
index 1da3fb554df..ff29427664f 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
}else Conflagration_Timer -= diff;
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
- if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION,0))
+ if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION))
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,1);
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
index f0048e7a4fa..c8fecdae893 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
index ea6751605c0..03543bf9874 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
index ddd9e8b9aa3..97bf717589a 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
index 3617ae8cc14..03c3a57568c 100644
--- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Blades_Edge_Mountains
SD%Complete: 90
-SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
+SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
SDCategory: Blade's Edge Mountains
EndScriptData */
@@ -28,10 +28,20 @@ npc_daranelle
npc_overseer_nuaar
npc_saikkal_the_elder
npc_skyguard_handler_irena
+go_legion_obelisk
EndContentData */
#include "precompiled.h"
+//Support for quest: You're Fired! (10821)
+bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
+
+#define LEGION_OBELISK_ONE 185193
+#define LEGION_OBELISK_TWO 185195
+#define LEGION_OBELISK_THREE 185196
+#define LEGION_OBELISK_FOUR 185197
+#define LEGION_OBELISK_FIVE 185198
+
/*######
## mobs_bladespire_ogre
######*/
@@ -96,14 +106,9 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
void Reset()
{
- NihilSpeech_Timer = 2000;
IsNihil = false;
- if( m_creature->GetEntry() == ENTRY_NIHIL )
- {
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- IsNihil = true;
- }
- NihilSpeech_Phase = 1;
+ NihilSpeech_Timer = 3000;
+ NihilSpeech_Phase = 0;
ArcaneBlast_Timer = 7500;
ManaBurn_Timer = 10000;
@@ -112,138 +117,115 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
void Aggro(Unit* who) { }
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ return;
+
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ //in case creature was not summoned (not expected)
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 0)
+ {
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->RemoveCorpse();
+ m_creature->SetHealth(0);
+ }
+ }
+
void SpellHit(Unit *caster, const SpellEntry *spell)
{
- if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
+ if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
{
- uint32 cEntry = 0;
+ const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL};
+ int cid = rand()%(4-1);
+
+ if (entry_list[cid] == m_creature->GetEntry())
+ ++cid;
- switch( m_creature->GetEntry() )
+ //we are nihil, so say before transform
+ if (m_creature->GetEntry() == ENTRY_NIHIL)
{
- case ENTRY_WHELP:
- switch(rand()%4)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- case 3: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_PROTO:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_ADOLE; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_ADOLE:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_MATUR; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_MATUR:
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_NIHIL; break;
- }
- break;
- case ENTRY_NIHIL:
- if( NihilSpeech_Phase )
- {
- DoScriptText(SAY_NIHIL_INTERRUPT, m_creature);
- IsNihil = false;
- switch(rand()%3)
- {
- case 0: cEntry = ENTRY_PROTO; break;
- case 1: cEntry = ENTRY_ADOLE; break;
- case 2: cEntry = ENTRY_MATUR; break;
- }
- }
- break;
+ DoScriptText(SAY_NIHIL_INTERRUPT, m_creature);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = false;
}
- if( cEntry )
+ if (m_creature->UpdateEntry(entry_list[cid]))
{
- m_creature->UpdateEntry(cEntry);
-
- if( cEntry == ENTRY_NIHIL )
+ if (entry_list[cid] == ENTRY_NIHIL)
{
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- InCombat = false;
- Reset();
- }
+ EnterEvadeMode();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ IsNihil = true;
+ }else
+ AttackStart(caster);
}
}
}
void UpdateAI(const uint32 diff)
{
- if( IsNihil )
+ if (IsNihil)
{
- if( NihilSpeech_Phase )
+ if (NihilSpeech_Timer <= diff)
{
- if(NihilSpeech_Timer <= diff)
+ switch(NihilSpeech_Phase)
{
- switch( NihilSpeech_Phase )
- {
- case 1:
- DoScriptText(SAY_NIHIL_1, m_creature);
- ++NihilSpeech_Phase;
- break;
- case 2:
- DoScriptText(SAY_NIHIL_2, m_creature);
- ++NihilSpeech_Phase;
- break;
- case 3:
- DoScriptText(SAY_NIHIL_3, m_creature);
- ++NihilSpeech_Phase;
- break;
- case 4:
- DoScriptText(SAY_NIHIL_4, m_creature);
- ++NihilSpeech_Phase;
- break;
- case 5:
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // + MOVEMENTFLAG_LEVITATING
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
- //then take off to random location. creature is initially summoned, so don't bother do anything else.
- m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
- NihilSpeech_Phase = 0;
- break;
- }
- NihilSpeech_Timer = 5000;
- }else NihilSpeech_Timer -=diff;
- }
- return; //anything below here is not interesting for Nihil, so skip it
+ case 0:
+ DoScriptText(SAY_NIHIL_1, m_creature);
+ ++NihilSpeech_Phase;
+ break;
+ case 1:
+ DoScriptText(SAY_NIHIL_2, m_creature);
+ ++NihilSpeech_Phase;
+ break;
+ case 2:
+ DoScriptText(SAY_NIHIL_3, m_creature);
+ ++NihilSpeech_Phase;
+ break;
+ case 3:
+ DoScriptText(SAY_NIHIL_4, m_creature);
+ ++NihilSpeech_Phase;
+ break;
+ case 4:
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ //take off to location above
+ m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+50.0f, m_creature->GetPositionY(), m_creature->GetPositionZ()+50.0f);
+ ++NihilSpeech_Phase;
+ break;
+ }
+ NihilSpeech_Timer = 5000;
+ }else NihilSpeech_Timer -=diff;
+
+ //anything below here is not interesting for Nihil, so skip it
+ return;
}
- if( !UpdateVictim() )
+ if (!UpdateVictim() )
return;
- if( IntangiblePresence_Timer <= diff )
+ if (IntangiblePresence_Timer <= diff)
{
DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
IntangiblePresence_Timer = 15000+rand()%15000;
}else IntangiblePresence_Timer -= diff;
- if( ManaBurn_Timer <= diff )
+ if (ManaBurn_Timer <= diff)
{
Unit* target = m_creature->getVictim();
- if( target && target->getPowerType() == POWER_MANA )
+ if (target && target->getPowerType() == POWER_MANA)
DoCast(target,SPELL_MANA_BURN);
ManaBurn_Timer = 8000+rand()%8000;
}else ManaBurn_Timer -= diff;
- if( ArcaneBlast_Timer <= diff )
+ if (ArcaneBlast_Timer <= diff)
{
DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 2500+rand()%5000;
@@ -252,6 +234,7 @@ struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
{
return new mobs_nether_drakeAI (_Creature);
@@ -261,27 +244,23 @@ CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
## npc_daranelle
######*/
-#define SAY_DARANELLE -1000401
+#define SAY_SPELL_INFLUENCE -1000174
struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
{
npc_daranelleAI(Creature *c) : ScriptedAI(c) {}
- void Reset()
- {
- }
+ void Reset() { }
- void Aggro(Unit* who)
- {
- }
+ void Aggro(Unit* who) { }
void MoveInLineOfSight(Unit *who)
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
- if(who->HasAura(36904,0))
+ if (who->HasAura(36904) && m_creature->IsWithinDistInMap(who, 10.0f))
{
- DoScriptText(SAY_DARANELLE, m_creature, who);
+ DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
//TODO: Move the below to updateAI and run if this statement == true
((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
((Player*)who)->RemoveAurasDueToSpell(36904);
@@ -301,12 +280,10 @@ CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
## npc_overseer_nuaar
######*/
-#define GOSSIP_HON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition."
-
bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
{
if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_HON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
@@ -327,13 +304,10 @@ bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32
## npc_saikkal_the_elder
######*/
-#define GOSSIP_HSTE "Yes... yes, it's me."
-#define GOSSIP_SSTE "Yes elder. Tell me more of the book."
-
bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
{
if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_HSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
@@ -345,7 +319,7 @@ bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uin
switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_SSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
@@ -380,18 +354,54 @@ bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
-
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = 172; //from ogri'la
- nodes[1] = 171; //end at skettis
- player->ActivateTaxiPathTo(nodes); //TaxiPath 706
+ player->CastSpell(player,41278,true); //TaxiPath 706
}
return true;
}
/*######
+## go_legion_obelisk
+######*/
+
+bool GOHello_go_legion_obelisk(Player *player, GameObject* _GO)
+{
+ if ( player->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE )
+ {
+ switch( _GO->GetEntry() )
+ {
+ case LEGION_OBELISK_ONE:
+ obelisk_one = true;
+ break;
+ case LEGION_OBELISK_TWO:
+ obelisk_two = true;
+ break;
+ case LEGION_OBELISK_THREE:
+ obelisk_three = true;
+ break;
+ case LEGION_OBELISK_FOUR:
+ obelisk_four = true;
+ break;
+ case LEGION_OBELISK_FIVE:
+ obelisk_five = true;
+ break;
+ }
+
+ if ( obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true )
+ {
+ _GO->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
+ //reset global var
+ obelisk_one = false;
+ obelisk_two = false;
+ obelisk_three = false;
+ obelisk_four = false;
+ obelisk_five = false;
+ }
+ }
+
+ return true;
+}
+
+/*######
## AddSC
######*/
@@ -425,6 +435,11 @@ void AddSC_blades_edge_mountains()
newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="go_legion_obelisk";
+ newscript->pGOHello = &GOHello_go_legion_obelisk;
+ newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_skyguard_handler_irena";
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
index 954792a1044..432633e90fe 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
index f186a58252c..7516930285e 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/boss_kruul.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
index e7ce3b95c42..79d7b19e108 100644
--- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -81,7 +81,7 @@ CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
{
- if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
+ if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp
new file mode 100644
index 00000000000..c776c1f9271
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp
@@ -0,0 +1,105 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Borean_Tundra
+SD%Complete: 100
+SDComment:
+SDCategory: Borean Tundra
+EndScriptData */
+
+/* ContentData
+npc_tiare
+npc_surristrasz
+EndContentData */
+
+#include "precompiled.h"
+
+/*######
+## npc_tiare
+######*/
+
+#define GOSSIP_ITEM_TELEPORT "Teleport me to Amber Ledge, please."
+
+bool GossipHello_npc_tiare(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP);
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_tiare(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_OPTION_GOSSIP)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,50135,true);
+ }
+ return true;
+}
+
+/*######
+## npc_surristrasz
+######*/
+
+#define GOSSIP_ITEM_FREE_FLIGHT "I'd like passage to the Transitus Shield."
+#define GOSSIP_ITEM_FLIGHT "May I use a drake to fly elsewhere?"
+
+bool GossipHello_npc_surristrasz(Player *player, Creature *_Creature)
+{
+ if (_Creature->isQuestGiver())
+ player->PrepareQuestMenu(_Creature->GetGUID());
+
+ if (_Creature->isTaxi())
+ {
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_FREE_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP);
+ player->ADD_GOSSIP_ITEM(2, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_TAXIVENDOR);
+ }
+
+ player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_surristrasz(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_OPTION_GOSSIP)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->CastSpell(player,46064,true); //TaxiPath 795 (amber to coldarra)
+ }
+ if (action == GOSSIP_OPTION_TAXIVENDOR)
+ {
+ player->GetSession()->SendTaxiMenu(_Creature);
+ }
+ return true;
+}
+
+void AddSC_borean_tundra()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_tiare";
+ newscript->pGossipHello = &GossipHello_npc_tiare;
+ newscript->pGossipSelect = &GossipSelect_npc_tiare;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_surristrasz";
+ newscript->pGossipHello = &GossipHello_npc_surristrasz;
+ newscript->pGossipSelect = &GossipSelect_npc_surristrasz;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
index 0458e495959..b16b6551c78 100644
--- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
+++ b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if( who->HasAura(16468,0) )
+ if( who->HasAura(16468) )
{
if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) )
{
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
new file mode 100644
index 00000000000..de2ff9b93fd
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp
@@ -0,0 +1,86 @@
+/* Script Data Start
+SDName: Boss epoch
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CURSE_OF_EXERTION 52772
+#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec.
+#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec.
+#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank
+#define SPELL_WOUNDING_STRIKE_H 58830
+
+//Say
+#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own."
+#define SAY_AGGRO -1595001 //"We'll see about that, young prince."
+#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..."
+#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!"
+#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. "
+#define SAY_SLAY_1 -1595005 //"There is no future for you."
+#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!"
+#define SAY_SLAY_3 -1595007 //"You were destined to fail. "
+#define SAY_DEATH -1595008 //"*gurgles*"
+
+struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI
+{
+ boss_epochAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0:DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1:DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2:DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_epoch(Creature *_Creature)
+{
+ return new boss_epochAI (_Creature);
+}
+
+void AddSC_boss_epoch()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_epoch";
+ newscript->GetAI = GetAI_boss_epoch;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
new file mode 100644
index 00000000000..12cbb5f27a3
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp
@@ -0,0 +1,123 @@
+/* Script Data Start
+SDName: Boss mal_ganis
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_mal_ganis' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec.
+#define SPELL_CARRION_SWARM_H 58852
+#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy.
+#define SPELL_MIND_BLAST_H 58850
+#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target.
+#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack.
+
+//Yell Mal'ganis
+#define SAY_INTRO_1 -1595009
+#define SAY_INTRO_2 -1595010
+#define SAY_OUTRO -1595011
+#define SAY_AGGRO -1595012
+#define SAY_KILL_1 -1595013
+#define SAY_KILL_2 -1595014
+#define SAY_KILL_3 -1595015
+#define SAY_SLAY_1 -1595016
+#define SAY_SLAY_2 -1595017
+#define SAY_SLAY_3 -1595018
+#define SAY_SLAY_4 -1595019
+#define SAY_SLEEP_1 -1595020
+#define SAY_SLEEP_2 -1595021
+#define SAY_30HEALTH -1595022
+#define SAY_15HEALTH -1595023
+#define SAY_ESCAPE_SPEECH_1 -1595024
+#define SAY_ESCAPE_SPEECH_2 -1595025
+
+struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI
+{
+ boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {}
+
+ bool yelled,
+ yelled2,
+ yelled3;
+
+ void Reset()
+ {
+ yelled = false;
+ yelled2 = false;
+ yelled3 = false;
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if(!yelled)
+ {
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30)
+ {
+ DoScriptText(SAY_30HEALTH, m_creature);
+ yelled = true;
+ }
+ }
+
+ if(!yelled2)
+ {
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15)
+ {
+ DoScriptText(SAY_15HEALTH, m_creature);
+ yelled2 = true;
+ }
+ }
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1)
+ {
+ //Handle Escape Event
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%4)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ case 3: DoScriptText(SAY_SLAY_4, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_mal_ganis(Creature *_Creature)
+{
+ return new boss_mal_ganisAI (_Creature);
+}
+
+void AddSC_boss_mal_ganis()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_mal_ganis";
+ newscript->GetAI = GetAI_boss_mal_ganis;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
new file mode 100644
index 00000000000..187889cb053
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp
@@ -0,0 +1,138 @@
+/* Script Data Start
+SDName: Boss meathook
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_meathook' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spell
+#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec.
+#define SPELL_CONSTRICTING_CHAINS_H 58823
+#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec.
+#define SPELL_DISEASE_EXPULSION_H 58824
+#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec.
+
+//Yell
+#define SAY_AGGRO -1595026
+#define SAY_SLAY_1 -1595027
+#define SAY_SLAY_2 -1595028
+#define SAY_SLAY_3 -1595029
+#define SAY_SPAWN -1595030
+#define SAY_DEATH -1595031
+
+struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI
+{
+ boss_meathookAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Chain_Timer,
+ Disease_Timer,
+ Frenzy_Timer;
+
+ void Reset()
+ {
+ Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16
+ Disease_Timer = 2000 + rand()%1000; //approx 3s
+ Frenzy_Timer = 20000 + rand()%10000; //made it up
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void AttackStart(Unit* who) {}
+
+ std::list <Unit*>pList;
+ void MoveInLineOfSight(Unit* who, const uint32 diff)
+ {
+ /*if (m_creature->isHostileTo(who))
+ {
+ pList.append(who);
+ }*/
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if(Disease_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N);
+ Disease_Timer = 1500 + rand()%2500;
+ }else Disease_Timer -= diff;
+
+ if(Frenzy_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_FRENZY);
+ Frenzy_Timer = 20000 + rand()%10000;
+ }else Frenzy_Timer -= diff;
+
+ if(Chain_Timer < diff)
+ {
+
+ /*
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator itr;
+
+ int st=0;
+ for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr)
+ {
+ //st++;
+ m_creature->getThreatManager().
+ }
+ Unit* targets[st];
+ int st2=0;
+ for(int i=1; i<=st; i++){
+ if(!IsWithinLOSInMap(targets[i])
+ st2++;
+ }
+ Unit* targets_out_of_LOS[st2];*/
+
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank
+ Chain_Timer = 2000 + rand()%1000;
+ }else Chain_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_meathook(Creature *_Creature)
+{
+ return new boss_meathookAI (_Creature);
+}
+
+void AddSC_boss_meathook()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_meathook";
+ newscript->GetAI = GetAI_boss_meathook;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
new file mode 100644
index 00000000000..7226a1304dc
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp
@@ -0,0 +1,152 @@
+/* Script Data Start
+SDName: Boss salramm
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_salramm' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CURSE_OF_TWISTED_FLESH 58845
+#define SPELL_EXPLODE_GHOUL_N 52480
+#define SPELL_EXPLODE_GHOUL_H 58825
+#define SPELL_SHADOW_BOLT_N 57725
+#define SPELL_SHADOW_BOLT_H 58828
+#define SPELL_STEAL_FLESH 52708
+#define SPELL_SUMMON_GHOULS 52451
+
+//Yell
+#define SAY_AGGRO -1595032
+#define SAY_SPAWN -1595033
+#define SAY_SLAY_1 -1595034
+#define SAY_SLAY_2 -1595035
+#define SAY_SLAY_3 -1595036
+#define SAY_DEATH -1595037
+#define SAY_EXPLODE_GHOUL_1 -1595038
+#define SAY_EXPLODE_GHOUL_2 -1595039
+#define SAY_STEAL_FLESH_1 -1595040
+#define SAY_STEAL_FLESH_2 -1595041
+#define SAY_STEAL_FLESH_3 -1595042
+#define SAY_SUMMON_GHOULS_1 -1595043
+#define SAY_SUMMON_GHOULS_2 -1595044
+
+struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI
+{
+ boss_salrammAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Curse_flesh_Timer,
+ Explode_ghoul_Timer,
+ Shadow_bolt_Timer,
+ Steal_flesh_Timer,
+ Summon_ghouls_Timer;
+
+ void Reset()
+ {
+ Curse_flesh_Timer = 30000; //30s DBM
+ Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls
+ Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s
+ Steal_flesh_Timer = 12345;
+ Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro
+ }
+
+ void Aggro(Unit* who)
+ {DoScriptText(SAY_AGGRO, m_creature);}
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+
+ //Curse of twisted flesh timer
+ if (Curse_flesh_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH);
+ Curse_flesh_Timer = 37000;
+ }else Curse_flesh_Timer -= diff;
+
+ //Shadow bolt timer
+ if (Shadow_bolt_Timer < diff)
+ {
+ DoCast(random_target,SPELL_SHADOW_BOLT_N);
+ Shadow_bolt_Timer = 8000 + rand()%4000;
+ }else Shadow_bolt_Timer -= diff;
+
+ //Steal Flesh timer
+ if (Steal_flesh_Timer < diff)
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ DoScriptText(SAY_STEAL_FLESH_1, m_creature);
+ break;
+ case 1:
+ DoScriptText(SAY_STEAL_FLESH_2, m_creature);
+ break;
+ case 2:
+ DoScriptText(SAY_STEAL_FLESH_3, m_creature);
+ break;
+ }
+ DoCast(random_target,SPELL_STEAL_FLESH);
+ Steal_flesh_Timer = 10000;
+ }else Steal_flesh_Timer -= diff;
+
+ //Summon ghouls timer
+ if (Summon_ghouls_Timer < diff)
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ DoScriptText(SAY_SUMMON_GHOULS_1, m_creature);
+ break;
+ case 1:
+ DoScriptText(SAY_SUMMON_GHOULS_2, m_creature);
+ break;
+ }
+ DoCast(random_target,SPELL_SUMMON_GHOULS);
+ Summon_ghouls_Timer = 10000;
+ }else Summon_ghouls_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* killer)
+ {DoScriptText(SAY_DEATH, m_creature);}
+
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_salramm(Creature *_Creature)
+{
+ return new boss_salrammAI (_Creature);
+}
+
+void AddSC_boss_salramm()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_salramm";
+ newscript->GetAI = GetAI_boss_salramm;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h
new file mode 100644
index 00000000000..849549e8f99
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h
@@ -0,0 +1,4 @@
+#ifndef DEF_CULLING_OF_STRATHOLME_H
+#define DEF_CULLING_OF_STRATHOLME_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp
new file mode 100644
index 00000000000..936f8365a35
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_culling_of_stratholme.h"
+
+struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance
+{
+ instance_culling_of_stratholme(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* map)
+{
+ return new instance_culling_of_stratholme(map);
+}
+
+void AddSC_instance_culling_of_stratholme()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_culling_of_stratholme";
+ newscript->GetInstanceData = GetInstanceData_instance_culling_of_stratholme;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
index 7a2e8239cac..abe37b53685 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
index dc8723b7201..d7ffcde4059 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
index 1efa7c75a2c..3e0e327bb89 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp
index cbe3c4273a2..db8db78f723 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -79,8 +79,8 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
m_creature->CastSpell(m_creature,SPELL_CHANNEL,true);
- else if (m_creature->HasAura(SPELL_CHANNEL,0))
- m_creature->RemoveAura(SPELL_CHANNEL,0);
+ else if (m_creature->HasAura(SPELL_CHANNEL))
+ m_creature->RemoveAura(SPELL_CHANNEL);
m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true);
}
@@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
{
- if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
+ if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
return;
DoScriptText(SAY_INTRO, m_creature);
@@ -156,13 +156,13 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (SpellCorrupt_Timer)
{
- if (SpellCorrupt_Timer < diff)
+ if (SpellCorrupt_Timer <= diff)
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
- if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0))
+ if (m_creature->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
- else if (m_creature->HasAura(SPELL_CORRUPT,0))
+ else if (m_creature->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
@@ -171,7 +171,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (Check_Timer)
{
- if (Check_Timer < diff)
+ if (Check_Timer <= diff)
{
uint32 pct = pInstance->GetData(DATA_SHIELD);
@@ -181,7 +181,6 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
{
DoScriptText(SAY_WEAK25, m_creature);
Life25 = false;
- Check_Timer = 0;
}
else if (Life50 && pct <= 50)
{
@@ -203,11 +202,16 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
return;
}
- if (pInstance->GetData(TYPE_MEDIVH) == DONE)
+ if (pInstance->GetData(TYPE_RIFT) == DONE)
{
DoScriptText(SAY_WIN, m_creature);
Check_Timer = 0;
+
+ if (m_creature->HasAura(SPELL_CHANNEL))
+ m_creature->RemoveAura(SPELL_CHANNEL);
+
//TODO: start the post-event here
+ pInstance->SetData(TYPE_MEDIVH,DONE);
}
}else Check_Timer -= diff;
}
@@ -334,7 +338,8 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
debug_log("SD2: npc_time_rift: not casting anylonger, i need to die.");
m_creature->setDeathState(JUST_DIED);
- pInstance->SetData(TYPE_RIFT,SPECIAL);
+ if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
+ pInstance->SetData(TYPE_RIFT,SPECIAL);
}
};
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h
index 61018f58118..7bfd8c917d7 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp
index 39445fe727c..697134cd82d 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
}
- debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
+ debug_log("TSCR: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (Player* player = itr->getSource())
player->SendUpdateWorldState(id,state);
}
- }else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
+ }else debug_log("TSCR: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
}
void InitWorldState(bool Enable = true)
@@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (!player)
{
- debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
+ debug_log("TSCR: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
@@ -216,7 +216,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
{
if (data == IN_PROGRESS)
{
- debug_log("SD2: Instance Dark Portal: Starting event.");
+ debug_log("TSCR: Instance Dark Portal: Starting event.");
InitWorldState();
Encounter[1] = IN_PROGRESS;
NextPortal_Timer = 15000;
@@ -227,6 +227,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
//this may be completed further out in the post-event
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
+ debug_log("TSCR: Instance Dark Portal: Event completed.");
player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh);
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
}
@@ -282,7 +283,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
//normalize Z-level if we can, if rift is not at ground level.
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
- debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
+ debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
@@ -290,7 +291,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (Summon)
return Summon;
- debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
+ debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
return NULL;
}
@@ -302,12 +303,11 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
- for(uint8 i = 0; i < 4; i++)
- {
- int tmp = rand()%4;
- if (tmp != CurrentRiftId)
- {
- debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
+ int tmp = rand()%(4-1);
+
+ if (tmp >= CurrentRiftId)
+ tmp++;
+ debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
CurrentRiftId = tmp;
@@ -334,9 +334,6 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
}
}
- break;
- }
- }
}
}
@@ -354,7 +351,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (NextPortal_Timer)
{
- if (NextPortal_Timer < diff)
+ if (NextPortal_Timer <= diff)
{
++mRiftPortalCount;
UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount);
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
index 4476a47d04c..af842479ed1 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,12 +6,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
@@ -40,9 +40,9 @@ EndScriptData */
#define SAY_SOUL_CHARGE1 -1534029
#define SAY_SOUL_CHARGE2 -1534030
-#define SPELL_DENOUEMENT_WISP 32124
-#define SPELL_ANCIENT_SPARK 39349
-#define SPELL_PROTECTION_OF_ELUNE 38528
+#define SPELL_DENOUEMENT_WISP 32124
+#define SPELL_ANCIENT_SPARK 39349
+#define SPELL_PROTECTION_OF_ELUNE 38528
#define SPELL_DRAIN_WORLD_TREE 39140
#define SPELL_DRAIN_WORLD_TREE_2 39141
@@ -53,8 +53,7 @@ EndScriptData */
#define SPELL_GRIP_OF_THE_LEGION 31972
#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures
#define SPELL_DOOMFIRE_SPAWN 32074
-#define SPELL_DOOMFIRE_VISUAL 42344 // This is actually a Zul'Aman spell, but the proper Doomfire spell sometimes freezes the server if a player stands in it for too long
-#define SPELL_DOOMFIRE_DAMAGE 31944
+#define SPELL_DOOMFIRE 31945
#define SPELL_SOUL_CHARGE_YELLOW 32045
#define SPELL_SOUL_CHARGE_GREEN 32051
#define SPELL_SOUL_CHARGE_RED 32052
@@ -65,7 +64,7 @@ EndScriptData */
#define CREATURE_ARCHIMONDE 17968
#define CREATURE_DOOMFIRE 18095
-#define CREATURE_DOOMFIRE_TARGETING 18104
+#define CREATURE_DOOMFIRE_SPIRIT 18104
#define CREATURE_ANCIENT_WISP 17946
#define CREATURE_CHANNEL_TARGET 22418
@@ -98,20 +97,20 @@ struct mob_ancient_wispAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if(!ArchimondeGUID)
+ if (!ArchimondeGUID)
{
- if(pInstance)
+ if (pInstance)
ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
}
- if(CheckTimer < diff)
+ if (CheckTimer < diff)
{
- if(ArchimondeGUID)
+ if (ArchimondeGUID)
{
Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde)
+ if (Archimonde)
{
- if((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
+ if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
DoCast(m_creature, SPELL_DENOUEMENT_WISP);
else
DoCast(Archimonde, SPELL_ANCIENT_SPARK);
@@ -122,186 +121,65 @@ struct mob_ancient_wispAI : public ScriptedAI
}
};
-/* This script controls the Doomfire mob. Unlike the other Doomfire mob, this one does not stalk players.
- Instead, this doomfire will simply stand in one place after spawning and deal damage to any players that
- are within 3 yards. Another creature called Doomfire Targetting spawns this creature as well as stalks. */
+/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will
+ MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */
struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI
{
mob_doomfireAI(Creature* c) : ScriptedAI(c) {}
- uint32 CheckTimer;
- uint32 RefreshTimer;
-
- bool TargetSelected;
-
- uint64 ArchimondeGUID;
- uint64 TargetGUID;
-
- void Reset()
- {
- CheckTimer = 5000;
- RefreshTimer = 0;
-
- TargetSelected = false;
-
- ArchimondeGUID = 0;
- TargetGUID = 0;
- }
-
- void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
+ void Reset() { }
+ void MoveInLineOfSight(Unit* who) { }
void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit* who)
- {
- // Do not do anything if who does not exist, or we are refreshing our timer, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || RefreshTimer || who->GetEntry() == CREATURE_ANCIENT_WISP ||
- who->GetEntry() == CREATURE_ARCHIMONDE || who->GetEntry() == CREATURE_DOOMFIRE ||
- who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- if(m_creature->IsWithinDistInMap(who, 3))
- {
- TargetSelected = true;
- TargetGUID = who->GetGUID();
- RefreshTimer = 2000;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- bool suicide = true;
- if(ArchimondeGUID)
- {
- Creature* Archimonde = (Unit::GetCreature((*m_creature), ArchimondeGUID));
- if(Archimonde && Archimonde->isAlive())
- {
- suicide = false;
- Archimonde->AI()->KilledUnit(victim);
- }
- }
-
- if(suicide)
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(RefreshTimer < diff)
- RefreshTimer = 0;
- else RefreshTimer -= diff;
-
- if(TargetSelected && TargetGUID)
- {
- Unit* target = Unit::GetUnit((*m_creature), TargetGUID);
- if(target && target->isAlive())
- {
- target->CastSpell(target, SPELL_DOOMFIRE_DAMAGE, true);
- TargetGUID = 0;
- TargetSelected = false;
- }
- }
-
- if(CheckTimer < diff)
- {
- if(ArchimondeGUID)
- {
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(!Archimonde || !Archimonde->isAlive())
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- CheckTimer = 5000;
- }
- else m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else CheckTimer -= diff;
- }
+ void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
};
-/* This is the script for the Doomfire Targetting Mob. This mob simply follows players and/or travels in random directions and spawns the actual Doomfire which does damage to anyone that moves close. */
+/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or
+ travels in random directions if target cannot be found. */
struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
{
mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {}
+ uint64 TargetGUID;
uint32 ChangeTargetTimer;
- uint32 SummonTimer; // This timer will serve as both a summon timer for the doomfire that does damage as well as to check on Archionde
-
- uint64 ArchimondeGUID;
void Reset()
{
+ TargetGUID = 0;
ChangeTargetTimer = 5000;
- SummonTimer = 1000;
-
- ArchimondeGUID = 0;
}
- void Aggro(Unit* who) {}
-
void MoveInLineOfSight(Unit* who)
{
- // Do not do anything if who does not exist, or who is Doomfire, Archimonde or Doomfire targetting
- if(!who || who == m_creature || who->GetEntry() == CREATURE_ARCHIMONDE
- || who->GetEntry() == CREATURE_DOOMFIRE || who->GetEntry() == CREATURE_DOOMFIRE_TARGETING || !who->isTargetableForAttack())
- return;
-
- m_creature->AddThreat(who, 0.0f);
+ //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0
+ //when UpdateAI needs it, it will be forced to select randomPoint
+ if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER)
+ TargetGUID = who->GetGUID();
}
+ void Aggro(Unit* who) {}
+
void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; }
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim())
- return;
-
- if(SummonTimer < diff)
+ if (ChangeTargetTimer < diff)
{
- if(ArchimondeGUID)
+ if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID))
{
- Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
- if(Archimonde && Archimonde->isAlive())
- {
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE, 0, 0, 2, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
- {
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- ((mob_doomfireAI*)Doomfire->AI())->ArchimondeGUID = ArchimondeGUID;
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- SummonTimer = 500;
- }
- else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f);
+ TargetGUID = 0;
}
else
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }else SummonTimer -= diff;
-
- if(ChangeTargetTimer < diff)
- {
- Unit* target = NULL;
- switch(rand()%2)
{
- case 0: // stalk player
- target = SelectUnit(SELECT_TARGET_RANDOM, 1);
- if(target && target->isAlive())
- {
- m_creature->AddThreat(target, DoGetThreat(m_creature->getVictim()));
- m_creature->GetMotionMaster()->MoveChase(target);
- }
- break;
-
- case 1: // random location
- float x = 0;
- float y = 0;
- float z = 0;
- m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- break;
+ float x,y,z = 0.0;
+ m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
}
+
ChangeTargetTimer = 5000;
}else ChangeTargetTimer -= diff;
}
-
};
/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
@@ -309,8 +187,8 @@ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
select a random target and cast the spell on them. However, if someone IS in melee range, and this
is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
- For Doomfire, we summon a mob (Doomfire Targetting) that summons another mob (Doomfire every second)
- Doomfire Targetting 'stalks' players whilst Doomfire damages player that are within range. */
+ For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will
+ randomly select it's target to follow and then we create the random movement making it unpredictable. */
// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death
struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
@@ -333,6 +211,9 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
ScriptedInstance* pInstance;
+ uint64 DoomfireSpiritGUID;
+ uint64 WorldTreeGUID;
+
uint32 DrainNordrassilTimer;
uint32 FearTimer;
uint32 AirBurstTimer;
@@ -354,10 +235,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
void Reset()
{
- if(pInstance)
+ if (pInstance)
pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
+ DoomfireSpiritGUID = 0;
damageTaken = 0;
+ WorldTreeGUID = 0;
+
DrainNordrassilTimer = 0;
FearTimer = 42000;
AirBurstTimer = 30000;
@@ -384,7 +268,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
DoScriptText(SAY_AGGRO, m_creature);
DoZoneInCombat();
- if(pInstance)
+ if (pInstance)
pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS);
}
@@ -392,12 +276,12 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
{
switch(rand()%2)
{
- case 0: DoScriptText(SAY_SLAY1, m_creature); break;
- case 1: DoScriptText(SAY_SLAY2, m_creature); break;
- case 2: DoScriptText(SAY_SLAY3, m_creature); break;
+ case 0: DoScriptText(SAY_SLAY1, m_creature); break;
+ case 1: DoScriptText(SAY_SLAY2, m_creature); break;
+ case 2: DoScriptText(SAY_SLAY3, m_creature); break;
}
- if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
+ if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
GainSoulCharge(((Player*)victim));
}
@@ -431,7 +315,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
DoScriptText(SAY_DEATH, m_creature);
- if(pInstance)
+ if (pInstance)
pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
}
@@ -439,11 +323,11 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
{
// First we check if our current victim is in melee range or not.
Unit* victim = m_creature->getVictim();
- if(victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
+ if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
return false;
std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
- if(m_threatlist.empty())
+ if (m_threatlist.empty())
return false;
std::list<Unit*> targets;
@@ -451,56 +335,70 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
for( ; itr != m_threatlist.end(); ++itr)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
+ if (pUnit && pUnit->isAlive())
targets.push_back(pUnit);
}
- if(targets.empty())
+ if (targets.empty())
return false;
targets.sort(TargetDistanceOrder(m_creature));
Unit* target = targets.front();
- if(target)
+ if (target)
{
- if(!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
+ if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target)))
return true; // Cast Finger of Death
else // This target is closest, he is our new tank
- m_creature->AddThreat(target, DoGetThreat(m_creature->getVictim()));
+ m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
}
return false;
}
- void SummonDoomfire(Unit* target)
+ void JustSummoned(Creature *summoned)
{
- Creature* Doomfire = DoSpawnCreature(CREATURE_DOOMFIRE_TARGETING, rand()%30, rand()%30, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if(Doomfire)
+ summoned->setFaction(m_creature->getFaction());
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT)
{
- ((mob_doomfire_targettingAI*)Doomfire->AI())->ArchimondeGUID = m_creature->GetGUID();
- Doomfire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- // Give Doomfire a taste of everyone in the threatlist = more targets to chase.
- std::list<HostilReference*>::iterator itr;
- for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
- Doomfire->AddThreat(Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()), 1.0f);
- Doomfire->setFaction(m_creature->getFaction());
- DoCast(Doomfire, SPELL_DOOMFIRE_SPAWN);
- Doomfire->CastSpell(Doomfire, SPELL_DOOMFIRE_VISUAL, true);
- if(target)
- Doomfire->AI()->AttackStart(target);
-
- if(rand()%2 == 0)
- DoScriptText(SAY_DOOMFIRE1, m_creature);
- else
- DoScriptText(SAY_DOOMFIRE2, m_creature);
+ DoomfireSpiritGUID = summoned->GetGUID();
}
+
+ if (summoned->GetEntry() == CREATURE_DOOMFIRE)
+ {
+ summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false);
+ summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID());
+
+ if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID))
+ {
+ summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f);
+ DoomfireSpiritGUID = 0;
+ }
+ }
+ }
+
+ //this is code doing close to what the summoning spell would do (spell 31903)
+ void SummonDoomfire(Unit* target)
+ {
+ m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
+ target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0,
+ TEMPSUMMON_TIMED_DESPAWN, 27000);
+
+ m_creature->SummonCreature(CREATURE_DOOMFIRE,
+ target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0,
+ TEMPSUMMON_TIMED_DESPAWN, 27000);
}
void UnleashSoulCharge()
{
m_creature->InterruptNonMeleeSpells(false);
+
bool HasCast = false;
uint32 chargeSpell = 0;
uint32 unleashSpell = 0;
+
switch(rand()%3)
{
case 0:
@@ -516,42 +414,48 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
unleashSpell = SPELL_UNLEASH_SOUL_GREEN;
break;
}
- if(m_creature->HasAura(chargeSpell, 0))
+
+ if (m_creature->HasAura(chargeSpell))
{
- m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
+ m_creature->RemoveAuraFromStack(chargeSpell);
DoCast(m_creature->getVictim(), unleashSpell);
HasCast = true;
SoulChargeCount--;
}
- if(HasCast)
+
+ if (HasCast)
SoulChargeTimer = 2000 + rand()%28000;
}
void UpdateAI(const uint32 diff)
{
- if(!InCombat)
+ if (!InCombat)
{
- if(pInstance)
+ if (pInstance)
{
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
- if((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
+ if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->setFaction(35);
}
- else if((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
+ else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
{
m_creature->setFaction(1720);
m_creature->SetVisibility(VISIBILITY_ON);
}
}
- if(DrainNordrassilTimer < diff)
+ if (DrainNordrassilTimer < diff)
{
- if(!IsChanneling)
+ if (!IsChanneling)
{
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
- if(Nordrassil)
+ Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
+
+ if (temp)
+ WorldTreeGUID = temp->GetGUID();
+
+ if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID))
{
Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
@@ -559,26 +463,24 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
IsChanneling = true;
}
}
- Creature* Nordrassil = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 5000);
- if(Nordrassil)
+
+ if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID))
{
- Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Nordrassil->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
DrainNordrassilTimer = 1000;
}
}else DrainNordrassilTimer -= diff;
}
- if(!UpdateVictim())
+ if (!UpdateVictim() )
return;
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
+ if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
BelowTenPercent = true;
- if(!Enraged)
+ if (!Enraged)
{
- if(EnrageTimer < diff)
+ if (EnrageTimer < diff)
{
if((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
{
@@ -589,14 +491,15 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
}
}else EnrageTimer -= diff;
- if(CheckDistanceTimer < diff)
+ if (CheckDistanceTimer < diff)
{
// To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
- if(Check)
+ if (Check)
{
Check->SetVisibility(VISIBILITY_OFF);
- if(m_creature->IsWithinDistInMap(Check, 75))
+
+ if (m_creature->IsWithinDistInMap(Check, 75))
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
@@ -608,22 +511,23 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
}else CheckDistanceTimer -= diff;
}
- if(BelowTenPercent)
+ if (BelowTenPercent)
{
- if(!HasProtected)
+ if (!HasProtected)
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
+
//all members of raid must get this buff
DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
HasProtected = true;
Enraged = true;
}
- if(SummonWispTimer < diff)
+ if (SummonWispTimer < diff)
{
Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if(Wisp)
+ if (Wisp)
{
Wisp->AI()->AttackStart(m_creature);
((mob_ancient_wispAI*)Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
@@ -632,13 +536,13 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
++WispCount;
}else SummonWispTimer -= diff;
- if(WispCount >= 30)
+ if (WispCount >= 30)
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
- if(Enraged)
+ if (Enraged)
{
- if(HandOfDeathTimer < diff)
+ if (HandOfDeathTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
HandOfDeathTimer = 2000;
@@ -646,46 +550,57 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
return; // Don't do anything after this point.
}
- if(SoulChargeCount)
+ if (SoulChargeCount)
{
- if(SoulChargeTimer < diff)
+ if (SoulChargeTimer < diff)
UnleashSoulCharge();
else SoulChargeTimer -= diff;
}
- if(GripOfTheLegionTimer < diff)
+ if (GripOfTheLegionTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION);
GripOfTheLegionTimer = 5000 + rand()%20000;
}else GripOfTheLegionTimer -= diff;
- if(AirBurstTimer < diff)
+ if (AirBurstTimer < diff)
{
- if(rand()%2 == 0)
+ if (rand()%2 == 0)
DoScriptText(SAY_AIR_BURST1, m_creature);
else
DoScriptText(SAY_AIR_BURST2, m_creature);
-
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank
AirBurstTimer = 25000 + rand()%15000;
}else AirBurstTimer -= diff;
- if(FearTimer < diff)
+ if (FearTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FEAR);
FearTimer = 42000;
}else FearTimer -= diff;
- if(DoomfireTimer < diff)
+ if (DoomfireTimer < diff)
{
- SummonDoomfire(SelectUnit(SELECT_TARGET_RANDOM, 1));
- DoomfireTimer = 40000;
+ if (rand()%2 == 0)
+ DoScriptText(SAY_DOOMFIRE1, m_creature);
+ else
+ DoScriptText(SAY_DOOMFIRE2, m_creature);
+
+ Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if (!temp)
+ temp = m_creature->getVictim();
+
+ //replace with spell cast 31903 once implicitTarget 73 implemented
+ SummonDoomfire(temp);
+
+ //supposedly three doomfire can be up at the same time
+ DoomfireTimer = 20000;
}else DoomfireTimer -= diff;
- if(MeleeRangeCheckTimer < diff)
+ if (MeleeRangeCheckTimer < diff)
{
- if(CanUseFingerOfDeath())
+ if (CanUseFingerOfDeath())
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH);
MeleeRangeCheckTimer = 1000;
@@ -723,7 +638,7 @@ void AddSC_boss_archimonde()
{
Script *newscript;
newscript = new Script;
- newscript->Name="boss_archimonde";
+ newscript->Name = "boss_archimonde";
newscript->GetAI = &GetAI_boss_archimonde;
newscript->RegisterSelf();
@@ -742,4 +657,3 @@ void AddSC_boss_archimonde()
newscript->GetAI = &GetAI_mob_ancient_wisp;
newscript->RegisterSelf();
}
-
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
index ed02258cd9f..7d81dbe4993 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
index 312aa90a686..faa7f9eaad7 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
index d144423ccca..ed62e77b218 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -354,6 +354,7 @@ void hyjalAI::Reset()
// Misc
WaveCount = 0;
+ EnemyCount = 0;
// Set faction properly based on creature entry
switch(m_creature->GetEntry())
@@ -432,7 +433,7 @@ void hyjalAI::EnterEvadeMode()
void hyjalAI::Aggro(Unit *who)
{
if(IsDummy)return;
- for(uint8 i = 0; i < 2; ++i)
+ for(uint8 i = 0; i < 3; ++i)
if(Spell[i].Cooldown)
SpellTimer[i] = Spell[i].Cooldown;
@@ -686,7 +687,7 @@ void hyjalAI::Retreat()
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
@@ -1013,7 +1014,7 @@ void hyjalAI::HideNearPos(float x, float y)
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
@@ -1041,7 +1042,7 @@ void hyjalAI::RespawnNearPos(float x, float y)
cell.SetNoCreate();
Trinity::RespawnDo u_do;
- Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(u_do);
+ Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(m_creature, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap());
@@ -1050,7 +1051,7 @@ void hyjalAI::WaypointReached(uint32 i)
{
if(i == 1 || (i == 0 && m_creature->GetEntry() == THRALL))
{
- m_creature->Yell("Hurry, we don't have much time",0,0);
+ m_creature->MonsterYell("Hurry, we don't have much time",0,0);
WaitForTeleport = true;
TeleportTimer = 20000;
if(m_creature->GetEntry() == JAINA)
@@ -1075,7 +1076,7 @@ void hyjalAI::WaypointReached(uint32 i)
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
@@ -1117,7 +1118,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(creatures, creature_check);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
index 4a2fbd6494e..ba75eaa36f2 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
index b4fc3a65222..13844079b84 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -39,6 +39,9 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
{
instance_mount_hyjal(Map *map) : ScriptedInstance(map) {Initialize();};
+ uint32 Encounters[ENCOUNTERS];
+ std::string str_data;
+
uint64 RageWinterchill;
uint64 Anetheron;
uint64 Kazrogal;
@@ -51,7 +54,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
uint64 ElfGate;
uint32 Trash;
- uint32 Encounters[ENCOUNTERS];
+
uint32 hordeRetreat;
uint32 allianceRetreat;
@@ -114,13 +117,12 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
void OpenDoor(uint64 DoorGUID, bool open)
{
- if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ HandleGameObject(DoorGUID, open, NULL);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 17767: RageWinterchill = creature->GetGUID(); break;
case 17808: Anetheron = creature->GetGUID(); break;
@@ -229,7 +231,21 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);
if(data == DONE)
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
+ << Encounters[3] << " " << Encounters[4]
+ << " " << allianceRetreat << " " << hordeRetreat
+ << " " << RaidDamage;
+
+ str_data = saveStream.str();
+
SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
+ }
+
}
uint32 GetData(uint32 type)
@@ -265,19 +281,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
const char* Save()
{
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
- << Encounters[3] << " " << Encounters[4] << " " << allianceRetreat << " " << hordeRetreat << " " << RaidDamage;
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if(out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
-
- return NULL;
+ return str_data.c_str();
}
void Load(const char* in)
@@ -289,8 +293,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
}
OUT_LOAD_INST_DATA(in);
- std::istringstream loadStream;
- loadStream.str(in);
+ std::istringstream loadStream(in);
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat >> RaidDamage;
for(uint8 i = 0; i < ENCOUNTERS; ++i)
if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
index ab3a61ffe0b..be4c2660b51 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -56,9 +56,9 @@ struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI
void Reset()
{
- Holy_Light_Timer = 30000;
+ Holy_Light_Timer = 20000 + rand()%10000;
Cleanse_Timer = 10000;
- HammerOfJustice_Timer = 60000;
+ HammerOfJustice_Timer = 20000 + rand()%15000;
HolyShield_Timer = 240000;
DevotionAura_Timer = 3000;
Consecration_Timer = 8000;
@@ -126,14 +126,14 @@ struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI
if (DevotionAura_Timer < diff)
{
DoCast(m_creature, SPELL_DEVOTION_AURA);
- DevotionAura_Timer = 60000;
+ DevotionAura_Timer = 45000 + rand()%10000;
}else DevotionAura_Timer -= diff;
//Consecration
if (Consecration_Timer < diff)
{
//DoCast(m_creature->getVictim(), SPELL_CONSECRATION);
- Consecration_Timer = 8000;
+ Consecration_Timer = 5000 + rand()%5000;
}else Consecration_Timer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
index 39d42413c5f..60ef9ae55fe 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -56,8 +56,8 @@ struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI
void Reset()
{
- SandBreath_Timer = 25000;
- ImpendingDeath_Timer = 30000;
+ SandBreath_Timer = 8000 + rand()%8000;
+ ImpendingDeath_Timer = 25000 + rand()%5000;
WingBuffet_Timer = 35000;
Mda_Timer = 40000;
}
@@ -108,13 +108,13 @@ struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI
case 1: DoScriptText(SAY_BREATH2, m_creature); break;
}
- SandBreath_Timer = 25000+rand()%5000;
+ SandBreath_Timer = 10000 + rand()%10000;
}else SandBreath_Timer -= diff;
if (ImpendingDeath_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH);
- ImpendingDeath_Timer = 30000+rand()%5000;
+ ImpendingDeath_Timer = 25000+rand()%5000;
}else ImpendingDeath_Timer -= diff;
if (WingBuffet_Timer < diff)
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
index 67d0db45872..b36555cd074 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI
{
DoScriptText(SAY_SHOUT, m_creature);
DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
- Fear_Timer = 30000+rand()%10000;
+ Fear_Timer = 25000+rand()%10000;
}else Fear_Timer -= diff;
//Mortal Strike
@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI
{
DoScriptText(SAY_MORTAL, m_creature);
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
- MortalStrike_Timer = 45000+rand()%5000;
+ MortalStrike_Timer = 20000+rand()%10000;
}else MortalStrike_Timer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
index 01c0e1334ac..39db5bed06a 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
index 9ec75c06e0c..8b0a62c4452 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case THRALL_ENTRY:
ThrallGUID = creature->GetGUID();
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
index ea85414a27e..6ed4609e3b9 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -235,12 +235,12 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
case 9:
DoScriptText(SAY_TH_ARMORY, m_creature);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, THRALL_WEAPON_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, THRALL_SHIELD_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
break;
case 10:
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED);
@@ -278,7 +278,6 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
DoMount();
break;
case 37:
@@ -347,11 +346,9 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
break;
case 96:
DoScriptText(SAY_TH_EPOCH_WONDER, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
break;
case 97:
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 98:
@@ -386,11 +383,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
}
- break;
+ break;
case 108:
- //last waypoint, just set Thrall invisible, respawn is turned off
+ //last waypoint, just set Thrall invisible, respawn is turned off
m_creature->SetVisibility(VISIBILITY_OFF);
- break;
+ break;
}
}
@@ -406,12 +403,8 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
{
DoUnmount();
HadMount = false;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_UNEQUIPPED);
}
if( IsBeingEscorted )
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
index 134dac56ca0..ac646413cb0 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
pet = false;
- Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet);
+ Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet);
if( Pet && Pet->isAlive() )
{
Pet->DealDamage( Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false );
@@ -348,7 +348,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
((boss_fathomlord_karathressAI*)Karathress->AI())->EventSharkkisDeath();
@@ -407,7 +407,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
if(TheBeastWithin_Timer < diff)
{
DoCast(m_creature, SPELL_THE_BEAST_WITHIN);
- Creature *Pet = (Creature*) Unit::GetUnit(*m_creature, SummonedPet);
+ Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet);
if( Pet && Pet->isAlive() )
{
Pet->CastSpell( Pet, SPELL_PET_ENRAGE, true );
@@ -477,7 +477,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
if(!m_creature->isAlive() && Karathress)
@@ -519,7 +519,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
return;
}
- if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0) )
+ if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON) )
{
DoCast(m_creature, SPELL_WINDFURY_WEAPON);
}
@@ -592,7 +592,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
if (pInstance)
{
Creature *Karathress = NULL;
- Karathress = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
+ Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS)));
if (Karathress)
if(!m_creature->isAlive() && Karathress)
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
index e28fc77acd2..14012be1d1f 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
index 1a82ee38900..87bb245c382 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -370,7 +370,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
Unit *target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER, 0))
+ if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
//cast Static Charge every 2 seconds for 20 seconds
DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
@@ -576,12 +576,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
}
}
};
-class TRINITY_DLL_DECL VashjSurgeAura : public Aura
-{
- public:
- VashjSurgeAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
- {}
-};
+
//Enchanted Elemental
//If one of them reaches Vashj he will increase her damage done by 5%.
struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
@@ -665,13 +660,14 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_SURGE);
if( spell )
{
- for(uint32 i = 0;i<3;i++)
+ uint8 eff_mask=0;
+ for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
-
- Vashj->AddAura(new VashjSurgeAura(spell, i, NULL, Vashj, Vashj));
+ eff_mask|=1<<i;
}
+ Vashj->AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj));
}
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
@@ -711,7 +707,7 @@ struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI
if(pInstance)
{
Creature *Vashj = NULL;
- Vashj = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)));
+ Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)));
if(Vashj)
((boss_lady_vashjAI*)Vashj->AI())->EventTaintedElementalDeath();
@@ -923,7 +919,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI
if(Vashj && Vashj->isAlive())
{
//start visual channel
- if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER,0))
+ if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER))
{
m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true);
Casted = true;
@@ -945,7 +941,7 @@ bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets con
}
Creature *Vashj = NULL;
- Vashj = (Creature*)(Unit::GetUnit((*player), pInstance->GetData64(DATA_LADYVASHJ)));
+ Vashj = (Unit::GetCreature((*player), pInstance->GetData64(DATA_LADYVASHJ)));
if(Vashj && ((boss_lady_vashjAI*)Vashj->AI())->Phase == 2)
{
if(targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT)
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
index 6c2588671e6..073649db5ee 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -65,12 +65,6 @@ EndScriptData */
#define SAY_FREE -1548019
#define SAY_DEATH -1548020
-class TRINITY_DLL_DECL InsidiousAura : public Aura {
-public:
- InsidiousAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
- {}
-};
-
struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
{
mob_inner_demonAI(Creature *c) : ScriptedAI(c)
@@ -91,7 +85,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
void JustDied(Unit *victim)
{
Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID);
- if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER,0))
+ if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER))
pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
}
@@ -128,7 +122,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
}else Link_Timer -= diff;
- if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT, 0))
+ if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT))
DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true);
if(ShadowBolt_Timer < diff)
@@ -194,8 +188,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
InnderDemon_Count = 0;
m_creature->SetSpeed( MOVE_RUN, 2.0f, true);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
m_creature->SetCorpseDelay(1000*60*60);
if(pInstance)
@@ -229,7 +223,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}
void MoveInLineOfSight(Unit *who)
{
- if(m_creature->HasAura(AURA_BANISH, 0))
+ if(m_creature->HasAura(AURA_BANISH))
return;
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
@@ -267,7 +261,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}
// channelers == 0 remove banish aura
- if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0))
+ if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH))
{
// removing banish aura
m_creature->RemoveAurasDueToSpell(AURA_BANISH);
@@ -290,7 +284,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
StartEvent();
}
}
- else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0))
+ else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH))
{
// channelers != 0 apply banish aura
// removing Leotheras banish immune to apply AURA_BANISH
@@ -301,8 +295,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
// and removing weapons
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
}
@@ -390,7 +384,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
void Aggro(Unit *who)
{
- if(m_creature->HasAura(AURA_BANISH, 0))
+ if(m_creature->HasAura(AURA_BANISH))
return;
m_creature->LoadEquipment(m_creature->GetEquipmentId());
@@ -399,7 +393,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
- if (m_creature->HasAura(AURA_BANISH, 0) || !UpdateVictim())
+ if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim())
{
if(BanishTimer<diff)
{
@@ -408,7 +402,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}else BanishTimer -= diff;
return;
}
- if(m_creature->HasAura(SPELL_WHIRLWIND, 0))
+ if(m_creature->HasAura(SPELL_WHIRLWIND))
if(Whirlwind_Timer < diff)
{
Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -422,7 +416,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}else Whirlwind_Timer -= diff;
// reseting after changing forms and after ending whirlwind
- if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0))
+ if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND))
{
// when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
if(DemonForm)
@@ -446,7 +440,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
if(!DemonForm)
{
//Whirldind Timer
- if(!m_creature->HasAura(SPELL_WHIRLWIND, 0))
+ if(!m_creature->HasAura(SPELL_WHIRLWIND))
{
if(Whirlwind_Timer < diff)
{
@@ -465,8 +459,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
DoScriptText(SAY_SWITCH_TO_DEMON, m_creature);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY , 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
DemonForm = true;
NeedThreatReset = true;
SwitchToDemon_Timer = 45000;
@@ -513,12 +507,14 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
((ScriptedAI *)demon->AI())->AttackStart( (*itr) );
((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID();
+ uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
- (*itr)->AddAura(new InsidiousAura(spell, i, NULL, (*itr), (*itr)));
+ eff_mask|=1<<i;
}
+ (*itr)->AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr)));
if( InnderDemon_Count > 4 ) InnderDemon_Count = 0;
//Safe storing of creatures
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
index 02125f5fd38..653799f08f5 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -266,7 +266,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0))
+ if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER))
i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true);
else if(!i->getSource()->IsInWater())
i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
index 7d56bbf6d2a..35f3f5b9b13 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
index aceabea4b5c..13144bc93c0 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
index 0aceef32714..adf2eda7c39 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -137,12 +137,12 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
void OpenDoor(uint64 DoorGUID, bool open)
{
if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ Door->SetGoState(open ? 0 : 1);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 21212: LadyVashj = creature->GetGUID(); break;
case 21214: Karathress = creature->GetGUID(); break;
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
index cafbf8e3f4f..8ffee603597 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
index 1515b14e3a2..e5b12065298 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
index 7090d678768..ede9a38126f 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_creature, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
index 09a76d482b7..4b407ac4816 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
index b76cfedb777..92df1fffbe1 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
index 328bd8ee1ce..99d313d303a 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
index 5153edb5e62..d7c9791cf51 100644
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
+++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp
@@ -121,7 +121,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI
{
if(Unit* target = (Unit*)Unit::GetUnit(*m_creature, LevitatedTarget))
{
- if(!target->HasAura(SPELL_LEVITATE,0))
+ if(!target->HasAura(SPELL_LEVITATE))
{
LevitatedTarget = 0;
return;
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI
target->AddAura(SPELL_SUSPENSION, target);
LevitatedTarget = 0;
}
- else
+ else
{
target->CastSpell(target, SPELL_MAGNETIC_PULL, true);
InAir = true;
diff --git a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
index aea0e52e4f7..fcb13e9f479 100644
--- a/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
+++ b/src/bindings/scripts/scripts/zone/darkshore/darkshore.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
index 3f71dc9041b..cafdc5fbc46 100644
--- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
+++ b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
CannonBlast_Timer = CANNON_BLAST_TIMER;
// it's a hack - Mr. Smite should do that but his too far away
IronCladDoor->SetName("Mr. Smite");
- IronCladDoor->Yell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0);
+ IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0);
DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM1);
State=CANNON_BLAST_INITIATED;
break;
@@ -81,7 +81,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
ShootCannon();
BlastOutDoor();
LeverStucked();
- IronCladDoor->Yell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0);
+ IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0);
DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM2);
State = PIRATES_ATTACK;
}else
@@ -120,13 +120,13 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
void ShootCannon()
{
- DefiasCannon->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ DefiasCannon->SetGoState(0);
DoPlaySound(DefiasCannon, SOUND_CANNONFIRE);
}
void BlastOutDoor()
{
- IronCladDoor->SetUInt32Value(GAMEOBJECT_STATE, 2);
+ IronCladDoor->SetGoState(2);
DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR);
}
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp
new file mode 100644
index 00000000000..a1980b7506b
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp
@@ -0,0 +1,56 @@
+/* Script Data Start
+SDName: Boss dred
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled
+#define SPELL_GRIEVOUS_BITE 48920
+#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf
+#define SPELL_FEARSOME_ROAR_N 48849
+#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff
+#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75%
+#define SPELL_RAPTOR_CALL 59416 //dummy
+
+
+struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI
+{
+ boss_dredAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_dred(Creature *_Creature)
+{
+ return new boss_dredAI (_Creature);
+}
+
+void AddSC_boss_dred()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_dred";
+ newscript->GetAI = GetAI_boss_dred;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp
new file mode 100644
index 00000000000..54392bc3b1f
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp
@@ -0,0 +1,75 @@
+/* Script Data Start
+SDName: Boss novos
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_novos' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCANE_BLAST_N 49198
+#define SPELL_ARCANE_BLAST_H 59909
+#define SPELL_ARCANE_FIELD 47346
+#define SPELL_BLIZZARD_N 49034
+#define SPELL_BLIZZARD_H 59854
+#define SPELL_FROSTBOLT_N 49037
+#define SPELL_FROSTBOLT_H 59855
+#define SPELL_WRATH_OF_MISERY_N 50089
+#define SPELL_WRATH_OF_MISERY_H 59856
+#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster.
+
+//Yell
+#define SAY_AGGRO -1600000
+#define SAY_KILL -1600001
+#define SAY_DEATH -1600002
+#define SAY_NECRO_ADD -1600003
+#define SAY_REUBBLE_1 -1600004
+#define SAY_REUBBLE_2 -1600005
+
+struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI
+{
+ boss_novosAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_novos(Creature *_Creature)
+{
+ return new boss_novosAI (_Creature);
+}
+
+void AddSC_boss_novos()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_novos";
+ newscript->GetAI = GetAI_boss_novos;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp
new file mode 100644
index 00000000000..1454a9de8f5
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp
@@ -0,0 +1,88 @@
+/* Script Data Start
+SDName: Boss tharon_ja
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_tharon_ja' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_COURSE_OF_LIFE 49527
+#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2
+#define SPELL_EYE_BEAM_N 49544
+#define SPELL_LIGHTNING_BREATH_N 49537
+#define SPELL_POISON_CLOUD_N 49548
+#define SPELL_RAIN_OF_FIRE_N 49518
+#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds.
+#define SPELL_SHADOW_VOLLEY_N 49528
+
+//Spells Heroic
+#define SPELL_COURSE_OF_LIFE_H 59972
+#define SPELL_EYE_BEAM_H 59965
+#define SPELL_LIGHTNING_BREATH_H 59963
+#define SPELL_POISON_CLOUD_H 59969
+#define SPELL_RAIN_OF_FIRE_H 59971
+#define SPELL_SHADOW_VOLLEY_H 59973
+
+//Players skills durring Phase2
+#define PLAYER_PHASE2_SLAYING_STRIKE 50799
+#define PLAYER_PHASE2_TAUNT 49613
+#define PLAYER_PHASE2_BONE_ARMOR 49609
+#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617
+//Phase 1 all abilities except Eye beam
+//Phase 2 turns players to skeletons with new abilities, boss grows skin
+
+//Yell
+#define SAY_AGGRO 1600011
+#define SAY_KILL_1 1600012
+#define SAY_KILL_2 1600013
+#define SAY_FLESH_1 1600014
+#define SAY_FLESH_2 1600015
+#define SAY_SKELETON_1 1600016
+#define SAY_SKELETON_2 1600017
+#define SAY_DEATH 1600018
+
+struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI
+{
+ boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH,m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_tharon_ja(Creature *_Creature)
+{
+ return new boss_tharon_jaAI (_Creature);
+}
+
+void AddSC_boss_tharon_ja()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_tharon_ja";
+ newscript->GetAI = GetAI_boss_tharon_ja;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp
new file mode 100644
index 00000000000..bfc123edb4d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp
@@ -0,0 +1,75 @@
+/* Script Data Start
+SDName: Boss trollgore
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_trollgore' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spell
+#define SPELL_INFECTED_WOUND 49637
+#define SPELL_CRUSH 49639
+#define SPELL_CORPSE_EXPLODE_N 49555
+#define SPELL_CONSUME_N 49380
+
+//Spell Heroic
+#define SPELL_CORPSE_EXPLODE_H 59807
+#define SPELL_CONSUME_H 59803
+
+//Yell
+#define SAY_AGGRO -1600006
+#define SAY_KILL -1600007
+#define SAY_CONSUME -1600008
+#define SAY_EXPLODE -1600009
+#define SAY_DEATH -1600010
+
+struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI
+{
+ boss_trollgoreAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_trollgore(Creature *_Creature)
+{
+ return new boss_trollgoreAI (_Creature);
+}
+
+void AddSC_boss_trollgore()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_trollgore";
+ newscript->GetAI = GetAI_boss_trollgore;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h
new file mode 100644
index 00000000000..321d77a9c27
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h
@@ -0,0 +1,4 @@
+#ifndef DEF_DRAK_THARON_H
+#define DEF_DRAK_THARON_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp
new file mode 100644
index 00000000000..3f3cd32e764
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_drak_tharon_keep.h"
+
+struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance
+{
+ instance_drak_tharon(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_drak_tharon(Map* map)
+{
+ return new instance_drak_tharon(map);
+}
+
+void AddSC_instance_drak_tharon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_drak_tharon";
+ newscript->GetInstanceData = GetInstanceData_instance_drak_tharon;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
index abba40ffe2a..c9cc4625b97 100644
--- a/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
+++ b/src/bindings/scripts/scripts/zone/dun_morogh/dun_morogh.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
spellHit = false;
}
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ if (m_creature->IsStandState())
{
if(lifeTimer < diff)
m_creature->AI()->EnterEvadeMode();
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
if(Spellkind->Id == 8593 && !spellHit)
{
DoCast(m_creature,32343);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//m_creature->RemoveAllAuras();
DoScriptText(SAY_HEAL, m_creature);
diff --git a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
index 6e3e0fbb6d7..67f68334410 100644
--- a/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
+++ b/src/bindings/scripts/scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
index 6d068ec1543..167dd0455af 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -118,7 +118,7 @@ bool GossipHello_npc_tirion_fordring(Player *player, Creature *_Creature)
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
- if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == PLAYER_STATE_SIT )
+ if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT )
player->ADD_GOSSIP_ITEM( 0, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
diff --git a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
index 2e07f91984c..d1fa414ea11 100644
--- a/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/elwynn_forest/elwynn_forest.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
spellHit = false;
}
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ if (m_creature->IsStandState())
{
if(lifeTimer < diff)
m_creature->AI()->EnterEvadeMode();
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
if(Spellkind->Id == 8593 && !spellHit)
{
DoCast(m_creature,32343);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//m_creature->RemoveAllAuras();
DoScriptText(SAY_HEAL, m_creature);
diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
index 7340ac5c073..e420446abe8 100644
--- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
+++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,12 +17,11 @@
/* ScriptData
SDName: Eversong_Woods
SD%Complete: 100
-SDComment: Quest support: 8346, 8483, 8488, 8490
+SDComment: Quest support: 8483, 8488, 8490
SDCategory: Eversong Woods
EndScriptData */
/* ContentData
-mobs_mana_tapped
npc_prospector_anvilward
npc_apprentice_mirveda
npc_infused_crystal
@@ -32,31 +31,6 @@ EndContentData */
#include "../../npc/npc_escortAI.h"
/*######
-## mobs_mana_tapped
-######*/
-
-struct TRINITY_DLL_DECL mobs_mana_tappedAI : public ScriptedAI
-{
- mobs_mana_tappedAI(Creature *c) : ScriptedAI(c) {}
-
- void Reset() { }
-
- void Aggro(Unit *who) { }
-
- void SpellHit(Unit *caster, const SpellEntry *spell)
- {
- if( caster->GetTypeId() == TYPEID_PLAYER)
- if( ((Player*)caster)->GetQuestStatus(8346) == QUEST_STATUS_INCOMPLETE && !((Player*)caster)->GetReqKillOrCastCurrentCount(8346, m_creature->GetEntry()) && spell->Id == 28734)
- ((Player*)caster)->CastedCreatureOrGO(15468, m_creature->GetGUID(), spell->Id);
- return;
- }
-};
-CreatureAI* GetAI_mobs_mana_tapped(Creature *_Creature)
-{
- return new mobs_mana_tappedAI (_Creature);
-}
-
-/*######
## npc_prospector_anvilward
######*/
@@ -107,18 +81,11 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
}
};
-CreatureAI* GetAI_npc_prospector_anvilward(Creature *_Creature)
+CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature)
{
- npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(_Creature);
+ npc_prospector_anvilwardAI* thisAI = new npc_prospector_anvilwardAI(pCreature);
- thisAI->AddWaypoint(0, 9294.78, -6682.51, 22.42);
- thisAI->AddWaypoint(1, 9298.27, -6667.99, 22.42);
- thisAI->AddWaypoint(2, 9309.63, -6658.84, 22.43);
- thisAI->AddWaypoint(3, 9304.43, -6649.31, 26.46);
- thisAI->AddWaypoint(4, 9298.83, -6648.00, 28.61);
- thisAI->AddWaypoint(5, 9291.06, -6653.46, 31.83, 2500);
- thisAI->AddWaypoint(6, 9289.08, -6660.17, 31.85, 5000);
- thisAI->AddWaypoint(7, 9291.06, -6653.46, 31.83);
+ thisAI->FillPointMovementListForCreature();
return (CreatureAI*)thisAI;
}
@@ -229,7 +196,7 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
questPhase = 0;
summonerGuid = 0;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_KNEEL);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
m_creature->setFaction(FACTION_FRIENDLY);
spellFlashLight = false;
@@ -268,7 +235,7 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
if ( questPhase == 1 ) {
if ( timer < diff ) {
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
m_creature->setFaction(FACTION_HOSTILE);
questPhase = 0;
@@ -539,7 +506,7 @@ bool GOHello_go_second_trial(Player *player, GameObject* _GO)
Creature* event_controller = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*_GO, MASTER_KELERUN_BLOODMOURN, true, 30);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(event_controller, u_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(player, event_controller, u_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
//cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(_GO->GetMap(), _GO));
cell_lock->Visit(cell_lock, grid_unit_searcher, *(_GO->GetMap()));
@@ -754,11 +721,6 @@ void AddSC_eversong_woods()
Script *newscript;
newscript = new Script;
- newscript->Name="mobs_mana_tapped";
- newscript->GetAI = &GetAI_mobs_mana_tapped;
- newscript->RegisterSelf();
-
- newscript = new Script;
newscript->Name= "npc_prospector_anvilward";
newscript->GetAI = &GetAI_npc_prospector_anvilward;
newscript->pGossipHello = &GossipHello_npc_prospector_anvilward;
diff --git a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
index b7a4bc03c59..4103283be43 100644
--- a/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
+++ b/src/bindings/scripts/scripts/zone/felwood/felwood.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
index f3822bcdb7a..ff30fc3f90c 100644
--- a/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
+++ b/src/bindings/scripts/scripts/zone/feralas/feralas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
index bdd36dba074..00e00b2ac90 100644
--- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
+++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -135,17 +135,21 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO)
## npc_ranger_lilatha
######*/
-#define SAY_START -1000140
-#define SAY_PROGRESS1 -1000141
-#define SAY_PROGRESS2 -1000142
-#define SAY_PROGRESS3 -1000143
-#define SAY_END1 -1000144
-#define SAY_END2 -1000145
-#define SAY_CAPTAIN_ANSWER -1000146
-
-#define QUEST_ESCAPE_FROM_THE_CATACOMBS 9212
-#define GO_CAGE 181152
-#define NPC_CAPTAIN_HELIOS 16220
+enum
+{
+ SAY_START = -1000140,
+ SAY_PROGRESS1 = -1000141,
+ SAY_PROGRESS2 = -1000142,
+ SAY_PROGRESS3 = -1000143,
+ SAY_END1 = -1000144,
+ SAY_END2 = -1000145,
+ SAY_CAPTAIN_ANSWER = -1000146,
+
+ QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
+ GO_CAGE = 181152,
+ NPC_CAPTAIN_HELIOS = 16220,
+ FACTION_SMOON_E = 1603,
+};
struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
{
@@ -249,41 +253,7 @@ CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature)
{
npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(_Creature);
- ranger_lilathaAI->AddWaypoint(0, 7545.07, -7359.87, 162.354, 4000); // Say0
- ranger_lilathaAI->AddWaypoint(1, 7550.048340, -7362.237793, 162.235657);
- ranger_lilathaAI->AddWaypoint(2, 7566.976074, -7364.315430, 161.738770);
- ranger_lilathaAI->AddWaypoint(3, 7578.830566, -7361.677734, 161.738770);
- ranger_lilathaAI->AddWaypoint(4, 7590.969238, -7359.053711, 162.257660);
- ranger_lilathaAI->AddWaypoint(5, 7598.354004, -7362.815430, 162.256683, 4000); // Say1
- ranger_lilathaAI->AddWaypoint(6, 7605.861328, -7380.424316, 161.937073);
- ranger_lilathaAI->AddWaypoint(7, 7605.295410, -7387.382813, 157.253998);
- ranger_lilathaAI->AddWaypoint(8, 7606.131836, -7393.893555, 156.941925);
- ranger_lilathaAI->AddWaypoint(9, 7615.207520, -7400.187012, 157.142639);
- ranger_lilathaAI->AddWaypoint(10, 7618.956543, -7402.652832, 158.202042);
- ranger_lilathaAI->AddWaypoint(11, 7636.850586, -7401.756836, 162.144791);
- ranger_lilathaAI->AddWaypoint(12, 7637.058105, -7404.944824, 162.206970, 4000);// Say2
- ranger_lilathaAI->AddWaypoint(13, 7636.910645, -7412.585449, 162.366425);
- ranger_lilathaAI->AddWaypoint(14, 7637.607910, -7425.591797, 162.630661);
- ranger_lilathaAI->AddWaypoint(15, 7637.816895, -7459.057129, 163.302704);
- ranger_lilathaAI->AddWaypoint(16, 7638.859863, -7470.902344, 162.517059);
- ranger_lilathaAI->AddWaypoint(17, 7641.395996, -7488.217285, 157.381287);
- ranger_lilathaAI->AddWaypoint(18, 7634.455566, -7505.451660, 154.682159);
- ranger_lilathaAI->AddWaypoint(19, 7631.906738, -7516.948730, 153.597382); // say3
- ranger_lilathaAI->AddWaypoint(20, 7622.231445, -7537.037598, 151.587112);
- ranger_lilathaAI->AddWaypoint(21, 7610.921875, -7550.670410, 149.639374);
- ranger_lilathaAI->AddWaypoint(22, 7598.229004, -7562.551758, 145.953888);
- ranger_lilathaAI->AddWaypoint(23, 7588.509277, -7577.755371, 148.294479);
- ranger_lilathaAI->AddWaypoint(24, 7567.339355, -7608.456055, 146.006485);
- ranger_lilathaAI->AddWaypoint(25, 7562.547852, -7617.417969, 148.097504);
- ranger_lilathaAI->AddWaypoint(26, 7561.508789, -7645.064453, 151.245163);
- ranger_lilathaAI->AddWaypoint(27, 7563.337402, -7654.652344, 151.227158);
- ranger_lilathaAI->AddWaypoint(28, 7565.533691, -7658.296387, 151.248886);
- ranger_lilathaAI->AddWaypoint(29, 7571.155762, -7659.118652, 151.244568);
- ranger_lilathaAI->AddWaypoint(30, 7579.119629, -7662.213867, 151.651505);
- ranger_lilathaAI->AddWaypoint(31, 7603.768066, -7667.000488, 153.997726);
- ranger_lilathaAI->AddWaypoint(32, 7603.768066, -7667.000488, 153.997726, 4000); // Say4 & Set orientation
- ranger_lilathaAI->AddWaypoint(33, 7603.768066, -7667.000488, 153.997726, 8000); // Say5 & Set orientation
- ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726);
+ ranger_lilathaAI->FillPointMovementListForCreature();
return (CreatureAI*)ranger_lilathaAI;
}
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
index a651c117d7a..e4fdbf90656 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,12 +6,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
@@ -24,7 +24,6 @@ EndScriptData */
#include "precompiled.h"
#include "def_gruuls_lair.h"
-/* Yells & Quotes */
#define SAY_AGGRO -1565010
#define SAY_SLAM1 -1565011
#define SAY_SLAM2 -1565012
@@ -36,17 +35,18 @@ EndScriptData */
#define SAY_DEATH -1565018
#define EMOTE_GROW -1565019
-/* Spells */
-#define SPELL_GROWTH 36300
-#define SPELL_CAVE_IN 36240
-#define SPELL_GROUND_SLAM 33525 // AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback)
-#define SPELL_REVERBERATION 36297 //AoE Silence
-#define SPELL_SHATTER 33654
-#define SPELL_MAGNETIC_PULL 28337
-#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made
+#define SPELL_GROWTH 36300
+#define SPELL_CAVE_IN 36240
+#define SPELL_GROUND_SLAM 33525 //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback)
+#define SPELL_REVERBERATION 36297 //AoE Silence
+#define SPELL_SHATTER 33654
+
#define SPELL_SHATTER_EFFECT 33671
#define SPELL_HURTFUL_STRIKE 33813
#define SPELL_STONED 33652 //Spell is self cast
+#define SPELL_MAGNETIC_PULL 28337
+#define SPELL_KNOCK_BACK 24199 //Knockback spell until correct implementation is made
+
#define SPELL_GRONN_LORDS_GRASP 33572 //Triggered by Ground Slam
struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
@@ -60,6 +60,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
uint32 Growth_Timer;
uint32 CaveIn_Timer;
+ uint32 CaveIn_StaticTimer;
uint32 GroundSlamTimer;
uint32 GroundSlamStage;
uint32 PerformingGroundSlam;
@@ -69,31 +70,26 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
void Reset()
{
Growth_Timer= 30000;
- CaveIn_Timer= 40000;
+ CaveIn_Timer= 27000;
+ CaveIn_StaticTimer = 30000;
GroundSlamTimer= 35000;
GroundSlamStage= 0;
PerformingGroundSlam= false;
HurtfulStrike_Timer= 8000;
Reverberation_Timer= 60000+45000;
- if(pInstance)
+ if (pInstance)
pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
- }
-
- void JustDied(Unit* Killer)
- {
- DoScriptText(SAY_DEATH, m_creature);
- if(pInstance)
- pInstance->SetData(DATA_GRUULEVENT, DONE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
void Aggro(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
- DoZoneInCombat();
- if(pInstance)
+ if (pInstance)
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
}
@@ -101,9 +97,23 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
{
switch(rand()%3)
{
- case 0: DoScriptText(SAY_SLAY1, m_creature); break;
- case 1: DoScriptText(SAY_SLAY2, m_creature); break;
- case 2: DoScriptText(SAY_SLAY3, m_creature); break;
+ case 0: DoScriptText(SAY_SLAY1, m_creature); break;
+ case 1: DoScriptText(SAY_SLAY2, m_creature); break;
+ case 2: DoScriptText(SAY_SLAY3, m_creature); break;
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+
+ if(pInstance)
+ {
+ pInstance->SetData(DATA_GRUULEVENT, DONE);
+
+ GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR));
+ if (EncounterDoor)
+ EncounterDoor->SetGoState(0); // Open the encounter door
}
}
@@ -117,14 +127,14 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
// Gruul can cast this spell up to 30 times
if (Growth_Timer < diff)
{
- DoCast(m_creature,SPELL_GROWTH);
DoScriptText(EMOTE_GROW, m_creature);
+ DoCast(m_creature,SPELL_GROWTH);
Growth_Timer = 30000;
}else Growth_Timer -= diff;
- if(PerformingGroundSlam)
+ if (PerformingGroundSlam)
{
- if(GroundSlamTimer < diff)
+ if (GroundSlamTimer < diff)
{
switch(GroundSlamStage)
{
@@ -140,7 +150,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
{
Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
- if(target && target->GetTypeId() == TYPEID_PLAYER)
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
knockback_targets.push_back(target);
}
@@ -150,7 +160,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
Unit *target = *itr;
Unit *target2 = *(knockback_targets.begin() + rand()%knockback_targets.size());
- if(target && target2)
+ if (target && target2)
{
switch(rand()%2)
{
@@ -161,7 +171,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
}
GroundSlamTimer = 7000;
- break;
+ break;
}
case 1:
@@ -181,18 +191,15 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
}
GroundSlamTimer = 5000;
-
- break;
+ break;
}
case 2:
{
//The dummy shatter spell is cast
DoCast(m_creature, SPELL_SHATTER);
-
GroundSlamTimer = 1000;
-
- break;
+ break;
}
case 3:
@@ -217,20 +224,20 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
m_creature->GetMotionMaster()->Clear();
Unit *victim = m_creature->getVictim();
- if(victim)
+ if (victim)
{
m_creature->GetMotionMaster()->MoveChase(victim);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
}
PerformingGroundSlam = false;
-
GroundSlamTimer =120000;
HurtfulStrike_Timer= 8000;
- if(Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
+
+ if (Reverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter
Reverberation_Timer += 10000;
- break;
+ break;
}
}
@@ -259,7 +266,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
if (Reverberation_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true);
- Reverberation_Timer = 30000;
+ Reverberation_Timer = 15000 + rand()%10000;
}else Reverberation_Timer -= diff;
// Cave In
@@ -268,7 +275,11 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_CAVE_IN);
- CaveIn_Timer = 20000;
+ if(CaveIn_StaticTimer >= 4000)
+ CaveIn_StaticTimer -= 2000;
+
+ CaveIn_Timer = CaveIn_StaticTimer;
+
}else CaveIn_Timer -= diff;
// Ground Slam, Gronn Lord's Grasp, Stoned, Shatter
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
index 0131d39dc48..5bf36cc1d1e 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -88,11 +88,11 @@ bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature)
OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER);
KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND);
- Maulgar = ((Creature*)Unit::GetUnit((*m_creature), MaulgarGUID));
- Kiggler = ((Creature*)Unit::GetUnit((*m_creature), KigglerGUID));
- Blindeye = ((Creature*)Unit::GetUnit((*m_creature), BlindeyeGUID));
- Olm = ((Creature*)Unit::GetUnit((*m_creature), OlmGUID));
- Krosh = ((Creature*)Unit::GetUnit((*m_creature), KroshGUID));
+ Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID));
+ Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID));
+ Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID));
+ Olm = (Unit::GetCreature((*m_creature), OlmGUID));
+ Krosh = (Unit::GetCreature((*m_creature), KroshGUID));
if(!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh)
return false;
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
{
if(Council[i])
{
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), Council[i]));
+ pCreature = (Unit::GetCreature((*m_creature), Council[i]));
if(pCreature && !pCreature->isAlive())
{
pCreature->Respawn();
@@ -268,8 +268,8 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
DoScriptText(SAY_ENRAGE, m_creature);
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
if(Phase2)
@@ -337,7 +337,7 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
if(pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
if(Maulgar)
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
@@ -441,7 +441,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
if(pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
if(Maulgar)
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
@@ -482,7 +482,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
if(target)
DoCast(target, SPELL_GREATER_POLYMORPH);
- GreaterPolymorph_Timer = 20000;
+ GreaterPolymorph_Timer = 15000 + rand()%5000;
}else GreaterPolymorph_Timer -= diff;
//LightningBolt_Timer
@@ -520,13 +520,15 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
uint32 GreaterPowerWordShield_Timer;
uint32 Heal_Timer;
+ uint32 PrayerofHealing_Timer;
ScriptedInstance* pInstance;
void Reset()
{
GreaterPowerWordShield_Timer = 5000;
- Heal_Timer = 30000;
+ Heal_Timer = 25000 + rand()%15000;
+ PrayerofHealing_Timer = 45000 + rand()%10000;
//reset encounter
if (pInstance)
@@ -547,7 +549,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
if(pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
if(Maulgar)
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
@@ -592,9 +594,16 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
if(Heal_Timer < diff)
{
DoCast(m_creature, SPELL_HEAL);
- Heal_Timer = 60000;
+ Heal_Timer = 15000 + rand()%25000;
}else Heal_Timer -= diff;
+ //PrayerofHealing_Timer
+ if (PrayerofHealing_Timer < diff)
+ {
+ DoCast(m_creature, SPELL_PRAYER_OH);
+ PrayerofHealing_Timer = 35000 + rand()%15000;
+ }else PrayerofHealing_Timer -= diff;
+
DoMeleeAttackIfReady();
}
};
@@ -638,7 +647,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
if(pInstance)
{
Creature *Maulgar = NULL;
- Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
+ Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
if(Maulgar)
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
index 145e573f02a..7003dcb1e26 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
@@ -1,19 +1,21 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_GRUULS_LAIR_H
#define DEF_GRUULS_LAIR_H
-#define DATA_BLINDEYETHESEER 1
-#define DATA_GRUULEVENT 2
-#define DATA_KIGGLERTHECRAZED 3
-#define DATA_KROSHFIREHAND 4
-#define DATA_MAULGAREVENT 5
-#define DATA_MAULGAREVENT_TANK 6
-#define DATA_OLMTHESUMMONER 7
-#define DATA_MAULGARDOOR 8
-#define DATA_GRUULDOOR 9
-#define DATA_MAULGAR 10
+#define DATA_BLINDEYETHESEER 1
+#define DATA_GRUULEVENT 2
+#define DATA_KIGGLERTHECRAZED 3
+#define DATA_KROSHFIREHAND 4
+#define DATA_MAULGAREVENT 5
+#define DATA_MAULGAREVENT_TANK 6
+#define DATA_OLMTHESUMMONER 7
+#define DATA_MAULGARDOOR 8
+#define DATA_GRUULDOOR 9
+#define DATA_MAULGAR 10
+
+#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy."
#endif
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
index 5c026ab1860..34943449b1e 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 18835: KigglerTheCrazed = creature->GetGUID(); break;
case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp
new file mode 100644
index 00000000000..0b2fc89dd97
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp
@@ -0,0 +1,55 @@
+/* Script Data Start
+SDName: Boss Drakkari Colossus
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges
+#define SPELL_EMERGE_2 54851
+#define SPELL_MIGHTY_BLOW 54719
+
+struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI
+{
+ boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase =1;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_drakkari_colossus(Creature *_Creature)
+{
+ return new boss_drakkari_colossusAI (_Creature);
+}
+
+void AddSC_boss_drakkari_colossus()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_drakkari_colossus";
+ newscript->GetAI = GetAI_boss_drakkari_colossus;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp
new file mode 100644
index 00000000000..9c518bee397
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp
@@ -0,0 +1,65 @@
+/* Script Data Start
+SDName: Boss Eck the Ferocious
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment: Only appears in Heroic mode
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
+#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy.
+#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
+#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
+#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target.
+
+struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI
+{
+ boss_eckAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 berserk;
+
+ void Reset()
+ {
+ //Source Deadly Boss Mod
+ berserk = 120000; //2min
+ }
+
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if(berserk < diff)
+ {
+ DoCast(m_creature,SPELL_ECK_BERSERK);
+ berserk = 120000;
+ }else berserk -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_eck(Creature *_Creature)
+{
+ return new boss_eckAI (_Creature);
+}
+
+void AddSC_boss_eck()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_eck";
+ newscript->GetAI = GetAI_boss_eck;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp
new file mode 100644
index 00000000000..71654de9852
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp
@@ -0,0 +1,85 @@
+/* Script Data Start
+SDName: Boss gal_darah
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ENRAGE 55285
+#define SPELL_IMPALING_CHARGE 54956
+#define SPELL_STOMP 55292
+
+#define SPELL_PUNCTURE 55276
+#define SPELL_STAMPEDE 55218
+#define SPELL_WHIRLING_SLASH 55285
+
+//Yells
+#define SAY_AGGRO -1604000
+#define SAY_SLAY_1 -1604001
+#define SAY_SLAY_2 -1604002
+#define SAY_SLAY_3 -1604003
+#define SAY_DEATH -1604004
+#define SAY_SUMMON_RHINO_1 -1604005
+#define SAY_SUMMON_RHINO_2 -1604006
+#define SAY_SUMMON_RHINO_3 -1604007
+#define SAY_TRANSFORM_1 -1604008 //Phase change
+#define SAY_TRANSFORM_2 -1604009
+
+struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI
+{
+ boss_gal_darahAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_gal_darah(Creature *_Creature)
+{
+ return new boss_gal_darahAI (_Creature);
+}
+
+void AddSC_boss_gal_darah()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_gal_darah";
+ newscript->GetAI = GetAI_boss_gal_darah;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp
new file mode 100644
index 00000000000..49afd7b8126
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp
@@ -0,0 +1,88 @@
+/* Script Data Start
+SDName: Boss moorabi
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_moorabi' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_DETERMINED_GORE 55102
+#define SPELL_DETERMINED_STAB_2 59444
+#define SPELL_DETERMINED_STAB_3 55104
+
+#define SPELL_GROUND_TREMOR 55142
+#define SPELL_MOJO_FRENZY 55163
+#define SPELL_NUMBING_ROAR_1 55100
+#define SPELL_NUMBING_ROAR_2 55106
+#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects.
+#define SPELL_QUAKE 55101
+
+//Yell
+#define SAY_AGGRO -1604010
+#define SAY_SLAY_1 -1604011
+#define SAY_SLAY_2 -1604012
+#define SAY_SLAY_3 -1604013
+#define SAY_DEATH -1604014
+#define SAY_TRANSFORM -1604015
+#define SAY_QUAKE -1604016
+
+struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI
+{
+ boss_moorabiAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ phase =1;
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_moorabi(Creature *_Creature)
+{
+ return new boss_moorabiAI (_Creature);
+}
+
+void AddSC_boss_moorabi()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_moorabi";
+ newscript->GetAI = GetAI_boss_moorabi;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp
new file mode 100644
index 00000000000..7efd16fc375
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp
@@ -0,0 +1,95 @@
+/* Script Data Start
+SDName: Boss slad_ran
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_slad_ran' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_POISON_NOVA 55081
+#define SPELL_POISON_NOVA_2 59842
+//--
+#define SPELL_POWERFUL_BITE 48287
+#define SPELL_POWERFUL_BITE_2 59840
+//--
+#define SPELL_VENOM_BOLT 54970
+#define SPELL_VENOM_BOLT_2 59839
+//At 30% HPStart summoning small serpents
+
+//Yell
+#define SAY_AGGRO -1604017
+#define SAY_SLAY_1 -1604018
+#define SAY_SLAY_2 -1604019
+#define SAY_SLAY_3 -1604020
+#define SAY_DEATH -1604021
+#define SAY_SUMMON_SNAKES -1604022 //npc 29680
+#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093)
+
+struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI
+{
+ boss_slad_ranAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30)
+ {
+ //Summon 3 snakes --> npc 29680
+ DoScriptText(SAY_SUMMON_SNAKES,m_creature);
+ }
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
+ {
+ //Summon 3 constrictors --> npc 29713
+ DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature);
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%3)
+ {
+ case 0:DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1:DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2:DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_slad_ran(Creature *_Creature)
+{
+ return new boss_slad_ranAI (_Creature);
+}
+
+void AddSC_boss_slad_ran()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_slad_ran";
+ newscript->GetAI = GetAI_boss_slad_ran;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h
new file mode 100644
index 00000000000..5f015610312
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h
@@ -0,0 +1,4 @@
+#ifndef DEF_GUNDRAK_H
+#define DEF_GUNDRAK_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp
new file mode 100644
index 00000000000..88df9e1b73c
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_gundrak.h"
+
+struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance
+{
+ instance_gundrak(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_gundrak(Map* map)
+{
+ return new instance_gundrak(map);
+}
+
+void AddSC_instance_gundrak()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_gundrak";
+ newscript->GetInstanceData = GetInstanceData_instance_gundrak;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
index 92971bf16cf..1afe49ce30e 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,18 +6,18 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Broggok
-SD%Complete: 100
-SDComment:
+SD%Complete: 70
+SDComment: pre-event not made
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
@@ -51,25 +51,32 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
}
- void UpdateAI(const uint32 diff)
+ void JustSummoned(Creature *summoned)
{
+ summoned->setFaction(16);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID());
+ }
- if (!UpdateVictim())
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim() )
return;
- if(AcidSpray_Timer < diff)
+ if (AcidSpray_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY);
AcidSpray_Timer = 4000+rand()%8000;
}else AcidSpray_Timer -=diff;
- if(PoisonBolt_Timer < diff)
+ if (PoisonBolt_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_POISON_BOLT);
PoisonBolt_Timer = 4000+rand()%8000;
}else PoisonBolt_Timer -=diff;
- if(PoisonSpawn_Timer < diff)
+ if (PoisonSpawn_Timer < diff)
{
DoCast(m_creature,SPELL_POISON_CLOUD);
PoisonSpawn_Timer = 20000;
@@ -79,17 +86,36 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
}
};
-CreatureAI* GetAI_boss_broggokAI(Creature *_Creature)
+struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI
+{
+ mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+ void MoveInLineOfSight(Unit *who) { }
+ void AttackStart(Unit *who) { }
+ void Aggro(Unit* who) { }
+};
+
+CreatureAI* GetAI_boss_broggok(Creature *_Creature)
{
return new boss_broggokAI (_Creature);
}
+CreatureAI* GetAI_mob_broggok_poisoncloud(Creature *_Creature)
+{
+ return new mob_broggok_poisoncloudAI (_Creature);
+}
+
void AddSC_boss_broggok()
{
Script *newscript;
newscript = new Script;
- newscript->Name="boss_broggok";
- newscript->GetAI = &GetAI_boss_broggokAI;
+ newscript->Name = "boss_broggok";
+ newscript->GetAI = &GetAI_boss_broggok;
newscript->RegisterSelf();
-}
+ newscript = new Script;
+ newscript->Name = "mob_broggok_poisoncloud";
+ newscript->GetAI = &GetAI_mob_broggok_poisoncloud;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
index 64bd8e04de1..8c118a022ea 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -62,12 +62,6 @@ const float ShadowmoonChannelers[5][4]=
{316,-109,-24.6,1.257}
};
-class TRINITY_DLL_DECL BurningNovaAura : public Aura
-{
- public:
- BurningNovaAura(SpellEntry *spell, uint32 eff, Unit *target, Unit *caster) : Aura(spell, eff, NULL, target, caster, NULL){}
-};
-
struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
{
boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
@@ -234,12 +228,14 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA))
{
- for(uint32 i = 0; i < 3; ++i)
- if(nova->Effect[i] == SPELL_EFFECT_APPLY_AURA)
- {
- Aura *Aur = new BurningNovaAura(nova, i, m_creature, m_creature);
- m_creature->AddAura(Aur);
- }
+ uint8 eff_mask=0;
+ for (int i=0; i<3; i++)
+ {
+ if (!nova->Effect[i])
+ continue;
+ eff_mask|=1<<i;
+ }
+ m_creature->AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature));
}
if (HeroicMode)
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
index 65c98d5ef8d..e1ea1e03b2f 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
index 0dce1fe51d9..e6b8593d0c0 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
index 042291b330a..e955c537bf6 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
index 3e001888752..50db6680e94 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
@@ -257,7 +257,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i)
{
Unit *clicker = Unit::GetUnit(*m_creature, (*i).second);
- if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP, 1))
+ if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP))
{
DebuffClicker(clicker);
(*i).second = 0;
@@ -265,12 +265,12 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
}
// if 5 clickers from other cubes apply shadow cage
- if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
+ if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true);
}
- else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
+ else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE))
m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
if(!ClickerNum) NeedCheckCube = false;
@@ -510,7 +510,7 @@ bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO)
if(!Magtheridon || !Magtheridon->isAlive()) return true;
// if exhausted or already channeling return
- if(player->HasAura(SPELL_MIND_EXHAUSTION, 0) || player->HasAura(SPELL_SHADOW_GRASP, 1))
+ if(player->HasAura(SPELL_MIND_EXHAUSTION) || player->HasAura(SPELL_SHADOW_GRASP))
return true;
player->InterruptNonMeleeSpells(false);
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
index 3c0012ce447..c5469acaea0 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
index ea51e575824..1bdce52aea9 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
Creature *Magtheridon = instance->GetCreatureInMap(MagtheridonGUID);
if(Magtheridon && Magtheridon->isAlive())
{
- Magtheridon->TextEmote("'s bonds begin to weaken!", 0);
+ Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0);
CageTimer = 120000;
}
if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
index 320c6a0b0a4..a18579ccfa9 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -183,10 +183,11 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
- if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
- {
- if (!IntroOnce && m_creature->IsWithinDistInMap(who, 75))
+ if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f))
{
+ if (who->GetTypeId() != TYPEID_PLAYER)
+ return;
+
DoScriptText(SAY_INTRO, m_creature);
IntroOnce = true;
IsIntroEvent = true;
@@ -195,19 +196,10 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
}
- if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE )
- return;
-
if (IsIntroEvent || !IsMainEvent)
return;
- float attackRadius = m_creature->GetAttackDistance(who);
- if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
- {
- //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- AttackStart(who);
- }
- }
+ ScriptedAI::MoveInLineOfSight(who);
}
void Aggro(Unit *who)
@@ -222,9 +214,13 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
- summoned->setFaction(14);
+ summoned->setFaction(16);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid?
+ summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true);
+ summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID());
}
void KilledUnit(Unit* victim)
@@ -340,20 +336,24 @@ struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI
if (pInstance->GetData64(DATA_NETHEKURSE))
{
Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
- if (pKurse)
+ if (pKurse && m_creature->GetDistance(pKurse) < 45.0f)
+ {
((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonAggro();
- }
- if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
- return;
- else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
- }
+ if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS )
+ return;
+ else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS);
+ }
+ }
+ }
}
void JustDied(Unit* Killer)
{
if (pInstance)
{
+ if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS)
+ return;
if (pInstance->GetData64(DATA_NETHEKURSE))
{
Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
@@ -383,39 +383,10 @@ struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI
{
mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {}
- bool Start;
- uint32 Stop_Timer;
-
- void Reset()
- {
- Start = false;
- Stop_Timer = 30000;
- }
-
+ void Reset() { }
+ void MoveInLineOfSight(Unit *who) { }
+ void AttackStart(Unit* who) { }
void Aggro(Unit* who) { }
-
- void MoveInLineOfSight(Unit *who) { return; }
-
- void AttackStart(Unit* who) { return; }
-
- void UpdateAI(const uint32 diff)
- {
- if (!Start)
- {
- //triggered spell of consumption does not properly show it's SpellVisual, hack it a bit
- m_creature->CastSpell(m_creature,SPELL_TEMPORARY_VISUAL,true);
- m_creature->CastSpell(m_creature,SPELL_CONSUMPTION,false);
- Start = true;
- }
-
- if (Stop_Timer < diff)
- {
- m_creature->setDeathState(JUST_DIED);
- m_creature->SetHealth(0);
- m_creature->CombatStop();
- m_creature->DeleteThreatList();
- }else Stop_Timer -= diff;
- }
};
CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature *_Creature)
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
index c565d6ab08e..b8c6162a809 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -156,8 +156,6 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
void Reset()
{
- m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
LeftHead = 0;
RightHead = 0;
@@ -175,6 +173,9 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
ThunderClap_Timer = 15000;
ResetThreat_Timer = 30000;
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
+
if (pInstance)
pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid.
}
@@ -202,8 +203,8 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
- DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1800000);
+ DoSpawnCreature(ENTRY_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,90000);
+ DoSpawnCreature(ENTRY_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,90000);
if (Unit *Left = Unit::GetUnit(*m_creature,LeftHead))
{
@@ -357,19 +358,19 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
DoResetThreat();
m_creature->AddThreat(target, 0.0f);
}
- ResetThreat_Timer = 35000+rand()%10000;
+ ResetThreat_Timer = 25000+rand()%15000;
}else ResetThreat_Timer -= diff;
if (Fear_Timer < diff)
{
DoCast(m_creature,SPELL_FEAR);
- Fear_Timer = 15000+rand()%25000;
+ Fear_Timer = 15000+rand()%20000;
}else Fear_Timer -= diff;
if (ThunderClap_Timer < diff)
{
DoCast(m_creature,SPELL_THUNDERCLAP);
- ThunderClap_Timer = 25000+rand()%15000;
+ ThunderClap_Timer = 15000+rand()%15000;
}else ThunderClap_Timer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
index 8c4b24421c6..e72c0adc8e9 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp
@@ -1,6 +1,39 @@
-/* Copyright (C) 2008 - 2009 BroodWyrm */
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Warchief_Kargath_Bladefist
+SD%Complete: 90
+SDComment:
+SDCategory: Hellfire Citadel, Shattered Halls
+EndScriptData */
+
+/* ContentData
+boss_warchief_kargath_bladefist
+EndContentData */
+
#include "precompiled.h"
+#define SAY_AGGRO1 -1540042
+#define SAY_AGGRO2 -1540043
+#define SAY_AGGRO3 -1540044
+#define SAY_SLAY1 -1540045
+#define SAY_SLAY2 -1540046
+#define SAY_DEATH -1540047
+
#define SPELL_BLADE_DANCE 30739
#define H_SPELL_CHARGE 25821
@@ -11,23 +44,10 @@
#define MOB_SHARPSHOOTER_GUARD 17622
#define MOB_REAVER_GUARD 17623
-float AssassEntrance[3] = {275.136,-84.29,2.3}; // y +-8
-float AssassExit[3] = {184.233,-84.29,2.3}; // y +-8
+float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8
+float AssassExit[3] = {184.233,-84.29,2.3}; // y -8
float AddsEntrance[3] = {306.036,-84.29,1.93};
-#define SOUND_AGGRO1 10323
-#define SAY_AGGRO1 "Ours is the true Horde! The only Horde!"
-#define SOUND_AGGRO2 10324
-#define SAY_AGGRO2 "I'll carve the meat from your bones!"
-#define SOUND_AGGRO3 10325
-#define SAY_AGGRO3 "I am called Bladefist for a reason, as you will see!"
-#define SOUND_SLAY1 10326
-#define SAY_SLAY1 "For the real Horde!"
-#define SOUND_SLAY2 10327
-#define SAY_SLAY2 "I am the only Warchief!"
-#define SOUND_DEATH 10328
-#define SAY_DEATH "The true Horde... will.. prevail.."
-
struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
{
boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c)
@@ -67,8 +87,8 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
Wait_Timer = 0;
Charge_timer = 0;
- Blade_Dance_Timer = 30000;
- Summon_Assistant_Timer = 15000;
+ Blade_Dance_Timer = 45000;
+ Summon_Assistant_Timer = 30000;
Assassins_Timer = 5000;
resetcheck_timer = 5000;
}
@@ -77,18 +97,9 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
{
switch (rand()%3)
{
- case 0:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- break;
- case 2:
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- break;
+ case 0:DoScriptText(SAY_AGGRO1, m_creature);break;
+ case 1:DoScriptText(SAY_AGGRO2, m_creature);break;
+ case 2:DoScriptText(SAY_AGGRO3, m_creature);break;
}
}
@@ -114,22 +125,15 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
{
switch(rand()%2)
{
- case 0:
- DoPlaySoundToSet(m_creature, SOUND_SLAY1);
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- break;
- case 1:
- DoPlaySoundToSet(m_creature, SOUND_SLAY2);
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- break;
+ case 0: DoScriptText(SAY_SLAY1, m_creature); break;
+ case 1: DoScriptText(SAY_SLAY2, m_creature); break;
}
}
}
void JustDied(Unit* Killer)
{
- DoPlaySoundToSet(m_creature, SOUND_DEATH);
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
+ DoScriptText(SAY_DEATH, m_creature);
removeAdds();
}
@@ -180,15 +184,16 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
}
void SpawnAssassin()
{
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
- m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
+ m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
}
void UpdateAI(const uint32 diff)
{
- if (!UpdateVictim() )
+ //Return since we have no target
+ if (!UpdateVictim())
return;
if(Assassins_Timer)
@@ -250,30 +255,29 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
if (Summon_Assistant_Timer < diff)
{
Unit* target = NULL;
- Creature* Summoned;
for(int i = 0; i < summoned; i++)
{
switch(rand()%3)
{
- case 0: Summoned = m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break;
- case 1: Summoned = m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break;
- case 2: Summoned = m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); break;
+ case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
+ case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
+ case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break;
}
}
if(rand()%100 < 20) summoned++;
- Summon_Assistant_Timer = 15000 + (rand()%5000) ;
+ Summon_Assistant_Timer = 25000 + (rand()%10000) ;
}else Summon_Assistant_Timer -= diff;
DoMeleeAttackIfReady();
}
- if(resetcheck_timer < diff)
+ if (resetcheck_timer < diff)
{
uint32 tempx,tempy;
- tempx = m_creature->GetPositionX();
- tempy = m_creature->GetPositionY();
- if ( tempx > 255 || tempx < 205)
+ tempx = uint32(m_creature->GetPositionX());
+ tempy = uint32(m_creature->GetPositionY());
+ if (tempx > 255 || tempx < 205)
{
EnterEvadeMode();
}
@@ -292,7 +296,7 @@ void AddSC_boss_warchief_kargath_bladefist()
Script *newscript;
newscript = new Script;
newscript->Name="boss_warchief_kargath_bladefist";
- newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist;
+ newscript->GetAI = GetAI_boss_warchief_kargath_bladefist;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
index cb3a06055cb..cbfa23ec4e0 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
index aa2817ca994..b606ff0f97e 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
index b9e3b9d752f..fbb86e6cabf 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/boss_doomlord_kazzak.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
index cba3a107af6..2adbc632155 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_peninsula/hellfire_peninsula.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -293,8 +293,6 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
break;
case 13:
DoScriptText(SAY_ELF_RESTING, m_creature, player);
- // make the NPC kneel
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
break;
case 14:
DoScriptText(SAY_ELF_SUMMON2, m_creature, player);
@@ -349,38 +347,11 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
}
};
-CreatureAI* GetAI_npc_wounded_blood_elf(Creature *_Creature)
+CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature)
{
- npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(_Creature);
-
- welfAI->AddWaypoint(0, -1137.72, 4272.10, 14.04, 5000);
- welfAI->AddWaypoint(1, -1141.34, 4232.42, 14.63);
- welfAI->AddWaypoint(2, -1133.47, 4220.88, 11.78);
- welfAI->AddWaypoint(3, -1126.18, 4213.26, 13.51);
- welfAI->AddWaypoint(4, -1100.12, 4204.32, 16.41);
- welfAI->AddWaypoint(5, -1063.68, 4197.92, 15.51);
- welfAI->AddWaypoint(6, -1027.28, 4194.36, 15.52);
- welfAI->AddWaypoint(7, -995.68, 4189.59, 19.84);
- welfAI->AddWaypoint(8, -970.90, 4188.60, 24.61);
- welfAI->AddWaypoint(9, -961.93, 4193.34, 26.11, 15000); // Summon 1
- welfAI->AddWaypoint(10, -935.52, 4210.99, 31.98);
- welfAI->AddWaypoint(11, -913.42, 4218.27, 37.29);
- welfAI->AddWaypoint(12, -896.53, 4207.73, 43.23);
- welfAI->AddWaypoint(13, -868.49, 4194.77, 46.75, 30000);// Kneel and Rest Here
- welfAI->AddWaypoint(14, -852.83, 4198.29, 47.28, 15000);// Summon 2
- welfAI->AddWaypoint(15, -819.85, 4200.50, 46.37);
- welfAI->AddWaypoint(16, -791.92, 4201.96, 44.19);
- welfAI->AddWaypoint(17, -774.42, 4202.46, 47.41);
- welfAI->AddWaypoint(18, -762.90, 4202.17, 48.81);
- welfAI->AddWaypoint(19, -728.25, 4195.35, 50.68);
- welfAI->AddWaypoint(20, -713.58, 4192.07, 53.98);
- welfAI->AddWaypoint(21, -703.09, 4189.74, 56.96);
- welfAI->AddWaypoint(22, -693.70, 4185.43, 57.06);
- welfAI->AddWaypoint(23, -686.38, 4159.81, 60.26);
- welfAI->AddWaypoint(24, -679.88, 4147.04, 64.20);
- welfAI->AddWaypoint(25, -656.74, 4147.72, 64.11);
- welfAI->AddWaypoint(26, -652.22, 4137.50, 64.58);
- welfAI->AddWaypoint(27, -649.99, 4136.38, 64.63, 30000);// Award Quest Credit
+ npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(pCreature);
+
+ welfAI->FillPointMovementListForCreature();
return (CreatureAI*)welfAI;
}
diff --git a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
index 674bf56bb26..b17a280391a 100644
--- a/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
+++ b/src/bindings/scripts/scripts/zone/ironforge/ironforge.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
index 900a5ae3d5b..70a77302823 100644
--- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
+++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
if(!caster)
return;
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0))
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE))
{
PlayerGUID = caster->GetGUID();
if(PlayerGUID)
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
index 9c5563e8ac8..c71870b3232 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,18 +6,18 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Curator
SD%Complete: 100
-SDComment: Evocation may cause client crash (Core related)
+SDComment:
SDCategory: Karazhan
EndScriptData */
@@ -34,10 +34,6 @@ EndScriptData */
//Flare spell info
#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
-#define SPELL_ASTRAL_FLARE_NE 30236
-#define SPELL_ASTRAL_FLARE_NW 30239
-#define SPELL_ASTRAL_FLARE_SE 30240
-#define SPELL_ASTRAL_FLARE_SW 30241
//Curator spell info
#define SPELL_HATEFUL_BOLT 30383
@@ -45,7 +41,7 @@ EndScriptData */
#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
#define SPELL_BERSERK 26662
-struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
+struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
{
boss_curatorAI(Creature *c) : ScriptedAI(c) {}
@@ -69,8 +65,8 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
{
switch(rand()%2)
{
- case 0: DoScriptText(SAY_KILL1, m_creature); break;
- case 1: DoScriptText(SAY_KILL2, m_creature); break;
+ case 0: DoScriptText(SAY_KILL1, m_creature); break;
+ case 1: DoScriptText(SAY_KILL2, m_creature); break;
}
}
@@ -89,18 +85,38 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
if (!UpdateVictim() )
return;
- if (Evocating && !m_creature->HasAura(SPELL_EVOCATION, 0))
- Evocating = false;
+ //always decrease BerserkTimer
+ if (BerserkTimer < diff)
+ {
+ //if evocate, then break evocate
+ if (Evocating)
+ {
+ if (m_creature->HasAura(SPELL_EVOCATION))
+ m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION);
+
+ Evocating = false;
+ }
+
+ //may not be correct SAY (generic hard enrage)
+ DoScriptText(SAY_ENRAGE, m_creature);
- if (m_creature->GetPower(POWER_MANA) <= 1000 && !Evocating)
+ m_creature->InterruptNonMeleeSpells(true);
+ DoCast(m_creature, SPELL_BERSERK);
+
+ //don't know if he's supposed to do summon/evocate after hard enrage (probably not)
+ Enraged = true;
+ }else BerserkTimer -= diff;
+
+ if (Evocating)
{
- DoScriptText(SAY_EVOCATE, m_creature);
- m_creature->InterruptNonMeleeSpells(false);
- DoCast(m_creature, SPELL_EVOCATION);
- Evocating = true;
+ //not supposed to do anything while evocate
+ if (m_creature->HasAura(SPELL_EVOCATION))
+ return;
+ else
+ Evocating = false;
}
- if (!Enraged && !Evocating)
+ if (!Enraged)
{
if (AddTimer < diff)
{
@@ -113,29 +129,40 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
{
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
AstralFlare->AI()->AttackStart(target);
+ AstralFlare->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ AstralFlare->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
- //Reduce Mana by 10%
- int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA)));
- m_creature->ModifyPower(POWER_MANA, -mana);
- switch(rand()%4)
+ //Reduce Mana by 10% of max health
+ if (int32 mana = m_creature->GetMaxPower(POWER_MANA))
{
- case 0: DoScriptText(SAY_SUMMON1, m_creature);break;
- case 1: DoScriptText(SAY_SUMMON2, m_creature);break;
+ mana /= 10;
+ m_creature->ModifyPower(POWER_MANA, -mana);
+
+ //if this get's us below 10%, then we evocate (the 10th should be summoned now)
+ if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10)
+ {
+ DoScriptText(SAY_EVOCATE, m_creature);
+ m_creature->InterruptNonMeleeSpells(false);
+ DoCast(m_creature, SPELL_EVOCATION);
+ Evocating = true;
+ //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
+ return;
+ }
+ else
+ {
+ switch(rand()%4)
+ {
+ case 0: DoScriptText(SAY_SUMMON1, m_creature); break;
+ case 1: DoScriptText(SAY_SUMMON2, m_creature); break;
+ }
+ }
}
+
AddTimer = 10000;
}else AddTimer -= diff;
- if (HatefulBoltTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
- DoCast(target, SPELL_HATEFUL_BOLT);
-
- HatefulBoltTimer = 15000;
- }else HatefulBoltTimer -= diff;
-
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15)
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15)
{
Enraged = true;
DoCast(m_creature, SPELL_ENRAGE);
@@ -143,11 +170,17 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
}
}
- if (BerserkTimer < diff)
+ if (HatefulBoltTimer < diff)
{
- DoCast(m_creature, SPELL_BERSERK);
- DoScriptText(SAY_ENRAGE, m_creature);
- }else BerserkTimer -= diff;
+ if (Enraged)
+ HatefulBoltTimer = 7000;
+ else
+ HatefulBoltTimer = 15000;
+
+ if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
+ DoCast(target, SPELL_HATEFUL_BOLT);
+
+ }else HatefulBoltTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -162,8 +195,7 @@ void AddSC_boss_curator()
{
Script *newscript;
newscript = new Script;
- newscript->Name="boss_curator";
+ newscript->Name = "boss_curator";
newscript->GetAI = &GetAI_boss_curator;
newscript->RegisterSelf();
}
-
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
index 230b31c69bb..95e34e85622 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -51,9 +51,9 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
void Reset()
{
- Repentance_Timer = 30000+(rand()%15000);
+ Repentance_Timer = 25000+(rand()%15000);
Holyfire_Timer = 8000+(rand()%17000);
- Holywrath_Timer = 20000+(rand()%10000);
+ Holywrath_Timer = 15000+(rand()%10000);
Holyground_Timer = 3000;
Enrage_Timer = 600000;
@@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
case 0: DoScriptText(SAY_REPENTANCE1, m_creature);break;
case 1: DoScriptText(SAY_REPENTANCE2, m_creature);break;
}
- Repentance_Timer = 30000 + rand()%15000; //A little randomness on that spell
+ Repentance_Timer = 25000 + rand()%10000; //A little randomness on that spell
}else Repentance_Timer -= diff;
if (Holyfire_Timer < diff)
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYFIRE);
- Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row!
+ Holyfire_Timer = 8000 + rand()%15000; //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
}else Holyfire_Timer -= diff;
if (Holywrath_Timer < diff)
@@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYWRATH);
- Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice
+ Holywrath_Timer = 20000+(rand()%5000); //20-30 secs sounds nice
}else Holywrath_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
index 8bb8a5edbcd..e488ea26810 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -185,6 +185,9 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
void Reset()
{
ResetTimer = 2000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
}
void Aggro(Unit* who) {}
@@ -283,6 +286,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
{
((boss_midnightAI*)(pMidnight->AI()))->Mount(m_creature);
m_creature->SetHealth(pMidnight->GetHealth());
+ DoResetThreat();
}
}
}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
index 0d3f6f010c6..b0457b49359 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
- if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0))
+ if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE))
i->getSource()->RemoveAurasDueToSpell(SPELL_GARROTE);
}
}
@@ -320,6 +320,8 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
m_creature->setFaction(16);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
m_creature->AI()->AttackStart(m_creature->getVictim());
InVanish = false;
}else Wait_Timer -= diff;
@@ -540,7 +542,7 @@ struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
{
//Holy Priest
- boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {}
+ boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {Reset();}
uint32 DispelMagic_Timer;
uint32 GreaterHeal_Timer;
@@ -610,7 +612,7 @@ struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guest
struct TRINITY_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
{
//Holy Pally
- boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {}
+ boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {Reset();}
uint32 Cleanse_Timer;
uint32 GreaterBless_Timer;
@@ -727,7 +729,7 @@ struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI
struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
{
//Arms Warr
- boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {}
+ boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {Reset();}
uint32 Disarm_Timer;
uint32 HeroicStrike_Timer;
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
index b074dc920c1..6db1b193234 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
index 96f58bd3a3c..fd7e6176433 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -134,9 +134,9 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
void HandleTerraceDoors(bool open)
{
if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1)))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ Door->SetGoState(open ? 0 : 1);
if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2)))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ Door->SetGoState(open ? 0 : 1);
}
void Aggro(Unit *who)
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
index 3de8e352ded..54c04f59743 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -37,7 +37,7 @@ EndScriptData */
#define SAY_SUMMON2 -1532101
#define SAY_DEATH -1532102
-// 19 Coordinates for Infernal spawns
+// 18 Coordinates for Infernal spawns
struct InfernalPoint
{
float x,y;
@@ -64,11 +64,10 @@ static InfernalPoint InfernalPoints[] =
{-10948.8, -2005.1},
{-10984.0, -2019.3},
{-10932.8, -1979.6},
- {-10932.8, -1979.6},
{-10935.7, -1996.0}
};
-#define TOTAL_INFERNAL_POINTS 19
+#define TOTAL_INFERNAL_POINTS 18
//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends
//Along with reducing healing and regen while enfeebled to 0%
@@ -81,9 +80,10 @@ static InfernalPoint InfernalPoints[] =
#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though)
#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2
#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2
-#define SPELL_THRASH_AURA 3417 //Passive proc chance for thrash
+#define SPELL_THRASH_AURA 12787 //Passive proc chance for thrash
#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping
-#define SPELL_AMPLIFY_DAMAGE 12738 //Amplifiy during phase 3
+#define SPELL_AMPLIFY_DAMAGE 39095 //Amplifiy during phase 3
+#define SPELL_CLEAVE 30131 //Same as Nightbane.
#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura
#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature
#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3
@@ -168,6 +168,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
uint32 SWPainTimer;
uint32 SunderArmorTimer;
uint32 AmplifyDamageTimer;
+ uint32 Cleave_Timer;
uint32 InfernalTimer;
uint32 AxesTargetSwitchTimer;
uint32 InfernalCleanupTimer;
@@ -196,12 +197,14 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
EnfeebleTimer = 30000;
EnfeebleResetTimer = 38000;
- ShadowNovaTimer = 35000;
+ ShadowNovaTimer = 35500;
SWPainTimer = 20000;
- AmplifyDamageTimer = 10000;
+ AmplifyDamageTimer = 5000;
+ Cleave_Timer = 8000;
InfernalTimer = 45000;
InfernalCleanupTimer = 47000;
AxesTargetSwitchTimer = 7500 + rand()%12500;
+ SunderArmorTimer = 5000 + rand()%5000;
phase = 1;
if(pInstance)
@@ -288,11 +291,11 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
void ClearWeapons()
{
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
@@ -432,11 +435,11 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true);
//models
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, AXE_EQUIP_MODEL);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, AXE_EQUIP_MODEL);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, AXE_EQUIP_MODEL);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
@@ -474,8 +477,8 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if(axe)
{
- axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, AXE_EQUIP_MODEL);
- axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
+ axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, AXE_EQUIP_MODEL);
+ //axe->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO);
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
axe->setFaction(m_creature->getFaction());
@@ -499,9 +502,16 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if(SunderArmorTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
- SunderArmorTimer = 15000;
+ SunderArmorTimer = 10000 + rand()%8000;
}else SunderArmorTimer -= diff;
+
+ if (Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_CLEAVE);
+ Cleave_Timer = 6000 + rand()%6000;
+
+ }else Cleave_Timer -= diff;
}
else
{
@@ -543,13 +553,13 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if(InfernalTimer < diff)
{
SummonInfernal(diff);
- InfernalTimer = phase == 3 ? 15000 : 45000; //15 secs in phase 3, 45 otherwise
+ InfernalTimer = phase == 3 ? 14500 : 44500; //15 secs in phase 3, 45 otherwise
}else InfernalTimer -= diff;
if(ShadowNovaTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
- ShadowNovaTimer = phase == 3 ? 35000 : -1;
+ ShadowNovaTimer = phase == 3 ? 31000 : -1;
}else ShadowNovaTimer -= diff;
if(phase != 2)
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
index f98d85f9125..98aa93f3b8d 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -273,8 +273,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true);
m_creature->CastSpell(m_creature, SPELL_CONJURE, false);
m_creature->CastSpell(m_creature, SPELL_DRINK, false);
- //Sitting down
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1);
+ m_creature->SetStandState(UNIT_STAND_STATE_SIT);
DrinkInturruptTimer = 10000;
}
}
@@ -284,7 +283,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
{
Drinking = false;
m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
m_creature->CastSpell(m_creature, SPELL_POTION, false);
}
@@ -295,7 +294,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
DrinkInturruptTimer -= diff;
else
{
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->CastSpell(m_creature, SPELL_POTION, true);
m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false);
DrinkInturrupted = true;
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
index 4cbe59aabb5..13dd8feab34 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -45,11 +45,10 @@ EndScriptData */
#define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast
#define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast
-#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
+#define SPELL_FIREBOLT 30050 // Blasts a target for 150 Fire damage.
#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%.
#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec.
-#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage.
#define CREATURE_DEMONCHAINS 17248
#define CREATURE_FIENDISHIMP 17267
@@ -79,8 +78,7 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
void Reset()
{
TerestianGUID = 0;
-
- AmplifyTimer = 0;
+ AmplifyTimer = 2000;
}
void Aggro(Unit *who)
@@ -121,13 +119,10 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES);
- AmplifyTimer = 20000;
+ AmplifyTimer = 10000 + rand()%10000;
}else AmplifyTimer -= diff;
- //Chain cast
- if (!m_creature->IsNonMeleeSpellCasted(false) && m_creature->IsWithinDistInMap(m_creature->getVictim(), 30))
- DoCast(m_creature->getVictim(),SPELL_FIREBOLT);
- else DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
}
};
@@ -161,6 +156,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
{
boss_terestianAI(Creature *c) : ScriptedAI(c)
{
+ for(uint8 i = 0; i < 2; ++i)
+ PortalGUID[i] = 0;
pInstance = ((ScriptedInstance*)c->GetInstanceData());
}
@@ -175,6 +172,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
uint32 SummonTimer;
uint32 BerserkTimer;
+ bool ReSummon;
bool SummonKilrek;
bool SummonedPortals;
bool Berserk;
@@ -201,6 +199,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
SummonedPortals = false;
Berserk = false;
+ ReSummon = false;
if(pInstance)
pInstance->SetData(DATA_TERESTIAN_EVENT, NOT_STARTED);
@@ -212,8 +211,14 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
if(pInstance)
{
- // Put Kil'rek in combat against our target so players don't skip him
Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK)));
+ // Respawn Kil'rek on aggro if Kil'rek is dead.
+ if (Kilrek && !Kilrek->isAlive())
+ {
+ Kilrek->Respawn();
+ }
+
+ // Put Kil'rek in combat against our target so players don't skip him
if(Kilrek && !Kilrek->getVictim())
Kilrek->AddThreat(who, 1.0f);
@@ -257,18 +262,22 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
if(CheckKilrekTimer < diff)
{
+
CheckKilrekTimer = 5000;
if(pInstance)
uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK);
else ERROR_INST_DATA(m_creature);
- Creature* Kilrek = (Unit::GetCreature((*m_creature), KilrekGUID));
+ Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK)));
if(SummonKilrek && Kilrek)
{
Kilrek->Respawn();
if(Kilrek->AI())
+ {
Kilrek->AI()->AttackStart(m_creature->getVictim());
+ m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
+ }
SummonKilrek = false;
}
@@ -355,7 +364,9 @@ struct TRINITY_DLL_DECL mob_karazhan_impAI : public ScriptedAI
void Reset()
{
- FireboltTimer = 3000;
+ FireboltTimer = 2000;
+
+ m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
void Aggro(Unit *who) {}
@@ -369,7 +380,7 @@ struct TRINITY_DLL_DECL mob_karazhan_impAI : public ScriptedAI
if(FireboltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
- FireboltTimer = 1500;
+ FireboltTimer = 2200;
}else FireboltTimer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
index cd404e2ff15..2fa0184bd42 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -91,7 +91,7 @@ void SummonCroneIfReady(ScriptedInstance* pInstance, Creature *_Creature)
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, 0); // Increment DeathCount
if(pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4)
{
- Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ Creature* Crone = _Creature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, _Creature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if(Crone)
{
if(_Creature->getVictim())
@@ -117,7 +117,6 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
bool SummonedTito;
bool TitoDied;
- bool InCombat;
void Reset()
{
@@ -129,7 +128,6 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
SummonedTito = false;
TitoDied = false;
- InCombat = false;
}
void Aggro(Unit* who)
@@ -205,13 +203,11 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
mob_titoAI(Creature* c) : ScriptedAI(c) {}
uint64 DorotheeGUID;
-
uint32 YipTimer;
void Reset()
{
DorotheeGUID = 0;
-
YipTimer = 10000;
}
@@ -247,7 +243,7 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
void boss_dorotheeAI::SummonTito()
{
- Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if(Tito)
{
DoScriptText(SAY_DOROTHEE_SUMMON, m_creature);
@@ -301,8 +297,15 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI
void SpellHit(Unit* caster, const SpellEntry *Spell)
{
- if((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
+ if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
+ {
+ /*
+ if (not direct damage(aoe,dot))
+ return;
+ */
+
DoCast(m_creature, SPELL_BURNING_STRAW, true);
+ }
}
void JustDied(Unit* killer)
@@ -569,9 +572,13 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI
if(pInstance)
{
pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
+
+ if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
+ lDoor->SetGoState(0);
+ if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
+ rDoor->SetGoState(0);
+ if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
}
@@ -620,7 +627,7 @@ struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if(!m_creature->HasAura(SPELL_KNOCKBACK, 0))
+ if(!m_creature->HasAura(SPELL_KNOCKBACK))
DoCast(m_creature, SPELL_KNOCKBACK, true);
if(MoveTimer < diff)
@@ -705,7 +712,7 @@ bool GossipSelect_npc_grandmother(Player* player, Creature* _Creature, uint32 se
_Creature->SetVisibility(VISIBILITY_OFF);
float x,y,z;
_Creature->GetPosition(x,y,z);
- Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
+ Creature* BigBadWolf = _Creature->SummonCreature(CREATURE_BIG_BAD_WOLF, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if(BigBadWolf)
{
BigBadWolf->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -760,9 +767,13 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
if(pInstance)
{
pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
+
+ if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
+ lDoor->SetGoState(0);
+ if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
+ rDoor->SetGoState(0);
+ if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
}
@@ -795,8 +806,8 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
else
{
IsChasing = false;
- Unit* target = Unit::GetUnit((*m_creature), HoodGUID);
- if(target)
+
+ if (Unit* target = Unit::GetUnit((*m_creature), HoodGUID))
{
HoodGUID = 0;
if(DoGetThreat(target))
@@ -868,9 +879,9 @@ CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature)
#define SPELL_RES_VISUAL 24171
/*** Misc. Information ****/
-#define CREATURE_ROMULO 17533
-#define ROMULO_X -10900
-#define ROMULO_Y -1758
+#define CREATURE_ROMULO 17533
+#define ROMULO_X -10900
+#define ROMULO_Y -1758
enum RAJPhase
{
@@ -881,32 +892,28 @@ enum RAJPhase
void PretendToDie(Creature* _Creature)
{
- _Creature->InterruptNonMeleeSpells(false);
+ _Creature->InterruptNonMeleeSpells(true);
+ _Creature->RemoveAllAuras();
_Creature->SetHealth(0);
- _Creature->ClearComboPointHolders();
- _Creature->RemoveAllAurasOnDeath();
- _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
- _Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
_Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- _Creature->ClearAllReactives();
- _Creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
- _Creature->GetMotionMaster()->Clear();
+ _Creature->GetMotionMaster()->MovementExpired(false);
_Creature->GetMotionMaster()->MoveIdle();
- _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ _Creature->SetStandState(UNIT_STAND_STATE_DEAD);
};
void Resurrect(Creature* target)
{
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->SetHealth(target->GetMaxHealth());
- target->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ target->SetStandState(UNIT_STAND_STATE_STAND);
target->CastSpell(target, SPELL_RES_VISUAL, true);
if(target->getVictim())
{
- target->SetUInt64Value(UNIT_FIELD_TARGET, target->getVictim()->GetGUID());
target->GetMotionMaster()->MoveChase(target->getVictim());
target->AI()->AttackStart(target->getVictim());
}
+ else
+ target->GetMotionMaster()->Initialize();
};
struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
@@ -920,18 +927,21 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
ScriptedInstance* pInstance;
+ uint32 EntryYellTimer;
+ uint32 AggroYellTimer;
+
uint64 RomuloGUID;
uint32 Phase;
- uint32 EntryYellTimer;
- uint32 AggroYellTimer;
uint32 BlindingPassionTimer;
uint32 DevotionTimer;
uint32 EternalAffectionTimer;
uint32 PowerfulAttractionTimer;
uint32 SummonRomuloTimer;
uint32 ResurrectTimer;
+ uint32 DrinkPoisonTimer;
+ uint32 ResurrectSelfTimer;
bool IsFakingDeath;
bool SummonedRomulo;
@@ -947,15 +957,18 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
- RomuloGUID = 0;
}
+ RomuloGUID = 0;
Phase = PHASE_JULIANNE;
BlindingPassionTimer = 30000;
DevotionTimer = 15000;
EternalAffectionTimer = 25000;
PowerfulAttractionTimer = 5000;
+ SummonRomuloTimer = 10000;
+ DrinkPoisonTimer = 0;
+ ResurrectSelfTimer = 0;
if(IsFakingDeath)
Resurrect(m_creature);
@@ -983,6 +996,15 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
ScriptedAI::MoveInLineOfSight(who);
}
+ void SpellHit(Unit* caster, const SpellEntry *Spell)
+ {
+ if (Spell->Id == SPELL_DRINK_POISON)
+ {
+ DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
+ DrinkPoisonTimer = 2500;
+ }
+ }
+
void DamageTaken(Unit* done_by, uint32 &damage);
void JustDied(Unit* killer)
@@ -992,9 +1014,13 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
if(pInstance)
{
pInstance->SetData(DATA_OPERA_EVENT, DONE);
- GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
- if(Door)
- Door->UseDoorOrButton();
+
+ if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
+ lDoor->SetGoState(0);
+ if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
+ rDoor->SetGoState(0);
+ if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
}
}
@@ -1010,12 +1036,14 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
{
boss_romuloAI(Creature* c) : ScriptedAI(c)
{
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
EntryYellTimer = 8000;
AggroYellTimer = 15000;
}
+
+ ScriptedInstance* pInstance;
uint64 JulianneGUID;
-
uint32 Phase;
uint32 EntryYellTimer;
@@ -1026,22 +1054,19 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
uint32 PoisonThrustTimer;
uint32 ResurrectTimer;
- bool JulianneDead;
bool IsFakingDeath;
+ bool JulianneDead;
void Reset()
{
JulianneGUID = 0;
-
Phase = PHASE_ROMULO;
BackwardLungeTimer = 15000;
DaringTimer = 20000;
DeadlySwatheTimer = 25000;
PoisonThrustTimer = 10000;
-
- if(IsFakingDeath)
- Resurrect(m_creature);
+ ResurrectTimer = 10000;
IsFakingDeath = false;
JulianneDead = false;
@@ -1074,6 +1099,18 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_ROMULO_DEATH, m_creature);
+
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_OPERA_EVENT, DONE);
+
+ if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
+ lDoor->SetGoState(0);
+ if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
+ rDoor->SetGoState(0);
+ if (GameObject* pSideEntrance = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR)))
+ pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ }
}
void KilledUnit(Unit* victim)
@@ -1086,137 +1123,169 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
{
- if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == RomuloGUID)
+ if (damage < m_creature->GetHealth())
return;
+ //anything below only used if incoming damage will kill
+
if(Phase == PHASE_JULIANNE)
{
- DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
+ damage = 0;
+
+ //this means already drinking, so return
+ if (IsFakingDeath)
+ return;
+
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_DRINK_POISON);
- PretendToDie(m_creature);
- Phase = PHASE_ROMULO;
- damage = 0;
+
IsFakingDeath = true;
- SummonRomuloTimer = 10000;
+ //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
return;
}
- if(!IsFakingDeath)
+ if (Phase == PHASE_ROMULO)
{
- Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
- if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
- {
- ((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
- ((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
- }
- else
+ error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
+ damage = 0;
+ return;
+ }
+
+ if (Phase == PHASE_BOTH)
+ {
+ //if this is true then we have to kill romulo too
+ if (RomuloDead)
{
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(Romulo)
+ if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
{
- Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Romulo->GetMotionMaster()->Clear();
+ Romulo->setDeathState(JUST_DIED);
+ Romulo->CombatStop();
+ Romulo->DeleteThreatList();
+ Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
- JustDied(done_by);
+ return;
}
- IsFakingDeath = true;
- PretendToDie(m_creature);
- damage = 0;
+ //if not already returned, then romulo is alive and we can pretend die
+ if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
+ {
+ PretendToDie(m_creature);
+ IsFakingDeath = true;
+ ((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
+ ((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
+ damage = 0;
+ return;
+ }
}
- else
- damage = 0;
+ error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen.");
}
void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
{
- if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == JulianneGUID)
+ if (damage < m_creature->GetHealth())
return;
- if(!IsFakingDeath)
+ //anything below only used if incoming damage will kill
+
+ if (Phase == PHASE_ROMULO)
{
- IsFakingDeath = true;
+ DoScriptText(SAY_ROMULO_DEATH, m_creature);
PretendToDie(m_creature);
+ IsFakingDeath = true;
+ Phase = PHASE_BOTH;
- if(Phase == PHASE_BOTH)
+ if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
{
- Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
- if(Julianne && Julianne->isAlive() && !((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
- {
- ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
- ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
- }
- else
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if(Julianne)
- {
- Julianne->DealDamage(Julianne, Julianne->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- JustDied(done_by);
- }
+ ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
+ ((boss_julianneAI*)Julianne->AI())->ResurrectSelfTimer = 10000;
}
- else
+
+ damage = 0;
+ return;
+ }
+
+ if (Phase == PHASE_BOTH)
+ {
+ if (JulianneDead)
{
- Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
- if(Julianne)
+ if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
{
- Resurrect(Julianne);
- m_creature->SetHealth(m_creature->GetMaxHealth());
- ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 4000;
- ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
- ((boss_julianneAI*)Julianne->AI())->Phase = PHASE_BOTH;
- ((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
+ Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Julianne->GetMotionMaster()->Clear();
+ Julianne->setDeathState(JUST_DIED);
+ Julianne->CombatStop();
+ Julianne->DeleteThreatList();
+ Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
- Phase = PHASE_BOTH;
+ return;
}
- damage = 0;
+ if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
+ {
+ PretendToDie(m_creature);
+ IsFakingDeath = true;
+ ((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
+ ((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
+ damage = 0;
+ return;
+ }
}
- if(IsFakingDeath) damage = 0;
+ error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
}
void boss_julianneAI::UpdateAI(const uint32 diff)
{
if(EntryYellTimer)
{
- if(EntryYellTimer < diff)
+ if (EntryYellTimer <= diff)
{
DoScriptText(SAY_JULIANNE_ENTER, m_creature);
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
EntryYellTimer = 0;
}else EntryYellTimer -= diff;
}
if(AggroYellTimer)
{
- if(AggroYellTimer < diff)
+ if (AggroYellTimer <= diff)
{
DoScriptText(SAY_JULIANNE_AGGRO, m_creature);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->setFaction(16);
AggroYellTimer = 0;
}else AggroYellTimer -= diff;
}
- if(Phase == PHASE_ROMULO && !SummonedRomulo)
+ if (DrinkPoisonTimer)
+ {
+ //will do this 2secs after spell hit. this is time to display visual as expected
+ if (DrinkPoisonTimer <= diff)
+ {
+ PretendToDie(m_creature);
+ Phase = PHASE_ROMULO;
+ SummonRomuloTimer = 10000;
+ DrinkPoisonTimer = 0;
+ }else DrinkPoisonTimer -= diff;
+ }
+
+ if (Phase == PHASE_ROMULO && !SummonedRomulo)
{
if(SummonRomuloTimer < diff)
{
- Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000);
+ Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
if(Romulo)
{
RomuloGUID = Romulo->GetGUID();
((boss_romuloAI*)Romulo->AI())->JulianneGUID = m_creature->GetGUID();
((boss_romuloAI*)Romulo->AI())->Phase = PHASE_ROMULO;
+ Romulo->setFaction(16);
+
if(m_creature->getVictim())
{
- Romulo->AI()->AttackStart(m_creature->getVictim());
- Romulo->AddThreat(m_creature->getVictim(), 50.0f);
+ Romulo->AddThreat(m_creature->getVictim(), 0.0f);
}
DoZoneInCombat(Romulo);
}
@@ -1224,7 +1293,23 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
}else SummonRomuloTimer -= diff;
}
- if(!UpdateVictim() ||IsFakingDeath)
+ if (ResurrectSelfTimer)
+ {
+ if (ResurrectSelfTimer <= diff)
+ {
+ Resurrect(m_creature);
+ Phase = PHASE_BOTH;
+ IsFakingDeath = false;
+
+ if (m_creature->getVictim())
+ AttackStart(m_creature->getVictim());
+
+ ResurrectSelfTimer = 0;
+ ResurrectTimer = 1000;
+ }else ResurrectSelfTimer -= diff;
+ }
+
+ if(!UpdateVictim() || IsFakingDeath)
return;
if(RomuloDead)
@@ -1237,9 +1322,9 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
Resurrect(Romulo);
((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false;
+ RomuloDead = false;
ResurrectTimer = 10000;
}
- RomuloDead = false;
}else ResurrectTimer -= diff;
}
@@ -1266,10 +1351,8 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
if(rand()%2 == 1 && SummonedRomulo)
{
Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
- if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
+ if (Romulo && Romulo->isAlive() && !RomuloDead)
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
- else
- return;
}else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
EternalAffectionTimer = 45000 + rand()%15000;
@@ -1293,9 +1376,9 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
Resurrect(Julianne);
((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
+ JulianneDead = false;
ResurrectTimer = 10000;
}
- JulianneDead = false;
}else ResurrectTimer -= diff;
}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
index d08911d9c76..47162ec2599 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
+++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
@@ -1,44 +1,51 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
+
#ifndef DEF_KARAZHAN_H
#define DEF_KARAZHAN_H
-#define DATA_ATTUMEN_EVENT 1
-#define DATA_MOROES_EVENT 2
-#define DATA_MAIDENOFVIRTUE_EVENT 3
-#define DATA_OPTIONAL_BOSS_EVENT 4
-#define DATA_OPERA_EVENT 5
-#define DATA_CURATOR_EVENT 6
-#define DATA_SHADEOFARAN_EVENT 7
-#define DATA_TERESTIAN_EVENT 8
-#define DATA_NETHERSPITE_EVENT 9
-#define DATA_CHESS_EVENT 10
-#define DATA_MALCHEZZAR_EVENT 11
-#define DATA_NIGHTBANE_EVENT 12
-#define DATA_OPERA_PERFORMANCE 13
-#define DATA_OPERA_OZ_DEATHCOUNT 14
-#define DATA_KILREK 15
-#define DATA_TERESTIAN 16
-#define DATA_MOROES 17
-#define DATA_GAMEOBJECT_CURTAINS 18
-#define DATA_GAMEOBJECT_STAGEDOORLEFT 19
-#define DATA_GAMEOBJECT_STAGEDOORRIGHT 20
-#define DATA_GAMEOBJECT_LIBRARY_DOOR 21
-#define DATA_GAMEOBJECT_MASSIVE_DOOR 22
-#define DATA_GAMEOBJECT_NETHER_DOOR 23
-#define DATA_GAMEOBJECT_GAME_DOOR 24
-#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25
-#define DATA_IMAGE_OF_MEDIVH 26
-#define DATA_MASTERS_TERRACE_DOOR_1 27
-#define DATA_MASTERS_TERRACE_DOOR_2 28
+enum
+{
+ DATA_ATTUMEN_EVENT = 1,
+ DATA_MOROES_EVENT = 2,
+ DATA_MAIDENOFVIRTUE_EVENT = 3,
+ DATA_OPTIONAL_BOSS_EVENT = 4,
+ DATA_OPERA_EVENT = 5,
+ DATA_CURATOR_EVENT = 6,
+ DATA_SHADEOFARAN_EVENT = 7,
+ DATA_TERESTIAN_EVENT = 8,
+ DATA_NETHERSPITE_EVENT = 9,
+ DATA_CHESS_EVENT = 10,
+ DATA_MALCHEZZAR_EVENT = 11,
+ DATA_NIGHTBANE_EVENT = 12,
+ DATA_OPERA_PERFORMANCE = 13,
+ DATA_OPERA_OZ_DEATHCOUNT = 14,
+ DATA_KILREK = 15,
+ DATA_TERESTIAN = 16,
+ DATA_MOROES = 17,
+ DATA_GAMEOBJECT_CURTAINS = 18,
+ DATA_GAMEOBJECT_STAGEDOORLEFT = 19,
+ DATA_GAMEOBJECT_STAGEDOORRIGHT = 20,
+ DATA_GAMEOBJECT_LIBRARY_DOOR = 21,
+ DATA_GAMEOBJECT_MASSIVE_DOOR = 22,
+ DATA_GAMEOBJECT_NETHER_DOOR = 23,
+ DATA_GAMEOBJECT_GAME_DOOR = 24,
+ DATA_GAMEOBJECT_GAME_EXIT_DOOR = 25,
+ DATA_IMAGE_OF_MEDIVH = 26,
+ DATA_MASTERS_TERRACE_DOOR_1 = 27,
+ DATA_MASTERS_TERRACE_DOOR_2 = 28,
+ DATA_GO_SIDE_ENTRANCE_DOOR = 29
+};
-// Opera Performances
-#define EVENT_OZ 1
-#define EVENT_HOOD 2
-#define EVENT_RAJ 3
+enum OperaEvents
+{
+ EVENT_OZ = 1,
+ EVENT_HOOD = 2,
+ EVENT_RAJ = 3
+};
-#define ERROR_INST_DATA(a) error_log("SD2: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
+#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
#endif
diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
index 3952c0da167..e8dccdd62a4 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -46,6 +46,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
instance_karazhan(Map* map) : ScriptedInstance(map) {Initialize();}
uint32 Encounters[ENCOUNTERS];
+ std::string str_data;
uint32 OperaEvent;
uint32 OzDeathCount;
@@ -58,6 +59,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
uint64 MoroesGUID;
uint64 LibraryDoor; // Door at Shade of Aran
uint64 MassiveDoor; // Door at Netherspite
+ uint64 SideEntranceDoor; // Side Entrance
uint64 GamesmansDoor; // Door before Chess
uint64 GamesmansExitDoor; // Door after Chess
uint64 NetherspaceDoor; // Door at Malchezaar
@@ -82,6 +84,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
LibraryDoor = 0;
MassiveDoor = 0;
+ SideEntranceDoor = 0;
GamesmansDoor = 0;
GamesmansExitDoor = 0;
NetherspaceDoor = 0;
@@ -145,6 +148,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_GAMEOBJECT_CURTAINS: return CurtainGUID;
case DATA_GAMEOBJECT_LIBRARY_DOOR: return LibraryDoor;
case DATA_GAMEOBJECT_MASSIVE_DOOR: return MassiveDoor;
+ case DATA_GO_SIDE_ENTRANCE_DOOR: return SideEntranceDoor;
case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor;
case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor;
case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor;
@@ -183,7 +187,19 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
}
if(data == DONE)
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
+ << Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " "
+ << Encounters[7] << " " << Encounters[8] << " " << Encounters[9] << " " << Encounters[10];
+
+ str_data = saveStream.str();
+
SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
+ }
}
void SetData64(uint32 identifier, uint64 data)
@@ -208,6 +224,13 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case 185134: NetherspaceDoor = go->GetGUID(); break;
case 184274: MastersTerraceDoor[0] = go->GetGUID(); break;
case 184280: MastersTerraceDoor[1] = go->GetGUID(); break;
+ case 184275:
+ SideEntranceDoor = go->GetGUID();
+ if (GetData(DATA_OPERA_EVENT) != DONE)
+ go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ else
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ break;
}
switch(OperaEvent)
@@ -226,20 +249,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
const char* Save()
{
- OUT_SAVE_INST_DATA;
- std::ostringstream stream;
- stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " "
- << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] << " "
- << Encounters[8] << " " << Encounters[9] << " " << Encounters[10] << " " << Encounters[11];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if(out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
-
- return NULL;
+ return str_data.c_str();
}
void Load(const char* in)
@@ -251,8 +261,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
}
OUT_LOAD_INST_DATA(in);
- std::istringstream stream(in);
- stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
+ std::istringstream loadStream(in);
+ loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]
>> Encounters[4] >> Encounters[5] >> Encounters[6] >> Encounters[7]
>> Encounters[8] >> Encounters[9] >> Encounters[10] >> Encounters[11];
for(uint8 i = 0; i < ENCOUNTERS; ++i)
diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
index bdf7eed9f3a..3b550c34e72 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -46,6 +46,10 @@ EndContentData */
#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?"
#define RAJ_GOSSIP1 "I've never been more ready."
+#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ"
+#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD"
+#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ"
+
struct Dialogue
{
int32 textid;
@@ -181,6 +185,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
}
IsBeingEscorted = false;
PerformanceReady = true;
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
break;
}
}
@@ -377,6 +382,13 @@ bool GossipHello_npc_barnes(Player* player, Creature* _Creature)
{
player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ if (player->isGameMaster())
+ {
+ player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ }
+
if(!((npc_barnesAI*)_Creature->AI())->RaidWiped)
player->SEND_GOSSIP_MENU(8970, _Creature->GetGUID());
else
@@ -394,11 +406,25 @@ bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender,
player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(8971, _Creature->GetGUID());
break;
-
case GOSSIP_ACTION_INFO_DEF+2:
player->CLOSE_GOSSIP_MENU();
((npc_barnesAI*)_Creature->AI())->StartEvent();
break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_barnesAI*)_Creature->AI())->Event = EVENT_OZ;
+ outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",player->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_barnesAI*)_Creature->AI())->Event = EVENT_HOOD;
+ outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",player->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ player->CLOSE_GOSSIP_MENU();
+ ((npc_barnesAI*)_Creature->AI())->Event = EVENT_RAJ;
+ outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",player->GetGUID());
+ break;
}
return true;
@@ -524,25 +550,25 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
{
case 0: return 9999999;
case 1:
- m_creature->Yell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
return 10000;
case 2:
if(arca)
- ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
+ ((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
return 20000;
case 3:
- m_creature->Yell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
return 10000;
case 4:
if(arca)
- ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
+ ((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
return 20000;
case 5:
- m_creature->Yell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
+ m_creature->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
return 20000;
case 6:
if(arca)
- ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
+ ((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
return 10000;
case 7:
FireArcanagosTimer = 500;
@@ -552,7 +578,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
DoCast(m_creature, SPELL_MANA_SHIELD);
return 10000;
case 9:
- m_creature->TextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
+ m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
return 10000;
case 10:
if(arca)
@@ -560,7 +586,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
return 1000;
case 11:
if(arca)
- ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
+ ((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
return 5000;
case 12:
arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47);
@@ -569,7 +595,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
return 10000;
case 13:
- m_creature->Yell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
+ m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
return 10000;
case 14:
m_creature->SetVisibility(VISIBILITY_OFF);
diff --git a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
index d79f581d1c8..b838fc97aab 100644
--- a/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
+++ b/src/bindings/scripts/scripts/zone/loch_modan/loch_modan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
index cbc1013da17..b35b6a98642 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,18 +6,18 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Felblood_Kaelthas
SD%Complete: 80
-SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. TODO: Convert Phoenix to ACID.
+SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets.
SDCategory: Magisters' Terrace
EndScriptData */
@@ -25,7 +25,7 @@ EndScriptData */
#include "def_magisters_terrace.h"
#include "WorldPacket.h"
-#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as aggro yell.
+#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell.
#define SAY_PHOENIX -1585024
#define SAY_FLAMESTRIKE -1585025
#define SAY_GRAVITY_LAPSE -1585026
@@ -36,13 +36,12 @@ EndScriptData */
/*** Spells ***/
// Phase 1 spells
-
#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target
#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050
#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?)
-#define SPELL_PHOENIX_BURN 44198 // A spell Phoenix uses to damage everything around
-#define SPELL_PHOENIX_FIREBALL 44202 // Phoenix casts this in phase 2 and stops moving
+#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around
+#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen
#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part
#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part
@@ -53,7 +52,6 @@ EndScriptData */
#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage
// Phase 2 spells
-
#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse
#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range
#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position.
@@ -68,16 +66,14 @@ EndScriptData */
#define CREATURE_ARCANE_SPHERE 24708
/** Locations **/
-float KaelLocations[6][2]=
+float KaelLocations[3][2]=
{
- {148.744659, 181.377426},//center
- {140.823883, 195.403046},//phoenixpos1
- {156.574188, 195.650482},//phoenixpos2
- {149.813, 160.917},//spherepos1
- {167.223, 173.594},//spherepos2
- {130.68, 173.007},//spherepos3
+ {148.744659, 181.377426},
+ {140.823883, 195.403046},
+ {156.574188, 195.650482},
};
-#define LOCATION_Z -16.727455
+
+#define LOCATION_Z -16.727455
struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
@@ -106,6 +102,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
bool FirstGravityLapse;
bool Heroic;
+ bool HasTaunted;
uint8 Phase;
// 0 = Not started
@@ -116,7 +113,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
// TODO: Timers
FireballTimer = 0;
- PhoenixTimer = 30000;
+ PhoenixTimer = 10000;
FlameStrikeTimer = 25000;
CombatPulseTimer = 0;
@@ -126,55 +123,57 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
GravityLapsePhase = 0;
FirstGravityLapse = true;
+ HasTaunted = false;
Phase = 0;
- if(pInstance)
- {
- if(m_creature->isDead())
- pInstance->SetData(DATA_KAELTHAS_EVENT, DONE);
- else
- pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
- }
- }
+ if (pInstance)
+ pInstance->SetData(DATA_KAELTHAS_EVENT, 0);
- void KilledUnit(Unit* victim)
- {
- if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
- {
- victim->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
- victim->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
- data.append(victim->GetPackGUID());
- data << uint32(0);
- victim->SendMessageToSet(&data, true);
- }
+ GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_DOOR));
+ if (Door)
+ Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
+ // Small door opened after event are expected to be closed by default
}
+
void JustDied(Unit *killer)
{
- RemoveGravityLapse();
DoScriptText(SAY_DEATH, m_creature);
- if(pInstance)
- pInstance->SetData(DATA_KAELTHAS_EVENT, DONE);
+ GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_KAEL_DOOR));
+ if (EncounterDoor)
+ EncounterDoor->SetGoState(0); // Open the encounter door
}
void DamageTaken(Unit* done_by, uint32 &damage)
{
- if(damage > m_creature->GetHealth())
+ if (damage > m_creature->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}
void Aggro(Unit *who)
{
- DoScriptText(SAY_AGGRO, m_creature);
- if(pInstance)
- pInstance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS);
+ if (pInstance)
+ {
+ GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_DOOR));
+ if (EncounterDoor)
+ EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0))
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ HasTaunted = true;
+ }
+
+ ScriptedAI::MoveInLineOfSight(who);
}
void SetThreatList(Creature* SummonedUnit)
{
- if(!SummonedUnit)
+ if (!SummonedUnit)
return;
std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
@@ -182,114 +181,86 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
for(i = m_threatlist.begin(); i != m_threatlist.end(); i++)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
- if(pUnit && pUnit->isAlive())
+ if (pUnit && pUnit->isAlive())
{
- float threat = DoGetThreat(pUnit);
- SummonedUnit->AddThreat(pUnit, 0.1f);
+ float threat = m_creature->getThreatManager().getThreat(pUnit);
+ SummonedUnit->AddThreat(pUnit, threat);
}
}
}
- void EnterEvadeMode()
- {
- RemoveGravityLapse();
- m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveAllAuras();
- m_creature->DeleteThreatList();
- m_creature->CombatStop();
- m_creature->LoadCreaturesAddon();
-
- if( m_creature->isAlive() )
- m_creature->GetMotionMaster()->MoveTargetedHome();
-
- m_creature->SetLootRecipient(NULL);
-
- InCombat = false;
- Reset();
- }
-
void TeleportPlayersToSelf()
{
- float x,y,z;
- m_creature->Relocate(KaelLocations[0][0], KaelLocations[0][1], LOCATION_Z, 0);
- Map *map = m_creature->GetMap();
- Map::PlayerList const &PlayerList = map->GetPlayers();
- Map::PlayerList::const_iterator i;
- for (i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ float x = KaelLocations[0][0];
+ float y = KaelLocations[0][1];
+ m_creature->Relocate(x, y, LOCATION_Z, 0);
+ //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
{
- if (Player* i_pl = i->getSource())
- if(i_pl->isAlive())
- {
- i_pl->CastSpell(i_pl, SPELL_TELEPORT_CENTER, true);
- m_creature->GetNearPoint(m_creature,x,y,z,5,5,0);
- i_pl->TeleportTo(m_creature->GetMapId(),x,y,LOCATION_Z,i_pl->GetOrientation());
- }
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
+ pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
}
DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
}
void CastGravityLapseKnockUp()
{
- Map *map = m_creature->GetMap();
- Map::PlayerList const &PlayerList = map->GetPlayers();
- Map::PlayerList::const_iterator i;
- for (i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
{
- if (Player* i_pl = i->getSource())
- if(i_pl->isAlive())
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
// Knockback into the air
- i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
}
}
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
{
- Map *map = m_creature->GetMap();
- Map::PlayerList const &PlayerList = map->GetPlayers();
- Map::PlayerList::const_iterator i;
- for (i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
{
- if (Player* i_pl = i->getSource())
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
- if(i_pl->isAlive())
- {
- // Also needs an exception in spell system.
- i_pl->CastSpell(i_pl, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
- // Use packet hack
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
- data.append(i_pl->GetPackGUID());
- data << uint32(0);
- i_pl->SendMessageToSet(&data, true);
- i_pl->SetSpeed(MOVE_FLIGHT, 2.0f);
- }
+ // Also needs an exception in spell system.
+ pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
+ // Use packet hack
+ WorldPacket data(12);
+ data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ data.append(pUnit->GetPackGUID());
+ data << uint32(0);
+ pUnit->SendMessageToSet(&data, true);
}
}
}
void RemoveGravityLapse()
{
- Map *map = m_creature->GetMap();
- Map::PlayerList const &PlayerList = map->GetPlayers();
- Map::PlayerList::const_iterator i;
- for (i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i)
{
- if(Player* i_pl = i->getSource())
+ Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
+ if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
- i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
- i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
+ pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
+ pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
+
WorldPacket data(12);
data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
- data.append(i_pl->GetPackGUID());
+ data.append(pUnit->GetPackGUID());
data << uint32(0);
- i_pl->SendMessageToSet(&data, true);
+ pUnit->SendMessageToSet(&data, true);
}
}
}
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim())
+ //Return since we have no target
+ if (!UpdateVictim())
return;
switch(Phase)
@@ -297,9 +268,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
case 0:
{
// *Heroic mode only:
- if(Heroic)
+ if (Heroic)
{
- if(PyroblastTimer < diff)
+ if (PyroblastTimer < diff)
{
DoCast(m_creature, SPELL_SHOCK_BARRIER, true);
DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
@@ -307,56 +278,47 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}else PyroblastTimer -= diff;
}
- if(FireballTimer < diff)
+ if (FireballTimer < diff)
{
DoCast(m_creature->getVictim(), Heroic ? SPELL_FIREBALL_HEROIC : SPELL_FIREBALL_NORMAL);
FireballTimer = 2000 + rand()%4000;
}else FireballTimer -= diff;
- if(PhoenixTimer < diff)
+ if (PhoenixTimer < diff)
{
+
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+
uint32 random = rand()%2 + 1;
float x = KaelLocations[random][0];
float y = KaelLocations[random][1];
- Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000);
- if(Phoenix)
+
+ Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
+ if (Phoenix)
{
Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
SetThreatList(Phoenix);
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1);
- if(target)
- {
- Phoenix->AddThreat(target,1000);
- Phoenix->Attack(target,true);
- Phoenix->GetMotionMaster()->MoveChase(target);
- }
- else
- {
- Phoenix->AddThreat(m_creature->getVictim(),1000);
- Phoenix->Attack(m_creature->getVictim(),true);
- Phoenix->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
+ Phoenix->AI()->AttackStart(target);
}
DoScriptText(SAY_PHOENIX, m_creature);
- PhoenixTimer = 40000;
+ PhoenixTimer = 60000;
}else PhoenixTimer -= diff;
- if(FlameStrikeTimer < diff)
+ if (FlameStrikeTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
- m_creature->InterruptNonMeleeSpells(false);
DoCast(target, SPELL_FLAMESTRIKE3, true);
DoScriptText(SAY_FLAMESTRIKE, m_creature);
-
- FlameStrikeTimer = 20000 + rand()%5000;
}
+ FlameStrikeTimer = 15000 + rand()%10000;
}else FlameStrikeTimer -= diff;
// Below 50%
- if(m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
+ if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
{
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
m_creature->StopMoving();
@@ -366,34 +328,35 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
GravityLapsePhase = 0;
Phase = 1;
}
+
DoMeleeAttackIfReady();
}
break;
case 1:
{
- m_creature->StopMoving();
- if(GravityLapseTimer < diff)
+ if (GravityLapseTimer < diff)
{
switch(GravityLapsePhase)
{
case 0:
- if(FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
+ if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
FirstGravityLapse = false;
- if(pInstance)
+
+ if (pInstance)
{
GameObject* KaelLeft = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_LEFT));
- if(KaelLeft) KaelLeft->SetGoState(0);
+ if (KaelLeft) KaelLeft->SetGoState(0);
GameObject* KaelRight = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_KAEL_STATUE_RIGHT));
- if(KaelRight) KaelRight->SetGoState(0);
+ if (KaelRight) KaelRight->SetGoState(0);
}
}else
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
}
- m_creature->StopMoving();
+
DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
@@ -415,31 +378,23 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
CastGravityLapseFly();
GravityLapseTimer = 30000;
GravityLapsePhase = 4;
+
+
for(uint8 i = 0; i < 3; ++i)
{
- Creature* Orb = m_creature->SummonCreature(CREATURE_ARCANE_SPHERE,KaelLocations[3+i][0],KaelLocations[3+i][1],LOCATION_Z,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
- if(Orb)
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+
+ Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
+ if (Orb && target)
{
- SetThreatList(Orb);
- Unit *target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,i);
- if(target)
- {
- Orb->AddThreat(target,1000);
- Orb->Attack(target,true);
- Orb->GetMotionMaster()->MoveChase(target);
- }
- else
- {
- Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- if(ntarget)
- {
- Orb->AddThreat(ntarget,1000);
- Orb->Attack(ntarget,true);
- Orb->GetMotionMaster()->MoveChase(ntarget);
- }
- }
+ //SetThreatList(Orb);
+ Orb->AddThreat(target, 1.0f);
+ Orb->AI()->AttackStart(target);
}
+
}
+
DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
@@ -483,7 +438,7 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
void MoveInLineOfSight(Unit *who) {}
void UpdateAI(const uint32 diff)
{
- if(FlameStrikeTimer < diff)
+ if (FlameStrikeTimer < diff)
{
DoCast(m_creature, Heroic ? SPELL_FLAMESTRIKE1_HEROIC : SPELL_FLAMESTRIKE1_NORMAL, true);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -493,211 +448,187 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
{
- mob_felkael_phoenixAI(Creature *c) : ScriptedAI(c)
+ mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
}
- uint32 BurnTimer;
- uint32 CheckTimer;
- uint8 phase;
+
ScriptedInstance* pInstance;
- bool end;
+ uint32 BurnTimer;
+ uint32 Death_Timer;
+ bool Rebirth;
+ bool FakeDeath;
void Reset()
{
- m_creature->SetSpeed(MOVE_RUN, 0.5f);
- m_creature->SetSpeed(MOVE_WALK, 0.5f);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ m_creature->CastSpell(m_creature,SPELL_PHOENIX_BURN,true);
BurnTimer = 2000;
- CheckTimer = 1000;
- phase = 0;
- end = false;
+ Death_Timer = 2700;
+ Rebirth = false;
+ FakeDeath = false;
}
void Aggro(Unit* who) {}
- void JustDied(Unit* slayer)
+ void DamageTaken(Unit* pKiller, uint32 &damage)
{
- if (end)
+ if (damage < m_creature->GetHealth())
+ return;
+
+ //Prevent glitch if in fake death
+ if (FakeDeath)
+ {
+ damage = 0;
return;
- DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 45000);
+
+ }
+ //Don't really die in all phases of Kael'Thas
+ if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 0)
+ {
+ //prevent death
+ damage = 0;
+ FakeDeath = true;
+
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->SetHealth(0);
+ m_creature->StopMoving();
+ m_creature->ClearComboPointHolders();
+ m_creature->RemoveAllAurasOnDeath();
+ m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
+ m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->ClearAllReactives();
+ m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+
+ }
+
+ }
+
+ void JustDied(Unit* slayer)
+ {
+ DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
void UpdateAI(const uint32 diff)
{
- if(CheckTimer < diff)
+
+ //If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg.
+ if (FakeDeath)
{
- if (pInstance)
+ if (!Rebirth)
+ {
+ DoCast(m_creature, SPELL_REBIRTH_DMG);
+ Rebirth = true;
+ }
+
+ if (Rebirth)
{
- Creature *boss = (Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_KAEL)));
- if (boss)
+
+ if (Death_Timer < diff)
{
- phase = ((boss_felblood_kaelthasAI*)boss->AI())->Phase;
- if(boss->isDead() || !boss->isInCombat())
- {
- end = true;
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self
- }
- }
+ DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->RemoveCorpse();
+ Rebirth = false;
+ }else Death_Timer -= diff;
}
- CheckTimer = 1000;
- }else CheckTimer -= diff;
+
+
+ }
if (!UpdateVictim())
return;
if (BurnTimer < diff)
{
- if(!phase)
- {
- DoCast(m_creature, SPELL_PHOENIX_BURN);
- m_creature->DealDamage(m_creature, 1500, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, NULL, false);//temphack, hellfire is not damaging self
- }
- else
- {
- m_creature->StopMoving();
- DoCast(m_creature->getVictim(), SPELL_PHOENIX_FIREBALL);
- }
- BurnTimer = 2000;
- }else BurnTimer -= diff;
+ //spell Burn should possible do this, but it doesn't, so do this for now.
+ uint32 dmg = urand(1650,2050);
+ m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
+ BurnTimer += 2000;
+ } BurnTimer -= diff;
- //DoMeleeAttackIfReady();
+
+ DoMeleeAttackIfReady();
}
};
-struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public Scripted_NoMovementAI
+struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
{
- mob_felkael_phoenix_eggAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- }
+ mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {}
uint32 HatchTimer;
- ScriptedInstance* pInstance;
- void Reset() { HatchTimer = 15000; }
+
+ void Reset()
+ {
+ HatchTimer = 10000;
+
+ }
void Aggro(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
+
void UpdateAI(const uint32 diff)
{
-
- if(HatchTimer < diff)
+ if (HatchTimer < diff)
{
- Creature *bird = DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000);
- if (bird)
- {
- Unit *boss = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_KAEL));
- if (boss && boss->getVictim())
- {
- bird->AddThreat(boss->getVictim(),100);
- bird->Attack(boss->getVictim(),true);
- bird->GetMotionMaster()->MoveChase(boss->getVictim());
- }
- }
+ DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}else HatchTimer -= diff;
+
}
};
struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI
{
- mob_arcane_sphereAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = ((ScriptedInstance*)c->GetInstanceData());
- }
+ mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();}
+
uint32 DespawnTimer;
uint32 ChangeTargetTimer;
- uint32 CheckTimer;
-
- ScriptedInstance* pInstance;
void Reset()
{
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
DespawnTimer = 30000;
- ChangeTargetTimer = 5000;
- CheckTimer = 1000;
- m_creature->SetSpeed(MOVE_RUN, 0.5f);
- m_creature->SetSpeed(MOVE_WALK, 0.5f);
+ ChangeTargetTimer = 6000 + rand()%6000;
+
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
m_creature->setFaction(14);
DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
+
void Aggro(Unit* who) {}
- void StalkTarget(Unit* target)
- {
- if(!target)
- return;
- m_creature->AddThreat(target,100000);
- m_creature->GetMotionMaster()->MoveChase(target);
- m_creature->Attack(target,true);
- }
void UpdateAI(const uint32 diff)
{
- if(DespawnTimer < diff)
+ if (DespawnTimer < diff)
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
else DespawnTimer -= diff;
- if(!UpdateVictim())
- ChangeTargetTimer = 0;
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- if(ChangeTargetTimer < diff)
+ if (ChangeTargetTimer < diff)
{
- DoResetThreat();
- Unit *ntarget = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (ntarget)
- StalkTarget(ntarget);
- ChangeTargetTimer = 10000;
- }else ChangeTargetTimer -= diff;
- if(CheckTimer < diff)
- {
- if (pInstance)
- {
- Creature *boss = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_KAEL));
- if(boss)
- {
- if(!((boss_felblood_kaelthasAI*)boss->AI())->Phase || boss->isDead())
- DespawnTimer = 0;
- }else DespawnTimer = 0;
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
- }
-};
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target)
+ m_creature->AddThreat(target, 1.0f);
+ m_creature->TauntApply(target);
+ AttackStart(target);
-bool GOHello_go_kael_orb(Player *player, GameObject* _GO)
-{
- ScriptedInstance* pInst = (ScriptedInstance*)_GO->GetInstanceData();
- if (pInst && player)
- {
- Unit *kael = Unit::GetUnit((*_GO),pInst->GetData64(DATA_KAEL));
- if (kael && kael->isDead())
- player->TeleportTo(530, 12888, -6876, 9, 0.3);
- }
- return true;
-}
-
-bool GOHello_go_movie_orb(Player *player, GameObject* _GO)
-{
- if (player)
- {
- WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
- data << (uint32)164;
- player->GetSession()->SendPacket(&data);
-
- if (player->GetQuestStatus(11490) == QUEST_STATUS_INCOMPLETE)
- {
- Unit *qUnit = player->SummonCreature(25042,player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()-10,0,TEMPSUMMON_CORPSE_DESPAWN,0);
- if(qUnit)
- player->DealDamage(qUnit, qUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
+ ChangeTargetTimer = 5000 + rand()%10000;
+ }else ChangeTargetTimer -= diff;
}
- return true;
-}
+};
CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c)
{
@@ -739,28 +670,18 @@ void AddSC_boss_felblood_kaelthas()
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_felkael_phoenix";
+ newscript->Name = "mob_felkael_phoenix";
newscript->GetAI = &GetAI_mob_felkael_phoenix;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_felkael_phoenix_egg";
+ newscript->Name = "mob_felkael_phoenix_egg";
newscript->GetAI = &GetAI_mob_felkael_phoenix_egg;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_felkael_flamestrike";
+ newscript->Name = "mob_felkael_flamestrike";
newscript->GetAI = &GetAI_mob_felkael_flamestrike;
newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name="go_kael_orb";
- newscript->pGOHello = &GOHello_go_kael_orb;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name="go_movie_orb";
- newscript->pGOHello = &GOHello_go_movie_orb;
- newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
index 36ec57a4e25..e6e0caca2e8 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -97,8 +97,6 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
- Adds.clear();
- //SummonAdds();
Heroic = c->GetMap()->IsHeroic();
}
@@ -122,7 +120,6 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
void Reset()
{
- m_creature->SetCorpseDelay(60*60*1000);
LackeysKilled = 0;
PlayersKilled = 0;
@@ -135,15 +132,14 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
CombatPulseTimer = 5000;
+ SummonAdds();
CheckAdds();
- if(pInstance)
+ if (pInstance)
{
+ pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED);
pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 0);
- if (m_creature->isDead())
- pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
- else pInstance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED);
- }else error_log(ERROR_INST_DATA);
+ } else error_log(ERROR_INST_DATA);
}
void Aggro(Unit* who)
@@ -157,8 +153,9 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
void SummonAdds()
{
- /*if (m_creature->isDead())
- return;*/
+ if(!Adds.empty())
+ return;
+
std::vector<uint32> AddList;
for(uint8 i = 0; i < 8; ++i)
AddList.push_back(AddEntry[i]);
@@ -169,7 +166,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
for(uint8 i = 0; i < AddList.size(); ++i)
{
Creature* pAdd = m_creature->SummonCreature(AddList[i], LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(pAdd)
+ if (pAdd)
{
Add* nAdd = new Add(AddList[i], pAdd->GetGUID());
Adds.push_back(nAdd);
@@ -179,51 +176,45 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
void CheckAdds()
{
- //if (m_creature->isDead())
- // return;
- if(Adds.empty())
- {
- SummonAdds();
+ if (Adds.empty())
return;
- }
- for(uint8 i = 0; i < Adds.size(); ++i)
+
+ uint32 n = 0;
+ for(std::vector<Add*>::iterator i = Adds.begin(); i != Adds.end(); ++i, ++n)
{
- Creature* pAdd = (Unit::GetCreature(*m_creature, Adds[i]->guid));
+ Creature* pAdd = (Unit::GetCreature(*m_creature, (*i)->guid));
if(pAdd && pAdd->isAlive())
{
- pAdd->AI()->EnterEvadeMode();
- pAdd->GetMotionMaster()->MovePoint(0,LackeyLocations[i][0], LackeyLocations[i][1], POS_Z);
+ pAdd->AI()->EnterEvadeMode(); // Force them out of combat and reset if they are in combat.
}
- if(!pAdd || (pAdd && pAdd->isDead()))
+ else
{
+ pAdd = m_creature->SummonCreature((*i)->entry, LackeyLocations[n][0], LackeyLocations[n][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
if(pAdd)
- pAdd->RemoveCorpse();//looks stupid if mob is alive but has a dead corpse in front of him :)
- Creature* pAdd = m_creature->SummonCreature(Adds[i]->entry, LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
- if(pAdd)
- Adds[i]->guid = pAdd->GetGUID();
+ (*i)->guid = pAdd->GetGUID();
+ else
+ (*i)->guid = 0;
}
}
}
void KilledUnit(Unit* victim)
{
- if(victim->GetTypeId() != TYPEID_PLAYER || m_creature->isDead())
+ if (victim->GetTypeId() != TYPEID_PLAYER)
return;
DoScriptText(PlayerDeath[PlayersKilled].id, m_creature);
- if( PlayersKilled < 4 )
+
+ if (PlayersKilled < 4)
++PlayersKilled;
}
void KilledLackey()
{
- if(m_creature->isDead())//no sense to talk if dead..
- return;
DoScriptText(LackeyDeath[LackeysKilled].id, m_creature);
- if( LackeysKilled < 3 )
- ++LackeysKilled;
- CheckLootable();
+ if (LackeysKilled < 3)
+ ++LackeysKilled;
}
void JustDied(Unit* killer)
@@ -232,21 +223,21 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
CheckLootable();
- if(!pInstance)
+ if (!pInstance)
{
error_log(ERROR_INST_DATA);
return;
}
- pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
- if(GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR)))
+
+ if (GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_DELRISSA_DOOR)))
Door->SetGoState(0);
}
void CheckLootable()
{
- if(pInstance && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) >= 4)
+ if (LackeysKilled > 3)
m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
else
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
@@ -254,7 +245,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim())
+ if (!UpdateVictim())
return;
if(ResetTimer < diff)
@@ -269,27 +260,27 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
ResetTimer = 5000;
}else ResetTimer -= diff;
- if(HealTimer < diff)
+ if (HealTimer < diff)
{
uint32 health = m_creature->GetHealth();
Unit* target = m_creature;
for(uint8 i = 0; i < Adds.size(); ++i)
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
- if(pAdd->isAlive() && pAdd->GetHealth() < health)
+ if (Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
+ if (pAdd->isAlive() && pAdd->GetHealth() < health)
target = pAdd;
DoCast(target, SPELL_FLASH_HEAL);
HealTimer = 15000;
}else HealTimer -= diff;
- if(RenewTimer < diff)
+ if (RenewTimer < diff)
{
Unit* target = m_creature;
- if(rand()%2 == 1)
+ if (rand()%2 == 1)
{
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
- if(pAdd && pAdd->isAlive())
+ if (pAdd && pAdd->isAlive())
target = pAdd;
}
DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL);
@@ -299,44 +290,44 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
if(ShieldTimer < diff)
{
Unit* target = m_creature;
- if(rand()%2 == 1)
+ if (rand()%2 == 1)
{
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
- if(Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
- if(!pAdd->HasAura(SPELL_SHIELD, 0) && pAdd->isAlive())
+ if (Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
+ if (!pAdd->HasAura(SPELL_SHIELD) && pAdd->isAlive())
target = pAdd;
}
DoCast(target, SPELL_SHIELD);
ShieldTimer = 7500;
}else ShieldTimer -= diff;
- if(DispelTimer < diff)
+ if (DispelTimer < diff)
{
Unit* target = NULL;
bool friendly = false;
- if(rand()%2 == 1)
+ if (rand()%2 == 1)
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
else
{
friendly = true;
- if(rand()%2 == 1)
+ if (rand()%2 == 1)
target = m_creature;
else
{
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
- if(pAdd && pAdd->isAlive())
+ if (pAdd && pAdd->isAlive())
target = pAdd;
}
}
- if(target)
+ if (target)
{
DoCast(target, SPELL_DISPEL_MAGIC);
DispelTimer = 12000;
}
}else DispelTimer -= diff;
- if(SWPainTimer < diff)
+ if (SWPainTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL);
SWPainTimer = 10000;
@@ -382,12 +373,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
void Reset()
{
UsedPotion = false;
- if(pInstance)
- {
- Creature *boss = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if (boss && boss->isDead())
- boss->Respawn();
- }
+
ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked.
}
@@ -395,46 +381,47 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
void JustDied(Unit* killer)
{
- if(!pInstance)
+ if (!pInstance)
{
error_log(ERROR_INST_DATA);
return;
}
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
+ if (Delrissa)
{
+ pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
+
((boss_priestess_delrissaAI*)Delrissa->AI())->KilledLackey();
- if(!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3)
- ((boss_priestess_delrissaAI*)Delrissa->AI())->CheckLootable();
- pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
+ if (!Delrissa->isAlive() && pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) > 3)
+ Delrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
}
void KilledUnit(Unit* victim)
{
- if(!pInstance)
+ if (!pInstance)
{
error_log(ERROR_INST_DATA);
return;
}
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
+ if (Delrissa)
Delrissa->AI()->KilledUnit(victim);
}
void AcquireGUIDs()
{
- if(!pInstance)
+ if (!pInstance)
{
error_log(ERROR_INST_DATA);
return;
}
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
- if(Delrissa)
+ if (Delrissa)
{
Group = ((boss_priestess_delrissaAI*)Delrissa->AI())->Adds;
Add* dAdd = new Add(Delrissa->GetEntry(), Delrissa->GetGUID());
@@ -444,13 +431,13 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion)
+ if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) && !UsedPotion)
{
DoCast(m_creature, SPELL_HEALING_POTION, true);
UsedPotion = true;
}
- if(ResetThreatTimer < diff)
+ if (ResetThreatTimer < diff)
{
DoResetThreat();
ResetThreatTimer = 5000 + rand()%15000;
@@ -492,12 +479,12 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Vanish_Timer < diff)
+ if (Vanish_Timer < diff)
{
m_creature->SetVisibility(VISIBILITY_OFF); // ...? Hacklike
DoCast(m_creature, SPELL_VANISH);
@@ -508,35 +495,36 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA
m_creature->AddThreat(SelectUnit(SELECT_TARGET_RANDOM, 0), 1000.0f);
}else Vanish_Timer -= diff;
- if(InVanish)
- if(Wait_Timer < diff)
+ if (InVanish)
{
- DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true);
- DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true);
- m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike
- InVanish = false;
- }else Wait_Timer -= diff;
+ if (Wait_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true);
+ DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true);
+ m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike
+ InVanish = false;
+ }else Wait_Timer -= diff;
+ }
- if(Gouge_Timer < diff)
+ if (Gouge_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_GOUGE);
- DoModifyThreatPercent(m_creature->getVictim(),-100);
Gouge_Timer = 5500;
}else Gouge_Timer -= diff;
- if(Kick_Timer < diff)
+ if (Kick_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_KICK);
Kick_Timer = 7000;
}else Kick_Timer -= diff;
- if(Eviscerate_Timer < diff)
+ if (Eviscerate_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_EVISCERATE);
Eviscerate_Timer = 4000;
}else Eviscerate_Timer -= diff;
- if(!InVanish)
+ if (!InVanish)
DoMeleeAttackIfReady();
}
};
@@ -568,7 +556,8 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA
void UpdateAI(const uint32 diff)
{
- if (!UpdateVictim() )
+ //Return since we have no target
+ if (!UpdateVictim())
return;
//Chain cast
@@ -581,9 +570,7 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA
struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
{
//Warlock
- boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c)
- {
- }
+ boss_ellris_duskhallowAI(Creature *c) : boss_priestess_guestAI(c) {}
bool HasSummonedImp;
@@ -595,7 +582,7 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
void Reset()
{
- //HasSummonedImp = false;
+ HasSummonedImp = false;
Immolate_Timer = 6000;
Shadow_Bolt_Timer = 3000;
@@ -613,51 +600,49 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!HasSummonedImp)
+ if (!HasSummonedImp)
{
//Imp will not despawn unless it's killed, even if owner dies, this is correct way.
DoCast(m_creature,SPELL_SUMMON_IMP);
HasSummonedImp = true;
}
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Immolate_Timer < diff)
+ if (Immolate_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_IMMOLATE);
Immolate_Timer = 6000;
}else Immolate_Timer -= diff;
- if(Shadow_Bolt_Timer < diff)
+ if (Shadow_Bolt_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOW_BOLT);
Shadow_Bolt_Timer = 5000;
}else Shadow_Bolt_Timer -= diff;
- if(Seed_of_Corruption_Timer < diff)
+ if (Seed_of_Corruption_Timer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SEED_OF_CORRUPTION);
Seed_of_Corruption_Timer = 10000;
}else Seed_of_Corruption_Timer -= diff;
- if(Curse_of_Agony_Timer < diff)
+ if (Curse_of_Agony_Timer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_AGONY);
Curse_of_Agony_Timer = 13000;
}else Curse_of_Agony_Timer -= diff;
- if(Fear_Timer < diff)
+ if (Fear_Timer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FEAR);
Fear_Timer = 10000;
}else Fear_Timer -= diff;
- if (m_creature->GetDistance(m_creature->getVictim()) <= 10)
- m_creature->StopMoving();
- //DoMeleeAttackIfReady();//should not melee, she's a warlock
+ DoMeleeAttackIfReady();
}
};
@@ -694,18 +679,18 @@ struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestA
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Knockdown_Timer < diff)
+ if (Knockdown_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
Knockdown_Timer = 6000;
}else Knockdown_Timer -= diff;
- if(Snap_Kick_Timer < diff)
+ if (Snap_Kick_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SNAP_KICK);
Snap_Kick_Timer = 4500;
@@ -726,7 +711,7 @@ struct TRINITY_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_guestA
struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
{
//Mage
- boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {}
+ boss_yazzaiAI(Creature *c) : boss_priestess_guestAI(c) {}
bool HasIceBlocked;
@@ -757,82 +742,75 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Polymorph_Timer < diff)
+ if (Polymorph_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoCast(target, SPELL_POLYMORPH);
- DoModifyThreatPercent(target,-100);
Polymorph_Timer = 20000;
}
}else Polymorph_Timer -= diff;
- if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
+ if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
{
DoCast(m_creature, SPELL_ICE_BLOCK);
HasIceBlocked = true;
}
- if(Blizzard_Timer < diff)
+ if (Blizzard_Timer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLIZZARD);
Blizzard_Timer = 8000;
}else Blizzard_Timer -= diff;
- if(Ice_Lance_Timer < diff)
+ if (Ice_Lance_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_ICE_LANCE);
Ice_Lance_Timer = 12000;
}else Ice_Lance_Timer -= diff;
- if(Cone_of_Cold_Timer < diff)
+ if (Cone_of_Cold_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
Cone_of_Cold_Timer = 10000;
}else Cone_of_Cold_Timer -= diff;
- if(Frostbolt_Timer < diff)
+ if (Frostbolt_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 8000;
}else Frostbolt_Timer -= diff;
- if(Blink_Timer < diff)
+ if (Blink_Timer < diff)
{
bool InMeleeRange = false;
std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
+ {
//if in melee range
if (target->IsWithinDistInMap(m_creature, 5))
{
InMeleeRange = true;
break;
}
+ }
}
+
//if anybody is in melee range than escape by blink
- if(InMeleeRange)
- {
- //DoCast(m_creature, SPELL_BLINK); //blink does not work on npcs
- float x,y,z;
- m_creature->GetPosition(x,y,z);
- x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10;
- y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10;
- DoTeleportTo(x, y, z);
- }
+ if (InMeleeRange)
+ DoCast(m_creature, SPELL_BLINK);
+
Blink_Timer = 8000;
}else Blink_Timer -= diff;
- if (m_creature->getVictim() && m_creature->GetDistance(m_creature->getVictim()) <= 10)
- m_creature->StopMoving();
-
- //DoMeleeAttackIfReady(); //mage type, no melee needed
+ DoMeleeAttackIfReady();
}
};
@@ -865,6 +843,7 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
Hamstring_Timer = 4500;
Mortal_Strike_Timer = 8000;
DoCast(m_creature, SPELL_BATTLE_SHOUT);
+
boss_priestess_guestAI::Reset();
}
@@ -875,56 +854,60 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Intercept_Stun_Timer < diff)
+ if (Intercept_Stun_Timer < diff)
{
bool InMeleeRange = false;
std::list<HostilReference*>& t_list = m_creature->getThreatManager().getThreatList();
for(std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- if(Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
- //if in melee range
- if (target->IsWithinDistInMap(m_creature, 5))
+ if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
{
- InMeleeRange = true;
- break;
+ //if in melee range
+ if (target->IsWithinDistInMap(m_creature, 5))
+ {
+ InMeleeRange = true;
+ break;
+ }
}
}
+
//if nobody is in melee range than try to use Intercept
- if(!InMeleeRange)
+ if (!InMeleeRange)
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_INTERCEPT_STUN);
+
Intercept_Stun_Timer = 10000;
}else Intercept_Stun_Timer -= diff;
- if(Disarm_Timer < diff)
+ if (Disarm_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_DISARM);
Disarm_Timer = 6000;
}else Disarm_Timer -= diff;
- if(Hamstring_Timer < diff)
+ if (Hamstring_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
Hamstring_Timer = 4500;
}else Hamstring_Timer -= diff;
- if(Mortal_Strike_Timer < diff)
+ if (Mortal_Strike_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
Mortal_Strike_Timer = 4500;
}else Mortal_Strike_Timer -= diff;
- if(Piercing_Howl_Timer < diff)
+ if (Piercing_Howl_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL);
Piercing_Howl_Timer = 10000;
}else Piercing_Howl_Timer -= diff;
- if(Frightening_Shout_Timer < diff)
+ if (Frightening_Shout_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
Frightening_Shout_Timer = 18000;
@@ -973,13 +956,11 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
uint32 Multi_Shot_Timer;
uint32 Wing_Clip_Timer;
uint32 Freezing_Trap_Timer;
- uint32 StopMoving;
- bool Stopped;
void Reset()
{
//SliverGUID = 0;
- //HasSummonedSliver = false;
+ HasSummonedSliver = false;
Aimed_Shot_Timer = 6000;
Shoot_Timer = 2500;
@@ -987,8 +968,6 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
Multi_Shot_Timer = 10000;
Wing_Clip_Timer = 4000;
Freezing_Trap_Timer = 15000;
- StopMoving = 2000;
- Stopped = false;
boss_priestess_guestAI::Reset();
}
@@ -1000,10 +979,10 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!HasSummonedSliver)
+ if (!HasSummonedSliver)
{
Creature* Sliver = m_creature->SummonCreature(CREATURE_SLIVER, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if(Sliver)
+ if (Sliver)
{
//((mob_sliverAI*)Sliver->AI())->GaraxxasGUID = m_creature->GetGUID();
//SliverGUID = Sliver->GetGUID();
@@ -1011,64 +990,53 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
}
}
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 5))
+ if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5.0f))
{
- if(Wing_Clip_Timer < diff)
+ if (Wing_Clip_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_WING_CLIP);
Wing_Clip_Timer = 4000;
}else Wing_Clip_Timer -= diff;
- if(Freezing_Trap_Timer < diff)
+ if (Freezing_Trap_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
- DoModifyThreatPercent(m_creature->getVictim(),-100);
Freezing_Trap_Timer = 30000;
}else Freezing_Trap_Timer -= diff;
- if(!m_creature->getVictim()->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED | UNIT_STAT_DISTRACTED))
- DoMeleeAttackIfReady();
- }else
+ DoMeleeAttackIfReady();
+ }
+ else
{
- if(Concussive_Shot_Timer < diff)
+ if (Concussive_Shot_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT);
Concussive_Shot_Timer = 8000;
}else Concussive_Shot_Timer -= diff;
- if(Multi_Shot_Timer < diff)
+ if (Multi_Shot_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
Multi_Shot_Timer = 10000;
}else Multi_Shot_Timer -= diff;
- if(Aimed_Shot_Timer < diff)
+ if (Aimed_Shot_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT);
Aimed_Shot_Timer = 6000;
}else Aimed_Shot_Timer -= diff;
- if(Shoot_Timer < diff)
+ if (Shoot_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SHOOT);
Shoot_Timer = 2500;
}else Shoot_Timer -= diff;
}
- if(StopMoving < diff)
- {
- if(Stopped)
- Stopped = false;
- else
- Stopped = true;
- StopMoving = 2000+rand()%5000;
- }else StopMoving -= diff;
- if (Stopped)
- m_creature->StopMoving();
}
};
@@ -1118,12 +1086,12 @@ struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Totem_Timer < diff)
+ if (Totem_Timer < diff)
{
switch(rand()%3)
{
@@ -1135,25 +1103,25 @@ struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI
Totem_Timer = Totem_Amount*2000;
}else Totem_Timer -= diff;
- if(War_Stomp_Timer < diff)
+ if (War_Stomp_Timer < diff)
{
DoCast(m_creature, SPELL_WAR_STOMP);
War_Stomp_Timer = 10000;
}else War_Stomp_Timer -= diff;
- if(Purge_Timer < diff)
+ if (Purge_Timer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_PURGE);
Purge_Timer = 15000;
}else Purge_Timer -= diff;
- if(Frost_Shock_Timer < diff)
+ if (Frost_Shock_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
Frost_Shock_Timer = 7000;
}else Frost_Shock_Timer -= diff;
- if(Healing_Wave_Timer < diff)
+ if (Healing_Wave_Timer < diff)
{
// std::vector<Add*>::iterator itr = Group.begin() + rand()%Group.size();
// uint64 guid = (*itr)->guid;
@@ -1205,44 +1173,45 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim() )
+ if (!UpdateVictim())
return;
boss_priestess_guestAI::UpdateAI(diff);
- if(Goblin_Dragon_Gun_Timer < diff)
+ if (Goblin_Dragon_Gun_Timer < diff)
{
- if (m_creature->GetDistance(m_creature->getVictim()) <= 5)
- {
- Goblin_Dragon_Gun_Timer = 10000;
- DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
- }else Goblin_Dragon_Gun_Timer = 2000;
+ DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
+ Goblin_Dragon_Gun_Timer = 10000;
}else Goblin_Dragon_Gun_Timer -= diff;
- if(Rocket_Launch_Timer < diff)
+ if (Rocket_Launch_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH);
Rocket_Launch_Timer = 9000;
}else Rocket_Launch_Timer -= diff;
- if(Fel_Iron_Bomb_Timer < diff)
+ if (Fel_Iron_Bomb_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB);
Fel_Iron_Bomb_Timer = 15000;
}else Fel_Iron_Bomb_Timer -= diff;
- if(Recombobulate_Timer < diff)
+ if (Recombobulate_Timer < diff)
{
for(uint8 i = 0; i < Group.size(); ++i)
- if(Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid))
- if(pAdd->IsPolymorphed())
+ {
+ if (Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid))
+ {
+ if (pAdd->IsPolymorphed())
{
DoCast(pAdd, SPELL_RECOMBOBULATE);
break;
}
+ }
+ }
}else Recombobulate_Timer -= diff;
- if(High_Explosive_Sheep_Timer < diff)
+ if (High_Explosive_Sheep_Timer < diff)
{
DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP);
High_Explosive_Sheep_Timer = 65000;
@@ -1342,62 +1311,62 @@ void AddSC_boss_priestess_delrissa()
Script *newscript;
newscript = new Script;
- newscript->Name="boss_priestess_delrissa";
+ newscript->Name = "boss_priestess_delrissa";
newscript->GetAI = &GetAI_boss_priestess_delrissa;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_kagani_nightstrike";
+ newscript->Name = "boss_kagani_nightstrike";
newscript->GetAI = &GetAI_boss_kagani_nightstrike;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_ellris_duskhallow";
+ newscript->Name = "boss_ellris_duskhallow";
newscript->GetAI = &GetAI_ellris_duskhallow;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_eramas_brightblaze";
+ newscript->Name = "boss_eramas_brightblaze";
newscript->GetAI = &GetAI_eramas_brightblaze;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_yazzai";
+ newscript->Name = "boss_yazzai";
newscript->GetAI = &GetAI_yazzai;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_warlord_salaris";
+ newscript->Name = "boss_warlord_salaris";
newscript->GetAI = &GetAI_warlord_salaris;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_garaxxas";
+ newscript->Name = "boss_garaxxas";
newscript->GetAI = &GetAI_garaxxas;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_apoko";
+ newscript->Name = "boss_apoko";
newscript->GetAI = &GetAI_apoko;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="boss_zelfan";
+ newscript->Name = "boss_zelfan";
newscript->GetAI = &GetAI_zelfan;
newscript->RegisterSelf();
/*newscript = new Script;
- newscript->Name="mob_high_explosive_sheep";
+ newscript->Name = "mob_high_explosive_sheep";
newscript->GetAI = &GetAI_mob_high_explosive_sheep;
newscript->RegisterSelf();*/
/*newscript = new Script;
- newscript->Name="mob_fizzle";
+ newscript->Name = "mob_fizzle";
newscript->GetAI = &GetAI_mob_fizzle;
newscript->RegisterSelf();*/
/*newscript = new Script;
- newscript->Name="mob_sliver";
+ newscript->Name = "mob_sliver";
newscript->GetAI = &GetAI_mob_sliver;
newscript->RegisterSelf();*/
}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
index b056e2329e4..c18128bbe1a 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,12 +6,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
@@ -32,7 +32,7 @@ EndScriptData */
#define SAY_DEATH -1585005
#define EMOTE_CRYSTAL -1585006
-//Crystal efect spells
+//Crystal effect spells
#define SPELL_FEL_CRYSTAL_COSMETIC 44374
#define SPELL_FEL_CRYSTAL_DUMMY 44329
#define SPELL_FEL_CRYSTAL_VISUAL 44355
@@ -56,8 +56,8 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Crystals.clear();
- // GUIDs per instance is static, so we only need to load them once.
- if(pInstance)
+ //GUIDs per instance is static, so we only need to load them once.
+ if (pInstance)
{
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
for(uint8 i = 0; i < size; ++i)
@@ -71,6 +71,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
}
ScriptedInstance* pInstance;
+ bool Heroic;
std::list<uint64> Crystals;
@@ -78,23 +79,23 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
uint32 DrainManaTimer;
uint32 FelExplosionTimer;
uint32 DrainCrystalTimer;
- uint32 CheckTimer;
+ uint32 EmpowerTimer;
bool IsDraining;
bool DrainingCrystal;
- bool Heroic;
+
uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
void Reset()
{
- if(pInstance)
+ if (pInstance)
{
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
//Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
- if(pUnit)
+ if (pUnit)
{
if(!pUnit->isAlive())
((Creature*)pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc.
@@ -103,14 +104,13 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
+
GameObject* Door = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( Door )
+ if (Door)
Door->SetGoState(0); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
// Small door opened after event are expected to be closed by default
// Set Inst data for encounter
- if (m_creature->isDead())
- pInstance->SetData(DATA_SELIN_EVENT, DONE);
- else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
+ pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
}else error_log(ERROR_INST_DATA);
DrainLifeTimer = 3000 + rand()%4000;
@@ -118,7 +118,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
FelExplosionTimer = 2100;
DrainCrystalTimer = 10000 + rand()%5000;
DrainCrystalTimer = 20000 + rand()%5000;
- CheckTimer = 1000;
+ EmpowerTimer = 10000;
IsDraining = false;
DrainingCrystal = false;
@@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
void SelectNearestCrystal()
{
- if(Crystals.empty())
+ if (Crystals.empty())
return;
float ShortestDistance = 0;
@@ -140,9 +140,9 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pCrystal = NULL;
//pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
pCrystal = Unit::GetUnit(*m_creature, *itr);
- if(pCrystal && pCrystal->isAlive())
+ if (pCrystal && pCrystal->isAlive())
{
- if(!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal)))
+ if (!ShortestDistance || (ShortestDistance > m_creature->GetDistance2d(pCrystal)))
{
ShortestDistance = m_creature->GetDistance2d(pCrystal);
CrystalGUID = pCrystal->GetGUID();
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
}
}
}
- if( CrystalChosen )
+ if (CrystalChosen)
{
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_CRYSTAL, m_creature);
@@ -168,7 +168,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
void ShatterRemainingCrystals()
{
- if(Crystals.empty())
+ if (Crystals.empty())
return;
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
@@ -176,20 +176,19 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
//Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i]));
Creature* pCrystal = (Unit::GetCreature(*m_creature, *itr));
- if( pCrystal && pCrystal->isAlive())
+ if (pCrystal && pCrystal->isAlive())
pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
void Aggro(Unit* who)
{
- m_creature->SetPower(POWER_MANA, 0);
DoScriptText(SAY_AGGRO, m_creature);
- if( pInstance )
+ if (pInstance)
{
GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( EncounterDoor )
+ if (EncounterDoor)
EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset
}
}
@@ -198,17 +197,17 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
switch(rand()%2)
{
- case 0: DoScriptText(SAY_KILL_1, m_creature); break;
- case 1: DoScriptText(SAY_KILL_2, m_creature); break;
+ case 0: DoScriptText(SAY_KILL_1, m_creature); break;
+ case 1: DoScriptText(SAY_KILL_2, m_creature); break;
}
}
void MovementInform(uint32 type, uint32 id)
{
- if(type == POINT_MOTION_TYPE && id == 1)
+ if (type == POINT_MOTION_TYPE && id == 1)
{
Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
- if(CrystalChosen && CrystalChosen->isAlive())
+ if (CrystalChosen && CrystalChosen->isAlive())
{
// Make the crystal attackable
// We also remove NON_ATTACKABLE in case the database has it set.
@@ -229,7 +228,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, m_creature);
- if(!pInstance)
+ if (!pInstance)
{
error_log(ERROR_INST_DATA);
return;
@@ -238,35 +237,36 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR));
- if( EncounterDoor )
+ if (EncounterDoor)
EncounterDoor->SetGoState(0); // Open the encounter door
GameObject* ContinueDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_SELIN_DOOR));
- if( ContinueDoor )
+ if (ContinueDoor)
ContinueDoor->SetGoState(0); // Open the door leading further in
+ ShatterRemainingCrystals();
}
void UpdateAI(const uint32 diff)
{
- if(!UpdateVictim())
+ if (!UpdateVictim())
return;
- if(!DrainingCrystal)
+ if (!DrainingCrystal)
{
uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
- if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) )
+ if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
- if( DrainLifeTimer < diff )
+ if (DrainLifeTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
DrainLifeTimer = 10000;
}else DrainLifeTimer -= diff;
// Heroic only
- if( Heroic )
+ if (Heroic)
{
- if( DrainManaTimer < diff )
+ if (DrainManaTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_MANA);
DrainManaTimer = 10000;
@@ -274,9 +274,9 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
}
}
- if( FelExplosionTimer < diff )
+ if (FelExplosionTimer < diff)
{
- if(!m_creature->IsNonMeleeSpellCasted(false))
+ if (!m_creature->IsNonMeleeSpellCasted(false))
{
DoCast(m_creature, SPELL_FEL_EXPLOSION);
FelExplosionTimer = 2000;
@@ -285,48 +285,40 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
// If below 10% mana, start recharging
maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
- if( maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10) )
+ if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
- if(DrainCrystalTimer < diff)
+ if (DrainCrystalTimer < diff)
{
SelectNearestCrystal();
- if(Heroic) DrainCrystalTimer = 10000 + rand()%5000;
- else DrainCrystalTimer = 20000 + rand()%5000;
+ if (Heroic) DrainCrystalTimer = 10000 + rand()%5000;
+ else DrainCrystalTimer = 20000 + rand()%5000;
}else DrainCrystalTimer -= diff;
}
}else
{
- if( IsDraining )
+ if (IsDraining)
{
- if (CheckTimer < diff)
+ if (EmpowerTimer < diff)
{
+ IsDraining = false;
+ DrainingCrystal = false;
+
+ DoScriptText(SAY_EMPOWERED, m_creature);
+
Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
- if(CrystalChosen)
- {
- if(CrystalChosen->GetUInt32Value(UNIT_CHANNEL_SPELL) == SPELL_MANA_RAGE)
- {
- m_creature->StopMoving();
- }else{
- IsDraining = false;
- DrainingCrystal = false;
-
- DoScriptText(SAY_EMPOWERED, m_creature);
-
- Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
- if( CrystalChosen && CrystalChosen->isAlive() )
- // Use Deal Damage to kill it, not setDeathState.
- CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- CrystalGUID = 0;
-
- m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- }
- }
- CheckTimer = 1000;
- }else CheckTimer -= diff;
+ if (CrystalChosen && CrystalChosen->isAlive())
+ // Use Deal Damage to kill it, not setDeathState.
+ CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+
+ CrystalGUID = 0;
+
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ }else EmpowerTimer -= diff;
}
}
+
DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
}
};
@@ -348,19 +340,18 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
void JustDied(Unit* killer)
{
- m_creature->RemoveAurasDueToSpell(SPELL_MANA_RAGE);
- if(ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
+ if (ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
{
Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN)));
- if(Selin && Selin->isAlive())
+ if (Selin && Selin->isAlive())
{
- if(((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID())
+ if (((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID())
{
// Set this to false if we are the creature that Selin is draining so his AI flows properly
((boss_selin_fireheartAI*)Selin->AI())->DrainingCrystal = false;
((boss_selin_fireheartAI*)Selin->AI())->IsDraining = false;
- Selin->RemoveAurasDueToSpell(SPELL_MANA_RAGE);
- if(Selin->getVictim())
+ ((boss_selin_fireheartAI*)Selin->AI())->EmpowerTimer = 10000;
+ if (Selin->getVictim())
{
Selin->AI()->AttackStart(Selin->getVictim());
Selin->GetMotionMaster()->MoveChase(Selin->getVictim());
@@ -381,12 +372,12 @@ void AddSC_boss_selin_fireheart()
Script *newscript;
newscript = new Script;
- newscript->Name="boss_selin_fireheart";
+ newscript->Name = "boss_selin_fireheart";
newscript->GetAI = &GetAI_boss_selin_fireheart;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_fel_crystal";
+ newscript->Name = "mob_fel_crystal";
newscript->GetAI = &GetAI_mob_fel_crystal;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
index 3743423f0e0..5fb43c88306 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,12 +6,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
@@ -29,31 +29,36 @@ EndScriptData */
#define SAY_OVERLOAD -1585009
#define SAY_KILL -1585010
#define EMOTE_DISCHARGE_ENERGY -1585011
+
//is this text for real?
-#define SAY_DEATH "What...happen...ed."
+//#define SAY_DEATH "What...happen...ed."
//Pure energy spell info
-#define SPELL_ENERGY_BOLT 44342
+#define SPELL_ENERGY_BOLT 46156
#define SPELL_ENERGY_FEEDBACK 44335
//Vexallus spell info
#define SPELL_CHAIN_LIGHTNING 44318
-#define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell
#define SPELL_OVERLOAD 44353
#define SPELL_ARCANE_SHOCK 44319
-#define ASTRAL_FLARE_VISUAL 30237
+
+#define SPELL_SUMMON_PURE_ENERGY 44322 //mod scale -10
+#define H_SPELL_SUMMON_PURE_ENERGY1 46154 //mod scale -5
+#define H_SPELL_SUMMON_PURE_ENERGY2 46159 //mod scale -5
//Creatures
#define CREATURE_PURE_ENERGY 24745
-struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
+struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
{
boss_vexallusAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData()); Heroic = c->GetMap()->IsHeroic();
+ Heroic = c->GetMap()->IsHeroic();
}
ScriptedInstance* pInstance;
+ bool Heroic;
uint32 ChainLightningTimer;
uint32 ArcaneShockTimer;
@@ -61,7 +66,6 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
uint32 SpawnAddInterval;
uint32 AlreadySpawnedAmount;
bool Enraged;
- bool Heroic;
void Reset()
{
@@ -70,15 +74,10 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
OverloadTimer = 2200;
SpawnAddInterval = 15;
AlreadySpawnedAmount = 0;
-
Enraged = false;
- if(pInstance)
- {
- if (m_creature->isDead())
- pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
- else pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
- }
+ if (pInstance)
+ pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
}
void KilledUnit(Unit *victim)
@@ -88,14 +87,11 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
void JustDied(Unit *victim)
{
- DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
if (pInstance)
{
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
- GameObject* Door = NULL;
- Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR));
- if(Door)
+ if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR)))
Door->SetGoState(0);
}
}
@@ -103,68 +99,82 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
void Aggro(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
+
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
}
+ void JustSummoned(Creature *summoned)
+ {
+ if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ summoned->GetMotionMaster()->MoveFollow(temp,0,0);
+
+ //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
+ summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID());
+ }
+
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim() )
return;
- if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10)
{
Enraged = true;
}
- if(!Enraged)
+ if (!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
{
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
- Creature* PureEnergyCreature = NULL;
- PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (PureEnergyCreature && target)
- PureEnergyCreature->AI()->AttackStart(target);
-
- if(Heroic) // *Heroic mode only - he summons two instead of one.
+
+ if (Heroic)
{
- PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, -10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if (PureEnergyCreature && target)
- PureEnergyCreature->AI()->AttackStart(target);
+ m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false);
+ m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false);
}
+ else
+ m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false);
+
+ //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos
+ DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+
+ if (Heroic)
+ DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
++AlreadySpawnedAmount;
- };
+ }
- if(ChainLightningTimer < diff)
+ if (ChainLightningTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_CHAIN_LIGHTNING);
+ DoCast(target, SPELL_CHAIN_LIGHTNING);
+
ChainLightningTimer = 10000;
}else ChainLightningTimer -= diff;
- if(ArcaneShockTimer < diff)
+ if (ArcaneShockTimer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- DoCast(target, SPELL_ARCANE_SHOCK);
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_ARCANE_SHOCK);
+
ArcaneShockTimer = 8000;
}else ArcaneShockTimer -= diff;
- }else
+ }
+ else
{
- if(OverloadTimer < diff)
+ if (OverloadTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_OVERLOAD);
+ DoCast(target, SPELL_OVERLOAD);
+
OverloadTimer = 2200;
}else OverloadTimer -= diff;
}
+
DoMeleeAttackIfReady();
}
};
@@ -174,44 +184,24 @@ CreatureAI* GetAI_boss_vexallus(Creature *_Creature)
return new boss_vexallusAI (_Creature);
};
-struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
+struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
{
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {}
- uint32 EnergyBoltTimer;
- uint32 VisualTimer;
-
- void Reset()
- {
- EnergyBoltTimer = 1700;
- VisualTimer = 1000;
- m_creature->SetSpeed(MOVE_RUN, 0.5f);
- m_creature->SetSpeed(MOVE_WALK, 0.5f);
- }
+ void Reset() { }
void JustDied(Unit* slayer)
{
- slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, m_creature->GetGUID());
- }
-
- void Aggro(Unit *who){}
-
- void UpdateAI(const uint32 diff)
- {
- if(!UpdateVictim())
- return;
-
- if(EnergyBoltTimer < diff)
+ if (Unit *temp = m_creature->GetOwner())
{
- DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT);
- EnergyBoltTimer = 1700;
- }else EnergyBoltTimer -= diff;
- if(VisualTimer < diff)
- {
- DoCast(m_creature->getVictim(), ASTRAL_FLARE_VISUAL, true);
- VisualTimer = 1000;
- }else VisualTimer -= diff;
+ if (temp && temp->isAlive())
+ slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
+ }
}
+
+ void Aggro(Unit *who) { }
+ void MoveInLineOfSight(Unit *who) { }
+ void AttackStart(Unit *who) { }
};
CreatureAI* GetAI_mob_pure_energy(Creature *_Creature)
@@ -224,13 +214,12 @@ void AddSC_boss_vexallus()
Script *newscript;
newscript = new Script;
- newscript->Name="boss_vexallus";
+ newscript->Name = "boss_vexallus";
newscript->GetAI = &GetAI_boss_vexallus;
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_pure_energy";
+ newscript->Name = "mob_pure_energy";
newscript->GetAI = &GetAI_mob_pure_energy;
newscript->RegisterSelf();
}
-
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
index f509a8bc73c..d6419ea409c 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -20,13 +20,12 @@
#define DATA_DELRISSA_DOOR 11
#define DATA_SELIN_ENCOUNTER_DOOR 12
-#define DATA_KAEL_STATUE_LEFT 13
-#define DATA_KAEL_STATUE_RIGHT 14
+#define DATA_KAEL_DOOR 13
+#define DATA_KAEL_STATUE_LEFT 14
+#define DATA_KAEL_STATUE_RIGHT 15
-#define DATA_DELRISSA_DEATH_COUNT 15
+#define DATA_DELRISSA_DEATH_COUNT 16
-#define DATA_KAEL 16
-
-#define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
+#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
#endif
diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
index 5afb79e84d0..7e16b37c353 100644
--- a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
+++ b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -6,12 +6,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
@@ -37,29 +37,25 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
instance_magisters_terrace(Map* map) : ScriptedInstance(map) {Initialize();}
- uint32 DoorState[3];//0seline, 1vexallus, 2derlissa
uint32 Encounters[NUMBER_OF_ENCOUNTERS];
uint32 DelrissaDeathCount;
std::list<uint64> FelCrystals;
std::list<uint64>::iterator CrystalItr;
- uint64 KaelGUID;
uint64 SelinGUID;
uint64 DelrissaGUID;
uint64 VexallusDoorGUID;
uint64 SelinDoorGUID;
uint64 SelinEncounterDoorGUID;
uint64 DelrissaDoorGUID;
+ uint64 KaelDoorGUID;
uint64 KaelStatue[2];
bool InitializedItr;
void Initialize()
{
- for(uint8 i = 0; i < 3; i++)
- DoorState[i] = 1;//1 closed, 0 opened
-
for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
Encounters[i] = NOT_STARTED;
@@ -67,13 +63,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
DelrissaDeathCount = 0;
- KaelGUID = 0;
SelinGUID = 0;
DelrissaGUID = 0;
VexallusDoorGUID = 0;
SelinDoorGUID = 0;
SelinEncounterDoorGUID = 0;
DelrissaDoorGUID = 0;
+ KaelDoorGUID = 0;
KaelStatue[0] = 0;
KaelStatue[1] = 0;
@@ -106,30 +102,9 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
switch(identifier)
{
- case DATA_SELIN_EVENT:
- Encounters[0] = data;
- if(data==DONE)
- {
- DoorState[0] = 0;
- SaveToDB();
- }
- break;
- case DATA_VEXALLUS_EVENT:
- Encounters[1] = data;
- if(data==DONE)
- {
- DoorState[1] = 0;
- SaveToDB();
- }
- break;
- case DATA_DELRISSA_EVENT:
- Encounters[2] = data;
- if(data==DONE)
- {
- DoorState[2] = 0;
- SaveToDB();
- }
- break;
+ case DATA_SELIN_EVENT: Encounters[0] = data; break;
+ case DATA_VEXALLUS_EVENT: Encounters[1] = data; break;
+ case DATA_DELRISSA_EVENT: Encounters[2] = data; break;
case DATA_KAELTHAS_EVENT: Encounters[3] = data; break;
case DATA_DELRISSA_DEATH_COUNT:
@@ -138,38 +113,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
}
- const char* Save()
- {
- std::ostringstream ss;
- ss << "S " << DoorState[0] << " " << DoorState[1] << " " << DoorState[2];
- char* data = new char[ss.str().length()+1];
- strcpy(data, ss.str().c_str());
- return data;
- }
-
- void Load(const char* load)
- {
- if(!load) return;
- std::istringstream ss(load);
- char dataHead; // S
- uint32 data1, data2, data3;
- ss >> dataHead >> data1 >> data2 >> data3;
- if(dataHead == 'S')
- {
- DoorState[0] = data1;
- DoorState[1] = data2;
- DoorState[2] = data3;
- }else error_log("SD2: Magister's Terrace: corrupted save data.");
- }
-
void OnCreatureCreate(Creature *creature, uint32 entry)
{
- switch(entry)
+ switch(creature->GetEntry())
{
case 24723: SelinGUID = creature->GetGUID(); break;
case 24560: DelrissaGUID = creature->GetGUID(); break;
case 24722: FelCrystals.push_back(creature->GetGUID()); break;
- case 24664: KaelGUID = creature->GetGUID(); break;
}
}
@@ -177,21 +127,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
switch(go->GetEntry())
{
- case 187896:
- VexallusDoorGUID = go->GetGUID();
- go->SetGoState(DoorState[1]);
- break;
+ case 187896: VexallusDoorGUID = go->GetGUID(); break;
//SunwellRaid Gate 02
- case 187979:
- SelinDoorGUID = go->GetGUID();
- go->SetGoState(DoorState[0]);
- break;
+ case 187979: SelinDoorGUID = go->GetGUID(); break;
//Assembly Chamber Door
case 188065: SelinEncounterDoorGUID = go->GetGUID(); break;
- case 187770:
- DelrissaDoorGUID = go->GetGUID();
- go->SetGoState(DoorState[2]);
- break;
+ case 187770: DelrissaDoorGUID = go->GetGUID(); break;
+ case 188064: KaelDoorGUID = go->GetGUID(); break;
case 188165: KaelStatue[0] = go->GetGUID(); break;
case 188166: KaelStatue[1] = go->GetGUID(); break;
}
@@ -202,12 +144,12 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
switch(identifier)
{
case DATA_SELIN: return SelinGUID;
- case DATA_KAEL: return KaelGUID;
case DATA_DELRISSA: return DelrissaGUID;
case DATA_VEXALLUS_DOOR: return VexallusDoorGUID;
case DATA_SELIN_DOOR: return SelinDoorGUID;
case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID;
case DATA_DELRISSA_DOOR: return DelrissaDoorGUID;
+ case DATA_KAEL_DOOR: return KaelDoorGUID;
case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
index 16a6a301681..bb7c183ff02 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
index ca2253c96b1..960307421d0 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
index e59da4ff650..d748220d3cf 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
index 64b7c2c67f5..4741577a60b 100644
--- a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
+++ b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
index 5b34758714c..953ed97cfc6 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
index 7f4758b8c79..72d2e871f16 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
index fbe09203551..55ed3c6fb38 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
index 8684f10c509..b98c4bec979 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
index 7b948fbf747..b1d12d5a351 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
index 72c3a759dfa..034344845c6 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
index c28867accbd..ccfed05578b 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
index 7d9a64666cf..fddbbdeb992 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -225,6 +225,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
}
@@ -242,6 +243,7 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
}
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
index d11a49e0cf9..1f515f1e32f 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
index 244bc6ece50..3efc6d08bbf 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
index e728c863767..5874d8b9408 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
+++ b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
index 5c783edfe10..bfaa583e033 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
index 8d9977957d6..d25ddc7631c 100644
--- a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
+++ b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
index 027ef125ca7..dfafa193542 100644
--- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
+++ b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
index 74d800a5484..85d5d8a1d53 100644
--- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
+++ b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
index 0266fa8ef43..8b43005b5df 100644
--- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
+++ b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
m_creature->DeleteThreatList();
m_creature->CombatStop();
m_creature->setFaction(1080); //friendly
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
+ m_creature->SetStandState(UNIT_STAND_STATE_SIT);
DoScriptText(LUMP_DEFEAT, m_creature);
bReset = true;
@@ -134,11 +134,11 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
void Aggro(Unit *who)
{
- if (m_creature->HasAura(SPELL_VISUAL_SLEEP,0))
- m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0);
+ if (m_creature->HasAura(SPELL_VISUAL_SLEEP))
+ m_creature->RemoveAura(SPELL_VISUAL_SLEEP);
if (!m_creature->IsStandState())
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
switch(rand()%2)
{
@@ -226,7 +226,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI
void Reset()
{
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
}
void Aggro(Unit *who) {}
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
index 86d4002718f..815b273d185 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,7 +16,7 @@
/* ScriptData
SDName: Boss_Anubrekhan
-SD%Complete: 70
+SD%Complete: 100
SDComment:
SDCategory: Naxxramas
EndScriptData */
@@ -38,7 +38,7 @@ EndScriptData */
#define SPELL_LOCUSTSWARM 28785 //This is a self buff that triggers the dmg debuff
#define H_SPELL_LOCUSTSWARM 54021
-//invalid
+//spellId invalid
#define SPELL_SUMMONGUARD 29508 //Summons 1 crypt guard at targeted location
#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death)
@@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
{
//Cast Impale on a random target
//Do NOT cast it when we are afflicted by locust swarm
- if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
+ if (!m_creature->HasAura(SPELL_LOCUSTSWARM))
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_IMPALE);
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
index c04cab35e58..5fafebadb96 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Faerlina
SD%Complete: 50
-SDComment: Without Mindcontrol boss cannot be defeated
+SDComment:
SDCategory: Naxxramas
EndScriptData */
@@ -32,6 +32,8 @@ EndScriptData */
#define SAY_SLAY2 -1533015
#define SAY_DEATH -1533016
+//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this
+
#define SPELL_POSIONBOLT_VOLLEY 28796
#define H_SPELL_POSIONBOLT_VOLLEY 54098
#define SPELL_ENRAGE 28798
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp
index 0ae5080d227..a51573d745d 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
index 80cbc347fe1..5fb9f017b0a 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
index ed2ef9de4e6..0becff399da 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -41,8 +41,10 @@ EndScriptData */
#define SPELL_SHADOW_MARK 27825
//Unrelenting Rider
-#define SPELL_UNHOLY_AURA 28340
-#define SPELL_SHADOWBOLT 19729 //Search thru targets and find those who have the SHADOW_MARK to cast this on
+#define SPELL_UNHOLY_AURA 55606
+#define H_SPELL_UNHOLY_AURA 55608
+#define SPELL_SHADOWBOLT_VOLLEY 27831 //Search thru targets and find those who have the SHADOW_MARK to cast this on
+#define H_SPELL_SHADOWBOLT_VOLLEY 55638
//Spectral Trainee
#define SPELL_ARCANE_EXPLOSION 27989
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
index 88ce581e6dd..e0bf157dc43 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
index 78921efff3d..d5f1e594d0c 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -21,20 +21,19 @@ SDComment: Place Holder
SDCategory: Naxxramas
EndScriptData */
-//Lotheb or Heigan?
-//8825 aggro1 - You are mine now!
-//8826 aggro2 - I see you!
-//8827 aggro3 - You...are next!
-//8828 death -
-//8829 slay - close your eyes... sleep
-//8830 taunt1 - The races of the world will perish. It is only a matter of time.
-//8831 taunt2 - I see endless suffering, I see torment, I see rage. I see... everything!
-//8832 taunt3 - Soon... the world will tremble!
-//8833 taunt4 - The end is upon you.
-//8834 taunt5 - Hungry worms will feast on your rotten flesh!
-
#include "precompiled.h"
+#define SAY_AGGRO1 -1533109
+#define SAY_AGGRO2 -1533110
+#define SAY_AGGRO3 -1533111
+#define SAY_SLAY -1533112
+#define SAY_TAUNT1 -1533113
+#define SAY_TAUNT2 -1533114
+#define SAY_TAUNT3 -1533115
+#define SAY_TAUNT4 -1533116
+#define SAY_TAUNT5 -1533117
+#define SAY_DEATH -1533118
+
//Spell used by floor peices to cause damage to players
#define SPELL_ERUPTION 29371
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
index 170ced981f7..952fb5504ce 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -257,7 +257,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
Walk_Pos_Z = ADDZ_RIGHT_NEAR;
break;
}
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
+ pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z);
}
}
@@ -407,7 +407,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
{
//if we find no one to figth walk to the center
if(!pUnit->isInCombat())
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z,MOVEMENTFLAG_WALK_MODE);
+ pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z);
//Safe storing of creatures
GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID();
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
index d5e382d80e6..aceaba93b1f 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,28 +23,6 @@ EndScriptData */
#include "precompiled.h"
-#define SAY_AGGRO1 "You are mine now!"
-#define SAY_AGGRO2 "I see you!"
-#define SAY_AGGRO3 "You...are next!"
-#define SAY_SLAY1 "Close your eyes... sleep!"
-#define SAY_SLAY2 "The races of the world will perish. It is only a matter of time."
-#define SAY_SLAY3 "I see endless suffering, I see torment, I see rage. I see... everything!"
-#define SAY_SLAY4 "Soon... the world will tremble!"
-#define SAY_SLAY5 "The end is upon you."
-#define SAY_SLAY6 "Hungry worms will feast on your rotten flesh!"
-#define SAY_DEATH ""
-
-#define SOUND_AGGRO1 8825
-#define SOUND_AGGRO2 8826
-#define SOUND_AGGRO3 8827
-#define SOUND_SLAY1 8829
-#define SOUND_SLAY2 8830
-#define SOUND_SLAY3 8831
-#define SOUND_SLAY4 8832
-#define SOUND_SLAY5 8833
-#define SOUND_SLAY6 8834
-#define SOUND_DEATH 8828
-
#define SPELL_CORRUPTED_MIND 29198
#define SPELL_POISON_AURA 29865
#define SPELL_INEVITABLE_DOOM 29204
@@ -85,58 +63,10 @@ struct TRINITY_DLL_DECL boss_loathebAI : public ScriptedAI
void Aggro(Unit *who)
{
- switch (rand()%3)
- {
- case 0:
- DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
- break;
- case 1:
- DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
- break;
- case 2:
- DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
- break;
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- switch (rand()%6)
- {
- case 0:
- DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY1);
- break;
- case 1:
- DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY2);
- break;
- case 2:
- DoYell(SAY_SLAY3,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY3);
- break;
- case 3:
- DoYell(SAY_SLAY4,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY4);
- break;
- case 4:
- DoYell(SAY_SLAY5,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY5);
- break;
- case 5:
- DoYell(SAY_SLAY6,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SLAY6);
- break;
- }
}
void JustDied(Unit* Killer)
{
- DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_DEATH);
}
void UpdateAI(const uint32 diff)
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
index 235029f1cb7..6c41ad1b022 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,8 +16,8 @@
/* ScriptData
SDName: Boss_Maexxna
-SD%Complete: 80
-SDComment:
+SD%Complete: 60
+SDComment: this needs review, and rewrite of the webwrap ability
SDCategory: Naxxramas
EndScriptData */
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
index 59f9d33e245..43be957aa81 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
index 99d30a7ed06..5359b47bad4 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,8 +16,8 @@
/* ScriptData
SDName: Boss_Patchwerk
-SD%Complete: 100
-SDComment: Some issues with hateful strike inturrupting the melee swing timer. Probably core issue.
+SD%Complete: 80
+SDComment: Some issues with hateful strike inturrupting the melee swing timer.
SDCategory: Naxxramas
EndScriptData */
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
index 9a8277264e5..9054e89dc26 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index 43396199f5f..c0c2f457f0c 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
index a8bc620ec17..259c1589791 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Thaddius
SD%Complete: 0
-SDComment: Merge Feugen & Stalagg with this script
+SDComment: Placeholder. Includes Feugen & Stalagg.
SDCategory: Naxxramas
EndScriptData */
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
index e589630c15f..2ed8399f57a 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
index 05a6c9b6bf8..7704247cf90 100644
--- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
+++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -404,7 +404,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_creature, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
@@ -441,8 +441,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
ardonis->SendUpdateToPlayer(player);
//Set them to kneel
- m_creature->SetStandState(PLAYER_STATE_KNEEL);
- ardonis->SetStandState(PLAYER_STATE_KNEEL);
+ m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
+ ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
}
//Set them back to each other
@@ -466,8 +466,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
ardonis->SendUpdateToPlayer(player);
//Set state
- m_creature->SetStandState(PLAYER_STATE_NONE);
- ardonis->SetStandState(PLAYER_STATE_NONE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ ardonis->SetStandState(UNIT_STAND_STATE_STAND);
}
}
@@ -639,7 +639,7 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range)
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*source, entry, true, range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, creature_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(source, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
@@ -652,7 +652,7 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range)
bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at)
{
//if player lost aura or not have at all, we should not try start event.
- if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0))
+ if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
return false;
if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
@@ -858,7 +858,7 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
DoScriptText(EMOTE_WEAK, m_creature);
Weak = true;
}
- if(Weak && !Drained && m_creature->HasAura(34219, 0))
+ if(Weak && !Drained && m_creature->HasAura(34219))
{
Drained = true;
diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp
new file mode 100644
index 00000000000..25a156b1bc4
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp
@@ -0,0 +1,170 @@
+/* Script Data Start
+SDName: Boss malygos
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCANE_BREATH_N 56272
+#define SPELL_ARCANE_BREATH_H 60072
+#define SPELL_ARCANE_PULSE 57432
+#define SPELL_ARCANE_STORM_1 57459
+#define SPELL_ARCANE_STORM_2 61693
+#define SPELL_ARCANE_STORM_3 61694
+#define SPELL_STATIC_FIELD 57430
+#define SPELL_SURGE_OF_POWER_1 56505
+#define SPELL_SURGE_OF_POWER_2 57407
+#define SPELL_SURGE_OF_POWER_3 60936
+#define SPELL_VORTEX 56105
+
+//Dragon "mounts" spells in Phase3
+//they use Rugelike energy
+#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate
+#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621
+#define SPELL_DMOUNT_REVIVIFY 57090
+#define SPELL_DMOUNT_LIFE_BURST 57143
+#define SPELL_DMOUNT_FLAME_SHIELD 57108
+//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%.
+
+
+//Yell
+//-->Other
+#define SAY_ANTI_MAGIC_SHELL -1616000
+#define SAY_BREATH_ATTACK -1616001
+#define SAY_HIGH_DAMAGE_MODE -1616002
+#define SAY_MAGIC_BLAST -1616003
+//--> Generic Spells
+#define SAY_GENERIC_SPELL_1 -1616004
+#define SAY_GENERIC_SPELL_2 -1616005
+#define SAY_GENERIC_SPELL_3 -1616006
+#define SAY_DEATH -1616007
+//--> Prefight
+#define SAY_PREFIGHT_1 -1616008
+#define SAY_PREFIGHT_2 -1616009
+#define SAY_PREFIGHT_3 -1616010
+#define SAY_PREFIGHT_4 -1616011
+#define SAY_PREFIGHT_5 -1616012
+//--> Phase1
+#define SAY_PHASE1_AGGRO -1616013
+#define SAY_PHASE1_END -1616014
+#define SAY_PHASE1_SLAY_1 -1616015
+#define SAY_PHASE1_SLAY_2 -1616016
+#define SAY_PHASE1_SLAY_3 -1616017
+
+//--> Phase2 at 50% HP,
+
+/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter.
+During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops.
+Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone.
+The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions.
+The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground.
+It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them.
+The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage.
+After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/
+
+#define SAY_PHASE2_AGGRO -1616018
+#define SAY_PHASE2_END -1616019
+#define SAY_PHASE2_SLAY_1 -1616020
+#define SAY_PHASE2_SLAY_2 -1616021
+#define SAY_PHASE2_SLAY_3 -1616022
+//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts"
+#define SAY_PHASE3_INTRO -1616023
+#define SAY_PHASE3_AGGRO -1616024
+#define SAY_PHASE3_SLAY_1 -1616025
+#define SAY_PHASE3_SLAY_2 -1616026
+#define SAY_PHASE3_SLAY_3 -1616027
+#define SAY_PHASE3_BIG_ATTACK -1616028
+
+struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI
+{
+ boss_malygosAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase,
+ enrage;
+
+ void Reset()
+ {
+ //Source Deadly Boss Mod
+ enrage = 615000; //10 min
+ }
+ void Aggro(Unit* who)
+ {
+ if(phase == 1)
+ DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ if(phase == 2)
+ DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ if(phase == 3)
+ DoScriptText(SAY_PHASE1_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ phase =1;
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){
+ phase = 2;
+ //spawn adds
+ //set malygos unatackable untill all adds spawned dead
+ //start phase3
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ if(phase ==1)
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break;
+ case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break;
+ }
+ if(phase ==2)
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break;
+ }
+ if(phase ==3)
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_malygos(Creature *_Creature)
+{
+ return new boss_malygosAI (_Creature);
+}
+
+void AddSC_boss_malygos()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_malygos";
+ newscript->GetAI = GetAI_boss_malygos;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h
new file mode 100644
index 00000000000..caa82a92e95
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h
@@ -0,0 +1,4 @@
+#ifndef DEF_EYE_OF_ETERNITY_H
+#define DEF_EYE_OF_ETERNITY_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp
new file mode 100644
index 00000000000..48d26f2bcd9
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_eye_of_eternity.h"
+
+struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance
+{
+ instance_eye_of_eternity(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_eye_of_eternity(Map* map)
+{
+ return new instance_eye_of_eternity(map);
+}
+
+void AddSC_instance_eye_of_eternity()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_eye_of_eternity";
+ newscript->GetInstanceData = GetInstanceData_instance_eye_of_eternity;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp
new file mode 100644
index 00000000000..559a9081226
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp
@@ -0,0 +1,149 @@
+/* Script Data Start
+SDName: Boss anomalus
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_SPARK_1 47751
+#define SPELL_SPARK_2 57062
+#define SPELL_RIFT_SHIELD 47748
+#define SPELL_CHARGE_RIFT 47747
+#define SPELL_ARCANE_ATTRACTION 57063
+#define SPELL_CREATE_RIFT 47743 //Dummy ---> summons (npc 26918) "Chaotic Rift", which spawns "Crazed Mana Wraith"s (npc 26746)
+
+#define MOB_CRAZED_MANA_WRAITH 26746
+#define NPC_CHAOTIC_RIFT 26918
+
+//Yell
+#define SAY_AGGRO -1576000
+#define SAY_KILL -1576001
+#define SAY_DEATH -1576002
+#define SAY_RIFT -1576003
+#define SAY_SHIELD -1576004
+
+struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI
+{
+ boss_anomalusAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ //Source DBM
+ if((((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 80) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 77))
+ || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 52))
+ || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 27)))
+ {
+ //Summon rift at a random location
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+/*######
+## Crazed Mana Wraiths
+######*/
+#define SPELL_ARCANE_MISSILES 33833
+
+struct TRINITY_DLL_DECL mob_crazed_mana_wraithAI : public ScriptedAI
+{
+ mob_crazed_mana_wraithAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+/*######
+## Chaotic Rift
+######*/
+#define SPELL_CHAOTIC_ENERGY_BURST 47688
+#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737
+
+struct TRINITY_DLL_DECL npc_chaotic_riftAI : public ScriptedAI
+{
+ npc_chaotic_riftAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_npc_chaotic_rift(Creature *_Creature)
+{
+ return new npc_chaotic_riftAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_anomalus(Creature *_Creature)
+{
+ return new boss_anomalusAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_crazed_mana_wraith(Creature *_Creature)
+{
+ return new boss_anomalusAI (_Creature);
+}
+
+void AddSC_boss_anomalus()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_anomalus";
+ newscript->GetAI = GetAI_boss_anomalus;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_crazed_mana_wraith";
+ newscript->GetAI = GetAI_mob_crazed_mana_wraith;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_chaotic_rift";
+ newscript->GetAI = GetAI_npc_chaotic_rift;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp
new file mode 100644
index 00000000000..7c764c3ec1a
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp
@@ -0,0 +1,89 @@
+/* Script Data Start
+SDName: Boss keristrasza
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_maiden_of_grief' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_TAIL_SWEEP 50155
+#define SPELL_CRYSTAL_CHAINS 50997
+#define SPELL_ENRAGE 8599
+#define SPELL_CRYSTALFIRE_BREATH_1 48096
+#define SPELL_CRYSTALFIRE_BREATH_2 57091
+#define SPELL_CRYSTALIZE 48179
+#define SPELL_INTENSE_COLD 48095 //stackable debuff
+
+//Yell
+#define SAY_AGGRO -1576005
+#define SAY_SLAY -1576006
+#define SAY_ENRAGE -1576007
+#define SAY_DEATH -1576008
+#define SAY_CRYSTAL_NOVA -1576009
+
+struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
+{
+ boss_keristraszaAI(Creature *c) : ScriptedAI(c) {}
+
+ bool enraged;
+
+ void Reset()
+ {
+ enraged = false;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 10)
+ {
+ if(!enraged)
+ {
+ DoScriptText(SAY_ENRAGE, m_creature);
+ DoCast(m_creature, SPELL_ENRAGE);
+ enraged = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_SLAY, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_keristrasza(Creature *_Creature)
+{
+ return new boss_keristraszaAI (_Creature);
+}
+
+void AddSC_boss_keristrasza()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_keristrasza";
+ newscript->GetAI = GetAI_boss_keristrasza;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp
new file mode 100644
index 00000000000..0d97b530376
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp
@@ -0,0 +1,118 @@
+/* Script Data Start
+SDName: Boss magus_telestra
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+#include "def_nexus.h"
+
+
+//Spells
+
+//phase 1
+#define SPELL_ICE_NOVA 47772
+#define SPELL_ICE_NOVA 56935
+#define SPELL_FIREBOMB 47773
+#define SPELL_FIREBOMB 56934
+#define SPELL_GAVITY_WELL 47756
+
+//Phase 2 -->50% HP (3 clones, Frost, Fire, Arcane)
+//Frost Magus (npc 26930)
+#define FROST_MAGUS_VISUAL 47706 //Dummy
+#define SPELL_BLIZZARD_N 47727
+#define SPELL_ICE_BARB_N 47729
+//heroic
+#define SPELL_BLIZZARD_H 56936
+#define SPELL_ICE_BARB_H 56937
+
+//Fire Magus (npc 26928)
+#define FIRE_MAGUS_VISUAL 47705 //Dummy
+#define SPELL_FIRE_BLAST 47721
+#define SPELL_SCORCH 47723
+//heroic
+#define SPELL_FIRE_BLAST_H 56939
+#define SPELL_SCORCH_H 56938
+
+//Arcane Magus (npc 26929)
+#define ARCANE_MAGUS_VISUAL 47704 //Dummy
+#define SPELL_CRITTER 47731
+#define SPELL_TIME_STOP 47736
+
+//Yell
+#define SAY_AGGRO -1576010
+#define SAY_KILL -1576011
+#define SAY_DEATH -1576012
+#define SAY_MERGE -1576013
+#define SAY_SPLIT_1 -1576014
+#define SAY_SPLIT_2 -1576015
+
+
+struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI
+{
+ boss_magus_telestraAI(Creature *c) : ScriptedAI(c) {}
+
+ bool splited;
+ uint64 Magus_frost,
+ Magus_fire,
+ Magus_arcane;
+
+ void Reset()
+ {
+ splited = false;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if(!splited)
+ {
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50)
+ {
+ DoScriptText(SAY_SPLIT_1, m_creature);
+ //HandleSplit
+ splited = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_magus_telestra(Creature *_Creature)
+{
+ return new boss_magus_telestraAI (_Creature);
+}
+
+void AddSC_boss_magus_telestra()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_magus_telestra";
+ newscript->GetAI = GetAI_boss_magus_telestra;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp
new file mode 100644
index 00000000000..d4dcbae6616
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp
@@ -0,0 +1,90 @@
+/* Script Data Start
+SDName: Boss ormorok
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CRYSTAL_SPIKES_1 47958
+#define SPELL_CRYSTAL_SPIKES_2 57082
+#define SPELL_CRYSTAL_SPIKES_3 57083
+#define SPELL_SPELL_REFLECTION 47981
+#define SPELL_TRAMPLE_N 48016
+#define SPELL_TRAMPLE_H 57066
+#define SPELL_FRENZY_N 48017
+#define SPELL_FRENZY_H 57086
+#define SPELL_SUMMON_CRYSTALLINE_TANGLER 61564 //summons npc 32665
+
+//Yell
+#define SAY_AGGRO -1576016
+#define SAY_KILL -1576017
+#define SAY_DEATH -1576018
+#define SAY_REFLECT -1576019
+#define SAY_ICE_SPIKES -1576020
+
+struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI
+{
+ boss_ormorokAI(Creature *c) : ScriptedAI(c) {}
+
+ bool frenzy;
+
+ void Reset()
+ {
+ frenzy = false;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 25)
+ {
+ if(!frenzy)
+ {
+ DoCast(m_creature, SPELL_FRENZY_N);
+ frenzy = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_ormorok(Creature *_Creature)
+{
+ return new boss_ormorokAI (_Creature);
+}
+
+void AddSC_boss_ormorok()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ormorok";
+ newscript->GetAI = GetAI_boss_ormorok;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp
new file mode 100644
index 00000000000..b8715fb6d7d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp
@@ -0,0 +1,57 @@
+/* Script Data Start
+SDName: Boss Commander Kolurg
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment: Only Alliance Heroic
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_commander_kolurg' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+#define SPELL_BATTLE_SHOUT 31403
+#define SPELL_CHARGE 60067
+#define SPELL_FRIGHTENING_SHOUT 19134
+#define SPELL_WHIRLWIND_1 38619
+#define SPELL_WHIRLWIND_2 38618
+
+//Yell
+#define SAY_AGGRO 1576024
+#define SAY_KILL 1576025
+#define SAY_DEATH 1576026
+
+struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI
+{
+ boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_commander_kolurg(Creature *_Creature)
+{
+ return new boss_commander_kolurgAI (_Creature);
+}
+
+void AddSC_boss_commander_kolurg()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_commander_kolurg";
+ newscript->GetAI = GetAI_boss_commander_kolurg;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp
new file mode 100644
index 00000000000..26ef1fc5f97
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp
@@ -0,0 +1,63 @@
+/* Script Data Start
+SDName: Boss Commander Stoutbeard
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment: Only Horde Heroic
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+#define SPELL_BATTLE_SHOUT 31403
+#define SPELL_CHARGE 60067
+#define SPELL_FRIGHTENING_SHOUT 19134
+#define SPELL_WHIRLWIND_1 38619
+#define SPELL_WHIRLWIND_2 38618
+
+//Yell
+#define SAY_AGGRO 1576021
+#define SAY_KILL 1576022
+#define SAY_DEATH 1576023
+
+struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI
+{
+ boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_commander_stoutbeard(Creature *_Creature)
+{
+ return new boss_commander_stoutbeardAI (_Creature);
+}
+
+void AddSC_boss_commander_stoutbeard()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_commander_stoutbeard";
+ newscript->GetAI = GetAI_boss_commander_stoutbeard;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h
new file mode 100644
index 00000000000..d868c72adf6
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h
@@ -0,0 +1,35 @@
+#ifndef DEF_NEXUS_H
+#define DEF_NEXUS_H
+
+#define DATA_ANOMALUSDEAD 1
+#define DATA_ANOMALUS_DEATH 2
+#define DATA_ORMOROKDDEAD 3
+#define DATA_ORMOROK_DEATH 4
+
+#define DATA_MAGUSTELESTRADEAD 5
+#define DATA_MAGUSTELESTRA_DEATH 6
+#define DATA_MAGUSTELESTRA_A_DEAD 7
+#define DATA_MAGUSTELESTRA_A_DEATH 8
+#define DATA_MAGUSTELESTRA_F_DEAD 9
+#define DATA_MAGUSTELESTRA_F_DEATH 10
+#define DATA_MAGUSTELESTRA_FI_DEAD 11
+#define DATA_MAGUSTELESTRA_FI_DEATH 12
+
+#define DATA_KERISTRASZADEAD 13
+#define DATA_KERISTRASZA_DEATH 14
+#define DATA_COMMANDER_KOLURGDEAD 15
+#define DATA_COMMANDER_KOLURG_DEATH 16
+#define DATA_COMMANDER_STOUTBEARDDEAD 17
+#define DATA_COMMANDER_STOUTBEARD_DEATH 18
+#define DATA_ANOMALUS 19
+#define DATA_ORMOROK 20
+
+#define DATA_MAGUSTELESTRA 21
+#define DATA_MAGUSTELESTRA_A 22
+#define DATA_MAGUSTELESTRA_F 23
+#define DATA_MAGUSTELESTRA_FI 24
+
+#define DATA_KERISTRASZA 25
+#define DATA_COMMANDER_KOLURG 26
+#define DATA_COMMANDER_STOUTBEARD 27
+#endif
diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp
new file mode 100644
index 00000000000..7f07b372be9
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp
@@ -0,0 +1,158 @@
+#include "precompiled.h"
+#include "def_nexus.h"
+
+struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
+{
+ instance_nexus(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Anomalus,
+ Ormorok,
+ Magus_telestra,
+ Magus_frost,
+ Magus_fire,
+ Magus_arcane,
+ keristrasza,
+ Commander_kolurg,
+ Commander_stoutbeard;
+ bool IsBossDied[9];
+
+ void Initialize()
+ {
+ Anomalus = 0;
+ Ormorok = 0;
+ Magus_telestra =0;
+ Magus_frost =0;
+ Magus_fire =0;
+ Magus_arcane =0;
+ keristrasza =0;
+ Commander_kolurg = 0;
+ Commander_stoutbeard = 0;
+ IsBossDied[0] = false;
+ IsBossDied[1] = false;
+ IsBossDied[2] = false;
+ IsBossDied[3] = false;
+ IsBossDied[4] = false;
+ IsBossDied[5] = false;
+ IsBossDied[6] = false;
+ IsBossDied[7] = false;
+ IsBossDied[8] = false;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ //not active
+ return false;
+ }
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature->GetEntry())
+ {
+ case 26763: Anomalus = creature->GetGUID(); break;
+ case 26794: Ormorok = creature->GetGUID(); break;
+ case 26731: Magus_telestra = creature->GetGUID(); break;
+ case 26930: Magus_frost = creature->GetGUID(); break;
+ case 26928: Magus_fire = creature->GetGUID(); break;
+ case 26926: Magus_arcane = creature->GetGUID(); break;
+ case 26723: keristrasza = creature->GetGUID(); break;
+ case 26798: Commander_kolurg = creature->GetGUID(); break;
+ case 26796: Commander_stoutbeard = creature->GetGUID(); break;
+ }
+ }
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_ANOMALUSDEAD:
+ if(IsBossDied[0])
+ return 1;
+ break;
+ case DATA_ORMOROKDDEAD:
+ if(IsBossDied[1])
+ return 1;
+ break;
+ case DATA_MAGUSTELESTRADEAD:
+ if(IsBossDied[2])
+ return 1;
+ break;
+ case DATA_MAGUSTELESTRA_A_DEAD:
+ if(IsBossDied[3])
+ return 1;
+ break;
+ case DATA_MAGUSTELESTRA_F_DEAD:
+ if(IsBossDied[4])
+ return 1;
+ break;
+ case DATA_MAGUSTELESTRA_FI_DEAD:
+ if(IsBossDied[5])
+ return 1;
+ break;
+ case DATA_KERISTRASZADEAD:
+ if(IsBossDied[6])
+ return 1;
+ break;
+ case DATA_COMMANDER_KOLURGDEAD:
+ if(IsBossDied[7])
+ return 1;
+ break;
+ case DATA_COMMANDER_STOUTBEARDDEAD:
+ if(IsBossDied[8])
+ return 1;
+ break;
+ }
+
+ return 0;
+ }
+
+ uint64 GetData64 (uint32 identifier)
+ {
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_ANOMALUS_DEATH:
+ IsBossDied[0] = true;
+ break;
+ case DATA_ORMOROK_DEATH:
+ IsBossDied[1] = true;
+ break;
+ case DATA_MAGUSTELESTRA_DEATH:
+ IsBossDied[2] = true;
+ break;
+ case DATA_MAGUSTELESTRA_A_DEATH:
+ IsBossDied[3] = true;
+ break;
+ case DATA_MAGUSTELESTRA_F_DEATH:
+ IsBossDied[4] = true;
+ break;
+ case DATA_MAGUSTELESTRA_FI_DEAD:
+ IsBossDied[5] = true;
+ break;
+ case DATA_KERISTRASZA_DEATH:
+ IsBossDied[6] = true;
+ break;
+ case DATA_COMMANDER_KOLURG_DEATH:
+ IsBossDied[7] = true;
+ break;
+ case DATA_COMMANDER_STOUTBEARD_DEATH:
+ IsBossDied[8] = true;
+ break;
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_nexus(Map* map)
+{
+ return new instance_nexus(map);
+}
+
+void AddSC_instance_nexus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_nexus";
+ newscript->GetInstanceData = GetInstanceData_instance_nexus;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp
new file mode 100644
index 00000000000..eca9760262c
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp
@@ -0,0 +1,82 @@
+/* Script Data Start
+SDName: Boss drakos
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_MAGIC_PULL 51336
+#define SPELL_THUNDERING_STOMP 50774
+#define SPELL_THUNDERING_STOMP_2 59370
+
+//Yell
+#define SAY_AGGRO -1578000
+#define SAY_KILL_1 -1578001
+#define SAY_KILL_2 -1578002
+#define SAY_KILL_3 -1578003
+#define SAY_DEATH -1578004
+#define SAY_PULL_1 -1578005
+#define SAY_PULL_2 -1578006
+#define SAY_PULL_3 -1578007
+#define SAY_PULL_4 -1578008
+#define SAY_STOMP_1 -1578009
+#define SAY_STOMP_2 -1578010
+#define SAY_STOMP_3 -1578011
+
+struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI
+{
+ boss_drakosAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_KILL_1, m_creature);break;
+ case 1: DoScriptText(SAY_KILL_2, m_creature);break;
+ case 2: DoScriptText(SAY_KILL_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_drakos(Creature *_Creature)
+{
+ return new boss_drakosAI (_Creature);
+}
+
+void AddSC_boss_drakos()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_drakos";
+ newscript->GetAI = GetAI_boss_drakos;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp
new file mode 100644
index 00000000000..abfa904beb6
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp
@@ -0,0 +1,104 @@
+/* Script Data Start
+SDName: Boss eregos
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment: Encounter is done entirely on drake vehicles
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer)
+//Two Repeating phases
+
+//Spells
+#define SPELL_ARCANE_BARRAGE 50804
+#define SPELL_ARCANE_VOLLEY 51153
+#define SPELL_ENRAGED_ASSAULT 51170
+#define SPELL_PLANAR_ANOMALIES 57959
+#define SPELL_PLANAR_SHIFT 51162
+
+//Heroic
+#define SPELL_ARCANE_BARRAGE_H 59381
+#define SPELL_ARCANE_VOLLEY_H 59382
+
+/*Ruby Drake ,
+(npc 27756) (item 37860)
+(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756)
+*/
+#define NPC_RUBY_DRAKE_VEHICLE 27756
+#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464
+#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy
+
+#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets
+#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells.
+#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted.
+//you do not have acces to until you kill Mage-Lord Urom
+#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec.
+
+/*Amber Drake,
+(npc 27755) (item 37859)
+(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755)
+*/
+#define NPC_AMBER_DRAKE_VEHICLE 27755
+#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460
+#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy
+
+#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated.
+#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target.
+//you do not have access to until you kill the Mage-Lord Urom.
+#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated.
+
+/*Emerald Drake,
+(npc 27692) (item 37815),
+ (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692)
+*/
+#define NPC_EMERALD_DRAKE_VEHICLE 27692
+#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346
+#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy
+
+#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times.
+#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec.
+// you do not have access to until you kill the Mage-Lord Urom
+#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
+
+struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI
+{
+ boss_eregosAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase =1;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_eregos(Creature *_Creature)
+{
+ return new boss_eregosAI (_Creature);
+}
+
+void AddSC_boss_eregos()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_eregos";
+ newscript->GetAI = GetAI_boss_eregos;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp
new file mode 100644
index 00000000000..f7d35d014dd
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp
@@ -0,0 +1,87 @@
+/* Script Data Start
+SDName: Boss urom
+SDAuthor: LordVanMartin
+SD%Complete: 1%
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage.
+#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110
+#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377
+#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute.
+#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety.
+#define SPELL_SUMMON_MENAGERIE_2 50495
+#define SPELL_SUMMON_MENAGERIE_3 50496
+#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus
+#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff.
+#define SPELL_TIME_BOMB_2 59376
+
+//Yell
+#define SAY_AGGRO -1578012
+#define SAY_KILL_1 -1578013
+#define SAY_KILL_2 -1578014
+#define SAY_KILL_3 -1578015
+#define SAY_DEATH -1578016
+#define SAY_EXPLOSION_1 -1578017
+#define SAY_EXPLOSION_2 -1578018
+#define SAY_SUMMON_1 -1578019
+#define SAY_SUMMON_2 -1578020
+#define SAY_SUMMON_3 -1578021
+
+struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI
+{
+ boss_uromAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_KILL_1, m_creature);break;
+ case 1: DoScriptText(SAY_KILL_2, m_creature);break;
+ case 2: DoScriptText(SAY_KILL_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_urom(Creature *_Creature)
+{
+ return new boss_uromAI (_Creature);
+}
+
+void AddSC_boss_urom()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_urom";
+ newscript->GetAI = GetAI_boss_urom;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp
new file mode 100644
index 00000000000..272196008f2
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp
@@ -0,0 +1,85 @@
+/* Script Data Start
+SDName: Boss varos
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251
+#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069
+#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251
+#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251
+#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229)
+#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665)
+#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454)
+#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455)
+#define SPELL_CALL_AMPLIFY_MAGIC 51054
+#define SPELL_CALL_AMPLIFY_MAGIC_2 59371
+
+//Yell
+#define SAY_AGGRO -1578022
+#define SAY_KILL_1 -1578023
+#define SAY_KILL_2 -1578024
+#define SAY_DEATH -1578025
+#define SAY_STRIKE_1 -1578026
+#define SAY_STRIKE_2 -1578027
+#define SAY_STRIKE_3 -1578028
+#define SAY_SPAWN -1578029
+
+
+struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI
+{
+ boss_varosAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%2)
+ {
+ case 0: DoScriptText(SAY_KILL_1, m_creature);break;
+ case 1: DoScriptText(SAY_KILL_2, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_varos(Creature *_Creature)
+{
+ return new boss_varosAI (_Creature);
+}
+
+void AddSC_boss_varos()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_varos";
+ newscript->GetAI = GetAI_boss_varos;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h
new file mode 100644
index 00000000000..0b63a52d866
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h
@@ -0,0 +1,4 @@
+#ifndef DEF_OCULUS_H
+#define DEF_OCULUS_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp
new file mode 100644
index 00000000000..ecf6bcfae89
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_oculus.h"
+
+struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance
+{
+ instance_oculus(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_oculus(Map* map)
+{
+ return new instance_oculus(map);
+}
+
+void AddSC_instance_oculus()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_oculus";
+ newscript->GetInstanceData = GetInstanceData_instance_oculus;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp
new file mode 100644
index 00000000000..73e6157c600
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp
@@ -0,0 +1,300 @@
+/* Script Data Start
+SDName: Boss sartharion
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Sartharion Spells
+#define SPELL_BERSERK 61632 // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min.
+#define SPELL_CLEAVE 56909 // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets.
+#define SPELL_FLAME_BREATH_N 56908 // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster.
+#define SPELL_FLAME_BREATH_H 58956 // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster.
+#define SPELL_TAIL_LASH_N 56910 // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec.
+#define SPELL_TAIL_LASH_H 58957 // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec.
+#define SPELL_WILL_OF_SARTHARION 61254 // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%.
+#define SPELL_POWER_OF_SARTHARION 61254 //Shadron's presence increases Fire damage taken by all enemies by 100%.
+
+//Sartharion Yell
+#define SAY_SARTHARION_AGGRO -1615016
+#define SAY_SARTHARION_BERSERK -1615017
+#define SAY_SARTHARION_BREATH -1615018
+#define SAY_SARTHARION_CALL_SHADRON -1615019
+#define SAY_SARTHARION_CALL_TENEBRON -1615020
+#define SAY_SARTHARION_CALL_VESPERON -1615021
+#define SAY_SARTHARION_DEATH -1615022
+#define SAY_SARTHARION_SPECIAL_1 -1615023
+#define SAY_SARTHARION_SPECIAL_2 -1615024
+#define SAY_SARTHARION_SPECIAL_3 -1615025
+#define SAY_SARTHARION_SPECIAL_4 -1615026
+#define SAY_SARTHARION_SLAY_1 -1615027
+#define SAY_SARTHARION_SLAY_2 -1615028
+#define SAY_SARTHARION_SLAY_3 -1615029
+
+//Miniboses (Vesperon, Shadron, Tenebron)
+#define SPELL_SHADOW_BREATH_H 59126 //Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster.
+#define SPELL_SHADOW_BREATH_N 57570 //Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster.
+//TAIL LASH the same as Sartharion's
+#define SPELL_SHADOW_FISSURE_H 59127 //Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec.
+#define SPELL_SHADOW_FISSURE_N 57579 //Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec.
+
+//Vesperon
+#define MINIBOSS_VESPERON 30449 //npc 30449 //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal spawns multiple times
+#define BUFF_POWER_OF_VESPERON 61251 //Vesperon's presence decreases the maximum health of all enemies by 25%.
+
+//Shadron
+#define MINIBOSS_SHADRON 30451 //npc 30451 //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal spawns multiple times
+#define BUFF_POWER_OF_SHADRON 58105 //Shadron's presence increases Fire damage taken by all enemies by 100%.
+
+//Tenebron
+#define MINIBOSS_TENEBRON 30452 //npc 30452 //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708
+#define BUFF_POWER_OF_TENEBRON 61248 //Tenebron's presence increases Shadow damage taken by all enemies by 100%.
+
+//Minibosses common spells
+#define SPELL_SHADOW_BREATH_N 57570
+#define SPELL_SHADOW_BREATH_H 59126
+#define SPELL_SHADOW_FISSURE_N 57579
+#define SPELL_SHADOW_FISSURE_H 59127
+#define SPELL_TWILIGHT_REVENGE 60639
+
+//Tenebron, dummy spell
+#define SPELL_HATCH_EGGS 58793
+
+//Whelps
+#define TWILIGHT_WHELP 30890 //npc 30890
+#define SHARTHARION_TWILIGHT_WHELP 31214 //npc 31214
+#define SPELL_FADE_ARMOR 60708 //Reduces the armor of an enemy by 1500 for 15s
+
+/*Summons a portal, which all DPS and one healer should go through and proceed to kill all eggs. After about 20 seconds these eggs will hatch into whelplings with 60k health. Whelplings that hatched should be picked up by a tank and killed.
+Hatch Eggs Tenebron summons a portal in which eggs are spawned. After about 20s the eggs hatches into Whelps (156,396 hp - amount of whelps determined by Normal or Heroic mode) that do Fade Armor. */
+
+struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI
+{
+ boss_sartharionAI(Creature *c) : ScriptedAI(c) {}
+
+ bool berserk;
+
+ void Reset()
+ {
+ berserk = false;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_SARTHARION_DEATH,m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10)
+ {
+ if(!berserk){
+ DoCast(m_creature,SPELL_BERSERK);
+ berserk = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_SARTHARION_DEATH,m_creature);
+ }
+};
+
+/*######
+## Mob Vesperon
+######*/
+
+//Vesperon Yell
+#define SAY_VESPERON_AGGRO -1615030
+#define SAY_VESPERON_SLAY_1 -1615031
+#define SAY_VESPERON_SLAY_2 -1615032
+#define SAY_VESPERON_DEATH -1615033
+#define SAY_VESPERON_BREATH -1615034
+#define SAY_VESPERON_RESPOND -1615035
+#define SAY_VESPERON_SPECIAL_1 -1615036
+#define SAY_VESPERON_SPECIAL_2 -1615037
+
+struct TRINITY_DLL_DECL mob_vesperonAI : public ScriptedAI
+{
+ mob_vesperonAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_VESPERON_AGGRO,m_creature);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_VESPERON_DEATH,m_creature);
+ }
+};
+
+/*######
+## Mob Shadron
+######*/
+
+//Shadron Yell
+#define SAY_SHADRON_AGGRO -1615000
+#define SAY_SHADRON_SLAY_1 -1615001
+#define SAY_SHADRON_SLAY_2 -1615002
+#define SAY_SHADRON_DEATH -1615003
+#define SAY_SHADRON_BREATH -1615004
+#define SAY_SHADRON_RESPOND -1615005
+#define SAY_SHADRON_SPECIAL_1 -1615006
+#define SAY_SHADRON_SPECIAL_2 -1615007
+
+struct TRINITY_DLL_DECL mob_shadronAI : public ScriptedAI
+{
+ mob_shadronAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset(){}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_SHADRON_AGGRO,m_creature);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_SHADRON_DEATH,m_creature);
+ }
+};
+/*######
+## Mob Tenebron
+######*/
+
+//Yell
+#define SAY_TENEBRON_AGGRO -1615008
+#define SAY_TENEBRON_SLAY_1 -1615009
+#define SAY_TENEBRON_SLAY_2 -1615010
+#define SAY_TENEBRON_DEATH -1615011
+#define SAY_TENEBRON_BREATH -1615012
+#define SAY_TENEBRON_RESPOND -1615013
+#define SAY_TENEBRON_SPECIAL_1 -1615014
+#define SAY_TENEBRON_SPECIAL_2 -1615015
+
+struct TRINITY_DLL_DECL mob_tenebronAI : public ScriptedAI
+{
+ mob_tenebronAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_TENEBRON_AGGRO,m_creature);
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_TENEBRON_DEATH,m_creature);
+ }
+};
+
+/*######
+## Mob Whelps
+######*/
+struct TRINITY_DLL_DECL mob_whelpAI : public ScriptedAI
+{
+ mob_whelpAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Fade_armor_Timer;
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_mob_whelp(Creature *_Creature)
+{
+ return new mob_whelpAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_tenebron(Creature *_Creature)
+{
+ return new mob_tenebronAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_shadron(Creature *_Creature)
+{
+ return new mob_shadronAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_vesperon(Creature *_Creature)
+{
+ return new mob_vesperonAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_sartharion(Creature *_Creature)
+{
+ return new boss_sartharionAI (_Creature);
+}
+
+void AddSC_boss_sartharion()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_sartharion";
+ newscript->GetAI = GetAI_boss_sartharion;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_vesperon";
+ newscript->GetAI = GetAI_mob_vesperon;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_shadron";
+ newscript->GetAI = GetAI_mob_shadron;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_tenebron";
+ newscript->GetAI = GetAI_mob_tenebron;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_whelp";
+ newscript->GetAI = GetAI_mob_whelp;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h
new file mode 100644
index 00000000000..59d76502af3
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h
@@ -0,0 +1,4 @@
+#ifndef DEF_OBSIDIAN_SANCTUM_H
+#define DEF_OBSIDIAN_SANCTUM_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp
new file mode 100644
index 00000000000..2e24a1ae415
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_obsidian_sanctum.h"
+
+struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance
+{
+ instance_obsidian_sanctum(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* map)
+{
+ return new instance_obsidian_sanctum(map);
+}
+
+void AddSC_instance_obsidian_sanctum()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_obsidian_sanctum";
+ newscript->GetInstanceData = GetInstanceData_instance_obsidian_sanctum;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
index eef29518ecd..9e2370af086 100644
--- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
+++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -125,7 +125,6 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI
if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1))
{
Phase = 2;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT);
m_creature->SetHover(true);
m_creature->GetMotionMaster()->Clear(false);
@@ -137,7 +136,6 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI
{
Phase = 3;
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
m_creature->SetHover(false);
m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
DoStartMovement(m_creature->getVictim());
diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
index a53794c2b7a..1c2822b24b1 100644
--- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
+++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -116,7 +116,18 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+
+ void ReciveEmote_npc_shenthul(Player *player, uint32 emote)
+ {
+ if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
+ if(CanEmote)
+ {
+ player->AreaExploredOrEventHappens(QUEST_2460);
+ Reset();
+ }
+ }
};
+
CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
{
return new npc_shenthulAI (_Creature);
@@ -132,17 +143,6 @@ bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* q
return true;
}
-bool ReciveEmote_npc_shenthul(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
- if( ((npc_shenthulAI*)_Creature->AI())->CanEmote )
- {
- player->AreaExploredOrEventHappens(QUEST_2460);
- ((npc_shenthulAI*)_Creature->AI())->Reset();
- }
- return true;
-}
-
/*######
## npc_thrall_warchief
######*/
@@ -263,7 +263,6 @@ void AddSC_orgrimmar()
newscript->Name="npc_shenthul";
newscript->GetAI = &GetAI_npc_shenthul;
newscript->pQuestAccept = &QuestAccept_npc_shenthul;
- newscript->pReceiveEmote = &ReciveEmote_npc_shenthul;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
index d8e1a297872..9c089fddf71 100644
--- a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
+++ b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,15 +23,16 @@ EndScriptData */
#include "precompiled.h"
-#define SAY_0 "You'll never leave this place... alive."
-#define SAY_1 "Come, spirits, attend your master."
-#define SAY_SLAY "Too...easy!"
-#define SOUND_AGGRO 5825
-#define SOUND_SLAY 5826
-#define SOUND_SUMMON 5829
+#define SAY_AGGRO -1129000
+#define SAY_SUMMON60 -1129001
+#define SAY_SUMMON30 -1129002
+#define SAY_HP -1129003
+#define SAY_KILL -1129004
-#define SPELL_AMNENNARSWRATH 13009
-#define SPELL_FROSTBOLT 10179
+#define SPELL_AMNENNARSWRATH 13009
+#define SPELL_FROSTBOLT 15530
+#define SPELL_FROST_NOVA 15531
+#define SPELL_FROST_SPECTRES 12642
struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
{
@@ -39,50 +40,29 @@ struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
uint32 AmnenarsWrath_Timer;
uint32 FrostBolt_Timer;
- bool Spectrals;
- int Rand;
- int RandX;
- int RandY;
- Creature* Summoned;
+ uint32 FrostNova_Timer;
+ bool Spectrals60;
+ bool Spectrals30;
+ bool Hp;
void Reset()
{
AmnenarsWrath_Timer = 8000;
FrostBolt_Timer = 1000;
- Spectrals = false;
+ FrostNova_Timer = 10000 + rand()%5000;
+ Spectrals30 = false;
+ Spectrals60 = false;
+ Hp = false;
}
void Aggro(Unit *who)
{
- DoYell(SAY_0,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoScriptText(SAY_AGGRO, m_creature);
}
void KilledUnit()
{
- DoYell(SAY_SLAY, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SLAY);
- }
-
- void SummonSpectrals(Unit* victim)
- {
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandX = 0 - Rand; break;
- case 1: RandX = 0 + Rand; break;
- }
- Rand = 0;
- Rand = rand()%5;
- switch (rand()%2)
- {
- case 0: RandY = 0 - Rand; break;
- case 1: RandY = 0 + Rand; break;
- }
- Rand = 0;
- Summoned = DoSpawnCreature(8585, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- if(Summoned)
- ((CreatureAI*)Summoned->AI())->AttackStart(victim);
+ DoScriptText(SAY_KILL, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -100,25 +80,34 @@ struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI
//FrostBolt_Timer
if (FrostBolt_Timer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target) DoCast(target,SPELL_FROSTBOLT);
-
+ DoCast(m_creature->getVictim(),SPELL_FROSTBOLT);
FrostBolt_Timer = 8000;
} else FrostBolt_Timer -= diff;
- if ( !Spectrals && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50 )
+ if (FrostNova_Timer < diff)
{
- DoYell(SAY_1, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(m_creature, SOUND_SUMMON);
+ DoCast(m_creature,SPELL_FROST_NOVA);
+ FrostNova_Timer = 15000;
+ } else FrostNova_Timer -= diff;
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
+ {
+ DoScriptText(SAY_SUMMON60, m_creature);
+ DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES);
+ Spectrals60 = true;
+ }
- SummonSpectrals(target);
- SummonSpectrals(target);
- SummonSpectrals(target);
- Spectrals = true;
+ if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
+ {
+ DoScriptText(SAY_HP, m_creature);
+ Hp = true;
+ }
+
+ if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
+ {
+ DoScriptText(SAY_SUMMON30, m_creature);
+ DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES);
+ Spectrals30 = true;
}
DoMeleeAttackIfReady();
diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp
new file mode 100644
index 00000000000..d5c09e504a8
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp
@@ -0,0 +1,85 @@
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Razorfen_Downs
+SD%Complete: 100
+SDComment: Support for Henry Stern(2 recipes)
+SDCategory: Razorfen Downs
+EndScriptData */
+
+/* ContentData
+npc_henry_stern
+EndContentData */
+
+#include "precompiled.h"
+
+/*###
+# npc_henry_stern
+####*/
+
+enum
+{
+ SPELL_GOLDTHORN_TEA = 13028,
+ SPELL_TEACHING_GOLDTHORN_TEA = 13029,
+ SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451,
+ SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030,
+ GOSSIP_TEXT_TEA_ANSWER = 2114,
+ GOSSIP_TEXT_POTION_ANSWER = 2115,
+};
+
+#define GOSSIP_ITEM_TEA "Teach me the cooking recipe"
+#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe"
+
+bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature)
+{
+ if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA))
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+
+ if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION))
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+
+ pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action)
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 1)
+ {
+ pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true);
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID());
+ }
+
+ if (action == GOSSIP_ACTION_INFO_DEF + 2)
+ {
+ pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID());
+ pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true);
+ }
+
+ return true;
+}
+
+void AddSC_razorfen_downs()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_henry_stern";
+ newscript->pGossipHello = &GossipHello_npc_henry_stern;
+ newscript->pGossipSelect = &GossipSelect_npc_henry_stern;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
index 39be57325d7..8a65b493c5a 100644
--- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
+++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
index 128ab315334..be15a35f032 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
index 4297c32492f..58c48540362 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
index 9c888e98605..f164009c79b 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
index 5830b3a8070..df0e63f8599 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
index 1d389830045..5652b706917 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
index 0639a02deb6..fb2c92ff59f 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
index 27a0621b2be..b94e6f16a80 100644
--- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
+++ b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
index 222f927e5a0..533adf732f3 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,55 +23,40 @@ EndScriptData */
#include "precompiled.h"
-#define SPELL_POLYMORPH 12826
-#define SPELL_AOESILENCE 8988
-#define SPELL_ARCANEEXPLOSION3 8438
-#define SPELL_ARCANEEXPLOSION4 8439
-#define SPELL_FIREAOE 9435
-#define SPELL_BLINK 1953
-#define SPELL_FIREBALL 21162
-#define SPELL_MANASHIELD4 10191
-#define SPELL_ARCANEBUBBLE 9438
-
-#define SAY_AGGRO "You will not defile these mysteries!"
-#define SAY_SPECIALAE "Burn in righteous fire!"
-
-#define SOUND_AGGRO 5842
-#define SOUND_SPECIALAE 5843
+enum
+{
+ SAY_AGGRO = -1189019,
+ SAY_SPECIALAE = -1189020,
+
+ SPELL_POLYMORPH = 13323,
+ SPELL_AOESILENCE = 8988,
+ SPELL_ARCANEEXPLOSION = 9433,
+ SPELL_FIREAOE = 9435,
+ SPELL_ARCANEBUBBLE = 9438,
+};
struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI
{
boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {}
- uint32 FullAOE_Timer;
uint32 Polymorph_Timer;
- uint32 Yell_Timer;
- uint32 ArcaneBubble_Timer;
uint32 AoESilence_Timer;
- uint32 ArcaneExplosion3_Timer;
- uint32 ArcaneExplosion4_Timer;
- uint32 Blink_Timer;
- uint32 Fireball_Timer;
- uint32 ManaShield4_Timer;
+ uint32 ArcaneExplosion_Timer;
+ bool bCanDetonate;
+ bool bShielded;
void Reset()
{
- FullAOE_Timer = 5000;
- Polymorph_Timer = 1;
- Yell_Timer = 2000;
- ArcaneBubble_Timer = 3000;
- AoESilence_Timer = 20000;
- ArcaneExplosion3_Timer = 10000;
- ArcaneExplosion4_Timer = 10000;
- Blink_Timer = 40000;
- Fireball_Timer = 6000;
- ManaShield4_Timer = 70000;
+ Polymorph_Timer = 20000;
+ AoESilence_Timer = 15000;
+ ArcaneExplosion_Timer = 3000;
+ bCanDetonate = false;
+ bShielded = false;
}
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -79,79 +64,50 @@ struct TRINITY_DLL_DECL boss_arcanist_doanAI : public ScriptedAI
if (!UpdateVictim())
return;
- //If we are <50% hp cast Arcane Bubble and start casting SPECIAL FIRE AOE
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (bShielded && bCanDetonate)
{
- if (Polymorph_Timer < diff)
- {
- Unit* target = NULL;
-
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target)DoCast(target,SPELL_POLYMORPH);
- Polymorph_Timer = 40000;
- }else Polymorph_Timer -= diff;
-
- if (Yell_Timer < diff)
- {
- DoYell(SAY_SPECIALAE,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_SPECIALAE);
- Yell_Timer = 40000;
- }else Yell_Timer -= diff;
-
- if (ArcaneBubble_Timer < diff)
- {
- DoCast(m_creature,SPELL_ARCANEBUBBLE);
- ArcaneBubble_Timer = 40000;
- }else ArcaneBubble_Timer -= diff;
-
- if (FullAOE_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FIREAOE);
- FullAOE_Timer = 40000;
- }else FullAOE_Timer -= diff;
+ DoCast(m_creature,SPELL_FIREAOE);
+ bCanDetonate = false;
}
- //AoESilence_Timer
- if (AoESilence_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_AOESILENCE);
- AoESilence_Timer = 30000;
- }else AoESilence_Timer -= diff;
+ if (m_creature->HasAura(SPELL_ARCANEBUBBLE))
+ return;
- //ArcaneExplosion3_Timer
- if (ArcaneExplosion3_Timer < diff)
+ //If we are <50% hp cast Arcane Bubble
+ if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
{
- DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION3);
- ArcaneExplosion3_Timer = 8000;
- }else ArcaneExplosion3_Timer -= diff;
+ //wait if we already casting
+ if (m_creature->IsNonMeleeSpellCasted(false))
+ return;
- //ArcaneExplosion4_Timer
- if (ArcaneExplosion4_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION4);
- ArcaneExplosion4_Timer = 10000;
- }else ArcaneExplosion4_Timer -= diff;
+ DoScriptText(SAY_SPECIALAE, m_creature);
+ DoCast(m_creature,SPELL_ARCANEBUBBLE);
- //Blink_Timer
- if (Blink_Timer < diff)
+ bCanDetonate = true;
+ bShielded = true;
+ }
+
+ if (Polymorph_Timer < diff)
{
- DoCast(m_creature,SPELL_BLINK);
- Blink_Timer = 30000;
- }else Blink_Timer -= diff;
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
+ DoCast(target,SPELL_POLYMORPH);
+
+ Polymorph_Timer = 20000;
+ }else Polymorph_Timer -= diff;
- //Fireball_Timer
- if (Fireball_Timer < diff)
+ //AoESilence_Timer
+ if (AoESilence_Timer < diff)
{
- DoCast(m_creature->getVictim(),SPELL_FIREBALL);
- Fireball_Timer = 12000;
- }else Fireball_Timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_AOESILENCE);
+ AoESilence_Timer = 15000 + rand()%5000;
+ }else AoESilence_Timer -= diff;
- //ManaShiled4_Timer
- if (ManaShield4_Timer < diff)
+ //ArcaneExplosion_Timer
+ if (ArcaneExplosion_Timer < diff)
{
- DoCast(m_creature,SPELL_MANASHIELD4);
- ManaShield4_Timer = 70000;
- }else ManaShield4_Timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION);
+ ArcaneExplosion_Timer = 8000;
+ }else ArcaneExplosion_Timer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
index e22de9b8fb3..5975d5f7e57 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
index f5c094d6127..351a72db2fc 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,45 +23,45 @@ EndScriptData */
#include "precompiled.h"
-#define SPELL_FROSTNOVA2 865
-#define SPELL_FLAMESHOCK3 8053
-#define SPELL_SHADOWBOLT5 1106
-#define SPELL_FLAMESPIKE 8814
-#define SPELL_FIRENOVA 16079
-
-#define SAY_AGGRO "We hunger for vengeance."
-#define SAY_HEALTH "No rest... for the angry dead!"
-#define SAY_DEATH "More... More souls!"
-
-#define SOUND_AGGRO 5844
-#define SOUND_HEALTH 5846
-#define SOUND_DEATH 5845
+enum
+{
+ SAY_AGGRO = -1189016,
+ SAY_HEALTH = -1189017,
+ SAY_KILL = -1189018,
+
+ SPELL_FLAMESHOCK = 8053,
+ SPELL_SHADOWBOLT = 1106,
+ SPELL_FLAMESPIKE = 8814,
+ SPELL_FIRENOVA = 16079,
+};
struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI
{
boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {}
- uint32 FrostNova2_Timer;
- uint32 FlameShock3_Timer;
- uint32 ShadowBolt5_Timer;
+ bool HpYell;
+ uint32 FlameShock_Timer;
+ uint32 ShadowBolt_Timer;
uint32 FlameSpike_Timer;
uint32 FireNova_Timer;
- uint32 Yell_Timer;
void Reset()
{
- Yell_Timer = 1;
- FrostNova2_Timer = 10000;
- FlameShock3_Timer = 15000;
- ShadowBolt5_Timer = 20000;
- FlameSpike_Timer = 20000;
- FireNova_Timer = 10000;
+ HpYell = false;
+ FlameShock_Timer = 10000;
+ ShadowBolt_Timer = 2000;
+ FlameSpike_Timer = 8000;
+ FireNova_Timer = 40000;
}
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ DoScriptText(SAY_KILL, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -70,38 +70,18 @@ struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI
return;
//If we are <35% hp
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 35)
+ if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35))
{
- Yell_Timer -= diff;
-
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH);
- Yell_Timer = 900000;
- }
+ DoScriptText(SAY_HEALTH, m_creature);
+ HpYell = true;
}
- //FrostNova2_Timer
- if (FrostNova2_Timer < diff)
+ //FlameShock_Timer
+ if (FlameShock_Timer < diff)
{
- DoCast(m_creature->getVictim(),SPELL_FROSTNOVA2);
- FrostNova2_Timer = 10000;
- }else FrostNova2_Timer -= diff;
-
- //FlameShock3_Timer
- if (FlameShock3_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK3);
- FlameShock3_Timer = 15000;
- }else FlameShock3_Timer -= diff;
-
- //ShadowBolt5_Timer
- if (ShadowBolt5_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT5);
- ShadowBolt5_Timer = 20000;
- }else ShadowBolt5_Timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK);
+ FlameShock_Timer = 10000 + rand()%5000;
+ }else FlameShock_Timer -= diff;
//FlameSpike_Timer
if (FlameSpike_Timer < diff)
@@ -114,9 +94,16 @@ struct TRINITY_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI
if (FireNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
- FireNova_Timer = 20000;
+ FireNova_Timer = 40000;
}else FireNova_Timer -= diff;
+ //ShadowBolt_Timer
+ if (ShadowBolt_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
+ ShadowBolt_Timer = 2000;
+ }else ShadowBolt_Timer -= diff;
+
DoMeleeAttackIfReady();
}
};
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
index 441797ec158..9d1b447e746 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI
if (!who || Creaturetype != 1 || !who->isTargetableForAttack())
return;
- if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL,0))
+ if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL))
DoCast(who,SPELL_SQUASH_SOUL);
}
@@ -505,7 +505,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
void SpellHitTarget(Unit* unit, const SpellEntry* spell)
{
if (spell->Id == SPELL_CONFLAGRATION)
- if (unit->HasAura(SPELL_CONFLAGRATION,0))
+ if (unit->HasAura(SPELL_CONFLAGRATION))
SaySound(SAY_CONFLAGRATION,unit);
}
@@ -572,7 +572,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
DoCast(m_creature,SPELL_BODY_REGEN,true);
m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true);
DoCast(m_creature,SPELL_CONFUSE,false); //test
- done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL_AND_GET_XP,PROC_FLAG_KILLED,PROC_EX_NONE,0);
+ done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0);
whirlwind = 4000 + (rand()%5)*1000;
regen = 0;
}
@@ -734,7 +734,7 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI
sprouted = false;
DoCast(m_creature,SPELL_PUMPKIN_AURA,true);
DoCast(m_creature,SPELL_SPROUTING);
- m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
}
void Aggro(Unit *who){}
@@ -745,7 +745,7 @@ struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI
{
sprouted = true;
m_creature->RemoveAllAuras();
- m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_ROTATE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
DoCast(m_creature,SPELL_SPROUT_BODY,true);
m_creature->UpdateEntry(PUMPKIN_FIEND);
DoStartMovement(m_creature->getVictim());
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
index 17f4aee1ae3..956fa26bdac 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -105,45 +105,22 @@ struct TRINITY_DLL_DECL boss_herodAI : public ScriptedAI
}
};
-CreatureAI* GetAI_boss_herod(Creature *_Creature)
+CreatureAI* GetAI_boss_herod(Creature* pCreature)
{
- return new boss_herodAI (_Creature);
+ return new boss_herodAI(pCreature);
}
-float Location[12][3]=
-{
- {1945.81, -431.54, 16.36},
- {1946.21, -436.41, 16.36},
- {1950.01, -444.11, 14.63},
- {1956.08, -449.34, 13.12},
- {1966.59, -450.55, 11.27},
- {1976.09, -447.51, 11.27},
- {1983.42, -435.85, 11.27},
- {1978.17, -428.81, 11.27},
- {1973.97, -422.08, 9.04},
- {1963.84, -418.90, 6.17},
- {1961.22, -422.74, 6.17},
- {1964.80, -431.26, 6.17}
-};
-
-uint32 Wait[12][1]=
-{
- {0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{600000}
-};
-
struct TRINITY_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI
{
- mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) {}
-
- uint32 Start_Timer;
-
- void WaypointReached(uint32 i) { }
-
- void Reset()
+ mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c)
{
- Start_Timer = urand(1500,4500);
+ Start_Timer = urand(1000,6000);
}
+ uint32 Start_Timer;
+
+ void Reset() { }
+ void WaypointReached(uint32 uiPoint) { }
void Aggro(Unit* who) { }
void UpdateAI(const uint32 diff)
@@ -161,14 +138,13 @@ struct TRINITY_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI
}
};
-CreatureAI* GetAI_mob_scarlet_trainee(Creature* _Creature)
+CreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature)
{
- mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(_Creature);
+ mob_scarlet_traineeAI* thisAI = new mob_scarlet_traineeAI(pCreature);
- for(uint32 i = 0; i < 12; ++i)
- thisAI->AddWaypoint(i, Location[i][0], Location[i][1], Location[i][2], Wait[i][0]);
+ thisAI->FillPointMovementListForCreature();
- return ((CreatureAI*)thisAI);
+ return (CreatureAI*)thisAI;
}
void AddSC_boss_herod()
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
index b1c8bde0566..a188fe9c3f2 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
index 5dde65cb840..7f812310be3 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,11 +23,10 @@ EndScriptData */
#include "precompiled.h"
-#define SPELL_SUMMONSCARLETHOUND 17164
-#define SPELL_ENRAGE 28747
+#define SAY_AGGRO -1189021
-#define SAY_AGGRO "Release the hounds!"
-#define SOUND_AGGRO 5841
+#define SPELL_SUMMONSCARLETHOUND 17164
+#define SPELL_ENRAGE 6742
struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI
{
@@ -37,15 +36,12 @@ struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI
void Reset()
{
- Enrage_Timer = 6000000;
+ Enrage_Timer = 0;
}
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
-
- DoCast(m_creature,SPELL_SUMMONSCARLETHOUND);
+ DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -53,16 +49,17 @@ struct TRINITY_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI
if (!UpdateVictim())
return;
- //If we are <10% hp cast healing spells at self and Mograine
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10 && !m_creature->IsNonMeleeSpellCasted(false) && Enrage_Timer < diff)
+ //If we are <25% hp, bloodlust
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && Enrage_Timer < diff)
{
DoCast(m_creature,SPELL_ENRAGE);
- Enrage_Timer = 900000;
+ Enrage_Timer = 60000;
}else Enrage_Timer -= diff;
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_boss_houndmaster_loksey(Creature *_Creature)
{
return new boss_houndmaster_lokseyAI (_Creature);
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
index 1366897eb05..34d5a7fff37 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -22,36 +22,55 @@ SDCategory: Scarlet Monastery
EndScriptData */
#include "precompiled.h"
+#include "def_scarlet_monastery.h"
-#define SPELL_POWERWORDSHIELD 6065
-
-#define SAY_AGGRO "Tell me... tell me everything!"
-#define SAY_HEALTH1 "Naughty secrets"
-#define SAY_HEALTH2 "I'll rip the secrets from your flesh!"
-#define SAY_DEATH "Purged by pain!"
+enum
+{
+ SAY_AGGRO = -1189011,
+ SAY_HEALTH1 = -1189012,
+ SAY_HEALTH2 = -1189013,
+ SAY_KILL = -1189014,
+ SAY_TRIGGER_VORREL = -1189015,
-#define SOUND_AGGRO 5847
-#define SOUND_HEALTH1 5849
-#define SOUND_HEALTH2 5850
-#define SOUND_DEATH 5848
+ SPELL_SHADOWWORDPAIN = 2767,
+};
struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI
{
- boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) {}
+ boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (ScriptedInstance*)m_creature->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
- uint32 Yell_Timer;
- uint32 PowerWordShield_Timer;
+ bool Yell30;
+ bool Yell60;
+ uint32 ShadowWordPain_Timer;
void Reset()
{
- Yell_Timer = 6000000;
- PowerWordShield_Timer = 60000;
+ ShadowWordPain_Timer = 5000;
}
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+
+ void KilledUnit(Unit* Victim)
+ {
+ DoScriptText(SAY_KILL, m_creature);
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if (!pInstance)
+ return;
+
+ //Any other actions to do with vorrel? setStandState?
+ if (Unit *vorrel = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_VORREL)))
+ DoScriptText(SAY_TRIGGER_VORREL, vorrel);
}
void UpdateAI(const uint32 diff)
@@ -60,44 +79,29 @@ struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI
return;
//If we are low on hp Do sayings
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 60 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (!Yell60 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60))
{
- //Yell_Timer
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH1,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH1);
- return;
-
- //60 seconds until we should cast this agian
- Yell_Timer = 60000;
- }else Yell_Timer -= diff;
+ DoScriptText(SAY_HEALTH1, m_creature);
+ Yell60 = true;
}
- if ( m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
+ if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30))
{
- //Yell_Timer
- if (Yell_Timer < diff)
- {
- DoYell(SAY_HEALTH2,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_HEALTH2);
- return;
-
- //60 seconds until we should cast this agian
- Yell_Timer = 6000000;
- }else Yell_Timer -= diff;
+ DoScriptText(SAY_HEALTH2, m_creature);
+ Yell30 = true;
}
- //PowerWordShield_Timer
- if (PowerWordShield_Timer < diff)
+ //ShadowWordPain_Timer
+ if (ShadowWordPain_Timer < diff)
{
- DoCast(m_creature,SPELL_POWERWORDSHIELD);
- PowerWordShield_Timer = 60000;
- }else PowerWordShield_Timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
+ ShadowWordPain_Timer = 5000 + rand()%10000;;
+ }else ShadowWordPain_Timer -= diff;
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_boss_interrogator_vishas(Creature *_Creature)
{
return new boss_interrogator_vishasAI (_Creature);
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp
index 6c2bd8a9be8..bde26d42478 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
index 88cee632568..642c884ebc8 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h
index b8ab822129d..2b6399ae3e4 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
@@ -10,7 +10,9 @@
#define DATA_WHITEMANE 3
#define DATA_DOOR_WHITEMANE 4
-#define DATA_HORSEMAN_EVENT 5
-#define GAMEOBJECT_PUMPKIN_SHRINE 6
+#define DATA_HORSEMAN_EVENT 5
+#define GAMEOBJECT_PUMPKIN_SHRINE 6
+
+#define DATA_VORREL 7
#endif
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp
index 44152e6b4e0..4a2239f3b36 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -43,6 +43,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
uint64 MograineGUID;
uint64 WhitemaneGUID;
+ uint64 VorrelGUID;
uint64 DoorHighInquisitorGUID;
uint32 Encounter[ENCOUNTERS];
@@ -56,6 +57,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
MograineGUID = 0;
WhitemaneGUID = 0;
+ VorrelGUID = 0;
DoorHighInquisitorGUID = 0;
for(uint8 i = 0; i < ENCOUNTERS; i++)
@@ -80,6 +82,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
case ENTRY_PUMPKIN: HorsemanAdds.insert(creature->GetGUID());break;
case 3976: MograineGUID = creature->GetGUID(); break;
case 3977: WhitemaneGUID = creature->GetGUID(); break;
+ case 3981: VorrelGUID = creature->GetGUID(); break;
}
}
@@ -92,7 +95,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
{
GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID);
if(Shrine)
- Shrine->SetUInt32Value(GAMEOBJECT_STATE,1);
+ Shrine->SetGoState(1);
}break;
case DATA_HORSEMAN_EVENT:
if (data == DONE)
@@ -106,7 +109,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
HorsemanAdds.clear();
GameObject *Shrine = instance->GetGameObjectInMap(PumpkinShrineGUID);
if(Shrine)
- Shrine->SetUInt32Value(GAMEOBJECT_STATE,1);
+ Shrine->SetGoState(1);
}
break;
}
@@ -121,6 +124,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance
//case DATA_HEAD: return HeadGUID;
case DATA_MOGRAINE: return MograineGUID;
case DATA_WHITEMANE: return WhitemaneGUID;
+ case DATA_VORREL: return VorrelGUID;
case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID;
}
return 0;
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
index a20cd4d8b83..46f216220aa 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,12 +16,13 @@
/* ScriptData
SDName: Boss_Darkmaster_Gandling
-SD%Complete: 99
+SD%Complete: 75
SDComment: Doors missing in instance script.
SDCategory: Scholomance
EndScriptData */
#include "precompiled.h"
+#include "def_scholomance.h"
#define SPELL_ARCANEMISSILES 22272
#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either.
@@ -49,12 +50,18 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
{
- boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) {}
+ boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (ScriptedInstance*)m_creature->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
uint32 ArcaneMissiles_Timer;
uint32 ShadowShield_Timer;
uint32 Curse_Timer;
uint32 Teleport_Timer;
+
Creature *Summoned;
void Reset()
@@ -69,6 +76,12 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
{
}
+ void JustDied(Unit *killer)
+ {
+ if (pInstance)
+ pInstance->SetData(TYPE_GANDLING, DONE);
+ }
+
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
@@ -113,59 +126,79 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
case 0:
DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149);
Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 1:
DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 2:
DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043);
Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 3:
DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149);
Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 4:
DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
case 5:
DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043);
Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
+ if (Summoned)
((CreatureAI*)Summoned->AI())->AttackStart(target);
break;
}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
index 2e0eb4e09e2..8bb3703fa8b 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
index 001c67c26b8..96afbfe1971 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -24,6 +24,8 @@ EndScriptData */
#include "precompiled.h"
#include "def_scholomance.h"
+#define EMOTE_GENERIC_FRENZY_KILL -1000001
+
#define SPELL_REND 18106
#define SPELL_CLEAVE 15584
#define SPELL_FRENZY 28371
@@ -50,7 +52,7 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
{
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -84,7 +86,7 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
if (Frenzy_Timer < diff)
{
DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 8000;
}else Frenzy_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
index 6eb5e1ec249..02f4c9bc5a4 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_illuciabarovAI : public ScriptedAI
{
pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
index 4ba2811dc52..2790e36ddaf 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI
{
pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
index c6ff12be817..d2890801b5d 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
index 355fbd90c9b..8fdda4d2f33 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
index 195e5b048b4..ddf3c3b083d 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI
{
pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
index 728ad07e838..040cafc91fc 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI
{
pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
index 154da52596a..fbb1e355f1d 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
index 95ebafb092a..aea8b476ad2 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -29,8 +29,6 @@ EndScriptData */
#define SPELL_SUNDERINCLEAVE 25174
#define SPELL_KNOCKAWAY 10101
-#define SAY_AGGRO1 "Mine! Mine! Mine! Gizlock is the ruler of this domain! You shall never reveal my presence!"
-
struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
{
boss_theravenianAI(Creature *c) : ScriptedAI(c) {}
@@ -57,14 +55,13 @@ struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
{
pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
- if(pInstance->GetData(DATA_CANSPAWNGANDLING))
+ if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO1, LANG_UNIVERSAL, NULL);
}
void UpdateAI(const uint32 diff)
@@ -103,6 +100,7 @@ struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_boss_theravenian(Creature *_Creature)
{
return new boss_theravenianAI (_Creature);
diff --git a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
index 280e0d194d7..2ade6f7fd4d 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,6 +23,8 @@ EndScriptData */
#include "precompiled.h"
+#define EMOTE_GENERIC_FRENZY_KILL -1000001
+
#define SPELL_FIRESHIELD 19626
#define SPELL_BLASTWAVE 13021
#define SPELL_FRENZY 28371
@@ -71,7 +73,7 @@ struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI
if (Frenzy_Timer < diff)
{
DoCast(m_creature,SPELL_FRENZY);
- DoTextEmote("goes into a killing frenzy!",NULL);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 24000;
}else Frenzy_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
index 0216a48fc74..83ce26c9687 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
+++ b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h
@@ -1,16 +1,17 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_SCHOLOMANCE_H
#define DEF_SCHOLOMANCE_H
-#define DATA_CANSPAWNGANDLING 1
+#define TYPE_GANDLING 1
#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2
#define DATA_INSTRUCTORMALICIA_DEATH 3
#define DATA_LADYILLUCIABAROV_DEATH 4
#define DATA_LORDALEXEIBAROV_DEATH 5
#define DATA_LOREKEEPERPOLKELT_DEATH 6
#define DATA_THERAVENIAN_DEATH 7
+#define TYPE_KIRTONOS 8
#endif
diff --git a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
index 74b90dfdf53..d99546fbcea 100644
--- a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
+++ b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -24,36 +24,65 @@ EndScriptData */
#include "precompiled.h"
#include "def_scholomance.h"
+#define GO_GATE_KIRTONOS 175570
+#define GO_GATE_GANDLING 177374
+#define GO_GATE_MALICIA 177375
+#define GO_GATE_THEOLEN 177377
+#define GO_GATE_POLKELT 177376
+#define GO_GATE_RAVENIAN 177372
+#define GO_GATE_BAROV 177373
+#define GO_GATE_ILLUCIA 177371
+
+#define ENCOUNTERS 2
+
struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
{
instance_scholomance(Map *map) : ScriptedInstance(map) {Initialize();};
//Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
bool IsBossDied[6];
+ uint32 Encounter[ENCOUNTERS];
- void Initialize()
- {
- IsBossDied[0] = false;
- IsBossDied[1] = false;
- IsBossDied[2] = false;
- IsBossDied[3] = false;
- IsBossDied[4] = false;
- IsBossDied[5] = false;
- }
+ uint64 GateKirtonosGUID;
+ uint64 GateGandlingGUID;
+ uint64 GateMiliciaGUID;
+ uint64 GateTheolenGUID;
+ uint64 GatePolkeltGUID;
+ uint64 GateRavenianGUID;
+ uint64 GateBarovGUID;
+ uint64 GateIlluciaGUID;
- bool IsEncounterInProgress() const
+ void Initialize()
{
- //not active in scholomance
- return false;
+ GateKirtonosGUID = 0;
+ GateGandlingGUID = 0;
+ GateMiliciaGUID = 0;
+ GateTheolenGUID = 0;
+ GatePolkeltGUID = 0;
+ GateRavenianGUID = 0;
+ GateBarovGUID = 0;
+ GateIlluciaGUID = 0;
+
+ for(uint8 i = 0; i < 6; i++)
+ IsBossDied[i] = false;
+
+ for(uint8 i = 0; i < ENCOUNTERS; i++)
+ Encounter[i] = NOT_STARTED;
}
- uint32 GetData(uint32 type)
+ void OnObjectCreate(GameObject *go)
{
- if(type == DATA_CANSPAWNGANDLING)
- if(IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
- return 1;
-
- return 0;
+ switch(go->GetEntry())
+ {
+ case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break;
+ case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break;
+ case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break;
+ case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break;
+ case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break;
+ case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break;
+ case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break;
+ case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break;
+ }
}
void SetData(uint32 type, uint32 data)
@@ -63,28 +92,43 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
case DATA_LORDALEXEIBAROV_DEATH:
IsBossDied[0] = true;
break;
-
case DATA_DOCTORTHEOLENKRASTINOV_DEATH:
IsBossDied[1] = true;
break;
-
case DATA_THERAVENIAN_DEATH:
IsBossDied[2] = true;
break;
-
case DATA_LOREKEEPERPOLKELT_DEATH:
IsBossDied[3] = true;
break;
-
case DATA_INSTRUCTORMALICIA_DEATH:
IsBossDied[4] = true;
break;
-
case DATA_LADYILLUCIABAROV_DEATH:
IsBossDied[5] = true;
break;
+ case TYPE_GANDLING:
+ Encounter[0] = data;
+ break;
+ case TYPE_KIRTONOS:
+ Encounter[1] = data;
+ break;
}
}
+
+ uint32 GetData(uint32 type)
+ {
+ if (type == TYPE_GANDLING)
+ {
+ if (IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
+ {
+ Encounter[0] = IN_PROGRESS;
+ return IN_PROGRESS;
+ }
+ }
+
+ return 0;
+ }
};
InstanceData* GetInstanceData_instance_scholomance(Map* map)
diff --git a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
index fff417bcf21..4d55b5d91fd 100644
--- a/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
+++ b/src/bindings/scripts/scripts/zone/searing_gorge/searing_gorge.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
index 1612bfd59f0..8383a5c3950 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
index 3e7caef435f..3a788d2e863 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -26,6 +26,18 @@ EndScriptData */
#define ENCOUNTERS 4
+enum
+{
+ SAY_BOSS_DIE_AD = -1033007,
+ SAY_BOSS_DIE_AS = -1033008,
+
+ NPC_ASH = 3850,
+ NPC_ADA = 3849,
+
+ GO_COURTYARD_DOOR = 18895, //door to open when talking to NPC's
+ GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer
+ GO_ARUGAL_DOOR = 18971 //door to open when Wolf Master Nandos
+};
struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
{
instance_shadowfang_keep(Map *map) : ScriptedInstance(map) {Initialize();};
@@ -33,12 +45,18 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
uint32 Encounter[ENCOUNTERS];
std::string str_data;
+ uint64 uiAshGUID;
+ uint64 uiAdaGUID;
+
uint64 DoorCourtyardGUID;
uint64 DoorSorcererGUID;
uint64 DoorArugalGUID;
void Initialize()
{
+ uiAshGUID = 0;
+ uiAdaGUID = 0;
+
DoorCourtyardGUID = 0;
DoorSorcererGUID = 0;
DoorArugalGUID = 0;
@@ -63,13 +81,34 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
return NULL;
}
+ void OnCreatureCreate(Creature* pCreature, uint32 uiCreature)
+ {
+ switch(pCreature->GetEntry())
+ {
+ case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break;
+ case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break;
+ }
+ }
+
void OnObjectCreate(GameObject *go)
{
switch(go->GetEntry())
{
- case 18895: DoorCourtyardGUID = go->GetGUID(); break;
- case 18972: DoorSorcererGUID = go->GetGUID(); break;
- case 18971: DoorArugalGUID = go->GetGUID(); break;
+ case GO_COURTYARD_DOOR:
+ DoorCourtyardGUID = go->GetGUID();
+ if (Encounter[0] == DONE)
+ go->SetGoState(0);
+ break;
+ case GO_SORCERER_DOOR:
+ DoorSorcererGUID = go->GetGUID();
+ if (Encounter[2] == DONE)
+ go->SetGoState(0);
+ break;
+ case GO_ARUGAL_DOOR:
+ DoorArugalGUID = go->GetGUID();
+ if (Encounter[3] == DONE)
+ go->SetGoState(0);
+ break;
}
}
@@ -87,6 +126,23 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
go->SetGoState(state);
}
+ void DoSpeech()
+ {
+ Player* pPlayer = GetPlayerInMap();
+
+ if (pPlayer)
+ {
+ Unit* pAda = Unit::GetUnit(*pPlayer,uiAdaGUID);
+ Unit* pAsh = Unit::GetUnit(*pPlayer,uiAshGUID);
+
+ if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive())
+ {
+ DoScriptText(SAY_BOSS_DIE_AD,pAda);
+ DoScriptText(SAY_BOSS_DIE_AS,pAsh);
+ }
+ }
+ }
+
void SetData(uint32 type, uint32 data)
{
switch(type)
@@ -97,6 +153,8 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
Encounter[0] = data;
break;
case TYPE_RETHILGORE:
+ if (data == DONE)
+ DoSpeech();
Encounter[1] = data;
break;
case TYPE_FENRUS:
@@ -160,8 +218,10 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3];
for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ {
if (Encounter[i] == IN_PROGRESS)
Encounter[i] = NOT_STARTED;
+ }
OUT_LOAD_INST_DATA_COMPLETE;
}
diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
index a4f04f83ffd..f4b49b5f524 100644
--- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -33,7 +33,20 @@ EndContentData */
## npc_shadowfang_prisoner
######*/
-#define SAY_FREE -1033000
+enum
+{
+ SAY_FREE_AS = -1033000,
+ SAY_OPEN_DOOR_AS = -1033001,
+ SAY_POST_DOOR_AS = -1033002,
+ SAY_FREE_AD = -1033003,
+ SAY_OPEN_DOOR_AD = -1033004,
+ SAY_POST1_DOOR_AD = -1033005,
+ SAY_POST2_DOOR_AD = -1033006,
+
+ SPELL_UNLOCK = 6421,
+ NPC_ASH = 3850
+};
+
#define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door."
struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI
@@ -41,17 +54,45 @@ struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI
npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ uiNpcEntry = c->GetEntry();
}
ScriptedInstance *pInstance;
+ uint32 uiNpcEntry;
- void WaypointReached(uint32 i)
+ void WaypointReached(uint32 uiPoint)
{
- if( pInstance && i == 6)
+ switch(uiPoint)
{
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
- DoScriptText(SAY_FREE, m_creature);
- pInstance->SetData(TYPE_FREE_NPC, DONE);
+ case 0:
+ if (uiNpcEntry == NPC_ASH)
+ DoScriptText(SAY_FREE_AS, m_creature);
+ else
+ DoScriptText(SAY_FREE_AD, m_creature);
+ break;
+ case 10:
+ if (uiNpcEntry == NPC_ASH)
+ DoScriptText(SAY_OPEN_DOOR_AS, m_creature);
+ else
+ DoScriptText(SAY_OPEN_DOOR_AD, m_creature);
+ break;
+ case 11:
+ if (uiNpcEntry == NPC_ASH)
+ DoCast(m_creature, SPELL_UNLOCK);
+ break;
+ case 12:
+ if (uiNpcEntry == NPC_ASH)
+ DoScriptText(SAY_POST_DOOR_AS, m_creature);
+ else
+ DoScriptText(SAY_POST1_DOOR_AD, m_creature);
+
+ if (pInstance)
+ pInstance->SetData(TYPE_FREE_NPC, DONE);
+ break;
+ case 13:
+ if (uiNpcEntry != NPC_ASH)
+ DoScriptText(SAY_POST2_DOOR_AD, m_creature);
+ break;
}
}
@@ -59,62 +100,43 @@ struct TRINITY_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI
void Aggro(Unit* who) {}
};
-CreatureAI* GetAI_npc_shadowfang_prisoner(Creature *_Creature)
+CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature)
{
- npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(_Creature);
-
- uint32 eCreature = _Creature->GetEntry();
-
- if( eCreature==3849) //adamant
- prisonerAI->AddWaypoint(0, -254.47, 2117.48, 81.17);
- if( eCreature==3850) //ashcrombe
- prisonerAI->AddWaypoint(0, -252.35, 2126.71, 81.17);
+ npc_shadowfang_prisonerAI* prisonerAI = new npc_shadowfang_prisonerAI(pCreature);
- prisonerAI->AddWaypoint(1, -253.63, 2131.27, 81.28);
- prisonerAI->AddWaypoint(2, -249.66, 2142.45, 87.01);
- prisonerAI->AddWaypoint(3, -248.08, 2143.68, 87.01);
- prisonerAI->AddWaypoint(4, -238.87, 2139.93, 87.01);
- prisonerAI->AddWaypoint(5, -235.47, 2149.18, 90.59);
- prisonerAI->AddWaypoint(6, -239.89, 2156.06, 90.62, 20000);
+ prisonerAI->FillPointMovementListForCreature();
return (CreatureAI*)prisonerAI;
}
-bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature)
+bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature)
{
- ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
+ ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData());
- if (!pInstance)
- return false;
-
- if (pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
+ if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE)
+ pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+
+ pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
-bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, uint32 sender, uint32 action)
+bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
- if (action == GOSSIP_ACTION_INFO_DEF+1)
+ if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
- player->CLOSE_GOSSIP_MENU();
- ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false);
+ pPlayer->CLOSE_GOSSIP_MENU();
+ ((npc_escortAI*)(pCreature->AI()))->Start(false, true, false);
}
return true;
}
-/*######
-## AddSC
-######*/
-
void AddSC_shadowfang_keep()
{
Script *newscript;
newscript = new Script;
- newscript->Name="npc_shadowfang_prisoner";
+ newscript->Name = "npc_shadowfang_prisoner";
newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner;
newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner;
newscript->GetAI = &GetAI_npc_shadowfang_prisoner;
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
index 014d7fe1153..ea84a299403 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/boss_doomwalker.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI
//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
if (InEnrage)
- m_creature->RemoveAura(SPELL_ENRAGE, 0);
+ m_creature->RemoveAura(SPELL_ENRAGE);
DoCast(m_creature,SPELL_EARTHQUAKE);
Quake_Timer = 30000 + rand()%25000;
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
index 720d5aabb1c..0a84d13349e 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -57,6 +57,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
{
PlayerGUID = 0;
+ Reset();
}
uint64 PlayerGUID;
@@ -93,7 +94,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
if(!caster)
return;
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN, 0) && !PlayerGUID)
+ if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN) && !PlayerGUID)
{
float PlayerX, PlayerY, PlayerZ;
caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
@@ -180,6 +181,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
{
PlayerGUID = 0;
Tapped = false;
+ Reset();
}
uint64 PlayerGUID;
diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
index 82b4ca4e7bc..583a6324a00 100644
--- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
+++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -350,64 +350,7 @@ CreatureAI* GetAI_npc_kservantAI(Creature *_Creature)
{
npc_kservantAI* kservantAI = new npc_kservantAI(_Creature);
- kservantAI->AddWaypoint(0, -1863.369019, 5419.517090, -10.463668, 4000);
- kservantAI->AddWaypoint(1, -1861.749023, 5416.465332, -10.508068);
- kservantAI->AddWaypoint(2, -1857.036133, 5410.966309, -12.428039);
- kservantAI->AddWaypoint(3, -1831.539185, 5365.472168, -12.428039);
- kservantAI->AddWaypoint(4, -1813.416504, 5333.776855, -12.428039);
- kservantAI->AddWaypoint(5, -1800.354370, 5313.290039, -12.428039);
- kservantAI->AddWaypoint(6, -1775.624878, 5268.786133, -38.809181);
- kservantAI->AddWaypoint(7, -1770.147339, 5259.268066, -38.829231);
- kservantAI->AddWaypoint(8, -1762.814209, 5261.098145, -38.848995);
- kservantAI->AddWaypoint(9, -1740.110474, 5268.858398, -40.208965);
- kservantAI->AddWaypoint(10, -1725.837402, 5270.936035, -40.208965);
- kservantAI->AddWaypoint(11, -1701.580322, 5290.323242, -40.209187);
- kservantAI->AddWaypoint(12, -1682.877808, 5291.406738, -34.429646);
- kservantAI->AddWaypoint(13, -1670.101685, 5291.201172, -32.786007);
- kservantAI->AddWaypoint(14, -1656.666870, 5294.333496, -37.862648);
- kservantAI->AddWaypoint(15, -1652.035767, 5295.413086, -40.245499);
- kservantAI->AddWaypoint(16, -1620.860596, 5300.133301, -40.208992);
- kservantAI->AddWaypoint(17, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(18, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(19, -1607.630981, 5293.983398, -38.577045, 5000);
- kservantAI->AddWaypoint(20, -1622.140869, 5301.955566, -40.208897);
- kservantAI->AddWaypoint(21, -1621.131836, 5333.112793, -40.208897);
- kservantAI->AddWaypoint(22, -1637.598999, 5342.134277, -40.208790);
- kservantAI->AddWaypoint(23, -1648.521606, 5352.309570, -47.496170);
- kservantAI->AddWaypoint(24, -1654.606934, 5357.419434, -45.870892);
- kservantAI->AddWaypoint(25, -1633.670044, 5422.067871, -42.835541);
- kservantAI->AddWaypoint(25, -1656.567505, 5426.236328, -40.405815);
- kservantAI->AddWaypoint(26, -1664.932373, 5425.686523, -38.846405);
- kservantAI->AddWaypoint(27, -1681.406006, 5425.871094, -38.810928);
- kservantAI->AddWaypoint(28, -1730.875977, 5427.413574, -12.427910);
- kservantAI->AddWaypoint(29, -1743.509521, 5369.599121, -12.427910);
- kservantAI->AddWaypoint(30, -1877.217041, 5303.710449, -12.427989);
- kservantAI->AddWaypoint(31, -1890.371216, 5289.273438, -12.428268);
- kservantAI->AddWaypoint(32, -1905.505737, 5266.534668, 2.630672);
- kservantAI->AddWaypoint(33, -1909.381348, 5273.008301, 1.663714, 10000);
- kservantAI->AddWaypoint(34, -1909.381348, 5273.008301, 1.663714, 12000);
- kservantAI->AddWaypoint(35, -1909.381348, 5273.008301, 1.663714, 8000);
- kservantAI->AddWaypoint(36, -1909.381348, 5273.008301, 1.663714, 15000);
- kservantAI->AddWaypoint(37, -1927.561401, 5275.324707, 1.984987);
- kservantAI->AddWaypoint(38, -1927.385498, 5300.879883, -12.427236);
- kservantAI->AddWaypoint(39, -1921.063965, 5314.318359, -12.427236);
- kservantAI->AddWaypoint(40, -1965.425415, 5379.298828, -12.427236);
- kservantAI->AddWaypoint(41, -1981.233154, 5450.743652, -12.427236);
- kservantAI->AddWaypoint(42, -1958.022461, 5455.904297, 0.487659);
- kservantAI->AddWaypoint(43, -1951.991455, 5463.580566, 0.874490, 10000);
- kservantAI->AddWaypoint(44, -1951.991455, 5463.580566, 0.874490, 12000);
- kservantAI->AddWaypoint(45, -1968.730225, 5481.752930, -12.427846);
- kservantAI->AddWaypoint(46, -1881.839844, 5554.040039, -12.427846);
- kservantAI->AddWaypoint(47, -1841.566650, 5545.965332, -12.427846);
- kservantAI->AddWaypoint(48, -1837.658325, 5523.780273, 0.558756);
- kservantAI->AddWaypoint(49, -1831.321777, 5534.821777, 1.221819, 6000);
- kservantAI->AddWaypoint(50, -1831.321777, 5534.821777, 1.221819, 8000);
- kservantAI->AddWaypoint(51, -1831.321777, 5534.821777, 1.221819, 5000);
- kservantAI->AddWaypoint(52, -1850.060669, 5472.610840, 0.857320, 6000);
- kservantAI->AddWaypoint(53, -1850.060669, 5472.610840, 0.857320, 8000);
- kservantAI->AddWaypoint(54, -1850.060669, 5472.610840, 0.857320, 9000);
- kservantAI->AddWaypoint(55, -1850.060669, 5472.610840, 0.857320, 9000);
- kservantAI->AddWaypoint(56, -1850.060669, 5472.610840, 0.857320, 4000);
+ kservantAI->FillPointMovementListForCreature();
return (CreatureAI*)kservantAI;
}
diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
index 35dca28ddc8..bd1ecf748a0 100644
--- a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
+++ b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
index 330fcf937c2..b8119f82d6b 100644
--- a/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
+++ b/src/bindings/scripts/scripts/zone/silvermoon/silvermoon_city.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
- m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
spellHit = false;
}
@@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
+ if (m_creature->IsStandState())
{
if(lifeTimer < diff)
m_creature->AI()->EnterEvadeMode();
@@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
{
((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
DoCast(m_creature,SPELL_REVIVE_SELF);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//m_creature->RemoveAllAuras();
DoScriptText(SAY_HEAL, m_creature);
diff --git a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
index a4236c82cef..c975dea89cf 100644
--- a/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/silverpine_forest/silverpine_forest.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
index cd42b046d94..fcb44c764f3 100644
--- a/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/stonetalon_mountains/stonetalon_mountains.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
index 81016febdae..64c3df4f0c3 100644
--- a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
+++ b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -27,6 +27,7 @@ npc_bartleby
npc_dashel_stonefist
npc_general_marcus_jonathan
npc_lady_katrana_prestor
+npc_harbor_taxi
EndContentData */
#include "precompiled.h"
@@ -74,7 +75,7 @@ struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI
void Reset()
{
m_creature->setFaction(11);
- m_creature->setEmoteState(7);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 7);
PlayerGUID = 0;
}
@@ -131,7 +132,7 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
void Reset()
{
m_creature->setFaction(11);
- m_creature->setEmoteState(7);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 7);
}
void DamageTaken(Unit *done_by, uint32 & damage)
@@ -173,6 +174,8 @@ CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
## npc_general_marcus_jonathan
######*/
+#define SAY_GREETING -1000005
+
bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
{
if(player->GetTeam() == ALLIANCE)
@@ -184,7 +187,7 @@ bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creatur
}
if (emote == TEXTEMOTE_WAVE)
{
- _Creature->MonsterSay("Greetings citizen",LANG_COMMON,0);
+ DoScriptText(SAY_GREETING, _Creature, player);
}
}
return true;
@@ -236,6 +239,28 @@ bool GossipSelect_npc_lady_katrana_prestor(Player *player, Creature *_Creature,
return true;
}
+/*######
+## npc_harbor_taxi
+######*/
+
+#define GOSSIP_STORMWIND "I'd like to take a flight around Stormwind Harbor."
+
+bool GossipHello_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature)
+{
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_STORMWIND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->SEND_GOSSIP_MENU(13454,_Creature->GetGUID());
+ return true;
+}
+
+bool GossipSelect_npc_stormwind_harbor_taxi(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+{
+ if (action == GOSSIP_ACTION_INFO_DEF + 10)
+ {
+ player->GetSession()->SendDoFlight(1149, 1041);
+ }
+ return true;
+}
+
void AddSC_stormwind_city()
{
Script *newscript;
@@ -260,7 +285,7 @@ void AddSC_stormwind_city()
newscript = new Script;
newscript->Name = "npc_general_marcus_jonathan";
- newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
+ //newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
newscript->RegisterSelf();
newscript = new Script;
@@ -268,5 +293,11 @@ void AddSC_stormwind_city()
newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_stormwind_harbor_taxi";
+ newscript->pGossipHello = &GossipHello_npc_stormwind_harbor_taxi;
+ newscript->pGossipSelect = &GossipSelect_npc_stormwind_harbor_taxi;
+ newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
index c2aa57d8c49..2a46fe4d5dd 100644
--- a/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
+++ b/src/bindings/scripts/scripts/zone/stranglethorn_vale/stranglethorn_vale.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
index c8ad95038c0..aa897761344 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
index c30f712a98b..57f70cf33dd 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
index 08b754177bb..ce09bbc2cd0 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
index 0e70b4a3b43..5b85cdc07fe 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
index 5d0eda58c37..9402c601219 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
index 652dd48e766..e08c97965b1 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
index db425ebcca0..3233e5c9c50 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
index 86602f40d34..9c2084f6cec 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
index d6a87d43d8b..a8ed628ffc0 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
index 2e16dc883cc..6ef1477ff35 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
index f41c5f013b6..0555c5da57d 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
index 79dd277c999..b9246091a7c 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
+++ b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
index 142c38f06d6..200195d76af 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -280,10 +280,10 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
if (!pGroupie)
continue;
- if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0))
+ if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM))
pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM);
}
- } else if (player->HasAura(SPELL_BARON_ULTIMATUM,0))
+ } else if (player->HasAura(SPELL_BARON_ULTIMATUM))
player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM);
if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON)))
diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
index f22ca652fff..d7f16105f07 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -54,12 +54,12 @@ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO)
continue;
if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
- !pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0) &&
+ !pGroupie->HasAura(SPELL_BARON_ULTIMATUM) &&
pGroupie->GetMap() == _GO->GetMap())
pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true);
}
} else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
- !player->HasAura(SPELL_BARON_ULTIMATUM,0) &&
+ !player->HasAura(SPELL_BARON_ULTIMATUM) &&
player->GetMap() == _GO->GetMap())
player->CastSpell(player,SPELL_BARON_ULTIMATUM,true);
@@ -72,10 +72,10 @@ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO)
######*/
//Possibly more of these quotes around.
-#define SAY_ZAPPED0 "Thanks to Egan"
-#define SAY_ZAPPED1 "Rivendare must die"
-#define SAY_ZAPPED2 "Who you gonna call?"
-#define SAY_ZAPPED3 "Don't cross those beams!"
+#define SAY_ZAPPED0 -1329000
+#define SAY_ZAPPED1 -1329001
+#define SAY_ZAPPED2 -1329002
+#define SAY_ZAPPED3 -1329003
struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI
{
@@ -85,10 +85,10 @@ struct TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI
{
switch (rand()%4)
{
- case 0: DoSay(SAY_ZAPPED0,LANG_UNIVERSAL,NULL); break;
- case 1: DoSay(SAY_ZAPPED1,LANG_UNIVERSAL,NULL); break;
- case 2: DoSay(SAY_ZAPPED2,LANG_UNIVERSAL,NULL); break;
- case 3: DoSay(SAY_ZAPPED3,LANG_UNIVERSAL,NULL); break;
+ case 0: DoScriptText(SAY_ZAPPED0, m_creature); break;
+ case 1: DoScriptText(SAY_ZAPPED1, m_creature); break;
+ case 2: DoScriptText(SAY_ZAPPED2, m_creature); break;
+ case 3: DoScriptText(SAY_ZAPPED3, m_creature); break;
}
}
@@ -227,6 +227,32 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+
+ void ReciveEmote(Player *player, uint32 emote)
+ {
+ switch(emote)
+ {
+ case TEXTEMOTE_DANCE:
+ EnterEvadeMode();
+ break;
+ case TEXTEMOTE_RUDE:
+ //Should instead cast spell, kicking player back. Spell not found.
+ if (m_creature->IsWithinDistInMap(player, 5))
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ else
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ break;
+ case TEXTEMOTE_WAVE:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ break;
+ case TEXTEMOTE_BOW:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
+ break;
+ case TEXTEMOTE_KISS:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
+ break;
+ }
+ }
};
CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
@@ -234,34 +260,6 @@ CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
return new mobs_spectral_ghostly_citizenAI (_Creature);
}
-bool ReciveEmote_mobs_spectral_ghostly_citizen(Player *player, Creature *_Creature, uint32 emote)
-{
- switch(emote)
- {
- case TEXTEMOTE_DANCE:
- ((mobs_spectral_ghostly_citizenAI*)_Creature->AI())->EnterEvadeMode();
- break;
- case TEXTEMOTE_RUDE:
- //Should instead cast spell, kicking player back. Spell not found.
- if (_Creature->IsWithinDistInMap(player, 5))
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
- else
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
- break;
- case TEXTEMOTE_WAVE:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- break;
- case TEXTEMOTE_BOW:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
- break;
- case TEXTEMOTE_KISS:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
- break;
- }
-
- return true;
-}
-
void AddSC_stratholme()
{
Script *newscript;
@@ -284,7 +282,6 @@ void AddSC_stratholme()
newscript = new Script;
newscript->Name = "mobs_spectral_ghostly_citizen";
newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen;
- newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
index 539548af9da..e848557f859 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI
Unit *Target = m_creature->getVictim();
DoCast(Target,SPELL_STOMP);
- if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0);
+ if(Target->HasAura(45151)) Target->RemoveAura(45151);
StompTimer = 30000;
}else StompTimer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
index 0b013d8fe93..34f0f98fef4 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -209,9 +209,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
+ if(!target->HasAura(SPELL_DARK_FLAME))
{
- if(target->HasAura(SPELL_DARK_TOUCHED,0))
+ if(target->HasAura(SPELL_DARK_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -222,9 +222,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
}
break;
case SPELL_DARK_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
+ if(!target->HasAura(SPELL_DARK_FLAME))
{
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -507,9 +507,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
+ if(!target->HasAura(SPELL_DARK_FLAME))
{
- if(target->HasAura(SPELL_DARK_TOUCHED,0))
+ if(target->HasAura(SPELL_DARK_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -520,9 +520,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
}
break;
case SPELL_DARK_TOUCHED:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
+ if(!target->HasAura(SPELL_DARK_FLAME))
{
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -543,31 +543,31 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
case 0: DoPlaySoundToSet(m_creature,SOUND_INTRO); return 0;
case 1:
if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL);
+ Sacrolash->MonsterYell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL);
return 1000;
case 2:
- m_creature->Yell(YELL_INTRO_ALY_2, LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(YELL_INTRO_ALY_2, LANG_UNIVERSAL,NULL);
return 1000;
case 3:
if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL);
+ Sacrolash->MonsterYell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL);
return 2000;
case 4:
- m_creature->Yell(YELL_INTRO_ALY_4, LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(YELL_INTRO_ALY_4, LANG_UNIVERSAL,NULL);
return 1000;
case 5:
if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL);
+ Sacrolash->MonsterYell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL);
return 2000;
case 6:
- m_creature->Yell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL);
return 1000;
case 7:
if(Sacrolash)
- Sacrolash->Yell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL);
+ Sacrolash->MonsterYell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL);
return 3000;
case 8:
- m_creature->Yell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL);
+ m_creature->MonsterYell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL);
return 900000;
}
return 10000;
@@ -709,9 +709,9 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
case SPELL_SHADOW_FURY:
case SPELL_DARK_STRIKE:
- if(!target->HasAura(SPELL_DARK_FLAME,0))
+ if(!target->HasAura(SPELL_DARK_FLAME))
{
- if(target->HasAura(SPELL_FLAME_TOUCHED,0))
+ if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -726,7 +726,7 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
- if(!m_creature->HasAura(SPELL_IMAGE_VISUAL,0))
+ if(!m_creature->HasAura(SPELL_IMAGE_VISUAL))
DoCast(m_creature,SPELL_IMAGE_VISUAL);
if(kill_timer < diff)
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
index 68bb0ae8e44..442ac05816c 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp
@@ -491,7 +491,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
index 23c783ffa88..c39c14b7f20 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->SetVisibility(VISIBILITY_ON);
- m_creature->SetStandState(PLAYER_STATE_SLEEP);
+ m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
ArcaneBuffetTimer = 8000;
FrostBreathTimer = 15000;
@@ -157,7 +157,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
void Aggro(Unit* who)
{
- m_creature->SetStandState(PLAYER_STATE_NONE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_EVIL_AGGRO, m_creature);
GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID);
if(Door) Door->SetLootState(GO_ACTIVATED);
@@ -384,7 +384,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
if(ResetThreat < diff)
{
- if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION,0)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) )
+ if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) )
{
for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
{
@@ -609,7 +609,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
{
//this is a hack. we need to find a victim without aura in core
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) )
+ if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION)) )
{
DoCast(target, SPELL_SPECTRAL_BLAST);
SpectralBlastTimer = 20000+(rand()%5000);
@@ -626,7 +626,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
bool GOkalocegos_teleporter(Player *player, GameObject* _GO)
{
- if(player->HasAura(AURA_SPECTRAL_EXHAUSTION, 0))
+ if(player->HasAura(AURA_SPECTRAL_EXHAUSTION))
player->GetSession()->SendNotification(GO_FAILED);
else
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
index 0844d5dffe6..8ae61602616 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
index fd93aa15d6c..cd4f62584f0 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
index 45d9eba60d5..0278d40a7cb 100644
--- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
+++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -191,7 +191,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
if( who->GetTypeId() == TYPEID_PLAYER )
{
- if( ((Player*)who)->HasAura(34877,1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
+ if( ((Player*)who)->HasAura(34877) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
{
float Radius = 10.0;
if( m_creature->IsWithinDistInMap(who, Radius) )
@@ -211,38 +211,11 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
}
};
-CreatureAI* GetAI_npc_custodian_of_time(Creature *_Creature)
+CreatureAI* GetAI_npc_custodian_of_time(Creature* pCreature)
{
- npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(_Creature);
-
- custodian_of_timeAI->AddWaypoint(0, -8535.57,-4212.61, -212.04);
- custodian_of_timeAI->AddWaypoint(1, -8456.48,-4211.77, -213.30);
- custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -205.05,5000);
- custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,16000);
- custodian_of_timeAI->AddWaypoint(4, -8374.93,-4250.21, -204.38,10000);
- custodian_of_timeAI->AddWaypoint(5, -8374.93,-4250.21, -204.38,2000);
- custodian_of_timeAI->AddWaypoint(6, -8439.40,-4180.05, -209.25);
- custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,10000);
- custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,16000);
- custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,13000);
- custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,18000);
- custodian_of_timeAI->AddWaypoint(11, -8437.82,-4120.84, -208.59,15000);
- custodian_of_timeAI->AddWaypoint(12, -8437.82,-4120.84, -208.59,2000);
- custodian_of_timeAI->AddWaypoint(13, -8467.26,-4198.63, -214.21);
- custodian_of_timeAI->AddWaypoint(14, -8667.76,-4252.13, -209.56);
- custodian_of_timeAI->AddWaypoint(15, -8703.71,-4234.58, -209.5,14000);
- custodian_of_timeAI->AddWaypoint(16, -8703.71,-4234.58, -209.5,2000);
- custodian_of_timeAI->AddWaypoint(17, -8642.81,-4304.37, -209.57);
- custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,6000);
- custodian_of_timeAI->AddWaypoint(19, -8649.06,-4394.36, -208.46,18000);
- custodian_of_timeAI->AddWaypoint(20, -8649.06,-4394.36, -208.46,2000);
- custodian_of_timeAI->AddWaypoint(21, -8468.72,-4437.67, -215.45);
- custodian_of_timeAI->AddWaypoint(22, -8427.54,-4426, -211.13);
- custodian_of_timeAI->AddWaypoint(23, -8364.83,-4393.32, -205.91);
- custodian_of_timeAI->AddWaypoint(24, -8304.54,-4357.2, -208.2,18000);
- custodian_of_timeAI->AddWaypoint(25, -8304.54,-4357.2, -208.2,2000);
- custodian_of_timeAI->AddWaypoint(26, -8375.42,-4250.41, -205.14,5000);
- custodian_of_timeAI->AddWaypoint(27, -8375.42,-4250.41, -205.14,5000);
+ npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(pCreature);
+
+ custodian_of_timeAI->FillPointMovementListForCreature();
return (CreatureAI*)custodian_of_timeAI;
}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
index a61a9c9b163..b12a9eff520 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -347,7 +347,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
if( pInstance )
{
m_creature->InterruptNonMeleeSpells(true);
- m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY);
+ m_creature->RemoveAurasByType(SPELL_AURA_DUMMY);
switch( Phase )
{
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
index da2b392072a..ee8bacb930c 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
index 76f8d575383..3f8dee8bbd0 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
index 5f1fb087655..a0d21e302b5 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
index c9f88c57b2d..85a644f7ab8 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
index e95d8328907..9a276ead142 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
index 5306aa690cf..bbd18dee029 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
index 813222b52c9..3e5bbbf66da 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp
@@ -241,12 +241,12 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
WaitEvent = WE_DUMMY;
return;
case WE_DIE:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
WaitTimer = 5000;
WaitEvent = WE_REVIVE;
return;
case WE_REVIVE:
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
m_creature->SetHealth(m_creature->GetMaxHealth());
m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -348,7 +348,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
if(Charge_Timer < diff)
{
- Unit *target= SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_CHARGE), true);
+ Unit *target= SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRangeForHostile(SPELL_CHARGE), true);
DoCast(target, SPELL_CHARGE);
Charge_Timer = 30000;
}else Charge_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
index bc215f8c683..340d3f23fc8 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -120,6 +120,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Jump_Timer=8000;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
Phase = 1;
+ Wrath_Timer = 20000+rand()%5000;//twice in phase one
if(pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
index d36f520491a..a4c430ae7f7 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -191,7 +191,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
if(pInstance && (pInstance->GetData(DATA_KAELTHASEVENT) == 1 || pInstance->GetData(DATA_KAELTHASEVENT) == 3))
{
Creature *Kaelthas = NULL;
- Kaelthas = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KAELTHAS)));
+ Kaelthas = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KAELTHAS)));
if(Kaelthas)
Kaelthas->AI()->EnterEvadeMode();
@@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
if (pInstance->GetData(DATA_KAELTHASEVENT) == 3)
JustDied(pKiller);
@@ -325,7 +325,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
}
if(pInstance) {
for(uint32 i = 0; i < 7; i++) {
- Creature* weapon = (Creature*)(Unit::GetUnit((*m_creature), WeaponGuid[i]));;
+ Creature* weapon = (Unit::GetCreature((*m_creature), WeaponGuid[i]));;
delete weapon;
}
}
@@ -341,7 +341,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
std::list<Creature*> PhoenixList;
Trinity::AllCreaturesOfEntryInRange check(m_creature, PHOENIX, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(PhoenixList, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, PhoenixList, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
@@ -393,7 +393,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
Creature *pCreature;
for(uint8 i = 0; i < 4; ++i)
{
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ pCreature = (Unit::GetCreature((*m_creature), AdvisorGuid[i]));
if(pCreature)
{
pCreature->Respawn();
@@ -483,7 +483,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
Creature *pCreature;
for(uint8 i = 0; i < 4; ++i)
{
- pCreature = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ pCreature = (Unit::GetCreature((*m_creature), AdvisorGuid[i]));
if(pCreature)
{
pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -550,7 +550,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
case 1:
if(Phase_Timer < diff)
{
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[0]));
if(Advisor)
{
@@ -568,8 +568,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
//Subphase 2 - Start
case 2:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[0]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD))
{
DoScriptText(SAY_INTRO_SANGUINAR, m_creature);
@@ -584,7 +584,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
case 3:
if(Phase_Timer < diff)
{
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[1]));
if(Advisor)
{
@@ -602,8 +602,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
//Subphase 3 - Start
case 4:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[1]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD))
{
DoScriptText(SAY_INTRO_CAPERNIAN, m_creature);
@@ -618,7 +618,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
case 5:
if(Phase_Timer < diff)
{
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[2]));
if(Advisor)
{
@@ -636,8 +636,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
//Subphase 4 - Start
case 6:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[2]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD))
{
DoScriptText(SAY_INTRO_TELONICUS, m_creature);
@@ -652,7 +652,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
case 7:
if(Phase_Timer < diff)
{
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[3]));
if(Advisor)
{
@@ -672,8 +672,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
//End of phase 1
case 8:
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3]));
- if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD))
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[3]));
+ if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD))
{
Phase = 2;
pInstance->SetData(DATA_KAELTHASEVENT, 2);
@@ -742,7 +742,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
Creature* Advisor;
for (uint32 i = 0; i < 4; ++i)
{
- Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[i]));
+ Advisor = (Unit::GetCreature((*m_creature), AdvisorGuid[i]));
if (!Advisor)
error_log("TSCR: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
else ((advisorbase_ai*)Advisor->AI())->Revive(Target);
@@ -1457,7 +1457,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI
if(SummonEgg == 1){ //hack die animation
m_creature->RemoveAllAuras();
DoStartNoMovement(m_creature->getVictim());
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD);
+ m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
SummonEgg = 2;
Cycle_Timer = 1000;
}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
index 708e5feffcd..65c8d2f87f3 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
index 7162fb90199..d0d3ea09061 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
index c6352a9e67c..66e595ab729 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 20064: ThaladredTheDarkener = creature->GetGUID(); break;
case 20063: MasterEngineerTelonicus = creature->GetGUID(); break;
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
index ef3860c0581..7d73e08d9e5 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
index c77989e27f3..268cfeb2918 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
index bd8fc581e9d..9bc8afc8aef 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
index b3eddfa7ebe..b8cd2fc0cbe 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI
if(frost_attack_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK);
- frost_attack_Timer = 7000 + rand()%30000;
+ frost_attack_Timer = 7000 + rand()%3000;
}else frost_attack_Timer -= diff;
//Arcane Blast
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
index 338e115ef85..59f1748c9a5 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp
index 05866eb27fb..e8806b62957 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance
{
switch(type)
{
- case DATA_NETHERMANCER_EVENT: return Encounters[0];
+ case DATA_NETHERMANCER_EVENT: return Encounters[0];
}
return false;
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
index dc1e4df24ca..64c4fdae2c8 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
index c054340a4a5..86b04b28753 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI
DoCast(m_creature,SPELL_RED_COLORATION);
//Freeze animation
- m_creature->setEmoteState(53);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 53);
//Darkbeam for 35 seconds
PhaseTimer = 35000;
@@ -351,7 +351,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI
m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
//Freeze animation
- m_creature->setEmoteState(0);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
//Eye Beam for 50 seconds
@@ -397,7 +397,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI
m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
//Reset to normal emote state and prevent select and attack
- m_creature->setEmoteState(0);
+ m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Remove Target field
@@ -566,13 +566,15 @@ struct TRINITY_DLL_DECL cthunAI : public Scripted_NoMovementAI
Map *map = m_creature->GetMap();
if(!map->IsDungeon()) return;
+ //Play random sound to the zone
Map::PlayerList const &PlayerList = map->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+
+ if (!PlayerList.isEmpty())
{
- if (Player* i_pl = i->getSource())
+ for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
- //Play random sound to the zone
- i_pl->SendPlaySound(RANDOM_SOUND_WHISPER, true);
+ if (Player* pPlr = itr->getSource())
+ pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr);
}
}
@@ -963,7 +965,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target,SPELL_MIND_FLAY);
//Mindflay every 10 seconds
@@ -1031,7 +1033,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
return;
}
- if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -1127,7 +1129,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
return;
}
- if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -1211,7 +1213,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
- if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
+ if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target,SPELL_GREEN_BEAM);
//Beam every 2 seconds
@@ -1249,7 +1251,7 @@ void flesh_tentacleAI::JustDied(Unit* killer)
{
if (!Parent)
{
- DoYell("Error: No Parent variable", LANG_UNIVERSAL, NULL);
+ error_log("TSCR: flesh_tentacle: No Parent variable");
return;
}
@@ -1257,7 +1259,7 @@ void flesh_tentacleAI::JustDied(Unit* killer)
if (Cthun)
((cthunAI*)(Cthun->AI()))->FleshTentcleKilled();
- else DoYell("Error: No Cthun", LANG_UNIVERSAL, NULL);
+ else error_log("TSCR: flesh_tentacle: No Cthun");
}
//GetAIs
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
index 0888c395489..9315817a460 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -135,34 +135,46 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI
case 0:
DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
case 1:
DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
case 2:
DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Hatchling)
((CreatureAI*)Hatchling->AI())->AttackStart(target);
break;
}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
index 484a6260c86..3456fd19d87 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,6 +23,9 @@ EndScriptData */
#include "precompiled.h"
+#define EMOTE_GENERIC_FRENZY_KILL -1000001
+#define EMOTE_GENERIC_BERSERK -1000004
+
#define SPELL_FRENZY 26051
#define SPELL_BERSERK 26068
#define SPELL_POISONBOLT 26052
@@ -71,6 +74,7 @@ struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI
if (!Frenzy && Frenzy_Timer < diff)
{
DoCast(m_creature, SPELL_FRENZY);
+ DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy = true;
PoisonBolt_Timer = 3000;
Frenzy_Timer = 25000 + rand()%10000;
@@ -119,7 +123,7 @@ struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI
if ( !Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31 )
{
m_creature->InterruptNonMeleeSpells(false);
- DoTextEmote("is going berserk", NULL);
+ DoScriptText(EMOTE_GENERIC_BERSERK, m_creature);
DoCast(m_creature, SPELL_BERSERK);
Berserk = true;
}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
index 7f5827d398b..a5721c4bc92 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
index a9b0578279d..b1a0b4bdfea 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -94,8 +94,12 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
if (WhirlWindRandom_Timer < diff)
{
//Attack random Gamers
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
- AttackStart(target);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->AddThreat(target, 1.0f);
+ m_creature->TauntApply(target);
+ AttackStart(target);
WhirlWindRandom_Timer = 3000 + rand()%4000;
}else WhirlWindRandom_Timer -= diff;
@@ -119,8 +123,12 @@ struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI
if (AggroReset_Timer < diff)
{
//Attack random Gamers
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
- m_creature->TauntApply(target);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->AddThreat(target, 1.0f);
+ m_creature->TauntApply(target);
+ AttackStart(target);
AggroReset = true;
AggroReset_Timer = 2000 + rand()%3000;
@@ -213,8 +221,12 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
if (WhirlWindRandom_Timer < diff)
{
//Attack random Gamers
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
- m_creature->TauntApply(target);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->AddThreat(target, 1.0f);
+ m_creature->TauntApply(target);
+ AttackStart(target);
WhirlWindRandom_Timer = 3000 + rand()%4000;
}else WhirlWindRandom_Timer -= diff;
@@ -230,8 +242,12 @@ struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI
if (AggroReset_Timer < diff)
{
//Attack random Gamers
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1))
- AttackStart(target);
+ Unit* target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM,1);
+ if (target)
+ m_creature->AddThreat(target, 1.0f);
+ m_creature->TauntApply(target);
+ AttackStart(target);
AggroReset = true;
AggroReset_Timer = 2000 + rand()%3000;
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
index 84311d725f5..c4f9401f869 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -261,6 +261,9 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->Relocate(bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true;
+ delete place1;
+ delete place2;
+ delete place3;
DoResetThreat();
DoStopAttack();
@@ -274,20 +277,24 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
- Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image1->SetHealth(m_creature->GetHealth() / 5);
- if (target)
- Image1->AI()->AttackStart(target);
+ if (Image1)
+ {
+ Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
+ Image1->SetHealth(m_creature->GetHealth() / 5);
+ if (target)
+ Image1->AI()->AttackStart(target);
+ ((boss_skeramAI*)Image1->AI())->IsImage = true;
+ }
Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
- Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
- Image2->SetHealth(m_creature->GetHealth() / 5);
- if (target)
- Image2->AI()->AttackStart(target);
-
- ((boss_skeramAI*)Image1->AI())->IsImage = true;
- ((boss_skeramAI*)Image2->AI())->IsImage = true;
-
+ if (Image2)
+ {
+ Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
+ Image2->SetHealth(m_creature->GetHealth() / 5);
+ if (target)
+ Image2->AI()->AttackStart(target);
+ ((boss_skeramAI*)Image2->AI())->IsImage = true;
+ }
Invisible = true;
}
};
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
index c707ad23cee..0abaf8e79d9 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -336,7 +336,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
std::list<Creature*> unitList;
AnyBugCheck u_check(m_creature, 150);
- Trinity::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check);
+ Trinity::CreatureListSearcher<AnyBugCheck> searcher(m_creature, unitList, u_check);
TypeContainerVisitor<Trinity::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap()));
@@ -404,13 +404,6 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
}
};
-class TRINITY_DLL_DECL BugAura : public Aura
-{
- public:
- BugAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
- {}
-};
-
struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
{
bool IAmVeklor() {return false;}
@@ -441,12 +434,14 @@ struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
target->setFaction(14);
((CreatureAI*)target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget());
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MUTATE_BUG);
+ uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
- target->AddAura(new BugAura(spell, i, NULL, target, target));
+ eff_mask|=1<<i;
}
+ target->AddAura(new Aura(spell, eff_mask, NULL, target, target));
target->SetHealth(target->GetMaxHealth());
}
@@ -524,12 +519,14 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI
{
target->setFaction(14);
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_EXPLODEBUG);
+ uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
- target->AddAura(new BugAura(spell, i, NULL, target, target));
+ eff_mask|=1<<i;
}
+ target->AddAura(new Aura(spell, eff_mask, NULL, target, target));
target->SetHealth(target->GetMaxHealth());
}
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
index 7b310dfe10d..2bb9f1bfb0b 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
index 95db307f778..5d545ed7c74 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
index 7ca0f33566f..9048591b774 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
index fd3e7c56cb1..0899fa5a610 100644
--- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
+++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
std::list<Creature*> assistList;
NearbyAQSentinel u_check(nears);
- Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(assistList, u_check);
+ Trinity::CreatureListSearcher<NearbyAQSentinel> searcher(m_creature, assistList, u_check);
TypeContainerVisitor<Trinity::CreatureListSearcher<NearbyAQSentinel>, GridTypeMapContainer > grid_creature_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, grid_creature_searcher, *(nears->GetMap()));
@@ -220,6 +220,8 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
SendMyListToBuddies();
CallBuddiesToAttack(who);
+
+ delete[] chosenAbilities;
}
bool gatherOthersWhenAggro;
@@ -245,13 +247,16 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
void GainSentinelAbility(uint32 id)
{
const SpellEntry *spell = GetSpellStore()->LookupEntry(id);
+ uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
- SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, i);
- m_creature->AddAura(a);
+ eff_mask=1<<i;
}
+ SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, eff_mask);
+ m_creature->AddAura(a);
+
if (id == SPELL_KNOCK_BUFF)
{
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
@@ -339,6 +344,5 @@ SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry
{
aOwner = abilityOwner;
abilityId = ability;
- currentBasePoints = 0;
}
diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
index 9e7e809ba66..6deaa769ae5 100644
--- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
CanDoQuest = false;
UnkorUnfriendly_Timer = 0;
Pulverize_Timer = 3000;
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->setFaction(FACTION_HOSTILE);
}
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
{
DoScriptText(SAY_SUBMIT, m_creature);
m_creature->setFaction(FACTION_FRIENDLY);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT);
+ m_creature->SetStandState(UNIT_STAND_STATE_SIT);
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
index 4e81d44a610..4c9c76010ca 100644
--- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
+++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -259,19 +259,17 @@ struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI
DoMeleeAttackIfReady();
}
-};
-bool ReceiveEmote_npc_plucky( Player *player, Creature *_Creature, uint32 emote )
-{
- if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
- player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
+ void ReceiveEmote( Player *player, uint32 emote )
{
- _Creature->SetInFront(player);
- ((npc_pluckyAI*)((Creature*)_Creature)->AI())->TransformHuman(emote);
+ if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
+ player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
+ {
+ m_creature->SetInFront(player);
+ TransformHuman(emote);
+ }
}
-
- return true;
-}
+};
bool GossipHello_npc_plucky(Player *player, Creature *_Creature)
{
@@ -316,7 +314,6 @@ void AddSC_thousand_needles()
newscript = new Script;
newscript->Name = "npc_plucky";
newscript->GetAI = &GetAI_npc_plucky;
- newscript->pReceiveEmote = &ReceiveEmote_npc_plucky;
newscript->pGossipHello = &GossipHello_npc_plucky;
newscript->pGossipSelect = &GossipSelect_npc_plucky;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
index 30312313ee8..8038b7e4c34 100644
--- a/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
+++ b/src/bindings/scripts/scripts/zone/thunder_bluff/thunder_bluff.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
index 7a69eab5153..82f1afbff5d 100644
--- a/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
+++ b/src/bindings/scripts/scripts/zone/tirisfal_glades/tirisfal_glades.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -100,7 +100,7 @@ GameObject* SearchMausoleumGo(Unit *source, uint32 entry, float range)
cell.SetNoCreate();
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*source, entry, range);
- Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(pGo, go_check);
+ Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(source, pGo, go_check);
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer> go_searcher(searcher);
diff --git a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
index 14a788d29e2..030a5937caa 100644
--- a/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
+++ b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,12 +23,11 @@ EndScriptData */
#include "precompiled.h"
-#define SPELL_ARCINGSMASH 39144
-#define SPELL_KNOCKAWAY 22893
-#define SPELL_WSTOMP 16727
+#define SAY_AGGRO -1070000
-#define SAY_AGGRO "None may steal the secrets of the makers!"
-#define SOUND_AGGRO 5851
+#define SPELL_ARCINGSMASH 8374
+#define SPELL_KNOCKAWAY 10101
+#define SPELL_WSTOMP 11876
struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI
{
@@ -47,8 +46,7 @@ struct TRINITY_DLL_DECL boss_ironayaAI : public ScriptedAI
void Aggro(Unit *who)
{
- DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(m_creature,SOUND_AGGRO);
+ DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
diff --git a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp
index 7a5e50805f1..a8a1820f0a4 100644
--- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp
+++ b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
break;
case ANCIENT_VAULT_DOOR:
- go->SetUInt32Value(GAMEOBJECT_STATE,1);
+ go->SetGoState(1);
go->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
ancientVaultDoor = go->GetGUID();
break;
@@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance
return;
go->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
- go->SetUInt32Value(GAMEOBJECT_STATE, 0);
+ go->SetGoState(0);
}
void ActivateStoneKeepers()
diff --git a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
index de5f4889fe4..cf30cdb8824 100644
--- a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
+++ b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp
new file mode 100644
index 00000000000..48ecfdbbcbf
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp
@@ -0,0 +1,94 @@
+/* Script Data Start
+SDName: Boss bjarngrim
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//AURAS AND STANCES
+#define BUFF_BATTLE_AURA 41106
+#define SPELL_BATTLE_STANCE 53792
+#define BUFF_BERSEKER_AURA 41107
+#define SPELL_BERSEKER_STANCE 53791
+#define BUFF_DEFENSIVE_AURA 41105
+#define SPELL_DEFENSIVE_STANCE 53790
+
+//OTHER SPELLS
+#define SPELL_CHARGE_UP 52098
+#define SPELL_CLEAVE 15284
+#define SPELL_INTERCEPT 58769
+#define SPELL_IRONFORM 52022
+#define SPELL_KNOCK_AWAY 52029
+#define SPELL_MORTAL_STRIKE 15708
+#define SPELL_SLAM 52026
+#define SPELL_SPELL_REFLECTION 36096
+#define SPELL_WHIRLWIND 52027
+
+//Yell
+#define SAY_AGGRO -1602000
+#define SAY_SLAY_1 -1602001
+#define SAY_SLAY_2 -1602002
+#define SAY_SLAY_3 -1602003
+#define SAY_DEATH -1602004
+#define SAY_BATTLE_STANCE -1602005
+#define SAY_BERSEKER_STANCE -1602006
+#define SAY_DEFENSIVE_STANCE -1602007
+
+struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI
+{
+ boss_bjarngrimAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 whirlwind;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_bjarngrim(Creature *_Creature)
+{
+ return new boss_bjarngrimAI (_Creature);
+}
+
+void AddSC_boss_bjarngrim()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_bjarngrim";
+ newscript->GetAI = GetAI_boss_bjarngrim;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp
new file mode 100644
index 00000000000..1760c8d0032
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp
@@ -0,0 +1,114 @@
+/* Script Data Start
+SDName: Boss ionar
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_ionar' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_BALL_LIGHTNING 52780
+#define SPELL_BALL_LIGHTNING_2 59800
+#define SPELL_DISPERSE 52770 //Disperse into Sparks of Ionar.
+#define SPELL_STATIC_OVERLOAD 52658 //Effect Apply Aura: Periodic Trigger Interval: 2 seconds Spell 52659
+#define SPELL_STATIC_OVERLOAD_2 52658 //Effect Apply Aura: Periodic Trigger Interval: 2 seconds Spell 59796
+
+//Spark of Ionar spells
+#define NPC_SPARK_OF_IONAR 28962 //invulnerable
+#define SPELL_ARCING_BURN 52617
+#define SPELL_ARCING_BURN_2 59834
+
+//Yell
+#define SAY_AGGRO -1602008
+#define SAY_SLAY_1 -1602009
+#define SAY_SLAY_2 -1602010
+#define SAY_SLAY_3 -1602011
+#define SAY_DEATH -1602012
+#define SAY_SPLIT_1 -1602013
+#define SAY_SPLIT_2 -1602014
+
+//he does "morph" every about 25% into 4 sparks of ionar that chase people around, they r slow and easily avoidable.
+
+struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI
+{
+ boss_ionarAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+struct TRINITY_DLL_DECL npc_spark_of_ionarAI : public ScriptedAI
+{
+ npc_spark_of_ionarAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_npc_spark_of_ionar(Creature *_Creature)
+{
+ return new npc_spark_of_ionarAI (_Creature);
+}
+CreatureAI* GetAI_boss_ionar(Creature *_Creature)
+{
+ return new boss_ionarAI (_Creature);
+}
+
+void AddSC_boss_ionar()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ionar";
+ newscript->GetAI = GetAI_boss_ionar;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="spark_of_ionar";
+ newscript->GetAI = GetAI_npc_spark_of_ionar;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp
new file mode 100644
index 00000000000..e8b991a5172
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp
@@ -0,0 +1,86 @@
+/* Script Data Start
+SDName: Boss loken
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_loken' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARC_NOVA 52921
+//Effect #1 School Damage (Nature), Value: 3238 to 3762
+//Effect #2 Apply Aura: Dummy, Value: 3238 to 3762, Server-side script
+
+#define SPELL_LIGHTNING_NOVA 52960
+#define SPELL_LIGHTNING_NOVA_2 59835
+
+//Yell
+#define SAY_AGGRO -1602015
+#define SAY_INTRO_1 -1602016
+#define SAY_INTRO_2 -1602017
+#define SAY_SLAY_1 -1602018
+#define SAY_SLAY_2 -1602019
+#define SAY_SLAY_3 -1602020
+#define SAY_DEATH -1602021
+#define SAY_NOVA_1 -1602022
+#define SAY_NOVA_2 -1602023
+#define SAY_NOVA_3 -1602024
+#define SAY_75HEALTH -1602025
+#define SAY_50HEALTH -1602026
+#define SAY_25HEALTH -1602027
+
+struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI
+{
+ boss_lokenAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_loken(Creature *_Creature)
+{
+ return new boss_lokenAI (_Creature);
+}
+
+void AddSC_boss_loken()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_loken";
+ newscript->GetAI = GetAI_boss_loken;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp
new file mode 100644
index 00000000000..a613a084f02
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp
@@ -0,0 +1,128 @@
+/* Script Data Start
+SDName: Boss volkhan
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_volkhan' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_HEAT 52387
+#define SPELL_HEAT_2 59528
+#define SPELL_SHATTERING_STOMP 52237
+#define SPELL_SHATTERING_STOMP_2 59529
+#define SPELL_TEMPER 52238 //Dummy ---> Strikes Volkhan's Anvil, creating a number of Molten Golems.
+
+#define NPC_VOLKHANS_ANVIL 28823
+#define MOB_MOLTEN_GOLEM 28695
+
+//Yells
+#define SAY_AGGRO -1602028
+#define SAY_SLAY_1 -1602029
+#define SAY_SLAY_2 -1602030
+#define SAY_SLAY_3 -1602031
+#define SAY_DEATH -1602032
+#define SAY_STOMP_1 -1602033
+#define SAY_STOMP_2 -1602034
+#define SAY_FORGE_1 -1602035
+#define SAY_FORGE_2 -1602036
+
+struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI
+{
+ boss_volkhanAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+/*######
+## Mob Molten Golem
+######*/
+//Molten Golem Spells
+#define SPELL_BLAST_WAVE 23113
+#define SPELL_IMMOLATION_STRIKE 52433
+#define SPELL_IMMOLATION_STRIKE_2 59530
+//Effect #1 Apply Aura: Periodic Damage, value: 900 every 3 seconds
+//Effect #2 School Damage (Fire), value: 900
+//Effect #3 Script Effect
+#define SPELL_SHATTER 52429
+//Effect #1 School Damage (Physical), value: 9250 to 10750, radius: 10 yards
+//Effect #2 Dummy, Server-side script
+#define SPELL_SHATTER_2
+
+struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI
+{
+ mob_molten_golemAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_mob_molten_golem(Creature *_Creature)
+{
+ return new mob_molten_golemAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_volkhan(Creature *_Creature)
+{
+ return new boss_volkhanAI (_Creature);
+}
+
+void AddSC_boss_volkhan()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_volkhan";
+ newscript->GetAI = GetAI_boss_volkhan;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_molten_golem";
+ newscript->GetAI = GetAI_mob_molten_golem;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h
new file mode 100644
index 00000000000..134e32850ae
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h
@@ -0,0 +1,4 @@
+#ifndef DEF_HALLS_OF_LIGHTNING_H
+#define DEF_HALLS_OF_LIGHTNING_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp
new file mode 100644
index 00000000000..4e694df73a5
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_halls_of_lightning.h"
+
+struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance
+{
+ instance_halls_of_lightning(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_halls_of_lightning(Map* map)
+{
+ return new instance_halls_of_lightning(map);
+}
+
+void AddSC_instance_halls_of_lightning()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_halls_of_lightning";
+ newscript->GetInstanceData = GetInstanceData_instance_halls_of_lightning;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp
new file mode 100644
index 00000000000..e58c2f8a2ac
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp
@@ -0,0 +1,73 @@
+/* Script Data Start
+SDName: Boss krystallus
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_krystallus' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_BOULDER_TOSS 50843
+#define SPELL_BOULDER_TOSS_2 59742
+#define SPELL_GROUND_SPIKE 59750
+#define SPELL_SHATTER 50810
+#define SPELL_SHATTER_2 61546
+#define SPELL_STOMP 48131
+#define SPELL_STOMP_2 59744
+
+//Yell
+#define SAY_AGGRO -1599000
+#define SAY_KILL -1599001
+#define SAY_DEATH -1599002
+#define SAY_SHATTER -1599003
+
+struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI
+{
+ boss_krystallusAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_krystallus(Creature *_Creature)
+{
+ return new boss_krystallusAI (_Creature);
+}
+
+void AddSC_boss_krystallus()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_krystallus";
+ newscript->GetAI = GetAI_boss_krystallus;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
new file mode 100644
index 00000000000..f179e8d7a73
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp
@@ -0,0 +1,81 @@
+/* Script Data Start
+SDName: Boss maiden_of_grief
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_maiden_of_grief' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spell
+#define SPELL_PARTING_SORROW 59723
+#define SPELL_STORM_OF_GRIEF 50752
+#define SPELL_STORM_OF_GRIEF_2 59772
+#define SPELL_SHOCK_OF_SORROW 50760
+#define SPELL_SHOCK_OF_SORROW_2 59726
+#define SPELL_PILLAR_OF_WOE 50761
+#define SPELL_PILLAR_OF_WOE_2 59727
+
+//Yell
+#define SAY_AGGRO -1599004
+#define SAY_SLAY_1 -1599005
+#define SAY_SLAY_2 -1599006
+#define SAY_SLAY_3 -1599007
+#define SAY_SLAY_4 -1599008
+#define SAY_DEATH -1599009
+#define SAY_STUN -1599010
+
+struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
+{
+ boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_maiden_of_grief(Creature *_Creature)
+{
+ return new boss_maiden_of_griefAI (_Creature);
+}
+
+void AddSC_boss_maiden_of_grief()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_maiden_of_grief";
+ newscript->GetAI = GetAI_boss_maiden_of_grief;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp
new file mode 100644
index 00000000000..ddb048ee241
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp
@@ -0,0 +1,83 @@
+/* Script Data Start
+SDName: Boss sjonnir
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_sjonnir' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841
+#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841
+#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849
+#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849
+#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835
+#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847
+#define SPELL_CHAIN_LIGHTING_1 50830
+#define SPELL_CHAIN_LIGHTING_2 59844
+#define SPELL_LIGHTING_SHIELD_1 50831
+#define SPELL_LIGHTING_SHIELD_2 59845
+#define SPELL_FRENZY 28747
+
+//Yell
+#define SAY_AGGRO -1599011
+#define SAY_SLAY_1 -1599012
+#define SAY_SLAY_2 -1599013
+#define SAY_SLAY_3 -1599014
+#define SAY_DEATH -1599015
+
+struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
+{
+ boss_sjonnirAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_sjonnir(Creature *_Creature)
+{
+ return new boss_sjonnirAI (_Creature);
+}
+
+void AddSC_boss_sjonnir()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_sjonnir";
+ newscript->GetAI = GetAI_boss_sjonnir;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h
new file mode 100644
index 00000000000..ade934ad921
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h
@@ -0,0 +1,4 @@
+#ifndef DEF_HALLS_OF_STONE_H
+#define DEF_HALLS_OF_STONE_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp
new file mode 100644
index 00000000000..3c7d3970b47
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_halls_of_stone.h"
+
+struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
+{
+ instance_halls_of_stone(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_halls_of_stone(Map* map)
+{
+ return new instance_halls_of_stone(map);
+}
+
+void AddSC_instance_halls_of_stone()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_halls_of_stone";
+ newscript->GetInstanceData = GetInstanceData_instance_halls_of_stone;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
index b46acf1fcc2..3194ebc5439 100644
--- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
+++ b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000);
LamentEvent_Timer = 2000;
- if( !m_creature->HasAura(SPELL_SYLVANAS_CAST, 0))
+ if( !m_creature->HasAura(SPELL_SYLVANAS_CAST))
{
DoScriptText(SAY_LAMENT_END, m_creature);
DoScriptText(EMOTE_LAMENT_END, m_creature);
@@ -175,7 +175,7 @@ struct TRINITY_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI
if( EventMove_Timer < diff )
{
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
- m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,MOVEMENTFLAG_ONTRANSPORT,5000);
+ m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000);
m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation());
EventMove = false;
}else EventMove_Timer -= diff;
@@ -210,7 +210,7 @@ bool GossipHello_npc_parqual_fintallas(Player *player, Creature *_Creature)
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
- if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME,0) )
+ if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME) )
{
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_dalronn.cpp
new file mode 100644
index 00000000000..9512444458b
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_dalronn.cpp
@@ -0,0 +1,97 @@
+/* Script Data Start
+SDName: Boss dalronn
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_dalronn' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_DEBILITATE 43650
+#define SPELL_SHADOWBOLT 43649
+#define SPELL_SHADOWBOLT_2 59575
+#define SPELL_SUMMON_SKELETONS 52611 //Trigger Spell: 52612, summons NPC (28878)
+#define SPELL_SKARVALD_GHOST 48613 //When Skarvald dies
+
+//Yell
+#define SAY_AGGRO -1574005
+#define SAY_KILL -1574006
+#define SAY_DEATH_1 -1574007
+#define SAY_DEATH_2 -1574008
+#define SAY_RAISES -1574009
+
+struct TRINITY_DLL_DECL boss_dalronnAI : public ScriptedAI
+{
+ boss_dalronnAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 killed;
+ uint64 Skarvald;
+
+ void Reset()
+ {
+ Skarvald = 0;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if (Skarvald)
+ {
+ Creature* Skravald_m = (Unit::GetCreature((*m_creature), Skarvald));
+ if (Skravald_m)
+ {
+ if (!Skravald_m->isAlive())
+ {
+ DoCast(Skravald_m,SPELL_SKARVALD_GHOST);
+ DoScriptText(SAY_RAISES, m_creature);
+ }
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ killed++;
+ //On first death resurected instatly by Skarvald as a ghost, having the same abilities as when alive and is unatackable
+ //If Skarvald dies first, Dalron resurects him and says "SAY_RAISES"
+ if(killed ==2)
+ DoScriptText(SAY_DEATH_2,m_creature);
+ else
+ DoScriptText(SAY_DEATH_1,m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_dalronn(Creature *_Creature)
+{
+ return new boss_dalronnAI (_Creature);
+}
+
+void AddSC_boss_dalronn()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_dalronn";
+ newscript->GetAI = GetAI_boss_dalronn;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
new file mode 100644
index 00000000000..22e1b504446
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
@@ -0,0 +1,470 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Ingvar_The_Plunderer
+SD%Complete: 95
+SDComment: Some Problems with Annhylde Movement, Blizzlike Timers
+SDCategory: Udgarde Keep
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_utgarde_keep.h"
+
+//Yells Ingvar
+#define YELL_AGGRO_1 "I'll paint my face with your blood!"
+#define SOUND_AGGRO_1 13207
+#define YELL_AGGRO_2 "I return! A second chance to carve out your skull!"
+#define SOUND_AGGRO_2 13209
+
+#define YELL_DEAD_1 "My life for the... death god!"
+#define SOUND_DEAD_1 13213
+#define YELL_DEAD_2 "No! I can do... better! I can..."
+#define SOUND_DEAD_2 13211
+
+#define YELL_KILL_1 "Mjul orm agn gjor!"
+#define SOUND_KILL_1 13212
+#define YELL_KILL_2 "I am a warriorborn!"
+#define SOUND_KILL_2 13214
+
+//Ingvar Spells human form
+#define MOB_INGVAR_HUMAN 23954
+#define SPELL_CLEAVE 42724
+#define SPELL_SMASH 42669
+#define H_SPELL_SMASH 59706
+#define SPELL_STAGGERING_ROAR 42708
+#define H_SPELL_STAGGERING_ROAR 59708
+#define SPELL_ENRAGE 42705
+#define H_SPELL_ENRAGE 59707
+
+#define MOB_ANNHYLDE_THE_CALLER 24068
+#define SPELL_INGVAR_FEIGN_DEATH 42795
+#define SPELL_SUMMON_BANSHEE 42912
+#define SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN 42863 //Spawn resurrecteffekt around Ingvar
+
+#define MODEL_INGVAR_UNDEAD 26351
+#define MODEL_INGVAR_HUMAN 21953
+
+//Ingvar Spells undead form
+#define MOB_INGVAR_UNDEAD 23980
+#define SPELL_DARK_SMASH 42723
+#define SPELL_DREADFUL_ROAR 42729
+#define H_SPELL_DREADFUL_ROAR 59734
+#define SPELL_WOE_STRIKE 42730
+#define H_SPELL_WOE_STRIKE 59735
+
+#define ENTRY_THROW_TARGET 23996
+#define SPELL_SHADOW_AXE_SUMMON 42749
+
+struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI
+{
+ boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = c->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool HeroicMode;
+ bool undead;
+ bool event_inProgress;
+
+ uint32 Cleave_Timer;
+ uint32 Smash_Timer;
+ uint32 Enrage_Timer;
+ uint32 Roar_Timer;
+ uint32 SpawnResTimer;
+ uint32 wait_Timer;
+
+
+ void Reset()
+ {
+ if(undead) // Visual Hack
+ m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_INGVAR_HUMAN);
+
+ undead = false;
+ event_inProgress = false;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+
+ Cleave_Timer = 2000;
+ Smash_Timer = 5000;
+ Enrage_Timer = 10000;
+ Roar_Timer = 15000;
+
+ SpawnResTimer = 3000;
+
+ wait_Timer = 0;
+
+ if(pInstance)
+ pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED);
+ }
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if( damage >= m_creature->GetHealth() && !undead)
+ {
+ //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ???
+ // visuel hack
+ m_creature->SetHealth(0);
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
+ m_creature->GetMotionMaster()->MovementExpired(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ // visuel hack end
+
+ event_inProgress = true;
+ undead = true;
+
+ DoYell(YELL_DEAD_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEAD_1);
+ }
+
+ if(event_inProgress)
+ {
+ damage = 0;
+ }
+ }
+
+ void StartZombiePhase()
+ {
+ undead = true;
+ event_inProgress = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ m_creature->AI()->AttackStart(m_creature->getVictim());
+
+ DoYell(YELL_AGGRO_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_2);
+ }
+
+ void Aggro(Unit *who)
+ {
+ DoYell(YELL_AGGRO_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_AGGRO_1);
+
+ if(pInstance)
+ pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoYell(YELL_DEAD_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DEAD_2);
+
+ if(pInstance)
+ pInstance->SetData(DATA_INGVAR_EVENT, DONE);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(undead)
+ {
+ DoYell(YELL_KILL_1,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_1);
+ }
+ else
+ {
+ DoYell(YELL_KILL_2,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_KILL_2);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if(event_inProgress)
+ {
+ if(SpawnResTimer)
+ if(SpawnResTimer< diff)
+ {
+ DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position
+ //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ?
+ SpawnResTimer = 0;
+ }else SpawnResTimer -= diff;
+
+ return;
+ }
+
+ // This is used for a spell queue ... the spells should not castet if one spell is already casting
+ if(wait_Timer)
+ if(wait_Timer < diff)
+ {
+ wait_Timer = 0;
+ }else wait_Timer -= diff;
+
+ if(Cleave_Timer < diff)
+ {
+ if(!wait_Timer)
+ {
+ if(undead)
+ DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE);
+ else
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = rand()%5000 + 2000;
+
+ wait_Timer = 1000;
+ }
+ }else Cleave_Timer -= diff;
+
+ if(Smash_Timer < diff)
+ {
+ if(!wait_Timer)
+ {
+ if(undead)
+ DoCast(m_creature->getVictim(), SPELL_DARK_SMASH);
+ else
+ DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH);
+ Smash_Timer = 10000;
+
+ wait_Timer = 5000;
+ }
+ }else Smash_Timer -= diff;
+
+ if(!undead)
+ {
+ if(Enrage_Timer < diff)
+ {
+ DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE);
+ Enrage_Timer = 10000;
+ }else Enrage_Timer -= diff;
+ }else // In Undead form used to summon weapon
+ {
+ if(Enrage_Timer < diff)
+ {
+ if(!wait_Timer)
+ {
+ // Spawn target for Axe
+ Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+ if(target)
+ {
+ Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000);
+
+ DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON);
+ }
+ Enrage_Timer = 30000;
+ }
+ }else Enrage_Timer -= diff;
+ }
+
+
+ if(Roar_Timer < diff)
+ {
+ if(!wait_Timer)
+ {
+ if(undead)
+ DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR);
+ else
+ DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR);
+ Roar_Timer = 10000;
+
+ wait_Timer = 5000;
+ }
+ }else Roar_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature *_Creature)
+{
+ return new boss_ingvar_the_plundererAI (_Creature);
+}
+
+#define YELL_RESSURECT "Ingvar! Your pathetic failure will serve as a warning to all... you are damned! Arise and carry out the master's will!"
+#define SOUND_RESSURECT 13754
+
+//Spells for Annhylde
+#define SPELL_SCOURG_RESURRECTION_HEAL 42704 //Heal Max + DummyAura
+#define SPELL_SCOURG_RESURRECTION_BEAM 42857 //Channeling Beam of Annhylde
+#define SPELL_SCOURG_RESURRECTION_DUMMY 42862 //Some Emote Dummy?
+#define SPELL_INGVAR_TRANSFORM 42796
+
+struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI
+{
+ mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ float x,y,z;
+ ScriptedInstance* pInstance;
+ uint32 Resurect_Timer;
+ uint32 Resurect_Phase;
+
+ void Reset()
+ {
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_FLYING2);
+ m_creature->SetSpeed(MOVE_SWIM , 0.1f);
+ m_creature->SetSpeed(MOVE_RUN , 0.1f);
+ m_creature->SetSpeed(MOVE_WALK , 0.1f);
+ m_creature->SetSpeed(MOVE_FLIGHT , 0.1f);
+
+ m_creature->GetPosition(x,y,z);
+ DoTeleportTo(x+1,y,z+30);
+
+ Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR));
+ if(ingvar)
+ {
+ m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15);
+
+ DoYell(YELL_RESSURECT,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_RESSURECT);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+ Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR));
+ if(ingvar)
+ {
+ switch (id)
+ {
+ case 1:
+ ingvar->RemoveAura(SPELL_SUMMON_BANSHEE);
+ ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true);
+ DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM);
+ Resurect_Timer = 8000;
+ Resurect_Phase = 1;
+ break;
+ case 2:
+ m_creature->DealDamage(m_creature,m_creature->GetHealth());
+ m_creature->RemoveCorpse();
+ break;
+ }
+ }
+ }
+
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void Aggro(Unit *who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if(Resurect_Timer)
+ if(Resurect_Timer < diff)
+ {
+ if(Resurect_Phase == 1)
+ {
+ Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR));
+ if(ingvar)
+ {
+ ingvar->SetStandState(UNIT_STAND_STATE_STAND);
+ ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false);
+ }
+ Resurect_Timer = 3000;
+ Resurect_Phase = 2;
+ }else if (Resurect_Phase == 2)
+ {
+ Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR));
+ if(ingvar)
+ {
+ ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
+ //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false);
+ ingvar->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong
+ Creature* c_ingvar = (Creature*)ingvar;
+
+ ((boss_ingvar_the_plundererAI*)(c_ingvar->AI()))->StartZombiePhase();
+
+ m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30);
+ Resurect_Phase++;
+ }
+ }
+
+ }else Resurect_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_annhylde_the_caller(Creature *_Creature)
+{
+ return new mob_annhylde_the_callerAI (_Creature);
+}
+
+#define SPELL_SHADOW_AXE_DAMAGE 42750
+#define H_SPELL_SHADOW_AXE_DAMAGE 59719
+
+struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI
+{
+ mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = c->GetMap()->IsHeroic();
+ }
+
+ bool HeroicMode;
+ uint32 Despawn_Timer;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ Unit* target = FindCreature(ENTRY_THROW_TARGET,50,m_creature);
+ if(target)
+ {
+ DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE);
+ float x,y,z;
+ target->GetPosition(x,y,z);
+ m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
+ }
+ Despawn_Timer = 7000;
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void Aggro(Unit *who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ if(Despawn_Timer < diff)
+ {
+ m_creature->DealDamage(m_creature,m_creature->GetHealth());
+ m_creature->RemoveCorpse();
+ Despawn_Timer = 0;
+ }else Despawn_Timer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature *_Creature)
+{
+ return new mob_ingvar_throw_dummyAI (_Creature);
+}
+
+void AddSC_boss_ingvar_the_plunderer()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ingvar_the_plunderer";
+ newscript->GetAI = &GetAI_boss_ingvar_the_plunderer;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_annhylde_the_caller";
+ newscript->GetAI = &GetAI_mob_annhylde_the_caller;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_ingvar_throw_dummy";
+ newscript->GetAI = &GetAI_mob_ingvar_throw_dummy;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp
new file mode 100644
index 00000000000..6e99f204666
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Prince_Keleseth
+SD%Complete: 90
+SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells
+SDCategory: Utgarde Keep
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_utgarde_keep.h"
+
+#define SPELL_SHADOWBOLT 43667
+#define SPELL_SHADOWBOLT_HEROIC 59389
+#define SPELL_FROST_TOMB 48400
+#define SPELL_FROST_TOMB_SUMMON 42714
+#define SPELL_DECREPIFY 42702
+#define SPELL_SCOURGE_RESSURRECTION 42704
+#define CREATURE_FROSTTOMB 23965
+#define CREATURE_SKELETON 23970
+
+#define SAY_AGGRO -1574000
+#define SAY_KILL -1574001
+#define SAY_DEATH -1574002
+#define SAY_FROST_TOMB -1574003
+#define SAY_SKELETONS -1574004
+
+#define SKELETONSPAWN_Z 42.8668
+
+float SkeletonSpawnPoint[5][5]=
+{
+ {156.2559, 259.2093},
+ {156.2559, 259.2093},
+ {156.2559, 259.2093},
+ {156.2559, 259.2093},
+ {156.2559, 259.2093},
+};
+
+float AttackLoc[3]={197.636, 194.046, 40.8164};
+
+struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
+{
+ mob_frost_tombAI(Creature *c) : ScriptedAI(c)
+ {
+ FrostTombGUID = 0;
+ }
+
+ uint64 FrostTombGUID;
+
+ void SetPrisoner(Unit* uPrisoner)
+ {
+ FrostTombGUID = uPrisoner->GetGUID();
+ }
+
+ void Reset(){ FrostTombGUID = 0; }
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+
+ void JustDied(Unit *killer)
+ {
+ if(FrostTombGUID)
+ {
+ Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID);
+ if(FrostTomb)
+ FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID);
+ if((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp )
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+};
+
+struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
+{
+ boss_kelesethAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Heroic = c->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 FrostTombTimer;
+ uint32 SummonSkeletonsTimer;
+ uint32 RespawnSkeletonsTimer;
+ uint32 ShadowboltTimer;
+ uint64 SkeletonGUID[5];
+ bool Skeletons;
+ bool Heroic;
+ bool RespawnSkeletons;
+
+ void Reset()
+ {
+ ShadowboltTimer = 0;
+ Skeletons = false;
+
+ ResetTimer();
+
+ if(pInstance)
+ pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+
+ DoScriptText(SAY_KILL, m_creature);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+
+ if(pInstance)
+ pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
+ }
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ DoZoneInCombat();
+
+ if(pInstance)
+ pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
+ }
+
+ void ResetTimer(uint32 inc = 0)
+ {
+ SummonSkeletonsTimer = 5000 + inc;
+ FrostTombTimer = 28000 + inc;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if(ShadowboltTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true);
+ ShadowboltTimer = 10000;
+ }else ShadowboltTimer -= diff;
+
+ if(!Skeletons)
+ if((SummonSkeletonsTimer < diff))
+ {
+ Creature* Skeleton;
+ DoScriptText(SAY_SKELETONS, m_creature);
+ for(uint8 i = 0; i < 5; ++i)
+ {
+ Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ if(Skeleton)
+ {
+ Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ());
+ Skeleton->AddThreat(m_creature->getVictim(), 0.0f);
+ DoZoneInCombat(Skeleton);
+ }
+ }
+ Skeletons = true;
+ }else SummonSkeletonsTimer -= diff;
+
+ if(FrostTombTimer < diff)
+ {
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ //DoCast(target, SPELL_FROST_TOMB_SUMMON, true);
+ Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000);
+ if(Chains)
+ {
+ ((mob_frost_tombAI*)Chains->AI())->SetPrisoner(target);
+ Chains->CastSpell(target, SPELL_FROST_TOMB, true);
+
+ DoScriptText(SAY_FROST_TOMB, m_creature);
+ }
+ }
+ FrostTombTimer = 15000;
+ }else FrostTombTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI
+{
+ mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance *pInstance;
+ uint32 Respawn_Time;
+ uint64 Target_Guid;
+ uint32 Decrepify_Timer;
+
+ bool isDead;
+
+ void Reset()
+ {
+ Respawn_Time = 12000;
+ Decrepify_Timer = 10000 + rand()%20000;
+ isDead = false;
+ }
+
+ void Aggro(Unit *who){}
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(done_by->GetGUID() == m_creature->GetGUID())
+ return;
+
+ if(damage >= m_creature->GetHealth())
+ {
+ PretendToDie();
+ damage = 0;
+ }
+ }
+
+
+ void PretendToDie()
+ {
+ isDead = true;
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->GetMotionMaster()->MovementExpired(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
+ };
+
+ void Resurrect()
+ {
+ isDead = false;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true);
+
+ if(m_creature->getVictim())
+ {
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ m_creature->AI()->AttackStart(m_creature->getVictim());
+ }
+ else
+ m_creature->GetMotionMaster()->Initialize();
+ };
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS)
+ {
+ if(isDead)
+ {
+ if(Respawn_Time < diff)
+ {
+ Resurrect();
+ Respawn_Time = 12000;
+ }else Respawn_Time -= diff;
+ }
+ else
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(Decrepify_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_DECREPIFY);
+ Decrepify_Timer = 30000;
+ }else Decrepify_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ }else
+ {
+ if(m_creature->isAlive())
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+
+ }
+};
+
+CreatureAI* GetAI_mob_frost_tomb(Creature *_Creature)
+{
+ return new mob_frost_tombAI(_Creature);
+}
+
+CreatureAI* GetAI_boss_keleseth(Creature *_Creature)
+{
+ return new boss_kelesethAI (_Creature);
+}
+
+CreatureAI* GetAI_mob_vrykul_skeleton(Creature *_Creature)
+{
+ return new mob_vrykul_skeletonAI (_Creature);
+}
+
+void AddSC_boss_keleseth()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_keleseth";
+ newscript->GetAI = &GetAI_boss_keleseth;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "mob_frost_tomb";
+ newscript->GetAI = &GetAI_mob_frost_tomb;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_vrykul_skeleton";
+ newscript->GetAI = &GetAI_mob_vrykul_skeleton;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald.cpp
new file mode 100644
index 00000000000..1fc9bc1c995
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald.cpp
@@ -0,0 +1,96 @@
+/* Script Data Start
+SDName: Boss skarvald
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_skarvald' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CHARGE 43651 //randomly charges anyone but tank WoWradio video 14s afer aggro, and then every 5s change target
+#define SPELL_ENRAGE 48193
+#define SPELL_STONE_STRIKE 48583
+#define SPELL_DALRON_GHOST 48612 //When Dalron dies
+
+//Yells
+#define SAY_AGGRO -1574010
+#define SAY_KILL -1574011
+#define SAY_DEATH_1 -1574012
+#define SAY_DEATH_2 -1574013
+#define SAY_RAISES -1574014
+
+struct TRINITY_DLL_DECL boss_skarvaldAI : public ScriptedAI
+{
+ boss_skarvaldAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 kiled;
+ uint64 Dalronn;
+
+ void Reset()
+ {
+ Dalronn = 0;
+ }
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ if (Dalronn)
+ {
+ Creature* Dalronn_m = (Unit::GetCreature((*m_creature), Dalronn));
+ if (Dalronn_m)
+ {
+ if (!Dalronn_m->isAlive())
+ {
+ DoCast(Dalronn_m,SPELL_DALRON_GHOST);
+ DoScriptText(SAY_RAISES, m_creature);
+ }
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ kiled++;
+ //On first death resurected instatly by Dalron as a ghost, having the same abilities as when alive and is unatackable
+ //If Dalron dies first, Skarvald resurects him and says "SAY_RAISES"
+ if(kiled ==2)
+ DoScriptText(SAY_DEATH_2,m_creature);
+ else
+ DoScriptText(SAY_DEATH_1,m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ DoScriptText(SAY_KILL, m_creature);
+ }
+};
+
+CreatureAI* GetAI_boss_skarvald(Creature *_Creature)
+{
+ return new boss_skarvaldAI (_Creature);
+}
+
+void AddSC_boss_skarvald()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_skarvald";
+ newscript->GetAI = GetAI_boss_skarvald;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
new file mode 100644
index 00000000000..78bc29a770d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp
@@ -0,0 +1,408 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Boss_Skarvald_Dalronn
+SD%Complete: 95
+SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB
+SDCategory: Utgarde Keep
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_utgarde_keep.h"
+
+#define YELL_SKARVALD_AGGRO "Dalronn! See if you can muster the nerve to join my attack!"
+#define SOUND_SKARVALD_AGGRO 13229
+#define YELL_DALRONN_AGGRO "By all means, don't assess the situation, you halfwit! Just jump into the fray!"
+#define SOUND_DALRONN_AGGRO 13199
+
+#define YELL_SKARVALD_KILL "Jarggn olkt!"
+#define SOUND_SKARVALD_KILL 13232
+#define YELL_DALRONN_KILL "You may serve me yet."
+#define SOUND_DALRONN_KILL 13202
+
+#define YELL_DALRONN_DAL_DIEDFIRST "See... you... soon."
+#define SOUND_DALRONN_DAL_DIEDFIRST 13200
+#define YELL_SKARVALD_DAL_DIEDFIRST "Pagh! What sort of necromancer lets death stop him? I knew you were worthless!"
+#define SOUND_SKARVALD_DAL_DIEDFIRST 13233
+#define YELL_SKARVALD_DAL_DIED "A warrior's death."
+#define SOUND_SKARVALD_DAL_DIED 13231
+
+#define YELL_SKARVALD_SKA_DIEDFIRST "Not... over... yet."
+#define SOUND_SKARVALD_SKA_DIEDFIRST 13230
+#define YELL_DALRONN_SKA_DIEDFIRST "Skarvald, you incompetent slug! Return and make yourself useful!"
+#define SOUND_DALRONN_SKA_DIEDFIRST 13203
+#define YELL_DALRONN_SKA_DIED "There's no... greater... glory."
+#define SOUND_DALRONN_SKA_DIED 13201
+
+//Spells of Skarvald and his Ghost
+#define MOB_SKARVALD_THE_CONSTRUCTOR 24200
+#define SPELL_CHARGE 43651
+#define SPELL_STONE_STRIKE 48583
+#define SPELL_SUMMON_SKARVALD_GHOST 48613
+#define MOB_SKARVALD_GHOST 27390
+//Spells of Dalronn and his Ghost
+#define MOB_DALRONN_THE_CONTROLLER 24201
+#define SPELL_SHADOW_BOLT 43649
+#define H_SPELL_SHADOW_BOLT 59575
+#define H_SPELL_SUMMON_SKELETONS 52611
+#define SPELL_DEBILITATE 43650
+#define SPELL_SUMMON_DALRONN_GHOST 48612
+#define MOB_DALRONN_GHOST 27389
+
+struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI
+{
+ boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool ghost;
+ bool HeroicMode;
+ uint32 Charge_Timer;
+ uint32 StoneStrike_Timer;
+ uint32 Response_Timer;
+ uint32 Check_Timer;
+ bool Dalronn_isDead;
+
+ void Reset()
+ {
+ Charge_Timer = 5000;
+ StoneStrike_Timer = 10000;
+ Dalronn_isDead = false;
+ Check_Timer = 5000;
+
+ ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST);
+ if(!ghost)
+ {
+ Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ if(dalronn && dalronn->isDead())
+ ((Creature*)dalronn)->Respawn();
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(!ghost)
+ {
+ DoYell(YELL_SKARVALD_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARVALD_AGGRO);
+
+ Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ if(dalronn && dalronn->isAlive() && !dalronn->getVictim())
+ dalronn->getThreatManager().addThreat(who,0.0f);
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS);
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(!ghost)
+ {
+ Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ if(dalronn)
+ {
+ if(dalronn->isDead())
+ {
+ DoYell(YELL_SKARVALD_DAL_DIED,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARVALD_DAL_DIED);
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
+ }
+ else
+ {
+ DoYell(YELL_SKARVALD_SKA_DIEDFIRST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARVALD_SKA_DIEDFIRST);
+
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true);
+ Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
+ temp->AI()->AttackStart(Killer);
+ }
+ }
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(!ghost)
+ {
+ DoYell(YELL_SKARVALD_KILL,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARVALD_KILL);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(ghost)
+ {
+ if(pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ if(!UpdateVictim())
+ return;
+
+ if(!ghost)
+ {
+ if(Check_Timer)
+ if(Check_Timer < diff)
+ {
+ Check_Timer = 5000;
+ Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
+ if(dalronn && dalronn->isDead())
+ {
+ Dalronn_isDead = true;
+ Response_Timer = 2000;
+ Check_Timer = 0;
+ }
+ }else Check_Timer -= diff;
+
+ if(Response_Timer)
+ if(Dalronn_isDead)
+ if(Response_Timer < diff)
+ {
+ DoYell(YELL_SKARVALD_DAL_DIEDFIRST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_SKARVALD_DAL_DIEDFIRST);
+
+ Response_Timer = 0;
+ }else Response_Timer -= diff;
+ }
+
+ if(Charge_Timer < diff)
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE);
+ Charge_Timer = 5000+rand()%5000;
+ }else Charge_Timer -= diff;
+
+ if(StoneStrike_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE);
+ StoneStrike_Timer = 5000+rand()%5000;
+ }else StoneStrike_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_skarvald_the_constructor(Creature *_Creature)
+{
+ return new boss_skarvald_the_constructorAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI
+{
+ boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
+
+ bool ghost;
+ bool HeroicMode;
+ uint32 ShadowBolt_Timer;
+ uint32 Debilitate_Timer;
+ uint32 Summon_Timer;
+
+ uint32 Response_Timer;
+ uint32 Check_Timer;
+ uint32 AggroYell_Timer;
+ bool Skarvald_isDead;
+
+
+ void Reset()
+ {
+ ShadowBolt_Timer = 1000;
+ Debilitate_Timer = 5000;
+ Summon_Timer = 10000;
+ Check_Timer = 5000;
+ Skarvald_isDead = false;
+ AggroYell_Timer = 0;
+
+ ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST;
+ if(!ghost)
+ {
+ Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ if(skarvald && skarvald->isDead())
+ ((Creature*)skarvald)->Respawn();
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
+ }
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(!ghost)
+ {
+ Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ if(skarvald && skarvald->isAlive() && !skarvald->getVictim())
+ skarvald->getThreatManager().addThreat(who,0.0f);
+
+ AggroYell_Timer = 5000;
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS);
+ }
+ }
+
+ void JustDied(Unit* Killer)
+ {
+ if(!ghost)
+ {
+ Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ if(skarvald)
+ if(skarvald->isDead())
+ {
+ DoYell(YELL_DALRONN_SKA_DIED,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DALRONN_SKA_DIED);
+
+ if(pInstance)
+ pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
+ }
+ else
+ {
+ DoYell(YELL_DALRONN_DAL_DIEDFIRST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DALRONN_DAL_DIEDFIRST);
+
+ m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true);
+ Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
+ temp->AI()->AttackStart(Killer);
+ }
+ }
+ }
+
+ void KilledUnit(Unit *victim)
+ {
+ if(!ghost)
+ {
+ DoYell(YELL_DALRONN_KILL,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DALRONN_KILL);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(ghost)
+ {
+ if(pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS)
+ {
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+
+ if(!UpdateVictim())
+ return;
+
+ if(AggroYell_Timer)
+ if(AggroYell_Timer < diff)
+ {
+ DoYell(YELL_DALRONN_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DALRONN_AGGRO);
+
+ AggroYell_Timer = 0;
+ }else AggroYell_Timer -= diff;
+
+ if(!ghost)
+ {
+ if(Check_Timer)
+ if(Check_Timer < diff)
+ {
+ Check_Timer = 5000;
+ Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
+ if(skarvald && skarvald->isDead())
+ {
+ Skarvald_isDead = true;
+ Response_Timer = 2000;
+ Check_Timer = 0;
+ }
+ }else Check_Timer -= diff;
+
+ if(Response_Timer)
+ if(Skarvald_isDead)
+ if(Response_Timer < diff)
+ {
+ DoYell(YELL_DALRONN_SKA_DIEDFIRST,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(m_creature,SOUND_DALRONN_SKA_DIEDFIRST);
+
+ Response_Timer = 0;
+ }else Response_Timer -= diff;
+ }
+
+ if(ShadowBolt_Timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT);
+ ShadowBolt_Timer = 1000;
+ }
+ }else ShadowBolt_Timer -= diff;
+
+ if(Debilitate_Timer < diff)
+ {
+ if (!m_creature->IsNonMeleeSpellCasted(false))
+ {
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE);
+ Debilitate_Timer = 5000+rand()%5000;
+ }
+ }else Debilitate_Timer -= diff;
+
+ if(HeroicMode)
+ if(Summon_Timer < diff)
+ {
+ DoCast(m_creature,H_SPELL_SUMMON_SKELETONS);
+ Summon_Timer = (rand()%10000) + 20000;
+ }else Summon_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_dalronn_the_controller(Creature *_Creature)
+{
+ return new boss_dalronn_the_controllerAI (_Creature);
+}
+
+void AddSC_boss_skarvald_dalronn()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_skarvald_the_constructor";
+ newscript->GetAI = &GetAI_boss_skarvald_the_constructor;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="boss_dalronn_the_controller";
+ newscript->GetAI = &GetAI_boss_dalronn_the_controller;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h
new file mode 100644
index 00000000000..ec416e5729a
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DEF_UTGARDE_KEEP_H
+#define DEF_UTGARDE_KEEP_H
+
+#define DATA_PRINCEKELESETH 1
+#define DATA_SKARVALD 3
+#define DATA_DALRONN 4
+#define DATA_INGVAR 6
+
+#define DATA_PRINCEKELESETH_EVENT 2
+#define DATA_SKARVALD_DALRONN_EVENT 5
+#define DATA_INGVAR_EVENT 7
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp
new file mode 100644
index 00000000000..e0e243cbed9
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Instance_Utgarde_Keep
+SD%Complete: 90
+SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts
+SDCategory: Utgarde Keep
+EndScriptData */
+
+#include "precompiled.h"
+#include "def_utgarde_keep.h"
+
+#define ENCOUNTERS 3
+
+/* Utgarde Keep encounters:
+0 - Prince Keleseth
+1 - Skarvald Dalronn
+2 - Ingvar the Plunderer
+*/
+
+struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
+{
+ instance_utgarde_keep(Map *Map) : ScriptedInstance(Map) {Initialize();};
+
+ uint64 Keleseth;
+ uint64 Skarvald;
+ uint64 Dalronn;
+ uint64 Ingvar;
+
+ uint32 Encounters[ENCOUNTERS];
+ std::string str_data;
+
+ void Initialize()
+ {
+ Keleseth = 0;
+ Skarvald = 0;
+ Dalronn =0;
+ Ingvar =0;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ Encounters[i] = NOT_STARTED;
+ }
+
+ bool IsEncounterInProgress() const
+ {
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if(Encounters[i] == IN_PROGRESS) return true;
+
+ return false;
+ }
+
+ Player* GetPlayerInMap()
+ {
+ Map::PlayerList const& players = instance->GetPlayers();
+
+ if (!players.isEmpty())
+ {
+ for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
+ {
+ if (Player* plr = itr->getSource())
+ return plr;
+ }
+ }
+
+ debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
+ return NULL;
+ }
+
+ void HandleGameObject(uint64 guid, uint32 state)
+ {
+ Player *player = GetPlayerInMap();
+
+ if (!player || !guid)
+ {
+ debug_log("TSCR: Utgarde Keep: HandleGameObject fail");
+ return;
+ }
+
+ if (GameObject *go = GameObject::GetGameObject(*player,guid))
+ go->SetGoState(state);
+ }
+
+ void OnCreatureCreate(Creature *creature, uint32 creature_entry)
+ {
+ switch(creature_entry)
+ {
+ case 23953: Keleseth = creature->GetGUID(); break;
+ case 24201: Dalronn = creature->GetGUID(); break;
+ case 24200: Skarvald = creature->GetGUID(); break;
+ case 23954: Ingvar = creature->GetGUID(); break;
+ }
+ }
+
+ void OnObjectCreate(GameObject* go)
+ {
+ //switch(go->GetEntry())
+ //{
+ //door and object id
+ //}
+ }
+
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ case DATA_PRINCEKELESETH: return Keleseth;
+ case DATA_DALRONN: return Dalronn;
+ case DATA_SKARVALD: return Skarvald;
+ case DATA_INGVAR: return Ingvar;
+ }
+
+ return 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_PRINCEKELESETH_EVENT:
+ if(data == DONE)
+ {
+ //HandleGameObject(doorname, 0);
+ }
+ Encounters[0] = data;break;
+ case DATA_SKARVALD_DALRONN_EVENT:
+ if(data == DONE)
+ {
+ //HandleGameObject(doorname, 0);
+ }
+ Encounters[1] = data; break;
+ case DATA_INGVAR_EVENT:
+ if(data == DONE)
+ {
+ //HandleGameObject(doorname, 0);
+ }
+ Encounters[2] = data; break;
+ }
+
+ if (data == DONE)
+ {
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_PRINCEKELESETH_EVENT: return Encounters[0];
+ case DATA_SKARVALD_DALRONN_EVENT: return Encounters[1];
+ case DATA_INGVAR_EVENT: return Encounters[2];
+ }
+
+ return 0;
+ }
+
+ const char* Save()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << "U K " << Encounters[0] << " " << Encounters[1] << " "
+ << Encounters[2];
+
+ str_data = saveStream.str();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return str_data.c_str();
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0,data1,data2;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
+
+ if( dataHead1 == 'U' && dataHead2 == 'K')
+ {
+ Encounters[0] = data0;
+ Encounters[1] = data1;
+ Encounters[2] = data2;
+
+ for(uint8 i = 0; i < ENCOUNTERS; ++i)
+ if (Encounters[i] == IN_PROGRESS)
+ Encounters[i] = NOT_STARTED;
+
+ }else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_utgarde_keep(Map* map)
+{
+ return new instance_utgarde_keep(map);
+}
+
+void AddSC_instance_utgarde_keep()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_utgarde_keep";
+ newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
new file mode 100644
index 00000000000..d2351f1f458
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp
@@ -0,0 +1,78 @@
+/* Script Data Start
+SDName: Boss palehoof
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_palehoof' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCING_SMASH 48260
+#define SPELL_IMPALE 48261
+#define SPELL_WITHERING_ROAR 48256
+
+//Yell
+#define SAY_AGGRO -1575000
+#define SAY_SLAY_1 -1575001
+#define SAY_SLAY_2 -1575002
+#define SAY_DEATH -1575003
+
+struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI
+{
+ boss_palehoofAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if (victim == m_creature)
+ return;
+
+ switch(rand()%2)
+ {
+ case 0:
+ DoScriptText(SAY_SLAY_1, m_creature);
+ break;
+ case 1:
+ DoScriptText(SAY_SLAY_2, m_creature);
+ break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_palehoof(Creature *_Creature)
+{
+ return new boss_palehoofAI (_Creature);
+}
+
+void AddSC_boss_palehoof()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_palehoof";
+ newscript->GetAI = GetAI_boss_palehoof;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
new file mode 100644
index 00000000000..e08f249b036
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp
@@ -0,0 +1,89 @@
+/* Script Data Start
+SDName: Boss skadi
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_skadi' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons
+//Phase 1 Kill the Skadi drake mount with harppons launcher
+//Phase 2 Kill the Skadi
+
+//Skadi Spells
+#define SPELL_CRUSH 50234
+#define SPELL_POISONED_SPEAR 50225
+#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s
+
+//Yell
+#define SAY_AGGRO -1575004
+#define SAY_KILL_1 -1575005
+#define SAY_KILL_2 -1575006
+#define SAY_KILL_3 -1575007
+#define SAY_DEATH -1575008
+#define SAY_DRAKE_DEATH -1575009
+#define SAY_DRAKE_HIT_1 -1575010
+#define SAY_DRAKE_HIT_2 -1575011
+#define SAY_DRAKE_BREATH_1 -1575012
+#define SAY_DRAKE_BREATH_2 -1575013
+#define SAY_DRAKE_BREATH_3 -1575014
+
+struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI
+{
+ boss_skadiAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 phase;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ phase = 0;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_KILL_1, m_creature);break;
+ case 1: DoScriptText(SAY_KILL_2, m_creature);break;
+ case 2: DoScriptText(SAY_KILL_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_skadi(Creature *_Creature)
+{
+ return new boss_skadiAI (_Creature);
+}
+
+void AddSC_boss_skadi()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_skadi";
+ newscript->GetAI = GetAI_boss_skadi;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
new file mode 100644
index 00000000000..30064208cc3
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp
@@ -0,0 +1,83 @@
+/* Script Data Start
+SDName: Boss svala
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_svala' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CALL_FLAMES 48258
+#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy
+#define SPELL_SINSTER_STRIKE 15667
+
+//Yells
+#define SAY_DIALOG_WITH_ARTHAS_1 -1575015
+#define SAY_DIALOG_WITH_ARTHAS_2 -1575016
+#define SAY_DIALOG_WITH_ARTHAS_3 -1575017
+#define SAY_AGGRO -1575018
+#define SAY_SLAY_1 -1575019
+#define SAY_SLAY_2 -1575020
+#define SAY_SLAY_3 -1575021
+#define SAY_DEATH -1575022
+#define SAY_SACRIFICE_PLAYER_1 -1575023
+#define SAY_SACRIFICE_PLAYER_2 -1575024
+#define SAY_SACRIFICE_PLAYER_3 -1575025
+#define SAY_SACRIFICE_PLAYER_4 -1575026
+#define SAY_SACRIFICE_PLAYER_5 -1575027
+
+struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI
+{
+ boss_svalaAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_svala(Creature *_Creature)
+{
+ return new boss_svalaAI (_Creature);
+}
+
+void AddSC_boss_svala()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_svala";
+ newscript->GetAI = GetAI_boss_svala;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
new file mode 100644
index 00000000000..527a18d9af4
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp
@@ -0,0 +1,85 @@
+/* Script Data Start
+SDName: Boss ymiron
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = 'boss_ymiron' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_BANE 48294
+#define SPELL_DARK_SLASH 48292
+#define SPELL_FETID_ROT 48291
+#define SPELL_SCREAMS_OF_THE_DEAD 51750
+#define SPELL_SPIRIT_BURST 48529
+#define SPELL_SPIRIT_STRIKE 48423
+//every 20% stuns the party and runs to a boat
+
+//Yell
+#define SAY_AGGRO -1575028
+#define SAY_SLAY_1 -1575029
+#define SAY_SLAY_2 -1575030
+#define SAY_SLAY_3 -1575031
+#define SAY_SLAY_4 -1575032
+#define SAY_DEATH -1575033
+#define SAY_SUMMON_BJORN -1575034
+#define SAY_SUMMON_HALDOR -1575035
+#define SAY_SUMMON_RANULF -1575036
+#define SAY_SUMMON_TORGYN -1575037
+
+struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI
+{
+ boss_ymironAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%4)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ case 3: DoScriptText(SAY_SLAY_4, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_ymiron(Creature *_Creature)
+{
+ return new boss_ymironAI (_Creature);
+}
+
+void AddSC_boss_ymiron()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ymiron";
+ newscript->GetAI = GetAI_boss_ymiron;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h
new file mode 100644
index 00000000000..82e2173fab5
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h
@@ -0,0 +1,4 @@
+#ifndef DEF_PINNACLE_H
+#define DEF_PINNACLE_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp
new file mode 100644
index 00000000000..0772aee0647
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_pinnacle.h"
+
+struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance
+{
+ instance_pinnacle(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_pinnacle(Map* map)
+{
+ return new instance_pinnacle(map);
+}
+
+void AddSC_instance_pinnacle()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_pinnacle";
+ newscript->GetInstanceData = GetInstanceData_instance_pinnacle;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp
new file mode 100644
index 00000000000..9eb629f2f5f
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp
@@ -0,0 +1,93 @@
+/* Script Data Start
+SDName: Boss archavon
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells Archavon
+#define SPELL_ROCK_SHARDS 60883 //Instant -- Hurls a jagged rock shard, inflicting 707 to 793 Physical damage to any enemies within 5 of the target.
+#define SPELL_CRUSHING_LEAP 60895 //Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris.
+#define SPELL_CHOKING_CLOUD 61672 //Leaving behind CRUSHING_LEAP --> Slams into the ground, kicking up an asphyxiating cloud of debris, inflicting 2828 to 3172 Nature damage per second to all enemies caught within and reducing their chance to hit by 50%.
+//#define SPELL_STOMP //48131 or 55292 or 60880
+#define SPELL_IMPALE 60882 //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec.
+
+//Spells Archavon Warders
+#define SPELL_ROCK_SHOWER_N 60919
+#define SPELL_ROCK_SHOWER_H 60923
+#define SPELL_SHIELD_CRUSH_N 60897
+#define SPELL_SHIELD_CRUSH_H 60899
+#define SPELL_WHIRL_N 60902
+#define SPELL_WHIRL_H 60916
+
+//4 Warders spawned
+#define ARCHAVON_WARDER 32353 //npc 32353
+
+//Yell
+#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target
+
+struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI
+{
+ boss_archavonAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+/*######
+## Mob Archavon Warder
+######*/
+struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353
+{
+ mob_warderAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_warder(Creature *_Creature)
+{
+ return new mob_warderAI (_Creature);
+}
+
+CreatureAI* GetAI_boss_archavon(Creature *_Creature)
+{
+ return new boss_archavonAI (_Creature);
+}
+
+void AddSC_boss_archavon()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_archavon";
+ newscript->GetAI = GetAI_boss_archavon;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_archavon_warder";
+ newscript->GetAI = GetAI_mob_warder;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h
new file mode 100644
index 00000000000..f46ba447945
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h
@@ -0,0 +1,4 @@
+#ifndef DEF_ARCHAVON_H
+#define DEF_ARCHAVON_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp
new file mode 100644
index 00000000000..94ee36212ec
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_vault_of_archavon.h"
+
+struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance
+{
+ instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_archavon(Map* map)
+{
+ return new instance_archavon(map);
+}
+
+void AddSC_instance_archavon()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_archavon";
+ newscript->GetInstanceData = GetInstanceData_instance_archavon;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp
new file mode 100644
index 00000000000..cf6833d94bb
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp
@@ -0,0 +1,82 @@
+/* Script Data Start
+SDName: Boss cyanigosa
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCANE_VACUM 58694
+#define SPELL_BLIZZARD 58693
+#define SPELL_MANA_DESTRUCTION 59374
+#define SPELL_TAIL_SWEEP 58690
+#define SPELL_UNCONTROLLABLE_ENERGY 58688
+
+//Yells
+#define SAY_AGGRO -1608000
+#define SAY_SLAY_1 -1608001
+#define SAY_SLAY_2 -1608002
+#define SAY_SLAY_3 -1608003
+#define SAY_DEATH -1608004
+#define SAY_SPAWN -1608005
+#define SAY_DISRUPTION -1608006
+#define SAY_BREATH_ATTACK -1608007
+#define SAY_SPECIAL_ATTACK_1 -1608008
+#define SAY_SPECIAL_ATTACK_2 -1608009
+
+struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI
+{
+ boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_cyanigosa(Creature *_Creature)
+{
+ return new boss_cyanigosaAI (_Creature);
+}
+
+void AddSC_boss_cyanigosa()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_cyanigosa";
+ newscript->GetAI = GetAI_boss_cyanigosa;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp
new file mode 100644
index 00000000000..c74b3e28b6f
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp
@@ -0,0 +1,82 @@
+/* Script Data Start
+SDName: Boss erekem
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_BLOODLUST 54516
+#define SPELL_BREAK_BONDS 59463
+#define SPELL_CHAIN_HEAL 54481
+#define SPELL_EARTH_SHIELD 54479
+#define SPELL_EARTH_SHOCK 54511
+#define SPELL_LIGHTNING_BOLT 53044
+#define SPELL_STORMSTRIKE 51876
+
+//Yells
+#define SAY_AGGRO -1608010
+#define SAY_SLAY_1 -1608011
+#define SAY_SLAY_2 -1608012
+#define SAY_SLAY_3 -1608013
+#define SAY_DEATH -1608014
+#define SAY_SPAWN -1608015
+#define SAY_ADD_KILED -1608016
+#define SAY_BOTH_ADDS_KILED -1608017
+
+struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
+{
+ boss_erekemAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_erekem(Creature *_Creature)
+{
+ return new boss_erekemAI (_Creature);
+}
+
+void AddSC_boss_erekem()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_erekem";
+ newscript->GetAI = GetAI_boss_erekem;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp
new file mode 100644
index 00000000000..871eba33c32
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp
@@ -0,0 +1,81 @@
+/* Script Data Start
+SDName: Boss ichoron
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_DRAINED 59820
+#define SPELL_FRENZY 54312
+#define SPELL_PROTECTIVE_BUBBLE 54306
+#define SPELL_WATER_BLAST 54237
+#define SPELL_WATER_BOLT_VOLLEY 54241
+
+//Yells
+#define SAY_AGGRO -1608018
+#define SAY_SLAY_1 -1608019
+#define SAY_SLAY_2 -1608020
+#define SAY_SLAY_3 -1608021
+#define SAY_DEATH -1608022
+#define SAY_SPAWN -1608023
+#define SAY_ENRAGE -1608024
+#define SAY_SHATTER -1608025
+#define SAY_BUBBLE -1608026
+
+struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI
+{
+ boss_ichoronAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_ichoron(Creature *_Creature)
+{
+ return new boss_ichoronAI (_Creature);
+}
+
+void AddSC_boss_ichoron()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_ichoron";
+ newscript->GetAI = GetAI_boss_ichoron;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp
new file mode 100644
index 00000000000..2f88a6f2e30
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp
@@ -0,0 +1,52 @@
+/* Script Data Start
+SDName: Boss lavanthor
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CAUTERIZING_FLAMES 59466
+#define SPELL_FIREBOLT 54235
+#define SPELL_FLAME_BREATH 54282
+#define SPELL_LAVA_BURN 54249
+
+struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI
+{
+ boss_lavanthorAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_lavanthor(Creature *_Creature)
+{
+ return new boss_lavanthorAI (_Creature);
+}
+
+void AddSC_boss_lavanthor()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_lavanthor";
+ newscript->GetAI = GetAI_boss_lavanthor;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp
new file mode 100644
index 00000000000..72be8a72632
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp
@@ -0,0 +1,50 @@
+/* Script Data Start
+SDName: Boss moragg
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_CORROSICE_SALIVA 54527
+#define SPELL_OPTIC_LINK 54396
+
+struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI
+{
+ boss_moraggAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who) {}
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer) {}
+};
+
+CreatureAI* GetAI_boss_moragg(Creature *_Creature)
+{
+ return new boss_moraggAI (_Creature);
+}
+
+void AddSC_boss_moragg()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_moragg";
+ newscript->GetAI = GetAI_boss_moragg;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp
new file mode 100644
index 00000000000..e8653018cc9
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp
@@ -0,0 +1,82 @@
+/* Script Data Start
+SDName: Boss xevozz
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_ARCANE_BARRAGE_VOLLEY 54202
+#define SPELL_ARCANE_BUFFET 54226
+#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102
+#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137
+#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138
+
+//Yells
+#define SAY_AGGRO -1608027
+#define SAY_SLAY_1 -1608028
+#define SAY_SLAY_2 -1608029
+#define SAY_SLAY_3 -1608030
+#define SAY_DEATH -1608031
+#define SAY_SPAWN -1608032
+#define SAY_CHARGED -1608033
+#define SAY_REPEAT_SUMMON_1 -1608034
+#define SAY_REPEAT_SUMMON_2 -1608035
+#define SAY_SUMMON_ENERGY -1608036
+
+struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI
+{
+ boss_xevozzAI(Creature *c) : ScriptedAI(c) {}
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_xevozz(Creature *_Creature)
+{
+ return new boss_xevozzAI (_Creature);
+}
+
+void AddSC_boss_xevozz()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_xevozz";
+ newscript->GetAI = GetAI_boss_xevozz;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp
new file mode 100644
index 00000000000..e14c3ba672d
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp
@@ -0,0 +1,82 @@
+/* Script Data Start
+SDName: Boss zuramat
+SDAuthor: LordVanMartin
+SD%Complete:
+SDComment:
+SDCategory:
+Script Data End */
+
+/*** SQL START ***
+update creature_template set scriptname = '' where entry = '';
+*** SQL END ***/
+#include "precompiled.h"
+
+//Spells
+#define SPELL_SHROUD_OF_DARKNESS 54524
+#define SPELL_SUMMON_VOID_SENTRY 54524
+#define SPELL_VOID_SHIFT 54524
+
+#define NPC_VOID_SENTRY 29364
+
+//Yells
+#define SAY_AGGRO -1608037
+#define SAY_SLAY_1 -1608038
+#define SAY_SLAY_2 -1608039
+#define SAY_SLAY_3 -1608040
+#define SAY_DEATH -1608041
+#define SAY_SPAWN -1608042
+#define SAY_SHIELD -1608043
+#define SAY_WHISPER -1608044
+
+struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI
+{
+ boss_zuramatAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 void_shift;
+
+ void Reset() {}
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }
+ void AttackStart(Unit* who) {}
+ void MoveInLineOfSight(Unit* who) {}
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if(!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_DEATH, m_creature);
+ }
+ void KilledUnit(Unit *victim)
+ {
+ if(victim == m_creature)
+ return;
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }
+ }
+};
+
+CreatureAI* GetAI_boss_zuramat(Creature *_Creature)
+{
+ return new boss_zuramatAI (_Creature);
+}
+
+void AddSC_boss_zuramat()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name="boss_zuramat";
+ newscript->GetAI = GetAI_boss_zuramat;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h
new file mode 100644
index 00000000000..71bc0d18d2f
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h
@@ -0,0 +1,4 @@
+#ifndef DEF_VIOLET_HOLD_H
+#define DEF_VIOLET_HOLD_H
+
+#endif
diff --git a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp
new file mode 100644
index 00000000000..5d6ba3a5be3
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp
@@ -0,0 +1,21 @@
+#include "precompiled.h"
+#include "def_violet_hold.h"
+
+struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
+{
+ instance_violet_hold(Map *Map) : ScriptedInstance(Map) {Initialize();};
+};
+
+InstanceData* GetInstanceData_instance_violet_hold(Map* map)
+{
+ return new instance_violet_hold(map);
+}
+
+void AddSC_instance_violet_hold()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_violet_hold";
+ newscript->GetInstanceData = GetInstanceData_instance_violet_hold;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
index 9aaa32725c1..5327bf7041d 100644
--- a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
+++ b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
index 3019331ea05..70033f7c97b 100644
--- a/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
+++ b/src/bindings/scripts/scripts/zone/western_plaguelands/western_plaguelands.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
index 749296167fe..9f981d4a35c 100644
--- a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
+++ b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -38,7 +38,10 @@ EndContentData */
struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
{
- npc_defias_traitorAI(Creature *c) : npc_escortAI(c) {}
+ npc_defias_traitorAI(Creature *c) : npc_escortAI(c)
+ {
+ IsWalking = false;
+ }
bool IsWalking;
@@ -114,55 +117,11 @@ bool QuestAccept_npc_defias_traitor(Player* player, Creature* creature, Quest co
return true;
}
-CreatureAI* GetAI_npc_defias_traitor(Creature *_Creature)
+CreatureAI* GetAI_npc_defias_traitor(Creature* pCreature)
{
- npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(_Creature);
-
- thisAI->AddWaypoint(0, -10508.40, 1068.00, 55.21);
- thisAI->AddWaypoint(1, -10518.30, 1074.84, 53.96);
- thisAI->AddWaypoint(2, -10534.82, 1081.92, 49.88);
- thisAI->AddWaypoint(3, -10546.51, 1084.88, 50.13);
- thisAI->AddWaypoint(4, -10555.29, 1084.45, 45.75);
- thisAI->AddWaypoint(5, -10566.57, 1083.53, 42.10);
- thisAI->AddWaypoint(6, -10575.83, 1082.34, 39.46);
- thisAI->AddWaypoint(7, -10585.67, 1081.08, 37.77);
- thisAI->AddWaypoint(8, -10600.08, 1078.19, 36.23);
- thisAI->AddWaypoint(9, -10608.69, 1076.08, 35.88);
- thisAI->AddWaypoint(10, -10621.26, 1073.00, 35.40);
- thisAI->AddWaypoint(11, -10638.12, 1060.18, 33.61);
- thisAI->AddWaypoint(12, -10655.87, 1038.99, 33.48);
- thisAI->AddWaypoint(13, -10664.68, 1030.54, 32.70);
- thisAI->AddWaypoint(14, -10708.68, 1033.86, 33.32);
- thisAI->AddWaypoint(15, -10754.43, 1017.93, 32.79);
- thisAI->AddWaypoint(16, -10802.26, 1018.01, 32.16);
- thisAI->AddWaypoint(17, -10832.60, 1009.04, 32.71);
- thisAI->AddWaypoint(18, -10866.56, 1006.51, 31.71); // Fix waypoints from roughly this point, test first to get proper one
- thisAI->AddWaypoint(19, -10879.98, 1005.10, 32.84);
- thisAI->AddWaypoint(20, -10892.45, 1001.32, 34.46);
- thisAI->AddWaypoint(21, -10906.14, 997.11, 36.15);
- thisAI->AddWaypoint(22, -10922.26, 1002.23, 35.74);
- thisAI->AddWaypoint(23, -10936.32, 1023.38, 36.52);
- thisAI->AddWaypoint(24, -10933.35, 1052.61, 35.85);
- thisAI->AddWaypoint(25, -10940.25, 1077.66, 36.49);
- thisAI->AddWaypoint(26, -10957.09, 1099.33, 36.83);
- thisAI->AddWaypoint(27, -10956.53, 1119.90, 36.73);
- thisAI->AddWaypoint(28, -10939.30, 1150.75, 37.42);
- thisAI->AddWaypoint(29, -10915.14, 1202.09, 36.55);
- thisAI->AddWaypoint(30, -10892.59, 1257.03, 33.37);
- thisAI->AddWaypoint(31, -10891.93, 1306.66, 35.45);
- thisAI->AddWaypoint(32, -10896.17, 1327.86, 37.77);
- thisAI->AddWaypoint(33, -10906.03, 1368.05, 40.91);
- thisAI->AddWaypoint(34, -10910.18, 1389.33, 42.62);
- thisAI->AddWaypoint(35, -10915.42, 1417.72, 42.93);
- thisAI->AddWaypoint(36, -10926.37, 1421.18, 43.04); // walk here and say
- thisAI->AddWaypoint(37, -10952.31, 1421.74, 43.40);
- thisAI->AddWaypoint(38, -10980.04, 1411.38, 42.79);
- thisAI->AddWaypoint(39, -11006.06, 1420.47, 43.26);
- thisAI->AddWaypoint(40, -11021.98, 1450.59, 43.09);
- thisAI->AddWaypoint(41, -11025.36, 1491.59, 43.15);
- thisAI->AddWaypoint(42, -11036.09, 1508.32, 43.28);
- thisAI->AddWaypoint(43, -11060.68, 1526.72, 43.19);
- thisAI->AddWaypoint(44, -11072.75, 1527.77, 43.20, 5000);// say and quest credit
+ npc_defias_traitorAI* thisAI = new npc_defias_traitorAI(pCreature);
+
+ thisAI->FillPointMovementListForCreature();
return (CreatureAI*)thisAI;
}
diff --git a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
index 1986d2c1b27..db6555d058f 100644
--- a/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
+++ b/src/bindings/scripts/scripts/zone/winterspring/winterspring.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
index b5f194d8035..ebe549a0599 100644
--- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
+++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
index ea832370ea3..704cadb0bcd 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
@@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
{
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999);
- Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(tempUnitMap, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(m_creature, tempUnitMap, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
index 6e7311d8917..b9601764d1b 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
index 8792a988c6f..95db93e71fb 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
@@ -237,8 +237,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
SpawnAdds();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 46916);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 50268674);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916);
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
index c70bd007c58..5c1d9177d6b 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
@@ -273,7 +273,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
@@ -397,7 +397,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
m_creature->AttackStop();
m_creature->GetMotionMaster()->Clear();
- DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
+ DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]);
m_creature->StopMoving();
m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false);
HatchAllEggs(2);
@@ -517,7 +517,7 @@ struct TRINITY_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check);
+ Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
index 75d08661834..0212e4005f5 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
Berserk_Timer = 600000;
inBearForm = false;
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
}
void SendAttacker(Unit* target)
@@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
cell.SetNoCreate();
Trinity::AllFriendlyCreaturesInGrid check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(templist, check);
+ Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(m_creature, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
@@ -360,7 +360,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
{
if(inBearForm)
{
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 5122);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
DoYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL);
m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM);
@@ -372,7 +372,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
}
else
{
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
DoYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR);
DoCast(m_creature, SPELL_BEARFORM, true);
@@ -394,7 +394,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
if(Mangle_Timer < diff)
{
- if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
+ if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT))
{
DoCast(m_creature->getVictim(), SPELL_MANGLE);
Mangle_Timer = 1000;
@@ -406,7 +406,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
{
DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRange(SPELL_SURGE), true);
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, GetSpellMaxRangeForHostile(SPELL_SURGE), true);
DoCast(target, SPELL_SURGE);
Surge_Timer = 15000 + rand()%5000;
}else Surge_Timer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
index cf319c8f063..4150e0ec393 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp
@@ -206,9 +206,9 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
Summons.DespawnAll();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 47174);
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
- m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174);
+ //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
+ //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
void Aggro(Unit *who)
@@ -252,7 +252,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
void AttackStart(Unit *who)
@@ -339,7 +339,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
case 4:
DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100);
DoResetThreat();
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
+ m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura);
DoCast(m_creature, Transform[Phase].spell);
DoYell(Transform[Phase].text, LANG_UNIVERSAL, NULL);
@@ -347,7 +347,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
if(Phase > 0)
{
if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1]))
- Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD);
+ Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
}
if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1]))
Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp
diff --git a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
index c249cf6b3ec..6fb0ef173bd 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
+++ b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
index a56cdf3f9a7..2ff8a6e9b8a 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp
@@ -1,4 +1,4 @@
- /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -106,7 +106,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
- switch(creature_entry)
+ switch(creature->GetEntry())
{
case 23578://janalai
case 23863://zuljin
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance
void OpenDoor(uint64 DoorGUID, bool open)
{
if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
- Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ Door->SetGoState(open ? 0 : 1);
}
void SummonHostage(uint8 num)
diff --git a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
index 9f3588e387a..62130f9a863 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
index 3d233037d16..b53855990b3 100644
--- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
+++ b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
index a472fff2076..102fef21467 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
index 7cf15d53416..e5e727b4843 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -23,7 +23,7 @@ EndScriptData */
#include "precompiled.h"
-#define SPELL_FROSTBREATH 21099
+#define SPELL_FROSTBREATH 16099
#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
#define SPELL_SLAM 24326
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
index 623015acb73..dce2e76e157 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
index 0d490781ec7..592129b88da 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
index efe847045d5..bd341fdaf40 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
index aecc2f450db..62a057dc2cb 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
index 100d8881127..4ea62662ef9 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -54,10 +54,6 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
uint32 Delusions_Timer;
uint32 Teleport_Timer;
- Creature *Shade;
- Creature *Skeletons;
- Creature *HealingWard;
-
void Reset()
{
BrainWashTotem_Timer = 20000;
@@ -88,7 +84,7 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
if (HealingWard_Timer < diff)
{
//DoCast(m_creature, SPELL_POWERFULLHEALINGWARD);
- HealingWard = m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
+ m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000);
HealingWard_Timer = 14000 + rand()%6000;
}else HealingWard_Timer -= diff;
@@ -110,7 +106,8 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
{
DoCast(target, SPELL_DELUSIONSOFJINDO);
- Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Shade)
Shade->AI()->AttackStart(target);
}
@@ -129,23 +126,33 @@ struct TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI
if(DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(target,-100);
+ Creature *Skeletons;
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (Skeletons)
Skeletons->AI()->AttackStart(target);
}
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
index 87939596324..7ad5be3fefd 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
index 69588bdfbb8..44606438a02 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
index 1b01afd9aa1..42742437fec 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -65,9 +65,9 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI
if (Invisible_Timer < diff)
{
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
+ //m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
+ //m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,11686);
Invisible = true;
@@ -99,9 +99,9 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID,15268);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 31818);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
- m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
+ m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_ID, 31818);
+ //m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO , 218171138);
+ //m_creature->SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + 1, 3);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = false;
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
index 36e9fd9c84d..7a753dc9e01 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -118,7 +118,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
{
//Resurrect LorKhan
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->SetStandState(UNIT_STAND_STATE_STAND);
pLorKhan->setFaction(14);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
{
//Resurrect Zath
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->SetStandState(UNIT_STAND_STATE_STAND);
pZath->setFaction(14);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
@@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
m_creature->AttackStop();
if(pInstance)
@@ -169,7 +169,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
{
DoCast(m_creature,SPELL_TIGER_FORM);
m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0));
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
@@ -328,7 +328,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
{
//Resurrect Thekal
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->SetStandState(UNIT_STAND_STATE_STAND);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
@@ -338,7 +338,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
{
//Resurrect Zath
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pZath->SetStandState(UNIT_STAND_STATE_STAND);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->setFaction(14);
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
@@ -351,7 +351,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
m_creature->setFaction(35);
m_creature->AttackStop();
@@ -398,7 +398,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
if(pInstance)
pInstance->SetData(DATA_ZATH_ALIVE, 0);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -459,7 +459,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
{
//Resurrect LorKhan
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pLorKhan->SetStandState(UNIT_STAND_STATE_STAND);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->setFaction(14);
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
@@ -469,7 +469,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
{
//Resurrect Thekal
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ pThekal->SetStandState(UNIT_STAND_STATE_STAND);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->setFaction(14);
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
@@ -482,7 +482,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
+ m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
m_creature->setFaction(35);
m_creature->AttackStop();
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
index 29c79a28187..1dff6b63dbe 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
index c69e2c6204e..1776dfc5868 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
index fd1c905048e..f14bd8eca98 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
+++ b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
index a49ff110b2d..eb3cbd1d495 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/bindings/scripts/sql/WotLK/npc_taxi.sql b/src/bindings/scripts/sql/WotLK/npc_taxi.sql
new file mode 100644
index 00000000000..b93f5dfdfca
--- /dev/null
+++ b/src/bindings/scripts/sql/WotLK/npc_taxi.sql
@@ -0,0 +1,10 @@
+#Taxi in Archerus
+UPDATE `creature_template` SET `ScriptName`='npc_acherus_taxi' WHERE `entry`='28864';
+
+#Stormwind Harbor
+UPDATE `creature_template` SET `ScriptName`='npc_stormwindharbor_taxi' WHERE `entry`='29154';
+
+#Taxis to the 3 parts of the Wyrmresttempel
+UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempelbottom_taxi' WHERE `entry`='26443';
+UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempelmiddle_taxi' WHERE `entry`='27575';
+UPDATE `creature_template` SET `ScriptName`='npc_wyrmresttempeltop_taxi' WHERE `entry`='26949';
diff --git a/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql b/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql
new file mode 100644
index 00000000000..de3de7b9464
--- /dev/null
+++ b/src/bindings/scripts/sql/WotLK/script_texts_wotlk.sql
@@ -0,0 +1,530 @@
+-- -1 574 000 UTGARDE KEEP
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Prince Keleseth
+ (-1574000, 'Your blood is mine!',13221,1,0,'keleseth SAY_AGGRO'),
+ (-1574001, 'Darkness waits',13223,1,0, 'keleseth SAY_KILL'),
+ (-1574002, 'I join... the night.',13225,1,0, 'keleseth SAY_DEATH'),
+ (-1574003, 'Not so fast.',13222,1,0, 'keleseth SAY_FROST_TOMB'),
+ (-1574004, 'Aranal, lidel! Their fate shall be yours!',13224,1,0, 'keleseth SAY_SKELETONS'),
+-- Dalronn the Controller
+ (-1574005, 'By all means, don\'t assess the situation, you halfwit! Just jump into the fray!',13199, 1,0,'dalronn SAY_AGGRO'),
+ (-1574006, 'You may serve me yet.',13202, 1,0,'dalronn SAY_KILL'),
+ (-1574007, 'See... you... soon.',13200, 1,0,'dalronn SAY_DEATH_1'),
+ (-1574008, 'There\'s no... greater... glory.',13201, 1,0,'dalronn SAY_DEATH_2'),
+ (-1574009, 'Skarvald, you incompetent slug! Return and make yourself useful!',13203,1,0, 'dalronn SAY_RAISES'),
+-- Skarvald the Constructor
+ (-1574010, 'Dalronn! See if you can muster the nerve to join my attack!',13229, 1,0,'skarvald SAY_AGGRO'),
+ (-1574011, '...',13232,1,0, 'skarvald SAY_KILL'),
+ (-1574012, 'Not... over... yet.',13230,1,0, 'skarvald SAY_DEATH_1'),
+ (-1574013, 'A warrior\'s death.',13231,1,0, 'skarvald SAY_DEATH_2'),
+ (-1574014, 'Pagh! What sort of necromancer lets death stop him? I knew you were worthless!',13233,1,0, 'skarvald SAY_RAISES'),
+-- Ingvar the Plunderer
+ (-1574015, 'I\'ll paint my face with your blood!',13207,1,0, 'ingvar SAY_AGGRO'),
+ (-1574016, 'I am a warrior born!',13214,1,0, 'ingvar SAY_KILL'),
+ (-1574017, 'My life for the... death god!',13213,1,0, 'ingvar SAY_DEATH'),
+ (-1574018, 'Fight on or face me!',13208,1,0, 'ingvar SAY_ATTACK_1'),
+ (-1574019, '...',13240, 1,0,'ingvar SAY_ATTACK_2'),
+ (-1574020, 'Slay them all, no excuses, no mercy, no rest!',13241,1,0, 'ingvar SAY_ATTACK_3'),
+ (-1574021, '... of destruction silence every ...!',13242,1,0, 'ingvar SAY_ATTACK_4'),
+ (-1574022, 'I return! A second chance to carve out your skull!',13208,1,0, 'ingvar SAY_PHASE2_AGGRO'),
+ (-1574023, 'Mjul orm agn gjor!',13212, 1,0,'ingvar SAY_PHASE2_KILL'),
+ (-1574024, 'No! I can do... better! I can...',13211,1,0, 'ingvar SAY_PHASE2_DEATH'),
+-- Said by Annhylde the Caller when resurecting Ingvar
+ (-1574025, 'Ingvar! Your pathetic failure will serve as a warning to all... you are damned! Arise and carry out the master\'s will!',13754, 1,0,'ingvar SAY_ANNHYLDE_THE_CALLER_RESURECTION');
+
+-- -1 575 000 UTGARDE PINNACLE
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Gortok Palehoof
+ (-1575000, 'What this place? I will destroy you!',13464,1,0, 'palehoof SAY_AGGRO'),
+ (-1575001, 'You die! That what master wants!',13465,1,0, 'palehoof SAY_SLAY_1'),
+ (-1575002, 'An easy task!',13466,1,0, 'palehoof SAY_SLAY_2'),
+ (-1575003, '...',13467,1,0, 'palehoof SAY_DEATH'),
+-- Skadi the Ruthless
+ (-1575004, 'What mongrels dare intrude here? Look alive, my brothers! A feast for the one that brings me their heads!',13497,1,0, 'skadi SAY_AGGRO'),
+ (-1575005, 'Mjor Na Ul Kaval!',13503,1,0, 'skadi SAY_KILL_1'),
+ (-1575006, 'Not so brash now, are you?',13504,1,0, 'skadi SAY_KILL_2'),
+ (-1575007, 'I\'ll mount your skull from the highest tower!',13505,1,0, 'skadi SAY_KILL_3'),
+ (-1575008, 'ARGH! You call that... an attack? I\'ll... show... aghhhh...',13506,1,0, 'skadi SAY_DEATH'),
+ (-1575009, 'You motherless knaves! Your corpses will make fine morsels for my new drake!',13507,1,0, 'skadi SAY_DRAKE_DEATH'),
+ (-1575010, 'I ask for ... to kill them, yet all I get is feeble whelps! By Ye.. SLAUGHTER THEM!',13501,1,0, 'skadi SAY_DRAKE_HIT_1'),
+ (-1575011, 'If one more harpoon touches my drake I\'ll flae my miserable heins.',13502,1,0, 'skadi SAY_DRAKE_HIT_2'),
+ (-1575012, 'Sear them to the bone!',13498,1,0, 'skadi SAY_DRAKE_BREATH_1'),
+ (-1575013, 'Go now! Leave nothing but ash in your wake!',13499,1,0, 'skadi SAY_DRAKE_BREATH_2'),
+ (-1575014, 'Cleanse our sacred halls with flame!',13500,1,0, 'skadi SAY_DRAKE_BREATH_3'),
+-- Svala Sorrowgrave
+ (-1575015, 'I will vanquish your soul!',13842,1,0, 'svala SAY_AGGRO'),
+ (-1575016, 'You were a fool to challenge the power of the Lich King!',13845, 1,0,'svala SAY_SLAY_1'),
+ (-1575017, 'Your will is done, my king.',13847,1,0, 'svala SAY_SLAY_2'),
+ (-1575018, 'Another soul for my master.',13848, 1,0,'svala SAY_SLAY_3'),
+ (-1575019, 'Nooo! I did not come this far... to...',13855,1,0, 'svala SAY_DEATH'),
+ (-1575020, 'Your death approaches.',13850,1,0, 'svala SAY_SACRIFICE_PLAYER_1'),
+ (-1575021, 'Go now to my master.',13851,1,0, 'svala SAY_SACRIFICE_PLAYER_2'),
+ (-1575022, 'Your end is inevitable.',13852,1,0, 'svala SAY_SACRIFICE_PLAYER_3'),
+ (-1575023, '...',13853,1,0, 'svala SAY_SACRIFICE_PLAYER_4'),
+ (-1575024, 'Any last words?',13854,1,0, 'svala SAY_SACRIFICE_PLAYER_5'),
+ (-1575025, 'My liege! I have done as you asked, and now beseech you for your blessing!',13856,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_1'),
+ (-1575026, 'The sensation is... beyond my imagining. I am yours to command, my king.',13857,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_2'),
+ (-1575027, 'I will be happy to slaughter them in your name! Come, enemies of the Scourge! I will show you the might of the Lich King!',13858,1,0, 'svala SAY_SAY_DIALOG_WITH_ARTHAS_3'),
+-- King Ymiron
+ (-1575028, 'You invade my home and then dare to challenge me? I will tear the hearts from your chests and offer them as gifts to the death god! Rualg nja gaborr!',13609, 1,0,'ymiron SAY_AGGRO'),
+ (-1575029, 'Your death is only the beginning!',13614,1,0, 'ymiron SAY_SLAY_1'),
+ (-1575030, 'You have failed your people!',13615, 1,0,'ymiron SAY_SLAY_2'),
+ (-1575031, 'There is a reason I am king!',13616, 1,0,'ymiron SAY_SLAY_3'),
+ (-1575032, 'Bleed no more!',13617, 1,0,'ymiron SAY_SLAY_4'),
+ (-1575033, 'What... awaits me... now?',13618,1,0, 'ymiron SAY_DEATH'),
+ (-1575034, 'Bjorn of the Black Storm! Honor me now with your presence!',13610,1,0, 'ymiron SAY_SUMMON_BJORN'),
+ (-1575035, 'Haldor of the rocky cliffs, grant me your strength!',13611, 1,0,'ymiron SAY_SUMMON_HALDOR'),
+ (-1575036, 'Ranulf of the screaming abyss, snuff these maggots with darkest night!',13612,1,0, 'ymiron SAY_SUMMON_RANULF'),
+ (-1575037, 'Tor of the Brutal Siege! Bestow your might upon me!',13613,1,0, 'ymiron SAY_SUMMON_TORGYN');
+
+-- -1 576 000 NEXUS
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Anomalus
+ (-1576000, 'Chaos beckons.',13186,1,0,'anomalus SAY_AGGRO'),
+ (-1576001, 'Expiration... is necessary...',13274,1,0,'anomalus SAY_KILL'),
+ (-1576002, 'Of course.',13187,1,0,'anomalus SAY_DEATH'),
+ (-1576003, 'Reality... unwoven.',13188,1,0,'anomalus SAY_RIFT'),
+ (-1576004, 'Indestructible.',13189,1,0,'anomalus SAY_SHIELD'),
+-- Keristrasza
+ (-1576005, 'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,'keristrasza SAY_AGGRO'),
+ (-1576006, 'Now we\'ve come to the truth! ',13453,1,0,'keristrasza SAY_SLAY'),
+ (-1576007, 'Finish it! Finish it! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,'keristrasza SAY_ENRAGE'),
+ (-1576008, 'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,'keristrasza SAY_DEATH'),
+ (-1576009, 'Stay. Enjoy your final moments.',13451,1,0,'keristrasza SAY_CRYSTAL_NOVA'),
+-- Grand Magus Telestra
+ (-1576010, 'You know what they say about curiosity.',13319,1,0,'magus_telestra SAY_AGGRO'),
+ (-1576011, 'Death becomes you!',13324,1,0,'magus_telestra SAY_KILL'),
+ (-1576012, 'Damn the... luck.',13320,1,0,'magus_telestra SAY_DEATH'),
+ (-1576013, 'Now to finish the job!',13323,1,0,'magus_telestra SAY_MERGE'),
+ (-1576014, 'There\'s plenty of me to go around.',13321,1,0,'magus_telestra SAY_SPLIT_1'),
+ (-1576015, 'I\'ll give you more than you can handle.',13322,1,0,'magus_telestra SAY_SPLIT_2'),
+-- Ormorok
+ (-1576016, 'Noo!',13328,1,0,'ormorok SAY_AGGRO'),
+ (-1576017, 'Aargh Kill!',13329,1,0,'ormorok SAY_KILL'),
+ (-1576018, 'Aaggh!',13330,1,0,'ormorok SAY_DEATH'),
+ (-1576019, 'Back!',13331,1,0,'ormorok SAY_REFLECT'),
+ (-1576020, 'Bleed!',13332,1,0,'ormorok SAY_ICE_SPIKES'),
+-- Commander Stoutbeard
+ (-1576021, 'What? Where in a..? Don\'t just stand around lads KILL SOMEBODY!',13193,1,0,'commander_stoutbeard SAY_AGGRO'),
+ (-1576022, 'Now we\re getting someplace!',13195,1,0,'commander_stoutbeard SAY_KILL'),
+ (-1576023, 'Is that all you\'ve... got?',13194,1,0,'commander_stoutbeard SAY_DEATH'),
+-- Commander Kolurg
+ (-1576024, 'What is this? Mag thorin Kar! Kill them!',13458,1,0,'commander_kolurg SAY_AGGRO'),
+ (-1576025, 'Our task is not yet done!',13459,1,0,'commander_kolurg SAY_KILL'),
+ (-1576026, 'GOOO!',13460,1,0,'commander_kolurg SAY_DEATH');
+
+-- -1 578 000 OCULUS
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Drakos the Interrogator
+ (-1578000, 'The prisoners shall not go free. The word of Malygos is law!',13594,1,0, 'drakos SAY_AGGRO'),
+ (-1578001, 'A fitting punishment!',13602, 1,0,'drakos SAY_KILL_1'),
+ (-1578002, 'Sentence: executed!',13603,1,0, 'drakos SAY_KILL_2'),
+ (-1578003, 'Another casualty of war!',13604, 1,0,'drakos SAY_KILL_3'),
+ (-1578004, 'The war... goes on.',13605,1,0, 'drakos SPELL_DEATH'),
+ (-1578005, 'It is too late to run!',13598, 1,0,'drakos SAY_PULL_1'),
+ (-1578006, 'Gather \'round! ',13599, 1,0,'drakos SAY_PULL_2'),
+ (-1578007, 'None shall escape!',13600, 1,0,'drakos SAY_PULL_3'),
+ (-1578008, 'I condemn you to death!',13601,1,0, 'drakos SAY_PULL_4'),
+ (-1578009, 'Tremble, worms!',13595,1,0, 'drakos SAY_STOMP_1'),
+ (-1578010, 'I will crush you!',13596, 1,0,'drakos SAY_STOMP_2'),
+ (-1578011, 'Can you fly?',13597, 1,0,'drakos SAY_STOMP_3'),
+-- Mage-Lord Urom
+ (-1578012, 'Poor blind fools!',13638,1,0, 'urom SAY_AGGRO'),
+ (-1578013, 'If only you understood!',13641,1,0, 'urom SAY_KILL_1'),
+ (-1578014, 'Now, do you see? DO YOU?!',13642,1,0, 'urom SAY_KILL_2'),
+ (-1578015, 'Unfortunate, but necessary.',13643,1,0, 'urom SAY_KILL_3'),
+ (-1578016, 'Everything I\'ve done... has been for Azeroth...',13644,1,0, 'urom SAY_DEATH'),
+ (-1578017, 'A taste... just a small taste... of the Spell-Weaver\'s power!',13639,1,0, 'urom SAY_EXPLOSION_1'),
+ (-1578018, 'So much unstable energy... but worth the risk to destroy you!',13640,1,0, 'urom SAY_EXPLOSION_2'),
+ (-1578019, 'What do we have here... those would defy the Spell-Weaver? Those without foresight or understanding. How could I make you see? Malygos is saving the world from itself! Bah! You are hardly worth my time!',13635,1,0, 'urom SAY_SUMMON_1'),
+ (-1578020, 'Clearly my pets failed. Perhaps another demonstration is in order.',13636,1,0, 'urom SAY_SUMMON_2'),
+ (-1578021, 'Still you fight. Still you cling to misguided principles. If you survive, you\'ll find me in the center ring.',13637,1,0, 'urom SAY_SUMMON_3'),
+-- Varos Cloudstrider
+ (-1578022, 'There will be no mercy!',13649,1,0, 'varos SAY_AGGRO'),
+ (-1578023, 'You were warned.',13653,1,0, 'varos SAY_KILL_1'),
+ (-1578024, 'The Oculus is ours.',13654,1,0, 'varos SAY_KILL_2'),
+ (-1578025, 'They are... too strong! Underestimated their... fortitude.',13655,1,0, 'varos SAY_DEATH'),
+ (-1578026, 'Blast them! Destroy them!',13650,1,0, 'varos SAY_STRIKE_1'),
+ (-1578027, 'Take no prisoners! Attack!',13651,1,0, 'varos SAY_STRIKE_2'),
+ (-1578028, 'Strike now! Obliterate them!',13652,1,0, 'varos SAY_STRIKE_3'),
+-- Varos says when Drakos dies
+ (-1578029, 'Intruders, your victory will be short-lived. I am Commander Varos Cloudstrider. My drakes control the skies and protest this conduit. I will see to it personally that the Oculus does not fall into your hands!',13648,1,0, 'varos SAY_SPAWN');
+
+-- -1 595 000 CULLING OF STRATHOLME
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Epoch
+ (-1595000, 'We\'ll see about that, young prince.',13409,1,0, 'epoch SAY_AGGRO'),
+ (-1595001, 'Tick tock, tick tock...',13410, 1,0,'epoch SAY_TIME_WARP_1'),
+ (-1595002, 'Not quick enough!',13411,1,0, 'epoch SAY_TIME_WARP_2'),
+ (-1595003, 'Let\'s get this over with. ',13412, 1,0,'epoch SAY_TIME_WARP_3'),
+ (-1595004, 'There is no future for you.',13413,1,0, 'epoch SAY_SLAY_1'),
+ (-1595005, 'This is the hour of our greatest triumph!',13414,1,0, 'epoch SAY_SLAY_2'),
+ (-1595006, 'You would destined to fail. ',13415,1,0, 'epoch SAY_SLAY_3'),
+ (-1595007, 'Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own.',13408,1,0, 'epoch SAY_INTRO'),
+ (-1595008, '*gurgles*',13416,1,0, 'epoch SAY_DEATH'),
+-- Mal'ganis
+ (-1595009, 'Yes...this is the beginning...I\'ve been waiting for you...young prince...I...am Mal\'Ganis..', 14410,1,0, 'mal_ganis SAY_INTRO_1'),
+ (-1595010, 'As you can see, your people...are now mine. I will now turn this city, household by household, until the flame of life has been snuffed out...forever...', 14411,1,0, 'mal_ganis SAY_INTRO_2'),
+ (-1595011, 'This will be a fine test...Prince Arthas...', 14413,1,0, 'mal_ganis SAY_AGGRO'),
+ (-1595012, 'All too easy...', 14416,1,0, 'mal_ganis SAY_KILL_1'),
+ (-1595013, 'The dark lord is displeased with your interference...', 14417, 1,0,'mal_ganis SAY_KILL_2'),
+ (-1595014, 'It is Prince Arthas I want...not you...', 14418,1,0, 'mal_ganis SAY_KILL_3'),
+ (-1595015, 'Anak\'Keri...', 14422, 1,0,'mal_ganis SAY_SLAY_1'),
+ (-1595016, 'My onslaught will wash over the Lich King\'s forces...', 14423,1,0, 'mal_ganis SAY_SLAY_2'),
+ (-1595017, 'Your death is in vain, tiny mortal...', 14424, 1,0,'mal_ganis SAY_SLAY_3'),
+ (-1595018, 'Your time has come to an end! ', 14425,1,0, 'mal_ganis SAY_SLAY_4'),
+ (-1595019, 'Time out...', 14414, 1,0,'mal_ganis SAY_SLEEP_1'),
+ (-1595020, 'You seem...tired... ', 14415,1,0, 'mal_ganis SAY_SLEEP_2'),
+ (-1595021, '*Struggling sounds* I spent too much time in that weak little shell... ', 14426,1,0, 'mal_ganis SAY_30HEALTH'),
+ (-1595022, '(Eredun) I AM MAL\'GANIS! I AM ETERNAL! ', 14427,1,0, 'mal_ganis SAY_15HEALTH'),
+ (-1595023, 'ENOUGH! I waste my time here...I must gather my strength on the home world...', 14428,1,0, 'mal_ganis SAY_ESCAPE_SPEECH_1'),
+ (-1595024, 'You\'ll never defeat the Lich King without my forces! I\'ll have my revenge...on him, AND you... ', 14429,1,0, 'mal_ganis SAY_ESCAPE_SPEECH_2'),
+ (-1595025, 'Your journey has just begun, young prince...Gather your forces, and meet me in the arctic land of Northrend...It is there we shall settle the score between us...It is there that your true destiny will unfold...', 14412,1,0, 'mal_ganis SAY_OUTRO'),
+-- Meathook
+ (-1595026, 'New toys!',13429,1,0, 'meathook SAY_AGGRO'),
+ (-1595027, 'Boring...',13430,1,0, 'meathook SAY_SLAY_1'),
+ (-1595028, 'Why you stop moving?',13431,1,0, 'meathook SAY_SLAY_2'),
+ (-1595029, 'Get up! Me not done! ',13432,1,0, 'meathook SAY_SLAY_3'),
+ (-1595030, 'Play time! ',13428,1,0, 'meathook SAY_SPAWN'),
+ (-1595031, 'This not fun...',13433,1,0, 'meathook SAY_DEATH'),
+-- Salramm the Fleshcrafter
+ (-1595032, 'Ah, the entertainment has arrived!',13472,1,0, 'salramm SAY_AGGRO'),
+ (-1595033, 'You are too late, champion of Lordaeron. The dead shall have their day. ',13471,1,0, 'salramm SAY_SPAWN'),
+ (-1595034, 'The fun is just beginning!',13473,1,0, 'salramm SAY_SLAY_1'),
+ (-1595035, 'Aah, quality materials!',13474, 1,0,'salramm SAY_SLAY_2'),
+ (-1595036, 'Don\'t worry, I\'ll make good use of you. ',137475, 1,0,'salramm SAY_SLAY_3'),
+ (-1595037, 'You only advance... the master\'s plan...',13483,1,0, 'salramm SAY_DEATH'),
+ (-1595038, 'BOOM! Hahahahah...',13478, 1,0,'salramm SAY_EXPLODE_GHOUL_1'),
+ (-1595039, 'Blood... destruction... EXHILARATING! ',13479,1,0, 'salramm SAY_EXPLODE_GHOUL_2'),
+ (-1595040, 'I want a sample...',13480,1,0, 'salramm SAY_STEAL_FLESH_1'),
+ (-1595041, 'Such strength... it must be mine!',13481,1,0, 'salramm SAY_STEAL_FLESH_2'),
+ (-1595042, 'Your flesh betrays you.',13482,1,0, 'salramm SAY_STEAL_FLESH_3'),
+ (-1595043, 'Say hello to some friends of mine.',13476,1,0, 'salramm SAY_SUMMON_GHOULS_1'),
+ (-1595044, 'Come, citizen of Stratholme! Meet your saviors.',13477,1,0, 'salramm SAY_SUMMON_GHOULS_2');
+
+-- -1 599 000 HALLS OF STONE
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Krystallus
+ (-1599000, 'Crush....', 14176, 1,0,'krystallus SAY_AGGRO'),
+ (-1599001, 'Ha...ha...ha...ha...', 14177,1,0, 'krystallus SAY_KILL'),
+ (-1599002, 'Uuuuhhhhhhhhhh......', 14179,1,0, 'krystallus SAY_DEATH'),
+ (-1599003, 'Break.... you....', 14178,1,0, 'krystallus SAY_SHATTER'),
+-- Maiden of Grief
+ (-1599004, 'You shouldn\'t have come...now you will die!',13487,1,0, 'maiden_of_grief SAY_AGGRO'),
+ (-1599005, 'Why must it be this way?',13488,1,0, 'maiden_of_grief SAY_SLAY_1'),
+ (-1599006, 'You had it coming!',13489, 1,0,'maiden_of_grief SAY_SLAY_2'),
+ (-1599007, 'My burden grows heavier.',13490,1,0, 'maiden_of_grief SAY_SLAY_3'),
+ (-1599008, 'This is your own fault!',13491,1,0, 'maiden_of_grief SAY_SLAY_4'),
+ (-1599009, 'I hope you all rot! I never...wanted...this.',13493, 1,0,'maiden_of_grief SAY_DEATH'),
+ (-1599010, 'So much lost time... that you\'ll never get back!',13492,1,0, 'maiden_of_grief SAY_STUN'),
+-- Sjonnir
+ (-1599011, 'Soft, vulnerable shells. Brief, fragile lives. You can not escape the curse of flesh!', 14180,1,0, 'sjonnir SAY_AGGRO'),
+ (-1599012, '...', 14181,1,0, 'sjonnir SAY_SLAY_1'),
+ (-1599013, 'Flesh is no match for iron!', 14182, 1,0,'sjonnir SAY_SLAY_2'),
+ (-1599014, 'Armies of iron will smother the world!', 14183, 1,0,'sjonnir SAY_SLAY_3'),
+ (-1599015, 'Loken will not rest, until the forge is retaken. You changed nothing!', 14184,1,0, 'sjonnir SAY_DEATH');
+
+-- -1 600 000 DRAK'THARON KEEP
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Novos the Summoner
+ (-1600000, 'The chill you feel is the herald of your doom.', 13173, 1,0, 'novos SAY_AGGRO'),
+ (-1600001, 'Such is the faith of all who oppose the Lich King!', 13175, 1,0, 'novos SAY_KILL'),
+ (-1600002, 'Your efforts... are in vain.', 13174, 1,0, 'novos SAY_DEATH'),
+ (-1600003, 'Surely you can see the futility of it all!', 13177, 1,0, 'novos SAY_REBUBLE_1'),
+ (-1600004, 'Just give up and die already!', 13178, 1,0, 'novos SAY_REBUBLE_2'),
+ (-1600005, 'Bolster my defenses! Hurry, curse you!', 13176, 1,0, 'novos SAY_NECRO_ADD'),
+-- Trollgore
+ (-1600006, 'Mogas moblath moghuld!', 13181, 1,0, 'trollgore SAY_AGGRO'),
+ (-1600007, '... I will eat you!', 13185, 1,0, 'trollgore SAY_KILL'),
+ (-1600008, '... .. so hungry, .. ... must\'t feed.', 13182, 1,0, 'trollgore SAY_CONSUME'),
+ (-1600009, '*laugh* Corpse go boom!', 13184, 1,0, 'trollgore SAY_EXPLODE'),
+ (-1600010, '...', 13183, 1,0, 'trollgore SAY_DEATH'),
+-- The Prophet Tharon'ja
+ (-1600011, 'Tharon\'ja sees all! The work of mortals shall not end the eternal dynasty!', 13862, 1, 0, 'tharon_ja SAY_AGGRO'),
+ (-1600012, 'As Tharon\'ja predicted.', 13863, 1, 0, 'tharon_ja SAY_KILL_1'),
+ (-1600013, 'As it was written.', 13863, 1, 0, 'tharon_ja SAY_KILL_2'),
+ (-1600014, 'Your flesh serves Tharon\'ja now!', 13865, 1, 0, 'tharon_ja SAY_FLESH_1'),
+ (-1600015, 'Tharon\'ja has a use for your mortal shell!', 13866, 1, 0, 'tharon_ja SAY_FLESH_2'),
+ (-1600016, 'No! A taste... all too brief!', 13868, 1, 0, 'tharon_ja SAY_SKELETON_1'),
+ (-1600017, 'Tharon\'ja will have more!', 13868, 1, 0, 'tharon_ja SAY_SKELETON_2'),
+ (-1600018, 'Im... impossible! Tharon\'ja is eternal! Tharon\'ja... is...', 13869, 1, 0, 'tharon_ja SAY_DEATH');
+
+-- -1 601 000 AZJOL-NERUB
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Anub'arak
+ (-1601000, 'Eternal agony awaits you!', 14054,1,0, 'anub_arak SAY_AGGRO'),
+ (-1601001, 'You shall experience my torment, first-hand!', 14055,1,0, 'anub_arak SAY_SLAY_1'),
+ (-1601002, 'You have made your choice.', 14056,1,0, 'anub_arak SAY_SLAY_2'),
+ (-1601003, 'Soon, the Master\'s voice will call to you.', 14057,1,0, 'anub_arak SAY_SLAY_3'),
+ (-1601004, 'Ahhh... RAAAAAGH! Never thought... I would be free of him...', 14069,1,0, 'anub_arak SAY_DEATH'),
+ (-1601005, 'Your armor is useless against my locusts!', 14060, 1,0,'anub_arak SAY_LOCUST_1'),
+ (-1601006, '?!!??!!!', 14067,1,0, 'anub_arak SAY_LOCUST_2'),
+ (-1601007, 'The pestilence upon you!', 14068,1,0, 'anub_arak SAY_LOCUST_3'),
+ (-1601008, '!!!???!!!', 14058,1,0, 'anub_arak SAY_SUBMERGE_1'),
+ (-1601009, 'Come forth, my brethren. Feast on their flesh!', 14059,1,0, 'anub_arak SAY_SUBMERGE_2'),
+ (-1601010, 'I was king of this empire once, long ago. In life I stood as champion. In death I returned as conqueror. Now I protect the kingdom once more. Ironic, yes?', 14053, 1,0,'anub_arak SAY_INTRO'),
+-- Krik'thir
+ (-1601011, 'This kingdom belongs to the Scourge! Only the dead may enter.', 14075,1,0, 'krik_thir SAY_AGGRO'),
+ (-1601012, 'Hash\'tak hi\'tak.', 14076,1,0, 'krik_thir SAY_SLAY_1'),
+ (-1601013, 'You were foolish to come.', 14077, 1,0,'krik_thir SAY_SLAY_2'),
+ (-1601014, 'As Anub\'Arak commands!', 14078,1,0, 'krik_thir SAY_SLAY_3'),
+ (-1601015, 'I should be grateful. But I long ago lost the capacity.', 14087,1,0, 'krik_thir SAY_DEATH'),
+ (-1601016, 'They hunger.', 14085,1,0, 'krik_thir SAY_SWARM_1'),
+ (-1601017, 'Dinner time, my pets.', 14086,1,0, 'krik_thir SAY_SWARM_2'),
+ (-1601018, 'We are besieged. Strike out and bring back their corpses!', 14079,1,0, 'krik_thir SAY_SEND_GROUP_1'),
+ (-1601019, 'We must hold the gate. Attack! Tear them limb from limb!', 14080,1,0, 'krik_thir SAY_SEND_GROUP_2'),
+ (-1601020, 'The gate must be protected at all costs. Rip them to shreds!', 14081,1,0, 'krik_thir SAY_SEND_GROUP_3'),
+ (-1601021, 'Keep an eye on the tunnel. We must not let anyone through!', 14082,1,0, 'krik_thir SAY_PREFIGHT_1'),
+ (-1601022, 'I hear footsteps. Be on your guard.', 14083,1,0, 'krik_thir SAY_PREFIGHT_2'),
+ (-1601023, 'I sense the living. Be ready.', 14084,1,0, 'krik_thir SAY_PREFIGHT_3');
+
+-- -1 602 000 HALLS OF LIGHTNING
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- General Bjarngrim
+ (-1602000, 'I am the greatest of my father\'s sons! Your end has come!', 14149,1,0,'bjarngrim SAY_AGGRO'),
+ (-1602001, 'So ends your curse!', 14153,1,0, 'bjarngrim SAY_SLAY_1'),
+ (-1602002, 'Flesh... is... weak!', 14154,1,0, 'bjarngrim SAY_SLAY_2'),
+ (-1602003, '...', 14155,1,0, 'bjarngrim SAY_SLAY_3'),
+ (-1602004, 'How can it be...? Flesh is not... stronger!', 14156,1,0, 'bjarngrim SAY_DEATH'),
+ (-1602005, 'Defend yourself, for all the good it will do!', 14151,1,0, 'bjarngrim SAY_BATTLE_STANCE'),
+ (-1602006, 'GRAAAAAH! Behold the fury of iron and steel!', 14152,1,0, 'bjarngrim SAY_BERSEKER_STANCE'),
+ (-1602007, 'Give me your worst!', 14150,1,0, 'bjarngrim SAY_DEFENSIVE_STANCE'),
+-- Ionar
+ (-1602008, 'You wish to confront the master? You must weather the storm!', 14453,1,0, 'ionar SAY_AGGRO'),
+ (-1602009, 'Shocking ... I know!', 14456,1,0, 'ionar SAY_SLAY_1'),
+ (-1602010, 'You atempt the unpossible.', 14457,1,0, 'ionar SAY_SLAY_2'),
+ (-1602011, 'Your spark of light is ... extinguish.', 14458,1,0, 'ionar SAY_SLAY_3'),
+ (-1602012, 'Master... you have guests.', 14459,1,0, 'ionar SAY_DEATH'),
+ (-1602013, 'The slightest spark shall be your undoing.', 14454,1,0, 'ionar SAY_SPLIT_1'),
+ (-1602014, 'No one is safe!', 14455,1,0, 'ionar SAY_SPLIT_2'),
+-- Loken
+ (-1602015, 'What hope is there for you? None!', 14162,1,0, 'loken SAY_AGGRO0'),
+ (-1602016, 'I have witnessed the rise and fall of empires. The birth and extinction of entire species. Over countless millennia the foolishness of mortals has remained beyond a constant. Your presence here confirms this.', 14160,1,0, 'loken SAY_INTRO_1'),
+ (-1602017, 'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!', 14162,1,0, 'loken SAY_INTRO_2'),
+ (-1602018, 'Only mortal...', 14166,1,0, 'loken SAY_SLAY_1'),
+ (-1602019, 'I... am... FOREVER!', 14167,1,0, 'loken SAY_SLAY_2'),
+ (-1602020, 'What little time you had, you wasted!', 14168,1,0, 'loken SAY_SLAY_3'),
+ (-1602021, 'My death... heralds the end of this world.', 14172,1,0, 'loken SAY_DEATH'),
+ (-1602022, 'You cannot hide from fate!', 14163,1,0, 'lokenSAY_NOVA_1'),
+ (-1602023, 'Come closer. I will make it quick.', 14164,1,0, 'loken SAY_NOVA_2'),
+ (-1602024, 'Your flesh cannot hold out for long.', 14165,1,0, 'loken SAY_NOVA_3'),
+ (-1602025, 'You stare blindly into the abyss!', 14169,1,0, 'loken SAY_75HEALTH'),
+ (-1602026, 'Your ignorance is profound. Can you not see where this path leads?', 14170,1,0, 'loken SAY_50HEALTH'),
+ (-1602027, 'You cross the precipice of oblivion!', 14171,1,0, 'loken SAY_25HEALTH'),
+-- Volkhan
+ (-1602028, 'It is you who have destroyed my children? You... shall... pay!',13960,1,0, 'volkhan SAY_AGGRO'),
+ (-1602029, 'The armies of iron will conquer all!',13965, 1,0,'volkhan SAY_SLAY_1'),
+ (-1602030, 'Ha, pathetic!',13966,1,0, 'volkhan SAY_SLAY_2'),
+ (-1602031, 'You have cost me too much work!',13967,1,0, 'volkhan SAY_SLAY_3'),
+ (-1602032, 'The master was right... to be concerned.',13968, 1,0,'volkhan SAY_DEATH'),
+ (-1602033, 'I will crush you beneath my boots!',13963, 1,0,'volkhan SAY_STOMP_1'),
+ (-1602034, 'All my work... undone!',13964, 1,0,'volkhan SAY_STOMP_2'),
+ (-1602035, 'Life from the lifelessness... death for you.',13961,1,0, 'volkhan SAY_FORGE_1'),
+ (-1602036, 'Nothing is wasted in the process. You will see....',13962, 1,0,'volkhan SAY_FORGE_2');
+
+-- -1 603 000 ULDUAR (RAID NIU)
+
+-- -1 604 000 GUNDRAK
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Gal'darah
+ (-1604000, 'I\'m gonna spil your guts, man!', 14430, 1,0,'gal_darah SAY_AGGRO'),
+ (-1604001, 'What a rush.', 14436,1,0, 'gal_darah SAY_SLAY_1'),
+ (-1604002, 'Who needs gods, when we ARE gods!', 14437, 1,0,'gal_darah SAY_SLAY_2'),
+ (-1604003, 'I told ya so ...', 14438,1,0, 'gal_darah SAY_SLAY_3'),
+ (-1604004, 'Even the mighty ... can .. fall.', 14439,1,0, 'gal_darah SAY_DEATH'),
+ (-1604005, 'God damn! Impale them!', 14433, 1,0,'gal_darah SAY_SUMMON_RHINO_1'),
+ (-1604006, 'Kill them ALL!', 14434, 1,0,'gal_darah SAY_SUMMON_RHINO_2'),
+ (-1604007, 'Say hello to my BIG friend.', 14435,1,0, 'gal_darah SAY_SUMMON_RHINO_3'),
+ (-1604008, 'Ain\'t gonna bee nothig left after this.', 14431,1,0, 'gal_darah SAY_TRANSFORM_1'),
+ (-1604009, 'You wanna see POWER? I\'m gonna show you POWER!', 14432,1,0, 'gal_darah SAY_TRANSFORM_2'),
+-- Moorabi
+ (-1604010, 'We fought back the Scourge. What chance you be thinking you got?', 14721,1,0, 'moorabi SAY_AGGRO'),
+ (-1604011, 'I crush you, cockroaches!', 14725,1,0, 'moorabi SAY_SLAY_1'),
+ (-1604012, 'Who gonna stop me, you?', 14726,1,0, 'moorabi SAY_SLAY_2'),
+ (-1604013, 'Not so tough now.', 14727,1,0, 'moorabi SAY_SLAY_3'),
+ (-1604014, 'If our gods can die, then so can we.', 14728,1,0, 'moorabi SAY_DEATH'),
+ (-1604015, 'Get ready for something much bigger!', 14722,1,0, 'moorabi SAY_TRANSFORM'),
+ (-1604016, 'The ground will swallow you up!', 14723,1,0, 'moorabi SAY_QUAKE'),
+-- Slad'ran
+ (-1604017, 'Drak\'thari gonna kill anybody who trespass on this lands.', 14443,1,0, 'slad_ran SAY_AGGRO'),
+ (-1604018, 'Can not breath then, good ...', 14446,1,0, 'slad_ran SAY_SLAY_1'),
+ (-1604019, 'You\'re scared now.', 14447,1,0, 'slad_ran SAY_SLAY_2'),
+ (-1604020, 'I eat you next man!', 14448,1,0, 'slad_ran SAY_SLAY_3'),
+ (-1604021, 'I ... see now. Scourge was not tha greatest enemy.', 14449,1,0, 'slad_ran SAY_DEATH'),
+ (-1604022, 'Minions of this ... heed my call.', 14444,1,0, 'slad_ran SAY_SUMMON_SNAKES'),
+ (-1604023, 'A thousand fangs gonna rim yar flesh.', 14445,1,0, 'slad_ran SAY_SUMMON_CONSTRICTORS');
+
+-- -1 608 000 VIOLET HOLD
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Cyanigosa
+ (-1608000, 'We finish this now, champions of Kirin Tor!', 13947, 1, 0, 'cyanigosa SAY_AGGRO'),
+ (-1608001, 'I will end the Kirin Tor!', 13952, 1, 0, 'cyanigosa SAY_SLAY_1'),
+ (-1608002, 'Dalaran will fall!', 13953, 1, 0, 'cyanigosa SAY_SLAY_2'),
+ (-1608003, 'So ends your defiance of the Spell-Weaver!', 13954, 1, 0, 'cyanigosa SAY_SLAY_3'),
+ (-1608004, 'Perhaps... we have... underestimated... you.', 13955, 1, 0, 'cyanigosa SAY_DEATH'),
+ (-1608005, 'A valiant defense, but this city must be razed. I will fulfill Malygos\'s wishes myself!', 13946, 1, 0, 'cyanigosa SAY_SPAWN'),
+ (-1608006, 'Am I interrupting?', 13951, 1, 0, 'cyanigosa SAY_DISRUPTION'),
+ (-1608007, 'Shiver and die!', 13948, 1, 0, 'cyanigosa SAY_BREATH_ATTACK'),
+ (-1608008, 'The world has forgotten what true magic is! Let this be a reminder!', 13949, 1, 0, 'cyanigosa SAY_SPECIAL_ATTACK_1'),
+ (-1608009, 'Who among you can withstand my power?', 13950, 1, 0, 'cyanigosa SAY_SPECIAL_ATTACK_2'),
+-- Erekem
+ (-1608010, 'Notcawwget in way ofrrak-rrakflee!', 14219, 1, 0, 'erekem SAY_AGGRO'),
+ (-1608011, '...', 14222, 1, 0, 'erekem SAY_SLAY_1'),
+ (-1608012, 'Precious life ... wasted.', 14223, 1, 0, 'erekem SAY_SLAY_2'),
+ (-1608013, 'Only strong ... survive.', 14224, 1, 0, 'erekem SAY_SLAY_3'),
+ (-1608014, 'Nokaw, kawflee...', 14225, 1, 0, 'erekem SAY_DEATH'),
+ (-1608015, 'Free tommfly onw. Ra-aak... Not find usekh-ekh! Escape!', 14218, 1, 0, 'erekem SAY_SPAWN'),
+ (-1608016, 'My-raaakfavorite! Awk awk awk! Raa-kaa!', 14220, 1, 0, 'erekem SAY_ADD_KILLED'),
+ (-1608017, 'Nasty little...A-ak, kaw! Kill! Yes, kill you!', 14221, 1, 0, 'erekem SAY_BOTH_ADDS_KILLED'),
+-- Ichoron
+ (-1608018, 'Stand aside, mortals!', 14230, 1, 0, 'ichoron SAY_AGGRO'),
+ (-1608019, 'I am a force of nature!', 14234, 1, 0, 'ichoron SAY_SLAY_1'),
+ (-1608020, 'I shall pass!', 14235, 1, 0, 'ichoron SAY_SLAY_2'),
+ (-1608021, 'You can not stop the tide!', 14236, 1, 0, 'ichoron SAY_SLAY_3'),
+ (-1608022, 'I... recede.', 14237, 1, 0, 'ichoron SAY_DEATH'),
+ (-1608023, 'I... am fury... unrestrained!', 14239, 1, 0, 'ichoron SAY_SPAWN'),
+ (-1608024, 'I shall consume, decimate, devastate, and destroy! Yield now to the wrath of the pounding sea!', 14231, 1, 0, 'ichoron SAY_ENRAGE'),
+ (-1608025, 'I will not be contained! Ngyah!!', 14233, 1, 0, 'ichoron SAY_SHATTER'),
+ (-1608026, 'Water can hold any form, take any shape... overcome any obstacle.', 14232, 1, 0, 'ichoron SAY_BUBBLE'),
+-- Xevozz
+ (-1608027, 'It seems my freedom must be bought with blood...', 14499, 1, 0, 'xevozz SAY_AGGRO'),
+ (-1608028, 'Nothing personal.', 14504, 1, 0, 'xevozz SAY_SLAY_1'),
+ (-1608029, 'Business concluded.', 14505, 1, 0, 'xevozz SAY_SLAY_2'),
+ (-1608030, 'Profit!', 14506, 1, 0, 'xevozz SAY_SLAY_3'),
+ (-1608031, 'This is an... unrecoverable... loss.', 14507, 1, 0, 'xevozz SAY_DEATH'),
+ (-1608032, 'Back in business! Now to execute an exit strategy.', 14498, 1, 0, 'xevozz SAY_SPAWNED'),
+ (-1608033, 'It would seem that a renegotiation is in order.', 14503, 1, 0, 'xevozz SAY_CHARGED'),
+ (-1608034, 'The air teems with latent energy... quite the harvest!', 14501, 1, 0, 'xevozz SAY_REPEAT_SUMMON_1'),
+ (-1608035, 'Plentiful, exploitable resources... primed for acquisition!', 14502, 1, 0, 'xevozz SAY_REPEAT_SUMMON_2'),
+ (-1608036, 'Intriguing... a high quantity of arcane energy is near. Time for some prospecting...', 14500, 1, 0, 'xevozz SAY_SUMMON_ENERGY'),
+-- Zuramat
+ (-1608037, 'Eradicate.', 13996, 1, 0, 'zuramat SAY_AGGRO'),
+ (-1608038, 'More... energy.', 13999, 1, 0, 'zuramat SAY_SLAY_1'),
+ (-1608039, 'Relinquish.', 14000, 1, 0, 'zuramat SAY_SLAY_2'),
+ (-1608040, 'Fall... to shadow.', 14001, 1, 0, 'zuramat SAY_SLAY_3'),
+ (-1608041, 'Disperse.', 14002, 1, 0, 'zuramat SAY_DEATH'),
+ (-1608042, 'I am... renewed.', 13995, 1, 0, 'zuramat SAY_SPAWN'),
+ (-1608043, 'Know... my... pain.', 13997, 1, 0, 'zuramat SAY_SHIELD'),
+ (-1608044, 'Gaze... into the void.', 13998, 1, 0, 'zuramat SAY_WHISPER');
+
+-- -1 615 000 OBSIDIAN SANCTUM
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Shadron
+ (-1615000, 'I fear nothing! Least of all you!', 14111,1,0, 'shadron SAY_SHADRON_AGGRO'),
+ (-1615001, 'You are insignificant!', 14112,1,0, 'shadron SAY_SHADRON_SLAY_1'),
+ (-1615002, 'Such mediocre resistance!', 14113,1,0, 'shadron SAY_SHADRON_SLAY_2'),
+ (-1615003, 'We...are superior! How could this...be...', 14118, 1,0,'shadron SAY_SHADRON_DEATH'),
+ (-1615004, 'You are easily bested! ', 14114,1,0, 'shadron SAY_SHADRON_BREATH'),
+ (-1615005, 'I will take pity on you Sartharion, just this once.', 14117, 1,0,'shadron SAY_SHADRON_RESPOND'),
+ (-1615006, 'Father tought me well!', 14115,1,0, 'shadron SAY_SHADRON_SPECIAL_1'),
+ (-1615007, 'On your knees!', 14116,1,0, 'shadron SAY_SHADRON_SPECIAL_2'),
+-- Tenebron
+ (-1615008, 'You have no place here. Your place is among the departed.', 14122,1,0, 'tenebron SAY_TENEBRON_AGGRO'),
+ (-1615009, 'No contest.', 14123,1,0, 'tenebron SAY_TENEBRON_SLAY_1'),
+ (-1615010, 'Typical... Just as I was having fun.', 14124,1,0, 'tenebron SAY_TENEBRON_SLAY_2'),
+ (-1615011, 'I should not... have held back...', 14129,1,0, 'tenebron SAY_TENEBRON_DEATH'),
+ (-1615012, 'To darkness I condemn you...', 14125,1,0, 'tenebron SAY_TENEBRON_BREATH'),
+ (-1615013, 'It is amusing to watch you struggle. Very well, witness how it is done.', 14128, 1,0,'tenebron SAY_TENEBRON_RESPOND'),
+ (-1615014, 'Arrogant little creatures! To challenge powers you do not yet understand...', 14126,1,0, 'tenebron SAY_TENEBRON_SPECIAL_1'),
+ (-1615015, 'I am no mere dragon! You will find I am much, much, more...', 14127, 1,0,'tenebron SAY_TENEBRON_SPECIAL_2'),
+-- Sartharion
+ (-1615016, 'It is my charge to watch over these eggs. I will see you burn before any harm comes to them!', 14093,1,0, 'sartharion SAY_SARTHARION_AGGRO'),
+ (-1615017, 'This pathetic siege ends NOW!', 14103,1,0, 'sartharion SAY_SARTHARION_BERSERK'),
+ (-1615018, 'Burn, you miserable wretches!', 14098, 1,0,'sartharion SAY_SARTHARION_BREATH'),
+ (-1615019, 'Shadron! Come to me, all is at risk!', 14105,1,0, 'sartharion SARTHARION_CALL_SHADRON'),
+ (-1615020, 'Tenebron! The eggs are yours to protect as well!', 14106,1,0, 'sartharion SAY_SARTHARION_CALL_TENEBRON'),
+ (-1615021, 'Vesperon! The clutch is in danger! Assist me!', 14104,1,0, 'sartharion SAY_SARTHARION_CALL_VESPERON'),
+ (-1615022, 'Such is the price... of failure...', 14107,1,0, 'sartharion SAY_SARTHARION_DEATH'),
+ (-1615023, 'Such flammable little insects....', 14099,1,0, 'sartharion SAY_SARTHARION_SPECIAL_1'),
+ (-1615024, 'Your charred bones will litter the floor!', 14100,1,0, 'sartharion SAY_SARTHARION_SPECIAL_2'),
+ (-1615025, 'How much heat can you take?', 14101,1,0, 'sartharion SAY_SARTHARION_SPECIAL_3'),
+ (-1615026, 'All will be reduced to ash!', 14102,1,0, 'sartharion SAY_SARTHARION_SPECIAL_4'),
+ (-1615027, 'You will make a fine meal for the hatchlings.', 14094,1,0, 'sartharion SAY_SARTHARION_SLAY_1'),
+ (-1615028, 'You are the grave disadvantage.', 14096,1,0, 'sartharion SAY_SARTHARION_SLAY_2'),
+ (-1615029, 'This is why we call you lesser beeings.', 14097,1,0, 'sartharion SAY_SARTHARION_SLAY_3'),
+-- Vesperon
+ (-1615030, 'You pose no threat, lesser beings...give me your worst!', 14133, 1,0,'vesperon SAY_VESPERON_AGGRO'),
+ (-1615031, 'The least you could do is put up a fight...', 14134,1,0, 'vesperon SAY_VESPERON_SLAY_1'),
+ (-1615032, 'Was that the best you can do?', 14135,1,0, 'vesperon SAY_VESPERON_SLAY_2'),
+ (-1615033, 'I still have some...fight..in...me...', 14140, 1,0,'vesperon SAY_VESPERON_DEATH'),
+ (-1615034, 'I will pick my teeth with your bones!', 14136,1,0, 'vesperon SAY_VESPERON_BREATH'),
+ (-1615035, 'Father was right about you, Sartharion...You are a weakling!', 14139,1,0, 'vesperon SAY_VESPERON_RESPOND'),
+ (-1615036, 'Aren\'t you tricky...I have a few tricks of my own...', 14137,1,0, 'vesperon SAY_VESPERON_SPECIAL_1'),
+ (-1615037, 'Unlike, I have many talents.', 14138,1,0, 'vesperon SAY_VESPERON_SPECIAL_2');
+
+-- -1 616 000 EYE OF ETERNITY
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Malygos
+ (-1616000, 'I will teach you IGNORANT children just how little you know of magic...', 14524,1,0, 'malygos SAY_ANTI_MAGIC_SHELL'),
+ (-1616001, 'YOU WILL NOT SUCCEED WHILE I DRAW BREATH!', 14518,1,0, 'malygos SAY_BREATH_ATTACK'),
+ (-1616002, 'I AM UNSTOPPABLE!', 14533,1,0, 'malygos SAY_HIGH_DAMAGE_MODE'),
+ (-1616003, 'Watch helplessly as your hopes are swept away...', 14525, 1,0,'malygos SAY_MAGIC_BLAST'),
+ (-1616004, 'Still standing? Not for long...', 14537, 1,0,'malygos SAY_GENERIC_SPELL_1'),
+ (-1616005, 'Your cause is lost!', 14538, 1,0,'malygos SAY_GENERIC_SPELL_2'),
+ (-1616006, 'Your fragile mind will be shattered! ', 14539,1,0, 'malygos SAY_GENERIC_SPELL_3'),
+ (-1616007, 'UNTHINKABLE! The mortals will destroy...e-everything...my sister...what have you-', 14540,1,0, 'malygos SAY_DEATH'),
+ (-1616008, 'Lesser beings, intruding here! A shame that your excess courage does not compensate for your stupidity!', 14512,1,0, 'malygos SAY_PREFIGHT_1'),
+ (-1616009, 'None but the blue dragonflight are welcome here! Perhaps this is the work of Alexstrasza? Well then, she has sent you to your deaths.', 14513,1,0, 'malygos SAY_PREFIGHT_2'),
+ (-1616010, 'What could you hope to accomplish, to storm brassily into my domain? To employ MAGIC? Against ME? *Laughs*', 14514,1,0, 'malygos SAY_PREFIGHT_3'),
+ (-1616011, 'I am without limits here...the rules of your cherished reality do not apply...In this realm, I am in control...', 14515, 1,0,'malygos SAY_PREFIGHT_4'),
+ (-1616012, 'I give you one chance. Pledge loyalty to me, and perhaps I won\'t slaughter you for your insolence!', 14516,1,0, 'malygos SAY_PREFIGHT_5'),
+ (-1616013, 'My patience has reached its limit, I WILL BE RID OF YOU!', 14517,1,0, 'malygos SAY_PHASE1_AGGRO'),
+ (-1616014, 'I had hoped to end your lives quickly, but you have proven more...resilient then I had anticipated. None the less, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must...And if it means your...extinction...THEN SO BE IT!', 14522,1,0, 'malygos SAY_PHASE1_END'),
+ (-1616015, 'Your stupidity has finally caught up to you!', 14519,1,0, 'malygos SAY_PHASE1_SLAY_1'),
+ (-1616016, 'More artifacts to confiscate...', 14520, 1,0,'malygos SAY_PHASE1_SLAY_2'),
+ (-1616017, '*Laughs* How very...naive.. ', 14521,1,0, 'malygos SAY_PHASE1_SLAY_3'),
+ (-1616018, 'Few have experienced the pain I will now inflict on you!', 14523, 1,0,'malygos SAY_PHASE2_AGGRO'),
+ (-1616019, 'ENOUGH! If you intend to reclaim Azeroth\'s magic, then you shall have it... ', 14529,1,0, 'malygos SAY_PHASE2_END'),
+ (-1616020, 'Your energy will be put to good use!', 14526,1,0, 'malygos SAY_PHASE2_SLAY_1'),
+ (-1616021, 'I AM THE SPELL WEAVER! My power is INFINITE!', 14527, 1,0,'malygos SAY_PHASE2_SLAY_2'),
+ (-1616022, 'Your spirit will linger here forever!', 14528, 1,0,'malygos SAY_PHASE2_SLAY_3'),
+ (-1616023, 'Now your benefactors make their appearance...But they are too late. The powers contained here are powerful enough to destroy the world ten times over! What do you think they will do to you?', 14530,1,0, 'malygos SAY_PHASE3_INTRO'),
+ (-1616024, 'SUBMIT!', 14531,1,0, 'malygos SAY_PHASE3_AGGRO'),
+ (-1616025, 'Alexstrasza! Another of your brood falls!', 14534,1,0, 'malygos SAY_PHASE3_SLAY_1'),
+ (-1616026, 'Little more then gnats!', 14535, 1,0,'malygos SAY_PHASE3_SLAY_2'),
+ (-1616027, 'Your red allies will share your fate...', 14536, 1,0,'slad_ran SAY_PHASE3_SLAY_3'),
+ (-1616028, 'The powers at work here exceed anything you could possibly imagine!', 14532, 1,0,'malygos SAY_PHASE3_BIG_ATTACK');
+
+-- -1 619 000 AHN'KAHET
+ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+-- Jedoga Shadowseeker
+ (-1619000, 'These are sacred halls, your intrusion will be met with death', 14343, 1, 0, 'jedoga SAY_AGGRO'),
+ (-1619001, 'Who among you is devoted', 14344, 1, 0, 'jedoga SAY_C_SACRIFICE_1'),
+ (-1619002, 'You there! Step foward', 14345, 1, 0, 'jedoga SAY_C_SACRIFICE_2'),
+ (-1619003, 'Yogg-Saron, grant me your power!', 14346, 1, 0, 'jedoga SAY_SACRIFICE_1'),
+ (-1619004, 'Master, a gift for you!', 14347, 1, 0, 'jedoga SAY_SACRIFICE_2'),
+ (-1619005, 'Glory to the Yogg-Saron!', 14348, 1, 0, 'jedoga SAY_SLAY_1'),
+ (-1619006, 'You are unworthy', 14349, 1, 0, 'jedoga SAY_SLAY_2'),
+ (-1619007, 'Get up! You haven\'t suffered enough', 14350, 1, 0, 'jedoga SAY_SLAY_3'),
+ (-1619008, 'Do not expect your sacrilege... to go unpunished.', 14351, 1, 0, 'jedoga SAY_DEATH'),
+ (-1619009, 'The elements themselves will rise up against the civilized world! Only the faithful will be spared!', 14352, 1, 0, 'jedoga SAY_PREACHING_1'),
+ (-1619010, 'Immortality can be yours. But only if you pledge yourself fully to Yogg-Saron!', 14353, 1, 0, 'jedoga SAY_PREACHING_2'),
+ (-1619011, 'Here on the very borders of his domain. You will expirience powers you would never have imagined!', 14354, 1, 0, 'jedoga SAY_PREACHING_3'),
+ (-1619012, 'You have traveled long and risked much to be here. Your devotion shall be rewarded.', 14355, 1, 0, 'jedoga SAY_PREACHING_4'),
+ (-1619013, 'The faithful shall be exalted! But there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!', 14356, 1, 0, 'jedoga SAY_PREACHING_5'),
+-- Elder Nadox
+ (-1619014, 'The secrets of the deep shall remain hidden.', 14033, 1, 0, 'nadox SAY_AGGRO'),
+ (-1619015, 'Sleep now, in the cold dark.', 14036, 1, 0, 'nadox SAY_SLAY_1'),
+ (-1619016, 'For the Lich King!', 14307, 1, 0, 'nadox SAY_SLAY_2'),
+ (-1619017, 'Perhaps we will be allies soon.', 14038, 1, 0, 'nadox SAY_SLAY_3'),
+ (-1619018, 'Master, is my service complete?', 14039, 1, 0, 'nadox SAY_DEATH'),
+ (-1619019, 'The young must not grow hungry.', 14034, 1, 0, 'nadox SAY_EGG_SAC_1'),
+ (-1619020, 'Shad\'ak kerish\'akak', 14035, 1, 0, 'nadox SAY_EGG_SAC_2'),
+-- Prince Taldaram
+ (-1619021, 'I will feast on your remains.', 14360, 1, 0, 'taldaram SAY_AGGRO'),
+ (-1619022, '(Elfish)', 14365, 1, 0, 'taldaram SAY_SLAY_1'),
+ (-1619023, 'I will drink no blood before it is time.', 14366, 1, 0, 'taldaram SAY_SLAY_2'),
+ (-1619024, 'One final embrace.', 14367, 1, 0, 'taldaram SAY_SLAY_3'),
+ (-1619025, 'Still ... I hunger, still ... I thirst...', 14368, 1, 0, 'taldaram SAY_DEATH'),
+ (-1619026, 'Your heartbeat is music to my ears.', 14361, 1, 0, 'taldaram SAY_VANISH_1'),
+ (-1619027, 'I am nowhere. I am everywhere. I am the watcher, unseen.', 14362, 1, 0, 'taldaram SAY_VANISH_2'),
+ (-1619028, 'So appetizing.', 14363, 1, 0, 'taldaram SAY_FEED_1'),
+ (-1619029, 'Fresh, warm blood. It has been too long.', 14364, 1, 0, 'taldaram SAY_FEED_2'),
+-- Herald Volazj
+ (-1619030, '??? ??? ???', 14043, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619031, 'Ywaq ma phgwa\\\'cul hnakf. - They are the whisper on the shivering wind.', 14045, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619032, '?!? !?! ?!?', 14046, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619033, '!?! !?! !?!', 14047, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619034, 'Iilth vwah, uhn\'agth fhssh za. - Where one falls, many shall take its place.', 14048, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619035, '... ...! ...?', 14049, 1, 0, 'volazj SAY_AGGRO'),
+ (-1619036, 'Phasing', 14044, 1, 0, 'volazj SAY_AGGRO');
diff --git a/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql b/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql
new file mode 100644
index 00000000000..f8d10a64cf3
--- /dev/null
+++ b/src/bindings/scripts/sql/WotLK/wotlk_bosses.sql
@@ -0,0 +1,124 @@
+/* */
+/* AZJOL-NERUB */
+/* */
+
+/* AHN'KAHET */
+UPDATE `instance_template` SET `script`='instance_ahn_kahet' WHERE `map`=4494;
+UPDATE `creature_template` SET `ScriptName`='boss_jedoga' WHERE `entry`='29310';
+UPDATE `creature_template` SET `ScriptName`='boss_nadox' WHERE `entry`='29309';
+UPDATE `creature_template` SET `ScriptName`='boss_taldaram' WHERE `entry`='29308';
+UPDATE `creature_template` SET `ScriptName`='boss_volazj' WHERE `entry`='29311';
+
+/* AZJOL-NERUB */
+UPDATE `instance_template` SET `script`='instance_azjol_nerub' WHERE `map`=3477;
+UPDATE `creature_template` SET `ScriptName`='boss_anub_arak' WHERE `entry`='29120';
+UPDATE `creature_template` SET `ScriptName`='boss_hardronox' WHERE `entry`='28921';
+UPDATE `creature_template` SET `ScriptName`='boss_krik_thir' WHERE `entry`='28684';
+
+/* THE CULLING OF STRATHOLME */
+UPDATE `instance_template` SET `script`='instance_culling_of_stratholme' WHERE `map`=4100;
+UPDATE `creature_template` SET `ScriptName`='boss_epoch' WHERE `entry`='26532';
+UPDATE `creature_template` SET `ScriptName`='boss_mal_ganis' WHERE `entry`='26533';
+UPDATE `creature_template` SET `ScriptName`='boss_meathook' WHERE `entry`='26529';
+UPDATE `creature_template` SET `ScriptName`='boss_salramm' WHERE `entry`='26530';
+
+/* DRAK'THARON KEEP */
+UPDATE `instance_template` SET `script`='instance_drak_tharon' WHERE `map`=4196;
+UPDATE `creature_template` SET `ScriptName`='boss_dred' WHERE `entry`='27483';
+UPDATE `creature_template` SET `ScriptName`='boss_novos' WHERE `entry`='26631';
+UPDATE `creature_template` SET `ScriptName`='boss_tharon_ja' WHERE `entry`='26632';
+UPDATE `creature_template` SET `ScriptName`='boss_trollgore' WHERE `entry`='26630';
+
+/* GUNDRAK */
+UPDATE `instance_template` SET `script`='instance_gundrak' WHERE `map` =4375;
+UPDATE `creature_template` SET `ScriptName`='boss_eck' WHERE `entry`='29932';
+UPDATE `creature_template` SET `ScriptName`='boss_drakkari_colossus' WHERE `entry`='29307';
+UPDATE `creature_template` SET `ScriptName`='boss_gal_darah' WHERE `entry`='29306';
+UPDATE `creature_template` SET `ScriptName`='boss_moorabi' WHERE `entry`='29305';
+UPDATE `creature_template` SET `ScriptName`='boss_slad_ran' WHERE `entry`='29304';
+
+/* */
+/* THE NEXUS */
+/* */
+
+/* EYE OF ETERNITY */
+UPDATE `instance_template` SET `script`='instance_eye_of_eternity' WHERE `map`=4500;
+UPDATE `creature_template` SET `ScriptName`='boss_malygos' WHERE `entry`='28859';
+
+/* NEXUS */
+UPDATE `instance_template` SET `script`='instance_nexus' WHERE `map`=4120;
+UPDATE `creature_template` SET `ScriptName`='boss_anomalus' WHERE `entry`='26763';
+UPDATE `creature_template` SET `ScriptName`='npc_chaotic_rift' WHERE `entry`='26918';
+UPDATE `creature_template` SET `ScriptName`='mob_crazed_mana_wraith' WHERE `entry`='26746';
+UPDATE `creature_template` SET `ScriptName`='boss_keristrasza' WHERE `entry`='26723';
+UPDATE `creature_template` SET `ScriptName`='boss_magus_telestra' WHERE `entry`='26731';
+UPDATE `creature_template` SET `ScriptName`='boss_ormorok' WHERE `entry`='26794';
+UPDATE `creature_template` SET `ScriptName`='boss_commander_stoutbeard' WHERE `entry`='26796';
+UPDATE `creature_template` SET `ScriptName`='boss_commander_kolurg' WHERE `entry`='26798';
+
+/* OCULUS */
+UPDATE `instance_template` SET `script`='instance_oculus' WHERE `map`=4228;
+UPDATE `creature_template` SET `ScriptName`='boss_drakos' WHERE `entry`='27654';
+UPDATE `creature_template` SET `ScriptName`='boss_eregos' WHERE `entry`='27656';
+UPDATE `creature_template` SET `ScriptName`='boss_urom' WHERE `entry`='27655';
+UPDATE `creature_template` SET `ScriptName`='boss_varos' WHERE `entry`='27447';
+
+/* OBSIDIAN SANCTUM */
+UPDATE `instance_template` SET `script`='instance_obsidian_sanctum' WHERE `map`=4493;
+UPDATE `creature_template` SET `ScriptName`='boss_sartharion' WHERE `entry`='28860';
+UPDATE `creature_template` SET `ScriptName`='mob_vesperon' WHERE `entry`='30449';
+UPDATE `creature_template` SET `ScriptName`='mob_shadron' WHERE `entry`='30451';
+UPDATE `creature_template` SET `ScriptName`='mob_tenebron' WHERE `entry`='30452';
+UPDATE `creature_template` SET `ScriptName`='mob_whelp' WHERE `entry`='30890';
+UPDATE `creature_template` SET `ScriptName`='mob_whelp' WHERE `entry`='31214';
+
+/* */
+/* ULDUAR */
+/* */
+
+/* HALLS OF LIGHTNING */
+UPDATE `instance_template` SET `script`='instance_halls_of_lightning' WHERE `map`=4272;
+UPDATE `creature_template` SET `ScriptName`='boss_bjarngrim' WHERE `entry`='28586';
+UPDATE `creature_template` SET `ScriptName`='boss_ionar' WHERE `entry`='28546';
+UPDATE `creature_template` SET `ScriptName`='spark_of_ionar' WHERE `entry`='28962';
+UPDATE `creature_template` SET `ScriptName`='boss_volkhan' WHERE `entry`='28587';
+UPDATE `creature_template` SET `ScriptName`='mob_molten_golem' WHERE `entry`='28695';
+UPDATE `creature_template` SET `ScriptName`='boss_loken' WHERE `entry`='28923';
+/* HALLS OF STONE */
+UPDATE `instance_template` SET `script`='instance_halls_of_stone' WHERE `map`=4264;
+UPDATE `creature_template` SET `ScriptName`='boss_krystallus' WHERE `entry`='27977';
+UPDATE `creature_template` SET `ScriptName`='boss_maiden_of_grief' WHERE `entry`='27975';
+UPDATE `creature_template` SET `ScriptName`='boss_sjonnir' WHERE `entry`='27978';
+
+/* */
+/* UTGARDE KEEP */
+/* */
+
+/* UTGARDE KEEP */
+UPDATE `instance_template` SET `script`='instance_keep' WHERE `map`=206;
+UPDATE `creature_template` SET `ScriptName`='boss_dalronn' WHERE `entry`='24201';
+UPDATE `creature_template` SET `ScriptName`='boss_ingvar' WHERE `entry`='23954';
+UPDATE `creature_template` SET `ScriptName`='boss_keleseth' WHERE `entry`='23953';
+UPDATE `creature_template` SET `ScriptName`='boss_skarvald' WHERE `entry`='24200';
+
+/* UTGARDE PINNACLE */
+UPDATE `instance_template` SET `script`='instance_pinnacle' WHERE `map`=1196;
+UPDATE `creature_template` SET `ScriptName`='boss_palehoof' WHERE `entry`='26687';
+UPDATE `creature_template` SET `ScriptName`='boss_skadi' WHERE `entry`='26693';
+UPDATE `creature_template` SET `ScriptName`='boss_svala' WHERE `entry`='26668';
+UPDATE `creature_template` SET `ScriptName`='boss_ymiron' WHERE `entry`='26861';
+
+/* VAULT OF ARCHAVON */
+UPDATE `instance_template` SET `script`='instance_archavon' WHERE `map`=4603;
+UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125';
+UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353';
+
+/* VIOLET HOLD */
+UPDATE `instance_template` SET `script`='instance_violet_hold' WHERE `map`=4415;
+UPDATE `creature_template` SET `ScriptName`='boss_cyanigosa' WHERE `entry`='31134';
+UPDATE `creature_template` SET `ScriptName`='boss_erekem' WHERE `entry`='29315';
+UPDATE `creature_template` SET `ScriptName`='boss_ichoron' WHERE `entry`='29313';
+UPDATE `creature_template` SET `ScriptName`='boss_lavanthor' WHERE `entry`='29312';
+UPDATE `creature_template` SET `ScriptName`='boss_moragg' WHERE `entry`='29316';
+UPDATE `creature_template` SET `ScriptName`='boss_xevozz' WHERE `entry`='29266';
+UPDATE `creature_template` SET `ScriptName`='boss_zuramat' WHERE `entry`='29314';
diff --git a/src/bindings/scripts/system.cpp b/src/bindings/scripts/system.cpp
index 893e476e2fd..ab62e530681 100644
--- a/src/bindings/scripts/system.cpp
+++ b/src/bindings/scripts/system.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Dynamic/FactoryHolder.h b/src/framework/Dynamic/FactoryHolder.h
index 39c6061a687..858b8c1e1d3 100644
--- a/src/framework/Dynamic/FactoryHolder.h
+++ b/src/framework/Dynamic/FactoryHolder.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Dynamic/ObjectRegistry.h b/src/framework/Dynamic/ObjectRegistry.h
index 6e4b9aca53b..8c2659e8f53 100644
--- a/src/framework/Dynamic/ObjectRegistry.h
+++ b/src/framework/Dynamic/ObjectRegistry.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/Grid.h b/src/framework/GameSystem/Grid.h
index 326101d68dd..cebaebc68c6 100644
--- a/src/framework/GameSystem/Grid.h
+++ b/src/framework/GameSystem/Grid.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/GridLoader.h b/src/framework/GameSystem/GridLoader.h
index 23d32858e50..8a483044f8f 100644
--- a/src/framework/GameSystem/GridLoader.h
+++ b/src/framework/GameSystem/GridLoader.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/GridRefManager.h b/src/framework/GameSystem/GridRefManager.h
index 715d13fa2fe..bd32f836e18 100644
--- a/src/framework/GameSystem/GridRefManager.h
+++ b/src/framework/GameSystem/GridRefManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/GridReference.h b/src/framework/GameSystem/GridReference.h
index 5f9dbaf5279..d4bd6752515 100644
--- a/src/framework/GameSystem/GridReference.h
+++ b/src/framework/GameSystem/GridReference.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/NGrid.h b/src/framework/GameSystem/NGrid.h
index a4863bb287e..126703febd2 100644
--- a/src/framework/GameSystem/NGrid.h
+++ b/src/framework/GameSystem/NGrid.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -75,21 +75,21 @@ class TRINITY_DLL_DECL NGrid
public:
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES, ThreadModel> GridType;
- NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) :
- i_gridId(id), i_cellstate(GRID_STATE_INVALID), i_x(x), i_y(y), i_GridObjectDataLoaded(false)
- {
- i_GridInfo = GridInfo(expiry, unload);
- }
+ NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true)
+ : i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false)
+ {
+ i_GridInfo = GridInfo(expiry, unload);
+ }
const GridType& operator()(unsigned short x, unsigned short y) const { return i_cells[x][y]; }
GridType& operator()(unsigned short x, unsigned short y) { return i_cells[x][y]; }
- inline const uint32& GetGridId(void) const { return i_gridId; }
- inline void SetGridId(const uint32 id) const { i_gridId = id; }
- inline grid_state_t GetGridState(void) const { return i_cellstate; }
- inline void SetGridState(grid_state_t s) { i_cellstate = s; }
- inline int32 getX() const { return i_x; }
- inline int32 getY() const { return i_y; }
+ const uint32& GetGridId(void) const { return i_gridId; }
+ void SetGridId(const uint32 id) const { i_gridId = id; }
+ grid_state_t GetGridState(void) const { return i_cellstate; }
+ void SetGridState(grid_state_t s) { i_cellstate = s; }
+ int32 getX() const { return i_x; }
+ int32 getY() const { return i_y; }
void link(GridRefManager<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES, ThreadModel> >* pTo)
{
diff --git a/src/framework/GameSystem/TypeContainer.h b/src/framework/GameSystem/TypeContainer.h
index 8d4989debb7..9e4c6da65e2 100644
--- a/src/framework/GameSystem/TypeContainer.h
+++ b/src/framework/GameSystem/TypeContainer.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/TypeContainerFunctions.h b/src/framework/GameSystem/TypeContainerFunctions.h
index 4ca4e660236..f9945f84ac7 100644
--- a/src/framework/GameSystem/TypeContainerFunctions.h
+++ b/src/framework/GameSystem/TypeContainerFunctions.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/TypeContainerFunctionsPtr.h b/src/framework/GameSystem/TypeContainerFunctionsPtr.h
index 6bb4c9e4bf5..b22c07db2b4 100644
--- a/src/framework/GameSystem/TypeContainerFunctionsPtr.h
+++ b/src/framework/GameSystem/TypeContainerFunctionsPtr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/GameSystem/TypeContainerVisitor.h b/src/framework/GameSystem/TypeContainerVisitor.h
index 40f61b65cc4..97570b370c2 100644
--- a/src/framework/GameSystem/TypeContainerVisitor.h
+++ b/src/framework/GameSystem/TypeContainerVisitor.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Makefile.am b/src/framework/Makefile.am
new file mode 100644
index 00000000000..34ec997cc06
--- /dev/null
+++ b/src/framework/Makefile.am
@@ -0,0 +1,65 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(srcdir)
+
+## Build MaNGOS framework library as convenience library.
+# libMaNGOSScript shared library will later be reused by world server daemon.
+noinst_LIBRARIES = libmangosframework.a
+libmangosframework_a_SOURCES = \
+ Policies/ObjectLifeTime.cpp \
+ Utilities/EventProcessor.cpp
+
+## Additional files to include when running 'make dist'
+# Source and header files for the Framework.
+EXTRA_DIST = \
+ Dynamic/FactoryHolder.h \
+ Dynamic/ObjectRegistry.h \
+ GameSystem/Grid.h \
+ GameSystem/GridLoader.h \
+ GameSystem/GridRefManager.h \
+ GameSystem/GridReference.h \
+ GameSystem/NGrid.h \
+ GameSystem/TypeContainer.h \
+ GameSystem/TypeContainerFunctions.h \
+ GameSystem/TypeContainerFunctionsPtr.h \
+ GameSystem/TypeContainerVisitor.h \
+ Network/SocketDefines.h \
+ Platform/CompilerDefs.h \
+ Platform/Define.h \
+ Policies/CreationPolicy.h \
+ Policies/ObjectLifeTime.h \
+ Policies/Singleton.h \
+ Policies/SingletonImp.h \
+ Policies/ThreadingModel.h \
+ Utilities/CountedReference/Reference.h \
+ Utilities/CountedReference/ReferenceHolder.h \
+ Utilities/CountedReference/ReferenceImpl.h \
+ Utilities/LinkedReference/RefManager.h \
+ Utilities/LinkedReference/Reference.h \
+ Utilities/ByteConverter.h \
+ Utilities/Callback.h \
+ Utilities/EventProcessor.h \
+ Utilities/UnorderedMap.h \
+ Utilities/LinkedList.h \
+ Utilities/TypeList.h
diff --git a/src/framework/Network/SocketDefines.h b/src/framework/Network/SocketDefines.h
index bb59725bb76..e69f2fb41e0 100644
--- a/src/framework/Network/SocketDefines.h
+++ b/src/framework/Network/SocketDefines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Platform/CompilerDefs.h b/src/framework/Platform/CompilerDefs.h
index 64d4976210c..691acb2e6d7 100644
--- a/src/framework/Platform/CompilerDefs.h
+++ b/src/framework/Platform/CompilerDefs.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Platform/Define.h b/src/framework/Platform/Define.h
index 5e0cdfdd179..59c2418c745 100644
--- a/src/framework/Platform/Define.h
+++ b/src/framework/Platform/Define.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 Mangos <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -57,6 +57,8 @@
# define TRINITY_GET_PROC_ADDR dlsym
# if defined(__APPLE_CC__) && defined(BIG_ENDIAN)
# define TRINITY_IMPORT __attribute__ ((longcall))
+# elif defined(__x86_64__)
+# define TRINITY_IMPORT
# else
# define TRINITY_IMPORT __attribute__ ((cdecl))
# endif //__APPLE_CC__ && BIG_ENDIAN
diff --git a/src/framework/Policies/CreationPolicy.h b/src/framework/Policies/CreationPolicy.h
index df46d764917..91bec9eab37 100644
--- a/src/framework/Policies/CreationPolicy.h
+++ b/src/framework/Policies/CreationPolicy.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Policies/ObjectLifeTime.cpp b/src/framework/Policies/ObjectLifeTime.cpp
index cb963f9c2b0..852e382a0e9 100644
--- a/src/framework/Policies/ObjectLifeTime.cpp
+++ b/src/framework/Policies/ObjectLifeTime.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Policies/ObjectLifeTime.h b/src/framework/Policies/ObjectLifeTime.h
index aaf46810085..86303f889fb 100644
--- a/src/framework/Policies/ObjectLifeTime.h
+++ b/src/framework/Policies/ObjectLifeTime.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ namespace Trinity
class TRINITY_DLL_DECL ObjectLifeTime
{
public:
- inline static void ScheduleCall(void (*destroyer)() )
+ static void ScheduleCall(void (*destroyer)() )
{
at_exit( destroyer );
}
@@ -44,7 +44,7 @@ namespace Trinity
};
template <class T>
- inline void ObjectLifeTime<T>::OnDeadReference(void)// We don't handle Dead Reference for now
+ void ObjectLifeTime<T>::OnDeadReference(void) // We don't handle Dead Reference for now
{
throw std::runtime_error("Dead Reference");
}
diff --git a/src/framework/Policies/Singleton.h b/src/framework/Policies/Singleton.h
index 6961200c760..66daaba5a9a 100644
--- a/src/framework/Policies/Singleton.h
+++ b/src/framework/Policies/Singleton.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Policies/SingletonImp.h b/src/framework/Policies/SingletonImp.h
index 20d311858a7..89a4738ae22 100644
--- a/src/framework/Policies/SingletonImp.h
+++ b/src/framework/Policies/SingletonImp.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Policies/ThreadingModel.h b/src/framework/Policies/ThreadingModel.h
index e41ed53b416..a380fe78323 100644
--- a/src/framework/Policies/ThreadingModel.h
+++ b/src/framework/Policies/ThreadingModel.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/ByteConverter.h b/src/framework/Utilities/ByteConverter.h
index bfb5fea1471..d9282c1787d 100644
--- a/src/framework/Utilities/ByteConverter.h
+++ b/src/framework/Utilities/ByteConverter.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/Callback.h b/src/framework/Utilities/Callback.h
index 05fa2d9d160..28c0931e6e7 100644
--- a/src/framework/Utilities/Callback.h
+++ b/src/framework/Utilities/Callback.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/CountedReference/Reference.h b/src/framework/Utilities/CountedReference/Reference.h
index 3c4a2185651..1e1083e1a66 100644
--- a/src/framework/Utilities/CountedReference/Reference.h
+++ b/src/framework/Utilities/CountedReference/Reference.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/CountedReference/ReferenceHolder.h b/src/framework/Utilities/CountedReference/ReferenceHolder.h
index f4cbf240493..4cfb7d16ded 100644
--- a/src/framework/Utilities/CountedReference/ReferenceHolder.h
+++ b/src/framework/Utilities/CountedReference/ReferenceHolder.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/CountedReference/ReferenceImpl.h b/src/framework/Utilities/CountedReference/ReferenceImpl.h
index b3f7ab2aab7..c3116a21cf4 100644
--- a/src/framework/Utilities/CountedReference/ReferenceImpl.h
+++ b/src/framework/Utilities/CountedReference/ReferenceImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/EventProcessor.cpp b/src/framework/Utilities/EventProcessor.cpp
index b547392065a..852f84bc4e2 100644
--- a/src/framework/Utilities/EventProcessor.cpp
+++ b/src/framework/Utilities/EventProcessor.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/EventProcessor.h b/src/framework/Utilities/EventProcessor.h
index 0ce4251def7..d0a98c80e30 100644
--- a/src/framework/Utilities/EventProcessor.h
+++ b/src/framework/Utilities/EventProcessor.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/LinkedList.h b/src/framework/Utilities/LinkedList.h
index a25bbf75d5e..171ff3601e3 100644
--- a/src/framework/Utilities/LinkedList.h
+++ b/src/framework/Utilities/LinkedList.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/LinkedReference/RefManager.h b/src/framework/Utilities/LinkedReference/RefManager.h
index 5f0e3a9e10b..ed580f49ec2 100644
--- a/src/framework/Utilities/LinkedReference/RefManager.h
+++ b/src/framework/Utilities/LinkedReference/RefManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/LinkedReference/Reference.h b/src/framework/Utilities/LinkedReference/Reference.h
index bba58cf06d3..c77d3a2cbdb 100644
--- a/src/framework/Utilities/LinkedReference/Reference.h
+++ b/src/framework/Utilities/LinkedReference/Reference.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement
virtual ~Reference() {}
// Create new link
- inline void link(TO* toObj, FROM* fromObj)
+ void link(TO* toObj, FROM* fromObj)
{
assert(fromObj); // fromObj MUST not be NULL
if(isValid())
@@ -59,16 +59,16 @@ template <class TO, class FROM> class Reference : public LinkedListElement
// We don't need the reference anymore. Call comes from the refFrom object
// Tell our refTo object, that the link is cut
- inline void unlink() { targetObjectDestroyLink(); delink(); iRefTo = NULL; iRefFrom = NULL; }
+ void unlink() { targetObjectDestroyLink(); delink(); iRefTo = NULL; iRefFrom = NULL; }
// Link is invalid due to destruction of referenced target object. Call comes from the refTo object
// Tell our refFrom object, that the link is cut
- inline void invalidate() // the iRefFrom MUST remain!!
+ void invalidate() // the iRefFrom MUST remain!!
{
sourceObjectDestroyLink(); delink(); iRefTo = NULL;
}
- inline bool isValid() const // Only check the iRefTo
+ bool isValid() const // Only check the iRefTo
{
return iRefTo != NULL;
}
@@ -83,10 +83,10 @@ template <class TO, class FROM> class Reference : public LinkedListElement
Reference<TO,FROM> * nocheck_prev() { return((Reference<TO,FROM> *) LinkedListElement::nocheck_prev()); }
Reference<TO,FROM> const * nocheck_prev() const { return((Reference<TO,FROM> const *) LinkedListElement::nocheck_prev()); }
- inline TO* operator ->() const { return iRefTo; }
- inline TO* getTarget() const { return iRefTo; }
+ TO* operator ->() const { return iRefTo; }
+ TO* getTarget() const { return iRefTo; }
- inline FROM* getSource() const { return iRefFrom; }
+ FROM* getSource() const { return iRefFrom; }
};
//=====================================================
diff --git a/src/framework/Utilities/TypeList.h b/src/framework/Utilities/TypeList.h
index 143a9738381..07b1ebad3e6 100644
--- a/src/framework/Utilities/TypeList.h
+++ b/src/framework/Utilities/TypeList.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/framework/Utilities/UnorderedMap.h b/src/framework/Utilities/UnorderedMap.h
index a1de27cb615..dd539cc0bda 100644
--- a/src/framework/Utilities/UnorderedMap.h
+++ b/src/framework/Utilities/UnorderedMap.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/AccountMgr.cpp b/src/game/AccountMgr.cpp
index 6d27df2cb73..a39203f3755 100644
--- a/src/game/AccountMgr.cpp
+++ b/src/game/AccountMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,11 +25,7 @@
#include "Policies/SingletonImp.h"
#include "Util.h"
-#ifdef DO_POSTGRESQL
-extern DatabasePostgre LoginDatabase;
-#else
-extern DatabaseMysql LoginDatabase;
-#endif
+extern DatabaseType LoginDatabase;
INSTANTIATE_SINGLETON_1(AccountMgr);
diff --git a/src/game/AccountMgr.h b/src/game/AccountMgr.h
index febd5c6216b..adb1bdfa6b9 100644
--- a/src/game/AccountMgr.h
+++ b/src/game/AccountMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
new file mode 100644
index 00000000000..ce2c46a64cb
--- /dev/null
+++ b/src/game/AchievementMgr.cpp
@@ -0,0 +1,1812 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "AchievementMgr.h"
+#include "Common.h"
+#include "Player.h"
+#include "WorldPacket.h"
+#include "DBCEnums.h"
+#include "GameEventMgr.h"
+#include "ObjectMgr.h"
+#include "Guild.h"
+#include "Database/DatabaseEnv.h"
+#include "World.h"
+#include "SpellMgr.h"
+#include "ArenaTeam.h"
+#include "ProgressBar.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
+#include "Language.h"
+
+#include "Policies/SingletonImp.h"
+
+INSTANTIATE_SINGLETON_1(AchievementGlobalMgr);
+
+namespace MaNGOS
+{
+ class AchievementChatBuilder
+ {
+ public:
+ AchievementChatBuilder(Player const& pl, ChatMsg msgtype, int32 textId, uint32 ach_id)
+ : i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
+ void operator()(WorldPacket& data, int32 loc_idx)
+ {
+ char const* text = objmgr.GetMangosString(i_textId,loc_idx);
+
+ data << uint8(i_msgtype);
+ data << uint32(LANG_UNIVERSAL);
+ data << uint64(i_player.GetGUID());
+ data << uint32(5);
+ data << uint64(i_player.GetGUID());
+ data << uint32(strlen(text)+1);
+ data << text;
+ data << uint8(0);
+ data << uint32(i_achievementId);
+ }
+
+ private:
+ Player const& i_player;
+ ChatMsg i_msgtype;
+ int32 i_textId;
+ uint32 i_achievementId;
+ };
+} // namespace MaNGOS
+
+
+bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
+{
+ if(dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` for criteria (Entry: %u) have wrong data type (%u), ignore.", criteria->ID,dataType);
+ return false;
+ }
+
+ switch(criteria->requiredType)
+ {
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
+ case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE:
+ break;
+ default:
+ sLog.outErrorDb( "Table `achievement_criteria_data` have data for not supported criteria type (Entry: %u Type: %u), ignore.", criteria->ID, criteria->requiredType);
+ return false;
+ }
+
+ switch(dataType)
+ {
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE:
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
+ if(!creature.id || !objmgr.GetCreatureTemplate(creature.id))
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) have not existed creature id in value1 (%u), ignore.",
+ criteria->ID, criteria->requiredType,dataType,creature.id);
+ return false;
+ }
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
+ if(!classRace.class_id && !classRace.race_id)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) must have not 0 in one from value fields, ignore.",
+ criteria->ID, criteria->requiredType,dataType);
+ return false;
+ }
+ if(classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE)==0)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) have not existed class in value1 (%u), ignore.",
+ criteria->ID, criteria->requiredType,dataType,classRace.class_id);
+ return false;
+ }
+ if(classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE)==0)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) have not existed race in value2 (%u), ignore.",
+ criteria->ID, criteria->requiredType,dataType,classRace.race_id);
+ return false;
+ }
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
+ if(health.percent < 1 || health.percent > 100)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) have wrong percent value in value1 (%u), ignore.",
+ criteria->ID, criteria->requiredType,dataType,health.percent);
+ return false;
+ }
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD:
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA:
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA:
+ {
+ SpellEntry const* spellEntry = sSpellStore.LookupEntry(aura.spell_id);
+ if(!spellEntry)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have wrong spell id in value1 (%u), ignore.",
+ 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)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have wrong spell effect index in value2 (%u), ignore.",
+ 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->EffectApplyAuraName[aura.effect_idx])
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have non-aura spell effect (ID: %u Effect: %u), ignore.",
+ 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;
+ }
+ return true;
+ }
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA:
+ if(!GetAreaEntryByAreaID(area.id))
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) have wrong area id in value1 (%u), ignore.",
+ criteria->ID, criteria->requiredType,dataType,area.id);
+ return false;
+ }
+ return true;
+ default:
+ sLog.outErrorDb( "Table `achievement_criteria_data` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,dataType);
+ return false;
+ }
+ return false;
+}
+
+bool AchievementCriteriaData::Meets(Player const* source, Unit const* target) const
+{
+ switch(dataType)
+ {
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE:
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
+ if (!target || target->GetTypeId()!=TYPEID_UNIT)
+ return false;
+ if (target->GetEntry() != creature.id)
+ return false;
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
+ if (!target || target->GetTypeId()!=TYPEID_PLAYER)
+ return false;
+ if(classRace.class_id && classRace.class_id != ((Player*)target)->getClass())
+ return false;
+ if(classRace.race_id && classRace.race_id != ((Player*)target)->getRace())
+ return false;
+ return true;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
+ if (!target || target->GetTypeId()!=TYPEID_PLAYER)
+ return false;
+ return target->GetHealth()*100 <= health.percent*target->GetMaxHealth();
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD:
+ return target && target->GetTypeId() == TYPEID_PLAYER && !target->isAlive() && ((Player*)target)->GetDeathTimer() != 0;
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA:
+ return source->HasAura(aura.spell_id,aura.effect_idx);
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA:
+ {
+ uint32 zone_id,area_id;
+ source->GetZoneAndAreaId(zone_id,area_id);
+ return area.id==zone_id || area.id==area_id;
+ }
+ case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA:
+ return target && target->HasAura(aura.spell_id,aura.effect_idx);
+ }
+
+ return false;
+}
+
+bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target) const
+{
+ for(Storage::const_iterator itr = storage.begin(); itr != storage.end(); ++itr)
+ if(!itr->Meets(source,target))
+ return false;
+
+ return true;
+}
+
+AchievementMgr::AchievementMgr(Player *player)
+{
+ m_player = player;
+}
+
+AchievementMgr::~AchievementMgr()
+{
+}
+
+void AchievementMgr::Reset()
+{
+ for(CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
+ {
+ WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4);
+ data << uint32(iter->first);
+ m_player->SendDirectMessage(&data);
+ }
+
+ for(CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
+ {
+ WorldPacket data(SMSG_CRITERIA_DELETED,4);
+ data << uint32(iter->first);
+ m_player->SendDirectMessage(&data);
+ }
+
+ m_completedAchievements.clear();
+ m_criteriaProgress.clear();
+ DeleteFromDB(m_player->GetGUIDLow());
+
+ // re-fill data
+ CheckAllAchievementCriteria();
+}
+
+void AchievementMgr::DeleteFromDB(uint32 lowguid)
+{
+ CharacterDatabase.BeginTransaction ();
+ CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE guid = %u",lowguid);
+ CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE guid = %u",lowguid);
+ CharacterDatabase.CommitTransaction ();
+}
+
+void AchievementMgr::SaveToDB()
+{
+ if(!m_completedAchievements.empty())
+ {
+ bool need_execute = false;
+ std::ostringstream ssdel;
+ std::ostringstream ssins;
+ for(CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
+ {
+ if(!iter->second.changed)
+ continue;
+
+ /// first new/changed record prefix
+ if(!need_execute)
+ {
+ ssdel << "DELETE FROM character_achievement WHERE guid = " << GetPlayer()->GetGUIDLow() << " AND achievement IN (";
+ ssins << "INSERT INTO character_achievement (guid, achievement, date) VALUES ";
+ need_execute = true;
+ }
+ /// next new/changed record prefix
+ else
+ {
+ ssdel << ", ";
+ ssins << ", ";
+ }
+
+ // new/changed record data
+ ssdel << iter->first;
+ ssins << "("<<GetPlayer()->GetGUIDLow() << ", " << iter->first << ", " << uint64(iter->second.date) << ")";
+
+ /// mark as saved in db
+ iter->second.changed = false;
+ }
+
+ if(need_execute)
+ ssdel << ")";
+
+ if(need_execute)
+ {
+ CharacterDatabase.Execute( ssdel.str().c_str() );
+ CharacterDatabase.Execute( ssins.str().c_str() );
+ }
+ }
+
+ if(!m_criteriaProgress.empty())
+ {
+ /// prepare deleting and insert
+ bool need_execute_del = false;
+ bool need_execute_ins = false;
+ std::ostringstream ssdel;
+ std::ostringstream ssins;
+ for(CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
+ {
+ if(!iter->second.changed)
+ continue;
+
+ // deleted data (including 0 progress state)
+ {
+ /// first new/changed record prefix (for any counter value)
+ if(!need_execute_del)
+ {
+ ssdel << "DELETE FROM character_achievement_progress WHERE guid = " << GetPlayer()->GetGUIDLow() << " AND criteria IN (";
+ need_execute_del = true;
+ }
+ /// next new/changed record prefix
+ else
+ ssdel << ", ";
+
+ // new/changed record data
+ ssdel << iter->first;
+ }
+
+ // store data only for real progress
+ if(iter->second.counter != 0)
+ {
+ /// first new/changed record prefix
+ if(!need_execute_ins)
+ {
+ ssins << "INSERT INTO character_achievement_progress (guid, criteria, counter, date) VALUES ";
+ need_execute_ins = true;
+ }
+ /// next new/changed record prefix
+ else
+ ssins << ", ";
+
+ // new/changed record data
+ ssins << "(" << GetPlayer()->GetGUIDLow() << ", " << iter->first << ", " << iter->second.counter << ", " << iter->second.date << ")";
+ }
+
+ /// mark as updated in db
+ iter->second.changed = false;
+ }
+
+ if(need_execute_del) // DELETE ... IN (.... _)_
+ ssdel << ")";
+
+ if(need_execute_del || need_execute_ins)
+ {
+ if(need_execute_del)
+ CharacterDatabase.Execute( ssdel.str().c_str() );
+ if(need_execute_ins)
+ CharacterDatabase.Execute( ssins.str().c_str() );
+ }
+ }
+}
+
+void AchievementMgr::LoadFromDB(QueryResult *achievementResult, QueryResult *criteriaResult)
+{
+ if(achievementResult)
+ {
+ do
+ {
+ Field *fields = achievementResult->Fetch();
+ CompletedAchievementData& ca = m_completedAchievements[fields[0].GetUInt32()];
+ ca.date = time_t(fields[1].GetUInt64());
+ ca.changed = false;
+ } while(achievementResult->NextRow());
+ delete achievementResult;
+ }
+
+ if(criteriaResult)
+ {
+ do
+ {
+ Field *fields = criteriaResult->Fetch();
+
+ uint32 id = fields[0].GetUInt32();
+ uint32 counter = fields[1].GetUInt32();
+ time_t date = time_t(fields[2].GetUInt64());
+
+ AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(id);
+ if (!criteria || (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(NULL)))
+ continue;
+
+ CriteriaProgress& progress = m_criteriaProgress[id];
+ progress.counter = counter;
+ progress.date = date;
+ progress.changed = false;
+ } while(criteriaResult->NextRow());
+ delete criteriaResult;
+ }
+
+}
+
+void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
+{
+ if(GetPlayer()->GetSession()->PlayerLoading())
+ return;
+
+ #ifdef MANGOS_DEBUG
+ if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
+ sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
+ #endif
+
+ if(Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId()))
+ {
+ MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
+ MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
+ guild->BroadcastWorker(say_do,GetPlayer());
+ }
+
+ if(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL|ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
+ {
+ // broadcast realm first reached
+ WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+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);
+ }
+ else
+ {
+ CellPair p = MaNGOS::ComputeCellPair(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
+
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
+ MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
+ MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> > say_worker(GetPlayer(),sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
+ TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> >, WorldTypeMapContainer > message(say_worker);
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, message, *GetPlayer()->GetMap());
+ }
+
+ WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
+ data.append(GetPlayer()->GetPackGUID());
+ data << uint32(achievement->ID);
+ data << uint32(secsToTimeBitFields(time(NULL)));
+ data << uint32(0);
+ GetPlayer()->SendMessageToSetInRange(&data, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY), true);
+}
+
+void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress)
+{
+ WorldPacket data(SMSG_CRITERIA_UPDATE, 8+4+8);
+ data << uint32(id);
+
+ // the counter is packed like a packed Guid
+ data.appendPackGUID(progress->counter);
+
+ data.append(GetPlayer()->GetPackGUID());
+ data << uint32(0);
+ data << uint32(secsToTimeBitFields(progress->date));
+ data << uint32(0); // timer 1
+ data << uint32(0); // timer 2
+ GetPlayer()->SendDirectMessage(&data);
+}
+
+/**
+ * called at player login. The player might have fulfilled some achievements when the achievement system wasn't working yet
+ */
+void AchievementMgr::CheckAllAchievementCriteria()
+{
+ // suppress sending packets
+ for(uint32 i=0; i<ACHIEVEMENT_CRITERIA_TYPE_TOTAL; ++i)
+ UpdateAchievementCriteria(AchievementCriteriaTypes(i));
+}
+
+static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = { 1057, 1107, 1108 };
+static const uint32 achievIdForDangeon[][4] =
+{
+ // ach_cr_id,is_dungeon,is_raid,is_heroic_dungeon
+ { 321, true, true, true },
+ { 916, false, true, false },
+ { 917, false, true, false },
+ { 918, true, false, false },
+ { 2219, false, false, true },
+ { 0, false, false, false }
+};
+
+/**
+ * this function will be called whenever the user might have done a criteria relevant action
+ */
+void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
+{
+ if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
+ sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time);
+
+ if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
+ return;
+
+ AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
+ for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
+ {
+ AchievementCriteriaEntry const *achievementCriteria = (*i);
+
+ if (achievementCriteria->groupFlag & ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP && GetPlayer()->GetGroup())
+ continue;
+
+ AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement);
+ if (!achievement)
+ continue;
+
+ if ((achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_HORDE && GetPlayer()->GetTeam() != HORDE) ||
+ (achievement->factionFlag == ACHIEVEMENT_FACTION_FLAG_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE))
+ continue;
+
+ // don't update already completed criteria
+ if (IsCompletedCriteria(achievementCriteria,achievement))
+ continue;
+
+ switch (type)
+ {
+ // std. case: increment at 1
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ // std case: increment at miscvalue1
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS:
+ case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL:
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, miscvalue1, PROGRESS_ACCUMULATE);
+ break;
+ // std case: high value at miscvalue1
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: /* FIXME: for online player only currently */
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, miscvalue1, PROGRESS_HIGHEST);
+ break;
+
+ // specialized cases
+
+ case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(achievementCriteria->kill_creature.creatureID != miscvalue1)
+ continue;
+
+ // LOT achievement->ID required special custom checks
+ switch(achievement->ID)
+ {
+ // Just heroic
+ case 489: case 490: case 491: case 492: case 493: case 494: case 495:
+ case 496: case 497: case 498: case 499: case 500: case 563: case 565:
+ case 567: case 569: case 573: case 575: case 577: case 623: case 625:
+ case 667: case 668: case 669: case 670: case 671: case 672: case 673:
+ case 674: case 675: case 676: case 677: case 678: case 679: case 680:
+ case 681: case 682: case 1367: case 1368: case 1378: case 1379:
+ case 1380: case 1381: case 1382: case 1383: case 1384: case 1385:
+ case 1386: case 1387: case 1388: case 1389: case 1390: case 1393:
+ case 1394: case 1400: case 1402: case 1504: case 1505: case 1506:
+ case 1507: case 1508: case 1509: case 1510: case 1511: case 1512:
+ case 1513: case 1514: case 1515: case 1721: case 1754: case 1756:
+ case 1768: case 1817: case 1865:
+ if(GetPlayer()->GetDifficulty()!=DIFFICULTY_HEROIC)
+ continue;
+ break;
+ // Heroic + other
+ case 579: case 1296: case 1297: case 1816: case 1834: case 1857: case 1859:
+ case 1860: case 1861: case 1862: case 1864: case 1866: case 1867: case 1868:
+ case 1870: case 1871: case 1872: case 1873: case 1875: case 1877: case 1919:
+ case 2036: case 2037: case 2038: case 2039: case 2040: case 2041: case 2042:
+ case 2043: case 2044: case 2045: case 2046: case 2048: case 2052: case 2053:
+ case 2054: case 2056: case 2057: case 2058: case 2139: case 2140: case 2147:
+ case 2149: case 2150: case 2151: case 2152: case 2154: case 2155: case 2156:
+ case 2157: case 2179: case 2181: case 2183: case 2185: case 2186:
+ if(GetPlayer()->GetDifficulty()!=DIFFICULTY_HEROIC)
+ continue;
+ // FIX ME: mark as fail always until implement
+ continue;
+ // Normal + other
+ case 578: case 624: case 1790: case 1856: case 1858: case 1869: case 1874:
+ case 1996: case 1997: case 2047: case 2049: case 2050: case 2051: case 2146:
+ case 2148: case 2153: case 2178: case 2180: case 2182: case 2184: case 2187:
+ if(GetPlayer()->GetDifficulty()!=DIFFICULTY_NORMAL)
+ continue;
+ // FIX ME: mark as fail always until implement
+ continue;
+ // Just Normal
+ default:
+ if(GetPlayer()->GetDifficulty()!=DIFFICULTY_NORMAL)
+ continue;
+ break;
+ };
+
+ SetCriteriaProgress(achievementCriteria, miscvalue2, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL:
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->getLevel());
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL:
+ // update at loading or specific skill update
+ if(miscvalue1 && miscvalue1 != achievementCriteria->reach_skill_level.skillID)
+ continue;
+ if(uint32 skillvalue = GetPlayer()->GetBaseSkillValue(achievementCriteria->reach_skill_level.skillID))
+ SetCriteriaProgress(achievementCriteria, skillvalue);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL:
+ // update at loading or specific skill update
+ if(miscvalue1 && miscvalue1 != achievementCriteria->learn_skill_level.skillID)
+ continue;
+ if(uint32 maxSkillvalue = GetPlayer()->GetPureMaxSkillValue(achievementCriteria->learn_skill_level.skillID))
+ SetCriteriaProgress(achievementCriteria, maxSkillvalue);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
+ if(m_completedAchievements.find(achievementCriteria->complete_achievement.linkedAchievement) != m_completedAchievements.end())
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT:
+ {
+ uint32 counter =0;
+ for(QuestStatusMap::iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
+ if(itr->second.m_rewarded)
+ counter++;
+ SetCriteriaProgress(achievementCriteria, counter);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
+ {
+ // speedup for non-login case
+ if(miscvalue1 && miscvalue1 != achievementCriteria->complete_quests_in_zone.zoneID)
+ continue;
+
+ uint32 counter =0;
+ for(QuestStatusMap::iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
+ {
+ Quest const* quest = objmgr.GetQuestTemplate(itr->first);
+ if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
+ counter++;
+ }
+ SetCriteriaProgress(achievementCriteria, counter);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(GetPlayer()->GetMapId() != achievementCriteria->complete_battleground.mapID)
+ continue;
+ SetCriteriaProgress(achievementCriteria, miscvalue1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(GetPlayer()->GetMapId() != achievementCriteria->death_at_map.mapID)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH:
+ {
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ // skip wrong arena achievements, if not achievIdByArenaSlot then normal total death counter
+ bool notfit = false;
+ for(int i = 0; i < MAX_ARENA_SLOT; ++i)
+ {
+ if(achievIdByArenaSlot[i] == achievement->ID)
+ {
+ BattleGround* bg = GetPlayer()->GetBattleGround();
+ if(!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != i)
+ notfit = true;
+
+ break;
+ }
+ }
+ if(notfit)
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON:
+ {
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+
+ Map const* map = GetPlayer()->GetMap();
+ if(!map->IsDungeon())
+ continue;
+
+ // search case
+ bool found = false;
+ for(int i = 0; achievIdForDangeon[i][0]; ++i)
+ {
+ if(achievIdForDangeon[i][0] == achievement->ID)
+ {
+ if(map->IsRaid())
+ {
+ // if raid accepted (ignore difficulty)
+ if(!achievIdForDangeon[i][2])
+ break; // for
+ }
+ else if(GetPlayer()->GetDifficulty()==DIFFICULTY_NORMAL)
+ {
+ // dungeon in normal mode accepted
+ if(!achievIdForDangeon[i][1])
+ break; // for
+ }
+ else
+ {
+ // dungeon in heroic mode accepted
+ if(!achievIdForDangeon[i][3])
+ break; // for
+ }
+
+ found = true;
+ break; // for
+ }
+ }
+ if(!found)
+ continue;
+
+ //FIXME: work only for instances where max==min for players
+ if(((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(miscvalue1 != achievementCriteria->killed_by_creature.creatureEntry)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+
+ // if team check required: must kill by opposition faction
+ if(achievement->ID==318 && miscvalue2==GetPlayer()->GetTeam())
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING:
+ {
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(achievement->ID == 1260)
+ {
+ if(Player::GetDrunkenstateByValue(GetPlayer()->GetDrunkValue()) != DRUNKEN_SMASHED)
+ continue;
+ if(!IsHolidayActive(HOLIDAY_BREWFEST))
+ continue;
+ }
+ // miscvalue1 is the ingame fallheight*100 as stored in dbc
+ SetCriteriaProgress(achievementCriteria, miscvalue1);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(miscvalue2 != achievementCriteria->death_from.type)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
+ if(GetPlayer()->GetQuestRewardStatus(achievementCriteria->complete_quest.questID))
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
+ case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
+ if (!miscvalue1 || miscvalue1 != achievementCriteria->be_spell_target.spellID)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
+ if (!miscvalue1 || miscvalue1 != achievementCriteria->cast_spell.spellID)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
+ // spell always provide and at login spell learning.
+ if(miscvalue1 && miscvalue1!=achievementCriteria->learn_spell.spellID)
+ continue;
+ if(GetPlayer()->HasSpell(miscvalue1))
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM:
+ // speedup for non-login case
+ if(miscvalue1 && achievementCriteria->own_item.itemID != miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetItemCount(achievementCriteria->own_item.itemID, true));
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
+ // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
+ if(!miscvalue1)
+ continue;
+ if(achievementCriteria->use_item.itemID != miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
+ // You _have_ to loot that item, just owning it when logging in does _not_ count!
+ if(!miscvalue1)
+ continue;
+ if(miscvalue1 != achievementCriteria->own_item.itemID)
+ continue;
+ SetCriteriaProgress(achievementCriteria, miscvalue2, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA:
+ {
+ WorldMapOverlayEntry const* worldOverlayEntry = sWorldMapOverlayStore.LookupEntry(achievementCriteria->explore_area.areaReference);
+ if(!worldOverlayEntry)
+ break;
+
+ bool matchFound = false;
+ for (int i = 0; i < 3; ++i)
+ {
+ int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID[i]);
+ if(exploreFlag < 0)
+ break;
+
+ uint32 playerIndexOffset = uint32(exploreFlag) / 32;
+ uint32 mask = 1<< (uint32(exploreFlag) % 32);
+
+ if(GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
+ {
+ matchFound = true;
+ break;
+ }
+ }
+
+ if(matchFound)
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT:
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetByteValue(PLAYER_BYTES_2, 2)+1);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
+ {
+ // skip faction check only at loading
+ if (miscvalue1 && miscvalue1 != achievementCriteria->gain_reputation.factionID)
+ continue;
+
+ int32 reputation = GetPlayer()->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID);
+ if (reputation > 0)
+ SetCriteriaProgress(achievementCriteria, reputation);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION:
+ {
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetExaltedFactionCount());
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP:
+ {
+ // skip for login case
+ if(!miscvalue1)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
+ {
+ // miscvalue1 = itemid
+ // miscvalue2 = diced value
+ if(!miscvalue1)
+ continue;
+ if(miscvalue2 != achievementCriteria->roll_greed_on_loot.rollValue)
+ continue;
+ ItemPrototype const *pProto = objmgr.GetItemPrototype( miscvalue1 );
+
+ uint32 requiredItemLevel = 0;
+ if (achievementCriteria->ID == 2412 || achievementCriteria->ID == 2358)
+ requiredItemLevel = 185;
+
+ if(!pProto || pProto->ItemLevel <requiredItemLevel)
+ continue;
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE:
+ {
+ // miscvalue1 = emote
+ if(!miscvalue1)
+ continue;
+ if(miscvalue1 != achievementCriteria->do_emote.emoteID)
+ continue;
+ if(achievementCriteria->do_emote.count)
+ {
+ // those requirements couldn't be found in the dbc
+ AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
+ if(!data)
+ continue;
+
+ if(!data->Meets(GetPlayer(),unit))
+ continue;
+ }
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
+ // miscvalue1 = item_id
+ if(!miscvalue1)
+ continue;
+ if(miscvalue1 != achievementCriteria->equip_item.itemID)
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT:
+ // miscvalue1 = go entry
+ if(!miscvalue1)
+ continue;
+ if(miscvalue1 != achievementCriteria->use_gameobject.goEntry)
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
+ if (!miscvalue1)
+ continue;
+ if (miscvalue1 != achievementCriteria->fish_in_gameobject.goEntry)
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
+ {
+ // spell always provide and at login spell learning.
+ if(!miscvalue1)
+ continue;
+ // rescan only when change possible
+ SkillLineAbilityMap::const_iterator skillIter0 = spellmgr.GetBeginSkillLineAbilityMap(miscvalue1);
+ if(skillIter0 == spellmgr.GetEndSkillLineAbilityMap(miscvalue1))
+ continue;
+ if(skillIter0->second->skillId != achievementCriteria->learn_skilline_spell.skillLine)
+ continue;
+
+ uint32 spellCount = 0;
+ for (PlayerSpellMap::const_iterator spellIter = GetPlayer()->GetSpellMap().begin();
+ spellIter != GetPlayer()->GetSpellMap().end();
+ ++spellIter)
+ {
+ for(SkillLineAbilityMap::const_iterator skillIter = spellmgr.GetBeginSkillLineAbilityMap(spellIter->first);
+ skillIter != spellmgr.GetEndSkillLineAbilityMap(spellIter->first);
+ ++skillIter)
+ {
+ if(skillIter->second->skillId == achievementCriteria->learn_skilline_spell.skillLine)
+ spellCount++;
+ }
+ }
+ SetCriteriaProgress(achievementCriteria, spellCount);
+ break;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION:
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetReveredFactionCount());
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION:
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetHonoredFactionCount());
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS:
+ SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetVisibleFactionCount());
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
+ {
+ if (!miscvalue1)
+ continue;
+
+ if (!miscvalue1 || miscvalue1 != achievementCriteria->cast_spell.spellID)
+ continue;
+
+ // those requirements couldn't be found in the dbc
+ AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
+ if(!data)
+ continue;
+
+ if(!data->Meets(GetPlayer(),unit))
+ continue;
+
+ SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
+ break;
+ }
+ // std case: 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:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING:
+ break;
+ // FIXME: not triggered in code as result, need to implement
+ case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY:
+ case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE:
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID:
+ case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE:
+ case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA:
+ case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA:
+ case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA:
+ case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL:
+ case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING:
+ case ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING:
+ case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK:
+ case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM:
+ case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS:
+ case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE:
+ case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE:
+ case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS:
+ case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS:
+ case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS:
+ case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL:
+ case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
+ case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL:
+ case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS:
+ case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION:
+ case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED:
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM:
+ case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM:
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED:
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED:
+ case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED:
+ case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED:
+ case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED:
+ case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN:
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE:
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE:
+ case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL:
+ case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS:
+ case ACHIEVEMENT_CRITERIA_TYPE_TOTAL:
+ break; // Not implemented yet :(
+ }
+ if(IsCompletedCriteria(achievementCriteria,achievement))
+ CompletedCriteria(achievementCriteria,achievement);
+
+ // check again the completeness for SUMM and REQ COUNT achievements,
+ // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria
+ if (achievement->flags & ACHIEVEMENT_FLAG_SUMM)
+ {
+ if (IsCompletedAchievement(achievement))
+ CompletedAchievement(achievement);
+ }
+
+ if(AchievementEntryList const* achRefList = achievementmgr.GetAchievementByReferencedId(achievement->ID))
+ {
+ for(AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
+ if(IsCompletedAchievement(*itr))
+ CompletedAchievement(*itr);
+ }
+ }
+}
+
+static const uint32 achievIdByClass[MAX_CLASSES] = { 0, 459, 465 , 462, 458, 464, 461, 467, 460, 463, 0, 466 };
+static const uint32 achievIdByRace[MAX_RACES] = { 0, 1408, 1410, 1407, 1409, 1413, 1411, 1404, 1412, 0, 1405, 1406 };
+
+bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement)
+{
+ // counter can never complete
+ if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
+ return false;
+
+ if(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
+ {
+ // someone on this realm has already completed that achievement
+ if(achievementmgr.IsRealmCompleted(achievement))
+ return false;
+ }
+
+ CriteriaProgressMap::const_iterator itr = m_criteriaProgress.find(achievementCriteria->ID);
+ if(itr == m_criteriaProgress.end())
+ return false;
+
+ CriteriaProgress const* progress = &itr->second;
+
+ switch(achievementCriteria->requiredType)
+ {
+ case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
+ return progress->counter >= achievementCriteria->kill_creature.creatureCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL:
+ {
+ // skip wrong class achievements
+ for(int i = 1; i < MAX_CLASSES; ++i)
+ if(achievIdByClass[i] == achievement->ID && i != GetPlayer()->getClass())
+ return false;
+
+ // skip wrong race achievements
+ for(int i = 1; i < MAX_RACES; ++i)
+ if(achievIdByRace[i] == achievement->ID && i != GetPlayer()->getRace())
+ return false;
+
+ // appropriate class/race or not class/race specific
+ return progress->counter >= achievementCriteria->reach_level.level;
+ }
+ case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL:
+ return progress->counter >= achievementCriteria->reach_skill_level.skillLevel;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL:
+ return progress->counter >= (achievementCriteria->learn_skill_level.skillLevel * 75);
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
+ return progress->counter >= 1;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT:
+ return progress->counter >= achievementCriteria->complete_quest_count.totalQuestCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
+ return progress->counter >= achievementCriteria->complete_quests_in_zone.questCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
+ return progress->counter >= achievementCriteria->complete_daily_quest.questCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING:
+ return progress->counter >= achievementCriteria->fall_without_dying.fallHeight;
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
+ return progress->counter >= 1;
+ case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
+ case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
+ return progress->counter >= achievementCriteria->be_spell_target.spellCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
+ return progress->counter >= achievementCriteria->cast_spell.castCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
+ return progress->counter >= 1;
+ case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM:
+ return progress->counter >= achievementCriteria->own_item.itemCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
+ return progress->counter >= achievementCriteria->use_item.itemCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
+ return progress->counter >= achievementCriteria->loot_item.itemCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA:
+ return progress->counter >= 1;
+ case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT:
+ return progress->counter >= achievementCriteria->buy_bank_slot.numberOfSlots;
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
+ return progress->counter >= achievementCriteria->gain_reputation.reputationAmount;
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION:
+ return progress->counter >= achievementCriteria->gain_exalted_reputation.numberOfExaltedFactions;
+ case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP:
+ return progress->counter >= achievementCriteria->visit_barber.numberOfVisits;
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
+ case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
+ return progress->counter >= achievementCriteria->roll_greed_on_loot.count;
+ case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE:
+ return progress->counter >= achievementCriteria->do_emote.count;
+ case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
+ return progress->counter >= achievementCriteria->equip_item.count;
+ case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD:
+ return progress->counter >= achievementCriteria->quest_reward_money.goldInCopper;
+ case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
+ return progress->counter >= achievementCriteria->fish_in_gameobject.lootCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY:
+ return progress->counter >= achievementCriteria->loot_money.goldInCopper;
+ case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT:
+ return progress->counter >= achievementCriteria->use_gameobject.useCount;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
+ return progress->counter >= achievementCriteria->learn_skilline_spell.spellCount;
+
+ // handle all statistic-only criteria here
+ case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP:
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH:
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON:
+ case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE:
+ case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER:
+ case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER:
+ case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD:
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION:
+ case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION:
+ case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER:
+ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR:
+ return false;
+ }
+ return false;
+}
+
+void AchievementMgr::CompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement)
+{
+ // counter can never complete
+ if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
+ return;
+
+ // already completed and stored
+ if (m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
+ return;
+
+ if (IsCompletedAchievement(achievement))
+ CompletedAchievement(achievement);
+}
+
+bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
+{
+ // counter can never complete
+ if(entry->flags & ACHIEVEMENT_FLAG_COUNTER)
+ return false;
+
+ // for achievement with referenced achievement criterias get from referenced and counter from self
+ uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID;
+ uint32 achievmentForTestCount = entry->count;
+
+ AchievementCriteriaEntryList const* cList = achievementmgr.GetAchievementCriteriaByAchievement(achievmentForTestId);
+ if(!cList)
+ return false;
+ uint32 count = 0;
+
+ // For SUMM achievements, we have to count the progress of each criteria of the achievement.
+ // Oddly, the target count is NOT countained in the achievement, but in each individual criteria
+ if (entry->flags & ACHIEVEMENT_FLAG_SUMM)
+ {
+ for(AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
+ {
+ AchievementCriteriaEntry const* criteria = *itr;
+
+ CriteriaProgressMap::const_iterator itrProgress = m_criteriaProgress.find(criteria->ID);
+ if(itrProgress == m_criteriaProgress.end())
+ continue;
+
+ CriteriaProgress const* progress = &itrProgress->second;
+ count += progress->counter;
+
+ // for counters, field4 contains the main count requirement
+ if (count >= criteria->raw.count)
+ return true;
+ }
+ return false;
+ }
+
+ // Default case - need complete all or
+ bool completed_all = true;
+ for(AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
+ {
+ AchievementCriteriaEntry const* criteria = *itr;
+
+ bool completed = IsCompletedCriteria(criteria,entry);
+
+ // found an uncompleted criteria, but DONT return false yet - there might be a completed criteria with ACHIEVEMENT_CRITERIA_COMPLETE_FLAG_ALL
+ if(completed)
+ ++count;
+ else
+ completed_all = false;
+
+ // completed as have req. count of completed criterias
+ if(achievmentForTestCount > 0 && achievmentForTestCount <= count)
+ return true;
+ }
+
+ // all criterias completed requirement
+ if(completed_all && achievmentForTestCount==0)
+ return true;
+
+ return false;
+}
+
+void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype)
+{
+ if((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
+ sLog.outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow());
+
+ CriteriaProgress *progress = NULL;
+
+ CriteriaProgressMap::iterator iter = m_criteriaProgress.find(entry->ID);
+
+ if(iter == m_criteriaProgress.end())
+ {
+ // not create record for 0 counter
+ if(changeValue == 0)
+ return;
+
+ progress = &m_criteriaProgress[entry->ID];
+ progress->counter = changeValue;
+ progress->date = time(NULL);
+ }
+ else
+ {
+ progress = &iter->second;
+
+ uint32 newValue;
+ switch(ptype)
+ {
+ case PROGRESS_SET:
+ newValue = changeValue;
+ break;
+ case PROGRESS_ACCUMULATE:
+ {
+ // avoid overflow
+ uint32 max_value = std::numeric_limits<uint32>::max();
+ newValue = max_value - progress->counter > changeValue ? progress->counter + changeValue : max_value;
+ break;
+ }
+ case PROGRESS_HIGHEST:
+ newValue = progress->counter < changeValue ? changeValue : progress->counter;
+ break;
+ }
+
+ // not update (not mark as changed) if counter will have same value
+ if(progress->counter == newValue)
+ return;
+
+ progress->counter = newValue;
+ }
+
+ progress->changed = true;
+
+ if(entry->timeLimit)
+ {
+ time_t now = time(NULL);
+ if(time_t(progress->date + entry->timeLimit) < now)
+ progress->counter = 1;
+
+ // also it seems illogical, the timeframe will be extended at every criteria update
+ progress->date = now;
+ }
+ SendCriteriaUpdate(entry->ID,progress);
+}
+
+void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
+{
+ sLog.outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
+ if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
+ return;
+
+ SendAchievementEarned(achievement);
+ CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
+ ca.date = time(NULL);
+ ca.changed = true;
+
+ // don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement
+ // TODO: where do set this instead?
+ if(!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
+ achievementmgr.SetRealmCompleted(achievement);
+
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT);
+
+ // reward items and titles if any
+ AchievementReward const* reward = achievementmgr.GetAchievementReward(achievement);
+
+ // no rewards
+ if(!reward)
+ return;
+
+ // titles
+ if(uint32 titleId = reward->titleId[GetPlayer()->GetTeam() == HORDE?0:1])
+ {
+ if(CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
+ GetPlayer()->SetTitle(titleEntry);
+ }
+
+ // mail
+ if(reward->sender)
+ {
+ Item* item = reward->itemId ? Item::CreateItem(reward->itemId,1,GetPlayer ()) : NULL;
+
+ MailItemsInfo mi;
+ if(item)
+ {
+ // save new item before send
+ item->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted
+
+ // item
+ mi.AddItem(item->GetGUIDLow(), item->GetEntry(), item);
+ }
+
+ int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
+
+ // subject and text
+ std::string subject = reward->subject;
+ std::string text = reward->text;
+ if ( loc_idx >= 0 )
+ {
+ if(AchievementRewardLocale const* loc = achievementmgr.GetAchievementRewardLocale(achievement))
+ {
+ if (loc->subject.size() > size_t(loc_idx) && !loc->subject[loc_idx].empty())
+ subject = loc->subject[loc_idx];
+ if (loc->text.size() > size_t(loc_idx) && !loc->text[loc_idx].empty())
+ text = loc->text[loc_idx];
+ }
+ }
+
+ uint32 itemTextId = objmgr.CreateItemText( text );
+
+ WorldSession::SendMailTo(GetPlayer(), MAIL_CREATURE, MAIL_STATIONERY_NORMAL, reward->sender, GetPlayer()->GetGUIDLow(), subject, itemTextId , &mi, 0, 0, MAIL_CHECK_MASK_NONE);
+ }
+}
+
+void AchievementMgr::SendAllAchievementData()
+{
+ // since we don't know the exact size of the packed GUIDs this is just an approximation
+ WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4*2+m_completedAchievements.size()*4*2+m_completedAchievements.size()*7*4);
+ BuildAllDataPacket(&data);
+ GetPlayer()->GetSession()->SendPacket(&data);
+}
+
+void AchievementMgr::SendRespondInspectAchievements(Player* player)
+{
+ // since we don't know the exact size of the packed GUIDs this is just an approximation
+ WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 4+4*2+m_completedAchievements.size()*4*2+m_completedAchievements.size()*7*4);
+ data.append(GetPlayer()->GetPackGUID());
+ BuildAllDataPacket(&data);
+ player->GetSession()->SendPacket(&data);
+}
+
+/**
+ * used by both SMSG_ALL_ACHIEVEMENT_DATA and SMSG_RESPOND_INSPECT_ACHIEVEMENT
+ */
+void AchievementMgr::BuildAllDataPacket(WorldPacket *data)
+{
+ for(CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
+ {
+ *data << uint32(iter->first);
+ *data << uint32(secsToTimeBitFields(iter->second.date));
+ }
+ *data << int32(-1);
+
+ for(CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
+ {
+ *data << uint32(iter->first);
+ data->appendPackGUID(iter->second.counter);
+ data->append(GetPlayer()->GetPackGUID());
+ *data << uint32(0);
+ *data << uint32(secsToTimeBitFields(iter->second.date));
+ *data << uint32(0);
+ *data << uint32(0);
+ }
+
+ *data << int32(-1);
+}
+
+//==========================================================
+AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteriaByType(AchievementCriteriaTypes type)
+{
+ return m_AchievementCriteriasByType[type];
+}
+
+void AchievementGlobalMgr::LoadAchievementCriteriaList()
+{
+ if(sAchievementCriteriaStore.GetNumRows()==0)
+ {
+ barGoLink bar(1);
+ bar.step();
+
+ sLog.outString();
+ sLog.outErrorDb(">> Loaded 0 achievement criteria.");
+ return;
+ }
+
+ barGoLink bar( sAchievementCriteriaStore.GetNumRows() );
+ for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
+ {
+ bar.step();
+
+ AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId);
+ if(!criteria)
+ continue;
+
+ m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
+ m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria);
+ }
+
+ sLog.outString();
+ sLog.outString(">> Loaded %lu achievement criteria.",(unsigned long)m_AchievementCriteriasByType->size());
+}
+
+void AchievementGlobalMgr::LoadAchievementReferenceList()
+{
+ if(sAchievementStore.GetNumRows()==0)
+ {
+ barGoLink bar(1);
+ bar.step();
+
+ sLog.outString();
+ sLog.outErrorDb(">> Loaded 0 achievement references.");
+ return;
+ }
+
+ uint32 count = 0;
+ barGoLink bar( sAchievementStore.GetNumRows() );
+ for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
+ {
+ bar.step();
+
+ AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId);
+ if(!achievement || !achievement->refAchievement)
+ continue;
+
+ m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement);
+ ++count;
+ }
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u achievement references.",count);
+}
+
+void AchievementGlobalMgr::LoadAchievementCriteriaData()
+{
+ m_criteriaDataMap.clear(); // need for reload case
+
+ QueryResult *result = WorldDatabase.Query("SELECT criteria_id, type, value1, value2 FROM achievement_criteria_data");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+ bar.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
+ return;
+ }
+
+ uint32 count = 0;
+ barGoLink bar(result->GetRowCount());
+ do
+ {
+ bar.step();
+ Field *fields = result->Fetch();
+ uint32 criteria_id = fields[0].GetUInt32();
+
+ AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(criteria_id);
+
+ if (!criteria)
+ {
+ sLog.outErrorDb( "Table `achievement_criteria_data` have data for not existed criteria (Entry: %u), ignore.", criteria_id);
+ continue;
+ }
+
+ AchievementCriteriaData data(fields[1].GetUInt32(),fields[2].GetUInt32(),fields[3].GetUInt32());
+
+ if(!data.IsValid(criteria))
+ continue;
+
+ // this will allocate empty data set storage
+ AchievementCriteriaDataSet& dataSet = m_criteriaDataMap[criteria_id];
+
+ // add real data only for not NONE data types
+ if(data.dataType!=ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE)
+ dataSet.Add(data);
+
+ // counting data by and data types
+ ++count;
+ } while(result->NextRow());
+
+ delete result;
+
+ // post loading checks
+ for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
+ {
+ AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId);
+ if(!criteria)
+ continue;
+
+ switch(criteria->requiredType)
+ {
+ case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
+ if(!GetCriteriaDataSet(criteria))
+ sLog.outErrorDb( "Table `achievement_criteria_data` not have expected data for for criteria (Entry: %u Type: %u).", criteria->ID, criteria->requiredType);
+ break;
+ case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: // need skip generic cases
+ if(criteria->do_emote.count && !GetCriteriaDataSet(criteria))
+ sLog.outErrorDb( "Table `achievement_criteria_data` not have expected data for for criteria (Entry: %u Type: %u).", criteria->ID, criteria->requiredType);
+ break;
+ default: // unexpected case processed in IsValid check
+ break;
+ }
+
+ }
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u additional achievement criteria data.",count);
+}
+
+void AchievementGlobalMgr::LoadCompletedAchievements()
+{
+ QueryResult *result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+ bar.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded 0 realm completed achievements . DB table `character_achievement` is empty.");
+ return;
+ }
+
+ barGoLink bar(result->GetRowCount());
+ do
+ {
+ bar.step();
+ Field *fields = result->Fetch();
+ m_allCompletedAchievements.insert(fields[0].GetUInt32());
+ } while(result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString(">> Loaded %lu realm completed achievements.",(unsigned long)m_allCompletedAchievements.size());
+}
+
+void AchievementGlobalMgr::LoadRewards()
+{
+ m_achievementRewards.clear(); // need for reload case
+
+ // 0 1 2 3 4 5 6
+ QueryResult *result = WorldDatabase.Query("SELECT entry, title_A, title_H, item, sender, subject, text FROM achievement_reward");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
+ return;
+ }
+
+ uint32 count = 0;
+ barGoLink bar(result->GetRowCount());
+
+ do
+ {
+ bar.step();
+
+ Field *fields = result->Fetch();
+ uint32 entry = fields[0].GetUInt32();
+ if (!sAchievementStore.LookupEntry(entry))
+ {
+ sLog.outErrorDb( "Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry);
+ continue;
+ }
+
+ AchievementReward reward;
+ reward.titleId[0] = fields[1].GetUInt32();
+ reward.titleId[1] = fields[2].GetUInt32();
+ reward.itemId = fields[3].GetUInt32();
+ reward.sender = fields[4].GetUInt32();
+ reward.subject = fields[5].GetCppString();
+ reward.text = fields[6].GetCppString();
+
+ if ((reward.titleId[0]==0)!=(reward.titleId[1]==0))
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) only for one from teams.", entry, reward.titleId[0], reward.titleId[1]);
+
+ // must be title or mail at least
+ if (!reward.titleId[0] && !reward.titleId[1] && !reward.sender)
+ {
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry);
+ continue;
+ }
+
+ if (reward.titleId[0])
+ {
+ CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[0]);
+ if (!titleEntry)
+ {
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
+ reward.titleId[0] = 0;
+ }
+ }
+
+ if (reward.titleId[1])
+ {
+ CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[1]);
+ if (!titleEntry)
+ {
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[1]);
+ reward.titleId[1] = 0;
+ }
+ }
+
+ //check mail data before item for report including wrong item case
+ if (reward.sender)
+ {
+ if (!objmgr.GetCreatureTemplate(reward.sender))
+ {
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
+ reward.sender = 0;
+ }
+ }
+ else
+ {
+ if (reward.itemId)
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) not have sender data but have item reward, item will not rewarded", entry);
+
+ if (!reward.subject.empty())
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) not have sender data but have mail subject.", entry);
+
+ if (!reward.text.empty())
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) not have sender data but have mail text.", entry);
+ }
+
+ if (reward.itemId)
+ {
+ if (!objmgr.GetItemPrototype(reward.itemId))
+ {
+ sLog.outErrorDb( "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will be without item.", entry, reward.itemId);
+ reward.itemId = 0;
+ }
+ }
+
+ m_achievementRewards[entry] = reward;
+ ++count;
+
+ } while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u achievement rewards", count );
+}
+
+void AchievementGlobalMgr::LoadRewardLocales()
+{
+ m_achievementRewardLocales.clear(); // need for reload case
+
+ QueryResult *result = WorldDatabase.Query("SELECT entry,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty.");
+ return;
+ }
+
+ barGoLink bar(result->GetRowCount());
+
+ do
+ {
+ Field *fields = result->Fetch();
+ bar.step();
+
+ uint32 entry = fields[0].GetUInt32();
+
+ if(m_achievementRewards.find(entry)==m_achievementRewards.end())
+ {
+ sLog.outErrorDb( "Table `locales_achievement_reward` (Entry: %u) has locale strings for not existed achievement reward .", entry);
+ continue;
+ }
+
+ AchievementRewardLocale& data = m_achievementRewardLocales[entry];
+
+ for(int i = 1; i < MAX_LOCALE; ++i)
+ {
+ std::string str = fields[1+2*(i-1)].GetCppString();
+ if(!str.empty())
+ {
+ int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
+ if(idx >= 0)
+ {
+ if(data.subject.size() <= size_t(idx))
+ data.subject.resize(idx+1);
+
+ data.subject[idx] = str;
+ }
+ }
+ str = fields[1+2*(i-1)+1].GetCppString();
+ if(!str.empty())
+ {
+ int idx = objmgr.GetOrNewIndexForLocale(LocaleConstant(i));
+ if(idx >= 0)
+ {
+ if(data.text.size() <= size_t(idx))
+ data.text.resize(idx+1);
+
+ data.text[idx] = str;
+ }
+ }
+ }
+ } while (result->NextRow());
+
+ delete result;
+
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %lu achievement reward locale strings", (unsigned long)m_achievementRewardLocales.size() );
+}
diff --git a/src/game/AchievementMgr.h b/src/game/AchievementMgr.h
new file mode 100644
index 00000000000..391afedbb46
--- /dev/null
+++ b/src/game/AchievementMgr.h
@@ -0,0 +1,264 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __MANGOS_ACHIEVEMENTMGR_H
+#define __MANGOS_ACHIEVEMENTMGR_H
+
+#include "Common.h"
+#include "Policies/Singleton.h"
+#include "Database/DatabaseEnv.h"
+#include "DBCEnums.h"
+#include "DBCStores.h"
+
+#include <map>
+#include <string>
+
+typedef std::list<AchievementCriteriaEntry const*> AchievementCriteriaEntryList;
+typedef std::list<AchievementEntry const*> AchievementEntryList;
+
+typedef std::map<uint32,AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
+typedef std::map<uint32,AchievementEntryList> AchievementListByReferencedId;
+
+struct CriteriaProgress
+{
+ uint32 counter;
+ time_t date;
+ bool changed;
+};
+
+enum AchievementCriteriaDataType
+{ // value1 value2 comment
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE = 0, // 0 0
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1, // creature_id 0
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2, // class_id race_id
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH= 3, // health_percent 0
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD = 4, // 0 0 not corpse (not released body)
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5, // spell_id effect_idx
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA = 6, // area id 0
+ ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx
+};
+
+#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 8 // maximum value in AchievementCriteriaDataType enum
+
+class Player;
+class Unit;
+
+struct AchievementCriteriaData
+{
+ AchievementCriteriaDataType dataType;
+ union
+ {
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE
+ struct
+ {
+ uint32 id;
+ } creature;
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE
+ struct
+ {
+ uint32 class_id;
+ uint32 race_id;
+ } classRace;
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH
+ struct
+ {
+ uint32 percent;
+ } health;
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA
+ struct
+ {
+ uint32 spell_id;
+ uint32 effect_idx;
+ } aura;
+ // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA
+ struct
+ {
+ uint32 id;
+ } area;
+ // ...
+ struct
+ {
+ uint32 value1;
+ uint32 value2;
+ } raw;
+ };
+
+ AchievementCriteriaData() : dataType(ACHIEVEMENT_CRITERIA_DATA_TYPE_NONE)
+ {
+ raw.value1 = 0;
+ raw.value2 = 0;
+ }
+
+ AchievementCriteriaData(uint32 _dataType, uint32 _value1, uint32 _value2) : dataType(AchievementCriteriaDataType(_dataType))
+ {
+ raw.value1 = _value1;
+ raw.value2 = _value2;
+ }
+
+ bool IsValid(AchievementCriteriaEntry const* criteria);
+ bool Meets(Player const* source, Unit const* target) const;
+};
+
+struct AchievementCriteriaDataSet
+{
+ typedef std::vector<AchievementCriteriaData> Storage;
+ void Add(AchievementCriteriaData const& data) { storage.push_back(data); }
+ bool Meets(Player const* source, Unit const* target) const;
+ private:
+ Storage storage;
+};
+
+
+typedef std::map<uint32,AchievementCriteriaDataSet> AchievementCriteriaDataMap;
+
+struct AchievementReward
+{
+ uint32 titleId[2];
+ uint32 itemId;
+ uint32 sender;
+ std::string subject;
+ std::string text;
+};
+
+typedef std::map<uint32,AchievementReward> AchievementRewards;
+
+struct AchievementRewardLocale
+{
+ std::vector<std::string> subject;
+ std::vector<std::string> text;
+};
+
+typedef std::map<uint32,AchievementRewardLocale> AchievementRewardLocales;
+
+
+struct CompletedAchievementData
+{
+ time_t date;
+ bool changed;
+};
+
+typedef UNORDERED_MAP<uint32, CriteriaProgress> CriteriaProgressMap;
+typedef UNORDERED_MAP<uint32, CompletedAchievementData> CompletedAchievementMap;
+
+class Unit;
+class Player;
+class WorldPacket;
+
+class AchievementMgr
+{
+ public:
+ AchievementMgr(Player* pl);
+ ~AchievementMgr();
+
+ void Reset();
+ static void DeleteFromDB(uint32 lowguid);
+ void LoadFromDB(QueryResult *achievementResult, QueryResult *criteriaResult);
+ void SaveToDB();
+ void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
+ void CheckAllAchievementCriteria();
+ void SendAllAchievementData();
+ void SendRespondInspectAchievements(Player* player);
+ Player* GetPlayer() { return m_player;}
+
+ private:
+ enum ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST };
+ void SendAchievementEarned(AchievementEntry const* achievement);
+ void SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress);
+ void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET);
+ void CompletedCriteria(AchievementCriteriaEntry const* entry, AchievementEntry const* achievement);
+ void CompletedAchievement(AchievementEntry const* entry);
+ bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement);
+ bool IsCompletedAchievement(AchievementEntry const* entry);
+ void CompleteAchievementsWithRefs(AchievementEntry const* entry);
+ void BuildAllDataPacket(WorldPacket *data);
+
+ Player* m_player;
+ CriteriaProgressMap m_criteriaProgress;
+ CompletedAchievementMap m_completedAchievements;
+};
+
+class AchievementGlobalMgr
+{
+ public:
+ AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type);
+ AchievementCriteriaEntryList const* GetAchievementCriteriaByAchievement(uint32 id)
+ {
+ AchievementCriteriaListByAchievement::const_iterator itr = m_AchievementCriteriaListByAchievement.find(id);
+ return itr != m_AchievementCriteriaListByAchievement.end() ? &itr->second : NULL;
+ }
+
+ AchievementEntryList const* GetAchievementByReferencedId(uint32 id) const
+ {
+ AchievementListByReferencedId::const_iterator itr = m_AchievementListByReferencedId.find(id);
+ return itr != m_AchievementListByReferencedId.end() ? &itr->second : NULL;
+ }
+
+ AchievementReward const* GetAchievementReward(AchievementEntry const* achievement) const
+ {
+ AchievementRewards::const_iterator iter = m_achievementRewards.find(achievement->ID);
+ return iter!=m_achievementRewards.end() ? &iter->second : NULL;
+ }
+
+ AchievementRewardLocale const* GetAchievementRewardLocale(AchievementEntry const* achievement) const
+ {
+ AchievementRewardLocales::const_iterator iter = m_achievementRewardLocales.find(achievement->ID);
+ return iter!=m_achievementRewardLocales.end() ? &iter->second : NULL;
+ }
+
+ AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const *achievementCriteria)
+ {
+ AchievementCriteriaDataMap::const_iterator iter = m_criteriaDataMap.find(achievementCriteria->ID);
+ return iter!=m_criteriaDataMap.end() ? &iter->second : NULL;
+ }
+
+ bool IsRealmCompleted(AchievementEntry const* achievement) const
+ {
+ return m_allCompletedAchievements.find(achievement->ID) != m_allCompletedAchievements.end();
+ }
+
+ void SetRealmCompleted(AchievementEntry const* achievement)
+ {
+ m_allCompletedAchievements.insert(achievement->ID);
+ }
+
+ void LoadAchievementCriteriaList();
+ void LoadAchievementCriteriaData();
+ void LoadAchievementReferenceList();
+ void LoadCompletedAchievements();
+ void LoadRewards();
+ void LoadRewardLocales();
+ private:
+ AchievementCriteriaDataMap m_criteriaDataMap;
+
+ // store achievement criterias by type to speed up lookup
+ AchievementCriteriaEntryList m_AchievementCriteriasByType[ACHIEVEMENT_CRITERIA_TYPE_TOTAL];
+ // store achievement criterias by achievement to speed up lookup
+ AchievementCriteriaListByAchievement m_AchievementCriteriaListByAchievement;
+ // store achievements by referenced achievement id to speed up lookup
+ AchievementListByReferencedId m_AchievementListByReferencedId;
+
+ typedef std::set<uint32> AllCompletedAchievements;
+ AllCompletedAchievements m_allCompletedAchievements;
+
+ AchievementRewards m_achievementRewards;
+ AchievementRewardLocales m_achievementRewardLocales;
+};
+
+#define achievementmgr Trinity::Singleton<AchievementGlobalMgr>::Instance()
+
+#endif
diff --git a/src/game/AddonHandler.cpp b/src/game/AddonHandler.cpp
index 63582113914..4dd25c56b26 100644
--- a/src/game/AddonHandler.cpp
+++ b/src/game/AddonHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -66,63 +66,84 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target)
if (Source->rpos() + 4 > Source->size())
return false;
- *Source >> TempValue; //get real size of the packed structure
+ *Source >> TempValue; // get real size of the packed structure
// empty addon packet, nothing process, can't be received from real client
if(!TempValue)
return false;
- AddonRealSize = TempValue; //temp value because ZLIB only excepts uLongf
+ AddonRealSize = TempValue; // temp value because ZLIB only excepts uLongf
- CurrentPosition = Source->rpos(); //get the position of the pointer in the structure
+ CurrentPosition = Source->rpos(); // get the position of the pointer in the structure
- AddOnPacked.resize(AddonRealSize); //resize target for zlib action
+ AddOnPacked.resize(AddonRealSize); // resize target for zlib action
if (!uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition)!= Z_OK)
{
Target->Initialize(SMSG_ADDON_INFO);
- while(AddOnPacked.rpos() < AddOnPacked.size())
+ uint32 addonsCount;
+ AddOnPacked >> addonsCount; // addons count?
+
+ for(uint32 i = 0; i < addonsCount; ++i)
{
- std::string AddonNames;
- uint8 unk6;
- uint32 crc, unk7;
+ std::string addonName;
+ uint8 enabled;
+ uint32 crc, unk2;
// check next addon data format correctness
- if(AddOnPacked.rpos()+1+4+4+1 > AddOnPacked.size())
+ if(AddOnPacked.rpos()+1 > AddOnPacked.size())
return false;
- AddOnPacked >> AddonNames;
+ AddOnPacked >> addonName;
// recheck next addon data format correctness
- if(AddOnPacked.rpos()+4+4+1 > AddOnPacked.size())
+ if(AddOnPacked.rpos()+1+4+4 > AddOnPacked.size())
return false;
- AddOnPacked >> crc >> unk7 >> unk6;
+ AddOnPacked >> enabled >> crc >> unk2;
- //sLog.outDebug("ADDON: Name:%s CRC:%x Unknown1 :%x Unknown2 :%x", AddonNames.c_str(), crc, unk7, unk6);
+ sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2);
- *Target << (uint8)2;
+ uint8 state = (enabled ? 2 : 1);
+ *Target << uint8(state);
- uint8 unk1 = 1;
- *Target << (uint8)unk1;
+ uint8 unk1 = (enabled ? 1 : 0);
+ *Target << uint8(unk1);
if (unk1)
{
- uint8 unk2 = crc != 0x1c776d01LL; //If addon is Standard addon CRC
- *Target << (uint8)unk2;
+ uint8 unk2 = (crc != 0x4c1c776d); // If addon is Standard addon CRC
+ *Target << uint8(unk2);
if (unk2)
Target->append(tdata, sizeof(tdata));
- *Target << (uint32)0;
+ *Target << uint32(0);
}
- uint8 unk3 = 0;
- *Target << (uint8)unk3;
+ uint8 unk3 = (enabled ? 0 : 1);
+ *Target << uint8(unk3);
if (unk3)
{
- // String, 256
+ // String, 256 (null terminated?)
+ *Target << uint8(0);
}
}
+
+ uint32 unk4;
+ AddOnPacked >> unk4;
+
+ uint32 count = 0;
+ *Target << uint32(count);
+ /*for(uint32 i = 0; i < count; ++i)
+ {
+ uint32
+ string (16 bytes)
+ string (16 bytes)
+ uint32
+ }*/
+
+ if(AddOnPacked.rpos() != AddOnPacked.size())
+ sLog.outDebug("packet under read!");
}
else
{
diff --git a/src/game/AddonHandler.h b/src/game/AddonHandler.h
index 6255bd551e2..fd9ad395924 100644
--- a/src/game/AddonHandler.h
+++ b/src/game/AddonHandler.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp
index a001ea5af22..37a876bb059 100644
--- a/src/game/AggressorAI.cpp
+++ b/src/game/AggressorAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#include "AggressorAI.h"
#include "Errors.h"
#include "Creature.h"
-#include "Player.h"
#include "ObjectAccessor.h"
#include "VMapFactory.h"
#include "World.h"
@@ -38,78 +37,78 @@ AggressorAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-AggressorAI::AggressorAI(Creature *c) : CreatureAI(c), i_creature(*c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
+AggressorAI::AggressorAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
{
}
void AggressorAI::EnterEvadeMode()
{
- if( !i_creature.isAlive() )
+ if( !m_creature->isAlive() )
{
- DEBUG_LOG("Creature stopped attacking cuz his dead [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his dead [guid=%u]", m_creature->GetGUIDLow());
i_victimGuid = 0;
- i_creature.CombatStop();
- i_creature.DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
return;
}
- Unit* victim = ObjectAccessor::GetUnit(i_creature, i_victimGuid );
+ Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid );
if( !victim )
{
- DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", m_creature->GetGUIDLow());
}
else if( !victim->isAlive() )
{
- DEBUG_LOG("Creature stopped attacking cuz his victim is dead [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his victim is dead [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim->HasStealthAura() )
{
- DEBUG_LOG("Creature stopped attacking cuz his victim is stealth [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his victim is stealth [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim->isInFlight() )
{
- DEBUG_LOG("Creature stopped attacking cuz his victim is fly away [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his victim is fly away [guid=%u]", m_creature->GetGUIDLow());
}
else
{
- DEBUG_LOG("Creature stopped attacking due to target out run him [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking due to target out run him [guid=%u]", m_creature->GetGUIDLow());
//i_state = STATE_LOOK_AT_VICTIM;
//i_tracker.Reset(TIME_INTERVAL_LOOK);
}
- if(!i_creature.GetCharmerOrOwner())
+ if(!m_creature->GetCharmerOrOwner())
{
- i_creature.RemoveAllAuras();
+ m_creature->RemoveAllAuras();
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
- if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
- i_creature.GetMotionMaster()->MoveTargetedHome();
+ if( m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
+ m_creature->GetMotionMaster()->MoveTargetedHome();
}
- else if (i_creature.GetOwner() && i_creature.GetOwner()->isAlive())
- i_creature.GetMotionMaster()->MoveFollow(i_creature.GetOwner(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+ else if (m_creature->GetOwner() && m_creature->GetOwner()->isAlive())
+ m_creature->GetMotionMaster()->MoveFollow(m_creature->GetOwner(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
- i_creature.DeleteThreatList();
+ m_creature->DeleteThreatList();
i_victimGuid = 0;
- i_creature.CombatStop();
- i_creature.SetLootRecipient(NULL);
+ m_creature->CombatStop();
+ m_creature->SetLootRecipient(NULL);
}
void
AggressorAI::UpdateAI(const uint32 /*diff*/)
{
- // update i_victimGuid if i_creature.getVictim() !=0 and changed
+ // update i_victimGuid if m_creature->getVictim() !=0 and changed
if(!UpdateVictim())
return;
- i_victimGuid = i_creature.getVictim()->GetGUID();
+ i_victimGuid = m_creature->getVictim()->GetGUID();
- if( i_creature.isAttackReady() )
+ if( m_creature->isAttackReady() )
{
- if( i_creature.IsWithinMeleeRange(i_creature.getVictim()))
+ if( m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
- i_creature.AttackerStateUpdate(i_creature.getVictim());
- i_creature.resetAttackTimer();
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
}
}
}
diff --git a/src/game/AggressorAI.h b/src/game/AggressorAI.h
index 97dccbcd329..983498716e6 100644
--- a/src/game/AggressorAI.h
+++ b/src/game/AggressorAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ class TRINITY_DLL_DECL AggressorAI : public CreatureAI
public:
- AggressorAI(Creature *c);
+ explicit AggressorAI(Creature *c);
void EnterEvadeMode();
@@ -44,7 +44,6 @@ class TRINITY_DLL_DECL AggressorAI : public CreatureAI
static int Permissible(const Creature *);
private:
- Creature &i_creature;
uint64 i_victimGuid;
AggressorState i_state;
TimeTracker i_tracker;
diff --git a/src/game/AnimalRandomMovementGenerator.h b/src/game/AnimalRandomMovementGenerator.h
index c24162d2708..9c64edcaa44 100644
--- a/src/game/AnimalRandomMovementGenerator.h
+++ b/src/game/AnimalRandomMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp
index 747ad811b85..96e279f7d83 100644
--- a/src/game/ArenaTeam.cpp
+++ b/src/game/ArenaTeam.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
+ * 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
@@ -304,8 +304,11 @@ void ArenaTeam::Roster(WorldSession *session)
{
Player *pl = NULL;
+ uint8 unk308 = 0;
+
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // arena team id
+ data << uint8(unk308); // 308 unknown value but affect packet structure
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
@@ -313,18 +316,24 @@ void ArenaTeam::Roster(WorldSession *session)
{
pl = objmgr.GetPlayer(itr->guid);
- data << uint64(itr->guid); // guid
- data << uint8((pl ? 1 : 0)); // online flag
- data << itr->name; // member name
+ data << uint64(itr->guid); // guid
+ data << uint8((pl ? 1 : 0)); // online flag
+ data << itr->name; // member name
data << uint32((itr->guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
- data << uint8((pl ? pl->getLevel() : 0)); // unknown, level?
- data << uint8(itr->Class); // class
- data << uint32(itr->games_week); // played this week
- data << uint32(itr->wins_week); // wins this week
- data << uint32(itr->games_season); // played this season
- data << uint32(itr->wins_season); // wins this season
- data << uint32(itr->personal_rating); // personal rating
+ data << uint8((pl ? pl->getLevel() : 0)); // unknown, level?
+ data << uint8(itr->Class); // class
+ data << uint32(itr->games_week); // played this week
+ data << uint32(itr->wins_week); // wins this week
+ data << uint32(itr->games_season); // played this season
+ data << uint32(itr->wins_season); // wins this season
+ data << uint32(itr->personal_rating); // personal rating
+ if(unk308)
+ {
+ data << float(0.0); // 308 unk
+ data << float(0.0); // 308 unk
+ }
}
+
session->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
}
@@ -566,6 +575,28 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)
}
}
+void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)
+{
+ // called for offline player after ending rated arena match!
+ for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
+ {
+ if(itr->guid == guid)
+ {
+ // update personal rating
+ float chance = GetChanceAgainst(itr->personal_rating, againstRating);
+ int32 mod = (int32)ceil(32.0f * (0.0f - chance));
+ if (int32(itr->personal_rating) + mod < 0)
+ itr->personal_rating = 0;
+ else
+ itr->personal_rating += mod;
+ // update personal played stats
+ itr->games_week +=1;
+ itr->games_season +=1;
+ return;
+ }
+ }
+}
+
void ArenaTeam::MemberWon(Player * plr, uint32 againstRating)
{
// called for each participant after winning a match
@@ -623,11 +654,13 @@ void ArenaTeam::SaveToDB()
{
// save team and member stats to db
// called after a match has ended, or when calculating arena_points
+ CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("UPDATE arena_team_stats SET rating = '%u',games = '%u',played = '%u',rank = '%u',wins = '%u',wins2 = '%u' WHERE arenateamid = '%u'", stats.rating, stats.games_week, stats.games_season, stats.rank, stats.wins_week, stats.wins_season, GetId());
for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
{
- CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, Id, itr->guid);
+ CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, Id, GUID_LOPART(itr->guid));
}
+ CharacterDatabase.CommitTransaction();
}
void ArenaTeam::FinishWeek()
@@ -641,6 +674,19 @@ void ArenaTeam::FinishWeek()
}
}
+bool ArenaTeam::IsFighting() const
+{
+ for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
+ {
+ if (Player *p = objmgr.GetPlayer(itr->guid))
+ {
+ if (p->GetMap()->IsBattleArena())
+ return true;
+ }
+ }
+ return false;
+}
+
/*
arenateam fields (id from 2.3.3 client):
1414 - arena team id 2v2
diff --git a/src/game/ArenaTeam.h b/src/game/ArenaTeam.h
index 9641c1e5992..60c80f972d2 100644
--- a/src/game/ArenaTeam.h
+++ b/src/game/ArenaTeam.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -98,7 +98,7 @@ struct ArenaTeamMember
void ModifyPersonalRating(Player* plr, int32 mod, uint32 slot)
{
- if (personal_rating + mod < 0)
+ if (int32(personal_rating) + mod < 0)
personal_rating = 0;
else
personal_rating += mod;
@@ -179,18 +179,7 @@ class ArenaTeam
return NULL;
}
- bool IsFighting() const
- {
- for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
- {
- if (Player *p = objmgr.GetPlayer(itr->guid))
- {
- if (p->GetMap()->IsBattleArena())
- return true;
- }
- }
- return false;
- }
+ bool IsFighting() const;
bool LoadArenaTeamFromDB(uint32 ArenaTeamId);
void LoadMembersFromDB(uint32 ArenaTeamId);
@@ -211,6 +200,7 @@ class ArenaTeam
void MemberWon(Player * plr, uint32 againstRating);
int32 LostAgainst(uint32 againstRating);
void MemberLost(Player * plr, uint32 againstRating);
+ void OfflineMemberLost(uint64 guid, uint32 againstRating);
void UpdateArenaPointsHelper(std::map<uint32, uint32> & PlayerPoints);
diff --git a/src/game/ArenaTeamHandler.cpp b/src/game/ArenaTeamHandler.cpp
index 9ba2e65ec92..cebdb71411f 100644
--- a/src/game/ArenaTeamHandler.cpp
+++ b/src/game/ArenaTeamHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,7 +27,6 @@
#include "ArenaTeam.h"
#include "World.h"
#include "SocialMgr.h"
-#include "Language.h"
void WorldSession::HandleInspectArenaStatsOpcode(WorldPacket & recv_data)
{
@@ -173,7 +172,7 @@ void WorldSession::HandleArenaTeamInviteAcceptOpcode(WorldPacket & /*recv_data*/
if(!at)
return;
- if(_player->GetArenaTeamIdFromDB(_player->GetGUIDLow(), at->GetType()))
+ if(_player->GetArenaTeamId(at->GetSlot()))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ALREADY_IN_ARENA_TEAM); // already in arena team that size
return;
diff --git a/src/game/AuctionHouseBot.cpp b/src/game/AuctionHouseBot.cpp
index cb3244ee456..643e18c42d8 100644
--- a/src/game/AuctionHouseBot.cpp
+++ b/src/game/AuctionHouseBot.cpp
@@ -4,8 +4,8 @@
#include "Database/DatabaseEnv.h"
#include "Item.h"
#include "Log.h"
-#include "AuctionHouseMgr.h"
#include "ObjectMgr.h"
+#include "AuctionHouseMgr.h"
#include "Player.h"
#include "World.h"
#include "WorldSession.h"
@@ -15,7 +15,7 @@
using namespace std;
-static bool debug_Out = sConfig.GetIntDefault("AuctionHouseBot.DEBUG", 0);
+static bool debug_Out = sConfig.GetBoolDefault("AuctionHouseBot.DEBUG", false);
static vector<uint32> npcItems;
static vector<uint32> lootItems;
@@ -816,13 +816,13 @@ void AuctionHouseBot()
///////////////////////////////////////////////////////////////////////////////
void AuctionHouseBotInit()
{
- AHBSeller = sConfig.GetBoolDefault("AuctionHouseBot.EnableSeller", 0);
- AHBBuyer = sConfig.GetBoolDefault("AuctionHouseBot.EnableBuyer", 0);
- No_Bind = sConfig.GetBoolDefault("AuctionHouseBot.No_Bind", 1);
- Bind_When_Picked_Up = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Picked_Up", 0);
- Bind_When_Equipped = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Equipped", 1);
- Bind_When_Use = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Use", 1);
- Bind_Quest_Item = sConfig.GetBoolDefault("AuctionHouseBot.Bind_Quest_Item", 0);
+ AHBSeller = sConfig.GetBoolDefault("AuctionHouseBot.EnableSeller", false);
+ AHBBuyer = sConfig.GetBoolDefault("AuctionHouseBot.EnableBuyer", false);
+ No_Bind = sConfig.GetBoolDefault("AuctionHouseBot.No_Bind", true);
+ Bind_When_Picked_Up = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Picked_Up", false);
+ Bind_When_Equipped = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Equipped", true);
+ Bind_When_Use = sConfig.GetBoolDefault("AuctionHouseBot.Bind_When_Use", true);
+ Bind_Quest_Item = sConfig.GetBoolDefault("AuctionHouseBot.Bind_Quest_Item", false);
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
{
@@ -833,9 +833,9 @@ void AuctionHouseBotInit()
if (AHBSeller)
{
- Vendor_Items = sConfig.GetBoolDefault("AuctionHouseBot.VendorItems", 0);
- Loot_Items = sConfig.GetBoolDefault("AuctionHouseBot.LootItems", 1);
- Other_Items = sConfig.GetBoolDefault("AuctionHouseBot.OtherItems", 0);
+ Vendor_Items = sConfig.GetBoolDefault("AuctionHouseBot.VendorItems", false);
+ Loot_Items = sConfig.GetBoolDefault("AuctionHouseBot.LootItems", true);
+ Other_Items = sConfig.GetBoolDefault("AuctionHouseBot.OtherItems", false);
QueryResult* results = (QueryResult*) NULL;
char npcQuery[] = "SELECT distinct `item` FROM `npc_vendor`";
@@ -1056,20 +1056,20 @@ void AuctionHouseBotInit()
}
sLog.outString("AuctionHouseBot:");
- sLog.outString("loaded %d grey trade goods", greyTradeGoodsBin.size());
- sLog.outString("loaded %d white trade goods", whiteTradeGoodsBin.size());
- sLog.outString("loaded %d green trade goods", greenTradeGoodsBin.size());
- sLog.outString("loaded %d blue trade goods", blueTradeGoodsBin.size());
- sLog.outString("loaded %d purple trade goods", purpleTradeGoodsBin.size());
- sLog.outString("loaded %d orange trade goods", orangeTradeGoodsBin.size());
- sLog.outString("loaded %d yellow trade goods", yellowTradeGoodsBin.size());
- sLog.outString("loaded %d grey items", greyItemsBin.size());
- sLog.outString("loaded %d white items", whiteItemsBin.size());
- sLog.outString("loaded %d green items", greenItemsBin.size());
- sLog.outString("loaded %d blue items", blueItemsBin.size());
- sLog.outString("loaded %d purple items", purpleItemsBin.size());
- sLog.outString("loaded %d orange items", orangeItemsBin.size());
- sLog.outString("loaded %d yellow items", yellowItemsBin.size());
+ sLog.outString("loaded %u grey trade goods", greyTradeGoodsBin.size());
+ sLog.outString("loaded %u white trade goods", whiteTradeGoodsBin.size());
+ sLog.outString("loaded %u green trade goods", greenTradeGoodsBin.size());
+ sLog.outString("loaded %u blue trade goods", blueTradeGoodsBin.size());
+ sLog.outString("loaded %u purple trade goods", purpleTradeGoodsBin.size());
+ sLog.outString("loaded %u orange trade goods", orangeTradeGoodsBin.size());
+ sLog.outString("loaded %u yellow trade goods", yellowTradeGoodsBin.size());
+ sLog.outString("loaded %u grey items", greyItemsBin.size());
+ sLog.outString("loaded %u white items", whiteItemsBin.size());
+ sLog.outString("loaded %u green items", greenItemsBin.size());
+ sLog.outString("loaded %u blue items", blueItemsBin.size());
+ sLog.outString("loaded %u purple items", purpleItemsBin.size());
+ sLog.outString("loaded %u orange items", orangeItemsBin.size());
+ sLog.outString("loaded %u yellow items", yellowItemsBin.size());
}
sLog.outString("AuctionHouseBot by Paradox (original by ChrisK) has been loaded.");
sLog.outString("AuctionHouseBot now includes AHBuyer by Kerbe and Paradox");
diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp
index b36d1870b86..4d657fd6c84 100644
--- a/src/game/AuctionHouseHandler.cpp
+++ b/src/game/AuctionHouseHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
@@ -50,7 +50,7 @@ void WorldSession::HandleAuctionHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendAuctionHello(guid, unit);
}
@@ -199,7 +199,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *it = pl->GetItemByGuid( item );
//do not allow to sell already auctioned items
@@ -304,7 +304,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -367,6 +367,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
}
auction->bidder = pl->GetGUIDLow();
auction->bid = price;
+ GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price);
// after this update we should save player's money ...
CharacterDatabase.PExecute("UPDATE auctionhouse SET buyguid = '%u',lastbid = '%u' WHERE id = '%u'", auction->bidder, auction->bid, auction->Id);
@@ -390,6 +391,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
}
auction->bidder = pl->GetGUIDLow();
auction->bid = auction->buyout;
+ GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout);
auctionmgr.SendAuctionSalePendingMail( auction );
auctionmgr.SendAuctionSuccessfulMail( auction );
@@ -428,7 +430,7 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -500,7 +502,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
recv_data >> outbiddedCount;
if (recv_data.size() != (16 + outbiddedCount * 4 ))
{
- sLog.outError("Client sent bad opcode!!! with count: %u and size : %d (mustbe: %d", outbiddedCount, recv_data.size(),(16 + outbiddedCount * 4 ));
+ sLog.outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(),(16 + outbiddedCount * 4 ));
outbiddedCount = 0;
}
@@ -513,7 +515,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -562,7 +564,7 @@ void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -609,7 +611,7 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -638,3 +640,22 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
SendPacket(&data);
}
+void WorldSession::HandleAuctionListPendingSales( WorldPacket & recv_data )
+{
+ sLog.outDebug("CMSG_AUCTION_LIST_PENDING_SALES");
+ recv_data.hexlike();
+
+ uint32 count = 0;
+
+ WorldPacket data(SMSG_AUCTION_LIST_PENDING_SALES, 4);
+ data << uint32(count); // count
+ /*for(uint32 i = 0; i < count; ++i)
+ {
+ data << ""; // string
+ data << ""; // string
+ data << uint32(0);
+ data << uint32(0);
+ data << float(0);
+ }*/
+ SendPacket(&data);
+}
diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp
index 1554013af99..11b75a0be4e 100644
--- a/src/game/AuctionHouseMgr.cpp
+++ b/src/game/AuctionHouseMgr.cpp
@@ -1,25 +1,25 @@
/*
-* 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, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
#include "Common.h"
#include "Database/DatabaseEnv.h"
-#include "Database/DBCStores.h"
#include "Database/SQLStorage.h"
+#include "DBCStores.h"
#include "ProgressBar.h"
#include "AccountMgr.h"
@@ -223,6 +223,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail( AuctionEntry * auction )
if (owner)
{
+ //FIXME: what do if owner offline
+ owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, auction->bid);
//send auction owner notification, bidder must be current!
owner->GetSession()->SendAuctionOwnerNotification( auction );
}
@@ -257,7 +259,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction )
if ( owner )
owner->GetSession()->SendAuctionOwnerNotification( auction );
else
- RemoveAItem(pItem->GetGUIDLow()); // we have to remove the item, before we delete it !!
+ RemoveAItem(pItem->GetGUIDLow()); // we have to remove the item, before we delete it !!
MailItemsInfo mi;
mi.AddItem(auction->item_guidlow, auction->item_template, pItem);
@@ -283,7 +285,7 @@ void AuctionHouseMgr::LoadAuctionItems()
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 auction items");
return;
}
@@ -298,8 +300,8 @@ void AuctionHouseMgr::LoadAuctionItems()
bar.step();
fields = result->Fetch();
- uint32 item_guid = fields[1].GetUInt32();
- uint32 item_template = fields[2].GetUInt32();
+ uint32 item_guid = fields[1].GetUInt32();
+ uint32 item_template = fields[2].GetUInt32();
ItemPrototype const *proto = objmgr.GetItemPrototype(item_template);
@@ -334,7 +336,7 @@ void AuctionHouseMgr::LoadAuctions()
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
return;
}
@@ -347,7 +349,7 @@ void AuctionHouseMgr::LoadAuctions()
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
return;
}
@@ -357,7 +359,7 @@ void AuctionHouseMgr::LoadAuctions()
{
barGoLink bar(1);
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
return;
}
@@ -468,17 +470,17 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
// but no easy way convert creature faction to player race faction for specific city
switch(factionTemplateId)
{
- case 12: houseid = 1; break; // human
- case 29: houseid = 6; break; // orc, and generic for horde
- case 55: houseid = 2; break; // dwarf, and generic for alliance
- case 68: houseid = 4; break; // undead
- case 80: houseid = 3; break; // n-elf
- case 104: houseid = 5; break; // trolls
- case 120: houseid = 7; break; // booty bay, neutral
- case 474: houseid = 7; break; // gadgetzan, neutral
- case 855: houseid = 7; break; // everlook, neutral
+ case 12: houseid = 1; break; // human
+ case 29: houseid = 6; break; // orc, and generic for horde
+ case 55: houseid = 2; break; // dwarf, and generic for alliance
+ case 68: houseid = 4; break; // undead
+ case 80: houseid = 3; break; // n-elf
+ case 104: houseid = 5; break; // trolls
+ case 120: houseid = 7; break; // booty bay, neutral
+ case 474: houseid = 7; break; // gadgetzan, neutral
+ case 855: houseid = 7; break; // everlook, neutral
case 1604: houseid = 6; break; // b-elfs,
- default: // for unknown case
+ default: // for unknown case
{
FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId);
if(!u_entry)
@@ -576,22 +578,22 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
ItemPrototype const *proto = item->GetProto();
- if (itemClass != (0xffffffff) && proto->Class != itemClass)
+ if (itemClass != 0xffffffff && proto->Class != itemClass)
continue;
- if (itemSubClass != (0xffffffff) && proto->SubClass != itemSubClass)
+ if (itemSubClass != 0xffffffff && proto->SubClass != itemSubClass)
continue;
- if (inventoryType != (0xffffffff) && proto->InventoryType != inventoryType)
+ if (inventoryType != 0xffffffff && proto->InventoryType != inventoryType)
continue;
- if (quality != (0xffffffff) && proto->Quality != quality)
+ if (quality != 0xffffffff && proto->Quality != quality)
continue;
- if( levelmin != (0x00) && (proto->RequiredLevel < levelmin || levelmax != (0x00) && proto->RequiredLevel > levelmax ) )
+ if (levelmin != 0x00 && (proto->RequiredLevel < levelmin || (levelmax != 0x00 && proto->RequiredLevel > levelmax)))
continue;
- if( usable != (0x00) && player->CanUseItem( item ) != EQUIP_ERR_OK )
+ if (usable != 0x00 && player->CanUseItem( item ) != EQUIP_ERR_OK)
continue;
std::string name = proto->Name1;
@@ -609,10 +611,10 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
}
}
- if( !wsearchedname.empty() && !Utf8FitTo(name, wsearchedname) )
+ if (!wsearchedname.empty() && !Utf8FitTo(name, wsearchedname) )
continue;
- if ((count < 50) && (totalcount >= listfrom))
+ if (count < 50 && totalcount >= listfrom)
{
++count;
Aentry->BuildAuctionInfo(data);
@@ -630,29 +632,29 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
sLog.outError("auction to item, that doesn't exist !!!!");
return false;
}
- data << (uint32) Id;
- data << (uint32) pItem->GetEntry();
+ data << uint32(Id);
+ data << uint32(pItem->GetEntry());
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; i++)
{
- data << (uint32) pItem->GetEnchantmentId(EnchantmentSlot(i));
- data << (uint32) pItem->GetEnchantmentDuration(EnchantmentSlot(i));
- data << (uint32) pItem->GetEnchantmentCharges(EnchantmentSlot(i));
+ data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
+ data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
+ data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
}
- data << (uint32) pItem->GetItemRandomPropertyId(); //random item property id
- data << (uint32) pItem->GetItemSuffixFactor(); //SuffixFactor
- data << (uint32) pItem->GetCount(); //item->count
- data << (uint32) pItem->GetSpellCharges(); //item->charge FFFFFFF
- data << (uint32) 0; //Unknown
- data << (uint64) owner; //Auction->owner
- data << (uint32) startbid; //Auction->startbid (not sure if useful)
- data << (uint32) (bid ? GetAuctionOutBid() : 0);
+ data << uint32(pItem->GetItemRandomPropertyId()); //random item property id
+ data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
+ data << uint32(pItem->GetCount()); //item->count
+ data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
+ data << uint32(0); //Unknown
+ data << uint64(owner); //Auction->owner
+ data << uint32(startbid); //Auction->startbid (not sure if useful)
+ data << uint32(bid ? GetAuctionOutBid() : 0);
//minimal outbid
- data << (uint32) buyout; //auction->buyout
- data << (uint32) (expire_time - time(NULL))* 1000; //time left
- data << (uint64) bidder; //auction->bidder current
- data << (uint32) bid; //current bid
+ data << uint32(buyout); //auction->buyout
+ data << uint32((expire_time-time(NULL))*IN_MILISECONDS);//time left
+ data << uint64(bidder) ; //auction->bidder current
+ data << uint32(bid); //current bid
return true;
}
diff --git a/src/game/Bag.cpp b/src/game/Bag.cpp
index 331b12acde5..06c2f6ade6b 100644
--- a/src/game/Bag.cpp
+++ b/src/game/Bag.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,9 +23,7 @@
#include "ObjectMgr.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
-#include "WorldPacket.h"
#include "UpdateData.h"
-#include "WorldSession.h"
Bag::Bag( ): Item()
{
@@ -34,7 +32,7 @@ Bag::Bag( ): Item()
m_valuesCount = CONTAINER_END;
- memset(m_bagslot, 0, sizeof(Item *) * MAX_BAG_SIZE); // Maximum 20 Slots
+ memset(m_bagslot, 0, sizeof(Item *) * MAX_BAG_SIZE);
}
Bag::~Bag()
diff --git a/src/game/Bag.h b/src/game/Bag.h
index d930809cf4a..1c341b5611d 100644
--- a/src/game/Bag.h
+++ b/src/game/Bag.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,10 +24,7 @@
// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
#define MAX_BAG_SIZE 36 // 2.0.12
-#include "Object.h"
#include "ItemPrototype.h"
-#include "Unit.h"
-#include "Creature.h"
#include "Item.h"
class Bag : public Item
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 2538bd3434e..fffedb56ad8 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,23 +21,119 @@
#include "Object.h"
#include "Player.h"
#include "BattleGround.h"
+#include "BattleGroundMgr.h"
#include "Creature.h"
#include "MapManager.h"
#include "Language.h"
-#include "Chat.h"
#include "SpellAuras.h"
#include "ArenaTeam.h"
#include "World.h"
+#include "Group.h"
+#include "ObjectMgr.h"
+#include "WorldPacket.h"
#include "Util.h"
+#include "Formulas.h"
+#include "GridNotifiersImpl.h"
+
+namespace MaNGOS
+{
+ class BattleGroundChatBuilder
+ {
+ public:
+ BattleGroundChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, va_list* args = NULL)
+ : i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
+ void operator()(WorldPacket& data, int32 loc_idx)
+ {
+ char const* text = objmgr.GetMangosString(i_textId,loc_idx);
+
+ if (i_args)
+ {
+ // we need copy va_list before use or original va_list will corrupted
+ va_list ap;
+ va_copy(ap,*i_args);
+
+ char str [2048];
+ vsnprintf(str,2048,text, ap );
+ va_end(ap);
+
+ do_helper(data,&str[0]);
+ }
+ else
+ do_helper(data,text);
+ }
+ private:
+ void do_helper(WorldPacket& data, char const* text)
+ {
+ uint64 target_guid = i_source ? i_source ->GetGUID() : 0;
+
+ data << uint8(i_msgtype);
+ data << uint32(LANG_UNIVERSAL);
+ data << uint64(target_guid); // there 0 for BG messages
+ data << uint32(0); // can be chat msg group or something
+ data << uint64(target_guid);
+ data << uint32(strlen(text)+1);
+ data << text;
+ data << uint8(i_source ? i_source->chatTag() : uint8(0));
+ }
+
+ ChatMsg i_msgtype;
+ int32 i_textId;
+ Player const* i_source;
+ va_list* i_args;
+ };
+
+ class BattleGround2ChatBuilder
+ {
+ public:
+ BattleGround2ChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, int32 arg1, int32 arg2)
+ : i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
+ void operator()(WorldPacket& data, int32 loc_idx)
+ {
+ char const* text = objmgr.GetMangosString(i_textId,loc_idx);
+ char const* arg1str = i_arg1 ? objmgr.GetMangosString(i_arg1,loc_idx) : "";
+ char const* arg2str = i_arg2 ? objmgr.GetMangosString(i_arg2,loc_idx) : "";
+
+ char str [2048];
+ snprintf(str,2048,text, arg1str, arg2str );
+
+ uint64 target_guid = i_source ? i_source ->GetGUID() : 0;
+
+ data << uint8(i_msgtype);
+ data << uint32(LANG_UNIVERSAL);
+ data << uint64(target_guid); // there 0 for BG messages
+ data << uint32(0); // can be chat msg group or something
+ data << uint64(target_guid);
+ data << uint32(strlen(str)+1);
+ data << str;
+ data << uint8(i_source ? i_source->chatTag() : uint8(0));
+ }
+ private:
+
+ ChatMsg i_msgtype;
+ int32 i_textId;
+ Player const* i_source;
+ int32 i_arg1;
+ int32 i_arg2;
+ };
+} // namespace MaNGOS
+
+template<class Do>
+void BattleGround::BroadcastWorker(Do& _do)
+{
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ if (Player *plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
+ _do(plr);
+}
BattleGround::BattleGround()
{
- m_TypeID = 0;
+ m_TypeID = BattleGroundTypeId(0);
m_InstanceID = 0;
- m_Status = 0;
+ m_Status = STATUS_NONE;
+ m_ClientInstanceID = 0;
m_EndTime = 0;
m_LastResurrectTime = 0;
- m_Queue_type = MAX_BATTLEGROUND_QUEUES;
+ m_QueueId = QUEUE_ID_MAX_LEVEL_19;
m_InvitedAlliance = 0;
m_InvitedHorde = 0;
m_ArenaType = 0;
@@ -88,6 +184,16 @@ BattleGround::BattleGround()
m_PrematureCountDown = 0;
m_HonorMode = BG_NORMAL;
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_2M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set to some default existing values
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
}
BattleGround::~BattleGround()
@@ -105,84 +211,55 @@ BattleGround::~BattleGround()
DelObject(i);
}
- // delete creature and go respawn times
- WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE instance = '%u'",GetInstanceID());
- WorldDatabase.PExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'",GetInstanceID());
- // delete instance from db
- CharacterDatabase.PExecute("DELETE FROM instance WHERE id = '%u'",GetInstanceID());
- // remove from battlegrounds
- sBattleGroundMgr.RemoveBattleGround(GetInstanceID());
+ if(GetInstanceID()) // not spam by useless queries in case BG templates
+ {
+ // delete creature and go respawn times
+ WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE instance = '%u'",GetInstanceID());
+ WorldDatabase.PExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'",GetInstanceID());
+ // delete instance from db
+ CharacterDatabase.PExecute("DELETE FROM instance WHERE id = '%u'",GetInstanceID());
+ // remove from battlegrounds
+ }
+
+ sBattleGroundMgr.RemoveBattleGround(GetInstanceID(), GetTypeID());
// unload map
- if(Map * map = MapManager::Instance().FindMap(GetMapId(), GetInstanceID()))
- if(map->IsBattleGroundOrArena())
+ if (Map * map = MapManager::Instance().FindMap(GetMapId(), GetInstanceID()))
+ if (map->IsBattleGroundOrArena())
((BattleGroundMap*)map)->SetUnload();
// remove from bg free slot queue
this->RemoveFromBGFreeSlotQueue();
}
-void BattleGround::Update(time_t diff)
+void BattleGround::Update(uint32 diff)
{
- if(!GetPlayersSize() && !GetRemovedPlayersSize() && !GetReviveQueueSize())
+ if (!GetPlayersSize() && !GetReviveQueueSize())
//BG is empty
return;
- WorldPacket data;
-
- if(GetRemovedPlayersSize())
+ // remove offline players from bg after 5 minutes
+ if (!m_OfflineQueue.empty())
{
- for(std::map<uint64, uint8>::iterator itr = m_RemovedPlayers.begin(); itr != m_RemovedPlayers.end(); ++itr)
+ BattleGroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin()));
+ if (itr != m_Players.end())
{
- Player *plr = objmgr.GetPlayer(itr->first);
- switch(itr->second)
+ if (itr->second.OfflineRemoveTime <= sWorld.GetGameTime())
{
- //following code is handled by event:
- /*case 0:
- sBattleGroundMgr.m_BattleGroundQueues[GetTypeID()].RemovePlayer(itr->first);
- //RemovePlayerFromQueue(itr->first);
- if(plr)
- {
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(m_TypeID), STATUS_NONE, 0, 0);
- plr->GetSession()->SendPacket(&data);
- }
- break;*/
- case 1: // currently in bg and was removed from bg
- if(plr)
- RemovePlayerAtLeave(itr->first, true, true);
- else
- RemovePlayerAtLeave(itr->first, false, false);
- break;
- case 2: // revive queue
- RemovePlayerFromResurrectQueue(itr->first);
- break;
- default:
- sLog.outError("BattleGround: Unknown remove player case!");
+ RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
+ m_OfflineQueue.pop_front(); // remove from offline queue
+ //do not use itr for anything, because it is erased in RemovePlayerAtLeave()
}
}
- m_RemovedPlayers.clear();
}
- // this code isn't efficient and its idea isn't implemented yet
- /* offline players are removed from battleground in worldsession::LogoutPlayer()
- // remove offline players from bg after ~5 minutes
- if(GetPlayersSize())
- {
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
- {
- Player *plr = objmgr.GetPlayer(itr->first);
- itr->second.LastOnlineTime += diff;
-
- if(plr)
- itr->second.LastOnlineTime = 0; // update last online time
- else
- if(itr->second.LastOnlineTime >= MAX_OFFLINE_TIME) // 5 minutes
- m_RemovedPlayers[itr->first] = 1; // add to remove list (BG)
- }
- }*/
+ /*********************************************************/
+ /*** BATTLEGROUND RESSURECTION SYSTEM ***/
+ /*********************************************************/
+ //this should be handled by spell system
m_LastResurrectTime += diff;
if (m_LastResurrectTime >= RESURRECTION_INTERVAL)
{
- if(GetReviveQueueSize())
+ if (GetReviveQueueSize())
{
for(std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
{
@@ -190,7 +267,7 @@ void BattleGround::Update(time_t diff)
for(std::vector<uint64>::iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
{
Player *plr = objmgr.GetPlayer(*itr2);
- if(!plr)
+ if (!plr)
continue;
if (!sh)
@@ -219,7 +296,7 @@ void BattleGround::Update(time_t diff)
for(std::vector<uint64>::iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(*itr);
- if(!plr)
+ if (!plr)
continue;
plr->ResurrectPlayer(1.0f);
plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true);
@@ -228,46 +305,151 @@ void BattleGround::Update(time_t diff)
m_ResurrectQueue.clear();
}
+ /*********************************************************/
+ /*** BATTLEGROUND BALLANCE SYSTEM ***/
+ /*********************************************************/
+
// if less then minimum players are in on one side, then start premature finish timer
- if(GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattleGroundMgr.GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam()))
+ if (GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattleGroundMgr.GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam()))
{
- if(!m_PrematureCountDown)
+ if (!m_PrematureCountDown)
{
m_PrematureCountDown = true;
m_PrematureCountDownTimer = sBattleGroundMgr.GetPrematureFinishTime();
- SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
}
- else if(m_PrematureCountDownTimer < diff)
+ else if (m_PrematureCountDownTimer < diff)
{
// time's up!
- EndBattleGround(0); // noone wins
+ uint32 winner = 0;
+ if (GetPlayersCountByTeam(ALLIANCE) >= GetMinPlayersPerTeam())
+ winner = ALLIANCE;
+ else if (GetPlayersCountByTeam(HORDE) >= GetMinPlayersPerTeam())
+ winner = HORDE;
+
+ EndBattleGround(winner);
m_PrematureCountDown = false;
}
else
{
uint32 newtime = m_PrematureCountDownTimer - diff;
// announce every minute
- if(m_PrematureCountDownTimer != sBattleGroundMgr.GetPrematureFinishTime() && newtime / 60000 != m_PrematureCountDownTimer / 60000)
- SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
+ if (newtime > (MINUTE * IN_MILISECONDS))
+ {
+ if (newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS))
+ PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)));
+ }
+ else
+ {
+ //announce every 15 seconds
+ if (newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS))
+ PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS));
+ }
m_PrematureCountDownTimer = newtime;
}
}
else if (m_PrematureCountDown)
m_PrematureCountDown = false;
- if(GetStatus() == STATUS_WAIT_LEAVE)
+ /*********************************************************/
+ /*** BATTLEGROUND STARTING SYSTEM ***/
+ /*********************************************************/
+
+ if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
+ {
+ ModifyStartDelayTime(diff);
+
+ if (!(m_Events & BG_STARTING_EVENT_1))
+ {
+ m_Events |= BG_STARTING_EVENT_1;
+
+ // setup here, only when at least one player has ported to the map
+ if (!SetupBattleGround())
+ {
+ EndNow();
+ return;
+ }
+
+ StartingEventCloseDoors();
+ SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]);
+ //first start warning - 2 or 1 minute
+ SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ }
+ // After 1 minute or 30 seconds, warning is signalled
+ else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2))
+ {
+ m_Events |= BG_STARTING_EVENT_2;
+ SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ }
+ // After 30 or 15 seconds, warning is signalled
+ else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3))
+ {
+ m_Events |= BG_STARTING_EVENT_3;
+ SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ }
+ // delay expired (atfer 2 or 1 minute)
+ else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4))
+ {
+ m_Events |= BG_STARTING_EVENT_4;
+
+ StartingEventOpenDoors();
+
+ SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FOURTH], CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ SetStatus(STATUS_IN_PROGRESS);
+ SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FOURTH]);
+
+ //remove preparation
+ if (isArena())
+ {
+ //TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
+
+ for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
+ if (Player *plr = objmgr.GetPlayer(itr->first))
+ plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
+
+ CheckArenaWinConditions();
+ }
+ else
+ {
+
+ PlaySoundToAll(SOUND_BG_START);
+
+ for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
+ if (Player* plr = objmgr.GetPlayer(itr->first))
+ plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
+ //Announce BG starting
+ if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
+ {
+ sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
+ }
+ }
+ }
+ }
+
+ /*********************************************************/
+ /*** BATTLEGROUND ENDING SYSTEM ***/
+ /*********************************************************/
+
+ if (GetStatus() == STATUS_WAIT_LEAVE)
{
// remove all players from battleground after 2 minutes
- m_EndTime += diff;
- if(m_EndTime >= TIME_TO_AUTOREMOVE) // 2 minutes
+ m_EndTime -= diff;
+ if (m_EndTime <= 0)
{
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ m_EndTime = 0;
+ BattleGroundPlayerMap::iterator itr, next;
+ for(itr = m_Players.begin(); itr != m_Players.end(); itr = next)
{
- m_RemovedPlayers[itr->first] = 1; // add to remove list (BG)
+ next = itr;
+ ++next;
+ //itr is erased here!
+ RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
+ // do not change any battleground's private variables
}
- // do not change any battleground's private variables
}
}
+
+ //update start time
+ m_StartTime += diff;
}
void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O)
@@ -281,10 +463,10 @@ void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, flo
void BattleGround::SendPacketToAll(WorldPacket *packet)
{
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(plr)
+ if (plr)
plr->GetSession()->SendPacket(packet);
else
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
@@ -293,23 +475,23 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender, bool self)
{
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
- if(!self && sender == plr)
+ if (!self && sender == plr)
continue;
- uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
+ uint32 team = itr->second.Team;
if(!team) team = plr->GetTeam();
- if(team == TeamID)
+ if (team == TeamID)
plr->GetSession()->SendPacket(packet);
}
}
@@ -325,20 +507,20 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
{
WorldPacket data;
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
- uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
+ uint32 team = itr->second.Team;
if(!team) team = plr->GetTeam();
- if(team == TeamID)
+ if (team == TeamID)
{
sBattleGroundMgr.BuildPlaySoundPacket(&data, SoundID);
plr->GetSession()->SendPacket(&data);
@@ -348,20 +530,20 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
{
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
- uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
+ uint32 team = itr->second.Team;
if(!team) team = plr->GetTeam();
- if(team == TeamID)
+ if (team == TeamID)
plr->CastSpell(plr, SpellID, true);
}
}
@@ -385,20 +567,20 @@ void BattleGround::YellToAll(Creature* creature, const char* text, uint32 langua
void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
{
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
- uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
+ uint32 team = itr->second.Team;
if(!team) team = plr->GetTeam();
- if(team == TeamID)
+ if (team == TeamID)
UpdatePlayerScore(plr, SCORE_BONUS_HONOR, Honor);
}
}
@@ -407,24 +589,24 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
{
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id);
- if(!factionEntry)
+ if (!factionEntry)
return;
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
- uint32 team = itr->second.Team;//GetPlayerTeam(plr->GetGUID());
+ uint32 team = itr->second.Team;
if(!team) team = plr->GetTeam();
- if(team == TeamID)
- plr->ModifyFactionReputation(factionEntry, Reputation);
+ if (team == TeamID)
+ plr->GetReputationMgr().ModifyReputation(factionEntry, Reputation);
}
}
@@ -445,32 +627,25 @@ void BattleGround::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player
void BattleGround::EndBattleGround(uint32 winner)
{
this->RemoveFromBGFreeSlotQueue();
- uint32 almost_winning_team = HORDE;
+
ArenaTeam * winner_arena_team = NULL;
ArenaTeam * loser_arena_team = NULL;
uint32 loser_rating = 0;
uint32 winner_rating = 0;
WorldPacket data;
- Player *Source = NULL;
- const char *winmsg = "";
+ int32 winmsg_id = 0;
- if(winner == ALLIANCE)
+ if (winner == ALLIANCE)
{
- if(isBattleGround())
- winmsg = GetTrinityString(LANG_BG_A_WINS);
- else
- winmsg = GetTrinityString(LANG_ARENA_GOLD_WINS);
+ winmsg_id = isBattleGround() ? LANG_BG_A_WINS : LANG_ARENA_GOLD_WINS;
PlaySoundToAll(SOUND_ALLIANCE_WINS); // alliance wins sound
SetWinner(WINNER_ALLIANCE);
}
- else if(winner == HORDE)
+ else if (winner == HORDE)
{
- if(isBattleGround())
- winmsg = GetTrinityString(LANG_BG_H_WINS);
- else
- winmsg = GetTrinityString(LANG_ARENA_GREEN_WINS);
+ winmsg_id = isBattleGround() ? LANG_BG_H_WINS : LANG_ARENA_GREEN_WINS;
PlaySoundToAll(SOUND_HORDE_WINS); // horde wins sound
@@ -482,38 +657,23 @@ void BattleGround::EndBattleGround(uint32 winner)
}
SetStatus(STATUS_WAIT_LEAVE);
- m_EndTime = 0;
+ //we must set it this way, because end time is sent in packet!
+ m_EndTime = TIME_TO_AUTOREMOVE;
// arena rating calculation
- if(isArena() && isRated())
+ if (isArena() && isRated())
{
- if(winner == ALLIANCE)
- {
- winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(ALLIANCE));
- loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(HORDE));
- }
- else if(winner == HORDE)
- {
- winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(HORDE));
- loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(ALLIANCE));
- }
- if(winner_arena_team && loser_arena_team)
+ winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
+ loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
+ if (winner_arena_team && loser_arena_team)
{
loser_rating = loser_arena_team->GetStats().rating;
winner_rating = winner_arena_team->GetStats().rating;
int32 winner_change = winner_arena_team->WonAgainst(loser_rating);
int32 loser_change = loser_arena_team->LostAgainst(winner_rating);
sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner change: %u, Losser change: %u ---", winner_rating, loser_rating, winner_change, loser_change);
- if(winner == ALLIANCE)
- {
- SetArenaTeamRatingChangeForTeam(ALLIANCE, winner_change);
- SetArenaTeamRatingChangeForTeam(HORDE, loser_change);
- }
- else
- {
- SetArenaTeamRatingChangeForTeam(HORDE, winner_change);
- SetArenaTeamRatingChangeForTeam(ALLIANCE, loser_change);
- }
+ SetArenaTeamRatingChangeForTeam(winner, winner_change);
+ SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
}
else
{
@@ -522,69 +682,56 @@ void BattleGround::EndBattleGround(uint32 winner)
}
}
- if(!isArena()){
-
- if(m_score[GetTeamIndexByTeamId(ALLIANCE)] == m_score[GetTeamIndexByTeamId(HORDE)])
- almost_winning_team = 0; //no real winner
- if(m_score[GetTeamIndexByTeamId(ALLIANCE)] > m_score[GetTeamIndexByTeamId(HORDE)])
- almost_winning_team = ALLIANCE;
-
- }
-
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr)
+ uint32 team = itr->second.Team;
+
+ if (!plr)
{
+ //if rated arena match - make member lost!
+ if (isArena() && isRated() && winner_arena_team && loser_arena_team)
+ {
+ if (team == winner)
+ winner_arena_team->OfflineMemberLost(itr->first, loser_rating);
+ else
+ loser_arena_team->OfflineMemberLost(itr->first, winner_rating);
+ }
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);
continue;
}
// should remove spirit of redemption
if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
- plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
+ plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
- if(!plr->isAlive())
+ if (!plr->isAlive())
{
plr->ResurrectPlayer(1.0f);
plr->SpawnCorpseBones();
}
- uint32 team = itr->second.Team;
- if(!team) team = plr->GetTeam();
+ //this line is obsolete - team is set ALWAYS
+ //if(!team) team = plr->GetTeam();
// per player calculation
- if(isArena() && isRated() && winner_arena_team && loser_arena_team)
+ if (isArena() && isRated() && winner_arena_team && loser_arena_team)
{
- if(team == winner)
+ if (team == winner)
winner_arena_team->MemberWon(plr,loser_rating);
else
loser_arena_team->MemberLost(plr,winner_rating);
}
- if(team == winner)
+ if (team == winner)
{
- if(!Source)
- Source = plr;
RewardMark(plr,ITEM_WINNER_COUNT);
- UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20);
RewardQuest(plr);
}
else if(winner !=0)
{
- RewardMark(plr,ITEM_LOSER_COUNT);
+ RewardMark(plr,ITEM_LOSER_COUNT);
}
- else if(winner == 0)
- {
- if(sWorld.getConfig(CONFIG_PREMATURE_BG_REWARD)) // We're feeling generous, giving rewards to people who not earned them ;)
- { //nested ifs for the win! its boring writing that, forgive me my unfunniness
-
- if(almost_winning_team == team) //player's team had more points
- RewardMark(plr,ITEM_WINNER_COUNT);
- else
- RewardMark(plr,ITEM_LOSER_COUNT); // if scores were the same, each team gets 1 mark.
- }
- }
plr->CombatStopWithPets(true);
@@ -593,12 +740,13 @@ void BattleGround::EndBattleGround(uint32 winner)
sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);
plr->GetSession()->SendPacket(&data);
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(GetTypeID(), GetArenaType());
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType());
plr->GetSession()->SendPacket(&data);
+ plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1);
}
- if(isArena() && isRated() && winner_arena_team && loser_arena_team)
+ if (isArena() && isRated() && winner_arena_team && loser_arena_team)
{
// update arena points only after increasing the player's match count!
//obsolete: winner_arena_team->UpdateArenaPointsHelper();
@@ -610,17 +758,16 @@ void BattleGround::EndBattleGround(uint32 winner)
// this way all arena team members will get notified, not only the ones who participated in this match
winner_arena_team->NotifyStatsChanged();
loser_arena_team->NotifyStatsChanged();
- sLog.outDebug("Rated arena match between %s and %s finished, winner: %s", loser_arena_team->GetName().c_str(),winner_arena_team->GetName().c_str(),winner_arena_team->GetName().c_str());
}
- // inform invited players about the removal
- sBattleGroundMgr.m_BattleGroundQueues[sBattleGroundMgr.BGQueueTypeId(GetTypeID(), GetArenaType())].BGEndedRemoveInvites(this);
+ if (winmsg_id)
+ SendMessageToAll(winmsg_id, CHAT_MSG_BG_SYSTEM_NEUTRAL);
+}
- if(Source)
- {
- ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);
- SendPacketToAll(&data);
- }
+uint32 BattleGround::GetBonusHonorFromKill(uint32 kills) const
+{
+ //variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill)
+ return MaNGOS::Honor::hk_honor_at_level(GetMaxLevel(), kills);
}
uint32 BattleGround::GetBattlemasterEntry() const
@@ -639,13 +786,13 @@ uint32 BattleGround::GetBattlemasterEntry() const
void BattleGround::RewardMark(Player *plr,uint32 count)
{
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
- if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
+ if (plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
return;
if(!plr || !count)
return;
- BattleGroundMarks mark;
+ BattleGroundMarks mark;
switch(GetTypeID())
{
case BATTLEGROUND_AV:
@@ -657,7 +804,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
case BATTLEGROUND_AB:
mark = ITEM_AB_MARK_OF_HONOR;
break;
- case BATTLEGROUND_EY:
+ case BATTLEGROUND_EY:
mark = ITEM_EY_MARK_OF_HONOR;
break;
default:
@@ -676,7 +823,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
if(Item* item = plr->StoreNewItem( dest, mark, true, 0))
plr->SendNewItem(item,count,false,true);
- if(no_space_count > 0)
+ if (no_space_count > 0)
SendRewardMarkByMail(plr,mark,no_space_count);
}
}
@@ -684,14 +831,14 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
{
uint32 bmEntry = GetBattlemasterEntry();
- if(!bmEntry)
+ if (!bmEntry)
return;
ItemPrototype const* markProto = objmgr.GetItemPrototype(mark);
- if(!markProto)
+ if (!markProto)
return;
- if(Item* markItem = Item::CreateItem(mark,count,plr))
+ if (Item* markItem = Item::CreateItem(mark,count,plr))
{
// save new item before send
markItem->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted
@@ -703,8 +850,8 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
// subject: item name
std::string subject = markProto->Name1;
int loc_idx = plr->GetSession()->GetSessionDbLocaleIndex();
- if ( loc_idx >= 0 )
- if(ItemLocale const *il = objmgr.GetItemLocale(markProto->ItemId))
+ if (loc_idx >= 0 )
+ if (ItemLocale const *il = objmgr.GetItemLocale(markProto->ItemId))
if (il->Name.size() > size_t(loc_idx) && !il->Name[loc_idx].empty())
subject = il->Name[loc_idx];
@@ -721,7 +868,7 @@ void BattleGround::SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count)
void BattleGround::RewardQuest(Player *plr)
{
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
- if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
+ if (plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
return;
uint32 quest;
@@ -756,17 +903,17 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
uint32 team = GetPlayerTeam(guid);
bool participant = false;
// Remove from lists/maps
- std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.find(guid);
- if(itr != m_Players.end())
+ BattleGroundPlayerMap::iterator itr = m_Players.find(guid);
+ if (itr != m_Players.end())
{
- UpdatePlayersCountByTeam(team, true); // -1 player
+ UpdatePlayersCountByTeam(team, true); // -1 player
m_Players.erase(itr);
// check if the player was a participant of the match, or only entered through gm command (goname)
participant = true;
}
std::map<uint64, BattleGroundScore*>::iterator itr2 = m_PlayerScores.find(guid);
- if(itr2 != m_PlayerScores.end())
+ if (itr2 != m_PlayerScores.end())
{
delete itr2->second; // delete player's score
m_PlayerScores.erase(itr2);
@@ -778,7 +925,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
// should remove spirit of redemption
if(plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
- plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
+ plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
if(plr && !plr->isAlive()) // resurrect on exit
{
@@ -788,100 +935,91 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
RemovePlayer(plr, guid); // BG subclass specific code
- if(plr)
+ if(participant) // if the player was a match participant, remove auras, calc rating, update queue
{
- plr->ClearAfkReports();
-
- if(participant) // if the player was a match participant, remove auras, calc rating, update queue
+ BattleGroundTypeId bgTypeId = GetTypeID();
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
+ if (plr)
{
+ plr->ClearAfkReports();
+
if(!team) team = plr->GetTeam();
- uint32 bgTypeId = GetTypeID();
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(GetTypeID(), GetArenaType());
// if arena, remove the specific arena auras
- if(isArena())
+ if (isArena())
{
- plr->RemoveArenaAuras(true); // removes debuffs / dots etc., we don't want the player to die after porting out
- bgTypeId=BATTLEGROUND_AA; // set the bg type to all arenas (it will be used for queue refreshing)
+ plr->RemoveArenaAuras(true); // removes debuffs / dots etc., we don't want the player to die after porting out
+ bgTypeId=BATTLEGROUND_AA; // set the bg type to all arenas (it will be used for queue refreshing)
- // summon old pet if there was one and there isn't a current pet
- if(!plr->GetPet() && plr->GetTemporaryUnsummonedPetNumber())
- {
- Pet* NewPet = new Pet;
- if(!NewPet->LoadPetFromDB(plr, 0, (plr)->GetTemporaryUnsummonedPetNumber(), true))
- delete NewPet;
+ // unsummon current and summon old pet if there was one and there isn't a current pet
+ plr->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT);
+ plr->ResummonPetTemporaryUnSummonedIfAny();
- (plr)->SetTemporaryUnsummonedPetNumber(0);
- }
-
- if(isRated() && GetStatus() == STATUS_IN_PROGRESS)
+ if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
//left a rated match while the encounter was in progress, consider as loser
- ArenaTeam * winner_arena_team = 0;
- ArenaTeam * loser_arena_team = 0;
- if(team == HORDE)
- {
- winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(ALLIANCE));
- loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(HORDE));
- }
- else
- {
- winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(HORDE));
- loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(ALLIANCE));
- }
- if(winner_arena_team && loser_arena_team)
- {
+ ArenaTeam * winner_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
+ ArenaTeam * loser_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
+ if (winner_arena_team && loser_arena_team)
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
- }
}
}
-
- WorldPacket data;
- if(SendPacket)
+ if (SendPacket)
{
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, team, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0);
+ WorldPacket data;
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0);
plr->GetSession()->SendPacket(&data);
}
// this call is important, because player, when joins to battleground, this method is not called, so it must be called when leaving bg
plr->RemoveBattleGroundQueueId(bgQueueTypeId);
-
- DecreaseInvitedCount(team);
- //we should update battleground queue, but only if bg isn't ending
- if (GetQueueType() < MAX_BATTLEGROUND_QUEUES)
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, GetQueueType());
-
- Group * group = plr->GetGroup();
- // remove from raid group if exist
- if(group && group == GetBgRaid(team))
+ }
+ else
+ // removing offline participant
+ {
+ if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
{
- if(!group->RemoveMember(guid, 0)) // group was disbanded
- {
- SetBgRaid(team, NULL);
- delete group;
- }
+ //left a rated match while the encounter was in progress, consider as loser
+ ArenaTeam * others_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
+ ArenaTeam * players_arena_team = objmgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
+ if (others_arena_team && players_arena_team)
+ players_arena_team->OfflineMemberLost(guid, others_arena_team->GetRating());
}
+ }
- // Let others know
- sBattleGroundMgr.BuildPlayerLeftBattleGroundPacket(&data, plr);
- SendPacketToTeam(team, &data, plr, false);
+ // remove from raid group if player is member
+ if (Group *group = GetBgRaid(team))
+ {
+ if( !group->RemoveMember(guid, 0) ) // group was disbanded
+ {
+ SetBgRaid(team, NULL);
+ delete group;
+ }
}
+ DecreaseInvitedCount(team);
+ //we should update battleground queue, but only if bg isn't ending
+ if (isBattleGround() && GetStatus() < STATUS_WAIT_LEAVE)
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, GetQueueId());
+ // Let others know
+ WorldPacket data;
+ sBattleGroundMgr.BuildPlayerLeftBattleGroundPacket(&data, guid);
+ SendPacketToTeam(team, &data, plr, false);
+ }
+ if (plr)
+ {
// Do next only if found in battleground
- plr->SetBattleGroundId(0); // We're not in BG.
+ plr->SetBattleGroundId(0, BATTLEGROUND_TYPE_NONE); // We're not in BG.
// reset destination bg team
plr->SetBGTeam(0);
- if(Transport)
- {
- plr->TeleportTo(plr->GetBattleGroundEntryPointMap(), plr->GetBattleGroundEntryPointX(), plr->GetBattleGroundEntryPointY(), plr->GetBattleGroundEntryPointZ(), plr->GetBattleGroundEntryPointO());
- }
+ if (Transport)
+ plr->TeleportTo(plr->GetBattleGroundEntryPoint());
- // Log
sLog.outDetail("BATTLEGROUND: Removed player %s from BattleGround.", plr->GetName());
}
- if(!GetPlayersSize() && !GetInvitedCount(HORDE) && !GetInvitedCount(ALLIANCE))
+ if (!GetPlayersSize() && !GetInvitedCount(HORDE) && !GetInvitedCount(ALLIANCE))
{
// if no players left AND no invitees left, set this bg to delete in next update
// direct deletion could cause crashes
@@ -897,7 +1035,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
// this method is called when no players remains in battleground
void BattleGround::Reset()
{
- SetQueueType(MAX_BATTLEGROUND_QUEUES);
+ SetQueueId(QUEUE_ID_MAX_LEVEL_19);
SetWinner(WINNER_NONE);
SetStatus(STATUS_WAIT_QUEUE);
SetStartTime(0);
@@ -909,7 +1047,7 @@ void BattleGround::Reset()
m_Events = 0;
if (m_InvitedAlliance > 0 || m_InvitedHorde > 0)
- sLog.outError("BattleGround system ERROR: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde);
+ sLog.outError("BattleGround system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde);
m_InvitedAlliance = 0;
m_InvitedHorde = 0;
@@ -917,9 +1055,6 @@ void BattleGround::Reset()
m_Players.clear();
m_PlayerScores.clear();
-
- // reset BGSubclass
- ResetBGSubclass();
}
void BattleGround::StartBattleGround()
@@ -938,7 +1073,7 @@ void BattleGround::AddPlayer(Player *plr)
uint32 team = plr->GetBGTeam();
BattleGroundPlayer bp;
- bp.LastOnlineTime = 0;
+ bp.OfflineRemoveTime = 0;
bp.Team = team;
// Add to list/maps
@@ -951,40 +1086,28 @@ void BattleGround::AddPlayer(Player *plr)
SendPacketToTeam(team, &data, plr, false);
// add arena specific auras
- if(isArena())
+ if (isArena())
{
plr->RemoveArenaSpellCooldowns();
plr->RemoveArenaAuras();
plr->RemoveAllEnchantments(TEMP_ENCHANTMENT_SLOT);
if(team == ALLIANCE) // gold
{
- if(plr->GetTeam() == HORDE)
+ if (plr->GetTeam() == HORDE)
plr->CastSpell(plr, SPELL_HORDE_GOLD_FLAG,true);
else
plr->CastSpell(plr, SPELL_ALLIANCE_GOLD_FLAG,true);
}
else // green
{
- if(plr->GetTeam() == HORDE)
+ if (plr->GetTeam() == HORDE)
plr->CastSpell(plr, SPELL_HORDE_GREEN_FLAG,true);
else
plr->CastSpell(plr, SPELL_ALLIANCE_GREEN_FLAG,true);
}
plr->DestroyConjuredItems(true);
-
- Pet* pet = plr->GetPet();
- if(pet)
- {
- if(pet->getPetType() == SUMMON_PET || pet->getPetType() == HUNTER_PET)
- {
- (plr)->SetTemporaryUnsummonedPetNumber(pet->GetCharmInfo()->GetPetNumber());
- (plr)->SetOldPetSpell(pet->GetUInt32Value(UNIT_CREATED_BY_SPELL));
- }
- (plr)->RemovePet(NULL,PET_SAVE_NOT_IN_SLOT);
- }
- else
- (plr)->SetTemporaryUnsummonedPetNumber(0);
+ plr->UnsummonPetTemporaryIfAny();
if(GetStatus() == STATUS_WAIT_JOIN) // not started yet
{
@@ -1000,15 +1123,83 @@ void BattleGround::AddPlayer(Player *plr)
plr->CastSpell(plr, SPELL_PREPARATION, true); // reduces all mana cost of spells.
}
+ // setup BG group membership
+ PlayerAddedToBGCheckIfBGIsRunning(plr);
+ AddOrSetPlayerToCorrectBgGroup(plr, guid, team);
+
// Log
sLog.outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName());
}
+/* this method adds player to his team's bg group, or sets his correct group if player is already in bg group */
+void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team)
+{
+ Group* group = GetBgRaid(team);
+ if(!group) // first player joined
+ {
+ group = new Group;
+ SetBgRaid(team, group);
+ group->Create(plr_guid, plr->GetName());
+ }
+ else // raid already exist
+ {
+ if (group->IsMember(plr_guid))
+ {
+ uint8 subgroup = group->GetMemberGroup(plr_guid);
+ plr->SetBattleGroundRaid(group, subgroup);
+ }
+ else
+ {
+ group->AddMember(plr_guid, plr->GetName());
+ if (Group* originalGroup = plr->GetOriginalGroup())
+ if (originalGroup->IsLeader(plr_guid))
+ group->ChangeLeader(plr_guid);
+ }
+ }
+}
+
+// This method should be called when player logs into running battleground
+void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
+{
+ // player is correct pointer
+ for(std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
+ {
+ if (*itr == plr_guid)
+ {
+ m_OfflineQueue.erase(itr);
+ break;
+ }
+ }
+ m_Players[plr_guid].OfflineRemoveTime = 0;
+ PlayerAddedToBGCheckIfBGIsRunning(player);
+ // if battleground is starting, then add preparation aura
+ // we don't have to do that, because preparation aura isn't removed when player logs out
+}
+
+// This method should be called when player logs out from running battleground
+void BattleGround::EventPlayerLoggedOut(Player* player)
+{
+ // player is correct pointer, it is checked in WorldSession::LogoutPlayer()
+ m_OfflineQueue.push_back(player->GetGUID());
+ m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
+ if (GetStatus() == STATUS_IN_PROGRESS)
+ {
+ if (isBattleGround())
+ EventPlayerDroppedFlag(player);
+ else
+ {
+ //1 player is logging out, if it is the last, then end arena!
+ if (GetAlivePlayersCountByTeam(player->GetTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetTeam())))
+ EndBattleGround(GetOtherTeam(player->GetTeam()));
+ }
+ }
+}
+
/* This method should be called only once ... it adds pointer to queue */
void BattleGround::AddToBGFreeSlotQueue()
{
// make sure to add only once
- if(!m_InBGFreeSlotQueue)
+ if (!m_InBGFreeSlotQueue && isBattleGround())
{
sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].push_front(this);
m_InBGFreeSlotQueue = true;
@@ -1021,7 +1212,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
// set to be able to re-add if needed
m_InBGFreeSlotQueue = false;
// uncomment this code when battlegrounds will work like instances
- for (std::deque<BattleGround*>::iterator itr = sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].end(); ++itr)
+ for (BGFreeSlotQueueType::iterator itr = sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].end(); ++itr)
{
if ((*itr)->GetInstanceID() == m_InstanceID)
{
@@ -1032,61 +1223,12 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
}
// get the number of free slots for team
-// works in similar way that HasFreeSlotsForTeam did, but this is needed for join as group
+// returns the number how many players can join battleground to MaxPlayersPerTeam
uint32 BattleGround::GetFreeSlotsForTeam(uint32 Team) const
{
- //if BG is starting ... invite anyone
- if (GetStatus() == STATUS_WAIT_JOIN)
+ //return free slot count to MaxPlayerPerTeam
+ if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS)
return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
- //if BG is already started .. do not allow to join too much players of one faction
- uint32 otherTeam;
- uint32 otherIn;
- if (Team == ALLIANCE)
- {
- otherTeam = GetInvitedCount(HORDE);
- otherIn = GetPlayersCountByTeam(HORDE);
- }
- else
- {
- otherTeam = GetInvitedCount(ALLIANCE);
- otherIn = GetPlayersCountByTeam(ALLIANCE);
- }
- if (GetStatus() == STATUS_IN_PROGRESS)
- {
- // difference based on ppl invited (not necessarily entered battle)
- // default: allow 0
- uint32 diff = 0;
- // allow join one person if the sides are equal (to fill up bg to minplayersperteam)
- if (otherTeam == GetInvitedCount(Team))
- diff = 1;
- // allow join more ppl if the other side has more players
- else if(otherTeam > GetInvitedCount(Team))
- diff = otherTeam - GetInvitedCount(Team);
-
- // difference based on max players per team (don't allow inviting more)
- uint32 diff2 = (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
-
- // difference based on players who already entered
- // default: allow 0
- uint32 diff3 = 0;
- // allow join one person if the sides are equal (to fill up bg minplayersperteam)
- if (otherIn == GetPlayersCountByTeam(Team))
- diff3 = 1;
- // allow join more ppl if the other side has more players
- else if (otherIn > GetPlayersCountByTeam(Team))
- diff3 = otherIn - GetPlayersCountByTeam(Team);
- // or other side has less than minPlayersPerTeam
- else if (GetInvitedCount(Team) <= GetMinPlayersPerTeam())
- diff3 = GetMinPlayersPerTeam() - GetInvitedCount(Team) + 1;
-
- // return the minimum of the 3 differences
-
- // min of diff and diff 2
- diff = diff < diff2 ? diff : diff2;
-
- // min of diff, diff2 and diff3
- return diff < diff3 ? diff : diff3 ;
- }
return 0;
}
@@ -1117,10 +1259,10 @@ void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
break;
case SCORE_BONUS_HONOR: // Honor bonus
// do not add honor in arenas
- if(isBattleGround())
+ if (isBattleGround())
{
// reward honor instantly
- if(Source->RewardHonor(NULL, 1, value))
+ if (Source->RewardHonor(NULL, 1, value))
itr->second->BonusHonor += value;
}
break;
@@ -1142,14 +1284,13 @@ void BattleGround::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
m_ReviveQueue[npc_guid].push_back(player_guid);
Player *plr = objmgr.GetPlayer(player_guid);
- if(!plr)
+ if (!plr)
return;
- plr->CastSpell(plr, SPELL_WAITING_FOR_RESURRECT, true);
SpellEntry const *spellInfo = sSpellStore.LookupEntry( SPELL_WAITING_FOR_RESURRECT );
- if(spellInfo)
+ if (spellInfo)
{
- Aura *Aur = CreateAura(spellInfo, 0, NULL, plr);
+ Aura *Aur = new Aura(spellInfo, 1, NULL, plr);
plr->AddAura(Aur);
}
}
@@ -1160,12 +1301,12 @@ void BattleGround::RemovePlayerFromResurrectQueue(uint64 player_guid)
{
for(std::vector<uint64>::iterator itr2 =(itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
{
- if(*itr2 == player_guid)
+ if (*itr2 == player_guid)
{
(itr->second).erase(itr2);
Player *plr = objmgr.GetPlayer(player_guid);
- if(!plr)
+ if (!plr)
return;
plr->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT);
@@ -1179,14 +1320,15 @@ void BattleGround::RemovePlayerFromResurrectQueue(uint64 player_guid)
bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
{
Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceID());
- if(!map)
+ if (!map)
return false;
// 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(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, map,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
+ if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, map,
+ PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
{
sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry);
sLog.outError("Cannot create gameobject template %u! BattleGround not created!", entry);
@@ -1226,10 +1368,10 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
void BattleGround::DoorClose(uint32 type)
{
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
- if(obj)
+ if (obj)
{
//if doors are open, close it
- if( obj->getLootState() == GO_ACTIVATED && !obj->GetGoState() )
+ if (obj->getLootState() == GO_ACTIVATED && !obj->GetGoState())
{
//change state to allow door to be closed
obj->SetLootState(GO_READY);
@@ -1245,7 +1387,7 @@ void BattleGround::DoorClose(uint32 type)
void BattleGround::DoorOpen(uint32 type)
{
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
- if(obj)
+ if (obj)
{
//change state to be sure they will be opened
obj->SetLootState(GO_READY);
@@ -1276,15 +1418,15 @@ Creature* BattleGround::GetBGCreature(uint32 type)
void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime)
{
Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceID());
- if(!map)
+ if (!map)
return;
- if( respawntime == 0 )
+ if (respawntime == 0)
{
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
- if(obj)
+ if (obj)
{
//we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again
- if( obj->getLootState() == GO_JUST_DEACTIVATED )
+ if (obj->getLootState() == GO_JUST_DEACTIVATED)
obj->SetLootState(GO_READY);
obj->SetRespawnTime(0);
map->Add(obj);
@@ -1293,7 +1435,7 @@ void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime)
else
{
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
- if(obj)
+ if (obj)
{
map->Add(obj);
obj->SetRespawnTime(respawntime);
@@ -1305,11 +1447,11 @@ void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime)
Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime)
{
Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceID());
- if(!map)
+ if (!map)
return NULL;
Creature* pCreature = new Creature;
- if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, entry, teamval))
+ if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, teamval))
{
sLog.outError("Can't create creature entry: %u",entry);
delete pCreature;
@@ -1318,14 +1460,14 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
pCreature->Relocate(x, y, z, o);
- if(!pCreature->IsPositionValid())
+ if (!pCreature->IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to battleground. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not added to battleground. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ delete pCreature;
return NULL;
}
pCreature->SetHomePosition(x, y, z, o);
- pCreature->AIM_Initialize();
//pCreature->SetDungeonDifficulty(0);
@@ -1338,13 +1480,13 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
void BattleGround::SpawnBGCreature(uint32 type, uint32 respawntime)
{
Map * map = MapManager::Instance().FindMap(GetMapId(),GetInstanceId());
- if(!map)
+ if (!map)
return false;
- if(respawntime == 0)
+ if (respawntime == 0)
{
Creature *obj = HashMapHolder<Creature>::Find(m_BgCreatures[type]);
- if(obj)
+ if (obj)
{
//obj->Respawn(); // bugged
obj->SetRespawnTime(0);
@@ -1355,7 +1497,7 @@ void BattleGround::SpawnBGCreature(uint32 type, uint32 respawntime)
else
{
Creature *obj = HashMapHolder<Creature>::Find(m_BgCreatures[type]);
- if(obj)
+ if (obj)
{
obj->setDeathState(DEAD);
obj->SetRespawnTime(respawntime);
@@ -1366,8 +1508,11 @@ void BattleGround::SpawnBGCreature(uint32 type, uint32 respawntime)
*/
bool BattleGround::DelCreature(uint32 type)
{
+ if (!m_BgCreatures[type])
+ return true;
+
Creature *cr = HashMapHolder<Creature>::Find(m_BgCreatures[type]);
- if(!cr)
+ if (!cr)
{
sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type]));
return false;
@@ -1381,8 +1526,11 @@ bool BattleGround::DelCreature(uint32 type)
bool BattleGround::DelObject(uint32 type)
{
+ if (!m_BgObjects[type])
+ return true;
+
GameObject *obj = HashMapHolder<GameObject>::Find(m_BgObjects[type]);
- if(!obj)
+ if (!obj)
{
sLog.outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type]));
return false;
@@ -1397,13 +1545,13 @@ bool BattleGround::AddSpiritGuide(uint32 type, float x, float y, float z, float
{
uint32 entry = 0;
- if(team == ALLIANCE)
+ if (team == ALLIANCE)
entry = 13116;
else
entry = 13117;
Creature* pCreature = AddCreature(entry,type,team,x,y,z,o);
- if(!pCreature)
+ if (!pCreature)
{
sLog.outError("Can't create Spirit guide. BattleGround not created!");
EndNow();
@@ -1414,10 +1562,12 @@ bool BattleGround::AddSpiritGuide(uint32 type, float x, float y, float z, float
pCreature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pCreature->GetGUID());
// aura
- pCreature->SetUInt32Value(UNIT_FIELD_AURA, SPELL_SPIRIT_HEAL_CHANNEL);
- pCreature->SetUInt32Value(UNIT_FIELD_AURAFLAGS, 0x00000009);
- pCreature->SetUInt32Value(UNIT_FIELD_AURALEVELS, 0x0000003C);
- pCreature->SetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS, 0x000000FF);
+ //TODO: Fix display here
+ //pCreature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
+
+ //pCreature->SetUInt32Value(UNIT_FIELD_AURAFLAGS, 0x00000009);
+ //pCreature->SetUInt32Value(UNIT_FIELD_AURALEVELS, 0x0000003C);
+ //pCreature->SetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS, 0x000000FF);
// casting visual effect
pCreature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL);
// correct cast speed
@@ -1428,31 +1578,40 @@ bool BattleGround::AddSpiritGuide(uint32 type, float x, float y, float z, float
return true;
}
-void BattleGround::SendMessageToAll(char const* text)
+void BattleGround::SendMessageToAll(int32 entry, ChatMsg type, Player const* source)
{
- WorldPacket data;
- ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, text, NULL);
- SendPacketToAll(&data);
+ MaNGOS::BattleGroundChatBuilder bg_builder(type, entry, source);
+ MaNGOS::LocalizedPacketDo<MaNGOS::BattleGroundChatBuilder> bg_do(bg_builder);
+ BroadcastWorker(bg_do);
}
-void BattleGround::SendMessageToAll(int32 entry)
+void BattleGround::PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...)
{
- char const* text = GetTrinityString(entry);
- WorldPacket data;
- ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, text, NULL);
- SendPacketToAll(&data);
+ va_list ap;
+ va_start(ap, source);
+
+ MaNGOS::BattleGroundChatBuilder bg_builder(type, entry, source, &ap);
+ MaNGOS::LocalizedPacketDo<MaNGOS::BattleGroundChatBuilder> bg_do(bg_builder);
+ BroadcastWorker(bg_do);
+
+ va_end(ap);
+}
+
+void BattleGround::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2)
+{
+ MaNGOS::BattleGround2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
+ MaNGOS::LocalizedPacketDo<MaNGOS::BattleGround2ChatBuilder> bg_do(bg_builder);
+ BroadcastWorker(bg_do);
}
void BattleGround::EndNow()
{
RemoveFromBGFreeSlotQueue();
SetStatus(STATUS_WAIT_LEAVE);
- SetEndTime(TIME_TO_AUTOREMOVE);
- // inform invited players about the removal
- sBattleGroundMgr.m_BattleGroundQueues[sBattleGroundMgr.BGQueueTypeId(GetTypeID(), GetArenaType())].BGEndedRemoveInvites(this);
+ SetEndTime(0);
}
-// Battleground messages are localized using the dbc lang, they are not client language dependent
+//to be removed
const char *BattleGround::GetTrinityString(int32 entry)
{
// FIXME: now we have different DBC locales and need localized message for each target client
@@ -1467,7 +1626,7 @@ buffs are in their positions when battleground starts
void BattleGround::HandleTriggerBuff(uint64 const& go_guid)
{
GameObject *obj = HashMapHolder<GameObject>::Find(go_guid);
- if(!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
+ if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
return;
//change buff type, when buff is used:
@@ -1483,13 +1642,13 @@ void BattleGround::HandleTriggerBuff(uint64 const& go_guid)
//randomly select new buff
uint8 buff = urand(0, 2);
uint32 entry = obj->GetEntry();
- if( m_BuffChange && entry != Buff_Entries[buff] )
+ if (m_BuffChange && entry != Buff_Entries[buff])
{
//despawn current buff
SpawnBGObject(index, RESPAWN_ONE_DAY);
//set index for new one
for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex)
- if( entry == Buff_Entries[currBuffTypeIndex] )
+ if (entry == Buff_Entries[currBuffTypeIndex])
{
index -= currBuffTypeIndex;
index += buff;
@@ -1507,46 +1666,77 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
UpdatePlayerScore(player, SCORE_DEATHS, 1);
// add +1 kills to group and +1 killing_blows to killer
- if( killer )
+ if (killer)
{
UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1);
UpdatePlayerScore(killer, SCORE_KILLING_BLOWS, 1);
- for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
Player *plr = objmgr.GetPlayer(itr->first);
- if(!plr || plr == killer)
+ if (!plr || plr == killer)
continue;
- if( plr->GetTeam() == killer->GetTeam() && plr->IsAtGroupRewardDistance(player) )
+ if (plr->GetTeam() == killer->GetTeam() && plr->IsAtGroupRewardDistance(player))
UpdatePlayerScore(plr, SCORE_HONORABLE_KILLS, 1);
}
}
- // to be able to remove insignia
- player->SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE );
+ // to be able to remove insignia -- ONLY IN BattleGrounds
+ if (!isArena())
+ player->SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE );
}
// return the player's team based on battlegroundplayer info
// used in same faction arena matches mainly
uint32 BattleGround::GetPlayerTeam(uint64 guid)
{
- std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.find(guid);
- if(itr!=m_Players.end())
+ BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
+ if (itr!=m_Players.end())
return itr->second.Team;
return 0;
}
+uint32 BattleGround::GetOtherTeam(uint32 teamId)
+{
+ return (teamId) ? ((teamId == ALLIANCE) ? HORDE : ALLIANCE) : 0;
+}
+
+bool BattleGround::IsPlayerInBattleGround(uint64 guid)
+{
+ BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
+ if (itr != m_Players.end())
+ return true;
+ return false;
+}
+
+void BattleGround::PlayerAddedToBGCheckIfBGIsRunning(Player* plr)
+{
+ if (GetStatus() != STATUS_WAIT_LEAVE)
+ return;
+
+ WorldPacket data;
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType());
+
+ BlockMovement(plr);
+
+ sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);
+ plr->GetSession()->SendPacket(&data);
+
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType());
+ plr->GetSession()->SendPacket(&data);
+}
+
uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
{
int count = 0;
- for(std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
{
- if(itr->second.Team == Team)
+ if (itr->second.Team == Team)
{
Player * pl = objmgr.GetPlayer(itr->first);
- if(pl && pl->isAlive())
+ if (pl && pl->isAlive())
++count;
}
}
@@ -1574,3 +1764,23 @@ void BattleGround::HandleKillUnit(Creature *creature, Player *killer)
{
}
+void BattleGround::CheckArenaWinConditions()
+{
+ if (!GetAlivePlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
+ EndBattleGround(HORDE);
+ else if (GetPlayersCountByTeam(ALLIANCE) && !GetAlivePlayersCountByTeam(HORDE))
+ EndBattleGround(ALLIANCE);
+}
+
+void BattleGround::SetBgRaid( uint32 TeamID, Group *bg_raid )
+{
+ Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
+ if(old_raid) old_raid->SetBattlegroundGroup(NULL);
+ if(bg_raid) bg_raid->SetBattlegroundGroup(this);
+ old_raid = bg_raid;
+}
+
+WorldSafeLocsEntry const* BattleGround::GetClosestGraveYard( Player* player )
+{
+ return objmgr.GetClosestGraveYard( player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam() );
+}
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index c9592cebe63..9788f264502 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,13 +22,16 @@
#define __BATTLEGROUND_H
#include "Common.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "Opcodes.h"
-#include "ObjectMgr.h"
-#include "BattleGroundMgr.h"
#include "SharedDefines.h"
+class Creature;
+class GameObject;
+class Group;
+class Player;
+class WorldPacket;
+
+struct WorldSafeLocsEntry;
+
enum BattleGroundSounds
{
SOUND_HORDE_WINS = 8454,
@@ -83,17 +86,22 @@ enum BattleGroundTimeIntervals
{
RESURRECTION_INTERVAL = 30000, // ms
REMIND_INTERVAL = 30000, // ms
+ INVITATION_REMIND_TIME = 60000, // ms
INVITE_ACCEPT_WAIT_TIME = 80000, // ms
TIME_TO_AUTOREMOVE = 120000, // ms
- MAX_OFFLINE_TIME = 300000, // ms
- START_DELAY0 = 120000, // ms
- START_DELAY1 = 60000, // ms
- START_DELAY2 = 30000, // ms
- START_DELAY3 = 15000, // ms used only in arena
+ MAX_OFFLINE_TIME = 300, // secs
RESPAWN_ONE_DAY = 86400, // secs
RESPAWN_IMMEDIATELY = 0, // secs
BUFF_RESPAWN_TIME = 180, // secs
- BG_HONOR_SCORE_TICKS = 330 // points
+};
+
+enum BattleGroundStartTimeIntervals
+{
+ BG_START_DELAY_2M = 120000, // ms (2 minutes)
+ BG_START_DELAY_1M = 60000, // ms (1 minute)
+ BG_START_DELAY_30S = 30000, // ms (30 seconds)
+ BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
+ BG_START_DELAY_NONE = 0, // ms
};
enum BattleGroundBuffObjects
@@ -107,16 +115,16 @@ const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENB
enum BattleGroundStatus
{
- STATUS_NONE = 0,
- STATUS_WAIT_QUEUE = 1,
- STATUS_WAIT_JOIN = 2,
- STATUS_IN_PROGRESS = 3,
- STATUS_WAIT_LEAVE = 4 // custom
+ STATUS_NONE = 0, // first status, should mean bg is not instance
+ STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
+ STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
+ STATUS_IN_PROGRESS = 3, // means bg is running
+ STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
};
struct BattleGroundPlayer
{
- uint32 LastOnlineTime; // for tracking and removing offline players from queue after 5 minutes
+ time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
uint32 Team; // Player's team
};
@@ -129,31 +137,33 @@ struct BattleGroundObjectInfo
uint32 spellid;
};
-#define MAX_QUEUED_PLAYERS_MAP 7
-
-enum BattleGroundTypeId
+// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
+enum BattleGroundQueueTypeId
{
- BATTLEGROUND_AV = 1,
- BATTLEGROUND_WS = 2,
- BATTLEGROUND_AB = 3,
- BATTLEGROUND_NA = 4,
- BATTLEGROUND_BE = 5,
- BATTLEGROUND_AA = 6,
- BATTLEGROUND_EY = 7,
- BATTLEGROUND_RL = 8
+ BATTLEGROUND_QUEUE_NONE = 0,
+ BATTLEGROUND_QUEUE_AV = 1,
+ BATTLEGROUND_QUEUE_WS = 2,
+ BATTLEGROUND_QUEUE_AB = 3,
+ BATTLEGROUND_QUEUE_EY = 4,
+ BATTLEGROUND_QUEUE_SA = 5,
+ BATTLEGROUND_QUEUE_2v2 = 6,
+ BATTLEGROUND_QUEUE_3v3 = 7,
+ BATTLEGROUND_QUEUE_5v5 = 8
};
+#define MAX_BATTLEGROUND_QUEUE_TYPES 9
-// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
-enum BattleGroundQueueTypeId
+enum BGQueueIdBasedOnLevel // queue_id for level ranges
{
- BATTLEGROUND_QUEUE_AV = 1,
- BATTLEGROUND_QUEUE_WS = 2,
- BATTLEGROUND_QUEUE_AB = 3,
- BATTLEGROUND_QUEUE_EY = 4,
- BATTLEGROUND_QUEUE_2v2 = 5,
- BATTLEGROUND_QUEUE_3v3 = 6,
- BATTLEGROUND_QUEUE_5v5 = 7,
+ QUEUE_ID_MAX_LEVEL_19 = 0,
+ QUEUE_ID_MAX_LEVEL_29 = 1,
+ QUEUE_ID_MAX_LEVEL_39 = 2,
+ QUEUE_ID_MAX_LEVEL_49 = 3,
+ QUEUE_ID_MAX_LEVEL_59 = 4,
+ QUEUE_ID_MAX_LEVEL_69 = 5,
+ QUEUE_ID_MAX_LEVEL_79 = 6,
+ QUEUE_ID_MAX_LEVEL_80 = 7
};
+#define MAX_BATTLEGROUND_QUEUES 8
enum ScoreType
{
@@ -206,6 +216,25 @@ enum BattleGroundTeamId
BG_TEAM_ALLIANCE = 0,
BG_TEAM_HORDE = 1
};
+#define BG_TEAMS_COUNT 2
+
+enum BattleGroundStartingEvents
+{
+ BG_STARTING_EVENT_NONE = 0x00,
+ BG_STARTING_EVENT_1 = 0x01,
+ BG_STARTING_EVENT_2 = 0x02,
+ BG_STARTING_EVENT_3 = 0x04,
+ BG_STARTING_EVENT_4 = 0x08
+};
+
+enum BattleGroundStartingEventsIds
+{
+ BG_STARTING_EVENT_FIRST = 0,
+ BG_STARTING_EVENT_SECOND = 1,
+ BG_STARTING_EVENT_THIRD = 2,
+ BG_STARTING_EVENT_FOURTH = 3
+};
+#define BG_STARTING_EVENT_COUNT 4
enum BattleGroundJoinError
{
@@ -224,10 +253,11 @@ enum BattleGroundJoinError
class BattleGroundScore
{
public:
- BattleGroundScore() : KillingBlows(0), HonorableKills(0), Deaths(0), DamageDone(0), HealingDone(0), BonusHonor(0) {};
- virtual ~BattleGroundScore() //virtual destructor is used when deleting score from scores map
- {
- };
+ BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0),
+ BonusHonor(0), DamageDone(0), HealingDone(0)
+ {}
+ virtual ~BattleGroundScore() {} //virtual destructor is used when deleting score from scores map
+
uint32 KillingBlows;
uint32 Deaths;
uint32 HonorableKills;
@@ -259,23 +289,23 @@ class BattleGround
BattleGround();
/*BattleGround(const BattleGround& bg);*/
virtual ~BattleGround();
- virtual void Update(time_t diff); // must be implemented in BG subclass of BG specific update code, but must in begginning call parent version
+ virtual void Update(uint32 diff); // must be implemented in BG subclass of BG specific update code, but must in begginning call parent version
virtual bool SetupBattleGround() // must be implemented in BG subclass
{
return true;
}
- void Reset(); // resets all common properties for battlegrounds
- virtual void ResetBGSubclass() // must be implemented in BG subclass
- {
- }
+ virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass
+ virtual void StartingEventCloseDoors() {}
+ virtual void StartingEventOpenDoors() {}
/* Battleground */
// Get methods:
char const* GetName() const { return m_Name; }
- uint32 GetTypeID() const { return m_TypeID; }
- uint32 GetQueueType() const { return m_Queue_type; }
+ BattleGroundTypeId GetTypeID() const { return m_TypeID; }
+ BGQueueIdBasedOnLevel GetQueueId() const { return m_QueueId; }
uint32 GetInstanceID() const { return m_InstanceID; }
- uint32 GetStatus() const { return m_Status; }
+ BattleGroundStatus GetStatus() const { return m_Status; }
+ uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
uint32 GetStartTime() const { return m_StartTime; }
uint32 GetEndTime() const { return m_EndTime; }
uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
@@ -288,17 +318,25 @@ class BattleGround
uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
- int GetStartDelayTime() const { return m_StartDelayTime; }
+ int32 GetStartDelayTime() const { return m_StartDelayTime; }
uint8 GetArenaType() const { return m_ArenaType; }
uint8 GetWinner() const { return m_Winner; }
uint32 GetBattlemasterEntry() const;
+ uint32 GetBonusHonorFromKill(uint32 kills) const;
// Set methods:
void SetName(char const* Name) { m_Name = Name; }
- void SetTypeID(uint32 TypeID) { m_TypeID = TypeID; }
- void SetQueueType(uint32 ID) { m_Queue_type = ID; }
+ void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; }
+ //here we can count minlevel and maxlevel for players
+ void SetQueueId(BGQueueIdBasedOnLevel ID)
+ {
+ m_QueueId = ID;
+ uint8 diff = (m_TypeID == BATTLEGROUND_AV) ? 1 : 0;
+ this->SetLevelRange((ID + 1) * 10 + diff, (ID + 2) * 10 - ((diff + 1) % 2));
+ }
void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
- void SetStatus(uint32 Status) { m_Status = Status; }
+ void SetStatus(BattleGroundStatus Status) { m_Status = Status; }
+ void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
void SetStartTime(uint32 Time) { m_StartTime = Time; }
void SetEndTime(uint32 Time) { m_EndTime = Time; }
void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
@@ -323,12 +361,11 @@ class BattleGround
void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
uint32 GetInvitedCount(uint32 team) const
{
- if( team == ALLIANCE )
+ if (team == ALLIANCE)
return m_InvitedAlliance;
else
return m_InvitedHorde;
}
- bool HasFreeSlotsForTeam(uint32 Team) const;
bool HasFreeSlots() const;
uint32 GetFreeSlotsForTeam(uint32 Team) const;
@@ -339,7 +376,6 @@ class BattleGround
typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
uint32 GetPlayersSize() const { return m_Players.size(); }
- uint32 GetRemovedPlayersSize() const { return m_RemovedPlayers.size(); }
std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
@@ -374,6 +410,10 @@ class BattleGround
void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
void SendPacketToAll(WorldPacket *packet);
void YellToAll(Creature* creature, const char* text, uint32 language);
+
+ template<class Do>
+ void BroadcastWorker(Do& _do);
+
void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
void PlaySoundToAll(uint32 SoundID);
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
@@ -387,18 +427,15 @@ class BattleGround
void EndBattleGround(uint32 winner);
void BlockMovement(Player *plr);
- void SendMessageToAll(char const* text);
- void SendMessageToAll(int32 entry);
+ void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL);
+ void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ... );
+
+ // specialized version with 2 string id args
+ void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
/* Raid Group */
Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
- void SetBgRaid(uint32 TeamID, Group *bg_raid)
- {
- Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
- if(old_raid) old_raid->SetBattlegroundGroup(NULL);
- if(bg_raid) bg_raid->SetBattlegroundGroup(this);
- old_raid = bg_raid;
- }
+ void SetBgRaid(uint32 TeamID, Group *bg_raid);
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
@@ -407,7 +444,7 @@ class BattleGround
uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
void UpdatePlayersCountByTeam(uint32 Team, bool remove)
{
- if(remove)
+ if (remove)
--m_PlayersCount[GetTeamIndexByTeamId(Team)];
else
++m_PlayersCount[GetTeamIndexByTeamId(Team)];
@@ -415,9 +452,10 @@ class BattleGround
// used for rated arena battles
void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
- uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
+ uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
- int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
+ int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
+ void CheckArenaWinConditions();
/* Triggers handle */
// must be implemented in BG subclass
@@ -427,16 +465,19 @@ class BattleGround
virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/);
/* Battleground events */
- /* these functions will return true event is possible, but false if player is bugger */
virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
+ void EventPlayerLoggedIn(Player* player, uint64 plr_guid);
+ void EventPlayerLoggedOut(Player* player);
/* Death related */
- virtual WorldSafeLocsEntry const* GetClosestGraveYard(float /*x*/, float /*y*/, float /*z*/, uint32 /*team*/) { return NULL; }
+ virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
virtual void AddPlayer(Player *plr); // must be implemented in BG subclass
+ void AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team);
+
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
// can be extended in in BG subclass
@@ -459,18 +500,22 @@ class BattleGround
void DoorOpen(uint32 type);
void DoorClose(uint32 type);
+ //to be removed
const char *GetTrinityString(int32 entry);
- virtual bool HandlePlayerUnderMap(Player * plr) {return false;}
+ virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
uint32 GetPlayerTeam(uint64 guid);
+ uint32 GetOtherTeam(uint32 teamId);
+ bool IsPlayerInBattleGround(uint64 guid);
void SetDeleteThis() {m_SetDeleteThis = true;}
protected:
//this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround
void EndNow();
+ void PlayerAddedToBGCheckIfBGIsRunning(Player* plr);
/* Scorekeeping */
// Player scores
@@ -484,29 +529,29 @@ class BattleGround
std::map<uint64, std::vector<uint64> > m_ReviveQueue;
/*
- this is important variable used for invitation messages
+ these are important variables used for starting messages
*/
uint8 m_Events;
+ BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT];
+ //this must be filled in constructors!
+ uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT];
bool m_BuffChange;
- uint32 m_score[2]; //array that keeps general team scores, used to determine who gets most marks when bg ends prematurely
BGHonorMode m_HonorMode;
private:
/* Battleground */
- uint32 m_TypeID; //Battleground type, defined in enum BattleGroundTypeId
+ BattleGroundTypeId m_TypeID;
uint32 m_InstanceID; //BattleGround Instance's GUID!
- uint32 m_Status;
+ BattleGroundStatus m_Status;
+ uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use
uint32 m_StartTime;
- uint32 m_EndTime;
+ int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
uint32 m_LastResurrectTime;
- uint32 m_Queue_type;
+ BGQueueIdBasedOnLevel m_QueueId;
uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
- // this variable is not used .... it can be found in many other ways... but to store it in BG object instance is useless
- //uint8 m_BattleGroundType; // 3=BG, 4=arena
- //instead of uint8 (in previous line) is bool used
bool m_IsArena;
uint8 m_Winner; // 0=alliance, 1=horde, 2=none
int32 m_StartDelayTime;
@@ -514,11 +559,10 @@ class BattleGround
bool m_PrematureCountDown;
uint32 m_PrematureCountDownTimer;
char const *m_Name;
-
/* Player lists */
std::vector<uint64> m_ResurrectQueue; // Player GUID
- std::map<uint64, uint8> m_RemovedPlayers; // uint8 is remove type (0 - bgqueue, 1 - bg, 2 - resurrect queue)
+ std::deque<uint64> m_OfflineQueue; // Player GUID
/* Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction */
/* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
@@ -527,15 +571,15 @@ class BattleGround
uint32 m_InvitedHorde;
/* Raid Group */
- Group *m_BgRaids[2]; // 0 - alliance, 1 - horde
+ Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
/* Players count by team */
- uint32 m_PlayersCount[2];
+ uint32 m_PlayersCount[BG_TEAMS_COUNT];
/* Arena team ids by team */
- uint32 m_ArenaTeamIds[2];
+ uint32 m_ArenaTeamIds[BG_TEAMS_COUNT];
- int32 m_ArenaTeamRatingChanges[2];
+ int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT];
/* Limits */
uint32 m_LevelMin;
@@ -545,12 +589,12 @@ class BattleGround
uint32 m_MinPlayersPerTeam;
uint32 m_MinPlayers;
- /* Location */
+ /* Start location */
uint32 m_MapId;
- float m_TeamStartLocX[2];
- float m_TeamStartLocY[2];
- float m_TeamStartLocZ[2];
- float m_TeamStartLocO[2];
+ float m_TeamStartLocX[BG_TEAMS_COUNT];
+ float m_TeamStartLocY[BG_TEAMS_COUNT];
+ float m_TeamStartLocZ[BG_TEAMS_COUNT];
+ float m_TeamStartLocO[BG_TEAMS_COUNT];
};
#endif
diff --git a/src/game/BattleGroundAA.cpp b/src/game/BattleGroundAA.cpp
index ad9720ad5fe..2aac2dde3eb 100644
--- a/src/game/BattleGroundAA.cpp
+++ b/src/game/BattleGroundAA.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,10 +21,20 @@
#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundAA.h"
+#include "Language.h"
BattleGroundAA::BattleGroundAA()
{
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
}
BattleGroundAA::~BattleGroundAA()
@@ -32,11 +42,19 @@ BattleGroundAA::~BattleGroundAA()
}
-void BattleGroundAA::Update(time_t diff)
+void BattleGroundAA::Update(uint32 diff)
{
BattleGround::Update(diff);
}
+void BattleGroundAA::StartingEventCloseDoors()
+{
+}
+
+void BattleGroundAA::StartingEventOpenDoors()
+{
+}
+
void BattleGroundAA::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
diff --git a/src/game/BattleGroundAA.h b/src/game/BattleGroundAA.h
index 8a07831eb38..06793ea38e0 100644
--- a/src/game/BattleGroundAA.h
+++ b/src/game/BattleGroundAA.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,10 +37,13 @@ class BattleGroundAA : public BattleGround
public:
BattleGroundAA();
~BattleGroundAA();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
+
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp
index 1cd5cfad420..40f60960377 100644
--- a/src/game/BattleGroundAB.cpp
+++ b/src/game/BattleGroundAB.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,12 +23,11 @@
#include "BattleGround.h"
#include "BattleGroundAB.h"
#include "Creature.h"
-#include "Chat.h"
#include "ObjectMgr.h"
-#include "MapManager.h"
#include "Language.h"
#include "World.h"
#include "Util.h"
+#include "WorldPacket.h"
// these variables aren't used outside of this file, so declare them only here
uint32 BG_AB_HonorScoreTicks[BG_HONOR_MODE_NUM] = {
@@ -46,102 +45,31 @@ BattleGroundAB::BattleGroundAB()
m_BuffChange = true;
m_BgObjects.resize(BG_AB_OBJECT_MAX);
m_BgCreatures.resize(BG_AB_ALL_NODES_COUNT);
+
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AB_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AB_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AB_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_AB_HAS_BEGUN;
}
BattleGroundAB::~BattleGroundAB()
{
}
-void BattleGroundAB::Update(time_t diff)
+void BattleGroundAB::Update(uint32 diff)
{
BattleGround::Update(diff);
- if( GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize() )
+ if (GetStatus() == STATUS_IN_PROGRESS)
{
- ModifyStartDelayTime(diff);
-
- if( !(m_Events & 0x01) )
- {
- m_Events |= 0x01;
-
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
-
- sLog.outDebug("Arathi Basin: entering state STATUS_WAIT_JOIN ...");
-
- // despawn banners, auras and buffs
- for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
- SpawnBGObject(obj, RESPAWN_ONE_DAY);
- for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
- SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
-
- // Starting doors
- SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
- SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
- DoorClose(BG_AB_OBJECT_GATE_A);
- DoorClose(BG_AB_OBJECT_GATE_H);
-
- // Starting base spirit guides
- _NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE);
- _NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
-
- SetStartDelayTime(START_DELAY0);
- }
- // After 1 minute, warning is signalled
- else if( GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04) )
- {
- m_Events |= 0x04;
- SendMessageToAll(GetTrinityString(LANG_BG_AB_ONEMINTOSTART));
- }
- // After 1,5 minute, warning is signalled
- else if( GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08) )
- {
- m_Events |= 0x08;
- SendMessageToAll(GetTrinityString(LANG_BG_AB_HALFMINTOSTART));
- }
- // After 2 minutes, gates OPEN ! x)
- else if( GetStartDelayTime() < 0 && !(m_Events & 0x10) )
- {
- m_Events |= 0x10;
- SendMessageToAll(GetTrinityString(LANG_BG_AB_STARTED));
-
- // spawn neutral banners
- for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
- SpawnBGObject(banner, RESPAWN_IMMEDIATELY);
- for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
- {
- //randomly select buff to spawn
- uint8 buff = urand(0, 2);
- SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3, RESPAWN_IMMEDIATELY);
- }
- DoorOpen(BG_AB_OBJECT_GATE_A);
- DoorOpen(BG_AB_OBJECT_GATE_H);
-
- PlaySoundToAll(SOUND_BG_START);
- if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
- PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
- SetStatus(STATUS_IN_PROGRESS);
-
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player* plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
- }
-
- }
- else if( GetStatus() == STATUS_IN_PROGRESS )
- {
- int team_points[2] = { 0, 0 };
+ int team_points[BG_TEAMS_COUNT] = { 0, 0 };
for (int node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
{
// 3 sec delay to spawn new banner instead previous despawned one
- if( m_BannerTimers[node].timer )
+ if (m_BannerTimers[node].timer)
{
- if( m_BannerTimers[node].timer > diff )
+ if (m_BannerTimers[node].timer > diff)
m_BannerTimers[node].timer -= diff;
else
{
@@ -151,9 +79,9 @@ void BattleGroundAB::Update(time_t diff)
}
// 1-minute to occupy a node from contested state
- if( m_NodeTimers[node] )
+ if (m_NodeTimers[node])
{
- if( m_NodeTimers[node] > diff )
+ if (m_NodeTimers[node] > diff)
m_NodeTimers[node] -= diff;
else
{
@@ -169,72 +97,111 @@ void BattleGroundAB::Update(time_t diff)
_SendNodeUpdate(node);
_NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE);
// Message to chatlog
- char buf[256];
- uint8 type = (teamIndex == 0) ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE;
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
- WorldPacket data;
- ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
- SendPacketToAll(&data);
- PlaySoundToAll((teamIndex == 0) ? SOUND_NODE_CAPTURED_ALLIANCE : SOUND_NODE_CAPTURED_HORDE);
+
+ if (teamIndex == 0)
+ {
+ // FIXME: team and node names not localized
+ SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_AB_ALLY,_GetNodeNameId(node));
+ PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_ALLIANCE);
+ }
+ else
+ {
+ // FIXME: team and node names not localized
+ SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_AB_HORDE,_GetNodeNameId(node));
+ PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE);
+ }
}
}
- for (int team = 0; team < 2; ++team)
- if( m_Nodes[node] == team + BG_AB_NODE_TYPE_OCCUPIED )
+ for (int team = 0; team < BG_TEAMS_COUNT; ++team)
+ if (m_Nodes[node] == team + BG_AB_NODE_TYPE_OCCUPIED)
++team_points[team];
}
// Accumulate points
- for (int team = 0; team < 2; ++team)
+ for (int team = 0; team < BG_TEAMS_COUNT; ++team)
{
int points = team_points[team];
- if( !points )
+ if (!points)
continue;
m_lastTick[team] += diff;
- if( m_lastTick[team] > BG_AB_TickIntervals[points] )
+ if (m_lastTick[team] > BG_AB_TickIntervals[points])
{
m_lastTick[team] -= BG_AB_TickIntervals[points];
m_TeamScores[team] += BG_AB_TickPoints[points];
- m_score[team] = m_TeamScores[team];
m_HonorScoreTics[team] += BG_AB_TickPoints[points];
m_ReputationScoreTics[team] += BG_AB_TickPoints[points];
- if( m_ReputationScoreTics[team] >= BG_AB_ReputationScoreTicks[m_HonorMode] )
+ if (m_ReputationScoreTics[team] >= m_ReputationTics)
{
(team == BG_TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE);
- m_ReputationScoreTics[team] -= BG_AB_ReputationScoreTicks[m_HonorMode];
+ m_ReputationScoreTics[team] -= m_ReputationTics;
}
- if( m_HonorScoreTics[team] >= BG_AB_HonorScoreTicks[m_HonorMode] )
+ if (m_HonorScoreTics[team] >= m_HonorTics)
{
- (team == BG_TEAM_ALLIANCE) ? RewardHonorToTeam(20, ALLIANCE) : RewardHonorToTeam(20, HORDE);
- m_HonorScoreTics[team] -= BG_AB_HonorScoreTicks[m_HonorMode];
+ RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BG_TEAM_ALLIANCE) ? ALLIANCE : HORDE);
+ m_HonorScoreTics[team] -= m_HonorTics;
}
- if( !m_IsInformedNearVictory && m_TeamScores[team] > 1800 )
+ if (!m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE)
{
- if( team == BG_TEAM_ALLIANCE )
- SendMessageToAll(GetTrinityString(LANG_BG_AB_A_NEAR_VICTORY));
+ if (team == BG_TEAM_ALLIANCE)
+ SendMessageToAll(LANG_BG_AB_A_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else
- SendMessageToAll(GetTrinityString(LANG_BG_AB_H_NEAR_VICTORY));
- PlaySoundToAll(SOUND_NEAR_VICTORY);
+ SendMessageToAll(LANG_BG_AB_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ PlaySoundToAll(BG_AB_SOUND_NEAR_VICTORY);
m_IsInformedNearVictory = true;
}
- if( m_TeamScores[team] > 2000 )
- m_TeamScores[team] = 2000;
- if( team == BG_TEAM_ALLIANCE )
+ if (m_TeamScores[team] > BG_AB_MAX_TEAM_SCORE)
+ m_TeamScores[team] = BG_AB_MAX_TEAM_SCORE;
+ if (team == BG_TEAM_ALLIANCE)
UpdateWorldState(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[team]);
- if( team == BG_TEAM_HORDE )
+ if (team == BG_TEAM_HORDE)
UpdateWorldState(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[team]);
}
}
// Test win condition
- if( m_TeamScores[BG_TEAM_ALLIANCE] >= 2000 )
+ if (m_TeamScores[BG_TEAM_ALLIANCE] >= BG_AB_MAX_TEAM_SCORE)
EndBattleGround(ALLIANCE);
- if( m_TeamScores[BG_TEAM_HORDE] >= 2000 )
+ if (m_TeamScores[BG_TEAM_HORDE] >= BG_AB_MAX_TEAM_SCORE)
EndBattleGround(HORDE);
}
}
+void BattleGroundAB::StartingEventCloseDoors()
+{
+ // despawn banners, auras and buffs
+ for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
+ SpawnBGObject(obj, RESPAWN_ONE_DAY);
+ for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
+ SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
+
+ // Starting doors
+ DoorClose(BG_AB_OBJECT_GATE_A);
+ DoorClose(BG_AB_OBJECT_GATE_H);
+ SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
+ SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
+
+ // Starting base spirit guides
+ _NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE);
+ _NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
+}
+
+void BattleGroundAB::StartingEventOpenDoors()
+{
+ // spawn neutral banners
+ for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
+ SpawnBGObject(banner, RESPAWN_IMMEDIATELY);
+ for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
+ {
+ //randomly select buff to spawn
+ uint8 buff = urand(0, 2);
+ SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3, RESPAWN_IMMEDIATELY);
+ }
+ DoorOpen(BG_AB_OBJECT_GATE_A);
+ DoorOpen(BG_AB_OBJECT_GATE_H);
+}
+
void BattleGroundAB::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -251,19 +218,19 @@ void BattleGroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
void BattleGroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
- if( GetStatus() != STATUS_IN_PROGRESS )
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
switch(Trigger)
{
case 3948: // Arathi Basin Alliance Exit.
- if( Source->GetTeam() != ALLIANCE )
+ if (Source->GetTeam() != ALLIANCE)
Source->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
else
Source->LeaveBattleground();
break;
case 3949: // Arathi Basin Horde Exit.
- if( Source->GetTeam() != HORDE )
+ if (Source->GetTeam() != HORDE)
Source->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
else
Source->LeaveBattleground();
@@ -288,7 +255,7 @@ void BattleGroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
{
// Just put it into the queue
- if( delay )
+ if (delay)
{
m_BannerTimers[node].timer = 2000;
m_BannerTimers[node].type = type;
@@ -301,7 +268,7 @@ void BattleGroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool
SpawnBGObject(obj, RESPAWN_IMMEDIATELY);
// handle aura with banner
- if( !type )
+ if (!type)
return;
obj = node * 8 + ((type == BG_AB_NODE_TYPE_OCCUPIED) ? (5 + teamIndex) : 7);
SpawnBGObject(obj, RESPAWN_IMMEDIATELY);
@@ -313,30 +280,25 @@ void BattleGroundAB::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
SpawnBGObject(obj, RESPAWN_ONE_DAY);
// handle aura with banner
- if( !type )
+ if (!type)
return;
obj = node * 8 + ((type == BG_AB_NODE_TYPE_OCCUPIED) ? (5 + teamIndex) : 7);
SpawnBGObject(obj, RESPAWN_ONE_DAY);
}
-const char* BattleGroundAB::_GetNodeName(uint8 node)
+int32 BattleGroundAB::_GetNodeNameId(uint8 node)
{
switch (node)
{
- case BG_AB_NODE_STABLES:
- return GetTrinityString(LANG_BG_AB_NODE_STABLES);
- case BG_AB_NODE_BLACKSMITH:
- return GetTrinityString(LANG_BG_AB_NODE_BLACKSMITH);
- case BG_AB_NODE_FARM:
- return GetTrinityString(LANG_BG_AB_NODE_FARM);
- case BG_AB_NODE_LUMBER_MILL:
- return GetTrinityString(LANG_BG_AB_NODE_LUMBER_MILL);
- case BG_AB_NODE_GOLD_MINE:
- return GetTrinityString(LANG_BG_AB_NODE_GOLD_MINE);
+ case BG_AB_NODE_STABLES: return LANG_BG_AB_NODE_STABLES;
+ case BG_AB_NODE_BLACKSMITH: return LANG_BG_AB_NODE_BLACKSMITH;
+ case BG_AB_NODE_FARM: return LANG_BG_AB_NODE_FARM;
+ case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL;
+ case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE;
default:
ASSERT(0);
}
- return "";
+ return 0;
}
void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
@@ -355,9 +317,9 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
// How many bases each team owns
uint8 ally = 0, horde = 0;
for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
- if( m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_OCCUPIED )
+ if (m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_OCCUPIED)
++ally;
- else if( m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_OCCUPIED )
+ else if (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_OCCUPIED)
++horde;
data << uint32(BG_AB_OP_OCCUPIED_BASES_ALLY) << uint32(ally);
@@ -365,7 +327,7 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
// Team scores
data << uint32(BG_AB_OP_RESOURCES_MAX) << uint32(BG_AB_MAX_TEAM_SCORE);
- data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_SCORE);
+ data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_NEAR_VICTORY_SCORE);
data << uint32(BG_AB_OP_RESOURCES_ALLY) << uint32(m_TeamScores[BG_TEAM_ALLIANCE]);
data << uint32(BG_AB_OP_RESOURCES_HORDE) << uint32(m_TeamScores[BG_TEAM_HORDE]);
@@ -378,7 +340,7 @@ void BattleGroundAB::_SendNodeUpdate(uint8 node)
// Send node owner state update to refresh map icons on client
const uint8 plusArray[] = {0, 2, 3, 0, 1};
- if( m_prevNodes[node] )
+ if (m_prevNodes[node])
UpdateWorldState(BG_AB_OP_NODESTATES[node] + plusArray[m_prevNodes[node]], 0);
else
UpdateWorldState(BG_AB_OP_NODEICONS[node], 0);
@@ -388,9 +350,9 @@ void BattleGroundAB::_SendNodeUpdate(uint8 node)
// How many bases each team owns
uint8 ally = 0, horde = 0;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
- if( m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED )
+ if (m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED)
++ally;
- else if( m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED )
+ else if (m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED)
++horde;
UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_ALLY, ally);
@@ -399,46 +361,47 @@ void BattleGroundAB::_SendNodeUpdate(uint8 node)
void BattleGroundAB::_NodeOccupied(uint8 node,Team team)
{
- if( !AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team) )
+ if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
sLog.outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team);
// SpawnBGCreature(node,RESPAWN_IMMEDIATELY);
uint8 capturedNodes = 0;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
- if( m_Nodes[node] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i])
+ if (m_Nodes[node] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i])
++capturedNodes;
}
- if(capturedNodes >= 5)
+ if (capturedNodes >= 5)
CastSpellOnTeam(SPELL_AB_QUEST_REWARD_5_BASES, team);
- if(capturedNodes >= 4)
+ if (capturedNodes >= 4)
CastSpellOnTeam(SPELL_AB_QUEST_REWARD_4_BASES, team);
}
void BattleGroundAB::_NodeDeOccupied(uint8 node)
{
- if( node >= BG_AB_DYNAMIC_NODES_COUNT)
+ if (node >= BG_AB_DYNAMIC_NODES_COUNT)
return;
// Those who are waiting to resurrect at this node are taken to the closest own node's graveyard
std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[node]];
- if( !ghost_list.empty() )
+ if (!ghost_list.empty())
{
WorldSafeLocsEntry const *ClosestGrave = NULL;
- Player *plr;
- for (std::vector<uint64>::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
+ for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
{
- plr = objmgr.GetPlayer(*ghost_list.begin());
- if( !plr )
+ Player* plr = objmgr.GetPlayer(*itr);
+ if (!plr)
continue;
- if( !ClosestGrave )
- ClosestGrave = GetClosestGraveYard(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetTeam());
- plr->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, plr->GetOrientation());
+ if (!ClosestGrave) // cache
+ ClosestGrave = GetClosestGraveYard(plr);
+
+ if (ClosestGrave)
+ plr->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, plr->GetOrientation());
}
}
- if( m_BgCreatures[node] )
+ if (m_BgCreatures[node])
DelCreature(node);
// buff object isn't despawned
@@ -447,7 +410,7 @@ void BattleGroundAB::_NodeDeOccupied(uint8 node)
/* Invoked if a player used a banner as a gameobject */
void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/)
{
- if( GetStatus() != STATUS_IN_PROGRESS )
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint8 node = BG_AB_NODE_STABLES;
@@ -458,7 +421,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
obj=HashMapHolder<GameObject>::Find(m_BgObjects[node*8+BG_AB_OBJECT_AURA_CONTESTED]);
}
- if( node == BG_AB_DYNAMIC_NODES_COUNT)
+ if (node == BG_AB_DYNAMIC_NODES_COUNT)
{
// this means our player isn't close to any of banners - maybe cheater ??
return;
@@ -466,18 +429,14 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
uint8 teamIndex = GetTeamIndexByTeamId(source->GetTeam());
- // Message to chatlog
- char buf[256];
- uint8 type = (teamIndex == 0) ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE;
-
// Check if player really could use this banner, not cheated
- if( !(m_Nodes[node] == 0 || teamIndex == m_Nodes[node]%2) )
+ if (!(m_Nodes[node] == 0 || teamIndex == m_Nodes[node]%2))
return;
source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
uint32 sound = 0;
// If node is neutral, change to contested
- if( m_Nodes[node] == BG_AB_NODE_TYPE_NEUTRAL )
+ if (m_Nodes[node] == BG_AB_NODE_TYPE_NEUTRAL)
{
UpdatePlayerScore(source, SCORE_BASES_ASSAULTED, 1);
m_prevNodes[node] = m_Nodes[node];
@@ -488,14 +447,20 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
_SendNodeUpdate(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_CLAIMED), _GetNodeName(node), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE));
- sound = SOUND_NODE_CLAIMED;
+
+ // FIXME: team and node names not localized
+ if (teamIndex == 0)
+ SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_AB_ALLY);
+ else
+ SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE);
+
+ sound = BG_AB_SOUND_NODE_CLAIMED;
}
// If node is contested
- else if( (m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_CONTESTED) || (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_CONTESTED) )
+ else if ((m_Nodes[node] == BG_AB_NODE_STATUS_ALLY_CONTESTED) || (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_CONTESTED))
{
// If last state is NOT occupied, change node to enemy-contested
- if( m_prevNodes[node] < BG_AB_NODE_TYPE_OCCUPIED )
+ if (m_prevNodes[node] < BG_AB_NODE_TYPE_OCCUPIED)
{
UpdatePlayerScore(source, SCORE_BASES_ASSAULTED, 1);
m_prevNodes[node] = m_Nodes[node];
@@ -506,7 +471,12 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_CreateBanner(node, BG_AB_NODE_TYPE_CONTESTED, teamIndex, true);
_SendNodeUpdate(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
+
+ // FIXME: node names not localized
+ if (teamIndex == 0)
+ SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
+ else
+ SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
}
// If contested, change back to occupied
else
@@ -521,9 +491,14 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_SendNodeUpdate(node);
m_NodeTimers[node] = 0;
_NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE);
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_DEFENDED), _GetNodeName(node));
+
+ // FIXME: node names not localized
+ if (teamIndex == 0)
+ SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
+ else
+ SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
}
- sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
+ sound = (teamIndex == 0) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
}
// If node is occupied, change to enemy-contested
else
@@ -538,18 +513,24 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_SendNodeUpdate(node);
_NodeDeOccupied(node);
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_ASSAULTED), _GetNodeName(node));
- sound = (teamIndex == 0) ? SOUND_NODE_ASSAULTED_ALLIANCE : SOUND_NODE_ASSAULTED_HORDE;
+
+ // FIXME: node names not localized
+ if (teamIndex == 0)
+ SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
+ else
+ SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
+
+ sound = (teamIndex == 0) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
}
- WorldPacket data;
- ChatHandler::FillMessageData(&data, source->GetSession(), type, LANG_UNIVERSAL, NULL, source->GetGUID(), buf, NULL);
- SendPacketToAll(&data);
+
// If node is occupied again, send "X has taken the Y" msg.
- if( m_Nodes[node] >= BG_AB_NODE_TYPE_OCCUPIED )
+ if (m_Nodes[node] >= BG_AB_NODE_TYPE_OCCUPIED)
{
- sprintf(buf, GetTrinityString(LANG_BG_AB_NODE_TAKEN), (teamIndex == 0) ? GetTrinityString(LANG_BG_AB_ALLY) : GetTrinityString(LANG_BG_AB_HORDE), _GetNodeName(node));
- ChatHandler::FillMessageData(&data, NULL, type, LANG_UNIVERSAL, NULL, 0, buf, NULL);
- SendPacketToAll(&data);
+ // FIXME: team and node names not localized
+ if (teamIndex == 0)
+ SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node));
+ else
+ SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node));
}
PlaySoundToAll(sound);
}
@@ -558,7 +539,7 @@ bool BattleGroundAB::SetupBattleGround()
{
for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
- if( !AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i,BG_AB_OBJECTID_NODE_BANNER_0 + i,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
+ if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i,BG_AB_OBJECTID_NODE_BANNER_0 + i,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i,BG_AB_OBJECTID_BANNER_CONT_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_H + 8*i,BG_AB_OBJECTID_BANNER_CONT_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_ALLY + 8*i,BG_AB_OBJECTID_BANNER_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
@@ -572,7 +553,7 @@ bool BattleGroundAB::SetupBattleGround()
return false;
}
}
- if( !AddObject(BG_AB_OBJECT_GATE_A,BG_AB_OBJECTID_GATE_A,BG_AB_DoorPositions[0][0],BG_AB_DoorPositions[0][1],BG_AB_DoorPositions[0][2],BG_AB_DoorPositions[0][3],BG_AB_DoorPositions[0][4],BG_AB_DoorPositions[0][5],BG_AB_DoorPositions[0][6],BG_AB_DoorPositions[0][7],RESPAWN_IMMEDIATELY)
+ if (!AddObject(BG_AB_OBJECT_GATE_A,BG_AB_OBJECTID_GATE_A,BG_AB_DoorPositions[0][0],BG_AB_DoorPositions[0][1],BG_AB_DoorPositions[0][2],BG_AB_DoorPositions[0][3],BG_AB_DoorPositions[0][4],BG_AB_DoorPositions[0][5],BG_AB_DoorPositions[0][6],BG_AB_DoorPositions[0][7],RESPAWN_IMMEDIATELY)
|| !AddObject(BG_AB_OBJECT_GATE_H,BG_AB_OBJECTID_GATE_H,BG_AB_DoorPositions[1][0],BG_AB_DoorPositions[1][1],BG_AB_DoorPositions[1][2],BG_AB_DoorPositions[1][3],BG_AB_DoorPositions[1][4],BG_AB_DoorPositions[1][5],BG_AB_DoorPositions[1][6],BG_AB_DoorPositions[1][7],RESPAWN_IMMEDIATELY)
)
{
@@ -582,7 +563,7 @@ bool BattleGroundAB::SetupBattleGround()
//buffs
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
- if( !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
+ if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
)
@@ -592,8 +573,11 @@ bool BattleGroundAB::SetupBattleGround()
return true;
}
-void BattleGroundAB::ResetBGSubclass()
+void BattleGroundAB::Reset()
{
+ //call parent's class reset
+ BattleGround::Reset();
+
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
m_TeamScores[BG_TEAM_HORDE] = 0;
m_lastTick[BG_TEAM_ALLIANCE] = 0;
@@ -603,6 +587,10 @@ void BattleGroundAB::ResetBGSubclass()
m_ReputationScoreTics[BG_TEAM_ALLIANCE] = 0;
m_ReputationScoreTics[BG_TEAM_HORDE] = 0;
m_IsInformedNearVictory = false;
+ bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks;
+ m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks;
+
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
m_Nodes[i] = 0;
@@ -612,32 +600,49 @@ void BattleGroundAB::ResetBGSubclass()
}
for (uint8 i = 0; i < BG_AB_ALL_NODES_COUNT; ++i)
- if(m_BgCreatures[i])
+ if (m_BgCreatures[i])
DelCreature(i);
}
-WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(float x, float y, float /*z*/, uint32 team)
+void BattleGroundAB::EndBattleGround(uint32 winner)
{
- uint8 teamIndex = GetTeamIndexByTeamId(team);
+ //win reward
+ if (winner == ALLIANCE)
+ RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
+ if (winner == HORDE)
+ RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
+ //complete map_end rewards (even if no team wins)
+ RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
+ RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
+
+ BattleGround::EndBattleGround(winner);
+}
+
+WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
+{
+ uint8 teamIndex = GetTeamIndexByTeamId(player->GetTeam());
// Is there any occupied node for this team?
std::vector<uint8> nodes;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
- if( m_Nodes[i] == teamIndex + 3 )
+ if (m_Nodes[i] == teamIndex + 3)
nodes.push_back(i);
WorldSafeLocsEntry const* good_entry = NULL;
// If so, select the closest node to place ghost on
- if( !nodes.empty() )
+ if (!nodes.empty())
{
+ float plr_x = player->GetPositionX();
+ float plr_y = player->GetPositionY();
+
float mindist = 999999.0f;
for (uint8 i = 0; i < nodes.size(); ++i)
{
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry( BG_AB_GraveyardIds[nodes[i]] );
- if( !entry )
+ if (!entry)
continue;
- float dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y);
- if( mindist > dist )
+ float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y);
+ if (mindist > dist)
{
mindist = dist;
good_entry = entry;
@@ -646,7 +651,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(float x, float y,
nodes.clear();
}
// If not, place ghost on starting location
- if( !good_entry )
+ if (!good_entry)
good_entry = sWorldSafeLocsStore.LookupEntry( BG_AB_GraveyardIds[teamIndex+5] );
return good_entry;
diff --git a/src/game/BattleGroundAB.h b/src/game/BattleGroundAB.h
index 3fcea59c8e8..abe81df5ef8 100644
--- a/src/game/BattleGroundAB.h
+++ b/src/game/BattleGroundAB.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -77,17 +77,17 @@ enum BG_AB_NodeObjectId
enum BG_AB_ObjectType
{
// for all 5 node points 8*5=40 objects
- BG_AB_OBJECT_BANNER_NEUTRAL = 0,
- BG_AB_OBJECT_BANNER_CONT_A = 1,
- BG_AB_OBJECT_BANNER_CONT_H = 2,
- BG_AB_OBJECT_BANNER_ALLY = 3,
- BG_AB_OBJECT_BANNER_HORDE = 4,
- BG_AB_OBJECT_AURA_ALLY = 5,
- BG_AB_OBJECT_AURA_HORDE = 6,
- BG_AB_OBJECT_AURA_CONTESTED = 7,
+ BG_AB_OBJECT_BANNER_NEUTRAL = 0,
+ BG_AB_OBJECT_BANNER_CONT_A = 1,
+ BG_AB_OBJECT_BANNER_CONT_H = 2,
+ BG_AB_OBJECT_BANNER_ALLY = 3,
+ BG_AB_OBJECT_BANNER_HORDE = 4,
+ BG_AB_OBJECT_AURA_ALLY = 5,
+ BG_AB_OBJECT_AURA_HORDE = 6,
+ BG_AB_OBJECT_AURA_CONTESTED = 7,
//gates
- BG_AB_OBJECT_GATE_A = 40,
- BG_AB_OBJECT_GATE_H = 41,
+ BG_AB_OBJECT_GATE_A = 40,
+ BG_AB_OBJECT_GATE_H = 41,
//buffs
BG_AB_OBJECT_SPEEDBUFF_STABLES = 42,
BG_AB_OBJECT_REGENBUFF_STABLES = 43,
@@ -130,8 +130,8 @@ enum BG_AB_Timers
enum BG_AB_Score
{
- BG_AB_MAX_TEAM_SCORE = 2000,
- BG_AB_WARNING_SCORE = 1800
+ BG_AB_WARNING_NEAR_VICTORY_SCORE = 1800,
+ BG_AB_MAX_TEAM_SCORE = 2000
};
/* do NOT change the order, else wrong behaviour */
@@ -164,14 +164,19 @@ enum BG_AB_NodeStatus
enum BG_AB_Sounds
{
- SOUND_NODE_CLAIMED = 8192,
- SOUND_NODE_CAPTURED_ALLIANCE = 8173,
- SOUND_NODE_CAPTURED_HORDE = 8213,
- SOUND_NODE_ASSAULTED_ALLIANCE = 8174,
- SOUND_NODE_ASSAULTED_HORDE = 8212,
- SOUND_NEAR_VICTORY = 8456
+ BG_AB_SOUND_NODE_CLAIMED = 8192,
+ BG_AB_SOUND_NODE_CAPTURED_ALLIANCE = 8173,
+ BG_AB_SOUND_NODE_CAPTURED_HORDE = 8213,
+ BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE = 8212,
+ BG_AB_SOUND_NODE_ASSAULTED_HORDE = 8174,
+ BG_AB_SOUND_NEAR_VICTORY = 8456
};
+#define BG_AB_NotABBGWeekendHonorTicks 330
+#define BG_AB_ABBGWeekendHonorTicks 200
+#define BG_AB_NotABBGWeekendReputationTicks 200
+#define BG_AB_ABBGWeekendReputationTicks 150
+
// x, y, z, o
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
{1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables
@@ -238,13 +243,16 @@ class BattleGroundAB : public BattleGround
BattleGroundAB();
~BattleGroundAB();
- void Update(time_t diff);
+ void Update(uint32 diff);
void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
virtual bool SetupBattleGround();
- virtual void ResetBGSubclass();
- virtual WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 team);
+ virtual void Reset();
+ void EndBattleGround(uint32 winner);
+ virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/* Scorekeeping */
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
@@ -265,7 +273,7 @@ class BattleGroundAB : public BattleGround
void _NodeOccupied(uint8 node,Team team);
void _NodeDeOccupied(uint8 node);
- const char* _GetNodeName(uint8 node);
+ int32 _GetNodeNameId(uint8 node);
/* Nodes info:
0: neutral
@@ -273,15 +281,19 @@ class BattleGroundAB : public BattleGround
2: horde contested
3: ally occupied
4: horde occupied */
- uint8 m_Nodes[BG_AB_DYNAMIC_NODES_COUNT];
- uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT];
- BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT];
- int32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT];
- uint32 m_TeamScores[2];
- uint32 m_lastTick[2];
- uint32 m_HonorScoreTics[2];
- uint32 m_ReputationScoreTics[2];
- bool m_IsInformedNearVictory;
+ uint8 m_Nodes[BG_AB_DYNAMIC_NODES_COUNT];
+ uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT];
+ BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT];
+ int32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT];
+ uint32 m_TeamScores[BG_TEAMS_COUNT];
+ uint32 m_lastTick[BG_TEAMS_COUNT];
+ uint32 m_HonorScoreTics[BG_TEAMS_COUNT];
+ uint32 m_ReputationScoreTics[BG_TEAMS_COUNT];
+ bool m_IsInformedNearVictory;
+ uint32 m_HonorTics;
+ uint32 m_ReputationTics;
+
+
};
#endif
diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp
index 6086d0be441..bc0b50d21f0 100644
--- a/src/game/BattleGroundAV.cpp
+++ b/src/game/BattleGroundAV.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,21 +21,23 @@
#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundAV.h"
-#include "Creature.h"
-#include "Chat.h"
-#include "Object.h"
-#include "ObjectMgr.h"
-#include "ObjectAccessor.h"
-#include "MapManager.h"
#include "Language.h"
#include "SpellAuras.h"
#include "Formulas.h"
+#include "WorldPacket.h"
+#include "ObjectMgr.h"
+#include "GameObject.h"
BattleGroundAV::BattleGroundAV()
{
-
m_BgObjects.resize(BG_AV_OBJECT_MAX);
m_BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
+
+ //TODO FIX ME!
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_EY_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_EY_HAS_BEGUN;
}
BattleGroundAV::~BattleGroundAV()
@@ -229,8 +231,6 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points )
uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
m_Team_Scores[teamindex] += points;
- m_score[teamindex] = m_Team_Scores[teamindex];
-
UpdateWorldState(((teamindex==BG_TEAM_HORDE)?AV_Horde_Score:AV_Alliance_Score), m_Team_Scores[teamindex]);
if( points < 0)
{
@@ -241,7 +241,7 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points )
}
else if(!m_IsInformedNearVictory[teamindex] && m_Team_Scores[teamindex] < SEND_MSG_NEAR_LOSE)
{
- SendMessageToAll(GetTrinityString((teamindex==BG_TEAM_HORDE)?LANG_BG_AV_H_NEAR_LOSE:LANG_BG_AV_A_NEAR_LOSE));
+ SendMessageToAll(teamindex==BG_TEAM_HORDE?LANG_BG_AV_H_NEAR_LOSE:LANG_BG_AV_A_NEAR_LOSE, teamindex==BG_TEAM_HORDE ? CHAT_MSG_BG_SYSTEM_HORDE : CHAT_MSG_BG_SYSTEM_ALLIANCE);
PlaySoundToAll(AV_SOUND_NEAR_VICTORY);
m_IsInformedNearVictory[teamindex] = true;
}
@@ -296,7 +296,7 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type )
return creature;
}
-void BattleGroundAV::Update(time_t diff)
+void BattleGroundAV::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
@@ -368,19 +368,19 @@ void BattleGroundAV::Update(time_t diff)
DoorClose(BG_AV_OBJECT_DOOR_A);
DoorClose(BG_AV_OBJECT_DOOR_H);
- SetStartDelayTime(START_DELAY0);
+ SetStartDelayTime(BG_START_DELAY_2M);
}
// After 1 minute, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
+ else if (GetStartDelayTime() <= BG_START_DELAY_1M && !(m_Events & 0x04))
{
m_Events |= 0x04;
- SendMessageToAll(GetTrinityString(LANG_BG_AV_ONEMINTOSTART));
+ SendMessageToAll(LANG_BG_AV_ONEMINTOSTART, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
// After 1,5 minute, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
+ else if (GetStartDelayTime() <= BG_START_DELAY_1M + BG_START_DELAY_30S && !(m_Events & 0x08))
{
m_Events |= 0x08;
- SendMessageToAll(GetTrinityString(LANG_BG_AV_HALFMINTOSTART));
+ SendMessageToAll(LANG_BG_AV_HALFMINTOSTART, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
// After 2 minutes, gates OPEN ! x)
else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
@@ -389,7 +389,7 @@ void BattleGroundAV::Update(time_t diff)
UpdateWorldState(AV_SHOW_A_SCORE, 1);
m_Events |= 0x10;
- SendMessageToAll(GetTrinityString(LANG_BG_AV_STARTED));
+ SendMessageToAll(LANG_BG_AV_STARTED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(SOUND_BG_START);
SetStatus(STATUS_IN_PROGRESS);
@@ -467,6 +467,14 @@ void BattleGroundAV::Update(time_t diff)
}
}
+void BattleGroundAV::StartingEventCloseDoors()
+{
+}
+
+void BattleGroundAV::StartingEventOpenDoors()
+{
+}
+
void BattleGroundAV::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -535,7 +543,7 @@ void BattleGroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 SpellId = 0;
@@ -568,7 +576,7 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
}
- if(SpellId)
+ if (SpellId)
Source->CastSpell(Source, SpellId, true);
}
diff --git a/src/game/BattleGroundAV.h b/src/game/BattleGroundAV.h
index 310635b995f..f9f4f46b0ae 100644
--- a/src/game/BattleGroundAV.h
+++ b/src/game/BattleGroundAV.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1500,10 +1500,12 @@ class BattleGroundAV : public BattleGround
public:
BattleGroundAV();
~BattleGroundAV();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGroundBE.cpp
index a010bb166ac..dd45b78d924 100644
--- a/src/game/BattleGroundBE.cpp
+++ b/src/game/BattleGroundBE.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,14 +22,23 @@
#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundBE.h"
-#include "Creature.h"
#include "ObjectMgr.h"
-#include "MapManager.h"
+#include "WorldPacket.h"
#include "Language.h"
BattleGroundBE::BattleGroundBE()
{
m_BgObjects.resize(BG_BE_OBJECT_MAX);
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
}
BattleGroundBE::~BattleGroundBE()
@@ -37,77 +46,34 @@ BattleGroundBE::~BattleGroundBE()
}
-void BattleGroundBE::Update(time_t diff)
+void BattleGroundBE::Update(uint32 diff)
{
BattleGround::Update(diff);
- // after bg start we get there
- if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
- {
- ModifyStartDelayTime(diff);
-
- if (!(m_Events & 0x01))
- {
- m_Events |= 0x01;
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
- for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; i++)
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
-
- for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
- SpawnBGObject(i, RESPAWN_ONE_DAY);
-
- SetStartDelayTime(START_DELAY1);
- SendMessageToAll(LANG_ARENA_ONE_MINUTE);
- }
- // After 30 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
- {
- m_Events |= 0x04;
- SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
- }
- // After 15 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
- {
- m_Events |= 0x08;
- SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
- }
- // delay expired (1 minute)
- else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
- {
- m_Events |= 0x10;
-
- for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; i++)
- DoorOpen(i);
-
- for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
- SpawnBGObject(i, 60);
-
- SendMessageToAll(LANG_ARENA_BEGUN);
- SetStatus(STATUS_IN_PROGRESS);
- SetStartDelayTime(0);
-
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player *plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
-
- if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
- }
- }
-
- /*if(GetStatus() == STATUS_IN_PROGRESS)
+ /*if (GetStatus() == STATUS_IN_PROGRESS)
{
// update something
}*/
}
+void BattleGroundBE::StartingEventCloseDoors()
+{
+ for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; i++)
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+
+ for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
+ SpawnBGObject(i, RESPAWN_ONE_DAY);
+}
+
+void BattleGroundBE::StartingEventOpenDoors()
+{
+ for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; i++)
+ DoorOpen(i);
+
+ for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; i++)
+ SpawnBGObject(i, 60);
+}
+
void BattleGroundBE::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -122,24 +88,21 @@ void BattleGroundBE::AddPlayer(Player *plr)
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
{
- if(GetStatus() == STATUS_WAIT_LEAVE)
+ if (GetStatus() == STATUS_WAIT_LEAVE)
return;
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetAlivePlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
+ CheckArenaWinConditions();
}
void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- if(!killer)
+ if (!killer)
{
sLog.outError("Killer player not found");
return;
@@ -150,16 +113,7 @@ void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE))
- {
- // all opponents killed
- EndBattleGround(HORDE);
- }
- else if(!GetAlivePlayersCountByTeam(HORDE))
- {
- // all opponents killed
- EndBattleGround(ALLIANCE);
- }
+ CheckArenaWinConditions();
}
bool BattleGroundBE::HandlePlayerUnderMap(Player *player)
@@ -171,7 +125,7 @@ bool BattleGroundBE::HandlePlayerUnderMap(Player *player)
void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
@@ -190,7 +144,7 @@ void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
}
- //if(buff_guid)
+ //if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
}
@@ -201,15 +155,16 @@ void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
data << uint32(0x9f3) << uint32(1); // 9
}
-void BattleGroundBE::ResetBGSubclass()
+void BattleGroundBE::Reset()
{
-
+ //call parent's class reset
+ BattleGround::Reset();
}
bool BattleGroundBE::SetupBattleGround()
{
// gates
- if( !AddObject(BG_BE_OBJECT_DOOR_1, BG_BE_OBJECT_TYPE_DOOR_1, 6287.277f, 282.1877f, 3.810925f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
+ if (!AddObject(BG_BE_OBJECT_DOOR_1, BG_BE_OBJECT_TYPE_DOOR_1, 6287.277f, 282.1877f, 3.810925f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_BE_OBJECT_DOOR_2, BG_BE_OBJECT_TYPE_DOOR_2, 6189.546f, 241.7099f, 3.101481f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_BE_OBJECT_DOOR_3, BG_BE_OBJECT_TYPE_DOOR_3, 6299.116f, 296.5494f, 3.308032f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_BE_OBJECT_DOOR_4, BG_BE_OBJECT_TYPE_DOOR_4, 6177.708f, 227.3481f, 3.604374f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
diff --git a/src/game/BattleGroundBE.h b/src/game/BattleGroundBE.h
index 00f826f8207..e75e332f44f 100644
--- a/src/game/BattleGroundBE.h
+++ b/src/game/BattleGroundBE.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -57,15 +57,17 @@ class BattleGroundBE : public BattleGround
public:
BattleGroundBE();
~BattleGroundBE();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
- void ResetBGSubclass();
+ virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
void HandleKillPlayer(Player* player, Player *killer);
bool HandlePlayerUnderMap(Player * plr);
diff --git a/src/game/BattleGroundDS.cpp b/src/game/BattleGroundDS.cpp
new file mode 100644
index 00000000000..78360b9b194
--- /dev/null
+++ b/src/game/BattleGroundDS.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Player.h"
+#include "BattleGround.h"
+#include "BattleGroundDS.h"
+#include "Language.h"
+
+BattleGroundDS::BattleGroundDS()
+{
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
+}
+
+BattleGroundDS::~BattleGroundDS()
+{
+
+}
+
+void BattleGroundDS::Update(uint32 diff)
+{
+ BattleGround::Update(diff);
+}
+
+void BattleGroundDS::StartingEventCloseDoors()
+{
+}
+
+void BattleGroundDS::StartingEventOpenDoors()
+{
+}
+
+void BattleGroundDS::AddPlayer(Player *plr)
+{
+ BattleGround::AddPlayer(plr);
+ //create score and add it to map, default values are set in constructor
+ BattleGroundDSScore* sc = new BattleGroundDSScore;
+
+ m_PlayerScores[plr->GetGUID()] = sc;
+}
+
+void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
+{
+}
+
+void BattleGroundDS::HandleKillPlayer(Player* player, Player* killer)
+{
+ BattleGround::HandleKillPlayer(player, killer);
+}
+
+void BattleGroundDS::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
+{
+}
+
+bool BattleGroundDS::SetupBattleGround()
+{
+ return true;
+}
diff --git a/src/game/BattleGroundDS.h b/src/game/BattleGroundDS.h
new file mode 100644
index 00000000000..44a6cfbd33a
--- /dev/null
+++ b/src/game/BattleGroundDS.h
@@ -0,0 +1,50 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __BATTLEGROUNDDS_H
+#define __BATTLEGROUNDDS_H
+
+class BattleGround;
+
+class BattleGroundDSScore : public BattleGroundScore
+{
+ public:
+ BattleGroundDSScore() {};
+ virtual ~BattleGroundDSScore() {};
+ //TODO fix me
+};
+
+class BattleGroundDS : public BattleGround
+{
+ friend class BattleGroundMgr;
+
+ public:
+ BattleGroundDS();
+ ~BattleGroundDS();
+ void Update(uint32 diff);
+
+ /* inherited from BattlegroundClass */
+ virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
+
+ void RemovePlayer(Player *plr, uint64 guid);
+ void HandleAreaTrigger(Player *Source, uint32 Trigger);
+ bool SetupBattleGround();
+ void HandleKillPlayer(Player* player, Player *killer);
+};
+#endif
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp
index ecf454d1cfe..04ab25c30cc 100644
--- a/src/game/BattleGroundEY.cpp
+++ b/src/game/BattleGroundEY.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,11 +23,10 @@
#include "BattleGround.h"
#include "BattleGroundEY.h"
#include "Creature.h"
-#include "Chat.h"
#include "ObjectMgr.h"
-#include "MapManager.h"
#include "Language.h"
-#include "World.h"
+#include "World.h" //music
+#include "WorldPacket.h"
#include "Util.h"
// these variables aren't used outside of this file, so declare them only here
@@ -45,85 +44,25 @@ BattleGroundEY::BattleGroundEY()
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
+
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_EY_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_EY_HAS_BEGUN;
}
BattleGroundEY::~BattleGroundEY()
{
}
-void BattleGroundEY::Update(time_t diff)
+void BattleGroundEY::Update(uint32 diff)
{
BattleGround::Update(diff);
- // after bg start we get there (once)
- if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
- {
- ModifyStartDelayTime(diff);
-
- if(!(m_Events & 0x01))
- {
- m_Events |= 0x01;
-
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
-
- SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
- SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
-
-// SpawnBGCreature(EY_SPIRIT_MAIN_ALLIANCE, RESPAWN_IMMEDIATELY);
-// SpawnBGCreature(EY_SPIRIT_MAIN_HORDE, RESPAWN_IMMEDIATELY);
- for(uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
- SpawnBGObject(i, RESPAWN_ONE_DAY);
-
- SetStartDelayTime(START_DELAY0);
- }
- // After 1 minute, warning is signalled
- else if(GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
- {
- m_Events |= 0x04;
- SendMessageToAll(GetTrinityString(LANG_BG_EY_ONE_MINUTE));
- }
- // After 1,5 minute, warning is signalled
- else if(GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
- {
- m_Events |= 0x08;
- SendMessageToAll(GetTrinityString(LANG_BG_EY_HALF_MINUTE));
- }
- // After 2 minutes, gates OPEN ! x)
- else if(GetStartDelayTime() < 0 && !(m_Events & 0x10))
- {
- m_Events |= 0x10;
- SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
- SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
-
- for(uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
- for(uint32 i = 0; i < EY_POINTS_MAX; ++i)
- {
- //randomly spawn buff
- uint8 buff = urand(0, 2);
- SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3, RESPAWN_IMMEDIATELY);
- }
-
- SendMessageToAll(GetTrinityString(LANG_BG_EY_BEGIN));
-
- PlaySoundToAll(SOUND_BG_START);
- if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
- PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC
- SetStatus(STATUS_IN_PROGRESS);
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player *plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
- }
- }
- else if(GetStatus() == STATUS_IN_PROGRESS)
+ if (GetStatus() == STATUS_IN_PROGRESS)
{
m_PointAddingTimer -= diff;
- if(m_PointAddingTimer <= 0)
+ if (m_PointAddingTimer <= 0)
{
m_PointAddingTimer = BG_EY_FPOINTS_TICK_TIME;
if (m_TeamPointsCount[BG_TEAM_ALLIANCE] > 0)
@@ -132,11 +71,11 @@ void BattleGroundEY::Update(time_t diff)
AddPoints(HORDE, BG_EY_TickPoints[m_TeamPointsCount[BG_TEAM_HORDE] - 1]);
}
- if(m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN || m_FlagState == BG_EY_FLAG_STATE_ON_GROUND)
+ if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN || m_FlagState == BG_EY_FLAG_STATE_ON_GROUND)
{
m_FlagsTimer -= diff;
- if(m_FlagsTimer < 0)
+ if (m_FlagsTimer < 0)
{
m_FlagsTimer = 0;
if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN)
@@ -147,7 +86,7 @@ void BattleGroundEY::Update(time_t diff)
}
m_TowerCapCheckTimer -= diff;
- if(m_TowerCapCheckTimer <= 0)
+ if (m_TowerCapCheckTimer <= 0)
{
//check if player joined point
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
@@ -162,16 +101,39 @@ void BattleGroundEY::Update(time_t diff)
}
}
+void BattleGroundEY::StartingEventCloseDoors()
+{
+ SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
+ SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
+
+ for(uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
+ SpawnBGObject(i, RESPAWN_ONE_DAY);
+}
+
+void BattleGroundEY::StartingEventOpenDoors()
+{
+ SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
+ SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
+
+ for(uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+ for(uint32 i = 0; i < EY_POINTS_MAX; ++i)
+ {
+ //randomly spawn buff
+ uint8 buff = urand(0, 2);
+ SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3, RESPAWN_IMMEDIATELY);
+ }
+}
+
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
{
uint8 team_index = GetTeamIndexByTeamId(Team);
m_TeamScores[team_index] += Points;
- m_score[team_index] = m_TeamScores[team_index];
m_HonorScoreTics[team_index] += Points;
- if (m_HonorScoreTics[team_index] >= BG_EY_HonorScoreTicks[m_HonorMode])
+ if (m_HonorScoreTics[team_index] >= m_HonorTics )
{
- RewardHonorToTeam(20, Team);
- m_HonorScoreTics[team_index] -= BG_EY_HonorScoreTicks[m_HonorMode];
+ RewardHonorToTeam(GetBonusHonorFromKill(1), Team);
+ m_HonorScoreTics[team_index] -= m_HonorTics;
}
UpdateTeamScore(Team);
}
@@ -188,13 +150,13 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
while (j < m_PlayersNearPoint[EY_POINTS_MAX].size())
{
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGroundEY: Player " I64FMTD " not found!", m_PlayersNearPoint[EY_POINTS_MAX][j]);
++j;
continue;
}
- if (plr->isAllowUseBattleGroundObject() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
+ if (plr->CanCaptureTowerPoint() && plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
{
//player joined point!
//show progress bar
@@ -222,7 +184,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
obj = HashMapHolder<GameObject>::Find(m_BgObjects[BG_EY_OBJECT_TOWER_CAP_FEL_REALVER + i]);
- if(obj)
+ if (obj)
{
uint8 j = 0;
while (j < m_PlayersNearPoint[i].size())
@@ -237,7 +199,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
++j;
continue;
}
- if (!plr->isAllowUseBattleGroundObject() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
+ if (!plr->CanCaptureTowerPoint() || !plr->IsWithinDistInMap(obj, BG_EY_POINT_RADIUS))
//move player out of point (add him to players that are out of points
{
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
@@ -305,21 +267,46 @@ void BattleGroundEY::UpdatePointStatuses()
void BattleGroundEY::UpdateTeamScore(uint32 Team)
{
uint32 score = GetTeamScore(Team);
- if(score >= EY_MAX_TEAM_SCORE)
+ //TODO there should be some sound played when one team is near victory!! - and define variables
+ /*if (!m_IsInformedNearVictory && score >= BG_EY_WARNING_NEAR_VICTORY_SCORE)
+ {
+ if (Team == ALLIANCE)
+ SendMessageToAll(LANG_BG_EY_A_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ else
+ SendMessageToAll(LANG_BG_EY_H_NEAR_VICTORY, CHAT_MSG_BG_SYSTEM_NEUTRAL);
+ PlaySoundToAll(BG_EY_SOUND_NEAR_VICTORY);
+ m_IsInformedNearVictory = true;
+ }*/
+
+ if (score >= BG_EY_MAX_TEAM_SCORE)
{
- score = EY_MAX_TEAM_SCORE;
+ score = BG_EY_MAX_TEAM_SCORE;
EndBattleGround(Team);
}
- if(Team == ALLIANCE)
+ if (Team == ALLIANCE)
UpdateWorldState(EY_ALLIANCE_RESOURCES, score);
else
UpdateWorldState(EY_HORDE_RESOURCES, score);
}
+void BattleGroundEY::EndBattleGround(uint32 winner)
+{
+ //win reward
+ if (winner == ALLIANCE)
+ RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
+ if (winner == HORDE)
+ RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
+ //complete map reward
+ RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
+ RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
+
+ BattleGround::EndBattleGround(winner);
+}
+
void BattleGroundEY::UpdatePointsCount(uint32 Team)
{
- if(Team == ALLIANCE)
+ if (Team == ALLIANCE)
UpdateWorldState(EY_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
else
UpdateWorldState(EY_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
@@ -331,14 +318,14 @@ void BattleGroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
if (m_PointState[Point] == EY_POINT_UNDER_CONTROL)
{
UpdateWorldState(m_PointsIconStruct[Point].WorldStateControlIndex, 0);
- if(Team == ALLIANCE)
+ if (Team == ALLIANCE)
UpdateWorldState(m_PointsIconStruct[Point].WorldStateAllianceControlledIndex, 1);
else
UpdateWorldState(m_PointsIconStruct[Point].WorldStateHordeControlledIndex, 1);
}
else
{
- if(Team == ALLIANCE)
+ if (Team == ALLIANCE)
UpdateWorldState(m_PointsIconStruct[Point].WorldStateAllianceControlledIndex, 0);
else
UpdateWorldState(m_PointsIconStruct[Point].WorldStateHordeControlledIndex, 0);
@@ -363,15 +350,15 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
for (int j = EY_POINTS_MAX; j >= 0; --j)
{
for(int i = 0; i < m_PlayersNearPoint[j].size(); ++i)
- if(m_PlayersNearPoint[j][i] == guid)
+ if (m_PlayersNearPoint[j][i] == guid)
m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
}
- if(IsFlagPickedup())
+ if (IsFlagPickedup())
{
- if(m_FlagKeeper == guid)
+ if (m_FlagKeeper == guid)
{
- if(plr)
- this->EventPlayerDroppedFlag(plr);
+ if (plr)
+ EventPlayerDroppedFlag(plr);
else
{
SetFlagPicker(0);
@@ -383,7 +370,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
if(!Source->isAlive()) //hack code, must be removed later
@@ -392,23 +379,23 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
switch(Trigger)
{
case TR_BLOOD_ELF_POINT:
- if(m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
- if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
+ if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
break;
case TR_FEL_REALVER_POINT:
- if(m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
- if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
+ if (m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REALVER);
break;
case TR_MAGE_TOWER_POINT:
- if(m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
- if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
+ if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
- if(m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
- if(m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
+ if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
+ if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
break;
case 4512:
@@ -432,7 +419,7 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
bool BattleGroundEY::SetupBattleGround()
{
// doors
- if( !AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY)
+ if (!AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_EY_OBJECT_DOOR_H, BG_OBJECT_H_DOOR_EY_ENTRY, 1803.21f, 1539.49f, 1261.09f, 3.14159f, 0.173648f, 0, 0.984808f, 0, RESPAWN_IMMEDIATELY)
// banners (alliance)
|| !AddObject(BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2057.46f, 1735.07f, 1187.91f, -0.925024f, 0, 0, 0.446198f, -0.894934f, RESPAWN_ONE_DAY)
@@ -494,12 +481,12 @@ bool BattleGroundEY::SetupBattleGround()
for (int i = 0; i < EY_POINTS_MAX; ++i)
{
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
- if( !at )
+ if (!at)
{
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
continue;
}
- if ( !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
+ if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + 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_REALVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
@@ -508,14 +495,14 @@ bool BattleGroundEY::SetupBattleGround()
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, ALLIANCE) )
+ if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround 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, HORDE) )
+ if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround not created!");
return false;
@@ -524,8 +511,11 @@ bool BattleGroundEY::SetupBattleGround()
return true;
}
-void BattleGroundEY::ResetBGSubclass()
+void BattleGroundEY::Reset()
{
+ //call parent's class reset
+ BattleGround::Reset();
+
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
m_TeamScores[BG_TEAM_HORDE] = 0;
m_TeamPointsCount[BG_TEAM_ALLIANCE] = 0;
@@ -538,6 +528,8 @@ void BattleGroundEY::ResetBGSubclass()
m_DroppedFlagGUID = 0;
m_PointAddingTimer = 0;
m_TowerCapCheckTimer = 0;
+ bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ m_HonorTics = (isBGWeekend) ? BG_EY_EYWeekendHonorTicks : BG_EY_NotEYWeekendHonorTicks;
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
@@ -560,9 +552,9 @@ void BattleGroundEY::RespawnFlag(bool send_message)
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
SpawnBGObject(BG_EY_OBJECT_FLAG_NETHERSTORM, RESPAWN_IMMEDIATELY);
- if(send_message)
+ if (send_message)
{
- SendMessageToAll(GetTrinityString(LANG_BG_EY_RESETED_FLAG));
+ SendMessageToAll(LANG_BG_EY_RESETED_FLAG, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_EY_SOUND_FLAG_RESET); // flags respawned sound...
}
@@ -574,7 +566,7 @@ void BattleGroundEY::RespawnFlagAfterDrop()
RespawnFlag(true);
GameObject *obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID());
- if(obj)
+ if (obj)
obj->Delete();
else
sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
@@ -584,7 +576,7 @@ void BattleGroundEY::RespawnFlagAfterDrop()
void BattleGroundEY::HandleKillPlayer(Player *player, Player *killer)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
BattleGround::HandleKillPlayer(player, killer);
@@ -593,11 +585,11 @@ void BattleGroundEY::HandleKillPlayer(Player *player, Player *killer)
void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
{
// if not running, do not cast things at the dropper player, neither send unnecessary messages
// just take off the aura
- if(IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
+ if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
{
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
@@ -605,59 +597,41 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
return;
}
- if(!IsFlagPickedup())
+ if (!IsFlagPickedup())
return;
- if(GetFlagPickerGUID() != Source->GetGUID())
+ if (GetFlagPickerGUID() != Source->GetGUID())
return;
- const char *message = "";
- uint8 type = 0;
-
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
- if(Source->GetTeam() == ALLIANCE)
- {
- message = GetTrinityString(LANG_BG_EY_DROPPED_FLAG);
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
- }
- else
- {
- message = GetTrinityString(LANG_BG_EY_DROPPED_FLAG);
- type = CHAT_MSG_BG_SYSTEM_HORDE;
- }
//this does not work correctly :( (it should remove flag carrier name)
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ if (Source->GetTeam() == ALLIANCE)
+ SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL);
+ else
+ SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
}
void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
- if(GetStatus() != STATUS_IN_PROGRESS || this->IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
+ if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
return;
- const char *message;
- uint8 type = 0;
- message = GetTrinityString(LANG_BG_EY_HAS_TAKEN_FLAG);
-
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_ON_PLAYER);
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE);
}
else
{
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_ON_PLAYER);
- type = CHAT_MSG_BG_SYSTEM_HORDE;
PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_HORDE);
}
@@ -671,29 +645,26 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ if (Source->GetTeam() == ALLIANCE)
+ PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, Source->GetName());
+ else
+ PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
}
void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
//Natural point
- uint8 message_type = 0;
- const char *message = "";
uint32 Team = m_PointOwnedByTeam[Point];
- if(!Team)
+ if (!Team)
return;
if (Team == ALLIANCE)
{
m_TeamPointsCount[BG_TEAM_ALLIANCE]--;
- message_type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
- message = GetTrinityString(m_LoosingPointTypes[Point].MessageIdAlliance);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeAlliance, RESPAWN_ONE_DAY);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeAlliance + 1, RESPAWN_ONE_DAY);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeAlliance + 2, RESPAWN_ONE_DAY);
@@ -701,8 +672,6 @@ void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
else
{
m_TeamPointsCount[BG_TEAM_HORDE]--;
- message_type = CHAT_MSG_BG_SYSTEM_HORDE;
- message = GetTrinityString(m_LoosingPointTypes[Point].MessageIdHorde);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeHorde, RESPAWN_ONE_DAY);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeHorde + 1, RESPAWN_ONE_DAY);
SpawnBGObject(m_LoosingPointTypes[Point].DespawnObjectTypeHorde + 2, RESPAWN_ONE_DAY);
@@ -717,9 +686,10 @@ void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
m_PointOwnedByTeam[Point] = EY_POINT_NO_OWNER;
m_PointState[Point] = EY_POINT_NO_OWNER;
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), message_type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ if (Team == ALLIANCE)
+ SendMessageToAll(m_LoosingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
+ else
+ SendMessageToAll(m_LoosingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
UpdatePointsIcons(Team, Point);
UpdatePointsCount(Team);
@@ -727,11 +697,9 @@ void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- uint8 type = 0;
- const char *message = "";
uint32 Team = Source->GetTeam();
SpawnBGObject(m_CapturingPointTypes[Point].DespawnNeutralObjectType, RESPAWN_ONE_DAY);
@@ -741,8 +709,6 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
if (Team == ALLIANCE)
{
m_TeamPointsCount[BG_TEAM_ALLIANCE]++;
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
- message = GetTrinityString(m_CapturingPointTypes[Point].MessageIdAlliance);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeAlliance, RESPAWN_IMMEDIATELY);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeAlliance + 1, RESPAWN_IMMEDIATELY);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeAlliance + 2, RESPAWN_IMMEDIATELY);
@@ -750,8 +716,6 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
else
{
m_TeamPointsCount[BG_TEAM_HORDE]++;
- type = CHAT_MSG_BG_SYSTEM_HORDE;
- message = GetTrinityString(m_CapturingPointTypes[Point].MessageIdHorde);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeHorde, RESPAWN_IMMEDIATELY);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeHorde + 1, RESPAWN_IMMEDIATELY);
SpawnBGObject(m_CapturingPointTypes[Point].SpawnObjectTypeHorde + 2, RESPAWN_IMMEDIATELY);
@@ -762,16 +726,17 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
m_PointOwnedByTeam[Point] = Team;
m_PointState[Point] = EY_POINT_UNDER_CONTROL;
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ if (Team == ALLIANCE)
+ SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
+ else
+ SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
- if(m_BgCreatures[Point])
+ if (m_BgCreatures[Point])
DelCreature(Point);
WorldSafeLocsEntry const *sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
- if(!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
+ if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
@@ -783,43 +748,38 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
{
- if(GetStatus() != STATUS_IN_PROGRESS || this->GetFlagPickerGUID() != Source->GetGUID())
+ if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
return;
- uint8 type = 0;
- uint8 team_id = 0;
- const char *message = "";
-
SetFlagPicker(0);
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- if(Source->GetTeam() == ALLIANCE)
- {
+
+ if (Source->GetTeam() == ALLIANCE)
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
- team_id = BG_TEAM_ALLIANCE;
- message = GetTrinityString(LANG_BG_EY_CAPTURED_FLAG_A);
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
- }
else
- {
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
- team_id = BG_TEAM_HORDE;
- message = GetTrinityString(LANG_BG_EY_CAPTURED_FLAG_H);
- type = CHAT_MSG_BG_SYSTEM_HORDE;
- }
SpawnBGObject(BgObjectType, RESPAWN_IMMEDIATELY);
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
m_FlagCapturedBgObjectType = BgObjectType;
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ uint8 team_id = 0;
+ if (Source->GetTeam() == ALLIANCE)
+ {
+ team_id = BG_TEAM_ALLIANCE;
+ SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_A, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
+ }
+ else
+ {
+ team_id = BG_TEAM_HORDE;
+ SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_H, CHAT_MSG_BG_SYSTEM_HORDE, Source);
+ }
- if(m_TeamPointsCount[team_id] > 0)
+ if (m_TeamPointsCount[team_id] > 0)
AddPoints(Source->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]);
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1);
@@ -893,16 +853,16 @@ void BattleGroundEY::FillInitialWorldStates(WorldPacket& data)
data << uint32(0xc0d) << uint32(0x17b);
}
-WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(float x, float y, float z, uint32 team)
+WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
{
uint32 g_id = 0;
- if(team == ALLIANCE)
- g_id = EY_GRAVEYARD_MAIN_ALLIANCE;
- else if(team == HORDE)
- g_id = EY_GRAVEYARD_MAIN_HORDE;
- else
- return NULL;
+ switch(player->GetTeam())
+ {
+ case ALLIANCE: g_id = EY_GRAVEYARD_MAIN_ALLIANCE; break;
+ case HORDE: g_id = EY_GRAVEYARD_MAIN_HORDE; break;
+ default: return NULL;
+ }
float distance, nearestDistance;
@@ -911,26 +871,31 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(float x, float y,
entry = sWorldSafeLocsStore.LookupEntry(g_id);
nearestEntry = entry;
- if(!entry)
+ if (!entry)
{
sLog.outError("BattleGroundEY: Not found the main team graveyard. Graveyard system isn't working!");
return NULL;
}
- distance = (entry->x - x)*(entry->x - x) + (entry->y - y)*(entry->y - y) + (entry->z - z)*(entry->z - z);
+ float plr_x = player->GetPositionX();
+ float plr_y = player->GetPositionY();
+ float plr_z = player->GetPositionZ();
+
+
+ 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);
nearestDistance = distance;
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
- if(m_PointOwnedByTeam[i]==team && m_PointState[i]==EY_POINT_UNDER_CONTROL)
+ if (m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
{
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
- if(!entry)
+ if (!entry)
sLog.outError("BattleGroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
else
{
- distance = (entry->x - x)*(entry->x - x) + (entry->y - y)*(entry->y - y) + (entry->z - z)*(entry->z - z);
- if(distance < nearestDistance)
+ 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);
+ if (distance < nearestDistance)
{
nearestDistance = distance;
nearestEntry = entry;
diff --git a/src/game/BattleGroundEY.h b/src/game/BattleGroundEY.h
index 30ff2b3e584..c4ffb57fba3 100644
--- a/src/game/BattleGroundEY.h
+++ b/src/game/BattleGroundEY.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,9 +25,8 @@
class BattleGround;
-#define EY_MAX_TEAM_SCORE 2000
-#define BG_EY_FLAG_RESPAWN_TIME 10000 //10 seconds
-#define BG_EY_FPOINTS_TICK_TIME 2000 //2 seconds
+#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILISECONDS) //10 seconds
+#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILISECONDS) //2 seconds
enum BG_EY_WorldStates
{
@@ -73,11 +72,11 @@ enum BG_EY_ProgressBarConsts
enum BG_EY_Sounds
{
//strange ids, but sure about them
- BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212,
- BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213,
- BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174,
- BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE = 8173,
- BG_EY_SOUND_FLAG_RESET = 8192
+ BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212,
+ BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213,
+ BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174,
+ BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE = 8173,
+ BG_EY_SOUND_FLAG_RESET = 8192
};
enum BG_EY_Spells
@@ -88,18 +87,18 @@ enum BG_EY_Spells
enum EYBattleGroundObjectEntry
{
- BG_OBJECT_A_DOOR_EY_ENTRY = 184719, //Alliance door
- BG_OBJECT_H_DOOR_EY_ENTRY = 184720, //Horde door
- BG_OBJECT_FLAG1_EY_ENTRY = 184493, //Netherstorm flag (generic)
- BG_OBJECT_FLAG2_EY_ENTRY = 184141, //Netherstorm flag (flagstand)
- BG_OBJECT_FLAG3_EY_ENTRY = 184142, //Netherstorm flag (flagdrop)
- BG_OBJECT_A_BANNER_EY_ENTRY = 184381, //Visual Banner (Alliance)
- BG_OBJECT_H_BANNER_EY_ENTRY = 184380, //Visual Banner (Horde)
- BG_OBJECT_N_BANNER_EY_ENTRY = 184382, //Visual Banner (Neutral)
- BG_OBJECT_BE_TOWER_CAP_EY_ENTRY = 184080, //BE Tower Cap Pt
- BG_OBJECT_FR_TOWER_CAP_EY_ENTRY = 184081, //Fel Reaver Cap Pt
- BG_OBJECT_HU_TOWER_CAP_EY_ENTRY = 184082, //Human Tower Cap Pt
- BG_OBJECT_DR_TOWER_CAP_EY_ENTRY = 184083 //Draenei Tower Cap Pt
+ BG_OBJECT_A_DOOR_EY_ENTRY = 184719, //Alliance door
+ BG_OBJECT_H_DOOR_EY_ENTRY = 184720, //Horde door
+ BG_OBJECT_FLAG1_EY_ENTRY = 184493, //Netherstorm flag (generic)
+ BG_OBJECT_FLAG2_EY_ENTRY = 184141, //Netherstorm flag (flagstand)
+ BG_OBJECT_FLAG3_EY_ENTRY = 184142, //Netherstorm flag (flagdrop)
+ BG_OBJECT_A_BANNER_EY_ENTRY = 184381, //Visual Banner (Alliance)
+ BG_OBJECT_H_BANNER_EY_ENTRY = 184380, //Visual Banner (Horde)
+ BG_OBJECT_N_BANNER_EY_ENTRY = 184382, //Visual Banner (Neutral)
+ BG_OBJECT_BE_TOWER_CAP_EY_ENTRY = 184080, //BE Tower Cap Pt
+ BG_OBJECT_FR_TOWER_CAP_EY_ENTRY = 184081, //Fel Reaver Cap Pt
+ BG_OBJECT_HU_TOWER_CAP_EY_ENTRY = 184082, //Human Tower Cap Pt
+ BG_OBJECT_DR_TOWER_CAP_EY_ENTRY = 184083 //Draenei Tower Cap Pt
};
enum EYBattleGroundPointsTrigger
@@ -131,7 +130,7 @@ enum EYBattleGroundPoints
DRAENEI_RUINS = 2,
MAGE_TOWER = 3,
- EY_PLAYERS_OUT_OF_POINTS = 4,
+ EY_PLAYERS_OUT_OF_POINTS = 4,
EY_POINTS_MAX = 4
};
@@ -212,6 +211,15 @@ enum EYBattleGroundObjectTypes
BG_EY_OBJECT_MAX = 59
};
+#define BG_EY_NotEYWeekendHonorTicks 330
+#define BG_EY_EYWeekendHonorTicks 200
+
+enum BG_EY_Score
+{
+ BG_EY_WARNING_NEAR_VICTORY_SCORE = 1800,
+ BG_EY_MAX_TEAM_SCORE = 2000
+};
+
enum BG_EY_FlagState
{
BG_EY_FLAG_STATE_ON_BASE = 0,
@@ -300,10 +308,12 @@ class BattleGroundEY : public BattleGround
public:
BattleGroundEY();
~BattleGroundEY();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }
@@ -317,10 +327,11 @@ class BattleGroundEY : public BattleGround
void HandleBuffUse(uint64 const& buff_guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleKillPlayer(Player *player, Player *killer);
- virtual WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 team);
+ virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
virtual bool SetupBattleGround();
- virtual void ResetBGSubclass();
+ virtual void Reset();
void UpdateTeamScore(uint32 Team);
+ void EndBattleGround(uint32 winner);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
virtual void FillInitialWorldStates(WorldPacket& data);
void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;}
@@ -370,6 +381,7 @@ class BattleGroundEY : public BattleGround
uint8 m_CurrentPointPlayersCount[2*EY_POINTS_MAX];
int32 m_PointAddingTimer;
+ uint32 m_HonorTics;
};
#endif
diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp
index b1522c939f7..6e94a8c8a9f 100644
--- a/src/game/BattleGroundHandler.cpp
+++ b/src/game/BattleGroundHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
#include "Player.h"
#include "ObjectMgr.h"
#include "WorldSession.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Object.h"
#include "Chat.h"
@@ -44,7 +43,7 @@ void WorldSession::HandleBattleGroundHelloOpcode( WorldPacket & recv_data )
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from: " I64FMT, guid);
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
- if(!unit)
+ if (!unit)
return;
if(!unit->isBattleMaster()) // it's not battlemaster
@@ -53,9 +52,9 @@ void WorldSession::HandleBattleGroundHelloOpcode( WorldPacket & recv_data )
// Stop the npc if moving
unit->StopMoving();
- uint32 bgTypeId = objmgr.GetBattleMasterBG(unit->GetEntry());
+ BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(unit->GetEntry());
- if(!_player->GetBGAccessByLevel(bgTypeId))
+ if (!_player->GetBGAccessByLevel(bgTypeId))
{
// temp, must be gossip message...
SendNotification(LANG_YOUR_BG_LEVEL_REQ_ERROR);
@@ -65,7 +64,7 @@ void WorldSession::HandleBattleGroundHelloOpcode( WorldPacket & recv_data )
SendBattlegGroundList(guid, bgTypeId);
}
-void WorldSession::SendBattlegGroundList( uint64 guid, uint32 bgTypeId )
+void WorldSession::SendBattlegGroundList( uint64 guid, BattleGroundTypeId bgTypeId )
{
WorldPacket data;
sBattleGroundMgr.BuildBattleGroundListPacket(&data, guid, _player, bgTypeId);
@@ -77,57 +76,60 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
CHECK_PACKET_SIZE(recv_data, 8+4+4+1);
uint64 guid;
- uint32 bgTypeId;
+ uint32 bgTypeId_;
uint32 instanceId;
uint8 joinAsGroup;
+ bool isPremade = false;
Group * grp;
recv_data >> guid; // battlemaster guid
- recv_data >> bgTypeId; // battleground type id (DBC id)
+ recv_data >> bgTypeId_; // battleground type id (DBC id)
recv_data >> instanceId; // instance id, 0 if First Available selected
recv_data >> joinAsGroup; // join as group
- if(bgTypeId >= MAX_BATTLEGROUND_TYPES)
+ if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{
- sLog.outError("Battleground: invalid bgtype received. possible cheater? player guid %u",_player->GetGUIDLow());
+ sLog.outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u",bgTypeId_,_player->GetGUIDLow());
return;
}
+ BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
+
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from: " I64FMT, guid);
// can do this, since it's battleground, not arena
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bgTypeId, 0);
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, 0);
// ignore if player is already in BG
- if(_player->InBattleGround())
+ if (_player->InBattleGround())
return;
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
- if(!unit)
+ if (!unit)
return;
if(!unit->isBattleMaster()) // it's not battlemaster
return;
// get bg instance or bg template if instance not found
- BattleGround * bg = 0;
- if(instanceId)
- BattleGround *bg = sBattleGroundMgr.GetBattleGround(instanceId);
+ BattleGround * bg = NULL;
+ if (instanceId)
+ BattleGround *bg = sBattleGroundMgr.GetBattleGroundThroughClientInstance(instanceId, bgTypeId, _player->GetBattleGroundQueueIdFromLevel(bgTypeId));
- if(!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
+ if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
{
sLog.outError("Battleground: no available bg / template found");
return;
}
// check queueing conditions
- if(!joinAsGroup)
+ if (!joinAsGroup)
{
// check Deserter debuff
- if( !_player->CanJoinToBattleground() )
+ if (!_player->CanJoinToBattleground())
{
WorldPacket data(SMSG_GROUP_JOINED_BATTLEGROUND, 4);
- data << (uint32) 0xFFFFFFFE;
+ data << uint32(0xFFFFFFFE);
_player->GetSession()->SendPacket(&data);
return;
}
@@ -136,16 +138,17 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
//player is already in this queue
return;
// check if has free queue slots
- if(!_player->HasFreeBattleGroundQueueId())
+ if (!_player->HasFreeBattleGroundQueueId())
return;
}
else
{
grp = _player->GetGroup();
// no group found, error
- if(!grp)
+ if (!grp)
return;
uint32 err = grp->CanJoinBattleGroundQueue(bgTypeId, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0);
+ isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam());
if (err != BG_JOIN_ERR_OK)
{
SendBattleGroundOrArenaJoinError(err);
@@ -155,10 +158,11 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
// if we're here, then the conditions to join a bg are met. We can proceed in joining.
// _player->GetGroup() was already checked, grp is already initialized
- if(joinAsGroup /* && _player->GetGroup()*/)
+ GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, isPremade, 0);
+ uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel(bgTypeId));
+ if (joinAsGroup /* && _player->GetGroup()*/)
{
sLog.outDebug("Battleground: the following players are joining as group:");
- GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, 0);
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *member = itr->getSource();
@@ -171,7 +175,7 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
WorldPacket data;
// send status packet (in queue)
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, member->GetTeam(), queueSlot, STATUS_WAIT_QUEUE, 0, 0);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, bgTypeId);
member->GetSession()->SendPacket(&data);
@@ -179,7 +183,6 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName());
}
sLog.outDebug("Battleground: group end");
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
}
else
{
@@ -190,14 +193,15 @@ void WorldSession::HandleBattleGroundJoinOpcode( WorldPacket & recv_data )
WorldPacket data;
// send status packet (in queue)
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), queueSlot, STATUS_WAIT_QUEUE, 0, 0);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType);
SendPacket(&data);
- GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, 0, false, 0);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo);
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel());
sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
}
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(bgTypeId));
+ if (!ginfo->IsInvitedToBGInstanceGUID)
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
}
void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv_data*/ )
@@ -209,40 +213,62 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
if(!bg) // can't be received if player not in battleground
return;
- if(bg->GetTypeID() == BATTLEGROUND_WS)
+ switch( bg->GetTypeID() )
{
- uint32 count1 = 0;
- uint32 count2 = 0;
+ case BATTLEGROUND_WS:
+ {
+ uint32 count1 = 0; //always constant zero?
+ uint32 count2 = 0; //count of next fields
- Player *ap = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
- if(ap) ++count2;
+ Player *ali_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
+ if (ali_plr)
+ ++count2;
- Player *hp = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
- if(hp) ++count2;
+ Player *horde_plr = objmgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
+ if (horde_plr)
+ ++count2;
- WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
- data << count1; // alliance flag holders count
- /*for(uint8 i = 0; i < count1; i++)
- {
- data << uint64(0); // guid
- data << (float)0; // x
- data << (float)0; // y
- }*/
- data << count2; // horde flag holders count
- if(ap)
- {
- data << (uint64)ap->GetGUID();
- data << (float)ap->GetPositionX();
- data << (float)ap->GetPositionY();
- }
- if(hp)
- {
- data << (uint64)hp->GetGUID();
- data << (float)hp->GetPositionX();
- data << (float)hp->GetPositionY();
- }
+ WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
+ data << count1; // alliance flag holders count - obsolete, now always 0
+ /*for(uint8 i = 0; i < count1; i++)
+ {
+ data << uint64(0); // guid
+ data << (float)0; // x
+ data << (float)0; // y
+ }*/
+ data << count2; // horde flag holders count - obsolete, now count of next fields
+ if (ali_plr)
+ {
+ data << (uint64)ali_plr->GetGUID();
+ data << (float)ali_plr->GetPositionX();
+ data << (float)ali_plr->GetPositionY();
+ }
+ if (horde_plr)
+ {
+ data << (uint64)horde_plr->GetGUID();
+ data << (float)horde_plr->GetPositionX();
+ data << (float)horde_plr->GetPositionY();
+ }
- SendPacket(&data);
+ SendPacket(&data);
+ }
+ break;
+ case BATTLEGROUND_EY:
+ //TODO : fix me!
+ break;
+ case BATTLEGROUND_AB:
+ case BATTLEGROUND_AV:
+ {
+ //for other BG types - send default
+ WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4));
+ data << uint32(0);
+ data << uint32(0);
+ SendPacket(&data);
+ }
+ break;
+ default:
+ //maybe it is sent also in arena - do nothing
+ break;
}
}
@@ -251,7 +277,7 @@ void WorldSession::HandleBattleGroundPVPlogdataOpcode( WorldPacket & /*recv_data
sLog.outDebug( "WORLD: Recvd MSG_PVP_LOG_DATA Message");
BattleGround *bg = _player->GetBattleGround();
- if(!bg)
+ if (!bg)
return;
WorldPacket data;
@@ -270,19 +296,15 @@ void WorldSession::HandleBattleGroundListOpcode( WorldPacket &recv_data )
uint32 bgTypeId;
recv_data >> bgTypeId; // id from DBC
- if(bgTypeId >= MAX_BATTLEGROUND_TYPES)
+ BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
+ if (!bl)
{
sLog.outError("Battleground: invalid bgtype received.");
return;
}
- BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
-
- if(!bl)
- return;
-
WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundListPacket(&data, _player->GetGUID(), _player, bgTypeId);
+ sBattleGroundMgr.BuildBattleGroundListPacket(&data, _player->GetGUID(), _player, BattleGroundTypeId(bgTypeId));
SendPacket( &data );
}
@@ -295,45 +317,40 @@ void WorldSession::HandleBattleGroundPlayerPortOpcode( WorldPacket &recv_data )
uint8 type; // arenatype if arena
uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1
uint32 instanceId;
- uint32 bgTypeId; // type id from dbc
+ uint32 bgTypeId_; // type id from dbc
uint16 unk; // 0x1F90 constant?
uint8 action; // enter battle 0x1, leave queue 0x0
- recv_data >> type >> unk2 >> bgTypeId >> unk >> action;
+ recv_data >> type >> unk2 >> bgTypeId_ >> unk >> action;
- if(bgTypeId >= MAX_BATTLEGROUND_TYPES)
+ if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{
- sLog.outError("Battleground: invalid bgtype received.");
+ sLog.outError("Battleground: invalid bgtype (%u) received.", bgTypeId_);
// update battleground slots for the player to fix his UI and sent data.
// this is a HACK, I don't know why the client starts sending invalid packets in the first place.
// it usually happens with extremely high latency (if debugging / stepping in the code for example)
- if(_player->InBattleGroundQueue())
+ if (_player->InBattleGroundQueue())
{
// update all queues, send invitation info if player is invited, queue info if queued
for (uint32 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
{
- uint32 queue_id = _player->GetBattleGroundQueueId(i);
- if(!queue_id)
+ BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i);
+ if (!bgQueueTypeId)
continue;
- BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].find(_player->GetGUID());
- // if the player is not in queue, contine
- if(itrPlayerStatus == sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].end())
- continue;
-
- // no group information, this should never happen
- if(!itrPlayerStatus->second.GroupInfo)
+ BattleGroundTypeId bgTypeId = BattleGroundMgr::BGTemplateId(bgQueueTypeId);
+ BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
+ BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
+ // if the player is not in queue, continue or no group information - this should never happen
+ if (itrPlayerStatus == qpMap.end() || !itrPlayerStatus->second.GroupInfo)
continue;
BattleGround * bg = NULL;
-
// get possibly needed data from groupinfo
- bgTypeId = itrPlayerStatus->second.GroupInfo->BgTypeId;
uint8 arenatype = itrPlayerStatus->second.GroupInfo->ArenaType;
uint8 israted = itrPlayerStatus->second.GroupInfo->IsRated;
uint8 status = 0;
-
- if(!itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
+ if (!itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
{
// not invited to bg, get template
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
@@ -342,130 +359,124 @@ void WorldSession::HandleBattleGroundPlayerPortOpcode( WorldPacket &recv_data )
else
{
// get the bg we're invited to
- BattleGround * bg = sBattleGroundMgr.GetBattleGround(itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID);
+ BattleGround * bg = sBattleGroundMgr.GetBattleGround(itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID, bgTypeId);
status = STATUS_WAIT_JOIN;
}
- // if bg not found, then continue
- if(!bg)
- continue;
-
- // don't invite if already in the instance
- if(_player->InBattleGround() && _player->GetBattleGround() && _player->GetBattleGround()->GetInstanceID() == bg->GetInstanceID())
+ // if bg not found, then continue, don't invite if already in the instance
+ if (!bg || (_player->InBattleGround() && _player->GetBattleGround() && _player->GetBattleGround()->GetInstanceID() == bg->GetInstanceID()))
continue;
// re - invite player with proper data
WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, itrPlayerStatus->second.GroupInfo->Team?itrPlayerStatus->second.GroupInfo->Team:_player->GetTeam(), i, status, INVITE_ACCEPT_WAIT_TIME, 0, arenatype, israted);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, status, INVITE_ACCEPT_WAIT_TIME, 0, arenatype);
SendPacket(&data);
}
}
return;
}
- uint32 bgQueueTypeId = 0;
- // get the bg what we were invited to
- BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus;
- bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bgTypeId,type);
- itrPlayerStatus = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].find(_player->GetGUID());
-
- if(itrPlayerStatus == sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].end())
+ //get GroupQueueInfo from BattleGroundQueue
+ BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, type);
+ BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
+ BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
+ if (itrPlayerStatus == qpMap.end())
{
sLog.outError("Battleground: itrplayerstatus not found.");
return;
}
- instanceId = itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID;
- // if action == 1, then instanceId is _required_
- if(!instanceId && action == 1)
+ instanceId = itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID;
+ // if action == 1, then instanceId is required
+ if (!instanceId && action == 1)
{
sLog.outError("Battleground: instance not found.");
return;
}
- BattleGround *bg = sBattleGroundMgr.GetBattleGround(instanceId);
+ BattleGround *bg = sBattleGroundMgr.GetBattleGround(instanceId, bgTypeId);
// bg template might and must be used in case of leaving queue, when instance is not created yet
- if(!bg && action == 0)
+ if (!bg && action == 0)
bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
-
- if(!bg)
+ if (!bg)
{
- sLog.outError("Battleground: bg not found.");
+ sLog.outError("Battleground: bg_template not found for type id %u.", bgTypeId);
return;
}
- bgTypeId = bg->GetTypeID();
-
- if(_player->InBattleGroundQueue())
+ if (_player->InBattleGroundQueue())
{
- uint32 queueSlot = 0;
- uint32 team = 0;
- uint32 arenatype = 0;
- uint32 israted = 0;
- uint32 rating = 0;
- uint32 opponentsRating = 0;
- // get the team info from the queue
- BattleGroundQueue::QueuedPlayersMap::iterator pitr = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].find(_player->GetGUID());
- if(pitr !=sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].end()
- && pitr->second.GroupInfo )
- {
- team = pitr->second.GroupInfo->Team;
- arenatype = pitr->second.GroupInfo->ArenaType;
- israted = pitr->second.GroupInfo->IsRated;
- rating = pitr->second.GroupInfo->ArenaTeamRating;
- opponentsRating = pitr->second.GroupInfo->OpponentsTeamRating;
- }
- else
+ //we must use temporary variables, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function!
+ uint32 team = itrPlayerStatus->second.GroupInfo->Team;
+ uint32 arenaType = itrPlayerStatus->second.GroupInfo->ArenaType;
+ uint32 isRated = itrPlayerStatus->second.GroupInfo->IsRated;
+ uint32 rating = itrPlayerStatus->second.GroupInfo->ArenaTeamRating;
+ uint32 opponentsRating = itrPlayerStatus->second.GroupInfo->OpponentsTeamRating;
+
+ //some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it
+ if (action == 1 && arenaType == 0)
{
- sLog.outError("Battleground: Invalid player queue info!");
- return;
+ //if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue
+ if (!_player->CanJoinToBattleground())
+ {
+ //send bg command result to show nice message
+ WorldPacket data2(SMSG_GROUP_JOINED_BATTLEGROUND, 4);
+ data2 << uint32(0xFFFFFFFE);
+ _player->GetSession()->SendPacket(&data2);
+ action = 0;
+ sLog.outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
+ }
+ //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
+ if (_player->getLevel() > bg->GetMaxLevel())
+ {
+ sLog.outError("Battleground: Player %s (%u) has level higher than maxlevel of battleground! Do not port him to battleground!", _player->GetName(), _player->GetGUIDLow());
+ action = 0;
+ }
}
+ uint32 queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
WorldPacket data;
- switch(action)
+ switch( action )
{
- case 1: // port to battleground
- if(!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
- return; // cheating?
+ case 1: // port to battleground
+ if (!_player->IsInvitedForBattleGroundQueueType(bgQueueTypeId))
+ return; // cheating?
// resurrect the player
- if(!_player->isAlive())
+ if (!_player->isAlive())
{
_player->ResurrectPlayer(1.0f);
_player->SpawnCorpseBones();
}
// stop taxi flight at port
- if(_player->isInFlight())
+ if (_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations();
}
- _player->RemoveFromGroup();
- queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime());
+
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType());
_player->GetSession()->SendPacket(&data);
// remove battleground queue status from BGmgr
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(_player->GetGUID(), false);
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
- // also this required to prevent stuck at old battleground after SetBattleGroundId set to new
- if( BattleGround *currentBg = _player->GetBattleGround() )
+ // also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
+ if (BattleGround *currentBg = _player->GetBattleGround())
currentBg->RemovePlayerAtLeave(_player->GetGUID(), false, true);
// set the destination instance id
- _player->SetBattleGroundId(bg->GetInstanceID());
+ _player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);
// set the destination team
_player->SetBGTeam(team);
// bg->HandleBeforeTeleportToBattleGround(_player);
- sBattleGroundMgr.SendToBattleGround(_player, instanceId);
+ sBattleGroundMgr.SendToBattleGround(_player, instanceId, bgTypeId);
// add only in HandleMoveWorldPortAck()
// bg->AddPlayer(_player,team);
- sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.",_player->GetName(),_player->GetGUIDLow(),bg->GetInstanceID(),bg->GetTypeID(),bgQueueTypeId);
+ sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId);
break;
- case 0: // leave queue
- queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
- /*
- if player leaves rated arena match before match start, it is counted as he played but he lost
- */
- if (israted)
+ case 0: // leave queue
+ // if player leaves rated arena match before match start, it is counted as he played but he lost
+ if (isRated)
{
ArenaTeam * at = objmgr.GetArenaTeamById(team);
if (at)
@@ -475,13 +486,14 @@ void WorldSession::HandleBattleGroundPlayerPortOpcode( WorldPacket &recv_data )
at->SaveToDB();
}
}
- _player->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), queueSlot, STATUS_NONE, 0, 0);
+ _player->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(_player->GetGUID(), true);
- // player left queue, we should update it, maybe now his group fits in
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId,_player->GetBattleGroundQueueIdFromLevel(),arenatype,israted,rating);
+ // player left queue, we should update it - do not update Arena Queue
+ if (!arenaType)
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(bgTypeId), arenaType, isRated, rating);
SendPacket(&data);
- sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.",_player->GetName(),_player->GetGUIDLow(),bg->GetTypeID(),bgQueueTypeId);
+ sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId);
break;
default:
sLog.outError("Battleground port: unknown action %u", action);
@@ -506,9 +518,9 @@ void WorldSession::HandleBattleGroundLeaveOpcode( WorldPacket & /*recv_data*/ )
// return;
// not allow leave battleground in combat
- if(_player->isInCombat())
- if(BattleGround* bg = _player->GetBattleGround())
- if(bg->GetStatus() != STATUS_WAIT_LEAVE)
+ if (_player->isInCombat())
+ if (BattleGround* bg = _player->GetBattleGround())
+ if (bg->GetStatus() != STATUS_WAIT_LEAVE)
return;
_player->LeaveBattleground();
@@ -520,81 +532,56 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
sLog.outDebug( "WORLD: Battleground status" );
WorldPacket data;
-
- // TODO: we must put player back to battleground in case disconnect (< 5 minutes offline time) or teleport player on login(!) from battleground map to entry point
- if(_player->InBattleGround())
+ // we must update all queues here
+ BattleGround *bg = NULL;
+ for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
{
- BattleGround *bg = _player->GetBattleGround();
- if(bg)
+ BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i);
+ if (!bgQueueTypeId)
+ continue;
+ BattleGroundTypeId bgTypeId = BattleGroundMgr::BGTemplateId(bgQueueTypeId);
+ uint8 arenaType = BattleGroundMgr::BGArenaType(bgQueueTypeId);
+ if (bgTypeId == _player->GetBattleGroundTypeId())
{
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
- uint32 queueSlot = _player->GetBattleGroundQueueIndex(bgQueueTypeId);
- if((bg->GetStatus() <= STATUS_IN_PROGRESS))
+ bg = _player->GetBattleGround();
+ //i cannot check any variable from player class because player class doesn't know if player is in 2v2 / 3v3 or 5v5 arena
+ //so i must use bg pointer to get that information
+ if (bg && bg->GetArenaType() == arenaType)
{
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime());
+ // this line is checked, i only don't know if GetStartTime is changing itself after bg end!
+ // send status in BattleGround
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType);
SendPacket(&data);
- }
- for (uint32 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- {
- uint32 queue_id = _player->GetBattleGroundQueueId(i); // battlegroundqueueid stores the type id, not the instance id, so this is definitely wrong
- uint8 arenatype = sBattleGroundMgr.BGArenaType(queue_id);
- uint8 isRated = 0;
- if (i == queueSlot || !queue_id) // we need to get the instance ids
- continue;
- BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].find(_player->GetGUID());
- if(itrPlayerStatus == sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].end())
- continue;
- if(itrPlayerStatus->second.GroupInfo)
- {
- arenatype = itrPlayerStatus->second.GroupInfo->ArenaType;
- isRated = itrPlayerStatus->second.GroupInfo->IsRated;
- }
- BattleGround *bg2 = sBattleGroundMgr.GetBattleGroundTemplate(sBattleGroundMgr.BGTemplateId(queue_id)); // try this
- if(bg2)
- {
- //in this call is small bug, this call should be filled by player's waiting time in queue
- //this call nulls all timers for client :
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg2, _player->GetTeam(), i, STATUS_WAIT_QUEUE, 0, 0,arenatype,isRated);
- SendPacket(&data);
- }
+ continue;
}
}
- }
- else
- {
- // we should update all queues? .. i'm not sure if this code is correct
- for (uint32 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
+ //we are sending update to player about queue - he can be invited there!
+ //get GroupQueueInfo for queue status
+ BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
+ BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = qpMap.find(_player->GetGUID());
+ if (itrPlayerStatus == qpMap.end())
+ continue;
+ if (itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID)
{
- uint32 queue_id = _player->GetBattleGroundQueueId(i);
- if(!queue_id)
+ bg = sBattleGroundMgr.GetBattleGround(itrPlayerStatus->second.GroupInfo->IsInvitedToBGInstanceGUID, bgTypeId);
+ if (!bg)
continue;
- uint32 bgTypeId = sBattleGroundMgr.BGTemplateId(queue_id);
- uint8 arenatype = sBattleGroundMgr.BGArenaType(queue_id);
- uint8 isRated = 0;
- BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
- BattleGroundQueue::QueuedPlayersMap::iterator itrPlayerStatus = sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].find(_player->GetGUID());
- if(itrPlayerStatus == sBattleGroundMgr.m_BattleGroundQueues[queue_id].m_QueuedPlayers[_player->GetBattleGroundQueueIdFromLevel()].end())
- continue;
- if(itrPlayerStatus->second.GroupInfo)
- {
- arenatype = itrPlayerStatus->second.GroupInfo->ArenaType;
- isRated = itrPlayerStatus->second.GroupInfo->IsRated;
- }
- if(bg && queue_id)
- {
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), i, STATUS_WAIT_QUEUE, 0, 0, arenatype, isRated);
- SendPacket(&data);
- }
+ uint32 remainingTime = getMSTimeDiff(getMSTime(), itrPlayerStatus->second.GroupInfo->RemoveInviteTime);
+ // send status invited to BattleGround
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType);
+ SendPacket(&data);
}
- }
-/* else // not sure if it needed...
- {
- for (uint32 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
+ else
{
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, NULL, _player->GetTeam(),i , STATUS_NONE, 0, 0);
+ BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
+ if (!bg)
+ continue;
+ uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(itrPlayerStatus->second.GroupInfo, _player->GetBattleGroundQueueIdFromLevel(bgTypeId));
+ // send status in BattleGround Queue
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(itrPlayerStatus->second.GroupInfo->JoinTime, getMSTime()), arenaType);
SendPacket(&data);
}
- }*/
+ }
}
void WorldSession::HandleAreaSpiritHealerQueryOpcode( WorldPacket & recv_data )
@@ -604,14 +591,14 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode( WorldPacket & recv_data )
CHECK_PACKET_SIZE(recv_data, 8);
BattleGround *bg = _player->GetBattleGround();
- if(!bg)
+ if (!bg)
return;
uint64 guid;
recv_data >> guid;
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
- if(!unit)
+ if (!unit)
return;
if(!unit->isSpiritService()) // it's not spirit service
@@ -627,14 +614,14 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data )
CHECK_PACKET_SIZE(recv_data, 8);
BattleGround *bg = _player->GetBattleGround();
- if(!bg)
+ if (!bg)
return;
uint64 guid;
recv_data >> guid;
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
- if(!unit)
+ if (!unit)
return;
if(!unit->isSpiritService()) // it's not spirit service
@@ -651,19 +638,19 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
recv_data.hexlike();
// ignore if we already in BG or BG queue
- if(_player->InBattleGround())
+ if (_player->InBattleGround())
return;
uint64 guid; // arena Battlemaster guid
- uint8 type; // 2v2, 3v3 or 5v5
+ uint8 arenaslot; // 2v2, 3v3 or 5v5
uint8 asGroup; // asGroup
uint8 isRated; // isRated
Group * grp;
- recv_data >> guid >> type >> asGroup >> isRated;
+ recv_data >> guid >> arenaslot >> asGroup >> isRated;
Creature *unit = ObjectAccessor::GetCreature(*_player, guid);
- if(!unit)
+ if (!unit)
return;
if(!unit->isBattleMaster()) // it's not battle master
@@ -672,7 +659,7 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
uint8 arenatype = 0;
uint32 arenaRating = 0;
- switch(type)
+ switch(arenaslot)
{
case 0:
arenatype = ARENA_TYPE_2v2;
@@ -684,39 +671,39 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
arenatype = ARENA_TYPE_5v5;
break;
default:
- sLog.outError("Unknown arena type %u at HandleBattleGroundArenaJoin()", type);
+ sLog.outError("Unknown arena slot %u at HandleBattleGroundArenaJoin()", arenaslot);
return;
}
//check existance
BattleGround* bg = NULL;
- if( !(bg = sBattleGroundMgr.GetBattleGroundTemplate(BATTLEGROUND_AA)) )
+ if (!(bg = sBattleGroundMgr.GetBattleGroundTemplate(BATTLEGROUND_AA)))
{
sLog.outError("Battleground: template bg (all arenas) not found");
return;
}
- uint8 bgTypeId = bg->GetTypeID();
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bgTypeId, arenatype);
+ BattleGroundTypeId bgTypeId = bg->GetTypeID();
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenatype);
// check queueing conditions
- if(!asGroup)
+ if (!asGroup)
{
// check if already in queue
if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES)
//player is already in this queue
return;
// check if has free queue slots
- if(!_player->HasFreeBattleGroundQueueId())
+ if (!_player->HasFreeBattleGroundQueueId())
return;
}
else
{
grp = _player->GetGroup();
// no group found, error
- if(!grp)
+ if (!grp)
return;
- uint32 err = grp->CanJoinBattleGroundQueue(bgTypeId, bgQueueTypeId, arenatype, arenatype, (bool)isRated, type);
+ uint32 err = grp->CanJoinBattleGroundQueue(bgTypeId, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot);
if (err != BG_JOIN_ERR_OK)
{
SendBattleGroundOrArenaJoinError(err);
@@ -726,12 +713,12 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
uint32 ateamId = 0;
- if(isRated)
+ if (isRated)
{
- ateamId = _player->GetArenaTeamId(type);
+ ateamId = _player->GetArenaTeamId(arenaslot);
// check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice)
ArenaTeam * at = objmgr.GetArenaTeamById(ateamId);
- if(!at)
+ if (!at)
{
_player->GetSession()->SendNotInArenaTeamPacket(arenatype);
return;
@@ -746,23 +733,24 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
Player *member = itr->getSource();
// calc avg personal rating
- avg_pers_rating += member->GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (type*6) + 5);
+ avg_pers_rating += member->GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (arenaslot*6) + 5);
}
- if( arenatype )
+ if (arenatype)
avg_pers_rating /= arenatype;
// if avg personal rating is more than 150 points below the teams rating, the team will be queued against an opponent matching or similar to the average personal rating
- if(avg_pers_rating + 150 < arenaRating)
+ if (avg_pers_rating + 150 < arenaRating)
arenaRating = avg_pers_rating;
}
- if(asGroup)
+ GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, arenatype, isRated, false, arenaRating, ateamId);
+ uint32 avgTime = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].GetAverageQueueWaitTime(ginfo, _player->GetBattleGroundQueueIdFromLevel(bgTypeId));
+ if (asGroup)
{
- GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, arenatype, isRated, arenaRating, ateamId);
sLog.outDebug("Battleground: arena join as group start");
- if(isRated)
- sLog.outDebug("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(type),_player->GetName(),arenaRating,arenatype);
+ if (isRated)
+ sLog.outDebug("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),arenaRating,arenatype);
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *member = itr->getSource();
@@ -775,7 +763,7 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
WorldPacket data;
// send status packet (in queue)
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, member->GetTeam(), queueSlot, STATUS_WAIT_QUEUE, 0, 0, arenatype, isRated);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
member->GetSession()->SendPacket(&data);
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, bgTypeId);
member->GetSession()->SendPacket(&data);
@@ -783,7 +771,8 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
sLog.outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName());
}
sLog.outDebug("Battleground: arena join as group end");
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenatype, isRated, arenaRating);
+ if (isRated)
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AnnounceWorld(ginfo, _player->GetGUID(), true);
}
else
{
@@ -794,13 +783,12 @@ void WorldSession::HandleBattleGroundArenaJoin( WorldPacket & recv_data )
WorldPacket data;
// send status packet (in queue)
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, _player->GetTeam(), queueSlot, STATUS_WAIT_QUEUE, 0, 0, arenatype, isRated);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
SendPacket(&data);
- GroupQueueInfo * ginfo = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddGroup(_player, bgTypeId, arenatype, isRated, arenaRating);
sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].AddPlayer(_player, ginfo);
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(), arenatype, isRated, arenaRating);
sLog.outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
}
+ sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgTypeId, _player->GetBattleGroundQueueIdFromLevel(bgTypeId), arenatype, isRated, arenaRating);
}
void WorldSession::HandleBattleGroundReportAFK( WorldPacket & recv_data )
@@ -811,7 +799,7 @@ void WorldSession::HandleBattleGroundReportAFK( WorldPacket & recv_data )
recv_data >> playerGuid;
Player *reportedPlayer = objmgr.GetPlayer(playerGuid);
- if(!reportedPlayer)
+ if (!reportedPlayer)
{
sLog.outDebug("WorldSession::HandleBattleGroundReportAFK: player not found");
return;
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp
index 54d2538068d..6b7b3c99fe0 100644
--- a/src/game/BattleGroundMgr.cpp
+++ b/src/game/BattleGroundMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
*/
#include "Common.h"
+#include "SharedDefines.h"
#include "Player.h"
#include "BattleGroundMgr.h"
#include "BattleGroundAV.h"
@@ -29,16 +30,21 @@
#include "BattleGroundBE.h"
#include "BattleGroundAA.h"
#include "BattleGroundRL.h"
-#include "SharedDefines.h"
-#include "Policies/SingletonImp.h"
+#include "BattleGroundSA.h"
+#include "BattleGroundDS.h"
+#include "BattleGroundRV.h"
#include "MapManager.h"
#include "Map.h"
#include "MapInstanced.h"
#include "ObjectMgr.h"
#include "ProgressBar.h"
-#include "World.h"
#include "Chat.h"
#include "ArenaTeam.h"
+#include "World.h"
+#include "WorldPacket.h"
+#include "ProgressBar.h"
+
+#include "Policies/SingletonImp.h"
INSTANTIATE_SINGLETON_1( BattleGroundMgr );
@@ -48,96 +54,103 @@ INSTANTIATE_SINGLETON_1( BattleGroundMgr );
BattleGroundQueue::BattleGroundQueue()
{
- //queues are empty, we don't have to call clear()
-/* for (int i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
{
- //m_QueuedPlayers[i].Horde = 0;
- //m_QueuedPlayers[i].Alliance = 0;
- //m_QueuedPlayers[i].AverageTime = 0;
- }*/
-}
-
-BattleGroundQueue::~BattleGroundQueue()
-{
- for (int i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
- {
- m_QueuedPlayers[i].clear();
- for(QueuedGroupsList::iterator itr = m_QueuedGroups[i].begin(); itr!= m_QueuedGroups[i].end(); ++itr)
+ for(uint32 j = 0; j < MAX_BATTLEGROUND_QUEUES; j++)
{
- delete (*itr);
+ m_SumOfWaitTimes[i][j] = 0;
+ m_WaitTimeLastPlayer[i][j] = 0;
+ for(uint32 k = 0; k < COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME; k++)
+ m_WaitTimes[i][j][k] = 0;
}
- m_QueuedGroups[i].clear();
}
}
-// initialize eligible groups from the given source matching the given specifications
-void BattleGroundQueue::EligibleGroups::Init(BattleGroundQueue::QueuedGroupsList *source, uint32 BgTypeId, uint32 side, uint32 MaxPlayers, uint8 ArenaType, bool IsRated, uint32 MinRating, uint32 MaxRating, uint32 DisregardTime, uint32 excludeTeam)
+BattleGroundQueue::~BattleGroundQueue()
{
- // clear from prev initialization
- clear();
- BattleGroundQueue::QueuedGroupsList::iterator itr, next;
- // iterate through the source
- for(itr = source->begin(); itr!= source->end(); itr = next)
+ m_QueuedPlayers.clear();
+ for (int i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
{
- next = itr;
- ++next;
- if( (*itr)->BgTypeId == BgTypeId && // bg type must match
- (*itr)->ArenaType == ArenaType && // arena type must match
- (*itr)->IsRated == IsRated && // israted must match
- (*itr)->IsInvitedToBGInstanceGUID == 0 && // leave out already invited groups
- (*itr)->Team == side && // match side
- (*itr)->Players.size() <= MaxPlayers && // the group must fit in the bg
- ( !excludeTeam || (*itr)->ArenaTeamId != excludeTeam ) && // if excludeTeam is specified, leave out those arena team ids
- ( !IsRated || (*itr)->Players.size() == MaxPlayers ) && // if rated, then pass only if the player count is exact NEEDS TESTING! (but now this should never happen)
- ( !DisregardTime || (*itr)->JoinTime <= DisregardTime // pass if disregard time is greater than join time
- || (*itr)->ArenaTeamRating == 0 // pass if no rating info
- || ( (*itr)->ArenaTeamRating >= MinRating // pass if matches the rating range
- && (*itr)->ArenaTeamRating <= MaxRating ) ) )
+ for(uint32 j = 0; j < BG_QUEUE_GROUP_TYPES_COUNT; j++)
{
- // the group matches the conditions
- // using push_back for proper selecting when inviting
- push_back((*itr));
+ for(GroupsQueueType::iterator itr = m_QueuedGroups[i][j].begin(); itr!= m_QueuedGroups[i][j].end(); ++itr)
+ delete (*itr);
+ m_QueuedGroups[i][j].clear();
}
}
}
+/*********************************************************/
+/*** BATTLEGROUND QUEUE SELECTION POOLS ***/
+/*********************************************************/
+
// selection pool initialization, used to clean up from prev selection
-void BattleGroundQueue::SelectionPool::Init(EligibleGroups * curr)
+void BattleGroundQueue::SelectionPool::Init()
{
- m_CurrEligGroups = curr;
SelectedGroups.clear();
PlayerCount = 0;
}
// remove group info from selection pool
-void BattleGroundQueue::SelectionPool::RemoveGroup(GroupQueueInfo *ginfo)
+// returns true when we need to try to add new group to selection pool
+// returns false when selection pool is ok or when we kicked smaller group than we need to kick
+// sometimes it can be called on empty selection pool
+bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
{
- // find what to remove
- for(std::list<GroupQueueInfo *>::iterator itr = SelectedGroups.begin(); itr != SelectedGroups.end(); ++itr)
+ //find maxgroup or LAST group with size == size and kick it
+ bool found = false;
+ GroupsQueueType::iterator groupToKick = SelectedGroups.begin();
+ for (GroupsQueueType::iterator itr = groupToKick; itr != SelectedGroups.end(); ++itr)
{
- if((*itr)==ginfo)
+ if (abs((int32)((*itr)->Players.size() - size)) <= 1)
{
- SelectedGroups.erase(itr);
- // decrease selected players count
- PlayerCount -= ginfo->Players.size();
- return;
+ groupToKick = itr;
+ found = true;
}
+ else if (!found && (*itr)->Players.size() >= (*groupToKick)->Players.size())
+ groupToKick = itr;
+ }
+ //if pool is empty, do nothing
+ if (GetPlayerCount())
+ {
+ //update player count
+ GroupQueueInfo* ginfo = (*groupToKick);
+ SelectedGroups.erase(groupToKick);
+ PlayerCount -= ginfo->Players.size();
+ //return false if we kicked smaller group or there are enough players in selection pool
+ if (ginfo->Players.size() <= size + 1)
+ return false;
}
+ return true;
}
-// add group to selection
+// add group to selection pool
// used when building selection pools
-void BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo * ginfo)
+// returns true if we can invite more players, or when we added group to selection pool
+// returns false when selection pool is full
+bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount)
{
- SelectedGroups.push_back(ginfo);
- // increase selected players count
- PlayerCount+=ginfo->Players.size();
+ //if group is larger than desired count - don't allow to add it to pool
+ if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size())
+ {
+ SelectedGroups.push_back(ginfo);
+ // increase selected players count
+ PlayerCount += ginfo->Players.size();
+ return true;
+ }
+ if (PlayerCount < desiredCount)
+ return true;
+ return false;
}
+/*********************************************************/
+/*** BATTLEGROUND QUEUES ***/
+/*********************************************************/
+
// add group to bg queue with the given leader and bg specifications
-GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, uint32 BgTypeId, uint8 ArenaType, bool isRated, uint32 arenaRating, uint32 arenateamid)
+GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, BattleGroundTypeId BgTypeId, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid)
{
- uint32 queue_id = leader->GetBattleGroundQueueIdFromLevel();
+ BGQueueIdBasedOnLevel queue_id = leader->GetBattleGroundQueueIdFromLevel(BgTypeId);
// create new ginfo
// cannot use the method like in addplayer, because that could modify an in-queue group's stats
@@ -147,28 +160,34 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, uint32 BgTypeId, ui
ginfo->ArenaType = ArenaType;
ginfo->ArenaTeamId = arenateamid;
ginfo->IsRated = isRated;
- ginfo->IsInvitedToBGInstanceGUID = 0; // maybe this should be modifiable by function arguments to enable selection of running instances?
+ ginfo->IsInvitedToBGInstanceGUID = 0;
ginfo->JoinTime = getMSTime();
+ ginfo->RemoveInviteTime = 0;
ginfo->Team = leader->GetTeam();
ginfo->ArenaTeamRating = arenaRating;
- ginfo->OpponentsTeamRating = 0; //initialize it to 0
+ ginfo->OpponentsTeamRating = 0;
ginfo->Players.clear();
- m_QueuedGroups[queue_id].push_back(ginfo);
+ //compute index (if group is premade or joined a rated match) to queues
+ uint32 index = 0;
+ if (!isRated && !isPremade)
+ index += BG_TEAMS_COUNT;
+ if (ginfo->Team == HORDE)
+ index++;
+ sLog.outDebug("Adding Group to BattleGroundQueue bgTypeId : %u, queue_id : %u, index : %u", BgTypeId, queue_id, index);
+
+ m_QueuedGroups[queue_id][index].push_back(ginfo);
// return ginfo, because it is needed to add players to this group info
return ginfo;
}
+//add player to playermap
void BattleGroundQueue::AddPlayer(Player *plr, GroupQueueInfo *ginfo)
{
- uint32 queue_id = plr->GetBattleGroundQueueIdFromLevel();
-
//if player isn't in queue, he is added, if already is, then values are overwritten, no memory leak
- PlayerQueueInfo& info = m_QueuedPlayers[queue_id][plr->GetGUID()];
- info.InviteTime = 0;
- info.LastInviteTime = 0;
+ PlayerQueueInfo& info = m_QueuedPlayers[plr->GetGUID()];
info.LastOnlineTime = getMSTime();
info.GroupInfo = ginfo;
@@ -176,113 +195,228 @@ void BattleGroundQueue::AddPlayer(Player *plr, GroupQueueInfo *ginfo)
ginfo->Players[plr->GetGUID()] = &info;
}
-void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
+void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id)
{
- Player *plr = objmgr.GetPlayer(guid);
+ uint32 timeInQueue = getMSTimeDiff(ginfo->JoinTime, getMSTime());
+ uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas!
+ if (!ginfo->ArenaType)
+ {
+ if (ginfo->Team == HORDE)
+ team_index = BG_TEAM_HORDE;
+ }
+ else
+ {
+ if (ginfo->IsRated)
+ team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE
+ }
- uint32 queue_id = 0;
- QueuedPlayersMap::iterator itr;
- GroupQueueInfo * group;
- QueuedGroupsList::iterator group_itr;
- bool IsSet = false;
- if(plr)
+ //store pointer to arrayindex of player that was added first
+ uint32* lastPlayerAddedPointer = &(m_WaitTimeLastPlayer[team_index][queue_id]);
+ //remove his time from sum
+ m_SumOfWaitTimes[team_index][queue_id] -= m_WaitTimes[team_index][queue_id][(*lastPlayerAddedPointer)];
+ //set average time to new
+ m_WaitTimes[team_index][queue_id][(*lastPlayerAddedPointer)] = timeInQueue;
+ //add new time to sum
+ m_SumOfWaitTimes[team_index][queue_id] += timeInQueue;
+ //set index of last player added to next one
+ (*lastPlayerAddedPointer)++;
+ (*lastPlayerAddedPointer) %= COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME;
+}
+
+uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id)
+{
+ uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas!
+ if (!ginfo->ArenaType)
{
- queue_id = plr->GetBattleGroundQueueIdFromLevel();
+ if (ginfo->Team == HORDE)
+ team_index = BG_TEAM_HORDE;
+ }
+ else
+ {
+ if (ginfo->IsRated)
+ team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE
+ }
+ //check if there is enought values(we always add values > 0)
+ if (m_WaitTimes[team_index][queue_id][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME - 1] )
+ return (m_SumOfWaitTimes[team_index][queue_id] / COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME);
+ else
+ //if there aren't enough values return 0 - not available
+ return 0;
+}
+
+//remove player from queue and from group info, if group info is empty then remove it too
+void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCount)
+{
+ //Player *plr = objmgr.GetPlayer(guid);
+
+ int32 queue_id = -1; // signed for proper for-loop finish
+ QueuedPlayersMap::iterator itr;
- itr = m_QueuedPlayers[queue_id].find(guid);
- if(itr != m_QueuedPlayers[queue_id].end())
- IsSet = true;
+ //remove player from map, if he's there
+ itr = m_QueuedPlayers.find(guid);
+ if (itr == m_QueuedPlayers.end())
+ {
+ sLog.outError("BattleGroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
+ return;
}
- if(!IsSet)
+ GroupQueueInfo* group = itr->second.GroupInfo;
+ GroupsQueueType::iterator group_itr, group_itr_tmp;
+ // mostly people with the highest levels are in battlegrounds, thats why
+ // we count from MAX_BATTLEGROUND_QUEUES - 1 to 0
+ // variable index removes useless searching in other team's queue
+ uint32 index = (group->Team == HORDE) ? BG_TEAM_HORDE : BG_TEAM_ALLIANCE;
+
+ for (int32 queue_id_tmp = MAX_BATTLEGROUND_QUEUES - 1; queue_id_tmp >= 0 && queue_id == -1; --queue_id_tmp)
{
- // either player is offline, or he levelled up to another queue category
- // sLog.outError("Battleground: removing offline player from BG queue - this might not happen, but it should not cause crash");
- for (uint32 i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
+ //we must check premade and normal team's queue - because when players from premade are joining bg,
+ //they leave groupinfo so we can't use its players size to find out index
+ for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE)
{
- itr = m_QueuedPlayers[i].find(guid);
- if(itr != m_QueuedPlayers[i].end())
+ for(group_itr_tmp = m_QueuedGroups[queue_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[queue_id_tmp][j].end(); ++group_itr_tmp)
{
- queue_id = i;
- IsSet = true;
- break;
+ if ((*group_itr_tmp) == group)
+ {
+ queue_id = queue_id_tmp;
+ group_itr = group_itr_tmp;
+ //we must store index to be able to erase iterator
+ index = j;
+ break;
+ }
}
}
}
-
- // couldn't find the player in bg queue, return
- if(!IsSet)
+ //player can't be in queue without group, but just in case
+ if (queue_id == -1)
{
- sLog.outError("Battleground: couldn't find player to remove.");
+ sLog.outError("BattleGroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
return;
}
+ sLog.outDebug("BattleGroundQueue: Removing player GUID %u, from queue_id %u", GUID_LOPART(guid), (uint32)queue_id);
- group = itr->second.GroupInfo;
+ // ALL variables are correctly set
+ // We can ignore leveling up in queue - it should not cause crash
+ // remove player from group
+ // if only one player there, remove group
- for(group_itr=m_QueuedGroups[queue_id].begin(); group_itr != m_QueuedGroups[queue_id].end(); ++group_itr)
+ // remove player queue info from group queue info
+ std::map<uint64, PlayerQueueInfo*>::iterator pitr = group->Players.find(guid);
+ if (pitr != group->Players.end())
+ group->Players.erase(pitr);
+
+ // if invited to bg, and should decrease invited count, then do it
+ if (decreaseInvitedCount && group->IsInvitedToBGInstanceGUID)
{
- if(group == (GroupQueueInfo*)(*group_itr))
- break;
+ BattleGround* bg = sBattleGroundMgr.GetBattleGround(group->IsInvitedToBGInstanceGUID, group->BgTypeId);
+ if (bg)
+ bg->DecreaseInvitedCount(group->Team);
}
- // variables are set (what about leveling up when in queue????)
- // remove player from group
- // if only player there, remove group
+ // remove player queue info
+ m_QueuedPlayers.erase(itr);
- // remove player queue info from group queue info
- std::map<uint64, PlayerQueueInfo*>::iterator pitr = group->Players.find(guid);
+ //if we left BG queue(not porting) OR if arena team left queue for rated match
+ if ((decreaseInvitedCount && !group->ArenaType) || (group->ArenaType && group->IsRated && group->Players.empty()))
+ AnnounceWorld(group, guid, false);
- if(pitr != group->Players.end())
- group->Players.erase(pitr);
+ //if player leaves queue and he is invited to rated arena match, then he have to loose
+ if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
+ {
+ ArenaTeam * at = objmgr.GetArenaTeamById(group->ArenaTeamId);
+ if (at)
+ {
+ sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
+ Player *plr = objmgr.GetPlayer(guid);
+ if (plr)
+ at->MemberLost(plr, group->OpponentsTeamRating);
+ else
+ at->OfflineMemberLost(guid, group->OpponentsTeamRating);
+ at->SaveToDB();
+ }
+ }
- // check for iterator correctness
- if (group_itr != m_QueuedGroups[queue_id].end() && itr != m_QueuedPlayers[queue_id].end())
+ // remove group queue info if needed
+ if (group->Players.empty())
{
- // used when player left the queue, NOT used when porting to bg
- if (decreaseInvitedCount)
+ m_QueuedGroups[queue_id][index].erase(group_itr);
+ delete group;
+ }
+ // if group wasn't empty, so it wasn't deleted, and player have left a rated
+ // queue -> everyone from the group should leave too
+ // don't remove recursively if already invited to bg!
+ else if (!group->IsInvitedToBGInstanceGUID && group->IsRated)
+ {
+ // remove next player, this is recursive
+ // first send removal information
+ if (Player *plr2 = objmgr.GetPlayer(group->Players.begin()->first))
{
- // if invited to bg, and should decrease invited count, then do it
- if(group->IsInvitedToBGInstanceGUID)
- {
- BattleGround* bg = sBattleGroundMgr.GetBattleGround(group->IsInvitedToBGInstanceGUID);
- if (bg)
- bg->DecreaseInvitedCount(group->Team);
- if (bg && !bg->GetPlayersSize() && !bg->GetInvitedCount(ALLIANCE) && !bg->GetInvitedCount(HORDE))
- {
- // no more players on battleground, set delete it
- bg->SetDeleteThis();
- }
- }
- // update the join queue, maybe now the player's group fits in a queue!
- // not yet implemented (should store bgTypeId in group queue info?)
+ BattleGround * bg = sBattleGroundMgr.GetBattleGroundTemplate(group->BgTypeId);
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType);
+ uint32 queueSlot = plr2->GetBattleGroundQueueIndex(bgQueueTypeId);
+ plr2->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to
+ // queue->removeplayer, it causes bugs
+ WorldPacket data;
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
+ plr2->GetSession()->SendPacket(&data);
}
- // remove player queue info
- m_QueuedPlayers[queue_id].erase(itr);
- // remove group queue info if needed
- if(group->Players.empty())
+ // then actually delete, this may delete the group as well!
+ RemovePlayer(group->Players.begin()->first, decreaseInvitedCount);
+ }
+}
+
+//Announce world message
+void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playerGUID, bool isAddedToQueue)
+{
+ if(ginfo->ArenaType) //if Arena
+ {
+ if (sWorld.getConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE) && ginfo->IsRated)
{
- m_QueuedGroups[queue_id].erase(group_itr);
- delete group;
+ BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
+ if (!bg)
+ return;
+
+ char const* bgName = bg->GetName();
+ if (isAddedToQueue)
+ sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, bgName, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
+ else
+ sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, bgName, ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
- // NEEDS TESTING!
- // group wasn't empty, so it wasn't deleted, and player have left a rated queue -> everyone from the group should leave too
- // don't remove recursively if already invited to bg!
- else if(!group->IsInvitedToBGInstanceGUID && decreaseInvitedCount && group->IsRated)
+ }
+ else //if BG
+ {
+ if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
{
- // remove next player, this is recursive
- // first send removal information
- if(Player *plr2 = objmgr.GetPlayer(group->Players.begin()->first))
+ Player *plr = objmgr.GetPlayer(playerGUID);
+ BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId);
+ if (!bg || !plr)
+ return;
+
+ BGQueueIdBasedOnLevel queue_id = plr->GetBattleGroundQueueIdFromLevel(bg->GetTypeID());
+ char const* bgName = bg->GetName();
+ uint32 MinPlayers = bg->GetMinPlayersPerTeam();
+ uint32 qHorde = 0;
+ uint32 qAlliance = 0;
+ uint32 q_min_level = (queue_id + 1) * 10;
+ GroupsQueueType::const_iterator itr;
+ for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr)
+ if (!(*itr)->IsInvitedToBGInstanceGUID)
+ qAlliance += (*itr)->Players.size();
+ for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].end(); ++itr)
+ if (!(*itr)->IsInvitedToBGInstanceGUID)
+ qHorde += (*itr)->Players.size();
+
+ // Show queue status to player only (when joining queue)
+ if (sWorld.getConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
{
- BattleGround * bg = sBattleGroundMgr.GetBattleGroundTemplate(group->BgTypeId);
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(group->BgTypeId,group->ArenaType);
- uint32 queueSlot = plr2->GetBattleGroundQueueIndex(bgQueueTypeId);
- plr2->RemoveBattleGroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs
- WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, plr2->GetTeam(), queueSlot, STATUS_NONE, 0, 0);
- plr2->GetSession()->SendPacket(&data);
+ ChatHandler(plr).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF,
+ bgName, q_min_level, q_min_level + 10, qAlliance, MinPlayers, qHorde, MinPlayers);
+ }
+ // System message
+ else
+ {
+ sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD,
+ bgName, q_min_level, q_min_level + 10, qAlliance, MinPlayers, qHorde, MinPlayers);
}
- // then actually delete, this may delete the group as well!
- RemovePlayer(group->Players.begin()->first,decreaseInvitedCount);
}
}
}
@@ -290,30 +424,48 @@ void BattleGroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * bg, uint32 side)
{
// set side if needed
- if(side)
+ if (side)
ginfo->Team = side;
- if(!ginfo->IsInvitedToBGInstanceGUID)
+ if (!ginfo->IsInvitedToBGInstanceGUID)
{
// not yet invited
// set invitation
ginfo->IsInvitedToBGInstanceGUID = bg->GetInstanceID();
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
+ BattleGroundTypeId bgTypeId = bg->GetTypeID();
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, bg->GetArenaType());
+ BGQueueIdBasedOnLevel queue_id = bg->GetQueueId();
+
+ // set ArenaTeamId for rated matches
+ if (bg->isArena() && bg->isRated())
+ bg->SetArenaTeamIdForTeam(ginfo->Team, ginfo->ArenaTeamId);
+
+ ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME;
+
// loop through the players
for(std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
{
- // set status
- itr->second->InviteTime = getMSTime();
- itr->second->LastInviteTime = getMSTime();
-
// get the player
Player* plr = objmgr.GetPlayer(itr->first);
- // if offline, skip him
- if(!plr)
+ // if offline, skip him, this should not happen - player is removed from queue when he logs out
+ if (!plr)
continue;
// invite the player
- sBattleGroundMgr.InvitePlayer(plr, bg->GetInstanceID(),ginfo->Team);
+ PlayerInvitedToBGUpdateAverageWaitTime(ginfo, queue_id);
+ //sBattleGroundMgr.InvitePlayer(plr, bg, ginfo->Team);
+
+ // set invited player counters
+ bg->IncreaseInvitedCount(ginfo->Team);
+
+ plr->SetInviteForBattleGroundQueueType(bgQueueTypeId, ginfo->IsInvitedToBGInstanceGUID);
+
+ // create remind invite events
+ BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, ginfo->RemoveInviteTime);
+ plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITATION_REMIND_TIME));
+ // create automatic remove events
+ BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetGUID(), ginfo->IsInvitedToBGInstanceGUID, bgTypeId, bgQueueTypeId, ginfo->RemoveInviteTime);
+ plr->m_Events.AddEvent(removeEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME));
WorldPacket data;
@@ -322,7 +474,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
sLog.outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID());
// send status packet
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, side?side:plr->GetTeam(), queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType);
plr->GetSession()->SendPacket(&data);
}
return true;
@@ -331,190 +483,294 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
return false;
}
-// used to recursively select groups from eligible groups
-bool BattleGroundQueue::SelectionPool::Build(uint32 MinPlayers, uint32 MaxPlayers, EligibleGroups::iterator startitr)
+/*
+This function is inviting players to already running battlegrounds
+Invitation type is based on config file
+large groups are disadvantageous, because they will be kicked first if invitation type = 1
+*/
+void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel queue_id)
{
- // start from the specified start iterator
- for(EligibleGroups::iterator itr1 = startitr; itr1 != m_CurrEligGroups->end(); ++itr1)
+ uint32 hordeFree = bg->GetFreeSlotsForTeam(HORDE);
+ uint32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE);
+
+ //iterator for iterating through bg queue
+ GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin();
+ //count of groups in queue - used to stop cycles
+ uint32 aliCount = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].size();
+ //index to queue which group is current
+ uint32 aliIndex = 0;
+ for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); aliIndex++)
+ ++Ali_itr;
+ //the same thing for horde
+ GroupsQueueType::const_iterator Horde_itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].begin();
+ uint32 hordeCount = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].size();
+ uint32 hordeIndex = 0;
+ for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); hordeIndex++)
+ ++Horde_itr;
+
+ //if ofc like BG queue invitation is set in config, then we are happy
+ if (sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0)
+ return;
+
+ /*
+ if we reached this code, then we have to solve NP - complete problem called Subset sum problem
+ So one solution is to check all possible invitation subgroups, or we can use these conditions:
+ 1. Last time when BattleGroundQueue::Update was executed we invited all possible players - so there is only small possibility
+ that we will invite now whole queue, because only 1 change has been made to queues from the last BattleGroundQueue::Update call
+ 2. Other thing we should consider is group order in queue
+ */
+
+ // At first we need to compare free space in bg and our selection pool
+ int32 diffAli = aliFree - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount();
+ int32 diffHorde = hordeFree - m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount();
+ while( abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0) )
{
- // if it fits in, select it
- if(GetPlayerCount() + (*itr1)->Players.size() <= MaxPlayers)
+ //each cycle execution we need to kick at least 1 group
+ if (diffAli < diffHorde)
{
- EligibleGroups::iterator next = itr1;
- ++next;
- AddGroup((*itr1));
- if(GetPlayerCount() >= MinPlayers)
+ //kick alliance group, add to pool new group if needed
+ if (m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffHorde - diffAli))
{
- // enough players are selected
- return true;
+ for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); aliIndex++)
+ ++Ali_itr;
+ }
+ //if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break;
+ if (!m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
+ {
+ if (aliFree <= diffHorde + 1)
+ break;
+ m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffHorde - diffAli);
}
- // try building from the rest of the elig. groups
- // if that succeeds, return true
- if(Build(MinPlayers,MaxPlayers,next))
- return true;
- // the rest didn't succeed, so this group cannot be included
- RemoveGroup((*itr1));
}
+ else
+ {
+ //kick horde group, add to pool new group if needed
+ if (m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffAli - diffHorde))
+ {
+ for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); hordeIndex++)
+ ++Horde_itr;
+ }
+ if (!m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())
+ {
+ if (hordeFree <= diffAli + 1)
+ break;
+ m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde);
+ }
+ }
+ //count diffs after small update
+ diffAli = aliFree - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount();
+ diffHorde = hordeFree - m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount();
}
- // build didn't succeed
- return false;
}
-// this function is responsible for the selection of queued groups when trying to create new battlegrounds
-bool BattleGroundQueue::BuildSelectionPool(uint32 bgTypeId, uint32 queue_id, uint32 MinPlayers, uint32 MaxPlayers, SelectionPoolBuildMode mode, uint8 ArenaType, bool isRated, uint32 MinRating, uint32 MaxRating, uint32 DisregardTime, uint32 excludeTeam)
+// this method checks if premade versus premade battleground is possible
+// then after 30 mins (default) in queue it moves premade group to normal queue
+// it tries to invite as much players as it can - to MaxPlayersPerTeam, because premade groups have more than MinPlayersPerTeam players
+bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam)
{
- uint32 side;
- switch(mode)
- {
- case NORMAL_ALLIANCE:
- case ONESIDE_ALLIANCE_TEAM1:
- case ONESIDE_ALLIANCE_TEAM2:
- side = ALLIANCE;
- break;
- case NORMAL_HORDE:
- case ONESIDE_HORDE_TEAM1:
- case ONESIDE_HORDE_TEAM2:
- side = HORDE;
- break;
- default:
- //unknown mode, return false
- sLog.outDebug("Battleground: unknown selection pool build mode, returning...");
- return false;
- break;
- }
-
- // initiate the groups eligible to create the bg
- m_EligibleGroups.Init(&(m_QueuedGroups[queue_id]), bgTypeId, side, MaxPlayers, ArenaType, isRated, MinRating, MaxRating, DisregardTime, excludeTeam);
- // init the selected groups (clear)
- // and set m_CurrEligGroups pointer
- // we set it this way to only have one EligibleGroups object to save some memory
- m_SelectionPools[mode].Init(&m_EligibleGroups);
- // build succeeded
- if(m_SelectionPools[mode].Build(MinPlayers,MaxPlayers,m_EligibleGroups.begin()))
- {
- // the selection pool is set, return
- sLog.outDebug("Battleground-debug: pool build succeeded, return true");
- sLog.outDebug("Battleground-debug: Player size for mode %u is %u", mode, m_SelectionPools[mode].GetPlayerCount());
- for(std::list<GroupQueueInfo* >::iterator itr = m_SelectionPools[mode].SelectedGroups.begin(); itr != m_SelectionPools[mode].SelectedGroups.end(); ++itr)
+ //check match
+ if (!m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && !m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].empty())
+ {
+ //start premade match
+ //if groups aren't invited
+ GroupsQueueType::const_iterator ali_group, horde_group;
+ for( ali_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group)
+ if (!(*ali_group)->IsInvitedToBGInstanceGUID)
+ break;
+ for( horde_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].begin(); horde_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++horde_group)
+ if (!(*horde_group)->IsInvitedToBGInstanceGUID)
+ break;
+
+ if (ali_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end() && horde_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end())
{
- sLog.outDebug("Battleground-debug: queued group in selection with %u players",(*itr)->Players.size());
- for(std::map<uint64, PlayerQueueInfo * >::iterator itr2 = (*itr)->Players.begin(); itr2 != (*itr)->Players.end(); ++itr2)
- sLog.outDebug("Battleground-debug: player in above group GUID %u", (uint32)(itr2->first));
+ m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*ali_group), MaxPlayersPerTeam);
+ m_SelectionPools[BG_TEAM_HORDE].AddGroup((*horde_group), MaxPlayersPerTeam);
+ //add groups/players from normal queue to size of bigger group
+ uint32 maxPlayers = std::max(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
+ GroupsQueueType::const_iterator itr;
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ {
+ for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
+ {
+ //if itr can join BG and player count is less that maxPlayers, then add group to selectionpool
+ if (!(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers))
+ break;
+ }
+ }
+ //premade selection pools are set
+ return true;
+ }
+ }
+ // now check if we can move group from Premade queue to normal queue (timer has expired) or group size lowered!!
+ // this could be 2 cycles but i'm checking only first team in queue - it can cause problem -
+ // if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
+ // and when they click or after 80 seconds the queue info is removed from queue
+ uint32 time_before = getMSTime() - sWorld.getConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ {
+ if (!m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
+ {
+ GroupsQueueType::iterator itr = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].begin();
+ if (!(*itr)->IsInvitedToBGInstanceGUID && ((*itr)->JoinTime < time_before || (*itr)->Players.size() < MinPlayersPerTeam))
+ {
+ //we must insert group to normal queue and erase pointer from premade queue
+ m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].push_front((*itr));
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr);
+ }
}
- return true;
}
- // failed to build a selection pool matching the given values
+ //selection pools are not set
return false;
}
-// used to remove the Enter Battle window if the battle has already, but someone still has it
-// (this can happen in arenas mainly, since the preparation is shorter than the timer for the bgqueueremove event
-void BattleGroundQueue::BGEndedRemoveInvites(BattleGround *bg)
+// this method tries to create battleground or arena with MinPlayersPerTeam against MinPlayersPerTeam
+bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BGQueueIdBasedOnLevel queue_id, uint32 minPlayers, uint32 maxPlayers)
{
- uint32 queue_id = bg->GetQueueType();
- uint32 bgInstanceId = bg->GetInstanceID();
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
- QueuedGroupsList::iterator itr, next;
- for(itr = m_QueuedGroups[queue_id].begin(); itr != m_QueuedGroups[queue_id].end(); itr = next)
- {
- // must do this way, because the groupinfo will be deleted when all playerinfos are removed
- GroupQueueInfo * ginfo = (*itr);
- next = itr;
- ++next;
- // if group was invited to this bg instance, then remove all references
- if(ginfo->IsInvitedToBGInstanceGUID == bgInstanceId)
+ GroupsQueueType::const_iterator itr_team[BG_TEAMS_COUNT];
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ {
+ itr_team[i] = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin();
+ for(; itr_team[i] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++(itr_team[i]))
{
- // after removing this much playerinfos, the ginfo will be deleted, so we'll use a for loop
- uint32 to_remove = ginfo->Players.size();
- uint32 team = ginfo->Team;
- for(int i = 0; i < to_remove; ++i)
+ if (!(*(itr_team[i]))->IsInvitedToBGInstanceGUID)
{
- // always remove the first one in the group
- std::map<uint64, PlayerQueueInfo * >::iterator itr2 = ginfo->Players.begin();
- if(itr2 == ginfo->Players.end())
- {
- sLog.outError("Empty Players in ginfo, this should never happen!");
- return;
- }
+ m_SelectionPools[i].AddGroup(*(itr_team[i]), maxPlayers);
+ if (m_SelectionPools[i].GetPlayerCount() >= minPlayers)
+ break;
+ }
+ }
+ }
+ //try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg
+ uint32 j = BG_TEAM_ALLIANCE;
+ if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
+ j = BG_TEAM_HORDE;
+ if( sWorld.getConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0
+ && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers )
+ {
+ //we will try to invite more groups to team with less players indexed by j
+ ++(itr_team[j]); //this will not cause a crash, because for cycle above reached break;
+ for(; itr_team[j] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
+ {
+ if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID)
+ if (!m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % BG_TEAMS_COUNT].GetPlayerCount()))
+ break;
+ }
+ // do not allow to start bg with more than 2 players more on 1 faction
+ if (abs((int32)(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())) > 2)
+ return false;
+ }
+ //allow 1v0 if debug bg
+ if (sBattleGroundMgr.isTesting() && bg_template->isBattleGround() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()))
+ return true;
+ //return true if there are enough players in selection pools - enable to work .debug bg command correctly
+ return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers;
+}
- // get the player
- Player * plr = objmgr.GetPlayer(itr2->first);
- if(!plr)
- {
- sLog.outError("Player offline when trying to remove from GroupQueueInfo, this should never happen.");
- continue;
- }
+// this method will check if we can invite players to same faction skirmish match
+bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_id, uint32 minPlayersPerTeam)
+{
+ if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() < minPlayersPerTeam && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < minPlayersPerTeam)
+ return false;
+ uint32 teamIndex = BG_TEAM_ALLIANCE;
+ uint32 otherTeam = BG_TEAM_HORDE;
+ uint32 otherTeamId = HORDE;
+ if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() == minPlayersPerTeam )
+ {
+ teamIndex = BG_TEAM_HORDE;
+ otherTeam = BG_TEAM_ALLIANCE;
+ otherTeamId = ALLIANCE;
+ }
+ //clear other team's selection
+ m_SelectionPools[otherTeam].Init();
+ //store last ginfo pointer
+ GroupQueueInfo* ginfo = m_SelectionPools[teamIndex].SelectedGroups.back();
+ //set itr_team to group that was added to selection pool latest
+ GroupsQueueType::iterator itr_team = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].begin();
+ for(; itr_team != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team)
+ if (ginfo == *itr_team)
+ break;
+ if (itr_team == m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end())
+ return false;
+ GroupsQueueType::iterator itr_team2 = itr_team;
+ ++itr_team2;
+ //invite players to other selection pool
+ for(; itr_team2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team2)
+ {
+ //if selection pool is full then break;
+ if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam))
+ break;
+ }
+ if (m_SelectionPools[otherTeam].GetPlayerCount() != minPlayersPerTeam)
+ return false;
- // get the queueslot
- uint32 queueSlot = plr->GetBattleGroundQueueIndex(bgQueueTypeId);
- if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue
- {
- plr->RemoveBattleGroundQueueId(bgQueueTypeId);
- // remove player from queue, this might delete the ginfo as well! don't use that pointer after this!
- RemovePlayer(itr2->first, true);
- // this is probably unneeded, since this player was already invited -> does not fit when initing eligible groups
- // but updating the queue can't hurt
- Update(bgQueueTypeId, bg->GetQueueType());
- // send info to client
- WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, team, queueSlot, STATUS_NONE, 0, 0);
- plr->GetSession()->SendPacket(&data);
- }
+ //here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue
+ for(GroupsQueueType::iterator itr = m_SelectionPools[otherTeam].SelectedGroups.begin(); itr != m_SelectionPools[otherTeam].SelectedGroups.end(); ++itr)
+ {
+ //set correct team
+ (*itr)->Team = otherTeamId;
+ //add team to other queue
+ m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + otherTeam].push_front(*itr);
+ //remove team from old queue
+ GroupsQueueType::iterator itr2 = itr_team;
+ ++itr2;
+ for(; itr2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr2)
+ {
+ if (*itr2 == *itr)
+ {
+ m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].erase(itr2);
+ break;
}
}
}
+ return true;
}
/*
this method is called when group is inserted, or player / group is removed from BG Queue - there is only one player's status changed, so we don't use while(true) cycles to invite whole queue
it must be called after fully adding the members of a group to ensure group joining
-should be called after removeplayer functions in some cases
+should be called from BattleGround::RemovePlayer function in some cases
*/
-void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype, bool isRated, uint32 arenaRating)
+void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id, uint8 arenaType, bool isRated, uint32 arenaRating)
{
- if (queue_id >= MAX_BATTLEGROUND_QUEUES)
- {
- //this is error, that caused crashes (not in , but now it shouldn't)
- sLog.outError("BattleGroundQueue::Update() called for non existing queue type - this can cause crash, pls report problem, if this is the last line of error log before crash");
- return;
- }
-
- //if no players in queue ... do nothing
- if (m_QueuedGroups[queue_id].empty())
+ //if no players in queue - do nothing
+ if( m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].empty() &&
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].empty() &&
+ m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].empty() &&
+ m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].empty() )
return;
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bgTypeId, arenatype);
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenaType);
- //battleground with free slot for player should be always the last in this queue
+ //battleground with free slot for player should be always in the beggining of the queue
+ // maybe it would be better to create bgfreeslotqueue for each queue_id_based_on_level
BGFreeSlotQueueType::iterator itr, next;
for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next)
{
next = itr;
++next;
- // battleground is running, so if:
- // DO NOT allow queue manager to invite new player to running arena
- if ((*itr)->isBattleGround() && (*itr)->GetTypeID() == bgTypeId && (*itr)->GetQueueType() == queue_id && (*itr)->GetStatus() > STATUS_WAIT_QUEUE && (*itr)->GetStatus() < STATUS_WAIT_LEAVE)
+ // DO NOT allow queue manager to invite new player to arena
+ if( (*itr)->isBattleGround() && (*itr)->GetTypeID() == bgTypeId && (*itr)->GetQueueId() == queue_id &&
+ (*itr)->GetStatus() > STATUS_WAIT_QUEUE && (*itr)->GetStatus() < STATUS_WAIT_LEAVE )
{
- //we must check both teams
BattleGround* bg = *itr; //we have to store battleground pointer here, because when battleground is full, it is removed from free queue (not yet implemented!!)
// and iterator is invalid
- for(QueuedGroupsList::iterator itr = m_QueuedGroups[queue_id].begin(); itr != m_QueuedGroups[queue_id].end(); ++itr)
- {
- // did the group join for this bg type?
- if((*itr)->BgTypeId != bgTypeId)
- continue;
- // if so, check if fits in
- if(bg->GetFreeSlotsForTeam((*itr)->Team) >= (*itr)->Players.size())
- {
- // if group fits in, invite it
- InviteGroupToBG((*itr),bg,(*itr)->Team);
- }
- }
+ // clear selection pools
+ m_SelectionPools[BG_TEAM_ALLIANCE].Init();
+ m_SelectionPools[BG_TEAM_HORDE].Init();
+
+ // call a function that does the job for us
+ FillPlayersToBG(bg, queue_id);
+
+ // now everything is set, invite players
+ for(GroupsQueueType::const_iterator itr = m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.begin(); itr != m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.end(); ++itr)
+ InviteGroupToBG((*itr), bg, (*itr)->Team);
+ for(GroupsQueueType::const_iterator itr = m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.begin(); itr != m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.end(); ++itr)
+ InviteGroupToBG((*itr), bg, (*itr)->Team);
if (!bg->HasFreeSlots())
{
- //remove BG from BGFreeSlotQueue
+ // remove BG from BGFreeSlotQueue
bg->RemoveFromBGFreeSlotQueue();
}
}
@@ -523,25 +779,29 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype
// finished iterating through the bgs with free slots, maybe we need to create a new bg
BattleGround * bg_template = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
- if(!bg_template)
+ if (!bg_template)
{
sLog.outError("Battleground: Update: bg template not found for %u", bgTypeId);
return;
}
-
// get the min. players per team, properly for larger arenas as well. (must have full teams for arena matches!)
uint32 MinPlayersPerTeam = bg_template->GetMinPlayersPerTeam();
uint32 MaxPlayersPerTeam = bg_template->GetMaxPlayersPerTeam();
- if(bg_template->isArena())
+ if (sBattleGroundMgr.isTesting())
+ MinPlayersPerTeam = 1;
+ if (bg_template->isArena())
{
- if(sBattleGroundMgr.isArenaTesting())
+ if (sBattleGroundMgr.isArenaTesting())
{
MaxPlayersPerTeam = 1;
MinPlayersPerTeam = 1;
}
else
{
- switch(arenatype)
+ //this switch can be much shorter
+ MaxPlayersPerTeam = arenaType;
+ MinPlayersPerTeam = arenaType;
+ /*switch(arenaType)
{
case ARENA_TYPE_2v2:
MaxPlayersPerTeam = 2;
@@ -555,293 +815,192 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype
MaxPlayersPerTeam = 5;
MinPlayersPerTeam = 5;
break;
- }
+ }*/
}
}
- // found out the minimum and maximum ratings the newly added team should battle against
- // arenaRating is the rating of the latest joined team
- uint32 arenaMinRating = (arenaRating <= sBattleGroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattleGroundMgr.GetMaxRatingDifference();
- // if no rating is specified, set maxrating to 0
- uint32 arenaMaxRating = (arenaRating == 0)? 0 : arenaRating + sBattleGroundMgr.GetMaxRatingDifference();
- uint32 discardTime = 0;
- // if max rating difference is set and the time past since server startup is greater than the rating discard time
- // (after what time the ratings aren't taken into account when making teams) then
- // the discard time is current_time - time_to_discard, teams that joined after that, will have their ratings taken into account
- // else leave the discard time on 0, this way all ratings will be discarded
- if(sBattleGroundMgr.GetMaxRatingDifference() && getMSTime() >= sBattleGroundMgr.GetRatingDiscardTimer())
- discardTime = getMSTime() - sBattleGroundMgr.GetRatingDiscardTimer();
-
- // try to build the selection pools
- bool bAllyOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_ALLIANCE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
- if(bAllyOK)
- sLog.outDebug("Battleground: ally pool successfully built");
- else
- sLog.outDebug("Battleground: ally pool wasn't created");
- bool bHordeOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_HORDE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
- if(bHordeOK)
- sLog.outDebug("Battleground: horde pool successfully built");
- else
- sLog.outDebug("Battleground: horde pool wasn't created");
+ m_SelectionPools[BG_TEAM_ALLIANCE].Init();
+ m_SelectionPools[BG_TEAM_HORDE].Init();
- // if selection pools are ready, create the new bg
- if (bAllyOK && bHordeOK)
+ if (bg_template->isBattleGround())
{
- BattleGround * bg2 = 0;
- // special handling for arenas
- if(bg_template->isArena())
+ //check if there is premade against premade match
+ if (CheckPremadeMatch(queue_id, MinPlayersPerTeam, MaxPlayersPerTeam))
{
- // Find a random arena, that can be created
- uint8 arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL};
- uint32 arena_num = urand(0,2);
- if( !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[arena_num%3])) &&
- !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[(arena_num+1)%3])) &&
- !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[(arena_num+2)%3])) )
+ //create new battleground
+ BattleGround * bg2 = NULL;
+ if (!(bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, queue_id, 0, false)))
{
- sLog.outError("Battleground: couldn't create any arena instance!");
+ sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return;
}
-
- // set the MaxPlayersPerTeam values based on arenatype
- // setting the min player values isn't needed, since we won't be using that value later on.
- if(sBattleGroundMgr.isArenaTesting())
- {
- bg2->SetMaxPlayersPerTeam(1);
- bg2->SetMaxPlayers(2);
- }
- else
- {
- switch(arenatype)
- {
- case ARENA_TYPE_2v2:
- bg2->SetMaxPlayersPerTeam(2);
- bg2->SetMaxPlayers(4);
- break;
- case ARENA_TYPE_3v3:
- bg2->SetMaxPlayersPerTeam(3);
- bg2->SetMaxPlayers(6);
- break;
- case ARENA_TYPE_5v5:
- bg2->SetMaxPlayersPerTeam(5);
- bg2->SetMaxPlayers(10);
- break;
- default:
- break;
- }
- }
- }
- else
- {
- // create new battleground
- bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId);
- }
-
- if(!bg2)
- {
- sLog.outError("Battleground: couldn't create bg %u",bgTypeId);
- return;
- }
-
- // start the joining of the bg
- bg2->SetStatus(STATUS_WAIT_JOIN);
- bg2->SetQueueType(queue_id);
- // initialize arena / rating info
- bg2->SetArenaType(arenatype);
- // set rating
- bg2->SetRated(isRated);
-
- std::list<GroupQueueInfo* >::iterator itr;
-
- // Send amount of invites based on the difference between the sizes of the two faction's queues
- uint32 QUEUED_HORDE = m_SelectionPools[NORMAL_HORDE].SelectedGroups.size();
- uint32 QUEUED_ALLIANCE = m_SelectionPools[NORMAL_ALLIANCE].SelectedGroups.size();
- uint16 maxbginvites = 0;
-
- if(QUEUED_ALLIANCE <= QUEUED_HORDE)
- maxbginvites = QUEUED_ALLIANCE;
- else
- maxbginvites = QUEUED_HORDE;
-
- // invite groups from horde selection pool
- uint16 invitecounter = 0;
- for(itr = m_SelectionPools[NORMAL_HORDE].SelectedGroups.begin(); itr != m_SelectionPools[NORMAL_HORDE].SelectedGroups.end(); ++itr)
- {
- if (invitecounter >= maxbginvites)
- return;
- InviteGroupToBG((*itr),bg2,HORDE);
- ++invitecounter;
- }
-
- // invite groups from ally selection pool
- invitecounter = 0;
- for(itr = m_SelectionPools[NORMAL_ALLIANCE].SelectedGroups.begin(); itr != m_SelectionPools[NORMAL_ALLIANCE].SelectedGroups.end(); ++itr)
- {
- if (invitecounter >= maxbginvites)
- return;
- InviteGroupToBG((*itr),bg2,ALLIANCE);
- ++invitecounter;
- }
-
- if (isRated)
- {
- std::list<GroupQueueInfo* >::iterator itr_alliance = m_SelectionPools[NORMAL_ALLIANCE].SelectedGroups.begin();
- std::list<GroupQueueInfo* >::iterator itr_horde = m_SelectionPools[NORMAL_HORDE].SelectedGroups.begin();
- (*itr_alliance)->OpponentsTeamRating = (*itr_horde)->ArenaTeamRating;
- sLog.outDebug("setting opposite team rating for team %u to %u", (*itr_alliance)->ArenaTeamId, (*itr_alliance)->OpponentsTeamRating);
- (*itr_horde)->OpponentsTeamRating = (*itr_alliance)->ArenaTeamRating;
- sLog.outDebug("setting opposite team rating for team %u to %u", (*itr_horde)->ArenaTeamId, (*itr_horde)->OpponentsTeamRating);
+ //invite those selection pools
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for(GroupsQueueType::const_iterator itr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); itr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++itr)
+ InviteGroupToBG((*itr), bg2, (*itr)->Team);
+ //start bg
+ bg2->StartBattleGround();
+ //clear structures
+ m_SelectionPools[BG_TEAM_ALLIANCE].Init();
+ m_SelectionPools[BG_TEAM_HORDE].Init();
}
-
- // start the battleground
- bg2->StartBattleGround();
}
- // there weren't enough players for a "normal" match
- // if arena, enable horde versus horde or alliance versus alliance teams here
-
- else if(bg_template->isArena())
+ // now check if there are in queues enough players to start new game of (normal battleground, or non-rated arena)
+ if (!isRated)
{
- bool bOneSideHordeTeam1 = false, bOneSideHordeTeam2 = false;
- bool bOneSideAllyTeam1 = false, bOneSideAllyTeam2 = false;
- bOneSideHordeTeam1 = BuildSelectionPool(bgTypeId, queue_id,MaxPlayersPerTeam,MaxPlayersPerTeam,ONESIDE_HORDE_TEAM1,arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
- if(bOneSideHordeTeam1)
- {
- // one team has been selected, find out if other can be selected too
- std::list<GroupQueueInfo* >::iterator itr;
- // temporarily change the team side to enable building the next pool excluding the already selected groups
- for(itr = m_SelectionPools[ONESIDE_HORDE_TEAM1].SelectedGroups.begin(); itr != m_SelectionPools[ONESIDE_HORDE_TEAM1].SelectedGroups.end(); ++itr)
- (*itr)->Team=ALLIANCE;
-
- bOneSideHordeTeam2 = BuildSelectionPool(bgTypeId, queue_id,MaxPlayersPerTeam,MaxPlayersPerTeam,ONESIDE_HORDE_TEAM2,arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime, (*(m_SelectionPools[ONESIDE_HORDE_TEAM1].SelectedGroups.begin()))->ArenaTeamId);
-
- // change back the team to horde
- for(itr = m_SelectionPools[ONESIDE_HORDE_TEAM1].SelectedGroups.begin(); itr != m_SelectionPools[ONESIDE_HORDE_TEAM1].SelectedGroups.end(); ++itr)
- (*itr)->Team=HORDE;
-
- if(!bOneSideHordeTeam2)
- bOneSideHordeTeam1 = false;
- }
- if(!bOneSideHordeTeam1)
+ // if there are enough players in pools, start new battleground or non rated arena
+ if (CheckNormalMatch(bg_template, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam)
+ || (bg_template->isArena() && CheckSkirmishForSameFaction(queue_id, MinPlayersPerTeam)) )
{
- // check for one sided ally
- bOneSideAllyTeam1 = BuildSelectionPool(bgTypeId, queue_id,MaxPlayersPerTeam,MaxPlayersPerTeam,ONESIDE_ALLIANCE_TEAM1,arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime);
- if(bOneSideAllyTeam1)
+ // we successfully created a pool
+ BattleGround * bg2 = NULL;
+ if (!(bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, queue_id, arenaType, false)))
{
- // one team has been selected, find out if other can be selected too
- std::list<GroupQueueInfo* >::iterator itr;
- // temporarily change the team side to enable building the next pool excluding the already selected groups
- for(itr = m_SelectionPools[ONESIDE_ALLIANCE_TEAM1].SelectedGroups.begin(); itr != m_SelectionPools[ONESIDE_ALLIANCE_TEAM1].SelectedGroups.end(); ++itr)
- (*itr)->Team=HORDE;
-
- bOneSideAllyTeam2 = BuildSelectionPool(bgTypeId, queue_id,MaxPlayersPerTeam,MaxPlayersPerTeam,ONESIDE_ALLIANCE_TEAM2,arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime,(*(m_SelectionPools[ONESIDE_ALLIANCE_TEAM1].SelectedGroups.begin()))->ArenaTeamId);
-
- // change back the team to ally
- for(itr = m_SelectionPools[ONESIDE_ALLIANCE_TEAM1].SelectedGroups.begin(); itr != m_SelectionPools[ONESIDE_ALLIANCE_TEAM1].SelectedGroups.end(); ++itr)
- (*itr)->Team=ALLIANCE;
+ sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId);
+ return;
}
- if(!bOneSideAllyTeam2)
- bOneSideAllyTeam1 = false;
+ // invite those selection pools
+ for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for(GroupsQueueType::const_iterator itr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); itr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++itr)
+ InviteGroupToBG((*itr), bg2, (*itr)->Team);
+ // start bg
+ bg2->StartBattleGround();
}
- // 1-sided BuildSelectionPool() will work, because the MinPlayersPerTeam == MaxPlayersPerTeam in every arena!!!!
- if( (bOneSideHordeTeam1 && bOneSideHordeTeam2) ||
- (bOneSideAllyTeam1 && bOneSideAllyTeam2) )
+ }
+ else if (bg_template->isArena())
+ {
+ // found out the minimum and maximum ratings the newly added team should battle against
+ // arenaRating is the rating of the latest joined team, or 0
+ // 0 is on (automatic update call) and we must set it to team's with longest wait time
+ if (!arenaRating )
{
- // which side has enough players?
- uint32 side = 0;
- SelectionPoolBuildMode mode1, mode2;
- // find out what pools are we using
- if(bOneSideAllyTeam1 && bOneSideAllyTeam2)
+ GroupQueueInfo* front1 = NULL;
+ GroupQueueInfo* front2 = NULL;
+ if (!m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].empty())
{
- side = ALLIANCE;
- mode1 = ONESIDE_ALLIANCE_TEAM1;
- mode2 = ONESIDE_ALLIANCE_TEAM2;
+ front1 = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].front();
+ arenaRating = front1->ArenaTeamRating;
}
- else
+ if (!m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].empty())
{
- side = HORDE;
- mode1 = ONESIDE_HORDE_TEAM1;
- mode2 = ONESIDE_HORDE_TEAM2;
+ front2 = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].front();
+ arenaRating = front2->ArenaTeamRating;
}
-
- // create random arena
- uint8 arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL};
- uint32 arena_num = urand(0,2);
- BattleGround* bg2 = NULL;
- if( !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[arena_num%3])) &&
- !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[(arena_num+1)%3])) &&
- !(bg2 = sBattleGroundMgr.CreateNewBattleGround(arenas[(arena_num+2)%3])) )
+ if (front1 && front2)
{
- sLog.outError("Could not create arena.");
- return;
+ if (front1->JoinTime < front2->JoinTime)
+ arenaRating = front1->ArenaTeamRating;
}
+ else if (!front1 && !front2)
+ return; //queues are empty
+ }
+
+ //set rating range
+ uint32 arenaMinRating = (arenaRating <= sBattleGroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattleGroundMgr.GetMaxRatingDifference();
+ uint32 arenaMaxRating = arenaRating + sBattleGroundMgr.GetMaxRatingDifference();
+ // if max rating difference is set and the time past since server startup is greater than the rating discard time
+ // (after what time the ratings aren't taken into account when making teams) then
+ // the discard time is current_time - time_to_discard, teams that joined after that, will have their ratings taken into account
+ // else leave the discard time on 0, this way all ratings will be discarded
+ uint32 discardTime = getMSTime() - sBattleGroundMgr.GetRatingDiscardTimer();
+
+ // we need to find 2 teams which will play next game
- sLog.outDebug("Battleground: One-faction arena created.");
- // init stats
- if(sBattleGroundMgr.isArenaTesting())
+ GroupsQueueType::iterator itr_team[BG_TEAMS_COUNT];
+
+ //optimalization : --- we dont need to use selection_pools - each update we select max 2 groups
+
+ for(uint32 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; i++)
+ {
+ // take the group that joined first
+ itr_team[i] = m_QueuedGroups[queue_id][i].begin();
+ for(; itr_team[i] != m_QueuedGroups[queue_id][i].end(); ++(itr_team[i]))
{
- bg2->SetMaxPlayersPerTeam(1);
- bg2->SetMaxPlayers(2);
+ // if group match conditions, then add it to pool
+ if( !(*itr_team[i])->IsInvitedToBGInstanceGUID
+ && (((*itr_team[i])->ArenaTeamRating >= arenaMinRating && (*itr_team[i])->ArenaTeamRating <= arenaMaxRating)
+ || (*itr_team[i])->JoinTime < discardTime) )
+ {
+ m_SelectionPools[i].AddGroup((*itr_team[i]), MaxPlayersPerTeam);
+ // break for cycle to be able to start selecting another group from same faction queue
+ break;
+ }
}
- else
+ }
+ // now we are done if we have 2 groups - ali vs horde!
+ // if we don't have, we must try to continue search in same queue
+ // tmp variables are correctly set
+ // this code isn't much userfriendly - but it is supposed to continue search for mathing group in HORDE queue
+ if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() == 0 && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())
+ {
+ itr_team[BG_TEAM_ALLIANCE] = itr_team[BG_TEAM_HORDE];
+ ++itr_team[BG_TEAM_ALLIANCE];
+ for(; itr_team[BG_TEAM_ALLIANCE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++(itr_team[BG_TEAM_ALLIANCE]))
{
- switch(arenatype)
+ if( !(*itr_team[BG_TEAM_ALLIANCE])->IsInvitedToBGInstanceGUID
+ && (((*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating <= arenaMaxRating)
+ || (*itr_team[BG_TEAM_ALLIANCE])->JoinTime < discardTime) )
{
- case ARENA_TYPE_2v2:
- bg2->SetMaxPlayersPerTeam(2);
- bg2->SetMaxPlayers(4);
+ m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*itr_team[BG_TEAM_ALLIANCE]), MaxPlayersPerTeam);
break;
- case ARENA_TYPE_3v3:
- bg2->SetMaxPlayersPerTeam(3);
- bg2->SetMaxPlayers(6);
- break;
- case ARENA_TYPE_5v5:
- bg2->SetMaxPlayersPerTeam(5);
- bg2->SetMaxPlayers(10);
- break;
- default:
+ }
+ }
+ }
+ // this code isn't much userfriendly - but it is supposed to continue search for mathing group in ALLIANCE queue
+ if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() == 0 && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
+ {
+ itr_team[BG_TEAM_HORDE] = itr_team[BG_TEAM_ALLIANCE];
+ ++itr_team[BG_TEAM_HORDE];
+ for(; itr_team[BG_TEAM_HORDE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++(itr_team[BG_TEAM_HORDE]))
+ {
+ if( !(*itr_team[BG_TEAM_HORDE])->IsInvitedToBGInstanceGUID
+ && (((*itr_team[BG_TEAM_HORDE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_HORDE])->ArenaTeamRating <= arenaMaxRating)
+ || (*itr_team[BG_TEAM_HORDE])->JoinTime < discardTime) )
+ {
+ m_SelectionPools[BG_TEAM_HORDE].AddGroup((*itr_team[BG_TEAM_HORDE]), MaxPlayersPerTeam);
break;
}
}
+ }
- bg2->SetRated(isRated);
-
- // assigned team of the other group
- uint32 other_side;
- if(side == ALLIANCE)
- other_side = HORDE;
- else
- other_side = ALLIANCE;
-
- // start the joining of the bg
- bg2->SetStatus(STATUS_WAIT_JOIN);
- bg2->SetQueueType(queue_id);
- // initialize arena / rating info
- bg2->SetArenaType(arenatype);
-
- std::list<GroupQueueInfo* >::iterator itr;
-
- // invite players from the first group as horde players (actually green team)
- for(itr = m_SelectionPools[mode1].SelectedGroups.begin(); itr != m_SelectionPools[mode1].SelectedGroups.end(); ++itr)
+ //if we have 2 teams, then start new arena and invite players!
+ if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())
+ {
+ BattleGround* arena = NULL;
+ if (!(arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, queue_id, arenaType, true)))
{
- InviteGroupToBG((*itr),bg2,HORDE);
+ sLog.outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
+ return;
}
- // invite players from the second group as ally players (actually gold team)
- for(itr = m_SelectionPools[mode2].SelectedGroups.begin(); itr != m_SelectionPools[mode2].SelectedGroups.end(); ++itr)
+ (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamRating;
+ sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating);
+ (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamRating;
+ sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating);
+ // now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer
+ if ((*(itr_team[BG_TEAM_ALLIANCE]))->Team != ALLIANCE)
{
- InviteGroupToBG((*itr),bg2,ALLIANCE);
+ // add to alliance queue
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].push_front(*(itr_team[BG_TEAM_ALLIANCE]));
+ // erase from horde queue
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].erase(itr_team[BG_TEAM_ALLIANCE]);
+ itr_team[BG_TEAM_ALLIANCE] = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].begin();
}
-
- if (isRated)
+ if ((*(itr_team[BG_TEAM_HORDE]))->Team != HORDE)
{
- std::list<GroupQueueInfo* >::iterator itr_alliance = m_SelectionPools[mode1].SelectedGroups.begin();
- std::list<GroupQueueInfo* >::iterator itr_horde = m_SelectionPools[mode2].SelectedGroups.begin();
- (*itr_alliance)->OpponentsTeamRating = (*itr_horde)->ArenaTeamRating;
- (*itr_horde)->OpponentsTeamRating = (*itr_alliance)->ArenaTeamRating;
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].push_front(*(itr_team[BG_TEAM_HORDE]));
+ m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].erase(itr_team[BG_TEAM_HORDE]);
+ itr_team[BG_TEAM_HORDE] = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].begin();
}
- bg2->StartBattleGround();
+ InviteGroupToBG(*(itr_team[BG_TEAM_ALLIANCE]), arena, ALLIANCE);
+ InviteGroupToBG(*(itr_team[BG_TEAM_HORDE]), arena, HORDE);
+
+ sLog.outDebug("Starting rated arena match!");
+
+ arena->StartBattleGround();
}
}
}
@@ -853,36 +1012,29 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype
bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
Player* plr = objmgr.GetPlayer( m_PlayerGuid );
-
// player logged off (we should do nothing, he is correctly removed from queue in another procedure)
if (!plr)
return true;
- // Player can be in another BG queue and must be removed in normal way in any case
- // // player is already in battleground ... do nothing (battleground queue status is deleted when player is teleported to BG)
- // if (plr->GetBattleGroundId() > 0)
- // return true;
-
- BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID);
+ BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId);
+ //if battleground ended and its instance deleted - do nothing
if (!bg)
return true;
- uint32 queueSlot = plr->GetBattleGroundQueueIndex(bg->GetTypeID());
- if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue
+ BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
+ uint32 queueSlot = plr->GetBattleGroundQueueIndex(bgQueueTypeId);
+ if( queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES ) // player is in queue or in battleground
{
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
- uint32 queueSlot = plr->GetBattleGroundQueueIndex(bgQueueTypeId);
- if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue
+ // check if player is invited to this bg
+ BattleGroundQueue::QueuedPlayersMap const& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers;
+ BattleGroundQueue::QueuedPlayersMap::const_iterator qItr = qpMap.find(m_PlayerGuid);
+ if( qItr != qpMap.end() && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID
+ && qItr->second.GroupInfo->RemoveInviteTime == m_RemoveTime )
{
- // check if player is invited to this bg ... this check must be here, because when player leaves queue and joins another, it would cause a problems
- BattleGroundQueue::QueuedPlayersMap const& qpMap = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[plr->GetBattleGroundQueueIdFromLevel()];
- BattleGroundQueue::QueuedPlayersMap::const_iterator qItr = qpMap.find(m_PlayerGuid);
- if (qItr != qpMap.end() && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID)
- {
- WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, qItr->second.GroupInfo->Team, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME/2, 0);
- plr->GetSession()->SendPacket(&data);
- }
+ WorldPacket data;
+ //we must send remaining time in queue
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, qItr->second.GroupInfo->ArenaType);
+ plr->GetSession()->SendPacket(&data);
}
}
return true; //event will be deleted
@@ -890,10 +1042,18 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
void BGQueueInviteEvent::Abort(uint64 /*e_time*/)
{
- //this should not be called
- sLog.outError("Battleground invite event ABORTED!");
+ //do nothing
}
+/*
+ this event has many possibilities when it is executed:
+ 1. player is in battleground ( he clicked enter on invitation window )
+ 2. player left battleground queue and he isn't there any more
+ 3. player left battleground queue and he joined it again and IsInvitedToBGInstanceGUID = 0
+ 4. player left queue and he joined again and he has been invited to same battleground again -> we should not remove him from queue yet
+ 5. player is invited to bg and he didn't choose what to do and timer expired - only in this condition we should call queue::RemovePlayer
+ we must remove player in the 5. case even if battleground object doesn't exist!
+*/
bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
Player* plr = objmgr.GetPlayer( m_PlayerGuid );
@@ -901,40 +1061,33 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
// player logged off (we should do nothing, he is correctly removed from queue in another procedure)
return true;
- BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID);
- if (!bg)
- return true;
+ BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId);
+ //battleground can be deleted already when we are removing queue info
+ //bg pointer can be NULL! so use it carefully!
- sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
-
- uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(bg->GetTypeID(), bg->GetArenaType());
- uint32 queueSlot = plr->GetBattleGroundQueueIndex(bgQueueTypeId);
- if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue
+ uint32 queueSlot = plr->GetBattleGroundQueueIndex(m_BgQueueTypeId);
+ if( queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES ) // player is in queue, or in Battleground
{
- // check if player is invited to this bg ... this check must be here, because when player leaves queue and joins another, it would cause a problems
- BattleGroundQueue::QueuedPlayersMap::iterator qMapItr = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[plr->GetBattleGroundQueueIdFromLevel()].find(m_PlayerGuid);
- if (qMapItr != sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].m_QueuedPlayers[plr->GetBattleGroundQueueIdFromLevel()].end() && qMapItr->second.GroupInfo && qMapItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID)
+ // check if player is in queue for this BG and if we are removing his invite event
+ BattleGroundQueue::QueuedPlayersMap& qpMap = sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId].m_QueuedPlayers;
+ BattleGroundQueue::QueuedPlayersMap::iterator qMapItr = qpMap.find(m_PlayerGuid);
+ if( qMapItr != qpMap.end() && qMapItr->second.GroupInfo
+ && qMapItr->second.GroupInfo->IsInvitedToBGInstanceGUID == m_BgInstanceGUID
+ && qMapItr->second.GroupInfo->RemoveInviteTime == m_RemoveTime )
{
- if (qMapItr->second.GroupInfo->IsRated)
- {
- ArenaTeam * at = objmgr.GetArenaTeamById(qMapItr->second.GroupInfo->ArenaTeamId);
- if (at)
- {
- sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(plr->GetGUID()), qMapItr->second.GroupInfo->OpponentsTeamRating);
- at->MemberLost(plr, qMapItr->second.GroupInfo->OpponentsTeamRating);
- at->SaveToDB();
- }
- }
- plr->RemoveBattleGroundQueueId(bgQueueTypeId);
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].RemovePlayer(m_PlayerGuid, true);
- sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId].Update(bgQueueTypeId, bg->GetQueueType());
+ sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
+
+ plr->RemoveBattleGroundQueueId(m_BgQueueTypeId);
+ sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId].RemovePlayer(m_PlayerGuid, true);
+ //update queues if battleground isn't ended
+ if (bg)
+ sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId].Update(m_BgTypeId, bg->GetQueueId());
+
WorldPacket data;
- sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, m_PlayersTeam, queueSlot, STATUS_NONE, 0, 0);
+ sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0);
plr->GetSession()->SendPacket(&data);
}
}
- else
- sLog.outDebug("Battleground: Player was already removed from queue");
//event will be deleted
return true;
@@ -942,76 +1095,98 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
{
- //this should not be called
- sLog.outError("Battleground remove event ABORTED!");
+ //do nothing
}
/*********************************************************/
/*** BATTLEGROUND MANAGER ***/
/*********************************************************/
-BattleGroundMgr::BattleGroundMgr()
+BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTesting(false)
{
- m_BattleGrounds.clear();
- m_AutoDistributePoints = (bool)sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS);
- m_MaxRatingDifference = sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
- m_RatingDiscardTimer = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
- m_PrematureFinishTimer = sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
- m_NextRatingDiscardUpdate = m_RatingDiscardTimer;
- m_AutoDistributionTimeChecker = 0;
- m_ArenaTesting = false;
+ for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
+ m_BattleGrounds[i].clear();
+ m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+ m_Testing=false;
}
BattleGroundMgr::~BattleGroundMgr()
{
- BattleGroundSet::iterator itr, next;
- for(itr = m_BattleGrounds.begin(); itr != m_BattleGrounds.end(); itr = next)
+ DeleteAllBattleGrounds();
+}
+
+void BattleGroundMgr::DeleteAllBattleGrounds()
+{
+ for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
{
- next = itr;
- ++next;
- BattleGround * bg = itr->second;
- m_BattleGrounds.erase(itr);
- delete bg;
+ for(BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end();)
+ {
+ BattleGround * bg = itr->second;
+ m_BattleGrounds[i].erase(itr++);
+ if (!m_ClientBattleGroundIds[i][bg->GetQueueId()].empty())
+ m_ClientBattleGroundIds[i][bg->GetQueueId()].erase(bg->GetClientInstanceID());
+ delete bg;
+ }
+ }
+
+ // destroy template battlegrounds that listed only in queues (other already terminated)
+ for(uint32 bgTypeId = 0; bgTypeId < MAX_BATTLEGROUND_TYPE_ID; ++bgTypeId)
+ {
+ // ~BattleGround call unregistring BG from queue
+ while(!BGFreeSlotQueue[bgTypeId].empty())
+ delete BGFreeSlotQueue[bgTypeId].front();
}
- m_BattleGrounds.clear();
}
// used to update running battlegrounds, and delete finished ones
-void BattleGroundMgr::Update(time_t diff)
+void BattleGroundMgr::Update(uint32 diff)
{
BattleGroundSet::iterator itr, next;
- for(itr = m_BattleGrounds.begin(); itr != m_BattleGrounds.end(); itr = next)
+ for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
{
- next = itr;
- ++next;
- itr->second->Update(diff);
- // use the SetDeleteThis variable
- // direct deletion caused crashes
- if(itr->second->m_SetDeleteThis)
+ itr = m_BattleGrounds[i].begin();
+ // skip updating battleground template
+ if (itr != m_BattleGrounds[i].end())
+ ++itr;
+ for(; itr != m_BattleGrounds[i].end(); itr = next)
{
- BattleGround * bg = itr->second;
- m_BattleGrounds.erase(itr);
- delete bg;
+ next = itr;
+ ++next;
+ itr->second->Update(diff);
+ // use the SetDeleteThis variable
+ // direct deletion caused crashes
+ if (itr->second->m_SetDeleteThis)
+ {
+ BattleGround * bg = itr->second;
+ m_BattleGrounds[i].erase(itr);
+ if (!m_ClientBattleGroundIds[i][bg->GetQueueId()].empty())
+ m_ClientBattleGroundIds[i][bg->GetQueueId()].erase(bg->GetClientInstanceID());
+ delete bg;
+ }
}
}
// if rating difference counts, maybe force-update queues
- if(m_MaxRatingDifference)
+ if (sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
{
// it's time to force update
- if(m_NextRatingDiscardUpdate < diff)
+ if (m_NextRatingDiscardUpdate < diff)
{
// forced update for level 70 rated arenas
- m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA,6,ARENA_TYPE_2v2,true,0);
- m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA,6,ARENA_TYPE_3v3,true,0);
- m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA,6,ARENA_TYPE_5v5,true,0);
- m_NextRatingDiscardUpdate = m_RatingDiscardTimer;
+ sLog.outDebug("BattleGroundMgr: UPDATING ARENA QUEUES");
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_79, ARENA_TYPE_2v2, true, 0);
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_2v2].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_80, ARENA_TYPE_2v2, true, 0);
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_79, ARENA_TYPE_3v3, true, 0);
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_3v3].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_80, ARENA_TYPE_3v3, true, 0);
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_79, ARENA_TYPE_5v5, true, 0);
+ m_BattleGroundQueues[BATTLEGROUND_QUEUE_5v5].Update(BATTLEGROUND_AA, QUEUE_ID_MAX_LEVEL_80, ARENA_TYPE_5v5, true, 0);
+ m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
}
else
m_NextRatingDiscardUpdate -= diff;
}
- if(m_AutoDistributePoints)
+ if (sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
{
- if(m_AutoDistributionTimeChecker < diff)
+ if (m_AutoDistributionTimeChecker < diff)
{
if(time(NULL) > m_NextAutoDistributionTime)
{
@@ -1026,10 +1201,11 @@ void BattleGroundMgr::Update(time_t diff)
}
}
-void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint32 team, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint32 arenatype, uint8 israted)
+void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype)
{
// we can be in 3 queues in same time...
- if(StatusID == 0)
+
+ if (StatusID == 0 || !bg)
{
data->Initialize(SMSG_BATTLEFIELD_STATUS, 4*3);
*data << uint32(QueueSlot); // queue id (0...2)
@@ -1040,10 +1216,11 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
data->Initialize(SMSG_BATTLEFIELD_STATUS, (4+1+1+4+2+4+1+4+4+4));
*data << uint32(QueueSlot); // queue id (0...2) - player can be in 3 queues in time
// uint64 in client
- *data << uint64( uint64(arenatype ? arenatype : bg->GetArenaType()) | (uint64(0x0D) << 8) | (uint64(bg->GetTypeID()) << 16) | (uint64(0x1F90) << 48) );
- *data << uint32(0); // unknown
+ *data << uint64( uint64(arenatype) | (uint64(0x0D) << 8) | (uint64(bg->GetTypeID()) << 16) | (uint64(0x1F90) << 48) );
+ *data << uint32(bg->GetClientInstanceID());
// alliance/horde for BG and skirmish/rated for Arenas
- *data << uint8(bg->isArena() ? ( israted ? israted : bg->isRated() ) : bg->GetTeamIndexByTeamId(team));
+ // following displays the minimap-icon 0 = faction icon 1 = arenaicon
+ *data << uint8(bg->isRated());
/* *data << uint8(arenatype ? arenatype : bg->GetArenaType()); // team type (0=BG, 2=2x2, 3=3x3, 5=5x5), for arenas // NOT PROPER VALUE IF ARENA ISN'T RUNNING YET!!!!
switch(bg->GetTypeID()) // value depends on bg id
{
@@ -1071,12 +1248,21 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
case BATTLEGROUND_RL:
*data << uint8(8);
break;
+ case BATTLEGROUND_SA:
+ *data << uint8(9);
+ break;
+ case BATTLEGROUND_DS:
+ *data << uint8(10);
+ break;
+ case BATTLEGROUND_RV:
+ *data << uint8(11);
+ break;
default: // unknown
*data << uint8(0);
break;
}
- if(bg->isArena() && (StatusID == STATUS_WAIT_QUEUE))
+ if (bg->isArena() && (StatusID == STATUS_WAIT_QUEUE))
*data << uint32(BATTLEGROUND_AA); // all arenas I don't think so.
else
*data << uint32(bg->GetTypeID()); // BG id from DBC
@@ -1084,17 +1270,14 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
*data << uint16(0x1F90); // unk value 8080
*data << uint32(bg->GetInstanceID()); // instance id
- if(bg->isBattleGround())
- *data << uint8(bg->GetTeamIndexByTeamId(team)); // team
- else
- *data << uint8(israted?israted:bg->isRated()); // is rated battle
+ *data << uint8(bg->isArena()); // minimap-icon 0=faction 1=arena
*/
*data << uint32(StatusID); // status
switch(StatusID)
{
case STATUS_WAIT_QUEUE: // status_in_queue
*data << uint32(Time1); // average wait time, milliseconds
- *data << uint32(Time2); // time in queue, updated every minute?
+ *data << uint32(Time2); // time in queue, updated every minute!, milliseconds
break;
case STATUS_WAIT_JOIN: // status_invite
*data << uint32(bg->GetMapId()); // map id
@@ -1102,7 +1285,7 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
break;
case STATUS_IN_PROGRESS: // status_in_progress
*data << uint32(bg->GetMapId()); // map id
- *data << uint32(Time1); // 0 at bg start, 120000 after bg end, time to bg auto leave, milliseconds
+ *data << uint32(Time1); // time to bg auto leave, 0 at bg start, 120000 after bg end, milliseconds
*data << uint32(Time2); // time from bg start, milliseconds
*data << uint8(0x1); // unk sometimes 0x0!
break;
@@ -1115,16 +1298,16 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
{
uint8 type = (bg->isArena() ? 1 : 0);
- // last check on 2.4.1
+ // last check on 3.0.3
data->Initialize(MSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize()));
- *data << uint8(type); // seems to be type (battleground=0/arena=1)
+ *data << uint8(type); // type (battleground=0/arena=1)
if(type) // arena
{
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
for(int i = 1; i >= 0; --i)
{
- *data << uint32(3000-bg->m_ArenaTeamRatingChanges[i]); // rating change: showed value - 3000
+ *data << uint32(bg->m_ArenaTeamRatingChanges[i]);
*data << uint32(3999); // huge thanks for TOM_RUS for this!
sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
}
@@ -1132,16 +1315,16 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
{
uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
- if(at)
+ if (at)
*data << at->GetName();
- else//*/
+ else
*data << (uint8)0;
}
}
- if(bg->GetWinner() == 2)
+ if (bg->GetStatus() != STATUS_WAIT_LEAVE)
{
- *data << uint8(0); // bg in progress
+ *data << uint8(0); // bg not ended
}
else
{
@@ -1155,10 +1338,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
{
*data << (uint64)itr->first;
*data << (int32)itr->second->KillingBlows;
- Player *plr = objmgr.GetPlayer(itr->first);
- uint32 team = bg->GetPlayerTeam(itr->first);
- if(!team && plr) team = plr->GetTeam();
- if(type == 0)
+ if (type == 0)
{
*data << (int32)itr->second->HonorableKills;
*data << (int32)itr->second->Deaths;
@@ -1166,18 +1346,12 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
}
else
{
- // that part probably wrong
- if(plr)
- {
- if(team == HORDE)
- *data << uint8(0);
- else if(team == ALLIANCE)
- {
- *data << uint8(1);
- }
- else
- *data << uint8(0);
- }
+ Player *plr = objmgr.GetPlayer(itr->first);
+ uint32 team = bg->GetPlayerTeam(itr->first);
+ if (!team && plr)
+ team = plr->GetTeam();
+ if (( bg->GetWinner()==0 && team == ALLIANCE ) || ( bg->GetWinner()==1 && team==HORDE ))
+ *data << uint8(1);
else
*data << uint8(0);
}
@@ -1204,13 +1378,16 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
*data << (uint32)((BattleGroundABScore*)itr->second)->BasesDefended; // bases defended
break;
case BATTLEGROUND_EY:
- *data << (uint32)0x00000001; // count of next fields
+ *data << (uint32)0x00000001; // count of next fields
*data << (uint32)((BattleGroundEYScore*)itr->second)->FlagCaptures; // flag captures
break;
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
case BATTLEGROUND_AA:
case BATTLEGROUND_RL:
+ case BATTLEGROUND_SA: // wotlk
+ case BATTLEGROUND_DS: // wotlk
+ case BATTLEGROUND_RV: // wotlk
*data << (int32)0; // 0
break;
default:
@@ -1221,7 +1398,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
}
}
-void BattleGroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket *data, uint32 bgTypeId)
+void BattleGroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket *data, BattleGroundTypeId bgTypeId)
{
/*bgTypeId is:
0 - Your group has joined a battleground queue, but you are not eligible
@@ -1249,10 +1426,10 @@ void BattleGroundMgr::BuildPlaySoundPacket(WorldPacket *data, uint32 soundid)
*data << uint32(soundid);
}
-void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, Player *plr)
+void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid)
{
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
- *data << uint64(plr->GetGUID());
+ *data << uint64(guid);
}
void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr)
@@ -1261,62 +1438,97 @@ void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Pla
*data << uint64(plr->GetGUID());
}
-void BattleGroundMgr::InvitePlayer(Player* plr, uint32 bgInstanceGUID, uint32 team)
+BattleGround * BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id)
{
- // set invited player counters:
- BattleGround* bg = GetBattleGround(bgInstanceGUID);
- if(!bg)
- return;
- bg->IncreaseInvitedCount(team);
+ //cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from
+ //SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id
+ BattleGround* bg = GetBattleGroundTemplate(bgTypeId);
+ if (!bg)
+ return NULL;
+
+ if (bg->isArena())
+ return GetBattleGround(instanceId, bgTypeId);
- plr->SetInviteForBattleGroundQueueType(BGQueueTypeId(bg->GetTypeID(),bg->GetArenaType()), bgInstanceGUID);
+ for(BattleGroundSet::iterator itr = m_BattleGrounds[bgTypeId].begin(); itr != m_BattleGrounds[bgTypeId].end(); ++itr)
+ {
+ if (itr->second->GetClientInstanceID() == instanceId)
+ return itr->second;
+ }
+ return NULL;
+}
- // set the arena teams for rated matches
- if(bg->isArena() && bg->isRated())
+BattleGround * BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId)
+{
+ //search if needed
+ BattleGroundSet::iterator itr;
+ if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{
- switch(bg->GetArenaType())
+ for(uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; i++)
{
- case ARENA_TYPE_2v2:
- bg->SetArenaTeamIdForTeam(team, plr->GetArenaTeamId(0));
- break;
- case ARENA_TYPE_3v3:
- bg->SetArenaTeamIdForTeam(team, plr->GetArenaTeamId(1));
- break;
- case ARENA_TYPE_5v5:
- bg->SetArenaTeamIdForTeam(team, plr->GetArenaTeamId(2));
- break;
- default:
- break;
+ itr = m_BattleGrounds[i].find(InstanceID);
+ if (itr != m_BattleGrounds[i].end())
+ return itr->second;
}
+ return NULL;
}
+ itr = m_BattleGrounds[bgTypeId].find(InstanceID);
+ return ( (itr != m_BattleGrounds[bgTypeId].end()) ? itr->second : NULL );
+}
- // create invite events:
- //add events to player's counters ---- this is not good way - there should be something like global event processor, where we should add those events
- BGQueueInviteEvent* inviteEvent = new BGQueueInviteEvent(plr->GetGUID(), bgInstanceGUID);
- plr->m_Events.AddEvent(inviteEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME/2));
- BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(plr->GetGUID(), bgInstanceGUID, team);
- plr->m_Events.AddEvent(removeEvent, plr->m_Events.CalculateTime(INVITE_ACCEPT_WAIT_TIME));
+BattleGround * BattleGroundMgr::GetBattleGroundTemplate(BattleGroundTypeId bgTypeId)
+{
+ //map is sorted and we can be sure that lowest instance id has only BG template
+ return m_BattleGrounds[bgTypeId].empty() ? NULL : m_BattleGrounds[bgTypeId].begin()->second;
}
-BattleGround * BattleGroundMgr::GetBattleGroundTemplate(uint32 bgTypeId)
+uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id)
{
- return BGFreeSlotQueue[bgTypeId].empty() ? NULL : BGFreeSlotQueue[bgTypeId].back();
+ if (IsArenaType(bgTypeId))
+ return 0; //arenas don't have client-instanceids
+
+ // we create here an instanceid, which is just for
+ // displaying this to the client and without any other use..
+ // the client-instanceIds are unique for each battleground-type
+ // the instance-id just needs to be as low as possible, beginning with 1
+ // the following works, because std::set is default ordered with "<"
+ // the optimalization would be to use as bitmask std::vector<uint32> - but that would only make code unreadable
+ uint32 lastId = 0;
+ for(std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end();)
+ {
+ if( (++lastId) != *itr) //if there is a gap between the ids, we will break..
+ break;
+ lastId = *itr;
+ }
+ m_ClientBattleGroundIds[bgTypeId][queue_id].insert(lastId + 1);
+ return lastId + 1;
}
// create a new battleground that will really be used to play
-BattleGround * BattleGroundMgr::CreateNewBattleGround(uint32 bgTypeId)
+BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id, uint8 arenaType, bool isRated)
{
- BattleGround *bg = NULL;
-
// get the template BG
BattleGround *bg_template = GetBattleGroundTemplate(bgTypeId);
-
- if(!bg_template)
+ if (!bg_template)
{
sLog.outError("BattleGround: CreateNewBattleGround - bg template not found for %u", bgTypeId);
- return 0;
+ return NULL;
+ }
+
+ //for arenas there is random map used
+ if (bg_template->isArena())
+ {
+ BattleGroundTypeId arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL};
+ uint32 arena_num = urand(0,2);
+ bgTypeId = arenas[arena_num];
+ bg_template = GetBattleGroundTemplate(bgTypeId);
+ if (!bg_template)
+ {
+ sLog.outError("BattleGround: CreateNewBattleGround - bg template not found for %u", bgTypeId);
+ return NULL;
+ }
}
+ BattleGround *bg = NULL;
// create a copy of the BG template
switch(bgTypeId)
{
@@ -1344,42 +1556,47 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(uint32 bgTypeId)
case BATTLEGROUND_RL:
bg = new BattleGroundRL(*(BattleGroundRL*)bg_template);
break;
+ case BATTLEGROUND_SA:
+ bg = new BattleGroundSA(*(BattleGroundSA*)bg_template);
+ break;
+ case BATTLEGROUND_DS:
+ bg = new BattleGroundDS(*(BattleGroundDS*)bg_template);
+ break;
+ case BATTLEGROUND_RV:
+ bg = new BattleGroundRV(*(BattleGroundRV*)bg_template);
+ break;
default:
- //bg = new BattleGround;
+ //error, but it is handled few lines above
return 0;
- break; // placeholder for non implemented BG
}
// generate a new instance id
bg->SetInstanceID(MapManager::Instance().GenerateInstanceId()); // set instance id
+ bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, queue_id));
// reset the new bg (set status to status_wait_queue from status_none)
bg->Reset();
- /* will be setup in BG::Update() when the first player is ported in
- if(!(bg->SetupBattleGround()))
- {
- sLog.outError("BattleGround: CreateNewBattleGround: SetupBattleGround failed for bg %u", bgTypeId);
- delete bg;
- return 0;
- }
- */
+ // start the joining of the bg
+ bg->SetStatus(STATUS_WAIT_JOIN);
+ bg->SetQueueId(queue_id);
+ bg->SetArenaType(arenaType);
+ bg->SetRated(isRated);
// add BG to free slot queue
bg->AddToBGFreeSlotQueue();
// add bg to update list
- AddBattleGround(bg->GetInstanceID(), bg);
+ AddBattleGround(bg->GetInstanceID(), bg->GetTypeID(), bg);
return bg;
}
// used to create the BG templates
-uint32 BattleGroundMgr::CreateBattleGround(uint32 bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO)
+uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO)
{
// Create the BG
BattleGround *bg = NULL;
-
switch(bgTypeId)
{
case BATTLEGROUND_AV: bg = new BattleGroundAV; break;
@@ -1390,35 +1607,27 @@ uint32 BattleGroundMgr::CreateBattleGround(uint32 bgTypeId, uint32 MinPlayersPer
case BATTLEGROUND_AA: bg = new BattleGroundAA; break;
case BATTLEGROUND_EY: bg = new BattleGroundEY; break;
case BATTLEGROUND_RL: bg = new BattleGroundRL; break;
+ case BATTLEGROUND_SA: bg = new BattleGroundSA; break;
+ case BATTLEGROUND_DS: bg = new BattleGroundDS; break;
+ case BATTLEGROUND_RV: bg = new BattleGroundRV; break;
default:bg = new BattleGround; break; // placeholder for non implemented BG
}
bg->SetMapId(MapID);
-
- bg->Reset();
-
- BattlemasterListEntry const *bl = sBattlemasterListStore.LookupEntry(bgTypeId);
- //in previous method is checked if exists entry in sBattlemasterListStore, so no check needed
- if (bl)
- {
- bg->SetArenaorBGType(bl->type == TYPE_ARENA);
- }
-
bg->SetTypeID(bgTypeId);
- bg->SetInstanceID(0); // template bg, instance id is 0
+ bg->SetInstanceID(0);
+ bg->SetArenaorBGType(IsArena);
bg->SetMinPlayersPerTeam(MinPlayersPerTeam);
bg->SetMaxPlayersPerTeam(MaxPlayersPerTeam);
- bg->SetMinPlayers(MinPlayersPerTeam*2);
- bg->SetMaxPlayers(MaxPlayersPerTeam*2);
+ bg->SetMinPlayers(MinPlayersPerTeam * 2);
+ bg->SetMaxPlayers(MaxPlayersPerTeam * 2);
bg->SetName(BattleGroundName);
bg->SetTeamStartLoc(ALLIANCE, Team1StartLocX, Team1StartLocY, Team1StartLocZ, Team1StartLocO);
bg->SetTeamStartLoc(HORDE, Team2StartLocX, Team2StartLocY, Team2StartLocZ, Team2StartLocO);
bg->SetLevelRange(LevelMin, LevelMax);
- //add BattleGround instance to FreeSlotQueue (.back() will return the template!)
- bg->AddToBGFreeSlotQueue();
-
- // do NOT add to update list, since this is a template battleground!
+ // add bg to update list
+ AddBattleGround(bg->GetInstanceID(), bg->GetTypeID(), bg);
// return some not-null value, bgTypeId is good enough for me
return bgTypeId;
@@ -1431,13 +1640,14 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
uint32 MaxPlayersPerTeam, MinPlayersPerTeam, MinLvl, MaxLvl, start1, start2;
BattlemasterListEntry const *bl;
WorldSafeLocsEntry const *start;
+ bool IsArena;
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8
QueryResult *result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO FROM battleground_template");
- if(!result)
+ if (!result)
{
barGoLink bar(1);
@@ -1455,44 +1665,46 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
Field *fields = result->Fetch();
bar.step();
- uint32 bgTypeID = fields[0].GetUInt32();
+ uint32 bgTypeID_ = fields[0].GetUInt32();
- // can be overwrited by values from DB
- bl = sBattlemasterListStore.LookupEntry(bgTypeID);
- if(!bl)
+ // can be overwrite by values from DB
+ bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
+ if (!bl)
{
- sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.",bgTypeID);
+ sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
continue;
}
- MaxPlayersPerTeam = bl->maxplayersperteam;
- MinPlayersPerTeam = bl->maxplayersperteam/2;
- MinLvl = bl->minlvl;
- MaxLvl = bl->maxlvl;
-
- if(fields[1].GetUInt32())
- MinPlayersPerTeam = fields[1].GetUInt32();
-
- if(fields[2].GetUInt32())
- MaxPlayersPerTeam = fields[2].GetUInt32();
-
- if(fields[3].GetUInt32())
- MinLvl = fields[3].GetUInt32();
+ BattleGroundTypeId bgTypeID = BattleGroundTypeId(bgTypeID_);
- if(fields[4].GetUInt32())
- MaxLvl = fields[4].GetUInt32();
+ IsArena = (bl->type == TYPE_ARENA);
+ MinPlayersPerTeam = fields[1].GetUInt32();
+ MaxPlayersPerTeam = fields[2].GetUInt32();
+ MinLvl = fields[3].GetUInt32();
+ MaxLvl = fields[4].GetUInt32();
+ //check values from DB
+ if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0 || MinPlayersPerTeam > MaxPlayersPerTeam)
+ {
+ MaxPlayersPerTeam = bl->maxplayersperteam;
+ MinPlayersPerTeam = bl->maxplayersperteam / 2;
+ }
+ if (MinLvl == 0 || MaxLvl == 0 || MinLvl > MaxLvl)
+ {
+ MinLvl = bl->minlvl;
+ MaxLvl = bl->maxlvl;
+ }
start1 = fields[5].GetUInt32();
start = sWorldSafeLocsStore.LookupEntry(start1);
- if(start)
+ if (start)
{
AStartLoc[0] = start->x;
AStartLoc[1] = start->y;
AStartLoc[2] = start->z;
AStartLoc[3] = fields[6].GetFloat();
}
- else if(bgTypeID == BATTLEGROUND_AA)
+ else if (bgTypeID == BATTLEGROUND_AA)
{
AStartLoc[0] = 0;
AStartLoc[1] = 0;
@@ -1501,21 +1713,21 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
}
else
{
- sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.",bgTypeID,start1);
+ sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTypeID, start1);
continue;
}
start2 = fields[7].GetUInt32();
start = sWorldSafeLocsStore.LookupEntry(start2);
- if(start)
+ if (start)
{
HStartLoc[0] = start->x;
HStartLoc[1] = start->y;
HStartLoc[2] = start->z;
HStartLoc[3] = fields[8].GetFloat();
}
- else if(bgTypeID == BATTLEGROUND_AA)
+ else if (bgTypeID == BATTLEGROUND_AA)
{
HStartLoc[0] = 0;
HStartLoc[1] = 0;
@@ -1524,12 +1736,12 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
}
else
{
- sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.",bgTypeID,start2);
+ sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTypeID, start2);
continue;
}
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
- if(!CreateBattleGround(bgTypeID, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
+ if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3]))
continue;
++count;
@@ -1543,11 +1755,11 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
void BattleGroundMgr::InitAutomaticArenaPointDistribution()
{
- if(m_AutoDistributePoints)
+ if (sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
{
sLog.outDebug("Initializing Automatic Arena Point Distribution");
QueryResult * result = CharacterDatabase.Query("SELECT NextArenaPointDistributionTime FROM saved_variables");
- if(!result)
+ if (!result)
{
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
@@ -1565,9 +1777,9 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
void BattleGroundMgr::DistributeArenaPoints()
{
// used to distribute arena points based on last week's stats
- sWorld.SendGlobalText("Flushing Arena points based on team ratings, this may take a few minutes. Please stand by...", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_START);
- sWorld.SendGlobalText("Distributing arena points to players...", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
//temporary structure for storing maximum points to add values for all players
std::map<uint32, uint32> PlayerPoints;
@@ -1575,7 +1787,7 @@ void BattleGroundMgr::DistributeArenaPoints()
//at first update all points for all team members
for(ObjectMgr::ArenaTeamMap::iterator team_itr = objmgr.GetArenaTeamMapBegin(); team_itr != objmgr.GetArenaTeamMapEnd(); ++team_itr)
{
- if(ArenaTeam * at = team_itr->second)
+ if (ArenaTeam * at = team_itr->second)
{
at->UpdateArenaPointsHelper(PlayerPoints);
}
@@ -1585,7 +1797,7 @@ void BattleGroundMgr::DistributeArenaPoints()
for (std::map<uint32, uint32>::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr)
{
//update to database
- CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE `guid` = '%u'", plr_itr->second, plr_itr->first);
+ CharacterDatabase.PExecute("UPDATE characters SET arena_pending_points = '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first);
//add points if player is online
Player* pl = objmgr.GetPlayer(plr_itr->first);
if (pl)
@@ -1594,12 +1806,12 @@ void BattleGroundMgr::DistributeArenaPoints()
PlayerPoints.clear();
- sWorld.SendGlobalText("Finished setting arena points for online players.", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
- sWorld.SendGlobalText("Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
for(ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
{
- if(ArenaTeam * at = titr->second)
+ if (ArenaTeam * at = titr->second)
{
at->FinishWeek(); // set played this week etc values to 0 in memory, too
at->SaveToDB(); // save changes
@@ -1607,16 +1819,16 @@ void BattleGroundMgr::DistributeArenaPoints()
}
}
- sWorld.SendGlobalText("Modification done.", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END);
- sWorld.SendGlobalText("Done flushing Arena points.", NULL);
+ sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
}
-void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, uint64 guid, Player* plr, uint32 bgTypeId)
+void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattleGroundTypeId bgTypeId)
{
uint32 PlayerLevel = 10;
- if(plr)
+ if (plr)
PlayerLevel = plr->getLevel();
data->Initialize(SMSG_BATTLEFIELD_LIST);
@@ -1635,27 +1847,25 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, uint64 guid
uint32 count = 0;
*data << uint32(0x00); // number of bg instances
- for(std::map<uint32, BattleGround*>::iterator itr = m_BattleGrounds.begin(); itr != m_BattleGrounds.end(); ++itr)
+ uint32 queue_id = plr->GetBattleGroundQueueIdFromLevel(bgTypeId);
+ for(std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end();++itr)
{
- if(itr->second->GetTypeID() == bgTypeId && (PlayerLevel >= itr->second->GetMinLevel()) && (PlayerLevel <= itr->second->GetMaxLevel()))
- {
- *data << uint32(itr->second->GetInstanceID());
- ++count;
- }
+ *data << uint32(*itr);
+ ++count;
}
data->put<uint32>( count_pos , count);
}
}
-void BattleGroundMgr::SendToBattleGround(Player *pl, uint32 instanceId)
+void BattleGroundMgr::SendToBattleGround(Player *pl, uint32 instanceId, BattleGroundTypeId bgTypeId)
{
- BattleGround *bg = GetBattleGround(instanceId);
- if(bg)
+ BattleGround *bg = GetBattleGround(instanceId, bgTypeId);
+ if (bg)
{
uint32 mapid = bg->GetMapId();
float x, y, z, O;
uint32 team = pl->GetBGTeam();
- if(team==0)
+ if (team==0)
team = pl->GetTeam();
bg->GetTeamStartLoc(team, x, y, z, O);
@@ -1668,24 +1878,17 @@ void BattleGroundMgr::SendToBattleGround(Player *pl, uint32 instanceId)
}
}
-void BattleGroundMgr::SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, uint64 guid)
+void BattleGroundMgr::SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, const uint64& guid)
{
WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12);
uint32 time_ = 30000 - bg->GetLastResurrectTime(); // resurrect every 30 seconds
- if(time_ == uint32(-1))
+ if (time_ == uint32(-1))
time_ = 0;
data << guid << time_;
pl->GetSession()->SendPacket(&data);
}
-void BattleGroundMgr::RemoveBattleGround(uint32 instanceID)
-{
- BattleGroundSet::iterator itr = m_BattleGrounds.find(instanceID);
- if(itr!=m_BattleGrounds.end())
- m_BattleGrounds.erase(itr);
-}
-
-bool BattleGroundMgr::IsArenaType(uint32 bgTypeId) const
+bool BattleGroundMgr::IsArenaType(BattleGroundTypeId bgTypeId)
{
return ( bgTypeId == BATTLEGROUND_AA ||
bgTypeId == BATTLEGROUND_BE ||
@@ -1693,96 +1896,169 @@ bool BattleGroundMgr::IsArenaType(uint32 bgTypeId) const
bgTypeId == BATTLEGROUND_RL );
}
-bool BattleGroundMgr::IsBattleGroundType(uint32 bgTypeId) const
-{
- return !IsArenaType(bgTypeId);
-}
-
-uint32 BattleGroundMgr::BGQueueTypeId(uint32 bgTypeId, uint8 arenaType) const
+BattleGroundQueueTypeId BattleGroundMgr::BGQueueTypeId(BattleGroundTypeId bgTypeId, uint8 arenaType)
{
switch(bgTypeId)
{
- case BATTLEGROUND_WS:
- return BATTLEGROUND_QUEUE_WS;
- case BATTLEGROUND_AB:
- return BATTLEGROUND_QUEUE_AB;
- case BATTLEGROUND_AV:
- return BATTLEGROUND_QUEUE_AV;
- case BATTLEGROUND_EY:
- return BATTLEGROUND_QUEUE_EY;
- case BATTLEGROUND_AA:
- case BATTLEGROUND_NA:
- case BATTLEGROUND_RL:
- case BATTLEGROUND_BE:
- switch(arenaType)
- {
- case ARENA_TYPE_2v2:
- return BATTLEGROUND_QUEUE_2v2;
- case ARENA_TYPE_3v3:
- return BATTLEGROUND_QUEUE_3v3;
- case ARENA_TYPE_5v5:
- return BATTLEGROUND_QUEUE_5v5;
+ case BATTLEGROUND_WS:
+ return BATTLEGROUND_QUEUE_WS;
+ case BATTLEGROUND_AB:
+ return BATTLEGROUND_QUEUE_AB;
+ case BATTLEGROUND_AV:
+ return BATTLEGROUND_QUEUE_AV;
+ case BATTLEGROUND_EY:
+ return BATTLEGROUND_QUEUE_EY;
+ case BATTLEGROUND_SA:
+ return BATTLEGROUND_QUEUE_SA;
+ case BATTLEGROUND_AA:
+ case BATTLEGROUND_NA:
+ case BATTLEGROUND_RL:
+ case BATTLEGROUND_BE:
+ case BATTLEGROUND_DS:
+ case BATTLEGROUND_RV:
+ switch(arenaType)
+ {
+ case ARENA_TYPE_2v2:
+ return BATTLEGROUND_QUEUE_2v2;
+ case ARENA_TYPE_3v3:
+ return BATTLEGROUND_QUEUE_3v3;
+ case ARENA_TYPE_5v5:
+ return BATTLEGROUND_QUEUE_5v5;
+ default:
+ return BATTLEGROUND_QUEUE_NONE;
+ }
default:
- return 0;
- }
- default:
- return 0;
+ return BATTLEGROUND_QUEUE_NONE;
}
}
-uint32 BattleGroundMgr::BGTemplateId(uint32 bgQueueTypeId) const
+BattleGroundTypeId BattleGroundMgr::BGTemplateId(BattleGroundQueueTypeId bgQueueTypeId)
{
switch(bgQueueTypeId)
{
- case BATTLEGROUND_QUEUE_WS:
- return BATTLEGROUND_WS;
- case BATTLEGROUND_QUEUE_AB:
- return BATTLEGROUND_AB;
- case BATTLEGROUND_QUEUE_AV:
- return BATTLEGROUND_AV;
- case BATTLEGROUND_QUEUE_EY:
- return BATTLEGROUND_EY;
- case BATTLEGROUND_QUEUE_2v2:
- case BATTLEGROUND_QUEUE_3v3:
- case BATTLEGROUND_QUEUE_5v5:
- return BATTLEGROUND_AA;
- default:
- return 0;
+ case BATTLEGROUND_QUEUE_WS:
+ return BATTLEGROUND_WS;
+ case BATTLEGROUND_QUEUE_AB:
+ return BATTLEGROUND_AB;
+ case BATTLEGROUND_QUEUE_AV:
+ return BATTLEGROUND_AV;
+ case BATTLEGROUND_QUEUE_EY:
+ return BATTLEGROUND_EY;
+ case BATTLEGROUND_QUEUE_SA:
+ return BATTLEGROUND_SA;
+ case BATTLEGROUND_QUEUE_2v2:
+ case BATTLEGROUND_QUEUE_3v3:
+ case BATTLEGROUND_QUEUE_5v5:
+ return BATTLEGROUND_AA;
+ default:
+ return BattleGroundTypeId(0); // used for unknown template (it existed and do nothing)
}
}
-uint8 BattleGroundMgr::BGArenaType(uint32 bgQueueTypeId) const
+uint8 BattleGroundMgr::BGArenaType(BattleGroundQueueTypeId bgQueueTypeId)
{
switch(bgQueueTypeId)
{
- case BATTLEGROUND_QUEUE_2v2:
- return ARENA_TYPE_2v2;
- case BATTLEGROUND_QUEUE_3v3:
- return ARENA_TYPE_3v3;
- case BATTLEGROUND_QUEUE_5v5:
- return ARENA_TYPE_5v5;
- default:
- return 0;
+ case BATTLEGROUND_QUEUE_2v2:
+ return ARENA_TYPE_2v2;
+ case BATTLEGROUND_QUEUE_3v3:
+ return ARENA_TYPE_3v3;
+ case BATTLEGROUND_QUEUE_5v5:
+ return ARENA_TYPE_5v5;
+ default:
+ return 0;
}
}
+void BattleGroundMgr::ToggleTesting()
+{
+ m_Testing = !m_Testing;
+ if (m_Testing)
+ sWorld.SendWorldText(LANG_DEBUG_BG_ON);
+ else
+ sWorld.SendWorldText(LANG_DEBUG_BG_OFF);
+}
+
void BattleGroundMgr::ToggleArenaTesting()
{
m_ArenaTesting = !m_ArenaTesting;
- if(m_ArenaTesting)
- sWorld.SendGlobalText("Arenas are set to 1v1 for debugging. So, don't join as group.", NULL);
+ if (m_ArenaTesting)
+ sWorld.SendWorldText(LANG_DEBUG_ARENA_ON);
else
- sWorld.SendGlobalText("Arenas are set to normal playercount.", NULL);
+ sWorld.SendWorldText(LANG_DEBUG_ARENA_OFF);
}
void BattleGroundMgr::SetHolidayWeekends(uint32 mask)
{
- for(uint32 bgtype = 1; bgtype <= 8; ++bgtype)
+ for(uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
{
- if(BattleGround * bg = GetBattleGroundTemplate(bgtype))
+ if(BattleGround * bg = GetBattleGroundTemplate(BattleGroundTypeId(bgtype)))
{
bg->SetHoliday(mask & (1 << bgtype));
}
}
}
+uint32 BattleGroundMgr::GetMaxRatingDifference() const
+{
+ // this is for stupid people who can't use brain and set max rating difference to 0
+ uint32 diff = sWorld.getConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
+ if (diff == 0)
+ diff = 5000;
+ return diff;
+}
+
+uint32 BattleGroundMgr::GetRatingDiscardTimer() const
+{
+ return sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+}
+
+uint32 BattleGroundMgr::GetPrematureFinishTime() const
+{
+ return sWorld.getConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
+}
+
+void BattleGroundMgr::LoadBattleMastersEntry()
+{
+ mBattleMastersMap.clear(); // need for reload case
+
+ QueryResult *result = WorldDatabase.Query( "SELECT entry,bg_template FROM battlemaster_entry" );
+
+ uint32 count = 0;
+
+ if (!result)
+ {
+ barGoLink bar( 1 );
+ bar.step();
+
+ sLog.outString();
+ sLog.outString( ">> Loaded 0 battlemaster entries - table is empty!" );
+ return;
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ do
+ {
+ ++count;
+ bar.step();
+
+ Field *fields = result->Fetch();
+
+ uint32 entry = fields[0].GetUInt32();
+ uint32 bgTypeId = fields[1].GetUInt32();
+ if (!sBattlemasterListStore.LookupEntry(bgTypeId))
+ {
+ sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId);
+ continue;
+ }
+
+ mBattleMastersMap[entry] = BattleGroundTypeId(bgTypeId);
+
+ } while( result->NextRow() );
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u battlemaster entries", count );
+}
diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h
index 5edcc1457d3..889b8b6f4fe 100644
--- a/src/game/BattleGroundMgr.h
+++ b/src/game/BattleGroundMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,30 +21,23 @@
#ifndef __BATTLEGROUNDMGR_H
#define __BATTLEGROUNDMGR_H
-#include "BattleGround.h"
+#include "Common.h"
#include "Policies/Singleton.h"
+#include "BattleGround.h"
-class BattleGround;
-
-//TODO it is not possible to have this structure, because we should have BattlegroundSet for each queue
-//so i propose to change this type to array 1..MAX_BATTLEGROUND_TYPES of sets or maps..
typedef std::map<uint32, BattleGround*> BattleGroundSet;
-//typedef std::map<uint32, BattleGroundQueue*> BattleGroundQueueSet;
-typedef std::deque<BattleGround*> BGFreeSlotQueueType;
-#define MAX_BATTLEGROUND_QUEUES 7 // for level ranges 10-19, 20-29, 30-39, 40-49, 50-59, 60-69, 70+
+//this container can't be deque, because deque doesn't like removing the last element - if you remove it, it invalidates next iterator and crash appears
+typedef std::list<BattleGround*> BGFreeSlotQueueType;
-#define MAX_BATTLEGROUND_TYPES 9 // each BG type will be in array
+typedef UNORDERED_MAP<uint32, BattleGroundTypeId> BattleMastersMap;
-#define MAX_BATTLEGROUND_QUEUE_TYPES 8
-
-#define BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY 86400 // seconds in a day
+#define BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY 86400 // seconds in a day
+#define COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME 10
struct GroupQueueInfo; // type predefinition
struct PlayerQueueInfo // stores information for players in queue
{
- uint32 InviteTime; // first invite time
- uint32 LastInviteTime; // last invite time
uint32 LastOnlineTime; // for tracking and removing offline players from queue after 5 minutes
GroupQueueInfo * GroupInfo; // pointer to the associated groupqueueinfo
};
@@ -53,16 +46,26 @@ struct GroupQueueInfo // stores informatio
{
std::map<uint64, PlayerQueueInfo*> Players; // player queue info map
uint32 Team; // Player team (ALLIANCE/HORDE)
- uint32 BgTypeId; // battleground type id
+ BattleGroundTypeId BgTypeId; // battleground type id
bool IsRated; // rated
uint8 ArenaType; // 2v2, 3v3, 5v5 or 0 when BG
uint32 ArenaTeamId; // team id if rated match
uint32 JoinTime; // time when group was added
+ uint32 RemoveInviteTime; // time when we will remove invite for players in group
uint32 IsInvitedToBGInstanceGUID; // was invited to certain BG
uint32 ArenaTeamRating; // if rated match, inited to the rating of the team
uint32 OpponentsTeamRating; // for rated arena matches
};
+enum BattleGroundQueueGroupTypes
+{
+ BG_QUEUE_PREMADE_ALLIANCE = 0,
+ BG_QUEUE_PREMADE_HORDE = 1,
+ BG_QUEUE_NORMAL_ALLIANCE = 2,
+ BG_QUEUE_NORMAL_HORDE = 3
+};
+#define BG_QUEUE_GROUP_TYPES_COUNT 4
+
class BattleGround;
class BattleGroundQueue
{
@@ -70,64 +73,61 @@ class BattleGroundQueue
BattleGroundQueue();
~BattleGroundQueue();
- void Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype = 0, bool isRated = false, uint32 minRating = 0);
+ void Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id, uint8 arenaType = 0, bool isRated = false, uint32 minRating = 0);
- GroupQueueInfo * AddGroup(Player * leader, uint32 BgTypeId, uint8 ArenaType, bool isRated, uint32 ArenaRating, uint32 ArenaTeamId = 0);
+ void FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel queue_id);
+ bool CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam);
+ bool CheckNormalMatch(BattleGround* bg_template, BGQueueIdBasedOnLevel queue_id, uint32 minPlayers, uint32 maxPlayers);
+ bool CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_id, uint32 minPlayersPerTeam);
+ GroupQueueInfo * AddGroup(Player * leader, BattleGroundTypeId bgTypeId, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0);
void AddPlayer(Player *plr, GroupQueueInfo *ginfo);
- void RemovePlayer(uint64 guid, bool decreaseInvitedCount);
+ void RemovePlayer(const uint64& guid, bool decreaseInvitedCount);
+ void PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id);
+ uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BGQueueIdBasedOnLevel queue_id);
+
void DecreaseGroupLength(uint32 queueId, uint32 AsGroup);
- void BGEndedRemoveInvites(BattleGround * bg);
+ void AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playerGUID, bool isAddedToQueue);
typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap;
- QueuedPlayersMap m_QueuedPlayers[MAX_BATTLEGROUND_QUEUES];
-
- typedef std::list<GroupQueueInfo*> QueuedGroupsList;
- QueuedGroupsList m_QueuedGroups[MAX_BATTLEGROUND_QUEUES];
-
- // class to hold pointers to the groups eligible for a specific selection pool building mode
- class EligibleGroups : public std::list<GroupQueueInfo *>
- {
- public:
- void Init(QueuedGroupsList * source, uint32 BgTypeId, uint32 side, uint32 MaxPlayers, uint8 ArenaType = 0, bool IsRated = false, uint32 MinRating = 0, uint32 MaxRating = 0, uint32 DisregardTime = 0, uint32 excludeTeam = 0);
- };
-
- EligibleGroups m_EligibleGroups;
+ QueuedPlayersMap m_QueuedPlayers;
+
+ //we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well
+ typedef std::list<GroupQueueInfo*> GroupsQueueType;
+
+ /*
+ This two dimensional array is used to store All queued groups
+ First dimension specifies the bgTypeId
+ Second dimension specifies the player's group types -
+ BG_QUEUE_PREMADE_ALLIANCE is used for premade alliance groups and alliance rated arena teams
+ BG_QUEUE_PREMADE_HORDE is used for premade horde groups and horde rated arena teams
+ BG_QUEUE_NORMAL_ALLIANCE is used for normal (or small) alliance groups or non-rated arena matches
+ BG_QUEUE_NORMAL_HORDE is used for normal (or small) horde groups or non-rated arena matches
+ */
+ GroupsQueueType m_QueuedGroups[MAX_BATTLEGROUND_QUEUES][BG_QUEUE_GROUP_TYPES_COUNT];
// class to select and invite groups to bg
class SelectionPool
{
public:
- void Init(EligibleGroups * curr);
- void AddGroup(GroupQueueInfo * group);
- void RemoveGroup(GroupQueueInfo * group);
+ void Init();
+ bool AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount);
+ bool KickGroup(uint32 size);
uint32 GetPlayerCount() const {return PlayerCount;}
- bool Build(uint32 MinPlayers, uint32 MaxPlayers, EligibleGroups::iterator startitr);
public:
- std::list<GroupQueueInfo *> SelectedGroups;
+ GroupsQueueType SelectedGroups;
private:
uint32 PlayerCount;
- EligibleGroups * m_CurrEligGroups;
};
- enum SelectionPoolBuildMode
- {
- NORMAL_ALLIANCE,
- NORMAL_HORDE,
- ONESIDE_ALLIANCE_TEAM1,
- ONESIDE_ALLIANCE_TEAM2,
- ONESIDE_HORDE_TEAM1,
- ONESIDE_HORDE_TEAM2,
-
- NUM_SELECTION_POOL_TYPES
- };
-
- SelectionPool m_SelectionPools[NUM_SELECTION_POOL_TYPES];
-
- bool BuildSelectionPool(uint32 bgTypeId, uint32 queue_id, uint32 MinPlayers, uint32 MaxPlayers, SelectionPoolBuildMode mode, uint8 ArenaType = 0, bool isRated = false, uint32 MinRating = 0, uint32 MaxRating = 0, uint32 DisregardTime = 0, uint32 excludeTeam = 0);
+ //one selection pool for horde, other one for alliance
+ SelectionPool m_SelectionPools[BG_TEAMS_COUNT];
private:
bool InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * bg, uint32 side);
+ uint32 m_WaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_QUEUES][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME];
+ uint32 m_WaitTimeLastPlayer[BG_TEAMS_COUNT][MAX_BATTLEGROUND_QUEUES];
+ uint32 m_SumOfWaitTimes[BG_TEAMS_COUNT][MAX_BATTLEGROUND_QUEUES];
};
/*
@@ -137,7 +137,10 @@ class BattleGroundQueue
class BGQueueInviteEvent : public BasicEvent
{
public:
- BGQueueInviteEvent(uint64 pl_guid, uint32 BgInstanceGUID) : m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID) {};
+ BGQueueInviteEvent(const uint64& pl_guid, uint32 BgInstanceGUID, BattleGroundTypeId BgTypeId, uint32 removeTime) :
+ m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID), m_BgTypeId(BgTypeId), m_RemoveTime(removeTime)
+ {
+ };
virtual ~BGQueueInviteEvent() {};
virtual bool Execute(uint64 e_time, uint32 p_time);
@@ -145,15 +148,22 @@ class BGQueueInviteEvent : public BasicEvent
private:
uint64 m_PlayerGuid;
uint32 m_BgInstanceGUID;
+ uint32 m_RemoveTime;
+ BattleGroundTypeId m_BgTypeId;
};
/*
- This class is used to remove player from BG queue after 2 minutes from first invitation
+ This class is used to remove player from BG queue after 1 minute 20 seconds from first invitation
+ 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
{
public:
- BGQueueRemoveEvent(uint64 pl_guid, uint32 bgInstanceGUID, uint32 playersTeam) : m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_PlayersTeam(playersTeam) {};
+ BGQueueRemoveEvent(const uint64& pl_guid, uint32 bgInstanceGUID, BattleGroundTypeId BgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 removeTime) :
+ m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId), m_RemoveTime(removeTime)
+ {
+ };
virtual ~BGQueueRemoveEvent() {};
virtual bool Execute(uint64 e_time, uint32 p_time);
@@ -161,7 +171,9 @@ class BGQueueRemoveEvent : public BasicEvent
private:
uint64 m_PlayerGuid;
uint32 m_BgInstanceGUID;
- uint32 m_PlayersTeam;
+ uint32 m_RemoveTime;
+ BattleGroundTypeId m_BgTypeId;
+ BattleGroundQueueTypeId m_BgQueueTypeId;
};
class BattleGroundMgr
@@ -170,83 +182,81 @@ class BattleGroundMgr
/* Construction */
BattleGroundMgr();
~BattleGroundMgr();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* Packet Building */
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
- void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, Player *plr);
- void BuildBattleGroundListPacket(WorldPacket *data, uint64 guid, Player *plr, uint32 bgTypeId);
- void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, uint32 bgTypeId);
+ void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid);
+ void BuildBattleGroundListPacket(WorldPacket *data, const uint64& guid, Player *plr, BattleGroundTypeId bgTypeId);
+ void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, BattleGroundTypeId bgTypeId);
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
void BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg);
- void BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint32 team, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint32 arenatype = 0, uint8 israted = 0);
+ void BuildBattleGroundStatusPacket(WorldPacket *data, BattleGround *bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype);
void BuildPlaySoundPacket(WorldPacket *data, uint32 soundid);
-
- /* Player invitation */
- // called from Queue update, or from Addplayer to queue
- void InvitePlayer(Player* plr, uint32 bgInstanceGUID, uint32 team);
+ void SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, const uint64& guid);
/* Battlegrounds */
- BattleGroundSet::iterator GetBattleGroundsBegin() { return m_BattleGrounds.begin(); };
- BattleGroundSet::iterator GetBattleGroundsEnd() { return m_BattleGrounds.end(); };
+ BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id);
+ BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown
- BattleGround* GetBattleGround(uint32 ID)
- {
- BattleGroundSet::iterator i = m_BattleGrounds.find(ID);
- if(i != m_BattleGrounds.end())
- return i->second;
- else
- return NULL;
- };
-
- BattleGround * GetBattleGroundTemplate(uint32 bgTypeId);
- BattleGround * CreateNewBattleGround(uint32 bgTypeId);
+ BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId);
+ BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id, uint8 arenaType, bool isRated);
- uint32 CreateBattleGround(uint32 bgTypeId, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO);
+ uint32 CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsArena, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam, uint32 LevelMin, uint32 LevelMax, char* BattleGroundName, uint32 MapID, float Team1StartLocX, float Team1StartLocY, float Team1StartLocZ, float Team1StartLocO, float Team2StartLocX, float Team2StartLocY, float Team2StartLocZ, float Team2StartLocO);
- inline void AddBattleGround(uint32 ID, BattleGround* BG) { m_BattleGrounds[ID] = BG; };
- void RemoveBattleGround(uint32 instanceID);
+ void AddBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId, BattleGround* BG) { m_BattleGrounds[bgTypeId][InstanceID] = BG; };
+ void RemoveBattleGround(uint32 instanceID, BattleGroundTypeId bgTypeId) { m_BattleGrounds[bgTypeId].erase(instanceID); }
+ uint32 CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLevel queue_id);
void CreateInitialBattleGrounds();
+ void DeleteAllBattleGrounds();
- void SendToBattleGround(Player *pl, uint32 bgTypeId);
+ void SendToBattleGround(Player *pl, uint32 InstanceID, BattleGroundTypeId bgTypeId);
/* Battleground queues */
//these queues are instantiated when creating BattlegroundMrg
BattleGroundQueue m_BattleGroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES]; // public, because we need to access them in BG handler code
- BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPES];
+ BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPE_ID];
- void SendAreaSpiritHealerQueryOpcode(Player *pl, BattleGround *bg, uint64 guid);
-
- bool IsArenaType(uint32 bgTypeId) const;
- bool IsBattleGroundType(uint32 bgTypeId) const;
- uint32 BGQueueTypeId(uint32 bgTypeId, uint8 arenaType) const;
- uint32 BGTemplateId(uint32 bgQueueTypeId) const;
- uint8 BGArenaType(uint32 bgQueueTypeId) const;
-
- uint32 GetMaxRatingDifference() const {return m_MaxRatingDifference;}
- uint32 GetRatingDiscardTimer() const {return m_RatingDiscardTimer;}
+ uint32 GetMaxRatingDifference() const;
+ uint32 GetRatingDiscardTimer() const;
+ uint32 GetPrematureFinishTime() const;
void InitAutomaticArenaPointDistribution();
void DistributeArenaPoints();
- uint32 GetPrematureFinishTime() const {return m_PrematureFinishTimer;}
void ToggleArenaTesting();
- const bool isArenaTesting() const { return m_ArenaTesting; }
+ void ToggleTesting();
void SetHolidayWeekends(uint32 mask);
+ void LoadBattleMastersEntry();
+ BattleGroundTypeId GetBattleMasterBG(uint32 entry) const
+ {
+ BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
+ if (itr != mBattleMastersMap.end())
+ return itr->second;
+ return BATTLEGROUND_WS;
+ }
+
+ bool isArenaTesting() const { return m_ArenaTesting; }
+ bool isTesting() const { return m_Testing; }
+
+ static bool IsArenaType(BattleGroundTypeId bgTypeId);
+ static bool IsBattleGroundType(BattleGroundTypeId bgTypeId) { return !BattleGroundMgr::IsArenaType(bgTypeId); }
+ static BattleGroundQueueTypeId BGQueueTypeId(BattleGroundTypeId bgTypeId, uint8 arenaType);
+ static BattleGroundTypeId BGTemplateId(BattleGroundQueueTypeId bgQueueTypeId);
+ static uint8 BGArenaType(BattleGroundQueueTypeId bgQueueTypeId);
private:
+ BattleMastersMap mBattleMastersMap;
/* Battlegrounds */
- BattleGroundSet m_BattleGrounds;
- uint32 m_MaxRatingDifference;
- uint32 m_RatingDiscardTimer;
+ BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID];
+ std::set<uint32> m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_QUEUES]; //the instanceids just visible for the client
uint32 m_NextRatingDiscardUpdate;
- bool m_AutoDistributePoints;
uint64 m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker;
- uint32 m_PrematureFinishTimer;
bool m_ArenaTesting;
+ bool m_Testing;
};
#define sBattleGroundMgr Trinity::Singleton<BattleGroundMgr>::Instance()
diff --git a/src/game/BattleGroundNA.cpp b/src/game/BattleGroundNA.cpp
index 5debaa3c6a5..364ba972bec 100644
--- a/src/game/BattleGroundNA.cpp
+++ b/src/game/BattleGroundNA.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,14 +22,23 @@
#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundNA.h"
-#include "Creature.h"
#include "ObjectMgr.h"
-#include "MapManager.h"
+#include "WorldPacket.h"
#include "Language.h"
BattleGroundNA::BattleGroundNA()
{
m_BgObjects.resize(BG_NA_OBJECT_MAX);
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
}
BattleGroundNA::~BattleGroundNA()
@@ -37,74 +46,31 @@ BattleGroundNA::~BattleGroundNA()
}
-void BattleGroundNA::Update(time_t diff)
+void BattleGroundNA::Update(uint32 diff)
{
BattleGround::Update(diff);
- // after bg start we get there
- if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
- {
- ModifyStartDelayTime(diff);
-
- if (!(m_Events & 0x01))
- {
- m_Events |= 0x01;
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
- for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; i++)
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
-
- SetStartDelayTime(START_DELAY1);
- SendMessageToAll(LANG_ARENA_ONE_MINUTE);
- }
- // After 30 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
- {
- m_Events |= 0x04;
- SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
- }
- // After 15 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
- {
- m_Events |= 0x08;
- SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
- }
- // delay expired (1 minute)
- else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
- {
- m_Events |= 0x10;
-
- for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; i++)
- DoorOpen(i);
-
- for(uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; i++)
- SpawnBGObject(i, 60);
-
- SendMessageToAll(LANG_ARENA_BEGUN);
- SetStatus(STATUS_IN_PROGRESS);
- SetStartDelayTime(0);
-
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player *plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
-
- if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
- }
- }
-
- /*if(GetStatus() == STATUS_IN_PROGRESS)
+ /*if (GetStatus() == STATUS_IN_PROGRESS)
{
// update something
}*/
}
+void BattleGroundNA::StartingEventCloseDoors()
+{
+ for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; i++)
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+}
+
+void BattleGroundNA::StartingEventOpenDoors()
+{
+ for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; i++)
+ DoorOpen(i);
+
+ for(uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; i++)
+ SpawnBGObject(i, 60);
+}
+
void BattleGroundNA::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -119,24 +85,21 @@ void BattleGroundNA::AddPlayer(Player *plr)
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
{
- if(GetStatus() == STATUS_WAIT_LEAVE)
+ if (GetStatus() == STATUS_WAIT_LEAVE)
return;
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetAlivePlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
+ CheckArenaWinConditions();
}
void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- if(!killer)
+ if (!killer)
{
sLog.outError("BattleGroundNA: Killer player not found");
return;
@@ -147,16 +110,7 @@ void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE))
- {
- // all opponents killed
- EndBattleGround(HORDE);
- }
- else if(!GetAlivePlayersCountByTeam(HORDE))
- {
- // all opponents killed
- EndBattleGround(ALLIANCE);
- }
+ CheckArenaWinConditions();
}
bool BattleGroundNA::HandlePlayerUnderMap(Player *player)
@@ -167,7 +121,7 @@ bool BattleGroundNA::HandlePlayerUnderMap(Player *player)
void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
@@ -183,7 +137,7 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
}
- //if(buff_guid)
+ //if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
}
@@ -194,15 +148,16 @@ void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
data << uint32(0xa11) << uint32(1); // 9
}
-void BattleGroundNA::ResetBGSubclass()
+void BattleGroundNA::Reset()
{
-
+ //call parent's class reset
+ BattleGround::Reset();
}
bool BattleGroundNA::SetupBattleGround()
{
// gates
- if( !AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854, 2966.833, 12.6462, -2.648788, 0, 0, 0.9697962, -0.2439165, RESPAWN_IMMEDIATELY)
+ if (!AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854, 2966.833, 12.6462, -2.648788, 0, 0, 0.9697962, -0.2439165, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_2, 4081.179, 2874.97, 12.39171, 0.4928045, 0, 0, 0.2439165, 0.9697962, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_3, 4023.709, 2981.777, 10.70117, -2.648788, 0, 0, 0.9697962, -0.2439165, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_TYPE_DOOR_4, 4090.064, 2858.438, 10.23631, 0.4928045, 0, 0, 0.2439165, 0.9697962, RESPAWN_IMMEDIATELY)
diff --git a/src/game/BattleGroundNA.h b/src/game/BattleGroundNA.h
index ae419b9fc44..56e2cf373c4 100644
--- a/src/game/BattleGroundNA.h
+++ b/src/game/BattleGroundNA.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -58,15 +58,17 @@ class BattleGroundNA : public BattleGround
public:
BattleGroundNA();
~BattleGroundNA();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
- virtual void ResetBGSubclass();
+ virtual void Reset();
virtual void FillInitialWorldStates(WorldPacket &d);
void HandleKillPlayer(Player* player, Player *killer);
bool HandlePlayerUnderMap(Player * plr);
diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGroundRL.cpp
index 6d68403fe4c..033733aa61a 100644
--- a/src/game/BattleGroundRL.cpp
+++ b/src/game/BattleGroundRL.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,14 +22,23 @@
#include "Player.h"
#include "BattleGround.h"
#include "BattleGroundRL.h"
-#include "Creature.h"
#include "ObjectMgr.h"
-#include "MapManager.h"
#include "Language.h"
+#include "WorldPacket.h"
BattleGroundRL::BattleGroundRL()
{
m_BgObjects.resize(BG_RL_OBJECT_MAX);
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
}
BattleGroundRL::~BattleGroundRL()
@@ -37,75 +46,31 @@ BattleGroundRL::~BattleGroundRL()
}
-void BattleGroundRL::Update(time_t diff)
+void BattleGroundRL::Update(uint32 diff)
{
BattleGround::Update(diff);
- if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
- {
- ModifyStartDelayTime(diff);
-
- if (!(m_Events & 0x01))
- {
- m_Events |= 0x01;
-
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
-
- for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
-
- SetStartDelayTime(START_DELAY1);
- SendMessageToAll(LANG_ARENA_ONE_MINUTE);
- }
- // After 30 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x04))
- {
- m_Events |= 0x04;
- SendMessageToAll(LANG_ARENA_THIRTY_SECONDS);
- }
- // After 15 seconds, warning is signalled
- else if (GetStartDelayTime() <= START_DELAY3 && !(m_Events & 0x08))
- {
- m_Events |= 0x08;
- SendMessageToAll(LANG_ARENA_FIFTEEN_SECONDS);
- }
- // delay expired (1 minute)
- else if (GetStartDelayTime() <= 0 && !(m_Events & 0x10))
- {
- m_Events |= 0x10;
-
- for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
- DoorOpen(i);
-
- for(uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; i++)
- SpawnBGObject(i, 60);
-
- SendMessageToAll(LANG_ARENA_BEGUN);
- SetStatus(STATUS_IN_PROGRESS);
- SetStartDelayTime(0);
-
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player *plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
-
- if(!GetPlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetPlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
- }
- }
-
- /*if(GetStatus() == STATUS_IN_PROGRESS)
+ /*if (GetStatus() == STATUS_IN_PROGRESS)
{
// update something
}*/
}
+void BattleGroundRL::StartingEventCloseDoors()
+{
+ for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+}
+
+void BattleGroundRL::StartingEventOpenDoors()
+{
+ for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; i++)
+ DoorOpen(i);
+
+ for(uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; i++)
+ SpawnBGObject(i, 60);
+}
+
void BattleGroundRL::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -120,24 +85,21 @@ void BattleGroundRL::AddPlayer(Player *plr)
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
{
- if(GetStatus() == STATUS_WAIT_LEAVE)
+ if (GetStatus() == STATUS_WAIT_LEAVE)
return;
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
- EndBattleGround(HORDE);
- else if(GetPlayersCountByTeam(ALLIANCE) && !GetAlivePlayersCountByTeam(HORDE))
- EndBattleGround(ALLIANCE);
+ CheckArenaWinConditions();
}
void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- if(!killer)
+ if (!killer)
{
sLog.outError("Killer player not found");
return;
@@ -148,16 +110,7 @@ void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
- if(!GetAlivePlayersCountByTeam(ALLIANCE))
- {
- // all opponents killed
- EndBattleGround(HORDE);
- }
- else if(!GetAlivePlayersCountByTeam(HORDE))
- {
- // all opponents killed
- EndBattleGround(ALLIANCE);
- }
+ CheckArenaWinConditions();
}
bool BattleGroundRL::HandlePlayerUnderMap(Player *player)
@@ -169,7 +122,7 @@ bool BattleGroundRL::HandlePlayerUnderMap(Player *player)
void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
@@ -185,7 +138,7 @@ void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
}
- //if(buff_guid)
+ //if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
}
@@ -196,15 +149,16 @@ void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
data << uint32(0xbba) << uint32(1); // 9
}
-void BattleGroundRL::ResetBGSubclass()
+void BattleGroundRL::Reset()
{
-
+ //call parent's reset
+ BattleGround::Reset();
}
bool BattleGroundRL::SetupBattleGround()
{
// gates
- if( !AddObject(BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_1, 1293.561, 1601.938, 31.60557, -1.457349, 0, 0, -0.6658813, 0.7460576, RESPAWN_IMMEDIATELY)
+ if (!AddObject(BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_1, 1293.561, 1601.938, 31.60557, -1.457349, 0, 0, -0.6658813, 0.7460576, RESPAWN_IMMEDIATELY)
|| !AddObject(BG_RL_OBJECT_DOOR_2, BG_RL_OBJECT_TYPE_DOOR_2, 1278.648, 1730.557, 31.60557, 1.684245, 0, 0, 0.7460582, 0.6658807, RESPAWN_IMMEDIATELY)
// buffs
|| !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971, 1632.719971, 36.730400, -1.448624, 0, 0, 0.6626201, -0.7489557, 120)
diff --git a/src/game/BattleGroundRL.h b/src/game/BattleGroundRL.h
index 599cb53dc63..772c9dd0879 100644
--- a/src/game/BattleGroundRL.h
+++ b/src/game/BattleGroundRL.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -54,16 +54,18 @@ class BattleGroundRL : public BattleGround
public:
BattleGroundRL();
~BattleGroundRL();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void Reset();
+ virtual void FillInitialWorldStates(WorldPacket &d);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
- virtual void ResetBGSubclass();
- virtual void FillInitialWorldStates(WorldPacket &d);
void HandleKillPlayer(Player* player, Player *killer);
bool HandlePlayerUnderMap(Player * plr);
};
diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGroundRV.cpp
new file mode 100644
index 00000000000..8c252c35c97
--- /dev/null
+++ b/src/game/BattleGroundRV.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Player.h"
+#include "BattleGround.h"
+#include "BattleGroundRV.h"
+#include "Language.h"
+
+BattleGroundRV::BattleGroundRV()
+{
+
+ m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
+ m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
+ m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
+ m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE;
+ //we must set messageIds
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
+}
+
+BattleGroundRV::~BattleGroundRV()
+{
+
+}
+
+void BattleGroundRV::Update(uint32 diff)
+{
+ BattleGround::Update(diff);
+}
+
+void BattleGroundRV::StartingEventCloseDoors()
+{
+}
+
+void BattleGroundRV::StartingEventOpenDoors()
+{
+}
+
+void BattleGroundRV::AddPlayer(Player *plr)
+{
+ BattleGround::AddPlayer(plr);
+ //create score and add it to map, default values are set in constructor
+ BattleGroundRVScore* sc = new BattleGroundRVScore;
+
+ m_PlayerScores[plr->GetGUID()] = sc;
+}
+
+void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
+{
+}
+
+void BattleGroundRV::HandleKillPlayer(Player* player, Player* killer)
+{
+ BattleGround::HandleKillPlayer(player, killer);
+}
+
+void BattleGroundRV::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
+{
+}
+
+bool BattleGroundRV::SetupBattleGround()
+{
+ return true;
+}
diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGroundRV.h
new file mode 100644
index 00000000000..e3e94baf101
--- /dev/null
+++ b/src/game/BattleGroundRV.h
@@ -0,0 +1,50 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __BATTLEGROUNDRV_H
+#define __BATTLEGROUNDRV_H
+
+class BattleGround;
+
+class BattleGroundRVScore : public BattleGroundScore
+{
+ public:
+ BattleGroundRVScore() {};
+ virtual ~BattleGroundRVScore() {};
+ //TODO fix me
+};
+
+class BattleGroundRV : public BattleGround
+{
+ friend class BattleGroundMgr;
+
+ public:
+ BattleGroundRV();
+ ~BattleGroundRV();
+ void Update(uint32 diff);
+
+ /* inherited from BattlegroundClass */
+ virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
+
+ void RemovePlayer(Player *plr, uint64 guid);
+ void HandleAreaTrigger(Player *Source, uint32 Trigger);
+ bool SetupBattleGround();
+ void HandleKillPlayer(Player* player, Player *killer);
+};
+#endif
diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp
new file mode 100644
index 00000000000..5e6b02edfce
--- /dev/null
+++ b/src/game/BattleGroundSA.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Player.h"
+#include "BattleGround.h"
+#include "BattleGroundSA.h"
+#include "Language.h"
+
+BattleGroundSA::BattleGroundSA()
+{
+ //TODO FIX ME!
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
+}
+
+BattleGroundSA::~BattleGroundSA()
+{
+
+}
+
+void BattleGroundSA::Update(uint32 diff)
+{
+ BattleGround::Update(diff);
+}
+
+void BattleGroundSA::StartingEventCloseDoors()
+{
+}
+
+void BattleGroundSA::StartingEventOpenDoors()
+{
+}
+
+void BattleGroundSA::AddPlayer(Player *plr)
+{
+ BattleGround::AddPlayer(plr);
+ //create score and add it to map, default values are set in constructor
+ BattleGroundSAScore* sc = new BattleGroundSAScore;
+
+ m_PlayerScores[plr->GetGUID()] = sc;
+}
+
+void BattleGroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
+{
+
+}
+
+void BattleGroundSA::HandleAreaTrigger(Player *Source, uint32 Trigger)
+{
+ // this is wrong way to implement these things. On official it done by gameobject spell cast.
+ if (GetStatus() != STATUS_IN_PROGRESS)
+ return;
+}
+
+void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
+{
+
+ std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
+
+ if(itr == m_PlayerScores.end()) // player not found...
+ return;
+
+ BattleGround::UpdatePlayerScore(Source,type,value);
+}
diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h
new file mode 100644
index 00000000000..3ba23d02656
--- /dev/null
+++ b/src/game/BattleGroundSA.h
@@ -0,0 +1,54 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __BATTLEGROUNDSA_H
+#define __BATTLEGROUNDSA_H
+
+class BattleGround;
+
+class BattleGroundSAScore : public BattleGroundScore
+{
+ public:
+ BattleGroundSAScore() {};
+ virtual ~BattleGroundSAScore() {};
+};
+
+class BattleGroundSA : public BattleGround
+{
+ friend class BattleGroundMgr;
+
+ public:
+ BattleGroundSA();
+ ~BattleGroundSA();
+ void Update(uint32 diff);
+
+ /* inherited from BattlegroundClass */
+ virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
+
+ void RemovePlayer(Player *plr,uint64 guid);
+ void HandleAreaTrigger(Player *Source, uint32 Trigger);
+ //bool SetupBattleGround();
+
+ /* Scorekeeping */
+ void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
+
+ private:
+};
+#endif
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp
index 3a8c5668a7a..fac59229e63 100644
--- a/src/game/BattleGroundWS.cpp
+++ b/src/game/BattleGroundWS.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
#include "BattleGroundWS.h"
#include "Creature.h"
#include "GameObject.h"
-#include "Chat.h"
-#include "MapManager.h"
+#include "ObjectMgr.h"
+#include "WorldPacket.h"
#include "Language.h"
#include "World.h"
@@ -52,123 +52,58 @@ BattleGroundWS::BattleGroundWS()
{
m_BgObjects.resize(BG_WS_OBJECT_MAX);
m_BgCreatures.resize(BG_CREATURES_MAX_WS);
+
+ m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_WS_START_TWO_MINUTES;
+ m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE;
+ m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
}
BattleGroundWS::~BattleGroundWS()
{
}
-void BattleGroundWS::Update(time_t diff)
+void BattleGroundWS::Update(uint32 diff)
{
BattleGround::Update(diff);
- // after bg start we get there (once)
- if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize())
- {
- ModifyStartDelayTime(diff);
-
- if(!(m_Events & 0x01))
- {
- m_Events |= 0x01;
-
- // setup here, only when at least one player has ported to the map
- if(!SetupBattleGround())
- {
- EndNow();
- return;
- }
-
-// for(uint32 i = WS_SPIRIT_MAIN_ALLIANCE; i <= WS_SPIRIT_MAIN_HORDE; i++)
-// SpawnBGCreature(i, RESPAWN_IMMEDIATELY);
-
- for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; i++)
- {
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
- DoorClose(i);
- }
- for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
- SpawnBGObject(i, RESPAWN_ONE_DAY);
-
- SetStartDelayTime(START_DELAY0);
- }
- // After 1 minute, warning is signalled
- else if(GetStartDelayTime() <= START_DELAY1 && !(m_Events & 0x04))
- {
- m_Events |= 0x04;
- SendMessageToAll(GetTrinityString(LANG_BG_WS_ONE_MINUTE));
- }
- // After 1,5 minute, warning is signalled
- else if(GetStartDelayTime() <= START_DELAY2 && !(m_Events & 0x08))
- {
- m_Events |= 0x08;
- SendMessageToAll(GetTrinityString(LANG_BG_WS_HALF_MINUTE));
- }
- // After 2 minutes, gates OPEN ! x)
- else if(GetStartDelayTime() < 0 && !(m_Events & 0x10))
- {
- m_Events |= 0x10;
- for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; i++)
- DoorOpen(i);
- for(uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; i++)
- DoorOpen(i);
-
- SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY);
- SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY);
- SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY);
- SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
-
- for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
- SpawnBGObject(i, RESPAWN_IMMEDIATELY);
-
- SendMessageToAll(GetTrinityString(LANG_BG_WS_BEGIN));
-
- PlaySoundToAll(SOUND_BG_START);
- if(sWorld.getConfig(CONFIG_BG_START_MUSIC))
- PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC - Custom config
- SetStatus(STATUS_IN_PROGRESS);
-
- for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if(Player* plr = objmgr.GetPlayer(itr->first))
- plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
- }
- }
- else if(GetStatus() == STATUS_IN_PROGRESS)
+ if (GetStatus() == STATUS_IN_PROGRESS)
{
- if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
+ if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;
- if(m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
+ if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlag(ALLIANCE, true);
}
}
- if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
+ if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;
- if(m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
+ if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)
{
m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;
RespawnFlagAfterDrop(ALLIANCE);
}
}
- if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
+ if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)
{
m_FlagsTimer[BG_TEAM_HORDE] -= diff;
- if(m_FlagsTimer[BG_TEAM_HORDE] < 0)
+ if (m_FlagsTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsTimer[BG_TEAM_HORDE] = 0;
RespawnFlag(HORDE, true);
}
}
- if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
+ if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
{
m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;
- if(m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
+ if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)
{
m_FlagsDropTimer[BG_TEAM_HORDE] = 0;
RespawnFlagAfterDrop(HORDE);
@@ -177,6 +112,33 @@ void BattleGroundWS::Update(time_t diff)
}
}
+void BattleGroundWS::StartingEventCloseDoors()
+{
+ for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; i++)
+ {
+ DoorClose(i);
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+ }
+ for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
+ SpawnBGObject(i, RESPAWN_ONE_DAY);
+}
+
+void BattleGroundWS::StartingEventOpenDoors()
+{
+ for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; i++)
+ DoorOpen(i);
+ for(uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; i++)
+ DoorOpen(i);
+
+ SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY);
+ SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY);
+ SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY);
+ SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
+
+ for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; i++)
+ SpawnBGObject(i, RESPAWN_IMMEDIATELY);
+}
+
void BattleGroundWS::AddPlayer(Player *plr)
{
BattleGround::AddPlayer(plr);
@@ -188,7 +150,7 @@ void BattleGroundWS::AddPlayer(Player *plr)
void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
{
- if(Team == ALLIANCE)
+ if (Team == ALLIANCE)
{
sLog.outDebug("Respawn Alliance flag");
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
@@ -199,37 +161,37 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
}
- if(captured)
+ if (captured)
{
//when map_update will be allowed for battlegrounds this code will be useless
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
- SendMessageToAll(GetTrinityString(LANG_BG_WS_F_PLACED));
+ SendMessageToAll(LANG_BG_WS_F_PLACED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
}
}
void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
RespawnFlag(team,false);
- if(team == ALLIANCE)
+ if (team == ALLIANCE)
{
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
- SendMessageToAll(GetTrinityString(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED));
+ SendMessageToAll(LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
else
{
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY);
- SendMessageToAll(GetTrinityString(LANG_BG_WS_HORDE_FLAG_RESPAWNED));
+ SendMessageToAll(LANG_BG_WS_HORDE_FLAG_RESPAWNED, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED);
GameObject *obj = HashMapHolder<GameObject>::Find(GetDroppedFlagGUID(team));
- if(obj)
+ if (obj)
obj->Delete();
else
sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team)));
@@ -239,17 +201,13 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- uint8 type = 0;
uint32 winner = 0;
- const char *message = "";
-
- //TODO FIX reputation and honor gains for low level players!
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
if (!this->IsHordeFlagPickedup())
return;
@@ -258,13 +216,10 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Horde Flag from Player
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
- message = GetTrinityString(LANG_BG_WS_CAPTURED_HF);
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
- if(GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
+ if (GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(ALLIANCE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE);
- RewardReputationToTeam(890, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +35 reputation
- RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], ALLIANCE); // +40 bonushonor
+ RewardReputationToTeam(890, m_ReputationCapture, ALLIANCE);
}
else
{
@@ -275,34 +230,34 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Alliance Flag from Player
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
- message = GetTrinityString(LANG_BG_WS_CAPTURED_AF);
- type = CHAT_MSG_BG_SYSTEM_HORDE;
- if(GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
+ if (GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE)
AddPoint(HORDE, 1);
PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE);
- RewardReputationToTeam(889, BG_WSG_Reputation[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +35 reputation
- RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_FLAG_CAP], HORDE); // +40 bonushonor
+ RewardReputationToTeam(889, m_ReputationCapture, HORDE);
}
+ //for flag capture is reward 2 honorable kills
+ RewardHonorToTeam(GetBonusHonorFromKill(2), Source->GetTeam());
SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME);
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ if (Source->GetTeam() == ALLIANCE)
+ SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
+ else
+ SendMessageToAll(LANG_BG_WS_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE, Source);
UpdateFlagState(Source->GetTeam(), 1); // flag state none
UpdateTeamScore(Source->GetTeam());
// only flag capture should be updated
- UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures...
+ UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
- if(GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
+ if (GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
winner = ALLIANCE;
- if(GetTeamScore(HORDE) == BG_WS_MAX_TEAM_SCORE)
+ if (GetTeamScore(HORDE) == BG_WS_MAX_TEAM_SCORE)
winner = HORDE;
- if(winner)
+ if (winner)
{
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 0);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 0);
@@ -320,15 +275,15 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
{
// if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
// just take off the aura
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
- if(!this->IsHordeFlagPickedup())
+ if (!this->IsHordeFlagPickedup())
return;
- if(GetHordeFlagPickerGUID() == Source->GetGUID())
+ if (GetHordeFlagPickerGUID() == Source->GetGUID())
{
SetHordeFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
@@ -336,9 +291,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
}
else
{
- if(!this->IsAllianceFlagPickedup())
+ if (!this->IsAllianceFlagPickedup())
return;
- if(GetAllianceFlagPickerGUID() == Source->GetGUID())
+ if (GetAllianceFlagPickerGUID() == Source->GetGUID())
{
SetAllianceFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
@@ -347,36 +302,30 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
return;
}
- const char *message = "";
- uint8 type = 0;
bool set = false;
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
- if(!this->IsHordeFlagPickedup())
+ if (!IsHordeFlagPickedup())
return;
- if(GetHordeFlagPickerGUID() == Source->GetGUID())
+ if (GetHordeFlagPickerGUID() == Source->GetGUID())
{
SetHordeFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND;
- message = GetTrinityString(LANG_BG_WS_DROPPED_HF);
- type = CHAT_MSG_BG_SYSTEM_HORDE;
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
set = true;
}
}
else
{
- if(!this->IsAllianceFlagPickedup())
+ if (!IsAllianceFlagPickedup())
return;
- if(GetAllianceFlagPickerGUID() == Source->GetGUID())
+ if (GetAllianceFlagPickerGUID() == Source->GetGUID())
{
SetAllianceFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND;
- message = GetTrinityString(LANG_BG_WS_DROPPED_AF);
- type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
set = true;
}
@@ -387,14 +336,16 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
UpdateFlagState(Source->GetTeam(), 1);
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
-
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
+ {
+ SendMessageToAll(LANG_BG_WS_DROPPED_HF, CHAT_MSG_BG_SYSTEM_HORDE, Source);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, uint32(-1));
+ }
else
+ {
+ SendMessageToAll(LANG_BG_WS_DROPPED_AF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, uint32(-1));
+ }
m_FlagsDropTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] = BG_WS_FLAG_DROP_TIME;
}
@@ -402,17 +353,17 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
- const char *message;
- uint8 type = 0;
+ int32 message_id = 0;
+ ChatMsg type;
//alliance flag picked up from base
if(Source->GetTeam() == HORDE && this->GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE
&& this->m_BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID())
{
- message = GetTrinityString(LANG_BG_WS_PICKEDUP_AF);
+ message_id = LANG_BG_WS_PICKEDUP_AF;
type = CHAT_MSG_BG_SYSTEM_HORDE;
PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_ONE_DAY);
@@ -428,7 +379,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
if (Source->GetTeam() == ALLIANCE && this->GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE
&& this->m_BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID())
{
- message = GetTrinityString(LANG_BG_WS_PICKEDUP_HF);
+ message_id = LANG_BG_WS_PICKEDUP_HF;
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_ONE_DAY);
@@ -441,11 +392,11 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
}
//Alliance flag on ground(not in base) (returned or picked up again from ground!)
- if(this->GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->id == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY)
+ if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
{
- if(Source->GetTeam() == ALLIANCE)
+ if (Source->GetTeam() == ALLIANCE)
{
- message = GetTrinityString(LANG_BG_WS_RETURNED_AF);
+ message_id = LANG_BG_WS_RETURNED_AF;
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_WAIT_RESPAWN);
RespawnFlag(ALLIANCE, false);
@@ -455,7 +406,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
}
else
{
- message = GetTrinityString(LANG_BG_WS_PICKEDUP_AF);
+ message_id = LANG_BG_WS_PICKEDUP_AF;
type = CHAT_MSG_BG_SYSTEM_HORDE;
PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_ONE_DAY);
@@ -470,11 +421,11 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
}
//Horde flag on ground(not in base) (returned or picked up again)
- if(this->GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->id == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY)
+ if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10))
{
- if(Source->GetTeam() == HORDE)
+ if (Source->GetTeam() == HORDE)
{
- message = GetTrinityString(LANG_BG_WS_RETURNED_HF);
+ message_id = LANG_BG_WS_RETURNED_HF;
type = CHAT_MSG_BG_SYSTEM_HORDE;
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_WAIT_RESPAWN);
RespawnFlag(HORDE, false);
@@ -484,7 +435,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
}
else
{
- message = GetTrinityString(LANG_BG_WS_PICKEDUP_HF);
+ message_id = LANG_BG_WS_PICKEDUP_HF;
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP);
SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_ONE_DAY);
@@ -498,21 +449,19 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
//target_obj->Delete();
}
- if (!type)
+ if (!message_id)
return;
- WorldPacket data;
- ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
- SendPacketToAll(&data);
+ SendMessageToAll(message_id, type, Source);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
}
void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
{
// sometimes flag aura not removed :(
- if(IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
+ if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
{
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
this->SetAllianceFlagPicker(0);
@@ -521,9 +470,9 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
else
this->EventPlayerDroppedFlag(plr);
}
- if(IsHordeFlagPickedup() && m_FlagKeepers[BG_TEAM_HORDE] == guid)
+ if (IsHordeFlagPickedup() && m_FlagKeepers[BG_TEAM_HORDE] == guid)
{
- if(!plr)
+ if (!plr)
{
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
this->SetHordeFlagPicker(0);
@@ -536,7 +485,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
{
- if(team == ALLIANCE)
+ if (team == ALLIANCE)
UpdateWorldState(BG_WS_FLAG_STATE_ALLIANCE, value);
else
UpdateWorldState(BG_WS_FLAG_STATE_HORDE, value);
@@ -544,7 +493,7 @@ void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
void BattleGroundWS::UpdateTeamScore(uint32 team)
{
- if(team == ALLIANCE)
+ if (team == ALLIANCE)
UpdateWorldState(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(team));
else
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
@@ -553,7 +502,7 @@ void BattleGroundWS::UpdateTeamScore(uint32 team)
void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
@@ -579,13 +528,13 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
//buff_guid = m_BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
break;
case 3646: // Alliance Flag spawn
- if(m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
- if(GetHordeFlagPickerGUID() == Source->GetGUID())
+ if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
+ if (GetHordeFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3647: // Horde Flag spawn
- if(m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
- if(GetAllianceFlagPickerGUID() == Source->GetGUID())
+ if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
+ if (GetAllianceFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3649: // unk1
@@ -599,14 +548,14 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
}
- //if(buff_guid)
+ //if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
}
bool BattleGroundWS::SetupBattleGround()
{
// flags
- if( !AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
+ if (!AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
|| !AddObject(BG_WS_OBJECT_H_FLAG, BG_OBJECT_H_FLAG_WS_ENTRY, 916.0226f, 1434.405f, 345.413f, 0.01745329f, 0, 0, 0.008726535f, 0.9999619f, BG_WS_FLAG_RESPAWN_TIME/1000)
// buffs
|| !AddObject(BG_WS_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1449.93f, 1470.71f, 342.6346f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, BUFF_RESPAWN_TIME)
@@ -634,14 +583,14 @@ bool BattleGroundWS::SetupBattleGround()
}
WorldSafeLocsEntry const *sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
- if(!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
+ if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! BattleGround not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
- if(!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
+ if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! BattleGround not created!");
return false;
@@ -652,8 +601,11 @@ bool BattleGroundWS::SetupBattleGround()
return true;
}
-void BattleGroundWS::ResetBGSubclass()
+void BattleGroundWS::Reset()
{
+ //call parent's class reset
+ BattleGround::Reset();
+
m_FlagKeepers[BG_TEAM_ALLIANCE] = 0;
m_FlagKeepers[BG_TEAM_HORDE] = 0;
m_DroppedFlagGUID[BG_TEAM_ALLIANCE] = 0;
@@ -662,19 +614,36 @@ void BattleGroundWS::ResetBGSubclass()
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
m_TeamScores[BG_TEAM_HORDE] = 0;
+ bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call!
+ m_ReputationCapture = (isBGWeekend) ? 45 : 35;
+ m_HonorWinKills = (isBGWeekend) ? 3 : 1;
+ m_HonorEndKills = (isBGWeekend) ? 4 : 2;
/* Spirit nodes is static at this BG and then not required deleting at BG reset.
- if(m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
+ if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])
DelCreature(WS_SPIRIT_MAIN_ALLIANCE);
-
- if(m_BgCreatures[WS_SPIRIT_MAIN_HORDE])
+ if (m_BgCreatures[WS_SPIRIT_MAIN_HORDE])
DelCreature(WS_SPIRIT_MAIN_HORDE);
*/
}
+void BattleGroundWS::EndBattleGround(uint32 winner)
+{
+ //win reward
+ if (winner == ALLIANCE)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE);
+ if (winner == HORDE)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE);
+ //complete map_end rewards (even if no team wins)
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
+ RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
+
+ BattleGround::EndBattleGround(winner);
+}
+
void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)
{
- if(GetStatus() != STATUS_IN_PROGRESS)
+ if (GetStatus() != STATUS_IN_PROGRESS)
return;
EventPlayerDroppedFlag(player);
@@ -704,19 +673,42 @@ void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value
}
}
+WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
+{
+ //if status in progress, it returns main graveyards with spiritguides
+ //else it will return the graveyard in the flagroom - this is especially good
+ //if a player dies in preparation phase - then the player can't cheat
+ //and teleport to the graveyard outside the flagroom
+ //and start running around, while the doors are still closed
+ if (player->GetTeam() == ALLIANCE)
+ {
+ if (GetStatus() == STATUS_IN_PROGRESS)
+ return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
+ else
+ return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_ALLIANCE);
+ }
+ else
+ {
+ if (GetStatus() == STATUS_IN_PROGRESS)
+ return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
+ else
+ return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_FLAGROOM_HORDE);
+ }
+}
+
void BattleGroundWS::FillInitialWorldStates(WorldPacket& data)
{
data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(ALLIANCE));
data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(HORDE));
- if(m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
+ if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(-1);
else if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(1);
else
data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(0);
- if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
+ if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(-1);
else if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(1);
diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h
index 4e57826cd30..906bccfe6ab 100644
--- a/src/game/BattleGroundWS.h
+++ b/src/game/BattleGroundWS.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ enum BG_WS_TimerOrScore
BG_WS_FLAG_RESPAWN_TIME = 23000,
BG_WS_FLAG_DROP_TIME = 10000,
BG_WS_SPELL_FORCE_TIME = 600000,
- BG_WS_SPELL_BRUTAL_TIME = 900000
+ BG_WS_SPELL_BRUTAL_TIME = 900000
};
enum BG_WS_Sound
@@ -116,8 +116,10 @@ enum BG_WS_FlagState
enum BG_WS_Graveyards
{
- WS_GRAVEYARD_MAIN_ALLIANCE = 771,
- WS_GRAVEYARD_MAIN_HORDE = 772
+ WS_GRAVEYARD_FLAGROOM_ALLIANCE = 769,
+ WS_GRAVEYARD_FLAGROOM_HORDE = 770,
+ WS_GRAVEYARD_MAIN_ALLIANCE = 771,
+ WS_GRAVEYARD_MAIN_HORDE = 772
};
enum BG_WS_CreatureTypes
@@ -145,10 +147,12 @@ class BattleGroundWS : public BattleGround
/* Construction */
BattleGroundWS();
~BattleGroundWS();
- void Update(time_t diff);
+ void Update(uint32 diff);
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
+ virtual void StartingEventCloseDoors();
+ virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
@@ -174,7 +178,9 @@ class BattleGroundWS : public BattleGround
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleKillPlayer(Player *player, Player *killer);
bool SetupBattleGround();
- virtual void ResetBGSubclass();
+ virtual void Reset();
+ void EndBattleGround(uint32 winner);
+ virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
void UpdateFlagState(uint32 team, uint32 value);
void UpdateTeamScore(uint32 team);
@@ -185,9 +191,9 @@ class BattleGroundWS : public BattleGround
/* Scorekeeping */
uint32 GetTeamScore(uint32 TeamID) const { return m_TeamScores[GetTeamIndexByTeamId(TeamID)]; }
- void AddPoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] += Points; m_score[GetTeamIndexByTeamId(TeamID)] = m_TeamScores[GetTeamIndexByTeamId(TeamID)];}
- void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; m_score[GetTeamIndexByTeamId(TeamID)] = m_TeamScores[GetTeamIndexByTeamId(TeamID)];}
- void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; m_score[GetTeamIndexByTeamId(TeamID)] = m_TeamScores[GetTeamIndexByTeamId(TeamID)]; }
+ void AddPoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] += Points; }
+ void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; }
+ void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; }
private:
uint64 m_FlagKeepers[2]; // 0 - alliance, 1 - horde
@@ -197,8 +203,9 @@ class BattleGroundWS : public BattleGround
int32 m_FlagsTimer[2];
int32 m_FlagsDropTimer[2];
- int32 m_FlagSpellForceTimer;
- int32 m_FlagSpellBrutalTimer;
+ uint32 m_ReputationCapture;
+ uint32 m_HonorWinKills;
+ uint32 m_HonorEndKills;
};
#endif
diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt
index 316eb8a659c..081d9669696 100644
--- a/src/game/CMakeLists.txt
+++ b/src/game/CMakeLists.txt
@@ -4,6 +4,8 @@
SET(game_STAT_SRCS
AccountMgr.cpp
AccountMgr.h
+ AchievementMgr.h
+ AchievementMgr.cpp
AddonHandler.cpp
AddonHandler.h
AggressorAI.cpp
@@ -12,9 +14,9 @@ SET(game_STAT_SRCS
ArenaTeam.cpp
ArenaTeam.h
ArenaTeamHandler.cpp
+ AuctionHouseHandler.cpp
AuctionHouseBot.cpp
AuctionHouseBot.h
- AuctionHouseHandler.cpp
AuctionHouseMgr.cpp
AuctionHouseMgr.h
Bag.cpp
@@ -24,22 +26,31 @@ SET(game_STAT_SRCS
BattleGroundAB.cpp
BattleGroundAV.cpp
BattleGroundBE.cpp
+ BattleGroundDS.cpp
BattleGroundEY.cpp
BattleGroundNA.cpp
BattleGroundRL.cpp
+ BattleGroundRV.cpp
+ BattleGroundSA.cpp
BattleGroundWS.cpp
BattleGround.h
BattleGroundAA.h
BattleGroundAB.h
BattleGroundAV.h
BattleGroundBE.h
+ BattleGroundDS.h
BattleGroundEY.h
BattleGroundNA.h
BattleGroundRL.h
+ BattleGroundRV.h
+ BattleGroundSA.h
BattleGroundWS.h
BattleGroundHandler.cpp
BattleGroundMgr.cpp
BattleGroundMgr.h
+ Calendar.cpp
+ Calendar.h
+ CalendarHandler.cpp
Cell.h
CellImpl.h
Channel.cpp
@@ -62,10 +73,17 @@ SET(game_STAT_SRCS
CreatureAIRegistry.h
CreatureAISelector.cpp
CreatureAISelector.h
+ CreatureEventAI.cpp
+ CreatureEventAIMgr.cpp
Creature.cpp
Creature.h
CreatureGroups.cpp
CreatureGroups.h
+ DBCEnums.h
+ DBCStores.cpp
+ DBCStores.h
+ DBCStructure.h
+ DBCfmt.h
Debugcmds.cpp
DestinationHolder.cpp
DestinationHolder.h
@@ -76,8 +94,8 @@ SET(game_STAT_SRCS
FleeingMovementGenerator.cpp
FleeingMovementGenerator.h
Formulas.h
- GameEvent.cpp
- GameEvent.h
+ GameEventMgr.cpp
+ GameEventMgr.h
GameObject.cpp
GameObject.h
GlobalEvents.cpp
@@ -131,6 +149,8 @@ SET(game_STAT_SRCS
MapInstanced.h
MapManager.cpp
MapManager.h
+ MapReference.h
+ MapRefManager.h
MiscHandler.cpp
MotionMaster.cpp
MotionMaster.h
@@ -151,6 +171,8 @@ SET(game_STAT_SRCS
Object.h
ObjectMgr.cpp
ObjectMgr.h
+ ObjectPosSelector.cpp
+ ObjectPosSelector.h
Opcodes.cpp
Opcodes.h
OutdoorPvP.cpp
@@ -184,6 +206,8 @@ SET(game_STAT_SRCS
PlayerDump.h
PointMovementGenerator.cpp
PointMovementGenerator.h
+ PoolHandler.cpp
+ PoolHandler.h
PossessedAI.cpp
PossessedAI.h
QueryHandler.cpp
@@ -194,6 +218,8 @@ SET(game_STAT_SRCS
RandomMovementGenerator.h
ReactorAI.cpp
ReactorAI.h
+ ReputationMgr.cpp
+ ReputationMgr.h
ScriptCalls.cpp
ScriptCalls.h
SharedDefines.h
@@ -221,7 +247,7 @@ SET(game_STAT_SRCS
TemporarySummon.h
TicketHandler.cpp
TicketMgr.cpp
- TicketMgr.h
+ TicketMgr.h
Tools.cpp
Tools.h
TotemAI.cpp
@@ -241,6 +267,8 @@ SET(game_STAT_SRCS
UpdateData.h
UpdateFields.h
UpdateMask.h
+ Vehicle.cpp
+ Vehicle.h
VoiceChatHandler.cpp
WaypointManager.cpp
WaypointManager.h
@@ -267,4 +295,4 @@ SET(game_STAT_SRCS
)
add_library(game STATIC ${game_STAT_SRCS})
-ADD_DEPENDENCIES(game revision.h) \ No newline at end of file
+ADD_DEPENDENCIES(game revision.h)
diff --git a/src/game/Calendar.cpp b/src/game/Calendar.cpp
new file mode 100644
index 00000000000..0c1efb20f87
--- /dev/null
+++ b/src/game/Calendar.cpp
@@ -0,0 +1,17 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
diff --git a/src/game/Calendar.h b/src/game/Calendar.h
new file mode 100644
index 00000000000..7a86afa7db7
--- /dev/null
+++ b/src/game/Calendar.h
@@ -0,0 +1,26 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_CALENDAR_H
+#define MANGOS_CALENDAR_H
+
+class Calendar
+{
+
+};
+#endif
diff --git a/src/game/CalendarHandler.cpp b/src/game/CalendarHandler.cpp
new file mode 100644
index 00000000000..e9946e1a05e
--- /dev/null
+++ b/src/game/CalendarHandler.cpp
@@ -0,0 +1,159 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Common.h"
+#include "Log.h"
+#include "Player.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
+#include "Opcodes.h"
+#include "InstanceSaveMgr.h"
+
+void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
+ recv_data.hexlike();
+
+ time_t cur_time = time(NULL);
+
+ WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4);
+
+ // TODO: calendar invite event output
+ data << (uint32) 0; //invite node count
+ // TODO: calendar event output
+ data << (uint32) 0; //event count
+
+ data << (uint32) 0; //wtf??
+ data << (uint32) secsToTimeBitFields(cur_time); // current time
+
+ uint32 counter = 0;
+ size_t p_counter = data.wpos();
+ data << uint32(counter); // instance save count
+
+ for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
+ {
+ for (Player::BoundInstancesMap::iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr)
+ {
+ if(itr->second.perm)
+ {
+ InstanceSave *save = itr->second.save;
+ data << uint32(save->GetMapId());
+ data << uint32(save->GetDifficulty());
+ data << uint32(save->GetResetTime() - cur_time);
+ data << uint64(save->GetInstanceId()); // instance save id as unique instance copy id
+ ++counter;
+ }
+ }
+ }
+ data.put<uint32>(p_counter,counter);
+
+ data << (uint32) 1135753200; //wtf?? (28.12.2005 12:00)
+ data << (uint32) 0; // unk counter 4
+ data << (uint32) 0; // unk counter 5
+ //sLog.outDebug("Sending calendar");
+ //data.hexlike();
+ SendPacket(&data);
+}
+
+void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_ADD_EVENT");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarUpdateEvent(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_UPDATE_EVENT");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarRemoveEvent(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_REMOVE_EVENT");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarCopyEvent(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_COPY_EVENT");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarEventInvite(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_INVITE");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarEventRsvp(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_RSVP");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarEventStatus(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_STATUS");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarComplain(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_COMPLAIN");
+ recv_data.hexlike();
+}
+
+void WorldSession::HandleCalendarGetNumPending(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING");
+ recv_data.hexlike();
+
+ WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4);
+ data << uint32(0); // 0 - no pending invites, 1 - some pending invites
+ SendPacket(&data);
+}
diff --git a/src/game/Cell.h b/src/game/Cell.h
index 160e037bcfb..7e66d5d9f73 100644
--- a/src/game/Cell.h
+++ b/src/game/Cell.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -93,13 +93,13 @@ struct TRINITY_DLL_DECL Cell
y = data.Part.grid_y*MAX_NUMBER_OF_CELLS + data.Part.cell_y;
}
- inline bool DiffCell(const Cell &cell) const
+ bool DiffCell(const Cell &cell) const
{
return( data.Part.cell_x != cell.data.Part.cell_x ||
data.Part.cell_y != cell.data.Part.cell_y );
}
- inline bool DiffGrid(const Cell &cell) const
+ bool DiffGrid(const Cell &cell) const
{
return( data.Part.grid_x != cell.data.Part.grid_x ||
data.Part.grid_y != cell.data.Part.grid_y );
diff --git a/src/game/CellImpl.h b/src/game/CellImpl.h
index 463b051f7ac..e74e0013a19 100644
--- a/src/game/CellImpl.h
+++ b/src/game/CellImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp
index bf787d7d25d..8d61dd733ea 100644
--- a/src/game/Channel.cpp
+++ b/src/game/Channel.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include "SocialMgr.h"
Channel::Channel(const std::string& name, uint32 channel_id)
-: m_name(name), m_announce(true), m_moderate(false), m_channelId(channel_id), m_ownerGUID(0), m_password(""), m_flags(0)
+: m_announce(true), m_moderate(false), m_name(name), m_flags(0), m_channelId(channel_id), m_ownerGUID(0)
{
// set special flags if built-in channel
ChatChannelsEntry const* ch = GetChannelEntryFor(channel_id);
@@ -455,7 +455,7 @@ void Channel::List(Player* player)
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
- if( plr && ( plr->GetSession()->GetSecurity() == SEC_PLAYER || gmInWhoList && plr->IsVisibleGloballyFor(player) ) )
+ if (plr && ( plr->GetSession()->GetSecurity() == SEC_PLAYER || (gmInWhoList && plr->IsVisibleGloballyFor(player))))
{
data << uint64(i->first);
data << uint8(i->second.flags); // flags seems to be changed...
@@ -693,12 +693,12 @@ void Channel::SendToOne(WorldPacket *data, uint64 who)
plr->GetSession()->SendPacket(data);
}
-void Channel::Voice(uint64 guid1, uint64 guid2)
+void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/)
{
}
-void Channel::DeVoice(uint64 guid1, uint64 guid2)
+void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/)
{
}
diff --git a/src/game/Channel.h b/src/game/Channel.h
index 82b62df12c4..924046e4739 100644
--- a/src/game/Channel.h
+++ b/src/game/Channel.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
#include "Common.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "Opcodes.h"
#include "Player.h"
@@ -31,95 +30,95 @@
#include <map>
#include <string>
-class Channel
+enum ChatNotify
{
- enum ChatNotify
- {
- CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel.";
- CHAT_LEFT_NOTICE = 0x01, //+ "%s left channel.";
- //CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel.";
- CHAT_YOU_JOINED_NOTICE = 0x02, //+ "Joined Channel: [%s]"; -- You joined
- //CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]";
- CHAT_YOU_LEFT_NOTICE = 0x03, //+ "Left Channel: [%s]"; -- You left
- CHAT_WRONG_PASSWORD_NOTICE = 0x04, //+ "Wrong password for %s.";
- CHAT_NOT_MEMBER_NOTICE = 0x05, //+ "Not on channel %s.";
- CHAT_NOT_MODERATOR_NOTICE = 0x06, //+ "Not a moderator of %s.";
- CHAT_PASSWORD_CHANGED_NOTICE = 0x07, //+ "[%s] Password changed by %s.";
- CHAT_OWNER_CHANGED_NOTICE = 0x08, //+ "[%s] Owner changed to %s.";
- CHAT_PLAYER_NOT_FOUND_NOTICE = 0x09, //+ "[%s] Player %s was not found.";
- CHAT_NOT_OWNER_NOTICE = 0x0A, //+ "[%s] You are not the channel owner.";
- CHAT_CHANNEL_OWNER_NOTICE = 0x0B, //+ "[%s] Channel owner is %s.";
- CHAT_MODE_CHANGE_NOTICE = 0x0C, //?
- CHAT_ANNOUNCEMENTS_ON_NOTICE = 0x0D, //+ "[%s] Channel announcements enabled by %s.";
- CHAT_ANNOUNCEMENTS_OFF_NOTICE = 0x0E, //+ "[%s] Channel announcements disabled by %s.";
- CHAT_MODERATION_ON_NOTICE = 0x0F, //+ "[%s] Channel moderation enabled by %s.";
- 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 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 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.";
- CHAT_WRONG_FACTION_NOTICE = 0x1A, //+ "Wrong alliance for %s.";
- 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 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.
- CHAT_VOICE_ON_NOTICE = 0x22, //+ "[%s] Channel voice enabled by %s.";
- CHAT_VOICE_OFF_NOTICE = 0x23, //+ "[%s] Channel voice disabled by %s.";
- };
+ CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel.";
+ CHAT_LEFT_NOTICE = 0x01, //+ "%s left channel.";
+ //CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel.";
+ CHAT_YOU_JOINED_NOTICE = 0x02, //+ "Joined Channel: [%s]"; -- You joined
+ //CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]";
+ CHAT_YOU_LEFT_NOTICE = 0x03, //+ "Left Channel: [%s]"; -- You left
+ CHAT_WRONG_PASSWORD_NOTICE = 0x04, //+ "Wrong password for %s.";
+ CHAT_NOT_MEMBER_NOTICE = 0x05, //+ "Not on channel %s.";
+ CHAT_NOT_MODERATOR_NOTICE = 0x06, //+ "Not a moderator of %s.";
+ CHAT_PASSWORD_CHANGED_NOTICE = 0x07, //+ "[%s] Password changed by %s.";
+ CHAT_OWNER_CHANGED_NOTICE = 0x08, //+ "[%s] Owner changed to %s.";
+ CHAT_PLAYER_NOT_FOUND_NOTICE = 0x09, //+ "[%s] Player %s was not found.";
+ CHAT_NOT_OWNER_NOTICE = 0x0A, //+ "[%s] You are not the channel owner.";
+ CHAT_CHANNEL_OWNER_NOTICE = 0x0B, //+ "[%s] Channel owner is %s.";
+ CHAT_MODE_CHANGE_NOTICE = 0x0C, //?
+ CHAT_ANNOUNCEMENTS_ON_NOTICE = 0x0D, //+ "[%s] Channel announcements enabled by %s.";
+ CHAT_ANNOUNCEMENTS_OFF_NOTICE = 0x0E, //+ "[%s] Channel announcements disabled by %s.";
+ CHAT_MODERATION_ON_NOTICE = 0x0F, //+ "[%s] Channel moderation enabled by %s.";
+ 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 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 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.";
+ CHAT_WRONG_FACTION_NOTICE = 0x1A, //+ "Wrong alliance for %s.";
+ 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 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.
+ CHAT_VOICE_ON_NOTICE = 0x22, //+ "[%s] Channel voice enabled by %s.";
+ CHAT_VOICE_OFF_NOTICE = 0x23, //+ "[%s] Channel voice disabled by %s.";
+};
- enum ChannelFlags
- {
- CHANNEL_FLAG_NONE = 0x00,
- CHANNEL_FLAG_CUSTOM = 0x01,
- // 0x02
- CHANNEL_FLAG_TRADE = 0x04,
- CHANNEL_FLAG_NOT_LFG = 0x08,
- CHANNEL_FLAG_GENERAL = 0x10,
- CHANNEL_FLAG_CITY = 0x20,
- CHANNEL_FLAG_LFG = 0x40,
- CHANNEL_FLAG_VOICE = 0x80
- // General 0x18 = 0x10 | 0x08
- // Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
- // LocalDefence 0x18 = 0x10 | 0x08
- // GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
- // LookingForGroup 0x50 = 0x40 | 0x10
- };
+enum ChannelFlags
+{
+ CHANNEL_FLAG_NONE = 0x00,
+ CHANNEL_FLAG_CUSTOM = 0x01,
+ // 0x02
+ CHANNEL_FLAG_TRADE = 0x04,
+ CHANNEL_FLAG_NOT_LFG = 0x08,
+ CHANNEL_FLAG_GENERAL = 0x10,
+ CHANNEL_FLAG_CITY = 0x20,
+ CHANNEL_FLAG_LFG = 0x40,
+ CHANNEL_FLAG_VOICE = 0x80
+ // General 0x18 = 0x10 | 0x08
+ // Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
+ // LocalDefence 0x18 = 0x10 | 0x08
+ // GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
+ // LookingForGroup 0x50 = 0x40 | 0x10
+};
- enum ChannelDBCFlags
- {
- CHANNEL_DBC_FLAG_NONE = 0x00000,
- CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG
- CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment
- CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense
- CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade
- CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment
- CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment
- CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense
- CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment
- CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup
- };
+enum ChannelDBCFlags
+{
+ CHANNEL_DBC_FLAG_NONE = 0x00000,
+ CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG
+ CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment
+ CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense
+ CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade
+ CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment
+ CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment
+ CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense
+ CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment
+ CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup
+};
- enum ChannelMemberFlags
- {
- MEMBER_FLAG_NONE = 0x00,
- MEMBER_FLAG_OWNER = 0x01,
- MEMBER_FLAG_MODERATOR = 0x02,
- MEMBER_FLAG_VOICED = 0x04,
- MEMBER_FLAG_MUTED = 0x08,
- MEMBER_FLAG_CUSTOM = 0x10,
- MEMBER_FLAG_MIC_MUTED = 0x20,
- // 0x40
- // 0x80
- };
+enum ChannelMemberFlags
+{
+ MEMBER_FLAG_NONE = 0x00,
+ MEMBER_FLAG_OWNER = 0x01,
+ MEMBER_FLAG_MODERATOR = 0x02,
+ MEMBER_FLAG_VOICED = 0x04,
+ MEMBER_FLAG_MUTED = 0x08,
+ MEMBER_FLAG_CUSTOM = 0x10,
+ MEMBER_FLAG_MIC_MUTED = 0x20,
+ // 0x40
+ // 0x80
+};
+class Channel
+{
struct PlayerInfo
{
uint64 player;
@@ -204,11 +203,8 @@ class Channel
void SendToAllButOne(WorldPacket *data, uint64 who);
void SendToOne(WorldPacket *data, uint64 who);
- bool IsOn(uint64 who) const { return players.count(who) != 0; }
-
- bool IsBanned(const uint64 guid) const {return banned.count(guid) != 0; }
-
- bool IsFirst() const { return !(players.size() > 1); }
+ bool IsOn(uint64 who) const { return players.find(who) != players.end(); }
+ bool IsBanned(uint64 guid) const { return banned.find(guid) != banned.end(); }
uint8 GetPlayerFlags(uint64 p) const
{
diff --git a/src/game/ChannelHandler.cpp b/src/game/ChannelHandler.cpp
index 71e7ea365c2..9b06693c589 100644
--- a/src/game/ChannelHandler.cpp
+++ b/src/game/ChannelHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ChannelMgr.h b/src/game/ChannelMgr.h
index 453ee144d86..66f692ef69c 100644
--- a/src/game/ChannelMgr.h
+++ b/src/game/ChannelMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ class ChannelMgr
}
Channel *GetJoinChannel(const std::string& name, uint32 channel_id)
{
- if(channels.count(name) == 0)
+ if (channels.find(name) == channels.end())
{
Channel *nchan = new Channel(name,channel_id);
channels[name] = nchan;
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 4aef21df530..a2e189603f9 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@
#include "Guild.h"
#include "UpdateMask.h"
#include "Auth/md5.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Group.h"
#include "Database/DatabaseImpl.h"
@@ -64,11 +63,11 @@ bool LoginQueryHolder::Initialize()
// NOTE: all fields in `characters` must be read to prevent lost character data at next save in case wrong DB structure.
// !!! NOTE: including unused `zone`,`online`
- res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADFROM, "SELECT guid, account, data, name, race, class, 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, dungeon_difficulty, arena_pending_points FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADFROM, "SELECT guid, account, data, name, race, class, 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, dungeon_difficulty, arena_pending_points,bgid,bgteam,bgmap,bgx,bgy,bgz,bgo FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
- res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
- res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,slot,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest,time FROM character_queststatus_daily WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADTUTORIALS, "SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u' AND realmid = '%u'", GetAccountId(), realmID);
@@ -85,6 +84,8 @@ bool LoginQueryHolder::Initialize()
// in other case still be dummy query
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGUILD, "SELECT guildid,rank FROM guild_member WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADARENAINFO, "SELECT arenateamid, played_week, played_season, personal_rating FROM arena_team_member WHERE guid='%u'", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = '%u'", GUID_LOPART(m_guid));
+ res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS,"SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = '%u'", GUID_LOPART(m_guid));
return res;
}
@@ -164,7 +165,7 @@ void WorldSession::HandleCharEnumOpcode( WorldPacket & /*recv_data*/ )
"SELECT characters.guid, characters.data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, "
// 9 10 11 12 13
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, guild_member.guildid "
- "FROM characters LEFT JOIN character_pet ON characters.guid=character_pet.owner AND character_pet.slot='0' "
+ "FROM characters LEFT JOIN character_pet ON characters.guid=character_pet.owner AND character_pet.slot='%u' "
"LEFT JOIN guild_member ON characters.guid = guild_member.guid "
"WHERE characters.account = '%u' ORDER BY characters.guid"
:
@@ -173,11 +174,11 @@ void WorldSession::HandleCharEnumOpcode( WorldPacket & /*recv_data*/ )
"SELECT characters.guid, characters.data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, "
// 9 10 11 12 13 14
"characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, guild_member.guildid, genitive "
- "FROM characters LEFT JOIN character_pet ON characters.guid = character_pet.owner AND character_pet.slot='0' "
+ "FROM characters LEFT JOIN character_pet ON characters.guid = character_pet.owner AND character_pet.slot='%u' "
"LEFT JOIN character_declinedname ON characters.guid = character_declinedname.guid "
"LEFT JOIN guild_member ON characters.guid = guild_member.guid "
"WHERE characters.account = '%u' ORDER BY characters.guid",
- GetAccountId());
+ PET_SAVE_AS_CURRENT,GetAccountId());
}
void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
@@ -234,17 +235,16 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
if (raceEntry->addon > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION;
- sLog.outError("Not Expansion 1 account:[%d] but tried to Create character with expansion 1 race (%u)",GetAccountId(),race_);
+ sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)",Expansion(),GetAccountId(),raceEntry->addon,race_);
SendPacket( &data );
return;
}
// prevent character creating Expansion class without Expansion account
- // TODO: use possible addon field in ChrClassesEntry in next dbc version
- if (Expansion() < 2 && class_ == CLASS_DEATH_KNIGHT)
+ if (classEntry->addon > Expansion())
{
- data << (uint8)CHAR_CREATE_EXPANSION;
- sLog.outError("Not Expansion 2 account:[%d] but tried to Create character with expansion 2 class (%u)",GetAccountId(),class_);
+ data << (uint8)CHAR_CREATE_EXPANSION_CLASS;
+ sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)",Expansion(),GetAccountId(),classEntry->addon,class_);
SendPacket( &data );
return;
}
@@ -311,29 +311,77 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
}
}
+ // speedup check for heroic class disabled case
+ uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
+ if(heroic_free_slots==0 && GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
+ {
+ data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
+ SendPacket( &data );
+ return;
+ }
+
+ // speedup check for heroic class disabled case
+ uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
+ if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
+ {
+ data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
+ SendPacket( &data );
+ return;
+ }
+
bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
uint32 skipCinematics = sWorld.getConfig(CONFIG_SKIP_CINEMATICS);
bool have_same_race = false;
- if(!AllowTwoSideAccounts || skipCinematics == 1)
+
+ // if 0 then allowed creating without any characters
+ bool have_req_level_for_heroic = (req_level_for_heroic==0);
+
+ if(!AllowTwoSideAccounts || skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT)
{
- QueryResult *result2 = CharacterDatabase.PQuery("SELECT DISTINCT race FROM characters WHERE account = '%u' %s", GetAccountId(),skipCinematics == 1 ? "" : "LIMIT 1");
+ QueryResult *result2 = CharacterDatabase.PQuery("SELECT guid,race,class FROM characters WHERE account = '%u' %s",
+ GetAccountId(), (skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1");
if(result2)
{
uint32 team_= Player::TeamForRace(race_);
Field* field = result2->Fetch();
- uint8 race = field[0].GetUInt32();
+ uint8 acc_race = field[1].GetUInt32();
+
+ if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
+ {
+ uint8 acc_class = field[2].GetUInt32();
+ if(acc_class == CLASS_DEATH_KNIGHT)
+ {
+ if(heroic_free_slots > 0)
+ --heroic_free_slots;
+
+ if(heroic_free_slots==0)
+ {
+ data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
+ SendPacket( &data );
+ return;
+ }
+ }
+
+ if(!have_req_level_for_heroic)
+ {
+ uint32 acc_guid = field[0].GetUInt32();
+ uint32 acc_level = Player::GetUInt32ValueFromDB(UNIT_FIELD_LEVEL,acc_guid);
+ if(acc_level >= req_level_for_heroic)
+ have_req_level_for_heroic = true;
+ }
+ }
// need to check team only for first character
// TODO: what to if account already has characters of both races?
if (!AllowTwoSideAccounts)
{
- uint32 team=0;
- if(race > 0)
- team = Player::TeamForRace(race);
+ uint32 acc_team=0;
+ if(acc_race > 0)
+ acc_team = Player::TeamForRace(acc_race);
- if(team != team_)
+ if(acc_team != team_)
{
data << (uint8)CHAR_CREATE_PVP_TEAMS_VIOLATION;
SendPacket( &data );
@@ -342,20 +390,55 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
}
}
- if (skipCinematics == 1)
+ // search same race for cinematic or same class if need
+ // TODO: check if cinematic already shown? (already logged in?; cinematic field)
+ while ((skipCinematics == 1 && !have_same_race) || class_ == CLASS_DEATH_KNIGHT)
{
- // TODO: check if cinematic already shown? (already logged in?; cinematic field)
- while (race_ != race && result2->NextRow())
+ if(!result2->NextRow())
+ break;
+
+ field = result2->Fetch();
+ acc_race = field[1].GetUInt32();
+
+ if(!have_same_race)
+ have_same_race = race_ == acc_race;
+
+ if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
{
- field = result2->Fetch();
- race = field[0].GetUInt32();
+ uint8 acc_class = field[2].GetUInt32();
+ if(acc_class == CLASS_DEATH_KNIGHT)
+ {
+ if(heroic_free_slots > 0)
+ --heroic_free_slots;
+
+ if(heroic_free_slots==0)
+ {
+ data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
+ SendPacket( &data );
+ return;
+ }
+ }
+
+ if(!have_req_level_for_heroic)
+ {
+ uint32 acc_guid = field[0].GetUInt32();
+ uint32 acc_level = Player::GetUInt32ValueFromDB(UNIT_FIELD_LEVEL,acc_guid);
+ if(acc_level >= req_level_for_heroic)
+ have_req_level_for_heroic = true;
+ }
}
- have_same_race = race_ == race;
}
delete result2;
}
}
+ if(GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && !have_req_level_for_heroic)
+ {
+ data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
+ SendPacket( &data );
+ return;
+ }
+
// extract other data required for player creating
uint8 gender, skin, face, hairStyle, hairColor, facialHair, outfitId;
recv_data >> gender >> skin >> face;
@@ -373,7 +456,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
return;
}
- if(have_same_race && skipCinematics == 1 || skipCinematics == 2)
+ if ((have_same_race && skipCinematics == 1) || skipCinematics == 2)
pNewChar->setCinematic(1); // not show intro
// Player created, save it now
@@ -439,7 +522,7 @@ void WorldSession::HandleCharDeleteOpcode( WorldPacket & recv_data )
return;
std::string IP_str = GetRemoteAddress();
- sLog.outDetail("Account: %d (IP: %s) Delete Character:[%s] (guid:%u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
+ sLog.outDetail("Account: %d (IP: %s) Delete Character:[%s] (guid: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
sLog.outChar("Account: %d (IP: %s) Delete Character:[%s] (guid: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid));
if(sLog.IsOutCharDump()) // optimize GetPlayerDump call
@@ -514,9 +597,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
data << pCurrChar->GetOrientation();
SendPacket(&data);
- data.Initialize( SMSG_ACCOUNT_DATA_TIMES, 128 );
- for(int i = 0; i < 32; i++)
- data << uint32(0);
+ data.Initialize( SMSG_ACCOUNT_DATA_TIMES, 4+1+8*4 ); // changed in WotLK
+ data << uint32(time(NULL)); // unix time of something
+ data << uint8(1);
+ for(int i = 0; i < NUM_ACCOUNT_DATA_TYPES; i++)
+ data << uint32(GetAccountData(i)->Time); // also unix time
SendPacket(&data);
data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
@@ -562,6 +647,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
DEBUG_LOG( "WORLD: Sent server info" );
}
+ data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4);
+ data << uint32(0);
+ data << uint32(0);
+ SendPacket(&data);
+
//QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow());
QueryResult *resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD);
@@ -619,12 +709,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
{
pCurrChar->setCinematic(1);
- ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace());
- if(rEntry)
+ if(ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass()))
{
- data.Initialize( SMSG_TRIGGER_CINEMATIC,4 );
- data << uint32(rEntry->startmovie);
- SendPacket( &data );
+ if (cEntry->CinematicSequence)
+ pCurrChar->SendCinematicStart(cEntry->CinematicSequence);
+ else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace()))
+ pCurrChar->SendCinematicStart(rEntry->CinematicSequence);
// send new char string if not empty
if (!sWorld.GetNewCharString().empty())
@@ -672,28 +762,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
pCurrChar->CastSpell(pCurrChar, 20584, true, 0);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
pCurrChar->CastSpell(pCurrChar, 8326, true, 0); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
- //pCurrChar->SetUInt32Value(UNIT_FIELD_AURA+41, 8326);
- //pCurrChar->SetUInt32Value(UNIT_FIELD_AURA+42, 20584);
- //pCurrChar->SetUInt32Value(UNIT_FIELD_AURAFLAGS+6, 238);
- //pCurrChar->SetUInt32Value(UNIT_FIELD_AURALEVELS+11, 514);
- //pCurrChar->SetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS+11, 65535);
- //pCurrChar->SetUInt32Value(UNIT_FIELD_DISPLAYID, 1825);
- //if (pCurrChar->getRace() == RACE_NIGHTELF)
- //{
- // pCurrChar->SetSpeed(MOVE_RUN, 1.5f*1.2f, true);
- // pCurrChar->SetSpeed(MOVE_SWIM, 1.5f*1.2f, true);
- //}
- //else
- //{
- // pCurrChar->SetSpeed(MOVE_RUN, 1.5f, true);
- // pCurrChar->SetSpeed(MOVE_SWIM, 1.5f, true);
- //}
pCurrChar->SetMovement(MOVE_WATER_WALK);
}
if(uint32 sourceNode = pCurrChar->m_taxi.GetTaxiSource())
{
-
sLog.outDebug( "WORLD: Restart character %u taxi flight", pCurrChar->GetGUIDLow() );
uint32 MountId = objmgr.GetTaxiMount(sourceNode, pCurrChar->GetTeam());
@@ -741,13 +814,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
SendDoFlight( MountId, path, startNode );
}
- // Load pet if any and player is alive and not in taxi flight
- if(pCurrChar->isAlive() && pCurrChar->m_taxi.GetTaxiSource()==0)
- pCurrChar->LoadPet();
+ // Load pet if any (if player not alive and in taxi flight or another then pet will remember as temporary unsummoned)
+ pCurrChar->LoadPet();
// Set FFA PvP for non GM in non-rest mode
if(sWorld.IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_RESTING) )
- pCurrChar->SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
if(pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
pCurrChar->SetContestedPvP();
@@ -795,15 +867,7 @@ void WorldSession::HandleSetFactionAtWar( WorldPacket & recv_data )
recv_data >> repListID;
recv_data >> flag;
- FactionStateList::iterator itr = GetPlayer()->m_factions.find(repListID);
- if (itr == GetPlayer()->m_factions.end())
- return;
-
- // always invisible or hidden faction can't change war state
- if(itr->second.Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN) )
- return;
-
- GetPlayer()->SetFactionAtWar(&itr->second,flag);
+ GetPlayer()->GetReputationMgr().SetAtWar(repListID,flag);
}
//I think this function is never used :/ I dunno, but i guess this opcode not exists
@@ -811,7 +875,7 @@ void WorldSession::HandleSetFactionCheat( WorldPacket & /*recv_data*/ )
{
//CHECK_PACKET_SIZE(recv_data,4+4);
- //sLog.outDebug("WORLD SESSION: HandleSetFactionCheat");
+ sLog.outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
/*
uint32 FactionID;
uint32 Standing;
@@ -831,7 +895,7 @@ void WorldSession::HandleSetFactionCheat( WorldPacket & /*recv_data*/ )
}
}
*/
- GetPlayer()->UpdateReputation();
+ GetPlayer()->GetReputationMgr().SendStates();
}
void WorldSession::HandleMeetingStoneInfo( WorldPacket & /*recv_data*/ )
@@ -896,11 +960,7 @@ void WorldSession::HandleSetWatchedFactionInactiveOpcode(WorldPacket & recv_data
uint8 inactive;
recv_data >> replistid >> inactive;
- FactionStateList::iterator itr = _player->m_factions.find(replistid);
- if (itr == _player->m_factions.end())
- return;
-
- _player->SetFactionInactive(&itr->second, inactive);
+ _player->GetReputationMgr().SetInactive(replistid, inactive);
}
void WorldSession::HandleToggleHelmOpcode( WorldPacket & /*recv_data*/ )
@@ -917,11 +977,11 @@ void WorldSession::HandleToggleCloakOpcode( WorldPacket & /*recv_data*/ )
void WorldSession::HandleChangePlayerNameOpcode(WorldPacket& recv_data)
{
+ CHECK_PACKET_SIZE(recv_data, 8+1);
+
uint64 guid;
std::string newname;
- CHECK_PACKET_SIZE(recv_data, 8+1);
-
recv_data >> guid;
recv_data >> newname;
@@ -929,15 +989,15 @@ void WorldSession::HandleChangePlayerNameOpcode(WorldPacket& recv_data)
if(!normalizePlayerName(newname))
{
WorldPacket data(SMSG_CHAR_RENAME, 1);
- data << (uint8)CHAR_NAME_NO_NAME;
+ data << uint8(CHAR_NAME_NO_NAME);
SendPacket( &data );
return;
}
- if(!ObjectMgr::IsValidName(newname,true))
+ if(!ObjectMgr::IsValidName(newname, true))
{
WorldPacket data(SMSG_CHAR_RENAME, 1);
- data << (uint8)CHAR_NAME_INVALID_CHARACTER;
+ data << uint8(CHAR_NAME_INVALID_CHARACTER);
SendPacket( &data );
return;
}
@@ -946,7 +1006,7 @@ void WorldSession::HandleChangePlayerNameOpcode(WorldPacket& recv_data)
if(GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
{
WorldPacket data(SMSG_CHAR_RENAME, 1);
- data << (uint8)CHAR_NAME_RESERVED;
+ data << uint8(CHAR_NAME_RESERVED);
SendPacket( &data );
return;
}
@@ -975,7 +1035,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult *result, uin
if (!result)
{
WorldPacket data(SMSG_CHAR_RENAME, 1);
- data << (uint8)CHAR_CREATE_ERROR;
+ data << uint8(CHAR_CREATE_ERROR);
session->SendPacket( &data );
return;
}
@@ -989,11 +1049,11 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult *result, uin
CharacterDatabase.PExecute("UPDATE characters set name = '%s', at_login = at_login & ~ %u WHERE guid ='%u'", newname.c_str(), uint32(AT_LOGIN_RENAME), guidLow);
CharacterDatabase.PExecute("DELETE FROM character_declinedname WHERE guid ='%u'", guidLow);
- sLog.outChar("Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s",session->GetAccountId(), session->GetRemoteAddress().c_str(), oldname.c_str(), guidLow, newname.c_str());
+ sLog.outChar("Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", session->GetAccountId(), session->GetRemoteAddress().c_str(), oldname.c_str(), guidLow, newname.c_str());
- WorldPacket data(SMSG_CHAR_RENAME,1+8+(newname.size()+1));
- data << (uint8)RESPONSE_SUCCESS;
- data << guid;
+ WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newname.size()+1));
+ data << uint8(RESPONSE_SUCCESS);
+ data << uint64(guid);
data << newname;
session->SendPacket(&data);
}
@@ -1088,3 +1148,170 @@ void WorldSession::HandleDeclinedPlayerNameOpcode(WorldPacket& recv_data)
SendPacket(&data);
}
+void WorldSession::HandleAlterAppearance( WorldPacket & recv_data )
+{
+ sLog.outDebug("CMSG_ALTER_APPEARANCE");
+
+ CHECK_PACKET_SIZE(recv_data, 4+4+4);
+
+ uint32 Hair, Color, FacialHair;
+ recv_data >> Hair >> Color >> FacialHair;
+
+ BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
+
+ if(!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->getGender())
+ return;
+
+ BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
+
+ if(!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender())
+ return;
+
+ uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id);
+
+ // 0 - ok
+ // 1,3 - not enough money
+ // 2 - you have to seat on barber chair
+ if(_player->GetMoney() < Cost)
+ {
+ WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
+ data << uint32(1); // no money
+ SendPacket(&data);
+ return;
+ }
+ else
+ {
+ WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
+ data << uint32(0); // ok
+ SendPacket(&data);
+ }
+
+ _player->ModifyMoney(-int32(Cost)); // it isn't free
+ _player->GetAchievementMgr().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->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
+
+ _player->SetStandState(0); // stand up
+}
+
+void WorldSession::HandleRemoveGlyph( WorldPacket & recv_data )
+{
+ CHECK_PACKET_SIZE(recv_data, 4);
+
+ uint32 slot;
+ recv_data >> slot;
+
+ if(slot >= MAX_GLYPH_SLOT_INDEX)
+ {
+ sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot);
+ return;
+ }
+
+ if(uint32 glyph = _player->GetGlyph(slot))
+ {
+ if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph))
+ {
+ _player->RemoveAurasDueToSpell(gp->SpellId);
+ _player->SetGlyph(slot, 0);
+ }
+ }
+}
+
+void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
+{
+ CHECK_PACKET_SIZE(recv_data, 8+1);
+
+ uint64 guid;
+ std::string newname;
+
+ recv_data >> guid;
+ recv_data >> newname;
+
+ CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+1+1+1+1+1+1);
+
+ uint8 gender, skin, face, hairStyle, hairColor, facialHair;
+ recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
+
+ QueryResult *result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid));
+ if (!result)
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_CREATE_ERROR);
+ SendPacket( &data );
+ return;
+ }
+
+ Field *fields = result->Fetch();
+ uint32 at_loginFlags = fields[0].GetUInt32();
+ delete result;
+
+ if (!(at_loginFlags & AT_LOGIN_CUSTOMIZE))
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_CREATE_ERROR);
+ SendPacket( &data );
+ return;
+ }
+
+ // prevent character rename to invalid name
+ if(!normalizePlayerName(newname))
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_NAME_NO_NAME);
+ SendPacket( &data );
+ return;
+ }
+
+ if(!ObjectMgr::IsValidName(newname,true))
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_NAME_INVALID_CHARACTER);
+ SendPacket( &data );
+ return;
+ }
+
+ // check name limitations
+ if(GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_NAME_RESERVED);
+ SendPacket( &data );
+ return;
+ }
+
+ // character with this name already exist
+ if(uint64 newguid = objmgr.GetPlayerGUIDByName(newname))
+ {
+ if(newguid != guid)
+ {
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
+ data << uint8(CHAR_CREATE_NAME_IN_USE);
+ SendPacket( &data );
+ return;
+ }
+ }
+
+ CharacterDatabase.escape_string(newname);
+ Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
+ CharacterDatabase.PExecute("UPDATE characters set name = '%s', at_login = at_login & ~ %u WHERE guid ='%u'", newname.c_str(), uint32(AT_LOGIN_CUSTOMIZE), GUID_LOPART(guid));
+ CharacterDatabase.PExecute("DELETE FROM character_declinedname WHERE guid ='%u'", GUID_LOPART(guid));
+
+ std::string IP_str = GetRemoteAddress();
+ sLog.outChar("Account: %d (IP: %s), Character guid: %u Customized to: %s", GetAccountId(), IP_str.c_str(), GUID_LOPART(guid), newname.c_str());
+
+ WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1+8+(newname.size()+1)+6);
+ data << uint8(RESPONSE_SUCCESS);
+ data << uint64(guid);
+ data << newname;
+ data << uint8(gender);
+ data << uint8(skin);
+ data << uint8(face);
+ data << uint8(hairStyle);
+ data << uint8(hairColor);
+ data << uint8(facialHair);
+ SendPacket(&data);
+}
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 06e3b285d5a..9a01742abc8 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,11 +30,28 @@
#include "Player.h"
#include "UpdateMask.h"
#include "Chat.h"
-#include "MapManager.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
+#include "AccountMgr.h"
#include "TicketMgr.h"
+// Supported shift-links (client generated and server side)
+// |color|Harea:area_id|h[name]|h|r
+// |color|Hcreature:creature_guid|h[name]|h|r
+// |color|Hcreature_entry:creature_id|h[name]|h|r
+// |color|Hgameevent:id|h[name]|h|r
+// |color|Hgameobject:go_guid|h[name]|h|r
+// |color|Hgameobject_entry:go_id|h[name]|h|r
+// |color|Hitem:item_id:perm_ench_id:0:0|h[name]|h|r
+// |color|Hitemset:itemset_id|h[name]|h|r
+// |color|Hplayer:name|h[name]|h|r - client, in some messages, at click copy only name instead link
+// |color|Hquest:quest_id|h[name]|h|r
+// |color|Hskill:skill_id|h[name]|h|r
+// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
+// |color|Htalent:talent_id,rank|h[name]|h|r - client, talent icon shift-click
+// |color|Htele:id|h[name]|h|r
+// |color|Htrade:spell_id,cur_value,max_value,unk3int,unk3str|h[name]|h|r - client, spellbook profession icon shift-click
+
bool ChatHandler::load_command_table = true;
ChatCommand * ChatHandler::getCommandTable()
@@ -57,163 +74,170 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverSetCommandTable[] =
+ static ChatCommand banCommandTable[] =
{
- { "loglevel", SEC_CONSOLE, true, &ChatHandler::HandleServerSetLogLevelCommand, "", NULL },
- { "difftime", SEC_CONSOLE, true, &ChatHandler::HandleServerSetDiffTimeCommand, "", NULL },
- { "motd", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetMotdCommand, "", NULL },
+ { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanIPCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverIdleRestartCommandTable[] =
+ static ChatCommand baninfoCommandTable[] =
{
- { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
- { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleRestartCommand, "", NULL },
+ { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoIPCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverIdleShutdownCommandTable[] =
+ static ChatCommand banlistCommandTable[] =
{
- { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
- { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleShutDownCommand, "", NULL },
+ { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListIPCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverRestartCommandTable[] =
+ static ChatCommand castCommandTable[] =
{
- { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
- { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerRestartCommand, "", NULL },
+ { "back", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastBackCommand, "", NULL },
+ { "dist", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastDistCommand, "", NULL },
+ { "self", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastSelfCommand, "", NULL },
+ { "target", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastTargetCommand, "", NULL },
+ { "", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverShutdownCommandTable[] =
+ static ChatCommand debugPlayCommandTable[] =
{
- { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
- { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "cinematic", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayCinematicCommand, "", NULL },
+ { "movie", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayMovieCommand, "", NULL },
+ { "sound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverCommandTable[] =
+ static ChatCommand debugSendCommandTable[] =
{
- { "corpses", SEC_GAMEMASTER, true, &ChatHandler::HandleServerCorpsesCommand, "", NULL },
- { "exit", SEC_CONSOLE, true, &ChatHandler::HandleServerExitCommand, "", NULL },
- { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
- { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
- { "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
- { "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
- { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
- { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
- { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { "buyerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendBuyErrorCommand, "", NULL },
+ { "channelnotify", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChannelNotifyCommand, "", NULL },
+ { "chatmmessage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChatMsgCommand, "", NULL },
+ { "equiperror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendEquipErrorCommand, "", NULL },
+ { "largepacket", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendLargePacketCommand, "", NULL },
+ { "opcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendOpcodeCommand, "", NULL },
+ { "poi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendPoiCommand, "", NULL },
+ { "qpartymsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestPartyMsgCommand, "", NULL },
+ { "qinvalidmsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestInvalidMsgCommand, "", NULL },
+ { "sellerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSellErrorCommand, "", NULL },
+ { "setphaseshift", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSetPhaseShiftCommand, "", NULL },
+ { "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSpellFailCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand modifyCommandTable[] =
+ static ChatCommand debugCommandTable[] =
{
- { "hp", SEC_MODERATOR, false, &ChatHandler::HandleModifyHPCommand, "", NULL },
- { "mana", SEC_MODERATOR, false, &ChatHandler::HandleModifyManaCommand, "", NULL },
- { "rage", SEC_MODERATOR, false, &ChatHandler::HandleModifyRageCommand, "", NULL },
- { "energy", SEC_MODERATOR, false, &ChatHandler::HandleModifyEnergyCommand, "", NULL },
- { "money", SEC_MODERATOR, false, &ChatHandler::HandleModifyMoneyCommand, "", NULL },
- { "speed", SEC_MODERATOR, false, &ChatHandler::HandleModifySpeedCommand, "", NULL },
- { "swim", SEC_MODERATOR, false, &ChatHandler::HandleModifySwimCommand, "", NULL },
- { "scale", SEC_MODERATOR, false, &ChatHandler::HandleModifyScaleCommand, "", NULL },
- { "bit", SEC_MODERATOR, false, &ChatHandler::HandleModifyBitCommand, "", NULL },
- { "bwalk", SEC_MODERATOR, false, &ChatHandler::HandleModifyBWalkCommand, "", NULL },
- { "fly", SEC_MODERATOR, false, &ChatHandler::HandleModifyFlyCommand, "", NULL },
- { "aspeed", SEC_MODERATOR, false, &ChatHandler::HandleModifyASpeedCommand, "", NULL },
- { "faction", SEC_MODERATOR, false, &ChatHandler::HandleModifyFactionCommand, "", NULL },
- { "spell", SEC_MODERATOR, false, &ChatHandler::HandleModifySpellCommand, "", NULL },
- { "tp", SEC_MODERATOR, false, &ChatHandler::HandleModifyTalentCommand, "", NULL },
- { "titles", SEC_MODERATOR, false, &ChatHandler::HandleModifyKnownTitlesCommand, "", NULL },
- { "mount", SEC_MODERATOR, false, &ChatHandler::HandleModifyMountCommand, "", NULL },
- { "honor", SEC_MODERATOR, false, &ChatHandler::HandleModifyHonorCommand, "", NULL },
- { "rep", SEC_MODERATOR, false, &ChatHandler::HandleModifyRepCommand, "", NULL },
- { "arena", SEC_MODERATOR, false, &ChatHandler::HandleModifyArenaCommand, "", NULL },
- { "drunk", SEC_MODERATOR, false, &ChatHandler::HandleDrunkCommand, "", NULL },
- { "standstate", SEC_GAMEMASTER, false, &ChatHandler::HandleStandStateCommand, "", NULL },
- { "morph", SEC_GAMEMASTER, false, &ChatHandler::HandleMorphCommand, "", NULL },
- { "gender", SEC_ADMINISTRATOR, false, &ChatHandler::HandleModifyGenderCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "setbit", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSet32Bit, "", NULL },
+ { "threat", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugThreatList, "", NULL },
+ { "hostil", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugHostilRefList, "", NULL },
+ { "anim", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugAnimCommand, "", NULL },
+ { "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
+ { "bg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBattlegroundCommand, "", NULL },
+ { "getitemstate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetItemState, "", NULL },
+ { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugGetLootRecipient, "", NULL },
+ { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetValue, "", NULL },
+ { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
+ { "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable },
+ { "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
+ { "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
+ { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
+ { "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
+ { "setvid", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetVehicleId, "", NULL },
+ { "entervehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugEnterVehicle, "", NULL },
+ { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
+ { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdate, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand wpCommandTable[] =
+ static ChatCommand eventCommandTable[] =
{
- { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL },
- { "addwp", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL },
- { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL },
- { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL },
- { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL },
- { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL },
-
+ { "activelist", SEC_GAMEMASTER, true, &ChatHandler::HandleEventActiveListCommand, "", NULL },
+ { "start", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStartCommand, "", NULL },
+ { "stop", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStopCommand, "", NULL },
+ { "", SEC_GAMEMASTER, true, &ChatHandler::HandleEventInfoCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
-
- static ChatCommand banCommandTable[] =
+ static ChatCommand gmCommandTable[] =
{
- { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanAccountCommand, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanCharacterCommand, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanIPCommand, "", NULL },
+ { "chat", SEC_MODERATOR, false, &ChatHandler::HandleGMChatCommand, "", NULL },
+ { "fly", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGMFlyCommand, "", NULL },
+ { "ingame", SEC_PLAYER, true, &ChatHandler::HandleGMListIngameCommand, "", NULL },
+ { "list", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMListFullCommand, "", NULL },
+ { "visible", SEC_MODERATOR, false, &ChatHandler::HandleGMVisibleCommand, "", NULL },
+ { "", SEC_MODERATOR, false, &ChatHandler::HandleGMCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand baninfoCommandTable[] =
+ static ChatCommand goCommandTable[] =
{
- { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoAccountCommand, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoCharacterCommand, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoIPCommand, "", NULL },
+ { "grid", SEC_MODERATOR, false, &ChatHandler::HandleGoGridCommand, "", NULL },
+ { "creature", SEC_MODERATOR, false, &ChatHandler::HandleGoCreatureCommand, "", NULL },
+ { "object", SEC_MODERATOR, false, &ChatHandler::HandleGoObjectCommand, "", NULL },
+ { "trigger", SEC_MODERATOR, false, &ChatHandler::HandleGoTriggerCommand, "", NULL },
+ { "ticket", SEC_MODERATOR, false, &ChatHandler::HandleGoTicketCommand, "", NULL },
+ { "graveyard", SEC_MODERATOR, false, &ChatHandler::HandleGoGraveyardCommand, "", NULL },
+ { "zonexy", SEC_MODERATOR, false, &ChatHandler::HandleGoZoneXYCommand, "", NULL },
+ { "xy", SEC_MODERATOR, false, &ChatHandler::HandleGoXYCommand, "", NULL },
+ { "xyz", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
+ { "", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand banlistCommandTable[] =
+ static ChatCommand gobjectCommandTable[] =
{
- { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListAccountCommand, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListCharacterCommand, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListIPCommand, "", NULL },
+ { "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL },
+ { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectAddCommand, "", NULL },
+ { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectDeleteCommand, "", NULL },
+ { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectMoveCommand, "", NULL },
+ { "near", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectNearCommand, "", NULL },
+ { "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectPhaseCommand, "", NULL },
+ { "target", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTargetCommand, "", NULL },
+ { "tempadd", SEC_GAMEMASTER, false, &ChatHandler::HandleTempGameObjectCommand, "", NULL },
+ { "turn", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectTurnCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand unbanCommandTable[] =
+ static ChatCommand groupCommandTable[] =
{
- { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanAccountCommand, "", NULL },
- { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanCharacterCommand, "", NULL },
- { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanIPCommand, "", NULL },
+ { "leader", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupLeaderCommand, "", NULL },
+ { "disband", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupDisbandCommand, "", NULL },
+ { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupRemoveCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand guildCommandTable[] =
+ {
+ { "create", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildCreateCommand, "", NULL },
+ { "delete", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildDeleteCommand, "", NULL },
+ { "invite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildInviteCommand, "", NULL },
+ { "uninvite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildUninviteCommand, "", NULL },
+ { "rank", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildRankCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand debugCommandTable[] =
+ static ChatCommand honorCommandTable[] =
{
- { "inarc", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugInArcCommand, "", NULL },
- { "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellFailCommand, "", NULL },
- { "setpoi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetPoiCommand, "", NULL },
- { "qpartymsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendQuestPartyMsgCommand, "", NULL },
- { "qinvalidmsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendQuestInvalidMsgCommand, "", NULL },
- { "equiperr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleEquipErrorCommand, "", NULL },
- { "sellerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSellErrorCommand, "", NULL },
- { "buyerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBuyErrorCommand, "", NULL },
- { "sendopcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendOpcodeCommand, "", NULL },
- { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUpdateWorldStateCommand, "", NULL },
- { "ps", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlaySound2Command, "", NULL },
- { "scn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendChannelNotifyCommand, "", NULL },
- { "scm", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendChatMsgCommand, "", NULL },
- { "getitemstate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetItemState, "", NULL },
- { "playsound", SEC_MODERATOR, false, &ChatHandler::HandlePlaySoundCommand, "", NULL },
- { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUpdate, "", NULL },
- { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetValue, "", NULL },
- { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetValue, "", NULL },
- { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleMod32Value, "", NULL },
- { "anim", SEC_GAMEMASTER, false, &ChatHandler::HandleAnimCommand, "", NULL },
- { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleGetLootRecipient, "", NULL },
- { "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
+ { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleHonorAddCommand, "", NULL },
+ { "addkill", SEC_GAMEMASTER, false, &ChatHandler::HandleHonorAddKillCommand, "", NULL },
+ { "update", SEC_GAMEMASTER, false, &ChatHandler::HandleHonorUpdateCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand eventCommandTable[] =
+ static ChatCommand instanceCommandTable[] =
{
- { "activelist", SEC_GAMEMASTER, true, &ChatHandler::HandleEventActiveListCommand, "", NULL },
- { "start", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStartCommand, "", NULL },
- { "stop", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStopCommand, "", NULL },
- { "", SEC_GAMEMASTER, true, &ChatHandler::HandleEventInfoCommand, "", NULL },
+ { "listbinds", SEC_ADMINISTRATOR, false, &ChatHandler::HandleInstanceListBindsCommand, "", NULL },
+ { "unbind", SEC_ADMINISTRATOR, false, &ChatHandler::HandleInstanceUnbindCommand, "", NULL },
+ { "stats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleInstanceStatsCommand, "", NULL },
+ { "savedata", SEC_ADMINISTRATOR, false, &ChatHandler::HandleInstanceSaveDataCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
@@ -225,6 +249,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "all_default", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllDefaultCommand, "", NULL },
{ "all_lang", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllLangCommand, "", NULL },
{ "all_myclass", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyClassCommand, "", NULL },
+ { "all_mypettalents",SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyPetTalentsCommand,"", NULL },
{ "all_myspells", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMySpellsCommand, "", NULL },
{ "all_mytalents", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyTalentsCommand, "", NULL },
{ "all_recipes", SEC_GAMEMASTER, false, &ChatHandler::HandleLearnAllRecipesCommand, "", NULL },
@@ -232,9 +257,140 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
+ static ChatCommand listCommandTable[] =
+ {
+ { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListCreatureCommand, "", NULL },
+ { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListItemCommand, "", NULL },
+ { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListObjectCommand, "", NULL },
+ { "auras", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListAurasCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand lookupPlayerCommandTable[] =
+ {
+ { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerIpCommand, "", NULL },
+ { "account", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerAccountCommand, "", NULL },
+ { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerEmailCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand lookupCommandTable[] =
+ {
+ { "area", SEC_MODERATOR, true, &ChatHandler::HandleLookupAreaCommand, "", NULL },
+ { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupCreatureCommand, "", NULL },
+ { "event", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupEventCommand, "", NULL },
+ { "faction", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupFactionCommand, "", NULL },
+ { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemCommand, "", NULL },
+ { "itemset", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemSetCommand, "", NULL },
+ { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupObjectCommand, "", NULL },
+ { "quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupQuestCommand, "", NULL },
+ { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
+ { "skill", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSkillCommand, "", NULL },
+ { "spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSpellCommand, "", NULL },
+ { "tele", SEC_MODERATOR, true, &ChatHandler::HandleLookupTeleCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand modifyCommandTable[] =
+ {
+ { "hp", SEC_MODERATOR, false, &ChatHandler::HandleModifyHPCommand, "", NULL },
+ { "mana", SEC_MODERATOR, false, &ChatHandler::HandleModifyManaCommand, "", NULL },
+ { "rage", SEC_MODERATOR, false, &ChatHandler::HandleModifyRageCommand, "", NULL },
+ { "runicpower", SEC_MODERATOR, false, &ChatHandler::HandleModifyRunicPowerCommand, "", NULL },
+ { "energy", SEC_MODERATOR, false, &ChatHandler::HandleModifyEnergyCommand, "", NULL },
+ { "money", SEC_MODERATOR, false, &ChatHandler::HandleModifyMoneyCommand, "", NULL },
+ { "speed", SEC_MODERATOR, false, &ChatHandler::HandleModifySpeedCommand, "", NULL },
+ { "swim", SEC_MODERATOR, false, &ChatHandler::HandleModifySwimCommand, "", NULL },
+ { "scale", SEC_MODERATOR, false, &ChatHandler::HandleModifyScaleCommand, "", NULL },
+ { "bit", SEC_MODERATOR, false, &ChatHandler::HandleModifyBitCommand, "", NULL },
+ { "bwalk", SEC_MODERATOR, false, &ChatHandler::HandleModifyBWalkCommand, "", NULL },
+ { "fly", SEC_MODERATOR, false, &ChatHandler::HandleModifyFlyCommand, "", NULL },
+ { "aspeed", SEC_MODERATOR, false, &ChatHandler::HandleModifyASpeedCommand, "", NULL },
+ { "faction", SEC_MODERATOR, false, &ChatHandler::HandleModifyFactionCommand, "", NULL },
+ { "spell", SEC_MODERATOR, false, &ChatHandler::HandleModifySpellCommand, "", NULL },
+ { "tp", SEC_MODERATOR, false, &ChatHandler::HandleModifyTalentCommand, "", NULL },
+ { "titles", SEC_MODERATOR, false, &ChatHandler::HandleModifyKnownTitlesCommand, "", NULL },
+ { "mount", SEC_MODERATOR, false, &ChatHandler::HandleModifyMountCommand, "", NULL },
+ { "honor", SEC_MODERATOR, false, &ChatHandler::HandleModifyHonorCommand, "", NULL },
+ { "rep", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyRepCommand, "", NULL },
+ { "arena", SEC_MODERATOR, false, &ChatHandler::HandleModifyArenaCommand, "", NULL },
+ { "drunk", SEC_MODERATOR, false, &ChatHandler::HandleModifyDrunkCommand, "", NULL },
+ { "standstate", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyStandStateCommand, "", NULL },
+ { "morph", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyMorphCommand, "", NULL },
+ { "phase", SEC_ADMINISTRATOR, false, &ChatHandler::HandleModifyPhaseCommand, "", NULL },
+ { "gender", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyGenderCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand npcCommandTable[] =
+ {
+ { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddCommand, "", NULL },
+ { "additem", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddVendorItemCommand, "", NULL },
+ { "addmove", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddMoveCommand, "", NULL },
+ { "allowmove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcAllowMovementCommand, "", NULL },
+ { "changeentry", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcChangeEntryCommand, "", NULL },
+ { "changelevel", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcChangeLevelCommand, "", NULL },
+ { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcDeleteCommand, "", NULL },
+ { "delitem", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcDelVendorItemCommand, "", NULL },
+ { "factionid", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFactionIdCommand, "", NULL },
+ { "flag", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFlagCommand, "", NULL },
+ { "follow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFollowCommand, "", NULL },
+ { "info", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcInfoCommand, "", NULL },
+ { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcMoveCommand, "", NULL },
+ { "playemote", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcPlayEmoteCommand, "", NULL },
+ { "setmodel", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetModelCommand, "", NULL },
+ { "setmovetype", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetMoveTypeCommand, "", NULL },
+ { "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetPhaseCommand, "", NULL },
+ { "spawndist", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnDistCommand, "", NULL },
+ { "spawntime", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnTimeCommand, "", NULL },
+ { "say", SEC_MODERATOR, false, &ChatHandler::HandleNpcSayCommand, "", NULL },
+ { "textemote", SEC_MODERATOR, false, &ChatHandler::HandleNpcTextEmoteCommand, "", NULL },
+ { "unfollow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcUnFollowCommand, "", NULL },
+ { "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
+ { "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
+ { "tempadd", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL },
+ { "tame", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTameCommand, "", NULL },
+ { "setdeathstate", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetDeathStateCommand, "", NULL },
+ { "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL },
+
+ //{ TODO: fix or remove this commands
+ { "addweapon", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcAddWeaponCommand, "", NULL },
+ { "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcNameCommand, "", NULL },
+ { "subname", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSubNameCommand, "", NULL },
+ //}
+
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand petCommandTable[] =
+ {
+ { "create", SEC_GAMEMASTER, false, &ChatHandler::HandleCreatePetCommand, "", NULL },
+ { "learn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetLearnCommand, "", NULL },
+ { "unlearn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetUnlearnCommand, "", NULL },
+ { "tp", SEC_GAMEMASTER, false, &ChatHandler::HandlePetTpCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand pdumpCommandTable[] =
+ {
+ { "load", SEC_ADMINISTRATOR, true, &ChatHandler::HandlePDumpLoadCommand, "", NULL },
+ { "write", SEC_ADMINISTRATOR, true, &ChatHandler::HandlePDumpWriteCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand questCommandTable[] =
+ {
+ { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleQuestAdd, "", NULL },
+ { "complete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleQuestComplete, "", NULL },
+ { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleQuestRemove, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
static ChatCommand reloadCommandTable[] =
{
{ "all", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllCommand, "", NULL },
+ { "all_achievement",SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAchievementCommand,"", NULL },
+ { "all_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAreaCommand, "", NULL },
{ "all_loot", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllLootCommand, "", NULL },
{ "all_npc", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllNpcCommand, "", NULL },
{ "all_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllQuestCommand, "", NULL },
@@ -245,6 +401,8 @@ ChatCommand * ChatHandler::getCommandTable()
{ "config", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadConfigCommand, "", NULL },
+ { "achievement_criteria_data", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAchievementCriteriaDataCommand, "", NULL },
+ { "achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAchievementRewardCommand, "", NULL },
{ "areatrigger_tavern", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTavernCommand, "", NULL },
{ "areatrigger_teleport", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTeleportCommand, "", NULL },
{ "access_requirement", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAccessRequirementCommand, "", NULL },
@@ -266,13 +424,23 @@ ChatCommand * ChatHandler::getCommandTable()
{ "gameobject_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameObjectScriptsCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
- { "trinity_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadTrinityStringCommand, "", NULL },
+ { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesAchievementRewardCommand,"", NULL },
+ { "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
+ { "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
+ { "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
+ { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
+ { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
+ { "locales_points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPointsOfInterestCommand, "", NULL },
+ { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
+// { "auctions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAuctionsCommand, "", NULL },
+ { "milling_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesMillingCommand, "", NULL },
{ "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL },
{ "npc_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcOptionCommand, "", NULL },
{ "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand,"",NULL},
+ { "points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPointsOfInterestCommand, "",NULL},
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand,"", NULL },
{ "quest_mail_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesQuestMailCommand, "", NULL },
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestEndScriptsCommand, "", NULL },
@@ -286,93 +454,30 @@ ChatCommand * ChatHandler::getCommandTable()
{ "skinning_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesSkinningCommand, "", NULL },
{ "spell_affect", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAffectCommand, "", NULL },
{ "spell_required", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellRequiredCommand, "", NULL },
+ { "spell_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAreaCommand, "", NULL },
{ "spell_elixir", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellElixirCommand, "", NULL },
{ "spell_learn_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLearnSpellCommand, "", NULL },
+ { "spell_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesSpellCommand, "", NULL },
{ "spell_linked_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLinkedSpellCommand, "", NULL },
{ "spell_pet_auras", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellPetAurasCommand, "", NULL },
{ "spell_proc_event", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellProcEventCommand, "", NULL },
+ { "spell_bonus_data", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellBonusesCommand, "", NULL },
{ "spell_script_target", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellScriptTargetCommand, "", NULL },
{ "spell_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellScriptsCommand, "", NULL },
{ "spell_target_position", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellTargetPositionCommand, "", NULL },
{ "spell_threats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellThreatsCommand, "", NULL },
{ "spell_disabled", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellDisabledCommand, "", NULL },
- { "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
- { "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
- { "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
- { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
- { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
- { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
+ { "trinity_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadTrinityStringCommand, "", NULL },
{ "auctions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAuctionsCommand, "", NULL },
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadWpScriptsCommand, "", NULL },
{ "gm_tickets", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMTicketReloadCommand, "", NULL },
- { "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand honorCommandTable[] =
- {
- { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleAddHonorCommand, "", NULL },
- { "addkill", SEC_GAMEMASTER, false, &ChatHandler::HandleHonorAddKillCommand, "", NULL },
- { "update", SEC_GAMEMASTER, false, &ChatHandler::HandleUpdateHonorFieldsCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand guildCommandTable[] =
- {
- { "create", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildCreateCommand, "", NULL },
- { "delete", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildDeleteCommand, "", NULL },
- { "invite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildInviteCommand, "", NULL },
- { "uninvite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildUninviteCommand, "", NULL },
- { "rank", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildRankCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand petCommandTable[] =
- {
- { "create", SEC_GAMEMASTER, false, &ChatHandler::HandleCreatePetCommand, "", NULL },
- { "learn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetLearnCommand, "", NULL },
- { "unlearn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetUnlearnCommand, "", NULL },
- { "tp", SEC_GAMEMASTER, false, &ChatHandler::HandlePetTpCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
-
- static ChatCommand groupCommandTable[] =
- {
- { "leader", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupLeaderCommand, "", NULL },
- { "disband", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupDisbandCommand, "", NULL },
- { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupRemoveCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand lookupPlayerCommandTable[] =
- {
- { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerIpCommand, "", NULL },
- { "account", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerAccountCommand, "", NULL },
- { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerEmailCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand lookupCommandTable[] =
- {
- { "area", SEC_MODERATOR, true, &ChatHandler::HandleLookupAreaCommand, "", NULL },
- { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupCreatureCommand, "", NULL },
- { "event", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupEventCommand, "", NULL },
- { "faction", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupFactionCommand, "", NULL },
- { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemCommand, "", NULL },
- { "itemset", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemSetCommand, "", NULL },
- { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupObjectCommand, "", NULL },
- { "quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupQuestCommand, "", NULL },
- { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
- { "skill", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSkillCommand, "", NULL },
- { "spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSpellCommand, "", NULL },
- { "tele", SEC_MODERATOR, true, &ChatHandler::HandleLookupTeleCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
static ChatCommand resetCommandTable[] =
{
+ { "achievements", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetAchievementsCommand, "", NULL },
{ "honor", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetHonorCommand, "", NULL },
{ "level", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetLevelCommand, "", NULL },
{ "spells", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetSpellsCommand, "", NULL },
@@ -382,132 +487,94 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand castCommandTable[] =
+ static ChatCommand sendCommandTable[] =
{
- { "back", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastBackCommand, "", NULL },
- { "dist", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastDistCommand, "", NULL },
- { "self", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastSelfCommand, "", NULL },
- { "target", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastTargetCommand, "", NULL },
- { "", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastCommand, "", NULL },
+ { "items", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendItemsCommand, "", NULL },
+ { "mail", SEC_MODERATOR, true, &ChatHandler::HandleSendMailCommand, "", NULL },
+ { "message", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
+ { "money", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMoneyCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand pdumpCommandTable[] =
+ static ChatCommand serverIdleRestartCommandTable[] =
{
- { "load", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLoadPDumpCommand, "", NULL },
- { "write", SEC_ADMINISTRATOR, true, &ChatHandler::HandleWritePDumpCommand, "", NULL },
+ { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleRestartCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand listCommandTable[] =
+ static ChatCommand serverIdleShutdownCommandTable[] =
{
- { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListCreatureCommand, "", NULL },
- { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListItemCommand, "", NULL },
- { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListObjectCommand, "", NULL },
- { "auras", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListAurasCommand, "", NULL },
+ { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleShutDownCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand teleCommandTable[] =
+ static ChatCommand serverRestartCommandTable[] =
{
- { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddTeleCommand, "", NULL },
- { "del", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDelTeleCommand, "", NULL },
- { "name", SEC_MODERATOR, true, &ChatHandler::HandleNameTeleCommand, "", NULL },
- { "group", SEC_MODERATOR, false, &ChatHandler::HandleGroupTeleCommand, "", NULL },
- { "", SEC_MODERATOR, false, &ChatHandler::HandleTeleCommand, "", NULL },
+ { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerRestartCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand npcCommandTable[] =
+ static ChatCommand serverShutdownCommandTable[] =
{
- { "say", SEC_MODERATOR, false, &ChatHandler::HandleNpcSayCommand, "", NULL },
- { "textemote", SEC_MODERATOR, false, &ChatHandler::HandleNpcTextEmoteCommand, "", NULL },
- { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddCommand, "", NULL },
- { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcDeleteCommand, "", NULL },
- { "spawndist", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnDistCommand, "", NULL },
- { "spawntime", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnTimeCommand, "", NULL },
- { "factionid", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFactionIdCommand, "", NULL },
- { "addmove", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddMoveCommand, "", NULL },
- { "setmovetype", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetMoveTypeCommand, "", NULL },
- { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcMoveCommand, "", NULL },
- { "changelevel", SEC_GAMEMASTER, false, &ChatHandler::HandleChangeLevelCommand, "", NULL },
- { "setmodel", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetModelCommand, "", NULL },
- { "additem", SEC_GAMEMASTER, false, &ChatHandler::HandleAddVendorItemCommand, "", NULL },
- { "delitem", SEC_GAMEMASTER, false, &ChatHandler::HandleDelVendorItemCommand, "", NULL },
- { "flag", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFlagCommand, "", NULL },
- { "changeentry", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcChangeEntryCommand, "", NULL },
- { "info", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcInfoCommand, "", NULL },
- { "playemote", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcPlayEmoteCommand, "", NULL },
- { "follow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFollowCommand, "", NULL },
- { "unfollow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcUnFollowCommand, "", NULL },
- { "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
- { "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
- { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL },
- { "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL },
+ { "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCommand, "", NULL },
{ "setlink", SEC_MODERATOR, false, &ChatHandler::HandleNpcSetLinkCommand, "", NULL },
-
- //{ TODO: fix or remove this commands
- { "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
- { "subname", SEC_GAMEMASTER, false, &ChatHandler::HandleSubNameCommand, "", NULL },
- { "addweapon", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddWeaponCommand, "", NULL },
- //}
-
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand goCommandTable[] =
+ static ChatCommand serverSetCommandTable[] =
{
- { "grid", SEC_MODERATOR, false, &ChatHandler::HandleGoGridCommand, "", NULL },
- { "creature", SEC_GAMEMASTER, false, &ChatHandler::HandleGoCreatureCommand, "", NULL },
- { "object", SEC_GAMEMASTER, false, &ChatHandler::HandleGoObjectCommand, "", NULL },
- { "ticket", SEC_MODERATOR, false, &ChatHandler::HandleGoTicketCommand, "", NULL },
- { "trigger", SEC_GAMEMASTER, false, &ChatHandler::HandleGoTriggerCommand, "", NULL },
- { "graveyard", SEC_GAMEMASTER, false, &ChatHandler::HandleGoGraveyardCommand, "", NULL },
- { "zonexy", SEC_MODERATOR, false, &ChatHandler::HandleGoZoneXYCommand, "", NULL },
- { "xy", SEC_MODERATOR, false, &ChatHandler::HandleGoXYCommand, "", NULL },
- { "xyz", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
- { "", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
+ { "difftime", SEC_CONSOLE, true, &ChatHandler::HandleServerSetDiffTimeCommand, "", NULL },
+ { "loglevel", SEC_CONSOLE, true, &ChatHandler::HandleServerSetLogLevelCommand, "", NULL },
+ { "logfilelevel", SEC_CONSOLE, true, &ChatHandler::HandleServerSetLogFileLevelCommand, "", NULL },
+ { "motd", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetMotdCommand, "", NULL },
+ { "closed", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetClosedCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand gobjectCommandTable[] =
+ static ChatCommand serverCommandTable[] =
{
- { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectCommand, "", NULL },
- { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleDelObjectCommand, "", NULL },
- { "target", SEC_GAMEMASTER, false, &ChatHandler::HandleTargetObjectCommand, "", NULL },
- { "turn", SEC_GAMEMASTER, false, &ChatHandler::HandleTurnObjectCommand, "", NULL },
- { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleMoveObjectCommand, "", NULL },
- { "near", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNearObjectCommand, "", NULL },
- { "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL },
- { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempGameObjectCommand, "", NULL },
+ { "corpses", SEC_GAMEMASTER, true, &ChatHandler::HandleServerCorpsesCommand, "", NULL },
+ { "exit", SEC_CONSOLE, true, &ChatHandler::HandleServerExitCommand, "", NULL },
+ { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
+ { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
+ { "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
+ { "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
+ { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
+ { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
+ { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand questCommandTable[] =
+ static ChatCommand teleCommandTable[] =
{
- { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddQuest, "", NULL },
- { "complete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCompleteQuest, "", NULL },
- { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleRemoveQuest, "", NULL },
+ { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleTeleAddCommand, "", NULL },
+ { "del", SEC_ADMINISTRATOR, true, &ChatHandler::HandleTeleDelCommand, "", NULL },
+ { "name", SEC_MODERATOR, true, &ChatHandler::HandleTeleNameCommand, "", NULL },
+ { "group", SEC_MODERATOR, false, &ChatHandler::HandleTeleGroupCommand, "", NULL },
+ { "", SEC_MODERATOR, false, &ChatHandler::HandleTeleCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand gmCommandTable[] =
+ static ChatCommand unbanCommandTable[] =
{
- { "chat", SEC_MODERATOR, false, &ChatHandler::HandleGMChatCommand, "", NULL },
- { "ingame", SEC_PLAYER, true, &ChatHandler::HandleGMListIngameCommand, "", NULL },
- { "list", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMListFullCommand, "", NULL },
- { "visible", SEC_MODERATOR, false, &ChatHandler::HandleVisibleCommand, "", NULL },
- { "fly", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlyModeCommand, "", NULL },
- { "", SEC_MODERATOR, false, &ChatHandler::HandleGMmodeCommand, "", NULL },
+ { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanAccountCommand, "", NULL },
+ { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanCharacterCommand, "", NULL },
+ { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanIPCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand instanceCommandTable[] =
+ static ChatCommand wpCommandTable[] =
{
- { "listbinds", SEC_MODERATOR, false, &ChatHandler::HandleInstanceListBindsCommand, "", NULL },
- { "unbind", SEC_MODERATOR, false, &ChatHandler::HandleInstanceUnbindCommand, "", NULL },
- { "stats", SEC_MODERATOR, true, &ChatHandler::HandleInstanceStatsCommand, "", NULL },
- { "savedata", SEC_MODERATOR, false, &ChatHandler::HandleInstanceSaveDataCommand, "", NULL },
+ { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL },
+ { "addwp", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL },
+ { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL },
+ { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL },
+ { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL },
+ { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
@@ -542,8 +609,10 @@ ChatCommand * ChatHandler::getCommandTable()
{ "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
//wp commands
- { "path", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
+ { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
{ "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL },
+ // AH bot
+ { "ahbotoptions", SEC_GAMEMASTER, false, &ChatHandler::HandleAHBotOptionsCommand, "", NULL },
{ "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
{ "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
@@ -591,7 +660,6 @@ ChatCommand * ChatHandler::getCommandTable()
{ "plimit", SEC_ADMINISTRATOR, true, &ChatHandler::HandlePLimitCommand, "", NULL },
{ "start", SEC_PLAYER, false, &ChatHandler::HandleStartCommand, "", NULL },
{ "taxicheat", SEC_MODERATOR, false, &ChatHandler::HandleTaxiCheatCommand, "", NULL },
- { "allowmove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAllowMovementCommand, "", NULL },
{ "linkgrave", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLinkGraveCommand, "", NULL },
{ "neargrave", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNearGraveCommand, "", NULL },
{ "explorecheat", SEC_ADMINISTRATOR, false, &ChatHandler::HandleExploreCheatCommand, "", NULL },
@@ -611,21 +679,18 @@ ChatCommand * ChatHandler::getCommandTable()
{ "password", SEC_PLAYER, false, &ChatHandler::HandlePasswordCommand, "", NULL },
{ "lockaccount", SEC_PLAYER, false, &ChatHandler::HandleLockAccountCommand, "", NULL },
{ "respawn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleRespawnCommand, "", NULL },
- { "senditems", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendItemsCommand, "", NULL },
- { "sendmail", SEC_MODERATOR, true, &ChatHandler::HandleSendMailCommand, "", NULL },
- { "sendmoney", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMoneyCommand, "", NULL },
+ { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable },
{ "rename", SEC_GAMEMASTER, true, &ChatHandler::HandleRenameCommand, "", NULL },
+ { "customize", SEC_GAMEMASTER, true, &ChatHandler::HandleCustomizeCommand, "", NULL },
{ "loadscripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLoadScriptsCommand, "", NULL },
- { "mute", SEC_GAMEMASTER, true, &ChatHandler::HandleMuteCommand, "", NULL },
- { "unmute", SEC_GAMEMASTER, true, &ChatHandler::HandleUnmuteCommand, "", NULL },
+ { "mute", SEC_MODERATOR, true, &ChatHandler::HandleMuteCommand, "", NULL },
+ { "unmute", SEC_MODERATOR, true, &ChatHandler::HandleUnmuteCommand, "", NULL },
{ "movegens", SEC_ADMINISTRATOR, false, &ChatHandler::HandleMovegensCommand, "", NULL },
{ "cometome", SEC_ADMINISTRATOR, false, &ChatHandler::HandleComeToMeCommand, "", NULL },
{ "damage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDamageCommand, "", NULL },
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
- { "ahbotoptions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotOptionsCommand, "", NULL },
- { "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
+ { "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
{ "chardelete", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeleteCommand, "", NULL },
- { "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
{ "playall", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
{ "repairitems", SEC_GAMEMASTER, false, &ChatHandler::HandleRepairitemsCommand, "", NULL },
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
@@ -651,28 +716,9 @@ ChatCommand * ChatHandler::getCommandTable()
{
Field *fields = result->Fetch();
std::string name = fields[0].GetCppString();
- for(uint32 i = 0; commandTable[i].Name != NULL; i++)
- {
- if (name == commandTable[i].Name)
- {
- commandTable[i].SecurityLevel = (uint16)fields[1].GetUInt16();
- commandTable[i].Help = fields[2].GetCppString();
- }
- if(commandTable[i].ChildCommands != NULL)
- {
- ChatCommand *ptable = commandTable[i].ChildCommands;
- for(uint32 j = 0; ptable[j].Name != NULL; j++)
- {
- // first case for "" named subcommand
- if (ptable[j].Name[0]=='\0' && name == commandTable[i].Name ||
- name == fmtstring("%s %s", commandTable[i].Name, ptable[j].Name) )
- {
- ptable[j].SecurityLevel = (uint16)fields[1].GetUInt16();
- ptable[j].Help = fields[2].GetCppString();
- }
- }
- }
- }
+
+ SetDataForCommandInTable(commandTable, name.c_str(), fields[1].GetUInt16(), fields[2].GetCppString(), name);
+
} while(result->NextRow());
delete result;
}
@@ -692,6 +738,55 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
return m_session->GetSecurity() >= cmd.SecurityLevel;
}
+bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
+{
+ WorldSession* target_session = NULL;
+ uint32 target_account = 0;
+
+ if (target)
+ target_session = target->GetSession();
+ else if (guid)
+ target_account = objmgr.GetPlayerAccountIdByGUID(guid);
+
+ if(!target_session && !target_account)
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return true;
+ }
+
+ return HasLowerSecurityAccount(target_session,target_account,strong);
+}
+
+bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_account, bool strong)
+{
+ uint32 target_sec;
+
+ // allow everything from console and RA console
+ if (!m_session)
+ return false;
+
+ // ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
+ if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld.getConfig(CONFIG_GM_LOWER_SECURITY))
+ return false;
+
+ if (target)
+ target_sec = target->GetSecurity();
+ else if (target_account)
+ target_sec = accmgr.GetSecurity(target_account);
+ else
+ return true; // caller must report error for (target==NULL && target_account==0)
+
+ if (m_session->GetSecurity() < target_sec || strong && m_session->GetSecurity() <= target_sec)
+ {
+ SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
+ SetSentErrorMessage(true);
+ return true;
+ }
+
+ return false;
+}
+
bool ChatHandler::hasStringAbbr(const char* name, const char* part)
{
// non "" command
@@ -777,9 +872,9 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
{
const char *format = GetTrinityString(entry);
va_list ap;
- char str [1024];
+ char str [2048];
va_start(ap, entry);
- vsnprintf(str,1024,format, ap );
+ vsnprintf(str,2048,format, ap );
va_end(ap);
SendSysMessage(str);
}
@@ -787,9 +882,9 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
void ChatHandler::PSendSysMessage(const char *format, ...)
{
va_list ap;
- char str [1024];
+ char str [2048];
va_start(ap, format);
- vsnprintf(str,1024,format, ap );
+ vsnprintf(str,2048,format, ap );
va_end(ap);
SendSysMessage(str);
}
@@ -864,6 +959,61 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
return false;
}
+bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand )
+{
+ std::string cmd = "";
+
+ while (*text != ' ' && *text != '\0')
+ {
+ cmd += *text;
+ ++text;
+ }
+
+ while (*text == ' ') ++text;
+
+ for(uint32 i = 0; table[i].Name != NULL; i++)
+ {
+ // for data fill use full explicit command names
+ if( table[i].Name != cmd )
+ continue;
+
+ // select subcommand from child commands list (including "")
+ if(table[i].ChildCommands != NULL)
+ {
+ if(SetDataForCommandInTable(table[i].ChildCommands, text, security, help, fullcommand))
+ return true;
+ else if(*text)
+ return false;
+
+ // fail with "" subcommands, then use normal level up command instead
+ }
+ // expected subcommand by full name DB content
+ else if(*text)
+ {
+ sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str());
+ return false;
+ }
+
+ if(table[i].SecurityLevel != security)
+ sLog.outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security);
+
+ table[i].SecurityLevel = security;
+ table[i].Help = help;
+ return true;
+ }
+
+ // in case "" command let process by caller
+ if(!cmd.empty())
+ {
+ if(table==getCommandTable())
+ sLog.outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
+ else
+ sLog.outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
+ }
+
+ return false;
+}
+
int ChatHandler::ParseCommands(const char* text)
{
ASSERT(text);
@@ -895,11 +1045,11 @@ int ChatHandler::ParseCommands(const char* text)
++text;
if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
- {
- if(m_session && m_session->GetSecurity() == SEC_PLAYER)
- return 0;
- SendSysMessage(LANG_NO_CMD);
- }
+ {
+ if(m_session && m_session->GetSecurity() == SEC_PLAYER)
+ return 0;
+ SendSysMessage(LANG_NO_CMD);
+ }
return 1;
}
@@ -1108,7 +1258,7 @@ Creature* ChatHandler::getSelectedCreature()
if(!m_session)
return NULL;
- return ObjectAccessor::GetCreatureOrPet(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection());
+ return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection());
}
char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1)
@@ -1179,12 +1329,23 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
// [name] Shift-click form |color|linkType:key|h[name]|h|r
// or
// [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
+ // or
+ // [name] Shift-click form |linkType:key|h[name]|h|r
- char* check = strtok(text, "|"); // skip color
- if(!check)
- return NULL; // end of data
+ char* tail;
- char* cLinkType = strtok(NULL, ":"); // linktype
+ if(text[1]=='c')
+ {
+ char* check = strtok(text, "|"); // skip color
+ if(!check)
+ return NULL; // end of data
+
+ tail = strtok(NULL, ""); // tail
+ }
+ else
+ tail = text+1; // skip first |
+
+ char* cLinkType = strtok(tail, ":"); // linktype
if(!cLinkType)
return NULL; // end of data
@@ -1260,20 +1421,29 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
- Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(obj,go_check);
+ MaNGOS::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
+ MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));
+ cell_lock->Visit(cell_lock, object_checker, *pl->GetMap());
}
return obj;
}
-static char const* const spellTalentKeys[] = {
- "Hspell",
- "Htalent",
+enum SpellLinkType
+{
+ SPELL_LINK_SPELL = 0,
+ SPELL_LINK_TALENT = 1,
+ SPELL_LINK_TRADE = 2
+};
+
+static char const* const spellKeys[] =
+{
+ "Hspell", // normal spell
+ "Htalent", // talent spell
+ "Htrade", // profession/skill spell
0
};
@@ -1281,31 +1451,41 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
{
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
// 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* rankS = NULL;
- char* idS = extractKeyFromLink(text,spellTalentKeys,&type,&rankS);
+ char* param1_str = NULL;
+ char* idS = extractKeyFromLink(text,spellKeys,&type,&param1_str);
if(!idS)
return 0;
uint32 id = (uint32)atol(idS);
- // spell
- if(type==0)
- return id;
+ switch(type)
+ {
+ case SPELL_LINK_SPELL:
+ return id;
+ case SPELL_LINK_TALENT:
+ {
+ // talent
+ TalentEntry const* talentEntry = sTalentStore.LookupEntry(id);
+ if(!talentEntry)
+ return 0;
- // talent
- TalentEntry const* talentEntry = sTalentStore.LookupEntry(id);
- if(!talentEntry)
- return 0;
+ int32 rank = param1_str ? (uint32)atol(param1_str) : 0;
+ if(rank >= MAX_TALENT_RANK)
+ return 0;
- int32 rank = rankS ? (uint32)atol(rankS) : 0;
- if(rank >= 5)
- return 0;
+ if(rank < 0)
+ rank = 0;
- if(rank < 0)
- rank = 0;
+ return talentEntry->RankID[rank];
+ }
+ case SPELL_LINK_TRADE:
+ return id;
+ }
- return talentEntry->RankID[rank];
+ // unknown type?
+ return 0;
}
GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
@@ -1323,9 +1503,84 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
return objmgr.GetGameTele(cId);
}
-const char *ChatHandler::GetName() const
+enum GuidLinkType
+{
+ SPELL_LINK_PLAYER = 0, // must be first for selection in not link case
+ SPELL_LINK_CREATURE = 1,
+ SPELL_LINK_GAMEOBJECT = 2
+};
+
+static char const* const guidKeys[] =
+{
+ "Hplayer",
+ "Hcreature",
+ "Hgameobject",
+ 0
+};
+
+uint64 ChatHandler::extractGuidFromLink(char* text)
+{
+ int type = 0;
+
+ // |color|Hcreature:creature_guid|h[name]|h|r
+ // |color|Hgameobject:go_guid|h[name]|h|r
+ // |color|Hplayer:name|h[name]|h|r
+ char* idS = extractKeyFromLink(text,guidKeys,&type);
+ if(!idS)
+ return 0;
+
+ switch(type)
+ {
+ case SPELL_LINK_PLAYER:
+ {
+ std::string name = idS;
+ if(!normalizePlayerName(name))
+ return 0;
+
+ if(Player* player = objmgr.GetPlayer(name.c_str()))
+ return player->GetGUID();
+
+ if(uint64 guid = objmgr.GetPlayerGUIDByName(name))
+ return guid;
+
+ return 0;
+ }
+ case SPELL_LINK_CREATURE:
+ {
+ uint32 lowguid = (uint32)atol(idS);
+
+ if(CreatureData const* data = objmgr.GetCreatureData(lowguid) )
+ return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
+ else
+ return 0;
+ }
+ case SPELL_LINK_GAMEOBJECT:
+ {
+ uint32 lowguid = (uint32)atol(idS);
+
+ if(GameObjectData const* data = objmgr.GetGOData(lowguid) )
+ return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
+ else
+ return 0;
+ }
+ }
+
+ // unknown type?
+ return 0;
+}
+
+std::string ChatHandler::extractPlayerNameFromLink(char* text)
{
- return m_session->GetPlayer()->GetName();
+ // |color|Hplayer:name|h[name]|h|r
+ char* name_str = extractKeyFromLink(text,"Hplayer");
+ if(!name_str)
+ return "";
+
+ std::string name = name_str;
+ if(!normalizePlayerName(name))
+ return "";
+
+ return name;
}
bool ChatHandler::needReportToTarget(Player* chr) const
@@ -1351,7 +1606,7 @@ void CliHandler::SendSysMessage(const char *str)
m_print("\r\n");
}
-const char *CliHandler::GetName() const
+std::string CliHandler::GetNameLink() const
{
return GetTrinityString(LANG_CONSOLE_COMMAND);
}
diff --git a/src/game/Chat.h b/src/game/Chat.h
index a8dbb5b98a5..3cc9aedac6e 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -72,8 +72,6 @@ class ChatHandler
int ParseCommands(const char* text);
- virtual char const* GetName() const;
-
protected:
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
@@ -81,10 +79,13 @@ class ChatHandler
virtual bool isAvailable(ChatCommand const& cmd) const;
virtual bool needReportToTarget(Player* chr) const;
+ bool HasLowerSecurity(Player* target, uint64 guid, bool strong = false);
+ bool HasLowerSecurityAccount(WorldSession* target, uint32 account, bool strong = false);
void SendGlobalSysMessage(const char *str);
void SendGlobalGMSysMessage(const char *str);
+ bool SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand );
bool ExecuteCommandInTable(ChatCommand *table, const char* text, const std::string& fullcommand);
bool ShowHelpForCommand(ChatCommand *table, const char* cmd);
bool ShowHelpForSubCommands(ChatCommand *table, char const* cmd, char const* subcmd);
@@ -99,43 +100,104 @@ class ChatHandler
bool HandleAccountSetGmLevelCommand(const char* args);
bool HandleAccountSetPasswordCommand(const char* args);
- bool HandleHelpCommand(const char* args);
bool HandleAHBotOptionsCommand(const char * args);
- bool HandleCommandsCommand(const char* args);
- bool HandleStartCommand(const char* args);
- bool HandleDismountCommand(const char* args);
- bool HandleSaveCommand(const char* args);
- bool HandleGMListIngameCommand(const char* args);
- bool HandleGMListFullCommand(const char* args);
-
- bool HandleNamegoCommand(const char* args);
- bool HandleGonameCommand(const char* args);
- bool HandleGroupgoCommand(const char* args);
- bool HandleRecallCommand(const char* args);
bool HandleNameAnnounceCommand(const char* args);
bool HandleGMNameAnnounceCommand(const char* args);
- bool HandleAnnounceCommand(const char* args);
bool HandleGMAnnounceCommand(const char* args);
- bool HandleNotifyCommand(const char* args);
bool HandleGMNotifyCommand(const char* args);
- bool HandleGMmodeCommand(const char* args);
- bool HandleGMChatCommand(const char* args);
- bool HandleVisibleCommand(const char* args);
- bool HandleGPSCommand(const char* args);
- bool HandleTaxiCheatCommand(const char* args);
- bool HandleWhispersCommand(const char* args);
- bool HandleNameTeleCommand(const char* args);
- bool HandleGroupTeleCommand(const char* args);
- bool HandleDrunkCommand(const char* args);
- bool HandleSendItemsCommand(const char* args);
- bool HandleSendMailCommand(const char* args);
- bool HandleSendMoneyCommand(const char* args);
+
+ bool HandleBanAccountCommand(const char* args);
+ bool HandleBanCharacterCommand(const char* args);
+ bool HandleBanIPCommand(const char* args);
+ bool HandleBanInfoAccountCommand(const char* args);
+ bool HandleBanInfoCharacterCommand(const char* args);
+ bool HandleBanInfoIPCommand(const char* args);
+ bool HandleBanListAccountCommand(const char* args);
+ bool HandleBanListCharacterCommand(const char* args);
+ bool HandleBanListIPCommand(const char* args);
+
+ bool HandleCastCommand(const char *args);
+ bool HandleCastBackCommand(const char *args);
+ bool HandleCastDistCommand(const char *args);
+ bool HandleCastSelfCommand(const char *args);
+ bool HandleCastTargetCommand(const char *args);
+
+ bool HandleDebugAnimCommand(const char* args);
+ bool HandleDebugArenaCommand(const char * args);
+ bool HandleDebugBattlegroundCommand(const char * args);
+ bool HandleDebugGetItemState(const char * args);
+ bool HandleDebugGetLootRecipient(const char * args);
+ bool HandleDebugGetValue(const char* args);
+ bool HandleDebugMod32Value(const char* args);
+ bool HandleDebugSetValue(const char* args);
+ bool HandleDebugSetItemFlagCommand(const char * args);
+ bool HandleDebugSetVehicleId(const char * args);
+ bool HandleDebugSpawnVehicle(const char * args);
+ bool HandleDebugEnterVehicle(const char * args);
+ bool HandleDebugUpdate(const char* args);
+ bool HandleDebugUpdateWorldStateCommand(const char* args);
+
+ bool HandleDebugSet32Bit(const char* args);
+ bool HandleDebugThreatList(const char * args);
+ bool HandleDebugHostilRefList(const char * args);
+ bool HandlePossessCommand(const char* args);
+ bool HandleUnPossessCommand(const char* args);
+ bool HandleBindSightCommand(const char* args);
+ bool HandleUnbindSightCommand(const char* args);
+
+ bool HandleDebugPlayCinematicCommand(const char* args);
+ bool HandleDebugPlayMovieCommand(const char* args);
+ bool HandleDebugPlaySoundCommand(const char* args);
+
+ bool HandleDebugSendBuyErrorCommand(const char* args);
+ bool HandleDebugSendChannelNotifyCommand(const char* args);
+ bool HandleDebugSendChatMsgCommand(const char* args);
+ bool HandleDebugSendEquipErrorCommand(const char* args);
+ bool HandleDebugSendLargePacketCommand(const char * args);
+ bool HandleDebugSendOpcodeCommand(const char* args);
+ bool HandleDebugSendPoiCommand(const char* args);
+ bool HandleDebugSendQuestPartyMsgCommand(const char* args);
+ bool HandleDebugSendQuestInvalidMsgCommand(const char* args);
+ bool HandleDebugSendSellErrorCommand(const char* args);
+ bool HandleDebugSendSetPhaseShiftCommand(const char * args);
+ bool HandleDebugSendSpellFailCommand(const char* args);
bool HandleEventActiveListCommand(const char* args);
bool HandleEventStartCommand(const char* args);
bool HandleEventStopCommand(const char* args);
bool HandleEventInfoCommand(const char* args);
+ bool HandleGameObjectAddCommand(const char* args);
+ bool HandleGameObjectDeleteCommand(const char* args);
+ bool HandleGameObjectMoveCommand(const char* args);
+ bool HandleGameObjectNearCommand(const char* args);
+ bool HandleGameObjectPhaseCommand(const char* args);
+ bool HandleGameObjectStateCommand(const char* args);
+ bool HandleGameObjectTargetCommand(const char* args);
+ bool HandleGameObjectTurnCommand(const char* args);
+
+ bool HandleGMCommand(const char* args);
+ bool HandleGMChatCommand(const char* args);
+ bool HandleGMFlyCommand(const char* args);
+ bool HandleGMListFullCommand(const char* args);
+ bool HandleGMListIngameCommand(const char* args);
+ bool HandleGMVisibleCommand(const char* args);
+
+ bool HandleGuildCreateCommand(const char* args);
+ bool HandleGuildInviteCommand(const char* args);
+ bool HandleGuildUninviteCommand(const char* args);
+ bool HandleGuildRankCommand(const char* args);
+ bool HandleGuildDeleteCommand(const char* args);
+
+ bool HandleHonorAddCommand(const char* args);
+ bool HandleHonorAddKillCommand(const char* args);
+ bool HandleHonorUpdateCommand(const char* args);
+
+ bool HandleInstanceListBindsCommand(const char* args);
+ bool HandleInstanceUnbindCommand(const char* args);
+ bool HandleInstanceStatsCommand(const char* args);
+ bool HandleInstanceSaveDataCommand(const char * args);
+
bool HandleLearnCommand(const char* args);
bool HandleLearnAllCommand(const char* args);
bool HandleLearnAllGMCommand(const char* args);
@@ -144,9 +206,15 @@ class ChatHandler
bool HandleLearnAllDefaultCommand(const char* args);
bool HandleLearnAllLangCommand(const char* args);
bool HandleLearnAllMyClassCommand(const char* args);
+ bool HandleLearnAllMyPetTalentsCommand(const char* args);
bool HandleLearnAllMySpellsCommand(const char* args);
bool HandleLearnAllMyTalentsCommand(const char* args);
+ bool HandleListAurasCommand(const char * args);
+ bool HandleListCreatureCommand(const char* args);
+ bool HandleListItemCommand(const char* args);
+ bool HandleListObjectCommand(const char* args);
+
bool HandleLookupAreaCommand(const char* args);
bool HandleLookupCreatureCommand(const char* args);
bool HandleLookupEventCommand(const char* args);
@@ -166,6 +234,7 @@ class ChatHandler
bool HandleModifyHPCommand(const char* args);
bool HandleModifyManaCommand(const char* args);
bool HandleModifyRageCommand(const char* args);
+ bool HandleModifyRunicPowerCommand(const char* args);
bool HandleModifyEnergyCommand(const char* args);
bool HandleModifyMoneyCommand(const char* args);
bool HandleModifyASpeedCommand(const char* args);
@@ -182,12 +251,17 @@ class ChatHandler
bool HandleModifyHonorCommand (const char* args);
bool HandleModifyRepCommand(const char* args);
bool HandleModifyArenaCommand(const char* args);
+ bool HandleModifyPhaseCommand(const char* args);
bool HandleModifyGenderCommand(const char* args);
+ //-----------------------Npc Commands-----------------------
bool HandleNpcAddCommand(const char* args);
bool HandleNpcAddMoveCommand(const char* args);
+ bool HandleNpcAddVendorItemCommand(const char* args);
bool HandleNpcChangeEntryCommand(const char *args);
+ bool HandleNpcChangeLevelCommand(const char* args);
bool HandleNpcDeleteCommand(const char* args);
+ bool HandleNpcDelVendorItemCommand(const char* args);
bool HandleNpcFactionIdCommand(const char* args);
bool HandleNpcFlagCommand(const char* args);
bool HandleNpcFollowCommand(const char* args);
@@ -195,8 +269,10 @@ class ChatHandler
bool HandleNpcMoveCommand(const char* args);
bool HandleNpcPlayEmoteCommand(const char* args);
bool HandleNpcSayCommand(const char* args);
+ bool HandleNpcSetDeathStateCommand(const char* args);
bool HandleNpcSetModelCommand(const char* args);
bool HandleNpcSetMoveTypeCommand(const char* args);
+ bool HandleNpcSetPhaseCommand(const char* args);
bool HandleNpcSpawnDistCommand(const char* args);
bool HandleNpcSpawnTimeCommand(const char* args);
bool HandleNpcTameCommand(const char* args);
@@ -207,8 +283,18 @@ class ChatHandler
bool HandleNpcAddFormationCommand(const char* args);
bool HandleNpcSetLinkCommand(const char* args);
- bool HandleReloadCommand(const char* args);
+ //TODO: NpcCommands that needs to be fixed :
+ bool HandleNpcAddWeaponCommand(const char* args);
+ bool HandleNpcNameCommand(const char* args);
+ bool HandleNpcSubNameCommand(const char* args);
+ //----------------------------------------------------------
+
+ bool HandleQuestAdd(const char * args);
+ bool HandleQuestRemove(const char * args);
+ bool HandleQuestComplete(const char * args);
+
bool HandleReloadAllCommand(const char* args);
+ bool HandleReloadAllAchievementCommand(const char* args);
bool HandleReloadAllAreaCommand(const char* args);
bool HandleReloadAllItemCommand(const char* args);
bool HandleReloadAllLootCommand(const char* args);
@@ -220,7 +306,8 @@ class ChatHandler
bool HandleReloadConfigCommand(const char* args);
- bool HandleReloadWpScriptsCommand(const char* args);
+ bool HandleReloadAchievementCriteriaDataCommand(const char* args);
+ bool HandleReloadAchievementRewardCommand(const char* args);
bool HandleReloadAreaTriggerTavernCommand(const char* args);
bool HandleReloadAreaTriggerTeleportCommand(const char* args);
bool HandleReloadAccessRequirementCommand(const char* args);
@@ -235,21 +322,35 @@ class ChatHandler
bool HandleReloadGameTeleCommand(const char* args);
bool HandleReloadGOQuestRelationsCommand(const char* args);
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
+ bool HandleReloadItemEnchantementsCommand(const char* args);
+ bool HandleReloadLocalesAchievementRewardCommand(const char* args);
+ bool HandleReloadLocalesCreatureCommand(const char* args);
+ bool HandleReloadLocalesGameobjectCommand(const char* args);
+ bool HandleReloadLocalesItemCommand(const char* args);
+ bool HandleReloadLocalesNpcTextCommand(const char* args);
+ bool HandleReloadLocalesPageTextCommand(const char* args);
+ bool HandleReloadLocalesPointsOfInterestCommand(const char* args);
+ bool HandleReloadLocalesQuestCommand(const char* args);
+// bool HandleReloadAuctionsCommand(const char* args);
bool HandleReloadLootTemplatesCreatureCommand(const char* args);
bool HandleReloadLootTemplatesDisenchantCommand(const char* args);
bool HandleReloadLootTemplatesFishingCommand(const char* args);
bool HandleReloadLootTemplatesGameobjectCommand(const char* args);
bool HandleReloadLootTemplatesItemCommand(const char* args);
+ bool HandleReloadLootTemplatesMillingCommand(const char* args);
bool HandleReloadLootTemplatesPickpocketingCommand(const char* args);
bool HandleReloadLootTemplatesProspectingCommand(const char* args);
bool HandleReloadLootTemplatesReferenceCommand(const char* args);
bool HandleReloadLootTemplatesQuestMailCommand(const char* args);
bool HandleReloadLootTemplatesSkinningCommand(const char* args);
+ bool HandleReloadLootTemplatesSpellCommand(const char* args);
bool HandleReloadTrinityStringCommand(const char* args);
bool HandleReloadNpcGossipCommand(const char* args);
bool HandleReloadNpcOptionCommand(const char* args);
bool HandleReloadNpcTrainerCommand(const char* args);
bool HandleReloadNpcVendorCommand(const char* args);
+ bool HandleReloadPageTextsCommand(const char* args);
+ bool HandleReloadPointsOfInterestCommand(const char* args);
bool HandleReloadQuestAreaTriggersCommand(const char* args);
bool HandleReloadQuestEndScriptsCommand(const char* args);
bool HandleReloadQuestStartScriptsCommand(const char* args);
@@ -260,30 +361,33 @@ class ChatHandler
bool HandleReloadSkillFishingBaseLevelCommand(const char* args);
bool HandleReloadSpellAffectCommand(const char* args);
bool HandleReloadSpellRequiredCommand(const char* args);
+ bool HandleReloadSpellAreaCommand(const char* args);
bool HandleReloadSpellElixirCommand(const char* args);
bool HandleReloadSpellLearnSpellCommand(const char* args);
bool HandleReloadSpellLinkedSpellCommand(const char* args);
bool HandleReloadSpellProcEventCommand(const char* args);
+ bool HandleReloadSpellBonusesCommand(const char* args);
bool HandleReloadSpellScriptTargetCommand(const char* args);
bool HandleReloadSpellScriptsCommand(const char* args);
bool HandleReloadSpellTargetPositionCommand(const char* args);
bool HandleReloadSpellThreatsCommand(const char* args);
bool HandleReloadSpellPetAurasCommand(const char* args);
bool HandleReloadSpellDisabledCommand(const char* args);
- bool HandleReloadPageTextsCommand(const char* args);
- bool HandleReloadItemEnchantementsCommand(const char* args);
- bool HandleReloadLocalesCreatureCommand(const char* args);
- bool HandleReloadLocalesGameobjectCommand(const char* args);
- bool HandleReloadLocalesItemCommand(const char* args);
- bool HandleReloadLocalesNpcTextCommand(const char* args);
- bool HandleReloadLocalesPageTextCommand(const char* args);
- bool HandleReloadLocalesQuestCommand(const char* args);
bool HandleReloadAuctionsCommand(const char* args);
+ bool HandleReloadWpScriptsCommand(const char* args);
- bool HandleInstanceListBindsCommand(const char* args);
- bool HandleInstanceUnbindCommand(const char* args);
- bool HandleInstanceStatsCommand(const char* args);
- bool HandleInstanceSaveDataCommand(const char * args);
+ bool HandleResetAchievementsCommand(const char * args);
+ bool HandleResetAllCommand(const char * args);
+ bool HandleResetHonorCommand(const char * args);
+ bool HandleResetLevelCommand(const char * args);
+ bool HandleResetSpellsCommand(const char * args);
+ bool HandleResetStatsCommand(const char * args);
+ bool HandleResetTalentsCommand(const char * args);
+
+ bool HandleSendItemsCommand(const char* args);
+ bool HandleSendMailCommand(const char* args);
+ bool HandleSendMessageCommand(const char * args);
+ bool HandleSendMoneyCommand(const char* args);
bool HandleServerCorpsesCommand(const char* args);
bool HandleServerExitCommand(const char* args);
@@ -294,41 +398,58 @@ class ChatHandler
bool HandleServerRestartCommand(const char* args);
bool HandleServerSetMotdCommand(const char* args);
bool HandleServerSetLogLevelCommand(const char* args);
+ bool HandleServerSetLogFileLevelCommand(const char* args);
bool HandleServerSetDiffTimeCommand(const char* args);
bool HandleServerShutDownCommand(const char* args);
bool HandleServerShutDownCancelCommand(const char* args);
+ bool HandleServerSetClosedCommand(const char* args);
- bool HandleAddHonorCommand(const char* args);
- bool HandleHonorAddKillCommand(const char* args);
- bool HandleUpdateHonorFieldsCommand(const char* args);
+ bool HandleTeleCommand(const char * args);
+ bool HandleTeleAddCommand(const char * args);
+ bool HandleTeleDelCommand(const char * args);
+ bool HandleTeleGroupCommand(const char* args);
+ bool HandleTeleNameCommand(const char* args);
- bool HandleLoadScriptsCommand(const char* args);
- bool HandleSendQuestPartyMsgCommand(const char* args);
- bool HandleSendQuestInvalidMsgCommand(const char* args);
+ bool HandleUnBanAccountCommand(const char* args);
+ bool HandleUnBanCharacterCommand(const char* args);
+ bool HandleUnBanIPCommand(const char* args);
- bool HandleDebugInArcCommand(const char* args);
- bool HandleDebugSpellFailCommand(const char* args);
+ bool HandleWpAddCommand(const char* args);
+ bool HandleWpLoadPathCommand(const char* args);
+ bool HandleWpUnLoadPathCommand(const char* args);
+ bool HandleWpModifyCommand(const char* args);
+ bool HandleWpEventCommand(const char* args);
+ bool HandleWpShowCommand(const char* args);
+ bool HandleReloadAllPaths(const char *args);
+
+ bool HandleHelpCommand(const char* args);
+ bool HandleCommandsCommand(const char* args);
+ bool HandleStartCommand(const char* args);
+ bool HandleDismountCommand(const char* args);
+ bool HandleSaveCommand(const char* args);
+
+ bool HandleNamegoCommand(const char* args);
+ bool HandleGonameCommand(const char* args);
+ bool HandleGroupgoCommand(const char* args);
+ bool HandleRecallCommand(const char* args);
+ bool HandleAnnounceCommand(const char* args);
+ bool HandleNotifyCommand(const char* args);
+ bool HandleGPSCommand(const char* args);
+ bool HandleTaxiCheatCommand(const char* args);
+ bool HandleWhispersCommand(const char* args);
+ bool HandleModifyDrunkCommand(const char* args);
+
+ bool HandleLoadScriptsCommand(const char* args);
bool HandleGUIDCommand(const char* args);
- bool HandleNameCommand(const char* args);
- bool HandleSubNameCommand(const char* args);
bool HandleItemMoveCommand(const char* args);
bool HandleDeMorphCommand(const char* args);
- bool HandleAddVendorItemCommand(const char* args);
- bool HandleDelVendorItemCommand(const char* args);
- bool HandleChangeLevelCommand(const char* args);
- bool HandleSetPoiCommand(const char* args);
- bool HandleEquipErrorCommand(const char* args);
bool HandleGoCreatureCommand(const char* args);
bool HandleGoObjectCommand(const char* args);
bool HandleGoTicketCommand(const char* args);
bool HandleGoTriggerCommand(const char* args);
bool HandleGoGraveyardCommand(const char* args);
- bool HandleTargetObjectCommand(const char* args);
- bool HandleDelObjectCommand(const char* args);
- bool HandleMoveObjectCommand(const char* args);
- bool HandleTurnObjectCommand(const char* args);
- bool HandleObjectStateCommand(const char* args);
+
bool HandlePInfoCommand(const char* args);
bool HandlePLimitCommand(const char* args);
bool HandleMuteCommand(const char* args);
@@ -339,37 +460,21 @@ class ChatHandler
bool HandleListFreezeCommand(const char* args);
bool HandleCharacterDeleteCommand(const char* args);
- bool HandleBanAccountCommand(const char* args);
- bool HandleBanCharacterCommand(const char* args);
- bool HandleBanIPCommand(const char* args);
- bool HandleUnBanAccountCommand(const char* args);
- bool HandleUnBanCharacterCommand(const char* args);
- bool HandleUnBanIPCommand(const char* args);
- bool HandleBanInfoAccountCommand(const char* args);
- bool HandleBanInfoCharacterCommand(const char* args);
- bool HandleBanInfoIPCommand(const char* args);
- bool HandleBanListAccountCommand(const char* args);
- bool HandleBanListCharacterCommand(const char* args);
- bool HandleBanListIPCommand(const char* args);
bool HandleGoXYCommand(const char* args);
bool HandleGoXYZCommand(const char* args);
bool HandleGoZoneXYCommand(const char* args);
bool HandleGoGridCommand(const char* args);
- bool HandleAddWeaponCommand(const char* args);
- bool HandleAllowMovementCommand(const char* args);
+ bool HandleNpcAllowMovementCommand(const char* args);
bool HandleGoCommand(const char* args);
bool HandleCooldownCommand(const char* args);
bool HandleUnLearnCommand(const char* args);
bool HandleGetDistanceCommand(const char* args);
- bool HandleGameObjectCommand(const char* args);
- bool HandleAnimCommand(const char* args);
- bool HandlePlaySoundCommand(const char* args);
- bool HandleStandStateCommand(const char* args);
+ bool HandleModifyStandStateCommand(const char* args);
bool HandleDieCommand(const char* args);
bool HandleDamageCommand(const char *args);
bool HandleReviveCommand(const char* args);
- bool HandleMorphCommand(const char* args);
+ bool HandleModifyMorphCommand(const char* args);
bool HandleAuraCommand(const char* args);
bool HandleUnAuraCommand(const char* args);
bool HandleLinkGraveCommand(const char* args);
@@ -393,29 +498,9 @@ class ChatHandler
bool HandleGroupDisbandCommand(const char* args);
bool HandleGroupRemoveCommand(const char* args);
- bool HandleGuildCreateCommand(const char* args);
- bool HandleGuildInviteCommand(const char* args);
- bool HandleGuildUninviteCommand(const char* args);
- bool HandleGuildRankCommand(const char* args);
- bool HandleGuildDeleteCommand(const char* args);
- bool HandleUpdate(const char* args);
bool HandleBankCommand(const char* args);
bool HandleChangeWeather(const char* args);
bool HandleKickPlayerCommand(const char * args);
- bool HandleTeleCommand(const char * args);
- bool HandleAddTeleCommand(const char * args);
- bool HandleDelTeleCommand(const char * args);
- bool HandleListAurasCommand(const char * args);
-
- bool HandleResetHonorCommand(const char * args);
- bool HandleResetLevelCommand(const char * args);
- bool HandleResetSpellsCommand(const char * args);
-
- bool HandleResetStatsCommand(const char * args);
- bool HandleResetTalentsCommand(const char * args);
-
- bool HandleResetAllCommand(const char * args);
-
// GM ticket command handlers
bool HandleGMTicketListCommand(const char* args);
@@ -432,43 +517,20 @@ class ChatHandler
bool HandleMaxSkillCommand(const char* args);
bool HandleSetSkillCommand(const char* args);
- bool HandleListCreatureCommand(const char* args);
- bool HandleListItemCommand(const char* args);
- bool HandleListObjectCommand(const char* args);
- bool HandleNearObjectCommand(const char* args);
bool HandlePasswordCommand(const char* args);
bool HandleLockAccountCommand(const char* args);
bool HandleRespawnCommand(const char* args);
- //New Wp Commands
- bool HandleWpAddCommand(const char* args);
- bool HandleWpLoadPathCommand(const char* args);
- bool HandleWpUnLoadPathCommand(const char* args);
- bool HandleWpModifyCommand(const char* args);
- bool HandleWpEventCommand(const char* args);
- bool HandleWpShowCommand(const char* args);
- bool HandleReloadAllPaths(const char *args);
-
- bool HandleFlyModeCommand(const char* args);
- bool HandleSendOpcodeCommand(const char* args);
- bool HandleSellErrorCommand(const char* args);
- bool HandleBuyErrorCommand(const char* args);
- bool HandleUpdateWorldStateCommand(const char* args);
- bool HandlePlaySound2Command(const char* args);
- bool HandleSendChannelNotifyCommand(const char* args);
- bool HandleSendChatMsgCommand(const char* args);
bool HandleRenameCommand(const char * args);
- bool HandleLoadPDumpCommand(const char *args);
- bool HandleWritePDumpCommand(const char *args);
- bool HandleCastCommand(const char *args);
- bool HandleCastBackCommand(const char *args);
- bool HandleCastDistCommand(const char *args);
- bool HandleCastSelfCommand(const char *args);
- bool HandleCastTargetCommand(const char *args);
+ bool HandleCustomizeCommand(const char * args);
+ bool HandlePDumpLoadCommand(const char *args);
+ bool HandlePDumpWriteCommand(const char *args);
bool HandleComeToMeCommand(const char *args);
bool HandleCombatStopCommand(const char *args);
- bool HandleCharDeleteCommand(const char *args);
- bool HandleSendMessageCommand(const char * args);
+
+ /*bool HandleCharDeleteCommand(const char *args);
+ bool HandleSendMessageCommand(const char * args);*/
+
bool HandleFlushArenaPointsCommand(const char *args);
bool HandlePlayAllCommand(const char* args);
bool HandleRepairitemsCommand(const char* args);
@@ -477,32 +539,30 @@ class ChatHandler
bool HandleTempAddSpwCommand(const char* args);
//! Development Commands
- bool HandleSetValue(const char* args);
- bool HandleGetValue(const char* args);
+
+ /*bool HandleQuestAdd(const char * args);
+ bool HandleQuestRemove(const char * args);
+ bool HandleQuestComplete(const char * args);*/
+
bool HandleSet32Bit(const char* args);
- bool HandleMod32Value(const char* args);
- bool HandleAddQuest(const char * args);
- bool HandleRemoveQuest(const char * args);
- bool HandleCompleteQuest(const char * args);
bool HandleSaveAllCommand(const char* args);
- bool HandleGetItemState(const char * args);
- bool HandleGetLootRecipient(const char * args);
- bool HandleDebugArenaCommand(const char * args);
- bool HandleDebugThreatList(const char * args);
- bool HandleDebugHostilRefList(const char * args);
- bool HandlePossessCommand(const char* args);
- bool HandleUnPossessCommand(const char* args);
- bool HandleBindSightCommand(const char* args);
- bool HandleUnbindSightCommand(const char* args);
Player* getSelectedPlayer();
Creature* getSelectedCreature();
Unit* getSelectedUnit();
+
char* extractKeyFromLink(char* text, char const* linkType, char** something1 = NULL);
char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = NULL);
+
uint32 extractSpellIdFromLink(char* text);
+ uint64 extractGuidFromLink(char* text);
GameTele const* extractGameTeleFromLink(char* text);
bool GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, Group* &group, uint64 &guid, bool offline = false);
+ std::string extractPlayerNameFromLink(char* text);
+
+ std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
+ virtual std::string GetNameLink() const { return GetNameLink(m_session->GetPlayer()); }
+ std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); }
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);
@@ -532,7 +592,7 @@ class CliHandler : public ChatHandler
const char *GetTrinityString(int32 entry) const;
bool isAvailable(ChatCommand const& cmd) const;
void SendSysMessage(const char *str);
- char const* GetName() const;
+ std::string GetNameLink() const;
bool needReportToTarget(Player* chr) const;
private:
diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
index 22b58cccdf3..333f2290816 100644
--- a/src/game/ChatHandler.cpp
+++ b/src/game/ChatHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,13 +30,14 @@
#include "ChannelMgr.h"
#include "Group.h"
#include "Guild.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ScriptCalls.h"
#include "Player.h"
#include "SpellAuras.h"
#include "Language.h"
#include "Util.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
{
@@ -66,11 +67,11 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(langDesc->skill_id != 0 && !_player->HasSkill(langDesc->skill_id))
{
// also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
- Unit::AuraList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE);
+ Unit::AuraEffectList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE);
bool foundAura = false;
- for(Unit::AuraList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
+ for(Unit::AuraEffectList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
{
- if((*i)->GetModifier()->m_miscvalue == lang)
+ if((*i)->GetMiscValue() == lang)
{
foundAura = true;
break;
@@ -85,6 +86,21 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(lang == LANG_ADDON)
{
+ if(sWorld.getConfig(CONFIG_CHATLOG_ADDON))
+ {
+ std::string msg = "";
+ recv_data >> msg;
+
+ if(msg.empty())
+ {
+ sLog.outDebug("Player %s send empty addon msg", GetPlayer()->GetName());
+ return;
+ }
+
+ sLog.outChat("[ADDON] Player %s sends: %s",
+ GetPlayer()->GetName(), msg.c_str());
+ }
+
// Disabled addon channel?
if(!sWorld.getConfig(CONFIG_ADDON_CHANNEL))
return;
@@ -122,9 +138,9 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
}
// but overwrite it by SPELL_AURA_MOD_LANGUAGE auras (only single case used)
- Unit::AuraList const& ModLangAuras = _player->GetAurasByType(SPELL_AURA_MOD_LANGUAGE);
+ Unit::AuraEffectList const& ModLangAuras = _player->GetAurasByType(SPELL_AURA_MOD_LANGUAGE);
if(!ModLangAuras.empty())
- lang = ModLangAuras.front()->GetModifier()->m_miscvalue;
+ lang = ModLangAuras.front()->GetMiscValue();
}
if (!_player->CanSpeak())
@@ -192,7 +208,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
Player *player = objmgr.GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity();
- uint32 pSecurity = player ? player->GetSession()->GetSecurity() : 0;
+ uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if(!player || tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers())
{
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
@@ -235,13 +251,19 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(msg.empty())
break;
- Group *group = GetPlayer()->GetGroup();
- if(!group)
+ // if player is in battleground, he cannot say to battleground members by /p
+ Group *group = GetPlayer()->GetOriginalGroup();
+ // so if player hasn't OriginalGroup and his player->GetGroup() is BG raid, then return
+ if( !group && (!(group = GetPlayer()->GetGroup()) || group->isBGGroup()) )
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_PARTY, lang, NULL, 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data, group->GetMemberGroup(GetPlayer()->GetGUID()));
+ group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_PARTY))
+ sLog.outChat("[PARTY] Player %s tells group with leader %s: %s",
+ GetPlayer()->GetName(), group->GetLeaderName(), msg.c_str());
}
break;
case CHAT_MSG_GUILD:
@@ -267,6 +289,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
+
+ if(lang != LANG_ADDON && sWorld.getConfig(CONFIG_CHATLOG_GUILD))
+ {
+ sLog.outChat("[GUILD] Player %s tells guild %s: %s",
+ GetPlayer()->GetName(), guild->GetName().c_str(), msg.c_str());
+ }
+ else if (lang == LANG_ADDON && sWorld.getConfig(CONFIG_CHATLOG_ADDON))
+ {
+ sLog.outChat("[ADDON] Player %s sends to guild %s: %s",
+ GetPlayer()->GetName(), guild->GetName().c_str(), msg.c_str());
+ }
}
break;
@@ -294,6 +327,10 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_GUILD))
+ sLog.outChat("[OFFICER] Player %s tells guild %s officers: %s",
+ GetPlayer()->GetName(), guild->GetName().c_str(), msg.c_str());
}
break;
}
@@ -315,13 +352,19 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(msg.empty())
break;
- Group *group = GetPlayer()->GetGroup();
- if(!group || !group->isRaidGroup() || group->isBGGroup())
+ // if player is in battleground, he cannot say to battleground members by /ra
+ Group *group = GetPlayer()->GetOriginalGroup();
+ // so if player hasn't OriginalGroup and his player->GetGroup() is BG raid or his group isn't raid, then return
+ if( !group && !(group = GetPlayer()->GetGroup()) || group->isBGGroup() || !group->isRaidGroup() )
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data);
+ group->BroadcastPacket(&data, false);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_RAID))
+ sLog.outChat("[RAID] Player %s tells raid with leader %s: %s",
+ GetPlayer()->GetName(), group->GetLeaderName(), msg.c_str());
} break;
case CHAT_MSG_RAID_LEADER:
{
@@ -341,13 +384,18 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(msg.empty())
break;
- Group *group = GetPlayer()->GetGroup();
- if(!group || !group->isRaidGroup() || !group->IsLeader(GetPlayer()->GetGUID()) || group->isBGGroup())
+ // if player is in battleground, he cannot say to battleground members by /ra
+ Group *group = GetPlayer()->GetOriginalGroup();
+ if( !group && !(group = GetPlayer()->GetGroup()) || group->isBGGroup() || !group->isRaidGroup() || !group->IsLeader(GetPlayer()->GetGUID()))
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data);
+ group->BroadcastPacket(&data, false);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_RAID))
+ sLog.outChat("[RAID] Leader player %s tells raid: %s",
+ GetPlayer()->GetName(), msg.c_str());
} break;
case CHAT_MSG_RAID_WARNING:
{
@@ -366,8 +414,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
return;
WorldPacket data;
+ //in battleground, raid warning is sent only to players in battleground - code is ok
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, "", 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data);
+ group->BroadcastPacket(&data, false);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_RAID))
+ sLog.outChat("[RAID] Leader player %s warns raid with: %s",
+ GetPlayer()->GetName(), msg.c_str());
} break;
case CHAT_MSG_BATTLEGROUND:
@@ -382,13 +435,18 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(msg.empty())
break;
+ //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
Group *group = GetPlayer()->GetGroup();
- if(!group || !group->isRaidGroup() || !group->isBGGroup())
+ if(!group || !group->isBGGroup())
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data);
+ group->BroadcastPacket(&data, false);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_BGROUND))
+ sLog.outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
+ GetPlayer()->GetName(), group->GetLeaderName(), msg.c_str());
} break;
case CHAT_MSG_BATTLEGROUND_LEADER:
@@ -403,13 +461,18 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(msg.empty())
break;
+ //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
Group *group = GetPlayer()->GetGroup();
- if(!group || !group->isRaidGroup() || !group->IsLeader(GetPlayer()->GetGUID()) || !group->isBGGroup())
+ if(!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID()))
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(),NULL);
- group->BroadcastPacket(&data);
+ group->BroadcastPacket(&data, false);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_BGROUND))
+ sLog.outChat("[RAID] Leader player %s tells battleground: %s",
+ GetPlayer()->GetName(), msg.c_str());
} break;
case CHAT_MSG_CHANNEL:
@@ -431,8 +494,22 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
{
- if(Channel *chn = cMgr->GetChannel(channel,_player))
+ Channel *chn = cMgr->GetChannel(channel,_player);
+ if(chn)
+ {
chn->Say(_player->GetGUID(),msg.c_str(),lang);
+
+ if((chn->HasFlag(CHANNEL_FLAG_TRADE) ||
+ chn->HasFlag(CHANNEL_FLAG_GENERAL) ||
+ chn->HasFlag(CHANNEL_FLAG_CITY) ||
+ chn->HasFlag(CHANNEL_FLAG_LFG)) &&
+ sWorld.getConfig(CONFIG_CHATLOG_SYSCHAN))
+ sLog.outChat("[SYSCHAN] Player %s tells channel %s: %s",
+ GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str());
+ else if(sWorld.getConfig(CONFIG_CHATLOG_CHANNEL))
+ sLog.outChat("[CHANNEL] Player %s tells channel %s: %s",
+ GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str());
+ }
}
} break;
@@ -491,6 +568,38 @@ void WorldSession::HandleEmoteOpcode( WorldPacket & recv_data )
GetPlayer()->HandleEmoteCommand(emote);
}
+namespace MaNGOS
+{
+ class EmoteChatBuilder
+ {
+ public:
+ EmoteChatBuilder(Player const& pl, uint32 text_emote, uint32 emote_num, Unit const* target)
+ : i_player(pl), i_text_emote(text_emote), i_emote_num(emote_num), i_target(target) {}
+
+ void operator()(WorldPacket& data, int32 loc_idx)
+ {
+ char const* nam = i_target ? i_target->GetNameForLocaleIdx(loc_idx) : NULL;
+ uint32 namlen = (nam ? strlen(nam) : 0) + 1;
+
+ data.Initialize(SMSG_TEXT_EMOTE, (20+namlen));
+ data << i_player.GetGUID();
+ data << (uint32)i_text_emote;
+ data << i_emote_num;
+ data << (uint32)namlen;
+ if( namlen > 1 )
+ data.append(nam, namlen);
+ else
+ data << (uint8)0x00;
+ }
+
+ private:
+ Player const& i_player;
+ uint32 i_text_emote;
+ uint32 i_emote_num;
+ Unit const* i_target;
+ };
+} // namespace MaNGOS
+
void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
{
if(!GetPlayer()->isAlive())
@@ -512,56 +621,44 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
recv_data >> emoteNum;
recv_data >> guid;
- const char *nam = 0;
- uint32 namlen = 1;
+ EmotesTextEntry const *em = sEmotesTextStore.LookupEntry(text_emote);
+ if (!em)
+ return;
- Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
- Creature *pCreature = dynamic_cast<Creature *>(unit);
- if(unit)
+ uint32 emote_anim = em->textid;
+
+ switch(emote_anim)
{
- nam = unit->GetName();
- namlen = (nam ? strlen(nam) : 0) + 1;
+ case EMOTE_STATE_SLEEP:
+ case EMOTE_STATE_SIT:
+ case EMOTE_STATE_KNEEL:
+ case EMOTE_ONESHOT_NONE:
+ break;
+ default:
+ GetPlayer()->HandleEmoteCommand(emote_anim);
+ break;
}
- EmotesTextEntry const *em = sEmotesTextStore.LookupEntry(text_emote);
- if (em)
- {
- uint32 emote_anim = em->textid;
+ Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
- WorldPacket data;
+ CellPair p = MaNGOS::ComputeCellPair(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY());
- switch(emote_anim)
- {
- case EMOTE_STATE_SLEEP:
- case EMOTE_STATE_SIT:
- case EMOTE_STATE_KNEEL:
- case EMOTE_ONESHOT_NONE:
- break;
- default:
- GetPlayer()->HandleEmoteCommand(emote_anim);
- break;
- }
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
- data.Initialize(SMSG_TEXT_EMOTE, (20+namlen));
- data << GetPlayer()->GetGUID();
- data << (uint32)text_emote;
- data << emoteNum;
- data << (uint32)namlen;
- if( namlen > 1 )
- {
- data.append(nam, namlen);
- }
- else
- {
- data << (uint8)0x00;
- }
+ MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
+ MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > emote_do(emote_builder);
+ MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > > emote_worker(GetPlayer(),sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),emote_do);
+ TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::EmoteChatBuilder > >, WorldTypeMapContainer > message(emote_worker);
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, message, *GetPlayer()->GetMap());
- GetPlayer()->SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
+ GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
- //Send scripted event call
- if (pCreature && Script)
- Script->ReceiveEmote(GetPlayer(),pCreature,text_emote);
- }
+ //Send scripted event call
+ if (unit && unit->GetTypeId()==TYPEID_UNIT && ((Creature*)unit)->AI())
+ ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(),text_emote);
}
void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data )
diff --git a/src/game/CombatHandler.cpp b/src/game/CombatHandler.cpp
index fb212870822..878d8e35648 100644
--- a/src/game/CombatHandler.cpp
+++ b/src/game/CombatHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
#include "Log.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "ObjectDefines.h"
diff --git a/src/game/ConfusedMovementGenerator.cpp b/src/game/ConfusedMovementGenerator.cpp
index bb7b56fdca7..06871ecdfa4 100644
--- a/src/game/ConfusedMovementGenerator.cpp
+++ b/src/game/ConfusedMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ConfusedMovementGenerator.h b/src/game/ConfusedMovementGenerator.h
index 4940c4bcaea..ad47b13cb39 100644
--- a/src/game/ConfusedMovementGenerator.h
+++ b/src/game/ConfusedMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp
index fe4794dea41..d427d1e5943 100644
--- a/src/game/Corpse.cpp
+++ b/src/game/Corpse.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,12 +22,9 @@
#include "Corpse.h"
#include "Player.h"
#include "UpdateMask.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Database/DatabaseEnv.h"
#include "Opcodes.h"
-#include "WorldSession.h"
-#include "WorldPacket.h"
#include "GossipDef.h"
#include "World.h"
@@ -36,7 +33,7 @@ Corpse::Corpse(CorpseType type) : WorldObject()
m_objectType |= TYPEMASK_CORPSE;
m_objectTypeId = TYPEID_CORPSE;
// 2.3.2 - 0x58
- m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HASPOSITION);
+ m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION);
m_valuesCount = CORPSE_END;
@@ -71,26 +68,26 @@ bool Corpse::Create( uint32 guidlow )
return true;
}
-bool Corpse::Create( uint32 guidlow, Player *owner, uint32 mapid, float x, float y, float z, float ang )
+bool Corpse::Create( uint32 guidlow, Player *owner)
{
SetInstanceId(owner->GetInstanceId());
- WorldObject::_Create(guidlow, HIGHGUID_CORPSE, mapid);
+ WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetMapId(), owner->GetPhaseMask());
- Relocate(x,y,z,ang);
+ Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
if(!IsPositionValid())
{
- sLog.outError("ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
- guidlow,owner->GetName(),x,y);
+ sLog.outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ guidlow,owner->GetName(),owner->GetPositionX(), owner->GetPositionY());
return false;
}
SetFloatValue( OBJECT_FIELD_SCALE_X, 1 );
- SetFloatValue( CORPSE_FIELD_POS_X, x );
- SetFloatValue( CORPSE_FIELD_POS_Y, y );
- SetFloatValue( CORPSE_FIELD_POS_Z, z );
- SetFloatValue( CORPSE_FIELD_FACING, ang );
+ SetFloatValue( CORPSE_FIELD_POS_X, GetPositionX() );
+ SetFloatValue( CORPSE_FIELD_POS_Y, GetPositionY() );
+ SetFloatValue( CORPSE_FIELD_POS_Z, GetPositionZ() );
+ SetFloatValue( CORPSE_FIELD_FACING, GetOrientation() );
SetUInt64Value( CORPSE_FIELD_OWNER, owner->GetGUID() );
m_grid = Trinity::ComputeGridPair(GetPositionX(), GetPositionY());
@@ -100,17 +97,27 @@ bool Corpse::Create( uint32 guidlow, Player *owner, uint32 mapid, float x, float
void Corpse::SaveToDB()
{
- // prevent DB data inconsistance problems and duplicates
+ // prevent DB data inconsistence problems and duplicates
CharacterDatabase.BeginTransaction();
DeleteFromDB();
std::ostringstream ss;
- ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance) VALUES ("
- << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", "
- << GetOrientation() << ", " << GetZoneId() << ", " << GetMapId() << ", '";
+ ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance,phaseMask) VALUES ("
+ << GetGUIDLow() << ", "
+ << GUID_LOPART(GetOwnerGUID()) << ", "
+ << GetPositionX() << ", "
+ << GetPositionY() << ", "
+ << GetPositionZ() << ", "
+ << GetOrientation() << ", "
+ << GetZoneId() << ", "
+ << GetMapId() << ", '";
for(uint16 i = 0; i < m_valuesCount; i++ )
ss << GetUInt32Value(i) << " ";
- ss << "'," << uint64(m_time) <<", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ")";
+ ss << "',"
+ << uint64(m_time) <<", "
+ << uint32(GetType()) << ", "
+ << int(GetInstanceId()) << ", "
+ << uint16(GetPhaseMask()) << ")"; // prevent out of range error
CharacterDatabase.Execute( ss.str().c_str() );
CharacterDatabase.CommitTransaction();
}
@@ -143,12 +150,12 @@ bool Corpse::LoadFromDB(uint32 guid, QueryResult *result, uint32 InstanceId)
{
bool external = (result != NULL);
if (!external)
- // 0 1 2 3 4 5 6 7 8
- result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,data,time,corpse_type,instance FROM corpse WHERE guid = '%u'",guid);
+ // 0 1 2 3 4 5 6 7 8 9
+ result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,data,time,corpse_type,instance,phaseMask FROM corpse WHERE guid = '%u'",guid);
if( ! result )
{
- sLog.outError("ERROR: Corpse (GUID: %u) not found in table `corpse`, can't load. ",guid);
+ sLog.outError("Corpse (GUID: %u) not found in table `corpse`, can't load. ",guid);
return false;
}
@@ -166,8 +173,8 @@ bool Corpse::LoadFromDB(uint32 guid, QueryResult *result, uint32 InstanceId)
bool Corpse::LoadFromDB(uint32 guid, Field *fields)
{
- // 0 1 2 3 4 5 6 7 8
- //result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,data,time,corpse_type,instance FROM corpse WHERE guid = '%u'",guid);
+ // 0 1 2 3 4 5 6 7 8 9
+ //result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,data,time,corpse_type,instance,phaseMask FROM corpse WHERE guid = '%u'",guid);
float positionX = fields[0].GetFloat();
float positionY = fields[1].GetFloat();
float positionZ = fields[2].GetFloat();
@@ -176,7 +183,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
if(!LoadValues( fields[5].GetString() ))
{
- sLog.outError("ERROR: Corpse #%d have broken data in `data` field. Can't be loaded.",guid);
+ sLog.outError("Corpse #%d have broken data in `data` field. Can't be loaded.",guid);
return false;
}
@@ -184,10 +191,11 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
m_type = CorpseType(fields[7].GetUInt32());
if(m_type >= MAX_CORPSE_TYPE)
{
- sLog.outError("ERROR: Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()));
+ sLog.outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()));
return false;
}
uint32 instanceid = fields[8].GetUInt32();
+ uint32 phaseMask = fields[9].GetUInt32();
// overwrite possible wrong/corrupted guid
SetUInt64Value(OBJECT_FIELD_GUID, MAKE_NEW_GUID(guid, 0, HIGHGUID_CORPSE));
@@ -195,11 +203,12 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
// place
SetInstanceId(instanceid);
SetMapId(mapid);
+ SetPhaseMask(phaseMask,false);
Relocate(positionX,positionY,positionZ,ort);
if(!IsPositionValid())
{
- sLog.outError("ERROR: Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog.outError("Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(),GUID_LOPART(GetOwnerGUID()),GetPositionX(),GetPositionY());
return false;
}
@@ -211,6 +220,6 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
bool Corpse::isVisibleForInState(Player const* u, bool inVisibleList) const
{
- return IsInWorld() && u->IsInWorld() && IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false);
+ return IsInWorld() && u->IsInWorld() && IsWithinDistInMap(u->m_seer,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false);
}
diff --git a/src/game/Corpse.h b/src/game/Corpse.h
index 91131c1cb85..da3511abfbb 100644
--- a/src/game/Corpse.h
+++ b/src/game/Corpse.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ class Corpse : public WorldObject
void RemoveFromWorld();
bool Create( uint32 guidlow );
- bool Create( uint32 guidlow, Player *owner, uint32 mapid, float x, float y, float z, float ang );
+ bool Create( uint32 guidlow, Player *owner );
void SaveToDB();
bool LoadFromDB(uint32 guid, QueryResult *result, uint32 InstanceId);
@@ -82,14 +82,11 @@ class Corpse : public WorldObject
Player* lootRecipient;
bool lootForBody;
- void Say(const char* text, uint32 language, uint64 TargetGuid) { MonsterSay(text,language,TargetGuid); }
- void Yell(const char* text, uint32 language, uint64 TargetGuid) { MonsterYell(text,language,TargetGuid); }
- void TextEmote(const char* text, uint64 TargetGuid) { MonsterTextEmote(text,TargetGuid); }
- void Whisper(const char* text, uint64 receiver) { MonsterWhisper(text,receiver); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
+ void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
GridReference<Corpse> &GetGridRef() { return m_gridRef; }
private:
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index f86df8485df..0de19314ab6 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "World.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
@@ -29,6 +28,7 @@
#include "QuestDef.h"
#include "GossipDef.h"
#include "Player.h"
+#include "PoolHandler.h"
#include "Opcodes.h"
#include "Log.h"
#include "LootMgr.h"
@@ -36,32 +36,24 @@
#include "CreatureAI.h"
#include "CreatureAISelector.h"
#include "Formulas.h"
-#include "SpellAuras.h"
#include "WaypointMovementGenerator.h"
#include "InstanceData.h"
-#include "BattleGround.h"
+#include "BattleGroundMgr.h"
#include "Util.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "OutdoorPvPMgr.h"
-#include "GameEvent.h"
+#include "GameEventMgr.h"
#include "CreatureGroups.h"
// apply implementation of the singletons
#include "Policies/SingletonImp.h"
-void TrainerSpellData::Clear()
-{
- for (TrainerSpellList::iterator itr = spellList.begin(); itr != spellList.end(); ++itr)
- delete (*itr);
- spellList.empty();
-}
-
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
{
- for(TrainerSpellList::const_iterator itr = spellList.begin(); itr != spellList.end(); ++itr)
- if((*itr)->spell == spell_id)
- return *itr;
+ TrainerSpellMap::const_iterator itr = spellList.find(spell_id);
+ if (itr != spellList.end())
+ return &itr->second;
return NULL;
}
@@ -144,14 +136,15 @@ Unit(),
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), lootingGroupLeaderGUID(0),
m_lootMoney(0), m_lootRecipient(0),
m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f),
-m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_reactState(REACT_AGGRESSIVE),
-m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
-m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false),
-m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL)
+m_gossipOptionLoaded(false),
+m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
+m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
+m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summonMask(SUMMON_MASK_NONE)
{
+ m_regenTimer = 200;
m_valuesCount = UNIT_END;
- for(int i =0; i<4; ++i)
+ for(int i =0; i<CREATURE_MAX_SPELLS; ++i)
m_spells[i] = 0;
m_CreatureSpellCooldowns.clear();
@@ -183,34 +176,34 @@ void Creature::AddToWorld()
ObjectAccessor::Instance().AddObject(this);
Unit::AddToWorld();
SearchFormation();
+ AIM_Initialize();
}
}
void Creature::RemoveFromWorld()
{
- ///- Remove the creature from the accessor
if(IsInWorld())
{
+ // Clear formation info
if(m_formation)
formation_mgr.RemoveCreatureFromGroup(m_formation, this);
- ObjectAccessor::Instance().RemoveObject(this);
Unit::RemoveFromWorld();
+ ObjectAccessor::Instance().RemoveObject(this);
}
}
void Creature::SearchFormation()
{
- if(isPet())
+ if(isSummon())
return;
uint32 lowguid = GetDBTableGUIDLow();
if(!lowguid)
- return;
+ return;
CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid);
if(frmdata != CreatureGroupMap.end())
formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this);
-
}
void Creature::RemoveCorpse()
@@ -311,10 +304,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
if(!m_respawnradius && m_defaultMovementType==RANDOM_MOTION_TYPE)
m_defaultMovementType = IDLE_MOTION_TYPE;
- m_spells[0] = GetCreatureInfo()->spell1;
- m_spells[1] = GetCreatureInfo()->spell2;
- m_spells[2] = GetCreatureInfo()->spell3;
- m_spells[3] = GetCreatureInfo()->spell4;
+ for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
+ m_spells[i] = GetCreatureInfo()->spells[i];
return true;
}
@@ -328,7 +319,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
// creatures always have melee weapon ready if any
SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_AURAS );
SelectLevel(GetCreatureInfo());
if (team == HORDE)
@@ -606,19 +596,37 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
return false;
}
- if(i_AI) delete i_AI;
- i_motionMaster.Initialize();
+ UnitAI *oldAI = i_AI;
+
+ Motion_Initialize();
+
i_AI = ai ? ai : FactorySelector::selectAI(this);
+ if(oldAI) delete oldAI;
IsAIEnabled = true;
i_AI->InitializeAI();
return true;
}
-bool Creature::Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, const CreatureData *data)
+void Creature::Motion_Initialize()
+{
+ if(!m_formation)
+ i_motionMaster.Initialize();
+ else if(m_formation->getLeader() == this)
+ {
+ m_formation->FormationReset(false);
+ i_motionMaster.Initialize();
+ }
+ else if(m_formation->isFormed())
+ i_motionMaster.MoveIdle(MOTION_SLOT_IDLE); //wait the order of leader
+ else
+ i_motionMaster.Initialize();
+}
+
+bool Creature::Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
{
SetMapId(map->GetId());
SetInstanceId(map->GetInstanceId());
- //m_DBTableGuid = guidlow;
+ SetPhaseMask(phaseMask,false);
//oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0;
const bool bResult = CreateFromProto(guidlow, Entry, team, data);
@@ -739,7 +747,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
if(!isBattleMaster())
return false;
- uint32 bgTypeId = objmgr.GetBattleMasterBG(GetEntry());
+ BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
if(!msg)
return pPlayer->GetBGAccessByLevel(bgTypeId);
@@ -755,8 +763,11 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
case BATTLEGROUND_AA:
- case BATTLEGROUND_RL: pPlayer->PlayerTalkClass->SendGossipMenu(10024,GetGUID()); break;
- break;
+ case BATTLEGROUND_RL:
+ case BATTLEGROUND_SA:
+ case BATTLEGROUND_DS:
+ case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024,GetGUID()); break;
+ default: break;
}
return false;
}
@@ -792,7 +803,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
if(gso->Id==1)
{
uint32 textid=GetNpcTextId();
- GossipText * gossiptext=objmgr.GetGossipText(textid);
+ GossipText const* gossiptext=objmgr.GetGossipText(textid);
if(!gossiptext)
cantalking=false;
}
@@ -903,13 +914,11 @@ void Creature::sendPreparedGossip(Player* player)
if(!player)
return;
- GossipMenu& gossipmenu = player->PlayerTalkClass->GetGossipMenu();
-
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT) // if world event npc then
gameeventmgr.HandleWorldEventGossip(player, this); // update world state with progress
- // in case empty gossip menu open quest menu if any
- if (gossipmenu.Empty() && GetNpcTextId() == 0)
+ // in case no gossip flag and quest menu not empty, open quest menu (client expect gossip menu with this flag)
+ if (!HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_GOSSIP) && !player->PlayerTalkClass->GetQuestMenu().Empty())
{
player->SendPreparedQuest(GetGUID());
return;
@@ -1010,7 +1019,7 @@ void Creature::OnGossipSelect(Player* player, uint32 option)
break;
case GOSSIP_OPTION_BATTLEFIELD:
{
- uint32 bgTypeId = objmgr.GetBattleMasterBG(GetEntry());
+ BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
player->GetSession()->SendBattlegGroundList( GetGUID(), bgTypeId );
break;
}
@@ -1025,12 +1034,12 @@ void Creature::OnPoiSelect(Player* player, GossipOption const *gossip)
{
if(gossip->GossipId==GOSSIP_GUARD_SPELLTRAINER || gossip->GossipId==GOSSIP_GUARD_SKILLTRAINER)
{
- Poi_Icon icon = ICON_POI_0;
+ Poi_Icon icon = ICON_POI_BLANK;
//need add more case.
switch(gossip->Action)
{
case GOSSIP_GUARD_BANK:
- icon=ICON_POI_HOUSE;
+ icon=ICON_POI_SMALL_HOUSE;
break;
case GOSSIP_GUARD_RIDE:
icon=ICON_POI_RWHORSE;
@@ -1039,7 +1048,7 @@ void Creature::OnPoiSelect(Player* player, GossipOption const *gossip)
icon=ICON_POI_BLUETOWER;
break;
default:
- icon=ICON_POI_TOWER;
+ icon=ICON_POI_GREYTOWER;
break;
}
uint32 textid = GetGossipTextId( gossip->Action, GetZoneId() );
@@ -1173,10 +1182,10 @@ void Creature::SaveToDB()
return;
}
- SaveToDB(GetMapId(), data->spawnMask);
+ SaveToDB(GetMapId(), data->spawnMask,GetPhaseMask());
}
-void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
+void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
{
// update in loaded data
if (!m_DBTableGuid)
@@ -1196,6 +1205,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
// data->guid = guid don't must be update at save
data.id = GetEntry();
data.mapid = mapid;
+ data.phaseMask = phaseMask;
data.displayid = displayId;
data.equipmentId = GetEquipmentId();
data.posX = GetPositionX();
@@ -1224,7 +1234,8 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
<< m_DBTableGuid << ","
<< GetEntry() << ","
<< mapid <<","
- << (uint32)spawnMask << ","
+ << uint32(spawnMask) << "," // cast to prevent save as symbol
+ << uint16(GetPhaseMask()) << "," // prevent out of range error
<< displayId <<","
<< GetEquipmentId() <<","
<< GetPositionX() << ","
@@ -1358,7 +1369,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(Entry);
if(!cinfo)
{
- sLog.outErrorDb("Error: creature entry %u does not exist.", Entry);
+ sLog.outErrorDb("Creature entry %u does not exist.", Entry);
return false;
}
m_originalEntry = Entry;
@@ -1390,18 +1401,22 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
return false;
}
+ if(const CreatureInfo *cInfo = objmgr.GetCreatureTemplate(data->id))
+ if(cInfo->VehicleId)
+ return false;
+
m_DBTableGuid = guid;
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
uint16 team = 0;
- if(!Create(guid,map,data->id,team,data))
+ if(!Create(guid,map,data->phaseMask,data->id,team,data))
return false;
Relocate(data->posX,data->posY,data->posZ,data->orientation);
if(!IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",GetGUIDLow(),GetEntry(),GetPositionX(),GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",GetGUIDLow(),GetEntry(),GetPositionX(),GetPositionY());
return false;
}
//We should set first home position, because then AI calls home movement
@@ -1439,7 +1454,6 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
// checked at creature_template loading
m_defaultMovementType = MovementGeneratorType(data->movementType);
- AIM_Initialize();
return true;
}
@@ -1450,11 +1464,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
if (force)
{
for (uint8 i = 0; i < 3; i++)
- {
- SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + i, 0);
- SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + (i * 2), 0);
- SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + (i * 2) + 1, 0);
- }
+ SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, 0);
m_equipmentId = 0;
}
return;
@@ -1466,11 +1476,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
m_equipmentId = equip_entry;
for (uint8 i = 0; i < 3; i++)
- {
- SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + i, einfo->equipmodel[i]);
- SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + (i * 2), einfo->equipinfo[i]);
- SetUInt32Value( UNIT_VIRTUAL_ITEM_INFO + (i * 2) + 1, einfo->equipslot[i]);
- }
+ SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, einfo->equipentry[i]);
}
bool Creature::hasQuest(uint32 quest_id) const
@@ -1528,6 +1534,10 @@ bool Creature::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bo
if (u == this)
return true;
+ // phased visibility (both must phased in same way)
+ if(!InSamePhase(u))
+ return false;
+
// always seen by owner
if(GetGUID() == u->GetCharmerOrOwnerGUID())
return true;
@@ -1616,7 +1626,7 @@ void Creature::setDeathState(DeathState s)
{
if((s == JUST_DIED && !m_isDeadByDefault)||(s == JUST_ALIVED && m_isDeadByDefault))
{
- m_deathTimer = m_corpseDelay*1000;
+ m_deathTimer = m_corpseDelay*IN_MILISECONDS;
// always save boss respawn time at death to prevent crash cheating
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
@@ -1642,6 +1652,10 @@ void Creature::setDeathState(DeathState s)
return;
Unit::setDeathState(CORPSE);
+
+ //Dismiss group if is leader
+ if(m_formation && m_formation->getLeader() == this)
+ m_formation->FormationReset(true);
}
if(s == JUST_ALIVED)
{
@@ -1655,9 +1669,9 @@ void Creature::setDeathState(DeathState s)
AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
clearUnitState(UNIT_STAT_ALL_STATE);
- i_motionMaster.Initialize();
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
LoadCreaturesAddon(true);
+ Motion_Initialize();
}
}
@@ -1720,11 +1734,15 @@ void Creature::Respawn()
//Call AI respawn virtual function
AI()->JustRespawned();
- GetMap()->Add(this);
+ uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId());
+ if (poolid)
+ poolhandler.UpdatePool(poolid, GetGUIDLow(), GetTypeId());
+ else
+ GetMap()->Add(this);
}
}
-bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
+bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo)
{
if (!spellInfo)
return false;
@@ -1732,15 +1750,15 @@ bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
return true;
- return Unit::IsImmunedToSpell(spellInfo, useCharges);
+ return Unit::IsImmunedToSpell(spellInfo);
}
-bool Creature::IsImmunedToSpellEffect(uint32 effect, uint32 mechanic) const
+bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
- if (GetCreatureInfo()->MechanicImmuneMask & (1 << (mechanic-1)))
+ if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1)))
return true;
- return Unit::IsImmunedToSpellEffect(effect, mechanic);
+ return Unit::IsImmunedToSpellEffect(spellInfo, index);
}
SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
@@ -1755,7 +1773,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i] );
if(!spellInfo)
{
- sLog.outError("WORLD: unknown spell id %i\n", m_spells[i]);
+ sLog.outError("WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1777,14 +1795,16 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
if(spellInfo->manaCost > GetPower(POWER_MANA))
continue;
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
- float range = GetSpellMaxRange(srange);
- float minrange = GetSpellMinRange(srange);
+ float range = GetSpellMaxRangeForHostile(srange);
+ float minrange = GetSpellMinRangeForHostile(srange);
float dist = GetDistance(pVictim);
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue;
if( dist > range || dist < minrange )
continue;
- if(HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ continue;
+ if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
continue;
return spellInfo;
}
@@ -1803,7 +1823,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i] );
if(!spellInfo)
{
- sLog.outError("WORLD: unknown spell id %i\n", m_spells[i]);
+ sLog.outError("WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1821,14 +1841,16 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
if(spellInfo->manaCost > GetPower(POWER_MANA))
continue;
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
- float range = GetSpellMaxRange(srange);
- float minrange = GetSpellMinRange(srange);
+ float range = GetSpellMaxRangeForFriend(srange);
+ float minrange = GetSpellMinRangeForFriend( srange);
float dist = GetDistance(pVictim);
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
// continue;
if( dist > range || dist < minrange )
continue;
- if(HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ continue;
+ if(spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))
continue;
return spellInfo;
}
@@ -1876,7 +1898,7 @@ void Creature::DoFleeToGetAssistance(float radius) // Optional parameter
Creature* pCreature = NULL;
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this,getVictim(),radius);
- Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(pCreature, u_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, pCreature, u_check);
VisitNearbyGridObject(radius, searcher);
if(!pCreature)
@@ -1896,7 +1918,7 @@ Unit* Creature::SelectNearestTarget(float dist) const
{
Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
- Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(target, u_check);
+ Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
@@ -1926,8 +1948,8 @@ void Creature::CallAssistance()
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
- Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck> searcher(assistList, u_check);
+ MaNGOS::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
+ MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
@@ -1987,7 +2009,7 @@ void Creature::SaveRespawnTime()
if(m_respawnTime > time(NULL)) // dead (no corpse)
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
else if(m_deathTimer > 0) // dead (corpse)
- objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/1000);
+ objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
}
bool Creature::IsOutOfThreatArea(Unit* pVictim) const
@@ -2076,9 +2098,8 @@ bool Creature::LoadCreaturesAddon(bool reload)
continue;
}
- Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, cAura->effect_idx, NULL, this, this, 0);
- AddAura(AdditionalAura);
- sLog.outDebug("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[0],GetGUIDLow(),GetEntry());
+ AddAuraEffect(AdditionalSpellInfo->Id, cAura->effect_idx, this);
+ sLog.outDebug("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[cAura->effect_idx],GetGUIDLow(),GetEntry());
}
}
return true;
@@ -2112,7 +2133,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
uint32 cooldown = GetSpellRecoveryTime(spellInfo);
if(cooldown)
- _AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/1000);
+ _AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILISECONDS);
if(spellInfo->Category)
_AddCreatureCategoryCooldown(spellInfo->Category, time(NULL));
@@ -2131,7 +2152,7 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const
return true;
CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category);
- return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / 1000)) > time(NULL));
+ return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILISECONDS)) > time(NULL));
}
bool Creature::HasSpellCooldown(uint32 spell_id) const
@@ -2160,7 +2181,7 @@ time_t Creature::GetRespawnTimeEx() const
if(m_respawnTime > now) // dead (no corpse)
return m_respawnTime;
else if(m_deathTimer > 0) // dead (corpse)
- return now+m_respawnDelay+m_deathTimer/1000;
+ return now+m_respawnDelay+m_deathTimer/IN_MILISECONDS;
else
return now;
}
@@ -2202,7 +2223,7 @@ void Creature::AllLootRemovedFromCorpse()
// corpse was not skinnable -> apply corpse looted timer
if (!cinfo || !cinfo->SkinLootId)
- nDeathTimer = (uint32)((m_corpseDelay * 1000) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED));
+ nDeathTimer = (uint32)((m_corpseDelay * IN_MILISECONDS) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED));
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
else
nDeathTimer = 0;
@@ -2226,12 +2247,17 @@ uint32 Creature::getLevelForTarget( Unit const* target ) const
return level;
}
-std::string Creature::GetScriptName()
+std::string Creature::GetAIName() const
+{
+ return ObjectMgr::GetCreatureTemplate(GetEntry())->AIName;
+}
+
+std::string Creature::GetScriptName() const
{
return objmgr.GetScriptName(GetScriptId());
}
-uint32 Creature::GetScriptId()
+uint32 Creature::GetScriptId() const
{
return ObjectMgr::GetCreatureTemplate(GetEntry())->ScriptID;
}
@@ -2366,4 +2392,4 @@ time_t Creature::GetLinkedCreatureRespawnTime() const
}
return 0;
-}
+} \ No newline at end of file
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 5a8fd48f97d..c1c1acb524c 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +28,6 @@
#include "LootMgr.h"
#include "Database/DatabaseEnv.h"
#include "Cell.h"
-#include "CreatureGroups.h"
#include <list>
@@ -138,6 +137,16 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_NO_CRIT = 0x00020000, // creature can't do critical strikes
};
+enum SummonMask
+{
+ SUMMON_MASK_NONE = 0x00000000,
+ SUMMON_MASK_SUMMON = 0x00000001,
+ SUMMON_MASK_GUARDIAN = 0x00000002,
+ SUMMON_MASK_TOTEM = 0x00000004,
+ SUMMON_MASK_PET = 0x00000008,
+ SUMMON_MASK_VEHICLE = 0x00000010,
+};
+
// 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)
@@ -178,7 +187,7 @@ struct CreatureInfo
uint32 rangeattacktime;
uint32 unit_flags; // enum UnitFlags mask values
uint32 dynamicflags;
- uint32 family; // enum CreatureFamily values for type==CREATURE_TYPE_BEAST, or 0 in another cases
+ uint32 family; // enum CreatureFamily values (optional)
uint32 trainer_type;
uint32 trainer_spell;
uint32 classNum;
@@ -197,16 +206,16 @@ struct CreatureInfo
int32 resistance4;
int32 resistance5;
int32 resistance6;
- uint32 spell1;
- uint32 spell2;
- uint32 spell3;
- uint32 spell4;
+ uint32 spells[CREATURE_MAX_SPELLS];
uint32 PetSpellDataId;
+ uint32 VehicleId;
uint32 mingold;
uint32 maxgold;
char const* AIName;
uint32 MovementType;
uint32 InhabitType;
+ float unk16;
+ float unk17;
bool RacialLeader;
bool RegenHealth;
uint32 equipmentId;
@@ -223,6 +232,8 @@ struct CreatureInfo
return SKILL_HERBALISM;
else if(type_flags & CREATURE_TYPEFLAGS_MININGLOOT)
return SKILL_MINING;
+ else if(type_flags & CREATURE_TYPEFLAGS_ENGINEERLOOT)
+ return SKILL_ENGINERING;
else
return SKILL_SKINNING; // normal case
}
@@ -245,12 +256,15 @@ struct NpcOptionLocale
std::vector<std::string> BoxText;
};
+struct PointOfInterestLocale
+{
+ std::vector<std::string> IconName;
+};
+
struct EquipmentInfo
{
uint32 entry;
- uint32 equipmodel[3];
- uint32 equipinfo[3];
- uint32 equipslot[3];
+ uint32 equipentry[3];
};
// from `creature` table
@@ -258,6 +272,7 @@ struct CreatureData
{
uint32 id; // entry in creature_template
uint16 mapid;
+ uint16 phaseMask;
uint32 displayid;
int32 equipmentId;
float posX;
@@ -311,6 +326,29 @@ enum InhabitTypeValues
INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR
};
+// Enums used by StringTextData::Type (CreatureEventAI)
+enum ChatType
+{
+ CHAT_TYPE_SAY = 0,
+ CHAT_TYPE_YELL = 1,
+ CHAT_TYPE_TEXT_EMOTE = 2,
+ CHAT_TYPE_BOSS_EMOTE = 3,
+ CHAT_TYPE_WHISPER = 4,
+ CHAT_TYPE_BOSS_WHISPER = 5,
+ CHAT_TYPE_ZONE_YELL = 6
+};
+
+//Selection method used by SelectTarget (CreatureEventAI)
+enum AttackingTarget
+{
+ ATTACKING_TARGET_RANDOM = 0, //Just selects a random target
+ ATTACKING_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
+ ATTACKING_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
+ ATTACKING_TARGET_RANDOM_PLAYER, //Just selects a random target (player only)
+ ATTACKING_TARGET_TOPAGGRO_PLAYER, //Selects targes from top aggro to bottom (player only)
+ ATTACKING_TARGET_BOTTOMAGGRO_PLAYER, //Selects targets from bottom aggro to top (player only)
+};
+
// 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()
@@ -354,6 +392,7 @@ struct VendorItemData
{
for (VendorItemList::iterator itr = m_items.begin(); itr != m_items.end(); ++itr)
delete (*itr);
+ m_items.clear();
}
};
@@ -371,25 +410,34 @@ typedef std::list<VendorItemCount> VendorItemCounts;
struct TrainerSpell
{
+ TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0), learnedSpell(0) {}
+
+ TrainerSpell(uint32 _spell, uint32 _spellCost, uint32 _reqSkill, uint32 _reqSkillValue, uint32 _reqLevel, uint32 _learnedspell)
+ : spell(_spell), spellCost(_spellCost), reqSkill(_reqSkill), reqSkillValue(_reqSkillValue), reqLevel(_reqLevel), learnedSpell(_learnedspell)
+ {}
+
uint32 spell;
- uint32 spellcost;
- uint32 reqskill;
- uint32 reqskillvalue;
- uint32 reqlevel;
+ uint32 spellCost;
+ uint32 reqSkill;
+ uint32 reqSkillValue;
+ uint32 reqLevel;
+ uint32 learnedSpell;
+
+ // helpers
+ bool IsCastable() const { return learnedSpell != spell; }
};
-typedef std::vector<TrainerSpell*> TrainerSpellList;
+typedef UNORDERED_MAP<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
struct TrainerSpellData
{
TrainerSpellData() : trainerType(0) {}
- TrainerSpellList spellList;
+ TrainerSpellMap spellList;
uint32 trainerType; // trainer type based at trainer spells, can be different from creature_template value.
// req. for correct show non-prof. trainers like weaponmaster, allowed values 0 and 2.
-
- void Clear();
TrainerSpell const* Find(uint32 spell_id) const;
+ void Clear() { spellList.clear(); }
};
typedef std::list<GossipOption> GossipOptionList;
@@ -411,7 +459,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
void AddToWorld();
void RemoveFromWorld();
- bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, const CreatureData *data = NULL);
+ bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data = NULL);
bool LoadCreaturesAddon(bool reload = false);
void SelectLevel(const CreatureInfo *cinfo);
void LoadEquipment(uint32 equip_entry, bool force=false);
@@ -423,9 +471,13 @@ class TRINITY_DLL_SPEC Creature : public Unit
void GetRespawnCoord(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
uint32 GetEquipmentId() const { return m_equipmentId; }
- bool isPet() const { return m_isPet; }
+ uint32 HasSummonMask(uint32 mask) const { return mask & m_summonMask; }
+ bool isSummon() const { return m_summonMask & SUMMON_MASK_SUMMON; }
+ bool isPet() const { return m_summonMask & SUMMON_MASK_PET; }
+ bool isVehicle() const { return m_summonMask & SUMMON_MASK_VEHICLE; }
+ bool isWorldCreature() const { return m_summonMask & SUMMON_MASK_PET; }
+ bool isTotem() const { return m_summonMask & SUMMON_MASK_TOTEM; }
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
- bool isTotem() const { return m_isTotem; }
bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; }
bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
@@ -440,9 +492,9 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const;
bool IsOutOfThreatArea(Unit* pVictim) const;
- bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
+ bool IsImmunedToSpell(SpellEntry const* spellInfo);
// redefine Unit::IsImmunedToSpell
- bool IsImmunedToSpellEffect(uint32 effect, uint32 mechanic) const;
+ bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
// redefine Unit::IsImmunedToSpellEffect
bool isElite() const
{
@@ -466,6 +518,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool IsInEvadeMode() const;
bool AIM_Initialize(CreatureAI* ai = NULL);
+ void Motion_Initialize();
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
CreatureAI* AI() { return (CreatureAI*)i_AI; }
@@ -507,8 +560,9 @@ class TRINITY_DLL_SPEC Creature : public Unit
CreatureInfo const *GetCreatureInfo() const { return m_creatureInfo; }
CreatureDataAddon const* GetCreatureAddon() const;
- std::string GetScriptName();
- uint32 GetScriptId();
+ std::string GetAIName() const;
+ std::string GetScriptName() const;
+ uint32 GetScriptId() const;
void prepareGossipMenu( Player *pPlayer, uint32 gossipid = 0 );
void sendPreparedGossip( Player* player );
@@ -522,15 +576,11 @@ class TRINITY_DLL_SPEC Creature : public Unit
GossipOption const* GetGossipOption( uint32 id ) const;
void addGossipOption(GossipOption const& gso) { m_goptions.push_back(gso); }
- void setEmoteState(uint8 emote) { m_emoteState = emote; };
- void Say(const char* text, uint32 language, uint64 TargetGuid) { MonsterSay(text,language,TargetGuid); }
- void Yell(const char* text, uint32 language, uint64 TargetGuid) { MonsterYell(text,language,TargetGuid); }
- void TextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(text,TargetGuid,IsBossEmote); }
- void Whisper(const char* text, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(text,receiver,IsBossWhisper); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId,TargetGuid,IsBossEmote); }
void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); }
+ void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
// overwrite WorldObject function for proper name localization
const char* GetNameForLocaleIdx(int32 locale_idx) const;
@@ -541,7 +591,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool LoadFromDB(uint32 guid, Map *map);
void SaveToDB();
// overwrited in Pet
- virtual void SaveToDB(uint32 mapid, uint8 spawnMask);
+ virtual void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
virtual void DeleteFromDB(); // overwrited in Pet
Loot loot;
@@ -630,10 +680,11 @@ class TRINITY_DLL_SPEC Creature : public Unit
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
void SearchFormation();
- CreatureGroup *GetFormation(){return m_formation;}
+ CreatureGroup *GetFormation() {return m_formation;}
void SetFormation(CreatureGroup *formation) {m_formation = formation;}
Unit *SelectVictim();
+ void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
@@ -662,13 +713,10 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool m_gossipOptionLoaded;
GossipOptionList m_goptions;
- uint8 m_emoteState;
- bool m_isPet; // set only in Pet::Pet
- bool m_isTotem; // set only in Totem::Totem
+ uint32 m_summonMask;
ReactStates m_reactState; // for AI, not charmInfo
void RegenerateMana();
void RegenerateHealth();
- uint32 m_regenTimer;
MovementGeneratorType m_defaultMovementType;
Cell m_currentCell; // store current cell where creature listed
uint32 m_DBTableGuid; ///< For new or temporary creatures is 0 for saved it is lowguid
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index d21fe43fcaa..59df2e866f2 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -71,6 +71,38 @@ void CreatureAI::OnCharmed(bool apply)
me->IsAIEnabled = false;
}
+void CreatureAI::DoZoneInCombat(Unit* pUnit)
+{
+ if (!pUnit)
+ pUnit = me;
+
+ Map *map = pUnit->GetMap();
+
+ if (!map->IsDungeon()) //use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated
+ {
+ sLog.outError("DoZoneInCombat call for map that isn't an instance (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0);
+ return;
+ }
+
+ if (!pUnit->CanHaveThreatList() || pUnit->getThreatManager().isThreatListEmpty())
+ {
+ sLog.outError("DoZoneInCombat called for creature that either cannot have threat list or has empty threat list (pUnit entry = %d)", pUnit->GetTypeId() == TYPEID_UNIT ? ((Creature*)pUnit)->GetEntry() : 0);
+ return;
+ }
+
+ Map::PlayerList const &PlayerList = map->GetPlayers();
+ for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if (Player* i_pl = i->getSource())
+ if (i_pl->isAlive())
+ {
+ pUnit->SetInCombatWith(i_pl);
+ i_pl->SetInCombatWith(pUnit);
+ pUnit->AddThreat(i_pl, 0.0f);
+ }
+ }
+}
+
void CreatureAI::MoveInLineOfSight(Unit *who)
{
if(me->getVictim())
@@ -112,9 +144,9 @@ void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
//kill self if charm aura has infinite duration
if(charmer->IsInEvadeMode())
{
- Unit::AuraList const& auras = me->GetAurasByType(SPELL_AURA_MOD_CHARM);
- for(Unit::AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
- if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->IsPermanent())
+ Unit::AuraEffectList const& auras = me->GetAurasByType(SPELL_AURA_MOD_CHARM);
+ for(Unit::AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
+ if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetParentAura()->IsPermanent())
{
charmer->Kill(me);
return;
@@ -129,3 +161,8 @@ void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
AttackStart(charmer->SelectNearestTarget());
}
+/*void CreatureAI::AttackedBy( Unit* attacker )
+{
+ if(!m_creature->getVictim())
+ AttackStart(attacker);
+}*/
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index b7a584fd36e..41e973f704c 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@
#include "Dynamic/ObjectRegistry.h"
#include "Dynamic/FactoryHolder.h"
+class WorldObject;
class Unit;
class Creature;
class Player;
@@ -73,9 +74,9 @@ enum SelectAggroTarget
class TRINITY_DLL_SPEC UnitAI
{
protected:
- Unit *me;
+ Unit* const me;
public:
- UnitAI(Unit *u) : me(u) {}
+ explicit UnitAI(Unit *u) : me(u) {}
virtual void AttackStart(Unit *);
virtual void UpdateAI(const uint32 diff) = 0;
@@ -96,9 +97,9 @@ class TRINITY_DLL_SPEC UnitAI
class TRINITY_DLL_SPEC PlayerAI : public UnitAI
{
protected:
- Player *me;
+ Player* const me;
public:
- PlayerAI(Player *p) : UnitAI((Unit*)p), me(p) {}
+ explicit PlayerAI(Player *p) : UnitAI((Unit*)p), me(p) {}
void OnCharmed(bool apply);
};
@@ -112,21 +113,26 @@ class TRINITY_DLL_SPEC SimpleCharmedAI : public PlayerAI
class TRINITY_DLL_SPEC CreatureAI : public UnitAI
{
protected:
- Creature *me;
+ Creature* const me;
+ Creature* const m_creature;
bool UpdateVictim();
public:
- CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c) {}
+ explicit CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c), m_creature(c) {}
virtual ~CreatureAI() {}
- // Called if IsVisible(Unit *who) is true at each *who move
+ ///== Reactions At =================================
+
+ // Called if IsVisible(Unit *who) is true at each *who move, reaction at visibility zone enter
virtual void MoveInLineOfSight(Unit *);
- // Called at stopping attack by any attacker
+ // Called for reaction at stopping attack at no attackers or targets
virtual void EnterEvadeMode();
// Called at any Damage from any attacker (before damage apply)
+ // Note: it for recalculation damage or special reaction at damage
+ // for attack reaction use AttackedBy called for not DOT damage in Unit::DealDamage also
virtual void DamageTaken(Unit *done_by, uint32 & /*damage*/) {}
// Called when the creature is killed
@@ -146,8 +152,8 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
// Called when spell hits a target
virtual void SpellHitTarget(Unit* target, const SpellEntry*) {}
- // Called when vitim entered water and creature can not enter water
- virtual bool canReachByRangeAttack(Unit*) { return false; }
+ // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
+ //virtual void AttackedBy(Unit* attacker);
// Called when creature is spawned or respawned (for reseting variables)
virtual void JustRespawned() {}
@@ -156,6 +162,36 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
virtual void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) {}
void OnCharmed(bool apply);
+
+ // Called at reaching home after evade
+ virtual void JustReachedHome() {}
+
+ void DoZoneInCombat(Unit* pUnit = NULL);
+
+ // Called at text emote receive from player
+ virtual void ReceiveEmote(Player* pPlayer, uint32 text_emote) {}
+
+ ///== Triggered Actions Requested ==================
+
+ // Called when creature attack expected (if creature can and no have current victim)
+ // Note: for reaction at hostile action must be called AttackedBy function.
+ //virtual void AttackStart(Unit *) {}
+
+ // Called at World update tick
+ //virtual void UpdateAI(const uint32 diff ) {}
+
+ ///== State checks =================================
+
+ // Is unit visible for MoveInLineOfSight
+ //virtual bool IsVisible(Unit *) const { return false; }
+
+ // Called when victim entered water and creature can not enter water
+ virtual bool canReachByRangeAttack(Unit*) { return false; }
+
+ ///== Fields =======================================
+
+ // Pointer to controlled by AI creature
+ //Creature* const m_creature;
};
struct SelectableAI : public FactoryHolder<CreatureAI>, public Permissible<Creature>
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h
index 2f82522f426..a8b8271c5ff 100644
--- a/src/game/CreatureAIImpl.h
+++ b/src/game/CreatureAIImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/CreatureAIRegistry.cpp b/src/game/CreatureAIRegistry.cpp
index 2ac73da702b..6253c06b8bc 100644
--- a/src/game/CreatureAIRegistry.cpp
+++ b/src/game/CreatureAIRegistry.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "CreatureAIRegistry.h"
#include "NullCreatureAI.h"
#include "ReactorAI.h"
#include "AggressorAI.h"
@@ -27,10 +26,10 @@
#include "PossessedAI.h"
#include "TotemAI.h"
#include "OutdoorPvPObjectiveAI.h"
+#include "CreatureEventAI.h"
#include "RandomMovementGenerator.h"
#include "CreatureAIImpl.h"
#include "MovementGeneratorImpl.h"
-#include "MapManager.h"
#include "CreatureAIRegistry.h"
#include "WaypointMovementGenerator.h"
@@ -48,6 +47,7 @@ namespace AIRegistry
(new CreatureAIFactory<TotemAI>("TotemAI"))->RegisterSelf();
(new CreatureAIFactory<OutdoorPvPObjectiveAI>("OutdoorPvPObjectiveAI"))->RegisterSelf();
(new CreatureAIFactory<PossessedAI>("PossessedAI"))->RegisterSelf();
+ (new CreatureAIFactory<CreatureEventAI>("EventAI"))->RegisterSelf();
(new MovementGeneratorFactory<RandomMovementGenerator<Creature> >(RANDOM_MOTION_TYPE))->RegisterSelf();
(new MovementGeneratorFactory<WaypointMovementGenerator<Creature> >(WAYPOINT_MOTION_TYPE))->RegisterSelf();
diff --git a/src/game/CreatureAIRegistry.h b/src/game/CreatureAIRegistry.h
index b4155403e9b..2b92a096731 100644
--- a/src/game/CreatureAIRegistry.h
+++ b/src/game/CreatureAIRegistry.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/CreatureAISelector.cpp b/src/game/CreatureAISelector.cpp
index a2f3d39fcc7..9250a254155 100644
--- a/src/game/CreatureAISelector.cpp
+++ b/src/game/CreatureAISelector.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
#include "MovementGenerator.h"
#include "ScriptCalls.h"
#include "Pet.h"
+#include "TemporarySummon.h"
INSTANTIATE_SINGLETON_1(CreatureAIRegistry);
INSTANTIATE_SINGLETON_1(MovementGeneratorRegistry);
@@ -34,24 +35,21 @@ namespace FactorySelector
{
CreatureAI* selectAI(Creature *creature)
{
- //if(creature->isPossessed())
- // creature->InitPossessedAI();
-
- // Allow scripting AI for normal creatures and not controlled pets (guardians and mini-pets)
- if((!creature->isPet() || !((Pet*)creature)->isControlled()) && !creature->isCharmed())
- if(CreatureAI* scriptedAI = Script->GetAI(creature))
- return scriptedAI;
-
+ const CreatureAICreator *ai_factory = NULL;
CreatureAIRegistry &ai_registry(CreatureAIRepository::Instance());
- assert( creature->GetCreatureInfo() != NULL );
- CreatureInfo const *cinfo=creature->GetCreatureInfo();
- const CreatureAICreator *ai_factory = NULL;
+ //player-controlled guardians with pet bar
+ if(creature->HasSummonMask(SUMMON_MASK_GUARDIAN) && ((Guardian*)creature)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ ai_factory = ai_registry.GetRegistryItem("PetAI");
- std::string ainame=cinfo->AIName;
+ //scriptname in db
+ if(!ai_factory)
+ if(CreatureAI* scriptedAI = Script->GetAI(creature))
+ return scriptedAI;
- // select by script name
- if( !ainame.empty())
+ // AIname in db
+ std::string ainame=creature->GetAIName();
+ if(!ai_factory && !ainame.empty())
ai_factory = ai_registry.GetRegistryItem( ainame.c_str() );
// select by NPC flags
@@ -59,7 +57,7 @@ namespace FactorySelector
{
if( creature->isGuard() )
ai_factory = ai_registry.GetRegistryItem("GuardAI");
- else if(creature->isPet() || (creature->isCharmed() && !creature->isPossessed()))
+ else if(creature->HasSummonMask(SUMMON_MASK_GUARDIAN))
ai_factory = ai_registry.GetRegistryItem("PetAI");
else if(creature->isTotem())
ai_factory = ai_registry.GetRegistryItem("TotemAI");
diff --git a/src/game/CreatureAISelector.h b/src/game/CreatureAISelector.h
index c7b4e541f3c..436233b5b21 100644
--- a/src/game/CreatureAISelector.h
+++ b/src/game/CreatureAISelector.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
new file mode 100644
index 00000000000..f39948dabd7
--- /dev/null
+++ b/src/game/CreatureEventAI.cpp
@@ -0,0 +1,1654 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Common.h"
+#include "CreatureEventAI.h"
+#include "CreatureEventAIMgr.h"
+#include "ObjectMgr.h"
+#include "Spell.h"
+#include "World.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GameEventMgr.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "WorldPacket.h"
+#include "InstanceData.h"
+
+int CreatureEventAI::Permissible(const Creature *creature)
+{
+ if( creature->GetAIName() == "EventAI" )
+ return PERMIT_BASE_SPECIAL;
+ return PERMIT_BASE_NO;
+}
+
+CreatureEventAI::CreatureEventAI(Creature *c) : CreatureAI(c), InCombat(false)
+{
+ CreatureEventAI_Event_Map::iterator CreatureEvents = CreatureEAI_Mgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
+ if (CreatureEvents != CreatureEAI_Mgr.GetCreatureEventAIMap().end())
+ {
+ std::vector<CreatureEventAI_Event>::iterator i;
+ for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
+ {
+
+ //Debug check
+ #ifndef MANGOS_DEBUG
+ if ((*i).event_flags & EFLAG_DEBUG_ONLY)
+ continue;
+ #endif
+ if(((*i).event_flags & (EFLAG_HEROIC | EFLAG_NORMAL)) && m_creature->GetMap()->IsDungeon() )
+ {
+ if( (m_creature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) ||
+ (!m_creature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL))
+ {
+ //event flagged for instance mode
+ CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
+ }
+ continue;
+ }
+ CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
+ }
+ //EventMap had events but they were not added because they must be for instance
+ if (CreatureEventAIList.empty())
+ sLog.outError("CreatureEventAI: CreatureId has events but no events added to list because of instance flags.", m_creature->GetEntry());
+ }
+ else
+ sLog.outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", m_creature->GetEntry());
+
+ bEmptyList = CreatureEventAIList.empty();
+ Phase = 0;
+ CombatMovementEnabled = true;
+ MeleeEnabled = true;
+ AttackDistance = 0;
+ AttackAngle = 0.0f;
+
+ //Handle Spawned Events
+ if (!bEmptyList)
+ {
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_SPAWNED)
+ ProcessEvent(*i);
+ }
+ }
+}
+
+bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pActionInvoker)
+{
+ if (!pHolder.Enabled || pHolder.Time)
+ return false;
+
+ //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask)
+ if (pHolder.Event.event_inverse_phase_mask & (1 << Phase))
+ return false;
+
+ //Store random here so that all random actions match up
+ uint32 rnd = rand();
+
+ //Return if chance for event is not met
+ if (pHolder.Event.event_chance <= rnd % 100)
+ return false;
+
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+
+ union
+ {
+ uint32 param4;
+ int32 param4_s;
+ };
+
+ param1 = pHolder.Event.event_param1;
+ param2 = pHolder.Event.event_param2;
+ param3 = pHolder.Event.event_param3;
+ param4 = pHolder.Event.event_param4;
+
+ //Check event conditions based on the event type, also reset events
+ switch (pHolder.Event.event_type)
+ {
+ case EVENT_T_TIMER:
+ {
+ if (!InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TIMER_OOC:
+ {
+ if (InCombat)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_HP:
+ {
+ if (!InCombat || !m_creature->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_MANA:
+ {
+ if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
+ return false;
+
+ uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_AGGRO:
+ {
+ }
+ break;
+ case EVENT_T_KILL:
+ {
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ case EVENT_T_DEATH:
+ {
+ }
+ break;
+ case EVENT_T_EVADE:
+ {
+ }
+ break;
+ case EVENT_T_SPELLHIT:
+ {
+ //Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_RANGE:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_OOC_LOS:
+ {
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SPAWNED:
+ {
+ }
+ break;
+ case EVENT_T_TARGET_HP:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
+ return false;
+
+ uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
+
+ if (perc > param1 || perc < param2)
+ return false;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_TARGET_CASTING:
+ {
+ if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
+ return false;
+
+ //Repeat Timers
+ if (param1 == param2)
+ {
+ pHolder.Time = param1;
+
+ }else if (param2 > param1)
+ pHolder.Time = urand(param1, param2);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_HP:
+ {
+ if (!InCombat)
+ return false;
+
+ Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
+
+ if (!pUnit)
+ return false;
+
+ pActionInvoker = pUnit;
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_IS_CC:
+ {
+ if (!InCombat)
+ return false;
+
+ std::list<Creature*> pList;
+ DoFindFriendlyCC(pList, param2);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_FRIENDLY_MISSING_BUFF:
+ {
+ std::list<Creature*> pList;
+ DoFindFriendlyMissingBuff(pList, param2, param1);
+
+ //List is empty
+ if (pList.empty())
+ return false;
+
+ //We don't really care about the whole list, just return first available
+ pActionInvoker = *(pList.begin());
+
+ //Repeat Timers
+ if (param3 == param4)
+ {
+ pHolder.Time = param3;
+
+ }else if (param4 > param3)
+ pHolder.Time = urand(param3, param4);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_SUMMONED_UNIT:
+ {
+ //Prevent event from occuring on no unit or non creatures
+ if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
+ return false;
+
+ //Creature id doesn't match up
+ if (param1 && ((Creature*)pActionInvoker)->GetEntry() != param1)
+ return false;
+
+ //Repeat Timers
+ if (param2 == param3)
+ {
+ pHolder.Time = param2;
+
+ }else if (param3 > param2)
+ pHolder.Time = urand(param2, param3);
+ else
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ pHolder.Enabled = false;
+ }
+ }
+ break;
+ case EVENT_T_REACHED_HOME:
+ {
+ }
+ break;
+ case EVENT_T_RECEIVE_EMOTE:
+ {
+ }
+ break;
+ default:
+
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
+ break;
+ }
+
+ //Disable non-repeatable events
+ if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE))
+ pHolder.Enabled = false;
+
+ //Process actions
+ for (uint32 j = 0; j < MAX_ACTIONS; j++)
+ ProcessAction(pHolder.Event.action[j].type, pHolder.Event.action[j].param1, pHolder.Event.action[j].param2, pHolder.Event.action[j].param3, rnd, pHolder.Event.event_id, pActionInvoker);
+
+ return true;
+}
+
+void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker)
+{
+ switch (type)
+ {
+ case ACTION_T_TEXT:
+ {
+ if (!param1)
+ return;
+
+ uint32 temp = 0;
+
+ if (param2 && param3)
+ {
+ switch( rand()%3 )
+ {
+ case 0: temp = param1; break;
+ case 2: temp = param2; break;
+ case 3: temp = param3; break;
+ }
+ }else if ( param2 && urand(0,1) )
+ {
+ temp = param2;
+ }else
+ {
+ temp = param1;
+ }
+
+ if (temp)
+ {
+ Unit* target = NULL;
+ Unit* owner = NULL;
+
+ if (pActionInvoker)
+ {
+ if (pActionInvoker->GetTypeId() == TYPEID_PLAYER)
+ target = pActionInvoker;
+ else if (owner = pActionInvoker->GetOwner())
+ {
+ if (owner->GetTypeId() == TYPEID_PLAYER)
+ target = owner;
+ }
+ }
+ else if (target = m_creature->getVictim())
+ {
+ if (target->GetTypeId() != TYPEID_PLAYER)
+ {
+ if (owner = target->GetOwner())
+ {
+ if (owner->GetTypeId() == TYPEID_PLAYER)
+ target = owner;
+ }
+ }
+ }
+
+ DoScriptText(temp, m_creature, target);
+ }
+ }
+ break;
+ case ACTION_T_SET_FACTION:
+ {
+ if (param1)
+ m_creature->setFaction(param1);
+ else
+ {
+ if (CreatureInfo const* ci = GetCreatureTemplateStore(m_creature->GetEntry()))
+ {
+ //if no id provided, assume reset and then use default
+ if (m_creature->getFaction() != ci->faction_A)
+ m_creature->setFaction(ci->faction_A);
+ }
+ }
+ }
+ break;
+ case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
+ {
+ if (param1 || param2)
+ {
+ //set model based on entry from creature_template
+ if (param1)
+ {
+ if (CreatureInfo const* ci = GetCreatureTemplateStore(param1))
+ {
+ //use default display
+ if (ci->Modelid1)
+ m_creature->SetDisplayId(ci->Modelid1);
+ }
+ }
+ //if no param1, then use value from param2 (modelId)
+ else
+ m_creature->SetDisplayId(param2);
+ }
+ else
+ m_creature->DeMorph();
+ }
+ break;
+ case ACTION_T_SOUND:
+ m_creature->PlayDirectSound(param1);
+ break;
+ case ACTION_T_EMOTE:
+ m_creature->HandleEmoteCommand(param1);
+ break;
+ case ACTION_T_RANDOM_SOUND:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != uint32(0xffffffff))
+ m_creature->PlayDirectSound( temp );
+ }
+ break;
+ case ACTION_T_RANDOM_EMOTE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ if (temp != uint32(0xffffffff))
+ m_creature->HandleEmoteCommand(temp);
+ }
+ break;
+ case ACTION_T_CAST:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+ Unit* caster = m_creature;
+
+ if (!target)
+ return;
+
+ //Cast is always triggered if target is forced to cast on self
+ if (param3 & CAST_FORCE_TARGET_SELF)
+ {
+ param3 |= CAST_TRIGGERED;
+ caster = target;
+ }
+
+ //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
+ bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
+
+ // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
+ if(param3 & CAST_AURA_NOT_PRESENT)
+ {
+ if(target->HasAura(param1))
+ return;
+ }
+
+ if (canCast)
+ {
+ const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
+
+ //Verify that spell exists
+ if (tSpell)
+ {
+ //Check if cannot cast spell
+ if (!(param3 & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) &&
+ !CanCast(target, tSpell, (param3 & CAST_TRIGGERED)))
+ {
+ //Melee current victim if flag not set
+ if (!(param3 & CAST_NO_MELEE_IF_OOM))
+ {
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
+ {
+ AttackDistance = 0;
+ AttackAngle = 0;
+
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+
+ }
+ else
+ {
+ //Interrupt any previous spell
+ if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
+ caster->InterruptNonMeleeSpells(false);
+
+ caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
+ }
+
+ }else
+ sLog.outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
+ }
+ }
+ break;
+ case ACTION_T_SUMMON:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ Creature* pCreature = NULL;
+
+ if (param3)
+ pCreature = m_creature->SummonCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, param3);
+ else
+ pCreature = m_creature->SummonCreature(param1, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+
+ sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_THREAT_SINGLE_PCT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ m_creature->getThreatManager().modifyThreatPercent(target, param1);
+ }
+ break;
+ case ACTION_T_THREAT_ALL_PCT:
+ {
+ Unit* Temp = NULL;
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid());
+ if (Temp)
+ m_creature->getThreatManager().modifyThreatPercent(Temp, param1);
+ }
+ }
+ break;
+ case ACTION_T_QUEST_EVENT:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->AreaExploredOrEventHappens(param1);
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)target)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FIELD:
+ {
+ Unit* target = GetTargetByType(param3, pActionInvoker);
+
+ if (param1 < OBJECT_END || param1 >= UNIT_END)
+ return;
+
+ if (target)
+ target->SetUInt32Value(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->SetFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_REMOVE_UNIT_FLAG:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ if (target)
+ target->RemoveFlag(UNIT_FIELD_FLAGS, param1);
+ }
+ break;
+ case ACTION_T_AUTO_ATTACK:
+ {
+ if (param1)
+ MeleeEnabled = true;
+ else MeleeEnabled = false;
+ }
+ break;
+ case ACTION_T_COMBAT_MOVEMENT:
+ {
+ CombatMovementEnabled = param1;
+
+ //Allow movement (create new targeted movement gen only if idle)
+ if (CombatMovementEnabled)
+ {
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ else
+ {
+ m_creature->GetMotionMaster()->MoveIdle();
+ }
+ }
+ break;
+ case ACTION_T_SET_PHASE:
+ {
+ Phase = param1;
+ }
+ break;
+ case ACTION_T_INC_PHASE:
+ {
+ Phase += param1;
+
+ if (Phase > 31)
+
+ sLog.outErrorDb( "CreatureEventAI: Event %d incremented Phase above 31. Phase mask cannot be used with phases past 31. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_EVADE:
+ {
+ EnterEvadeMode();
+ }
+ break;
+ case ACTION_T_FLEE:
+ {
+ if(m_creature->HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
+ break;
+ TimetoFleeLeft = 8000;
+ m_creature->DoFleeToGetAssistance();
+ IsFleeing = true;
+ }
+ break;
+ case ACTION_T_QUEST_EVENT_ALL:
+ {
+ Unit* Temp = NULL;
+ if( pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER )
+ {
+ Temp = Unit::GetUnit(*m_creature,pActionInvoker->GetGUID());
+ if( Temp )
+ ((Player*)Temp)->GroupEventHappens(param1,m_creature);
+ }
+ }
+ break;
+ case ACTION_T_CASTCREATUREGO_ALL:
+ {
+ Unit* Temp = NULL;
+
+ std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
+ for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
+ {
+ Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid());
+ if (Temp && Temp->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)Temp)->CastedCreatureOrGO(param1, m_creature->GetGUID(), param2);
+ }
+ }
+ break;
+ case ACTION_T_REMOVEAURASFROMSPELL:
+ {
+ Unit* target = GetTargetByType(param1, pActionInvoker);
+
+ if (target)
+ target->RemoveAurasDueToSpell(param2);
+ }
+ break;
+ case ACTION_T_RANGED_MOVEMENT:
+ {
+ AttackDistance = param1;
+ AttackAngle = ((float)param2/180)*M_PI;
+
+ if (CombatMovementEnabled)
+ {
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
+ }
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE:
+ {
+ uint32 temp = GetRandActionParam(rnd, param1, param2, param3);
+
+ Phase = temp;
+ }
+ break;
+ case ACTION_T_RANDOM_PHASE_RANGE:
+ {
+ if (param2 > param1)
+ {
+ Phase = param1 + (rnd % (param2 - param1));
+ }
+ else
+ sLog.outErrorDb( "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 <= Param1. Divide by Zero. Event = %d. CreatureEntry = %d", EventId, m_creature->GetEntry());
+ }
+ break;
+ case ACTION_T_SUMMON_ID:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+
+ //Duration
+ Creature* pCreature = NULL;
+
+ CreatureEventAI_Summon_Map::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAISummonMap().find(param3);
+ if (i == CreatureEAI_Mgr.GetCreatureEventAISummonMap().end())
+ {
+
+ sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", param1, param3, EventId, m_creature->GetEntry());
+ return;
+ }
+
+ if ((*i).second.SpawnTimeSecs)
+ pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
+ else pCreature = m_creature->SummonCreature(param1, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
+
+ if (!pCreature)
+ {
+
+ sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ else if (param2 != TARGET_T_SELF && target)
+ pCreature->AI()->AttackStart(target);
+ }
+ break;
+ case ACTION_T_KILLED_MONSTER:
+ {
+ //first attempt player who tapped creature
+ if (Player* pPlayer = m_creature->GetLootRecipient())
+ pPlayer->RewardPlayerAndGroupAtEvent(param1, m_creature);
+ else
+ {
+ //if not available, use pActionInvoker
+ Unit* pTarget = GetTargetByType(param2, pActionInvoker);
+
+ if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself())
+ pPlayer->RewardPlayerAndGroupAtEvent(param1, m_creature);
+ }
+ }
+ break;
+ case ACTION_T_SET_INST_DATA:
+ {
+ InstanceData* pInst = (InstanceData*)m_creature->GetInstanceData();
+ if (!pInst)
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData(param1, param2);
+ }
+ break;
+ case ACTION_T_SET_INST_DATA64:
+ {
+ Unit* target = GetTargetByType(param2, pActionInvoker);
+ if (!target)
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ InstanceData* pInst = (InstanceData*)m_creature->GetInstanceData();
+ if (!pInst)
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ pInst->SetData64(param1, target->GetGUID());
+ }
+ break;
+ case ACTION_T_UPDATE_TEMPLATE:
+ {
+ if (m_creature->GetEntry() == param1)
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ m_creature->UpdateEntry(param1, param2 ? HORDE : ALLIANCE);
+ }
+ break;
+ case ACTION_T_DIE:
+ {
+ if (m_creature->isDead())
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ break;
+ case ACTION_T_ZONE_COMBAT_PULSE:
+ {
+ if (!m_creature->isInCombat() || !m_creature->GetMap()->IsDungeon())
+ {
+
+ sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_ZONE_COMBAT_PULSE on creature out of combat or in non-dungeon map. Creature %d", EventId, m_creature->GetEntry());
+ return;
+ }
+
+ DoZoneInCombat(m_creature);
+ }
+ break;
+
+ // TRINITY ONLY
+ case ACTION_T_SET_ACTIVE:
+ me->setActive(param1 ? true : false);
+ break;
+ case ACTION_T_SET_AGGRESSIVE:
+ me->SetReactState(ReactStates(param1));
+ break;
+ case ACTION_T_ATTACK_START_PULSE:
+ AttackStart(me->SelectNearestTarget((float)param1));
+ break;
+ }
+}
+
+void CreatureEventAI::JustRespawned()
+{
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ if (bEmptyList)
+ return;
+
+ //Handle Spawned Events
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_SPAWNED)
+ ProcessEvent(*i);
+ }
+}
+
+void CreatureEventAI::Reset()
+{
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+
+ TimetoFleeLeft = 0;
+ IsFleeing = false;
+
+ if (bEmptyList)
+ return;
+
+ //Reset all events to enabled
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ //Reset all out of combat timers
+ case EVENT_T_TIMER_OOC:
+ {
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }
+ else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }
+ else
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ }
+ break;
+ //default:
+ //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
+ //(*i).Enabled = true;
+ //(*i).Time = 0;
+ //break;
+ }
+ }
+}
+
+void CreatureEventAI::JustReachedHome()
+{
+ m_creature->LoadCreaturesAddon();
+
+ if (!bEmptyList)
+ {
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_REACHED_HOME)
+ ProcessEvent(*i);
+ }
+ }
+
+ Reset();
+}
+
+void CreatureEventAI::EnterEvadeMode()
+{
+ m_creature->InterruptNonMeleeSpells(true);
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
+ m_creature->CombatStop();
+
+ if (m_creature->isAlive())
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+
+ m_creature->SetLootRecipient(NULL);
+
+ InCombat = false;
+
+ if (bEmptyList)
+ return;
+
+ //Handle Evade events
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_EVADE)
+ ProcessEvent(*i);
+ }
+}
+
+void CreatureEventAI::JustDied(Unit* killer)
+{
+ InCombat = false;
+ IsFleeing = false;
+ Reset();
+
+ if (bEmptyList)
+ return;
+
+ //Handle Evade events
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_DEATH)
+ ProcessEvent(*i, killer);
+ }
+}
+
+void CreatureEventAI::KilledUnit(Unit* victim)
+{
+ if (bEmptyList || victim->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_KILL)
+ ProcessEvent(*i, victim);
+ }
+}
+
+void CreatureEventAI::JustSummoned(Creature* pUnit)
+{
+ if (bEmptyList || !pUnit)
+ return;
+
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_SUMMONED_UNIT)
+ ProcessEvent(*i, pUnit);
+ }
+}
+
+void CreatureEventAI::Aggro(Unit *who)
+{
+ //Check for on combat start events
+ if (!bEmptyList)
+ {
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_AGGRO:
+ (*i).Enabled = true;
+ ProcessEvent(*i, who);
+ break;
+ //Reset all in combat timers
+ case EVENT_T_TIMER:
+ if ((*i).Event.event_param2 == (*i).Event.event_param1)
+ {
+ (*i).Time = (*i).Event.event_param1;
+ (*i).Enabled = true;
+ }
+ else if ((*i).Event.event_param2 > (*i).Event.event_param1)
+ {
+ (*i).Time = urand((*i).Event.event_param1, (*i).Event.event_param2);
+ (*i).Enabled = true;
+ }
+ else
+ sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
+ break;
+ //All normal events need to be re-enabled and their time set to 0
+ default:
+ (*i).Enabled = true;
+ (*i).Time = 0;
+ break;
+ }
+ }
+ }
+
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ EventDiff = 0;
+}
+
+void CreatureEventAI::AttackStart(Unit *who)
+{
+ if (!who)
+ return;
+
+ if (m_creature->Attack(who, MeleeEnabled))
+ {
+ if (!InCombat)
+ {
+ InCombat = true;
+ Aggro(who);
+ }
+
+ if (CombatMovementEnabled)
+ {
+ m_creature->GetMotionMaster()->MoveChase(who, AttackDistance, AttackAngle);
+ }
+ else
+ {
+ m_creature->GetMotionMaster()->MoveIdle();
+ }
+ }
+}
+
+void CreatureEventAI::MoveInLineOfSight(Unit *who)
+{
+ if (!who || InCombat)
+ return;
+
+ //Check for OOC LOS Event
+ if (!bEmptyList && !m_creature->getVictim())
+ {
+ for (std::list<CreatureEventAIHolder>::iterator itr = CreatureEventAIList.begin(); itr != CreatureEventAIList.end(); ++itr)
+ {
+ if ((*itr).Event.event_type == EVENT_T_OOC_LOS)
+ {
+ //can trigger if closer than fMaxAllowedRange
+ float fMaxAllowedRange = (*itr).Event.event_param2;
+
+ //if range is ok and we are actually in LOS
+ if (m_creature->IsWithinDistInMap(who, fMaxAllowedRange) && m_creature->IsWithinLOSInMap(who))
+ {
+ //if friendly event&&who is not hostile OR hostile event&&who is hostile
+ if (((*itr).Event.event_param1 && !m_creature->IsHostileTo(who)) ||
+ ((!(*itr).Event.event_param1) && m_creature->IsHostileTo(who)))
+ ProcessEvent(*itr, who);
+ }
+ }
+ }
+ }
+
+ //if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
+ // return;
+
+ if(me->canStartAttack(who))
+ AttackStart(who);
+}
+
+void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell)
+{
+
+ if (bEmptyList)
+ return;
+
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ if ((*i).Event.event_type == EVENT_T_SPELLHIT)
+ {
+ //If spell id matches (or no spell id) & if spell school matches (or no spell school)
+ if (!(*i).Event.event_param1 || pSpell->Id == (*i).Event.event_param1)
+ {
+ if ((*i).Event.event_param2_s == -1 || pSpell->SchoolMask == (*i).Event.event_param2)
+ ProcessEvent(*i, pUnit);
+ }
+ }
+ }
+}
+
+void CreatureEventAI::UpdateAI(const uint32 diff)
+{
+ //Check if we are in combat (also updates calls threat update code)
+ bool Combat = InCombat ? UpdateVictim() : false;
+
+ //Must return if creature isn't alive. Normally select hostil target and get victim prevent this
+ if (!m_creature->isAlive())
+ return;
+
+ if (IsFleeing)
+ {
+ if(TimetoFleeLeft < diff)
+ {
+ me->SetControlled(false, UNIT_STAT_FLEEING);
+ me->SetNoCallAssistance(false);
+ me->CallAssistance();
+ if(me->getVictim())
+ me->GetMotionMaster()->MoveChase(me->getVictim());
+ IsFleeing = false;
+ }
+ else
+ TimetoFleeLeft -= diff;
+
+ return;
+ }
+
+ if (!bEmptyList)
+ {
+ //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
+ if (EventUpdateTime < diff)
+ {
+ EventDiff += diff;
+
+ //Check for time based events
+ for (std::list<CreatureEventAIHolder>::iterator i = CreatureEventAIList.begin(); i != CreatureEventAIList.end(); ++i)
+ {
+ //Decrement Timers
+ if ((*i).Time)
+ {
+ if ((*i).Time > EventDiff)
+ {
+ //Do not decrement timers if event cannot trigger in this phase
+ if (!((*i).Event.event_inverse_phase_mask & (1 << Phase)))
+ (*i).Time -= EventDiff;
+
+ //Skip processing of events that have time remaining
+ continue;
+ }
+ else (*i).Time = 0;
+ }
+
+ //Events that are updated every EVENT_UPDATE_TIME
+ switch ((*i).Event.event_type)
+ {
+ case EVENT_T_TIMER_OOC:
+ ProcessEvent(*i);
+ break;
+ case EVENT_T_TIMER:
+ case EVENT_T_MANA:
+ case EVENT_T_HP:
+ case EVENT_T_TARGET_HP:
+ case EVENT_T_TARGET_CASTING:
+ case EVENT_T_FRIENDLY_HP:
+ if (Combat)
+ ProcessEvent(*i);
+ break;
+ case EVENT_T_RANGE:
+ if (Combat)
+ {
+ if (m_creature->IsWithinDistInMap(m_creature->getVictim(),(float)(*i).Event.event_param2))
+ {
+ if (m_creature->GetDistance(m_creature->getVictim()) >= (float)(*i).Event.event_param1)
+ ProcessEvent(*i);
+ }
+ }
+ break;
+ }
+ }
+
+ EventDiff = 0;
+ EventUpdateTime = EVENT_UPDATE_TIME;
+ }
+ else
+ {
+ EventDiff += diff;
+ EventUpdateTime -= diff;
+ }
+ }
+
+ //Melee Auto-Attack
+ if (Combat && MeleeEnabled)
+ DoMeleeAttackIfReady();
+}
+
+inline Unit* CreatureEventAI::SelectUnit(AttackingTarget target, uint32 position)
+{
+ //ThreatList m_threatlist;
+ std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
+ std::list<HostilReference*>::iterator i = m_threatlist.begin();
+ std::list<HostilReference*>::reverse_iterator r = m_threatlist.rbegin();
+
+ if (position >= m_threatlist.size() || !m_threatlist.size())
+ return NULL;
+
+ switch (target)
+ {
+ case ATTACKING_TARGET_RANDOM:
+ {
+ advance ( i , position + (rand() % (m_threatlist.size() - position ) ));
+ return Unit::GetUnit(*m_creature,(*i)->getUnitGuid());
+ }
+ case ATTACKING_TARGET_TOPAGGRO:
+ {
+ advance ( i , position);
+ return Unit::GetUnit(*m_creature,(*i)->getUnitGuid());
+ }
+ case ATTACKING_TARGET_BOTTOMAGGRO:
+ {
+ advance ( r , position);
+ return Unit::GetUnit(*m_creature,(*r)->getUnitGuid());
+ }
+ }
+ return NULL;
+}
+
+inline uint32 CreatureEventAI::GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
+{
+ switch (rnd % 3)
+ {
+ case 0:
+ return param1;
+ break;
+ case 1:
+ return param2;
+ break;
+ case 2:
+ return param3;
+ break;
+ }
+ return 0;
+}
+
+inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoker)
+{
+ switch (Target)
+ {
+ case TARGET_T_SELF:
+ return m_creature;
+ break;
+ case TARGET_T_HOSTILE:
+ return m_creature->getVictim();
+ break;
+ case TARGET_T_HOSTILE_SECOND_AGGRO:
+ return SelectUnit(ATTACKING_TARGET_TOPAGGRO,1);
+ break;
+ case TARGET_T_HOSTILE_LAST_AGGRO:
+ return SelectUnit(ATTACKING_TARGET_BOTTOMAGGRO,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM:
+ return SelectUnit(ATTACKING_TARGET_RANDOM,0);
+ break;
+ case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
+ return SelectUnit(ATTACKING_TARGET_RANDOM,1);
+ break;
+ case TARGET_T_ACTION_INVOKER:
+ return pActionInvoker;
+ break;
+ default:
+ return NULL;
+ break;
+ };
+}
+
+Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
+{
+ CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ Unit* pUnit = NULL;
+
+ MaNGOS::MostHPMissingInRange u_check(m_creature, range, MinHPDiff);
+ MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
+
+ /*
+ typedef TYPELIST_4(GameObject, Creature*except pets*, DynamicObject, Corpse*Bones*) AllGridObjectTypes;
+ This means that if we only search grid then we cannot possibly return pets or players so this is safe
+ */
+ TypeContainerVisitor<MaNGOS::UnitLastSearcher<MaNGOS::MostHPMissingInRange>, GridTypeMapContainer > grid_unit_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, grid_unit_searcher, *m_creature->GetMap());
+ return pUnit;
+}
+
+void CreatureEventAI::DoFindFriendlyCC(std::list<Creature*>& _list, float range)
+{
+ CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ MaNGOS::FriendlyCCedInRange u_check(m_creature, range);
+ MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange> searcher(m_creature, _list, u_check);
+
+ TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyCCedInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, grid_creature_searcher, *m_creature->GetMap());
+}
+
+void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid)
+{
+ CellPair p(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+
+ MaNGOS::FriendlyMissingBuffInRange u_check(m_creature, range, spellid);
+ MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange> searcher(m_creature, _list, u_check);
+
+ TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRange>, GridTypeMapContainer > grid_creature_searcher(searcher);
+
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, grid_creature_searcher, *m_creature->GetMap());
+}
+
+//*********************************
+//*** Functions used globally ***
+
+void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
+{
+ if (!pSource)
+ {
+ sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.",textEntry);
+ return;
+ }
+
+ if (textEntry >= 0)
+ {
+ sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry);
+ return;
+ }
+
+ CreatureEventAI_TextMap::const_iterator i = CreatureEAI_Mgr.GetCreatureEventAITextMap().find(textEntry);
+
+ if (i == CreatureEAI_Mgr.GetCreatureEventAITextMap().end())
+ {
+ sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry);
+ return;
+ }
+
+ sLog.outDebug("CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote);
+
+ if((*i).second.SoundId)
+ {
+ if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
+ pSource->PlayDirectSound((*i).second.SoundId);
+ else
+ sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId);
+ }
+
+ if((*i).second.Emote)
+ {
+ if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote);
+ }
+ else
+ sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId());
+ }
+
+ switch((*i).second.Type)
+ {
+ case CHAT_TYPE_SAY:
+ pSource->MonsterSay(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
+ break;
+ case CHAT_TYPE_YELL:
+ pSource->MonsterYell(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
+ break;
+ case CHAT_TYPE_TEXT_EMOTE:
+ pSource->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0);
+ break;
+ case CHAT_TYPE_BOSS_EMOTE:
+ pSource->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0, true);
+ break;
+ case CHAT_TYPE_WHISPER:
+ {
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(textEntry, target->GetGUID());
+ else sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ }break;
+ case CHAT_TYPE_BOSS_WHISPER:
+ {
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ pSource->MonsterWhisper(textEntry, target->GetGUID(), true);
+ else sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ }break;
+ case CHAT_TYPE_ZONE_YELL:
+ pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
+ break;
+ }
+}
+
+bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered)
+{
+ //No target so we can't cast
+ if (!Target || !Spell)
+ return false;
+
+ //Silenced so we can't cast
+ if (!Triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
+ return false;
+
+ //Check for power
+ if (!Triggered && me->GetPower((Powers)Spell->powerType) < Spell->manaCost)
+ return false;
+
+ SpellRangeEntry const *TempRange = NULL;
+
+ TempRange = GetSpellRangeStore()->LookupEntry(Spell->rangeIndex);
+
+ //Spell has invalid range store so we can't use it
+ if (!TempRange)
+ return false;
+
+ //Unit is out of range of this spell
+ if (me->GetDistance(Target) > me->GetSpellMaxRangeForTarget(Target, TempRange)
+ || me->GetDistance(Target) < me->GetSpellMinRangeForTarget(Target, TempRange))
+ return false;
+
+ return true;
+}
+
+void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
+{
+ if (bEmptyList)
+ return;
+
+ for (std::list<CreatureEventAIHolder>::iterator itr = CreatureEventAIList.begin(); itr != CreatureEventAIList.end(); ++itr)
+ {
+ if ((*itr).Event.event_type == EVENT_T_RECEIVE_EMOTE)
+ {
+ if ((*itr).Event.event_param1 != text_emote)
+ return;
+
+ bool bProcess = false;
+
+ switch((*itr).Event.event_param2)
+ {
+ //enum ConditionType
+ case CONDITION_NONE: // 0 0
+ bProcess = true;
+ break;
+ case CONDITION_AURA: // spell_id effindex
+ if (pPlayer->HasAura((*itr).Event.event_param3,(*itr).Event.event_param4))
+ bProcess = true;
+ break;
+ case CONDITION_ITEM: // item_id count
+ if (pPlayer->HasItemCount((*itr).Event.event_param3,(*itr).Event.event_param4))
+ bProcess = true;
+ break;
+ case CONDITION_ITEM_EQUIPPED: // item_id count
+ if (pPlayer->HasItemOrGemWithIdEquipped((*itr).Event.event_param3,(*itr).Event.event_param4))
+ bProcess = true;
+ break;
+ case CONDITION_ZONEID: // zone_id 0
+ if (pPlayer->GetZoneId() == (*itr).Event.event_param3)
+ bProcess = true;
+ break;
+ case CONDITION_REPUTATION_RANK: // faction_id min_rank
+ if (pPlayer->GetReputationRank((*itr).Event.event_param3) >= (*itr).Event.event_param4)
+ bProcess = true;
+ break;
+ case CONDITION_TEAM: // player_team 0, (469 - Alliance 67 - Horde)
+ if (pPlayer->GetTeam() == (*itr).Event.event_param3)
+ bProcess = true;
+ break;
+ case CONDITION_SKILL: // skill_id min skill_value
+ if (pPlayer->HasSkill((*itr).Event.event_param3) && pPlayer->GetSkillValue((*itr).Event.event_param3) >= (*itr).Event.event_param4)
+ bProcess = true;
+ break;
+ case CONDITION_QUESTREWARDED: // quest_id 0
+ if (pPlayer->GetQuestRewardStatus((*itr).Event.event_param3))
+ bProcess = true;
+ break;
+ case CONDITION_QUESTTAKEN: // quest_id 0, for condition true while quest active.
+ if (pPlayer->GetQuestStatus((*itr).Event.event_param3) == QUEST_STATUS_INCOMPLETE)
+ bProcess = true;
+ break;
+ case CONDITION_ACTIVE_EVENT: // event_id 0
+ if (IsHolidayActive(HolidayIds((*itr).Event.event_param3)))
+ bProcess = true;
+ break;
+ }
+
+ if (bProcess)
+ {
+ sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing");
+ ProcessEvent(*itr, pPlayer);
+ }
+ }
+ }
+}
diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h
new file mode 100644
index 00000000000..f5e89026508
--- /dev/null
+++ b/src/game/CreatureEventAI.h
@@ -0,0 +1,307 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_CREATURE_EAI_H
+#define MANGOS_CREATURE_EAI_H
+
+#include "Common.h"
+#include "Creature.h"
+#include "CreatureAI.h"
+#include "Unit.h"
+
+class Player;
+class WorldObject;
+
+#define EVENT_UPDATE_TIME 500
+#define SPELL_RUN_AWAY 8225
+#define MAX_ACTIONS 3
+#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
+
+enum EventAI_Type
+{
+ EVENT_T_TIMER = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_TIMER_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ EVENT_T_HP = 2, // HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_MANA = 3, // ManaMax%,ManaMin% RepeatMin, RepeatMax
+ EVENT_T_AGGRO = 4, // NONE
+ EVENT_T_KILL = 5, // RepeatMin, RepeatMax
+ EVENT_T_DEATH = 6, // NONE
+ EVENT_T_EVADE = 7, // NONE
+ EVENT_T_SPELLHIT = 8, // SpellID, School, RepeatMin, RepeatMax
+ EVENT_T_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax
+ EVENT_T_OOC_LOS = 10, // NoHostile, NoFriendly, RepeatMin, RepeatMax
+ EVENT_T_SPAWNED = 11, // NONE
+ EVENT_T_TARGET_HP = 12, // HPMax%, HPMin%, RepeatMin, RepeatMax
+ EVENT_T_TARGET_CASTING = 13, // RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_HP = 14, // HPDeficit, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_IS_CC = 15, // DispelType, Radius, RepeatMin, RepeatMax
+ EVENT_T_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax
+ EVENT_T_SUMMONED_UNIT = 17, // CreatureId, RepeatMin, RepeatMax
+ EVENT_T_TARGET_MANA = 18, // ManaMax%, ManaMin%, RepeatMin, RepeatMax
+ EVENT_T_QUEST_ACCEPT = 19, // QuestID
+ EVENT_T_QUEST_COMPLETE = 20, //
+ EVENT_T_REACHED_HOME = 21, // NONE
+ EVENT_T_RECEIVE_EMOTE = 22, // EmoteId, Condition, CondValue1, CondValue2
+
+ EVENT_T_END,
+};
+
+enum EventAI_ActionType
+{
+ ACTION_T_NONE = 0, //*No action
+ ACTION_T_TEXT = 1, //*-TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values.
+ ACTION_T_SET_FACTION = 2, //*FactionId (or 0 for default)
+ ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3, //*Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
+ ACTION_T_SOUND = 4, //*SoundId
+ ACTION_T_EMOTE = 5, //*EmoteId
+ ACTION_T_RANDOM_SAY = 6, //*UNUSED
+ ACTION_T_RANDOM_YELL = 7, //*UNUSED
+ ACTION_T_RANDOM_TEXTEMOTE = 8, //*UNUSED
+ ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_RANDOM_EMOTE = 10, //*EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
+ ACTION_T_CAST = 11, //*SpellId, Target, CastFlags
+ ACTION_T_SUMMON = 12, //*CreatureID, Target, Duration in ms
+ ACTION_T_THREAT_SINGLE_PCT = 13, //*Threat%, Target
+ ACTION_T_THREAT_ALL_PCT = 14, //Threat%
+ ACTION_T_QUEST_EVENT = 15, //*QuestID, Target
+ ACTION_T_CASTCREATUREGO = 16, //*QuestID, SpellId, Target
+ ACTION_T_SET_UNIT_FIELD = 17, //*Field_Number, Value, Target
+ ACTION_T_SET_UNIT_FLAG = 18, //*Flags (may be more than one field OR'd together), Target
+ ACTION_T_REMOVE_UNIT_FLAG = 19, //*Flags (may be more than one field OR'd together), Target
+ ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
+ ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
+ ACTION_T_SET_PHASE = 22, //*Phase
+ ACTION_T_INC_PHASE = 23, //*Value (may be negative to decrement phase, should not be 0)
+ ACTION_T_EVADE = 24, //No Params
+ ACTION_T_FLEE = 25, //No Params
+ ACTION_T_QUEST_EVENT_ALL = 26, //*QuestID
+ ACTION_T_CASTCREATUREGO_ALL = 27, //*QuestId, SpellId
+ ACTION_T_REMOVEAURASFROMSPELL = 28, //*Target, Spellid
+ ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
+ ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
+ ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
+ ACTION_T_SUMMON_ID = 32, //*CreatureId, Target, SpawnId
+ ACTION_T_KILLED_MONSTER = 33, //*CreatureId, Target
+ ACTION_T_SET_INST_DATA = 34, //*Field, Data
+ ACTION_T_SET_INST_DATA64 = 35, //*Field, Target
+ ACTION_T_UPDATE_TEMPLATE = 36, //*Entry, Team
+ ACTION_T_DIE = 37, //No Params
+ ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
+
+ ACTION_T_SET_ACTIVE = 101, //Apply
+ ACTION_T_SET_AGGRESSIVE = 102, //Apply
+ ACTION_T_ATTACK_START_PULSE = 103, //Distance
+
+ ACTION_T_END,
+};
+
+enum Target
+{
+ //Self (m_creature)
+ TARGET_T_SELF = 0, //Self cast
+
+ //Hostile targets (if pet then returns pet owner)
+ TARGET_T_HOSTILE, //Our current target (ie: highest aggro)
+ TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat
+
+ //Invoker targets (if pet then returns pet owner)
+ TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF)
+
+ //Hostile targets (including pets)
+ TARGET_T_HOSTILE_WPET, //Current target (can be a pet)
+ TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
+ TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
+ TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list
+ TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat
+
+ TARGET_T_ACTION_INVOKER_WPET,
+
+ TARGET_T_END
+};
+
+enum CastFlags
+{
+ CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting
+ CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
+ CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
+ CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
+ CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
+ CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
+};
+
+enum EventFlags
+{
+ EFLAG_REPEATABLE = 0x01, //Event repeats
+ EFLAG_NORMAL = 0x02, //Event only occurs in Normal instance difficulty
+ EFLAG_HEROIC = 0x04, //Event only occurs in Heroic instance difficulty
+ EFLAG_RESERVED_3 = 0x08,
+ EFLAG_RESERVED_4 = 0x10,
+ EFLAG_RESERVED_5 = 0x20,
+ EFLAG_RESERVED_6 = 0x40,
+ EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build
+};
+
+// String text additional data, used in (CreatureEventAI)
+struct StringTextData
+{
+ uint32 SoundId;
+ uint8 Type;
+ uint32 Language;
+ uint32 Emote;
+};
+// Text Maps
+typedef UNORDERED_MAP<int32, StringTextData> CreatureEventAI_TextMap;
+
+struct CreatureEventAI_Event
+{
+ uint32 event_id;
+
+ uint32 creature_id;
+
+ uint32 event_inverse_phase_mask;
+
+ EventAI_Type event_type : 16;
+ uint8 event_chance : 8;
+ uint8 event_flags : 8;
+
+ union
+ {
+ uint32 event_param1;
+ int32 event_param1_s;
+ };
+ union
+ {
+ uint32 event_param2;
+ int32 event_param2_s;
+ };
+ union
+ {
+ uint32 event_param3;
+ int32 event_param3_s;
+ };
+ union
+ {
+ uint32 event_param4;
+ int32 event_param4_s;
+ };
+
+ struct _action
+ {
+ EventAI_ActionType type: 16;
+ union
+ {
+ uint32 param1;
+ int32 param1_s;
+ };
+ union
+ {
+ uint32 param2;
+ int32 param2_s;
+ };
+ union
+ {
+ uint32 param3;
+ int32 param3_s;
+ };
+ }action[MAX_ACTIONS];
+};
+//Event_Map
+typedef UNORDERED_MAP<uint32, std::vector<CreatureEventAI_Event> > CreatureEventAI_Event_Map;
+
+struct CreatureEventAI_Summon
+{
+ uint32 id;
+
+ float position_x;
+ float position_y;
+ float position_z;
+ float orientation;
+ uint32 SpawnTimeSecs;
+};
+
+//EventSummon_Map
+typedef UNORDERED_MAP<uint32, CreatureEventAI_Summon> CreatureEventAI_Summon_Map;
+
+struct CreatureEventAIHolder
+{
+ CreatureEventAIHolder(CreatureEventAI_Event p) : Event(p), Time(0), Enabled(true){}
+
+ CreatureEventAI_Event Event;
+ uint32 Time;
+ bool Enabled;
+};
+
+class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
+{
+
+ public:
+ explicit CreatureEventAI(Creature *c);
+ ~CreatureEventAI()
+ {
+ CreatureEventAIList.clear();
+ }
+ void JustRespawned();
+ void Reset();
+ void JustReachedHome();
+ void EnterEvadeMode();
+ void JustDied(Unit* killer);
+ void KilledUnit(Unit* victim);
+ void JustSummoned(Creature* pUnit);
+ void Aggro(Unit *who);
+ void AttackStart(Unit *who);
+ void MoveInLineOfSight(Unit *who);
+ void SpellHit(Unit* pUnit, const SpellEntry* pSpell);
+ void UpdateAI(const uint32 diff);
+ void ReceiveEmote(Player* pPlayer, uint32 text_emote);
+ static int Permissible(const Creature *);
+
+ bool ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pActionInvoker = NULL);
+ void ProcessAction(uint16 type, uint32 param1, uint32 param2, uint32 param3, uint32 rnd, uint32 EventId, Unit* pActionInvoker);
+ inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3);
+ inline Unit* GetTargetByType(uint32 Target, Unit* pActionInvoker);
+ inline Unit* SelectUnit(AttackingTarget target, uint32 position);
+
+ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target);
+ bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered);
+
+ Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff);
+ void DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid);
+ void DoFindFriendlyCC(std::list<Creature*>& _list, float range);
+
+ //Bool for if we are in combat or not
+ bool InCombat;
+ //Holder for events (stores enabled, time, and eventid)
+ std::list<CreatureEventAIHolder> CreatureEventAIList;
+ uint32 EventUpdateTime; //Time between event updates
+ uint32 EventDiff; //Time between the last event call
+ bool bEmptyList;
+
+ //Variables used by Events themselves
+ uint8 Phase; //Current phase, max 32 phases
+ bool CombatMovementEnabled; //If we allow targeted movment gen (movement twoards top threat)
+ bool MeleeEnabled; //If we allow melee auto attack
+ uint32 AttackDistance; //Distance to attack from
+ float AttackAngle; //Angle of attack
+
+ uint32 TimetoFleeLeft;
+ bool IsFleeing;
+};
+#endif
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp
new file mode 100644
index 00000000000..ab6ca3e4d63
--- /dev/null
+++ b/src/game/CreatureEventAIMgr.cpp
@@ -0,0 +1,683 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Common.h"
+#include "Database/DatabaseEnv.h"
+#include "Database/SQLStorage.h"
+#include "CreatureEventAI.h"
+#include "CreatureEventAIMgr.h"
+#include "ObjectMgr.h"
+#include "ProgressBar.h"
+#include "Policies/SingletonImp.h"
+#include "ObjectDefines.h"
+
+INSTANTIATE_SINGLETON_1(CreatureEventAIMgr);
+
+// -------------------
+void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
+{
+ // Drop Existing Text Map, only done once and we are ready to add data from multiple sources.
+ m_CreatureEventAI_TextMap.clear();
+
+ // Load EventAI Text
+ LoadTrinityStrings(WorldDatabase,"creature_ai_texts",-1,1+(TEXT_SOURCE_RANGE));
+
+ // Gather Additional data from EventAI Texts
+ QueryResult *result = WorldDatabase.PQuery("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
+
+ sLog.outString("Loading EventAI Texts additional data...");
+ if (result)
+ {
+ barGoLink bar(result->GetRowCount());
+ uint32 count = 0;
+
+ do
+ {
+ bar.step();
+ Field* fields = result->Fetch();
+ StringTextData temp;
+
+ int32 i = fields[0].GetInt32();
+ temp.SoundId = fields[1].GetInt32();
+ temp.Type = fields[2].GetInt32();
+ temp.Language = fields[3].GetInt32();
+ temp.Emote = fields[4].GetInt32();
+
+ if (i >= 0)
+ {
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not a negative value.",i);
+ continue;
+ }
+
+ if (i <= TEXT_SOURCE_RANGE)
+ {
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is out of accepted entry range for table.",i);
+ continue;
+ }
+
+ if (temp.SoundId)
+ {
+ if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId))
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has soundId %u but sound does not exist.",i,temp.SoundId);
+ }
+
+ if (!GetLanguageDescByID(temp.Language))
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language);
+
+ if (temp.Type > CHAT_TYPE_BOSS_WHISPER)
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
+
+ m_CreatureEventAI_TextMap[i] = temp;
+ ++count;
+ } while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u additional CreatureEventAI Texts data.", count);
+ }else
+ {
+ barGoLink bar(1);
+ bar.step();
+ sLog.outString();
+ sLog.outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
+ }
+
+}
+
+// -------------------
+void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
+{
+
+ //Drop Existing EventSummon Map
+ m_CreatureEventAI_Summon_Map.clear();
+
+ //Gather additional data for EventAI
+ QueryResult *result = WorldDatabase.PQuery("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons");
+ if (result)
+ {
+ barGoLink bar(result->GetRowCount());
+ uint32 Count = 0;
+
+ do
+ {
+ bar.step();
+ Field *fields = result->Fetch();
+
+ CreatureEventAI_Summon temp;
+
+ uint32 i = fields[0].GetUInt32();
+ temp.position_x = fields[1].GetFloat();
+ temp.position_y = fields[2].GetFloat();
+ temp.position_z = fields[3].GetFloat();
+ temp.orientation = fields[4].GetFloat();
+ temp.SpawnTimeSecs = fields[5].GetUInt32();
+
+ //Add to map
+ m_CreatureEventAI_Summon_Map[i] = temp;
+ ++Count;
+ }while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u CreatureEventAI summon definitions", Count);
+ }else
+ {
+ barGoLink bar(1);
+ bar.step();
+ sLog.outString();
+ sLog.outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
+ }
+
+}
+
+// -------------------
+void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
+{
+ //Drop Existing EventAI List
+ m_CreatureEventAI_Event_Map.clear();
+
+ //Gather event data
+ QueryResult *result = WorldDatabase.PQuery("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, "
+ "event_param1, event_param2, event_param3, event_param4, "
+ "action1_type, action1_param1, action1_param2, action1_param3, "
+ "action2_type, action2_param1, action2_param2, action2_param3, "
+ "action3_type, action3_param1, action3_param2, action3_param3 "
+ "FROM creature_ai_scripts");
+ if (result)
+ {
+ barGoLink bar(result->GetRowCount());
+ uint32 Count = 0;
+
+ do
+ {
+ bar.step();
+ Field *fields = result->Fetch();
+
+ CreatureEventAI_Event temp;
+ temp.event_id = EventAI_Type(fields[0].GetUInt32());
+ uint32 i = temp.event_id;
+
+ temp.creature_id = fields[1].GetUInt32();
+ uint32 creature_id = temp.creature_id;
+
+ uint32 e_type = fields[2].GetUInt32();
+ //Report any errors in event
+ if (e_type >= EVENT_T_END)
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i,e_type);
+ continue;
+ }
+ temp.event_type = EventAI_Type(e_type);
+
+ temp.event_inverse_phase_mask = fields[3].GetUInt32();
+ temp.event_chance = fields[4].GetUInt8();
+ temp.event_flags = fields[5].GetUInt8();
+ temp.event_param1 = fields[6].GetUInt32();
+ temp.event_param2 = fields[7].GetUInt32();
+ temp.event_param3 = fields[8].GetUInt32();
+ temp.event_param4 = fields[9].GetUInt32();
+
+ //Creature does not exist in database
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.creature_id))
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id);
+ continue;
+ }
+
+ //No chance of this event occuring
+ if (temp.event_chance == 0)
+ sLog.outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
+ //Chance above 100, force it to be 100
+ else if (temp.event_chance > 100)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
+ temp.event_chance = 100;
+ }
+
+ //Individual event checks
+ switch (temp.event_type)
+ {
+ case EVENT_T_TIMER:
+ case EVENT_T_TIMER_OOC:
+ {
+ if (temp.event_param2 < temp.event_param1)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
+
+ if (temp.event_param4 < temp.event_param3)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+
+ break;
+ }
+
+ case EVENT_T_HP:
+ case EVENT_T_MANA:
+ case EVENT_T_TARGET_HP:
+ {
+ if (temp.event_param2 > 100)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
+
+ if (temp.event_param1 <= temp.event_param2)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
+
+ if (temp.event_flags & EFLAG_REPEATABLE && !temp.event_param3 && !temp.event_param4)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
+ temp.event_flags &= ~EFLAG_REPEATABLE;
+ }
+ break;
+ }
+
+ case EVENT_T_SPELLHIT:
+ {
+ if (temp.event_param1)
+ {
+ SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.event_param1);
+ if (!pSpell)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.event_param1, i);
+ continue;
+ }
+
+ if (temp.event_param2_s != -1 && temp.event_param2 != pSpell->SchoolMask)
+ sLog.outErrorDb("CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.event_param1, i);
+ }
+
+ //TODO: fix this system with SPELL_SCHOOL_MASK. Current complicate things, using int32(-1) instead of just 0
+ //SPELL_SCHOOL_MASK_NONE = 0 and does not exist, thus it can not ever trigger or be used in SpellHit()
+ if (temp.event_param2_s != -1 && temp.event_param2_s > SPELL_SCHOOL_MASK_ALL)
+ sLog.outErrorDb("CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.event_param2, i);
+
+ if (temp.event_param4 < temp.event_param3)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ break;
+ }
+
+ case EVENT_T_RANGE:
+ case EVENT_T_OOC_LOS:
+ case EVENT_T_FRIENDLY_HP:
+ case EVENT_T_FRIENDLY_IS_CC:
+ case EVENT_T_FRIENDLY_MISSING_BUFF:
+ {
+ //Disabled check for now. Check code related to events and adjust accordingly before enable.
+ //Events should have min/max or alternative set to a static value.
+ /*if (!temp.event_param3 && !temp.event_param4)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) without param3/param4 (RepeatMin/RepeatMax). Using minimum values.", temp.creature_id, i);
+ temp.event_param3 = 2500;
+ temp.event_param4 = 2500;
+ }*/
+
+ if (temp.event_param4 < temp.event_param3)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ break;
+ }
+
+ case EVENT_T_KILL:
+ case EVENT_T_TARGET_CASTING:
+ {
+ if (temp.event_param2 < temp.event_param1)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+
+ break;
+ }
+
+ case EVENT_T_AGGRO:
+ case EVENT_T_DEATH:
+ case EVENT_T_EVADE:
+ case EVENT_T_SPAWNED:
+ case EVENT_T_REACHED_HOME:
+ {
+ if (temp.event_flags & EFLAG_REPEATABLE)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
+ temp.event_flags &= ~EFLAG_REPEATABLE;
+ }
+
+ break;
+ }
+
+ case EVENT_T_RECEIVE_EMOTE:
+ {
+ if (!sEmotesTextStore.LookupEntry(temp.event_param1))
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.",temp.creature_id, i, temp.event_param1);
+ continue;
+ }
+
+ if (temp.event_param2 == CONDITION_AD_COMMISSION_AURA || temp.event_param2 == CONDITION_NO_AURA)
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not implemented for EventAI.",temp.creature_id, i, temp.event_param2);
+ continue;
+ }
+
+ if (!PlayerCondition::IsValid(ConditionType(temp.event_param2), temp.event_param3, temp.event_param4))
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.event_param2);
+ continue;
+ }
+
+ if (!(temp.event_flags & EFLAG_REPEATABLE))
+ {
+ sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i);
+ temp.event_flags |= EFLAG_REPEATABLE;
+ }
+
+ break;
+ }
+
+ case EVENT_T_SUMMONED_UNIT:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.event_param1))
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.event_param1);
+
+ if (temp.event_param3 < temp.event_param2)
+ sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param3 < param2 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+
+ break;
+ }
+
+ case EVENT_T_QUEST_ACCEPT:
+ case EVENT_T_QUEST_COMPLETE:
+ sLog.outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
+ continue;
+ default:
+ sLog.outErrorDb("CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i);
+ break;
+ }
+
+ for (uint32 j = 0; j < MAX_ACTIONS; j++)
+ {
+ uint16 action_type = fields[10+(j*4)].GetUInt16();
+ if (action_type >= ACTION_T_END)
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
+ temp.action[j].type = ACTION_T_NONE;
+ continue;
+ }
+
+ temp.action[j].type = EventAI_ActionType(action_type);
+ temp.action[j].param1 = fields[11+(j*4)].GetUInt32();
+ temp.action[j].param2 = fields[12+(j*4)].GetUInt32();
+ temp.action[j].param3 = fields[13+(j*4)].GetUInt32();
+
+ //Report any errors in actions
+ switch (temp.action[j].type)
+ {
+ case ACTION_T_NONE:
+ break;
+ case ACTION_T_TEXT:
+ {
+ if (temp.action[j].param1_s < 0)
+ {
+ if (m_CreatureEventAI_TextMap.find(temp.action[j].param1_s) == m_CreatureEventAI_TextMap.end())
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
+ }
+ if (temp.action[j].param2_s < 0)
+ {
+ if (m_CreatureEventAI_TextMap.find(temp.action[j].param2_s) == m_CreatureEventAI_TextMap.end())
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
+
+ if (!temp.action[j].param1_s)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
+ }
+ if (temp.action[j].param3_s < 0)
+ {
+ if (m_CreatureEventAI_TextMap.find(temp.action[j].param3_s) == m_CreatureEventAI_TextMap.end())
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
+
+ if (!temp.action[j].param1_s || !temp.action[j].param2_s)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
+ }
+ break;
+ }
+ case ACTION_T_SET_FACTION:
+ if (temp.action[j].param1 !=0 && !sFactionStore.LookupEntry(temp.action[j].param1))
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant FactionId %u.", i, j+1, temp.action[j].param1);
+ temp.action[j].param1 = 0;
+ }
+ break;
+ case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
+ if (temp.action[j].param1 !=0 || temp.action[j].param2 !=0)
+ {
+ if (temp.action[j].param1 && !sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, temp.action[j].param1);
+ temp.action[j].param1 = 0;
+ }
+
+ if (temp.action[j].param2 && !sCreatureDisplayInfoStore.LookupEntry(temp.action[j].param2))
+ {
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, temp.action[j].param2);
+ temp.action[j].param2 = 0;
+ }
+ }
+ break;
+ case ACTION_T_SOUND:
+ if (!sSoundEntriesStore.LookupEntry(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, temp.action[j].param1);
+ break;
+ case ACTION_T_RANDOM_SOUND:
+ if (!sSoundEntriesStore.LookupEntry(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, temp.action[j].param1);
+ if (temp.action[j].param2_s >= 0 && !sSoundEntriesStore.LookupEntry(temp.action[j].param2))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, temp.action[j].param2);
+ if (temp.action[j].param3_s >= 0 && !sSoundEntriesStore.LookupEntry(temp.action[j].param3))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, temp.action[j].param3);
+ break;
+ case ACTION_T_EMOTE:
+ //TODO: load emotes and check it's store for existing
+ /*
+ if (!sEmotesStore.LookupEntry(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, temp.action[j].param1);
+ */
+ break;
+ case ACTION_T_RANDOM_EMOTE:
+ //TODO: load emotes and check it's store for existing
+ /*
+ if (!sEmotesStore.LookupEntry(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, temp.action[j].param1);
+ if (temp.action[j].param2_s >= 0 && !sEmotesStore.LookupEntry(temp.action[j].param2))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, temp.action[j].param2);
+ if (temp.action[j].param3_s >= 0 && !sEmotesStore.LookupEntry(temp.action[j].param3))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, temp.action[j].param3);
+ */
+ break;
+ case ACTION_T_CAST:
+ {
+ const SpellEntry *spell = sSpellStore.LookupEntry(temp.action[j].param1);
+ if (!spell)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1);
+ else
+ {
+ if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE)
+ {
+ //output as debug for now, also because there's no general rule all spells have RecoveryTime
+ if (temp.event_param3 < spell->RecoveryTime)
+ sLog.outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,temp.action[j].param1, spell->RecoveryTime, temp.event_param3);
+ }
+ }
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_REMOVEAURASFROMSPELL:
+ {
+ if (!sSpellStore.LookupEntry(temp.action[j].param2))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
+
+ if (temp.action[j].param1 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_QUEST_EVENT:
+ {
+ if (Quest const* qid = objmgr.GetQuestTemplate(temp.action[j].param1))
+ {
+ if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
+ }
+ else
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+
+ break;
+ }
+ case ACTION_T_QUEST_EVENT_ALL:
+ {
+ if (Quest const* qid = objmgr.GetQuestTemplate(temp.action[j].param1))
+ {
+ if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
+ }
+ else
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
+ break;
+ }
+ case ACTION_T_CASTCREATUREGO:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
+
+ if (!sSpellStore.LookupEntry(temp.action[j].param2))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
+
+ if (temp.action[j].param3 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_CASTCREATUREGO_ALL:
+ {
+ if (!objmgr.GetQuestTemplate(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
+
+ if (!sSpellStore.LookupEntry(temp.action[j].param2))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
+ break;
+ }
+
+ //2nd param target
+ case ACTION_T_SUMMON_ID:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
+
+ if (m_CreatureEventAI_Summon_Map.find(temp.action[j].param3) == m_CreatureEventAI_Summon_Map.end())
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, temp.action[j].param3);
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_KILLED_MONSTER:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_SUMMON:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ }
+ case ACTION_T_THREAT_SINGLE_PCT:
+ case ACTION_T_SET_UNIT_FLAG:
+ case ACTION_T_REMOVE_UNIT_FLAG:
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+ //3rd param target
+ case ACTION_T_SET_UNIT_FIELD:
+ if (temp.action[j].param1 < OBJECT_END || temp.action[j].param1 >= UNIT_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
+ if (temp.action[j].param3 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ break;
+
+ case ACTION_T_SET_PHASE:
+ if (temp.action[j].param1 > 31)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase > 31. Phase mask cannot be used past phase 31.", i, j+1);
+ break;
+
+ case ACTION_T_INC_PHASE:
+ if (!temp.action[j].param1)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
+ break;
+
+ case ACTION_T_SET_INST_DATA:
+ {
+ if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
+
+ if (temp.action[j].param2 > 4/*SPECIAL*/)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
+
+ break;
+ }
+ case ACTION_T_SET_INST_DATA64:
+ {
+ if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
+
+ if (temp.action[j].param2 >= TARGET_T_END)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+
+ break;
+ }
+ case ACTION_T_UPDATE_TEMPLATE:
+ {
+ if (!sCreatureStorage.LookupEntry<CreatureInfo>(temp.action[j].param1))
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
+ break;
+ }
+
+ case ACTION_T_THREAT_ALL_PCT:
+ if (abs(temp.action[j].param1_s) > 100)
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, temp.action[j].param1);
+ break;
+
+ case ACTION_T_EVADE: //No Params
+ case ACTION_T_FLEE: //No Params
+ case ACTION_T_DIE: //No Params
+ case ACTION_T_ZONE_COMBAT_PULSE: //No Params
+ case ACTION_T_AUTO_ATTACK: //AllowAttackState (0 = stop attack, anything else means continue attacking)
+ case ACTION_T_COMBAT_MOVEMENT: //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
+ case ACTION_T_RANGED_MOVEMENT: //Distance, Angle
+ break;
+
+ case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3
+ case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax
+ // check not implemented
+ break;
+
+ case ACTION_T_RANDOM_SAY:
+ case ACTION_T_RANDOM_YELL:
+ case ACTION_T_RANDOM_TEXTEMOTE:
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
+ break;
+ default:
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, temp.action[j].type);
+ break;
+ }
+ }
+
+ //Add to list
+ m_CreatureEventAI_Event_Map[creature_id].push_back(temp);
+ ++Count;
+
+ if(!cInfo->AIName || !cInfo->AIName[0])
+ {
+ //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but its AIName is empty. Set to EventAI as default.", cInfo->Entry);
+ size_t len = strlen("EventAI")+1;
+ const_cast<CreatureInfo*>(cInfo)->AIName = new char[len];
+ strncpy(const_cast<char*>(cInfo->AIName), "EventAI", len);
+ }
+ if(strcmp(cInfo->AIName, "EventAI"))
+ {
+ //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it has AIName %s. EventAI script will be overriden.", cInfo->Entry, cInfo->AIName);
+ }
+ if(cInfo->ScriptID)
+ {
+ //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it also has C++ script. EventAI script will be overriden.", cInfo->Entry);
+ }
+ } while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u CreatureEventAI scripts", Count);
+ }else
+ {
+ barGoLink bar(1);
+ bar.step();
+ sLog.outString();
+ sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
+ }
+}
diff --git a/src/game/CreatureEventAIMgr.h b/src/game/CreatureEventAIMgr.h
new file mode 100644
index 00000000000..ea5989a74ed
--- /dev/null
+++ b/src/game/CreatureEventAIMgr.h
@@ -0,0 +1,46 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_CREATURE_EAI_MGR_H
+#define MANGOS_CREATURE_EAI_MGR_H
+
+#include "Common.h"
+#include "CreatureEventAI.h"
+
+class CreatureEventAIMgr
+{
+ public:
+ CreatureEventAIMgr(){};
+ ~CreatureEventAIMgr(){};
+
+ void LoadCreatureEventAI_Texts();
+ void LoadCreatureEventAI_Summons();
+ void LoadCreatureEventAI_Scripts();
+
+ CreatureEventAI_Event_Map& GetCreatureEventAIMap() { return m_CreatureEventAI_Event_Map; }
+ CreatureEventAI_Summon_Map& GetCreatureEventAISummonMap() { return m_CreatureEventAI_Summon_Map; }
+ CreatureEventAI_TextMap& GetCreatureEventAITextMap() { return m_CreatureEventAI_TextMap; }
+
+ private:
+ CreatureEventAI_Event_Map m_CreatureEventAI_Event_Map;
+ CreatureEventAI_Summon_Map m_CreatureEventAI_Summon_Map;
+ CreatureEventAI_TextMap m_CreatureEventAI_TextMap;
+};
+
+#define CreatureEAI_Mgr MaNGOS::Singleton<CreatureEventAIMgr>::Instance()
+#endif
diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h
new file mode 100644
index 00000000000..078804c19f4
--- /dev/null
+++ b/src/game/DBCEnums.h
@@ -0,0 +1,331 @@
+/*
+* 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, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef DBCENUMS_H
+#define DBCENUMS_H
+
+// client supported max level for player/pets/etc. Avoid overflow or client stability affected.
+// also see GT_MAX_LEVEL define
+#define MAX_LEVEL 100
+
+// Server side limitation. Base at used code requirements.
+// also see MAX_LEVEL and GT_MAX_LEVEL define
+#define STRONG_MAX_LEVEL 255
+
+enum AreaTeams
+{
+ AREATEAM_NONE = 0,
+ AREATEAM_ALLY = 2,
+ AREATEAM_HORDE = 4
+};
+
+enum AchievementFactionFlags
+{
+ ACHIEVEMENT_FACTION_FLAG_HORDE = 0x00000000,
+ ACHIEVEMENT_FACTION_FLAG_ALLIANCE = 0x00000001,
+};
+
+enum AchievementFlags
+{
+ ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete)
+ ACHIEVEMENT_FLAG_UNK2 = 0x00000002, // not used
+ ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx"
+ ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value)
+ ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??)
+ ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value)
+ ACHIEVEMENT_FLAG_AVERANGE = 0x00000040, // Show as averange value (value / time_in_days) depend from other flag (by def use last criteria value)
+ ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value)
+ ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, //
+ ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, //
+};
+
+enum AchievementCriteriaCondition
+{
+ ACHIEVEMENT_CRITERIA_CONDITION_NONE = 0,
+ ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH = 1,
+ ACHIEVEMENT_CRITERIA_CONDITION_UNK1 = 2, // only used in "Complete a daily quest every day for five consecutive days"
+ ACHIEVEMENT_CRITERIA_CONDITION_MAP = 3, // requires you to be on specific map
+ ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE = 4, // only used in "Win 10 arenas without losing"
+ ACHIEVEMENT_CRITERIA_CONDITION_UNK2 = 9, // unk
+ ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk
+};
+
+enum AchievementCriteriaCompletionFlags
+{
+ ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR = 0x00000001, // Show progress as bar
+ ACHIEVEMENT_CRITERIA_FLAG_HIDE_CRITERIA = 0x00000002, // Not show criteria in client
+ ACHIEVEMENT_CRITERIA_FLAG_UNK3 = 0x00000004, // BG related??
+ ACHIEVEMENT_CRITERIA_FLAG_UNK4 = 0x00000008, //
+ ACHIEVEMENT_CRITERIA_FLAG_UNK5 = 0x00000010, // not used
+ ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER = 0x00000020, // Displays counter as money
+};
+
+enum AchievementCriteriaGroupFlags
+{
+ // you mustn't be in a group while fulfilling this achievement
+ ACHIEVEMENT_CRITERIA_GROUP_NOT_IN_GROUP = 2,
+};
+
+enum AchievementCriteriaTypes
+{
+ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1,
+ ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5,
+ ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9,
+ // you have to complete a daily quest x times in a row
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11,
+ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP= 16,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH= 17,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19,
+ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20,
+ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER = 23,
+ ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24,
+ ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26,
+ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27,
+ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28,
+ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL= 29,
+ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30,
+ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32,
+ ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34,
+ // TODO: this criteria has additional conditions which can not be found in the dbcs
+ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35,
+ ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36,
+ // TODO: the archievements 1162 and 1163 requires a special rating which can't be found in the dbc
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38,
+ ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40,
+ ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM= 42,
+ ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43,
+ ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK= 44,
+ ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT= 45,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION= 46,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47,
+ // noted: rewarded as soon as the player payed, not at taking place at the seat
+ ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP= 48,
+ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49,
+ // TODO: itemlevel is mentioned in text but not present in dbc
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT= 51,
+ ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52,
+ ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53,
+ ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54,
+ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55,
+ // TODO: in some cases map not present, and in some cases need do without die
+ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56,
+ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57,
+ ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60,
+ ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS = 61,
+ ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD = 62,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING = 63,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER = 65,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67,
+ ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68,
+ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2= 69,
+ ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL= 70,
+ ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72,
+ // TODO: title id is not mentioned in dbc
+ ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS= 75,
+ ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76,
+ ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77,
+ // TODO: creature type (demon, undead etc.) is not stored in dbc
+ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78,
+ ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS= 80,
+ ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION= 82,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID= 83,
+ ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS= 84,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87,
+ ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION = 88,
+ ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS = 89,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM = 90,
+ ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93,
+ ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH = 95,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR = 99,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102,
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104,
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105,
+ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106,
+ ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107,
+ ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108,
+ ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109,
+ // TODO: target entry is missing
+ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110,
+ ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112,
+ ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113,
+ ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114,
+ // 0..114 => 115 criteria types total
+ ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 115,
+};
+
+enum AreaFlags
+{
+ AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring)
+ AREA_FLAG_UNK1 = 0x00000002, // may be necropolis?
+ AREA_FLAG_UNK2 = 0x00000004, // Only used for areas on map 571 (development before)
+ AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones
+ AREA_FLAG_UNK3 = 0x00000010, // can't find common meaning
+ AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag?
+ AREA_FLAG_UNK4 = 0x00000040, // many zones have this flag
+ AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas
+ AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag
+ AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?)
+ AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag)
+ AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled)
+ AREA_FLAG_NEED_FLY = 0x00001000, // only Netherwing Ledge, Socrethar's Seat, Tempest Keep, The Arcatraz, The Botanica, The Mechanar, Sorrow Wing Point, Dragonspine Ridge, Netherwing Mines, Dragonmaw Base Camp, Dragonmaw Skyway
+ AREA_FLAG_UNUSED1 = 0x00002000, // not used now (no area/zones with this flag set in 3.0.3)
+ AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag)
+ AREA_FLAG_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area)
+ AREA_FLAG_ARENA_INSTANCE = 0x00010000, // used by instanced arenas only
+ AREA_FLAG_UNUSED2 = 0x00020000, // not used now (no area/zones with this flag set in 3.0.3)
+ AREA_FLAG_UNK5 = 0x00040000, // only used for Amani Pass, Hatchet Hills
+ AREA_FLAG_UNK6 = 0x00080000, // Valgarde and Acherus: The Ebon Hold
+ AREA_FLAG_LOWLEVEL = 0x00100000, // used for some starting areas with area_level <=15
+ AREA_FLAG_TOWN = 0x00200000, // small towns with Inn
+ AREA_FLAG_UNK7 = 0x00400000, // Warsong Hold, Acherus: The Ebon Hold, New Agamand Inn, Vengeance Landing Inn
+ AREA_FLAG_UNK8 = 0x00800000, // Westguard Inn, Acherus: The Ebon Hold, Valgarde
+ AREA_FLAG_OUTDOOR_PVP = 0x01000000, // Wintergrasp and it's subzones
+ AREA_FLAG_UNK9 = 0x02000000, // unknown
+ AREA_FLAG_UNK10 = 0x04000000, // unknown
+ AREA_FLAG_OUTDOOR_PVP2 = 0x08000000 // Wintergrasp and it's subzones
+};
+
+enum FactionTemplateFlags
+{
+ FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
+};
+
+enum FactionMasks
+{
+ FACTION_MASK_PLAYER = 1, // any player
+ FACTION_MASK_ALLIANCE = 2, // player or creature from alliance team
+ FACTION_MASK_HORDE = 4, // player or creature from horde team
+ FACTION_MASK_MONSTER = 8 // aggressive creature from monster team
+ // if none flags set then non-aggressive creature
+};
+
+enum MapTypes
+{
+ MAP_COMMON = 0,
+ MAP_INSTANCE = 1,
+ MAP_RAID = 2,
+ MAP_BATTLEGROUND = 3,
+ MAP_ARENA = 4
+};
+
+enum AbilytyLearnType
+{
+ ABILITY_LEARNED_ON_GET_PROFESSION_SKILL = 1,
+ ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL = 2
+};
+
+enum ItemEnchantmentType
+{
+ ITEM_ENCHANTMENT_TYPE_NONE = 0,
+ ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL = 1,
+ ITEM_ENCHANTMENT_TYPE_DAMAGE = 2,
+ ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL = 3,
+ ITEM_ENCHANTMENT_TYPE_RESISTANCE = 4,
+ ITEM_ENCHANTMENT_TYPE_STAT = 5,
+ ITEM_ENCHANTMENT_TYPE_TOTEM = 6,
+ ITEM_ENCHANTMENT_TYPE_USE_SPELL = 7,
+ ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET = 8
+};
+
+enum TotemCategoryType
+{
+ TOTEM_CATEGORY_TYPE_KNIFE = 1,
+ TOTEM_CATEGORY_TYPE_TOTEM = 2,
+ TOTEM_CATEGORY_TYPE_ROD = 3,
+ TOTEM_CATEGORY_TYPE_PICK = 21,
+ TOTEM_CATEGORY_TYPE_STONE = 22,
+ TOTEM_CATEGORY_TYPE_HAMMER = 23,
+ TOTEM_CATEGORY_TYPE_SPANNER = 24
+};
+
+// SummonProperties.dbc, col 1
+/*enum SummonGroup
+{
+ SUMMON_GROUP_UNKNOWN1 = 0, // 1160 spells in 3.0.3
+ SUMMON_GROUP_UNKNOWN2 = 1, // 861 spells in 3.0.3
+ SUMMON_GROUP_PETS = 2, // 52 spells in 3.0.3, pets mostly
+ SUMMON_GROUP_CONTROLLABLE = 3, // 13 spells in 3.0.3, mostly controllable
+ SUMMON_GROUP_UNKNOWN3 = 4 // 86 spells in 3.0.3, taxi/mounts
+};
+
+// SummonProperties.dbc, col 3
+enum SummonType
+{
+ SUMMON_TYPE_UNKNOWN = 0, // different summons, 1330 spells in 3.0.3
+ SUMMON_TYPE_SUMMON = 1, // generic summons, 49 spells in 3.0.3
+ SUMMON_TYPE_GUARDIAN = 2, // summon guardian, 393 spells in 3.0.3
+ SUMMON_TYPE_ARMY = 3, // summon army, 5 spells in 3.0.3
+ SUMMON_TYPE_TOTEM = 4, // summon totem, 169 spells in 3.0.3
+ SUMMON_TYPE_CRITTER = 5, // critter/minipet, 195 spells in 3.0.3
+ SUMMON_TYPE_DK = 6, // summon DRW/Ghoul, 2 spells in 3.0.3
+ SUMMON_TYPE_BOMB = 7, // summon bot/bomb, 4 spells in 3.0.3
+ SUMMON_TYPE_PHASING = 8, // something todo with DK prequest line, 2 spells in 3.0.3
+ SUMMON_TYPE_SIEGE_VEH = 9, // summon different vehicles, 14 spells in 3.0.3
+ SUMMON_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells
+ SUMMON_TYPE_LIGHTWELL = 11 // summon lightwell, 6 spells in 3.0.3
+};
+
+// SummonProperties.dbc, col 5
+enum SummonFlags
+{
+ SUMMON_FLAG_NONE = 0x0000, // 1342 spells in 3.0.3
+ SUMMON_FLAG_UNK1 = 0x0001, // 75 spells in 3.0.3, something unfriendly
+ SUMMON_FLAG_UNK2 = 0x0002, // 616 spells in 3.0.3, something friendly
+ SUMMON_FLAG_UNK3 = 0x0004, // 22 spells in 3.0.3, no idea...
+ SUMMON_FLAG_UNK4 = 0x0008, // 49 spells in 3.0.3, some mounts
+ SUMMON_FLAG_UNK5 = 0x0010, // 25 spells in 3.0.3, quest related?
+ SUMMON_FLAG_UNK6 = 0x0020, // 0 spells in 3.0.3, unused
+ SUMMON_FLAG_UNK7 = 0x0040, // 12 spells in 3.0.3, no idea
+ SUMMON_FLAG_UNK8 = 0x0080, // 4 spells in 3.0.3, no idea
+ SUMMON_FLAG_UNK9 = 0x0100, // 51 spells in 3.0.3, no idea, many quest related
+ SUMMON_FLAG_UNK10 = 0x0200, // 51 spells in 3.0.3, something defensive
+ SUMMON_FLAG_UNK11 = 0x0400, // 3 spells, requires something near?
+ SUMMON_FLAG_UNK12 = 0x0800, // 30 spells in 3.0.3, no idea
+ SUMMON_FLAG_UNK13 = 0x1000, // 8 spells in 3.0.3, siege vehicle
+ SUMMON_FLAG_UNK14 = 0x2000, // 2 spells in 3.0.3, escort?
+};
+*/
+#endif
+
diff --git a/src/shared/Database/DBCStores.cpp b/src/game/DBCStores.cpp
index 2031457ceaf..4d1ba2a5cff 100644
--- a/src/shared/Database/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,12 +19,12 @@
*/
#include "DBCStores.h"
-//#include "DataStore.h"
#include "Policies/SingletonImp.h"
#include "Log.h"
#include "ProgressBar.h"
+#include "SharedDefines.h"
-#include "DBCfmt.cpp"
+#include "DBCfmt.h"
#include <map>
@@ -32,21 +32,28 @@ typedef std::map<uint16,uint32> AreaFlagByAreaID;
typedef std::map<uint32,uint32> AreaFlagByMapID;
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
+DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
static AreaFlagByAreaID sAreaFlagByAreaID;
static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files
+DBCStorage <AchievementEntry> sAchievementStore(Achievementfmt);
+DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore(AchievementCriteriafmt);
DBCStorage <AreaTriggerEntry> sAreaTriggerStore(AreaTriggerEntryfmt);
DBCStorage <AuctionHouseEntry> sAuctionHouseStore(AuctionHouseEntryfmt);
DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt);
DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryfmt);
+DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
DBCStorage <ChrRacesEntry> sChrRacesStore(ChrRacesEntryfmt);
+DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore(CinematicSequencesEntryfmt);
DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore(CreatureDisplayInfofmt);
DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore(CreatureFamilyfmt);
DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore(CreatureSpellDatafmt);
+DBCStorage <CreatureTypeEntry> sCreatureTypeStore(CreatureTypefmt);
+DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore(CurrencyTypesfmt);
DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore(DurabilityQualityfmt);
DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt);
@@ -59,7 +66,10 @@ DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt);
DBCStorage <FactionTemplateEntry> sFactionTemplateStore(FactionTemplateEntryfmt);
DBCStorage <GemPropertiesEntry> sGemPropertiesStore(GemPropertiesEntryfmt);
+DBCStorage <GlyphPropertiesEntry> sGlyphPropertiesStore(GlyphPropertiesfmt);
+DBCStorage <GlyphSlotEntry> sGlyphSlotStore(GlyphSlotfmt);
+DBCStorage <GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore(GtBarberShopCostBasefmt);
DBCStorage <GtCombatRatingsEntry> sGtCombatRatingsStore(GtCombatRatingsfmt);
DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt);
DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt);
@@ -69,10 +79,15 @@ DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore(GtOCTRegenHPfmt);
//DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently
DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore(GtRegenHPPerSptfmt);
DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
+
+DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
+
DBCStorage <ItemEntry> sItemStore(Itemfmt);
+DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
+DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
@@ -81,10 +96,13 @@ DBCStorage <LockEntry> sLockStore(LockEntryfmt);
DBCStorage <MailTemplateEntry> sMailTemplateStore(MailTemplateEntryfmt);
DBCStorage <MapEntry> sMapStore(MapEntryfmt);
+DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore(RandomPropertiesPointsfmt);
+DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore(ScalingStatDistributionfmt);
+DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore(ScalingStatValuesfmt);
DBCStorage <SkillLineEntry> sSkillLineStore(SkillLinefmt);
DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore(SkillLineAbilityfmt);
@@ -102,8 +120,10 @@ DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
+DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftfmt);
DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
+DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
TalentSpellPosMap sTalentSpellPosMap;
DBCStorage <TalentTabEntry> sTalentTabStore(TalentTabEntryfmt);
@@ -116,6 +136,7 @@ static uint32 sTalentTabPages[12/*MAX_CLASSES*/][3];
DBCStorage <TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt);
TaxiMask sTaxiNodesMask;
+TaxiMask sOldContinentsNodesMask;
// DBC used only for initialization sTaxiPathSetBySource at startup.
TaxiPathSetBySource sTaxiPathSetBySource;
@@ -126,8 +147,11 @@ TaxiPathNodesByPath sTaxiPathNodesByPath;
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
+DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
+DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
+DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
typedef std::list<std::string> StoreProblemList;
@@ -143,7 +167,7 @@ template<class T>
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
{
// compatibility format and C++ structure sizes
- assert(DBCFile::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFile::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
+ assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
std::string dbc_filename = dbc_path + filename;
if(storage.Load(dbc_filename.c_str()))
@@ -179,7 +203,7 @@ void LoadDBCStores(const std::string& dataPath)
{
std::string dbcPath = dataPath+"dbc/";
- const uint32 DBCFilesCount = 57;
+ const uint32 DBCFilesCount = 77;
barGoLink bar( DBCFilesCount );
@@ -197,24 +221,31 @@ void LoadDBCStores(const std::string& dataPath)
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag));
// fill MapId->DBC records ( skip sub zones and continents )
- if(area->zone==0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 )
+ if(area->zone==0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571 )
sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid,area->exploreFlag));
}
}
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementStore, dbcPath,"Achievement.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementCriteriaStore, dbcPath,"Achievement_Criteria.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaTriggerStore, dbcPath,"AreaTrigger.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaGroupStore, dbcPath,"AreaGroup.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAuctionHouseStore, dbcPath,"AuctionHouse.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBankBagSlotPricesStore, dbcPath,"BankBagSlotPrices.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBattlemasterListStore, dbcPath,"BattlemasterList.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBarberShopStyleStore, dbcPath,"BarberShopStyle.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCharStartOutfitStore, dbcPath,"CharStartOutfit.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCharTitlesStore, dbcPath,"CharTitles.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChatChannelsStore, dbcPath,"ChatChannels.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrClassesStore, dbcPath,"ChrClasses.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrRacesStore, dbcPath,"ChrRaces.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCinematicSequencesStore, dbcPath,"CinematicSequences.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoStore, dbcPath,"CreatureDisplayInfo.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureFamilyStore, dbcPath,"CreatureFamily.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureSpellDataStore, dbcPath,"CreatureSpellData.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureTypeStore, dbcPath,"CreatureType.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCurrencyTypesStore, dbcPath,"CurrencyTypes.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sDurabilityCostsStore, dbcPath,"DurabilityCosts.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sDurabilityQualityStore, dbcPath,"DurabilityQuality.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sEmotesTextStore, dbcPath,"EmotesText.dbc");
@@ -231,7 +262,10 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionTemplateStore, dbcPath,"FactionTemplate.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGemPropertiesStore, dbcPath,"GemProperties.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphPropertiesStore, dbcPath,"GlyphProperties.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphSlotStore, dbcPath,"GlyphSlot.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtBarberShopCostBaseStore,dbcPath,"gtBarberShopCostBase.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtCombatRatingsStore, dbcPath,"gtCombatRatings.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToMeleeCritBaseStore, dbcPath,"gtChanceToMeleeCritBase.dbc");
@@ -244,18 +278,24 @@ void LoadDBCStores(const std::string& dataPath)
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenHPPerSptStore, dbcPath,"gtRegenHPPerSpt.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sHolidaysStore, dbcPath,"Holidays.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemStore, dbcPath,"Item.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemBagFamilyStore, dbcPath,"ItemBagFamily.dbc");
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemExtendedCostStore, dbcPath,"ItemExtendedCost.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemLimitCategoryStore, dbcPath,"ItemLimitCategory.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemRandomPropertiesStore,dbcPath,"ItemRandomProperties.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemRandomSuffixStore, dbcPath,"ItemRandomSuffix.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemSetStore, dbcPath,"ItemSet.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sLockStore, dbcPath,"Lock.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMailTemplateStore, dbcPath,"MailTemplate.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMapStore, dbcPath,"Map.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatValuesStore, dbcPath,"ScalingStatValues.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineStore, dbcPath,"SkillLine.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineAbilityStore, dbcPath,"SkillLineAbility.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSoundEntriesStore, dbcPath,"SoundEntries.dbc");
@@ -266,11 +306,11 @@ void LoadDBCStores(const std::string& dataPath)
if(spell && spell->Category)
sSpellCategoryStore[spell->Category].insert(i);
- // DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
+ /*// DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
// uint32 field already converted to bigendian if need, but must be swapped for correct uint64 bigendian view
#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
std::swap(*((uint32*)(&spell->SpellFamilyFlags)),*(((uint32*)(&spell->SpellFamilyFlags))+1));
- #endif
+ #endif*/
}
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
@@ -305,8 +345,10 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellItemEnchantmentConditionStore,dbcPath,"SpellItemEnchantmentCondition.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRadiusStore, dbcPath,"SpellRadius.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRangeStore, dbcPath,"SpellRange.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRuneCostStore, dbcPath,"SpellRuneCost.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellShapeshiftStore, dbcPath,"SpellShapeshiftForm.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sStableSlotPricesStore, dbcPath,"StableSlotPrices.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSummonPropertiesStore, dbcPath,"SummonProperties.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentStore, dbcPath,"Talent.dbc");
// create talent spells set
@@ -314,7 +356,7 @@ void LoadDBCStores(const std::string& dataPath)
{
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo) continue;
- for (int j = 0; j < 5; j++)
+ for (int j = 0; j < MAX_TALENT_RANK; j++)
if(talentInfo->RankID[j])
sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i,j);
}
@@ -338,7 +380,7 @@ void LoadDBCStores(const std::string& dataPath)
// find talent rank
uint32 curtalent_maxrank = 0;
- for(uint32 k = 5; k > 0; --k)
+ for(uint32 k = MAX_TALENT_RANK; k > 0; --k)
{
if(talentInfo->RankID[k-1])
{
@@ -358,9 +400,13 @@ void LoadDBCStores(const std::string& dataPath)
if(!talentTabInfo)
continue;
+ // prevent memory corruption; otherwise cls will become 12 below
+ if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE)==0)
+ continue;
+
// store class talent tab pages
uint32 cls = 1;
- for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < 12 /*MAX_CLASSES*/;m <<=1, ++cls) {}
+ for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {}
sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
@@ -384,18 +430,6 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiNodesStore, dbcPath,"TaxiNodes.dbc");
- // Initialize global taxinodes mask
- memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
- for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
- {
- if(sTaxiNodesStore.LookupEntry(i))
- {
- uint8 field = (uint8)((i - 1) / 32);
- uint32 submask = 1<<((i-1)%32);
- sTaxiNodesMask[field] |= submask;
- }
- }
-
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathStore, dbcPath,"TaxiPath.dbc");
for(uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
if(TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
@@ -409,7 +443,10 @@ void LoadDBCStores(const std::string& dataPath)
pathLength.resize(pathCount); // 0 and some other indexes not used
for(uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
if(TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
- ++pathLength[entry->path];
+ {
+ if (pathLength[entry->path] < entry->index + 1)
+ pathLength[entry->path] = entry->index + 1;
+ }
// Set path length
sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
for(uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
@@ -420,9 +457,59 @@ void LoadDBCStores(const std::string& dataPath)
sTaxiPathNodesByPath[entry->path][entry->index] = TaxiPathNode(entry->mapid,entry->x,entry->y,entry->z,entry->actionFlag,entry->delay);
sTaxiPathNodeStore.Clear();
+ // Initialize global taxinodes mask
+ // include existed nodes that have at least single not spell base (scripted) path
+ {
+ std::set<uint32> spellPaths;
+ for(uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
+ if(SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
+ for(int j=0; j < 3; ++j)
+ if(sInfo->Effect[j]==123 /*SPELL_EFFECT_SEND_TAXI*/)
+ spellPaths.insert(sInfo->EffectMiscValue[j]);
+
+ memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
+ memset(sOldContinentsNodesMask,0,sizeof(sTaxiNodesMask));
+ for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
+ {
+ TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
+ if(!node)
+ continue;
+
+ TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i);
+ if(src_i!=sTaxiPathSetBySource.end() && !src_i->second.empty())
+ {
+ bool ok = false;
+ for(TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin();dest_i != src_i->second.end(); ++dest_i)
+ {
+ // not spell path
+ if(spellPaths.find(dest_i->second.ID)==spellPaths.end())
+ {
+ ok = true;
+ break;
+ }
+ }
+
+ if(!ok)
+ continue;
+ }
+
+ // valid taxi network node
+ uint8 field = (uint8)((i - 1) / 32);
+ uint32 submask = 1<<((i-1)%32);
+ sTaxiNodesMask[field] |= submask;
+
+ // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
+ if (node->map_id < 2 || i == 82 || i == 83 || i == 93 || i == 94)
+ sOldContinentsNodesMask[field] |= submask;
+ }
+ }
+
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapAreaStore, dbcPath,"WorldMapArea.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapOverlayStore, dbcPath,"WorldMapOverlay.dbc");
// error checks
if(bad_dbc_files.size() >= DBCFilesCount )
@@ -436,32 +523,25 @@ void LoadDBCStores(const std::string& dataPath)
for(std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
str += *i + "\n";
- sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",bad_dbc_files.size(),DBCFilesCount,str.c_str());
+ sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str());
exit(1);
}
- // check at up-to-date DBC files (53085 is last added spell in 2.4.3)
- // check at up-to-date DBC files (17514 is last ID in SkillLineAbilities in 2.4.3)
- // check at up-to-date DBC files (598 is last map added in 2.4.3)
- // check at up-to-date DBC files (1127 is last gem property added in 2.4.3)
- // check at up-to-date DBC files (2425 is last item extended cost added in 2.4.3)
- // check at up-to-date DBC files (71 is last char title added in 2.4.3)
- // check at up-to-date DBC files (1768 is last area added in 2.4.3)
- if( !sSpellStore.LookupEntry(53085) ||
- !sSkillLineAbilityStore.LookupEntry(17514) ||
- !sMapStore.LookupEntry(598) ||
- !sGemPropertiesStore.LookupEntry(1127) ||
- !sItemExtendedCostStore.LookupEntry(2425) ||
- !sCharTitlesStore.LookupEntry(71) ||
- !sAreaStore.LookupEntry(1768) )
+ // Check loaded DBC files proper version
+ if( !sSpellStore.LookupEntry(62735) || // last added spell in 3.0.9
+ !sMapStore.LookupEntry(624) || // last map added in 3.0.8a/3.0.9
+ !sGemPropertiesStore.LookupEntry(1557) || // last gem property added in 3.0.8a/3.0.9
+ !sItemExtendedCostStore.LookupEntry(2589) || // last item extended cost added in 3.0.8a/3.0.9
+ !sCharTitlesStore.LookupEntry(144) || // last char title added in 3.0.8a/3.0.9
+ !sAreaStore.LookupEntry(2769) || // last area (areaflag) added in 3.0.8a/3.0.9
+ !sItemStore.LookupEntry(45037) ) // last client known item added in 3.0.9
{
sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client.");
exit(1);
}
sLog.outString();
- sLog.outString( ">> Loaded %d data stores", DBCFilesCount );
- sLog.outString();
+ sLog.outString( ">> Initialized %d data stores", DBCFilesCount );
}
SimpleFactionsList const* GetFactionTeamList(uint32 faction)
@@ -539,7 +619,7 @@ uint32 GetAreaFlagByMapId(uint32 mapid)
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
{
- if(mapid != 530) // speed for most cases
+ if(mapid != 530 && mapid != 571) // speed for most cases
return mapid;
if(WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
@@ -651,4 +731,6 @@ uint32 const* GetTalentTabPages(uint32 cls)
TRINITY_DLL_SPEC DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore() { return &sSoundEntriesStore; }
TRINITY_DLL_SPEC DBCStorage <SpellEntry> const* GetSpellStore() { return &sSpellStore; }
TRINITY_DLL_SPEC DBCStorage <SpellRangeEntry> const* GetSpellRangeStore() { return &sSpellRangeStore; }
-
+TRINITY_DLL_SPEC DBCStorage <FactionEntry> const* GetFactionStore() { return &sFactionStore; }
+TRINITY_DLL_SPEC DBCStorage <ItemEntry> const* GetItemDisplayStore() { return &sItemStore; }
+TRINITY_DLL_SPEC DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; }
diff --git a/src/shared/Database/DBCStores.h b/src/game/DBCStores.h
index 4ad275653e7..c7c7b54608e 100644
--- a/src/shared/Database/DBCStores.h
+++ b/src/game/DBCStores.h
@@ -1,7 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
- *
- * Copyright (C) 2008 Trinity <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
@@ -18,12 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef DBCSTORES_H
-#define DBCSTORES_H
+#ifndef MANGOS_DBCSTORES_H
+#define MANGOS_DBCSTORES_H
#include "Common.h"
-//#include "DataStore.h"
-#include "dbcfile.h"
+#include "Database/DBCStore.h"
#include "DBCStructure.h"
#include <list>
@@ -61,97 +58,36 @@ uint32 GetTalentInspectBitPosInTab(uint32 talentId);
uint32 GetTalentTabInspectBitSize(uint32 talentTabId);
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
-template<class T>
-class DBCStorage
-{
- typedef std::list<char*> StringPoolList;
- public:
- explicit DBCStorage(const char *f) : nCount(0), fieldCount(0), fmt(f), indexTable(NULL), m_dataTable(NULL) { }
- ~DBCStorage() { Clear(); }
-
- T const* LookupEntry(uint32 id) const { return (id>=nCount)?NULL:indexTable[id]; }
- uint32 GetNumRows() const { return nCount; }
- char const* GetFormat() const { return fmt; }
- uint32 GetFieldCount() const { return fieldCount; }
-
- bool Load(char const* fn)
- {
- DBCFile dbc;
- // Check if load was sucessful, only then continue
- if(!dbc.Load(fn, fmt))
- return false;
-
- fieldCount = dbc.GetCols();
- m_dataTable = (T*)dbc.AutoProduceData(fmt,nCount,(char**&)indexTable);
- m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
-
- // error in dbc file at loading if NULL
- return indexTable!=NULL;
- }
-
- bool LoadStringsFrom(char const* fn)
- {
- // DBC must be already loaded using Load
- if(!indexTable)
- return false;
-
- DBCFile dbc;
- // Check if load was successful, only then continue
- if(!dbc.Load(fn, fmt))
- return false;
-
- m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
-
- return true;
- }
-
- void Clear()
- {
- if (!indexTable)
- return;
-
- delete[] ((char*)indexTable);
- indexTable = NULL;
- delete[] ((char*)m_dataTable);
- m_dataTable = NULL;
-
- while(!m_stringPoolList.empty())
- {
- delete[] m_stringPoolList.front();
- m_stringPoolList.pop_front();
- }
- nCount = 0;
- }
-
- private:
- uint32 nCount;
- uint32 fieldCount;
- char const* fmt;
- T** indexTable;
- T* m_dataTable;
- StringPoolList m_stringPoolList;
-};
-
+extern DBCStorage <AchievementEntry> sAchievementStore;
+extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
+extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
+extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
//extern DBCStorage <ChatChannelsEntry> sChatChannelsStore; -- accessed using function, no usable index
extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
extern DBCStorage <ChrClassesEntry> sChrClassesStore;
extern DBCStorage <ChrRacesEntry> sChrRacesStore;
+extern DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore;
extern DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
extern DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore;
extern DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore;
+extern DBCStorage <CreatureTypeEntry> sCreatureTypeStore;
+extern DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore;
extern DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore;
extern DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore;
extern DBCStorage <EmotesTextEntry> sEmotesTextStore;
extern DBCStorage <FactionEntry> sFactionStore;
extern DBCStorage <FactionTemplateEntry> sFactionTemplateStore;
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;
@@ -161,17 +97,23 @@ 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 <LockEntry> sLockStore;
extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
extern DBCStorage <MapEntry> sMapStore;
+extern DBCStorage <MovieEntry> sMovieStore;
extern DBCStorage <QuestSortEntry> sQuestSortStore;
extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
+extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
+extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore;
extern DBCStorage <SkillLineEntry> sSkillLineStore;
extern DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore;
extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
@@ -184,25 +126,33 @@ extern SpellCategoryStore sSpellCategoryStore;
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 TaxiPathSetBySource sTaxiPathSetBySource;
extern TaxiPathNodesByPath sTaxiPathNodesByPath;
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
+extern DBCStorage <VehicleEntry> sVehicleStore;
+extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
+extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
void LoadDBCStores(const std::string& dataPath);
// script support functions
-TRINITY_DLL_SPEC DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore();
-TRINITY_DLL_SPEC DBCStorage <SpellEntry> const* GetSpellStore();
-TRINITY_DLL_SPEC DBCStorage <SpellRangeEntry> const* GetSpellRangeStore();
+TRINITY_DLL_SPEC DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore();
+TRINITY_DLL_SPEC DBCStorage <SpellEntry> const* GetSpellStore();
+TRINITY_DLL_SPEC DBCStorage <SpellRangeEntry> const* GetSpellRangeStore();
+TRINITY_DLL_SPEC DBCStorage <FactionEntry> const* GetFactionStore();
+TRINITY_DLL_SPEC DBCStorage <ItemEntry> const* GetItemDisplayStore();
+TRINITY_DLL_SPEC DBCStorage <CreatureDisplayInfoEntry> const* GetCreatureDisplayStore();
#endif
-
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h
new file mode 100644
index 00000000000..e804cba5066
--- /dev/null
+++ b/src/game/DBCStructure.h
@@ -0,0 +1,1709 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_DBCSTRUCTURE_H
+#define MANGOS_DBCSTRUCTURE_H
+
+#include "DBCEnums.h"
+#include "Platform/Define.h"
+#include "Util.h"
+
+#include <map>
+#include <set>
+#include <vector>
+
+// Structures using to access raw DBC data and required packing to portability
+
+// 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 AchievementEntry
+{
+ uint32 ID; // 0
+ uint32 factionFlag; // 1 -1=all, 0=horde, 1=alliance
+ uint32 mapID; // 2 -1=none
+ //uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin)
+ //char *name[16]; // 4-19
+ //uint32 name_flags; // 20
+ //char *description[16]; // 21-36
+ //uint32 desc_flags; // 37
+ uint32 categoryId; // 38
+ uint32 points; // 39 reward points
+ //uint32 OrderInCategory; // 40
+ uint32 flags; // 41
+ //uint32 icon; // 42 icon (from SpellIcon.dbc)
+ //char *titleReward[16]; // 43-58
+ //uint32 titleReward_flags; // 59
+ uint32 count; // 60 - need this count of completed criterias (own or referenced achievement criterias)
+ uint32 refAchievement; // 61 - referenced achievement (counting of all completed criterias)
+};
+
+struct AchievementCategoryEntry
+{
+ uint32 ID; // 0
+ uint32 parentCategory; // 1 -1 for main category
+ //char *name[16]; // 2-17
+ //uint32 name_flags; // 18
+ //uint32 sortOrder; // 19
+};
+
+struct AchievementCriteriaEntry
+{
+ uint32 ID; // 0
+ uint32 referredAchievement; // 1
+ uint32 requiredType; // 2
+ union
+ {
+ // ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0
+ // TODO: also used for player deaths..
+ struct
+ {
+ uint32 creatureID; // 3
+ uint32 creatureCount; // 4
+ } kill_creature;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1
+ // TODO: there are further criterias instead just winning
+ struct
+ {
+ uint32 bgMapID; // 3
+ uint32 winCount; // 4
+ } win_bg;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5
+ struct
+ {
+ uint32 unused; // 3
+ uint32 level; // 4
+ } reach_level;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7
+ struct
+ {
+ uint32 skillID; // 3
+ uint32 skillLevel; // 4
+ } reach_skill_level;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8
+ struct
+ {
+ uint32 linkedAchievement; // 3
+ } complete_achievement;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9
+ struct
+ {
+ uint32 unused; // 3
+ uint32 totalQuestCount; // 4
+ } complete_quest_count;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10
+ struct
+ {
+ uint32 unused; // 3
+ uint32 numberOfDays; // 4
+ } complete_daily_quest_daily;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11
+ struct
+ {
+ uint32 zoneID; // 3
+ uint32 questCount; // 4
+ } complete_quests_in_zone;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14
+ struct
+ {
+ uint32 unused; // 3
+ uint32 questCount; // 4
+ } complete_daily_quest;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND = 15
+ struct
+ {
+ uint32 mapID; // 3
+ } complete_battleground;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP = 16
+ struct
+ {
+ uint32 mapID; // 3
+ } death_at_map;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18
+ struct
+ {
+ uint32 manLimit; // 3
+ } death_in_dungeon;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19
+ struct
+ {
+ uint32 groupSize; // 3 can be 5, 10 or 25
+ } complete_raid;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20
+ struct
+ {
+ uint32 creatureEntry; // 3
+ } killed_by_creature;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24
+ struct
+ {
+ uint32 unused; // 3
+ uint32 fallHeight; // 4
+ } fall_without_dying;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26
+ struct
+ {
+ uint32 type; // 3, see enum EnviromentalDamage
+ } death_from;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27
+ struct
+ {
+ uint32 questID; // 3
+ uint32 questCount; // 4
+ } complete_quest;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28
+ // ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69
+ struct
+ {
+ uint32 spellID; // 3
+ uint32 spellCount; // 4
+ } be_spell_target;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL = 29
+ // ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110
+ struct
+ {
+ uint32 spellID; // 3
+ uint32 castCount; // 4
+ } cast_spell;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31
+ struct
+ {
+ uint32 areaID; // 3 Reference to AreaTable.dbc
+ uint32 killCount; // 4
+ } honorable_kill_at_area;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32
+ struct
+ {
+ uint32 mapID; // 3 Reference to Map.dbc
+ } win_arena;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33
+ struct
+ {
+ uint32 mapID; // 3 Reference to Map.dbc
+ } play_arena;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34
+ struct
+ {
+ uint32 spellID; // 3 Reference to Map.dbc
+ } learn_spell;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36
+ struct
+ {
+ uint32 itemID; // 3
+ uint32 itemCount; // 4
+ } own_item;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37
+ struct
+ {
+ uint32 unused; // 3
+ uint32 count; // 4
+ uint32 flag; // 5 4=in a row
+ } win_rated_arena;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38
+ struct
+ {
+ uint32 teamtype; // 3 {2,3,5}
+ } highest_team_rating;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39
+ struct
+ {
+ uint32 teamtype; // 3 {2,3,5}
+ uint32 teamrating; // 4
+ } reach_team_rating;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40
+ struct
+ {
+ uint32 skillID; // 3
+ uint32 skillLevel; // 4 apprentice=1, journeyman=2, expert=3, artisan=4, master=5, grand master=6
+ } learn_skill_level;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41
+ struct
+ {
+ uint32 itemID; // 3
+ uint32 itemCount; // 4
+ } use_item;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42
+ struct
+ {
+ uint32 itemID; // 3
+ uint32 itemCount; // 4
+ } loot_item;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43
+ struct
+ {
+ // TODO: This rank is _NOT_ the index from AreaTable.dbc
+ uint32 areaReference; // 3
+ } explore_area;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK = 44
+ struct
+ {
+ // TODO: This rank is _NOT_ the index from CharTitles.dbc
+ uint32 rank; // 3
+ } own_rank;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45
+ struct
+ {
+ uint32 unused; // 3
+ uint32 numberOfSlots; // 4
+ } buy_bank_slot;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46
+ struct
+ {
+ uint32 factionID; // 3
+ uint32 reputationAmount; // 4 Total reputation amount, so 42000 = exalted
+ } gain_reputation;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47
+ struct
+ {
+ uint32 unused; // 3
+ uint32 numberOfExaltedFactions; // 4
+ } gain_exalted_reputation;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48
+ struct
+ {
+ uint32 unused; // 3
+ uint32 numberOfVisits; // 4
+ } visit_barber;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49
+ // TODO: where is the required itemlevel stored?
+ struct
+ {
+ uint32 itemSlot; // 3
+ } equip_epic_item;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50
+ struct
+ {
+ uint32 rollValue; // 3
+ uint32 count; // 4
+ } roll_need_on_loot;
+ // ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51
+ struct
+ {
+ uint32 rollValue; // 3
+ uint32 count; // 4
+ } roll_greed_on_loot;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52
+ struct
+ {
+ uint32 classID; // 3
+ uint32 count; // 4
+ } hk_class;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53
+ struct
+ {
+ uint32 raceID; // 3
+ uint32 count; // 4
+ } hk_race;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54
+ // TODO: where is the information about the target stored?
+ struct
+ {
+ uint32 emoteID; // 3 enum TextEmotes
+ uint32 count; // 4 count of emotes, always required special target or requirements
+ } do_emote;
+ // ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13
+ // ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55
+ // ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56
+ struct
+ {
+ uint32 unused; // 3
+ uint32 count; // 4
+ uint32 flag; // 5 =3 for battleground healing
+ uint32 mapid; // 6
+ } healing_done;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57
+ struct
+ {
+ uint32 itemID; // 3
+ uint32 count; // 4
+ } equip_item;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD= 62
+ struct
+ {
+ uint32 unused; // 3
+ uint32 goldInCopper; // 4
+ } quest_reward_money;
+
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67
+ struct
+ {
+ uint32 unused; // 3
+ uint32 goldInCopper; // 4
+ } loot_money;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68
+ struct
+ {
+ uint32 goEntry; // 3
+ uint32 useCount; // 4
+ } use_gameobject;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70
+ // TODO: are those special criteria stored in the dbc or do we have to add another sql table?
+ struct
+ {
+ uint32 unused; // 3
+ uint32 killCount; // 4
+ } special_pvp_kill;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72
+ struct
+ {
+ uint32 goEntry; // 3
+ uint32 lootCount; // 4
+ } fish_in_gameobject;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75
+ struct
+ {
+ uint32 skillLine; // 3
+ uint32 spellCount; // 4
+ } learn_skilline_spell;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76
+ struct
+ {
+ uint32 unused; // 3
+ uint32 duelCount; // 4
+ } win_duel;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96
+ struct
+ {
+ uint32 powerType; // 3 mana=0, 1=rage, 3=energy, 6=runic power
+ } highest_power;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97
+ struct
+ {
+ uint32 statType; // 3 4=spirit, 3=int, 2=stamina, 1=agi, 0=strength
+ } highest_stat;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98
+ struct
+ {
+ uint32 spellSchool; // 3
+ } highest_spellpower;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100
+ struct
+ {
+ uint32 ratingType; // 3
+ } highest_rating;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109
+ struct
+ {
+ uint32 lootType; // 3 3=fishing, 2=pickpocket, 4=disentchant
+ uint32 lootTypeCount; // 4
+ } loot_type;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112
+ struct
+ {
+ uint32 skillLine; // 3
+ uint32 spellCount; // 4
+ } learn_skill_line;
+
+ // ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113
+ struct
+ {
+ uint32 unused; // 3
+ uint32 killCount; // 4
+ } honorable_kill;
+
+ struct
+ {
+ uint32 field3; // 3 main requirement
+ uint32 count; // 4 main requirement count
+ uint32 additionalRequirement1_type; // 5 additional requirement 1 type
+ uint32 additionalRequirement1_value; // 6 additional requirement 1 value
+ uint32 additionalRequirement2_type; // 7 additional requirement 2 type
+ uint32 additionalRequirement2_value; // 8 additional requirement 1 value
+ } raw;
+ };
+ //char* name[16]; // 9-24
+ //uint32 name_flags; // 25
+ uint32 completionFlag; // 26
+ uint32 groupFlag; // 27
+ //uint32 unk1; // 28
+ uint32 timeLimit; // 29 time limit in seconds
+ //uint32 showOrder; // 30 show order
+};
+
+struct AreaTableEntry
+{
+ uint32 ID; // 0
+ uint32 mapid; // 1
+ uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area
+ uint32 exploreFlag; // 3, main index
+ uint32 flags; // 4, unknown value but 312 for all cities
+ // 5-9 unused
+ int32 area_level; // 10
+ char* area_name[16]; // 11-26
+ // 27, string flags, unused
+ uint32 team; // 28
+};
+
+struct AreaGroupEntry
+{
+ uint32 AreaGroupId; // 0
+ uint32 AreaId[7]; // 1-7
+};
+
+struct AreaTriggerEntry
+{
+ uint32 id; // 0 m_ID
+ uint32 mapid; // 1 m_ContinentID
+ float x; // 2 m_x
+ float y; // 3 m_y
+ float z; // 4 m_z
+ float radius; // 5 m_radius
+ float box_x; // 6 m_box_length
+ float box_y; // 7 m_box_width
+ float box_z; // 8 m_box_heigh
+ float box_orientation; // 9 m_box_yaw
+};
+
+struct AuctionHouseEntry
+{
+ uint32 houseId; // 0 index
+ uint32 faction; // 1 id of faction.dbc for player factions associated with city
+ uint32 depositPercent; // 2 1/3 from real
+ uint32 cutPercent; // 3
+ //char* name[16]; // 4-19
+ // 20 string flag, unused
+};
+
+struct BankBagSlotPricesEntry
+{
+ uint32 ID;
+ uint32 price;
+};
+
+struct BarberShopStyleEntry
+{
+ uint32 Id; // 0
+ uint32 type; // 1 value 0 -> hair, value 2 -> facialhair
+ //char* name[16]; // 2-17 name of hair style
+ //uint32 name_flags; // 18
+ //uint32 unk_name[16]; // 19-34, all empty
+ //uint32 unk_flags; // 35
+ //float CostMultiplier; // 36 values 1 and 0.75
+ uint32 race; // 37 race
+ uint32 gender; // 38 0 -> male, 1 -> female
+ uint32 hair_id; // 39 real ID to hair/facial hair
+};
+
+struct BattlemasterListEntry
+{
+ uint32 id; // 0
+ int32 mapid[8]; // 1-8 mapid
+ uint32 type; // 9 (3 - BG, 4 - arena)
+ uint32 minlvl; // 10
+ uint32 maxlvl; // 11
+ uint32 maxplayersperteam; // 12
+ // 13 minplayers
+ // 14 0 or 9
+ // 15
+ char* name[16]; // 16-31
+ // 32 string flag, unused
+ // 33 unused
+};
+
+#define MAX_OUTFIT_ITEMS 24
+
+struct CharStartOutfitEntry
+{
+ //uint32 Id; // 0
+ uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
+ int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13
+ //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side
+ //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side
+ //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids)
+ //uint32 Unknown2; // 39
+ //uint32 Unknown3; // 40
+};
+
+struct CharTitlesEntry
+{
+ uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
+ //uint32 unk1; // 1 flags?
+ //char* name[16]; // 2-17, unused
+ // 18 string flag, unused
+ //char* name2[16]; // 19-34, unused
+ // 35 string flag, unused
+ uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES
+};
+
+struct ChatChannelsEntry
+{
+ uint32 ChannelID; // 0
+ uint32 flags; // 1
+ char* pattern[16]; // 3-18
+ // 19 string flags, unused
+ //char* name[16]; // 20-35 unused
+ // 36 string flag, unused
+};
+
+struct ChrClassesEntry
+{
+ uint32 ClassID; // 0
+ // 1, unused
+ uint32 powerType; // 2
+ // 3-4, unused
+ //char* name[16]; // 5-20 unused
+ // 21 string flag, unused
+ //char* nameFemale[16]; // 21-36 unused, if different from base (male) case
+ // 37 string flag, unused
+ //char* nameNeutralGender[16]; // 38-53 unused, if different from base (male) case
+ // 54 string flag, unused
+ // 55, unused
+ uint32 spellfamily; // 56
+ // 57, unused
+ uint32 CinematicSequence; // 58 id from CinematicSequences.dbc
+ uint32 addon; // 59 (0 - original race, 1 - tbc addon, ...)
+};
+
+struct ChrRacesEntry
+{
+ uint32 RaceID; // 0
+ // 1 unused
+ uint32 FactionID; // 2 facton template id
+ // 3 unused
+ uint32 model_m; // 4
+ uint32 model_f; // 5
+ // 6-7 unused
+ uint32 TeamID; // 8 (7-Alliance 1-Horde)
+ // 9-12 unused
+ uint32 CinematicSequence; // 13 id from CinematicSequences.dbc
+ char* name[16]; // 14-29 used for DBC language detection/selection
+ // 30 string flags, unused
+ //char* nameFemale[16]; // 31-46, if different from base (male) case
+ // 47 string flags, unused
+ //char* nameNeutralGender[16]; // 48-63, if different from base (male) case
+ // 64 string flags, unused
+ // 65-67 unused
+ uint32 addon; // 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?
+};
+*/
+
+struct CinematicSequencesEntry
+{
+ uint32 Id; // 0 index
+ //uint32 unk1; // 1 always 0
+ //uint32 cinematicCamera; // 2 id in CinematicCamera.dbc
+ // 3-9 always 0
+};
+
+struct CreatureDisplayInfoEntry
+{
+ uint32 Displayid; // 0 m_ID
+ // 1 m_modelID
+ // 2 m_soundID
+ // 3 m_extendedDisplayInfoID
+ float scale; // 4 m_creatureModelScale
+ // 5 m_creatureModelAlpha
+ // 6-8 m_textureVariation[3]
+ // 9 m_portraitTextureName
+ // 10 m_sizeClass
+ // 11 m_bloodID
+ // 12 m_NPCSoundID
+ // 13 m_particleColorID
+ // 14 m_creatureGeosetData
+ // 15 m_objectEffectPackageID
+};
+
+struct CreatureFamilyEntry
+{
+ uint32 ID; // 0 m_ID
+ float minScale; // 1 m_minScale
+ uint32 minScaleLevel; // 2 m_minScaleLevel
+ float maxScale; // 3 m_maxScale
+ uint32 maxScaleLevel; // 4 m_maxScaleLevel
+ uint32 skillLine[2]; // 5-6 m_skillLine
+ uint32 petFoodMask; // 7 m_petFoodMask
+ int32 petTalentType; // 8 m_petTalentType
+ // 9 m_categoryEnumID
+ char* Name[16]; // 10-25 m_name_lang
+ // 26 string flags
+ // 27 m_iconFile
+};
+
+struct CreatureSpellDataEntry
+{
+ uint32 ID; // 0 m_ID
+ //uint32 spellId[4]; // 1-4 m_spells[4]
+ //uint32 availability[4]; // 4-7 m_availability[4]
+};
+
+struct CreatureTypeEntry
+{
+ uint32 ID; // 0 m_ID
+ //char* Name[16]; // 1-16 name
+ // 17 string flags
+ //uint32 no_expirience; // 18 no exp? critters, non-combat pets, gas cloud.
+};
+
+/* not used
+struct CurrencyCategoryEntry
+{
+ uint32 ID; // 0
+ uint32 Unk1; // 1 0 for known categories and 3 for unknown one (3.0.9)
+ char* Name[16]; // 2-17 name
+ // // 18 string flags
+};
+*/
+
+struct CurrencyTypesEntry
+{
+ //uint32 ID; // 0 not used
+ uint32 ItemId; // 1 used as real index
+ uint32 BitIndex; // 2 bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1))
+};
+
+struct DurabilityCostsEntry
+{
+ uint32 Itemlvl; // 0
+ uint32 multiplier[29]; // 1-29
+};
+
+struct DurabilityQualityEntry
+{
+ uint32 Id; // 0
+ float quality_mod; // 1
+};
+
+struct EmotesTextEntry
+{
+ uint32 Id;
+ uint32 textid;
+};
+
+struct FactionEntry
+{
+ uint32 ID; // 0 m_ID
+ int32 reputationListID; // 1 m_reputationIndex
+ uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask
+ uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask
+ int32 BaseRepValue[4]; // 10-13 m_reputationBase
+ uint32 ReputationFlags[4]; // 14-17 m_reputationFlags
+ uint32 team; // 18 m_parentFactionID
+ char* name[16]; // 19-34 m_name_lang
+ // 35 string flags
+ //char* description[16]; // 36-51 m_description_lang
+ // 52 string flags
+};
+
+struct FactionTemplateEntry
+{
+ uint32 ID; // 0 m_ID
+ uint32 faction; // 1 m_faction
+ uint32 factionFlags; // 2 m_flags
+ uint32 ourMask; // 3 m_factionGroup
+ uint32 friendlyMask; // 4 m_friendGroup
+ uint32 hostileMask; // 5 m_enemyGroup
+ uint32 enemyFaction[4]; // 6 m_enemies[4]
+ uint32 friendFaction[4]; // 10 m_friend[4]
+ //------------------------------------------------------- end structure
+
+ // helpers
+ bool IsFriendlyTo(FactionTemplateEntry const& entry) const
+ {
+ if(ID == entry.ID)
+ return true;
+ if(entry.faction)
+ {
+ for(int i = 0; i < 4; ++i)
+ if (enemyFaction[i] == entry.faction)
+ return false;
+ for(int i = 0; i < 4; ++i)
+ if (friendFaction[i] == entry.faction)
+ return true;
+ }
+ return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
+ }
+ bool IsHostileTo(FactionTemplateEntry const& entry) const
+ {
+ if(ID == entry.ID)
+ return false;
+ if(entry.faction)
+ {
+ for(int i = 0; i < 4; ++i)
+ if (enemyFaction[i] == entry.faction)
+ return true;
+ for(int i = 0; i < 4; ++i)
+ if (friendFaction[i] == entry.faction)
+ return false;
+ }
+ return (hostileMask & entry.ourMask) != 0;
+ }
+ bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
+ bool IsNeutralToAll() const
+ {
+ for(int i = 0; i < 4; ++i)
+ if (enemyFaction[i] != 0)
+ return false;
+ return hostileMask == 0 && friendlyMask == 0;
+ }
+ bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; }
+};
+
+struct GemPropertiesEntry
+{
+ uint32 ID;
+ uint32 spellitemenchantement;
+ uint32 color;
+};
+
+struct GlyphPropertiesEntry
+{
+ uint32 Id;
+ uint32 SpellId;
+ uint32 TypeFlags;
+ uint32 Unk1; // GlyphIconId (SpellIcon.dbc)
+};
+
+struct GlyphSlotEntry
+{
+ uint32 Id;
+ uint32 TypeFlags;
+ uint32 Order;
+};
+
+// All Gt* DBC store data for 100 levels, some by 100 per class/race
+#define GT_MAX_LEVEL 100
+
+struct GtBarberShopCostBaseEntry
+{
+ float cost;
+};
+
+struct GtCombatRatingsEntry
+{
+ float ratio;
+};
+
+struct GtChanceToMeleeCritBaseEntry
+{
+ float base;
+};
+
+struct GtChanceToMeleeCritEntry
+{
+ float ratio;
+};
+
+struct GtChanceToSpellCritBaseEntry
+{
+ float base;
+};
+
+struct GtChanceToSpellCritEntry
+{
+ float ratio;
+};
+
+struct GtOCTRegenHPEntry
+{
+ float ratio;
+};
+
+//struct GtOCTRegenMPEntry
+//{
+// float ratio;
+//};
+
+struct GtRegenHPPerSptEntry
+{
+ float ratio;
+};
+
+struct GtRegenMPPerSptEntry
+{
+ float ratio;
+};
+
+/* no used
+struct HolidayDescriptionsEntry
+{
+ uint32 ID; // 0, this is NOT holiday id
+ //char* name[16] // 1-16 m_name_lang
+ // 17 name flags
+};
+*/
+
+/* no used
+struct HolidayNamesEntry
+{
+ uint32 ID; // 0, this is NOT holiday id
+ //char* name[16] // 1-16 m_name_lang
+ // 17 name flags
+};
+*/
+
+struct HolidaysEntry
+{
+ uint32 ID; // 0, holiday id
+ //uint32 unk1; // 1
+ //uint32 unk2; // 2
+ //uint32 unk3[8] // 3-10, empty fields
+ //uint32 unk11[13] // 11-23, some unknown data (bit strings?)
+ //uint32 unk11[13] // 24-36, some empty fields (continue prev?)
+ //uint32 unk11[12] // 37-48, counters?
+ //uint32 holidayNameId; // 49, id for HolidayNames.dbc
+ //uint32 holidayDescriptionId; // 50, id for HolidayDescriptions.dbc
+ //uint32 unk51; // 51
+ //uint32 unk52; // 52
+ //uint32 unk53; // 53
+};
+
+struct ItemEntry
+{
+ uint32 ID; // 0
+ uint32 Class; // 1
+ //uint32 SubClass; // 2 some items have strnage subclasses
+ int32 Unk0; // 3
+ int32 Material; // 4
+ uint32 DisplayId; // 5
+ uint32 InventoryType; // 6
+ uint32 Sheath; // 7
+};
+
+struct ItemBagFamilyEntry
+{
+ uint32 ID; // 0
+ //char* name[16] // 1-16 m_name_lang
+ // // 17 name flags
+};
+
+struct ItemDisplayInfoEntry
+{
+ uint32 ID; // 0 m_ID
+ // 1 m_modelName[2]
+ // 2 m_modelTexture[2]
+ // 3 m_inventoryIcon
+ // 4 m_geosetGroup[3]
+ // 5 m_flags
+ // 6 m_spellVisualID
+ // 7 m_groupSoundIndex
+ // 8 m_helmetGeosetVis[2]
+ // 9 m_texture[2]
+ // 10 m_itemVisual[8]
+ // 11 m_particleColorID
+};
+
+//struct ItemCondExtCostsEntry
+//{
+// uint32 ID;
+// uint32 condExtendedCost; // ItemPrototype::CondExtendedCost
+// uint32 itemextendedcostentry; // ItemPrototype::ExtendedCost
+// uint32 arenaseason; // arena season number(1-4)
+//};
+
+struct ItemExtendedCostEntry
+{
+ uint32 ID; // 0 extended-cost entry id
+ uint32 reqhonorpoints; // 1 required honor points
+ uint32 reqarenapoints; // 2 required arena points
+ uint32 reqitem[5]; // 3-7 required item id
+ uint32 reqitemcount[5]; // 8-12 required count of 1st item
+ uint32 reqpersonalarenarating; // 13 required personal arena rating
+};
+
+struct ItemLimitCategoryEntry
+{
+ uint32 ID; // 0 Id
+ //char* name[16] // 1-16 m_name_lang
+ // 17 name flags
+ uint32 maxCount; // max allowed equipped as item or in gem slot
+ //uint32 unk; // 1 for prismatic gems only...
+};
+
+struct ItemRandomPropertiesEntry
+{
+ uint32 ID; // 0 m_ID
+ //char* internalName // 1 m_Name
+ uint32 enchant_id[5]; // 2-6 m_Enchantment
+ //char* nameSuffix[16] // 7-22 m_name_lang
+ // 23 name flags
+};
+
+struct ItemRandomSuffixEntry
+{
+ uint32 ID; // 0 m_ID
+ //char* name[16] // 1-16 m_name_lang
+ // 17, name flags
+ // 18 m_internalName
+ uint32 enchant_id[5]; // 19-21 m_enchantment
+ uint32 prefix[5]; // 22-24 m_allocationPct
+};
+
+struct ItemSetEntry
+{
+ //uint32 id // 0 m_ID
+ char* name[16]; // 1-16 m_name_lang
+ // 17 string flags, unused
+ //uint32 itemId[17]; // 18-34 m_itemID
+ uint32 spells[8]; // 35-42 m_setSpellID
+ uint32 items_to_triggerspell[8]; // 43-50 m_setThreshold
+ uint32 required_skill_id; // 51 m_requiredSkill
+ uint32 required_skill_value; // 52 m_requiredSkillRank
+};
+
+#define MAX_LOCK_CASE 8
+
+struct LockEntry
+{
+ uint32 ID; // 0 m_ID
+ uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type
+ uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index
+ uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill
+ //uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action
+};
+
+struct MailTemplateEntry
+{
+ uint32 ID; // 0
+ //char* subject[16]; // 1-16
+ // 17 name flags, unused
+ //char* content[16]; // 18-33
+};
+
+struct MapEntry
+{
+ uint32 MapID; // 0
+ //char* internalname; // 1 unused
+ uint32 map_type; // 2
+ // 3 0 or 1 for battlegrounds (not arenas)
+ char* name[16]; // 4-19
+ // 20 name flags, unused
+ uint32 linked_zone; // 21 common zone for instance and continent map
+ //char* hordeIntro[16]; // 23-37 text for PvP Zones
+ // 38 intro text flags
+ //char* allianceIntro[16]; // 39-54 text for PvP Zones
+ // 55 intro text flags
+ uint32 multimap_id; // 56
+ // 57
+ //chat* unknownText1[16]; // 58-73 unknown empty text fields, possible normal Intro text.
+ // 74 text flags
+ //chat* heroicIntroText[16]; // 75-90 heroic mode requirement text
+ // 91 text flags
+ //chat* unknownText2[16]; // 92-107 unknown empty text fields
+ // 108 text flags
+ int32 entrance_map; // 109 map_id of entrance map
+ float entrance_x; // 110 entrance x coordinate (if exist single entry)
+ float entrance_y; // 111 entrance y coordinate (if exist single entry)
+ uint32 resetTimeRaid; // 112
+ uint32 resetTimeHeroic; // 113
+ // 114 all 0
+ // 115 -1, 0 and 720
+ uint32 addon; // 116 (0-original maps,1-tbc addon)
+ // 117 some kind of time?
+
+ // Helpers
+ uint32 Expansion() const { return addon; }
+
+
+ bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; }
+ bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
+ bool IsRaid() const { return map_type == MAP_RAID; }
+ bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; }
+ bool IsBattleArena() const { return map_type == MAP_ARENA; }
+ bool IsBattleGroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
+ bool SupportsHeroicMode() const { return resetTimeHeroic != 0; }
+ bool HasResetTime() const { return resetTimeHeroic || resetTimeRaid; }
+
+ bool IsMountAllowed() const
+ {
+ return !IsDungeon() ||
+ MapID==209 || MapID==269 || MapID==309 || // TanarisInstance, CavernsOfTime, Zul'gurub
+ MapID==509 || MapID==534 || MapID==560 || // AhnQiraj, HyjalPast, HillsbradPast
+ MapID==568 || MapID==580 || MapID==615 || // ZulAman, Sunwell Plateau, Obsidian Sanctrum
+ MapID==616; // Eye Of Eternity
+ }
+
+ bool IsContinent() const
+ {
+ return MapID == 0 || MapID == 1 || MapID == 530 || MapID == 571;
+ }
+};
+
+struct MovieEntry
+{
+ uint32 Id; // 0 index
+ //char* filename; // 1
+ //uint32 unk2; // 2 always 100
+};
+
+struct QuestSortEntry
+{
+ uint32 id; // 0 m_ID
+ //char* name[16]; // 1-16 m_SortName_lang
+ // 17 name flags
+};
+
+struct RandomPropertiesPointsEntry
+{
+ //uint32 Id; // 0 hidden key
+ uint32 itemLevel; // 1
+ uint32 EpicPropertiesPoints[5]; // 2-6
+ uint32 RarePropertiesPoints[5]; // 7-11
+ uint32 UncommonPropertiesPoints[5]; // 12-16
+};
+
+struct ScalingStatDistributionEntry
+{
+ uint32 Id;
+ uint32 StatMod[10];
+ uint32 Modifier[10];
+ uint32 MaxLevel;
+};
+
+struct ScalingStatValuesEntry
+{
+ uint32 Id;
+ uint32 Level;
+ uint32 Multiplier[17];
+};
+
+//struct SkillLineCategoryEntry{
+// uint32 id; // 0 m_ID
+// char* name[16]; // 1-17 m_name_lang
+// // 18 string flag
+// uint32 displayOrder; // 19 m_sortIndex
+//};
+
+//struct SkillRaceClassInfoEntry{
+// uint32 id; // 0 m_ID
+// uint32 skillId; // 1 m_skillID
+// uint32 raceMask; // 2 m_raceMask
+// uint32 classMask; // 3 m_classMask
+// uint32 flags; // 4 m_flags
+// uint32 reqLevel; // 5 m_minLevel
+// uint32 skillTierId; // 6 m_skillTierID
+// uint32 skillCostID; // 7 m_skillCostIndex
+//};
+
+//struct SkillTiersEntry{
+// uint32 id; // 0 m_ID
+// uint32 skillValue[16]; // 1-17 m_cost
+// uint32 maxSkillValue[16]; // 18-32 m_valueMax
+//};
+
+struct SkillLineEntry
+{
+ uint32 id; // 0 m_ID
+ int32 categoryId; // 1 m_categoryID
+ //uint32 skillCostID; // 2 m_skillCostsID
+ char* name[16]; // 3-18 m_displayName_lang
+ // 19 string flags
+ //char* description[16]; // 20-35 m_description_lang
+ // 36 string flags
+ uint32 spellIcon; // 37 m_spellIconID
+ //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang
+ // 54 string flags
+ // 55 m_canLink
+};
+
+struct SkillLineAbilityEntry
+{
+ uint32 id; // 0 m_ID
+ uint32 skillId; // 1 m_skillLine
+ uint32 spellId; // 2 m_spell
+ uint32 racemask; // 3 m_raceMask
+ uint32 classmask; // 4 m_classMask
+ //uint32 racemaskNot; // 5 m_excludeRace
+ //uint32 classmaskNot; // 6 m_excludeClass
+ uint32 req_skill_value; // 7 m_minSkillLineRank
+ uint32 forward_spellid; // 8 m_supercededBySpell
+ uint32 learnOnGetSkill; // 9 m_acquireMethod
+ uint32 max_value; // 10 m_trivialSkillLineRankHigh
+ uint32 min_value; // 11 m_trivialSkillLineRankLow
+ //uint32 characterPoints[2]; // 12-13 m_characterPoints[2]
+};
+
+struct SoundEntriesEntry
+{
+ uint32 Id; // 0 m_ID
+ //uint32 Type; // 1 m_soundType
+ //char* InternalName; // 2 m_name
+ //char* FileName[10]; // 3-12 m_File[10]
+ //uint32 Unk13[10]; // 13-22 m_Freq[10]
+ //char* Path; // 23 m_DirectoryBase
+ // 24 m_volumeFloat
+ // 25 m_flags
+ // 26 m_minDistance
+ // 27 m_distanceCutoff
+ // 28 m_EAXDef
+};
+
+#define MAX_SPELL_EFFECTS 3
+
+struct SpellEntry
+{
+ uint32 Id; // 0 m_ID
+ uint32 Category; // 1 m_category
+ uint32 Dispel; // 2 m_dispelType
+ uint32 Mechanic; // 3 m_mechanic
+ uint32 Attributes; // 4 m_attribute
+ uint32 AttributesEx; // 5 m_attributesEx
+ uint32 AttributesEx2; // 6 m_attributesExB
+ uint32 AttributesEx3; // 7 m_attributesExC
+ uint32 AttributesEx4; // 8 m_attributesExD
+ uint32 AttributesEx5; // 9 m_attributesExE
+ //uint32 AttributesEx6; // 10 m_attributesExF not used
+ uint32 Stances; // 11 m_shapeshiftMask
+ uint32 StancesNot; // 12 m_shapeshiftExclude
+ uint32 Targets; // 13 m_targets
+ uint32 TargetCreatureType; // 14 m_targetCreatureType
+ uint32 RequiresSpellFocus; // 15 m_requiresSpellFocus
+ uint32 FacingCasterFlags; // 16 m_facingCasterFlags
+ uint32 CasterAuraState; // 17 m_casterAuraState
+ uint32 TargetAuraState; // 18 m_targetAuraState
+ uint32 CasterAuraStateNot; // 19 m_excludeCasterAuraState
+ uint32 TargetAuraStateNot; // 20 m_excludeTargetAuraState
+ uint32 casterAuraSpell; // 21 m_casterAuraSpell
+ uint32 targetAuraSpell; // 22 m_targetAuraSpell
+ uint32 excludeCasterAuraSpell; // 23 m_excludeCasterAuraSpell
+ uint32 excludeTargetAuraSpell; // 24 m_excludeTargetAuraSpell
+ uint32 CastingTimeIndex; // 25 m_castingTimeIndex
+ uint32 RecoveryTime; // 26 m_recoveryTime
+ uint32 CategoryRecoveryTime; // 27 m_categoryRecoveryTime
+ uint32 InterruptFlags; // 28 m_interruptFlags
+ uint32 AuraInterruptFlags; // 29 m_auraInterruptFlags
+ uint32 ChannelInterruptFlags; // 30 m_channelInterruptFlags
+ uint32 procFlags; // 31 m_procTypeMask
+ uint32 procChance; // 32 m_procChance
+ uint32 procCharges; // 33 m_procCharges
+ uint32 maxLevel; // 34 m_maxLevel
+ uint32 baseLevel; // 35 m_baseLevel
+ uint32 spellLevel; // 36 m_spellLevel
+ uint32 DurationIndex; // 37 m_durationIndex
+ uint32 powerType; // 38 m_powerType
+ uint32 manaCost; // 39 m_manaCost
+ uint32 manaCostPerlevel; // 40 m_manaCostPerLevel
+ uint32 manaPerSecond; // 41 m_manaPerSecond
+ uint32 manaPerSecondPerLevel; // 42 m_manaPerSecondPerLeve
+ uint32 rangeIndex; // 43 m_rangeIndex
+ float speed; // 44 m_speed
+ //uint32 modalNextSpell; // 45 m_modalNextSpell not used
+ uint32 StackAmount; // 46 m_cumulativeAura
+ uint32 Totem[2]; // 47-48 m_totem
+ int32 Reagent[8]; // 49-56 m_reagent
+ uint32 ReagentCount[8]; // 57-64 m_reagentCount
+ int32 EquippedItemClass; // 65 m_equippedItemClass (value)
+ int32 EquippedItemSubClassMask; // 66 m_equippedItemSubclass (mask)
+ int32 EquippedItemInventoryTypeMask; // 67 m_equippedItemInvTypes (mask)
+ uint32 Effect[MAX_SPELL_EFFECTS]; // 68-70 m_effect
+ int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 71-73 m_effectDieSides
+ uint32 EffectBaseDice[MAX_SPELL_EFFECTS]; // 74-76 m_effectBaseDice
+ float EffectDicePerLevel[MAX_SPELL_EFFECTS]; // 77-79 m_effectDicePerLevel
+ float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 80-82 m_effectRealPointsPerLevel
+ int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 83-85 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
+ uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 86-88 m_effectMechanic
+ uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 89-91 m_implicitTargetA
+ uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 92-94 m_implicitTargetB
+ uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]; // 95-97 m_effectRadiusIndex - spellradius.dbc
+ uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]; // 98-100 m_effectAura
+ uint32 EffectAmplitude[MAX_SPELL_EFFECTS]; // 101-103 m_effectAuraPeriod
+ float EffectMultipleValue[MAX_SPELL_EFFECTS]; // 104-106 m_effectAmplitude
+ uint32 EffectChainTarget[MAX_SPELL_EFFECTS]; // 107-109 m_effectChainTargets
+ uint32 EffectItemType[MAX_SPELL_EFFECTS]; // 110-112 m_effectItemType
+ int32 EffectMiscValue[MAX_SPELL_EFFECTS]; // 113-115 m_effectMiscValue
+ int32 EffectMiscValueB[MAX_SPELL_EFFECTS]; // 116-118 m_effectMiscValueB
+ uint32 EffectTriggerSpell[MAX_SPELL_EFFECTS]; // 119-121 m_effectTriggerSpell
+ float EffectPointsPerComboPoint[MAX_SPELL_EFFECTS]; // 122-124 m_effectPointsPerCombo
+ flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; //
+ uint32 SpellVisual[2]; // 134-135 m_spellVisualID
+ uint32 SpellIconID; // 136 m_spellIconID
+ uint32 activeIconID; // 137 m_activeIconID
+ //uint32 spellPriority; // 138 not used
+ char* SpellName[16]; // 139-154 m_name_lang
+ //uint32 SpellNameFlag; // 155 not used
+ char* Rank[16]; // 156-171 m_nameSubtext_lang
+ //uint32 RankFlags; // 172 not used
+ //char* Description[16]; // 173-188 m_description_lang not used
+ //uint32 DescriptionFlags; // 189 not used
+ //char* ToolTip[16]; // 190-205 m_auraDescription_lang not used
+ //uint32 ToolTipFlags; // 206 not used
+ uint32 ManaCostPercentage; // 207 m_manaCostPct
+ uint32 StartRecoveryCategory; // 208 m_startRecoveryCategory
+ uint32 StartRecoveryTime; // 209 m_startRecoveryTime
+ uint32 MaxTargetLevel; // 210 m_maxTargetLevel
+ uint32 SpellFamilyName; // 211 m_spellClassSet
+ flag96 SpellFamilyFlags; // 212-214
+ uint32 MaxAffectedTargets; // 215 m_maxTargets
+ uint32 DmgClass; // 216 m_defenseType
+ uint32 PreventionType; // 217 m_preventionType
+ //uint32 StanceBarOrder; // 218 m_stanceBarOrder not used
+ float DmgMultiplier[3]; // 219-221 m_effectChainAmplitude
+ //uint32 MinFactionId; // 222 m_minFactionID not used
+ //uint32 MinReputation; // 223 m_minReputation not used
+ //uint32 RequiredAuraVision; // 224 m_requiredAuraVision not used
+ uint32 TotemCategory[2]; // 225-226 m_requiredTotemCategoryID
+ int32 AreaGroupId; // 227 m_requiredAreaGroupId
+ uint32 SchoolMask; // 228 m_schoolMask
+ uint32 runeCostID; // 229 m_runeCostID
+ //uint32 spellMissileID; // 230 m_spellMissileID not used
+
+ // helpers
+ int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); }
+
+ private:
+ // prevent creating custom entries (copy data from original in fact)
+ SpellEntry(SpellEntry const&); // DON'T must have implementation
+};
+
+typedef std::set<uint32> SpellCategorySet;
+typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
+typedef std::set<uint32> PetFamilySpellsSet;
+typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
+
+struct SpellCastTimesEntry
+{
+ uint32 ID; // 0
+ int32 CastTime; // 1
+ //float CastTimePerLevel; // 2 unsure / per skill?
+ //int32 MinCastTime; // 3 unsure
+};
+
+struct SpellFocusObjectEntry
+{
+ uint32 ID; // 0
+ //char* Name[16]; // 1-15 unused
+ // 16 string flags, unused
+};
+
+// stored in SQL table
+struct SpellThreatEntry
+{
+ uint32 spellId;
+ int32 threat;
+};
+
+struct SpellRadiusEntry
+{
+ uint32 ID;
+ float radiusHostile;
+ //uint32 Unk //always 0
+ float radiusFriend;
+};
+
+struct SpellRangeEntry
+{
+ uint32 ID;
+ float minRangeHostile;
+ float minRangeFriend;
+ float maxRangeHostile;
+ float maxRangeFriend; //friend means unattackable unit here
+ uint32 type;
+ //char* Name[16]; // 7-23 unused
+ // 24 string flags, unused
+ //char* Name2[16]; // 25-40 unused
+ // 41 string flags, unused
+};
+
+struct SpellRuneCostEntry
+{
+ uint32 ID; // 0
+ uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy)
+ uint32 runePowerGain; // 4
+
+ bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; }
+ bool NoRunicPowerGain() const { return runePowerGain == 0; }
+};
+
+struct SpellShapeshiftEntry
+{
+ uint32 ID; // 0
+ //uint32 buttonPosition; // 1 unused
+ //char* Name[16]; // 2-17 unused
+ //uint32 NameFlags; // 18 unused
+ uint32 flags1; // 19
+ int32 creatureType; // 20 <=0 humanoid, other normal creature types
+ //uint32 unk1; // 21 unused
+ uint32 attackSpeed; // 22
+ //uint32 modelID; // 23 unused, alliance modelid (where horde case?)
+ //uint32 unk2; // 24 unused
+ //uint32 unk3; // 25 unused
+ //uint32 unk4; // 26 unused
+ //uint32 unk5; // 27 unused
+ //uint32 unk6; // 28 unused
+ //uint32 unk7; // 29 unused
+ //uint32 unk8; // 30 unused
+ //uint32 unk9; // 31 unused
+ //uint32 unk10; // 32 unused
+ //uint32 unk11; // 33 unused
+ //uint32 unk12; // 34 unused
+};
+
+struct SpellDurationEntry
+{
+ uint32 ID;
+ int32 Duration[3];
+};
+
+struct SpellItemEnchantmentEntry
+{
+ uint32 ID; // 0 m_ID
+ //uint32 charges; // 1 m_charges
+ uint32 type[3]; // 2-4 m_effect[3]
+ uint32 amount[3]; // 5-7 m_effectPointsMin[3]
+ //uint32 amount2[3] // 8-10 m_effectPointsMax[3]
+ uint32 spellid[3]; // 11-13 m_effectArg[3]
+ char* description[16]; // 14-29 m_name_lang[16]
+ //uint32 descriptionFlags; // 30 name flags
+ uint32 aura_id; // 31 m_itemVisual
+ uint32 slot; // 32 m_flags
+ uint32 GemID; // 33 m_src_itemID
+ uint32 EnchantmentCondition; // 34 m_condition_id
+ //uint32 requiredSkill; // 35 m_requiredSkillID
+ //uint32 requiredSkillValue; // 36 m_requiredSkillRank
+};
+
+struct SpellItemEnchantmentConditionEntry
+{
+ uint32 ID; // 0 m_ID
+ uint8 Color[5]; // 1-5 m_lt_operandType[5]
+ //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5]
+ uint8 Comparator[5]; // 11-15 m_operator[5]
+ uint8 CompareColor[5]; // 15-20 m_rt_operandType[5]
+ uint32 Value[5]; // 21-25 m_rt_operand[5]
+ //uint8 Logic[5] // 25-30 m_logic[5]
+};
+
+struct StableSlotPricesEntry
+{
+ uint32 Slot;
+ uint32 Price;
+};
+
+struct SummonPropertiesEntry
+{
+ uint32 Id; // 0
+ uint32 Category; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount?
+ uint32 Faction; // 2, 14 rows > 0
+ uint32 Type; // 3, see enum
+ uint32 Slot; // 4, 0-6
+ uint32 Flags; // 5
+};
+
+#define MAX_TALENT_RANK 5
+#define MAX_PET_TALENT_RANK 3 // use in calculations, expected <= MAX_TALENT_RANK
+
+struct TalentEntry
+{
+ uint32 TalentID; // 0
+ uint32 TalentTab; // 1 index in TalentTab.dbc (TalentTabEntry)
+ uint32 Row; // 2
+ uint32 Col; // 3
+ uint32 RankID[MAX_TALENT_RANK]; // 4-8
+ // 9-12 not used, always 0, maybe not used high ranks
+ uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry)
+ // 14-15 not used
+ uint32 DependsOnRank; // 16
+ // 17-18 not used
+ //uint32 unk1; // 19, 0 or 1
+ //uint32 unk2; // 20, all 0
+ //uint32 unkFlags1; // 21, related to hunter pet talents
+ //uint32 unkFlags2; // 22, related to hunter pet talents
+};
+
+struct TalentTabEntry
+{
+ uint32 TalentTabID; // 0
+ //char* name[16]; // 1-16, unused
+ //uint32 nameFlags; // 17, unused
+ //unit32 spellicon; // 18
+ // 19 not used
+ uint32 ClassMask; // 20
+ uint32 petTalentMask; // 21
+ uint32 tabpage; // 22
+ //char* internalname; // 23
+};
+
+struct TaxiNodesEntry
+{
+ uint32 ID; // 0 m_ID
+ uint32 map_id; // 1 m_ContinentID
+ float x; // 2 m_x
+ float y; // 3 m_y
+ float z; // 4 m_z
+ //char* name[16]; // 5-21 m_Name_lang
+ // 22 string flags
+ uint32 MountCreatureID[2]; // 23-24 m_MountCreatureID[2]
+};
+
+struct TaxiPathEntry
+{
+ uint32 ID; // 0 m_ID
+ uint32 from; // 1 m_FromTaxiNode
+ uint32 to; // 2 m_ToTaxiNode
+ uint32 price; // 3 m_Cost
+};
+
+struct TaxiPathNodeEntry
+{
+ // 0 m_ID
+ uint32 path; // 1 m_PathID
+ uint32 index; // 2 m_NodeIndex
+ uint32 mapid; // 3 m_ContinentID
+ float x; // 4 m_LocX
+ float y; // 5 m_LocY
+ float z; // 6 m_LocZ
+ uint32 actionFlag; // 7 m_flags
+ uint32 delay; // 8 m_delay
+ // 9 m_arrivalEventID
+ // 10 m_departureEventID
+};
+
+struct TotemCategoryEntry
+{
+ uint32 ID; // 0
+ //char* name[16]; // 1-16
+ // 17 string flags, unused
+ uint32 categoryType; // 18 (one for specialization)
+ uint32 categoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods)
+};
+
+struct VehicleEntry
+{
+ uint32 m_ID; // 0
+ uint32 m_flags; // 1
+ float m_turnSpeed; // 2
+ float m_pitchSpeed; // 3
+ float m_pitchMin; // 4
+ float m_pitchMax; // 5
+ uint32 m_seatID[8]; // 6-13
+ float m_mouseLookOffsetPitch; // 14
+ float m_cameraFadeDistScalarMin; // 15
+ float m_cameraFadeDistScalarMax; // 16
+ float m_cameraPitchOffset; // 17
+ int m_powerType[3]; // 18-20
+ int m_powerToken[3]; // 21-23
+ float m_facingLimitRight; // 24
+ float m_facingLimitLeft; // 25
+ float m_msslTrgtTurnLingering; // 26
+ float m_msslTrgtPitchLingering; // 27
+ float m_msslTrgtMouseLingering; // 28
+ float m_msslTrgtEndOpacity; // 29
+ float m_msslTrgtArcSpeed; // 30
+ float m_msslTrgtArcRepeat; // 31
+ float m_msslTrgtArcWidth; // 32
+ float m_msslTrgtImpactRadius[2]; // 33-34
+ char* m_msslTrgtArcTexture; // 35
+ char* m_msslTrgtImpactTexture; // 36
+ char* m_msslTrgtImpactModel[2]; // 37-38
+ float m_cameraYawOffset; // 39
+ uint32 m_uiLocomotionType; // 40
+ float m_msslTrgtImpactTexRadius; // 41
+ uint32 m_uiSeatIndicatorType; // 42
+};
+
+struct VehicleSeatEntry
+{
+ uint32 m_ID; // 0
+ uint32 m_flags; // 1
+ int32 m_attachmentID; // 2
+ float m_attachmentOffsetX; // 3
+ float m_attachmentOffsetY; // 4
+ float m_attachmentOffsetZ; // 5
+ float m_enterPreDelay; // 6
+ float m_enterSpeed; // 7
+ float m_enterGravity; // 8
+ float m_enterMinDuration; // 9
+ float m_enterMaxDuration; // 10
+ float m_enterMinArcHeight; // 11
+ float m_enterMaxArcHeight; // 12
+ int32 m_enterAnimStart; // 13
+ int32 m_enterAnimLoop; // 14
+ int32 m_rideAnimStart; // 15
+ int32 m_rideAnimLoop; // 16
+ int32 m_rideUpperAnimStart; // 17
+ int32 m_rideUpperAnimLoop; // 18
+ float m_exitPreDelay; // 19
+ float m_exitSpeed; // 20
+ float m_exitGravity; // 21
+ float m_exitMinDuration; // 22
+ float m_exitMaxDuration; // 23
+ float m_exitMinArcHeight; // 24
+ float m_exitMaxArcHeight; // 25
+ int32 m_exitAnimStart; // 26
+ int32 m_exitAnimLoop; // 27
+ int32 m_exitAnimEnd; // 28
+ float m_passengerYaw; // 29
+ float m_passengerPitch; // 30
+ float m_passengerRoll; // 31
+ int32 m_passengerAttachmentID; // 32
+ int32 m_vehicleEnterAnim; // 33
+ int32 m_vehicleExitAnim; // 34
+ int32 m_vehicleRideAnimLoop; // 35
+ int32 m_vehicleEnterAnimBone; // 36
+ int32 m_vehicleExitAnimBone; // 37
+ int32 m_vehicleRideAnimLoopBone; // 38
+ float m_vehicleEnterAnimDelay; // 39
+ float m_vehicleExitAnimDelay; // 40
+ uint32 m_vehicleAbilityDisplay; // 41
+ uint32 m_enterUISoundID; // 42
+ uint32 m_exitUISoundID; // 43
+ int32 m_uiSkin; // 44
+ uint32 m_flagsB; // 45
+};
+
+struct WorldMapAreaEntry
+{
+ //uint32 ID; // 0
+ uint32 map_id; // 1
+ uint32 area_id; // 2 index (continent 0 areas ignored)
+ //char* internal_name // 3
+ float y1; // 4
+ float y2; // 5
+ float x1; // 6
+ float x2; // 7
+ int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
+ // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1,x2,y1,y2 coordinates)
+};
+
+struct WorldSafeLocsEntry
+{
+ uint32 ID; // 0
+ uint32 map_id; // 1
+ float x; // 2
+ float y; // 3
+ float z; // 4
+ //char* name[16] // 5-20 name, unused
+ // 21 name flags, unused
+};
+
+struct WorldMapOverlayEntry
+{
+ uint32 ID; // 0
+ uint32 areatableID[4]; // 2-5
+};
+
+// 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
+
+// Structures not used for casting to loaded DBC data and not required then packing
+struct TalentSpellPos
+{
+ TalentSpellPos() : talent_id(0), rank(0) {}
+ TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
+
+ uint16 talent_id;
+ uint8 rank;
+};
+
+typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap;
+
+struct TaxiPathBySourceAndDestination
+{
+ TaxiPathBySourceAndDestination() : ID(0),price(0) {}
+ TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {}
+
+ uint32 ID;
+ uint32 price;
+};
+typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource;
+typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource;
+
+struct TaxiPathNode
+{
+ TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {}
+ TaxiPathNode(uint32 _mapid, float _x, float _y, float _z, uint32 _actionFlag, uint32 _delay) : mapid(_mapid), x(_x),y(_y),z(_z),actionFlag(_actionFlag),delay(_delay) {}
+
+ uint32 mapid;
+ float x;
+ float y;
+ float z;
+ uint32 actionFlag;
+ uint32 delay;
+};
+typedef std::vector<TaxiPathNode> TaxiPathNodeList;
+typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
+
+#define TaxiMaskSize 12
+typedef uint32 TaxiMask[TaxiMaskSize];
+#endif
+
diff --git a/src/shared/Database/DBCfmt.cpp b/src/game/DBCfmt.h
index 14cf6486933..23f9cc9c516 100644
--- a/src/shared/Database/DBCfmt.cpp
+++ b/src/game/DBCfmt.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -10,37 +10,47 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxx";
-const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
+#ifndef MANGOS_DBCSFRM_H
+#define MANGOS_DBCSFRM_H
+
+const char Achievementfmt[]="niixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
+const char AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiixix";
+const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
+const char AreaGroupEntryfmt[]="niiiiiii";
const char AreaTriggerEntryfmt[]="niffffffff";
+const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
const char BankBagSlotPricesEntryfmt[]="ni";
-const char BattlemasterListEntryfmt[]="niiixxxxxiiiixxssssssssssssssssxx";
-const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxx";
-// 3*12 new item fields in 3.0.x
-//const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
+const char BattlemasterListEntryfmt[]="niiiiiiiiiiiixxxssssssssssssssssxx";
+const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char CharTitlesEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
// ChatChannelsEntryfmt, index not used (more compact store)
-//const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix";
-const char ChrClassesEntryfmt[]="nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix";
+const char ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
const char ChrRacesEntryfmt[]="nxixiixxixxxxissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
-const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxx";
-const char CreatureFamilyfmt[]="nfifiiiissssssssssssssssxx";
+const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
+const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx";
+const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx";
const char CreatureSpellDatafmt[]="nxxxxxxxx";
+const char CreatureTypefmt[]="nxxxxxxxxxxxxxxxxxx";
+const char CurrencyTypesfmt[]="xnxi";
const char DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
const char DurabilityQualityfmt[]="nf";
const char EmoteEntryfmt[]="nxixxxxxxxxxxxxxxxx";
const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiissssssssssssssssxxxxxxxxxxxxxxxxxx";
const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii";
const char GemPropertiesEntryfmt[]="nixxi";
+const char GlyphPropertiesfmt[]="niii";
+const char GlyphSlotfmt[]="nii";
+const char GtBarberShopCostBasefmt[]="f";
const char GtCombatRatingsfmt[]="f";
const char GtChanceToMeleeCritBasefmt[]="f";
const char GtChanceToMeleeCritfmt[]="f";
@@ -50,37 +60,49 @@ const char GtOCTRegenHPfmt[]="f";
//const char GtOCTRegenMPfmt[]="f";
const char GtRegenHPPerSptfmt[]="f";
const char GtRegenMPPerSptfmt[]="f";
-const char Itemfmt[]="niii";
+const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char Itemfmt[]="nixiiiii";
+const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx";
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
//const char ItemCondExtCostsEntryfmt[]="xiii";
-const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiii";
-const char ItemRandomPropertiesfmt[]="nxiiixxxxxxxxxxxxxxxxxxx";
-const char ItemRandomSuffixfmt[]="nxxxxxxxxxxxxxxxxxxiiiiii";
+const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix";
+const char ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxix";
+const char ItemRandomPropertiesfmt[]="nxiiiiixxxxxxxxxxxxxxxxx";
+const char ItemRandomSuffixfmt[]="nxxxxxxxxxxxxxxxxxxiiiiiiiiii";
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
-const char LockEntryfmt[]="niiiiixxxiiiiixxxiixxxxxxxxxxxxxx";
+const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
-const char MapEntryfmt[]="nxixssssssssssssssssxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxi";
+const char MapEntryfmt[]="nxixssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxix";
+const char MovieEntryfmt[]="nxx";
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
-const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxi";
-const char SkillLineAbilityfmt[]="niiiixxiiiiixxi";
+const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii";
+const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiii";
+const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxx";
+const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellCastTimefmt[]="nixx";
const char SpellDurationfmt[]="niii";
-const char SpellEntryfmt[]="nixiiiiiiiixiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffixiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiixfffxxxiiii";
+const char SpellEntryfmt[]="niiiiiiiiixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiix";
const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
-const char SpellItemEnchantmentfmt[]="niiiiiixxxiiissssssssssssssssxiiii";
+const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixx";
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf";
-const char SpellRangefmt[]="nffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char SpellRangefmt[]="nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char SpellRuneCostfmt[]="niiii";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx";
const char StableSlotPricesfmt[] = "ni";
-const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxi";
-const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiix";
+const char SummonPropertiesfmt[] = "niiiii";
+const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx";
+const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix";
const char TaxiNodesEntryfmt[]="nifffxxxxxxxxxxxxxxxxxii";
const char TaxiPathEntryfmt[]="niii";
const char TaxiPathNodeEntryfmt[]="diiifffiixx";
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
-const char WorldMapAreaEntryfmt[]="xinxffffi";
+const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
+const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
+const char WorldMapAreaEntryfmt[]="xinxffffix";
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
+const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx";
+#endif \ No newline at end of file
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp
index 3bf64188e34..940edeb74c2 100644
--- a/src/game/Debugcmds.cpp
+++ b/src/game/Debugcmds.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,37 +21,23 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
+#include "Vehicle.h"
#include "Player.h"
#include "Opcodes.h"
#include "Chat.h"
#include "Log.h"
#include "Unit.h"
-#include "ObjectAccessor.h"
#include "GossipDef.h"
#include "Language.h"
-#include "MapManager.h"
#include "BattleGroundMgr.h"
#include <fstream>
#include "ObjectMgr.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
-bool ChatHandler::HandleDebugInArcCommand(const char* /*args*/)
-{
- Object *obj = getSelectedUnit();
-
- if(!obj)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- return true;
- }
-
- SendSysMessage(LANG_NOT_IMPLEMENTED);
-
- return true;
-}
-
-bool ChatHandler::HandleDebugSpellFailCommand(const char* args)
+bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
{
if(!args)
return false;
@@ -61,16 +47,31 @@ bool ChatHandler::HandleDebugSpellFailCommand(const char* args)
return false;
uint8 failnum = (uint8)atoi(px);
+ if(failnum==0 && *px!='0')
+ return false;
+
+ char* p1 = strtok(NULL, " ");
+ uint8 failarg1 = p1 ? (uint8)atoi(p1) : 0;
+
+ char* p2 = strtok(NULL, " ");
+ uint8 failarg2 = p2 ? (uint8)atoi(p2) : 0;
+
WorldPacket data(SMSG_CAST_FAILED, 5);
+ data << uint8(0);
data << uint32(133);
data << uint8(failnum);
+ if(p1 || p2)
+ data << uint32(failarg1);
+ if(p2)
+ data << uint32(failarg2);
+
m_session->SendPacket(&data);
return true;
}
-bool ChatHandler::HandleSetPoiCommand(const char* args)
+bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
{
Player *pPlayer = m_session->GetPlayer();
Unit* target = getSelectedUnit();
@@ -89,9 +90,6 @@ bool ChatHandler::HandleSetPoiCommand(const char* args)
return false;
uint32 icon = atol(icon_text);
- if ( icon < 0 )
- icon = 0;
-
uint32 flags = atol(flags_text);
sLog.outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon,flags);
@@ -99,7 +97,7 @@ bool ChatHandler::HandleSetPoiCommand(const char* args)
return true;
}
-bool ChatHandler::HandleEquipErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
{
if(!args)
return false;
@@ -109,7 +107,7 @@ bool ChatHandler::HandleEquipErrorCommand(const char* args)
return true;
}
-bool ChatHandler::HandleSellErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
{
if(!args)
return false;
@@ -119,7 +117,7 @@ bool ChatHandler::HandleSellErrorCommand(const char* args)
return true;
}
-bool ChatHandler::HandleBuyErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendBuyErrorCommand(const char* args)
{
if(!args)
return false;
@@ -129,7 +127,7 @@ bool ChatHandler::HandleBuyErrorCommand(const char* args)
return true;
}
-bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
+bool ChatHandler::HandleDebugSendOpcodeCommand(const char* /*args*/)
{
Unit *unit = getSelectedUnit();
Player *player = NULL;
@@ -192,14 +190,22 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
ifs >> val6;
data << val6;
}
- else if(type == "pguid")
+ else if(type == "appitsguid")
{
data.append(unit->GetPackGUID());
}
- else if(type == "myguid")
+ else if(type == "appmyguid")
{
data.append(player->GetPackGUID());
}
+ else if(type == "myguid")
+ {
+ data << uint64(player->GetGUID());
+ }
+ else if(type == "itsguid")
+ {
+ data << uint64(unit->GetGUID());
+ }
else if(type == "pos")
{
data << unit->GetPositionX();
@@ -221,12 +227,12 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/)
ifs.close();
sLog.outDebug("Sending opcode %u", data.GetOpcode());
data.hexlike();
- ((Player*)unit)->GetSession()->SendPacket(&data);
+ player->GetSession()->SendPacket(&data);
PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
return true;
}
-bool ChatHandler::HandleUpdateWorldStateCommand(const char* args)
+bool ChatHandler::HandleDebugUpdateWorldStateCommand(const char* args)
{
char* w = strtok((char*)args, " ");
char* s = strtok(NULL, " ");
@@ -240,18 +246,94 @@ bool ChatHandler::HandleUpdateWorldStateCommand(const char* args)
return true;
}
-bool ChatHandler::HandlePlaySound2Command(const char* args)
+bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args)
{
- if(!args)
+ // USAGE: .debug play cinematic #cinematicid
+ // #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
+ if( !*args )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
return false;
+ }
+
+ uint32 dwId = atoi((char*)args);
- uint32 soundid = atoi(args);
- m_session->GetPlayer()->PlaySound(soundid, false);
+ if(!sCinematicSequencesStore.LookupEntry(dwId))
+ {
+ PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, dwId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ m_session->GetPlayer()->SendCinematicStart(dwId);
+ return true;
+}
+
+bool ChatHandler::HandleDebugPlayMovieCommand(const char* args)
+{
+ // USAGE: .debug play movie #movieid
+ // #movieid - ID decimal number from Movie.dbc (1st column)
+ if( !*args )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 dwId = atoi((char*)args);
+
+ if(!sMovieStore.LookupEntry(dwId))
+ {
+ PSendSysMessage(LANG_MOVIE_NOT_EXIST, dwId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ m_session->GetPlayer()->SendMovieStart(dwId);
+ return true;
+}
+
+//Play sound
+bool ChatHandler::HandleDebugPlaySoundCommand(const char* args)
+{
+ // USAGE: .debug playsound #soundid
+ // #soundid - ID decimal number from SoundEntries.dbc (1st column)
+ if( !*args )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 dwSoundId = atoi((char*)args);
+
+ if(!sSoundEntriesStore.LookupEntry(dwSoundId))
+ {
+ PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ Unit* unit = getSelectedUnit();
+ if(!unit)
+ {
+ SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(m_session->GetPlayer()->GetSelection())
+ unit->PlayDistanceSound(dwSoundId,m_session->GetPlayer());
+ else
+ unit->PlayDirectSound(dwSoundId,m_session->GetPlayer());
+
+ PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId);
return true;
}
//Send notification in channel
-bool ChatHandler::HandleSendChannelNotifyCommand(const char* args)
+bool ChatHandler::HandleDebugSendChannelNotifyCommand(const char* args)
{
if(!args)
return false;
@@ -269,7 +351,7 @@ bool ChatHandler::HandleSendChannelNotifyCommand(const char* args)
}
//Send notification in chat
-bool ChatHandler::HandleSendChatMsgCommand(const char* args)
+bool ChatHandler::HandleDebugSendChatMsgCommand(const char* args)
{
if(!args)
return false;
@@ -282,15 +364,14 @@ bool ChatHandler::HandleSendChatMsgCommand(const char* args)
return true;
}
-bool ChatHandler::HandleSendQuestPartyMsgCommand(const char* args)
+bool ChatHandler::HandleDebugSendQuestPartyMsgCommand(const char* args)
{
uint32 msg = atol((char*)args);
- if (msg >= 0)
- m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg);
+ m_session->GetPlayer()->SendPushToPartyResponse(m_session->GetPlayer(), msg);
return true;
}
-bool ChatHandler::HandleGetLootRecipient(const char* /*args*/)
+bool ChatHandler::HandleDebugGetLootRecipient(const char* /*args*/)
{
Creature* target = getSelectedCreature();
if(!target)
@@ -300,15 +381,14 @@ bool ChatHandler::HandleGetLootRecipient(const char* /*args*/)
return true;
}
-bool ChatHandler::HandleSendQuestInvalidMsgCommand(const char* args)
+bool ChatHandler::HandleDebugSendQuestInvalidMsgCommand(const char* args)
{
uint32 msg = atol((char*)args);
- if (msg >= 0)
- m_session->GetPlayer()->SendCanTakeQuestResponse(msg);
+ m_session->GetPlayer()->SendCanTakeQuestResponse(msg);
return true;
}
-bool ChatHandler::HandleGetItemState(const char* args)
+bool ChatHandler::HandleDebugGetItemState(const char* args)
{
if (!args)
return false;
@@ -542,6 +622,12 @@ bool ChatHandler::HandleGetItemState(const char* args)
return true;
}
+bool ChatHandler::HandleDebugBattlegroundCommand(const char * /*args*/)
+{
+ sBattleGroundMgr.ToggleTesting();
+ return true;
+}
+
bool ChatHandler::HandleDebugArenaCommand(const char * /*args*/)
{
sBattleGroundMgr.ToggleArenaTesting();
@@ -591,3 +677,154 @@ bool ChatHandler::HandleDebugHostilRefList(const char * /*args*/)
return true;
}
+bool ChatHandler::HandleDebugSetVehicleId(const char *args)
+{
+ Unit* target = getSelectedUnit();
+ if(!target || target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->isVehicle())
+ return false;
+
+ if(!args)
+ return false;
+
+ char* i = strtok((char*)args, " ");
+ if(!i)
+ return false;
+
+ uint32 id = (uint32)atoi(i);
+ ((Vehicle*)target)->SetVehicleId(id);
+ target->SendUpdateObjectToAllExcept(NULL);
+ PSendSysMessage("Vehicle id set to %u", id);
+ return true;
+}
+
+bool ChatHandler::HandleDebugEnterVehicle(const char * args)
+{
+ Unit* target = getSelectedUnit();
+ if(!target || target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->isVehicle())
+ return false;
+
+ if(!args)
+ return false;
+
+ char* i = strtok((char*)args, " ");
+ if(!i)
+ return false;
+
+ uint32 entry = (uint32)atoi(i);
+ Creature *passenger = NULL;
+ Trinity::AllCreaturesOfEntryInRange check(m_session->GetPlayer(), entry, 20.0f);
+ Trinity::CreatureSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_session->GetPlayer(), passenger, check);
+ m_session->GetPlayer()->VisitNearbyObject(20.0f, searcher);
+ if(!passenger || passenger == target)
+ return false;
+
+ ((Vehicle*)target)->AddPassenger(passenger);
+
+ PSendSysMessage("Creature entered vehicle");
+ return true;
+}
+
+bool ChatHandler::HandleDebugSpawnVehicle(const char* args)
+{
+ if(!args)
+ return false;
+
+ char* e = strtok((char*)args, " ");
+ char* i = strtok(NULL, " ");
+
+ if (!e || !i)
+ return false;
+
+ uint32 entry = (uint32)atoi(e);
+ uint32 id = (uint32)atoi(i);
+
+ CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
+
+ if(!ci)
+ return false;
+
+ VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
+
+ if(!ve)
+ return false;
+
+ Vehicle *v = new Vehicle;
+ Map *map = m_session->GetPlayer()->GetMap();
+ if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam()))
+ {
+ delete v;
+ return false;
+ }
+
+ float px, py, pz;
+ m_session->GetPlayer()->GetClosePoint(px, py, pz, m_session->GetPlayer()->GetObjectSize());
+
+ v->Relocate(px, py, pz, m_session->GetPlayer()->GetOrientation());
+
+ if(!v->IsPositionValid())
+ {
+ sLog.outError("Vehicle (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ v->GetGUIDLow(), v->GetEntry(), v->GetPositionX(), v->GetPositionY());
+ delete v;
+ return false;
+ }
+
+ map->Add((Creature*)v);
+
+ return true;
+}
+
+bool ChatHandler::HandleDebugSendLargePacketCommand(const char* /*args*/)
+{
+ const char* stuffingString = "This is a dummy string to push the packet's size beyond 128000 bytes. ";
+ std::ostringstream ss;
+ while(ss.str().size() < 128000)
+ ss << stuffingString;
+ SendSysMessage(ss.str().c_str());
+ return true;
+}
+
+bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args)
+{
+ if(!args)
+ return false;
+
+ uint32 PhaseShift = atoi(args);
+ m_session->SendSetPhaseShift(PhaseShift);
+ return true;
+}
+
+bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
+{
+ if(!args)
+ return false;
+
+ char* e = strtok((char*)args, " ");
+ char* f = strtok(NULL, " ");
+
+ if (!e || !f)
+ return false;
+
+ uint32 guid = (uint32)atoi(e);
+ uint32 flag = (uint32)atoi(f);
+
+ Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
+
+ if(!i)
+ return false;
+
+ i->SetUInt32Value(ITEM_FIELD_FLAGS, flag);
+
+ return true;
+}
+
+//show animation
+bool ChatHandler::HandleDebugAnimCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 anim_id = atoi((char*)args);
+ m_session->GetPlayer()->HandleEmoteCommand(anim_id);
+ return true;
+}
diff --git a/src/game/DestinationHolder.cpp b/src/game/DestinationHolder.cpp
index 904509aeef4..f2158e3b5be 100644
--- a/src/game/DestinationHolder.cpp
+++ b/src/game/DestinationHolder.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/DestinationHolder.h b/src/game/DestinationHolder.h
index 4c259d0dfde..94e12a1757d 100644
--- a/src/game/DestinationHolder.h
+++ b/src/game/DestinationHolder.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/DestinationHolderImp.h b/src/game/DestinationHolderImp.h
index fcc2d946de8..384ad9621a3 100644
--- a/src/game/DestinationHolderImp.h
+++ b/src/game/DestinationHolderImp.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#ifndef TRINITY_DESTINATIONHOLDERIMP_H
#define TRINITY_DESTINATIONHOLDERIMP_H
-#include "Creature.h"
#include "MapManager.h"
#include "DestinationHolder.h"
@@ -85,24 +84,7 @@ DestinationHolder<TRAVELLER>::StartTravel(TRAVELLER &traveller, bool sendMove)
i_fromY = traveller.GetPositionY();
i_fromZ = traveller.GetPositionZ();
- float dx = i_destX - i_fromX;
- float dy = i_destY - i_fromY;
- float dz = i_destZ - i_fromZ;
-
- float dist;
- //Should be for Creature Flying and Swimming.
- if(traveller.GetTraveller().hasUnitState(UNIT_STAT_IN_FLIGHT))
- dist = sqrt((dx*dx) + (dy*dy) + (dz*dz));
- else //Walking on the ground
- dist = sqrt((dx*dx) + (dy*dy));
-
- float speed;
- if(traveller.GetTraveller().hasUnitState(UNIT_STAT_CHARGING))
- speed = SPEED_CHARGE * 0.001f;
- else
- speed = traveller.Speed() * 0.001f; // speed is in seconds so convert from second to millisecond
- i_totalTravelTime = static_cast<uint32>(dist/speed);
-
+ i_totalTravelTime = traveller.GetTotalTrevelTimeTo(i_destX,i_destY,i_destZ);
i_timeElapsed = 0;
if(sendMove)
traveller.MoveTo(i_destX, i_destY, i_destZ, i_totalTravelTime);
diff --git a/src/game/DuelHandler.cpp b/src/game/DuelHandler.cpp
index 58506f949e9..aa6563a3f98 100644
--- a/src/game/DuelHandler.cpp
+++ b/src/game/DuelHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,11 +21,9 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "Log.h"
#include "Opcodes.h"
#include "UpdateData.h"
-#include "MapManager.h"
#include "Player.h"
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp
index 801626d5a9b..d294886619c 100644
--- a/src/game/DynamicObject.cpp
+++ b/src/game/DynamicObject.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,16 +19,11 @@
*/
#include "Common.h"
-#include "GameObject.h"
#include "UpdateMask.h"
#include "Opcodes.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
#include "World.h"
#include "ObjectAccessor.h"
#include "Database/DatabaseEnv.h"
-#include "SpellAuras.h"
-#include "MapManager.h"
#include "GridNotifiers.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
@@ -38,7 +33,7 @@ DynamicObject::DynamicObject() : WorldObject()
m_objectType |= TYPEMASK_DYNAMICOBJECT;
m_objectTypeId = TYPEID_DYNAMICOBJECT;
// 2.3.2 - 0x58
- m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HASPOSITION);
+ m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION);
m_valuesCount = DYNAMICOBJECT_END;
}
@@ -58,8 +53,20 @@ void DynamicObject::RemoveFromWorld()
///- Remove the dynamicObject from the accessor
if(IsInWorld())
{
- ObjectAccessor::Instance().RemoveObject(this);
+ if(m_effIndex == 4)
+ {
+ if(Unit *caster = GetCaster())
+ {
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)caster)->SetViewpoint(this, false);
+ }
+ else
+ {
+ sLog.outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner");
+ }
+ }
WorldObject::RemoveFromWorld();
+ ObjectAccessor::Instance().RemoveObject(this);
}
}
@@ -67,12 +74,12 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
{
SetInstanceId(caster->GetInstanceId());
- WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetMapId());
+ WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetMapId(), caster->GetPhaseMask());
Relocate(x,y,z,0);
if(!IsPositionValid())
{
- sLog.outError("ERROR: DynamicObject (spell %u eff %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,effIndex,GetPositionX(),GetPositionY());
+ sLog.outError("DynamicObject (spell %u eff %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,effIndex,GetPositionX(),GetPositionY());
return false;
}
@@ -81,7 +88,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
SetUInt64Value( DYNAMICOBJECT_CASTER, caster->GetGUID() );
SetUInt32Value( DYNAMICOBJECT_BYTES, 0x00000001 );
SetUInt32Value( DYNAMICOBJECT_SPELLID, spellId );
- SetFloatValue( DYNAMICOBJECT_RADIUS, radius * 2);
+ SetFloatValue( DYNAMICOBJECT_RADIUS, radius * 2); //diameter?
SetFloatValue( DYNAMICOBJECT_POS_X, x );
SetFloatValue( DYNAMICOBJECT_POS_Y, y );
SetFloatValue( DYNAMICOBJECT_POS_Z, z );
@@ -139,6 +146,7 @@ void DynamicObject::Update(uint32 p_time)
void DynamicObject::Delete()
{
SendObjectDeSpawnAnim(GetGUID());
+ RemoveFromWorld();
AddObjectToRemoveList();
}
@@ -147,13 +155,12 @@ void DynamicObject::Delay(int32 delaytime)
m_aliveDuration -= delaytime;
for(AffectedSet::iterator iunit= m_affected.begin();iunit != m_affected.end();++iunit)
if (*iunit)
- (*iunit)->DelayAura(m_spellId, m_effIndex, delaytime);
+ (*iunit)->DelayAura(m_spellId, GetCaster()->GetGUID() , delaytime);
}
bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const
{
return IsInWorld() && u->IsInWorld()
- && (IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false)
- || GetCasterGUID() == u->GetGUID());
+ && (IsWithinDistInMap(u->m_seer,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false));
}
diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h
index 1bcd29998f8..714b639e552 100644
--- a/src/game/DynamicObject.h
+++ b/src/game/DynamicObject.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,14 +50,11 @@ class DynamicObject : public WorldObject
void Delay(int32 delaytime);
bool isVisibleForInState(Player const* u, bool inVisibleList) const;
- void Say(const char* text, uint32 language, uint64 TargetGuid) { MonsterSay(text,language,TargetGuid); }
- void Yell(const char* text, uint32 language, uint64 TargetGuid) { MonsterYell(text,language,TargetGuid); }
- void TextEmote(const char* text, uint64 TargetGuid) { MonsterTextEmote(text,TargetGuid); }
- void Whisper(const char* text, uint64 receiver) { MonsterWhisper(text,receiver); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
+ void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
GridReference<DynamicObject> &GetGridRef() { return m_gridRef; }
protected:
diff --git a/src/game/FleeingMovementGenerator.cpp b/src/game/FleeingMovementGenerator.cpp
index 87800d2edc1..8f9eb6073d5 100644
--- a/src/game/FleeingMovementGenerator.cpp
+++ b/src/game/FleeingMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -301,19 +301,26 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
if(!&owner)
return;
- Unit * fright = ObjectAccessor::GetUnit(owner, i_frightGUID);
- if(!fright)
- return;
-
_Init(owner);
owner.CastStop();
owner.addUnitState(UNIT_STAT_FLEEING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- i_caster_x = fright->GetPositionX();
- i_caster_y = fright->GetPositionY();
- i_caster_z = fright->GetPositionZ();
+
+ if(Unit * fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
+ {
+ i_caster_x = fright->GetPositionX();
+ i_caster_y = fright->GetPositionY();
+ i_caster_z = fright->GetPositionZ();
+ }
+ else
+ {
+ i_caster_x = owner.GetPositionX();
+ i_caster_y = owner.GetPositionY();
+ i_caster_z = owner.GetPositionZ();
+ }
+
i_only_forward = true;
i_cur_angle = 0.0f;
i_last_distance_from_caster = 0.0f;
diff --git a/src/game/FleeingMovementGenerator.h b/src/game/FleeingMovementGenerator.h
index 6a4f3593370..a6957545d41 100644
--- a/src/game/FleeingMovementGenerator.h
+++ b/src/game/FleeingMovementGenerator.h
@@ -1,7 +1,7 @@
/*
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
-* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "MovementGenerator.h"
#include "DestinationHolder.h"
#include "Traveller.h"
-#include "MapManager.h"
template<class T>
class TRINITY_DLL_SPEC FleeingMovementGenerator
diff --git a/src/game/FollowerRefManager.h b/src/game/FollowerRefManager.h
index 136fdbfeadb..093c85adcee 100644
--- a/src/game/FollowerRefManager.h
+++ b/src/game/FollowerRefManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/FollowerReference.cpp b/src/game/FollowerReference.cpp
index 44c8e8d55de..173f9881c54 100644
--- a/src/game/FollowerReference.cpp
+++ b/src/game/FollowerReference.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/FollowerReference.h b/src/game/FollowerReference.h
index 16fa880bcfe..3c0b3dc9e7c 100644
--- a/src/game/FollowerReference.h
+++ b/src/game/FollowerReference.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Formulas.h b/src/game/Formulas.h
index f54917be6f3..041c0621c74 100644
--- a/src/game/Formulas.h
+++ b/src/game/Formulas.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ namespace Trinity
}
namespace XP
{
- typedef enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
+ enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
inline uint32 GetGrayLevel(uint32 pl_level)
{
@@ -80,8 +80,17 @@ namespace Trinity
inline uint32 BaseGain(uint32 pl_level, uint32 mob_level, ContentLevels content)
{
- //TODO: need modifier for CONTENT_71_80 different from CONTENT_61_70?
- const uint32 nBaseExp = content == CONTENT_1_60 ? 45 : 235;
+ uint32 nBaseExp;
+ switch(content)
+ {
+ case CONTENT_1_60: nBaseExp = 45; break;
+ case CONTENT_61_70: nBaseExp = 235; break;
+ case CONTENT_71_80: nBaseExp = 580; break;
+ default:
+ sLog.outError("BaseGain: Unsupported content level %u",content);
+ nBaseExp = 45; break;
+ }
+
if( mob_level >= pl_level )
{
uint32 nLevelDiff = mob_level - pl_level;
@@ -118,66 +127,6 @@ namespace Trinity
return (uint32)(xp_gain*sWorld.getRate(RATE_XP_KILL));
}
- inline uint32 xp_Diff(uint32 lvl)
- {
- if( lvl < 29 )
- return 0;
- if( lvl == 29 )
- return 1;
- if( lvl == 30 )
- return 3;
- if( lvl == 31 )
- return 6;
- else
- return (5*(lvl-30));
- }
-
- inline uint32 mxp(uint32 lvl)
- {
- if (lvl < 60)
- {
- return (45 + (5*lvl));
- }
- else
- {
- return (235 + (5*lvl));
- }
- }
-
- inline uint32 xp_to_level(uint32 lvl)
- {
- uint32 xp = 0;
- if (lvl < 60)
- {
- xp = (8*lvl + xp_Diff(lvl)) * mxp(lvl);
- }
- else if (lvl == 60)
- {
- xp = (155 + mxp(lvl) * (1344 - 70 - ((69 - lvl) * (7 + (69 - lvl) * 8 - 1)/2)));
- }
- else if (lvl < 70)
- {
- xp = (155 + mxp(lvl) * (1344 - ((69-lvl) * (7 + (69 - lvl) * 8 - 1)/2)));
- }else
- {
- // level higher than 70 is not supported
- xp = (uint32)(779700 * (pow(sWorld.getRate(RATE_XP_PAST_70), (int32)lvl - 69)));
- return ((xp < 0x7fffffff) ? xp : 0x7fffffff);
- }
-
- // The XP to Level is always rounded to the nearest 100 points (50 rounded to high).
- xp = ((xp + 50) / 100) * 100; // use additional () for prevent free association operations in C++
-
- if ((lvl > 10) && (lvl < 60)) // compute discount added in 2.3.x
- {
- uint32 discount = (lvl < 28) ? (lvl - 10) : 18;
- xp = (xp * (100 - discount)) / 100; // apply discount
- xp = (xp / 100) * 100; // floor to hundreds
- }
-
- return xp;
- }
-
inline float xp_in_group_rate(uint32 count, bool isRaid)
{
if(isRaid)
diff --git a/src/game/GameEvent.cpp b/src/game/GameEventMgr.cpp
index ae2dc488b86..53d01529fb9 100644
--- a/src/game/GameEvent.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,9 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "GameEvent.h"
+#include "GameEventMgr.h"
#include "World.h"
#include "ObjectMgr.h"
+#include "PoolHandler.h"
#include "ProgressBar.h"
#include "Language.h"
#include "Log.h"
@@ -30,9 +31,9 @@
#include "Player.h"
#include "BattleGroundMgr.h"
-INSTANTIATE_SINGLETON_1(GameEvent);
+INSTANTIATE_SINGLETON_1(GameEventMgr);
-bool GameEvent::CheckOneGameEvent(uint16 entry) const
+bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
{
time_t currenttime = time(NULL);
// if the state is conditions or nextphase, then the event should be active
@@ -62,7 +63,7 @@ bool GameEvent::CheckOneGameEvent(uint16 entry) const
return false;
}
-uint32 GameEvent::NextCheck(uint16 entry) const
+uint32 GameEventMgr::NextCheck(uint16 entry) const
{
time_t currenttime = time(NULL);
@@ -96,7 +97,7 @@ uint32 GameEvent::NextCheck(uint16 entry) const
return delay;
}
-bool GameEvent::StartEvent( uint16 event_id, bool overwrite )
+bool GameEventMgr::StartEvent( uint16 event_id, bool overwrite )
{
if(mGameEvent[event_id].state == GAMEEVENT_NORMAL)
{
@@ -135,7 +136,7 @@ bool GameEvent::StartEvent( uint16 event_id, bool overwrite )
}
}
-void GameEvent::StopEvent( uint16 event_id, bool overwrite )
+void GameEventMgr::StopEvent( uint16 event_id, bool overwrite )
{
bool serverwide_evt = mGameEvent[event_id].state != GAMEEVENT_NORMAL;
@@ -167,7 +168,7 @@ void GameEvent::StopEvent( uint16 event_id, bool overwrite )
}
}
-void GameEvent::LoadFromDB()
+void GameEventMgr::LoadFromDB()
{
{
QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event");
@@ -186,54 +187,68 @@ void GameEvent::LoadFromDB()
mGameEvent.resize(max_event_id+1);
}
- QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,description,world_event FROM game_event");
+ QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event");
if( !result )
{
mGameEvent.clear();
- sLog.outString(">> Table game_event is empty:");
+ sLog.outString(">> Table game_event is empty!");
sLog.outString();
return;
}
uint32 count = 0;
- barGoLink bar( result->GetRowCount() );
- do
{
- ++count;
- Field *fields = result->Fetch();
+ barGoLink bar( result->GetRowCount() );
+ do
+ {
+ ++count;
+ Field *fields = result->Fetch();
- bar.step();
+ bar.step();
- uint16 event_id = fields[0].GetUInt16();
- if(event_id==0)
- {
- sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id);
- continue;
- }
+ uint16 event_id = fields[0].GetUInt16();
+ if(event_id==0)
+ {
+ sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id);
+ continue;
+ }
- GameEventData& pGameEvent = mGameEvent[event_id];
- uint64 starttime = fields[1].GetUInt64();
- pGameEvent.start = time_t(starttime);
- uint64 endtime = fields[2].GetUInt64();
- pGameEvent.end = time_t(endtime);
- pGameEvent.occurence = fields[3].GetUInt32();
- pGameEvent.length = fields[4].GetUInt32();
- pGameEvent.description = fields[5].GetCppString();
- pGameEvent.state = (GameEventState)(fields[6].GetUInt8());
- pGameEvent.nextstart = 0;
-
- if(pGameEvent.length==0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
- {
- sLog.outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id);
- continue;
- }
+ GameEventData& pGameEvent = mGameEvent[event_id];
+ uint64 starttime = fields[1].GetUInt64();
+ pGameEvent.start = time_t(starttime);
+ uint64 endtime = fields[2].GetUInt64();
+ pGameEvent.end = time_t(endtime);
+ pGameEvent.occurence = fields[3].GetUInt32();
+ pGameEvent.length = fields[4].GetUInt32();
+ pGameEvent.holiday_id = fields[5].GetUInt32();
- } while( result->NextRow() );
+ pGameEvent.state = (GameEventState)(fields[7].GetUInt8());
+ pGameEvent.nextstart = 0;
- sLog.outString();
- sLog.outString( ">> Loaded %u game events", count );
- delete result;
+ if(pGameEvent.length==0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
+ {
+ sLog.outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id);
+ continue;
+ }
+
+ if(pGameEvent.holiday_id)
+ {
+ if(!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
+ {
+ sLog.outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id);
+ pGameEvent.holiday_id = 0;
+ }
+ }
+
+ pGameEvent.description = fields[6].GetCppString();
+
+ } while( result->NextRow() );
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u game events", count );
+ }
// load game event saves
// 0 1 2
@@ -346,8 +361,8 @@ void GameEvent::LoadFromDB()
count = 0;
if( !result )
{
- barGoLink bar2(1);
- bar2.step();
+ barGoLink bar(1);
+ bar.step();
sLog.outString();
sLog.outString(">> Loaded %u creatures in game events", count );
@@ -355,12 +370,12 @@ void GameEvent::LoadFromDB()
else
{
- barGoLink bar2( result->GetRowCount() );
+ barGoLink bar( result->GetRowCount() );
do
{
Field *fields = result->Fetch();
- bar2.step();
+ bar.step();
uint32 guid = fields[0].GetUInt32();
int16 event_id = fields[1].GetInt16();
@@ -378,9 +393,10 @@ void GameEvent::LoadFromDB()
crelist.push_back(guid);
} while( result->NextRow() );
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u creatures in game events", count );
- delete result;
}
mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1);
@@ -391,8 +407,8 @@ void GameEvent::LoadFromDB()
count = 0;
if( !result )
{
- barGoLink bar3(1);
- bar3.step();
+ barGoLink bar(1);
+ bar.step();
sLog.outString();
sLog.outString(">> Loaded %u gameobjects in game events", count );
@@ -400,12 +416,12 @@ void GameEvent::LoadFromDB()
else
{
- barGoLink bar3( result->GetRowCount() );
+ barGoLink bar( result->GetRowCount() );
do
{
Field *fields = result->Fetch();
- bar3.step();
+ bar.step();
uint32 guid = fields[0].GetUInt32();
int16 event_id = fields[1].GetInt16();
@@ -423,10 +439,10 @@ void GameEvent::LoadFromDB()
golist.push_back(guid);
} while( result->NextRow() );
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u gameobjects in game events", count );
-
- delete result;
}
mGameEventModelEquip.resize(mGameEvent.size());
@@ -439,8 +455,8 @@ void GameEvent::LoadFromDB()
count = 0;
if( !result )
{
- barGoLink bar3(1);
- bar3.step();
+ barGoLink bar(1);
+ bar.step();
sLog.outString();
sLog.outString(">> Loaded %u model/equipment changes in game events", count );
@@ -448,12 +464,12 @@ void GameEvent::LoadFromDB()
else
{
- barGoLink bar3( result->GetRowCount() );
+ barGoLink bar( result->GetRowCount() );
do
{
Field *fields = result->Fetch();
- bar3.step();
+ bar.step();
uint32 guid = fields[0].GetUInt32();
uint16 event_id = fields[1].GetUInt16();
@@ -483,10 +499,10 @@ void GameEvent::LoadFromDB()
equiplist.push_back(std::pair<uint32, ModelEquip>(guid, newModelEquipSet));
} while( result->NextRow() );
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u model/equipment changes in game events", count );
-
- delete result;
}
mGameEventCreatureQuests.resize(mGameEvent.size());
@@ -496,8 +512,8 @@ void GameEvent::LoadFromDB()
count = 0;
if( !result )
{
- barGoLink bar3(1);
- bar3.step();
+ barGoLink bar(1);
+ bar.step();
sLog.outString();
sLog.outString(">> Loaded %u quests additions in game events", count );
@@ -505,12 +521,12 @@ void GameEvent::LoadFromDB()
else
{
- barGoLink bar3( result->GetRowCount() );
+ barGoLink bar( result->GetRowCount() );
do
{
Field *fields = result->Fetch();
- bar3.step();
+ bar.step();
uint32 id = fields[0].GetUInt32();
uint32 quest = fields[1].GetUInt32();
uint16 event_id = fields[2].GetUInt16();
@@ -569,10 +585,10 @@ void GameEvent::LoadFromDB()
questlist.push_back(QuestRelation(id, quest));
} while( result->NextRow() );
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u quests additions in game events", count );
-
- delete result;
}
// Load quest to (event,condition) mapping
@@ -913,9 +929,64 @@ void GameEvent::LoadFromDB()
delete result;
}
+
+ ////////////////////////
+ // GameEventPool
+ ////////////////////////
+
+ mGameEventPoolIds.resize(mGameEvent.size()*2-1);
+ // 1 2
+ result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.event "
+ "FROM pool_template JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry");
+
+ count = 0;
+ if( !result )
+ {
+ barGoLink bar2(1);
+ bar2.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u pools in game events", count );
+ }
+ else
+ {
+
+ barGoLink bar2( result->GetRowCount() );
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar2.step();
+
+ uint32 entry = fields[0].GetUInt16();
+ int16 event_id = fields[1].GetInt16();
+
+ int32 internal_event_id = mGameEvent.size() + event_id - 1;
+
+ if(internal_event_id < 0 || internal_event_id >= mGameEventPoolIds.size())
+ {
+ sLog.outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
+ continue;
+ }
+
+ if (!poolhandler.CheckPool(entry))
+ {
+ sLog.outErrorDb("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;
+ }
+
+ ++count;
+ IdList& poollist = mGameEventPoolIds[internal_event_id];
+ poollist.push_back(entry);
+
+ } while( result->NextRow() );
+ sLog.outString();
+ sLog.outString( ">> Loaded %u pools in game events", count );
+ delete result;
+ }
}
-uint32 GameEvent::GetNPCFlag(Creature * cr)
+uint32 GameEventMgr::GetNPCFlag(Creature * cr)
{
uint32 mask = 0;
uint32 guid = cr->GetDBTableGUIDLow();
@@ -932,7 +1003,7 @@ uint32 GameEvent::GetNPCFlag(Creature * cr)
return mask;
}
-uint32 GameEvent::GetNpcTextId(uint32 guid)
+uint32 GameEventMgr::GetNpcTextId(uint32 guid)
{
GuidEventNpcGossipIdMap::iterator itr = mNPCGossipIds.find(guid);
if(itr != mNPCGossipIds.end())
@@ -941,7 +1012,7 @@ uint32 GameEvent::GetNpcTextId(uint32 guid)
return 0;
}
-uint32 GameEvent::Initialize() // return the next event delay in ms
+uint32 GameEventMgr::Initialize() // return the next event delay in ms
{
m_ActiveEvents.clear();
uint32 delay = Update();
@@ -950,7 +1021,7 @@ uint32 GameEvent::Initialize() // return the next e
return delay;
}
-uint32 GameEvent::Update() // return the next event delay in ms
+uint32 GameEventMgr::Update() // return the next event delay in ms
{
time_t currenttime = time(NULL);
uint32 nextEventDelay = max_ge_check_delay; // 1 day
@@ -1017,10 +1088,10 @@ uint32 GameEvent::Update() // return the next e
for(std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
StopEvent(*itr);
sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
- return (nextEventDelay + 1) * 1000; // Add 1 second to be sure event has started/stopped at next call
+ return (nextEventDelay + 1) * IN_MILISECONDS; // Add 1 second to be sure event has started/stopped at next call
}
-void GameEvent::UnApplyEvent(uint16 event_id)
+void GameEventMgr::UnApplyEvent(uint16 event_id)
{
sLog.outString("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str());
// un-spawn positive event tagged objects
@@ -1040,7 +1111,7 @@ void GameEvent::UnApplyEvent(uint16 event_id)
UpdateBattleGroundSettings();
}
-void GameEvent::ApplyNewEvent(uint16 event_id)
+void GameEventMgr::ApplyNewEvent(uint16 event_id)
{
switch(sWorld.getConfig(CONFIG_EVENT_ANNOUNCE))
{
@@ -1070,7 +1141,7 @@ void GameEvent::ApplyNewEvent(uint16 event_id)
UpdateBattleGroundSettings();
}
-void GameEvent::UpdateEventNPCFlags(uint16 event_id)
+void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
{
// go through the creatures whose npcflags are changed in the event
for(NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr)
@@ -1096,7 +1167,7 @@ void GameEvent::UpdateEventNPCFlags(uint16 event_id)
}
}
-void GameEvent::UpdateBattleGroundSettings()
+void GameEventMgr::UpdateBattleGroundSettings()
{
uint32 mask = 0;
for(ActiveEvents::const_iterator itr = m_ActiveEvents.begin(); itr != m_ActiveEvents.end(); ++itr )
@@ -1104,7 +1175,7 @@ void GameEvent::UpdateBattleGroundSettings()
sBattleGroundMgr.SetHolidayWeekends(mask);
}
-void GameEvent::UpdateEventNPCVendor(uint16 event_id, bool activate)
+void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate)
{
for(NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr)
{
@@ -1115,13 +1186,13 @@ void GameEvent::UpdateEventNPCVendor(uint16 event_id, bool activate)
}
}
-void GameEvent::GameEventSpawn(int16 event_id)
+void GameEventMgr::GameEventSpawn(int16 event_id)
{
int32 internal_event_id = mGameEvent.size() + event_id - 1;
if(internal_event_id < 0 || internal_event_id >= mGameEventCreatureGuids.size())
{
- sLog.outError("GameEvent::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size());
+ sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size());
return;
}
@@ -1154,7 +1225,7 @@ void GameEvent::GameEventSpawn(int16 event_id)
if(internal_event_id < 0 || internal_event_id >= mGameEventGameobjectGuids.size())
{
- sLog.outError("GameEvent::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size());
+ sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size());
return;
}
@@ -1185,15 +1256,26 @@ void GameEvent::GameEventSpawn(int16 event_id)
}
}
}
+
+ if(internal_event_id < 0 || internal_event_id >= mGameEventPoolIds.size())
+ {
+ sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size());
+ return;
+ }
+
+ for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
+ {
+ poolhandler.SpawnPool(*itr);
+ }
}
-void GameEvent::GameEventUnspawn(int16 event_id)
+void GameEventMgr::GameEventUnspawn(int16 event_id)
{
int32 internal_event_id = mGameEvent.size() + event_id - 1;
if(internal_event_id < 0 || internal_event_id >= mGameEventCreatureGuids.size())
{
- sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size());
+ sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %u)",internal_event_id,mGameEventCreatureGuids.size());
return;
}
@@ -1217,7 +1299,7 @@ void GameEvent::GameEventUnspawn(int16 event_id)
if(internal_event_id < 0 || internal_event_id >= mGameEventGameobjectGuids.size())
{
- sLog.outError("GameEvent::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size());
+ sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %u)",internal_event_id,mGameEventGameobjectGuids.size());
return;
}
@@ -1235,9 +1317,19 @@ void GameEvent::GameEventUnspawn(int16 event_id)
pGameobject->AddObjectToRemoveList();
}
}
+ if(internal_event_id < 0 || internal_event_id >= mGameEventPoolIds.size())
+ {
+ sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %i (size: %u)",internal_event_id,mGameEventPoolIds.size());
+ return;
+ }
+
+ for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
+ {
+ poolhandler.DespawnPool(*itr);
+ }
}
-void GameEvent::ChangeEquipOrModel(int16 event_id, bool activate)
+void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
{
for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr)
{
@@ -1316,7 +1408,7 @@ void GameEvent::ChangeEquipOrModel(int16 event_id, bool activate)
}
}
-bool GameEvent::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
+bool GameEventMgr::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
{
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
{
@@ -1330,7 +1422,7 @@ bool GameEvent::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_
return false;
}
-bool GameEvent::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
+bool GameEventMgr::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
{
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
{
@@ -1343,7 +1435,7 @@ bool GameEvent::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 even
}
return false;
}
-bool GameEvent::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event_id)
+bool GameEventMgr::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event_id)
{
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
{
@@ -1359,7 +1451,7 @@ bool GameEvent::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event_id
}
return false;
}
-bool GameEvent::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
+bool GameEventMgr::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
{
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
{
@@ -1376,7 +1468,7 @@ bool GameEvent::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
return false;
}
-void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate)
+void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
{
QuestRelList::iterator itr;
for (itr = mGameEventCreatureQuests[event_id].begin();itr != mGameEventCreatureQuests[event_id].end();++itr)
@@ -1430,12 +1522,12 @@ void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate)
}
}}
-GameEvent::GameEvent()
+GameEventMgr::GameEventMgr()
{
isSystemInit = false;
}
-void GameEvent::HandleQuestComplete(uint32 quest_id)
+void GameEventMgr::HandleQuestComplete(uint32 quest_id)
{
// translate the quest to event and condition
QuestIdToEventConditionMap::iterator itr = mQuestToEventConditions.find(quest_id);
@@ -1481,7 +1573,7 @@ void GameEvent::HandleQuestComplete(uint32 quest_id)
}
}
-bool GameEvent::CheckOneGameEventConditions(uint16 event_id)
+bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
{
for(std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
if(itr->second.done < itr->second.reqNum)
@@ -1498,7 +1590,7 @@ bool GameEvent::CheckOneGameEventConditions(uint16 event_id)
return true;
}
-void GameEvent::SaveWorldEventStateToDB(uint16 event_id)
+void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id)
{
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM game_event_save WHERE event_id = '%u'",event_id);
@@ -1509,7 +1601,7 @@ void GameEvent::SaveWorldEventStateToDB(uint16 event_id)
CharacterDatabase.CommitTransaction();
}
-void GameEvent::HandleWorldEventGossip(Player *plr, Creature *c)
+void GameEventMgr::HandleWorldEventGossip(Player *plr, Creature *c)
{
// this function is used to send world state update before sending gossip menu
// find the npc's gossip id (if set) in an active game event
@@ -1521,7 +1613,7 @@ void GameEvent::HandleWorldEventGossip(Player *plr, Creature *c)
SendWorldStateUpdate(plr, itr->second.first);
}
-void GameEvent::SendWorldStateUpdate(Player * plr, uint16 event_id)
+void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id)
{
std::map<uint32,GameEventFinishCondition>::iterator itr;
for(itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr)
@@ -1533,3 +1625,14 @@ void GameEvent::SendWorldStateUpdate(Player * plr, uint16 event_id)
}
}
+TRINITY_DLL_SPEC bool IsHolidayActive( HolidayIds id )
+{
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
+
+ for(GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
+ if(events[id].holiday_id==id)
+ return true;
+
+ return false;
+}
diff --git a/src/game/GameEvent.h b/src/game/GameEventMgr.h
index 9f69aa9e6ea..a7b52f0ab72 100644
--- a/src/game/GameEvent.h
+++ b/src/game/GameEventMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,12 +18,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef TRINITY_GAMEEVENT_H
-#define TRINITY_GAMEEVENT_H
+#ifndef TRINITY_GAMEEVENT_MGR_H
+#define TRINITY_GAMEEVENT_MGR_H
+#include "Common.h"
+#include "SharedDefines.h"
#include "Platform/Define.h"
-#include "Creature.h"
-#include "GameObject.h"
+#include "Policies/Singleton.h"
#define max_ge_check_delay 86400 // 1 day in seconds
@@ -54,11 +55,12 @@ struct GameEventQuestToEventConditionNum
struct GameEventData
{
GameEventData() : start(1),end(0),nextstart(0),occurence(0),length(0),state(GAMEEVENT_NORMAL) {}
- time_t start; // occurs after this time
- time_t end; // occurs before this time
- time_t nextstart; // after this time the follow-up events count this phase completed
- uint32 occurence; // time between end and start
- uint32 length; // length of the event (minutes) after finishing all conditions
+ time_t start; // occurs after this time
+ time_t end; // occurs before this time
+ time_t nextstart; // after this time the follow-up events count this phase completed
+ uint32 occurence; // time between end and start
+ uint32 length; // length of the event (minutes) after finishing all conditions
+ uint32 holiday_id;
GameEventState state; // state of the game event, these are saved into the game_event table on change!
std::map<uint32 /*condition id*/, GameEventFinishCondition> conditions; // conditions to finish
std::set<uint16 /*gameevent id*/> prerequisite_events; // events that must be completed before starting this event
@@ -85,11 +87,13 @@ struct NPCVendorEntry
};
class Player;
-class GameEvent
+class Creature;
+
+class GameEventMgr
{
public:
- GameEvent();
- ~GameEvent() {};
+ GameEventMgr();
+ ~GameEventMgr() {};
typedef std::set<uint16> ActiveEvents;
typedef std::vector<GameEventData> GameEventDataMap;
ActiveEvents const& GetActiveEventList() const { return m_ActiveEvents; }
@@ -127,7 +131,9 @@ class GameEvent
bool hasGameObjectActiveEventExcept(uint32 go_guid, uint16 event_id);
protected:
typedef std::list<uint32> GuidList;
+ typedef std::list<uint16> IdList;
typedef std::vector<GuidList> GameEventGuidMap;
+ typedef std::vector<IdList> GameEventIdMap;
typedef std::pair<uint32, ModelEquip> ModelEquipPair;
typedef std::list<ModelEquipPair> ModelEquipList;
typedef std::vector<ModelEquipList> GameEventModelEquipMap;
@@ -149,6 +155,7 @@ class GameEvent
GameEventModelEquipMap mGameEventModelEquip;
GameEventGuidMap mGameEventCreatureGuids;
GameEventGuidMap mGameEventGameobjectGuids;
+ GameEventIdMap mGameEventPoolIds;
GameEventDataMap mGameEvent;
GameEventBitmask mGameEventBattleGroundHolidays;
QuestIdToEventConditionMap mQuestToEventConditions;
@@ -158,6 +165,9 @@ class GameEvent
bool isSystemInit;
};
-#define gameeventmgr Trinity::Singleton<GameEvent>::Instance()
+#define gameeventmgr Trinity::Singleton<GameEventMgr>::Instance()
+
+TRINITY_DLL_SPEC bool IsHolidayActive(HolidayIds id);
+
#endif
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index d1bb0362872..a0a44c22733 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,15 +22,14 @@
#include "QuestDef.h"
#include "GameObject.h"
#include "ObjectMgr.h"
+#include "PoolHandler.h"
#include "SpellMgr.h"
#include "Spell.h"
#include "UpdateMask.h"
#include "Opcodes.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "World.h"
#include "Database/DatabaseEnv.h"
-#include "MapManager.h"
#include "LootMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
@@ -46,7 +45,7 @@ GameObject::GameObject() : WorldObject()
m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT;
// 2.3.2 - 0x58
- m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HASPOSITION);
+ m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION);
m_valuesCount = GAMEOBJECT_END;
m_respawnTime = 0;
@@ -64,9 +63,9 @@ GameObject::GameObject() : WorldObject()
GameObject::~GameObject()
{
- if(m_uint32Values) // field array can be not exist if GameOBject not loaded
+ /*if(m_uint32Values) // field array can be not exist if GameOBject not loaded
{
- // crash possible at access to deleted GO in Unit::m_gameobj
+ // Possible crash at access to deleted GO in Unit::m_gameobj
uint64 owner_guid = GetOwnerGUID();
if(owner_guid)
{
@@ -76,7 +75,7 @@ GameObject::~GameObject()
else if(!IS_PLAYER_GUID(owner_guid))
sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
}
- }
+ }*/
}
void GameObject::AddToWorld()
@@ -94,20 +93,30 @@ void GameObject::RemoveFromWorld()
///- Remove the gameobject from the accessor
if(IsInWorld())
{
- ObjectAccessor::Instance().RemoveObject(this);
+ // Possible crash at access to deleted GO in Unit::m_gameobj
+ if(uint64 owner_guid = GetOwnerGUID())
+ {
+ Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid);
+ if(owner)
+ owner->RemoveGameObject(this,false);
+ else if(!IS_PLAYER_GUID(owner_guid))
+ sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid));
+ }
WorldObject::RemoveFromWorld();
+ ObjectAccessor::Instance().RemoveObject(this);
}
}
-bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state, uint32 ArtKit)
+bool GameObject::Create(uint32 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, uint32 go_state, uint32 ArtKit)
{
Relocate(x,y,z,ang);
SetMapId(map->GetId());
SetInstanceId(map->GetInstanceId());
+ SetPhaseMask(phaseMask,false);
if(!IsPositionValid())
{
- sLog.outError("ERROR: Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
+ sLog.outError("Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
return false;
}
@@ -131,19 +140,18 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float
SetFloatValue(GAMEOBJECT_POS_X, x);
SetFloatValue(GAMEOBJECT_POS_Y, y);
SetFloatValue(GAMEOBJECT_POS_Z, z);
- SetFloatValue(GAMEOBJECT_FACING, ang); //this is not facing angle
- SetFloatValue (GAMEOBJECT_ROTATION, rotation0);
- SetFloatValue (GAMEOBJECT_ROTATION+1, rotation1);
- SetFloatValue (GAMEOBJECT_ROTATION+2, rotation2);
- SetFloatValue (GAMEOBJECT_ROTATION+3, rotation3);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1);
+
+ UpdateRotationFields(rotation2,rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3
SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
- SetUInt32Value(OBJECT_FIELD_ENTRY, goinfo->id);
+ SetEntry(goinfo->id);
SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId);
@@ -152,7 +160,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float
SetGoAnimProgress(animprogress);
- SetUInt32Value (GAMEOBJECT_ARTKIT, ArtKit);
+ SetByteValue(GAMEOBJECT_BYTES_1, 2, ArtKit);
// Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22)
if (goinfo->type == GAMEOBJECT_TYPE_SPELLCASTER)
@@ -270,7 +278,11 @@ void GameObject::Update(uint32 /*p_time*/)
return;
}
// respawn timer
- MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
+ uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
+ if (poolid)
+ poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
+ else
+ GetMap()->Add(this);
break;
}
}
@@ -316,18 +328,18 @@ void GameObject::Update(uint32 /*p_time*/)
if(owner && NeedDespawn) // hunter trap
{
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, owner, radius);
- Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> checker(ok, u_check);
+ Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> checker(this, ok, u_check);
CellLock<GridReadGuard> cell_lock(cell, p);
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
- cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
+ cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
// or unfriendly player/pet
if(!ok)
{
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
- cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
+ cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
}
}
else // environmental trap
@@ -336,13 +348,13 @@ void GameObject::Update(uint32 /*p_time*/)
// affect only players
Player* p_ok = NULL;
- Trinity::AnyPlayerInObjectRangeCheck p_check(this, radius);
- Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> checker(p_ok, p_check);
+ MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius);
+ MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck> checker(this,p_ok, p_check);
CellLock<GridReadGuard> cell_lock(cell, p);
TypeContainerVisitor<Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
- cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
+ cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
ok = p_ok;
}
@@ -350,8 +362,8 @@ void GameObject::Update(uint32 /*p_time*/)
{
//Unit *caster = owner ? owner : ok;
- //caster->CastSpell(ok, goInfo->trap.spellId, true);
CastSpell(ok, goInfo->trap.spellId);
+ //caster->CastSpell(ok, goInfo->trap.spellId, true, 0, 0, GetGUID());
m_cooldownTime = time(NULL) + 4; // 4 seconds
if(NeedDespawn)
@@ -401,7 +413,7 @@ void GameObject::Update(uint32 /*p_time*/)
for (; it != end; it++)
{
Unit* owner = Unit::GetUnit(*this, uint64(*it));
- if (owner) owner->CastSpell(owner, spellId, false);
+ if (owner) owner->CastSpell(owner, spellId, false, 0, 0, GetGUID());
}
m_unique_users.clear();
@@ -420,7 +432,7 @@ void GameObject::Update(uint32 /*p_time*/)
//burning flags in some battlegrounds, if you find better condition, just add it
if (GetGoAnimProgress() > 0)
{
- SendObjectDeSpawnAnim(this->GetGUID());
+ SendObjectDeSpawnAnim(GetGUID());
//reset flags
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
}
@@ -457,7 +469,7 @@ void GameObject::Refresh()
return;
if(isSpawned())
- MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
+ GetMap()->Add(this);
}
void GameObject::AddUniqueUse(Player* player)
@@ -473,21 +485,26 @@ void GameObject::Delete()
SetGoState(1);
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
- AddObjectToRemoveList();
+ uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
+ if (poolid)
+ poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
+ else
+ AddObjectToRemoveList();
}
-void GameObject::getFishLoot(Loot *fishloot)
+void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
{
fishloot->clear();
- uint32 subzone = GetAreaId();
+ uint32 zone, subzone;
+ GetZoneAndAreaId(zone,subzone);
// if subzone loot exist use it
if(LootTemplates_Fishing.HaveLootFor(subzone))
- fishloot->FillLoot(subzone, LootTemplates_Fishing, NULL);
+ fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner,true);
// else use zone loot
else
- fishloot->FillLoot(GetZoneId(), LootTemplates_Fishing, NULL);
+ fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true);
}
void GameObject::SaveToDB()
@@ -501,10 +518,10 @@ void GameObject::SaveToDB()
return;
}
- SaveToDB(GetMapId(), data->spawnMask);
+ SaveToDB(GetMapId(), data->spawnMask, data->phaseMask);
}
-void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask)
+void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
{
const GameObjectInfo *goI = GetGOInfo();
@@ -519,38 +536,40 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask)
// data->guid = guid don't must be update at save
data.id = GetEntry();
data.mapid = mapid;
+ data.phaseMask = phaseMask;
data.posX = GetFloatValue(GAMEOBJECT_POS_X);
data.posY = GetFloatValue(GAMEOBJECT_POS_Y);
data.posZ = GetFloatValue(GAMEOBJECT_POS_Z);
data.orientation = GetFloatValue(GAMEOBJECT_FACING);
- data.rotation0 = GetFloatValue(GAMEOBJECT_ROTATION+0);
- data.rotation1 = GetFloatValue(GAMEOBJECT_ROTATION+1);
- data.rotation2 = GetFloatValue(GAMEOBJECT_ROTATION+2);
- data.rotation3 = GetFloatValue(GAMEOBJECT_ROTATION+3);
+ 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.spawntimesecs = m_spawnedByDefault ? m_respawnDelayTime : -(int32)m_respawnDelayTime;
data.animprogress = GetGoAnimProgress();
data.go_state = GetGoState();
data.spawnMask = spawnMask;
- data.ArtKit = GetUInt32Value (GAMEOBJECT_ARTKIT);
+ data.ArtKit = GetGoArtKit();
// updated in DB
std::ostringstream ss;
ss << "INSERT INTO gameobject VALUES ( "
<< m_DBTableGuid << ", "
- << GetUInt32Value (OBJECT_FIELD_ENTRY) << ", "
+ << GetEntry() << ", "
<< mapid << ", "
- << (uint32)spawnMask << ", "
+ << uint32(spawnMask) << "," // cast to prevent save as symbol
+ << uint16(GetPhaseMask()) << "," // prevent out of range error
<< GetFloatValue(GAMEOBJECT_POS_X) << ", "
<< GetFloatValue(GAMEOBJECT_POS_Y) << ", "
<< GetFloatValue(GAMEOBJECT_POS_Z) << ", "
<< GetFloatValue(GAMEOBJECT_FACING) << ", "
- << GetFloatValue(GAMEOBJECT_ROTATION) << ", "
- << GetFloatValue(GAMEOBJECT_ROTATION+1) << ", "
- << GetFloatValue(GAMEOBJECT_ROTATION+2) << ", "
- << GetFloatValue(GAMEOBJECT_ROTATION+3) << ", "
+ << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ", "
+ << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ", "
+ << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ", "
+ << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ", "
<< m_respawnDelayTime << ", "
- << GetGoAnimProgress() << ", "
- << GetGoState() << ")";
+ << (uint32)GetGoAnimProgress() << ", "
+ << (uint32)GetGoState() << ")";
WorldDatabase.BeginTransaction();
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
@@ -564,12 +583,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
if( !data )
{
- sLog.outErrorDb("ERROR: Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
+ sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
return false;
}
uint32 entry = data->id;
- uint32 map_id = data->mapid;
+ //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;
@@ -587,40 +607,37 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
m_DBTableGuid = guid;
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
- if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, ArtKit) )
+ if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, ArtKit) )
return false;
- switch(GetGOInfo()->type)
+ if(!GetDespawnPossibility())
+ {
+ SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
+ m_spawnedByDefault = true;
+ m_respawnDelayTime = 0;
+ m_respawnTime = 0;
+ }
+ else
{
- case GAMEOBJECT_TYPE_DOOR:
- case GAMEOBJECT_TYPE_BUTTON:
- /* this code (in comment) isn't correct because in battlegrounds we need despawnable doors and buttons, pls remove
- SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
+ if(data->spawntimesecs >= 0)
+ {
m_spawnedByDefault = true;
- m_respawnDelayTime = 0;
- m_respawnTime = 0;
- break;*/
- default:
- if(data->spawntimesecs >= 0)
- {
- m_spawnedByDefault = true;
- m_respawnDelayTime = data->spawntimesecs;
- m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
+ m_respawnDelayTime = data->spawntimesecs;
+ m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
- // ready to respawn
- if(m_respawnTime && m_respawnTime <= time(NULL))
- {
- m_respawnTime = 0;
- objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
- }
- }
- else
+ // ready to respawn
+ if(m_respawnTime && m_respawnTime <= time(NULL))
{
- m_spawnedByDefault = false;
- m_respawnDelayTime = -data->spawntimesecs;
m_respawnTime = 0;
+ objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
}
- break;
+ }
+ else
+ {
+ m_spawnedByDefault = false;
+ m_respawnDelayTime = -data->spawntimesecs;
+ m_respawnTime = 0;
+ }
}
return true;
@@ -730,14 +747,10 @@ bool GameObject::isVisibleForInState(Player const* u, bool inVisibleList) const
if(owner && u->IsHostileTo(owner) && !canDetectTrap(u, GetDistance(u)))
return false;
}
-
- // Smuggled Mana Cell required 10 invisibility type detection/state
- if(GetEntry()==187039 && ((u->m_detectInvisibilityMask | u->m_invisibilityMask) & (1<<10))==0)
- return false;
}
// check distance
- return IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject() +
+ return IsWithinDistInMap(u->m_seer,World::GetMaxVisibleDistanceForObject() +
(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false);
}
@@ -816,7 +829,20 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target)
if(!trapSpell) // checked at load already
return;
- float range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(trapSpell->rangeIndex));
+ float range;
+ SpellRangeEntry const * srentry = sSpellRangeStore.LookupEntry(trapSpell->rangeIndex);
+ //get owner to check hostility of GameObject
+ if (GetSpellMaxRangeForHostile(srentry) == GetSpellMaxRangeForHostile(srentry))
+ range = GetSpellMaxRangeForHostile(srentry);
+ else
+ {
+ Unit * owner=GetOwner();
+ if (owner)
+ range = owner->GetSpellMaxRangeForTarget(target, srentry);
+ else
+ //if no owner assume that object is hostile to target
+ range = GetSpellMaxRangeForHostile(srentry);
+ }
// search nearest linked GO
GameObject* trapGO = NULL;
@@ -826,18 +852,18 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target)
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
- Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(trapGO,go_check);
+ MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
+ MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO,go_check);
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
+ cell_lock->Visit(cell_lock, object_checker, *GetMap());
}
// found correct GO
// FIXME: when GO casting will be implemented trap must cast spell to target
if(trapGO)
- target->CastSpell(target,trapSpell,true);
+ target->CastSpell(target,trapSpell,true, 0, 0, GetGUID());
}
GameObject* GameObject::LookupFishingHoleAround(float range)
@@ -847,13 +873,13 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::NearestGameObjectFishingHole u_check(*this, range);
- Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole> checker(ok, u_check);
+ MaNGOS::NearestGameObjectFishingHole u_check(*this, range);
+ MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole> checker(this, ok, u_check);
CellLock<GridReadGuard> cell_lock(cell, p);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
- cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
+ cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
return ok;
}
@@ -873,9 +899,9 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore)
}
-void GameObject::SetGoArtKit(uint32 kit)
+void GameObject::SetGoArtKit(uint8 kit)
{
- SetUInt32Value(GAMEOBJECT_ARTKIT, kit);
+ SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
GameObjectData *data = const_cast<GameObjectData*>(objmgr.GetGOData(m_DBTableGuid));
if(data)
data->ArtKit = kit;
@@ -899,6 +925,7 @@ void GameObject::Use(Unit* user)
// by default spell caster is user
Unit* spellCaster = user;
uint32 spellId = 0;
+ bool triggered = false;
switch(GetGoType())
{
@@ -980,7 +1007,7 @@ void GameObject::Use(Unit* user)
// fallback, will always work
player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
}
- player->SetStandState(PLAYER_STATE_SIT_LOW_CHAIR+info->chair.height);
+ player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height);
return;
}
//big gun, its a spell/aura
@@ -1020,12 +1047,9 @@ void GameObject::Use(Unit* user)
Player* player = (Player*)user;
- if(info->camera.cinematicId)
- {
- WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
- data << info->camera.cinematicId;
- player->GetSession()->SendPacket(&data);
- }
+ if (info->camera.cinematicId)
+ player->SendCinematicStart(info->camera.cinematicId);
+
return;
}
//fishing bobber
@@ -1047,11 +1071,12 @@ void GameObject::Use(Unit* user)
// 2) if skill == base_zone_skill => 5% chance
// 3) chance is linear dependence from (base_zone_skill-skill)
- uint32 subzone = GetAreaId();
+ uint32 zone, subzone;
+ GetZoneAndAreaId(zone,subzone);
int32 zone_skill = objmgr.GetFishingBaseSkillLevel( subzone );
if(!zone_skill)
- zone_skill = objmgr.GetFishingBaseSkillLevel( GetZoneId() );
+ zone_skill = objmgr.GetFishingBaseSkillLevel( zone );
//provide error, no fishable zone or area should be 0
if(!zone_skill)
@@ -1076,6 +1101,7 @@ void GameObject::Use(Unit* user)
if (ok)
{
player->SendLoot(ok->GetGUID(),LOOT_FISHINGHOLE);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, ok->GetGOInfo()->id);
SetLootState(GO_JUST_DEACTIVATED);
}
else
@@ -1142,6 +1168,13 @@ void GameObject::Use(Unit* user)
return;
spellId = info->summoningRitual.spellId;
+ if(spellId==62330) // GO store not existed spell, replace by expected
+ {
+ // spell have reagent and mana cost but it not expected use its
+ // it triggered spell in fact casted at currently channeled GO
+ spellId = 61993;
+ triggered = true;
+ }
// finish spell
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
@@ -1199,7 +1232,10 @@ void GameObject::Use(Unit* user)
if (level < info->meetingstone.minLevel || level > info->meetingstone.maxLevel)
return;
- spellId = 23598;
+ if(info->id==194097)
+ spellId = 61994; // Ritual of Summoning
+ else
+ spellId = 59782; // Summoning Stone Effect
break;
}
@@ -1211,7 +1247,7 @@ void GameObject::Use(Unit* user)
Player* player = (Player*)user;
- if( player->isAllowUseBattleGroundObject() )
+ if( player->CanUseBattleGroundObject() )
{
// in battleground check
BattleGround *bg = player->GetBattleGround();
@@ -1236,7 +1272,7 @@ void GameObject::Use(Unit* user)
Player* player = (Player*)user;
- if( player->isAllowUseBattleGroundObject() )
+ if( player->CanUseBattleGroundObject() )
{
// in battleground check
BattleGround *bg = player->GetBattleGround();
@@ -1274,6 +1310,26 @@ void GameObject::Use(Unit* user)
}
break;
}
+ case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
+ {
+ GameObjectInfo const* info = GetGOInfo();
+ if(!info)
+ return;
+
+ if(user->GetTypeId()!=TYPEID_PLAYER)
+ return;
+
+ Player* player = (Player*)user;
+
+ // fallback, will always work
+ player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
+
+ WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0);
+ player->GetSession()->SendPacket(&data);
+
+ player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->barberChair.chairheight);
+ return;
+ }
default:
sLog.outDebug("Unknown Object Type %u", GetGoType());
break;
@@ -1292,7 +1348,7 @@ void GameObject::Use(Unit* user)
return;
}
- Spell *spell = new Spell(spellCaster, spellInfo, false);
+ Spell *spell = new Spell(spellCaster, spellInfo, triggered);
// spell target is user of GO
SpellCastTargets targets;
@@ -1301,8 +1357,28 @@ void GameObject::Use(Unit* user)
spell->prepare(&targets);
}
-void GameObject::CastSpell(Unit* target, uint32 spell)
+void GameObject::CastSpell(Unit* target, uint32 spellId)
{
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo)
+ return;
+
+ bool self = false;
+ for(int i = 0; i < 3; ++i)
+ {
+ if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
+ {
+ self = true;
+ break;
+ }
+ }
+
+ if(self)
+ {
+ target->CastSpell(target, spellInfo, true);
+ return;
+ }
+
//summon world trigger
Creature *trigger = SummonTrigger(GetPositionX(), GetPositionY(), GetPositionZ(), 0, 1);
if(!trigger) return;
@@ -1311,12 +1387,12 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
if(Unit *owner = GetOwner())
{
trigger->setFaction(owner->getFaction());
- trigger->CastSpell(target, spell, true, 0, 0, owner->GetGUID());
+ trigger->CastSpell(target, spellInfo, true, 0, 0, owner->GetGUID());
}
else
{
trigger->setFaction(14);
- trigger->CastSpell(target, spell, true, 0, 0, target->GetGUID());
+ trigger->CastSpell(target, spellInfo, true, 0, 0, target->GetGUID());
}
//trigger->setDeathState(JUST_DIED);
//trigger->RemoveCorpse();
@@ -1338,3 +1414,25 @@ const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
return GetName();
}
+void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3 /*=0.0f*/)
+{
+ static double const atan_pow = atan(pow(2.0f, -20.0f));
+
+ SetFloatValue(GAMEOBJECT_FACING, GetOrientation());
+
+ double f_rot1 = sin(GetOrientation() / 2.0f);
+ double f_rot2 = cos(GetOrientation() / 2.0f);
+
+ int64 i_rot1 = int64(f_rot1 / atan_pow *(f_rot2 >= 0 ? 1.0f : -1.0f));
+ int64 rotation = (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
+ SetUInt64Value(GAMEOBJECT_ROTATION, rotation);
+
+ if(rotation2==0.0f && rotation3==0.0f)
+ {
+ rotation2 = f_rot1;
+ rotation3 = f_rot2;
+ }
+
+ SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3);
+}
diff --git a/src/game/GameObject.h b/src/game/GameObject.h
index 2eb51a6fbe4..b0019048827 100644
--- a/src/game/GameObject.h
+++ b/src/game/GameObject.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@ struct GameObjectInfo
uint32 type;
uint32 displayId;
char *name;
+ char *IconName;
char *castBarCaption;
uint32 faction;
uint32 flags;
@@ -336,12 +337,12 @@ struct GameObjectInfo
uint32 mapID; //0
uint32 difficulty; //1
} dungeonDifficulty;
- //32 GAMEOBJECT_TYPE_DO_NOT_USE_YET
+ //32 GAMEOBJECT_TYPE_BARBER_CHAIR
struct
{
- uint32 mapID; //0
- uint32 difficulty; //1
- } doNotUseYet;
+ uint32 chairheight; //0
+ uint32 heightOffset; //1
+ } barberChair;
//33 GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
struct
{
@@ -350,6 +351,13 @@ struct GameObjectInfo
uint32 state1Name; //2
uint32 state2Name; //3
} destructibleBuilding;
+ //34 GAMEOBJECT_TYPE_TRAPDOOR
+ struct
+ {
+ uint32 whenToPause; // 0
+ uint32 startOpen; // 1
+ uint32 autoClose; // 2
+ } trapDoor;
// not use for specific field access (only for output with loop by all filed), also this determinate max union size
struct // GAMEOBJECT_TYPE_SPELLCASTER
@@ -370,7 +378,8 @@ struct GameObjectLocale
struct GameObjectData
{
uint32 id; // entry in gamobject_template
- uint32 mapid;
+ uint16 mapid;
+ uint16 phaseMask;
float posX;
float posY;
float posZ;
@@ -419,7 +428,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
void AddToWorld();
void RemoveFromWorld();
- bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, uint32 go_state, uint32 ArtKit = 0);
+ bool Create(uint32 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, uint32 go_state, uint32 ArtKit = 0);
void Update(uint32 p_time);
static GameObject* GetGameObject(WorldObject& object, uint64 guid);
GameObjectInfo const* GetGOInfo() const;
@@ -436,20 +445,19 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
- void Say(const char* text, uint32 language, uint64 TargetGuid) { MonsterSay(text,language,TargetGuid); }
- void Yell(const char* text, uint32 language, uint64 TargetGuid) { MonsterYell(text,language,TargetGuid); }
- void TextEmote(const char* text, uint64 TargetGuid) { MonsterTextEmote(text,TargetGuid); }
- void Whisper(const char* text,uint64 receiver) { MonsterWhisper(text,receiver); }
+ void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f);
+
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); }
+ void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
// overwrite WorldObject function for proper name localization
const char* GetNameForLocaleIdx(int32 locale_idx) const;
void SaveToDB();
- void SaveToDB(uint32 mapid, uint8 spawnMask);
+ void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
bool LoadFromDB(uint32 guid, Map *map);
void DeleteFromDB();
void SetLootState(LootState s) { m_lootState = s; }
@@ -474,6 +482,20 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
}
}
+ bool GetDespawnPossibility() const
+ {
+ switch(GetGoType())
+ {
+ case GAMEOBJECT_TYPE_DOOR: return GetGOInfo()->door.noDamageImmune;
+ case GAMEOBJECT_TYPE_BUTTON: return GetGOInfo()->button.noDamageImmune;
+ case GAMEOBJECT_TYPE_QUESTGIVER: return GetGOInfo()->questgiver.noDamageImmune;
+ case GAMEOBJECT_TYPE_GOOBER: return GetGOInfo()->goober.noDamageImmune;
+ case GAMEOBJECT_TYPE_FLAGSTAND: return GetGOInfo()->flagstand.noDamageImmune;
+ case GAMEOBJECT_TYPE_FLAGDROP: return GetGOInfo()->flagdrop.noDamageImmune;
+ default: return true;
+ }
+ }
+
time_t GetRespawnTime() const { return m_respawnTime; }
time_t GetRespawnTimeEx() const
{
@@ -503,15 +525,15 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
void Delete();
void SetSpellId(uint32 id) { m_spellId = id;}
uint32 GetSpellId() const { return m_spellId;}
- void getFishLoot(Loot *loot);
- GameobjectTypes GetGoType() const { return GameobjectTypes(GetUInt32Value(GAMEOBJECT_TYPE_ID)); }
- void SetGoType(GameobjectTypes type) { SetUInt32Value(GAMEOBJECT_TYPE_ID, type); }
- uint32 GetGoState() const { return GetUInt32Value(GAMEOBJECT_STATE); }
- void SetGoState(uint32 state) { SetUInt32Value(GAMEOBJECT_STATE, state); }
- uint32 GetGoArtKit() const { return GetUInt32Value(GAMEOBJECT_ARTKIT); }
- void SetGoArtKit(uint32 artkit);
- uint32 GetGoAnimProgress() const { return GetUInt32Value(GAMEOBJECT_ANIMPROGRESS); }
- void SetGoAnimProgress(uint32 animprogress) { SetUInt32Value(GAMEOBJECT_ANIMPROGRESS, animprogress); }
+ void getFishLoot(Loot *loot, Player* loot_owner);
+ GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); }
+ void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); }
+ uint8 GetGoState() const { return GetByteValue(GAMEOBJECT_BYTES_1, 0); }
+ void SetGoState(uint8 state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); }
+ uint8 GetGoArtKit() const { return GetByteValue(GAMEOBJECT_BYTES_1, 2); }
+ void SetGoArtKit(uint8 artkit);
+ uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
+ void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); }
void Use(Unit* user);
diff --git a/src/game/GlobalEvents.cpp b/src/game/GlobalEvents.cpp
index a2dd89d34c0..a544113f5c8 100644
--- a/src/game/GlobalEvents.cpp
+++ b/src/game/GlobalEvents.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones)
{
if(!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid))
{
- sLog.outDebug("Corpse %u not found in world. Delete from DB.",guidlow);
+ sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow);
CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow);
}
}
diff --git a/src/game/GlobalEvents.h b/src/game/GlobalEvents.h
index 6ec6e6b60b1..aa99c47985e 100644
--- a/src/game/GlobalEvents.h
+++ b/src/game/GlobalEvents.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp
index b0f717eea9e..c362b23ff71 100644
--- a/src/game/GossipDef.cpp
+++ b/src/game/GossipDef.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -127,7 +127,7 @@ bool PlayerMenu::GossipOptionCoded( unsigned int Selection )
void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
{
WorldPacket data( SMSG_GOSSIP_MESSAGE, (100) ); // guess size
- data << npcGUID;
+ data << uint64(npcGUID);
data << uint32(0); // new 2.4.0
data << uint32( TitleTextId );
data << uint32( mGossipMenu.MenuItemCount() ); // max count 0x0F
@@ -153,7 +153,7 @@ void PlayerMenu::SendGossipMenu( uint32 TitleTextId, uint64 npcGUID )
data << uint32(questID);
data << uint32( qItem.m_qIcon );
- data << uint32( pQuest ? pQuest->GetQuestLevel() : 0 );
+ data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest));
std::string Title = pQuest->GetTitle();
int loc_idx = pSession->GetSessionDbLocaleIndex();
@@ -181,6 +181,7 @@ void PlayerMenu::CloseGossip()
//sLog.outDebug( "WORLD: Sent SMSG_GOSSIP_COMPLETE" );
}
+// Outdated
void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const * locName )
{
WorldPacket data( SMSG_GOSSIP_POI, (4+4+4+4+4+10) ); // guess size
@@ -194,12 +195,43 @@ void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flag
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
}
-void PlayerMenu::SendTalking( uint32 textID )
+void PlayerMenu::SendPointOfInterest( uint32 poi_id )
{
- GossipText *pGossip;
- std::string GossipStr;
+ PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id);
+ if(!poi)
+ {
+ sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.",poi_id);
+ return;
+ }
+
+ std::string icon_name = poi->icon_name;
+
+ int loc_idx = pSession->GetSessionDbLocaleIndex();
+ if (loc_idx >= 0)
+ {
+ PointOfInterestLocale const *pl = objmgr.GetPointOfInterestLocale(poi_id);
+ if (pl)
+ {
+ if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
+ icon_name = pl->IconName[loc_idx];
+ }
+ }
+
+ WorldPacket data( SMSG_GOSSIP_POI, (4+4+4+4+4+10) ); // guess size
+ data << uint32(poi->flags);
+ data << float(poi->x);
+ data << float(poi->y);
+ data << uint32(poi->icon);
+ data << uint32(poi->data);
+ data << icon_name;
+
+ pSession->SendPacket( &data );
+ //sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
+}
- pGossip = objmgr.GetGossipText(textID);
+void PlayerMenu::SendTalking( uint32 textID )
+{
+ GossipText const* pGossip = objmgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID; // can be < 0
@@ -259,14 +291,11 @@ void PlayerMenu::SendTalking( uint32 textID )
data << pGossip->Options[i].Language;
- data << pGossip->Options[i].Emotes[0]._Delay;
- data << pGossip->Options[i].Emotes[0]._Emote;
-
- data << pGossip->Options[i].Emotes[1]._Delay;
- data << pGossip->Options[i].Emotes[1]._Emote;
-
- data << pGossip->Options[i].Emotes[2]._Delay;
- data << pGossip->Options[i].Emotes[2]._Emote;
+ for(int j = 0; j < 3; ++j)
+ {
+ data << pGossip->Options[i].Emotes[j]._Delay;
+ data << pGossip->Options[i].Emotes[j]._Emote;
+ }
}
}
pSession->SendPacket( &data );
@@ -373,7 +402,7 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, const std::string& Titl
data << uint32(questID);
data << uint32(qmi.m_qIcon);
- data << uint32(pQuest ? pQuest->GetQuestLevel() : 0);
+ data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest));
data << title;
}
pSession->SendPacket( &data );
@@ -417,10 +446,14 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
}
data << uint64(npcGUID);
+ data << uint64(0); // wotlk, something todo with quest sharing?
data << uint32(pQuest->GetQuestId());
- data << Title << Details << Objectives;
+ data << Title;
+ data << Details;
+ data << Objectives;
data << uint32(ActivateAccept);
data << uint32(pQuest->GetSuggestedPlayers());
+ data << uint8(0); // new wotlk
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
{
@@ -466,6 +499,7 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
data << uint32(pQuest->GetRewSpellCast()); // casted spell
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
+ data << uint32(pQuest->GetBonusTalents()); // bonus talents
data << uint32(QUEST_EMOTE_COUNT);
for (uint32 i=0; i < QUEST_EMOTE_COUNT; i++)
@@ -514,7 +548,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << uint32(pQuest->GetQuestId());
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
- data << uint32(pQuest->GetQuestLevel()); // may be 0
+ data << uint32(pQuest->GetQuestLevel()); // may be 0, static data, in other cases must be used dynamic level: Player::GetQuestLevel
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
data << uint32(pQuest->GetType());
@@ -542,6 +576,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << uint32(pQuest->GetSrcItemId());
data << uint32(pQuest->GetFlags() & 0xFFFF);
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
+ data << uint32(pQuest->GetPlayersSlain()); // players slain
+ data << uint32(pQuest->GetBonusTalents()); // bonus talents
int iI;
@@ -588,15 +624,23 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
data << uint32(pQuest->ReqCreatureOrGOId[iI]);
}
data << uint32(pQuest->ReqCreatureOrGOCount[iI]);
+ data << uint32(pQuest->ReqSourceId[iI]);
+ }
+
+ for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
+ {
data << uint32(pQuest->ReqItemId[iI]);
data << uint32(pQuest->ReqItemCount[iI]);
}
+ data << uint32(0); // TODO: 5 item objective
+ data << uint32(0);
+
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; iI++)
data << ObjectiveText[iI];
pSession->SendPacket( &data );
- sLog.outDebug( "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u",pQuest->GetQuestId() );
+ sLog.outDebug( "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId() );
}
void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID, bool EnbleNext )
@@ -678,9 +722,10 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
data << uint32(0x08); // unused by client?
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
data << uint32(pQuest->GetRewSpellCast()); // casted spell
- data << uint32(0x00); // unk, NOT honor
+ data << uint32(0); // unknown
+ data << uint32(pQuest->GetBonusTalents()); // bonus talents
pSession->SendPacket( &data );
- sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u",GUID_LOPART(npcGUID),pQuest->GetQuestId() );
+ sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId() );
}
void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel )
@@ -688,16 +733,8 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
// We can always call to RequestItems, but this packet only goes out if there are actually
// items. Otherwise, we'll skip straight to the OfferReward
- // We may wish a better check, perhaps checking the real quest requirements
- if (pQuest->GetRequestItemsText().empty())
- {
- SendQuestGiverOfferReward(pQuest, npcGUID, true);
- return;
- }
-
- std::string Title,RequestItemsText;
- Title = pQuest->GetTitle();
- RequestItemsText = pQuest->GetRequestItemsText();
+ std::string Title = pQuest->GetTitle();
+ std::string RequestItemsText = pQuest->GetRequestItemsText();
int loc_idx = pSession->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
@@ -712,6 +749,13 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
}
}
+ // We may wish a better check, perhaps checking the real quest requirements
+ if (RequestItemsText.empty())
+ {
+ SendQuestGiverOfferReward(pQuest, npcGUID, true);
+ return;
+ }
+
WorldPacket data( SMSG_QUESTGIVER_REQUEST_ITEMS, 50 ); // guess size
data << npcGUID;
data << pQuest->GetQuestId();
diff --git a/src/game/GossipDef.h b/src/game/GossipDef.h
index e2279550528..102a34b5913 100644
--- a/src/game/GossipDef.h
+++ b/src/game/GossipDef.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,27 +30,27 @@ class WorldSession;
#define GOSSIP_MAX_MENU_ITEMS 64 // client supported items unknown, but provided number must be enough
#define DEFAULT_GOSSIP_MESSAGE 0xffffff
-//POI defines
+//POI icons. Many more exist, list not complete.
enum Poi_Icon
{
- ICON_POI_0 = 0, // Grey ?
- ICON_POI_1 = 1, // Red ?
- ICON_POI_2 = 2, // Blue ?
- ICON_POI_BWTOMB = 3, // Blue and White Tomb Stone
- ICON_POI_HOUSE = 4, // House
- ICON_POI_TOWER = 5, // Tower
- ICON_POI_REDFLAG = 6, // Red Flag with Yellow !
- ICON_POI_TOMB = 7, // Tomb Stone
- ICON_POI_BWTOWER = 8, // Blue and White Tower
- ICON_POI_REDTOWER = 9, // Red Tower
- ICON_POI_BLUETOWER = 10, // Blue Tower
- ICON_POI_RWTOWER = 11, // Red and White Tower
- ICON_POI_REDTOMB = 12, // Red Tomb Stone
- ICON_POI_RWTOMB = 13, // Red and White Tomb Stone
- ICON_POI_BLUETOMB = 14, // Blue Tomb Stone
- ICON_POI_NOTHING = 15, // NOTHING
- ICON_POI_16 = 16, // Red ?
- ICON_POI_17 = 17, // Grey ?
+ ICON_POI_BLANK = 0, // Blank (not visible)
+ ICON_POI_GREY_AV_MINE = 1, // Grey mine lorry
+ ICON_POI_RED_AV_MINE = 2, // Red mine lorry
+ ICON_POI_BLUE_AV_MINE = 3, // Blue mine lorry
+ ICON_POI_BWTOMB = 4, // Blue and White Tomb Stone
+ ICON_POI_SMALL_HOUSE = 5, // Small house
+ ICON_POI_GREYTOWER = 6, // Grey Tower
+ ICON_POI_REDFLAG = 7, // Red Flag w/Yellow !
+ ICON_POI_TOMBSTONE = 8, // Normal tomb stone (brown)
+ ICON_POI_BWTOWER = 9, // Blue and White Tower
+ ICON_POI_REDTOWER = 10, // Red Tower
+ ICON_POI_BLUETOWER = 11, // Blue Tower
+ ICON_POI_RWTOWER = 12, // Red and White Tower
+ ICON_POI_REDTOMB = 13, // Red Tomb Stone
+ ICON_POI_RWTOMB = 14, // Red and White Tomb Stone
+ ICON_POI_BLUETOMB = 15, // Blue Tomb Stone
+ ICON_POI_16 = 16, // Grey ?
+ ICON_POI_17 = 17, // Blue/White ?
ICON_POI_18 = 18, // Blue ?
ICON_POI_19 = 19, // Red and White ?
ICON_POI_20 = 20, // Red ?
@@ -189,6 +189,7 @@ class TRINITY_DLL_SPEC PlayerMenu
void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID );
void CloseGossip();
void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
+ void SendPointOfInterest( uint32 poi_id );
void SendTalking( uint32 textID );
void SendTalking( char const * title, char const * text );
diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h
index cb67897329f..a3fe011f402 100644
--- a/src/game/GridDefines.h
+++ b/src/game/GridDefines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ class Player;
#define CENTER_GRID_OFFSET (SIZE_OF_GRIDS/2)
-#define MIN_GRID_DELAY MINUTE*1000
+#define MIN_GRID_DELAY (MINUTE*IN_MILISECONDS)
#define MIN_MAP_UPDATE_DELAY 50
#define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)
@@ -57,7 +57,7 @@ class Player;
#define TOTAL_NUMBER_OF_CELLS_PER_MAP (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS)
-#define MAP_RESOLUTION 256
+#define MAP_RESOLUTION 128
#define MAP_SIZE (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)
#define MAP_HALFSIZE (MAP_SIZE/2)
diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp
index e27abeccd0c..fe18dc35840 100644
--- a/src/game/GridNotifiers.cpp
+++ b/src/game/GridNotifiers.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "UpdateData.h"
#include "Item.h"
#include "Map.h"
-#include "MapManager.h"
#include "Transports.h"
#include "ObjectAccessor.h"
@@ -94,9 +93,9 @@ PlayerVisibilityNotifier::Notify()
// Now do operations that required done at object visibility change to visible
- // target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
+ // target aura duration for caster show only if target exist at caster client
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
@@ -109,14 +108,20 @@ Deliverer::Visit(PlayerMapType &m)
{
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
- if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist)
+ //if (!i_source.InSamePhase(iter->getSource()))
+ // continue;
+ if(!iter->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
+ if (!i_dist || iter->getSource()->GetDistance(&i_source) < i_dist)
{
// Send packet to all who are sharing the player's vision
if (!iter->getSource()->GetSharedVisionList().empty())
{
- SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
- for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
- SendPacket(*it);
+ SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
+ for ( ; i != iter->getSource()->GetSharedVisionList().end(); ++i)
+ if((*i)->m_seer == iter->getSource())
+ SendPacket(*i);
}
VisitObject(iter->getSource());
@@ -129,14 +134,18 @@ Deliverer::Visit(CreatureMapType &m)
{
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
- if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist)
+ if(!iter->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
+ if (!i_dist || iter->getSource()->GetDistance(&i_source) < i_dist)
{
// Send packet to all who are sharing the creature's vision
if (!iter->getSource()->GetSharedVisionList().empty())
{
- SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
- for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
- SendPacket(*it);
+ SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
+ for ( ; i != iter->getSource()->GetSharedVisionList().end(); ++i)
+ if((*i)->m_seer == iter->getSource())
+ SendPacket(*i);
}
}
}
@@ -147,13 +156,18 @@ Deliverer::Visit(DynamicObjectMapType &m)
{
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
- if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
+ if(!iter->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
+ if (!i_dist || iter->getSource()->GetDistance(&i_source) < i_dist)
{
- // Send packet back to the caster if the caster has vision of dynamic object
- Player* caster = (Player*)iter->getSource()->GetCaster();
- if (caster && caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID() &&
- (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist))
- SendPacket(caster);
+ if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
+ {
+ // Send packet back to the caster if the caster has vision of dynamic object
+ Player* caster = (Player*)iter->getSource()->GetCaster();
+ if (caster && caster->m_seer == iter->getSource())
+ SendPacket(caster);
+ }
}
}
}
@@ -204,9 +218,6 @@ ObjectUpdater::Visit(GridRefManager<T> &m)
}
}
-template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
-template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
-
bool CannibalizeObjectCheck::operator()(Corpse* u)
{
// ignore bones
@@ -224,3 +235,5 @@ bool CannibalizeObjectCheck::operator()(Corpse* u)
return false;
}
+template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
+template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index b34eee36e7b..521a543c08c 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -108,8 +108,10 @@ namespace Trinity
std::set<uint64> plr_list;
bool i_toPossessor;
bool i_toSelf;
+ uint32 i_phaseMask;
float i_dist;
- Deliverer(WorldObject &src, WorldPacket *msg, bool to_possessor, bool to_self, float dist = 0.0f) : i_source(src), i_message(msg), i_toPossessor(to_possessor), i_toSelf(to_self), i_dist(dist) {}
+ Deliverer(WorldObject &src, WorldPacket *msg, bool to_possessor, bool to_self, float dist = 0.0f)
+ : i_source(src), i_message(msg), i_toPossessor(to_possessor), i_toSelf(to_self), i_dist(dist), i_phaseMask(src.GetPhaseMask()) {}
void Visit(PlayerMapType &m);
void Visit(CreatureMapType &m);
void Visit(DynamicObjectMapType &m);
@@ -208,10 +210,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL WorldObjectSearcher
{
+ uint32 i_phaseMask;
WorldObject* &i_object;
Check &i_check;
- WorldObjectSearcher(WorldObject* & result, Check& check) : i_object(result),i_check(check) {}
+ WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(GameObjectMapType &m);
void Visit(PlayerMapType &m);
@@ -225,10 +229,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL WorldObjectListSearcher
{
+ uint32 i_phaseMask;
std::list<WorldObject*> &i_objects;
Check& i_check;
- WorldObjectListSearcher(std::list<WorldObject*> &objects, Check & check) : i_objects(objects),i_check(check) {}
+ WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
void Visit(PlayerMapType &m);
void Visit(CreatureMapType &m);
@@ -242,37 +248,44 @@ namespace Trinity
template<class Do>
struct TRINITY_DLL_DECL WorldObjectWorker
{
+ uint32 i_phaseMask;
Do const& i_do;
- explicit WorldObjectWorker(Do const& _do) : i_do(_do) {}
+ WorldObjectWorker(WorldObject const* searcher, Do const& _do)
+ : i_phaseMask(searcher->GetPhaseMask()), i_do(_do) {}
void Visit(GameObjectMapType &m)
{
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
}
void Visit(PlayerMapType &m)
{
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
}
void Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
}
void Visit(CorpseMapType &m)
{
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
}
void Visit(DynamicObjectMapType &m)
{
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
}
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
@@ -283,10 +296,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL GameObjectSearcher
{
+ uint32 i_phaseMask;
GameObject* &i_object;
Check &i_check;
- GameObjectSearcher(GameObject* & result, Check& check) : i_object(result),i_check(check) {}
+ GameObjectSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(GameObjectMapType &m);
@@ -297,10 +312,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL GameObjectLastSearcher
{
+ uint32 i_phaseMask;
GameObject* &i_object;
Check& i_check;
- GameObjectLastSearcher(GameObject* & result, Check& check) : i_object(result),i_check(check) {}
+ GameObjectLastSearcher(WorldObject const* searcher, GameObject* & result, Check& check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
void Visit(GameObjectMapType &m);
@@ -310,10 +327,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL GameObjectListSearcher
{
+ uint32 i_phaseMask;
std::list<GameObject*> &i_objects;
Check& i_check;
- GameObjectListSearcher(std::list<GameObject*> &objects, Check & check) : i_objects(objects),i_check(check) {}
+ GameObjectListSearcher(WorldObject const* searcher, std::list<GameObject*> &objects, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {}
void Visit(GameObjectMapType &m);
@@ -326,10 +345,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL UnitSearcher
{
+ uint32 i_phaseMask;
Unit* &i_object;
Check & i_check;
- UnitSearcher(Unit* & result, Check & check) : i_object(result),i_check(check) {}
+ UnitSearcher(WorldObject const* searcher, Unit* & result, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(CreatureMapType &m);
void Visit(PlayerMapType &m);
@@ -341,10 +362,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL UnitLastSearcher
{
+ uint32 i_phaseMask;
Unit* &i_object;
Check & i_check;
- UnitLastSearcher(Unit* & result, Check & check) : i_object(result),i_check(check) {}
+ UnitLastSearcher(WorldObject const* searcher, Unit* & result, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(CreatureMapType &m);
void Visit(PlayerMapType &m);
@@ -356,10 +379,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL UnitListSearcher
{
+ uint32 i_phaseMask;
std::list<Unit*> &i_objects;
Check& i_check;
- UnitListSearcher(std::list<Unit*> &objects, Check & check) : i_objects(objects),i_check(check) {}
+ UnitListSearcher(WorldObject const* searcher, std::list<Unit*> &objects, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
void Visit(PlayerMapType &m);
void Visit(CreatureMapType &m);
@@ -372,10 +397,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL CreatureSearcher
{
+ uint32 i_phaseMask;
Creature* &i_object;
Check & i_check;
- CreatureSearcher(Creature* & result, Check & check) : i_object(result),i_check(check) {}
+ CreatureSearcher(WorldObject const* searcher, Creature* & result, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(CreatureMapType &m);
@@ -386,10 +413,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL CreatureLastSearcher
{
+ uint32 i_phaseMask;
Creature* &i_object;
Check & i_check;
- CreatureLastSearcher(Creature* & result, Check & check) : i_object(result),i_check(check) {}
+ CreatureLastSearcher(WorldObject const* searcher, Creature* & result, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(CreatureMapType &m);
@@ -399,10 +428,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL CreatureListSearcher
{
+ uint32 i_phaseMask;
std::list<Creature*> &i_objects;
Check& i_check;
- CreatureListSearcher(std::list<Creature*> &objects, Check & check) : i_objects(objects),i_check(check) {}
+ CreatureListSearcher(WorldObject const* searcher, std::list<Creature*> &objects, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {}
void Visit(CreatureMapType &m);
@@ -414,10 +445,12 @@ namespace Trinity
template<class Check>
struct TRINITY_DLL_DECL PlayerSearcher
{
+ uint32 i_phaseMask;
Player* &i_object;
Check & i_check;
- PlayerSearcher(Player* & result, Check & check) : i_object(result),i_check(check) {}
+ PlayerSearcher(WorldObject const* searcher, Player* & result, Check & check)
+ : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {}
void Visit(PlayerMapType &m);
@@ -427,14 +460,37 @@ namespace Trinity
template<class Do>
struct TRINITY_DLL_DECL PlayerWorker
{
+ uint32 i_phaseMask;
Do& i_do;
- explicit PlayerWorker(Do& _do) : i_do(_do) {}
+ PlayerWorker(WorldObject const* searcher, Do& _do)
+ : i_phaseMask(searcher->GetPhaseMask()), i_do(_do) {}
void Visit(PlayerMapType &m)
{
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- i_do(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
+ }
+
+ template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
+ };
+
+ template<class Do>
+ struct TRINITY_DLL_DECL PlayerDistWorker
+ {
+ WorldObject const* i_searcher;
+ float i_dist;
+ Do& i_do;
+
+ PlayerDistWorker(WorldObject const* searcher, float _dist, Do& _do)
+ : i_searcher(searcher), i_dist(_dist), i_do(_do) {}
+
+ void Visit(PlayerMapType &m)
+ {
+ for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ if(itr->getSource()->InSamePhase(i_searcher) && itr->getSource()->GetDistance(i_searcher) <= i_dist)
+ i_do(itr->getSource());
}
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
@@ -572,6 +628,62 @@ namespace Trinity
// Unit checks
+ class MostHPMissingInRange
+ {
+ public:
+ MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) {}
+ bool operator()(Unit* u)
+ {
+ if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
+ {
+ i_hp = u->GetMaxHealth() - u->GetHealth();
+ return true;
+ }
+ return false;
+ }
+ private:
+ Unit const* i_obj;
+ float i_range;
+ uint32 i_hp;
+ };
+
+ class FriendlyCCedInRange
+ {
+ public:
+ FriendlyCCedInRange(Unit const* obj, float range) : i_obj(obj), i_range(range) {}
+ bool operator()(Unit* u)
+ {
+ if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
+ (u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUNNED) || u->hasUnitState(UNIT_STAT_CONFUSED)))
+ {
+ return true;
+ }
+ return false;
+ }
+ private:
+ Unit const* i_obj;
+ float i_range;
+ };
+
+ class FriendlyMissingBuffInRange
+ {
+ public:
+ FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
+ bool operator()(Unit* u)
+ {
+ if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
+ !(u->HasAura(i_spell, 0) || u->HasAura(i_spell, 1) || u->HasAura(i_spell, 2)))
+ {
+ return true;
+ }
+ return false;
+ }
+ private:
+ Unit const* i_obj;
+ float i_range;
+ uint32 i_spell;
+ };
+
class AnyUnfriendlyUnitInObjectRangeCheck
{
public:
@@ -859,63 +971,6 @@ namespace Trinity
float i_range;
};
- // Searchers used by ScriptedAI
- class MostHPMissingInRange
- {
- public:
- MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) {}
- bool operator()(Unit* u)
- {
- if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
- {
- i_hp = u->GetMaxHealth() - u->GetHealth();
- return true;
- }
- return false;
- }
- private:
- Unit const* i_obj;
- float i_range;
- uint32 i_hp;
- };
-
- class FriendlyCCedInRange
- {
- public:
- FriendlyCCedInRange(Unit const* obj, float range) : i_obj(obj), i_range(range) {}
- bool operator()(Unit* u)
- {
- if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
- (u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUNNED) || u->hasUnitState(UNIT_STAT_CONFUSED)))
- {
- return true;
- }
- return false;
- }
- private:
- Unit const* i_obj;
- float i_range;
- };
-
- class FriendlyMissingBuffInRange
- {
- public:
- FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
- bool operator()(Unit* u)
- {
- if(u->isAlive() && u->isInCombat() && /*!i_obj->IsHostileTo(u)*/ i_obj->IsFriendlyTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
- !(u->HasAura(i_spell, 0) || u->HasAura(i_spell, 1) || u->HasAura(i_spell, 2)))
- {
- return true;
- }
- return false;
- }
- private:
- Unit const* i_obj;
- float i_range;
- uint32 i_spell;
- };
-
class AllFriendlyCreaturesInGrid
{
public:
@@ -963,6 +1018,49 @@ namespace Trinity
float range;
};
+ // Player checks and do
+
+ // Prepare using Builder localized packets with caching and send to player
+ template<class Builder>
+ class LocalizedPacketDo
+ {
+ public:
+ explicit LocalizedPacketDo(Builder& builder) : i_builder(builder) {}
+
+ ~LocalizedPacketDo()
+ {
+ for(size_t i = 0; i < i_data_cache.size(); ++i)
+ delete i_data_cache[i];
+ }
+ void operator()( Player* p );
+
+ private:
+ Builder& i_builder;
+ std::vector<WorldPacket*> i_data_cache; // 0 = default, i => i-1 locale index
+ };
+
+ // Prepare using Builder localized packets with caching and send to player
+ template<class Builder>
+ class LocalizedPacketListDo
+ {
+ public:
+ typedef std::vector<WorldPacket*> WorldPacketList;
+ explicit LocalizedPacketListDo(Builder& builder) : i_builder(builder) {}
+
+ ~LocalizedPacketListDo()
+ {
+ for(size_t i = 0; i < i_data_cache.size(); ++i)
+ for(int j = 0; j < i_data_cache[i].size(); ++j)
+ delete i_data_cache[i][j];
+ }
+ void operator()( Player* p );
+
+ private:
+ Builder& i_builder;
+ std::vector<WorldPacketList> i_data_cache;
+ // 0 = default, i => i-1 locale index
+ };
+
#ifndef WIN32
template<> inline void PlayerRelocationNotifier::Visit<Creature>(CreatureMapType &);
template<> inline void PlayerRelocationNotifier::Visit<Player>(PlayerMapType &);
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index a43a97cd898..7fc6c147f5b 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -128,7 +128,7 @@ Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m)
continue;
iter->getSource()->UpdateVisibilityOf(&i_creature);
-
+
PlayerCreatureRelocationWorker(iter->getSource(), &i_creature);
}
}
@@ -144,7 +144,7 @@ Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m)
{
if(iter->getSource()->m_Notified)
continue;
-
+
if(!iter->getSource()->isAlive())
continue;
@@ -202,11 +202,10 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
}
// Check target immune to spell or aura
- if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo->Effect[eff_index], spellInfo->EffectMechanic[eff_index]))
+ if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index))
return;
// Apply PersistentAreaAura on target
- PersistentAreaAura* Aur = new PersistentAreaAura(spellInfo, eff_index, NULL, target, i_dynobject.GetCaster());
- target->AddAura(Aur);
+ target->AddAuraEffect(spellInfo->Id, eff_index, i_dynobject.GetCaster());
i_dynobject.AddAffected(target);
}
@@ -239,7 +238,10 @@ void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
- if(i_check(itr->getSource()))
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -256,6 +258,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -273,6 +278,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -290,6 +298,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -307,6 +318,9 @@ void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -319,40 +333,45 @@ template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
{
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
{
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
{
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
{
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
// Gameobject searchers
@@ -366,6 +385,9 @@ void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -379,6 +401,9 @@ void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
{
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
i_object = itr->getSource();
}
@@ -388,8 +413,9 @@ template<class Check>
void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
{
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
// Unit searchers
@@ -403,6 +429,9 @@ void Trinity::UnitSearcher<Check>::Visit(CreatureMapType &m)
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -420,6 +449,9 @@ void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m)
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -433,6 +465,9 @@ void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
i_object = itr->getSource();
}
@@ -443,6 +478,9 @@ void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
{
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
i_object = itr->getSource();
}
@@ -452,16 +490,18 @@ template<class Check>
void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m)
{
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if(i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
// Creature searchers
@@ -475,6 +515,9 @@ void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m)
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -488,6 +531,9 @@ void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
i_object = itr->getSource();
}
@@ -497,8 +543,9 @@ template<class Check>
void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(i_check(itr->getSource()))
- i_objects.push_back(itr->getSource());
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ if( i_check(itr->getSource()))
+ i_objects.push_back(itr->getSource());
}
template<class Check>
@@ -510,6 +557,9 @@ void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
{
+ if(!itr->getSource()->InSamePhase(i_phaseMask))
+ continue;
+
if(i_check(itr->getSource()))
{
i_object = itr->getSource();
@@ -518,5 +568,53 @@ void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
}
}
-#endif // TRINITY_GRIDNOTIFIERSIMPL_H
+template<class Builder>
+void MaNGOS::LocalizedPacketDo<Builder>::operator()( Player* p )
+{
+ uint32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
+ uint32 cache_idx = loc_idx+1;
+ WorldPacket* data;
+
+ // create if not cached yet
+ if(i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
+ {
+ if(i_data_cache.size() < cache_idx+1)
+ i_data_cache.resize(cache_idx+1);
+
+ data = new WorldPacket(SMSG_MESSAGECHAT, 200);
+
+ i_builder(*data,loc_idx);
+
+ i_data_cache[cache_idx] = data;
+ }
+ else
+ data = i_data_cache[cache_idx];
+
+ p->SendDirectMessage(data);
+}
+
+template<class Builder>
+void MaNGOS::LocalizedPacketListDo<Builder>::operator()( Player* p )
+{
+ uint32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
+ uint32 cache_idx = loc_idx+1;
+ WorldPacketList* data_list;
+
+ // create if not cached yet
+ if(i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty())
+ {
+ if(i_data_cache.size() < cache_idx+1)
+ i_data_cache.resize(cache_idx+1);
+
+ data_list = &i_data_cache[cache_idx];
+
+ i_builder(*data_list,loc_idx);
+ }
+ else
+ data_list = &i_data_cache[cache_idx];
+
+ for(size_t i = 0; i < data_list->size(); ++i)
+ p->SendDirectMessage((*data_list)[i]);
+}
+#endif // MANGOS_GRIDNOTIFIERSIMPL_H
diff --git a/src/game/GridStates.h b/src/game/GridStates.h
index 167f30b8371..12d64ad58ca 100644
--- a/src/game/GridStates.h
+++ b/src/game/GridStates.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Group.cpp b/src/game/Group.cpp
index 535a3d4392c..f4a977c3d7c 100644
--- a/src/game/Group.cpp
+++ b/src/game/Group.cpp
@@ -203,13 +203,24 @@ void Group::ConvertToRaid()
_initRaidSubGroupsCounter();
- if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
+ if(!isBGGroup())
+ CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
SendUpdate();
+
+ // update quest related GO states (quest activity dependent from raid membership)
+ for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
+ if(Player* player = objmgr.GetPlayer(citr->guid))
+ player->UpdateForQuestsGO();
}
bool Group::AddInvite(Player *player)
{
- if(!player || player->GetGroupInvite() || player->GetGroup())
+ if( !player || player->GetGroupInvite() )
+ return false;
+ Group* group = player->GetGroup();
+ if( group && group->isBGGroup() )
+ group = player->GetOriginalGroup();
+ if( group )
return false;
RemoveInvite(player);
@@ -290,6 +301,10 @@ bool Group::AddMember(const uint64 &guid, const char* name)
}
player->SetGroupUpdateFlag(GROUP_UPDATE_FULL);
UpdatePlayerOutOfRange(player);
+
+ // quest related GO state dependent from raid memebership
+ if(isRaidGroup())
+ player->UpdateForQuestsGO();
}
return true;
@@ -306,6 +321,10 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
if(Player *player = objmgr.GetPlayer( guid ))
{
+ // quest related GO state dependent from raid membership
+ if(isRaidGroup())
+ player->UpdateForQuestsGO();
+
WorldPacket data;
if(method == 1)
@@ -314,9 +333,17 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
player->GetSession()->SendPacket( &data );
}
- data.Initialize(SMSG_GROUP_LIST, 24);
- data << uint64(0) << uint64(0) << uint64(0);
- player->GetSession()->SendPacket(&data);
+ //we already removed player from group and in player->GetGroup() is his original group!
+ if( Group* group = player->GetGroup() )
+ {
+ group->SendUpdate();
+ }
+ else
+ {
+ data.Initialize(SMSG_GROUP_LIST, 24);
+ data << uint64(0) << uint64(0) << uint64(0);
+ player->GetSession()->SendPacket(&data);
+ }
_homebindIfInstance(player);
}
@@ -325,7 +352,7 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
{
WorldPacket data(SMSG_GROUP_SET_LEADER, (m_memberSlots.front().name.size()+1));
data << m_memberSlots.front().name;
- BroadcastPacket(&data);
+ BroadcastPacket(&data, true);
}
SendUpdate();
@@ -348,7 +375,7 @@ void Group::ChangeLeader(const uint64 &guid)
WorldPacket data(SMSG_GROUP_SET_LEADER, slot->name.size()+1);
data << slot->name;
- BroadcastPacket(&data);
+ BroadcastPacket(&data, true);
SendUpdate();
}
@@ -362,7 +389,22 @@ void Group::Disband(bool hideDestroy)
if(!player)
continue;
- player->SetGroup(NULL);
+ //we cannot call _removeMember because it would invalidate member iterator
+ //if we are removing player from battleground raid
+ if( isBGGroup() )
+ player->RemoveFromBattleGroundRaid();
+ else
+ {
+ //we can remove player who is in battleground from his original group
+ if( player->GetOriginalGroup() == this )
+ player->SetOriginalGroup(NULL);
+ else
+ player->SetGroup(NULL);
+ }
+
+ // quest related GO state dependent from raid membership
+ if(isRaidGroup())
+ player->UpdateForQuestsGO();
if(!player->GetSession())
continue;
@@ -374,9 +416,17 @@ void Group::Disband(bool hideDestroy)
player->GetSession()->SendPacket(&data);
}
- data.Initialize(SMSG_GROUP_LIST, 24);
- data << uint64(0) << uint64(0) << uint64(0);
- player->GetSession()->SendPacket(&data);
+ //we already removed player from group and in player->GetGroup() is his original group, send update
+ if( Group* group = player->GetGroup() )
+ {
+ group->SendUpdate();
+ }
+ else
+ {
+ data.Initialize(SMSG_GROUP_LIST, 24);
+ data << uint64(0) << uint64(0) << uint64(0);
+ player->GetSession()->SendPacket(&data);
+ }
_homebindIfInstance(player);
}
@@ -730,6 +780,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
if(player && player->GetSession())
{
+ player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul);
+
ItemPosCountVec dest;
LootItem *item = &(roll->getLoot()->items[roll->itemSlot]);
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count );
@@ -775,6 +827,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
if(player && player->GetSession())
{
+ player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul);
+
ItemPosCountVec dest;
LootItem *item = &(roll->getLoot()->items[roll->itemSlot]);
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count );
@@ -820,7 +874,7 @@ void Group::SetTargetIcon(uint8 id, uint64 guid)
data << (uint8)0;
data << id;
data << guid;
- BroadcastPacket(&data);
+ BroadcastPacket(&data, true);
}
void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level)
@@ -836,13 +890,10 @@ void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_lev
++count;
sum_level += member->getLevel();
- // store maximum member level
if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel())
member_with_max_level = member;
- uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel());
- // if the victim is higher level than the gray level of the currently examined group member,
- // then set not_gray_member_with_max_level if needed.
+ uint32 gray_level = MaNGOS::XP::GetGrayLevel(member->getLevel());
if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level
|| not_gray_member_with_max_level->getLevel() < member->getLevel()))
not_gray_member_with_max_level = member;
@@ -876,7 +927,7 @@ void Group::SendUpdate()
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
player = objmgr.GetPlayer(citr->guid);
- if(!player || !player->GetSession())
+ if(!player || !player->GetSession() || player->GetGroup() != this )
continue;
// guess size
WorldPacket data(SMSG_GROUP_LIST, (1+1+1+1+8+4+GetMembersCount()*20));
@@ -890,11 +941,14 @@ void Group::SendUpdate()
{
if(citr->guid == citr2->guid)
continue;
+ Player* member = objmgr.GetPlayer(citr2->guid);
+ uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
+ onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0);
data << citr2->name;
data << (uint64)citr2->guid;
// online-state
- data << (uint8)(objmgr.GetPlayer(citr2->guid) ? 1 : 0);
+ data << (uint8)(onlineState);
data << (uint8)(citr2->group); // groupid
data << (uint8)(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank
}
@@ -906,7 +960,6 @@ void Group::SendUpdate()
data << (uint64)m_looterGuid; // looter guid
data << (uint8)m_lootThreshold; // loot threshold
data << (uint8)m_difficulty; // Heroic Mod Group
-
}
player->GetSession()->SendPacket( &data );
}
@@ -929,12 +982,12 @@ void Group::UpdatePlayerOutOfRange(Player* pPlayer)
}
}
-void Group::BroadcastPacket(WorldPacket *packet, int group, uint64 ignore)
+void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group, uint64 ignore)
{
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *pl = itr->getSource();
- if(!pl || (ignore != 0 && pl->GetGUID() == ignore))
+ if(!pl || (ignore != 0 && pl->GetGUID() == ignore) || (ignorePlayersInBGRaid && pl->GetGroup() != this) )
continue;
if (pl->GetSession() && (group==-1 || itr->getSubGroup()==group))
@@ -985,7 +1038,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant)
}
// We are raid group and no one slot is free
if (!groupFound)
- return false;
+ return false;
}
return _addMember(guid, name, isAssistant, groupid);
@@ -1013,7 +1066,15 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
if(player)
{
player->SetGroupInvite(NULL);
- player->SetGroup(this, group);
+ //if player is in group and he is being added to BG raid group, then call SetBattleGroundRaid()
+ if( player->GetGroup() && isBGGroup() )
+ player->SetBattleGroundRaid(this, group);
+ //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup()
+ else if ( player->GetGroup() )
+ player->SetOriginalGroup(this, group);
+ //if player is not in group, then call set group
+ else
+ player->SetGroup(this, group);
// if the same group invites the player back, cancel the homebind timer
InstanceGroupBind *bind = GetBoundInstance(player->GetMapId(), player->GetDifficulty());
if(bind && bind->save->GetInstanceId() == player->GetInstanceId())
@@ -1040,7 +1101,17 @@ bool Group::_removeMember(const uint64 &guid)
Player *player = objmgr.GetPlayer(guid);
if (player)
{
- player->SetGroup(NULL);
+ //if we are removing player from battleground raid
+ if( isBGGroup() )
+ player->RemoveFromBattleGroundRaid();
+ else
+ {
+ //we can remove player who is in battleground from his original group
+ if( player->GetOriginalGroup() == this )
+ player->SetOriginalGroup(NULL);
+ else
+ player->SetGroup(NULL);
+ }
}
_removeRolls(guid);
@@ -1232,12 +1303,17 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group)
return;
if(_setMembersGroup(player->GetGUID(), group))
{
- uint8 prevSubGroup;
- prevSubGroup = player->GetSubGroup();
-
+ uint8 prevSubGroup = player->GetSubGroup();
+ if( player->GetGroup() == this )
+ player->GetGroupRef().setSubGroup(group);
+ //if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference
+ else
+ {
+ prevSubGroup = player->GetOriginalSubGroup();
+ player->GetOriginalGroupRef().setSubGroup(group);
+ }
SubGroupCounterDecrease(prevSubGroup);
- player->GetGroupRef().setSubGroup(group);
SendUpdate();
}
}
@@ -1315,7 +1391,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
SendUpdate();
}
-uint32 Group::CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot)
+uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot)
{
// check for min / max count
uint32 memberscount = GetMembersCount();
@@ -1330,7 +1406,7 @@ uint32 Group::CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint
if(!reference)
return BG_JOIN_ERR_OFFLINE_MEMBER;
- uint32 bgQueueId = reference->GetBattleGroundQueueIdFromLevel();
+ BGQueueIdBasedOnLevel queue_id = reference->GetBattleGroundQueueIdFromLevel(bgTypeId);
uint32 arenaTeamId = reference->GetArenaTeamId(arenaSlot);
uint32 team = reference->GetTeam();
@@ -1345,13 +1421,13 @@ uint32 Group::CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint
if(member->GetTeam() != team)
return BG_JOIN_ERR_MIXED_FACTION;
// not in the same battleground level braket, don't let join
- if(member->GetBattleGroundQueueIdFromLevel() != bgQueueId)
+ if(member->GetBattleGroundQueueIdFromLevel(bgTypeId) != queue_id)
return BG_JOIN_ERR_MIXED_LEVELS;
// don't let join rated matches if the arena team id doesn't match
if(isRated && member->GetArenaTeamId(arenaSlot) != arenaTeamId)
return BG_JOIN_ERR_MIXED_ARENATEAM;
// don't let join if someone from the group is already in that bg queue
- if(member->InBattleGroundQueueForBattleGroundQueueType(bgQueueType))
+ if(member->InBattleGroundQueueForBattleGroundQueueType(bgQueueTypeId))
return BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE;
// check for deserter debuff in case not arena queue
if(bgTypeId != BATTLEGROUND_AA && !member->CanJoinToBattleground())
@@ -1480,7 +1556,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
if(bind.save)
{
- // when a boss is killed or when copying the player's binds to the group
+ // when a boss is killed or when copying the players's binds to the group
if(permanent != bind.perm || save != bind.save)
if(!load) CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u', permanent = '%u' WHERE leaderGuid = '%u' AND instance = '%u'", save->GetInstanceId(), permanent, GUID_LOPART(GetLeaderGUID()), bind.save->GetInstanceId());
}
diff --git a/src/game/Group.h b/src/game/Group.h
index 76543dd4873..d09ef616897 100644
--- a/src/game/Group.h
+++ b/src/game/Group.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
#include "GroupReference.h"
#include "GroupRefManager.h"
+#include "BattleGround.h"
#include "LootMgr.h"
#include <map>
@@ -66,24 +67,25 @@ enum GroupUpdateFlags
{
GROUP_UPDATE_FLAG_NONE = 0x00000000, // nothing
GROUP_UPDATE_FLAG_STATUS = 0x00000001, // uint16, flags
- GROUP_UPDATE_FLAG_CUR_HP = 0x00000002, // uint16
- GROUP_UPDATE_FLAG_MAX_HP = 0x00000004, // uint16
+ GROUP_UPDATE_FLAG_CUR_HP = 0x00000002, // uint32
+ GROUP_UPDATE_FLAG_MAX_HP = 0x00000004, // uint32
GROUP_UPDATE_FLAG_POWER_TYPE = 0x00000008, // uint8
GROUP_UPDATE_FLAG_CUR_POWER = 0x00000010, // uint16
GROUP_UPDATE_FLAG_MAX_POWER = 0x00000020, // uint16
GROUP_UPDATE_FLAG_LEVEL = 0x00000040, // uint16
GROUP_UPDATE_FLAG_ZONE = 0x00000080, // uint16
GROUP_UPDATE_FLAG_POSITION = 0x00000100, // uint16, uint16
- GROUP_UPDATE_FLAG_AURAS = 0x00000200, // uint64 mask, for each bit set uint16 spellid + uint8 unk
+ GROUP_UPDATE_FLAG_AURAS = 0x00000200, // uint64 mask, for each bit set uint32 spellid + uint8 unk
GROUP_UPDATE_FLAG_PET_GUID = 0x00000400, // uint64 pet guid
GROUP_UPDATE_FLAG_PET_NAME = 0x00000800, // pet name, NULL terminated string
GROUP_UPDATE_FLAG_PET_MODEL_ID = 0x00001000, // uint16, model id
- GROUP_UPDATE_FLAG_PET_CUR_HP = 0x00002000, // uint16 pet cur health
- GROUP_UPDATE_FLAG_PET_MAX_HP = 0x00004000, // uint16 pet max health
+ GROUP_UPDATE_FLAG_PET_CUR_HP = 0x00002000, // uint32 pet cur health
+ GROUP_UPDATE_FLAG_PET_MAX_HP = 0x00004000, // uint32 pet max health
GROUP_UPDATE_FLAG_PET_POWER_TYPE = 0x00008000, // uint8 pet power type
GROUP_UPDATE_FLAG_PET_CUR_POWER = 0x00010000, // uint16 pet cur power
GROUP_UPDATE_FLAG_PET_MAX_POWER = 0x00020000, // uint16 pet max power
- GROUP_UPDATE_FLAG_PET_AURAS = 0x00040000, // uint64 mask, for each bit set uint16 spellid + uint8 unk, pet auras...
+ GROUP_UPDATE_FLAG_PET_AURAS = 0x00040000, // uint64 mask, for each bit set uint32 spellid + uint8 unk, pet auras...
+ GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00080000, // uint32 vehicle_seat_id (index from VehicleSeat.dbc)
GROUP_UPDATE_PET = 0x0007FC00, // all pet flags
GROUP_UPDATE_FULL = 0x0007FFFF, // all known flags
};
@@ -249,7 +251,7 @@ class TRINITY_DLL_SPEC Group
void ConvertToRaid();
void SetBattlegroundGroup(BattleGround *bg) { m_bgGroup = bg; }
- uint32 CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
+ uint32 CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
void ChangeMembersGroup(const uint64 &guid, const uint8 &group);
void ChangeMembersGroup(Player *player, const uint8 &group);
@@ -291,7 +293,7 @@ class TRINITY_DLL_SPEC Group
void SendUpdate();
void UpdatePlayerOutOfRange(Player* pPlayer);
// ignore: GUID of player that will be ignored
- void BroadcastPacket(WorldPacket *packet, int group=-1, uint64 ignore=0);
+ void BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0);
void BroadcastReadyCheck(WorldPacket *packet);
void OfflineReadyCheck();
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index f63505ae24a..b0094989e19 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -28,10 +28,11 @@
#include "ObjectMgr.h"
#include "Player.h"
#include "Group.h"
-#include "ObjectAccessor.h"
-#include "MapManager.h"
#include "SocialMgr.h"
#include "Util.h"
+#include "SpellAuras.h"
+
+class Aura;
/* differeces from off:
-you can uninvite yourself - is is useful
@@ -59,12 +60,6 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
std::string membername;
recv_data >> membername;
- if(_player->InBattleGround())
- {
- SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_INVITE_RESTRICTED);
- return;
- }
-
// attempt add selected player
// cheating
@@ -107,15 +102,20 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
return;
}
+ Group *group = GetPlayer()->GetGroup();
+ if( group && group->isBGGroup() )
+ group = GetPlayer()->GetOriginalGroup();
+
+ Group *group2 = player->GetGroup();
+ if( group2 && group2->isBGGroup() )
+ group2 = player->GetOriginalGroup();
// player already in another group or invited
- if(player->GetGroup() || player->GetGroupInvite() )
+ if( group2 || player->GetGroupInvite() )
{
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_ALREADY_IN_GROUP);
return;
}
- Group *group = GetPlayer()->GetGroup();
-
if(group)
{
// not have permissions for invite
@@ -161,6 +161,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
// ok, we do it
WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size
+ data << uint8(1); // ok
data << GetPlayer()->GetName();
player->GetSession()->SendPacket(&data);
@@ -193,12 +194,6 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
Player* leader = objmgr.GetPlayer(group->GetLeaderGUID());
- if(leader && leader->InBattleGround())
- {
- SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_INVITE_RESTRICTED);
- return;
- }
-
// forming a new group, create it
if(!group->IsCreated())
{
@@ -208,14 +203,10 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
objmgr.AddGroup(group);
}
- // everything's fine, do it
+ // everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName()))
return;
- uint8 subgroup = group->GetMemberGroup(GetPlayer()->GetGUID());
-
- GetPlayer()->SetGroup(group, subgroup);
-
group->BroadcastGroupUpdate();
}
@@ -224,26 +215,16 @@ void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
Group *group = GetPlayer()->GetGroupInvite();
if (!group) return;
+ // remember leader if online
Player *leader = objmgr.GetPlayer(group->GetLeaderGUID());
- /** error handling **/
+ // uninvite, group can be deleted
+ GetPlayer()->UninviteFromGroup();
+
if(!leader || !leader->GetSession())
return;
- /********************/
-
- // everything's fine, do it
- if(!group->IsCreated())
- {
- // note: this means that if you invite more than one person
- // and one of them declines before the first one accepts
- // all invites will be cleared
- // fixme: is that ok ?
- group->RemoveAllInvites();
- delete group;
- }
-
- GetPlayer()->SetGroupInvite(NULL);
+ // report
WorldPacket data( SMSG_GROUP_DECLINE, 10 ); // guess size
data << GetPlayer()->GetName();
leader->GetSession()->SendPacket( &data );
@@ -445,7 +426,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
data << GetPlayer()->GetGUID();
data << x;
data << y;
- GetPlayer()->GetGroup()->BroadcastPacket(&data, -1, GetPlayer()->GetGUID());
+ GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
}
void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
@@ -472,7 +453,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
data << roll;
data << GetPlayer()->GetGUID();
if(GetPlayer()->GetGroup())
- GetPlayer()->GetGroup()->BroadcastPacket(&data);
+ GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
else
SendPacket(&data);
}
@@ -555,8 +536,20 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
return;
/********************/
+ Player *movedPlayer=objmgr.GetPlayer(name.c_str());
+ if(!movedPlayer)
+ return;
+
+ //Do not allow leader to change group of player in combat
+ if (movedPlayer->isInCombat())
+ {
+ WorldPacket data(SMSG_GROUP_SWAP_FAILED, (0));
+ SendPacket(&data);
+ return;
+ }
+
// everything's fine, do it
- group->ChangeMembersGroup(objmgr.GetPlayer(name.c_str()), groupNr);
+ group->ChangeMembersGroup(movedPlayer, groupNr);
}
void WorldSession::HandleGroupAssistantOpcode( WorldPacket & recv_data )
@@ -626,7 +619,7 @@ void WorldSession::HandleRaidReadyCheckOpcode( WorldPacket & recv_data )
// everything's fine, do it
WorldPacket data(MSG_RAID_READY_CHECK, 8);
data << GetPlayer()->GetGUID();
- group->BroadcastPacket(&data, -1);
+ group->BroadcastPacket(&data, false, -1);
group->OfflineReadyCheck();
}
@@ -691,10 +684,10 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
}
if (mask & GROUP_UPDATE_FLAG_CUR_HP)
- *data << (uint16) player->GetHealth();
+ *data << (uint32) player->GetHealth();
if (mask & GROUP_UPDATE_FLAG_MAX_HP)
- *data << (uint16) player->GetMaxHealth();
+ *data << (uint32) player->GetMaxHealth();
Powers powerType = player->getPowerType();
if (mask & GROUP_UPDATE_FLAG_POWER_TYPE)
@@ -717,14 +710,14 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
if (mask & GROUP_UPDATE_FLAG_AURAS)
{
- uint64 auramask = player->GetAuraUpdateMask();
+ const uint64& auramask = player->GetAuraUpdateMaskForRaid();
*data << uint64(auramask);
for(uint32 i = 0; i < MAX_AURAS; ++i)
{
if(auramask & (uint64(1) << i))
{
- uint32 updatedAura=player->GetUInt32Value(uint16(UNIT_FIELD_AURA + i));
- *data << uint16(updatedAura);
+ Aura * pAura = player->GetVisibleAura(i);
+ *data << uint32(pAura ? pAura->GetId() : 0);
*data << uint8(1);
}
}
@@ -758,17 +751,17 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
if (mask & GROUP_UPDATE_FLAG_PET_CUR_HP)
{
if(pet)
- *data << (uint16) pet->GetHealth();
+ *data << (uint32) pet->GetHealth();
else
- *data << (uint16) 0;
+ *data << (uint32) 0;
}
if (mask & GROUP_UPDATE_FLAG_PET_MAX_HP)
{
if(pet)
- *data << (uint16) pet->GetMaxHealth();
+ *data << (uint32) pet->GetMaxHealth();
else
- *data << (uint16) 0;
+ *data << (uint32) 0;
}
if (mask & GROUP_UPDATE_FLAG_PET_POWER_TYPE)
@@ -799,14 +792,14 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
if(pet)
{
- uint64 auramask = pet->GetAuraUpdateMask();
+ const uint64& auramask = pet->GetAuraUpdateMaskForRaid();
*data << uint64(auramask);
for(uint32 i = 0; i < MAX_AURAS; ++i)
{
if(auramask & (uint64(1) << i))
{
- uint32 updatedAura=pet->GetUInt32Value(uint16(UNIT_FIELD_AURA + i));
- *data << uint16(updatedAura);
+ Aura * pAura = pet->GetVisibleAura(i);
+ *data << uint32(pAura ? pAura->GetId() : 0);
*data << uint8(1);
}
}
@@ -829,6 +822,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
if(!player)
{
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);
+ data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
data.appendPackGUID(Guid);
data << (uint32) GROUP_UPDATE_FLAG_STATUS;
data << (uint16) MEMBER_STATUS_OFFLINE;
@@ -839,6 +833,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
Pet *pet = player->GetPet();
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 4+2+2+2+1+2*6+8+1+8);
+ data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
data.append(player->GetPackGUID());
uint32 mask1 = 0x00040BFF; // common mask, real flags used 0x000040BFF
@@ -848,8 +843,8 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
Powers powerType = player->getPowerType();
data << (uint32) mask1; // group update mask
data << (uint16) MEMBER_STATUS_ONLINE; // member's online status
- data << (uint16) player->GetHealth(); // GROUP_UPDATE_FLAG_CUR_HP
- data << (uint16) player->GetMaxHealth(); // GROUP_UPDATE_FLAG_MAX_HP
+ data << (uint32) player->GetHealth(); // GROUP_UPDATE_FLAG_CUR_HP
+ data << (uint32) player->GetMaxHealth(); // GROUP_UPDATE_FLAG_MAX_HP
data << (uint8) powerType; // GROUP_UPDATE_FLAG_POWER_TYPE
data << (uint16) player->GetPower(powerType); // GROUP_UPDATE_FLAG_CUR_POWER
data << (uint16) player->GetMaxPower(powerType); // GROUP_UPDATE_FLAG_MAX_POWER
@@ -863,11 +858,11 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
data << (uint64) auramask; // placeholder
for(uint8 i = 0; i < MAX_AURAS; ++i)
{
- if(uint32 aura = player->GetUInt32Value(UNIT_FIELD_AURA + i))
+ if(Aura * pAura = player->GetVisibleAura(i))
{
auramask |= (uint64(1) << i);
- data << uint16(aura);
- data << uint8(1);
+ data << (uint32) pAura->GetId();
+ data << (uint8) 1;
}
}
data.put<uint64>(maskPos,auramask); // GROUP_UPDATE_FLAG_AURAS
@@ -878,8 +873,8 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
data << (uint64) pet->GetGUID(); // GROUP_UPDATE_FLAG_PET_GUID
data << pet->GetName(); // GROUP_UPDATE_FLAG_PET_NAME
data << (uint16) pet->GetDisplayId(); // GROUP_UPDATE_FLAG_PET_MODEL_ID
- data << (uint16) pet->GetHealth(); // GROUP_UPDATE_FLAG_PET_CUR_HP
- data << (uint16) pet->GetMaxHealth(); // GROUP_UPDATE_FLAG_PET_MAX_HP
+ data << (uint32) pet->GetHealth(); // GROUP_UPDATE_FLAG_PET_CUR_HP
+ data << (uint32) pet->GetMaxHealth(); // GROUP_UPDATE_FLAG_PET_MAX_HP
data << (uint8) petpowertype; // GROUP_UPDATE_FLAG_PET_POWER_TYPE
data << (uint16) pet->GetPower(petpowertype); // GROUP_UPDATE_FLAG_PET_CUR_POWER
data << (uint16) pet->GetMaxPower(petpowertype); // GROUP_UPDATE_FLAG_PET_MAX_POWER
@@ -889,10 +884,10 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
data << (uint64) petauramask; // placeholder
for(uint8 i = 0; i < MAX_AURAS; ++i)
{
- if(uint32 petaura = pet->GetUInt32Value(UNIT_FIELD_AURA + i))
+ if(Aura * pAura = pet->GetVisibleAura(i))
{
petauramask |= (uint64(1) << i);
- data << (uint16) petaura;
+ data << (uint32) pAura->GetId();
data << (uint8) 1;
}
}
diff --git a/src/game/GroupRefManager.h b/src/game/GroupRefManager.h
index 94741c30279..ab3b6417611 100644
--- a/src/game/GroupRefManager.h
+++ b/src/game/GroupRefManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/GroupReference.cpp b/src/game/GroupReference.cpp
index 24646e3059a..a09fc769dad 100644
--- a/src/game/GroupReference.cpp
+++ b/src/game/GroupReference.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/GroupReference.h b/src/game/GroupReference.h
index 0b338991109..da896cf02dd 100644
--- a/src/game/GroupReference.h
+++ b/src/game/GroupReference.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp
index 07a5bd9f819..710acede150 100644
--- a/src/game/GuardAI.cpp
+++ b/src/game/GuardAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,107 +33,107 @@ int GuardAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_creature(*c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
+GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK)
{
}
void GuardAI::MoveInLineOfSight(Unit *u)
{
// Ignore Z for flying creatures
- if ( !i_creature.canFly() && i_creature.GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE )
+ if ( !m_creature->canFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE )
return;
- if( !i_creature.getVictim() && i_creature.canAttack(u) &&
- ( u->IsHostileToPlayers() || i_creature.IsHostileTo(u) /*|| u->getVictim() && i_creature.IsFriendlyTo(u->getVictim())*/ ) &&
- u->isInAccessiblePlaceFor(&i_creature))
+ if( !m_creature->getVictim() && m_creature->canAttack(u) &&
+ ( u->IsHostileToPlayers() || m_creature->IsHostileTo(u) /*|| u->getVictim() && m_creature->IsFriendlyTo(u->getVictim())*/ ) &&
+ u->isInAccessiblePlaceFor(m_creature))
{
- float attackRadius = i_creature.GetAttackDistance(u);
- if(i_creature.IsWithinDistInMap(u,attackRadius))
+ float attackRadius = m_creature->GetAttackDistance(u);
+ if(m_creature->IsWithinDistInMap(u,attackRadius))
{
//Need add code to let guard support player
AttackStart(u);
- //u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ //u->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
}
}
}
void GuardAI::EnterEvadeMode()
{
- if( !i_creature.isAlive() )
+ if( !m_creature->isAlive() )
{
- DEBUG_LOG("Creature stopped attacking because he's dead [guid=%u]", i_creature.GetGUIDLow());
- i_creature.GetMotionMaster()->MoveIdle();
+ DEBUG_LOG("Creature stopped attacking because he's dead [guid=%u]", m_creature->GetGUIDLow());
+ m_creature->GetMotionMaster()->MoveIdle();
i_state = STATE_NORMAL;
i_victimGuid = 0;
- i_creature.CombatStop();
- i_creature.DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
return;
}
- Unit* victim = ObjectAccessor::GetUnit(i_creature, i_victimGuid );
+ Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid );
if( !victim )
{
- DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", m_creature->GetGUIDLow());
}
else if( !victim ->isAlive() )
{
- DEBUG_LOG("Creature stopped attacking because victim is dead [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is dead [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim ->HasStealthAura() )
{
- DEBUG_LOG("Creature stopped attacking because victim is using stealth [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is using stealth [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim ->isInFlight() )
{
- DEBUG_LOG("Creature stopped attacking because victim is flying away [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is flying away [guid=%u]", m_creature->GetGUIDLow());
}
else
{
- DEBUG_LOG("Creature stopped attacking because victim outran him [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim outran him [guid=%u]", m_creature->GetGUIDLow());
}
- i_creature.RemoveAllAuras();
- i_creature.DeleteThreatList();
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
i_victimGuid = 0;
- i_creature.CombatStop();
+ m_creature->CombatStop();
i_state = STATE_NORMAL;
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
- if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
- i_creature.GetMotionMaster()->MoveTargetedHome();
+ if( m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
+ m_creature->GetMotionMaster()->MoveTargetedHome();
}
void GuardAI::UpdateAI(const uint32 /*diff*/)
{
- // update i_victimGuid if i_creature.getVictim() !=0 and changed
+ // update i_victimGuid if m_creature->getVictim() !=0 and changed
if(!UpdateVictim())
return;
- i_victimGuid = i_creature.getVictim()->GetGUID();
+ i_victimGuid = m_creature->getVictim()->GetGUID();
- if( i_creature.isAttackReady() )
+ if( m_creature->isAttackReady() )
{
- if( i_creature.IsWithinMeleeRange(i_creature.getVictim()))
+ if( m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
- i_creature.AttackerStateUpdate(i_creature.getVictim());
- i_creature.resetAttackTimer();
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
}
}
}
bool GuardAI::IsVisible(Unit *pl) const
{
- return i_creature.GetDistance(pl) < sWorld.getConfig(CONFIG_SIGHT_GUARDER)
- && pl->isVisibleForOrDetect(&i_creature,true);
+ return m_creature->GetDistance(pl) < sWorld.getConfig(CONFIG_SIGHT_GUARDER)
+ && pl->isVisibleForOrDetect(m_creature,true);
}
void GuardAI::JustDied(Unit *killer)
{
if(Player* pkiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
- i_creature.SendZoneUnderAttackMessage(pkiller);
+ m_creature->SendZoneUnderAttackMessage(pkiller);
}
diff --git a/src/game/GuardAI.h b/src/game/GuardAI.h
index b7b3c79607b..db1bfe0229d 100644
--- a/src/game/GuardAI.h
+++ b/src/game/GuardAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ class TRINITY_DLL_DECL GuardAI : public CreatureAI
public:
- GuardAI(Creature *c);
+ explicit GuardAI(Creature *c);
void MoveInLineOfSight(Unit *);
void EnterEvadeMode();
@@ -47,7 +47,6 @@ class TRINITY_DLL_DECL GuardAI : public CreatureAI
static int Permissible(const Creature *);
private:
- Creature &i_creature;
uint64 i_victimGuid;
GuardState i_state;
TimeTracker i_tracker;
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 87dbb81c5c6..b35bdf300bf 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -21,7 +21,6 @@
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "MapManager.h"
#include "Player.h"
#include "Opcodes.h"
#include "ObjectMgr.h"
@@ -29,6 +28,7 @@
#include "Chat.h"
#include "SocialMgr.h"
#include "Util.h"
+#include "Language.h"
Guild::Guild()
{
@@ -52,27 +52,25 @@ Guild::~Guild()
}
-bool Guild::create(uint64 lGuid, std::string gname)
+bool Guild::create(Player* leader, std::string gname)
{
- std::string rname;
- std::string lName;
-
- if(!objmgr.GetPlayerNameByGUID(lGuid, lName))
- return false;
if(objmgr.GetGuildByName(gname))
return false;
- sLog.outDebug("GUILD: creating guild %s to leader: %u", gname.c_str(), GUID_LOPART(lGuid));
+ WorldSession* lSession = leader->GetSession();
+ if(!lSession)
+ return false;
- leaderGuid = lGuid;
+ leaderGuid = leader->GetGUID();
name = gname;
GINFO = "";
MOTD = "No message set.";
guildbank_money = 0;
purchased_tabs = 0;
-
Id = objmgr.GenerateGuildId();
+ sLog.outDebug("GUILD: creating guild %s to leader: %u", gname.c_str(), GUID_LOPART(leaderGuid));
+
// gname already assigned to Guild::name, use it to encode string for DB
CharacterDatabase.escape_string(gname);
@@ -90,18 +88,13 @@ bool Guild::create(uint64 lGuid, std::string gname)
Id, gname.c_str(), GUID_LOPART(leaderGuid), dbGINFO.c_str(), dbMOTD.c_str(), EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, guildbank_money);
CharacterDatabase.CommitTransaction();
- rname = "Guild Master";
- CreateRank(rname,GR_RIGHT_ALL);
- rname = "Officer";
- CreateRank(rname,GR_RIGHT_ALL);
- rname = "Veteran";
- CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
- rname = "Member";
- CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
- rname = "Initiate";
- CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ CreateRank(lSession->GetMangosString(LANG_GUILD_MASTER), GR_RIGHT_ALL);
+ CreateRank(lSession->GetMangosString(LANG_GUILD_OFFICER), GR_RIGHT_ALL);
+ CreateRank(lSession->GetMangosString(LANG_GUILD_VETERAN), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ CreateRank(lSession->GetMangosString(LANG_GUILD_MEMBER), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ CreateRank(lSession->GetMangosString(LANG_GUILD_INITIATE),GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
- return AddMember(lGuid, (uint32)GR_GUILDMASTER);
+ return AddMember(leaderGuid, (uint32)GR_GUILDMASTER);
}
bool Guild::AddMember(uint64 plGuid, uint32 plRank)
@@ -621,7 +614,7 @@ void Guild::CreateRank(std::string name_,uint32 rights)
// name now can be used for encoding to DB
CharacterDatabase.escape_string(name_);
- CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", Id, m_ranks.size(), name_.c_str(), rights );
+ CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", Id, (unsigned int)m_ranks.size(), name_.c_str(), rights );
}
void Guild::AddRank(const std::string& name_,uint32 rights, uint32 money)
@@ -785,6 +778,7 @@ void Guild::Query(WorldSession *session)
data << uint32(BorderStyle);
data << uint32(BorderColor);
data << uint32(BackgroundColor);
+ data << uint32(0); // something new in WotLK
session->SendPacket( &data );
sLog.outDebug( "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)" );
@@ -1603,7 +1597,21 @@ void Guild::DisplayGuildBankLogs(WorldSession *session, uint8 TabId)
{
data << uint8((*itr)->LogEntry);
data << uint64(MAKE_NEW_GUID((*itr)->PlayerGuid,0,HIGHGUID_PLAYER));
- data << uint32((*itr)->ItemOrMoney);
+ if ((*itr)->LogEntry == GUILD_BANK_LOG_DEPOSIT_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_WITHDRAW_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_REPAIR_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_UNK1 ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_UNK2)
+ {
+ data << uint32((*itr)->ItemOrMoney);
+ }
+ else
+ {
+ data << uint32((*itr)->ItemOrMoney);
+ data << uint32((*itr)->ItemStackCount);
+ if ((*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM || (*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM2)
+ data << uint8((*itr)->DestTabId); // moved tab
+ }
data << uint32(time(NULL)-(*itr)->TimeStamp);
}
session->SendPacket(&data);
@@ -1619,10 +1627,21 @@ void Guild::DisplayGuildBankLogs(WorldSession *session, uint8 TabId)
{
data << uint8((*itr)->LogEntry);
data << uint64(MAKE_NEW_GUID((*itr)->PlayerGuid,0,HIGHGUID_PLAYER));
- data << uint32((*itr)->ItemOrMoney);
- data << uint8((*itr)->ItemStackCount);
- if ((*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM || (*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM2)
- data << uint8((*itr)->DestTabId); // moved tab
+ if ((*itr)->LogEntry == GUILD_BANK_LOG_DEPOSIT_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_WITHDRAW_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_REPAIR_MONEY ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_UNK1 ||
+ (*itr)->LogEntry == GUILD_BANK_LOG_UNK2)
+ {
+ data << uint32((*itr)->ItemOrMoney);
+ }
+ else
+ {
+ data << uint32((*itr)->ItemOrMoney);
+ data << uint32((*itr)->ItemStackCount);
+ if ((*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM || (*itr)->LogEntry == GUILD_BANK_LOG_MOVE_ITEM2)
+ data << uint8((*itr)->DestTabId); // moved tab
+ }
data << uint32(time(NULL)-(*itr)->TimeStamp);
}
session->SendPacket(&data);
@@ -1704,7 +1723,7 @@ void Guild::AppendDisplayGuildBankSlot( WorldPacket& data, GuildBankTab const *t
// SuffixFactor +4
data << (uint32) pItem->GetItemSuffixFactor();
// +12 // ITEM_FIELD_STACK_COUNT
- data << uint8(pItem->GetCount());
+ data << uint32(pItem->GetCount());
data << uint32(0); // +16 // Unknown value
data << uint8(0); // unknown 2.4.2
if (uint32 Enchant0 = pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT))
@@ -1961,6 +1980,9 @@ void Guild::SetGuildBankTabText(uint8 TabId, std::string text)
CharacterDatabase.escape_string(text);
CharacterDatabase.PExecute("UPDATE guild_bank_tab SET TabText='%s' WHERE guildid='%u' AND TabId='%u'", text.c_str(), Id, uint32(TabId));
+
+ // announce
+ SendGuildBankTabText(NULL,TabId);
}
void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
@@ -1975,7 +1997,12 @@ void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1+tab->Text.size()+1);
data << uint8(TabId);
data << tab->Text;
- session->SendPacket(&data);
+
+ if(session)
+ session->SendPacket(&data);
+ else
+ BroadcastPacket(&data);
+
}
bool GuildItemPosCount::isContainedIn(GuildItemPosCountVec const &vec) const
diff --git a/src/game/Guild.h b/src/game/Guild.h
index 5dc6c00111d..12dea1feb1f 100644
--- a/src/game/Guild.h
+++ b/src/game/Guild.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,10 +53,11 @@ enum GuildRankRights
GR_RIGHT_VIEWOFFNOTE = 0x00004040,
GR_RIGHT_EOFFNOTE = 0x00008040,
GR_RIGHT_MODIFY_GUILD_INFO = 0x00010040,
- GR_RIGHT_REPAIR_FROM_GUILD = 0x00020000, // unused in 2.4.x?, Remove money withdraw capacity
+ GR_RIGHT_WITHDRAW_GOLD_LOCK = 0x00020000, // remove money withdraw capacity
GR_RIGHT_WITHDRAW_REPAIR = 0x00040000, // withdraw for repair
GR_RIGHT_WITHDRAW_GOLD = 0x00080000, // withdraw gold
- GR_RIGHT_ALL = 0x000FF1FF
+ GR_RIGHT_CREATE_GUILD_EVENT = 0x00100000, // wotlk
+ GR_RIGHT_ALL = 0x001DF1FF
};
enum Typecommand
@@ -156,6 +157,8 @@ enum GuildBankLogEntries
GUILD_BANK_LOG_WITHDRAW_MONEY = 5,
GUILD_BANK_LOG_REPAIR_MONEY = 6,
GUILD_BANK_LOG_MOVE_ITEM2 = 7,
+ GUILD_BANK_LOG_UNK1 = 8,
+ GUILD_BANK_LOG_UNK2 = 9,
};
enum GuildEventLogEntryTypes
@@ -217,12 +220,12 @@ struct GuildBankTab
struct GuildItemPosCount
{
- GuildItemPosCount(uint8 _slot, uint8 _count) : slot(_slot), count(_count) {}
+ GuildItemPosCount(uint8 _slot, uint32 _count) : slot(_slot), count(_count) {}
bool isContainedIn(std::vector<GuildItemPosCount> const& vec) const;
uint8 slot;
- uint8 count;
+ uint32 count;
};
typedef std::vector<GuildItemPosCount> GuildItemPosCountVec;
@@ -266,7 +269,7 @@ class Guild
Guild();
~Guild();
- bool create(uint64 lGuid, std::string gname);
+ bool create(Player* leader, std::string gname);
void Disband();
typedef std::map<uint32, MemberSlot> MemberList;
@@ -314,6 +317,15 @@ class Guild
void BroadcastPacketToRank(WorldPacket *packet, uint32 rankId);
void BroadcastPacket(WorldPacket *packet);
+ template<class Do>
+ void BroadcastWorker(Do& _do, Player* except = NULL)
+ {
+ for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
+ if(Player *player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
+ if(player != except)
+ _do(player);
+ }
+
void CreateRank(std::string name,uint32 rights);
void DelRank();
std::string GetRankName(uint32 rankId);
diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp
index 77e9af49ed3..1b8ec5eb836 100644
--- a/src/game/GuildHandler.cpp
+++ b/src/game/GuildHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,6 @@
#include "Log.h"
#include "Opcodes.h"
#include "Guild.h"
-#include "MapManager.h"
#include "GossipDef.h"
#include "SocialMgr.h"
@@ -65,7 +64,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
return;
Guild *guild = new Guild;
- if(!guild->create(GetPlayer()->GetGUID(),gname))
+ if(!guild->create(GetPlayer(),gname))
{
delete guild;
return;
@@ -375,7 +374,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
guild->ChangeRank(plGuid, (slot->RankId+1));
// Put record into guildlog
- guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (slot->RankId));
+ guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), slot->RankId);
WorldPacket data(SMSG_GUILD_EVENT, (2+30)); // guess size
data << (uint8)GE_DEMOTION;
@@ -663,7 +662,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
guild->SetRankName(rankId, rankname);
if(rankId==GR_GUILDMASTER) // prevent loss leader rights
- rights |= GR_RIGHT_ALL;
+ rights = GR_RIGHT_ALL;
guild->SetRankRights(rankId, rights);
@@ -794,7 +793,7 @@ void WorldSession::HandleGuildSaveEmblemOpcode(WorldPacket& recvPacket)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
recvPacket >> EmblemStyle;
recvPacket >> EmblemColor;
@@ -906,7 +905,7 @@ void WorldSession::HandleGuildBankQuery( WorldPacket & recv_data )
uint8 unk;
recv_data >> GoGuid >> unk;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
if (uint32 GuildId = GetPlayer()->GetGuildId())
@@ -930,7 +929,7 @@ void WorldSession::HandleGuildBankTabColon( WorldPacket & recv_data )
uint8 TabId,unk1;
recv_data >> GoGuid >> TabId >> unk1;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
@@ -959,7 +958,7 @@ void WorldSession::HandleGuildBankDeposit( WorldPacket & recv_data )
if (!money)
return;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
@@ -1007,7 +1006,7 @@ void WorldSession::HandleGuildBankWithdraw( WorldPacket & recv_data )
if (!money)
return;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
@@ -1109,7 +1108,7 @@ void WorldSession::HandleGuildBankDepositItem( WorldPacket & recv_data )
return;
}
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
@@ -1564,7 +1563,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
recv_data >> GoGuid;
recv_data >> TabId;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
@@ -1621,7 +1620,7 @@ void WorldSession::HandleGuildBankModifyTab( WorldPacket & recv_data )
if(IconIndex.empty())
return;
- if (!objmgr.IsGuildVaultGameObject(_player, GoGuid))
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
return;
uint32 GuildId = GetPlayer()->GetGuildId();
diff --git a/src/game/HomeMovementGenerator.cpp b/src/game/HomeMovementGenerator.cpp
index ddf66ad220c..4f0ca2f8cec 100644
--- a/src/game/HomeMovementGenerator.cpp
+++ b/src/game/HomeMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,9 +20,8 @@
#include "HomeMovementGenerator.h"
#include "Creature.h"
+#include "CreatureAI.h"
#include "Traveller.h"
-#include "MapManager.h"
-#include "ObjectAccessor.h"
#include "DestinationHolderImp.h"
#include "WorldPacket.h"
@@ -70,11 +69,14 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
// restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
{
+ //sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)");
owner.SetOrientation(ori);
WorldPacket packet;
owner.BuildHeartBeatMsg(&packet);
owner.SendMessageToSet(&packet, false);
}
+
+ owner.AI()->JustReachedHome();
return false;
}
diff --git a/src/game/HomeMovementGenerator.h b/src/game/HomeMovementGenerator.h
index 12d5f150405..964b5c3e801 100644
--- a/src/game/HomeMovementGenerator.h
+++ b/src/game/HomeMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@ class TRINITY_DLL_SPEC HomeMovementGenerator<Creature>
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
+
private:
void _setTargetLocation(Creature &);
DestinationHolder< Traveller<Creature> > i_destinationHolder;
diff --git a/src/game/HostilRefManager.cpp b/src/game/HostilRefManager.cpp
index f1cb465520e..4a51d54248d 100644
--- a/src/game/HostilRefManager.cpp
+++ b/src/game/HostilRefManager.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#include "HostilRefManager.h"
#include "ThreatManager.h"
#include "Unit.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
#include "SpellMgr.h"
HostilRefManager::~HostilRefManager()
diff --git a/src/game/HostilRefManager.h b/src/game/HostilRefManager.h
index e7addd5479b..316509e3908 100644
--- a/src/game/HostilRefManager.h
+++ b/src/game/HostilRefManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/IdleMovementGenerator.cpp b/src/game/IdleMovementGenerator.cpp
index c6598409b44..67f89303e40 100644
--- a/src/game/IdleMovementGenerator.cpp
+++ b/src/game/IdleMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
*/
#include "IdleMovementGenerator.h"
-#include "Creature.h"
+#include "Unit.h"
IdleMovementGenerator si_idleMovement;
diff --git a/src/game/IdleMovementGenerator.h b/src/game/IdleMovementGenerator.h
index ac5a4da529c..7ada9f08f52 100644
--- a/src/game/IdleMovementGenerator.h
+++ b/src/game/IdleMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/InstanceData.cpp b/src/game/InstanceData.cpp
index ac607bfd7ac..808ebca2f59 100644
--- a/src/game/InstanceData.cpp
+++ b/src/game/InstanceData.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,8 +30,8 @@ void InstanceData::SaveToDB()
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%d'", data.c_str(), instance->GetInstanceId());
}
-void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go)
-{
+void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go)
+{
if(!go)
go = instance->GetGameObjectInMap(GUID);
if(go)
diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h
index ec36a794525..c33beccfffb 100644
--- a/src/game/InstanceData.h
+++ b/src/game/InstanceData.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -67,6 +67,10 @@ class TRINITY_DLL_SPEC InstanceData
//called on creature creation
virtual void OnCreatureCreate(Creature * /*creature*/, uint32 /*creature_entry*/) {}
+ //All-purpose data storage 64 bit
+ virtual uint64 GetData64(uint32 /*Data*/) { return 0; }
+ virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { }
+
//All-purpose data storage 32 bit
virtual uint32 GetData(uint32) { return 0; }
virtual void SetData(uint32, uint32 data) {}
diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp
index ba34f949a5f..d4232a71838 100644
--- a/src/game/InstanceSaveMgr.cpp
+++ b/src/game/InstanceSaveMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -19,13 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "InstanceSaveMgr.h"
#include "Common.h"
#include "Database/SQLStorage.h"
#include "Player.h"
#include "GridNotifiers.h"
-#include "WorldSession.h"
#include "Log.h"
#include "GridStates.h"
#include "CellImpl.h"
@@ -37,7 +35,6 @@
#include "GridNotifiersImpl.h"
#include "Config/ConfigEnv.h"
#include "Transports.h"
-#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "World.h"
#include "Group.h"
@@ -142,9 +139,8 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
}
}
-InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty,
- time_t resetTime, bool canReset)
-: m_mapid(MapId), m_instanceid(InstanceId), m_resetTime(resetTime),
+InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, uint8 difficulty, time_t resetTime, bool canReset)
+: m_resetTime(resetTime), m_instanceid(InstanceId), m_mapid(MapId),
m_difficulty(difficulty), m_canReset(canReset)
{
}
@@ -270,7 +266,7 @@ void InstanceSaveManager::CleanupInstances()
// creature_respawn and gameobject_respawn are in another database
// first, obtain total instance set
- std::set< uint32 > InstanceSet;
+ std::set<uint32> InstanceSet;
QueryResult *result = CharacterDatabase.Query("SELECT id FROM instance");
if( result )
{
@@ -322,7 +318,7 @@ void InstanceSaveManager::PackInstances()
// TODO: this can be done a LOT more efficiently
// obtain set of all associations
- std::set< uint32 > InstanceSet;
+ std::set<uint32> InstanceSet;
// all valid ids are in the instance table
// any associations to ids not in this table are assumed to be
@@ -344,7 +340,7 @@ void InstanceSaveManager::PackInstances()
uint32 InstanceNumber = 1;
// we do assume std::set is sorted properly on integer value
- for (std::set< uint32 >::iterator i = InstanceSet.begin(); i != InstanceSet.end(); ++i)
+ for (std::set<uint32>::iterator i = InstanceSet.begin(); i != InstanceSet.end(); ++i)
{
if (*i != InstanceNumber)
{
@@ -361,8 +357,8 @@ void InstanceSaveManager::PackInstances()
bar.step();
}
- sLog.outString();
sLog.outString( ">> Instance numbers remapped, next instance id is %u", InstanceNumber );
+ sLog.outString();
}
void InstanceSaveManager::LoadResetTimes()
@@ -375,14 +371,14 @@ void InstanceSaveManager::LoadResetTimes()
// get the current reset times for normal instances (these may need to be updated)
// these are only kept in memory for InstanceSaves that are loaded later
// resettime = 0 in the DB for raid/heroic instances so those are skipped
- typedef std::map<uint32, std::pair<uint32, uint64> > ResetTimeMapType;
+ typedef std::map<uint32, std::pair<uint32, time_t> > ResetTimeMapType;
ResetTimeMapType InstResetTime;
QueryResult *result = CharacterDatabase.Query("SELECT id, map, resettime FROM instance WHERE resettime > 0");
if( result )
{
do
{
- if(uint64 resettime = (*result)[2].GetUInt64())
+ if(time_t resettime = time_t((*result)[2].GetUInt64()))
{
uint32 id = (*result)[0].GetUInt32();
uint32 mapid = (*result)[1].GetUInt32();
@@ -400,11 +396,11 @@ void InstanceSaveManager::LoadResetTimes()
{
Field *fields = result->Fetch();
uint32 instance = fields[1].GetUInt32();
- uint64 resettime = fields[0].GetUInt64() + 2 * HOUR;
+ time_t resettime = time_t(fields[0].GetUInt64() + 2 * HOUR);
ResetTimeMapType::iterator itr = InstResetTime.find(instance);
if(itr != InstResetTime.end() && itr->second.second != resettime)
{
- CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", resettime, instance);
+ CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", uint64(resettime), instance);
itr->second.second = resettime;
}
}
@@ -454,7 +450,7 @@ void InstanceSaveManager::LoadResetTimes()
// add the global reset times to the priority queue
for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
{
- InstanceTemplate* temp = (InstanceTemplate*)objmgr.GetInstanceTemplate(i);
+ InstanceTemplate const* temp = objmgr.GetInstanceTemplate(i);
if(!temp) continue;
// only raid/heroic maps have a global reset time
const MapEntry* entry = sMapStore.LookupEntry(temp->map);
@@ -583,7 +579,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
{
// global reset for all instances of the given map
// note: this isn't fast but it's meant to be executed very rarely
- Map *map = (MapInstanced*)MapManager::Instance().GetBaseMap(mapid);
+ Map const *map = MapManager::Instance().GetBaseMap(mapid);
if(!map->Instanceable())
return;
uint64 now = (uint64)time(NULL);
@@ -591,7 +587,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
if(!warn)
{
// this is called one minute before the reset time
- InstanceTemplate* temp = (InstanceTemplate*)objmgr.GetInstanceTemplate(mapid);
+ InstanceTemplate const* temp = objmgr.GetInstanceTemplate(mapid);
if(!temp || !temp->reset_delay)
{
sLog.outError("InstanceSaveManager::ResetOrWarnAll: no instance template or reset delay for map %d", mapid);
diff --git a/src/game/InstanceSaveMgr.h b/src/game/InstanceSaveMgr.h
index 58b891b3a9f..2a913e5cedf 100644
--- a/src/game/InstanceSaveMgr.h
+++ b/src/game/InstanceSaveMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 766bd81d640..26f49097b65 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -206,6 +206,10 @@ bool ItemCanGoIntoBag(ItemPrototype const *pProto, ItemPrototype const *pBagProt
if(!(pProto->BagFamily & BAG_FAMILY_MASK_LEATHERWORKING_SUPP))
return false;
return true;
+ case ITEM_SUBCLASS_INSCRIPTION_CONTAINER:
+ if(!(pProto->BagFamily & BAG_FAMILY_MASK_INSCRIPTION_SUPP))
+ return false;
+ return true;
default:
return false;
}
@@ -261,7 +265,7 @@ bool Item::Create( uint32 guidlow, uint32 itemid, Player const* owner)
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, itemProto->MaxDurability);
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
- for(int i = 0; i < 5; ++i)
+ for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
SetUInt32Value(ITEM_FIELD_FLAGS, itemProto->Flags);
@@ -284,7 +288,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
}
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
- SetState(ITEM_CHANGED); // save new time in database
+ SetState(ITEM_CHANGED, owner); // save new time in database
}
void Item::SaveToDB()
@@ -346,7 +350,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
if (!result)
{
- sLog.outError("ERROR: Item (GUID: %u owner: %u) not found in table `item_instance`, can't load. ",guid,GUID_LOPART(owner_guid));
+ sLog.outError("Item (GUID: %u owner: %u) not found in table `item_instance`, can't load. ",guid,GUID_LOPART(owner_guid));
return false;
}
@@ -354,7 +358,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
if(!LoadValues(fields[0].GetString()))
{
- sLog.outError("ERROR: Item #%d have broken data in `data` field. Can't be loaded.",guid);
+ sLog.outError("Item #%d have broken data in `data` field. Can't be loaded.",guid);
if (delete_result) delete result;
return false;
}
@@ -450,7 +454,7 @@ uint32 Item::GetSkill()
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,SKILL_CLOTH,SKILL_LEATHER,SKILL_MAIL,SKILL_PLATE_MAIL,0,SKILL_SHIELD,0,0,0,0
};
ItemPrototype const* proto = GetProto();
@@ -752,7 +756,12 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
if(spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
{
- if((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
+ // Special case - accept weapon type for main and offhand requirements
+ if(proto->InventoryType == INVTYPE_WEAPON &&
+ (spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) ||
+ spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND)))
+ return true;
+ else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
return false; // inventory type not present in mask
}
@@ -765,9 +774,9 @@ void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint
if((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges))
return;
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET,id);
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET,id);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
SetState(ITEM_CHANGED);
}
@@ -776,7 +785,7 @@ void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration)
if(GetEnchantmentDuration(slot) == duration)
return;
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
SetState(ITEM_CHANGED);
}
@@ -785,7 +794,7 @@ void Item::SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges)
if(GetEnchantmentCharges(slot) == charges)
return;
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
SetState(ITEM_CHANGED);
}
@@ -795,14 +804,14 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
return;
for(uint8 x = 0; x < 3; ++x)
- SetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + x, 0);
+ SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + x, 0);
SetState(ITEM_CHANGED);
}
bool Item::GemsFitSockets() const
{
bool fits = true;
- for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
{
uint8 SocketColor = GetProto()->Socket[enchant_slot-SOCK_ENCHANTMENT_SLOT].Color;
@@ -842,7 +851,7 @@ bool Item::GemsFitSockets() const
uint8 Item::GetGemCountWithID(uint32 GemID) const
{
uint8 count = 0;
- for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
{
uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
if(!enchant_id)
@@ -858,6 +867,29 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const
return count;
}
+uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
+{
+ uint8 count = 0;
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
+ {
+ uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
+ if(!enchant_id)
+ continue;
+
+ SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+ if(!enchantEntry)
+ continue;
+
+ ItemPrototype const* gemProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID);
+ if(!gemProto)
+ continue;
+
+ if(gemProto->ItemLimitCategory==limitCategory)
+ ++count;
+ }
+ return count;
+}
+
bool Item::IsLimitedToAnotherMapOrZone( uint32 cur_mapId, uint32 cur_zoneId) const
{
ItemPrototype const* proto = GetProto();
@@ -886,8 +918,8 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
ItemPrototype const *pProto = objmgr.GetItemPrototype( item );
if( pProto )
{
- if ( count > pProto->Stackable )
- count = pProto->Stackable;
+ if ( count > pProto->GetMaxStackSize())
+ count = pProto->GetMaxStackSize();
assert(count !=0 && "pProto->Stackable==0 but checked at loading already");
diff --git a/src/game/Item.h b/src/game/Item.h
index 3417f2fcc6d..824375cea8d 100644
--- a/src/game/Item.h
+++ b/src/game/Item.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -148,29 +148,32 @@ enum SellFailure
// -1 from client enchantment slot number
enum EnchantmentSlot
{
- PERM_ENCHANTMENT_SLOT = 0,
- TEMP_ENCHANTMENT_SLOT = 1,
- SOCK_ENCHANTMENT_SLOT = 2,
- SOCK_ENCHANTMENT_SLOT_2 = 3,
- SOCK_ENCHANTMENT_SLOT_3 = 4,
- BONUS_ENCHANTMENT_SLOT = 5,
- MAX_INSPECTED_ENCHANTMENT_SLOT = 6,
-
- PROP_ENCHANTMENT_SLOT_0 = 6, // used with RandomSuffix
- PROP_ENCHANTMENT_SLOT_1 = 7, // used with RandomSuffix
- PROP_ENCHANTMENT_SLOT_2 = 8, // used with RandomSuffix and RandomProperty
- PROP_ENCHANTMENT_SLOT_3 = 9, // used with RandomProperty
- PROP_ENCHANTMENT_SLOT_4 = 10, // used with RandomProperty
- MAX_ENCHANTMENT_SLOT = 11
+ PERM_ENCHANTMENT_SLOT = 0,
+ TEMP_ENCHANTMENT_SLOT = 1,
+ SOCK_ENCHANTMENT_SLOT = 2,
+ SOCK_ENCHANTMENT_SLOT_2 = 3,
+ SOCK_ENCHANTMENT_SLOT_3 = 4,
+ BONUS_ENCHANTMENT_SLOT = 5,
+ PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment
+ MAX_INSPECTED_ENCHANTMENT_SLOT = 7,
+
+ PROP_ENCHANTMENT_SLOT_0 = 7, // used with RandomSuffix
+ PROP_ENCHANTMENT_SLOT_1 = 8, // used with RandomSuffix
+ PROP_ENCHANTMENT_SLOT_2 = 9, // used with RandomSuffix and RandomProperty
+ PROP_ENCHANTMENT_SLOT_3 = 10, // used with RandomProperty
+ PROP_ENCHANTMENT_SLOT_4 = 11, // used with RandomProperty
+ MAX_ENCHANTMENT_SLOT = 12
};
-#define MAX_VISIBLE_ITEM_OFFSET 16 // 16 fields per visible item (creator(2) + enchantments(12) + properties(1) + pad(1))
+#define MAX_VISIBLE_ITEM_OFFSET 18 // 18 fields per visible item (creator(2) + enchantments(13) + properties(1) + seed(1) + pad(1))
+
+#define MAX_GEM_SOCKETS MAX_ITEM_PROTO_SOCKETS// (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT) and item proto size, equal value expected
enum EnchantmentOffset
{
ENCHANTMENT_ID_OFFSET = 0,
ENCHANTMENT_DURATION_OFFSET = 1,
- ENCHANTMENT_CHARGES_OFFSET = 2
+ ENCHANTMENT_CHARGES_OFFSET = 2 // now here not only charges, but something new in wotlk
};
#define MAX_ENCHANTMENT_OFFSET 3
@@ -211,6 +214,7 @@ class TRINITY_DLL_SPEC Item : public Object
void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS,ITEM_FLAGS_BINDED,val); }
bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_BINDED); }
+ bool IsAccountBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_BOA); }
bool IsBindedNotWith(uint64 guid) const { return IsSoulBound() && GetOwnerGUID()!= guid; }
bool IsBoundByEnchant() const;
virtual void SaveToDB();
@@ -230,8 +234,9 @@ class TRINITY_DLL_SPEC Item : public Object
uint32 GetCount() const { return GetUInt32Value (ITEM_FIELD_STACK_COUNT); }
void SetCount(uint32 value) { SetUInt32Value (ITEM_FIELD_STACK_COUNT, value); }
- uint32 GetMaxStackCount() const { return GetProto()->Stackable; }
+ uint32 GetMaxStackCount() const { return GetProto()->GetMaxStackSize(); }
uint8 GetGemCountWithID(uint32 GemID) const;
+ uint8 GetGemCountWithLimitCategory(uint32 limitCategory) const;
uint8 GetSlot() const {return m_slot;}
Bag *GetContainer() { return m_container; }
@@ -256,9 +261,9 @@ class TRINITY_DLL_SPEC Item : public Object
void SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration);
void SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges);
void ClearEnchantment(EnchantmentSlot slot);
- uint32 GetEnchantmentId(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET);}
- uint32 GetEnchantmentDuration(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET);}
- uint32 GetEnchantmentCharges(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET);}
+ uint32 GetEnchantmentId(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET);}
+ uint32 GetEnchantmentDuration(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET);}
+ uint32 GetEnchantmentCharges(EnchantmentSlot slot) const { return GetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET);}
void SendTimeUpdate(Player* owner);
void UpdateDuration(Player* owner, uint32 diff);
@@ -282,13 +287,10 @@ class TRINITY_DLL_SPEC Item : public Object
uState = state;
}
- bool hasQuest(uint32 quest_id) const
- {
- ItemPrototype const *itemProto = GetProto();
- return itemProto && itemProto->StartQuest == quest_id;
- }
+ bool hasQuest(uint32 quest_id) const { return GetProto()->StartQuest == quest_id; }
bool hasInvolvedQuest(uint32 /*quest_id*/) const { return false; }
-
+ bool IsPotion() const { return GetProto()->IsPotion(); }
+ bool IsConjuredConsumable() const { return GetProto()->IsConjuredConsumable(); }
private:
uint8 m_slot;
Bag *m_container;
diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp
index 3326fb56e96..e4b2d809582 100644
--- a/src/game/ItemEnchantmentMgr.cpp
+++ b/src/game/ItemEnchantmentMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ItemEnchantmentMgr.h b/src/game/ItemEnchantmentMgr.h
index 17cf634860e..ce627515aee 100644
--- a/src/game/ItemEnchantmentMgr.h
+++ b/src/game/ItemEnchantmentMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp
index 0e46115de08..aef5ea829c6 100644
--- a/src/game/ItemHandler.cpp
+++ b/src/game/ItemHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "Opcodes.h"
#include "Log.h"
#include "ObjectMgr.h"
@@ -324,7 +323,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->ItemId;
data << pProto->Class;
data << pProto->SubClass;
- data << uint32(-1); // new 2.0.3, not exist in wdb cache?
+ data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache?
data << Name;
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00);
@@ -346,15 +345,18 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->RequiredCityRank;
data << pProto->RequiredReputationFaction;
data << pProto->RequiredReputationRank;
- data << pProto->MaxCount;
- data << pProto->Stackable;
+ data << int32(pProto->MaxCount);
+ data << int32(pProto->Stackable);
data << pProto->ContainerSlots;
- for(int i = 0; i < 10; i++)
+ data << pProto->StatsCount; // item stats count
+ for(uint32 i = 0; i < pProto->StatsCount; ++i)
{
data << pProto->ItemStat[i].ItemStatType;
data << pProto->ItemStat[i].ItemStatValue;
}
- for(int i = 0; i < 5; i++)
+ data << pProto->ScalingStatDistribution; // scaling stats distribution
+ data << pProto->ScalingStatValue; // some kind of flags used to determine stat values column
+ for(int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
{
data << pProto->Damage[i].DamageMin;
data << pProto->Damage[i].DamageMax;
@@ -374,7 +376,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->AmmoType;
data << pProto->RangedModRange;
- for(int s = 0; s < 5; s++)
+ for(int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
{
// send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown
// use `item_template` or if not set then only use spell cooldowns
@@ -417,7 +419,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->PageMaterial;
data << pProto->StartQuest;
data << pProto->LockID;
- data << pProto->Material;
+ data << int32(pProto->Material);
data << pProto->Sheath;
data << pProto->RandomProperty;
data << pProto->RandomSuffix;
@@ -428,7 +430,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch
data << pProto->BagFamily;
data << pProto->TotemCategory;
- for(int s = 0; s < 3; s++)
+ for(int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s)
{
data << pProto->Socket[s].Color;
data << pProto->Socket[s].Content;
@@ -437,7 +439,8 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->GemProperties;
data << pProto->RequiredDisenchantSkill;
data << pProto->ArmorDamageModifier;
- data << uint32(0); // added in 2.4.2.8209, duration (seconds)
+ data << pProto->Duration; // added in 2.4.2.8209, duration (seconds)
+ data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory
SendPacket( &data );
}
else
@@ -525,7 +528,7 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *pItem = _player->GetItemByGuid( itemguid );
if( pItem )
@@ -630,7 +633,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *pItem = _player->GetItemFromBuyBackSlot( slot );
if( pItem )
@@ -717,7 +720,7 @@ void WorldSession::SendListInventory( uint64 vendorguid )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
pCreature->StopMoving();
@@ -738,7 +741,7 @@ void WorldSession::SendListInventory( uint64 vendorguid )
float discountMod = _player->GetReputationPriceDiscount(pCreature);
- for(int i = 0; i < numitems; i++ )
+ for(int i = 0; i < numitems; ++i )
{
if(VendorItem const* crItem = vItems->GetItem(i))
{
@@ -824,10 +827,23 @@ void WorldSession::HandleAutoStoreBagItemOpcode( WorldPacket & recv_data )
_player->StoreItem( dest, pItem, true );
}
-void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& /*recvPacket*/)
+void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
{
+ CHECK_PACKET_SIZE(recvPacket, 8);
+
sLog.outDebug("WORLD: CMSG_BUY_BANK_SLOT");
+ uint64 guid;
+ recvPacket >> guid;
+
+ // cheating protection
+ Creature *pCreature = ObjectAccessor::GetNPCIfCanInteractWith(*_player, guid, UNIT_NPC_FLAG_BANKER);
+ if(!pCreature)
+ {
+ sLog.outDebug( "WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
+ return;
+ }
+
uint32 slot = _player->GetByteValue(PLAYER_BYTES_2, 2);
// next slot
@@ -845,6 +861,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& /*recvPacket*/)
if (_player->GetMoney() < price)
return;
+ _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT, slot);
_player->SetByteValue(PLAYER_BYTES_2, 2, slot);
_player->ModifyMoney(-int32(price));
}
@@ -1106,120 +1123,193 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
{
sLog.outDebug("WORLD: CMSG_SOCKET_GEMS");
- CHECK_PACKET_SIZE(recv_data,8*4);
-
- uint64 guids[4];
- uint32 GemEnchants[3], OldEnchants[3];
- Item *Gems[3];
- bool SocketBonusActivated, SocketBonusToBeActivated;
+ CHECK_PACKET_SIZE(recv_data,8+8*MAX_GEM_SOCKETS);
- for(int i = 0; i < 4; i++)
- recv_data >> guids[i];
+ uint64 item_guid;
+ uint64 gem_guids[MAX_GEM_SOCKETS];
- if(!guids[0])
+ recv_data >> item_guid;
+ if(!item_guid)
return;
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
+ recv_data >> gem_guids[i];
+
//cheat -> tried to socket same gem multiple times
- if((guids[1] && (guids[1] == guids[2] || guids[1] == guids[3])) || (guids[2] && (guids[2] == guids[3])))
+ if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
+ (gem_guids[1] && (gem_guids[1] == gem_guids[2])))
return;
- Item *itemTarget = _player->GetItemByGuid(guids[0]);
+ Item *itemTarget = _player->GetItemByGuid(item_guid);
if(!itemTarget) //missing item to socket
return;
+ ItemPrototype const* itemProto = itemTarget->GetProto();
+ if(!itemProto)
+ return;
+
//this slot is excepted when applying / removing meta gem bonus
- uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT;
+ uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT);
- for(int i = 0; i < 3; i++)
- Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL;
+ Item *Gems[MAX_GEM_SOCKETS];
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
+ Gems[i] = gem_guids[i] ? _player->GetItemByGuid(gem_guids[i]) : NULL;
- GemPropertiesEntry const *GemProps[3];
- for(int i = 0; i < 3; ++i) //get geminfo from dbc storage
- {
+ GemPropertiesEntry const *GemProps[MAX_GEM_SOCKETS];
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL;
- }
- for(int i = 0; i < 3; ++i) //check for hack maybe
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe
{
- // tried to put gem in socket where no socket exists / tried to put normal gem in meta socket
+ if (!GemProps[i])
+ continue;
+
+ // tried to put gem in socket where no socket exists (take care about prismatic sockets)
+ if (!itemProto->Socket[i].Color)
+ {
+ // no prismatic socket
+ if(!itemTarget->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT))
+ return;
+
+ // not first not-colored (not normaly used) socket
+ if(i!=0 && !itemProto->Socket[i-1].Color && (i+1 >= MAX_GEM_SOCKETS || itemProto->Socket[i+1].Color))
+ return;
+
+ // ok, this is first not colored socket for item with prismatic socket
+ }
+
+ // tried to put normal gem in meta socket
+ if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META)
+ return;
+
// tried to put meta gem in normal socket
- if( GemProps[i] && ( !itemTarget->GetProto()->Socket[i].Color ||
- itemTarget->GetProto()->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META ||
- itemTarget->GetProto()->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META ) )
+ if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META)
return;
}
- for(int i = 0; i < 3; ++i) //get new and old enchantments
+ uint32 GemEnchants[MAX_GEM_SOCKETS];
+ uint32 OldEnchants[MAX_GEM_SOCKETS];
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
{
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
}
// check unique-equipped conditions
- for(int i = 0; i < 3; ++i)
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
{
- if (Gems[i] && (Gems[i]->GetProto()->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED))
+ if(!Gems[i])
+ continue;
+
+ // continue check for case when attempt add 2 similar unique equipped gems in one item.
+ ItemPrototype const* iGemProto = Gems[i]->GetProto();
+
+ // unique item (for new and already placed bit removed enchantments
+ if (iGemProto->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED)
{
- // for equipped item check all equipment for duplicate equipped gems
- if(itemTarget->IsEquipped())
+ for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{
- if(GetPlayer()->GetItemOrItemWithGemEquipped(Gems[i]->GetEntry()))
+ if(i==j) // skip self
+ continue;
+
+ if (Gems[j])
{
- _player->SendEquipError( EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE, itemTarget, NULL );
- return;
+ if (iGemProto->ItemId == Gems[j]->GetEntry())
+ {
+ _player->SendEquipError( EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL );
+ return;
+ }
+ }
+ else if(OldEnchants[j])
+ {
+ if(SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
+ {
+ if (iGemProto->ItemId == enchantEntry->GemID)
+ {
+ _player->SendEquipError( EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL );
+ return;
+ }
+ }
}
+
}
+ }
- // continue check for case when attempt add 2 similar unique equipped gems in one item.
- for (int j = 0; j < 3; ++j)
+ // unique limit type item
+ int32 limit_newcount = 0;
+ if (iGemProto->ItemLimitCategory)
+ {
+ if(ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(iGemProto->ItemLimitCategory))
{
- if ((i != j) && (Gems[j]) && (Gems[i]->GetProto()->ItemId == Gems[j]->GetProto()->ItemId))
+ for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
+ {
+ if (Gems[j])
+ {
+ // destroyed gem
+ if (OldEnchants[j])
+ {
+ if(SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
+ if(ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
+ if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
+ --limit_newcount;
+ }
+
+ // new gem
+ if (iGemProto->ItemLimitCategory == Gems[j]->GetProto()->ItemLimitCategory)
+ ++limit_newcount;
+ }
+ // existed gem
+ else if(OldEnchants[j])
+ {
+ if(SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
+ if(ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
+ if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
+ ++limit_newcount;
+ }
+ }
+
+ if(limit_newcount > 0 && uint32(limit_newcount) > limitEntry->maxCount)
{
_player->SendEquipError( EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL );
return;
}
}
- for (int j = 0; j < 3; ++j)
- {
- if (OldEnchants[j])
- {
- SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]);
- if(!enchantEntry)
- continue;
+ }
- if ((enchantEntry->GemID == Gems[i]->GetProto()->ItemId) && (i != j))
- {
- _player->SendEquipError( EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL );
- return;
- }
- }
+ // for equipped item check all equipment for duplicate equipped gems
+ if(itemTarget->IsEquipped())
+ {
+ if(uint8 res = _player->CanEquipUniqueItem(Gems[i],slot,limit_newcount >= 0 ? limit_newcount : 0))
+ {
+ _player->SendEquipError( res, itemTarget, NULL );
+ return;
}
}
}
- SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus
+ bool SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus
_player->ToggleMetaGemsActive(slot, false); //turn off all metagems (except for the target item)
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
//remove ALL enchants
- for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),false);
- for(int i = 0; i < 3; ++i)
+ for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
{
if(GemEnchants[i])
{
itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i],0,0);
- if(Item* guidItem = _player->GetItemByGuid(guids[i + 1]))
+ if(Item* guidItem = _player->GetItemByGuid(gem_guids[i]))
_player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true );
}
}
- for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
- SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
+ bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
if(SocketBonusActivated ^ SocketBonusToBeActivated) //if there was a change...
{
_player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,false);
diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h
index 15b01faf5a2..3967b37622b 100644
--- a/src/game/ItemPrototype.h
+++ b/src/game/ItemPrototype.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -57,10 +57,18 @@ enum ItemModType
ITEM_MOD_CRIT_TAKEN_RATING = 34,
ITEM_MOD_RESILIENCE_RATING = 35,
ITEM_MOD_HASTE_RATING = 36,
- ITEM_MOD_EXPERTISE_RATING = 37
+ ITEM_MOD_EXPERTISE_RATING = 37,
+ ITEM_MOD_ATTACK_POWER = 38,
+ ITEM_MOD_RANGED_ATTACK_POWER = 39,
+ ITEM_MOD_FERAL_ATTACK_POWER = 40,
+ ITEM_MOD_SPELL_HEALING_DONE = 41,
+ ITEM_MOD_SPELL_DAMAGE_DONE = 42,
+ ITEM_MOD_MANA_REGENERATION = 43,
+ ITEM_MOD_ARMOR_PENETRATION_RATING = 44,
+ ITEM_MOD_SPELL_POWER = 45
};
-#define MAX_ITEM_MOD 38
+#define MAX_ITEM_MOD 46
enum ItemSpelltriggerType
{
@@ -68,6 +76,12 @@ enum ItemSpelltriggerType
ITEM_SPELLTRIGGER_ON_EQUIP = 1,
ITEM_SPELLTRIGGER_CHANCE_ON_HIT = 2,
ITEM_SPELLTRIGGER_SOULSTONE = 4,
+ /*
+ * ItemSpelltriggerType 5 might have changed on 2.4.3/3.0.3: Such auras
+ * will be applied on item pickup and removed on item loss - maybe on the
+ * other hand the item is destroyed if the aura is removed ("removed on
+ * death" of spell 57348 makes me think so)
+ */
ITEM_SPELLTRIGGER_ON_NO_DELAY_USE = 5, // no equip cooldown
ITEM_SPELLTRIGGER_LEARN_SPELL_ID = 6 // used in item_template.spell_2 with spell_id with SPELL_GENERIC_LEARN in spell_1
};
@@ -93,9 +107,11 @@ enum ITEM_FLAGS
ITEM_FLAGS_CONJURED = 0x00000002,
ITEM_FLAGS_OPENABLE = 0x00000004,
ITEM_FLAGS_WRAPPED = 0x00000008,
+ ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability==0)
ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper
ITEM_FLAGS_PARTY_LOOT = 0x00000800, // determines if item is party loot or not
ITEM_FLAGS_CHARTER = 0x00002000, // arena/guild charter
+ ITEM_FLAGS_PROSPECTABLE = 0x00040000,
ITEM_FLAGS_UNIQUE_EQUIPPED = 0x00080000,
ITEM_FLAGS_USEABLE_IN_ARENA = 0x00200000,
ITEM_FLAGS_THROWABLE = 0x00400000, // not used in game for check trow possibility, only for item in game tooltip
@@ -185,10 +201,11 @@ enum ItemClass
ITEM_CLASS_QUEST = 12,
ITEM_CLASS_KEY = 13,
ITEM_CLASS_PERMANENT = 14,
- ITEM_CLASS_JUNK = 15
+ ITEM_CLASS_MISC = 15,
+ ITEM_CLASS_GLYPH = 16
};
-#define MAX_ITEM_CLASS 16
+#define MAX_ITEM_CLASS 17
enum ItemSubclassConsumable
{
@@ -214,10 +231,11 @@ enum ItemSubclassContainer
ITEM_SUBCLASS_ENGINEERING_CONTAINER = 4,
ITEM_SUBCLASS_GEM_CONTAINER = 5,
ITEM_SUBCLASS_MINING_CONTAINER = 6,
- ITEM_SUBCLASS_LEATHERWORKING_CONTAINER = 7
+ ITEM_SUBCLASS_LEATHERWORKING_CONTAINER = 7,
+ ITEM_SUBCLASS_INSCRIPTION_CONTAINER = 8
};
-#define MAX_ITEM_SUBCLASS_CONTAINER 8
+#define MAX_ITEM_SUBCLASS_CONTAINER 9
enum ItemSubclassWeapon
{
@@ -272,10 +290,11 @@ enum ItemSubclassArmor
ITEM_SUBCLASS_ARMOR_SHIELD = 6,
ITEM_SUBCLASS_ARMOR_LIBRAM = 7,
ITEM_SUBCLASS_ARMOR_IDOL = 8,
- ITEM_SUBCLASS_ARMOR_TOTEM = 9
+ ITEM_SUBCLASS_ARMOR_TOTEM = 9,
+ ITEM_SUBCLASS_ARMOR_SIGIL = 10
};
-#define MAX_ITEM_SUBCLASS_ARMOR 10
+#define MAX_ITEM_SUBCLASS_ARMOR 11
enum ItemSubclassReagent
{
@@ -310,10 +329,12 @@ enum ItemSubclassTradeGoods
ITEM_SUBCLASS_ELEMENTAL = 10,
ITEM_SUBCLASS_TRADE_GOODS_OTHER = 11,
ITEM_SUBCLASS_ENCHANTING = 12,
- ITEM_SUBCLASS_MATERIAL = 13 // Added in 2.4.2
+ ITEM_SUBCLASS_MATERIAL = 13,
+ ITEM_SUBCLASS_ARMOR_ENCHANTMENT = 14,
+ ITEM_SUBCLASS_WEAPON_ENCHANTMENT = 15
};
-#define MAX_ITEM_SUBCLASS_TRADE_GOODS 14
+#define MAX_ITEM_SUBCLASS_TRADE_GOODS 16
enum ItemSubclassGeneric
{
@@ -423,7 +444,8 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] =
MAX_ITEM_SUBCLASS_QUEST,
MAX_ITEM_SUBCLASS_KEY,
MAX_ITEM_SUBCLASS_PERMANENT,
- MAX_ITEM_SUBCLASS_JUNK
+ MAX_ITEM_SUBCLASS_JUNK,
+ MAX_ITEM_SUBCLASS_GLYPH
};
inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass)
@@ -472,12 +494,17 @@ struct _Socket
uint32 Content;
};
+#define MAX_ITEM_PROTO_DAMAGES 5
+#define MAX_ITEM_PROTO_SOCKETS 3
+#define MAX_ITEM_PROTO_SPELLS 5
+#define MAX_ITEM_PROTO_STATS 10
+
struct ItemPrototype
{
uint32 ItemId;
uint32 Class; // id from ItemClass.dbc
uint32 SubClass; // id from ItemSubClass.dbc
- uint32 Unk0;
+ int32 Unk0;
char* Name1;
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
uint32 Quality;
@@ -497,11 +524,14 @@ struct ItemPrototype
uint32 RequiredCityRank;
uint32 RequiredReputationFaction; // id from Faction.dbc
uint32 RequiredReputationRank;
- uint32 MaxCount;
- uint32 Stackable;
+ int32 MaxCount; // <=0: no limit
+ int32 Stackable; // 0: not allowed, -1: put in player coin info tab and don't limit stacking (so 1 slot)
uint32 ContainerSlots;
- _ItemStat ItemStat[10];
- _Damage Damage[5];
+ uint32 StatsCount;
+ _ItemStat ItemStat[MAX_ITEM_PROTO_STATS];
+ uint32 ScalingStatDistribution; // id from ScalingStatDistribution.dbc
+ uint32 ScalingStatValue; // mask for selecting column in ScalingStatValues.dbc
+ _Damage Damage[MAX_ITEM_PROTO_DAMAGES];
uint32 Armor;
uint32 HolyRes;
uint32 FireRes;
@@ -512,7 +542,7 @@ struct ItemPrototype
uint32 Delay;
uint32 AmmoType;
float RangedModRange;
- _Spell Spells[5];
+ _Spell Spells[MAX_ITEM_PROTO_SPELLS];
uint32 Bonding;
char* Description;
uint32 PageText;
@@ -520,7 +550,7 @@ struct ItemPrototype
uint32 PageMaterial;
uint32 StartQuest; // id from QuestCache.wdb
uint32 LockID;
- uint32 Material; // id from Material.dbc
+ int32 Material; // id from Material.dbc
uint32 Sheath;
uint32 RandomProperty; // id from ItemRandomProperties.dbc
uint32 RandomSuffix; // id from ItemRandomSuffix.dbc
@@ -529,19 +559,20 @@ struct ItemPrototype
uint32 MaxDurability;
uint32 Area; // id from AreaTable.dbc
uint32 Map; // id from Map.dbc
- uint32 BagFamily; // id from ItemBagFamily.dbc
+ uint32 BagFamily; // bit string (1 << id from ItemBagFamily.dbc)
uint32 TotemCategory; // id from TotemCategory.dbc
- _Socket Socket[3];
+ _Socket Socket[MAX_ITEM_PROTO_SOCKETS];
uint32 socketBonus; // id from SpellItemEnchantment.dbc
uint32 GemProperties; // id from GemProperties.dbc
uint32 RequiredDisenchantSkill;
float ArmorDamageModifier;
+ int32 Duration; // negative = realtime, positive = ingame time
+ uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc
uint32 ScriptId;
uint32 DisenchantID;
uint32 FoodType;
uint32 MinMoneyLoot;
uint32 MaxMoneyLoot;
- int32 Duration; // negative = realtime, positive = ingame time
// helpers
bool CanChangeEquipStateInCombat() const
@@ -563,6 +594,74 @@ struct ItemPrototype
return false;
}
+
+ uint32 GetScalingStatValuesColumn() const
+ {
+ if(ScalingStatValue & 0x00000001) // stat mod
+ return 0;
+ if(ScalingStatValue & 0x00000002) // stat mod
+ return 1;
+ if(ScalingStatValue & 0x00000004) // stat mod
+ return 2;
+ if(ScalingStatValue & 0x00000008) // stat mod
+ return 3;
+ if(ScalingStatValue & 0x00000010) // stat mod
+ return 4;
+ if(ScalingStatValue & 0x00000020) // armor mod
+ return 5;
+ if(ScalingStatValue & 0x00000040) // armor mod
+ return 6;
+ if(ScalingStatValue & 0x00000080) // armor mod
+ return 7;
+ if(ScalingStatValue & 0x00000100) // armor mod
+ return 8;
+ if(ScalingStatValue & 0x00000200) // damage mod
+ return 9;
+ if(ScalingStatValue & 0x00000400) // damage mod
+ return 10;
+ if(ScalingStatValue & 0x00000800) // damage mod
+ return 11;
+ if(ScalingStatValue & 0x00001000) // damage mod
+ return 12;
+ if(ScalingStatValue & 0x00002000) // damage mod
+ return 13;
+ if(ScalingStatValue & 0x00004000) // damage mod
+ return 14;
+ if(ScalingStatValue & 0x00008000) // spell power
+ return 15;
+ if(ScalingStatValue & 0x00020000) // feral AP
+ return 16;
+
+ return 0;
+ }
+
+ uint32 GetMaxStackSize() const { return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF-1); }
+
+ 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;
+ }
+
+ int32 getFeralBonus() const
+ {
+ // 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
+ if (Class == ITEM_CLASS_WEAPON && (1<<SubClass)&0x02A5F3)
+ {
+ int32 bonus = int32(getDPS()*14.0f) - 767;
+ if (bonus < 0)
+ return 0;
+ return bonus;
+ }
+ return 0;
+ }
+
+ bool IsPotion() const { return Class==ITEM_CLASS_CONSUMABLE && SubClass==ITEM_SUBCLASS_POTION; }
+ bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAGS_CONJURED); }
};
struct ItemLocale
diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp
index 667b65327d5..85c196a9346 100644
--- a/src/game/LFGHandler.cpp
+++ b/src/game/LFGHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Language.h b/src/game/Language.h
index 03c485a4b02..9c85571c17e 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -84,7 +84,8 @@ enum TrinityStrings
LANG_MOTD_CURRENT = 56,
LANG_USING_WORLD_DB = 57,
LANG_USING_SCRIPT_LIB = 58,
- // Room for more level 0 59-99 not used
+ LANG_USING_EVENT_AI = 59,
+ // Room for more level 0 60-99 not used
// level 1 chat
LANG_GLOBAL_NOTIFY = 100,
@@ -170,7 +171,10 @@ enum TrinityStrings
LANG_SOUND_NOT_EXIST = 170,
LANG_TELEPORTED_TO_BY_CONSOLE = 171,
LANG_CONSOLE_COMMAND = 172,
- // Room for more level 1 173-199 not used
+ LANG_YOU_CHANGE_RUNIC_POWER = 173,
+ LANG_YOURS_RUNIC_POWER_CHANGED = 174,
+ LANG_LIQUID_STATUS = 175,
+ // Room for more level 1 176-199 not used
// level 2 chat
LANG_NO_SELECTION = 200,
@@ -269,9 +273,9 @@ enum TrinityStrings
LANG_COMMAND_WHISPERON = 285,
LANG_COMMAND_WHISPEROFF = 286,
LANG_COMMAND_CREATGUIDNOTFOUND = 287,
- // TICKET STRINGS NEED REWRITE // 288-296 FREE
+ // TICKET STRINGS NEED REWRITE // 288-296 FREE
- // END
+ // END
LANG_COMMAND_SPAWNDIST = 297,
LANG_COMMAND_SPAWNTIME = 298,
LANG_COMMAND_MODIFY_HONOR = 299,
@@ -322,6 +326,8 @@ enum TrinityStrings
LANG_CREATURE_NOT_FOLLOW_YOU_NOW = 342,
LANG_CREATURE_NON_TAMEABLE = 343,
LANG_YOU_ALREADY_HAVE_PET = 344,
+ LANG_CUSTOMIZE_PLAYER = 345,
+ LANG_CUSTOMIZE_PLAYER_GUID = 346,
// Room for more level 2 345-399 not used
// level 3 chat
@@ -529,9 +535,9 @@ enum TrinityStrings
LANG_CHANGE_32BIT = 575, //log
LANG_CHANGE_32BIT_FIELD = 576,
- LANG_INVISIBLE_INVISIBLE = 577,
- LANG_INVISIBLE_VISIBLE = 578,
- LANG_SELECTED_TARGET_NOT_HAVE_VICTIM = 579,
+ LANG_INVISIBLE_INVISIBLE = 577,
+ LANG_INVISIBLE_VISIBLE = 578,
+ LANG_SELECTED_TARGET_NOT_HAVE_VICTIM = 579,
LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST = 580,
LANG_COMMAND_NEAROBJMESSAGE = 581,
@@ -561,9 +567,11 @@ enum TrinityStrings
// Battleground
LANG_BG_A_WINS = 600,
LANG_BG_H_WINS = 601,
- LANG_BG_WS_ONE_MINUTE = 602,
- LANG_BG_WS_HALF_MINUTE = 603,
- LANG_BG_WS_BEGIN = 604,
+
+ LANG_BG_WS_START_TWO_MINUTES = 753,
+ LANG_BG_WS_START_ONE_MINUTE = 602,
+ LANG_BG_WS_START_HALF_MINUTE = 603,
+ LANG_BG_WS_HAS_BEGUN = 604,
LANG_BG_WS_CAPTURED_HF = 605,
LANG_BG_WS_CAPTURED_AF = 606,
@@ -577,9 +585,10 @@ enum TrinityStrings
LANG_BG_WS_ALLIANCE_FLAG_RESPAWNED = 614,
LANG_BG_WS_HORDE_FLAG_RESPAWNED = 615,
- LANG_BG_EY_ONE_MINUTE = 636,
- LANG_BG_EY_HALF_MINUTE = 637,
- LANG_BG_EY_BEGIN = 638,
+ LANG_BG_EY_START_TWO_MINUTES = 755,
+ LANG_BG_EY_START_ONE_MINUTE = 636,
+ LANG_BG_EY_START_HALF_MINUTE = 637,
+ LANG_BG_EY_HAS_BEGUN = 638,
LANG_BG_AB_ALLY = 650,
LANG_BG_AB_HORDE = 651,
@@ -592,9 +601,11 @@ enum TrinityStrings
LANG_BG_AB_NODE_DEFENDED = 658,
LANG_BG_AB_NODE_ASSAULTED = 659,
LANG_BG_AB_NODE_CLAIMED = 660,
- LANG_BG_AB_ONEMINTOSTART = 661,
- LANG_BG_AB_HALFMINTOSTART = 662,
- LANG_BG_AB_STARTED = 663,
+
+ LANG_BG_AB_START_TWO_MINUTES = 754,
+ LANG_BG_AB_START_ONE_MINUTE = 661,
+ LANG_BG_AB_START_HALF_MINUTE = 662,
+ LANG_BG_AB_HAS_BEGUN = 663,
LANG_BG_AB_A_NEAR_VICTORY = 664,
LANG_BG_AB_H_NEAR_VICTORY = 665,
LANG_BG_MARK_BY_MAIL = 666,
@@ -625,7 +636,7 @@ enum TrinityStrings
LANG_ARENA_ONE_MINUTE = 701,
LANG_ARENA_THIRTY_SECONDS = 702,
LANG_ARENA_FIFTEEN_SECONDS = 703,
- LANG_ARENA_BEGUN = 704,
+ LANG_ARENA_HAS_BEGUN = 704,
LANG_WAIT_BEFORE_SPEAKING = 705,
LANG_NOT_EQUIPPED_ITEM = 706,
@@ -636,77 +647,61 @@ enum TrinityStrings
LANG_BG_QUEUE_ANNOUNCE_SELF = 711,
LANG_BG_QUEUE_ANNOUNCE_WORLD = 712,
-
-
LANG_YOUR_ARENA_LEVEL_REQ_ERROR = 713,
-// LANG_HIS_ARENA_LEVEL_REQ_ERROR = 714, an opcode exists for this
+ // = 714, not used
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
-// LANG_YOUR_ARENA_TEAM_FULL = 716, an opcode exists for this
-
- LANG_BG_AV_ALLY = 717,
- LANG_BG_AV_HORDE = 718,
- LANG_BG_AV_TOWER_TAKEN = 719,
- LANG_BG_AV_TOWER_ASSAULTED = 720,
- LANG_BG_AV_TOWER_DEFENDED = 721,
- LANG_BG_AV_GRAVE_TAKEN = 722,
- LANG_BG_AV_GRAVE_DEFENDED = 723,
- LANG_BG_AV_GRAVE_ASSAULTED = 724,
-
- LANG_BG_AV_MINE_TAKEN = 725,
- LANG_BG_AV_MINE_NORTH = 726,
- LANG_BG_AV_MINE_SOUTH = 727,
-
- LANG_BG_AV_NODE_GRAVE_STORM_AID = 728,
- LANG_BG_AV_NODE_TOWER_DUN_S = 729,
- LANG_BG_AV_NODE_TOWER_DUN_N = 730,
- LANG_BG_AV_NODE_GRAVE_STORMPIKE = 731,
- LANG_BG_AV_NODE_TOWER_ICEWING = 732,
- LANG_BG_AV_NODE_GRAVE_STONE = 733,
- LANG_BG_AV_NODE_TOWER_STONE = 734,
- LANG_BG_AV_NODE_GRAVE_SNOW = 735,
- LANG_BG_AV_NODE_TOWER_ICE = 736,
- LANG_BG_AV_NODE_GRAVE_ICE = 737,
- LANG_BG_AV_NODE_TOWER_POINT = 738,
- LANG_BG_AV_NODE_GRAVE_FROST = 739,
- LANG_BG_AV_NODE_TOWER_FROST_E = 740,
- LANG_BG_AV_NODE_TOWER_FROST_W = 741,
- LANG_BG_AV_NODE_GRAVE_FROST_HUT = 742,
-
- LANG_BG_AV_ONEMINTOSTART = 743,
- LANG_BG_AV_HALFMINTOSTART = 744,
- LANG_BG_AV_STARTED = 745,
- LANG_BG_AV_A_NEAR_LOSE = 746,
- LANG_BG_AV_H_NEAR_LOSE = 747,
- LANG_BG_AV_H_CAPTAIN_DEAD = 748,
- LANG_BG_AV_A_CAPTAIN_DEAD = 749,
- LANG_NPCINFO_LINKGUID = 750,
+ // LANG_YOUR_ARENA_TEAM_FULL = 716, an opcode exists for this
+ LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
+ LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN= 718,
+ LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT= 719,
+
+ LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
+ LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
+ LANG_ARENA_YOUR_TEAM_ONLY = 722, // "Your group has members not in your arena team. Please regroup to join."
+ LANG_ARENA_NOT_ENOUGH_PLAYERS = 723, // "Your group does not have enough players to join this match."
+ LANG_ARENA_GOLD_WINS = 724, // "The Gold Team wins!"
+ LANG_ARENA_GREEN_WINS = 725, // "The Green Team wins!"
+// = 726, not used
+ LANG_BG_GROUP_OFFLINE_MEMBER = 727, // "Your group has an offline member. Please remove him before joining."
+ LANG_BG_GROUP_MIXED_FACTION = 728, // "Your group has players from the opposing faction. You can't join the battleground as a group."
+ LANG_BG_GROUP_MIXED_LEVELS = 729, // "Your group has players from different battleground brakets. You can't join as group."
+ LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 730, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
+ LANG_BG_GROUP_MEMBER_DESERTER = 731, // "Someone in your party is Deserter. You can't join as group."
+ LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 732, // "Someone in your party is already in three battleground queues. You cannot join as group."
+
+ LANG_CANNOT_TELE_TO_BG = 733, // "You cannot teleport to a battleground or arena map."
+ LANG_CANNOT_SUMMON_TO_BG = 734, // "You cannot summon players to a battleground or arena map."
+ LANG_CANNOT_GO_TO_BG_GM = 735, // "You must be in GM mode to teleport to a player in a battleground."
+ LANG_CANNOT_GO_TO_BG_FROM_BG = 736, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."
+ LANG_DEBUG_ARENA_ON = 737,
+ LANG_DEBUG_ARENA_OFF = 738,
+ LANG_DEBUG_BG_ON = 739,
+ LANG_DEBUG_BG_OFF = 740,
+ LANG_DIST_ARENA_POINTS_START = 741,
+ LANG_DIST_ARENA_POINTS_ONLINE_START = 742,
+ LANG_DIST_ARENA_POINTS_ONLINE_END = 743,
+ LANG_DIST_ARENA_POINTS_TEAM_START = 744,
+ LANG_DIST_ARENA_POINTS_TEAM_END = 745,
+ LANG_DIST_ARENA_POINTS_END = 746,
+// = 747, not used
+// = 748, not used
+// = 749, not used
+ LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 750, // "Not enough players. This game will close in %u mins."
+ LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS = 751, // "Not enough players. This game will close in %u seconds."
+// = 752, not used
+// LANG_BG_WS_START_TWO_MINUTES = 753, - defined above
+// LANG_BG_AB_START_TWO_MINUTES = 754, - defined above
+// LANG_BG_EY_START_TWO_MINUTES = 755, - defined above
+ // Room for batleground/arena strings 756-799 not used
// Room for BG/ARENA 751-769 not used
+
+ LANG_NPCINFO_LINKGUID = 750,
LANG_ARENA_TESTING = 785,
-
LANG_AUTO_ANN = 786,
LANG_ANNOUNCE_COLOR = 787,
- LANG_BG_GROUP_TOO_LARGE = 1122, // "Your group is too large for this battleground. Please regroup to join."
- LANG_ARENA_GROUP_TOO_LARGE = 1123, // "Your group is too large for this arena. Please regroup to join."
- LANG_ARENA_YOUR_TEAM_ONLY = 1124, // "Your group has members not in your arena team. Please regroup to join."
- LANG_ARENA_NOT_ENOUGH_PLAYERS = 1125, // "Your group does not have enough players to join this match."
- LANG_ARENA_GOLD_WINS = 1126, // "The Gold Team wins!"
- LANG_ARENA_GREEN_WINS = 1127, // "The Green Team wins!"
- LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 1128, // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
- LANG_BG_GROUP_OFFLINE_MEMBER = 1129, // "Your group has an offline member. Please remove him before joining."
- LANG_BG_GROUP_MIXED_FACTION = 1130, // "Your group has players from the opposing faction. You can't join the battleground as a group."
- LANG_BG_GROUP_MIXED_LEVELS = 1131, // "Your group has players from different battleground brakets. You can't join as group."
- LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 1132, // "Someone in your party is already in this battleground queue. (S)he must leave it before joining as group."
- LANG_BG_GROUP_MEMBER_DESERTER = 1133, // "Someone in your party is Deserter. You can't join as group."
- LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 1134, // "Someone in your party is already in three battleground queues. You cannot join as group."
-
- LANG_CANNOT_TELE_TO_BG = 1135, // "You cannot teleport to a battleground or arena map."
- LANG_CANNOT_SUMMON_TO_BG = 1136, // "You cannot summon players to a battleground or arena map."
- LANG_CANNOT_GO_TO_BG_GM = 1137, // "You must be in GM mode to teleport to a player in a battleground."
- LANG_CANNOT_GO_TO_BG_FROM_BG = 1138, // "You cannot teleport to a battleground from another battleground. Please leave the current battleground first."
-
// in game strings
LANG_PET_INVALID_NAME = 800,
LANG_NOT_ENOUGH_GOLD = 801,
@@ -718,7 +713,13 @@ enum TrinityStrings
LANG_NEED_CHARACTER_NAME = 807,
LANG_PLAYER_NOT_EXIST_OR_OFFLINE = 808,
LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND = 809,
- // Room for in-game strings 810-999 not used
+ LANG_ACHIEVEMENT_EARNED = 810,
+ LANG_GUILD_MASTER = 811,
+ LANG_GUILD_OFFICER = 812,
+ LANG_GUILD_VETERAN = 813,
+ LANG_GUILD_MEMBER = 814,
+ LANG_GUILD_INITIATE = 815,
+ // Room for in-game strings 816-999 not used
// Level 4 (CLI only commands)
LANG_COMMAND_EXIT = 1000,
@@ -733,7 +734,10 @@ enum TrinityStrings
LANG_CHARACTER_DELETED = 1009,
LANG_ACCOUNT_LIST_HEADER = 1010,
LANG_ACCOUNT_LIST_ERROR = 1011,
- // Room for more level 4 1012-1099 not used
+ LANG_ACCOUNT_LIST_BAR = 1012,
+ LANG_ACCOUNT_LIST_LINE = 1013,
+ LANG_ACCOUNT_LIST_EMPTY = 1014,
+ // Room for more level 4 1015-1099 not used
// Level 3 (continue)
LANG_ACCOUNT_SETADDON = 1100,
@@ -758,25 +762,71 @@ enum TrinityStrings
LANG_MUST_MALE_OR_FEMALE = 1119,
LANG_YOU_CHANGE_GENDER = 1120,
LANG_YOUR_GENDER_CHANGED = 1121,
+ LANG_SKILL_VALUES = 1122,
+ LANG_NO_PET_FOUND = 1123,
+ LANG_WRONG_PET_TYPE = 1124,
+ LANG_COMMAND_LEARN_PET_TALENTS = 1125,
+ LANG_RESET_PET_TALENTS = 1126,
+ LANG_RESET_PET_TALENTS_ONLINE = 1127,
+ // Room for more level 3 1128-1199 not used
+
+ // AV
+ LANG_BG_AV_ALLY = 1200,
+ LANG_BG_AV_HORDE = 1201,
+ LANG_BG_AV_TOWER_TAKEN = 1202,
+ LANG_BG_AV_TOWER_ASSAULTED = 1203,
+ LANG_BG_AV_TOWER_DEFENDED = 1204,
+ LANG_BG_AV_GRAVE_TAKEN = 1205,
+ LANG_BG_AV_GRAVE_DEFENDED = 1206,
+ LANG_BG_AV_GRAVE_ASSAULTED = 1207,
+
+ LANG_BG_AV_MINE_TAKEN = 1208,
+ LANG_BG_AV_MINE_NORTH = 1209,
+ LANG_BG_AV_MINE_SOUTH = 1210,
+
+ LANG_BG_AV_NODE_GRAVE_STORM_AID = 1211,
+ LANG_BG_AV_NODE_TOWER_DUN_S = 1212,
+ LANG_BG_AV_NODE_TOWER_DUN_N = 1213,
+ LANG_BG_AV_NODE_GRAVE_STORMPIKE = 1214,
+ LANG_BG_AV_NODE_TOWER_ICEWING = 1215,
+ LANG_BG_AV_NODE_GRAVE_STONE = 1216,
+ LANG_BG_AV_NODE_TOWER_STONE = 1217,
+ LANG_BG_AV_NODE_GRAVE_SNOW = 1218,
+ LANG_BG_AV_NODE_TOWER_ICE = 1219,
+ LANG_BG_AV_NODE_GRAVE_ICE = 1220,
+ LANG_BG_AV_NODE_TOWER_POINT = 1221,
+ LANG_BG_AV_NODE_GRAVE_FROST = 1222,
+ LANG_BG_AV_NODE_TOWER_FROST_E = 1223,
+ LANG_BG_AV_NODE_TOWER_FROST_W = 1224,
+ LANG_BG_AV_NODE_GRAVE_FROST_HUT = 1225,
+
+ LANG_BG_AV_ONEMINTOSTART = 1226,
+ LANG_BG_AV_HALFMINTOSTART = 1227,
+ LANG_BG_AV_STARTED = 1228,
+ LANG_BG_AV_A_NEAR_LOSE = 1229,
+ LANG_BG_AV_H_NEAR_LOSE = 1230,
+ LANG_BG_AV_H_CAPTAIN_DEAD = 1231,
+ LANG_BG_AV_A_CAPTAIN_DEAD = 1232,
+ // FREE IDS 1233-9999
// Ticket Strings 2000-2029
LANG_COMMAND_TICKETNEW = 2000,
LANG_COMMAND_TICKETUPDATED = 2001,
LANG_COMMAND_TICKETPLAYERABANDON = 2002,
- LANG_COMMAND_TICKETCLOSED = 2003,
- LANG_COMMAND_TICKETDELETED = 2004,
+ LANG_COMMAND_TICKETCLOSED = 2003,
+ LANG_COMMAND_TICKETDELETED = 2004,
LANG_COMMAND_TICKETNOTEXIST = 2005,
LANG_COMMAND_TICKETCLOSEFIRST = 2006,
LANG_COMMAND_TICKETALREADYASSIGNED = 2007,
- LANG_COMMAND_TICKETRELOAD = 2008,
- LANG_COMMAND_TICKETSHOWLIST = 2009,
- LANG_COMMAND_TICKETSHOWONLINELIST = 2010,
- LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011,
- LANG_COMMAND_TICKETASSIGNERROR_A = 2012,
- LANG_COMMAND_TICKETASSIGNERROR_B = 2013,
- LANG_COMMAND_TICKETNOTASSIGNED = 2014,
+ LANG_COMMAND_TICKETRELOAD = 2008,
+ LANG_COMMAND_TICKETSHOWLIST = 2009,
+ LANG_COMMAND_TICKETSHOWONLINELIST = 2010,
+ LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011,
+ LANG_COMMAND_TICKETASSIGNERROR_A = 2012,
+ LANG_COMMAND_TICKETASSIGNERROR_B = 2013,
+ LANG_COMMAND_TICKETNOTASSIGNED = 2014,
LANG_COMMAND_TICKETUNASSIGNSECURITY = 2015,
- LANG_COMMAND_TICKETCANNOTCLOSE = 2016,
+ LANG_COMMAND_TICKETCANNOTCLOSE = 2016,
LANG_COMMAND_TICKETLISTGUID = 2017,
LANG_COMMAND_TICKETLISTNAME = 2018,
LANG_COMMAND_TICKETLISTAGE = 2019,
@@ -787,7 +837,7 @@ enum TrinityStrings
LANG_COMMAND_TICKETLISTADDCOMMENT = 2024,
LANG_COMMAND_TICKETLISTAGECREATE = 2025,
- // Trinity strings 5000-9999
+ // Trinity strings 5000-9999
LANG_COMMAND_FREEZE = 5000,
LANG_COMMAND_FREEZE_ERROR = 5001,
LANG_COMMAND_FREEZE_WRONG = 5002,
@@ -795,8 +845,8 @@ enum TrinityStrings
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
LANG_COMMAND_LIST_FREEZE = 5005,
LANG_COMMAND_FROZEN_PLAYERS = 5006,
- LANG_INSTANCE_MUST_RAID_GRP = 5007,
- LANG_INSTANCE_NOT_AS_GHOST = 5008,
+ LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
+ //LANG_INSTANCE_NOT_AS_GHOST = 5008,
LANG_COMMAND_PLAYED_TO_ALL = 5009,
// Room for more Trinity strings 5010-9999
// Used for GM Announcements
@@ -804,6 +854,16 @@ enum TrinityStrings
LANG_GM_NOTIFY = 6614,
LANG_GM_ANNOUNCE_COLOR = 6615,
+ LANG_WORLD_CLOSED = 7523,
+ LANG_WORLD_OPENED = 7524,
+
+ // Debug commands
+ LANG_CINEMATIC_NOT_EXIST = 1200,
+ LANG_MOVIE_NOT_EXIST = 1201,
+ // Room for more debug 1202-1299 not used
+
+ // FREE IDS 1300-9999
+
// Use for not-in-offcial-sources patches
// 10000-10999
// opvp hp
@@ -868,9 +928,7 @@ enum TrinityStrings
LANG_OPVP_EP_FLIGHT_CGT = 10053,
LANG_OPVP_ZM_GOSSIP_ALLIANCE = 10054,
LANG_OPVP_ZM_GOSSIP_HORDE = 10055,
- LANG_NO_ENTER_HALL_OF_LEGENDS = 10056,
- LANG_NO_ENTER_CHAMPIONS_HALL = 10057,
-
+
// Use for custom patches 11000-11999
// NOT RESERVED IDS 12000-1999999999
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index 62aa5d41709..5f8a6cf86ef 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,13 +20,10 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
#include "World.h"
#include "Player.h"
#include "Opcodes.h"
#include "Chat.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Language.h"
#include "AccountMgr.h"
@@ -105,6 +102,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
//SendSysMessage(full);
//PSendSysMessage(LANG_USING_SCRIPT_LIB,sWorld.GetScriptsVersion());
//PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
+ //PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion());
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
PSendSysMessage(LANG_UPTIME, str.c_str());
PSendSysMessage("Update time diff: %u.", updateTime);
@@ -130,7 +128,7 @@ bool ChatHandler::HandleDismountCommand(const char* /*args*/)
}
m_session->GetPlayer()->Unmount();
- m_session->GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ m_session->GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED);
return true;
}
@@ -148,7 +146,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
// save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
- if(save_interval==0 || save_interval > 20*1000 && player->GetSaveTimer() <= save_interval - 20*1000)
+ if(save_interval==0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS)
player->SaveToDB();
return true;
@@ -172,7 +170,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
first = false;
}
- SendSysMessage(itr->second->GetName());
+ SendSysMessage(GetNameLink(itr->second).c_str());
}
}
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 1966bf6aa51..51829e504f0 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
#include "VMapFactory.h"
#endif
+//-----------------------Npc Commands-----------------------
bool ChatHandler::HandleNpcSayCommand(const char* args)
{
if(!*args)
@@ -53,7 +54,7 @@ bool ChatHandler::HandleNpcSayCommand(const char* args)
return false;
}
- pCreature->Say(args, LANG_UNIVERSAL, 0);
+ pCreature->MonsterSay(args, LANG_UNIVERSAL, 0);
return true;
}
@@ -71,7 +72,7 @@ bool ChatHandler::HandleNpcYellCommand(const char* args)
return false;
}
- pCreature->Yell(args, LANG_UNIVERSAL, 0);
+ pCreature->MonsterYell(args, LANG_UNIVERSAL, 0);
return true;
}
@@ -91,7 +92,7 @@ bool ChatHandler::HandleNpcTextEmoteCommand(const char* args)
return false;
}
- pCreature->TextEmote(args, 0);
+ pCreature->MonsterTextEmote(args, 0);
return true;
}
@@ -115,18 +116,22 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
uint64 receiver_guid= atol(receiver_str);
- pCreature->Whisper(text,receiver_guid);
+ // check online security
+ if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
+ return false;
+
+ pCreature->MonsterWhisper(text,receiver_guid);
return true;
}
+//----------------------------------------------------------
bool ChatHandler::HandleNameAnnounceCommand(const char* args)
{
WorldPacket data;
if(!*args)
return false;
- //char str[1024];
- //sprintf(str, GetTrinityString(LANG_ANNOUNCE_COLOR), m_session->GetPlayer()->GetName(), args);
+
sWorld.SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
return true;
}
@@ -194,7 +199,7 @@ bool ChatHandler::HandleGMNotifyCommand(const char* args)
}
//Enable\Dissable GM Mode
-bool ChatHandler::HandleGMmodeCommand(const char* args)
+bool ChatHandler::HandleGMCommand(const char* args)
{
if(!*args)
{
@@ -627,7 +632,7 @@ bool ChatHandler::HandleGMTicketReloadCommand(const char*)
}
//Enable\Dissable Invisible mode
-bool ChatHandler::HandleVisibleCommand(const char* args)
+bool ChatHandler::HandleGMVisibleCommand(const char* args)
{
if (!*args)
{
@@ -656,14 +661,16 @@ bool ChatHandler::HandleVisibleCommand(const char* args)
return false;
}
+
+
bool ChatHandler::HandleGPSCommand(const char* args)
{
WorldObject *obj = NULL;
if (*args)
{
- std::string name = args;
- if(normalizePlayerName(name))
- obj = objmgr.GetPlayer(name.c_str());
+ uint64 guid = extractGuidFromLink((char*)args);
+ if(guid)
+ obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if(!obj)
{
@@ -686,8 +693,8 @@ bool ChatHandler::HandleGPSCommand(const char* args)
CellPair cell_val = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
Cell cell(cell_val);
- uint32 zone_id = obj->GetZoneId();
- uint32 area_id = obj->GetAreaId();
+ uint32 zone_id, area_id;
+ obj->GetZoneAndAreaId(zone_id,area_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(obj->GetMapId());
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zone_id);
@@ -714,22 +721,30 @@ bool ChatHandler::HandleGPSCommand(const char* args)
obj->GetMapId(), (mapEntry ? mapEntry->name[m_session->GetSessionDbcLocale()] : "<unknown>" ),
zone_id, (zoneEntry ? zoneEntry->area_name[m_session->GetSessionDbcLocale()] : "<unknown>" ),
area_id, (areaEntry ? areaEntry->area_name[m_session->GetSessionDbcLocale()] : "<unknown>" ),
+ obj->GetPhaseMask(),
obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(),
zone_x, zone_y, ground_z, floor_z, have_map, have_vmap );
sLog.outDebug("Player %s GPS call for %s '%s' (%s: %u):",
- GetName(),
+ m_session ? GetNameLink().c_str() : GetMangosString(LANG_CONSOLE_COMMAND),
(obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(),
(obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry()) );
sLog.outDebug(GetTrinityString(LANG_MAP_POSITION),
obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld.GetDefaultDbcLocale()] : "<unknown>" ),
zone_id, (zoneEntry ? zoneEntry->area_name[sWorld.GetDefaultDbcLocale()] : "<unknown>" ),
area_id, (areaEntry ? areaEntry->area_name[sWorld.GetDefaultDbcLocale()] : "<unknown>" ),
+ obj->GetPhaseMask(),
obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(),
zone_x, zone_y, ground_z, floor_z, have_map, have_vmap );
+ LiquidData liquid_status;
+ ZLiquidStatus res = map->getLiquidStatus(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), MAP_ALL_LIQUIDS, &liquid_status);
+ if (res)
+ {
+ PSendSysMessage(LANG_LIQUID_STATUS, liquid_status.level, liquid_status.depth_level, liquid_status.type, res);
+ }
return true;
}
@@ -739,9 +754,8 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
if(!*args)
return false;
- std::string name = args;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -751,9 +765,14 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
Player *chr = objmgr.GetPlayer(name.c_str());
if (chr)
{
- if(chr->IsBeingTeleported()==true)
+ std::string nameLink = playerLink(name);
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ if(chr->IsBeingTeleported())
{
- PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
+ PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -762,10 +781,25 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
if(pMap->IsBattleGroundOrArena())
{
- // cannot summon to bg
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_BG,chr->GetName());
- SetSentErrorMessage(true);
- return false;
+ // only allow if gm mode is on
+ if (!chr->isGameMaster())
+ {
+ PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
+ SetSentErrorMessage(true);
+ return false;
+ }
+ // if both players are in different bgs
+ else if (chr->GetBattleGroundId() && m_session->GetPlayer()->GetBattleGroundId() != chr->GetBattleGroundId())
+ {
+ PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG, nameLink.c_str());
+ SetSentErrorMessage(true);
+ return false;
+ }
+ // all's well, set bg id
+ // when porting out from the bg, it will be reset to 0
+ chr->SetBattleGroundId(m_session->GetPlayer()->GetBattleGroundId(), m_session->GetPlayer()->GetBattleGroundTypeId());
+ // remember current position as entry point for return at bg end teleportation
+ chr->SetBattleGroundEntryPoint(chr->GetMapId(),chr->GetPositionX(),chr->GetPositionY(),chr->GetPositionZ(),chr->GetOrientation());
}
else if(pMap->IsDungeon())
{
@@ -773,7 +807,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
if( cMap->Instanceable() && cMap->GetInstanceId() != pMap->GetInstanceId() )
{
// cannot summon from instance to instance
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -784,15 +818,15 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
(m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()) )
// the last check is a bit excessive, but let it be, just in case
{
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
}
- PSendSysMessage(LANG_SUMMONING, chr->GetName(),"");
+ PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),"");
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_SUMMONED_BY, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
// stop flight if need
if(chr->isInFlight())
@@ -811,7 +845,13 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
}
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
{
- PSendSysMessage(LANG_SUMMONING, name.c_str(),GetTrinityString(LANG_OFFLINE));
+ // check offline security
+ if (HasLowerSecurity(NULL, guid))
+ return false;
+
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),GetTrinityString(LANG_OFFLINE));
// in point where GM stay
Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(),
@@ -839,9 +879,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
Player* _player = m_session->GetPlayer();
- std::string name = args;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -851,26 +890,34 @@ bool ChatHandler::HandleGonameCommand(const char* args)
Player *chr = objmgr.GetPlayer(name.c_str());
if (chr)
{
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = playerLink(name);
+
Map* cMap = chr->GetMap();
if(cMap->IsBattleGroundOrArena())
{
// only allow if gm mode is on
if (!_player->isGameMaster())
{
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- // if already in a bg, don't let port to other
- else if (_player->GetBattleGroundId())
+ // if both players are in different bgs
+ else if (_player->GetBattleGroundId() && _player->GetBattleGroundId() != chr->GetBattleGroundId())
{
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
// all's well, set bg id
// when porting out from the bg, it will be reset to 0
- _player->SetBattleGroundId(chr->GetBattleGroundId());
+ _player->SetBattleGroundId(chr->GetBattleGroundId(), chr->GetBattleGroundTypeId());
+ // remember current position as entry point for return at bg end teleportation
+ _player->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
}
else if(cMap->IsDungeon())
{
@@ -884,7 +931,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
// we are in group, we can go only if we are in the player group
if (_player->GetGroup() != chr->GetGroup())
{
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -894,7 +941,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
// we are not in group, let's verify our GM mode
if (!_player->isGameMaster())
{
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chr->GetName());
+ PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -918,10 +965,9 @@ bool ChatHandler::HandleGonameCommand(const char* args)
_player->SetDifficulty(chr->GetDifficulty());
}
- PSendSysMessage(LANG_APPEARING_AT, chr->GetName());
-
+ PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
if (_player->IsVisibleGloballyFor(chr))
- ChatHandler(chr).PSendSysMessage(LANG_APPEARING_TO, _player->GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str());
// stop flight if need
if(_player->isInFlight())
@@ -944,7 +990,13 @@ bool ChatHandler::HandleGonameCommand(const char* args)
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
{
- PSendSysMessage(LANG_APPEARING_AT, name.c_str());
+ // check offline security
+ if (HasLowerSecurity(NULL, guid))
+ return false;
+
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
// to point where player stay (if loaded)
float x,y,z,o;
@@ -983,12 +1035,15 @@ bool ChatHandler::HandleRecallCommand(const char* args)
chr = getSelectedPlayer();
if(!chr)
chr = m_session->GetPlayer();
+
+ // check online security
+ else if (HasLowerSecurity(chr, 0))
+ return false;
}
else
{
- std::string name = args;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -1003,11 +1058,15 @@ bool ChatHandler::HandleRecallCommand(const char* args)
SetSentErrorMessage(true);
return false;
}
+
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
}
if(chr->IsBeingTeleported())
{
- PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
+ PSendSysMessage(LANG_IS_TELEPORTED, GetNameLink(chr).c_str());
SetSentErrorMessage(true);
return false;
}
@@ -1041,6 +1100,10 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
uint64 titles2 = titles;
for(int i=1; i < sCharTitlesStore.GetNumRows(); ++i)
@@ -1090,9 +1153,13 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink(chr).c_str(), hp, hpm);
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm);
chr->SetMaxHealth( hpm );
chr->SetHealth( hp );
@@ -1134,9 +1201,13 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_MANA, GetNameLink(chr).c_str(), mana, manam);
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetNameLink().c_str(), mana, manam);
chr->SetMaxPower(POWER_MANA,manam );
chr->SetPower(POWER_MANA, mana );
@@ -1179,9 +1250,13 @@ bool ChatHandler::HandleModifyEnergyCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_ENERGY, GetNameLink(chr).c_str(), energy/10, energym/10);
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetNameLink().c_str(), energy/10, energym/10);
chr->SetMaxPower(POWER_ENERGY,energym );
chr->SetPower(POWER_ENERGY, energy );
@@ -1226,9 +1301,13 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_RAGE, GetNameLink(chr).c_str(), rage/10, ragem/10);
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetNameLink().c_str(), rage/10, ragem/10);
chr->SetMaxPower(POWER_RAGE,ragem );
chr->SetPower(POWER_RAGE, rage );
@@ -1236,6 +1315,40 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
return true;
}
+// Edit Player Runic Power
+bool ChatHandler::HandleModifyRunicPowerCommand(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)
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player *chr = getSelectedPlayer();
+ if (chr == NULL)
+ {
+ SendSysMessage(LANG_NO_CHAR_SELECTED);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, GetNameLink(chr).c_str(), rune/10, runem/10);
+ if (needReportToTarget(chr))
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, GetNameLink().c_str(), rune/10, runem/10);
+
+ chr->SetMaxPower(POWER_RUNIC_POWER,runem );
+ chr->SetPower(POWER_RUNIC_POWER, rune );
+
+ return true;
+}
+
//Edit Player Faction
bool ChatHandler::HandleModifyFactionCommand(const char* args)
{
@@ -1350,9 +1463,13 @@ bool ChatHandler::HandleModifySpellCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetNameLink().c_str(), spellflatid, val, mark);
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2));
data << uint8(spellflatid);
@@ -1380,6 +1497,11 @@ bool ChatHandler::HandleModifyTalentCommand (const char* args)
SetSentErrorMessage(true);
return false;
}
+
+ // check online security
+ if (HasLowerSecurity(player, 0))
+ return false;
+
player->SetFreeTalentPoints(tp);
return true;
}
@@ -1404,21 +1526,25 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
chr=m_session->GetPlayer();
}
+ // check online security
+ else if (HasLowerSecurity(chr, 0))
+ return false;
+
if (argstr == "on")
{
chr->SetTaxiCheater(true);
- PSendSysMessage(LANG_YOU_GIVE_TAXIS, chr->GetName());
+ PSendSysMessage(LANG_YOU_GIVE_TAXIS, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetNameLink().c_str());
return true;
}
if (argstr == "off")
{
chr->SetTaxiCheater(false);
- PSendSysMessage(LANG_YOU_REMOVE_TAXIS, chr->GetName());
+ PSendSysMessage(LANG_YOU_REMOVE_TAXIS, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetNameLink().c_str());
return true;
}
@@ -1451,16 +1577,22 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = GetNameLink(chr);
+
if(chr->isInFlight())
{
- PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
+ PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, chr->GetName());
+ PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, chrNameLink.c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, GetName(), ASpeed);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, GetNameLink().c_str(), ASpeed);
chr->SetSpeed(MOVE_WALK, ASpeed,true);
chr->SetSpeed(MOVE_RUN, ASpeed,true);
@@ -1493,16 +1625,22 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = GetNameLink(chr);
+
if(chr->isInFlight())
{
- PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
+ PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, chr->GetName());
+ PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, chrNameLink.c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, GetName(), Speed);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, GetNameLink().c_str(), Speed);
chr->SetSpeed(MOVE_RUN,Speed,true);
@@ -1532,16 +1670,22 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = GetNameLink(chr);
+
if(chr->isInFlight())
{
- PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
+ PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, chr->GetName());
+ PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, chrNameLink.c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, GetName(), Swim);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, GetNameLink().c_str(), Swim);
chr->SetSpeed(MOVE_SWIM,Swim,true);
@@ -1571,16 +1715,22 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = GetNameLink(chr);
+
if(chr->isInFlight())
{
- PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
+ PSendSysMessage(LANG_CHAR_IN_FLIGHT,chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, chr->GetName());
+ PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, chrNameLink.c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, GetName(), BSpeed);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, GetNameLink().c_str(), BSpeed);
chr->SetSpeed(MOVE_RUN_BACK,BSpeed,true);
@@ -1610,9 +1760,13 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetNameLink().c_str(), FSpeed);
chr->SetSpeed(MOVE_FLIGHT,FSpeed,true);
@@ -1641,9 +1795,13 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetNameLink().c_str(), Scale);
chr->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale);
@@ -1884,9 +2042,13 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
return false;
}
- PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ PSendSysMessage(LANG_YOU_GIVE_MOUNT, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetNameLink().c_str());
chr->SetUInt32Value( UNIT_FIELD_FLAGS , 0x001000 );
chr->Mount(mId);
@@ -1921,6 +2083,10 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
int32 addmoney = atoi((char*)args);
uint32 moneyuser = chr->GetMoney();
@@ -1932,25 +2098,25 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
sLog.outDetail(GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
if(newmoney <= 0 )
{
- PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, chr->GetName());
+ PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, GetNameLink().c_str());
chr->SetMoney(0);
}
else
{
- PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), chr->GetName());
+ PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, GetName(), abs(addmoney));
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, GetNameLink().c_str(), abs(addmoney));
chr->SetMoney( newmoney );
}
}
else
{
- PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, chr->GetName());
+ PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, GetName(), addmoney);
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, GetNameLink().c_str(), addmoney);
chr->ModifyMoney( addmoney );
}
@@ -1959,20 +2125,24 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
return true;
}
-//Edit Player field
+//Edit Unit field
bool ChatHandler::HandleModifyBitCommand(const char* args)
{
if( !*args )
return false;
- Player *chr = getSelectedPlayer();
- if (chr == NULL)
+ Unit *unit = getSelectedUnit();
+ if (!unit)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
+ // check online security
+ if (unit->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player *)unit, 0))
+ return false;
+
char* pField = strtok((char*)args, " ");
if (!pField)
return false;
@@ -1984,13 +2154,12 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)
uint16 field = atoi(pField);
uint32 bit = atoi(pBit);
- if (field < 1 || field >= PLAYER_END)
+ if (field < OBJECT_END || field >= unit->GetValuesCount())
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
return false;
}
-
if (bit < 1 || bit > 32)
{
SendSysMessage(LANG_BAD_VALUE);
@@ -1998,17 +2167,16 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)
return false;
}
- if ( chr->HasFlag( field, (1<<(bit-1)) ) )
+ if ( unit->HasFlag( field, (1<<(bit-1)) ) )
{
- chr->RemoveFlag( field, (1<<(bit-1)) );
+ unit->RemoveFlag( field, (1<<(bit-1)) );
PSendSysMessage(LANG_REMOVE_BIT, bit, field);
}
else
{
- chr->SetFlag( field, (1<<(bit-1)) );
+ unit->SetFlag( field, (1<<(bit-1)) );
PSendSysMessage(LANG_SET_BIT, bit, field);
}
-
return true;
}
@@ -2025,11 +2193,15 @@ bool ChatHandler::HandleModifyHonorCommand (const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
int32 amount = (uint32)atoi(args);
target->ModifyHonorPoints(amount);
- PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, target->GetName(), target->GetHonorPoints());
+ PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, GetNameLink(target).c_str(), target->GetHonorPoints());
return true;
}
@@ -2132,8 +2304,10 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
}
}
}
+
if (counter == 0) // if counter == 0 then we found nth
SendSysMessage (LANG_COMMAND_NOAREAFOUND);
+
return true;
}
@@ -2215,35 +2389,6 @@ bool ChatHandler::HandleWhispersCommand(const char* args)
return false;
}
-//Play sound
-bool ChatHandler::HandlePlaySoundCommand(const char* args)
-{
- // USAGE: .debug playsound #soundid
- // #soundid - ID decimal number from SoundEntries.dbc (1st column)
- // this file have about 5000 sounds.
- // In this realization only caller can hear this sound.
- if( *args )
- {
- uint32 dwSoundId = atoi((char*)args);
-
- if( !sSoundEntriesStore.LookupEntry(dwSoundId) )
- {
- PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId);
- SetSentErrorMessage(true);
- return false;
- }
-
- WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8);
- data << uint32(dwSoundId) << m_session->GetPlayer()->GetGUID();
- m_session->SendPacket(&data);
-
- PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId);
- return true;
- }
-
- return false;
-}
-
//Save all players in the world
bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
{
@@ -2260,9 +2405,13 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
// format: name "subject text" "mail text"
- char* pName = strtok((char*)args, " ");
- if(!pName)
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
+ }
char* tail1 = strtok(NULL, "");
if(!tail1)
@@ -2300,18 +2449,10 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
if (!msgText)
return false;
- // pName, msgSubject, msgText isn't NUL after prev. check
- std::string name = pName;
+ // msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
- if(!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
uint64 receiver_guid = objmgr.GetPlayerGUIDByName(name);
if(!receiver_guid)
{
@@ -2320,7 +2461,6 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
return false;
}
- uint32 mailId = objmgr.GenerateMailID();
// from console show not existed sender
uint32 sender_guidlo = m_session ? m_session->GetPlayer()->GetGUIDLow() : 0;
@@ -2332,24 +2472,19 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
WorldSession::SendMailTo(receiver,messagetype, stationery, sender_guidlo, GUID_LOPART(receiver_guid), subject, itemTextId, NULL, 0, 0, MAIL_CHECK_MASK_NONE);
- PSendSysMessage(LANG_MAIL_SENT, name.c_str());
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
// teleport player to given game_tele.entry
-bool ChatHandler::HandleNameTeleCommand(const char * args)
+bool ChatHandler::HandleTeleNameCommand(const char * args)
{
if(!*args)
return false;
- char* pName = strtok((char*)args, " ");
-
- if(!pName)
- return false;
-
- std::string name = pName;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -2380,17 +2515,22 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
Player *chr = objmgr.GetPlayer(name.c_str());
if (chr)
{
+ // check online security
+ if (HasLowerSecurity(chr, 0))
+ return false;
+
+ std::string chrNameLink = playerLink(name);
if(chr->IsBeingTeleported()==true)
{
- PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
+ PSendSysMessage(LANG_IS_TELEPORTED, chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- PSendSysMessage(LANG_TELEPORTING_TO, chr->GetName(),"", tele->name.c_str());
+ PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(),"", tele->name.c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_TELEPORTED_TO_BY, GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_TELEPORTED_TO_BY, GetNameLink().c_str());
// stop flight if need
if(chr->isInFlight())
@@ -2404,10 +2544,17 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
chr->TeleportTo(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation);
}
- else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
+ else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
{
- PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetTrinityString(LANG_OFFLINE), tele->name.c_str());
- Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y),guid);
+ // check offline security
+ if (HasLowerSecurity(NULL, guid))
+ return false;
+
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str());
+ Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,
+ MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),guid);
}
else
PSendSysMessage(LANG_NO_PLAYER, name.c_str());
@@ -2416,7 +2563,7 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
}
//Teleport group to given game_tele.entry
-bool ChatHandler::HandleGroupTeleCommand(const char * args)
+bool ChatHandler::HandleTeleGroupCommand(const char * args)
{
if(!*args)
return false;
@@ -2429,6 +2576,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(player, 0))
+ return false;
+
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
GameTele const* tele = extractGameTeleFromLink((char*)args);
if(!tele)
@@ -2445,10 +2596,13 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
SetSentErrorMessage(true);
return false;
}
+
+ std::string nameLink = GetNameLink(player);
+
Group *grp = player->GetGroup();
if(!grp)
{
- PSendSysMessage(LANG_NOT_IN_GROUP,player->GetName());
+ PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -2460,15 +2614,21 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
if(!pl || !pl->GetSession() )
continue;
+ // check online security
+ if (HasLowerSecurity(pl, 0))
+ return false;
+
+ std::string plNameLink = GetNameLink(pl);
+
if(pl->IsBeingTeleported())
{
- PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
+ PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
continue;
}
- PSendSysMessage(LANG_TELEPORTING_TO, pl->GetName(),"", tele->name.c_str());
+ PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(),"", tele->name.c_str());
if (needReportToTarget(pl))
- ChatHandler(pl).PSendSysMessage(LANG_TELEPORTED_TO_BY, GetName());
+ ChatHandler(pl).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str());
// stop flight if need
if(pl->isInFlight())
@@ -2492,9 +2652,8 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
if(!*args)
return false;
- std::string name = args;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -2509,16 +2668,22 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(player, 0))
+ return false;
+
Group *grp = player->GetGroup();
+ std::string nameLink = playerLink(name);
+
if(!grp)
{
- PSendSysMessage(LANG_NOT_IN_GROUP,player->GetName());
+ PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
- Map* gmMap = MapManager::Instance().GetMap(m_session->GetPlayer()->GetMapId(),m_session->GetPlayer());
+ Map* gmMap = m_session->GetPlayer()->GetMap();
bool to_instance = gmMap->Instanceable();
// we are in instance, and can summon only player in our group with us as lead
@@ -2539,29 +2704,35 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
if(!pl || pl==m_session->GetPlayer() || !pl->GetSession() )
continue;
+ // check online security
+ if (HasLowerSecurity(pl, 0))
+ return false;
+
+ std::string plNameLink = playerLink(pl->GetName());
+
if(pl->IsBeingTeleported()==true)
{
- PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
+ PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
if (to_instance)
{
- Map* plMap = MapManager::Instance().GetMap(pl->GetMapId(),pl);
+ Map* plMap = pl->GetMap();
if ( plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId() )
{
// cannot summon from instance to instance
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,pl->GetName());
+ PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,plNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
}
- PSendSysMessage(LANG_SUMMONING, pl->GetName(),"");
+ PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(),"");
if (needReportToTarget(pl))
- ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetName());
+ ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
// stop flight if need
if(pl->isInFlight())
@@ -2695,6 +2866,11 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
float x = (float)atof(px);
float y = (float)atof(py);
+
+ // prevent accept wrong numeric args
+ if (x==0.0f && *px!='0' || y==0.0f && *py!='0')
+ return false;
+
uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaid);
@@ -2791,7 +2967,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args)
return true;
}
-bool ChatHandler::HandleDrunkCommand(const char* args)
+bool ChatHandler::HandleModifyDrunkCommand(const char* args)
{
if(!*args) return false;
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 4937d230142..9aa1fec4778 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -10,19 +10,16 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Database/DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "Item.h"
@@ -33,9 +30,11 @@
#include "MapManager.h"
#include "Language.h"
#include "World.h"
-#include "GameEvent.h"
+#include "GameEventMgr.h"
#include "SpellMgr.h"
+#include "PoolHandler.h"
#include "AccountMgr.h"
+#include "TicketMgr.h"
#include "WaypointManager.h"
#include "Util.h"
#include <cctype>
@@ -46,6 +45,7 @@
#include "TicketMgr.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
+#include "CreatureGroups.h"
static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK] =
{
@@ -59,11 +59,13 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if (!*args)
return false;
- char *charname = strtok((char*)args, " ");
- if (!charname)
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
-
- std::string cname = charname;
+ }
char *timetonotspeak = strtok(NULL, " ");
if(!timetonotspeak)
@@ -71,14 +73,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
uint32 notspeaktime = (uint32) atoi(timetonotspeak);
- if(!normalizePlayerName(cname))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint64 guid = objmgr.GetPlayerGUIDByName(cname.c_str());
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
if(!guid)
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
@@ -88,27 +83,11 @@ bool ChatHandler::HandleMuteCommand(const char* args)
Player *chr = objmgr.GetPlayer(guid);
- // check security
- uint32 account_id = 0;
- uint32 security = 0;
-
- if (chr)
- {
- account_id = chr->GetSession()->GetAccountId();
- security = chr->GetSession()->GetSecurity();
- }
- else
- {
- account_id = objmgr.GetPlayerAccountIdByGUID(guid);
- security = accmgr.GetSecurity(account_id);
- }
-
- if(m_session && security >= m_session->GetSecurity())
- {
- SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
- SetSentErrorMessage(true);
+ // must have strong lesser security level
+ if(HasLowerSecurity (chr,guid,true))
return false;
- }
+
+ uint32 account_id = chr ? chr->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(guid);
time_t mutetime = time(NULL) + notspeaktime*60;
@@ -120,7 +99,9 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(chr)
ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime);
- PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime);
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_YOU_DISABLE_CHAT, nameLink.c_str(), notspeaktime);
return true;
}
@@ -131,20 +112,15 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
if (!*args)
return false;
- char *charname = strtok((char*)args, " ");
- if (!charname)
- return false;
-
- std::string cname = charname;
-
- if(!normalizePlayerName(cname))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
- uint64 guid = objmgr.GetPlayerGUIDByName(cname.c_str());
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
if(!guid)
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
@@ -154,27 +130,11 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
Player *chr = objmgr.GetPlayer(guid);
- // check security
- uint32 account_id = 0;
- uint32 security = 0;
-
- if (chr)
- {
- account_id = chr->GetSession()->GetAccountId();
- security = chr->GetSession()->GetSecurity();
- }
- else
- {
- account_id = objmgr.GetPlayerAccountIdByGUID(guid);
- security = accmgr.GetSecurity(account_id);
- }
-
- if(m_session && security >= m_session->GetSecurity())
- {
- SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
- SetSentErrorMessage(true);
+ // must have strong lesser security level
+ if(HasLowerSecurity (chr,guid,true))
return false;
- }
+
+ uint32 account_id = chr ? chr->GetSession()->GetAccountId() : objmgr.GetPlayerAccountIdByGUID(guid);
if (chr)
{
@@ -193,161 +153,15 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
if(chr)
ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
- PSendSysMessage(LANG_YOU_ENABLE_CHAT, cname.c_str());
- return true;
-}
-
-bool ChatHandler::HandleTargetObjectCommand(const char* args)
-{
- Player* pl = m_session->GetPlayer();
- QueryResult *result;
- GameEvent::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
- if(*args)
- {
- int32 id = atoi((char*)args);
- if(id)
- result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
- pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),id);
- else
- {
- std::string name = args;
- WorldDatabase.escape_string(name);
- result = WorldDatabase.PQuery(
- "SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
- "FROM gameobject,gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'")" ORDER BY order_ ASC LIMIT 1",
- pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),name.c_str());
- }
- }
- else
- {
- std::ostringstream eventFilter;
- eventFilter << " AND (event IS NULL ";
- bool initString = true;
-
- for (GameEvent::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
- {
- if (initString)
- {
- eventFilter << "OR event IN (" <<*itr;
- initString =false;
- }
- else
- eventFilter << "," << *itr;
- }
-
- if (!initString)
- eventFilter << "))";
- else
- eventFilter << ")";
-
- result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, "
- "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
- "LEFT OUTER JOIN game_event_gameobject on gameobject.guid=game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 1",
- m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY(), m_session->GetPlayer()->GetPositionZ(), m_session->GetPlayer()->GetMapId(),eventFilter.str().c_str());
- }
-
- if (!result)
- {
- SendSysMessage(LANG_COMMAND_TARGETOBJNOTFOUND);
- return true;
- }
-
- Field *fields = result->Fetch();
- uint32 lowguid = fields[0].GetUInt32();
- uint32 id = fields[1].GetUInt32();
- float x = fields[2].GetFloat();
- float y = fields[3].GetFloat();
- float z = fields[4].GetFloat();
- float o = fields[5].GetFloat();
- int mapid = fields[6].GetUInt16();
- delete result;
-
- GameObjectInfo const* goI = objmgr.GetGameObjectInfo(id);
-
- if (!goI)
- {
- PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
- return false;
- }
-
- GameObject* target = ObjectAccessor::GetGameObject(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
-
- PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name, lowguid, id, x, y, z, mapid, o);
+ std::string nameLink = playerLink(name);
- if(target)
- {
- int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
- if(curRespawnDelay < 0)
- curRespawnDelay = 0;
-
- std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true);
- std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(),true);
-
- PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(),curRespawnDelayStr.c_str());
- }
- return true;
-}
-
-//teleport to gameobject
-bool ChatHandler::HandleGoObjectCommand(const char* args)
-{
- if(!*args)
- return false;
-
- Player* _player = m_session->GetPlayer();
-
- // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
- char* cId = extractKeyFromLink((char*)args,"Hgameobject");
- if(!cId)
- return false;
-
- int32 guid = atoi(cId);
- if(!guid)
- return false;
-
- float x, y, z, ort;
- int mapid;
-
- // by DB guid
- if (GameObjectData const* go_data = objmgr.GetGOData(guid))
- {
- x = go_data->posX;
- y = go_data->posY;
- z = go_data->posZ;
- ort = go_data->orientation;
- mapid = go_data->mapid;
- }
- else
- {
- SendSysMessage(LANG_COMMAND_GOOBJNOTFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if(!MapManager::IsValidMapCoord(mapid,x,y,z,ort))
- {
- PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
- SetSentErrorMessage(true);
- return false;
- }
-
- // stop flight if need
- if(_player->isInFlight())
- {
- _player->GetMotionMaster()->MovementExpired();
- _player->m_taxi.ClearTaxiDestinations();
- }
- // save only in non-flight case
- else
- _player->SaveRecallPosition();
-
- _player->TeleportTo(mapid, x, y, z, ort);
+ PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
return true;
}
bool ChatHandler::HandleGoTicketCommand(const char * args)
{
- if(!*args)
+ if(!*args)
return false;
char *cstrticket_id = strtok((char*)args, " ");
@@ -478,15 +292,15 @@ bool ChatHandler::HandleGoGraveyardCommand(const char* args)
}
/** \brief Teleport the GM to the specified creature
- *
- * .gocreature <GUID> --> TP using creature.guid
- * .gocreature azuregos --> TP player to the mob with this name
- * Warning: If there is more than one mob with this name
- * you will be teleported to the first one that is found.
- * .gocreature id 6109 --> TP player to the mob, that has this creature_template.entry
- * Warning: If there is more than one mob with this "id"
- * you will be teleported to the first one that is found.
- */
+*
+* .gocreature <GUID> --> TP using creature.guid
+* .gocreature azuregos --> TP player to the mob with this name
+* Warning: If there is more than one mob with this name
+* you will be teleported to the first one that is found.
+* .gocreature id 6109 --> TP player to the mob, that has this creature_template.entry
+* Warning: If there is more than one mob with this "id"
+* you will be teleported to the first one that is found.
+*/
//teleport to creature
bool ChatHandler::HandleGoCreatureCommand(const char* args)
{
@@ -584,434 +398,180 @@ bool ChatHandler::HandleGoCreatureCommand(const char* args)
return true;
}
-bool ChatHandler::HandleGUIDCommand(const char* /*args*/)
+//teleport to gameobject
+bool ChatHandler::HandleGoObjectCommand(const char* args)
{
- uint64 guid = m_session->GetPlayer()->GetSelection();
-
- if (guid == 0)
- {
- SendSysMessage(LANG_NO_SELECTION);
- SetSentErrorMessage(true);
+ if(!*args)
return false;
- }
- PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
- return true;
-}
+ Player* _player = m_session->GetPlayer();
-bool ChatHandler::HandleLookupFactionCommand(const char* args)
-{
- if (!*args)
+ // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hgameobject");
+ if(!cId)
return false;
- // Can be NULL at console call
- Player *target = getSelectedPlayer ();
-
- std::string namepart = args;
- std::wstring wnamepart;
-
- if (!Utf8toWStr (namepart,wnamepart))
+ int32 guid = atoi(cId);
+ if(!guid)
return false;
- // converting string that we try to find to lower case
- wstrToLower (wnamepart);
-
- uint32 counter = 0; // Counter for figure out that we found smth.
+ float x, y, z, ort;
+ int mapid;
- for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
+ // by DB guid
+ if (GameObjectData const* go_data = objmgr.GetGOData(guid))
{
- FactionEntry const *factionEntry = sFactionStore.LookupEntry (id);
- if (factionEntry)
- {
- FactionState const* repState = NULL;
- if(target)
- {
- FactionStateList::const_iterator repItr = target->m_factions.find (factionEntry->reputationListID);
- if(repItr != target->m_factions.end())
- repState = &repItr->second;
- }
-
- int loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale();
- std::string name = factionEntry->name[loc];
- if(name.empty())
- continue;
-
- if (!Utf8FitTo(name, wnamepart))
- {
- loc = 0;
- for(; loc < MAX_LOCALE; ++loc)
- {
- if(m_session && loc==m_session->GetSessionDbcLocale())
- continue;
-
- name = factionEntry->name[loc];
- if(name.empty())
- continue;
-
- if (Utf8FitTo(name, wnamepart))
- break;
- }
- }
-
- if(loc < MAX_LOCALE)
- {
- // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
- // or "id - [faction] [no reputation]" format
- std::ostringstream ss;
- if (m_session)
- ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r";
- else
- ss << id << " - " << name << " " << localeNames[loc];
-
- if (repState) // and then target!=NULL also
- {
- ReputationRank rank = target->GetReputationRank(factionEntry);
- std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
-
- ss << " " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
-
- if(repState->Flags & FACTION_FLAG_VISIBLE)
- ss << GetTrinityString(LANG_FACTION_VISIBLE);
- if(repState->Flags & FACTION_FLAG_AT_WAR)
- ss << GetTrinityString(LANG_FACTION_ATWAR);
- if(repState->Flags & FACTION_FLAG_PEACE_FORCED)
- ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if(repState->Flags & FACTION_FLAG_HIDDEN)
- ss << GetTrinityString(LANG_FACTION_HIDDEN);
- if(repState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if(repState->Flags & FACTION_FLAG_INACTIVE)
- ss << GetTrinityString(LANG_FACTION_INACTIVE);
- }
- else
- ss << GetTrinityString(LANG_FACTION_NOREPUTATION);
-
- SendSysMessage(ss.str().c_str());
- counter++;
- }
- }
+ x = go_data->posX;
+ y = go_data->posY;
+ z = go_data->posZ;
+ ort = go_data->orientation;
+ mapid = go_data->mapid;
}
-
- if (counter == 0) // if counter == 0 then we found nth
- SendSysMessage(LANG_COMMAND_FACTION_NOTFOUND);
- return true;
-}
-
-bool ChatHandler::HandleModifyRepCommand(const char * args)
-{
- if (!*args) return false;
-
- Player* target = NULL;
- target = getSelectedPlayer();
-
- if(!target)
+ else
{
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SendSysMessage(LANG_COMMAND_GOOBJNOTFOUND);
SetSentErrorMessage(true);
return false;
}
- char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
- if(!factionTxt)
- return false;
-
- uint32 factionId = atoi(factionTxt);
-
- int32 amount = 0;
- char *rankTxt = strtok(NULL, " ");
- if (!factionTxt || !rankTxt)
- return false;
-
- amount = atoi(rankTxt);
- if ((amount == 0) && (rankTxt[0] != '-') && !isdigit(rankTxt[0]))
- {
- std::string rankStr = rankTxt;
- std::wstring wrankStr;
- if(!Utf8toWStr(rankStr,wrankStr))
- return false;
- wstrToLower( wrankStr );
-
- int r = 0;
- amount = -42000;
- for (; r < MAX_REPUTATION_RANK; ++r)
- {
- std::string rank = GetTrinityString(ReputationRankStrIndex[r]);
- if(rank.empty())
- continue;
-
- std::wstring wrank;
- if(!Utf8toWStr(rank,wrank))
- continue;
-
- wstrToLower(wrank);
-
- if(wrank.substr(0,wrankStr.size())==wrankStr)
- {
- char *deltaTxt = strtok(NULL, " ");
- if (deltaTxt)
- {
- int32 delta = atoi(deltaTxt);
- if ((delta < 0) || (delta > Player::ReputationRank_Length[r] -1))
- {
- PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (Player::ReputationRank_Length[r]-1));
- SetSentErrorMessage(true);
- return false;
- }
- amount += delta;
- }
- break;
- }
- amount += Player::ReputationRank_Length[r];
- }
- if (r >= MAX_REPUTATION_RANK)
- {
- PSendSysMessage(LANG_COMMAND_FACTION_INVPARAM, rankTxt);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionId);
-
- if (!factionEntry)
+ if(!MapManager::IsValidMapCoord(mapid,x,y,z,ort))
{
- PSendSysMessage(LANG_COMMAND_FACTION_UNKNOWN, factionId);
+ PSendSysMessage(LANG_INVALID_TARGET_COORD,x,y,mapid);
SetSentErrorMessage(true);
return false;
}
- if (factionEntry->reputationListID < 0)
+ // stop flight if need
+ if(_player->isInFlight())
{
- PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[m_session->GetSessionDbcLocale()], factionId);
- SetSentErrorMessage(true);
- return false;
+ _player->GetMotionMaster()->MovementExpired();
+ _player->m_taxi.ClearTaxiDestinations();
}
+ // save only in non-flight case
+ else
+ _player->SaveRecallPosition();
- target->SetFactionReputation(factionEntry,amount);
- PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[m_session->GetSessionDbcLocale()], factionId, target->GetName(), target->GetReputation(factionId));
+ _player->TeleportTo(mapid, x, y, z, ort);
return true;
}
-bool ChatHandler::HandleNameCommand(const char* args)
+bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
{
- /* Temp. disabled
- if(!*args)
+ Player* pl = m_session->GetPlayer();
+ QueryResult *result;
+ GameEventMgr::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
+ if(*args)
+ {
+ // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hgameobject_entry");
+ if(!cId)
return false;
- if(strlen((char*)args)>75)
+ uint32 id = atol(cId);
+
+ if(id)
+ result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
+ pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),id);
+ else
{
- PSendSysMessage(LANG_TOO_LONG_NAME, strlen((char*)args)-75);
- return true;
+ std::string name = cId;
+ WorldDatabase.escape_string(name);
+ result = WorldDatabase.PQuery(
+ "SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
+ "FROM gameobject,gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'")" ORDER BY order_ ASC LIMIT 1",
+ pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),name.c_str());
}
+ }
+ else
+ {
+ std::ostringstream eventFilter;
+ eventFilter << " AND (event IS NULL ";
+ bool initString = true;
- for (uint8 i = 0; i < strlen(args); i++)
+ for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
{
- if(!isalpha(args[i]) && args[i]!=' ')
+ if (initString)
{
- SendSysMessage(LANG_CHARS_ONLY);
- return false;
+ eventFilter << "OR event IN (" <<*itr;
+ initString =false;
}
+ else
+ eventFilter << "," << *itr;
}
- uint64 guid;
- guid = m_session->GetPlayer()->GetSelection();
- if (guid == 0)
- {
- SendSysMessage(LANG_NO_SELECTION);
- return true;
- }
-
- Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
-
- if(!pCreature)
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- return true;
- }
-
- pCreature->SetName(args);
- uint32 idname = objmgr.AddCreatureTemplate(pCreature->GetName());
- pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
-
- pCreature->SaveToDB();
- */
-
- return true;
-}
-
-bool ChatHandler::HandleSubNameCommand(const char* /*args*/)
-{
- /* Temp. disabled
-
- if(!*args)
- args = "";
-
- if(strlen((char*)args)>75)
- {
+ if (!initString)
+ eventFilter << "))";
+ else
+ eventFilter << ")";
- PSendSysMessage(LANG_TOO_LONG_SUBNAME, strlen((char*)args)-75);
- return true;
+ result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, "
+ "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
+ "LEFT OUTER JOIN game_event_gameobject on gameobject.guid=game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
+ m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY(), m_session->GetPlayer()->GetPositionZ(), m_session->GetPlayer()->GetMapId(),eventFilter.str().c_str());
}
- for (uint8 i = 0; i < strlen(args); i++)
- {
- if(!isalpha(args[i]) && args[i]!=' ')
- {
- SendSysMessage(LANG_CHARS_ONLY);
- return false;
- }
- }
- uint64 guid;
- guid = m_session->GetPlayer()->GetSelection();
- if (guid == 0)
+ if (!result)
{
- SendSysMessage(LANG_NO_SELECTION);
+ SendSysMessage(LANG_COMMAND_TARGETOBJNOTFOUND);
return true;
}
- Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
+ bool found = false;
+ float x, y, z, o;
+ uint32 lowguid, id;
+ uint16 mapid, pool_id;
- if(!pCreature)
+ do
{
- SendSysMessage(LANG_SELECT_CREATURE);
- return true;
- }
-
- uint32 idname = objmgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
- pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
-
- pCreature->SaveToDB();
- */
- return true;
-}
-
-//move item to other slot
-bool ChatHandler::HandleItemMoveCommand(const char* args)
-{
- if(!*args)
- return false;
- uint8 srcslot, dstslot;
-
- char* pParam1 = strtok((char*)args, " ");
- if (!pParam1)
- return false;
-
- char* pParam2 = strtok(NULL, " ");
- if (!pParam2)
- return false;
-
- srcslot = (uint8)atoi(pParam1);
- dstslot = (uint8)atoi(pParam2);
-
- if(srcslot==dstslot)
- return true;
-
- if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
- return false;
-
- if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,dstslot))
- return false;
-
- uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
- uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);
-
- m_session->GetPlayer()->SwapItem( src, dst );
-
- return true;
-}
-
-//add spawn of creature
-bool ChatHandler::HandleNpcAddCommand(const char* args)
-{
- if(!*args)
- return false;
- char* charID = strtok((char*)args, " ");
- if (!charID)
- return false;
-
- char* team = strtok(NULL, " ");
- int32 teamval = 0;
- if (team) { teamval = atoi(team); }
- if (teamval < 0) { teamval = 0; }
-
- uint32 id = atoi(charID);
+ Field *fields = result->Fetch();
+ lowguid = fields[0].GetUInt32();
+ id = fields[1].GetUInt32();
+ x = fields[2].GetFloat();
+ y = fields[3].GetFloat();
+ z = fields[4].GetFloat();
+ o = fields[5].GetFloat();
+ mapid = fields[6].GetUInt16();
+ pool_id = poolhandler.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT);
+ if (!pool_id || (pool_id && poolhandler.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT)))
+ found = true;
+ } while( result->NextRow() && (!found) );
- Player *chr = m_session->GetPlayer();
- float x = chr->GetPositionX();
- float y = chr->GetPositionY();
- float z = chr->GetPositionZ();
- float o = chr->GetOrientation();
- Map *map = chr->GetMap();
+ delete result;
- Creature* pCreature = new Creature;
- if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, (uint32)teamval))
+ if (!found)
{
- delete pCreature;
+ PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
return false;
}
- pCreature->Relocate(x,y,z,o);
+ GameObjectInfo const* goI = objmgr.GetGameObjectInfo(id);
- if(!pCreature->IsPositionValid())
+ if (!goI)
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
- delete pCreature;
+ PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
return false;
}
- pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
-
- uint32 db_guid = pCreature->GetDBTableGUIDLow();
-
- // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
- pCreature->LoadFromDB(db_guid, map);
-
- map->Add(pCreature);
- objmgr.AddCreatureToGrid(db_guid, objmgr.GetCreatureData(db_guid));
- return true;
-}
+ GameObject* target = ObjectAccessor::GetGameObject(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
-bool ChatHandler::HandleNpcDeleteCommand(const char* args)
-{
- Creature* unit = NULL;
+ PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name, lowguid, id, x, y, z, mapid, o);
- if(*args)
+ if(target)
{
- // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
- char* cId = extractKeyFromLink((char*)args,"Hcreature");
- if(!cId)
- return false;
-
- uint32 lowguid = atoi(cId);
- if(!lowguid)
- return false;
+ int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
+ if(curRespawnDelay < 0)
+ curRespawnDelay = 0;
- if (CreatureData const* cr_data = objmgr.GetCreatureData(lowguid))
- unit = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
- }
- else
- unit = getSelectedCreature();
+ std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true);
+ std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(),true);
- if(!unit || unit->isPet() || unit->isTotem())
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
+ PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(),curRespawnDelayStr.c_str());
}
-
- // Delete the creature
- unit->CombatStop();
- unit->DeleteFromDB();
- unit->CleanupsBeforeDelete();
- unit->AddObjectToRemoveList();
-
- SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
-
return true;
}
//delete object by selection or guid
-bool ChatHandler::HandleDelObjectCommand(const char* args)
+bool ChatHandler::HandleGameObjectDeleteCommand(const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
char* cId = extractKeyFromLink((char*)args,"Hgameobject");
@@ -1059,7 +619,7 @@ bool ChatHandler::HandleDelObjectCommand(const char* args)
}
//turn selected object
-bool ChatHandler::HandleTurnObjectCommand(const char* args)
+bool ChatHandler::HandleGameObjectTurnCommand(const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
char* cId = extractKeyFromLink((char*)args,"Hgameobject");
@@ -1096,109 +656,24 @@ bool ChatHandler::HandleTurnObjectCommand(const char* args)
o = chr->GetOrientation();
}
- float rot2 = sin(o/2);
- float rot3 = cos(o/2);
-
- Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
+ Map* map = obj->GetMap();
map->Remove(obj,false);
obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o);
-
- obj->SetFloatValue(GAMEOBJECT_FACING, o);
- obj->SetFloatValue(GAMEOBJECT_ROTATION+2, rot2);
- obj->SetFloatValue(GAMEOBJECT_ROTATION+3, rot3);
+ obj->UpdateRotationFields();
map->Add(obj);
obj->SaveToDB();
obj->Refresh();
- PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, obj->GetGUIDLow(), o);
+ PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, obj->GetGUIDLow(), obj->GetGOInfo()->name, obj->GetGUIDLow(), o);
return true;
}
-//move selected creature
-bool ChatHandler::HandleNpcMoveCommand(const char* args)
-{
- uint32 lowguid = 0;
-
- Creature* pCreature = getSelectedCreature();
-
- if(!pCreature)
- {
- // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
- char* cId = extractKeyFromLink((char*)args,"Hcreature");
- if(!cId)
- return false;
-
- uint32 lowguid = atoi(cId);
-
- /* FIXME: impossibel without entry
- if(lowguid)
- pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_GUID(lowguid,HIGHGUID_UNIT));
- */
-
- // Attempting creature load from DB data
- if(!pCreature)
- {
- CreatureData const* data = objmgr.GetCreatureData(lowguid);
- if(!data)
- {
- PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 map_id = data->mapid;
-
- if(m_session->GetPlayer()->GetMapId()!=map_id)
- {
- PSendSysMessage(LANG_COMMAND_CREATUREATSAMEMAP, lowguid);
- SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- lowguid = pCreature->GetDBTableGUIDLow();
- }
- }
- else
- {
- lowguid = pCreature->GetDBTableGUIDLow();
- }
-
- float x = m_session->GetPlayer()->GetPositionX();
- float y = m_session->GetPlayer()->GetPositionY();
- float z = m_session->GetPlayer()->GetPositionZ();
- float o = m_session->GetPlayer()->GetOrientation();
-
- if (pCreature)
- {
- if(CreatureData const* data = objmgr.GetCreatureData(pCreature->GetDBTableGUIDLow()))
- {
- const_cast<CreatureData*>(data)->posX = x;
- const_cast<CreatureData*>(data)->posY = y;
- const_cast<CreatureData*>(data)->posZ = z;
- const_cast<CreatureData*>(data)->orientation = o;
- }
- MapManager::Instance().GetMap(pCreature->GetMapId(),pCreature)->CreatureRelocation(pCreature,x, y, z,o);
- pCreature->GetMotionMaster()->Initialize();
- if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
- {
- pCreature->setDeathState(JUST_DIED);
- pCreature->Respawn();
- }
- }
-
- WorldDatabase.PExecuteLog("UPDATE creature SET position_x = '%f', position_y = '%f', position_z = '%f', orientation = '%f' WHERE guid = '%u'", x, y, z, o, lowguid);
- PSendSysMessage(LANG_COMMAND_CREATUREMOVED);
- return true;
-}
-
//move selected object
-bool ChatHandler::HandleMoveObjectCommand(const char* args)
+bool ChatHandler::HandleGameObjectMoveCommand(const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
char* cId = extractKeyFromLink((char*)args,"Hgameobject");
@@ -1230,7 +705,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
{
Player *chr = m_session->GetPlayer();
- Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
+ Map* map = obj->GetMap();
map->Remove(obj,false);
obj->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), obj->GetOrientation());
@@ -1256,7 +731,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
return false;
}
- Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
+ Map* map = obj->GetMap();
map->Remove(obj,false);
obj->Relocate(x, y, z, obj->GetOrientation());
@@ -1270,25 +745,422 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
obj->SaveToDB();
obj->Refresh();
- PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, obj->GetGUIDLow());
+ PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, obj->GetGUIDLow(), obj->GetGOInfo()->name, obj->GetGUIDLow());
return true;
}
-//demorph player or unit
-bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
+//spawn go
+bool ChatHandler::HandleGameObjectAddCommand(const char* args)
{
- Unit *target = getSelectedUnit();
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hgameobject_entry");
+ if(!cId)
+ return false;
+
+ uint32 id = atol(cId);
+ if(!id)
+ return false;
+
+ char* spawntimeSecs = strtok(NULL, " ");
+
+ const GameObjectInfo *goI = objmgr.GetGameObjectInfo(id);
+
+ if (!goI)
+ {
+ PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player *chr = m_session->GetPlayer();
+ float x = float(chr->GetPositionX());
+ float y = float(chr->GetPositionY());
+ float z = float(chr->GetPositionZ());
+ float o = float(chr->GetOrientation());
+ Map *map = chr->GetMap();
+
+ GameObject* pGameObj = new GameObject;
+ uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
+
+ if(!pGameObj->Create(db_lowGUID, goI->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
+ {
+ delete pGameObj;
+ return false;
+ }
+
+ if( spawntimeSecs )
+ {
+ uint32 value = atoi((char*)spawntimeSecs);
+ pGameObj->SetRespawnTime(value);
+ //sLog.outDebug("*** spawntimeSecs: %d", value);
+ }
+
+ // fill the gameobject data and save to the db
+ pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()),chr->GetPhaseMaskForSpawn());
+
+ // this will generate a new guid if the object is in an instance
+ if(!pGameObj->LoadFromDB(db_lowGUID, map))
+ {
+ delete pGameObj;
+ return false;
+ }
+
+ sLog.outDebug(GetMangosString(LANG_GAMEOBJECT_CURRENT), goI->name, db_lowGUID, x, y, z, o);
+
+ map->Add(pGameObj);
+
+ // TODO: is it really necessary to add both the real and DB table guid here ?
+ objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID));
+
+ PSendSysMessage(LANG_GAMEOBJECT_ADD,id,goI->name,db_lowGUID,x,y,z);
+ return true;
+}
+
+//set pahsemask for selected object
+bool ChatHandler::HandleGameObjectPhaseCommand(const char* args)
+{
+ // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hgameobject");
+ if(!cId)
+ return false;
+
+ uint32 lowguid = atoi(cId);
+ if(!lowguid)
+ return false;
+
+ GameObject* obj = NULL;
+
+ // by DB guid
+ if (GameObjectData const* go_data = objmgr.GetGOData(lowguid))
+ obj = GetObjectGlobalyWithGuidOrNearWithDbGuid(lowguid,go_data->id);
+
+ if(!obj)
+ {
+ PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, lowguid);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* phaseStr = strtok (NULL, " ");
+ uint32 phasemask = phaseStr? atoi(phaseStr) : 0;
+ if ( phasemask == 0 )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ obj->SetPhaseMask(phasemask,true);
+ obj->SaveToDB();
+ return true;
+}
+
+bool ChatHandler::HandleGameObjectNearCommand(const char* args)
+{
+ float distance = (!*args) ? 10 : atol(args);
+ uint32 count = 0;
+
+ Player* pl = m_session->GetPlayer();
+ QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
+ "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
+ "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
+ pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
+ pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
+
+ if (result)
+ {
+ do
+ {
+ Field *fields = result->Fetch();
+ uint32 guid = fields[0].GetUInt32();
+ uint32 entry = fields[1].GetUInt32();
+ float x = fields[2].GetFloat();
+ float y = fields[3].GetFloat();
+ float z = fields[4].GetFloat();
+ int mapid = fields[5].GetUInt16();
+
+ GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry);
+
+ if(!gInfo)
+ continue;
+
+ PSendSysMessage(LANG_GO_LIST_CHAT, guid, guid, gInfo->name, x, y, z, mapid);
+
+ ++count;
+ } while (result->NextRow());
+
+ delete result;
+ }
+
+ PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE,distance,count);
+ return true;
+}
+
+bool ChatHandler::HandleGUIDCommand(const char* /*args*/)
+{
+ uint64 guid = m_session->GetPlayer()->GetSelection();
+
+ if (guid == 0)
+ {
+ SendSysMessage(LANG_NO_SELECTION);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
+ return true;
+}
+
+bool ChatHandler::HandleLookupFactionCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ // Can be NULL at console call
+ Player *target = getSelectedPlayer ();
+
+ std::string namepart = args;
+ std::wstring wnamepart;
+
+ if (!Utf8toWStr (namepart,wnamepart))
+ return false;
+
+ // converting string that we try to find to lower case
+ wstrToLower (wnamepart);
+
+ uint32 counter = 0; // Counter for figure out that we found smth.
+
+ for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
+ {
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry (id);
+ if (factionEntry)
+ {
+ FactionState const* repState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
+
+ int loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale();
+ std::string name = factionEntry->name[loc];
+ if(name.empty())
+ continue;
+
+ if (!Utf8FitTo(name, wnamepart))
+ {
+ loc = 0;
+ for(; loc < MAX_LOCALE; ++loc)
+ {
+ if(m_session && loc==m_session->GetSessionDbcLocale())
+ continue;
+
+ name = factionEntry->name[loc];
+ if(name.empty())
+ continue;
+
+ if (Utf8FitTo(name, wnamepart))
+ break;
+ }
+ }
+
+ if(loc < MAX_LOCALE)
+ {
+ // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
+ // or "id - [faction] [no reputation]" format
+ std::ostringstream ss;
+ if (m_session)
+ ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r";
+ else
+ ss << id << " - " << name << " " << localeNames[loc];
+
+ if (repState) // and then target!=NULL also
+ {
+ ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
+ std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
+
+ ss << " " << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ")";
+
+ if(repState->Flags & FACTION_FLAG_VISIBLE)
+ ss << GetTrinityString(LANG_FACTION_VISIBLE);
+ if(repState->Flags & FACTION_FLAG_AT_WAR)
+ ss << GetTrinityString(LANG_FACTION_ATWAR);
+ if(repState->Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if(repState->Flags & FACTION_FLAG_HIDDEN)
+ ss << GetTrinityString(LANG_FACTION_HIDDEN);
+ if(repState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if(repState->Flags & FACTION_FLAG_INACTIVE)
+ ss << GetTrinityString(LANG_FACTION_INACTIVE);
+ }
+ else
+ ss << GetTrinityString(LANG_FACTION_NOREPUTATION);
+
+ SendSysMessage(ss.str().c_str());
+ counter++;
+ }
+ }
+ }
+
+ if (counter == 0) // if counter == 0 then we found nth
+ SendSysMessage(LANG_COMMAND_FACTION_NOTFOUND);
+ return true;
+}
+
+bool ChatHandler::HandleModifyRepCommand(const char * args)
+{
+ if (!*args) return false;
+
+ Player* target = NULL;
+ target = getSelectedPlayer();
+
if(!target)
- target = m_session->GetPlayer();
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
- target->DeMorph();
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
+ char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
+ if(!factionTxt)
+ return false;
+
+ uint32 factionId = atoi(factionTxt);
+
+ int32 amount = 0;
+ char *rankTxt = strtok(NULL, " ");
+ if (!factionTxt || !rankTxt)
+ return false;
+
+ amount = atoi(rankTxt);
+ if ((amount == 0) && (rankTxt[0] != '-') && !isdigit(rankTxt[0]))
+ {
+ std::string rankStr = rankTxt;
+ std::wstring wrankStr;
+ if(!Utf8toWStr(rankStr,wrankStr))
+ return false;
+ wstrToLower( wrankStr );
+ int r = 0;
+ amount = -42000;
+ for (; r < MAX_REPUTATION_RANK; ++r)
+ {
+ std::string rank = GetTrinityString(ReputationRankStrIndex[r]);
+ if(rank.empty())
+ continue;
+
+ std::wstring wrank;
+ if(!Utf8toWStr(rank,wrank))
+ continue;
+
+ wstrToLower(wrank);
+
+ if(wrank.substr(0,wrankStr.size())==wrankStr)
+ {
+ char *deltaTxt = strtok(NULL, " ");
+ if (deltaTxt)
+ {
+ int32 delta = atoi(deltaTxt);
+ if ((delta < 0) || (delta > ReputationMgr::PointsInRank[r] -1))
+ {
+ PSendSysMessage(LANG_COMMAND_FACTION_DELTA, (ReputationMgr::PointsInRank[r]-1));
+ SetSentErrorMessage(true);
+ return false;
+ }
+ amount += delta;
+ }
+ break;
+ }
+ amount += ReputationMgr::PointsInRank[r];
+ }
+ if (r >= MAX_REPUTATION_RANK)
+ {
+ PSendSysMessage(LANG_COMMAND_FACTION_INVPARAM, rankTxt);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ }
+
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionId);
+
+ if (!factionEntry)
+ {
+ PSendSysMessage(LANG_COMMAND_FACTION_UNKNOWN, factionId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (factionEntry->reputationListID < 0)
+ {
+ PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[m_session->GetSessionDbcLocale()], factionId);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->GetReputationMgr().SetReputation(factionEntry,amount);
+ PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[m_session->GetSessionDbcLocale()], factionId,
+ GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
+ return true;
+}
+
+//-----------------------Npc Commands-----------------------
+//add spawn of creature
+bool ChatHandler::HandleNpcAddCommand(const char* args)
+{
+ if(!*args)
+ return false;
+ char* charID = extractKeyFromLink((char*)args,"Hcreature_entry");
+ if(!charID)
+ return false;
+
+ char* team = strtok(NULL, " ");
+ int32 teamval = 0;
+ if (team) { teamval = atoi(team); }
+ if (teamval < 0) { teamval = 0; }
+
+ uint32 id = atoi(charID);
+
+ Player *chr = m_session->GetPlayer();
+ float x = chr->GetPositionX();
+ float y = chr->GetPositionY();
+ float z = chr->GetPositionZ();
+ float o = chr->GetOrientation();
+ Map *map = chr->GetMap();
+
+ Creature* pCreature = new Creature;
+ if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, (uint32)teamval))
+ {
+ delete pCreature;
+ return false;
+ }
+
+ pCreature->Relocate(x,y,z,o);
+
+ if(!pCreature->IsPositionValid())
+ {
+ sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ delete pCreature;
+ return false;
+ }
+
+ pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+
+ uint32 db_guid = pCreature->GetDBTableGUIDLow();
+
+ // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
+ pCreature->LoadFromDB(db_guid, map);
+
+ map->Add(pCreature);
+ objmgr.AddCreatureToGrid(db_guid, objmgr.GetCreatureData(db_guid));
return true;
}
//add item in vendorlist
-bool ChatHandler::HandleAddVendorItemCommand(const char* args)
+bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args)
{
if (!*args)
return false;
@@ -1335,7 +1207,7 @@ bool ChatHandler::HandleAddVendorItemCommand(const char* args)
}
//del item from vendor list
-bool ChatHandler::HandleDelVendorItemCommand(const char* args)
+bool ChatHandler::HandleNpcDelVendorItemCommand(const char* args)
{
if (!*args)
return false;
@@ -1357,7 +1229,6 @@ bool ChatHandler::HandleDelVendorItemCommand(const char* args)
}
uint32 itemId = atol(pitem);
-
if(!objmgr.RemoveVendorItem(vendor->GetEntry(),itemId))
{
PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
@@ -1413,6 +1284,8 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
Player* player = m_session->GetPlayer();
+ //WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0);
+
// update movement type
WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid);
if(pCreature && pCreature->GetWaypointPath())
@@ -1427,10 +1300,193 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
pCreature->SaveToDB();
}
+ SendSysMessage(LANG_WAYPOINT_ADDED);
+
return true;
}
-/**
+//change level of creature or pet
+bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint8 lvl = (uint8) atoi((char*)args);
+ if ( lvl < 1 || lvl > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) + 3)
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ Creature* pCreature = getSelectedCreature();
+ if(!pCreature)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(pCreature->isPet())
+ {
+ ((Pet*)pCreature)->GivePetLevel(lvl);
+ }
+ else
+ {
+ pCreature->SetMaxHealth( 100 + 30*lvl);
+ pCreature->SetHealth( 100 + 30*lvl);
+ pCreature->SetLevel( lvl);
+ pCreature->SaveToDB();
+ }
+
+ return true;
+}
+
+//set npcflag of creature
+bool ChatHandler::HandleNpcFlagCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 npcFlags = (uint32) atoi((char*)args);
+
+ Creature* pCreature = getSelectedCreature();
+
+ if(!pCreature)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ pCreature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags);
+
+ WorldDatabase.PExecuteLog("UPDATE creature_template SET npcflag = '%u' WHERE entry = '%u'", npcFlags, pCreature->GetEntry());
+
+ SendSysMessage(LANG_VALUE_SAVED_REJOIN);
+
+ return true;
+}
+
+bool ChatHandler::HandleNpcDeleteCommand(const char* args)
+{
+ Creature* unit = NULL;
+
+ if(*args)
+ {
+ // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hcreature");
+ if(!cId)
+ return false;
+
+ uint32 lowguid = atoi(cId);
+ if(!lowguid)
+ return false;
+
+ if (CreatureData const* cr_data = objmgr.GetCreatureData(lowguid))
+ unit = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, cr_data->id, HIGHGUID_UNIT));
+ }
+ else
+ unit = getSelectedCreature();
+
+ if(!unit || unit->isPet() || unit->isTotem() || unit->isVehicle())
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Delete the creature
+ unit->CombatStop();
+ unit->DeleteFromDB();
+ unit->CleanupsBeforeDelete();
+ unit->AddObjectToRemoveList();
+
+ SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
+
+ return true;
+}
+
+//move selected creature
+bool ChatHandler::HandleNpcMoveCommand(const char* args)
+{
+ uint32 lowguid = 0;
+
+ Creature* pCreature = getSelectedCreature();
+
+ if(!pCreature)
+ {
+ // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r
+ char* cId = extractKeyFromLink((char*)args,"Hcreature");
+ if(!cId)
+ return false;
+
+ uint32 lowguid = atoi(cId);
+
+ /* FIXME: impossibel without entry
+ if(lowguid)
+ pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_GUID(lowguid,HIGHGUID_UNIT));
+ */
+
+ // Attempting creature load from DB data
+ if(!pCreature)
+ {
+ CreatureData const* data = objmgr.GetCreatureData(lowguid);
+ if(!data)
+ {
+ PSendSysMessage(LANG_COMMAND_CREATGUIDNOTFOUND, lowguid);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint32 map_id = data->mapid;
+
+ if(m_session->GetPlayer()->GetMapId()!=map_id)
+ {
+ PSendSysMessage(LANG_COMMAND_CREATUREATSAMEMAP, lowguid);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ }
+ else
+ {
+ lowguid = pCreature->GetDBTableGUIDLow();
+ }
+ }
+ else
+ {
+ lowguid = pCreature->GetDBTableGUIDLow();
+ }
+
+ float x = m_session->GetPlayer()->GetPositionX();
+ float y = m_session->GetPlayer()->GetPositionY();
+ float z = m_session->GetPlayer()->GetPositionZ();
+ float o = m_session->GetPlayer()->GetOrientation();
+
+ if (pCreature)
+ {
+ if(CreatureData const* data = objmgr.GetCreatureData(pCreature->GetDBTableGUIDLow()))
+ {
+ const_cast<CreatureData*>(data)->posX = x;
+ const_cast<CreatureData*>(data)->posY = y;
+ const_cast<CreatureData*>(data)->posZ = z;
+ const_cast<CreatureData*>(data)->orientation = o;
+ }
+ pCreature->GetMap()->CreatureRelocation(pCreature,x, y, z,o);
+ pCreature->GetMotionMaster()->Initialize();
+ if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
+ {
+ pCreature->setDeathState(JUST_DIED);
+ pCreature->Respawn();
+ }
+ }
+
+ WorldDatabase.PExecuteLog("UPDATE creature SET position_x = '%f', position_y = '%f', position_z = '%f', orientation = '%f' WHERE guid = '%u'", x, y, z, o, lowguid);
+ PSendSysMessage(LANG_COMMAND_CREATUREMOVED);
+ return true;
+}
+
+/**HandleNpcSetMoveTypeCommand
* Set the movement type for an NPC.<br/>
* <br/>
* Valid movement types are:
@@ -1545,6 +1601,10 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
else
return false;
+ // update movement type
+ //if(doNotDelete == false)
+ // WaypointMgr.DeletePath(lowguid);
+
if(pCreature)
{
// update movement type
@@ -1570,23 +1630,49 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
}
return true;
-} // HandleNpcSetMoveTypeCommand
+}
-//change level of creature or pet
-bool ChatHandler::HandleChangeLevelCommand(const char* args)
+//set model of creature
+bool ChatHandler::HandleNpcSetModelCommand(const char* args)
{
if (!*args)
return false;
- uint8 lvl = (uint8) atoi((char*)args);
- if ( lvl < 1 || lvl > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) + 3)
+ uint32 displayId = (uint32) atoi((char*)args);
+
+ Creature *pCreature = getSelectedCreature();
+
+ if(!pCreature || pCreature->isPet())
{
- SendSysMessage(LANG_BAD_VALUE);
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ pCreature->SetDisplayId(displayId);
+ pCreature->SetNativeDisplayId(displayId);
+
+ pCreature->SaveToDB();
+
+ return true;
+}
+//set faction of creature
+bool ChatHandler::HandleNpcFactionIdCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 factionId = (uint32) atoi((char*)args);
+
+ if (!sFactionTemplateStore.LookupEntry(factionId))
+ {
+ PSendSysMessage(LANG_WRONG_FACTION, factionId);
SetSentErrorMessage(true);
return false;
}
Creature* pCreature = getSelectedCreature();
+
if(!pCreature)
{
SendSysMessage(LANG_SELECT_CREATURE);
@@ -1594,126 +1680,441 @@ bool ChatHandler::HandleChangeLevelCommand(const char* args)
return false;
}
- if(pCreature->isPet())
+ pCreature->setFaction(factionId);
+
+ // faction is set in creature_template - not inside creature
+
+ // update in memory
+ if(CreatureInfo const *cinfo = pCreature->GetCreatureInfo())
{
- ((Pet*)pCreature)->GivePetLevel(lvl);
+ const_cast<CreatureInfo*>(cinfo)->faction_A = factionId;
+ const_cast<CreatureInfo*>(cinfo)->faction_H = factionId;
+ }
+
+ // and DB
+ WorldDatabase.PExecuteLog("UPDATE creature_template SET faction_A = '%u', faction_H = '%u' WHERE entry = '%u'", factionId, factionId, pCreature->GetEntry());
+
+ return true;
+}
+//set spawn dist of creature
+bool ChatHandler::HandleNpcSpawnDistCommand(const char* args)
+{
+ if(!*args)
+ return false;
+
+ float option = atof((char*)args);
+ if (option < 0.0f)
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ return false;
}
+
+ MovementGeneratorType mtype = IDLE_MOTION_TYPE;
+ if (option >0.0f)
+ mtype = RANDOM_MOTION_TYPE;
+
+ Creature *pCreature = getSelectedCreature();
+ uint32 u_guidlow = 0;
+
+ if (pCreature)
+ u_guidlow = pCreature->GetDBTableGUIDLow();
else
+ return false;
+
+ pCreature->SetRespawnRadius((float)option);
+ pCreature->SetDefaultMovementType(mtype);
+ pCreature->GetMotionMaster()->Initialize();
+ if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
{
- pCreature->SetMaxHealth( 100 + 30*lvl);
- pCreature->SetHealth( 100 + 30*lvl);
- pCreature->SetLevel( lvl);
- pCreature->SaveToDB();
+ pCreature->setDeathState(JUST_DIED);
+ pCreature->Respawn();
}
+ WorldDatabase.PExecuteLog("UPDATE creature SET spawndist=%f, MovementType=%i WHERE guid=%u",option,mtype,u_guidlow);
+ PSendSysMessage(LANG_COMMAND_SPAWNDIST,option);
return true;
}
-
-//set npcflag of creature
-bool ChatHandler::HandleNpcFlagCommand(const char* args)
+//spawn time handling
+bool ChatHandler::HandleNpcSpawnTimeCommand(const char* args)
{
- if (!*args)
+ if(!*args)
return false;
- uint32 npcFlags = (uint32) atoi((char*)args);
+ char* stime = strtok((char*)args, " ");
- Creature* pCreature = getSelectedCreature();
+ if (!stime)
+ return false;
- if(!pCreature)
+ int i_stime = atoi((char*)stime);
+
+ if (i_stime < 0)
{
- SendSysMessage(LANG_SELECT_CREATURE);
+ SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
return false;
}
- pCreature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags);
+ Creature *pCreature = getSelectedCreature();
+ uint32 u_guidlow = 0;
- WorldDatabase.PExecuteLog("UPDATE creature_template SET npcflag = '%u' WHERE entry = '%u'", npcFlags, pCreature->GetEntry());
+ if (pCreature)
+ u_guidlow = pCreature->GetDBTableGUIDLow();
+ else
+ return false;
- SendSysMessage(LANG_VALUE_SAVED_REJOIN);
+ WorldDatabase.PExecuteLog("UPDATE creature SET spawntimesecs=%i WHERE guid=%u",i_stime,u_guidlow);
+ pCreature->SetRespawnDelay((uint32)i_stime);
+ PSendSysMessage(LANG_COMMAND_SPAWNTIME,i_stime);
return true;
}
-
-//set model of creature
-bool ChatHandler::HandleNpcSetModelCommand(const char* args)
+//npc follow handling
+bool ChatHandler::HandleNpcFollowCommand(const char* /*args*/)
{
- if (!*args)
+ Player *player = m_session->GetPlayer();
+ Creature *creature = getSelectedCreature();
+
+ if(!creature)
+ {
+ PSendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
return false;
+ }
- uint32 displayId = (uint32) atoi((char*)args);
+ // Follow player - Using pet's default dist and angle
+ creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- Creature *pCreature = getSelectedCreature();
+ PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName());
+ return true;
+}
+//npc unfollow handling
+bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/)
+{
+ Player *player = m_session->GetPlayer();
+ Creature *creature = getSelectedCreature();
- if(!pCreature || pCreature->isPet())
+ if(!creature)
{
- SendSysMessage(LANG_SELECT_CREATURE);
+ PSendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
- pCreature->SetDisplayId(displayId);
- pCreature->SetNativeDisplayId(displayId);
+ if (/*creature->GetMotionMaster()->empty() ||*/
+ creature->GetMotionMaster()->GetCurrentMovementGeneratorType ()!=TARGETED_MOTION_TYPE)
+ {
+ PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU);
+ SetSentErrorMessage(true);
+ return false;
+ }
- pCreature->SaveToDB();
+ TargetedMovementGenerator<Creature> const* mgen
+ = static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
+
+ if(mgen->GetTarget()!=player)
+ {
+ PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ // reset movement
+ creature->GetMotionMaster()->MovementExpired(true);
+
+ PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName());
return true;
}
+//npc tame handling
+bool ChatHandler::HandleNpcTameCommand(const char* /*args*/)
+{
+ Creature *creatureTarget = getSelectedCreature ();
+ if (!creatureTarget || creatureTarget->isPet ())
+ {
+ PSendSysMessage (LANG_SELECT_CREATURE);
+ SetSentErrorMessage (true);
+ return false;
+ }
-//morph creature or player
-bool ChatHandler::HandleMorphCommand(const char* args)
+ Player *player = m_session->GetPlayer ();
+
+ if(player->GetPetGUID ())
+ {
+ SendSysMessage (LANG_YOU_ALREADY_HAVE_PET);
+ SetSentErrorMessage (true);
+ return false;
+ }
+
+ CreatureInfo const* cInfo = creatureTarget->GetCreatureInfo();
+
+ if (!cInfo->isTameable ())
+ {
+ PSendSysMessage (LANG_CREATURE_NON_TAMEABLE,cInfo->Entry);
+ SetSentErrorMessage (true);
+ return false;
+ }
+
+ // Everything looks OK, create new pet
+ Pet* pet = player->CreateTamedPetFrom (creatureTarget);
+ if (!pet)
+ {
+ PSendSysMessage (LANG_CREATURE_NON_TAMEABLE,cInfo->Entry);
+ SetSentErrorMessage (true);
+ return false;
+ }
+
+ // place pet before player
+ float x,y,z;
+ player->GetClosePoint (x,y,z,creatureTarget->GetObjectSize (),CONTACT_DISTANCE);
+ pet->Relocate (x,y,z,M_PI-player->GetOrientation ());
+
+ // set pet to defensive mode by default (some classes can't control controlled pets in fact).
+ pet->SetReactState(REACT_DEFENSIVE);
+
+ // calculate proper level
+ uint32 level = (creatureTarget->getLevel() < (player->getLevel() - 5)) ? (player->getLevel() - 5) : creatureTarget->getLevel();
+
+ // prepare visual effect for levelup
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);
+
+ // add to world
+ pet->GetMap()->Add((Creature*)pet);
+
+ // visual effect for levelup
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);
+
+ // caster have pet now
+ player->SetGuardian(pet, true);
+
+ pet->SavePetToDB(PET_SAVE_AS_CURRENT);
+ player->PetSpellInitialize();
+
+ return true;
+}
+//npc phasemask handling
+//change phasemask of creature or pet
+bool ChatHandler::HandleNpcSetPhaseCommand(const char* args)
{
if (!*args)
return false;
- uint16 display_id = (uint16)atoi((char*)args);
+ uint32 phasemask = (uint32) atoi((char*)args);
+ if ( phasemask == 0 )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
- Unit *target = getSelectedUnit();
- if(!target)
- target = m_session->GetPlayer();
+ Creature* pCreature = getSelectedCreature();
+ if(!pCreature)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
- target->SetDisplayId(display_id);
+ pCreature->SetPhaseMask(phasemask,true);
+
+ if(!pCreature->isPet())
+ pCreature->SaveToDB();
return true;
}
-
-//set faction of creature
-bool ChatHandler::HandleNpcFactionIdCommand(const char* args)
+//npc deathstate handling
+bool ChatHandler::HandleNpcSetDeathStateCommand(const char* args)
{
if (!*args)
return false;
- uint32 factionId = (uint32) atoi((char*)args);
+ Creature* pCreature = getSelectedCreature();
+ if(!pCreature || pCreature->isPet())
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
- if (!sFactionTemplateStore.LookupEntry(factionId))
+ if (strncmp(args, "on", 3) == 0)
+ pCreature->SetDeadByDefault(true);
+ else if (strncmp(args, "off", 4) == 0)
+ pCreature->SetDeadByDefault(false);
+ else
{
- PSendSysMessage(LANG_WRONG_FACTION, factionId);
+ SendSysMessage(LANG_USE_BOL);
SetSentErrorMessage(true);
return false;
}
- Creature* pCreature = getSelectedCreature();
+ pCreature->SaveToDB();
+ pCreature->Respawn();
+
+ return true;
+}
+
+//TODO: NpcCommands that need to be fixed :
+
+bool ChatHandler::HandleNpcNameCommand(const char* /*args*/)
+{
+ /* Temp. disabled
+ if(!*args)
+ return false;
+
+ if(strlen((char*)args)>75)
+ {
+ PSendSysMessage(LANG_TOO_LONG_NAME, strlen((char*)args)-75);
+ return true;
+ }
+
+ for (uint8 i = 0; i < strlen(args); i++)
+ {
+ if(!isalpha(args[i]) && args[i]!=' ')
+ {
+ SendSysMessage(LANG_CHARS_ONLY);
+ return false;
+ }
+ }
+
+ uint64 guid;
+ guid = m_session->GetPlayer()->GetSelection();
+ if (guid == 0)
+ {
+ SendSysMessage(LANG_NO_SELECTION);
+ return true;
+ }
+
+ Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
if(!pCreature)
{
SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
+ return true;
}
- pCreature->setFaction(factionId);
+ pCreature->SetName(args);
+ uint32 idname = objmgr.AddCreatureTemplate(pCreature->GetName());
+ pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
- // faction is set in creature_template - not inside creature
+ pCreature->SaveToDB();
+ */
- // update in memory
- if(CreatureInfo const *cinfo = pCreature->GetCreatureInfo())
+ return true;
+}
+
+bool ChatHandler::HandleNpcSubNameCommand(const char* /*args*/)
+{
+ /* Temp. disabled
+
+ if(!*args)
+ args = "";
+
+ if(strlen((char*)args)>75)
{
- const_cast<CreatureInfo*>(cinfo)->faction_A = factionId;
- const_cast<CreatureInfo*>(cinfo)->faction_H = factionId;
+
+ PSendSysMessage(LANG_TOO_LONG_SUBNAME, strlen((char*)args)-75);
+ return true;
}
- // and DB
- WorldDatabase.PExecuteLog("UPDATE creature_template SET faction_A = '%u', faction_H = '%u' WHERE entry = '%u'", factionId, factionId, pCreature->GetEntry());
+ for (uint8 i = 0; i < strlen(args); i++)
+ {
+ if(!isalpha(args[i]) && args[i]!=' ')
+ {
+ SendSysMessage(LANG_CHARS_ONLY);
+ return false;
+ }
+ }
+ uint64 guid;
+ guid = m_session->GetPlayer()->GetSelection();
+ if (guid == 0)
+ {
+ SendSysMessage(LANG_NO_SELECTION);
+ return true;
+ }
+
+ Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
+
+ if(!pCreature)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ return true;
+ }
+
+ uint32 idname = objmgr.AddCreatureSubName(pCreature->GetName(),args,pCreature->GetUInt32Value(UNIT_FIELD_DISPLAYID));
+ pCreature->SetUInt32Value(OBJECT_FIELD_ENTRY, idname);
+
+ pCreature->SaveToDB();
+ */
+ return true;
+}
+
+//move item to other slot
+bool ChatHandler::HandleItemMoveCommand(const char* args)
+{
+ if(!*args)
+ return false;
+ uint8 srcslot, dstslot;
+
+ char* pParam1 = strtok((char*)args, " ");
+ if (!pParam1)
+ return false;
+
+ char* pParam2 = strtok(NULL, " ");
+ if (!pParam2)
+ return false;
+
+ srcslot = (uint8)atoi(pParam1);
+ dstslot = (uint8)atoi(pParam2);
+
+ if(srcslot==dstslot)
+ return true;
+
+ if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
+ return false;
+
+ if(!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,dstslot))
+ return false;
+
+ uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
+ uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);
+
+ m_session->GetPlayer()->SwapItem( src, dst );
+
+ return true;
+}
+
+//demorph player or unit
+bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
+{
+ Unit *target = getSelectedUnit();
+ if(!target)
+ target = m_session->GetPlayer();
+
+
+ // check online security
+ else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
+ return false;
+
+ target->DeMorph();
+
+ return true;
+}
+
+//morph creature or player
+bool ChatHandler::HandleModifyMorphCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint16 display_id = (uint16)atoi((char*)args);
+
+ Unit *target = getSelectedUnit();
+ if(!target)
+ target = m_session->GetPlayer();
+
+ // check online security
+ else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
+ return false;
+
+ target->SetDisplayId(display_id);
return true;
}
@@ -1731,7 +2132,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
kicker = m_session->GetPlayer()->GetName();
if(!kickName)
- {
+ {
Player* player = getSelectedPlayer();
if(!player)
{
@@ -1747,14 +2148,16 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(player, 0))
+ return false;
+
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
{
-
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
}
else
{
-
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
}
@@ -1762,8 +2165,8 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
}
else
{
- std::string name = kickName;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)kickName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -1785,34 +2188,56 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
return false;
}
- if(m_session && player->GetSession()->GetSecurity() > m_session->GetSecurity())
+ if(HasLowerSecurity(player, 0))
{
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
SetSentErrorMessage(true);
return false;
}
- if(sWorld.KickPlayer(name.c_str()))
+ std::string nameLink = playerLink(name);
+
+ if(sWorld.KickPlayer(name))
{
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
{
-
- sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
+ sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, nameLink.c_str(), kicker.c_str(), reason.c_str());
}
else
{
- PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
+ PSendSysMessage(LANG_COMMAND_KICKMESSAGE,nameLink.c_str());
}
}
else
{
- PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str());
+ PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER,nameLink.c_str());
return false;
}
}
return true;
}
+//set temporary phase mask for player
+bool ChatHandler::HandleModifyPhaseCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 phasemask = (uint32)atoi((char*)args);
+
+ Unit *target = getSelectedUnit();
+ if(!target)
+ target = m_session->GetPlayer();
+
+ // check online security
+ else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
+ return false;
+
+ target->SetPhaseMask(phasemask,true);
+
+ return true;
+}
+
//show info of player
bool ChatHandler::HandlePInfoCommand(const char* args)
{
@@ -1826,12 +2251,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
if (px)
{
- name = px;
-
+ name = extractPlayerNameFromLink(px);
if(name.empty())
- return false;
-
- if(!normalizePlayerName(name))
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -1872,6 +2293,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
// get additional information from Player object
if(target)
{
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
targetGUID = target->GetGUID();
name = target->GetName(); // re-read for case getSelectedPlayer() target
accId = target->GetSession()->GetAccountId();
@@ -1883,6 +2308,11 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
// get additional information from DB
else
{
+ // check offline security
+ if (HasLowerSecurity(NULL, targetGUID))
+ return false;
+
+ // 0
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(targetGUID));
if (!result)
{
@@ -1933,7 +2363,9 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
delete result;
}
- PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), name.c_str(), GUID_LOPART(targetGUID), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetMangosString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(targetGUID), username.c_str(), accId, security, last_ip.c_str(), last_login.c_str(), latency);
std::string timeStr = secsToTimeString(total_player_time,true,true);
uint32 gold = money /GOLD;
@@ -1951,18 +2383,16 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
return false;
}
- char* FactionName;
- for(FactionStateList::const_iterator itr = target->m_factions.begin(); itr != target->m_factions.end(); ++itr)
+ FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
+ for(FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
{
FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID);
- if (factionEntry)
- FactionName = factionEntry->name[m_session->GetSessionDbcLocale()];
- else
- FactionName = "#Not found#";
- ReputationRank rank = target->GetReputationRank(factionEntry);
- std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
+ char const* factionName = factionEntry ? factionEntry->name[m_session->GetSessionDbcLocale()] : "#Not found#";
+ ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
+ std::string rankName = GetMangosString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
- ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << FactionName << "]|h|r " << rankName << "|h|r (" << target->GetReputation(factionEntry) << ")";
+ ss << itr->second.ID << ": |cffffffff|Hfaction:" << itr->second.ID << "|h[" << factionName << "]|h|r " << rankName << "|h|r ("
+ << target->GetReputationMgr().GetReputation(factionEntry) << ")";
if(itr->second.Flags & FACTION_FLAG_VISIBLE)
ss << GetTrinityString(LANG_FACTION_VISIBLE);
@@ -1983,81 +2413,215 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
return true;
}
-//set spawn dist of creature
-bool ChatHandler::HandleNpcSpawnDistCommand(const char* args)
+/*//show tickets
+void ChatHandler::ShowTicket(uint64 guid, char const* text, char const* time)
{
- if(!*args)
- return false;
+ std::string name;
+ if(!objmgr.GetPlayerNameByGUID(guid,name))
+ name = GetTrinityString(LANG_UNKNOWN);
- float option = atof((char*)args);
- if (option < 0.0f)
+ std::string nameLink = playerLink(name);
+
+ PSendSysMessage(LANG_COMMAND_TICKETVIEW, nameLink.c_str(),time,text);
+}
+
+//ticket commands
+bool ChatHandler::HandleTicketCommand(const char* args)
+{
+ char* px = strtok((char*)args, " ");
+
+ // ticket<end>
+ if (!px)
{
- SendSysMessage(LANG_BAD_VALUE);
- return false;
+ if(!m_session)
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ size_t count = ticketmgr.GetTicketCount();
+
+ bool accept = m_session->GetPlayer()->isAcceptTickets();
+
+ PSendSysMessage(LANG_COMMAND_TICKETCOUNT, count, accept ? GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
+ return true;
}
- MovementGeneratorType mtype = IDLE_MOTION_TYPE;
- if (option >0.0f)
- mtype = RANDOM_MOTION_TYPE;
+ // ticket on
+ if(strncmp(px,"on",3) == 0)
+ {
+ if(!m_session)
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
- Creature *pCreature = getSelectedCreature();
- uint32 u_guidlow = 0;
+ m_session->GetPlayer()->SetAcceptTicket(true);
+ SendSysMessage(LANG_COMMAND_TICKETON);
+ return true;
+ }
- if (pCreature)
- u_guidlow = pCreature->GetDBTableGUIDLow();
- else
- return false;
+ // ticket off
+ if(strncmp(px,"off",4) == 0)
+ {
+ if(!m_session)
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
- pCreature->SetRespawnRadius((float)option);
- pCreature->SetDefaultMovementType(mtype);
- pCreature->GetMotionMaster()->Initialize();
- if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
+ m_session->GetPlayer()->SetAcceptTicket(false);
+ SendSysMessage(LANG_COMMAND_TICKETOFF);
+ return true;
+ }
+
+ // ticket #num
+ int num = atoi(px);
+ if(num > 0)
{
- pCreature->setDeathState(JUST_DIED);
- pCreature->Respawn();
+ QueryResult *result = CharacterDatabase.PQuery("SELECT guid,ticket_text,ticket_lastchange FROM character_ticket ORDER BY ticket_id ASC "_OFFSET_, num-1);
+
+ if(!result)
+ {
+ PSendSysMessage(LANG_COMMAND_TICKENOTEXIST, num);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ Field* fields = result->Fetch();
+
+ uint32 guid = fields[0].GetUInt32();
+ char const* text = fields[1].GetString();
+ char const* time = fields[2].GetString();
+
+ ShowTicket(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER),text,time);
+ delete result;
+ return true;
}
- WorldDatabase.PExecuteLog("UPDATE creature SET spawndist=%f, MovementType=%i WHERE guid=%u",option,mtype,u_guidlow);
- PSendSysMessage(LANG_COMMAND_SPAWNDIST,option);
+ std::string name = extractPlayerNameFromLink(px);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
+
+ if(!guid)
+ return false;
+
+ // ticket $char_name
+ GMTicket* ticket = ticketmgr.GetGMTicket(GUID_LOPART(guid));
+ if(!ticket)
+ return false;
+
+ std::string time = TimeToTimestampStr(ticket->GetLastUpdate());
+
+ ShowTicket(guid, ticket->GetText(), time.c_str());
+
return true;
}
-bool ChatHandler::HandleNpcSpawnTimeCommand(const char* args)
+//dell all tickets
+bool ChatHandler::HandleDelTicketCommand(const char *args)
{
- if(!*args)
+ char* px = strtok((char*)args, " ");
+ if (!px)
return false;
- char* stime = strtok((char*)args, " ");
+ // delticket all
+ if(strncmp(px,"all",4) == 0)
+ {
+ ticketmgr.DeleteAll();
+ SendSysMessage(LANG_COMMAND_ALLTICKETDELETED);
+ return true;
+ }
- if (!stime)
- return false;
+ int num = (uint32)atoi(px);
- int i_stime = atoi((char*)stime);
+ // delticket #num
+ if(num > 0)
+ {
+ QueryResult* result = CharacterDatabase.PQuery("SELECT guid FROM character_ticket ORDER BY ticket_id ASC "_OFFSET_,num-1);
+ if(!result)
+ {
+ PSendSysMessage(LANG_COMMAND_TICKENOTEXIST, num);
+ SetSentErrorMessage(true);
+ return false;
+ }
+ Field* fields = result->Fetch();
+ uint32 guid = fields[0].GetUInt32();
+ delete result;
- if (i_stime < 0)
+ ticketmgr.Delete(guid);
+
+ //notify player
+ if(Player* pl = objmgr.GetPlayer(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
+ {
+ pl->GetSession()->SendGMTicketGetTicket(0x0A, 0);
+ PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL, GetNameLink(pl).c_str());
+ }
+ else
+ PSendSysMessage(LANG_COMMAND_TICKETDEL);
+
+ return true;
+ }
+
+ std::string name = extractPlayerNameFromLink(px);
+ if(name.empty())
{
- SendSysMessage(LANG_BAD_VALUE);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
- Creature *pCreature = getSelectedCreature();
- uint32 u_guidlow = 0;
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
- if (pCreature)
- u_guidlow = pCreature->GetDBTableGUIDLow();
- else
+ if(!guid)
return false;
- WorldDatabase.PExecuteLog("UPDATE creature SET spawntimesecs=%i WHERE guid=%u",i_stime,u_guidlow);
- pCreature->SetRespawnDelay((uint32)i_stime);
- PSendSysMessage(LANG_COMMAND_SPAWNTIME,i_stime);
+ // delticket $char_name
+ ticketmgr.Delete(GUID_LOPART(guid));
+
+ // notify players about ticket deleting
+ if(Player* sender = objmgr.GetPlayer(guid))
+ sender->GetSession()->SendGMTicketGetTicket(0x0A,0);
+
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_COMMAND_TICKETPLAYERDEL,nameLink.c_str());
return true;
-}
+}*/
+
/////WAYPOINT COMMANDS
+/**
+ * Add a waypoint to a creature.
+ *
+ * The user can either select an npc or provide its GUID.
+ *
+ * The user can even select a visual waypoint - then the new waypoint
+ * is placed *after* the selected one - this makes insertion of new
+ * waypoints possible.
+ *
+ * eg:
+ * .wp add 12345
+ * -> adds a waypoint to the npc with the GUID 12345
+ *
+ * .wp add
+ * -> adds a waypoint to the currently selected creature
+ *
+ *
+ * @param args if the user did not provide a GUID, it is NULL
+ *
+ * @return true - command did succeed, false - something went wrong
+ */
bool ChatHandler::HandleWpAddCommand(const char* args)
{
sLog.outDebug("DEBUG: HandleWpAddCommand");
@@ -2177,7 +2741,7 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
target->LoadPath(pathid);
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
target->GetMotionMaster()->Initialize();
- target->Say("Path loaded.",0,0);
+ target->MonsterSay("Path loaded.",0,0);
return true;
}
@@ -2220,7 +2784,7 @@ bool ChatHandler::HandleWpUnLoadPathCommand(const char *args)
target->SetDefaultMovementType(IDLE_MOTION_TYPE);
target->GetMotionMaster()->MoveTargetedHome();
target->GetMotionMaster()->Initialize();
- target->Say("Path unloaded.",0,0);
+ target->MonsterSay("Path unloaded.",0,0);
return true;
}
PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path.");
@@ -2612,7 +3176,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
wpCreature->AddObjectToRemoveList();
// re-create
Creature* wpCreature2 = new Creature;
- if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, VISUAL_WAYPOINT, 0))
+ if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -2622,12 +3186,12 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
if(!wpCreature2->IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature2->GetGUIDLow(),wpCreature2->GetEntry(),wpCreature2->GetPositionX(),wpCreature2->GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature2->GetGUIDLow(),wpCreature2->GetEntry(),wpCreature2->GetPositionX(),wpCreature2->GetPositionY());
delete wpCreature2;
return false;
}
- wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
+ wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map);
map->Add(wpCreature2);
@@ -2661,7 +3225,6 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
}
PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str);
-
return true;
}
@@ -2843,7 +3406,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
float o = chr->GetOrientation();
Creature* wpCreature = new Creature;
- if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0))
+ if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@@ -2855,7 +3418,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
if(!wpCreature->IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY());
delete wpCreature;
delete result;
return false;
@@ -2865,7 +3428,8 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
// set "wpguid" column to the visual waypoint
WorldDatabase.PExecuteLog("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point);
- wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
+ wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map);
map->Add(wpCreature);
@@ -2906,7 +3470,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
- if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, id, 0))
+ if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete pCreature;
@@ -2918,13 +3482,13 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
if(!pCreature->IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
delete result;
return false;
}
- pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
+ pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map);
map->Add(pCreature);
@@ -2971,7 +3535,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Map *map = chr->GetMap();
Creature* pCreature = new Creature;
- if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0))
+ if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0))
{
PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete pCreature;
@@ -2983,13 +3547,13 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
if(!pCreature->IsPositionValid())
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
delete result;
return false;
}
- pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
+ pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map);
map->Add(pCreature);
@@ -3071,9 +3635,8 @@ bool ChatHandler::HandleRenameCommand(const char* args)
if(px)
{
- oldname = px;
-
- if(!normalizePlayerName(oldname))
+ oldname = extractPlayerNameFromLink(px);
+ if(oldname.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -3100,104 +3663,85 @@ bool ChatHandler::HandleRenameCommand(const char* args)
if(target)
{
- PSendSysMessage(LANG_RENAME_PLAYER, target->GetName());
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
+ PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
target->SetAtLoginFlag(AT_LOGIN_RENAME);
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
}
else
{
- PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldname.c_str(), GUID_LOPART(targetGUID));
+ // check offline security
+ if (HasLowerSecurity(NULL, targetGUID))
+ return false;
+
+ std::string oldNameLink = playerLink(oldname);
+
+ PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGUID));
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", GUID_LOPART(targetGUID));
}
return true;
}
-//spawn go
-bool ChatHandler::HandleGameObjectCommand(const char* args)
+// customize characters
+bool ChatHandler::HandleCustomizeCommand(const char* args)
{
- if (!*args)
- return false;
+ Player* target = NULL;
+ uint64 targetGUID = 0;
+ std::string oldname;
- char* pParam1 = strtok((char*)args, " ");
- if (!pParam1)
- return false;
+ char* px = strtok((char*)args, " ");
- uint32 id = atoi((char*)pParam1);
- if(!id)
- return false;
+ if(px)
+ {
+ oldname = extractPlayerNameFromLink(px);
+ if(oldname.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
- char* spawntimeSecs = strtok(NULL, " ");
+ target = objmgr.GetPlayer(oldname.c_str());
- const GameObjectInfo *goI = objmgr.GetGameObjectInfo(id);
+ if (!target)
+ targetGUID = objmgr.GetPlayerGUIDByName(oldname);
+ }
- if (!goI)
+ if(!target && !targetGUID)
{
- PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
- SetSentErrorMessage(true);
- return false;
+ target = getSelectedPlayer();
}
- Player *chr = m_session->GetPlayer();
- float x = float(chr->GetPositionX());
- float y = float(chr->GetPositionY());
- float z = float(chr->GetPositionZ());
- float o = float(chr->GetOrientation());
- Map *map = chr->GetMap();
-
- float rot2 = sin(o/2);
- float rot3 = cos(o/2);
-
- GameObject* pGameObj = new GameObject;
- uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
-
- if(!pGameObj->Create(db_lowGUID, goI->id, map, x, y, z, o, 0, 0, rot2, rot3, 0, 1))
+ if(!target && !targetGUID)
{
- delete pGameObj;
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
}
- if( spawntimeSecs )
+ if(target)
{
- uint32 value = atoi((char*)spawntimeSecs);
- pGameObj->SetRespawnTime(value);
- //sLog.outDebug("*** spawntimeSecs: %d", value);
+ PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
+ CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = '%u'", target->GetGUIDLow());
}
-
- // fill the gameobject data and save to the db
- pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
-
- // this will generate a new guid if the object is in an instance
- if(!pGameObj->LoadFromDB(db_lowGUID, map))
+ else
{
- delete pGameObj;
- return false;
- }
-
- sLog.outDebug(GetTrinityString(LANG_GAMEOBJECT_CURRENT), goI->name, db_lowGUID, x, y, z, o);
-
- map->Add(pGameObj);
+ std::string oldNameLink = playerLink(oldname);
- // TODO: is it really necessary to add both the real and DB table guid here ?
- objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID));
+ PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGUID));
+ CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = '%u'", GUID_LOPART(targetGUID));
+ }
- PSendSysMessage(LANG_GAMEOBJECT_ADD,id,goI->name,db_lowGUID,x,y,z);
- return true;
-}
-
-//show animation
-bool ChatHandler::HandleAnimCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 anim_id = atoi((char*)args);
- m_session->GetPlayer()->HandleEmoteCommand(anim_id);
return true;
}
//change standstate
-bool ChatHandler::HandleStandStateCommand(const char* args)
+bool ChatHandler::HandleModifyStandStateCommand(const char* args)
{
if (!*args)
return false;
@@ -3208,7 +3752,7 @@ bool ChatHandler::HandleStandStateCommand(const char* args)
return true;
}
-bool ChatHandler::HandleAddHonorCommand(const char* args)
+bool ChatHandler::HandleHonorAddCommand(const char* args)
{
if (!*args)
return false;
@@ -3221,6 +3765,10 @@ bool ChatHandler::HandleAddHonorCommand(const char* args)
return false;
}
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
uint32 amount = (uint32)atoi(args);
target->RewardHonor(NULL, 1, amount);
return true;
@@ -3236,11 +3784,15 @@ bool ChatHandler::HandleHonorAddKillCommand(const char* /*args*/)
return false;
}
+ // check online security
+ if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
+ return false;
+
m_session->GetPlayer()->RewardHonor(target, 1);
return true;
}
-bool ChatHandler::HandleUpdateHonorFieldsCommand(const char* /*args*/)
+bool ChatHandler::HandleHonorUpdateCommand(const char* /*args*/)
{
Player *target = getSelectedPlayer();
if(!target)
@@ -3250,6 +3802,10 @@ bool ChatHandler::HandleUpdateHonorFieldsCommand(const char* /*args*/)
return false;
}
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
target->UpdateHonorFields();
return true;
}
@@ -3270,8 +3826,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
uint32 counter = 0;
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
- GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
for(uint32 id = 0; id < events.size(); ++id )
{
@@ -3304,12 +3860,12 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args)
{
uint32 counter = 0;
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
- GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
char const* active = GetTrinityString(LANG_ACTIVE);
- for(GameEvent::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
+ for(GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
{
uint32 event_id = *itr;
GameEventData const& eventData = events[event_id];
@@ -3340,7 +3896,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
uint32 event_id = atoi(cId);
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
if(event_id >=events.size())
{
@@ -3357,7 +3913,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
return false;
}
- GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
+ GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
bool active = activeEvents.find(event_id) != activeEvents.end();
char const* activeStr = active ? GetTrinityString(LANG_ACTIVE) : "";
@@ -3389,7 +3945,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
int32 event_id = atoi(cId);
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
if(event_id < 1 || event_id >=events.size())
{
@@ -3406,7 +3962,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
return false;
}
- GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
+ GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
if(activeEvents.find(event_id) != activeEvents.end())
{
PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id);
@@ -3430,7 +3986,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
int32 event_id = atoi(cId);
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
if(event_id < 1 || event_id >=events.size())
{
@@ -3447,7 +4003,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
return false;
}
- GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
+ GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
if(activeEvents.find(event_id) == activeEvents.end())
{
@@ -3466,9 +4022,8 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
if(*args)
{
- std::string playername = args;
-
- if(!normalizePlayerName(playername))
+ std::string playername = extractPlayerNameFromLink((char*)args);
+ if(playername.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -3492,6 +4047,10 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
player = m_session->GetPlayer();
}
+ // check online security
+ if (HasLowerSecurity(player, 0))
+ return false;
+
player->CombatStop();
player->getHostilRefManager().deleteReferences();
return true;
@@ -3530,7 +4089,7 @@ bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
- m_session->GetPlayer()->learnSpell(skillLine->spellId);
+ m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
}
}
}
@@ -3603,7 +4162,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
continue;
if( !target->HasSpell(spellInfo->Id) )
- m_session->GetPlayer()->learnSpell(skillLine->spellId);
+ m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
}
uint16 maxLevel = target->GetPureMaxSkillValue(skillInfo->id);
@@ -3710,6 +4269,13 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit)
delete result;
+ if(i==0) // empty accounts only
+ {
+ PSendSysMessage(LANG_NO_PLAYERS_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
return true;
}
@@ -3731,68 +4297,50 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
return false;
}
+ // check online security
+ if (HasLowerSecurity(target, 0))
+ return false;
+
// Repair items
target->DurabilityRepairAll(false, 0, false);
- PSendSysMessage(LANG_YOU_REPAIR_ITEMS, target->GetName());
+ PSendSysMessage(LANG_YOU_REPAIR_ITEMS, GetNameLink(target).c_str());
if(needReportToTarget(target))
- ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetName());
+ ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetNameLink().c_str());
return true;
}
-bool ChatHandler::HandleNpcFollowCommand(const char* /*args*/)
+bool ChatHandler::HandleWaterwalkCommand(const char* args)
{
- Player *player = m_session->GetPlayer();
- Creature *creature = getSelectedCreature();
-
- if(!creature)
- {
- PSendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
+ if(!*args)
return false;
- }
- // Follow player - Using pet's default dist and angle
- creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ Player *player = getSelectedPlayer();
- PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName());
- return true;
-}
-
-bool ChatHandler::HandleNpcUnFollowCommand(const char* /*args*/)
-{
- Player *player = m_session->GetPlayer();
- Creature *creature = getSelectedCreature();
-
- if(!creature)
+ if(!player)
{
- PSendSysMessage(LANG_SELECT_CREATURE);
+ PSendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
- if (/*creature->GetMotionMaster()->empty() ||*/
- creature->GetMotionMaster()->GetCurrentMovementGeneratorType ()!=TARGETED_MOTION_TYPE)
- {
- PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU);
- SetSentErrorMessage(true);
+ // check online security
+ if (HasLowerSecurity(player, 0))
return false;
- }
- TargetedMovementGenerator<Creature> const* mgen
- = static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
-
- if(mgen->GetTarget()!=player)
+ if (strncmp(args, "on", 3) == 0)
+ player->SetMovement(MOVE_WATER_WALK); // ON
+ else if (strncmp(args, "off", 4) == 0)
+ player->SetMovement(MOVE_LAND_WALK); // OFF
+ else
{
- PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU);
- SetSentErrorMessage(true);
+ SendSysMessage(LANG_USE_BOL);
return false;
}
- // reset movement
- creature->GetMotionMaster()->MovementExpired(true);
-
- PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName());
+ PSendSysMessage(LANG_YOU_SET_WATERWALK, args, GetNameLink(player).c_str());
+ if(needReportToTarget(player))
+ ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetNameLink().c_str());
return true;
}
@@ -3825,7 +4373,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
}
// Everything looks OK, create new pet
- Pet* pet = new Pet(HUNTER_PET);
+ Pet* pet = new Pet(player, HUNTER_PET);
if(!pet->CreateBaseAtCreature(creatureTarget))
{
@@ -3838,7 +4386,6 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
- pet->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, player->GetGUID());
pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
@@ -3854,16 +4401,15 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
- pet->AIM_Initialize();
pet->InitPetCreateSpells();
pet->SetHealth(pet->GetMaxHealth());
- MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet);
+ pet->GetMap()->Add((Creature*)pet);
// visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel());
- player->SetPet(pet);
+ player->SetGuardian(pet, true);
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
player->PetSpellInitialize();
@@ -3955,7 +4501,7 @@ bool ChatHandler::HandlePetTpCommand(const char *args)
uint32 tp = atol(args);
- pet->SetTP(tp);
+ //pet->SetTP(tp);
PSendSysMessage("Pet's tp changed to %u", tp);
return true;
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 128971f0153..844bf9b5f68 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -36,7 +36,6 @@
#include "Guild.h"
#include "ObjectAccessor.h"
#include "MapManager.h"
-#include "SpellAuras.h"
#include "ScriptCalls.h"
#include "Language.h"
#include "GridNotifiersImpl.h"
@@ -526,19 +525,11 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args)
}
//reload commands
-bool ChatHandler::HandleReloadCommand(const char* arg)
-{
- // this is error catcher for wrong table name in .reload commands
- PSendSysMessage("Db table with name starting from '%s' not found and can't be reloaded.",arg);
- SetSentErrorMessage(true);
- return false;
-}
-
bool ChatHandler::HandleReloadAllCommand(const char*)
{
- HandleReloadAreaTriggerTeleportCommand("");
HandleReloadSkillFishingBaseLevelCommand("");
+ HandleReloadAllAchievementCommand("");
HandleReloadAllAreaCommand("");
HandleReloadAllLootCommand("");
HandleReloadAllNpcCommand("");
@@ -554,6 +545,13 @@ bool ChatHandler::HandleReloadAllCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadAllAchievementCommand(const char*)
+{
+ HandleReloadAchievementCriteriaDataCommand("");
+ HandleReloadAchievementRewardCommand("");
+ return true;
+}
+
bool ChatHandler::HandleReloadAllAreaCommand(const char*)
{
//HandleReloadQuestAreaTriggersCommand(""); -- reloaded in HandleReloadAllQuestCommand
@@ -577,6 +575,7 @@ bool ChatHandler::HandleReloadAllNpcCommand(const char* /*args*/)
HandleReloadNpcOptionCommand("a");
HandleReloadNpcTrainerCommand("a");
HandleReloadNpcVendorCommand("a");
+ HandleReloadPointsOfInterestCommand("a");
return true;
}
@@ -618,10 +617,12 @@ bool ChatHandler::HandleReloadAllSpellCommand(const char*)
HandleReloadSkillExtraItemTemplateCommand("a");
HandleReloadSpellAffectCommand("a");
HandleReloadSpellRequiredCommand("a");
+ HandleReloadSpellAreaCommand("a");
HandleReloadSpellElixirCommand("a");
HandleReloadSpellLearnSpellCommand("a");
HandleReloadSpellLinkedSpellCommand("a");
HandleReloadSpellProcEventCommand("a");
+ HandleReloadSpellBonusesCommand("a");
HandleReloadSpellScriptTargetCommand("a");
HandleReloadSpellTargetPositionCommand("a");
HandleReloadSpellThreatsCommand("a");
@@ -639,11 +640,13 @@ bool ChatHandler::HandleReloadAllItemCommand(const char*)
bool ChatHandler::HandleReloadAllLocalesCommand(const char* /*args*/)
{
+ HandleReloadLocalesAchievementRewardCommand("a");
HandleReloadLocalesCreatureCommand("a");
HandleReloadLocalesGameobjectCommand("a");
HandleReloadLocalesItemCommand("a");
HandleReloadLocalesNpcTextCommand("a");
HandleReloadLocalesPageTextCommand("a");
+ HandleReloadLocalesPointsOfInterestCommand("a");
HandleReloadLocalesQuestCommand("a");
return true;
}
@@ -656,6 +659,22 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/)
return true;
}
+bool ChatHandler::HandleReloadAchievementCriteriaDataCommand(const char*)
+{
+ sLog.outString( "Re-Loading Additional Achievement Criteria Data..." );
+ achievementmgr.LoadAchievementCriteriaData();
+ SendGlobalSysMessage("DB table `achievement_criteria_data` reloaded.");
+ return true;
+}
+
+bool ChatHandler::HandleReloadAchievementRewardCommand(const char*)
+{
+ sLog.outString( "Re-Loading Achievement Reward Data..." );
+ achievementmgr.LoadRewards();
+ SendGlobalSysMessage("DB table `achievement_reward` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadAreaTriggerTavernCommand(const char*)
{
sLog.outString( "Re-Loading Tavern Area Triggers..." );
@@ -740,6 +759,11 @@ bool ChatHandler::HandleReloadQuestTemplateCommand(const char*)
sLog.outString( "Re-Loading Quest Templates..." );
objmgr.LoadQuests();
SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");
+
+ /// dependent also from `gameobject` but this table not reloaded anyway
+ sLog.outString( "Re-Loading GameObjects for quests..." );
+ objmgr.LoadGameObjectForQuests();
+ SendGlobalGMSysMessage("Data GameObjects for quests reloaded.");
return true;
}
@@ -788,6 +812,15 @@ bool ChatHandler::HandleReloadLootTemplatesItemCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadLootTemplatesMillingCommand(const char*)
+{
+ sLog.outString( "Re-Loading Loot Tables... (`milling_loot_template`)" );
+ LoadLootTemplates_Milling();
+ LootTemplates_Milling.CheckLootRefs();
+ SendGlobalSysMessage("DB table `milling_loot_template` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadLootTemplatesPickpocketingCommand(const char*)
{
sLog.outString( "Re-Loading Loot Tables... (`pickpocketing_loot_template`)" );
@@ -832,6 +865,15 @@ bool ChatHandler::HandleReloadLootTemplatesSkinningCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadLootTemplatesSpellCommand(const char*)
+{
+ sLog.outString( "Re-Loading Loot Tables... (`spell_loot_template`)" );
+ LoadLootTemplates_Spell();
+ LootTemplates_Spell.CheckLootRefs();
+ SendGlobalSysMessage("DB table `spell_loot_template` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadTrinityStringCommand(const char*)
{
sLog.outString( "Re-Loading trinity_string Table!" );
@@ -872,6 +914,14 @@ bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
+{
+ sLog.outString( "Re-Loading `points_of_interest` Table!" );
+ objmgr.LoadPointsOfInterest();
+ SendGlobalSysMessage("DB table `points_of_interest` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadReservedNameCommand(const char*)
{
sLog.outString( "Loading ReservedNames... (`reserved_name`)" );
@@ -912,6 +962,14 @@ bool ChatHandler::HandleReloadSpellAffectCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadSpellAreaCommand(const char*)
+{
+ sLog.outString( "Re-Loading SpellArea Data..." );
+ spellmgr.LoadSpellAreas();
+ SendGlobalSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadSpellRequiredCommand(const char*)
{
sLog.outString( "Re-Loading Spell Required Data... " );
@@ -952,6 +1010,14 @@ bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
return true;
}
+bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
+{
+ sLog.outString( "Re-Loading Spell Bonus Data..." );
+ spellmgr.LoadSpellBonusess();
+ SendGlobalSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadSpellScriptTargetCommand(const char*)
{
sLog.outString( "Re-Loading SpellsScriptTarget..." );
@@ -1161,6 +1227,14 @@ bool ChatHandler::HandleReloadSpellDisabledCommand(const char* /*arg*/)
return true;
}
+bool ChatHandler::HandleReloadLocalesAchievementRewardCommand(const char*)
+{
+ sLog.outString( "Re-Loading Locales Achievement Reward Data..." );
+ achievementmgr.LoadRewardLocales();
+ SendGlobalSysMessage("DB table `locales_achievement_reward` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadLocalesCreatureCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Creature ...");
@@ -1201,6 +1275,14 @@ bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
return true;
}
+bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/)
+{
+ sLog.outString( "Re-Loading Locales Points Of Interest ... ");
+ objmgr.LoadPointOfInterestLocales();
+ SendGlobalSysMessage("DB table `locales_points_of_interest` reloaded.");
+ return true;
+}
+
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
{
sLog.outString( "Re-Loading Locales Quest ... ");
@@ -1347,19 +1429,10 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
return false;
}
- uint32 targetSecurity = accmgr.GetSecurity(targetAccountId);
-
- /// m_session==NULL only for console
- uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
-
/// can set password only for target with less security
/// This is also reject self apply in fact
- if (targetSecurity >= plSecurity)
- {
- SendSysMessage (LANG_YOURS_SECURITY_IS_LOW);
- SetSentErrorMessage (true);
+ if(HasLowerSecurityAccount (NULL,targetAccountId,true))
return false;
- }
if (strcmp(szPassword1,szPassword2))
{
@@ -1392,21 +1465,6 @@ bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
return true;
}
-bool ChatHandler::HandleAllowMovementCommand(const char* /*args*/)
-{
- if(sWorld.getAllowMovement())
- {
- sWorld.SetAllowMovement(false);
- SendSysMessage(LANG_CREATURE_MOVE_DISABLED);
- }
- else
- {
- sWorld.SetAllowMovement(true);
- SendSysMessage(LANG_CREATURE_MOVE_ENABLED);
- }
- return true;
-}
-
bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/)
{
Player* SelectedPlayer = getSelectedPlayer();
@@ -1437,7 +1495,6 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
char *max_p = strtok (NULL, " ");
int32 skill = atoi(skill_p);
-
if (skill <= 0)
{
PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
@@ -1463,9 +1520,11 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
return false;
}
+ std::string tNameLink = GetNameLink(target);
+
if(!target->GetSkillValue(skill))
{
- PSendSysMessage(LANG_SET_SKILL_ERROR, target->GetName(), skill, sl->name[0]);
+ PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[0]);
SetSentErrorMessage(true);
return false;
}
@@ -1476,7 +1535,7 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
return false;
target->SetSkill(skill, level, max);
- PSendSysMessage(LANG_SET_SKILL, skill, sl->name[0], target->GetName(), level, max);
+ PSendSysMessage(LANG_SET_SKILL, skill, sl->name[0], tNameLink.c_str(), level, max);
return true;
}
@@ -1487,27 +1546,12 @@ bool ChatHandler::HandleUnLearnCommand(const char* args)
return false;
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- uint32 min_id = extractSpellIdFromLink((char*)args);
- if(!min_id)
+ uint32 spell_id = extractSpellIdFromLink((char*)args);
+ if(!spell_id)
return false;
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- char* tail = strtok(NULL,"");
-
- uint32 max_id = extractSpellIdFromLink(tail);
-
- if (!max_id)
- {
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- max_id = min_id+1;
- }
- else
- {
- if (max_id < min_id)
- std::swap(min_id,max_id);
-
- max_id=max_id+1;
- }
+ char const* allStr = strtok(NULL," ");
+ bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
Player* target = getSelectedPlayer();
if(!target)
@@ -1517,13 +1561,13 @@ bool ChatHandler::HandleUnLearnCommand(const char* args)
return false;
}
- for(uint32 spell=min_id;spell<max_id;spell++)
- {
- if (target->HasSpell(spell))
- target->removeSpell(spell);
- else
- SendSysMessage(LANG_FORGET_SPELL);
- }
+ if(allRanks)
+ spell_id = spellmgr.GetFirstSpellInChain (spell_id);
+
+ if (target->HasSpell(spell_id))
+ target->removeSpell(spell_id,false,!allRanks);
+ else
+ SendSysMessage(LANG_FORGET_SPELL);
return true;
}
@@ -1538,10 +1582,12 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
return false;
}
+ std::string tNameLink = GetNameLink(target);
+
if (!*args)
{
target->RemoveAllSpellCooldown();
- PSendSysMessage(LANG_REMOVEALL_COOLDOWN, target->GetName());
+ PSendSysMessage(LANG_REMOVEALL_COOLDOWN, tNameLink.c_str());
}
else
{
@@ -1552,7 +1598,7 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
if(!sSpellStore.LookupEntry(spell_id))
{
- PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
+ PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -1562,8 +1608,8 @@ bool ChatHandler::HandleCooldownCommand(const char* args)
data << uint64(target->GetGUID());
target->GetSession()->SendPacket(&data);
target->RemoveSpellCooldown(spell_id);
- PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : target->GetName());
- }
+ PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetMangosString(LANG_YOU) : tNameLink.c_str());
+ }
return true;
}
@@ -2188,7 +2234,7 @@ bool ChatHandler::HandleLearnAllCommand(const char* /*args*/)
continue;
}
- m_session->GetPlayer()->learnSpell(spell);
+ m_session->GetPlayer()->learnSpell(spell,false);
}
SendSysMessage(LANG_COMMAND_LEARN_MANY_SPELLS);
@@ -2228,7 +2274,7 @@ bool ChatHandler::HandleLearnAllGMCommand(const char* /*args*/)
continue;
}
- m_session->GetPlayer()->learnSpell(spell);
+ m_session->GetPlayer()->learnSpell(spell,false);
}
SendSysMessage(LANG_LEARNING_GM_SKILLS);
@@ -2255,6 +2301,10 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if(!spellInfo)
continue;
+ // skip server-side/triggered spells
+ if(spellInfo->spellLevel==0)
+ continue;
+
// skip wrong class/race skills
if(!m_session->GetPlayer()->IsSpellFitByClassAndRace(spellInfo->Id))
continue;
@@ -2263,8 +2313,6 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if( spellInfo->SpellFamilyName != family)
continue;
- //TODO: skip triggered spells
-
// skip spells with first rank learned as talent (and all talents then also)
uint32 first_rank = spellmgr.GetFirstSpellInChain(spellInfo->Id);
if(GetTalentSpellCost(first_rank) > 0 )
@@ -2274,31 +2322,92 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
- m_session->GetPlayer()->learnSpell(i);
+ m_session->GetPlayer()->learnSpell(i,false);
}
SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);
return true;
}
-static void learnAllHighRanks(Player* player, uint32 spellid)
+bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
{
- SpellChainNode const* node;
- do
+ Player* player = m_session->GetPlayer();
+ uint32 classMask = player->getClassMask();
+
+ for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++)
{
- node = spellmgr.GetSpellChainNode(spellid);
- player->learnSpell(spellid);
- if (!node)
- break;
- spellid=node->next;
+ TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
+ if(!talentInfo)
+ continue;
+
+ TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab );
+ if(!talentTabInfo)
+ continue;
+
+ if( (classMask & talentTabInfo->ClassMask) == 0 )
+ continue;
+
+ // search highest talent rank
+ uint32 spellid = 0;
+
+ for(int rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
+ {
+ if(talentInfo->RankID[rank]!=0)
+ {
+ spellid = talentInfo->RankID[rank];
+ break;
+ }
+ }
+
+ if(!spellid) // ??? none spells in talent
+ continue;
+
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
+ if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
+ continue;
+
+ // learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
+ player->learnSpellHighRank(spellid);
}
- while (node->next);
+
+ SendSysMessage(LANG_COMMAND_LEARN_CLASS_TALENTS);
+ return true;
}
-bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
+bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/)
{
Player* player = m_session->GetPlayer();
- uint32 classMask = player->getClassMask();
+
+ Pet* pet = player->GetPet();
+ if(!pet)
+ {
+ SendSysMessage(LANG_NO_PET_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ CreatureInfo const *ci = pet->GetCreatureInfo();
+ if(!ci)
+ {
+ SendSysMessage(LANG_WRONG_PET_TYPE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
+ if(!pet_family)
+ {
+ SendSysMessage(LANG_WRONG_PET_TYPE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(pet_family->petTalentType < 0) // not hunter pet
+ {
+ SendSysMessage(LANG_WRONG_PET_TYPE);
+ SetSentErrorMessage(true);
+ return false;
+ }
for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++)
{
@@ -2310,13 +2419,14 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
if(!talentTabInfo)
continue;
- if( (classMask & talentTabInfo->ClassMask) == 0 )
+ // prevent learn talent for different family (cheating)
+ if(((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)==0)
continue;
// search highest talent rank
uint32 spellid = 0;
- int rank = 4;
- for(; rank >= 0; --rank)
+
+ for(int rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
if(talentInfo->RankID[rank]!=0)
{
@@ -2332,14 +2442,11 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
- // learn highest rank of talent
- player->learnSpell(spellid);
-
- // and learn all non-talent spell ranks (recursive by tree)
- learnAllHighRanks(player,spellid);
+ // learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
+ pet->learnSpellHighRank(spellid);
}
- SendSysMessage(LANG_COMMAND_LEARN_CLASS_TALENTS);
+ SendSysMessage(LANG_COMMAND_LEARN_PET_TALENTS);
return true;
}
@@ -2347,7 +2454,7 @@ bool ChatHandler::HandleLearnAllLangCommand(const char* /*args*/)
{
// skipping UNIVERSAL language (0)
for(int i = 1; i < LANGUAGES_COUNT; ++i)
- m_session->GetPlayer()->learnSpell(lang_description[i].spell_id);
+ m_session->GetPlayer()->learnSpell(lang_description[i].spell_id,false);
SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
return true;
@@ -2355,13 +2462,11 @@ bool ChatHandler::HandleLearnAllLangCommand(const char* /*args*/)
bool ChatHandler::HandleLearnAllDefaultCommand(const char* args)
{
- char* pName = strtok((char*)args, "");
Player *player = NULL;
- if (pName)
+ if (*args)
{
- std::string name = pName;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -2383,7 +2488,7 @@ bool ChatHandler::HandleLearnAllDefaultCommand(const char* args)
player->learnDefaultSpells();
player->learnQuestRewardedSpells();
- PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST,player->GetName());
+ PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST,GetNameLink(player).c_str());
return true;
}
@@ -2403,25 +2508,31 @@ bool ChatHandler::HandleLearnCommand(const char* args)
if(!spell || !sSpellStore.LookupEntry(spell))
return false;
- if (targetPlayer->HasSpell(spell))
+ char const* allStr = strtok(NULL," ");
+ bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
+
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
+ if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer()))
{
- if(targetPlayer == m_session->GetPlayer())
- SendSysMessage(LANG_YOU_KNOWN_SPELL);
- else
- PSendSysMessage(LANG_TARGET_KNOWN_SPELL,targetPlayer->GetName());
+ PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell);
SetSentErrorMessage(true);
return false;
}
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
- if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer()))
+ if (!allRanks && targetPlayer->HasSpell(spell))
{
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell);
+ if(targetPlayer == m_session->GetPlayer())
+ SendSysMessage(LANG_YOU_KNOWN_SPELL);
+ else
+ PSendSysMessage(LANG_TARGET_KNOWN_SPELL,GetNameLink(targetPlayer).c_str());
SetSentErrorMessage(true);
return false;
}
- targetPlayer->learnSpell(spell);
+ if(allRanks)
+ targetPlayer->learnSpellHighRank(spell);
+ else
+ targetPlayer->learnSpell(spell,false);
return true;
}
@@ -2491,7 +2602,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args)
if (count < 0)
{
plTarget->DestroyItemCount(itemId, -count, true, false);
- PSendSysMessage(LANG_REMOVEITEM, itemId, -count, plTarget->GetName());
+ PSendSysMessage(LANG_REMOVEITEM, itemId, -count, GetNameLink(plTarget).c_str());
return true;
}
@@ -2901,48 +3012,7 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
return true;
}
-bool ChatHandler::HandleNearObjectCommand(const char* args)
-{
- float distance = (!*args) ? 10 : atol(args);
- uint32 count = 0;
-
- Player* pl = m_session->GetPlayer();
- QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
- "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
- "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
- pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
- pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
-
- if (result)
- {
- do
- {
- Field *fields = result->Fetch();
- uint32 guid = fields[0].GetUInt32();
- uint32 entry = fields[1].GetUInt32();
- float x = fields[2].GetFloat();
- float y = fields[3].GetFloat();
- float z = fields[4].GetFloat();
- int mapid = fields[5].GetUInt16();
-
- GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry);
-
- if(!gInfo)
- continue;
-
- PSendSysMessage(LANG_GO_LIST_CHAT, guid, guid, gInfo->name, x, y, z, mapid);
-
- ++count;
- } while (result->NextRow());
-
- delete result;
- }
-
- PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE,distance,count);
- return true;
-}
-
-bool ChatHandler::HandleObjectStateCommand(const char* args)
+bool ChatHandler::HandleGameObjectStateCommand(const char* args)
{
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
char* cId = extractKeyFromLink((char*)args, "Hgameobject");
@@ -2976,8 +3046,6 @@ bool ChatHandler::HandleObjectStateCommand(const char* args)
gobj->SetGoState(state);
return true;
-
- return true;
}
bool ChatHandler::HandleListCreatureCommand(const char* args)
@@ -3231,15 +3299,25 @@ bool ChatHandler::HandleLookupSkillCommand(const char* args)
if(loc < MAX_LOCALE)
{
+ char valStr[50] = "";
char const* knownStr = "";
if(target && target->HasSkill(id))
+ {
knownStr = GetTrinityString(LANG_KNOWN);
+ uint32 curValue = target->GetPureSkillValue(id);
+ uint32 maxValue = target->GetPureMaxSkillValue(id);
+ uint32 permValue = target->GetSkillPermBonusValue(id);
+ uint32 tempValue = target->GetSkillTempBonusValue(id);
+
+ char const* valFormat = GetTrinityString(LANG_SKILL_VALUES);
+ snprintf(valStr,50,valFormat,curValue,maxValue,permValue,tempValue);
+ }
// send skill in "id - [namedlink locale]" format
if (m_session)
- PSendSysMessage(LANG_SKILL_LIST_CHAT,id,id,name.c_str(),localeNames[loc],knownStr);
+ PSendSysMessage(LANG_SKILL_LIST_CHAT,id,id,name.c_str(),localeNames[loc],knownStr,valStr);
else
- PSendSysMessage(LANG_SKILL_LIST_CONSOLE,id,name.c_str(),localeNames[loc],knownStr);
+ PSendSysMessage(LANG_SKILL_LIST_CONSOLE,id,name.c_str(),localeNames[loc],knownStr,valStr);
++counter;
}
@@ -3306,7 +3384,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
bool talent = (talentCost > 0);
bool passive = IsPassiveSpell(id);
- bool active = target && (target->HasAura(id,0) || target->HasAura(id,1) || target->HasAura(id,2));
+ bool active = target && target->HasAura(id);
// unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank
@@ -3626,7 +3704,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char* args)
}
Guild *guild = new Guild;
- if (!guild->create (player->GetGUID (),guildname))
+ if (!guild->create (player,guildname))
{
delete guild;
SendSysMessage (LANG_GUILD_NOT_CREATED);
@@ -3653,11 +3731,11 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
if (!targetGuild)
return false;
- std::string plName = par1;
- if (!normalizePlayerName (plName))
+ std::string plName = extractPlayerNameFromLink(par1);
+ if(plName.empty())
{
- SendSysMessage (LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage (true);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
}
@@ -3665,10 +3743,10 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args)
if (Player* targetPlayer = ObjectAccessor::Instance ().FindPlayerByName (plName.c_str ()))
plGuid = targetPlayer->GetGUID ();
else
- plGuid = objmgr.GetPlayerGUIDByName (plName.c_str ());
+ plGuid = objmgr.GetPlayerGUIDByName (plName);
if (!plGuid)
- false;
+ return false;
// player's guild membership checked in AddMember before add
if (!targetGuild->AddMember (plGuid,targetGuild->GetLowestRank ()))
@@ -3686,11 +3764,11 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
if(!par1)
return false;
- std::string plName = par1;
- if (!normalizePlayerName (plName))
+ std::string plName = extractPlayerNameFromLink(par1);
+ if(plName.empty())
{
- SendSysMessage (LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage (true);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
}
@@ -3703,7 +3781,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args)
}
else
{
- plGuid = objmgr.GetPlayerGUIDByName (plName.c_str ());
+ plGuid = objmgr.GetPlayerGUIDByName (plName);
glId = Player::GetGuildIdFromDB (plGuid);
}
@@ -3728,14 +3806,16 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
char* par2 = strtok (NULL, " ");
if (!par1 || !par2)
return false;
- std::string plName = par1;
- if (!normalizePlayerName (plName))
+
+ std::string plName = extractPlayerNameFromLink(par1);
+ if(plName.empty())
{
- SendSysMessage (LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage (true);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
}
+
uint64 plGuid = 0;
uint32 glId = 0;
if (Player* targetPlayer = ObjectAccessor::Instance ().FindPlayerByName (plName.c_str ()))
@@ -3745,7 +3825,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
}
else
{
- plGuid = objmgr.GetPlayerGUIDByName (plName.c_str ());
+ plGuid = objmgr.GetPlayerGUIDByName (plName);
glId = Player::GetGuildIdFromDB (plGuid);
}
@@ -3785,90 +3865,37 @@ bool ChatHandler::HandleGuildDeleteCommand(const char* args)
return true;
}
-bool ChatHandler::HandleGetDistanceCommand(const char* /*args*/)
+bool ChatHandler::HandleGetDistanceCommand(const char* args)
{
- Unit* pUnit = getSelectedUnit();
-
- if(!pUnit)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
+ WorldObject* obj = NULL;
- PSendSysMessage(LANG_DISTANCE, m_session->GetPlayer()->GetDistance(pUnit),m_session->GetPlayer()->GetDistance2d(pUnit));
-
- return true;
-}
-
-// FIX-ME!!!
-
-bool ChatHandler::HandleAddWeaponCommand(const char* /*args*/)
-{
- /*if (!*args)
- return false;
-
- uint64 guid = m_session->GetPlayer()->GetSelection();
- if (guid == 0)
+ if (*args)
{
- SendSysMessage(LANG_NO_SELECTION);
- return true;
- }
-
- Creature *pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
+ uint64 guid = extractGuidFromLink((char*)args);
+ if(guid)
+ obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
- if(!pCreature)
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- return true;
- }
-
- char* pSlotID = strtok((char*)args, " ");
- if (!pSlotID)
- return false;
-
- char* pItemID = strtok(NULL, " ");
- if (!pItemID)
- return false;
-
- uint32 ItemID = atoi(pItemID);
- uint32 SlotID = atoi(pSlotID);
-
- ItemPrototype* tmpItem = objmgr.GetItemPrototype(ItemID);
-
- bool added = false;
- if(tmpItem)
- {
- switch(SlotID)
+ if(!obj)
{
- case 1:
- pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, ItemID);
- added = true;
- break;
- case 2:
- pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY_01, ItemID);
- added = true;
- break;
- case 3:
- pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY_02, ItemID);
- added = true;
- break;
- default:
- PSendSysMessage(LANG_ITEM_SLOT_NOT_EXIST,SlotID);
- added = false;
- break;
- }
- if(added)
- {
- PSendSysMessage(LANG_ITEM_ADDED_TO_SLOT,ItemID,tmpItem->Name1,SlotID);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
}
}
else
{
- PSendSysMessage(LANG_ITEM_NOT_FOUND,ItemID);
- return true;
+ obj = getSelectedUnit();
+
+ if(!obj)
+ {
+ SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
}
- */
+
+ PSendSysMessage(LANG_DISTANCE, m_session->GetPlayer()->GetDistance(obj),m_session->GetPlayer()->GetDistance2d(obj));
+
return true;
}
@@ -3883,6 +3910,12 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/)
return false;
}
+ if(target->GetTypeId()==TYPEID_PLAYER)
+ {
+ if(HasLowerSecurity((Player*)target,0,false))
+ return false;
+ }
+
if( target->isAlive() )
{
//m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -3934,7 +3967,7 @@ bool ChatHandler::HandleDamageCommand(const char * args)
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
if ( schoolmask & SPELL_SCHOOL_MASK_NORMAL )
- damage = m_session->GetPlayer()->CalcArmorReducedDamage(target, damage);
+ damage = m_session->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
char* spellStr = strtok((char*)NULL, " ");
@@ -3984,7 +4017,7 @@ bool ChatHandler::HandleModifyArenaCommand(const char * args)
target->ModifyArenaPoints(amount);
- PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, target->GetName(), target->GetArenaPoints());
+ PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, GetNameLink(target).c_str(), target->GetArenaPoints());
return true;
}
@@ -3995,8 +4028,8 @@ bool ChatHandler::HandleReviveCommand(const char* args)
if (*args)
{
- std::string name = args;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -4023,10 +4056,6 @@ bool ChatHandler::HandleReviveCommand(const char* args)
bool ChatHandler::HandleAuraCommand(const char* args)
{
- char* px = strtok((char*)args, " ");
- if (!px)
- return false;
-
Unit *target = getSelectedUnit();
if(!target)
{
@@ -4035,8 +4064,11 @@ bool ChatHandler::HandleAuraCommand(const char* args)
return false;
}
- uint32 spellID = (uint32)atoi(px);
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellID = extractSpellIdFromLink((char*)args);
+
SpellEntry const *spellInfo = sSpellStore.LookupEntry( spellID );
+ uint8 eff_mask=0;
if(spellInfo)
{
for(uint32 i = 0;i<3;i++)
@@ -4048,21 +4080,18 @@ bool ChatHandler::HandleAuraCommand(const char* args)
eff == SPELL_EFFECT_APPLY_AURA ||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA )
{
- Aura *Aur = CreateAura(spellInfo, i, NULL, target);
- target->AddAura(Aur);
+ eff_mask|=1<<i;
}
}
}
+ Aura *Aur = new Aura(spellInfo, eff_mask, NULL, target);
+ target->AddAura(Aur);
return true;
}
bool ChatHandler::HandleUnAuraCommand(const char* args)
{
- char* px = strtok((char*)args, " ");
- if (!px)
- return false;
-
Unit *target = getSelectedUnit();
if(!target)
{
@@ -4078,7 +4107,11 @@ bool ChatHandler::HandleUnAuraCommand(const char* args)
return true;
}
- uint32 spellID = (uint32)atoi(px);
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellID = extractSpellIdFromLink((char*)args);
+ if(!spellID)
+ return false;
+
target->RemoveAurasDueToSpell(spellID);
return true;
@@ -4129,7 +4162,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char* args)
return false;
}
- if(objmgr.AddGraveYardLink(g_id,player->GetZoneId(),g_team))
+ if(objmgr.AddGraveYardLink(g_id,zoneId,g_team))
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
else
PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId);
@@ -4153,6 +4186,7 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
return false;
Player* player = m_session->GetPlayer();
+ uint32 zone_id = player->GetZoneId();
WorldSafeLocsEntry const* graveyard = objmgr.GetClosestGraveYard(
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team);
@@ -4161,7 +4195,7 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
{
uint32 g_id = graveyard->ID;
- GraveYardData const* data = objmgr.FindGraveYardData(g_id,player->GetZoneId());
+ GraveYardData const* data = objmgr.FindGraveYardData(g_id,zone_id);
if (!data)
{
PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id);
@@ -4180,7 +4214,7 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
else if(g_team == ALLIANCE)
team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
- PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id,team_name.c_str(),player->GetZoneId());
+ PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id,team_name.c_str(),zone_id);
}
else
{
@@ -4194,29 +4228,51 @@ bool ChatHandler::HandleNearGraveCommand(const char* args)
team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
if(g_team == ~uint32(0))
- PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, player->GetZoneId());
+ PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
else
- PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, player->GetZoneId(),team_name.c_str());
+ PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id,team_name.c_str());
}
return true;
}
-//play npc emote
-bool ChatHandler::HandleNpcPlayEmoteCommand(const char* args)
+//-----------------------Npc Commands-----------------------
+bool ChatHandler::HandleNpcAllowMovementCommand(const char* /*args*/)
{
- uint32 emote = atoi((char*)args);
+ if(sWorld.getAllowMovement())
+ {
+ sWorld.SetAllowMovement(false);
+ SendSysMessage(LANG_CREATURE_MOVE_DISABLED);
+ }
+ else
+ {
+ sWorld.SetAllowMovement(true);
+ SendSysMessage(LANG_CREATURE_MOVE_ENABLED);
+ }
+ return true;
+}
- Creature* target = getSelectedCreature();
- if(!target)
+bool ChatHandler::HandleNpcChangeEntryCommand(const char *args)
+{
+ if (!*args)
+ return false;
+
+ uint32 newEntryNum = atoi(args);
+ if(!newEntryNum)
+ return false;
+
+ Unit* unit = getSelectedUnit();
+ if(!unit || unit->GetTypeId() != TYPEID_UNIT)
{
SendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
-
- target->SetUInt32Value(UNIT_NPC_EMOTESTATE,emote);
-
+ Creature* creature = (Creature*)unit;
+ if(creature->UpdateEntry(newEntryNum))
+ SendSysMessage(LANG_DONE);
+ else
+ SendSysMessage(LANG_ERROR);
return true;
}
@@ -4268,6 +4324,95 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/)
return true;
}
+//play npc emote
+bool ChatHandler::HandleNpcPlayEmoteCommand(const char* args)
+{
+ uint32 emote = atoi((char*)args);
+
+ Creature* target = getSelectedCreature();
+ if(!target)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->SetUInt32Value(UNIT_NPC_EMOTESTATE,emote);
+
+ return true;
+}
+
+//TODO: NpcCommands that needs to be fixed :
+
+bool ChatHandler::HandleNpcAddWeaponCommand(const char* /*args*/)
+{
+ /*if (!*args)
+ return false;
+
+ uint64 guid = m_session->GetPlayer()->GetSelection();
+ if (guid == 0)
+ {
+ SendSysMessage(LANG_NO_SELECTION);
+ return true;
+ }
+
+ Creature *pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid);
+
+ if(!pCreature)
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ return true;
+ }
+
+ char* pSlotID = strtok((char*)args, " ");
+ if (!pSlotID)
+ return false;
+
+ char* pItemID = strtok(NULL, " ");
+ if (!pItemID)
+ return false;
+
+ uint32 ItemID = atoi(pItemID);
+ uint32 SlotID = atoi(pSlotID);
+
+ ItemPrototype* tmpItem = objmgr.GetItemPrototype(ItemID);
+
+ bool added = false;
+ if(tmpItem)
+ {
+ switch(SlotID)
+ {
+ case 1:
+ pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, ItemID);
+ added = true;
+ break;
+ case 2:
+ pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY_01, ItemID);
+ added = true;
+ break;
+ case 3:
+ pCreature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY_02, ItemID);
+ added = true;
+ break;
+ default:
+ PSendSysMessage(LANG_ITEM_SLOT_NOT_EXIST,SlotID);
+ added = false;
+ break;
+ }
+
+ if(added)
+ PSendSysMessage(LANG_ITEM_ADDED_TO_SLOT,ItemID,tmpItem->Name1,SlotID);
+ }
+ else
+ {
+ PSendSysMessage(LANG_ITEM_NOT_FOUND,ItemID);
+ return true;
+ }
+ */
+ return true;
+}
+//----------------------------------------------------------
+
bool ChatHandler::HandleExploreCheatCommand(const char* args)
{
if (!*args)
@@ -4285,15 +4430,15 @@ bool ChatHandler::HandleExploreCheatCommand(const char* args)
if (flag != 0)
{
- PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, chr->GetName());
+ PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL,GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL,GetNameLink().c_str());
}
else
{
- PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, chr->GetName());
+ PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, GetNameLink(chr).c_str());
if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetName());
+ ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetNameLink().c_str());
}
for (uint8 i=0; i<128; i++)
@@ -4330,36 +4475,6 @@ bool ChatHandler::HandleHoverCommand(const char* args)
return true;
}
-bool ChatHandler::HandleWaterwalkCommand(const char* args)
-{
- if(!args)
- return false;
-
- Player *player = getSelectedPlayer();
- if(!player)
- {
- PSendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (strncmp(args, "on", 3) == 0)
- player->SetMovement(MOVE_WATER_WALK); // ON
- else if (strncmp(args, "off", 4) == 0)
- player->SetMovement(MOVE_LAND_WALK); // OFF
- else
- {
- SendSysMessage(LANG_USE_BOL);
- return false;
- }
-
- PSendSysMessage(LANG_YOU_SET_WATERWALK, args, player->GetName());
- if(needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetName());
- return true;
-
-}
-
bool ChatHandler::HandleLevelUpCommand(const char* args)
{
char* px = strtok((char*)args, " ");
@@ -4391,8 +4506,8 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
if(pname) // player by name
{
- name = pname;
- if(!normalizePlayerName(name))
+ name = extractPlayerNameFromLink(pname);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -4460,7 +4575,10 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
}
if(m_session->GetPlayer() != chr) // including chr==NULL
- PSendSysMessage(LANG_YOU_CHANGE_LVL,name.c_str(),newlevel);
+ {
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_YOU_CHANGE_LVL,nameLink.c_str(),newlevel);
+ }
return true;
}
@@ -4469,8 +4587,6 @@ bool ChatHandler::HandleShowAreaCommand(const char* args)
if (!*args)
return false;
- int area = atoi((char*)args);
-
Player *chr = getSelectedPlayer();
if (chr == NULL)
{
@@ -4479,10 +4595,11 @@ bool ChatHandler::HandleShowAreaCommand(const char* args)
return false;
}
+ int area = GetAreaFlagByAreaID(atoi((char*)args));
int offset = area / 32;
uint32 val = (uint32)(1 << (area % 32));
- if(offset >= 128)
+ if(area<0 || offset >= 128)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
@@ -4501,8 +4618,6 @@ bool ChatHandler::HandleHideAreaCommand(const char* args)
if (!*args)
return false;
- int area = atoi((char*)args);
-
Player *chr = getSelectedPlayer();
if (chr == NULL)
{
@@ -4511,10 +4626,11 @@ bool ChatHandler::HandleHideAreaCommand(const char* args)
return false;
}
+ int area = GetAreaFlagByAreaID(atoi((char*)args));
int offset = area / 32;
uint32 val = (uint32)(1 << (area % 32));
- if(offset >= 128)
+ if(area<0 || offset >= 128)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
@@ -4528,7 +4644,7 @@ bool ChatHandler::HandleHideAreaCommand(const char* args)
return true;
}
-bool ChatHandler::HandleUpdate(const char* args)
+bool ChatHandler::HandleDebugUpdate(const char* args)
{
if(!*args)
return false;
@@ -4628,7 +4744,7 @@ bool ChatHandler::HandleChangeWeather(const char* args)
return true;
}
-bool ChatHandler::HandleSetValue(const char* args)
+bool ChatHandler::HandleDebugSetValue(const char* args)
{
if(!*args)
return false;
@@ -4679,7 +4795,7 @@ bool ChatHandler::HandleSetValue(const char* args)
return true;
}
-bool ChatHandler::HandleGetValue(const char* args)
+bool ChatHandler::HandleDebugGetValue(const char* args)
{
if(!*args)
return false;
@@ -4728,11 +4844,19 @@ bool ChatHandler::HandleGetValue(const char* args)
return true;
}
-bool ChatHandler::HandleSet32Bit(const char* args)
+bool ChatHandler::HandleDebugSet32Bit(const char* args)
{
if(!*args)
return false;
+ Unit* target = getSelectedUnit();
+ if(!target)
+ {
+ SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
char* px = strtok((char*)args, " ");
char* py = strtok(NULL, " ");
@@ -4746,13 +4870,14 @@ bool ChatHandler::HandleSet32Bit(const char* args)
sLog.outDebug(GetTrinityString(LANG_SET_32BIT), Opcode, Value);
- m_session->GetPlayer( )->SetUInt32Value( Opcode , 2^Value );
+ uint32 iValue = Value ? 1 << (Value - 1) : 0;
+ target->SetUInt32Value( Opcode , iValue);
- PSendSysMessage(LANG_SET_32BIT_FIELD, Opcode,1);
+ PSendSysMessage(LANG_SET_32BIT_FIELD, Opcode, iValue);
return true;
}
-bool ChatHandler::HandleMod32Value(const char* args)
+bool ChatHandler::HandleDebugMod32Value(const char* args)
{
if(!*args)
return false;
@@ -4784,7 +4909,7 @@ bool ChatHandler::HandleMod32Value(const char* args)
return true;
}
-bool ChatHandler::HandleAddTeleCommand(const char * args)
+bool ChatHandler::HandleTeleAddCommand(const char * args)
{
if(!*args)
return false;
@@ -4824,7 +4949,7 @@ bool ChatHandler::HandleAddTeleCommand(const char * args)
return true;
}
-bool ChatHandler::HandleDelTeleCommand(const char * args)
+bool ChatHandler::HandleTeleDelCommand(const char * args)
{
if(!*args)
return false;
@@ -4860,43 +4985,104 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
for (Unit::AuraMap::const_iterator itr = uAuras.begin(); itr != uAuras.end(); ++itr)
{
bool talent = GetTalentSpellCost(itr->second->GetId()) > 0;
- PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffIndex(),
- itr->second->GetModifier()->m_auraname, itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
- itr->second->GetSpellProto()->SpellName[m_session->GetSessionDbcLocale()],
- (itr->second->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
- IS_PLAYER_GUID(itr->second->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(itr->second->GetCasterGUID()));
+
+ char const* name = itr->second->GetSpellProto()->SpellName[m_session->GetSessionDbcLocale()];
+
+ if (m_session)
+ {
+ std::ostringstream ss_name;
+ ss_name << "|cffffffff|Hspell:" << itr->second->GetId() << "|h[" << name << "]|h|r";
+
+ PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffectMask(),
+ itr->second->GetAuraCharges(), itr->second->GetStackAmount(),itr->second->GetAuraSlot(),
+ itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
+ ss_name.str().c_str(),
+ (itr->second->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
+ IS_PLAYER_GUID(itr->second->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(itr->second->GetCasterGUID()));
+ }
+ else
+ {
+ PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffectMask(),
+ itr->second->GetAuraCharges(), itr->second->GetStackAmount(),itr->second->GetAuraSlot(),
+ itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
+ name,
+ (itr->second->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
+ IS_PLAYER_GUID(itr->second->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(itr->second->GetCasterGUID()));
+ }
}
for (int i = 0; i < TOTAL_AURAS; i++)
{
- Unit::AuraList const& uAuraList = unit->GetAurasByType(AuraType(i));
+ Unit::AuraEffectList const& uAuraList = unit->GetAurasByType(AuraType(i));
if (uAuraList.empty()) continue;
PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i);
- for (Unit::AuraList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
+ for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
{
- bool talent = GetTalentSpellCost((*itr)->GetId()) > 0;
+ char const* name = (*itr)->GetSpellProto()->SpellName[m_session->GetSessionDbcLocale()];
+
+ std::ostringstream ss_name;
+ ss_name << "|cffffffff|Hspell:" << (*itr)->GetId() << "|h[" << name << "]|h|r";
+
PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(),
- (*itr)->GetSpellProto()->SpellName[m_session->GetSessionDbcLocale()],((*itr)->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
- IS_PLAYER_GUID((*itr)->GetCasterGUID()) ? "player" : "creature",GUID_LOPART((*itr)->GetCasterGUID()));
+ (*itr)->GetAmount());
}
}
return true;
}
+bool ChatHandler::HandleResetAchievementsCommand (const char * args)
+{
+ char* pName = strtok((char*)args, "");
+ Player *player = NULL;
+ uint64 guid = 0;
+ if (pName)
+ {
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ guid = objmgr.GetPlayerGUIDByName(name);
+ player = objmgr.GetPlayer(guid);
+ }
+ else
+ {
+ player = getSelectedPlayer();
+ if(player)
+ guid = player->GetGUID();
+ }
+
+ if(!player && !guid)
+ {
+ SendSysMessage(LANG_NO_CHAR_SELECTED);
+ return true;
+ }
+
+ if(player)
+ player->GetAchievementMgr().Reset();
+ else if(guid)
+ AchievementMgr::DeleteFromDB(GUID_LOPART(guid));
+
+ return true;
+}
+
bool ChatHandler::HandleResetHonorCommand (const char * args)
{
char* pName = strtok((char*)args, "");
Player *player = NULL;
if (pName)
{
- std::string name = pName;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
- uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str());
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
player = objmgr.GetPlayer(guid);
}
else
@@ -4931,19 +5117,6 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
uint8 powertype = cEntry->powerType;
- uint32 unitfield;
- if(powertype == POWER_RAGE)
- unitfield = 0x1100EE00;
- else if(powertype == POWER_ENERGY)
- unitfield = 0x00000000;
- else if(powertype == POWER_MANA)
- unitfield = 0x0000EE00;
- else
- {
- sLog.outError("Invalid default powertype %u for player (class %u)",powertype,player->getClass());
- return false;
- }
-
// reset m_form if no aura
if(!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
player->m_form = FORM_NONE;
@@ -4973,9 +5146,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
}
}
- // set UNIT_FIELD_BYTES_1 to init state but preserve m_form value
- player->SetUInt32Value(UNIT_FIELD_BYTES_1, unitfield);
- player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_UNK5 );
+ player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
player->SetByteValue(UNIT_FIELD_BYTES_2, 3, player->m_form);
player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
@@ -4993,15 +5164,15 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
Player *player = NULL;
if (pName)
{
- std::string name = pName;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
- uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str());
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
player = objmgr.GetPlayer(guid);
}
else
@@ -5017,17 +5188,27 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
if(!HandleResetStatsOrLevelHelper(player))
return false;
- player->SetLevel(1);
+ // set starting level
+ uint32 start_level = player->getClass() != CLASS_DEATH_KNIGHT
+ ? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)
+ : sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
+
+ player->SetLevel(start_level);
+ player->InitRunes();
player->InitStatsForLevel(true);
player->InitTaxiNodesForLevel();
+ player->InitGlyphsForLevel();
player->InitTalentForLevel();
player->SetUInt32Value(PLAYER_XP,0);
// reset level to summoned pet
- Pet* pet = player->GetPet();
- if(pet && pet->getPetType()==SUMMON_PET)
+ Guardian* pet = player->GetGuardianPet();
+ if(pet)
+ {
pet->InitStatsForLevel(1);
-
+ if(pet->isPet())
+ ((Pet*)pet)->InitTalentForLevel();
+ }
return true;
}
@@ -5037,15 +5218,15 @@ bool ChatHandler::HandleResetStatsCommand(const char * args)
Player *player = NULL;
if (pName)
{
- std::string name = pName;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
- uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str());
+ uint64 guid = objmgr.GetPlayerGUIDByName(name);
player = objmgr.GetPlayer(guid);
}
else
@@ -5061,8 +5242,10 @@ bool ChatHandler::HandleResetStatsCommand(const char * args)
if(!HandleResetStatsOrLevelHelper(player))
return false;
+ player->InitRunes();
player->InitStatsForLevel(true);
player->InitTaxiNodesForLevel();
+ player->InitGlyphsForLevel();
player->InitTalentForLevel();
return true;
@@ -5075,9 +5258,8 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args)
uint64 playerGUID = 0;
if (pName)
{
- std::string name = pName;
-
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -5086,7 +5268,7 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args)
player = objmgr.GetPlayer(name.c_str());
if(!player)
- playerGUID = objmgr.GetPlayerGUIDByName(name.c_str());
+ playerGUID = objmgr.GetPlayerGUIDByName(name);
}
else
player = getSelectedPlayer();
@@ -5103,9 +5285,8 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args)
player->resetSpells();
ChatHandler(player).SendSysMessage(LANG_RESET_SPELLS);
-
if(m_session->GetPlayer()!=player)
- PSendSysMessage(LANG_RESET_SPELLS_ONLINE,player->GetName());
+ PSendSysMessage(LANG_RESET_SPELLS_ONLINE,GetNameLink(player).c_str());
}
else
{
@@ -5123,8 +5304,8 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args)
uint64 playerGUID = 0;
if (pName)
{
- std::string name = pName;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink(pName);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -5133,34 +5314,47 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args)
player = objmgr.GetPlayer(name.c_str());
if(!player)
- playerGUID = objmgr.GetPlayerGUIDByName(name.c_str());
+ playerGUID = objmgr.GetPlayerGUIDByName(name);
}
else
player = getSelectedPlayer();
- if(!player && !playerGUID)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
if(player)
{
player->resetTalents(true);
ChatHandler(player).SendSysMessage(LANG_RESET_TALENTS);
-
if(m_session->GetPlayer()!=player)
- PSendSysMessage(LANG_RESET_TALENTS_ONLINE,player->GetName());
+ PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(player).c_str());
+
+ return true;
}
- else
+ else if (playerGUID)
{
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'",uint32(AT_LOGIN_RESET_TALENTS), GUID_LOPART(playerGUID) );
- PSendSysMessage(LANG_RESET_TALENTS_OFFLINE,pName);
+ std::string nameLink = playerLink(pName);
+ PSendSysMessage(LANG_RESET_TALENTS_OFFLINE,nameLink.c_str());
+ return true;
+ }
+ // Try reset talenents as Hunter Pet
+ Creature* creature = getSelectedCreature();
+ if (creature && creature->isPet() && ((Pet *)creature)->getPetType() == HUNTER_PET)
+ {
+ ((Pet *)creature)->resetTalents(true);
+ Unit *owner = creature->GetOwner();
+ if (owner && owner->GetTypeId() == TYPEID_PLAYER)
+ {
+ player = (Player *)owner;
+ ChatHandler(player).SendSysMessage(LANG_RESET_PET_TALENTS);
+ if(m_session->GetPlayer()!=player)
+ PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE,GetNameLink(player).c_str());
+ }
+ return true;
}
- return true;
+ SendSysMessage(LANG_NO_CHAR_SELECTED);
+ SetSentErrorMessage(true);
+ return false;
}
bool ChatHandler::HandleResetAllCommand(const char * args)
@@ -5344,7 +5538,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char* args)
return true;
}
-bool ChatHandler::HandleAddQuest(const char* args)
+bool ChatHandler::HandleQuestAdd(const char* args)
{
Player* player = getSelectedPlayer();
if(!player)
@@ -5398,7 +5592,7 @@ bool ChatHandler::HandleAddQuest(const char* args)
return true;
}
-bool ChatHandler::HandleRemoveQuest(const char* args)
+bool ChatHandler::HandleQuestRemove(const char* args)
{
Player* player = getSelectedPlayer();
if(!player)
@@ -5448,7 +5642,7 @@ bool ChatHandler::HandleRemoveQuest(const char* args)
return true;
}
-bool ChatHandler::HandleCompleteQuest(const char* args)
+bool ChatHandler::HandleQuestComplete(const char* args)
{
Player* player = getSelectedPlayer();
if(!player)
@@ -5522,12 +5716,10 @@ bool ChatHandler::HandleCompleteQuest(const char* args)
if(uint32 repFaction = pQuest->GetRepObjectiveFaction())
{
uint32 repValue = pQuest->GetRepObjectiveValue();
- uint32 curRep = player->GetReputation(repFaction);
+ uint32 curRep = player->GetReputationMgr().GetReputation(repFaction);
if(curRep < repValue)
- {
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(repFaction);
- player->SetFactionReputation(factionEntry,repValue);
- }
+ if(FactionEntry const *factionEntry = sFactionStore.LookupEntry(repFaction))
+ player->GetReputationMgr().SetReputation(factionEntry,repValue);
}
// If the quest requires money
@@ -5556,7 +5748,7 @@ bool ChatHandler::HandleBanIPCommand(const char* args)
bool ChatHandler::HandleBanHelper(BanMode mode, const char* args)
{
- if(!args)
+ if (!*args)
return false;
char* cnameOrIP = strtok ((char*)args, " ");
@@ -5644,7 +5836,7 @@ bool ChatHandler::HandleUnBanIPCommand(const char* args)
bool ChatHandler::HandleUnBanHelper(BanMode mode, const char* args)
{
- if(!args)
+ if (!*args)
return false;
char* cnameOrIP = strtok ((char*)args, " ");
@@ -5687,7 +5879,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char* args)
bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
{
- if(!args)
+ if (!*args)
return false;
char* cname = strtok((char*)args, "");
@@ -5714,15 +5906,11 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
{
- if(!args)
- return false;
-
- char* cname = strtok ((char*)args, "");
- if(!cname)
+ if (!*args)
return false;
- std::string name = cname;
- if(!normalizePlayerName(name))
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
@@ -5777,7 +5965,7 @@ bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname)
bool ChatHandler::HandleBanInfoIPCommand(const char* args)
{
- if(!args)
+ if (!*args)
return false;
char* cIP = strtok ((char*)args, "");
@@ -6034,8 +6222,8 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::RespawnDo u_do;
- Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(u_do);
+ MaNGOS::RespawnDo u_do;
+ MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo> worker(pl,u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -6044,14 +6232,14 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
return true;
}
-bool ChatHandler::HandleFlyModeCommand(const char* args)
+bool ChatHandler::HandleGMFlyCommand(const char* args)
{
- if(!args)
+ if (!*args)
return false;
- Unit *unit = getSelectedUnit();
- if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
- unit = m_session->GetPlayer();
+ Player *target = getSelectedPlayer();
+ if (!target)
+ target = m_session->GetPlayer();
WorldPacket data(12);
if (strncmp(args, "on", 3) == 0)
@@ -6063,16 +6251,16 @@ bool ChatHandler::HandleFlyModeCommand(const char* args)
SendSysMessage(LANG_USE_BOL);
return false;
}
- data.append(unit->GetPackGUID());
+ data.append(target->GetPackGUID());
data << uint32(0); // unknown
- unit->SendMessageToSet(&data, true);
- PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, unit->GetName(), args);
+ target->SendMessageToSet(&data, true);
+ PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, GetNameLink(target).c_str(), args);
return true;
}
-bool ChatHandler::HandleLoadPDumpCommand(const char *args)
+bool ChatHandler::HandlePDumpLoadCommand(const char *args)
{
- if(!args)
+ if (!*args)
return false;
char * file = strtok((char*)args, " ");
@@ -6181,33 +6369,9 @@ bool ChatHandler::HandleLoadPDumpCommand(const char *args)
return true;
}
-bool ChatHandler::HandleNpcChangeEntryCommand(const char *args)
+bool ChatHandler::HandlePDumpWriteCommand(const char *args)
{
- if(!args)
- return false;
-
- uint32 newEntryNum = atoi(args);
- if(!newEntryNum)
- return false;
-
- Unit* unit = getSelectedUnit();
- if(!unit || unit->GetTypeId() != TYPEID_UNIT)
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
- Creature* creature = (Creature*)unit;
- if(creature->UpdateEntry(newEntryNum))
- SendSysMessage(LANG_DONE);
- else
- SendSysMessage(LANG_ERROR);
- return true;
-}
-
-bool ChatHandler::HandleWritePDumpCommand(const char *args)
-{
- if(!args)
+ if (!*args)
return false;
char* file = strtok((char*)args, " ");
@@ -6222,12 +6386,11 @@ bool ChatHandler::HandleWritePDumpCommand(const char *args)
guid = atoi(p2);
else
{
- std::string name = p2;
-
- if (!normalizePlayerName (name))
+ std::string name = extractPlayerNameFromLink(p2);
+ if(name.empty())
{
- SendSysMessage (LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage (true);
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
}
@@ -6778,6 +6941,29 @@ bool ChatHandler::HandleServerSetMotdCommand(const char* args)
return true;
}
+/// Set whether we accept new clients
+bool ChatHandler::HandleServerSetClosedCommand(const char* args)
+{
+ std::string arg = args;
+
+ if(args == "on")
+ {
+ SendSysMessage(LANG_WORLD_CLOSED);
+ sWorld.SetClosed(true);
+ return true;
+ }
+ if(args == "off")
+ {
+ SendSysMessage(LANG_WORLD_OPENED);
+ sWorld.SetClosed(false);
+ return true;
+ }
+
+ SendSysMessage(LANG_USE_BOL);
+ SetSentErrorMessage(true);
+ return false;
+}
+
/// Set/Unset the expansion level for an account
bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
{
@@ -6819,8 +7005,15 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
SetSentErrorMessage(true);
return false;
}
+
}
+ // Let set addon state only for lesser (strong) security level
+ // or to self account
+ if (m_session && m_session->GetAccountId () != account_id &&
+ HasLowerSecurityAccount (NULL,account_id,true))
+ return false;
+
int lev=atoi(szExp); //get int anyway (0 if error)
if(lev < 0)
return false;
@@ -6839,9 +7032,13 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
// format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
- char* pName = strtok((char*)args, " ");
- if(!pName)
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
+ }
char* tail1 = strtok(NULL, "");
if(!tail1)
@@ -6879,8 +7076,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
if (!msgText)
return false;
- // pName, msgSubject, msgText isn't NUL after prev. check
- std::string name = pName;
+ // msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
@@ -6915,17 +7111,17 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
}
uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1;
- if(item_count < 1 || item_proto->MaxCount && item_count > item_proto->MaxCount)
+ if(item_count < 1 || item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount))
{
PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id);
SetSentErrorMessage(true);
return false;
}
- while(item_count > item_proto->Stackable)
+ while(item_count > item_proto->GetMaxStackSize())
{
- items.push_back(ItemPair(item_id,item_proto->Stackable));
- item_count -= item_proto->Stackable;
+ items.push_back(ItemPair(item_id,item_proto->GetMaxStackSize()));
+ item_count -= item_proto->GetMaxStackSize();
}
items.push_back(ItemPair(item_id,item_count));
@@ -6938,13 +7134,6 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
}
}
- if(!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
uint64 receiver_guid = objmgr.GetPlayerGUIDByName(name);
if(!receiver_guid)
{
@@ -6976,7 +7165,8 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
WorldSession::SendMailTo(receiver,messagetype, stationery, sender_guidlo, GUID_LOPART(receiver_guid), subject, itemTextId, &mi, 0, 0, MAIL_CHECK_MASK_NONE);
- PSendSysMessage(LANG_MAIL_SENT, name.c_str());
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
@@ -6988,9 +7178,13 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
/// format: name "subject text" "mail text" money
- char* pName = strtok((char*)args, " ");
- if (!pName)
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
+ }
char* tail1 = strtok(NULL, "");
if (!tail1)
@@ -7033,18 +7227,10 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
if (money <= 0)
return false;
- // pName, msgSubject, msgText isn't NUL after prev. check
- std::string name = pName;
+ // msgSubject, msgText isn't NUL after prev. check
std::string subject = msgSubject;
std::string text = msgText;
- if (!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
uint64 receiver_guid = objmgr.GetPlayerGUIDByName(name);
if (!receiver_guid)
{
@@ -7053,8 +7239,6 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
return false;
}
- uint32 mailId = objmgr.GenerateMailID();
-
// from console show not existed sender
uint32 sender_guidlo = m_session ? m_session->GetPlayer()->GetGUIDLow() : 0;
@@ -7066,7 +7250,8 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
WorldSession::SendMailTo(receiver,messagetype, stationery, sender_guidlo, GUID_LOPART(receiver_guid), subject, itemTextId, NULL, money, 0, MAIL_CHECK_MASK_NONE);
- PSendSysMessage(LANG_MAIL_SENT, name.c_str());
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
return true;
}
@@ -7074,15 +7259,16 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
bool ChatHandler::HandleSendMessageCommand(const char* args)
{
///- Get the command line arguments
- char* name_str = strtok((char*)args, " ");
- char* msg_str = strtok(NULL, "");
-
- if(!name_str || !msg_str)
+ std::string name = extractPlayerNameFromLink((char*)args);
+ if(name.empty())
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
return false;
+ }
- std::string name = name_str;
-
- if(!normalizePlayerName(name))
+ char* msg_str = strtok(NULL, "");
+ if(!msg_str)
return false;
///- Find the player and check that he is not logging out.
@@ -7107,7 +7293,8 @@ bool ChatHandler::HandleSendMessageCommand(const char* args)
rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
//Confirmation message
- PSendSysMessage(LANG_SENDMESSAGE,name.c_str(),msg_str);
+ std::string nameLink = playerLink(name);
+ PSendSysMessage(LANG_SENDMESSAGE,nameLink.c_str(),msg_str);
return true;
}
@@ -7131,30 +7318,27 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
return false;
}
+ PlayerInfo const* info = objmgr.GetPlayerInfo(player->getRace(), player->getClass());
+ if(!info)
+ return false;
+
char const* gender_str = (char*)args;
int gender_len = strlen(gender_str);
- uint32 displayId = player->GetNativeDisplayId();
- char const* gender_full = NULL;
- uint32 new_displayId = displayId;
Gender gender;
- if(!strncmp(gender_str,"male",gender_len)) // MALE
+ if(!strncmp(gender_str, "male", gender_len)) // MALE
{
if(player->getGender() == GENDER_MALE)
return true;
- gender_full = "male";
- new_displayId = player->getRace() == RACE_BLOODELF ? displayId+1 : displayId-1;
gender = GENDER_MALE;
}
- else if (!strncmp(gender_str,"female",gender_len)) // FEMALE
+ else if (!strncmp(gender_str, "female", gender_len)) // FEMALE
{
if(player->getGender() == GENDER_FEMALE)
return true;
- gender_full = "female";
- new_displayId = player->getRace() == RACE_BLOODELF ? displayId-1 : displayId+1;
gender = GENDER_FEMALE;
}
else
@@ -7169,12 +7353,16 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
player->SetByteValue(PLAYER_BYTES_3, 0, gender);
// Change display ID
- player->SetDisplayId(new_displayId);
- player->SetNativeDisplayId(new_displayId);
+ player->SetDisplayId(gender ? info->displayId_f : info->displayId_m);
+ player->SetNativeDisplayId(gender ? info->displayId_f : info->displayId_m);
+
+ char const* gender_full = gender ? "female" : "male";
+
+ PSendSysMessage(LANG_YOU_CHANGE_GENDER, GetNameLink(player).c_str(), gender_full);
- PSendSysMessage(LANG_YOU_CHANGE_GENDER, player->GetName(),gender_full);
if (needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full,GetName());
+ ChatHandler(player).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, GetNameLink().c_str());
+
return true;
}
@@ -7262,26 +7450,10 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
}
}
- //stop movement and disable spells
- uint32 spellID = 9454;
//m_session->GetPlayer()->CastSpell(player,spellID,false);
- SpellEntry const *spellInfo = sSpellStore.LookupEntry( spellID );
- if(spellInfo) //TODO: Change the duration of the aura to -1 instead of 5000000
- {
- for(uint32 i = 0;i<3;i++)
- {
- uint8 eff = spellInfo->Effect[i];
- if (eff>=TOTAL_SPELL_EFFECTS)
- continue;
- if( eff == SPELL_EFFECT_APPLY_AREA_AURA_PARTY || eff == SPELL_EFFECT_APPLY_AURA ||
- eff == SPELL_EFFECT_PERSISTENT_AREA_AURA || eff == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
- eff == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
- {
- Aura *Aur = CreateAura(spellInfo, i, NULL, player);
- player->AddAura(Aur);
- }
- }
- }
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry( 9454 );
+ Aura *Aur = new Aura(spellInfo, 1, NULL, player);
+ player->AddAura(Aur);
//save player
player->SaveToDB();
@@ -7320,8 +7492,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
player->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//allow movement and spells
- uint32 spellID = 9454;
- player->RemoveAurasDueToSpell(spellID);
+ player->RemoveAurasDueToSpell(9454);
//save player
player->SaveToDB();
@@ -7437,9 +7608,9 @@ bool ChatHandler::HandleUnPossessCommand(const char* args)
Unit* pUnit = getSelectedUnit();
if(!pUnit) pUnit = m_session->GetPlayer();
- pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
- pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
- pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
+ pUnit->RemoveAurasByType(SPELL_AURA_MOD_CHARM);
+ pUnit->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET);
+ pUnit->RemoveAurasByType(SPELL_AURA_MOD_POSSESS);
return true;
}
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp
index 6ca7ae1c535..6aded9b1f97 100644
--- a/src/game/LootHandler.cpp
+++ b/src/game/LootHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -154,6 +154,7 @@ void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
--loot->unlootedCount;
player->SendNewItem(newitem, uint32(item->count), false, false, true);
+ player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count);
}
else
player->SendEquipError( msg, NULL, NULL );
@@ -233,6 +234,7 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
for (std::vector<Player*>::iterator i = playersNear.begin(); i != playersNear.end(); ++i)
{
(*i)->ModifyMoney( money_per_player );
+ (*i)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, money_per_player);
//Offset surely incorrect, but works
WorldPacket data( SMSG_LOOT_MONEY_NOTIFY, 4 );
data << uint32(money_per_player);
@@ -240,7 +242,10 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
}
}
else
+ {
player->ModifyMoney( pLoot->gold );
+ player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, pLoot->gold);
+ }
pLoot->gold = 0;
pLoot->NotifyMoneyRemoved();
}
@@ -326,7 +331,7 @@ void WorldSession::DoLootRelease( uint64 lguid )
int32 ReqValue = 175;
LockEntry const *lockInfo = sLockStore.LookupEntry(go->GetGOInfo()->chest.lockId);
if(lockInfo)
- ReqValue = lockInfo->requiredminingskill;
+ ReqValue = lockInfo->Skill[0];
float skill = float(player->GetSkillValue(SKILL_MINING))/(ReqValue+25);
double chance = pow(0.8*chance_rate,4*(1/double(max_amount))*double(uses));
if(roll_chance_f(100*chance+skill))
@@ -383,14 +388,22 @@ void WorldSession::DoLootRelease( uint64 lguid )
Item *pItem = player->GetItemByGuid(lguid );
if(!pItem)
return;
- if( (pItem->GetProto()->BagFamily & BAG_FAMILY_MASK_MINING_SUPP) &&
- pItem->GetProto()->Class == ITEM_CLASS_TRADE_GOODS &&
- pItem->GetCount() >= 5)
+
+ ItemPrototype const* proto = pItem->GetProto();
+
+ // destroy only 5 items from stack in case prospecting and milling
+ if( (proto->BagFamily & (BAG_FAMILY_MASK_MINING_SUPP|BAG_FAMILY_MASK_HERBS)) &&
+ proto->Class == ITEM_CLASS_TRADE_GOODS)
{
pItem->m_lootGenerated = false;
pItem->loot.clear();
- uint32 count = 5;
+ uint32 count = pItem->GetCount();
+
+ // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks.
+ if(count > 5)
+ count = 5;
+
player->DestroyItemCount(pItem, count, true);
}
else
@@ -477,7 +490,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
if (slotid > pLoot->items.size())
{
- sLog.outDebug("AutoLootItem: Player %s might be using a hack! (slot %d, size %d)",GetPlayer()->GetName(), slotid, pLoot->items.size());
+ sLog.outDebug("AutoLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size());
return;
}
@@ -495,6 +508,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
// not move item from loot to target inventory
Item * newitem = target->StoreNewItem( dest, item.itemid, true, item.randomPropertyId );
target->SendNewItem(newitem, uint32(item.count), false, false, true );
+ target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count);
// mark as looted
item.count=0;
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index c8511c3deeb..a3dd4167be2 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
#include "World.h"
#include "Util.h"
#include "SharedDefines.h"
+#include "SpellMgr.h"
static Rates const qualityToRate[MAX_ITEM_QUALITY] = {
RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR
@@ -36,16 +37,18 @@ static Rates const qualityToRate[MAX_ITEM_QUALITY] = {
RATE_DROP_ITEM_ARTIFACT, // ITEM_QUALITY_ARTIFACT
};
-LootStore LootTemplates_Creature( "creature_loot_template", "creature entry");
-LootStore LootTemplates_Disenchant( "disenchant_loot_template", "item disenchant id");
-LootStore LootTemplates_Fishing( "fishing_loot_template", "area id");
-LootStore LootTemplates_Gameobject( "gameobject_loot_template", "gameobject entry");
-LootStore LootTemplates_Item( "item_loot_template", "item entry");
-LootStore LootTemplates_Pickpocketing("pickpocketing_loot_template","creature pickpocket lootid");
-LootStore LootTemplates_Prospecting( "prospecting_loot_template", "item entry");
-LootStore LootTemplates_QuestMail( "quest_mail_loot_template", "quest id");
-LootStore LootTemplates_Reference( "reference_loot_template", "reference id");
-LootStore LootTemplates_Skinning( "skinning_loot_template", "creature skinning id");
+LootStore LootTemplates_Creature( "creature_loot_template", "creature entry", true);
+LootStore LootTemplates_Disenchant( "disenchant_loot_template", "item disenchant id", true);
+LootStore LootTemplates_Fishing( "fishing_loot_template", "area id", true);
+LootStore LootTemplates_Gameobject( "gameobject_loot_template", "gameobject entry", true);
+LootStore LootTemplates_Item( "item_loot_template", "item entry", true);
+LootStore LootTemplates_Milling( "milling_loot_template", "item entry (herb)", true);
+LootStore LootTemplates_Pickpocketing("pickpocketing_loot_template","creature pickpocket lootid", true);
+LootStore LootTemplates_Prospecting( "prospecting_loot_template", "item entry (ore)", true);
+LootStore LootTemplates_QuestMail( "quest_mail_loot_template", "quest id (with mail template)",false);
+LootStore LootTemplates_Reference( "reference_loot_template", "reference id", false);
+LootStore LootTemplates_Skinning( "skinning_loot_template", "creature skinning id", true);
+LootStore LootTemplates_Spell( "spell_loot_template", "spell id (explicitly discovering ability)",false);
class LootTemplate::LootGroup // A set of loot definitions for items (refs are not allowed)
@@ -114,11 +117,18 @@ void LootStore::LoadLootTable()
float chanceOrQuestChance = fields[2].GetFloat();
uint8 group = fields[3].GetUInt8();
int32 mincountOrRef = fields[4].GetInt32();
- uint8 maxcount = fields[5].GetUInt8();
+ uint32 maxcount = fields[5].GetUInt32();
ConditionType condition = (ConditionType)fields[6].GetUInt8();
uint32 cond_value1 = fields[7].GetUInt32();
uint32 cond_value2 = fields[8].GetUInt32();
+ if(maxcount > std::numeric_limits<uint8>::max())
+ {
+ sLog.outErrorDb("Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount,std::numeric_limits<uint8>::max());
+ continue; // error already printed to log/console.
+ }
+
+
if(!PlayerCondition::IsValid(condition,cond_value1, cond_value2))
{
sLog.outErrorDb("... in table '%s' entry %u item %u", GetName(), entry, item);
@@ -159,7 +169,7 @@ void LootStore::LoadLootTable()
Verify(); // Checks validity of the loot store
sLog.outString();
- sLog.outString( ">> Loaded %u loot definitions (%d templates)", count, m_LootTemplates.size());
+ sLog.outString( ">> Loaded %u loot definitions (%lu templates)", count, (unsigned long)m_LootTemplates.size());
}
else
{
@@ -230,17 +240,17 @@ void LootStore::ReportNotExistedId(uint32 id) const
// Checks if the entry (quest, non-quest, reference) takes it's chance (at loot generation)
// RATE_DROP_ITEMS is no longer used for all types of entries
-bool LootStoreItem::Roll() const
+bool LootStoreItem::Roll(bool rate) const
{
if(chance>=100.f)
return true;
if(mincountOrRef < 0) // reference case
- return roll_chance_f(chance*sWorld.getRate(RATE_DROP_ITEM_REFERENCED));
+ return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
- float qualityModifier = pProto ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f;
+ float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f;
return roll_chance_f(chance*qualityModifier);
}
@@ -248,6 +258,12 @@ bool LootStoreItem::Roll() const
// Checks correctness of values
bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
{
+ if(group >= 1 << 7) // it stored in 7 bit field
+ {
+ sLog.outErrorDb("Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
+ return false;
+ }
+
if (mincountOrRef == 0)
{
sLog.outErrorDb("Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
@@ -275,6 +291,13 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
store.GetName(), entry, itemid, chance);
return false;
}
+
+ if( maxcount < mincountOrRef) // wrong max count
+ {
+ sLog.outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, uint32(maxcount), mincountOrRef);
+ return false;
+ }
+
}
else // mincountOrRef < 0
{
@@ -366,8 +389,12 @@ void Loot::AddItem(LootStoreItem const & item)
}
// Calls processor of corresponding LootTemplate (which handles everything including references)
-void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner)
+void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal)
{
+ // Must be provided
+ if(!loot_owner)
+ return;
+
LootTemplate const* tab = store.GetLootFor(loot_id);
if (!tab)
@@ -379,37 +406,36 @@ void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner)
items.reserve(MAX_NR_LOOT_ITEMS);
quest_items.reserve(MAX_NR_QUEST_ITEMS);
- tab->Process(*this, store); // Processing is done there, callback via Loot::AddItem()
+ tab->Process(*this, store,store.IsRatesAllowed ()); // Processing is done there, callback via Loot::AddItem()
- // Setting access rights fow group-looting case
- if(!loot_owner)
- return;
+ // Setting access rights for group loot case
Group * pGroup=loot_owner->GetGroup();
- if(!pGroup)
- return;
- for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ if(!personal && pGroup)
{
- //fill the quest item map for every player in the recipient's group
- Player* pl = itr->getSource();
- if(!pl)
- continue;
- uint32 plguid = pl->GetGUIDLow();
- QuestItemMap::iterator qmapitr = PlayerQuestItems.find(plguid);
- if (qmapitr == PlayerQuestItems.end())
- {
- FillQuestLoot(pl);
- }
- qmapitr = PlayerFFAItems.find(plguid);
- if (qmapitr == PlayerFFAItems.end())
- {
- FillFFALoot(pl);
- }
- qmapitr = PlayerNonQuestNonFFAConditionalItems.find(plguid);
- if (qmapitr == PlayerNonQuestNonFFAConditionalItems.end())
- {
- FillNonQuestNonFFAConditionalLoot(pl);
- }
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ if(Player* pl = itr->getSource())
+ FillNotNormalLootFor(pl);
}
+ // ... for personal loot
+ else
+ FillNotNormalLootFor(loot_owner);
+}
+
+void Loot::FillNotNormalLootFor(Player* pl)
+{
+ uint32 plguid = pl->GetGUIDLow();
+
+ QuestItemMap::iterator qmapitr = PlayerQuestItems.find(plguid);
+ if (qmapitr == PlayerQuestItems.end())
+ FillQuestLoot(pl);
+
+ qmapitr = PlayerFFAItems.find(plguid);
+ if (qmapitr == PlayerFFAItems.end())
+ FillFFALoot(pl);
+
+ qmapitr = PlayerNonQuestNonFFAConditionalItems.find(plguid);
+ if (qmapitr == PlayerNonQuestNonFFAConditionalItems.end())
+ FillNonQuestNonFFAConditionalLoot(pl);
}
QuestItemList* Loot::FillFFALoot(Player* player)
@@ -640,6 +666,12 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem **qite
return item;
}
+uint32 Loot::GetMaxSlotInLootFor(Player* player) const
+{
+ QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUIDLow());
+ return items.size() + (itr != PlayerQuestItems.end() ? itr->second->size() : 0);
+}
+
ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
{
b << uint32(li.itemid);
@@ -653,12 +685,19 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li)
ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
{
+ if (lv.permission == NONE_PERMISSION)
+ {
+ b << uint32(0); //gold
+ b << uint8(0); // item count
+ return b; // nothing output more
+ }
+
Loot &l = lv.loot;
uint8 itemsShown = 0;
//gold
- b << uint32(lv.permission!=NONE_PERMISSION ? l.gold : 0);
+ b << uint32(l.gold);
size_t count_pos = b.wpos(); // pos of item count byte
b << uint8(0); // item count placeholder
@@ -697,19 +736,21 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
break;
}
- case NONE_PERMISSION:
default:
return b; // nothing output more
}
- if (lv.qlist)
+ QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
+ QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUIDLow());
+ if (q_itr != lootPlayerQuestItems.end())
{
- for (QuestItemList::iterator qi = lv.qlist->begin() ; qi != lv.qlist->end(); ++qi)
+ QuestItemList *q_list = q_itr->second;
+ for (QuestItemList::iterator qi = q_list->begin() ; qi != q_list->end(); ++qi)
{
LootItem &item = l.quest_items[qi->index];
if (!qi->is_looted && !item.is_looted)
{
- b << uint8(l.items.size() + (qi - lv.qlist->begin()));
+ b << uint8(l.items.size() + (qi - q_list->begin()));
b << item;
b << uint8(0); // allow loot
++itemsShown;
@@ -717,9 +758,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
}
- if (lv.ffalist)
+ QuestItemMap const& lootPlayerFFAItems = l.GetPlayerFFAItems();
+ QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUIDLow());
+ if (ffa_itr != lootPlayerFFAItems.end())
{
- for (QuestItemList::iterator fi = lv.ffalist->begin() ; fi != lv.ffalist->end(); ++fi)
+ QuestItemList *ffa_list = ffa_itr->second;
+ for (QuestItemList::iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi)
{
LootItem &item = l.items[fi->index];
if (!fi->is_looted && !item.is_looted)
@@ -731,9 +775,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
}
- if (lv.conditionallist)
+ QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = l.GetPlayerNonQuestNonFFAConditionalItems();
+ QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUIDLow());
+ if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
- for (QuestItemList::iterator ci = lv.conditionallist->begin() ; ci != lv.conditionallist->end(); ++ci)
+ QuestItemList *conditional_list = nn_itr->second;
+ for (QuestItemList::iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci)
{
LootItem &item = l.items[ci->index];
if (!ci->is_looted && !item.is_looted)
@@ -776,7 +823,6 @@ LootStoreItem const * LootTemplate::LootGroup::Roll() const
if(ExplicitlyChanced[i].chance>=100.f)
return &ExplicitlyChanced[i];
- ItemPrototype const *pProto = objmgr.GetItemPrototype(ExplicitlyChanced[i].itemid);
Roll -= ExplicitlyChanced[i].chance;
if (Roll < 0)
return &ExplicitlyChanced[i];
@@ -900,7 +946,7 @@ void LootTemplate::AddEntry(LootStoreItem& item)
}
// Rolls for every item in the template and adds the rolled items the the loot
-void LootTemplate::Process(Loot& loot, LootStore const& store, uint8 groupId) const
+void LootTemplate::Process(Loot& loot, LootStore const& store, bool rate, uint8 groupId) const
{
if (groupId) // Group reference uses own processing of the group
{
@@ -914,7 +960,7 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, uint8 groupId) co
// Rolling non-grouped items
for (LootStoreItemList::const_iterator i = Entries.begin() ; i != Entries.end() ; ++i )
{
- if ( !i->Roll() )
+ if (!i->Roll(rate))
continue; // Bad luck for the entry
if (i->mincountOrRef < 0) // References processing
@@ -925,7 +971,7 @@ void LootTemplate::Process(Loot& loot, LootStore const& store, uint8 groupId) co
continue; // Error message already printed at loading stage
for (uint32 loop=0; loop < i->maxcount; ++loop )// Ref multiplicator
- Referenced->Process(loot, store, i->group); // Ref processing
+ Referenced->Process(loot, store, rate, i->group);
}
else // Plain entries (not a reference, not grouped)
loot.AddItem(*i); // Chance is already checked, just add
@@ -995,7 +1041,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co
// Now checking groups
for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i )
- if (i->HasQuestDrop())
+ if (i->HasQuestDropForPlayer(player))
return true;
return false;
@@ -1137,6 +1183,29 @@ void LoadLootTemplates_Item()
LootTemplates_Item.ReportUnusedIds(ids_set);
}
+void LoadLootTemplates_Milling()
+{
+ LootIdSet ids_set;
+ LootTemplates_Milling.LoadAndCollectLootIds(ids_set);
+
+ // remove real entries and check existence loot
+ for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
+ {
+ ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
+ if(!proto)
+ continue;
+
+ if((proto->BagFamily & BAG_FAMILY_MASK_HERBS)==0)
+ continue;
+
+ if(ids_set.count(proto->ItemId))
+ ids_set.erase(proto->ItemId);
+ }
+
+ // output error for any still listed (not referenced from appropriate table) ids
+ LootTemplates_Milling.ReportUnusedIds(ids_set);
+}
+
void LoadLootTemplates_Pickpocketing()
{
LootIdSet ids_set, ids_setUsed;
@@ -1170,9 +1239,17 @@ void LoadLootTemplates_Prospecting()
// remove real entries and check existence loot
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
- if(ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
- if(ids_set.count(proto->ItemId))
- ids_set.erase(proto->ItemId);
+ {
+ ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
+ if(!proto)
+ continue;
+
+ if((proto->BagFamily & BAG_FAMILY_MASK_MINING_SUPP)==0)
+ continue;
+
+ if(ids_set.count(proto->ItemId))
+ ids_set.erase(proto->ItemId);
+ }
// output error for any still listed (not referenced from appropriate table) ids
LootTemplates_Prospecting.ReportUnusedIds(ids_set);
@@ -1186,8 +1263,17 @@ void LoadLootTemplates_QuestMail()
// remove real entries and check existence loot
ObjectMgr::QuestMap const& questMap = objmgr.GetQuestTemplates();
for(ObjectMgr::QuestMap::const_iterator itr = questMap.begin(); itr != questMap.end(); ++itr )
+ {
+ if(!itr->second->GetRewMailTemplateId())
+ continue;
+
if(ids_set.count(itr->first))
ids_set.erase(itr->first);
+ /* disabled reporting: some quest mails not include items
+ else
+ LootTemplates_QuestMail.ReportNotExistedId(itr->first);
+ */
+ }
// output error for any still listed (not referenced from appropriate table) ids
LootTemplates_QuestMail.ReportUnusedIds(ids_set);
@@ -1219,6 +1305,37 @@ void LoadLootTemplates_Skinning()
LootTemplates_Skinning.ReportUnusedIds(ids_set);
}
+void LoadLootTemplates_Spell()
+{
+ LootIdSet ids_set;
+ LootTemplates_Spell.LoadAndCollectLootIds(ids_set);
+
+ // remove real entries and check existence loot
+ for(uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id)
+ {
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry (spell_id);
+ if(!spellInfo)
+ continue;
+
+ // possible cases
+ if( !IsLootCraftingSpell(spellInfo))
+ continue;
+
+ if(!ids_set.count(spell_id))
+ {
+ // not report about not trainable spells (optionally supported by DB) except with SPELL_ATTR_EX2_UNK14 (clams)
+ // 61756 (Northrend Inscription Research (FAST QA VERSION) for example
+ if ((spellInfo->Attributes & SPELL_ATTR_UNK5) || (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK14))
+ LootTemplates_Spell.ReportNotExistedId(spell_id);
+ }
+ else
+ ids_set.erase(spell_id);
+ }
+
+ // output error for any still listed (not referenced from appropriate table) ids
+ LootTemplates_QuestMail.ReportUnusedIds(ids_set);
+}
+
void LoadLootTemplates_Reference()
{
LootIdSet ids_set;
@@ -1229,6 +1346,7 @@ void LoadLootTemplates_Reference()
LootTemplates_Fishing.CheckLootRefs(&ids_set);
LootTemplates_Gameobject.CheckLootRefs(&ids_set);
LootTemplates_Item.CheckLootRefs(&ids_set);
+ LootTemplates_Milling.CheckLootRefs(&ids_set);
LootTemplates_Pickpocketing.CheckLootRefs(&ids_set);
LootTemplates_Skinning.CheckLootRefs(&ids_set);
LootTemplates_Disenchant.CheckLootRefs(&ids_set);
diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h
index 8c64531bf4a..79d292cf8d4 100644
--- a/src/game/LootMgr.h
+++ b/src/game/LootMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,19 +65,19 @@ struct LootStoreItem
uint32 itemid; // id of the item
float chance; // always positive, chance to drop for both quest and non-quest items, chance to be used for refs
int32 mincountOrRef; // mincount for drop items (positive) or minus referenced TemplateleId (negative)
- uint8 group :8;
+ uint8 group :7;
+ bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB)
uint8 maxcount :8; // max drop count for the item (mincountOrRef positive) or Ref multiplicator (mincountOrRef negative)
uint16 conditionId :16; // additional loot condition Id
- bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB)
// Constructor, converting ChanceOrQuestChance -> (chance, needs_quest)
// displayid is filled in IsValid() which must be called after
LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, int8 _group, uint8 _conditionId, int32 _mincountOrRef, uint8 _maxcount)
: itemid(_itemid), chance(fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef),
- group(_group), maxcount(_maxcount), conditionId(_conditionId),
- needs_quest(_chanceOrQuestChance < 0) {}
+ group(_group), needs_quest(_chanceOrQuestChance < 0), maxcount(_maxcount), conditionId(_conditionId)
+ {}
- bool Roll() const; // Checks if the entry takes it's chance (at loot generation)
+ bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation)
bool IsValid(LootStore const& store, uint32 entry) const;
// Checks correctness of values
};
@@ -129,7 +129,8 @@ typedef std::set<uint32> LootIdSet;
class LootStore
{
public:
- explicit LootStore(char const* name, char const* entryName) : m_name(name), m_entryName(entryName) {}
+ explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
+ : m_name(name), m_entryName(entryName), m_ratesAllowed(ratesAllowed) {}
virtual ~LootStore() { Clear(); }
void Verify() const;
@@ -147,6 +148,7 @@ class LootStore
char const* GetName() const { return m_name; }
char const* GetEntryName() const { return m_entryName; }
+ bool IsRatesAllowed() const { return m_ratesAllowed; }
protected:
void LoadLootTable();
void Clear();
@@ -154,6 +156,7 @@ class LootStore
LootTemplateMap m_LootTemplates;
char const* m_name;
char const* m_entryName;
+ bool m_ratesAllowed;
};
class LootTemplate
@@ -165,7 +168,7 @@ class LootTemplate
// Adds an entry to the group (at loading stage)
void AddEntry(LootStoreItem& item);
// Rolls for every item in the template and adds the rolled items the the loot
- void Process(Loot& loot, LootStore const& store, uint8 GroupId = 0) const;
+ void Process(Loot& loot, LootStore const& store, bool rate, uint8 GroupId = 0) const;
// True if template includes at least 1 quest drop entry
bool HasQuestDrop(LootTemplateMap const& store, uint8 GroupId = 0) const;
@@ -207,19 +210,20 @@ class LootValidatorRefManager : public RefManager<Loot, LootValidatorRef>
};
//=====================================================
+struct LootView;
+
+ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li);
+ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
struct Loot
{
+ friend ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
+
QuestItemMap const& GetPlayerQuestItems() const { return PlayerQuestItems; }
QuestItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
- QuestItemList* FillFFALoot(Player* player);
- QuestItemList* FillQuestLoot(Player* player);
- QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player);
-
std::vector<LootItem> items;
- std::vector<LootItem> quest_items;
uint32 gold;
uint8 unlootedCount;
@@ -235,18 +239,19 @@ struct Loot
// void clear();
void clear()
{
- items.clear(); gold = 0; PlayersLooting.clear();
for (QuestItemMap::iterator itr = PlayerQuestItems.begin(); itr != PlayerQuestItems.end(); ++itr)
delete itr->second;
+ PlayerQuestItems.clear();
+
for (QuestItemMap::iterator itr = PlayerFFAItems.begin(); itr != PlayerFFAItems.end(); ++itr)
delete itr->second;
+ PlayerFFAItems.clear();
+
for (QuestItemMap::iterator itr = PlayerNonQuestNonFFAConditionalItems.begin(); itr != PlayerNonQuestNonFFAConditionalItems.end(); ++itr)
delete itr->second;
-
- PlayerQuestItems.clear();
- PlayerFFAItems.clear();
PlayerNonQuestNonFFAConditionalItems.clear();
+ PlayersLooting.clear();
items.clear();
quest_items.clear();
gold = 0;
@@ -264,13 +269,21 @@ struct Loot
void RemoveLooter(uint64 GUID) { PlayersLooting.erase(GUID); }
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount);
- void FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner);
+ void FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, bool personal);
// Inserts the item into the loot (called by LootTemplate processors)
void AddItem(LootStoreItem const & item);
LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = NULL, QuestItem** ffaitem = NULL, QuestItem** conditem = NULL);
+ uint32 GetMaxSlotInLootFor(Player* player) const;
+
private:
+ void FillNotNormalLootFor(Player* player);
+ QuestItemList* FillFFALoot(Player* player);
+ QuestItemList* FillQuestLoot(Player* player);
+ QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player);
+
+ std::vector<LootItem> quest_items;
std::set<uint64> PlayersLooting;
QuestItemMap PlayerQuestItems;
QuestItemMap PlayerFFAItems;
@@ -278,40 +291,41 @@ struct Loot
// All rolls are registered here. They need to know, when the loot is not valid anymore
LootValidatorRefManager i_LootValidatorRefManager;
-
};
struct LootView
{
Loot &loot;
- QuestItemList *qlist;
- QuestItemList *ffalist;
- QuestItemList *conditionallist;
Player *viewer;
PermissionTypes permission;
- LootView(Loot &_loot, QuestItemList *_qlist, QuestItemList *_ffalist, QuestItemList *_conditionallist, Player *_viewer,PermissionTypes _permission = ALL_PERMISSION)
- : loot(_loot), qlist(_qlist), ffalist(_ffalist), conditionallist(_conditionallist), viewer(_viewer), permission(_permission) {}
+ LootView(Loot &_loot, Player *_viewer,PermissionTypes _permission = ALL_PERMISSION)
+ : 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_Milling;
extern LootStore LootTemplates_Pickpocketing;
extern LootStore LootTemplates_Skinning;
extern LootStore LootTemplates_Disenchant;
extern LootStore LootTemplates_Prospecting;
extern LootStore LootTemplates_QuestMail;
+extern LootStore LootTemplates_Spell;
void LoadLootTemplates_Creature();
void LoadLootTemplates_Fishing();
void LoadLootTemplates_Gameobject();
void LoadLootTemplates_Item();
+void LoadLootTemplates_Milling();
void LoadLootTemplates_Pickpocketing();
void LoadLootTemplates_Skinning();
void LoadLootTemplates_Disenchant();
void LoadLootTemplates_Prospecting();
void LoadLootTemplates_QuestMail();
+
+void LoadLootTemplates_Spell();
void LoadLootTemplates_Reference();
inline void LoadLootTables()
@@ -320,15 +334,16 @@ inline void LoadLootTables()
LoadLootTemplates_Fishing();
LoadLootTemplates_Gameobject();
LoadLootTemplates_Item();
+ LoadLootTemplates_Milling();
LoadLootTemplates_Pickpocketing();
LoadLootTemplates_Skinning();
LoadLootTemplates_Disenchant();
LoadLootTemplates_Prospecting();
LoadLootTemplates_QuestMail();
+ LoadLootTemplates_Spell();
+
LoadLootTemplates_Reference();
}
-ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li);
-ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
#endif
diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp
index 5698fdf03f2..97a684a2700 100644
--- a/src/game/Mail.cpp
+++ b/src/game/Mail.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,8 +29,8 @@
#include "UpdateMask.h"
#include "Unit.h"
#include "Language.h"
-#include "Database/DBCStores.h"
#include "AuctionHouseBot.h"
+#include "DBCStores.h"
void MailItem::deleteItem( bool inDB )
{
@@ -55,6 +55,9 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
recv_data >> mailbox;
recv_data >> receiver;
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
// recheck
CHECK_PACKET_SIZE(recv_data, 8+(receiver.size()+1)+1+1+4+4+1+4+4+8+1);
@@ -125,9 +128,9 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
return;
}
- uint32 reqmoney = money + 30;
- if (items_count)
- reqmoney = money + (30 * items_count);
+ uint32 cost = items_count ? 30 * items_count : 30; // price hardcoded in client
+
+ uint32 reqmoney = cost + money;
if (pl->GetMoney() < reqmoney)
{
@@ -210,6 +213,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
}
pl->ModifyMoney( -int32(reqmoney) );
+ pl->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost);
bool needItemDelay = false;
@@ -276,6 +280,10 @@ void WorldSession::HandleMarkAsRead(WorldPacket & recv_data )
uint64 mailbox;
uint32 mailId;
recv_data >> mailbox;
+
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
recv_data >> mailId;
Player *pl = _player;
Mail *m = pl->GetMail(mailId);
@@ -299,6 +307,10 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data )
uint32 mailId;
recv_data >> mailbox;
recv_data >> mailId;
+
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
Player* pl = _player;
pl->m_mailsUpdated = true;
Mail *m = pl->GetMail(mailId);
@@ -314,6 +326,10 @@ void WorldSession::HandleReturnToSender(WorldPacket & recv_data )
uint64 mailbox;
uint32 mailId;
recv_data >> mailbox;
+
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
recv_data >> mailId;
Player *pl = _player;
Mail *m = pl->GetMail(mailId);
@@ -418,6 +434,10 @@ void WorldSession::HandleTakeItem(WorldPacket & recv_data )
uint32 mailId;
uint32 itemId;
recv_data >> mailbox;
+
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
recv_data >> mailId;
recv_data >> itemId; // item guid low?
Player* pl = _player;
@@ -509,6 +529,10 @@ void WorldSession::HandleTakeMoney(WorldPacket & recv_data )
uint32 mailId;
recv_data >> mailbox;
recv_data >> mailId;
+
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
Player *pl = _player;
Mail* m = pl->GetMail(mailId);
@@ -540,9 +564,8 @@ void WorldSession::HandleGetMail(WorldPacket & recv_data )
uint64 mailbox;
recv_data >> mailbox;
- //GameObject* obj = ObjectAccessor::GetGameObject(_player, mailbox);
- //if(!obj || !obj->IsMailBox())
- // return;
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
Player* pl = _player;
@@ -601,7 +624,7 @@ void WorldSession::HandleGetMail(WorldPacket & recv_data )
data << (uint32) (*itr)->mailTemplateId; // mail template (MailTemplate.dbc)
data << (*itr)->subject; // Subject string - once 00, when mail type = 3
- data << (uint8) item_count;
+ data << (uint8) item_count; // client limit is 0x10
for(uint8 i = 0; i < item_count; ++i)
{
@@ -612,7 +635,7 @@ void WorldSession::HandleGetMail(WorldPacket & recv_data )
data << (uint32) (item ? item->GetGUIDLow() : 0);
// entry
data << (uint32) (item ? item->GetEntry() : 0);
- for(uint8 j = 0; j < 6; ++j)
+ for(uint8 j = 0; j < MAX_INSPECTED_ENCHANTMENT_SLOT; ++j)
{
// unsure
data << (uint32) (item ? item->GetEnchantmentCharges((EnchantmentSlot)j) : 0);
@@ -626,13 +649,15 @@ void WorldSession::HandleGetMail(WorldPacket & recv_data )
// unk
data << (uint32) (item ? item->GetItemSuffixFactor() : 0);
// stack count
- data << (uint8) (item ? item->GetCount() : 0);
+ data << (uint32) (item ? item->GetCount() : 0);
// charges
data << (uint32) (item ? item->GetSpellCharges() : 0);
// durability
data << (uint32) (item ? item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY) : 0);
// durability
data << (uint32) (item ? item->GetUInt32Value(ITEM_FIELD_DURABILITY) : 0);
+ // unknown wotlk
+ data << (uint8) 0;
}
mails_count += 1;
@@ -676,6 +701,9 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
recv_data >> mailbox >> mailId;
+ if (!objmgr.IsGameObjectOfTypeInRange(_player, mailbox, GAMEOBJECT_TYPE_MAILBOX))
+ return;
+
Player *pl = _player;
Mail* m = pl->GetMail(mailId);
diff --git a/src/game/Mail.h b/src/game/Mail.h
index 784028e6d5d..acf0d9346fe 100644
--- a/src/game/Mail.h
+++ b/src/game/Mail.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Makefile.am b/src/game/Makefile.am
new file mode 100644
index 00000000000..47c072a1188
--- /dev/null
+++ b/src/game/Makefile.am
@@ -0,0 +1,847 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../shared/vmap -I$(srcdir)/../realmd -DSYSCONFDIR=\"$(sysconfdir)/\"
+
+## Build MaNGOS game library as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosgame.a
+
+# libmangossgame library will later be reused by ...
+libmangosgame_a_SOURCES = \
+<<<<<<< HEAD:src/game/Makefile.am
+<<<<<<< HEAD:src/game/Makefile.am
+ AccountMgr.cpp \
+ AccountMgr.h \
+ AchievementMgr.h \
+ AchievementMgr.cpp \
+ AddonHandler.cpp \
+ AddonHandler.h \
+ AggressorAI.cpp \
+ AggressorAI.h \
+ AnimalRandomMovementGenerator.h \
+ ArenaTeam.cpp \
+ ArenaTeam.h \
+ ArenaTeamHandler.cpp \
+ AuctionHouseBot.cpp \
+ AuctionHouseBot.h \
+ AuctionHouseHandler.cpp \
+ AuctionHouseMgr.cpp \
+ AuctionHouseMgr.h \
+ Bag.cpp \
+ Bag.h \
+ BattleGround.cpp \
+ BattleGroundAA.cpp \
+ BattleGroundAB.cpp \
+ BattleGroundAV.cpp \
+ BattleGroundBE.cpp \
+ BattleGroundDS.cpp \
+ BattleGroundEY.cpp \
+ BattleGroundNA.cpp \
+ BattleGroundRL.cpp \
+ BattleGroundRV.cpp \
+ BattleGroundSA.cpp \
+ BattleGroundWS.cpp \
+ BattleGround.h \
+ BattleGroundAA.h \
+ BattleGroundAB.h \
+ BattleGroundAV.h \
+ BattleGroundBE.h \
+ BattleGroundDS.h \
+ BattleGroundEY.h \
+ BattleGroundNA.h \
+ BattleGroundRL.h \
+ BattleGroundRV.h \
+ BattleGroundSA.h \
+ BattleGroundWS.h \
+ BattleGroundHandler.cpp \
+ BattleGroundMgr.cpp \
+ BattleGroundMgr.h \
+ Calendar.cpp \
+ Calendar.h \
+ CalendarHandler.cpp \
+ Cell.h \
+ CellImpl.h \
+ Channel.cpp \
+ Channel.h \
+ ChannelHandler.cpp \
+ ChannelMgr.h \
+ CharacterHandler.cpp \
+ Chat.cpp \
+ Chat.h \
+ ChatHandler.cpp \
+ CombatHandler.cpp \
+ ConfusedMovementGenerator.cpp \
+ ConfusedMovementGenerator.h \
+ Corpse.cpp \
+ Corpse.h \
+ CreatureAI.cpp \
+ CreatureAI.h \
+ CreatureAIImpl.h \
+ CreatureAIRegistry.cpp \
+ CreatureAIRegistry.h \
+ CreatureAISelector.cpp \
+ CreatureAISelector.h \
+ CreatureGroups.cpp \
+ CreatureGroups.h \
+ Creature.cpp \
+ Creature.h \
+ debugcmds.cpp \
+ DestinationHolder.cpp \
+ DestinationHolder.h \
+ DestinationHolderImp.h \
+ DuelHandler.cpp \
+ DynamicObject.cpp \
+ DynamicObject.h \
+ FleeingMovementGenerator.cpp \
+ FleeingMovementGenerator.h \
+ Formulas.h \
+ GameEventMgr.cpp \
+ GameEventMgr.h \
+ GameObject.cpp \
+ GameObject.h \
+ GlobalEvents.cpp \
+ GlobalEvents.h \
+ GossipDef.cpp \
+ GossipDef.h \
+ GridDefines.h \
+ GridNotifiers.cpp \
+ GridNotifiers.h \
+ GridNotifiersImpl.h \
+ GridStates.cpp \
+ GridStates.h \
+ Group.cpp \
+ Group.h \
+ GroupHandler.cpp \
+ GuardAI.cpp \
+ GuardAI.h \
+ Guild.cpp \
+ Guild.h \
+ GuildHandler.cpp \
+ HomeMovementGenerator.cpp \
+ HomeMovementGenerator.h \
+ HostilRefManager.cpp \
+ HostilRefManager.h \
+ IdleMovementGenerator.cpp \
+ IdleMovementGenerator.h \
+ InstanceData.cpp \
+ InstanceData.h \
+ InstanceSaveMgr.cpp \
+ InstanceSaveMgr.h \
+ Item.cpp \
+ Item.h \
+ ItemEnchantmentMgr.cpp \
+ ItemEnchantmentMgr.h \
+ ItemHandler.cpp \
+ ItemPrototype.h \
+ Language.h \
+ Level0.cpp \
+ Level1.cpp \
+ Level2.cpp \
+ Level3.cpp \
+ LFGHandler.cpp \
+ LootHandler.cpp \
+ LootMgr.cpp \
+ LootMgr.h \
+ Mail.cpp \
+ Mail.h \
+ Map.cpp \
+ Map.h \
+ MapInstanced.cpp \
+ MapInstanced.h \
+ MapManager.cpp \
+ MapManager.h \
+ MapReference.h \
+ MapRefManager.h \
+ MiscHandler.cpp \
+ MotionMaster.cpp \
+ MotionMaster.h \
+ MovementGenerator.cpp \
+ MovementGenerator.h \
+ MovementGeneratorImpl.h \
+ MovementHandler.cpp \
+ NPCHandler.cpp \
+ NPCHandler.h \
+ NullCreatureAI.cpp \
+ NullCreatureAI.h \
+ ObjectAccessor.cpp \
+ ObjectAccessor.h \
+ Object.cpp \
+ ObjectDefines.h \
+ ObjectGridLoader.cpp \
+ ObjectGridLoader.h \
+ Object.h \
+ ObjectMgr.cpp \
+ ObjectMgr.h \
+ ObjectPosSelector.cpp \
+ ObjectPosSelector.h \
+ Opcodes.cpp \
+ Opcodes.h \
+ OutdoorPvP.cpp \
+ OutdoorPvP.h \
+ OutdoorPvPEP.cpp \
+ OutdoorPvPEP.h \
+ OutdoorPvPHP.cpp \
+ OutdoorPvPHP.h \
+ OutdoorPvPMgr.cpp \
+ OutdoorPvPMgr.h \
+ OutdoorPvPNA.cpp \
+ OutdoorPvPNA.h \
+ OutdoorPvPObjectiveAI.cpp \
+ OutdoorPvPObjectiveAI.h \
+ OutdoorPvPSI.cpp \
+ OutdoorPvPSI.h \
+ OutdoorPvPTF.cpp \
+ OutdoorPvPTF.h \
+ OutdoorPvPZM.cpp \
+ OutdoorPvPZM.h \
+ Path.h \
+ PetAI.cpp \
+ PetAI.h \
+ Pet.cpp \
+ Pet.h \
+ PetHandler.cpp \
+ PetitionsHandler.cpp \
+ Player.cpp \
+ Player.h \
+ PlayerDump.cpp \
+ PlayerDump.h \
+ PossessedAI.cpp \
+ PossessedAI.h \
+ PointMovementGenerator.cpp \
+ PointMovementGenerator.h \
+ PoolHandler.cpp \
+ PoolHandler.h \
+ QueryHandler.cpp \
+ QuestDef.cpp \
+ QuestDef.h \
+ QuestHandler.cpp \
+ RandomMovementGenerator.cpp \
+ RandomMovementGenerator.h \
+ ReactorAI.cpp \
+ ReactorAI.h \
+ ScriptCalls.cpp \
+ ScriptCalls.h \
+ SharedDefines.h \
+ SkillHandler.cpp \
+ SpellAuraDefines.h \
+ SpellAuras.cpp \
+ SpellAuras.h \
+ Spell.cpp \
+ SpellEffects.cpp \
+ Spell.h \
+ SkillDiscovery.cpp \
+ SkillDiscovery.h \
+ SkillExtraItems.cpp \
+ SkillExtraItems.h \
+ SpellHandler.cpp \
+ SocialMgr.cpp \
+ SocialMgr.h \
+ SpellMgr.cpp \
+ SpellMgr.h \
+ StatSystem.cpp \
+ TargetedMovementGenerator.cpp \
+ TargetedMovementGenerator.h \
+ TaxiHandler.cpp \
+ TemporarySummon.cpp \
+ TemporarySummon.h \
+ TotemAI.cpp \
+ TotemAI.h \
+ Totem.cpp \
+ Totem.h \
+ TradeHandler.cpp \
+ Transports.cpp \
+ Transports.h \
+ ThreatManager.cpp \
+ ThreatManager.h \
+ TicketHandler.cpp \
+ TicketMgr.cpp \
+ TicketMgr.h \
+ Traveller.h \
+ Unit.cpp \
+ Unit.h \
+ UnitEvents.h \
+ UpdateData.cpp \
+ UpdateData.h \
+ UpdateFields.h \
+ UpdateMask.h \
+ Vehicle.cpp \
+ Vehicle.h \
+ VoiceChatHandler.cpp \
+ WaypointManager.cpp \
+ WaypointManager.h \
+ WaypointMovementGenerator.cpp \
+ WaypointMovementGenerator.h \
+ Weather.cpp \
+ Weather.h \
+ World.cpp \
+ World.h \
+ WorldLog.cpp \
+ WorldLog.h \
+ WorldSession.cpp \
+ WorldSession.h \
+ WorldSocket.cpp \
+ WorldSocket.h \
+ WorldSocketMgr.cpp \
+ WorldSocketMgr.h \
+ FollowerReference.cpp \
+ FollowerReference.h \
+ FollowerRefManager.h \
+ GroupReference.cpp \
+ GroupReference.h \
+ GroupRefManager.h
+=======
+ AccountMgr.cpp \
+ AccountMgr.h \
+ AchievementMgr.h \
+ AchievementMgr.cpp \
+ AggressorAI.cpp \
+ AggressorAI.h \
+ AnimalRandomMovementGenerator.h \
+ ArenaTeam.cpp \
+ ArenaTeam.h \
+ ArenaTeamHandler.cpp \
+ AuctionHouseHandler.cpp \
+ AuctionHouseMgr.cpp \
+ AuctionHouseMgr.h \
+ Bag.cpp \
+ Bag.h \
+ BattleGround.cpp \
+ BattleGroundAA.cpp \
+ BattleGroundAB.cpp \
+ BattleGroundAV.cpp \
+ BattleGroundBE.cpp \
+ BattleGroundDS.cpp \
+ BattleGroundEY.cpp \
+ BattleGroundNA.cpp \
+ BattleGroundRL.cpp \
+ BattleGroundRV.cpp \
+ BattleGroundSA.cpp \
+ BattleGroundWS.cpp \
+ BattleGround.h \
+ BattleGroundAA.h \
+ BattleGroundAB.h \
+ BattleGroundAV.h \
+ BattleGroundBE.h \
+ BattleGroundDS.h \
+ BattleGroundEY.h \
+ BattleGroundNA.h \
+ BattleGroundRL.h \
+ BattleGroundRV.h \
+ BattleGroundSA.h \
+ BattleGroundWS.h \
+ BattleGroundHandler.cpp \
+ BattleGroundMgr.cpp \
+ BattleGroundMgr.h \
+ Calendar.cpp \
+ Calendar.h \
+ CalendarHandler.cpp \
+ Cell.h \
+ CellImpl.h \
+ Channel.cpp \
+ Channel.h \
+ ChannelHandler.cpp \
+ ChannelMgr.h \
+ CharacterHandler.cpp \
+ Chat.cpp \
+ Chat.h \
+ ChatHandler.cpp \
+ CombatHandler.cpp \
+ ConfusedMovementGenerator.cpp \
+ ConfusedMovementGenerator.h \
+ Corpse.cpp \
+ Corpse.h \
+ CreatureAI.cpp \
+ CreatureAI.h \
+ CreatureAIImpl.h \
+ CreatureAIRegistry.cpp \
+ CreatureAIRegistry.h \
+ CreatureAISelector.cpp \
+ CreatureAISelector.h \
+ Creature.cpp \
+ Creature.h \
+ DBCEnums.h \
+ DBCfmt.h \
+ DBCStores.cpp \
+ DBCStores.h \
+ DBCStructure.h \
+ debugcmds.cpp \
+ DestinationHolder.cpp \
+ DestinationHolder.h \
+ DestinationHolderImp.h \
+ DuelHandler.cpp \
+ DynamicObject.cpp \
+ DynamicObject.h \
+ FleeingMovementGenerator.cpp \
+ FleeingMovementGenerator.h \
+ Formulas.h \
+ GameEventMgr.cpp \
+ GameEventMgr.h \
+ GameObject.cpp \
+ GameObject.h \
+ GlobalEvents.cpp \
+ GlobalEvents.h \
+ GMTicketHandler.cpp \
+ GMTicketMgr.cpp \
+ GMTicketMgr.h \
+ GossipDef.cpp \
+ GossipDef.h \
+ GridDefines.h \
+ GridNotifiers.cpp \
+ GridNotifiers.h \
+ GridNotifiersImpl.h \
+ GridStates.cpp \
+ GridStates.h \
+ Group.cpp \
+ Group.h \
+ GroupHandler.cpp \
+ GuardAI.cpp \
+ GuardAI.h \
+ Guild.cpp \
+ Guild.h \
+ GuildHandler.cpp \
+ HomeMovementGenerator.cpp \
+ HomeMovementGenerator.h \
+ HostilRefManager.cpp \
+ HostilRefManager.h \
+ IdleMovementGenerator.cpp \
+ IdleMovementGenerator.h \
+ InstanceData.cpp \
+ InstanceData.h \
+ InstanceSaveMgr.cpp \
+ InstanceSaveMgr.h \
+ Item.cpp \
+ Item.h \
+ ItemEnchantmentMgr.cpp \
+ ItemEnchantmentMgr.h \
+ ItemHandler.cpp \
+ ItemPrototype.h \
+ Language.h \
+ Level0.cpp \
+ Level1.cpp \
+ Level2.cpp \
+ Level3.cpp \
+ LFGHandler.cpp \
+ LootHandler.cpp \
+ LootMgr.cpp \
+ LootMgr.h \
+ Mail.cpp \
+ Mail.h \
+ Map.cpp \
+ Map.h \
+ MapInstanced.cpp \
+ MapInstanced.h \
+ MapManager.cpp \
+ MapManager.h \
+ MapReference.h \
+ MapRefManager.h \
+ MiscHandler.cpp \
+ MotionMaster.cpp \
+ MotionMaster.h \
+ MovementGenerator.cpp \
+ MovementGenerator.h \
+ MovementGeneratorImpl.h \
+ MovementHandler.cpp \
+ NPCHandler.cpp \
+ NPCHandler.h \
+ NullCreatureAI.cpp \
+ NullCreatureAI.h \
+ ObjectAccessor.cpp \
+ ObjectAccessor.h \
+ Object.cpp \
+ ObjectDefines.h \
+ ObjectGridLoader.cpp \
+ ObjectGridLoader.h \
+ Object.h \
+ ObjectMgr.cpp \
+ ObjectMgr.h \
+ ObjectPosSelector.cpp \
+ ObjectPosSelector.h \
+ Opcodes.cpp \
+ Opcodes.h \
+ Path.h \
+ PetAI.cpp \
+ PetAI.h \
+ Pet.cpp \
+ Pet.h \
+ PetHandler.cpp \
+ PetitionsHandler.cpp \
+ Player.cpp \
+ Player.h \
+ PlayerDump.cpp \
+ PlayerDump.h \
+ PointMovementGenerator.cpp \
+ PointMovementGenerator.h \
+ PoolHandler.cpp \
+ PoolHandler.h \
+ QueryHandler.cpp \
+ QuestDef.cpp \
+ QuestDef.h \
+ QuestHandler.cpp \
+ RandomMovementGenerator.cpp \
+ RandomMovementGenerator.h \
+ ReactorAI.cpp \
+ ReactorAI.h \
+ ReputationMgr.cpp \
+ ReputationMgr.h \
+ ScriptCalls.cpp \
+ ScriptCalls.h \
+ SharedDefines.h \
+ SkillHandler.cpp \
+ SpellAuraDefines.h \
+ SpellAuras.cpp \
+ SpellAuras.h \
+ Spell.cpp \
+ SpellEffects.cpp \
+ Spell.h \
+ SkillDiscovery.cpp \
+ SkillDiscovery.h \
+ SkillExtraItems.cpp \
+ SkillExtraItems.h \
+ SpellHandler.cpp \
+ SocialMgr.cpp \
+ SocialMgr.h \
+ SpellMgr.cpp \
+ SpellMgr.h \
+ StatSystem.cpp \
+ TargetedMovementGenerator.cpp \
+ TargetedMovementGenerator.h \
+ TaxiHandler.cpp \
+ TemporarySummon.cpp \
+ TemporarySummon.h \
+ TotemAI.cpp \
+ TotemAI.h \
+ Totem.cpp \
+ Totem.h \
+ TradeHandler.cpp \
+ Transports.cpp \
+ Transports.h \
+ ThreatManager.cpp \
+ ThreatManager.h \
+ Traveller.h \
+ Unit.cpp \
+ Unit.h \
+ UnitEvents.h \
+ UpdateData.cpp \
+ UpdateData.h \
+ UpdateFields.h \
+ UpdateMask.h \
+ Vehicle.cpp \
+ Vehicle.h \
+ VoiceChatHandler.cpp \
+ WaypointManager.cpp \
+ WaypointManager.h \
+ WaypointMovementGenerator.cpp \
+ WaypointMovementGenerator.h \
+ Weather.cpp \
+ Weather.h \
+ World.cpp \
+ World.h \
+ WorldLog.cpp \
+ WorldLog.h \
+ WorldSession.cpp \
+ WorldSession.h \
+ WorldSocket.cpp \
+ WorldSocket.h \
+ WorldSocketMgr.cpp \
+ WorldSocketMgr.h \
+ FollowerReference.cpp \
+ FollowerReference.h \
+ FollowerRefManager.h \
+ GroupReference.cpp \
+ GroupReference.h \
+ GroupRefManager.h
+>>>>>>> 2429aaf2276d689e101ed88285f18449dbe4280d:src/game/Makefile.am
+=======
+ AccountMgr.cpp \
+ AccountMgr.h \
+ AchievementMgr.h \
+ AchievementMgr.cpp \
+ AggressorAI.cpp \
+ AggressorAI.h \
+ AnimalRandomMovementGenerator.h \
+ ArenaTeam.cpp \
+ ArenaTeam.h \
+ ArenaTeamHandler.cpp \
+ AuctionHouseHandler.cpp \
+ AuctionHouseMgr.cpp \
+ AuctionHouseMgr.h \
+ Bag.cpp \
+ Bag.h \
+ BattleGround.cpp \
+ BattleGroundAA.cpp \
+ BattleGroundAB.cpp \
+ BattleGroundAV.cpp \
+ BattleGroundBE.cpp \
+ BattleGroundDS.cpp \
+ BattleGroundEY.cpp \
+ BattleGroundNA.cpp \
+ BattleGroundRL.cpp \
+ BattleGroundRV.cpp \
+ BattleGroundSA.cpp \
+ BattleGroundWS.cpp \
+ BattleGround.h \
+ BattleGroundAA.h \
+ BattleGroundAB.h \
+ BattleGroundAV.h \
+ BattleGroundBE.h \
+ BattleGroundDS.h \
+ BattleGroundEY.h \
+ BattleGroundNA.h \
+ BattleGroundRL.h \
+ BattleGroundRV.h \
+ BattleGroundSA.h \
+ BattleGroundWS.h \
+ BattleGroundHandler.cpp \
+ BattleGroundMgr.cpp \
+ BattleGroundMgr.h \
+ Calendar.cpp \
+ Calendar.h \
+ CalendarHandler.cpp \
+ Cell.h \
+ CellImpl.h \
+ Channel.cpp \
+ Channel.h \
+ ChannelHandler.cpp \
+ ChannelMgr.h \
+ CharacterHandler.cpp \
+ Chat.cpp \
+ Chat.h \
+ ChatHandler.cpp \
+ CombatHandler.cpp \
+ ConfusedMovementGenerator.cpp \
+ ConfusedMovementGenerator.h \
+ Corpse.cpp \
+ Corpse.h \
+ CreatureAI.cpp \
+ CreatureAI.h \
+ CreatureAIImpl.h \
+ CreatureAIRegistry.cpp \
+ CreatureAIRegistry.h \
+ CreatureAISelector.cpp \
+ CreatureAISelector.h \
+ CreatureEventAI.cpp \
+ CreatureEventAI.h \
+ CreatureEventAIMgr.cpp \
+ CreatureEventAIMgr.h \
+ Creature.cpp \
+ Creature.h \
+ DBCEnums.h \
+ DBCfmt.h \
+ DBCStores.cpp \
+ DBCStores.h \
+ DBCStructure.h \
+ debugcmds.cpp \
+ DestinationHolder.cpp \
+ DestinationHolder.h \
+ DestinationHolderImp.h \
+ DuelHandler.cpp \
+ DynamicObject.cpp \
+ DynamicObject.h \
+ FleeingMovementGenerator.cpp \
+ FleeingMovementGenerator.h \
+ Formulas.h \
+ GameEventMgr.cpp \
+ GameEventMgr.h \
+ GameObject.cpp \
+ GameObject.h \
+ GlobalEvents.cpp \
+ GlobalEvents.h \
+ GMTicketHandler.cpp \
+ GMTicketMgr.cpp \
+ GMTicketMgr.h \
+ GossipDef.cpp \
+ GossipDef.h \
+ GridDefines.h \
+ GridNotifiers.cpp \
+ GridNotifiers.h \
+ GridNotifiersImpl.h \
+ GridStates.cpp \
+ GridStates.h \
+ Group.cpp \
+ Group.h \
+ GroupHandler.cpp \
+ GuardAI.cpp \
+ GuardAI.h \
+ Guild.cpp \
+ Guild.h \
+ GuildHandler.cpp \
+ HomeMovementGenerator.cpp \
+ HomeMovementGenerator.h \
+ HostilRefManager.cpp \
+ HostilRefManager.h \
+ IdleMovementGenerator.cpp \
+ IdleMovementGenerator.h \
+ InstanceData.cpp \
+ InstanceData.h \
+ InstanceSaveMgr.cpp \
+ InstanceSaveMgr.h \
+ Item.cpp \
+ Item.h \
+ ItemEnchantmentMgr.cpp \
+ ItemEnchantmentMgr.h \
+ ItemHandler.cpp \
+ ItemPrototype.h \
+ Language.h \
+ Level0.cpp \
+ Level1.cpp \
+ Level2.cpp \
+ Level3.cpp \
+ LFGHandler.cpp \
+ LootHandler.cpp \
+ LootMgr.cpp \
+ LootMgr.h \
+ Mail.cpp \
+ Mail.h \
+ Map.cpp \
+ Map.h \
+ MapInstanced.cpp \
+ MapInstanced.h \
+ MapManager.cpp \
+ MapManager.h \
+ MapReference.h \
+ MapRefManager.h \
+ MiscHandler.cpp \
+ MotionMaster.cpp \
+ MotionMaster.h \
+ MovementGenerator.cpp \
+ MovementGenerator.h \
+ MovementGeneratorImpl.h \
+ MovementHandler.cpp \
+ NPCHandler.cpp \
+ NPCHandler.h \
+ NullCreatureAI.cpp \
+ NullCreatureAI.h \
+ ObjectAccessor.cpp \
+ ObjectAccessor.h \
+ Object.cpp \
+ ObjectDefines.h \
+ ObjectGridLoader.cpp \
+ ObjectGridLoader.h \
+ Object.h \
+ ObjectMgr.cpp \
+ ObjectMgr.h \
+ ObjectPosSelector.cpp \
+ ObjectPosSelector.h \
+ Opcodes.cpp \
+ Opcodes.h \
+ Path.h \
+ PetAI.cpp \
+ PetAI.h \
+ Pet.cpp \
+ Pet.h \
+ PetHandler.cpp \
+ PetitionsHandler.cpp \
+ Player.cpp \
+ Player.h \
+ PlayerDump.cpp \
+ PlayerDump.h \
+ PointMovementGenerator.cpp \
+ PointMovementGenerator.h \
+ PoolHandler.cpp \
+ PoolHandler.h \
+ QueryHandler.cpp \
+ QuestDef.cpp \
+ QuestDef.h \
+ QuestHandler.cpp \
+ RandomMovementGenerator.cpp \
+ RandomMovementGenerator.h \
+ ReactorAI.cpp \
+ ReactorAI.h \
+ ReputationMgr.cpp \
+ ReputationMgr.h \
+ ScriptCalls.cpp \
+ ScriptCalls.h \
+ SharedDefines.h \
+ SkillHandler.cpp \
+ SpellAuraDefines.h \
+ SpellAuras.cpp \
+ SpellAuras.h \
+ Spell.cpp \
+ SpellEffects.cpp \
+ Spell.h \
+ SkillDiscovery.cpp \
+ SkillDiscovery.h \
+ SkillExtraItems.cpp \
+ SkillExtraItems.h \
+ SpellHandler.cpp \
+ SocialMgr.cpp \
+ SocialMgr.h \
+ SpellMgr.cpp \
+ SpellMgr.h \
+ StatSystem.cpp \
+ TargetedMovementGenerator.cpp \
+ TargetedMovementGenerator.h \
+ TaxiHandler.cpp \
+ TemporarySummon.cpp \
+ TemporarySummon.h \
+ TotemAI.cpp \
+ TotemAI.h \
+ Totem.cpp \
+ Totem.h \
+ TradeHandler.cpp \
+ Transports.cpp \
+ Transports.h \
+ ThreatManager.cpp \
+ ThreatManager.h \
+ Traveller.h \
+ Unit.cpp \
+ Unit.h \
+ UnitEvents.h \
+ UpdateData.cpp \
+ UpdateData.h \
+ UpdateFields.h \
+ UpdateMask.h \
+ Vehicle.cpp \
+ Vehicle.h \
+ VoiceChatHandler.cpp \
+ WaypointManager.cpp \
+ WaypointManager.h \
+ WaypointMovementGenerator.cpp \
+ WaypointMovementGenerator.h \
+ Weather.cpp \
+ Weather.h \
+ World.cpp \
+ World.h \
+ WorldLog.cpp \
+ WorldLog.h \
+ WorldSession.cpp \
+ WorldSession.h \
+ WorldSocket.cpp \
+ WorldSocket.h \
+ WorldSocketMgr.cpp \
+ WorldSocketMgr.h \
+ FollowerReference.cpp \
+ FollowerReference.h \
+ FollowerRefManager.h \
+ GroupReference.cpp \
+ GroupReference.h \
+ GroupRefManager.h
+>>>>>>> 5a6594330caefc0dc00a5fe792dcb0e344b457cb:src/game/Makefile.am
+
+## Link against shared library
+libmangosgame_a_LIBADD = ../shared/libmangosshared.a ../shared/Auth/libmangosauth.a ../shared/Config/libmangosconfig.a ../shared/Database/libmangosdatabase.a ../shared/vmap/libmangosvmaps.a
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index b12c7b477c0..c6c74a74493 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -21,7 +21,6 @@
#include "MapManager.h"
#include "Player.h"
#include "GridNotifiers.h"
-#include "WorldSession.h"
#include "Log.h"
#include "GridStates.h"
#include "CellImpl.h"
@@ -36,6 +35,7 @@
#include "ScriptCalls.h"
#include "Group.h"
#include "MapRefManager.h"
+#include "Vehicle.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
@@ -44,9 +44,6 @@
#define DEFAULT_GRID_EXPIRY 300
#define MAX_GRID_LOAD_TIME 50
-// magic *.map header
-const char MAP_MAGIC[] = "MAP_2.50";
-
GridState* si_GridStates[MAX_GRID_STATE];
Map::~Map()
@@ -54,11 +51,11 @@ Map::~Map()
UnloadAll();
}
-bool Map::ExistMap(uint32 mapid,int x,int y)
+bool Map::ExistMap(uint32 mapid,int gx,int gy)
{
int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
char* tmp = new char[len];
- snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,x,y);
+ snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy);
FILE *pf=fopen(tmp,"rb");
@@ -69,9 +66,10 @@ bool Map::ExistMap(uint32 mapid,int x,int y)
return false;
}
- char magic[8];
- fread(magic,1,8,pf);
- if(strncmp(MAP_MAGIC,magic,8))
+ map_fileheader header;
+ fread(&header, sizeof(header), 1, pf);
+ if (header.mapMagic != uint32(MAP_MAGIC) ||
+ header.versionMagic != uint32(MAP_VERSION_MAGIC))
{
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
delete [] tmp;
@@ -84,17 +82,17 @@ bool Map::ExistMap(uint32 mapid,int x,int y)
return true;
}
-bool Map::ExistVMap(uint32 mapid,int x,int y)
+bool Map::ExistVMap(uint32 mapid,int gx,int gy)
{
if(VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager())
{
if(vmgr->isMapLoadingEnabled())
{
// x and y are swapped !! => fixed now
- bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, x,y);
+ bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy);
if(!exists)
{
- std::string name = vmgr->getDirFileName(mapid,x,y);
+ std::string name = vmgr->getDirFileName(mapid,gx,gy);
sLog.outError("VMap file '%s' is missing or point to wrong version vmap file, redo vmaps with latest vmap_assembler.exe program", (sWorld.GetDataPath()+"vmaps/"+name).c_str());
return false;
}
@@ -104,91 +102,70 @@ bool Map::ExistVMap(uint32 mapid,int x,int y)
return true;
}
-void Map::LoadVMap(int x,int y)
+void Map::LoadVMap(int gx,int gy)
{
// x and y are swapped !!
- int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld.GetDataPath()+ "vmaps").c_str(), GetId(), x,y);
+ int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld.GetDataPath()+ "vmaps").c_str(), GetId(), gx,gy);
switch(vmapLoadResult)
{
case VMAP::VMAP_LOAD_RESULT_OK:
- sLog.outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), x,y, x,y);
+ sLog.outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
break;
case VMAP::VMAP_LOAD_RESULT_ERROR:
- sLog.outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), x,y, x,y);
+ sLog.outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
break;
case VMAP::VMAP_LOAD_RESULT_IGNORED:
- DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), x,y, x,y);
+ DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy);
break;
}
}
-void Map::LoadMap(uint32 mapid, uint32 instanceid, int x,int y)
+void Map::LoadMap(int gx,int gy)
{
- if( instanceid != 0 )
+ if( i_InstanceId != 0 )
{
- if(GridMaps[x][y])
+ if(GridMaps[gx][gy])
return;
- Map* baseMap = const_cast<Map*>(MapManager::Instance().GetBaseMap(mapid));
-
- // load gridmap for base map
- if (!baseMap->GridMaps[x][y])
- baseMap->EnsureGridCreated(GridPair(63-x,63-y));
+ Map* baseMap = const_cast<Map*>(MapManager::Instance().GetBaseMap(i_id));
-//+++ if (!baseMap->GridMaps[x][y]) don't check for GridMaps[gx][gy], we need the management for vmaps
-// return;
+ // load grid map for base map
+ if (!baseMap->GridMaps[gx][gy])
+ baseMap->EnsureGridCreated(GridPair(63-gx,63-gy));
- ((MapInstanced*)(baseMap))->AddGridMapReference(GridPair(x,y));
- GridMaps[x][y] = baseMap->GridMaps[x][y];
+ ((MapInstanced*)(baseMap))->AddGridMapReference(GridPair(gx,gy));
+ GridMaps[gx][gy] = baseMap->GridMaps[gx][gy];
return;
}
//map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?)
- if(GridMaps[x][y])
+ if(GridMaps[gx][gy])
{
- sLog.outDetail("Unloading already loaded map %u before reloading.",mapid);
- delete (GridMaps[x][y]);
- GridMaps[x][y]=NULL;
+ sLog.outDetail("Unloading already loaded map %u before reloading.",i_id);
+ delete (GridMaps[gx][gy]);
+ GridMaps[gx][gy]=NULL;
}
// map file name
char *tmp=NULL;
- // Pihhan: dataPath length + "maps/" + 3+2+2+ ".map" length may be > 32 !
int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
tmp = new char[len];
- snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,x,y);
+ snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),i_id,gx,gy);
sLog.outDetail("Loading map %s",tmp);
// loading data
- FILE *pf=fopen(tmp,"rb");
- if(!pf)
+ GridMaps[gx][gy] = new GridMap();
+ if (!GridMaps[gx][gy]->loadData(tmp))
{
- delete [] tmp;
- return;
+ sLog.outError("Error load map file: \n %s\n", tmp);
}
-
- char magic[8];
- fread(magic,1,8,pf);
- if(strncmp(MAP_MAGIC,magic,8))
- {
- sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
- delete [] tmp;
- fclose(pf); //close file before return
- return;
- }
- delete [] tmp;
-
- GridMap * buf= new GridMap;
- fread(buf,1,sizeof(GridMap),pf);
- fclose(pf);
-
- GridMaps[x][y] = buf;
+ delete [] tmp;
}
-void Map::LoadMapAndVMap(uint32 mapid, uint32 instanceid, int x,int y)
+void Map::LoadMapAndVMap(int gx,int gy)
{
- LoadMap(mapid,instanceid,x,y);
- if(instanceid == 0)
- LoadVMap(x, y); // Only load the data for the base map
+ LoadMap(gx,gy);
+ if(i_InstanceId == 0)
+ LoadVMap(gx, gy); // Only load the data for the base map
}
void Map::InitStateMachine()
@@ -256,7 +233,7 @@ template<>
void Map::AddToGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// add to world object registry in grid
- if(obj->isPet() || obj->IsTempWorldObject)
+ if(obj->isWorldCreature() || obj->IsTempWorldObject)
{
(*grid)(cell.CellX(), cell.CellY()).AddWorldObject<Creature>(obj, obj->GetGUID());
}
@@ -308,7 +285,7 @@ template<>
void Map::RemoveFromGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// remove from world object registry in grid
- if(obj->isPet() || obj->IsTempWorldObject)
+ if(obj->isWorldCreature() || obj->IsTempWorldObject)
{
(*grid)(cell.CellX(), cell.CellY()).RemoveWorldObject<Creature>(obj, obj->GetGUID());
}
@@ -410,7 +387,7 @@ Map::EnsureGridCreated(const GridPair &p)
Guard guard(*this);
if(!getNGrid(p.x_coord, p.y_coord))
{
- sLog.outDebug("Loading grid[%u,%u] for map %u", p.x_coord, p.y_coord, i_id);
+ sLog.outDebug("Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, i_id, i_InstanceId);
setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getConfig(CONFIG_GRID_UNLOAD)),
p.x_coord, p.y_coord);
@@ -425,20 +402,20 @@ Map::EnsureGridCreated(const GridPair &p)
int gy=63-p.y_coord;
if(!GridMaps[gx][gy])
- Map::LoadMapAndVMap(i_id,i_InstanceId,gx,gy);
+ LoadMapAndVMap(gx,gy);
}
}
}
void
-Map::EnsureGridLoaded(const Cell &cell, Player *player)
+Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player)
{
- EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
- NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
+ NGridType *grid;
- assert(grid != NULL);
- if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
+ if(EnsureGridLoaded(cell))
{
+ grid = getNGrid(cell.GridX(), cell.GridY());
+
if (player)
{
player->SendDelayResponse(MAX_GRID_LOAD_TIME);
@@ -449,19 +426,37 @@ Map::EnsureGridLoaded(const Cell &cell, Player *player)
DEBUG_LOG("Active object nearby triggers of loading grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), i_id);
}
+ ResetGridExpiry(*getNGrid(cell.GridX(), cell.GridY()), 0.1f);
+ grid->SetGridState(GRID_STATE_ACTIVE);
+ }
+ else
+ grid = getNGrid(cell.GridX(), cell.GridY());
+
+ if (player)
+ AddToGrid(player,grid,cell);
+}
+
+bool Map::EnsureGridLoaded(const Cell &cell)
+{
+ EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
+ NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
+
+ assert(grid != NULL);
+ if( !isGridObjectDataLoaded(cell.GridX(), cell.GridY()) )
+ {
+ sLog.outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), i_id, i_InstanceId);
+
ObjectGridLoader loader(*grid, this, cell);
loader.LoadN();
- setGridObjectDataLoaded(true, cell.GridX(), cell.GridY());
// Add resurrectable corpses to world object list in grid
ObjectAccessor::Instance().AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this);
- ResetGridExpiry(*getNGrid(cell.GridX(), cell.GridY()), 0.1f);
- grid->SetGridState(GRID_STATE_ACTIVE);
+ setGridObjectDataLoaded(true,cell.GridX(), cell.GridY());
+ return true;
}
-
- if(player)
- AddToGrid(player,grid,cell);
+
+ return false;
}
void Map::LoadGrid(float x, float y)
@@ -480,7 +475,7 @@ bool Map::Add(Player *player)
// update player state for other player and visa-versa
CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
Cell cell(p);
- EnsureGridLoaded(cell, player);
+ EnsureGridLoadedAtEnter(cell, player);
player->AddToWorld();
SendInitSelf(player);
@@ -508,7 +503,7 @@ Map::Add(T *obj)
Cell cell(p);
if(obj->isActiveObject())
- EnsureGridLoaded(cell);
+ EnsureGridLoadedAtEnter(cell);
else
EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
@@ -517,12 +512,14 @@ Map::Add(T *obj)
AddToGrid(obj,grid,cell);
obj->AddToWorld();
-
+
if(obj->isActiveObject())
AddToActive(obj);
DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
+ //something, such as vehicle, needs to be update immediately
+ //if(obj->GetTypeId() != TYPEID_UNIT)
UpdateObjectVisibility(obj,cell,p);
//AddNotifier(obj);
@@ -730,6 +727,13 @@ void Map::Update(const uint32 &t_diff)
}
}
}
+
+ if(plr->m_seer != plr && !plr->hasUnitState(UNIT_STAT_ONVEHICLE))
+ {
+ Trinity::PlayerVisibilityNotifier notifier(*plr);
+ VisitAll(plr->m_seer->GetPositionX(), plr->m_seer->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
+ notifier.Notify();
+ }
}
// non-player active objects
@@ -747,33 +751,6 @@ void Map::Update(const uint32 &t_diff)
if(!obj->IsInWorld())
continue;
- // Update bindsight players
- /*if(obj->isType(TYPEMASK_UNIT))
- {
- if(!((Unit*)obj)->GetSharedVisionList().empty())
- for(SharedVisionList::const_iterator itr = ((Unit*)obj)->GetSharedVisionList().begin(); itr != ((Unit*)obj)->GetSharedVisionList().end(); ++itr)
- {
- if(!*itr)
- {
- sLog.outError("unit %u has invalid shared vision player, list size %u", obj->GetEntry(), ((Unit*)obj)->GetSharedVisionList().size());
- continue;
- }
- Trinity::PlayerVisibilityNotifier notifier(**itr);
- VisitAll(obj->GetPositionX(), obj->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
- notifier.Notify();
- }
- }
- else */if(obj->GetTypeId() == TYPEID_DYNAMICOBJECT)
- {
- if(Unit *caster = ((DynamicObject*)obj)->GetCaster())
- if(caster->GetTypeId() == TYPEID_PLAYER && caster->GetUInt64Value(PLAYER_FARSIGHT) == obj->GetGUID())
- {
- Trinity::PlayerVisibilityNotifier notifier(*((Player*)caster));
- VisitAll(obj->GetPositionX(), obj->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
- notifier.Notify();
- }
- }
-
CellPair standing_cell(Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()));
// Check for correctness of standing_cell, it also avoids problems with update_cell
@@ -948,7 +925,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
if( !old_cell.DiffGrid(new_cell) )
AddToGrid(player, oldGrid,new_cell);
else
- EnsureGridLoaded(new_cell, player);
+ EnsureGridLoadedAtEnter(new_cell, player);
}
AddUnitToNotify(player);
@@ -986,6 +963,17 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang
creature->Relocate(x, y, z, ang);
AddUnitToNotify(creature);
}
+
+ if(creature->isVehicle())
+ {
+ for(SeatMap::iterator itr = ((Vehicle*)creature)->m_Seats.begin(); itr != ((Vehicle*)creature)->m_Seats.end(); ++itr)
+ if(itr->second.passenger)
+ if(itr->second.passenger->GetTypeId() == TYPEID_PLAYER)
+ PlayerRelocation((Player*)itr->second.passenger, x, y, z, ang);
+ else
+ CreatureRelocation((Creature*)itr->second.passenger, x, y, z, ang);
+ }
+
assert(CheckGridIntegrity(creature,true));
}
@@ -1067,7 +1055,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
// in diff. grids but active creature
if(c->isActiveObject())
{
- EnsureGridLoaded(new_cell);
+ EnsureGridLoadedAtEnter(new_cell);
#ifdef TRINITY_DEBUG
if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
@@ -1178,7 +1166,11 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
{
if (i_InstanceId == 0)
{
- if(GridMaps[gx][gy]) delete (GridMaps[gx][gy]);
+ if(GridMaps[gx][gy])
+ {
+ GridMaps[gx][gy]->unloadData();
+ delete GridMaps[gx][gy];
+ }
// x and y are swapped
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gy, gx);
}
@@ -1203,103 +1195,529 @@ void Map::UnloadAll()
}
}
-float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
+//*****************************
+// Grid function
+//*****************************
+GridMap::GridMap()
{
- GridPair p = Trinity::ComputeGridPair(x, y);
+ m_flags = 0;
+ // Area data
+ m_gridArea = 0;
+ m_area_map = NULL;
+ // Height level data
+ m_gridHeight = INVALID_HEIGHT;
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+ m_V9 = NULL;
+ m_V8 = NULL;
+ // Liquid data
+ m_liquidType = 0;
+ m_liquid_offX = 0;
+ m_liquid_offY = 0;
+ m_liquid_width = 0;
+ m_liquid_height = 0;
+ m_liquidLevel = INVALID_HEIGHT;
+ m_liquid_type = NULL;
+ m_liquid_map = NULL;
+}
- // half opt method
- int gx=(int)(32-x/SIZE_OF_GRIDS); //grid x
- int gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
+GridMap::~GridMap()
+{
+ unloadData();
+}
- float lx=128*(32 -x/SIZE_OF_GRIDS - gx);
- float ly=128*(32 -y/SIZE_OF_GRIDS - gy);
+bool GridMap::loadData(char *filename)
+{
+ // Unload old data if exist
+ unloadData();
- // ensure GridMap is loaded
- const_cast<Map*>(this)->EnsureGridCreated(GridPair(63-gx,63-gy));
+ map_fileheader header;
+ // Not return error if file not found
+ FILE *in = fopen(filename, "rb");
+ if (!in)
+ return true;
+ fread(&header, sizeof(header),1,in);
+ if (header.mapMagic == uint32(MAP_MAGIC) &&
+ header.versionMagic == uint32(MAP_VERSION_MAGIC))
+ {
+ // loadup area data
+ if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
+ {
+ sLog.outError("Error loading map area data\n");
+ fclose(in);
+ return false;
+ }
+ // loadup height data
+ if (header.heightMapOffset && !loadHeihgtData(in, header.heightMapOffset, header.heightMapSize))
+ {
+ sLog.outError("Error loading map height data\n");
+ fclose(in);
+ return false;
+ }
+ // loadup liquid data
+ if (header.liquidMapOffset && !loadLiquidData(in, header.liquidMapOffset, header.liquidMapSize))
+ {
+ sLog.outError("Error loading map liquids data\n");
+ fclose(in);
+ return false;
+ }
+ fclose(in);
+ return true;
+ }
+ sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", filename);
+ fclose(in);
+ return false;
+}
- // find raw .map surface under Z coordinates
- float mapHeight;
- if(GridMap* gmap = GridMaps[gx][gy])
+void GridMap::unloadData()
+{
+ if (m_area_map) delete[] m_area_map;
+ if (m_V9) delete[] m_V9;
+ if (m_V8) delete[] m_V8;
+ if (m_liquid_type) delete[] m_liquid_type;
+ if (m_liquid_map) delete[] m_liquid_map;
+ m_area_map = NULL;
+ m_V9 = NULL;
+ m_V8 = NULL;
+ m_liquid_type = NULL;
+ m_liquid_map = NULL;
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+}
+
+bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 size)
+{
+ map_areaHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != uint32(MAP_AREA_MAGIC))
+ return false;
+
+ m_gridArea = header.gridArea;
+ if (!(header.flags & MAP_AREA_NO_AREA))
{
- int lx_int = (int)lx;
- int ly_int = (int)ly;
+ m_area_map = new uint16 [16*16];
+ fread(m_area_map, sizeof(uint16), 16*16, in);
+ }
+ return true;
+}
- lx -= lx_int;
- ly -= ly_int;
+bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 size)
+{
+ map_heightHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != uint32(MAP_HEIGTH_MAGIC))
+ return false;
- float a,b,c;
- if (lx+ly < 1)
+ m_gridHeight = header.gridHeight;
+ if (!(header.flags & MAP_HEIGHT_NO_HIGHT))
+ {
+ if ((header.flags & MAP_HEIGHT_AS_INT16))
{
- if (lx > ly)
- {
- // 1
- float h1 = gmap->v9[lx_int][ly_int];
- float h2 = gmap->v9[lx_int+1][ly_int];
- float h5 = 2 * gmap->v8[lx_int][ly_int];
- a = h2-h1;
- b = h5-h1-h2;
- c = h1;
- }
- else
- {
- // 2
- float h1 = gmap->v9[lx_int][ly_int];
- float h3 = gmap->v9[lx_int][ly_int+1];
- float h5 = 2 * gmap->v8[lx_int][ly_int];
- a = h5 - h1 - h3;
- b = h3 - h1;
- c = h1;
- }
+ m_uint16_V9 = new uint16 [129*129];
+ m_uint16_V8 = new uint16 [128*128];
+ fread(m_uint16_V9, sizeof(uint16), 129*129, in);
+ fread(m_uint16_V8, sizeof(uint16), 128*128, in);
+ m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 65535;
+ m_gridGetHeight = &GridMap::getHeightFromUint16;
+ }
+ else if ((header.flags & MAP_HEIGHT_AS_INT8))
+ {
+ m_uint8_V9 = new uint8 [129*129];
+ m_uint8_V8 = new uint8 [128*128];
+ fread(m_uint8_V9, sizeof(uint8), 129*129, in);
+ fread(m_uint8_V8, sizeof(uint8), 128*128, in);
+ m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 255;
+ m_gridGetHeight = &GridMap::getHeightFromUint8;
}
else
{
- if (lx > ly)
- {
- // 3
- float h2 = gmap->v9[lx_int+1][ly_int];
- float h4 = gmap->v9[lx_int+1][ly_int+1];
- float h5 = 2 * gmap->v8[lx_int][ly_int];
- a = h2 + h4 - h5;
- b = h4 - h2;
- c = h5 - h4;
- }
- else
- {
- // 4
- float h3 = gmap->v9[lx_int][ly_int+1];
- float h4 = gmap->v9[lx_int+1][ly_int+1];
- float h5 = 2 * gmap->v8[lx_int][ly_int];
- a = h4 - h3;
- b = h3 + h4 - h5;
- c = h5 - h4;
- }
+ m_V9 = new float [129*129];
+ m_V8 = new float [128*128];
+ fread(m_V9, sizeof(float), 129*129, in);
+ fread(m_V8, sizeof(float), 128*128, in);
+ m_gridGetHeight = &GridMap::getHeightFromFloat;
+ }
+ }
+ else
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+ return true;
+}
+
+bool GridMap::loadLiquidData(FILE *in, uint32 offset, uint32 size)
+{
+ map_liquidHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != uint32(MAP_LIQUID_MAGIC))
+ return false;
+
+ m_liquidType = header.liquidType;
+ m_liquid_offX = header.offsetX;
+ m_liquid_offY = header.offsetY;
+ m_liquid_width = header.width;
+ m_liquid_height= header.height;
+ m_liquidLevel = header.liquidLevel;
+
+ if (!(header.flags&MAP_LIQUID_NO_TYPE))
+ {
+ m_liquid_type = new uint8 [16*16];
+ fread(m_liquid_type, sizeof(uint8), 16*16, in);
+ }
+ if (!(header.flags&MAP_LIQUID_NO_HIGHT))
+ {
+ m_liquid_map = new float [m_liquid_width*m_liquid_height];
+ fread(m_liquid_map, sizeof(float), m_liquid_width*m_liquid_height, in);
+ }
+ return true;
+}
+
+uint16 GridMap::getArea(float x, float y)
+{
+ if (!m_area_map)
+ return m_gridArea;
+
+ x = 16 * (32 - x/SIZE_OF_GRIDS);
+ y = 16 * (32 - y/SIZE_OF_GRIDS);
+ int lx = (int)x & 15;
+ int ly = (int)y & 15;
+ return m_area_map[lx*16 + ly];
+}
+
+float GridMap::getHeightFromFlat(float x, float y) const
+{
+ return m_gridHeight;
+}
+
+float GridMap::getHeightFromFloat(float x, float y) const
+{
+ if (!m_V8 || !m_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int&=(MAP_RESOLUTION - 1);
+ y_int&=(MAP_RESOLUTION - 1);
+
+ // Height stored as: h5 - its v8 grid, h1-h4 - its v9 grid
+ // +--------------> X
+ // | h1-------h2 Coordinates is:
+ // | | \ 1 / | h1 0,0
+ // | | \ / | h2 0,1
+ // | | 2 h5 3 | h3 1,0
+ // | | / \ | h4 1,1
+ // | | / 4 \ | h5 1/2,1/2
+ // | h3-------h4
+ // V Y
+ // For find height need
+ // 1 - detect triangle
+ // 2 - solve linear equation from triangle points
+ // Calculate coefficients for solve h = a*x + b*y + c
+
+ float a,b,c;
+ // Select triangle:
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ float h1 = m_V9[(x_int )*129 + y_int];
+ float h2 = m_V9[(x_int+1)*129 + y_int];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
+ }
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ float h1 = m_V9[x_int*129 + y_int ];
+ float h3 = m_V9[x_int*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ float h2 = m_V9[(x_int+1)*129 + y_int ];
+ float h4 = m_V9[(x_int+1)*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ float h3 = m_V9[(x_int )*129 + y_int+1];
+ float h4 = m_V9[(x_int+1)*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+ // Calculate height
+ return a * x + b * y + c;
+}
+
+float GridMap::getHeightFromUint8(float x, float y) const
+{
+ if (!m_uint8_V8 || !m_uint8_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int&=(MAP_RESOLUTION - 1);
+ y_int&=(MAP_RESOLUTION - 1);
+
+ int32 a, b, c;
+ uint8 *V9_h1_ptr = &m_uint8_V9[x_int*128 + x_int + y_int];
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ int32 h1 = V9_h1_ptr[ 0];
+ int32 h2 = V9_h1_ptr[129];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
}
- float _mapheight = a * lx + b * ly + c;
-
- // In some very rare case this will happen. Need find a better way.
- if(lx_int == MAP_RESOLUTION) --lx_int;
- if(ly_int == MAP_RESOLUTION) --ly_int;
-
- /*
- float zi[4];
- // Probe 4 nearest points (except border cases)
- zi[0] = gmap->Z[lx_int][ly_int];
- zi[1] = lx < MAP_RESOLUTION-1 ? gmap->Z[lx_int+1][ly_int] : zi[0];
- zi[2] = ly < MAP_RESOLUTION-1 ? gmap->Z[lx_int][ly_int+1] : zi[0];
- zi[3] = lx < MAP_RESOLUTION-1 && ly < MAP_RESOLUTION-1 ? gmap->Z[lx_int+1][ly_int+1] : zi[0];
- // Recalculate them like if their x,y positions were in the range 0,1
- float b[4];
- b[0] = zi[0];
- b[1] = zi[1]-zi[0];
- b[2] = zi[2]-zi[0];
- b[3] = zi[0]-zi[1]-zi[2]+zi[3];
- // Normalize the dx and dy to be in range 0..1
- float fact_x = lx - lx_int;
- float fact_y = ly - ly_int;
- // Use the simplified bilinear equation, as described in [url="http://en.wikipedia.org/wiki/Bilinear_interpolation"]http://en.wikipedia.org/wiki/Bilinear_interpolation[/url]
- float _mapheight = b[0] + (b[1]*fact_x) + (b[2]*fact_y) + (b[3]*fact_x*fact_y);
-
- */
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ int32 h1 = V9_h1_ptr[0];
+ int32 h3 = V9_h1_ptr[1];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ int32 h2 = V9_h1_ptr[129];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ int32 h3 = V9_h1_ptr[ 1];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+ // Calculate height
+ return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
+}
+
+float GridMap::getHeightFromUint16(float x, float y) const
+{
+ if (!m_uint16_V8 || !m_uint16_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int&=(MAP_RESOLUTION - 1);
+ y_int&=(MAP_RESOLUTION - 1);
+
+ int32 a, b, c;
+ uint16 *V9_h1_ptr = &m_uint16_V9[x_int*128 + x_int + y_int];
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ int32 h1 = V9_h1_ptr[ 0];
+ int32 h2 = V9_h1_ptr[129];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
+ }
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ int32 h1 = V9_h1_ptr[0];
+ int32 h3 = V9_h1_ptr[1];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ int32 h2 = V9_h1_ptr[129];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ int32 h3 = V9_h1_ptr[ 1];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+ // Calculate height
+ return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
+}
+
+float GridMap::getLiquidLevel(float x, float y)
+{
+ if (!m_liquid_map)
+ return m_liquidLevel;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int cx_int = ((int)x & (MAP_RESOLUTION-1)) - m_liquid_offY;
+ int cy_int = ((int)y & (MAP_RESOLUTION-1)) - m_liquid_offX;
+
+ if (cx_int < 0 || cx_int >=m_liquid_height)
+ return INVALID_HEIGHT;
+ if (cy_int < 0 || cy_int >=m_liquid_width )
+ return INVALID_HEIGHT;
+
+ return m_liquid_map[cx_int*m_liquid_width + cy_int];
+}
+
+uint8 GridMap::getTerrainType(float x, float y)
+{
+ if (!m_liquid_type)
+ return m_liquidType;
+
+ x = 16 * (32 - x/SIZE_OF_GRIDS);
+ y = 16 * (32 - y/SIZE_OF_GRIDS);
+ int lx = (int)x & 15;
+ int ly = (int)y & 15;
+ return m_liquid_type[lx*16 + ly];
+}
+
+// Get water state on map
+inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data)
+{
+ // Check water type (if no water return)
+ if (!m_liquid_type && !m_liquidType)
+ return LIQUID_MAP_NO_WATER;
+
+ // Get cell
+ float cx = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ float cy = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)cx & (MAP_RESOLUTION-1);
+ int y_int = (int)cy & (MAP_RESOLUTION-1);
+
+ // Check water type in cell
+ uint8 type = m_liquid_type ? m_liquid_type[(x_int>>3)*16 + (y_int>>3)] : m_liquidType;
+ if (type == 0)
+ return LIQUID_MAP_NO_WATER;
+
+ // Check req liquid type mask
+ if (ReqLiquidType && !(ReqLiquidType&type))
+ return LIQUID_MAP_NO_WATER;
+
+ // Check water level:
+ // Check water height map
+ int lx_int = x_int - m_liquid_offY;
+ int ly_int = y_int - m_liquid_offX;
+ if (lx_int < 0 || lx_int >=m_liquid_height)
+ return LIQUID_MAP_NO_WATER;
+ if (ly_int < 0 || ly_int >=m_liquid_width )
+ return LIQUID_MAP_NO_WATER;
+
+ // Get water level
+ float liquid_level = m_liquid_map ? m_liquid_map[lx_int*m_liquid_width + ly_int] : m_liquidLevel;
+ // Get ground level (sub 0.2 for fix some errors)
+ float ground_level = getHeight(x, y);
+
+ // Check water level and ground level
+ if (liquid_level < ground_level || z < ground_level - 2)
+ return LIQUID_MAP_NO_WATER;
+
+ // All ok in water -> store data
+ if (data)
+ {
+ data->type = type;
+ data->level = liquid_level;
+ data->depth_level = ground_level;
+ }
+
+ // For speed check as int values
+ int delta = int((liquid_level - z) * 10);
+
+ // Get position delta
+ if (delta > 20) // Under water
+ return LIQUID_MAP_UNDER_WATER;
+ if (delta > 0 ) // In water
+ return LIQUID_MAP_IN_WATER;
+ if (delta > -1) // Walk on water
+ return LIQUID_MAP_WATER_WALK;
+ // Above water
+ return LIQUID_MAP_ABOVE_WATER;
+}
+
+inline GridMap *Map::GetGrid(float x, float y)
+{
+ // half opt method
+ int gx=(int)(32-x/SIZE_OF_GRIDS); //grid x
+ int gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
+
+ // ensure GridMap is loaded
+ EnsureGridCreated(GridPair(63-gx,63-gy));
+
+ return GridMaps[gx][gy];
+}
+
+float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
+{
+ // find raw .map surface under Z coordinates
+ float mapHeight;
+ if(GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ {
+ float _mapheight = gmap->getHeight(x,y);
+
// look from a bit higher pos to find the floor, ignore under surface case
if(z + 2.0f > _mapheight)
mapHeight = _mapheight;
@@ -1375,76 +1793,122 @@ float Map::GetVmapHeight(float x, float y, float z, bool useMaps) const
return vmapHeight;
}
-uint16 Map::GetAreaFlag(float x, float y ) const
+uint16 Map::GetAreaFlag(float x, float y, float z) const
{
- //local x,y coords
- float lx,ly;
- int gx,gy;
- GridPair p = Trinity::ComputeGridPair(x, y);
-
- // half opt method
- gx=(int)(32-x/SIZE_OF_GRIDS) ; //grid x
- gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
-
- lx=16*(32 -x/SIZE_OF_GRIDS - gx);
- ly=16*(32 -y/SIZE_OF_GRIDS - gy);
- //DEBUG_LOG("my %d %d si %d %d",gx,gy,p.x_coord,p.y_coord);
-
- // ensure GridMap is loaded
- const_cast<Map*>(this)->EnsureGridCreated(GridPair(63-gx,63-gy));
-
- if(GridMaps[gx][gy])
- return GridMaps[gx][gy]->area_flag[(int)(lx)][(int)(ly)];
+ uint16 areaflag;
+ if(GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ areaflag = gmap->getArea(x, y);
// this used while not all *.map files generated (instances)
else
- return GetAreaFlagByMapId(i_id);
+ areaflag = GetAreaFlagByMapId(i_id);
+
+ //FIXME: some hacks for areas above or underground for ground area
+ // required for area specific spells/etc, until map/vmap data
+ // not provided correct areaflag with this hacks
+ switch(areaflag)
+ {
+ // Acherus: The Ebon Hold (Plaguelands: The Scarlet Enclave)
+ case 1984: // Plaguelands: The Scarlet Enclave
+ case 2076: // Death's Breach (Plaguelands: The Scarlet Enclave)
+ case 2745: // The Noxious Pass (Plaguelands: The Scarlet Enclave)
+ if(z > 350.0f) areaflag = 2048; break;
+ // Acherus: The Ebon Hold (Eastern Plaguelands)
+ case 856: // The Noxious Glade (Eastern Plaguelands)
+ case 2456: // Death's Breach (Eastern Plaguelands)
+ if(z > 350.0f) areaflag = 1950; break;
+ // Dalaran
+ case 1593: // Crystalsong Forest
+ case 2484: // The Twilight Rivulet (Crystalsong Forest)
+ case 2492: // Forlorn Woods (Crystalsong Forest)
+ if (x > 5568.0f && x < 6116.0f && y > 282.0f && y < 982.0f && z > 563.0f) areaflag = 2153; break;
+ // Maw of Neltharion (cave)
+ case 164: // Dragonblight
+ case 1797: // Obsidian Dragonshrine (Dragonblight)
+ case 1827: // Wintergrasp
+ case 2591: // The Cauldron of Flames (Wintergrasp)
+ if (x > 4364.0f && x < 4632.0f && y > 1545.0f && y < 1886.0f && z < 200.0f) areaflag = 1853; break;
+ // Undercity (sewers enter and path)
+ case 179: // Tirisfal Glades
+ if (x > 1595.0f && x < 1699.0f && y > 535.0f && y < 643.5f && z < 30.5f) areaflag = 685; break;
+ // Undercity (Royal Quarter)
+ case 210: // Silverpine Forest
+ case 316: // The Shining Strand (Silverpine Forest)
+ case 438: // Lordamere Lake (Silverpine Forest)
+ if (x > 1237.0f && x < 1401.0f && y > 284.0f && y < 440.0f && z < -40.0f) areaflag = 685; break;
+ // Undercity (cave and ground zone, part of royal quarter)
+ case 607: // Ruins of Lordaeron (Tirisfal Glades)
+ // ground and near to ground (by city walls)
+ if(z > 0.0f)
+ {
+ if (x > 1510.0f && x < 1839.0f && y > 29.77f && y < 433.0f) areaflag = 685;
+ }
+ // more wide underground, part of royal quarter
+ else
+ {
+ if (x > 1299.0f && x < 1839.0f && y > 10.0f && y < 440.0f) areaflag = 685;
+ }
+ break;
+ // The Makers' Perch (ground) and Makers' Overlook (ground and cave)
+ case 1335: // Sholazar Basin
+ // The Makers' Perch ground (fast box)
+ if (x > 6100.0f && x < 6250.0f && y > 5650.0f && y < 5800.0f)
+ {
+ // nice slow circle
+ if ((x-6183.0f)*(x-6183.0f)+(y-5717.0f)*(y-5717.0f) < 2500.0f)
+ areaflag = 2189;
+ }
+ // Makers' Overlook (ground and cave)
+ else if (x > 5634.48f && x < 5774.53f && y < 3475.0f && z > 300.0f)
+ {
+ if(y > 3380.26f || y > 3265.0f && z < 360.0f) areaflag = 2187;
+ }
+ break;
+ // The Makers' Perch (underground)
+ case 2147: // The Stormwright's Shelf (Sholazar Basin)
+ if (x > 6199.0f && x < 6283.0f && y > 5705.0f && y < 5817.0f && z < 38.0f) areaflag = 2189; break;
+ // Makers' Overlook (deep cave)
+ case 267: // Icecrown
+ if (x > 5684.0f && x < 5798.0f && y > 3035.0f && y < 3367.0f && z < 358.0f) areaflag = 2187; break;
+ // Wyrmrest Temple (Dragonblight)
+ case 1814: // Path of the Titans (Dragonblight)
+ case 1897: // The Dragon Wastes (Dragonblight)
+ // fast box
+ if (x > 3400.0f && x < 3700.0f && y > 130.0f && y < 420.0f)
+ {
+ // nice slow circle
+ if ((x-3546.87f)*(x-3546.87f)+(y-272.71f)*(y-272.71f) < 19600.0f) areaflag = 1791;
+ }
+ break;
+ }
+
+ return areaflag;
}
uint8 Map::GetTerrainType(float x, float y ) const
{
- //local x,y coords
- float lx,ly;
- int gx,gy;
-
- // half opt method
- gx=(int)(32-x/SIZE_OF_GRIDS) ; //grid x
- gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
-
- lx=16*(32 -x/SIZE_OF_GRIDS - gx);
- ly=16*(32 -y/SIZE_OF_GRIDS - gy);
-
- // ensure GridMap is loaded
- const_cast<Map*>(this)->EnsureGridCreated(GridPair(63-gx,63-gy));
-
- if(GridMaps[gx][gy])
- return GridMaps[gx][gy]->terrain_type[(int)(lx)][(int)(ly)];
+ if(GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ return gmap->getTerrainType(x, y);
else
return 0;
}
-float Map::GetWaterLevel(float x, float y ) const
+ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data) const
{
- //local x,y coords
- float lx,ly;
- int gx,gy;
-
- // half opt method
- gx=(int)(32-x/SIZE_OF_GRIDS) ; //grid x
- gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
-
- lx=128*(32 -x/SIZE_OF_GRIDS - gx);
- ly=128*(32 -y/SIZE_OF_GRIDS - gy);
-
- // ensure GridMap is loaded
- const_cast<Map*>(this)->EnsureGridCreated(GridPair(63-gx,63-gy));
+ if(GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ return gmap->getLiquidStatus(x, y, z, ReqLiquidType, data);
+ else
+ return LIQUID_MAP_NO_WATER;
+}
- if(GridMaps[gx][gy])
- return GridMaps[gx][gy]->liquid_level[(int)(lx)][(int)(ly)];
+float Map::GetWaterLevel(float x, float y ) const
+{
+ if(GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ return gmap->getLiquidLevel(x, y);
else
return 0;
}
-uint32 Map::GetAreaId(uint16 areaflag,uint32 map_id)
+uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id)
{
AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
@@ -1454,7 +1918,7 @@ uint32 Map::GetAreaId(uint16 areaflag,uint32 map_id)
return 0;
}
-uint32 Map::GetZoneId(uint16 areaflag,uint32 map_id)
+uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id)
{
AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
@@ -1464,26 +1928,37 @@ uint32 Map::GetZoneId(uint16 areaflag,uint32 map_id)
return 0;
}
-bool Map::IsInWater(float x, float y, float pZ) const
+void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id)
{
- // This method is called too often to use vamps for that (4. parameter = false).
- // The pZ pos is taken anyway for future use
- float z = GetHeight(x,y,pZ,false); // use .map base surface height
+ AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
- // underground or instance without vmap
- if(z <= INVALID_HEIGHT)
- return false;
+ areaid = entry ? entry->ID : 0;
+ zoneid = entry ? (( entry->zone != 0 ) ? entry->zone : entry->ID) : 0;
+}
- float water_z = GetWaterLevel(x,y);
- uint8 flag = GetTerrainType(x,y);
- return (z < (water_z-2)) && (flag & 0x01);
+bool Map::IsInWater(float x, float y, float pZ) const
+{
+ // Check surface in x, y point for liquid
+ if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ {
+ LiquidData liquid_status;
+ if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
+ {
+ if (liquid_status.level - liquid_status.depth_level > 2)
+ return true;
+ }
+ }
+ return false;
}
bool Map::IsUnderWater(float x, float y, float z) const
{
- float water_z = GetWaterLevel(x,y);
- uint8 flag = GetTerrainType(x,y);
- return (z < (water_z-2)) && (flag & 0x01);
+ if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
+ {
+ if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
+ return true;
+ }
+ return false;
}
bool Map::CheckGridIntegrity(Creature* c, bool moved) const
@@ -1573,7 +2048,8 @@ void Map::SendInitTransports( Player * player )
for (MapManager::TransportSet::iterator i = tset.begin(); i != tset.end(); ++i)
{
- if((*i) != player->GetTransport()) // send data for current transport in other place
+ // send data for current transport in other place
+ if((*i) != player->GetTransport() && (*i)->GetMapId()==i_id)
{
hasTransport = true;
(*i)->BuildCreateUpdateBlockForPlayer(&transData, player);
@@ -1600,7 +2076,7 @@ void Map::SendRemoveTransports( Player * player )
// except used transport
for (MapManager::TransportSet::iterator i = tset.begin(); i != tset.end(); ++i)
- if(player->GetTransport() != (*i))
+ if((*i) != player->GetTransport() && (*i)->GetMapId()!=i_id)
(*i)->BuildOutOfRangeUpdateBlock(&transData);
WorldPacket packet;
@@ -1657,7 +2133,7 @@ void Map::RemoveAllObjectsInRemoveList()
switch(obj->GetTypeId())
{
case TYPEID_UNIT:
- if(!((Creature*)obj)->isPet())
+ if(!((Creature*)obj)->isWorldCreature())
SwitchGridContainers((Creature*)obj, on);
break;
}
@@ -1804,8 +2280,9 @@ template void Map::Remove(DynamicObject *, bool);
/* ******* Dungeon Instance Maps ******* */
InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
- : Map(id, expiry, InstanceId, SpawnMode), i_data(NULL),
- m_resetAfterUnload(false), m_unloadWhenEmpty(false)
+ : Map(id, expiry, InstanceId, SpawnMode),
+ m_resetAfterUnload(false), m_unloadWhenEmpty(false),
+ i_data(NULL), i_script_id(0)
{
// the timer is started by default, and stopped when the first player joins
// this make sure it gets unloaded if for some reason no player joins
@@ -1834,10 +2311,10 @@ bool InstanceMap::CanEnter(Player *player)
}
// cannot enter if the instance is full (player cap), GMs don't count
- InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
- if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= iTemplate->maxPlayers)
+ uint32 maxPlayers = GetMaxPlayers();
+ if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= maxPlayers)
{
- sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), iTemplate->maxPlayers, player->GetName());
+ sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false;
}
@@ -1867,79 +2344,81 @@ bool InstanceMap::Add(Player *player)
if(!CanEnter(player))
return false;
- // get or create an instance save for the map
- InstanceSave *mapSave = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
- if(!mapSave)
+ // Dungeon only code
+ if(IsDungeon())
{
- sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
- mapSave = sInstanceSaveManager.AddInstanceSave(GetId(), GetInstanceId(), GetSpawnMode(), 0, true);
- }
-
- // check for existing instance binds
- InstancePlayerBind *playerBind = player->GetBoundInstance(GetId(), GetSpawnMode());
- if(playerBind && playerBind->perm)
- {
- // cannot enter other instances if bound permanently
- if(playerBind->save != mapSave)
+ // get or create an instance save for the map
+ InstanceSave *mapSave = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
+ if(!mapSave)
{
- sLog.outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d,%d,%d,%d,%d,%d but he is being put in instance %d,%d,%d,%d,%d,%d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
- assert(false);
+ sLog.outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
+ mapSave = sInstanceSaveManager.AddInstanceSave(GetId(), GetInstanceId(), GetSpawnMode(), 0, true);
}
- }
- else
- {
- Group *pGroup = player->GetGroup();
- if(pGroup)
+
+ // check for existing instance binds
+ InstancePlayerBind *playerBind = player->GetBoundInstance(GetId(), GetSpawnMode());
+ if(playerBind && playerBind->perm)
{
- // solo saves should be reset when entering a group
- InstanceGroupBind *groupBind = pGroup->GetBoundInstance(GetId(), GetSpawnMode());
- if(playerBind)
+ // cannot enter other instances if bound permanently
+ if(playerBind->save != mapSave)
{
- sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
- if(groupBind) sLog.outError("InstanceMap::Add: the group is bound to instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
- sLog.outError("InstanceMap::Add: do not let player %s enter instance otherwise crash will happen", player->GetName());
- return false;
- //player->UnbindInstance(GetId(), GetSpawnMode());
- //assert(false);
+ sLog.outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d,%d,%d,%d,%d,%d but he is being put in instance %d,%d,%d,%d,%d,%d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
+ assert(false);
}
- // bind to the group or keep using the group save
- if(!groupBind)
- pGroup->BindToInstance(mapSave, false);
- else
+ }
+ else
+ {
+ Group *pGroup = player->GetGroup();
+ if(pGroup)
{
- // cannot jump to a different instance without resetting it
- if(groupBind->save != mapSave)
+ // solo saves should be reset when entering a group
+ InstanceGroupBind *groupBind = pGroup->GetBoundInstance(GetId(), GetSpawnMode());
+ if(playerBind)
{
- sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d but he is in group %d which is bound to instance %d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(pGroup->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
- if(mapSave)
- sLog.outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
- else
- sLog.outError("MapSave NULL");
- if(groupBind->save)
- sLog.outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
- else
- sLog.outError("GroupBind save NULL");
- assert(false);
+ sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
+ if(groupBind) sLog.outError("InstanceMap::Add: the group is bound to instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
+ //assert(false);
+ return false;
}
- // if the group/leader is permanently bound to the instance
- // players also become permanently bound when they enter
- if(groupBind->perm)
+ // bind to the group or keep using the group save
+ if(!groupBind)
+ pGroup->BindToInstance(mapSave, false);
+ else
{
- WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
- data << uint32(0);
- player->GetSession()->SendPacket(&data);
- player->BindToInstance(mapSave, true);
+ // cannot jump to a different instance without resetting it
+ if(groupBind->save != mapSave)
+ {
+ sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d but he is in group %d which is bound to instance %d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(pGroup->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
+ if(mapSave)
+ sLog.outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
+ else
+ sLog.outError("MapSave NULL");
+ if(groupBind->save)
+ sLog.outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
+ else
+ sLog.outError("GroupBind save NULL");
+ assert(false);
+ }
+ // if the group/leader is permanently bound to the instance
+ // players also become permanently bound when they enter
+ if(groupBind->perm)
+ {
+ WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
+ data << uint32(0);
+ player->GetSession()->SendPacket(&data);
+ player->BindToInstance(mapSave, true);
+ }
}
}
- }
- else
- {
- // set up a solo bind or continue using it
- if(!playerBind)
- player->BindToInstance(mapSave, false);
else
- // cannot jump to a different instance without resetting it
- assert(playerBind->save == mapSave);
+ {
+ // set up a solo bind or continue using it
+ if(!playerBind)
+ player->BindToInstance(mapSave, false);
+ else
+ // cannot jump to a different instance without resetting it
+ assert(playerBind->save == mapSave);
+ }
}
}
@@ -1948,7 +2427,6 @@ bool InstanceMap::Add(Player *player)
// first player enters (no players yet)
SetResetSchedule(false);
- player->SendInitWorldStates();
sLog.outDetail("MAP: Player '%s' entered the instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
// initialize unload state
m_unloadTimer = 0;
@@ -2075,10 +2553,13 @@ bool InstanceMap::Reset(uint8 method)
void InstanceMap::PermBindAllPlayers(Player *player)
{
+ if(!IsDungeon())
+ return;
+
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
if(!save)
{
- sLog.outError("Cannot bind players, no instance save available for map!\n");
+ sLog.outError("Cannot bind players, no instance save available for map!");
return;
}
@@ -2104,12 +2585,6 @@ void InstanceMap::PermBindAllPlayers(Player *player)
}
}
-time_t InstanceMap::GetResetTime()
-{
- InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
- return save ? save->GetDifficulty() : DIFFICULTY_NORMAL;
-}
-
void InstanceMap::UnloadAll()
{
if(HavePlayers())
@@ -2139,7 +2614,7 @@ void InstanceMap::SetResetSchedule(bool on)
// only for normal instances
// the reset time is only scheduled when there are no payers inside
// it is assumed that the reset time will rarely (if ever) change while the reset is scheduled
- if(!HavePlayers() && !IsRaid() && !IsHeroic())
+ if(IsDungeon() && !HavePlayers() && !IsRaid() && !IsHeroic())
{
InstanceSave *save = sInstanceSaveManager.GetInstanceSave(GetInstanceId());
if(!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
@@ -2147,6 +2622,14 @@ void InstanceMap::SetResetSchedule(bool on)
}
}
+uint32 InstanceMap::GetMaxPlayers() const
+{
+ InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
+ if(!iTemplate)
+ return 0;
+ return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers;
+}
+
/* ******* Battleground Instance Maps ******* */
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId)
@@ -2204,7 +2687,7 @@ void BattleGroundMap::UnloadAll()
{
if(Player * plr = m_mapRefManager.getFirst()->getSource())
{
- plr->TeleportTo(plr->m_homebindMapId, plr->m_homebindX, plr->m_homebindY, plr->m_homebindZ, plr->GetOrientation());
+ plr->TeleportTo(plr->GetBattleGroundEntryPoint());
// TeleportTo removes the player from this map (if the map exists) -> calls BattleGroundMap::Remove -> invalidates the iterator.
// just in case, remove the player from the list explicitly here as well to prevent a possible infinite loop
// note that this remove is not needed if the code works well in other places
diff --git a/src/game/Map.h b/src/game/Map.h
index f72b0c15ec3..fe29f448d27 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -26,7 +26,7 @@
#include "zthread/Lockable.h"
#include "zthread/Mutex.h"
#include "zthread/FairReadWriteLock.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
#include "GridDefines.h"
#include "Cell.h"
#include "Timer.h"
@@ -43,6 +43,7 @@ class InstanceData;
class Group;
class InstanceSave;
class WorldObject;
+class TempSummon;
class CreatureGroup;
namespace ZThread
@@ -71,15 +72,135 @@ typedef RGuard<GridRWLock, ZThread::Lockable> GridReadGuard;
typedef WGuard<GridRWLock, ZThread::Lockable> GridWriteGuard;
typedef Trinity::SingleThreaded<GridRWLock>::Lock NullGuard;
-typedef struct
+//******************************************
+// Map file format defines
+//******************************************
+#define MAP_MAGIC 'SPAM'
+#define MAP_VERSION_MAGIC '0.1w'
+#define MAP_AREA_MAGIC 'AERA'
+#define MAP_HEIGTH_MAGIC 'TGHM'
+#define MAP_LIQUID_MAGIC 'QILM'
+
+struct map_fileheader{
+ uint32 mapMagic;
+ uint32 versionMagic;
+ uint32 areaMapOffset;
+ uint32 areaMapSize;
+ uint32 heightMapOffset;
+ uint32 heightMapSize;
+ uint32 liquidMapOffset;
+ uint32 liquidMapSize;
+};
+
+#define MAP_AREA_NO_AREA 0x0001
+struct map_areaHeader{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 gridArea;
+};
+
+#define MAP_HEIGHT_NO_HIGHT 0x0001
+#define MAP_HEIGHT_AS_INT16 0x0002
+#define MAP_HEIGHT_AS_INT8 0x0004
+
+struct map_heightHeader{
+ uint32 fourcc;
+ uint32 flags;
+ float gridHeight;
+ float gridMaxHeight;
+};
+
+#define MAP_LIQUID_NO_TYPE 0x0001
+#define MAP_LIQUID_NO_HIGHT 0x0002
+struct map_liquidHeader{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 liquidType;
+ uint8 offsetX;
+ uint8 offsetY;
+ uint8 width;
+ uint8 height;
+ float liquidLevel;
+};
+
+enum ZLiquidStatus{
+ LIQUID_MAP_NO_WATER = 0x00000000,
+ LIQUID_MAP_ABOVE_WATER = 0x00000001,
+ LIQUID_MAP_WATER_WALK = 0x00000002,
+ LIQUID_MAP_IN_WATER = 0x00000004,
+ LIQUID_MAP_UNDER_WATER = 0x00000008
+};
+
+#define MAP_LIQUID_TYPE_NO_WATER 0x00
+#define MAP_LIQUID_TYPE_WATER 0x01
+#define MAP_LIQUID_TYPE_OCEAN 0x02
+#define MAP_LIQUID_TYPE_MAGMA 0x04
+#define MAP_LIQUID_TYPE_SLIME 0x08
+
+#define MAP_ALL_LIQUIDS (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME)
+
+#define MAP_LIQUID_TYPE_DARK_WATER 0x10
+#define MAP_LIQUID_TYPE_WMO_WATER 0x20
+
+struct LiquidData{
+ uint32 type;
+ float level;
+ float depth_level;
+};
+
+class GridMap
{
- uint16 area_flag[16][16];
- uint8 terrain_type[16][16];
- float liquid_level[128][128];
- float v9[16 * 8 + 1][16 * 8 + 1];
- float v8[16 * 8][16 * 8];
- //float Z[MAP_RESOLUTION][MAP_RESOLUTION];
-}GridMap;
+ uint32 m_flags;
+ // Area data
+ uint16 m_gridArea;
+ uint16 *m_area_map;
+ // Height level data
+ float m_gridHeight;
+ float m_gridIntHeightMultiplier;
+ union{
+ float *m_V9;
+ uint16 *m_uint16_V9;
+ uint8 *m_uint8_V9;
+ };
+ union{
+ float *m_V8;
+ uint16 *m_uint16_V8;
+ uint8 *m_uint8_V8;
+ };
+ // Liquid data
+ uint16 m_liquidType;
+ uint8 m_liquid_offX;
+ uint8 m_liquid_offY;
+ uint8 m_liquid_width;
+ uint8 m_liquid_height;
+ float m_liquidLevel;
+ uint8 *m_liquid_type;
+ float *m_liquid_map;
+
+ bool loadAreaData(FILE *in, uint32 offset, uint32 size);
+ bool loadHeihgtData(FILE *in, uint32 offset, uint32 size);
+ bool loadLiquidData(FILE *in, uint32 offset, uint32 size);
+
+ // Get height functions and pointers
+ typedef float (GridMap::*pGetHeightPtr) (float x, float y) const;
+ pGetHeightPtr m_gridGetHeight;
+ float getHeightFromFloat(float x, float y) const;
+ float getHeightFromUint16(float x, float y) const;
+ float getHeightFromUint8(float x, float y) const;
+ float getHeightFromFlat(float x, float y) const;
+
+public:
+ GridMap();
+ ~GridMap();
+ bool loadData(char *filaname);
+ void unloadData();
+
+ uint16 getArea(float x, float y);
+ inline float getHeight(float x, float y) {return (this->*m_gridGetHeight)(x, y);}
+ float getLiquidLevel(float x, float y);
+ uint8 getTerrainType(float x, float y);
+ ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data = 0);
+};
struct CreatureMover
{
@@ -99,9 +220,10 @@ struct CreatureMover
struct InstanceTemplate
{
uint32 map;
- uint32 parent;
+ uint32 parent;
uint32 maxPlayers;
- uint32 reset_delay;
+ uint32 maxPlayersHeroic;
+ uint32 reset_delay; // FIX ME: now exist normal/heroic raids with possible different time of reset.
uint32 access_id;
float startLocX;
float startLocY;
@@ -182,9 +304,8 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
time_t GetGridExpiry(void) const { return i_gridExpiry; }
uint32 GetId(void) const { return i_id; }
- static bool ExistMap(uint32 mapid, int x, int y);
- static bool ExistVMap(uint32 mapid, int x, int y);
- void LoadMapAndVMap(uint32 mapid, uint32 instanceid, int x, int y);
+ static bool ExistMap(uint32 mapid, int gx, int gy);
+ static bool ExistVMap(uint32 mapid, int gx, int gy);
static void InitStateMachine();
static void DeleteStateMachine();
@@ -195,22 +316,30 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
float GetVmapHeight(float x, float y, float z, bool useMaps) const;
bool IsInWater(float x, float y, float z) const; // does not use z pos. This is for future use
- uint16 GetAreaFlag(float x, float y ) const;
+ ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data = 0) const;
+
+ uint16 GetAreaFlag(float x, float y, float z) const;
uint8 GetTerrainType(float x, float y ) const;
float GetWaterLevel(float x, float y ) const;
bool IsUnderWater(float x, float y, float z) const;
- static uint32 GetAreaId(uint16 areaflag,uint32 map_id);
- static uint32 GetZoneId(uint16 areaflag,uint32 map_id);
+ static uint32 GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id);
+ static uint32 GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id);
+ static void GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id);
- uint32 GetAreaId(float x, float y) const
+ uint32 GetAreaId(float x, float y, float z) const
{
- return GetAreaId(GetAreaFlag(x,y),i_id);
+ return GetAreaIdByAreaFlag(GetAreaFlag(x,y,z),i_id);
}
- uint32 GetZoneId(float x, float y) const
+ uint32 GetZoneId(float x, float y, float z) const
{
- return GetZoneId(GetAreaFlag(x,y),i_id);
+ return GetZoneIdByAreaFlag(GetAreaFlag(x,y,z),i_id);
+ }
+
+ void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, float x, float y, float z) const
+ {
+ GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(x,y,z),i_id);
}
virtual void MoveAllCreaturesInMoveList();
@@ -221,8 +350,8 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
// assert print helper
bool CheckGridIntegrity(Creature* c, bool moved) const;
- uint32 GetInstanceId() { return i_InstanceId; }
- uint8 GetSpawnMode() { return (i_spawnMode); }
+ uint32 GetInstanceId() const { return i_InstanceId; }
+ uint8 GetSpawnMode() const { return (i_spawnMode); }
virtual bool CanEnter(Player* /*player*/) { return true; }
const char* GetMapName() const;
@@ -234,6 +363,17 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); }
bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); }
+ bool GetEntrancePos(int32 &mapid, float &x, float &y)
+ {
+ if(!i_mapEntry)
+ return false;
+ if(i_mapEntry->entrance_map < 0)
+ return false;
+ mapid = i_mapEntry->entrance_map;
+ x = i_mapEntry->entrance_x;
+ y = i_mapEntry->entrance_y;
+ return true;
+ }
void AddObjectToRemoveList(WorldObject *obj);
void AddObjectToSwitchList(WorldObject *obj, bool on);
@@ -277,10 +417,16 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
template<class NOTIFIER> void VisitAll(const float &x, const float &y, float radius, NOTIFIER &notifier);
template<class NOTIFIER> void VisitWorld(const float &x, const float &y, float radius, NOTIFIER &notifier);
template<class NOTIFIER> void VisitGrid(const float &x, const float &y, float radius, NOTIFIER &notifier);
- CreatureGroupHolderType CreatureGroupHolder;
+
+ TempSummon *SummonCreature(uint32 entry, float x, float y, float z, float angle, SummonPropertiesEntry const *properties = NULL, uint32 duration = 0, Unit *summoner = NULL);
+
+ CreatureGroupHolderType CreatureGroupHolder;
+
private:
- void LoadVMap(int pX, int pY);
- void LoadMap(uint32 mapid, uint32 instanceid, int x,int y);
+ void LoadMapAndVMap(int gx, int gy);
+ void LoadVMap(int gx, int gy);
+ void LoadMap(int gx,int gy);
+ GridMap *GetGrid(float x, float y);
void SetTimer(uint32 t) { i_gridExpiry = t < MIN_GRID_DELAY ? MIN_GRID_DELAY : t; }
//uint64 CalculateGridMask(const uint32 &y) const;
@@ -296,8 +442,9 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
CreatureMoveList i_creaturesToMove;
bool loaded(const GridPair &) const;
- void EnsureGridLoaded(const Cell&, Player* player = NULL);
- void EnsureGridCreated(const GridPair &);
+ void EnsureGridCreated(const GridPair &);
+ bool EnsureGridLoaded(Cell const&);
+ void EnsureGridLoadedAtEnter(Cell const&, Player* player = NULL);
void buildNGridLinkage(NGridType* pNGridType) { pNGridType->link(this); }
@@ -410,11 +557,11 @@ class TRINITY_DLL_SPEC InstanceMap : public Map
uint32 GetScriptId() { return i_script_id; }
InstanceData* GetInstanceData() { return i_data; }
void PermBindAllPlayers(Player *player);
- time_t GetResetTime();
void UnloadAll();
bool CanEnter(Player* player);
void SendResetWarnings(uint32 timeLeft) const;
void SetResetSchedule(bool on);
+ uint32 GetMaxPlayers() const;
private:
bool m_resetAfterUnload;
bool m_unloadWhenEmpty;
diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp
index fcdc2f76c11..99d677afffa 100644
--- a/src/game/MapInstanced.cpp
+++ b/src/game/MapInstanced.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/MapInstanced.h b/src/game/MapInstanced.h
index d34a5cf2dfb..70e59065577 100644
--- a/src/game/MapInstanced.h
+++ b/src/game/MapInstanced.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ class TRINITY_DLL_DECL MapInstanced : public Map
SetUnloadReferenceLock(GridPair(63-p.x_coord, 63-p.y_coord), true);
}
- void RemoveGridMapReference(const GridPair &p)
+ void RemoveGridMapReference(GridPair const& p)
{
--GridMapReference[p.x_coord][p.y_coord];
if (!GridMapReference[p.x_coord][p.y_coord])
diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp
index 6a8cd130691..061e0252a13 100644
--- a/src/game/MapManager.cpp
+++ b/src/game/MapManager.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
#include "CellImpl.h"
#include "Corpse.h"
#include "ObjectMgr.h"
+#include "Language.h"
#define CLASS_LOCK Trinity::ClassLevelLockable<MapManager, ZThread::Mutex>
INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK);
@@ -165,7 +166,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
{
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
// TODO: this is not a good place to send the message
- player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(810), mapName);
+ player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName);
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
return false;
}
@@ -175,7 +176,8 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
//The player has a heroic mode and tries to enter into instance which has no a heroic mode
if (!entry->SupportsHeroicMode() && player->GetDifficulty() == DIFFICULTY_HEROIC)
{
- player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY2); //Send aborted message
+ //Send aborted message
+ player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, DIFFICULTY_HEROIC);
return false;
}
@@ -213,7 +215,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid);
if(!instance)
return false;
-
+
return player->Satisfy(objmgr.GetAccessRequirement(instance->access_id), mapid, true);
}
else
@@ -238,7 +240,7 @@ void MapManager::RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y)
}
void
-MapManager::Update(time_t diff)
+MapManager::Update(uint32 diff)
{
i_timer.Update(diff);
if( !i_timer.Passed() )
@@ -284,7 +286,8 @@ bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)
bool MapManager::IsValidMAP(uint32 mapid)
{
MapEntry const* mEntry = sMapStore.LookupEntry(mapid);
- return mEntry && (!mEntry->Instanceable() || objmgr.GetInstanceTemplate(mapid));
+ return mEntry && (!mEntry->IsDungeon() || objmgr.GetInstanceTemplate(mapid));
+ // TODO: add check for battleground template
}
/*void MapManager::LoadGrid(int mapid, float x, float y, const WorldObject* obj, bool no_unload)
diff --git a/src/game/MapManager.h b/src/game/MapManager.h
index ce2e9ab012b..143248de162 100644
--- a/src/game/MapManager.h
+++ b/src/game/MapManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,18 +47,28 @@ class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinit
Map const* GetBaseMap(uint32 id) const { return const_cast<MapManager*>(this)->_GetBaseMap(id); }
void DeleteInstance(uint32 mapid, uint32 instanceId);
- inline uint16 GetAreaFlag(uint32 mapid, float x, float y) const
+ uint16 GetAreaFlag(uint32 mapid, float x, float y, float z) const
{
Map const* m = GetBaseMap(mapid);
- return m->GetAreaFlag(x, y);
+ return m->GetAreaFlag(x, y, z);
+ }
+ uint32 GetAreaId(uint32 mapid, float x, float y, float z) const
+ {
+ return Map::GetAreaIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid);
+ }
+ uint32 GetZoneId(uint32 mapid, float x, float y, float z) const
+ {
+ return Map::GetZoneIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid);
+ }
+ void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, uint32 mapid, float x, float y, float z)
+ {
+ Map::GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(mapid, x, y, z),mapid);
}
- inline uint32 GetAreaId(uint32 mapid, float x, float y) { return Map::GetAreaId(GetAreaFlag(mapid, x, y),mapid); }
- inline uint32 GetZoneId(uint32 mapid, float x, float y) { return Map::GetZoneId(GetAreaFlag(mapid, x, y),mapid); }
void Initialize(void);
- void Update(time_t);
+ void Update(uint32);
- inline void SetGridCleanUpDelay(uint32 t)
+ void SetGridCleanUpDelay(uint32 t)
{
if( t < MIN_GRID_DELAY )
i_gridCleanUpDelay = MIN_GRID_DELAY;
@@ -66,7 +76,7 @@ class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinit
i_gridCleanUpDelay = t;
}
- inline void SetMapUpdateInterval(uint32 t)
+ void SetMapUpdateInterval(uint32 t)
{
if( t > MIN_MAP_UPDATE_DELAY )
t = MIN_MAP_UPDATE_DELAY;
@@ -96,6 +106,11 @@ class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinit
return IsValidMAP(mapid) && Trinity::IsValidMapCoord(x,y,z,o);
}
+ static bool IsValidMapCoord(WorldLocation const& loc)
+ {
+ return IsValidMapCoord(loc.mapid,loc.x,loc.y,loc.z,loc.o);
+ }
+
void DoDelayedMovesAndRemoves();
void LoadTransports();
@@ -108,7 +123,7 @@ class TRINITY_DLL_DECL MapManager : public Trinity::Singleton<MapManager, Trinit
bool CanPlayerEnter(uint32 mapid, Player* player);
void RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y);
- inline uint32 GenerateInstanceId() { return ++i_MaxInstanceId; }
+ uint32 GenerateInstanceId() { return ++i_MaxInstanceId; }
void InitMaxInstanceId();
/* statistics */
diff --git a/src/game/MapRefManager.h b/src/game/MapRefManager.h
index cf8170a7bb3..4337aa75fd9 100644
--- a/src/game/MapRefManager.h
+++ b/src/game/MapRefManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
+ * 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
diff --git a/src/game/MapReference.h b/src/game/MapReference.h
index 50a7dcea5a4..ae485af7487 100644
--- a/src/game/MapReference.h
+++ b/src/game/MapReference.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
+ * 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
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index 14da3a94360..ca7a9effbfb 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,15 +37,14 @@
#include "Chat.h"
#include "ScriptCalls.h"
#include <zlib/zlib.h>
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Object.h"
#include "BattleGround.h"
#include "OutdoorPvP.h"
-#include "SpellAuras.h"
#include "Pet.h"
#include "SocialMgr.h"
#include "CellImpl.h"
+#include "Vehicle.h"
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
{
@@ -120,7 +119,7 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!code.empty())
{
@@ -356,7 +355,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
//Can not logout if...
if( GetPlayer()->isInCombat() || //...is in combat
GetPlayer()->duel || //...is in Duel
- GetPlayer()->HasAura(9454,0) || //...is frozen by GM via freeze command
+ GetPlayer()->HasAura(9454) || //...is frozen by GM via freeze command
//...is jumping ...is falling
GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING))
{
@@ -380,13 +379,13 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
// not set flags if player can't free move to prevent lost state at logout cancel
if(GetPlayer()->CanFreeMove())
{
- GetPlayer()->SetStandState(PLAYER_STATE_SIT);
+ GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
WorldPacket data( SMSG_FORCE_MOVE_ROOT, (8+4) ); // guess size
data.append(GetPlayer()->GetPackGUID());
data << (uint32)2;
SendPacket( &data );
- GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
WorldPacket data( SMSG_LOGOUT_RESPONSE, 5 );
@@ -420,10 +419,10 @@ void WorldSession::HandleLogoutCancelOpcode( WorldPacket & /*recv_data*/ )
SendPacket( &data );
//! Stand Up
- GetPlayer()->SetStandState(PLAYER_STATE_NONE);
+ GetPlayer()->SetStandState(UNIT_STAND_STATE_STAND);
//! DISABLE_ROTATE
- GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
sLog.outDebug( "WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message" );
@@ -437,10 +436,12 @@ void WorldSession::HandleTogglePvP( WorldPacket & recv_data )
bool newPvPStatus;
recv_data >> newPvPStatus;
GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP, newPvPStatus);
+ GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER, !newPvPStatus);
}
else
{
GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
+ GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER);
}
if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
@@ -469,9 +470,11 @@ void WorldSession::HandleZoneUpdateOpcode( WorldPacket & recv_data )
sLog.outDetail("WORLD: Recvd ZONE_UPDATE: %u", newZone);
- GetPlayer()->UpdateZone(newZone);
-
- GetPlayer()->SendInitWorldStates(true,newZone);
+ // use server size data
+ uint32 newzone, newarea;
+ GetPlayer()->GetZoneAndAreaId(newzone,newarea);
+ GetPlayer()->UpdateZone(newzone,newarea);
+ //GetPlayer()->SendInitWorldStates(true,newZone);
}
void WorldSession::HandleSetTargetOpcode( WorldPacket & recv_data )
@@ -489,7 +492,8 @@ void WorldSession::HandleSetTargetOpcode( WorldPacket & recv_data )
if(!unit)
return;
- _player->SetFactionVisibleForFactionTemplateId(unit->getFaction());
+ if(FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
+ _player->GetReputationMgr().SetVisible(factionTemplateEntry);
}
void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
@@ -506,7 +510,8 @@ void WorldSession::HandleSetSelectionOpcode( WorldPacket & recv_data )
if(!unit)
return;
- _player->SetFactionVisibleForFactionTemplateId(unit->getFaction());
+ if(FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
+ _player->GetReputationMgr().SetVisible(factionTemplateEntry);
}
void WorldSession::HandleStandStateChangeOpcode( WorldPacket & recv_data )
@@ -562,12 +567,12 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
uint64 friendGuid;
uint32 team;
FriendsResult friendResult;
-
+
WorldSession * session = sWorld.FindSession(accountId);
if(!session || !session->GetPlayer())
return;
-
+
friendResult = FRIEND_NOT_FOUND;
friendGuid = 0;
@@ -651,12 +656,12 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
{
uint64 IgnoreGuid;
FriendsResult ignoreResult;
-
+
WorldSession * session = sWorld.FindSession(accountId);
if(!session || !session->GetPlayer())
return;
-
+
ignoreResult = FRIEND_IGNORE_NOT_FOUND;
IgnoreGuid = 0;
@@ -675,7 +680,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
else
{
ignoreResult = FRIEND_IGNORE_ADDED;
-
+
// ignore list full
if(!session->GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(IgnoreGuid), true))
ignoreResult = FRIEND_IGNORE_FULL;
@@ -902,7 +907,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
GetPlayer()->SetRestType(REST_TYPE_IN_TAVERN);
if(sWorld.IsFFAPvPRealm())
- GetPlayer()->RemoveFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ GetPlayer()->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
return;
}
@@ -934,16 +939,96 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT);
}
-void WorldSession::HandleUpdateAccountData(WorldPacket &/*recv_data*/)
+void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data)
{
sLog.outDetail("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA");
- //recv_data.hexlike();
+
+ CHECK_PACKET_SIZE(recv_data, 4+4+4);
+
+ uint32 type, timestamp, decompressedSize;
+ recv_data >> type >> timestamp >> decompressedSize;
+
+ sLog.outDebug("UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize);
+
+ if(type > NUM_ACCOUNT_DATA_TYPES)
+ return;
+
+ if(decompressedSize == 0) // erase
+ {
+ SetAccountData(type, 0, "");
+
+ WorldPacket data(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, 4+4);
+ data << uint32(type);
+ data << uint32(0);
+ SendPacket(&data);
+
+ return;
+ }
+
+ if(decompressedSize > 0xFFFF)
+ {
+ sLog.outError("UAD: Account data packet too big, size %u", decompressedSize);
+ return;
+ }
+
+ ByteBuffer dest;
+ dest.resize(decompressedSize);
+
+ uLongf realSize = decompressedSize;
+ if(uncompress(const_cast<uint8*>(dest.contents()), &realSize, const_cast<uint8*>(recv_data.contents() + recv_data.rpos()), recv_data.size() - recv_data.rpos()) != Z_OK)
+ {
+ sLog.outError("UAD: Failed to decompress account data");
+ return;
+ }
+
+ std::string adata;
+ dest >> adata;
+
+ SetAccountData(type, timestamp, adata);
+
+ WorldPacket data(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, 4+4);
+ data << uint32(type);
+ data << uint32(0);
+ SendPacket(&data);
}
-void WorldSession::HandleRequestAccountData(WorldPacket& /*recv_data*/)
+void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
{
sLog.outDetail("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA");
- //recv_data.hexlike();
+
+ CHECK_PACKET_SIZE(recv_data, 4);
+
+ uint32 type;
+ recv_data >> type;
+
+ sLog.outDebug("RAD: type %u", type);
+
+ if(type > NUM_ACCOUNT_DATA_TYPES)
+ return;
+
+ AccountData *adata = GetAccountData(type);
+
+ uint32 size = adata->Data.size();
+
+ ByteBuffer dest;
+ dest.resize(size);
+
+ uLongf destSize = size;
+ if(size && compress(const_cast<uint8*>(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK)
+ {
+ sLog.outDebug("RAD: Failed to compress account data");
+ return;
+ }
+
+ dest.resize(destSize);
+
+ WorldPacket data (SMSG_UPDATE_ACCOUNT_DATA, 8+4+4+4+destSize);
+ data << uint64(_player->GetGUID()); // player guid
+ data << uint32(type); // type (0-7)
+ data << uint32(adata->Time); // unix time
+ data << uint32(size); // decompressed length
+ data.append(dest); // compressed data
+ SendPacket(&data);
}
void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
@@ -970,7 +1055,7 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
}
else if(type==ACTION_BUTTON_SPELL)
{
- sLog.outDetail( "MISC: Added Action %u into button %u", action, button );
+ sLog.outDetail( "MISC: Added Spell %u into button %u", action, button );
GetPlayer()->addActionButton(button,action,type,misc);
}
else if(type==ACTION_BUTTON_ITEM)
@@ -1087,22 +1172,6 @@ void WorldSession::HandleMoveRootAck(WorldPacket&/* recv_data*/)
*/
}
-void WorldSession::HandleMoveTeleportAck(WorldPacket&/* recv_data*/)
-{
- /*
- CHECK_PACKET_SIZE(recv_data,8+4);
-
- sLog.outDebug("MSG_MOVE_TELEPORT_ACK");
- uint64 guid;
- uint32 flags, time;
-
- recv_data >> guid;
- recv_data >> flags >> time;
- DEBUG_LOG("Guid " I64FMTD,guid);
- DEBUG_LOG("Flags %u, time %u",flags, time/1000);
- */
-}
-
void WorldSession::HandleSetActionBar(WorldPacket& recv_data)
{
CHECK_PACKET_SIZE(recv_data,1);
@@ -1190,7 +1259,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
// find talent rank
uint32 curtalent_maxrank = 0;
- for(uint32 k = 5; k > 0; --k)
+ for(uint32 k = MAX_TALENT_RANK; k > 0; --k)
{
if(talentInfo->RankID[k-1] && plr->HasSpell(talentInfo->RankID[k-1]))
{
@@ -1427,22 +1496,18 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
uint8 apply;
recv_data >> apply;
- CellPair pair;
-
switch(apply)
{
case 0:
- _player->SetFarsightVision(false);
- pair = Trinity::ComputeCellPair(_player->GetPositionX(), _player->GetPositionY());
- sLog.outDebug("Player %u set vision to himself", _player->GetGUIDLow());
+ sLog.outDebug("Player %u set vision to self", _player->GetGUIDLow());
+ _player->SetSeer(_player);
break;
case 1:
- _player->SetFarsightVision(true);
- if (WorldObject* obj = _player->GetFarsightTarget())
- pair = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+ sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
+ if(WorldObject *target = _player->GetViewpoint())
+ _player->SetSeer(target);
else
- return;
- sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetFarSight(), _player->GetGUIDLow());
+ sLog.outError("Player %s requests non-existing seer", _player->GetName());
break;
default:
sLog.outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply);
@@ -1475,11 +1540,11 @@ void WorldSession::HandleChooseTitleOpcode( WorldPacket & recv_data )
GetPlayer()->SetUInt32Value(PLAYER_CHOSEN_TITLE, title);
}
-void WorldSession::HandleAllowMoveAckOpcode( WorldPacket & recv_data )
+void WorldSession::HandleTimeSyncResp( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data, 4+4);
- sLog.outDebug("CMSG_ALLOW_MOVE_ACK");
+ sLog.outDebug("CMSG_TIME_SYNC_RESP");
uint32 counter, time_;
recv_data >> counter >> time_;
@@ -1549,26 +1614,6 @@ void WorldSession::HandleDungeonDifficultyOpcode( WorldPacket & recv_data )
}
}
-void WorldSession::HandleNewUnknownOpcode( WorldPacket & recv_data )
-{
- sLog.outDebug("New Unknown Opcode %u", recv_data.GetOpcode());
- recv_data.hexlike();
- /*
- New Unknown Opcode 837
- STORAGE_SIZE: 60
- 02 00 00 00 00 00 00 00 | 00 00 00 00 01 20 00 00
- 89 EB 33 01 71 5C 24 C4 | 15 03 35 45 74 47 8B 42
- BA B8 1B 40 00 00 00 00 | 00 00 00 00 77 66 42 BF
- 23 91 26 3F 00 00 60 41 | 00 00 00 00
-
- New Unknown Opcode 837
- STORAGE_SIZE: 44
- 02 00 00 00 00 00 00 00 | 00 00 00 00 00 00 80 00
- 7B 80 34 01 84 EA 2B C4 | 5F A1 36 45 C9 39 1C 42
- BA B8 1B 40 CE 06 00 00 | 00 00 80 3F
- */
-}
-
void WorldSession::HandleDismountOpcode( WorldPacket & /*recv_data*/ )
{
sLog.outDebug("WORLD: CMSG_CANCEL_MOUNT_AURA");
@@ -1588,7 +1633,7 @@ void WorldSession::HandleDismountOpcode( WorldPacket & /*recv_data*/ )
}
_player->Unmount();
- _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ _player->RemoveAurasByType(SPELL_AURA_MOUNTED);
}
void WorldSession::HandleMoveFlyModeChangeAckOpcode( WorldPacket & recv_data )
@@ -1636,3 +1681,34 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode( WorldPacket & recv_data )
sLog.outDebug("Client used \"/timetest %d\" command", mode);
}
+void WorldSession::HandleSpellClick( WorldPacket & recv_data )
+{
+ CHECK_PACKET_SIZE(recv_data, 8);
+
+ uint64 guid;
+ recv_data >> guid;
+
+ Vehicle *vehicle = ObjectAccessor::GetVehicle(guid);
+
+ if(!vehicle)
+ {
+ sLog.outError("Player %s cannot find vehicle %u", _player->GetName(), guid);
+ return;
+ }
+
+ vehicle->AddPassenger(_player);
+}
+
+void WorldSession::HandleInspectAchievements( WorldPacket & recv_data )
+{
+ CHECK_PACKET_SIZE(recv_data, 1);
+ uint64 guid;
+ if(!recv_data.readPackGUID(guid))
+ return;
+
+ Player *player = objmgr.GetPlayer(guid);
+ if(!player)
+ return;
+
+ player->GetAchievementMgr().SendRespondInspectAchievements(_player);
+}
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index 9beecf9c5cf..51e684c5a6c 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -50,17 +50,20 @@ MotionMaster::Initialize()
if(curr) DirectDelete(curr);
}
- // set new default movement generator
+ InitDefault();
+}
+
+// set new default movement generator
+void MotionMaster::InitDefault()
+{
if(i_owner->GetTypeId() == TYPEID_UNIT)
{
MovementGenerator* movement = FactorySelector::selectMovementGenerator((Creature*)i_owner);
- push( movement == NULL ? &si_idleMovement : movement );
- InitTop();
+ Mutate(movement == NULL ? &si_idleMovement : movement, MOTION_SLOT_IDLE);
}
else
{
- push(&si_idleMovement);
- needInit[MOTION_SLOT_IDLE] = false;
+ Mutate(&si_idleMovement, MOTION_SLOT_IDLE);
}
}
@@ -200,28 +203,22 @@ MotionMaster::MoveTargetedHome()
Clear(false);
- if(i_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)i_owner)->GetCharmerOrOwnerGUID())
+ if(Unit *target = i_owner->GetCharmerOrOwner())
{
- DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow());
- Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
+ DEBUG_LOG("Pet or controlled unit (Entry: %u GUID: %u) targeting home",
+ i_owner->GetEntry(), i_owner->GetGUIDLow() );
+
+ MoveFollow(target, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE, MOTION_SLOT_IDLE);
}
- else if(i_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)i_owner)->GetCharmerOrOwnerGUID())
+ else if(i_owner->GetTypeId() == TYPEID_UNIT)
{
- DEBUG_LOG("Pet or controlled creature (Entry: %u GUID: %u) targeting home",
- i_owner->GetEntry(), i_owner->GetGUIDLow() );
- Unit *target = ((Creature*)i_owner)->GetCharmerOrOwner();
- if(target)
- {
- i_owner->addUnitState(UNIT_STAT_FOLLOW);
- DEBUG_LOG("Following %s (GUID: %u)",
- target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
- target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
- Mutate(new TargetedMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
- }
+ DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow());
+ Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
}
else
{
sLog.outError("Player (GUID: %u) attempt targeted home", i_owner->GetGUIDLow() );
+ return;
}
}
@@ -268,7 +265,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle)
}
void
-MotionMaster::MoveFollow(Unit* target, float dist, float angle)
+MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
{
// ignore movement request if target not exist
if(!target || target == i_owner)
@@ -280,7 +277,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle)
DEBUG_LOG("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? i_owner->GetGUIDLow() : ((Creature*)i_owner)->GetDBTableGUIDLow() );
- Mutate(new TargetedMovementGenerator<Player>(*target,dist,angle), MOTION_SLOT_ACTIVE);
+ Mutate(new TargetedMovementGenerator<Player>(*target,dist,angle), slot);
}
else
{
@@ -288,7 +285,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle)
i_owner->GetEntry(), i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
- Mutate(new TargetedMovementGenerator<Creature>(*target,dist,angle), MOTION_SLOT_ACTIVE);
+ Mutate(new TargetedMovementGenerator<Creature>(*target,dist,angle), slot);
}
}
@@ -308,13 +305,59 @@ MotionMaster::MovePoint(uint32 id, float x, float y, float z)
}
}
+void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
+{
+ //this function may make players fall below map
+ if(i_owner->GetTypeId()==TYPEID_PLAYER)
+ return;
+
+ float x, y, z;
+ float dist = speedXY * speedZ * 0.1f;
+ i_owner->GetNearPoint(i_owner, x, y, z, i_owner->GetObjectSize(), dist, i_owner->GetAngle(srcX, srcY) + M_PI);
+ MoveJump(x, y, z, speedXY, speedZ);
+}
+
+void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
+{
+ //this function may make players fall below map
+ if(i_owner->GetTypeId()==TYPEID_PLAYER)
+ return;
+
+ float x, y, z;
+ float dist = speedXY * speedZ * 0.1f;
+ i_owner->GetClosePoint(x, y, z, i_owner->GetObjectSize(), dist, angle);
+ MoveJump(x, y, z, speedXY, speedZ);
+}
+
+void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ)
+{
+ uint32 moveFlag = MOVEFLAG_JUMP | MOVEFLAG_WALK;
+ uint32 time = speedZ * 100;
+ i_owner->SendMonsterMove(x, y, z, moveFlag, time, speedZ);
+
+ i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
+ i_owner->m_TempSpeed = speedXY;
+ if(i_owner->GetTypeId()==TYPEID_PLAYER)
+ {
+ DEBUG_LOG("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z );
+ Mutate(new PointMovementGenerator<Player>(0,x,y,z), MOTION_SLOT_CONTROLLED);
+ }
+ else
+ {
+ DEBUG_LOG("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)",
+ i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z );
+ Mutate(new PointMovementGenerator<Creature>(0,x,y,z), MOTION_SLOT_CONTROLLED);
+ }
+}
+
void
-MotionMaster::MoveCharge(float x, float y, float z)
+MotionMaster::MoveCharge(float x, float y, float z, float speed)
{
if(Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
return;
i_owner->addUnitState(UNIT_STAT_CHARGING);
+ i_owner->m_TempSpeed = speed;
if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z );
@@ -484,7 +527,7 @@ void MotionMaster::DirectDelete(_Ty curr)
void MotionMaster::DelayedDelete(_Ty curr)
{
- sLog.outError("CRASH ALARM! Unit (Entry %u) is trying to delete its updating MG (Type %u)!", i_owner->GetEntry(), curr->GetMovementGeneratorType());
+ sLog.outCrash("Unit (Entry %u) is trying to delete its updating MG (Type %u)!", i_owner->GetEntry(), curr->GetMovementGeneratorType());
if(isStatic(curr))
return;
if(!m_expList)
@@ -494,9 +537,9 @@ void MotionMaster::DelayedDelete(_Ty curr)
bool MotionMaster::GetDestination(float &x, float &y, float &z)
{
- if(empty())
+ if(empty())
return false;
-
- return top()->GetDestination(x,y,z);
+
+ return top()->GetDestination(x,y,z);
}
diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h
index d68a94b7a1f..ea71495d216 100644
--- a/src/game/MotionMaster.h
+++ b/src/game/MotionMaster.h
@@ -63,6 +63,9 @@ enum MMCleanFlag
MMCF_RESET = 2 // Flag if need top()->Reset()
};
+// assume it is 25 yard per 0.6 second
+#define SPEED_CHARGE 42.0f
+
class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
{
private:
@@ -73,7 +76,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
typedef std::vector<_Ty> ExpireList;
int i_top;
- bool empty() const { return i_top < 0; }
+ bool empty() const { return (i_top < 0); }
void pop() { Impl[i_top] = NULL; --i_top; }
void push(_Ty _Val) { ++i_top; Impl[i_top] = _Val; }
@@ -92,6 +95,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
~MotionMaster();
void Initialize();
+ void InitDefault();
int size() const { return i_top + 1; }
_Ty top() const { return Impl[i_top]; }
@@ -131,12 +135,15 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
void MoveIdle(MovementSlot slot = MOTION_SLOT_ACTIVE);
void MoveTargetedHome();
void MoveRandom(float spawndist = 0.0f);
- void MoveFollow(Unit* target, float dist, float angle);
+ void MoveFollow(Unit* target, float dist, float angle, MovementSlot slot = MOTION_SLOT_ACTIVE);
void MoveChase(Unit* target, float dist = 0.0f, float angle = 0.0f);
void MoveConfused();
void MoveFleeing(Unit* enemy);
void MovePoint(uint32 id, float x,float y,float z);
- void MoveCharge(float x, float y, float z);
+ void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE);
+ void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
+ void MoveJumpTo(float angle, float speedXY, float speedZ);
+ void MoveJump(float x, float y, float z, float speedXY, float speedZ);
void MoveTaxiFlight(uint32 path, uint32 pathnode);
void MoveDistract(uint32 time);
void MovePath(uint32 path_id, bool repeatable);
diff --git a/src/game/MovementGenerator.cpp b/src/game/MovementGenerator.cpp
index ee314ffae3f..7784df315c9 100644
--- a/src/game/MovementGenerator.cpp
+++ b/src/game/MovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/MovementGenerator.h b/src/game/MovementGenerator.h
index 49d0ce8798a..cb352b7f1c6 100644
--- a/src/game/MovementGenerator.h
+++ b/src/game/MovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/MovementGeneratorImpl.h b/src/game/MovementGeneratorImpl.h
index 7197adb5dfe..fc676704d3a 100644
--- a/src/game/MovementGeneratorImpl.h
+++ b/src/game/MovementGeneratorImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 2eb3bab12e7..50152de4e97 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,14 +23,15 @@
#include "WorldSession.h"
#include "Opcodes.h"
#include "Log.h"
-#include "World.h"
#include "Corpse.h"
#include "Player.h"
+#include "Vehicle.h"
#include "MapManager.h"
#include "Transports.h"
#include "BattleGround.h"
#include "WaypointMovementGenerator.h"
#include "InstanceSaveMgr.h"
+#include "ObjectMgr.h"
void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
{
@@ -40,6 +41,10 @@ void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
void WorldSession::HandleMoveWorldportAckOpcode()
{
+ // ignore unexpected far teleports
+ if(!GetPlayer()->IsBeingTeleportedFar())
+ return;
+
// get the teleport destination
WorldLocation &loc = GetPlayer()->GetTeleportDest();
@@ -58,7 +63,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if(GetPlayer()->m_InstanceValid == false && !mInstance)
GetPlayer()->m_InstanceValid = true;
- GetPlayer()->SetSemaphoreTeleport(false);
+ GetPlayer()->SetSemaphoreTeleportFar(false);
// relocate the player to the teleport destination
GetPlayer()->SetMapId(loc.mapid);
@@ -78,7 +83,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
{
sLog.outDebug("WORLD: teleport of player %s (%d) to location %d,%f,%f,%f,%f failed", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.mapid, loc.x, loc.y, loc.z, loc.o);
// teleport the player home
- GetPlayer()->SetDontMove(false);
if(!GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation()))
{
// the player must always be able to teleport home
@@ -87,6 +91,26 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
return;
}
+
+ // battleground state prepare (in case join to BG), at relogin/tele player not invited
+ // only add to bg group and object, if the player was invited (else he entered through command)
+ if(_player->InBattleGround())
+ {
+ // cleanup seting if outdated
+ if(!mEntry->IsBattleGroundOrArena())
+ {
+ _player->SetBattleGroundId(0, BATTLEGROUND_TYPE_NONE); // We're not in BG.
+ // reset destination bg team
+ _player->SetBGTeam(0);
+ }
+ // join to bg case
+ else if(BattleGround *bg = _player->GetBattleGround())
+ {
+ if(_player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
+ bg->AddPlayer(_player);
+ }
+ }
+
GetPlayer()->SendInitialPacketsAfterAddToMap();
// flight fast teleport case
@@ -95,7 +119,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if(!_player->InBattleGround())
{
// short preparations to continue flight
- GetPlayer()->SetDontMove(false);
FlightPathMovementGenerator* flight = (FlightPathMovementGenerator*)(GetPlayer()->GetMotionMaster()->top());
flight->Initialize(*GetPlayer());
return;
@@ -129,113 +152,77 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// mount allow check
if(!mEntry->IsMountAllowed())
- _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
-
- // battleground state prepare
- // only add to bg group and object, if the player was invited (else he entered through command)
- if(_player->InBattleGround() && _player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId()))
- {
- BattleGround *bg = _player->GetBattleGround();
- if(bg)
- {
- bg->AddPlayer(_player);
- if(bg->GetMapId() == _player->GetMapId()) // we teleported to bg
- {
- // get the team this way, because arenas might 'override' the teams.
- uint32 team = bg->GetPlayerTeam(_player->GetGUID());
- if(!team)
- team = _player->GetTeam();
- if(!bg->GetBgRaid(team)) // first player joined
- {
- Group *group = new Group;
- bg->SetBgRaid(team, group);
- group->Create(_player->GetGUIDLow(), _player->GetName());
- }
- else // raid already exist
- {
- bg->GetBgRaid(team)->AddMember(_player->GetGUID(), _player->GetName());
- }
- }
- }
- }
+ _player->RemoveAurasByType(SPELL_AURA_MOUNTED);
// honorless target
if(GetPlayer()->pvpInfo.inHostileArea)
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
// resummon pet
- if(GetPlayer()->m_temporaryUnsummonedPetNumber)
- {
- Pet* NewPet = new Pet;
- if(!NewPet->LoadPetFromDB(GetPlayer(), 0, GetPlayer()->m_temporaryUnsummonedPetNumber, true))
- delete NewPet;
-
- GetPlayer()->m_temporaryUnsummonedPetNumber = 0;
- }
-
- GetPlayer()->SetDontMove(false);
+ GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
}
-void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
+void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
{
- CHECK_PACKET_SIZE(recv_data, 4+1+4+4+4+4+4);
+ CHECK_PACKET_SIZE(recv_data,8+4);
- /* extract packet */
- MovementInfo movementInfo;
- uint32 MovementFlags;
+ sLog.outDebug("MSG_MOVE_TELEPORT_ACK");
+ uint64 guid;
+ uint32 flags, time;
- recv_data >> MovementFlags;
- recv_data >> movementInfo.unk1;
- recv_data >> movementInfo.time;
- recv_data >> movementInfo.x;
- recv_data >> movementInfo.y;
- recv_data >> movementInfo.z;
- recv_data >> movementInfo.o;
+ recv_data >> guid;
+ recv_data >> flags >> time;
+ DEBUG_LOG("Guid " I64FMTD,guid);
+ DEBUG_LOG("Flags %u, time %u",flags, time/IN_MILISECONDS);
- if(MovementFlags & MOVEMENTFLAG_ONTRANSPORT)
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8+4+4+4+4+4);
-
- recv_data >> movementInfo.t_guid;
- recv_data >> movementInfo.t_x;
- recv_data >> movementInfo.t_y;
- recv_data >> movementInfo.t_z;
- recv_data >> movementInfo.t_o;
- recv_data >> movementInfo.t_time;
- }
+ Unit *mover = _player->m_mover;
+ Player *plMover = mover->GetTypeId()==TYPEID_PLAYER ? (Player*)mover : NULL;
- if(MovementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2))
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
+ if(!plMover || !plMover->IsBeingTeleportedNear())
+ return;
- recv_data >> movementInfo.s_pitch; // pitch, -1.55=looking down, 0=looking straight forward, +1.55=looking up
- }
+ if(guid != plMover->GetGUID())
+ return;
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
+ plMover->SetSemaphoreTeleportNear(false);
- recv_data >> movementInfo.fallTime; // duration of last jump (when in jump duration from jump begin to now)
+ uint32 old_zone = plMover->GetZoneId();
- if(MovementFlags & MOVEMENTFLAG_JUMPING)
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4+4+4);
+ WorldLocation const& dest = plMover->GetTeleportDest();
- recv_data >> movementInfo.j_unk; // constant, but different when jumping in water and on land?
- recv_data >> movementInfo.j_sinAngle; // sin of angle between orientation0 and players orientation
- recv_data >> movementInfo.j_cosAngle; // cos of angle between orientation0 and players orientation
- recv_data >> movementInfo.j_xyspeed; // speed of xy movement
- }
+ plMover->SetPosition(dest.x, dest.y, dest.z, dest.o, true);
- if(MovementFlags & MOVEMENTFLAG_SPLINE)
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
+ uint32 newzone, newarea;
+ plMover->GetZoneAndAreaId(newzone,newarea);
+ plMover->UpdateZone(newzone,newarea);
- recv_data >> movementInfo.u_unk1; // unknown
+ // new zone
+ if(old_zone != newzone)
+ {
+ // honorless target
+ if(plMover->pvpInfo.inHostileArea)
+ plMover->CastSpell(plMover, 2479, true);
}
+
+ // resummon pet
+ GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
+}
+
+void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
+{
+ uint32 opcode = recv_data.GetOpcode();
+ //sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
+
+ Unit *mover = _player->m_mover;
+ Player *plMover = mover->GetTypeId()==TYPEID_PLAYER ? (Player*)mover : NULL;
+
+ // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck
+ if(plMover && plMover->IsBeingTeleported())
+ return;
+
+ /* extract packet */
+ MovementInfo movementInfo;
+ ReadMovementInfo(recv_data, &movementInfo);
/*----------------*/
if(recv_data.size() != recv_data.rpos())
@@ -248,22 +235,8 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
if (!Trinity::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
return;
- // Handle possessed unit movement separately
- Unit* pos_unit = GetPlayer()->GetCharm();
- if (pos_unit && pos_unit->isPossessed()) // can be charmed but not possessed
- {
- HandlePossessedMovement(recv_data, movementInfo, MovementFlags);
- return;
- }
-
- if (GetPlayer()->GetDontMove())
- return;
-
- //Save movement flags
- GetPlayer()->SetUnitMovementFlags(MovementFlags);
-
/* handle special cases */
- if (MovementFlags & MOVEMENTFLAG_ONTRANSPORT)
+ if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
{
// transports size limited
// (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
@@ -275,141 +248,111 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
return;
// if we boarded a transport, add us to it
- if (!GetPlayer()->m_transport)
+ if (plMover && !plMover->m_transport)
{
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list
for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
{
if ((*iter)->GetGUID() == movementInfo.t_guid)
{
- // unmount before boarding
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
-
- GetPlayer()->m_transport = (*iter);
- (*iter)->AddPassenger(GetPlayer());
+ plMover->m_transport = (*iter);
+ (*iter)->AddPassenger(plMover);
break;
}
}
}
}
- else if (GetPlayer()->m_transport) // if we were on a transport, leave
+ else if (plMover && plMover->m_transport) // if we were on a transport, leave
{
- GetPlayer()->m_transport->RemovePassenger(GetPlayer());
- GetPlayer()->m_transport = NULL;
+ plMover->m_transport->RemovePassenger(plMover);
+ plMover->m_transport = NULL;
movementInfo.t_x = 0.0f;
movementInfo.t_y = 0.0f;
movementInfo.t_z = 0.0f;
movementInfo.t_o = 0.0f;
movementInfo.t_time = 0;
+ movementInfo.t_seat = -1;
}
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
- if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND && !GetPlayer()->isInFlight())
- GetPlayer()->HandleFallDamage(movementInfo);
+ if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight())
+ plMover->HandleFall(movementInfo);
- if(((MovementFlags & MOVEMENTFLAG_SWIMMING) != 0) != GetPlayer()->IsInWater())
+ if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater())
{
// now client not include swimming flag in case jumping under water
- GetPlayer()->SetInWater( !GetPlayer()->IsInWater() || GetPlayer()->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
+ plMover->SetInWater( !plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
}
/*----------------------*/
/* process position-change */
- recv_data.put<uint32>(5, getMSTime()); // offset flags(4) + unk(1)
- WorldPacket data(recv_data.GetOpcode(), (GetPlayer()->GetPackGUID().size()+recv_data.size()));
- data.append(GetPlayer()->GetPackGUID());
+ recv_data.put<uint32>(6, getMSTime()); // fix time, offset flags(4) + unk(2)
+ WorldPacket data(recv_data.GetOpcode(), (mover->GetPackGUID().size()+recv_data.size()));
+ data.append(mover->GetPackGUID()); // use mover guid
data.append(recv_data.contents(), recv_data.size());
GetPlayer()->SendMessageToSet(&data, false);
- GetPlayer()->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
- GetPlayer()->m_movementInfo = movementInfo;
- if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z || recv_data.GetOpcode() == MSG_MOVE_FALL_LAND)
- GetPlayer()->SetFallInformation(movementInfo.fallTime, movementInfo.z);
-
- if(GetPlayer()->isMovingOrTurning())
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
-
- if(movementInfo.z < -500.0f)
- GetPlayer()->HandleFallUnderMap();
-}
-
-void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo, uint32& MovementFlags)
-{
- // Whatever the client is controlling, it will send the GUID of the original player.
- // If current player is controlling, it must be handled like the controlled player sent these opcodes
-
- Unit* pos_unit = GetPlayer()->GetCharm();
-
- if (pos_unit->GetTypeId() == TYPEID_PLAYER && ((Player*)pos_unit)->GetDontMove())
- return;
-
- //Save movement flags
- pos_unit->SetUnitMovementFlags(MovementFlags);
-
- // Remove possession if possessed unit enters a transport
- if (MovementFlags & MOVEMENTFLAG_ONTRANSPORT)
- {
- GetPlayer()->Uncharm();
- return;
- }
-
- recv_data.put<uint32>(5, getMSTime());
- WorldPacket data(recv_data.GetOpcode(), pos_unit->GetPackGUID().size()+recv_data.size());
- data.append(pos_unit->GetPackGUID());
- data.append(recv_data.contents(), recv_data.size());
- // Send the packet to self but not to the possessed player; for creatures the first bool is irrelevant
- pos_unit->SendMessageToSet(&data, true, false);
-
- // Possessed is a player
- if (pos_unit->GetTypeId() == TYPEID_PLAYER)
+ if(plMover) // nothing is charmed, or player charmed
{
- Player* plr = (Player*)pos_unit;
-
- if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND)
- plr->HandleFallDamage(movementInfo);
-
- if(((MovementFlags & MOVEMENTFLAG_SWIMMING) != 0) != plr->IsInWater())
- {
- // Now client not include swimming flag in case jumping under water
- plr->SetInWater( !plr->IsInWater() || plr->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
- }
+ plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
+ plMover->m_movementInfo = movementInfo;
+ plMover->SetUnitMovementFlags(movementInfo.flags);
+ plMover->UpdateFallInformationIfNeed(movementInfo,recv_data.GetOpcode());
- plr->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o, false);
- plr->m_movementInfo = movementInfo;
-
- if(plr->isMovingOrTurning())
- plr->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ if(plMover->isMovingOrTurning())
+ plMover->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(movementInfo.z < -500.0f)
{
- GetPlayer()->Uncharm();
- plr->HandleFallUnderMap();
+ if(plMover->InBattleGround()
+ && plMover->GetBattleGround()
+ && plMover->GetBattleGround()->HandlePlayerUnderMap(_player))
+ {
+ // do nothing, the handle already did if returned true
+ }
+ else
+ {
+ // NOTE: this is actually called many times while falling
+ // even after the player has been teleported away
+ // TODO: discard movement packets after the player is rooted
+ if(plMover->isAlive())
+ {
+ plMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
+ // pl can be alive if GM/etc
+ if(!plMover->isAlive())
+ {
+ // change the death state to CORPSE to prevent the death timer from
+ // starting in the next player update
+ plMover->KillPlayer();
+ plMover->BuildPlayerRepop();
+ }
+ }
+
+ // cancel the death timer here if started
+ plMover->RepopAtGraveyard();
+ }
}
}
- else // Possessed unit is a creature
+ else // creature charmed
{
- Map* map = MapManager::Instance().GetMap(pos_unit->GetMapId(), pos_unit);
- map->CreatureRelocation((Creature*)pos_unit, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
+ if(Map *map = mover->GetMap())
+ {
+ map->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
+ }
+ mover->SetUnitMovementFlags(movementInfo.flags);
}
}
void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
{
- CHECK_PACKET_SIZE(recv_data, 8+4+4+1+4+4+4+4+4);
+ //sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(recv_data.GetOpcode()), recv_data.GetOpcode(), recv_data.GetOpcode());
+
+ CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8+4);
/* extract packet */
uint64 guid;
- uint8 unkB;
- uint32 unk1, flags, time, fallTime;
- float x, y, z, orientation;
-
- uint64 t_GUID;
- float t_x, t_y, t_z, t_o;
- uint32 t_time;
- float s_pitch;
- float j_unk1, j_sinAngle, j_cosAngle, j_xyspeed;
- float u_unk1;
+ uint32 unk1;
float newspeed;
recv_data >> guid;
@@ -420,47 +363,10 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
// continue parse packet
- recv_data >> unk1;
- recv_data >> flags >> unkB >> time;
- recv_data >> x >> y >> z >> orientation;
- if (flags & MOVEMENTFLAG_ONTRANSPORT)
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8+4+4+4+4+4);
-
- recv_data >> t_GUID;
- recv_data >> t_x >> t_y >> t_z >> t_o >> t_time;
- }
- if (flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2))
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
-
- recv_data >> s_pitch; // pitch, -1.55=looking down, 0=looking straight forward, +1.55=looking up
- }
-
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
-
- recv_data >> fallTime; // duration of last jump (when in jump duration from jump begin to now)
+ recv_data >> unk1; // counter or moveEvent
- if ((flags & MOVEMENTFLAG_JUMPING) || (flags & MOVEMENTFLAG_FALLING))
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4+4+4+4);
-
- recv_data >> j_unk1; // ?constant, but different when jumping in water and on land?
- recv_data >> j_sinAngle >> j_cosAngle; // sin + cos of angle between orientation0 and players orientation
- recv_data >> j_xyspeed; // speed of xy movement
- }
-
- if(flags & MOVEMENTFLAG_SPLINE)
- {
- // recheck
- CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
-
- recv_data >> u_unk1; // unknown
- }
+ MovementInfo movementInfo;
+ ReadMovementInfo(recv_data, &movementInfo);
// recheck
CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+4);
@@ -473,7 +379,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
UnitMoveType move_type;
UnitMoveType force_move_type;
- static char const* move_type_name[MAX_MOVE_TYPE] = { "Walk", "Run", "RunBack", "Swim", "SwimBack", "TurnRate", "Flight", "FlightBack" };
+ static char const* move_type_name[MAX_MOVE_TYPE] = { "Walk", "Run", "RunBack", "Swim", "SwimBack", "TurnRate", "Flight", "FlightBack", "PitchRate" };
uint16 opcode = recv_data.GetOpcode();
switch(opcode)
@@ -486,6 +392,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
case CMSG_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break;
case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break;
case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break;
+ case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break;
default:
sLog.outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
return;
@@ -520,20 +427,83 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
+ recv_data.hexlike();
- CHECK_PACKET_SIZE(recv_data,8);
+ CHECK_PACKET_SIZE(recv_data, 8);
uint64 guid;
recv_data >> guid;
- WorldPacket data(SMSG_TIME_SYNC_REQ, 4); // new 2.0.x, enable movement
- data << uint32(0x00000000); // on blizz it increments periodically
- SendPacket(&data);
+ if(_player->m_mover->GetGUID() != guid)
+ {
+ sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " I64FMT " and should be " I64FMT, _player->m_mover->GetGUID(), guid);
+ return;
+ }
}
-void WorldSession::HandleNotActiveMoverOpcode(WorldPacket& /*recv_data*/)
+void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
+ recv_data.hexlike();
+
+ CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8);
+
+ uint64 old_mover_guid;
+ recv_data >> old_mover_guid;
+
+ if(_player->m_mover->GetGUID() == old_mover_guid)
+ {
+ sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " I64FMT " and should be " I64FMT " instead of " I64FMT, _player->m_mover->GetGUID(), _player->GetGUID(), old_mover_guid);
+ return;
+ }
+
+ MovementInfo mi;
+ ReadMovementInfo(recv_data, &mi);
+ _player->m_movementInfo = mi;
+}
+
+void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
+ recv_data.hexlike();
+
+ uint64 vehicleGUID = _player->GetCharmGUID();
+
+ if(!vehicleGUID) // something wrong here...
+ return;
+
+ MovementInfo mi;
+ ReadMovementInfo(recv_data, &mi);
+ _player->m_movementInfo = mi;
+
+ // using charm guid, because we don't have vehicle guid...
+ if(Vehicle *vehicle = ObjectAccessor::GetVehicle(vehicleGUID))
+ {
+ vehicle->RemovePassenger(_player);
+ }
+}
+
+void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE");
+ recv_data.hexlike();
+ uint32 a;
+ uint16 b;
+ uint16 c;
+ uint32 d,e,f,g,h,i,j,k;
+ int8 seat;
+ recv_data >> a >> b >> c;
+ recv_data >> d >> e >> f >> g >> h >> i >> j >> k;
+ recv_data >> seat;
+ //sLog.outError("change seat %u %u %u %u %u %u %u %u %u %u %u %u", a, b,c,d,e,f,g,h,i,j,k,seat);
+}
+
+void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data)
+{
+ sLog.outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT");
+ recv_data.hexlike();
+ if(GetPlayer()->m_Vehicle)
+ GetPlayer()->m_Vehicle->RemovePassenger(GetPlayer());
}
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp
index df027a48acd..8d1427c86b8 100644
--- a/src/game/NPCHandler.cpp
+++ b/src/game/NPCHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,17 +25,14 @@
#include "WorldSession.h"
#include "Opcodes.h"
#include "Log.h"
-#include "World.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Player.h"
#include "GossipDef.h"
-#include "SpellAuras.h"
#include "UpdateMask.h"
#include "ScriptCalls.h"
#include "ObjectAccessor.h"
#include "Creature.h"
-#include "MapManager.h"
#include "Pet.h"
#include "BattleGroundMgr.h"
#include "BattleGround.h"
@@ -57,7 +54,7 @@ void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendTabardVendorActivate(guid);
}
@@ -88,7 +85,7 @@ void WorldSession::HandleBankerActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendShowBank(guid);
}
@@ -129,7 +126,7 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// trainer list loaded at check;
if(!unit->isCanTrainingOf(_player,true))
@@ -162,29 +159,29 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
float fDiscountMod = _player->GetReputationPriceDiscount(unit);
uint32 count = 0;
- for(TrainerSpellList::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
+ for(TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
{
- TrainerSpell const* tSpell = *itr;
+ TrainerSpell const* tSpell = &itr->second;
- if(!_player->IsSpellFitByClassAndRace(tSpell->spell))
+ if(!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue;
++count;
- bool primary_prof_first_rank = spellmgr.IsPrimaryProfessionFirstRankSpell(tSpell->spell);
+ bool primary_prof_first_rank = spellmgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell);
- SpellChainNode const* chain_node = spellmgr.GetSpellChainNode(tSpell->spell);
+ SpellChainNode const* chain_node = spellmgr.GetSpellChainNode(tSpell->learnedSpell);
uint32 req_spell = spellmgr.GetSpellRequired(tSpell->spell);
- data << uint32(tSpell->spell);
+ data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
data << uint8(_player->GetTrainerSpellState(tSpell));
- data << uint32(floor(tSpell->spellcost * fDiscountMod));
+ data << uint32(floor(tSpell->spellCost * fDiscountMod));
data << uint32(primary_prof_first_rank ? 1 : 0); // primary prof. learn confirmation dialog
data << uint32(primary_prof_first_rank ? 1 : 0); // must be equal prev. field to have learn button in enabled state
- data << uint8(tSpell->reqlevel);
- data << uint32(tSpell->reqskill);
- data << uint32(tSpell->reqskillvalue);
+ data << uint8(tSpell->reqLevel);
+ data << uint32(tSpell->reqSkill);
+ data << uint32(tSpell->reqSkillValue);
data << uint32(chain_node && chain_node->prev ? chain_node->prev : req_spell);
data << uint32(chain_node && chain_node->prev ? req_spell : 0);
data << uint32(0);
@@ -215,7 +212,7 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!unit->isCanTrainingOf(_player,true))
return;
@@ -235,12 +232,14 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
return;
// apply reputation discount
- uint32 nSpellCost = uint32(floor(trainer_spell->spellcost * _player->GetReputationPriceDiscount(unit)));
+ uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit)));
// check money requirement
if(_player->GetMoney() < nSpellCost )
return;
+ _player->ModifyMoney( -int32(nSpellCost) );
+
WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 12); // visual effect on trainer
data << uint64(guid) << uint32(0xB3);
SendPacket(&data);
@@ -249,13 +248,15 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
data << uint64(_player->GetGUID()) << uint32(0x016A);
SendPacket(&data);
- _player->ModifyMoney( -int32(nSpellCost) );
-
- // learn explicitly to prevent lost money at lags, learning spell will be only show spell animation
- _player->learnSpell(trainer_spell->spell);
+ // learn explicitly or cast explicitly
+ if(trainer_spell->IsCastable ())
+ //FIXME: prof. spell entry in trainer list not marked gray until list re-open.
+ _player->CastSpell(_player,trainer_spell->spell,true);
+ else
+ _player->learnSpell(spellId,false);
data.Initialize(SMSG_TRAINER_BUY_SUCCEEDED, 12);
- data << uint64(guid) << uint32(spellId);
+ data << uint64(guid) << uint32(trainer_spell->spell);
SendPacket(&data);
}
@@ -278,7 +279,7 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
// remove fake death
//if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- // GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ // GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if( unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider())
{
@@ -336,7 +337,7 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!code.empty())
{
@@ -369,7 +370,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendSpiritResurrect();
}
@@ -430,7 +431,7 @@ void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendBindPoint(unit);
}
@@ -438,11 +439,12 @@ void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data )
void WorldSession::SendBindPoint(Creature *npc)
{
uint32 bindspell = 3286;
+ uint32 zone_id = _player->GetZoneId();
// update sql homebind
- CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", _player->GetMapId(), _player->GetZoneId(), _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow());
+ CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", _player->GetMapId(), zone_id, _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetGUIDLow());
_player->m_homebindMapId = _player->GetMapId();
- _player->m_homebindZoneId = _player->GetZoneId();
+ _player->m_homebindZoneId = zone_id;
_player->m_homebindX = _player->GetPositionX();
_player->m_homebindY = _player->GetPositionY();
_player->m_homebindZ = _player->GetPositionZ();
@@ -461,25 +463,24 @@ void WorldSession::SendBindPoint(Creature *npc)
data << float(_player->GetPositionY());
data << float(_player->GetPositionZ());
data << uint32(_player->GetMapId());
- data << uint32(_player->GetZoneId());
+ data << uint32(zone_id);
SendPacket( &data );
DEBUG_LOG("New Home Position X is %f",_player->GetPositionX());
DEBUG_LOG("New Home Position Y is %f",_player->GetPositionY());
DEBUG_LOG("New Home Position Z is %f",_player->GetPositionZ());
DEBUG_LOG("New Home MapId is %u",_player->GetMapId());
- DEBUG_LOG("New Home ZoneId is %u",_player->GetZoneId());
+ DEBUG_LOG("New Home ZoneId is %u",zone_id);
// zone update
data.Initialize( SMSG_PLAYERBOUND, 8+4 );
data << uint64(_player->GetGUID());
- data << uint32(_player->GetZoneId());
+ data << uint32(zone_id);
SendPacket( &data );
_player->PlayerTalkClass->CloseGossip();
}
-//Need fix
void WorldSession::HandleListStabledPetsOpcode( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,8);
@@ -498,11 +499,11 @@ void WorldSession::HandleListStabledPetsOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// remove mounts this fix bug where getting pet from stable while mounted deletes pet.
if(GetPlayer()->IsMounted())
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED);
SendStablePet(npcGUID);
}
@@ -516,7 +517,9 @@ void WorldSession::SendStablePet(uint64 guid )
Pet *pet = _player->GetPet();
+ size_t wpos = data.wpos();
data << uint8(0); // place holder for slot show number
+
data << uint8(GetPlayer()->m_stableSlots);
uint8 num = 0; // counter for place holder
@@ -528,13 +531,13 @@ void WorldSession::SendStablePet(uint64 guid )
data << uint32(pet->GetEntry());
data << uint32(pet->getLevel());
data << pet->GetName(); // petname
- data << uint32(pet->GetLoyaltyLevel()); // loyalty
- data << uint8(0x01); // client slot 1 == current pet (0)
+ data << uint8(1); // 1 = current, 2/3 = in stable (any from 4,5,... create problems with proper show)
++num;
}
- // 0 1 2 3 4 5 6
- QueryResult* result = CharacterDatabase.PQuery("SELECT owner, slot, id, entry, level, loyalty, name FROM character_pet WHERE owner = '%u' AND slot > 0 AND slot < 3",_player->GetGUIDLow());
+ // 0 1 2 3 4
+ QueryResult* result = CharacterDatabase.PQuery("SELECT owner, id, entry, level, name FROM character_pet WHERE owner = '%u' AND slot >= '%u' AND slot <= '%u' ORDER BY slot",
+ _player->GetGUIDLow(),PET_SAVE_FIRST_STABLE_SLOT,PET_SAVE_LAST_STABLE_SLOT);
if(result)
{
@@ -542,12 +545,11 @@ void WorldSession::SendStablePet(uint64 guid )
{
Field *fields = result->Fetch();
- data << uint32(fields[2].GetUInt32()); // petnumber
- data << uint32(fields[3].GetUInt32()); // creature entry
- data << uint32(fields[4].GetUInt32()); // level
- data << fields[6].GetString(); // name
- data << uint32(fields[5].GetUInt32()); // loyalty
- data << uint8(fields[1].GetUInt32()+1); // slot
+ data << uint32(fields[1].GetUInt32()); // petnumber
+ data << uint32(fields[2].GetUInt32()); // creature entry
+ data << uint32(fields[3].GetUInt32()); // level
+ data << fields[4].GetString(); // name
+ data << uint8(2); // 1 = current, 2/3 = in stable (any from 4,5,... create problems with proper show)
++num;
}while( result->NextRow() );
@@ -555,7 +557,7 @@ void WorldSession::SendStablePet(uint64 guid )
delete result;
}
- data.put<uint8>(8, num); // set real data to placeholder
+ data.put<uint8>(wpos, num); // set real data to placeholder
SendPacket(&data);
}
@@ -580,7 +582,7 @@ void WorldSession::HandleStablePet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Pet *pet = _player->GetPet();
@@ -596,7 +598,8 @@ void WorldSession::HandleStablePet( WorldPacket & recv_data )
uint32 free_slot = 1;
- QueryResult *result = CharacterDatabase.PQuery("SELECT owner,slot,id FROM character_pet WHERE owner = '%u' AND slot > 0 AND slot < 3 ORDER BY slot ",_player->GetGUIDLow());
+ QueryResult *result = CharacterDatabase.PQuery("SELECT owner,slot,id FROM character_pet WHERE owner = '%u' AND slot >= '%u' AND slot <= '%u' ORDER BY slot ",
+ _player->GetGUIDLow(),PET_SAVE_FIRST_STABLE_SLOT,PET_SAVE_LAST_STABLE_SLOT);
if(result)
{
do
@@ -605,11 +608,16 @@ void WorldSession::HandleStablePet( WorldPacket & recv_data )
uint32 slot = fields[1].GetUInt32();
- if(slot==free_slot) // this slot not free
- ++free_slot;
+ // slots ordered in query, and if not equal then free
+ if(slot!=free_slot)
+ break;
+
+ // this slot not free, skip
+ ++free_slot;
}while( result->NextRow() );
+
+ delete result;
}
- delete result;
if( free_slot > 0 && free_slot <= GetPlayer()->m_stableSlots)
{
@@ -641,15 +649,14 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200); // guess size
Pet* pet = _player->GetPet();
if(pet && pet->isAlive())
{
- uint8 i = 0x06;
- data << uint8(i);
+ data << uint8(0x06);
SendPacket(&data);
return;
}
@@ -660,13 +667,14 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
Pet *newpet = NULL;
- QueryResult *result = CharacterDatabase.PQuery("SELECT entry FROM character_pet WHERE owner = '%u' AND id = '%u' AND slot > 0 AND slot < 3",_player->GetGUIDLow(),petnumber);
+ QueryResult *result = CharacterDatabase.PQuery("SELECT entry FROM character_pet WHERE owner = '%u' AND id = '%u' AND slot >='%u' AND slot <= '%u'",
+ _player->GetGUIDLow(),petnumber,PET_SAVE_FIRST_STABLE_SLOT,PET_SAVE_LAST_STABLE_SLOT);
if(result)
{
Field *fields = result->Fetch();
uint32 petentry = fields[0].GetUInt32();
- newpet = new Pet(HUNTER_PET);
+ newpet = new Pet(_player, HUNTER_PET);
if(!newpet->LoadPetFromDB(_player,petentry,petnumber))
{
delete newpet;
@@ -700,11 +708,11 @@ void WorldSession::HandleBuyStableSlot( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200);
- if(GetPlayer()->m_stableSlots < 2) // max slots amount = 2
+ if(GetPlayer()->m_stableSlots < MAX_PET_STABLES)
{
StableSlotPricesEntry const *SlotPrice = sStableSlotPricesStore.LookupEntry(GetPlayer()->m_stableSlots+1);
if(_player->GetMoney() >= SlotPrice->Price)
@@ -746,7 +754,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200); // guess size
@@ -756,7 +764,8 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
return;
// find swapped pet slot in stable
- QueryResult *result = CharacterDatabase.PQuery("SELECT slot,entry FROM character_pet WHERE owner = '%u' AND id = '%u'",_player->GetGUIDLow(),pet_number);
+ QueryResult *result = CharacterDatabase.PQuery("SELECT slot,entry FROM character_pet WHERE owner = '%u' AND id = '%u'",
+ _player->GetGUIDLow(),pet_number);
if(!result)
return;
@@ -766,11 +775,11 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
uint32 petentry = fields[1].GetUInt32();
delete result;
- // move alive pet to slot or delele dead pet
+ // move alive pet to slot or delete dead pet
_player->RemovePet(pet,pet->isAlive() ? PetSaveMode(slot) : PET_SAVE_AS_DELETED);
// summon unstabled pet
- Pet *newpet = new Pet;
+ Pet *newpet = new Pet(_player);
if(!newpet->LoadPetFromDB(_player,petentry,pet_number))
{
delete newpet;
@@ -802,7 +811,7 @@ void WorldSession::HandleRepairItemOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// reputation discount
float discountMod = _player->GetReputationPriceDiscount(unit);
diff --git a/src/game/NPCHandler.h b/src/game/NPCHandler.h
index e359878173f..4d0395a0c87 100644
--- a/src/game/NPCHandler.h
+++ b/src/game/NPCHandler.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,7 +60,6 @@ struct GossipTextOption
struct GossipText
{
- uint32 Text_ID;
GossipTextOption Options[8];
};
diff --git a/src/game/NullCreatureAI.cpp b/src/game/NullCreatureAI.cpp
index 8bea03d0216..be59ed6e40d 100644
--- a/src/game/NullCreatureAI.cpp
+++ b/src/game/NullCreatureAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/NullCreatureAI.h b/src/game/NullCreatureAI.h
index d20d727690a..d5c12d8c9a0 100644
--- a/src/game/NullCreatureAI.h
+++ b/src/game/NullCreatureAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
class TRINITY_DLL_DECL PassiveAI : public CreatureAI
{
public:
- PassiveAI(Creature *c) : CreatureAI(c) {}
+ explicit PassiveAI(Creature *c) : CreatureAI(c) {}
~PassiveAI() {}
void MoveInLineOfSight(Unit *) {}
@@ -39,7 +39,7 @@ class TRINITY_DLL_DECL PassiveAI : public CreatureAI
class TRINITY_DLL_DECL PossessedAI : public PassiveAI
{
public:
- PossessedAI(Creature *c) : PassiveAI(c) {}
+ explicit PossessedAI(Creature *c) : PassiveAI(c) {}
void AttackStart(Unit *target);
void UpdateAI(const uint32);
@@ -52,7 +52,7 @@ class TRINITY_DLL_DECL PossessedAI : public PassiveAI
class TRINITY_DLL_DECL NullCreatureAI : public PassiveAI
{
public:
- NullCreatureAI(Creature *c) : PassiveAI(c) {}
+ explicit NullCreatureAI(Creature *c) : PassiveAI(c) {}
void UpdateAI(const uint32) {}
void EnterEvadeMode() {}
@@ -61,7 +61,7 @@ class TRINITY_DLL_DECL NullCreatureAI : public PassiveAI
class TRINITY_DLL_DECL CritterAI : public PassiveAI
{
public:
- CritterAI(Creature *c) : PassiveAI(c) {}
+ explicit CritterAI(Creature *c) : PassiveAI(c) {}
void DamageTaken(Unit *done_by, uint32 & /*damage*/);
void EnterEvadeMode();
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index d106b578004..015bb6d3479 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -27,8 +27,8 @@
#include "Object.h"
#include "Creature.h"
#include "Player.h"
+#include "Vehicle.h"
#include "ObjectMgr.h"
-#include "WorldSession.h"
#include "UpdateData.h"
#include "UpdateMask.h"
#include "Util.h"
@@ -44,6 +44,7 @@
#include "GridNotifiersImpl.h"
#include "TemporarySummon.h"
+#include "Totem.h"
uint32 GuidHigh2TypeId(uint32 guid_hi)
{
@@ -58,8 +59,9 @@ uint32 GuidHigh2TypeId(uint32 guid_hi)
case HIGHGUID_DYNAMICOBJECT:return TYPEID_DYNAMICOBJECT;
case HIGHGUID_CORPSE: return TYPEID_CORPSE;
case HIGHGUID_MO_TRANSPORT: return TYPEID_GAMEOBJECT;
+ case HIGHGUID_VEHICLE: return TYPEID_UNIT;
}
- return 10; // unknown
+ return MAX_TYPEID; // unknown
}
Object::Object( )
@@ -83,17 +85,16 @@ Object::~Object( )
//if(m_objectUpdated)
// ObjectAccessor::Instance().RemoveUpdateObject(this);
- if(m_uint32Values)
+ if(IsInWorld())
{
- if(IsInWorld())
- {
- ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash
- sLog.outError("Object::~Object - guid="I64FMTD", typeid=%d deleted but still in world!!", GetGUID(), GetTypeId());
- assert(false);
- }
+ sLog.outCrash("Object::~Object - guid="I64FMTD", typeid=%d deleted but still in world!!", GetGUID(), GetTypeId());
+ assert(false);
+ }
- assert(!m_objectUpdated);
+ assert(!m_objectUpdated);
+ if(m_uint32Values)
+ {
//DEBUG_LOG("Object desctr 1 check (%p)",(void*)this);
delete [] m_uint32Values;
delete [] m_uint32Values_mirror;
@@ -152,7 +153,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c
if(target == this) // building packet for oneself
flags |= UPDATEFLAG_SELF;
- if(flags & UPDATEFLAG_HASPOSITION)
+ if(flags & UPDATEFLAG_HAS_POSITION)
{
// UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses...
if(isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER))
@@ -178,6 +179,12 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c
break;
}
}
+
+ if(isType(TYPEMASK_UNIT))
+ {
+ if(((Unit*)this)->getVictim())
+ flags |= UPDATEFLAG_HAS_TARGET;
+ }
}
//sLog.outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2);
@@ -248,11 +255,18 @@ void Object::DestroyForPlayer(Player *target) const
WorldPacket data(SMSG_DESTROY_OBJECT, 8);
data << GetGUID();
+ data << uint8(0); // WotLK (bool)
target->GetSession()->SendPacket( &data );
}
-void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2 ) const
+void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2) const
{
+ uint16 unk_flags = ((GetTypeId() == TYPEID_PLAYER) ? ((Player*)this)->m_movementInfo.unk1 : 0);
+
+ if(GetTypeId() == TYPEID_UNIT)
+ if(((Creature*)this)->isVehicle())
+ unk_flags |= 0x20; // always allow pitch
+
*data << (uint8)flags; // update flags
// 0x20
@@ -263,7 +277,10 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
case TYPEID_UNIT:
{
flags2 = ((Unit*)this)->GetUnitMovementFlags();
- flags2 &= ~MOVEMENTFLAG_ONTRANSPORT;
+ if(((Unit*)this)->m_Vehicle)
+ flags2 |= MOVEMENTFLAG_ONTRANSPORT;
+ else
+ flags2 &= ~MOVEMENTFLAG_ONTRANSPORT;
flags2 &= ~MOVEMENTFLAG_SPLINE2;
}
break;
@@ -271,7 +288,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
{
flags2 = ((Player*)this)->GetUnitMovementFlags();
- if(((Player*)this)->GetTransport())
+ if(((Player*)this)->GetTransport() || ((Player*)this)->m_Vehicle)
flags2 |= MOVEMENTFLAG_ONTRANSPORT;
else
flags2 &= ~MOVEMENTFLAG_ONTRANSPORT;
@@ -289,12 +306,12 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
}
*data << uint32(flags2); // movement flags
- *data << uint8(0); // unk 2.3.0
+ *data << uint16(unk_flags); // unknown 2.3.0
*data << uint32(getMSTime()); // time (in milliseconds)
}
// 0x40
- if (flags & UPDATEFLAG_HASPOSITION)
+ if (flags & UPDATEFLAG_HAS_POSITION)
{
// 0x02
if(flags & UPDATEFLAG_TRANSPORT && ((GameObject*)this)->GetGoType() == GAMEOBJECT_TYPE_MO_TRANSPORT)
@@ -319,20 +336,20 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
// 0x00000200
if(flags2 & MOVEMENTFLAG_ONTRANSPORT)
{
- if(GetTypeId() == TYPEID_PLAYER)
- {
+ if(((Unit*)this)->m_Vehicle)
+ *data << (uint64)((Unit*)this)->m_Vehicle->GetGUID();
+ else
*data << (uint64)((Player*)this)->GetTransport()->GetGUID();
- *data << (float)((Player*)this)->GetTransOffsetX();
- *data << (float)((Player*)this)->GetTransOffsetY();
- *data << (float)((Player*)this)->GetTransOffsetZ();
- *data << (float)((Player*)this)->GetTransOffsetO();
- *data << (uint32)((Player*)this)->GetTransTime();
- }
- //TrinIty currently not have support for other than player on transport
+ *data << (float)((Unit*)this)->GetTransOffsetX();
+ *data << (float)((Unit*)this)->GetTransOffsetY();
+ *data << (float)((Unit*)this)->GetTransOffsetZ();
+ *data << (float)((Unit*)this)->GetTransOffsetO();
+ *data << (uint32)((Unit*)this)->GetTransTime();
+ *data << (int8)((Unit*)this)->GetTransSeat();
}
// 0x02200000
- if(flags2 & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2))
+ if((flags2 & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (unk_flags & 0x20))
{
if(GetTypeId() == TYPEID_PLAYER)
*data << (float)((Player*)this)->m_movementInfo.s_pitch;
@@ -381,6 +398,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
*data << ((Unit*)this)->GetSpeed( MOVE_FLIGHT );
*data << ((Unit*)this)->GetSpeed( MOVE_FLIGHT_BACK );
*data << ((Unit*)this)->GetSpeed( MOVE_TURN_RATE );
+ *data << ((Unit*)this)->GetSpeed( MOVE_PITCH_RATE );
// 0x08000000
if(flags2 & MOVEMENTFLAG_SPLINE2)
@@ -445,6 +463,8 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
*data << path.GetNodes()[i].z;
}
+ *data << uint8(0); // added in 3.0.8
+
/*for(uint32 i = 0; i < poscount; i++)
{
// path points
@@ -482,7 +502,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
break;
case TYPEID_PLAYER:
if(flags & UPDATEFLAG_SELF)
- *data << uint32(0x00000015); // unk, can be 0x15 or 0x22
+ *data << uint32(0x0000002F); // unk, can be 0x15 or 0x22
else
*data << uint32(0x00000008); // unk, can be 0x7 or 0x8
break;
@@ -505,6 +525,15 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
case TYPEID_CORPSE:
*data << uint32(GetGUIDHigh()); // GetGUIDHigh()
break;
+ case TYPEID_UNIT:
+ *data << uint32(0x0000000B); // unk, can be 0xB or 0xC
+ break;
+ case TYPEID_PLAYER:
+ if(flags & UPDATEFLAG_SELF)
+ *data << uint32(0x0000002F); // unk, can be 0x15 or 0x22
+ else
+ *data << uint32(0x00000008); // unk, can be 0x7 or 0x8
+ break;
default:
*data << uint32(0x00000000); // unk
break;
@@ -512,9 +541,12 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
}
// 0x4
- if(flags & UPDATEFLAG_FULLGUID)
+ if(flags & UPDATEFLAG_HAS_TARGET) // packed guid (current target guid)
{
- *data << uint8(0); // packed guid (probably target guid)
+ if(Unit *victim = ((Unit*)this)->getVictim())
+ data->append(victim->GetPackGUID());
+ else
+ *data << uint8(0);
}
// 0x2
@@ -522,6 +554,13 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2
{
*data << uint32(getMSTime()); // ms time
}
+
+ // 0x80
+ if(flags & UPDATEFLAG_VEHICLE) // unused for now
+ {
+ *data << uint32(((Vehicle*)this)->GetVehicleInfo()->m_ID); // vehicle id
+ *data << float(0); // facing adjustment
+ }
}
void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *updateMask, Player *target) const
@@ -537,10 +576,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if ( ((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster())
{
IsActivateToQuest = true;
- updateMask->SetBit(GAMEOBJECT_DYN_FLAGS);
+ updateMask->SetBit(GAMEOBJECT_DYNAMIC);
}
- if (GetUInt32Value(GAMEOBJECT_ARTKIT))
- updateMask->SetBit(GAMEOBJECT_ARTKIT);
+ if (((GameObject*)this)->GetGoArtKit())
+ updateMask->SetBit(GAMEOBJECT_BYTES_1);
}
}
else //case UPDATETYPE_VALUES
@@ -551,8 +590,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
{
IsActivateToQuest = true;
}
- updateMask->SetBit(GAMEOBJECT_DYN_FLAGS);
- updateMask->SetBit(GAMEOBJECT_ANIMPROGRESS);
+ updateMask->SetBit(GAMEOBJECT_DYNAMIC);
+ updateMask->SetBit(GAMEOBJECT_BYTES_1);
}
}
@@ -625,33 +664,32 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
// FG: pretend that OTHER players in own group are friendly ("blue")
else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
{
- bool ch = false;
- if(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER && target != this)
- {
- if(target->IsInSameGroupWith((Player*)this) || target->IsInSameRaidWith((Player*)this))
+ bool ch = false;
+ if(GetTypeId() == TYPEID_PLAYER && target != this
+ && ((Player*)this)->IsInSameRaidWith(target))
{
- if(index == UNIT_FIELD_BYTES_2)
+ // Allow targetting opposite faction in party when enabled in config
+ if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && index == UNIT_FIELD_BYTES_2)
{
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
- *data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5) << 8) ); // this flag is at uint8 offset 1 !!
+ *data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY /*| UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5*/) << 8) ); // this flag is at uint8 offset 1 !!
ch = true;
}
- else if(index == UNIT_FIELD_FACTIONTEMPLATE)
+ else
{
FactionTemplateEntry const *ft1, *ft2;
ft1 = ((Player*)this)->getFactionTemplateEntry();
- ft2 = ((Player*)target)->getFactionTemplateEntry();
+ ft2 = target->getFactionTemplateEntry();
if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
{
- uint32 faction = ((Player*)target)->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
+ uint32 faction = target->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
*data << uint32(faction);
ch = true;
}
}
}
- }
if(!ch)
*data << m_uint32Values[ index ];
}
@@ -670,7 +708,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if( updateMask->GetBit( index ) )
{
// send in current format (float as float, uint32 as uint32)
- if ( index == GAMEOBJECT_DYN_FLAGS )
+ if ( index == GAMEOBJECT_DYNAMIC )
{
if(IsActivateToQuest )
{
@@ -710,11 +748,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
void Object::ClearUpdateMask(bool remove)
{
- for( uint16 index = 0; index < m_valuesCount; index ++ )
- {
- if(m_uint32Values_mirror[index]!= m_uint32Values[index])
- m_uint32Values_mirror[index] = m_uint32Values[index];
- }
+ uint32 *temp = m_uint32Values;
+
+ memcpy(m_uint32Values_mirror, m_uint32Values, m_valuesCount*sizeof(uint32));
+
if(m_objectUpdated)
{
if(remove)
@@ -758,18 +795,23 @@ bool Object::LoadValues(const char* data)
void Object::_SetUpdateBits(UpdateMask *updateMask, Player* /*target*/) const
{
- for( uint16 index = 0; index < m_valuesCount; index ++ )
+ uint32 *value = m_uint32Values;
+ uint32 *mirror = m_uint32Values_mirror;
+
+ for(uint16 index = 0; index < m_valuesCount; ++index, ++value, ++mirror)
{
- if(m_uint32Values_mirror[index]!= m_uint32Values[index])
+ if(*mirror != *value)
updateMask->SetBit(index);
}
}
void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const
{
- for( uint16 index = 0; index < m_valuesCount; index++ )
+ uint32 *value = m_uint32Values;
+
+ for(uint16 index = 0; index < m_valuesCount; ++index, ++value)
{
- if(GetUInt32Value(index) != 0)
+ if(*value)
updateMask->SetBit(index);
}
}
@@ -831,6 +873,48 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
}
}
+bool Object::AddUInt64Value(uint16 index, const uint64 &value)
+{
+ ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) );
+ if(value && !*((uint64*)&(m_uint32Values[index])))
+ {
+ m_uint32Values[ index ] = *((uint32*)&value);
+ m_uint32Values[ index + 1 ] = *(((uint32*)&value) + 1);
+
+ if(m_inWorld)
+ {
+ if(!m_objectUpdated)
+ {
+ ObjectAccessor::Instance().AddUpdateObject(this);
+ m_objectUpdated = true;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+bool Object::RemoveUInt64Value(uint16 index, const uint64 &value)
+{
+ ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) );
+ if(value && *((uint64*)&(m_uint32Values[index])) == value)
+ {
+ m_uint32Values[ index ] = 0;
+ m_uint32Values[ index + 1 ] = 0;
+
+ if(m_inWorld)
+ {
+ if(!m_objectUpdated)
+ {
+ ObjectAccessor::Instance().AddUpdateObject(this);
+ m_objectUpdated = true;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
void Object::SetFloatValue( uint16 index, float value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );
@@ -1051,6 +1135,8 @@ bool Object::PrintIndexError(uint32 index, bool set) const
}
WorldObject::WorldObject()
+ : m_mapId(0), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL),
+ m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f)
{
m_positionX = 0.0f;
m_positionY = 0.0f;
@@ -1062,8 +1148,6 @@ WorldObject::WorldObject()
m_name = "";
- mSemaphoreTeleport = false;
-
m_isActive = false;
IsTempWorldObject = false;
}
@@ -1072,8 +1156,8 @@ void WorldObject::SetWorldObject(bool on)
{
if(!IsInWorld())
return;
-
- GetMap()->AddObjectToSwitchList(this, on);
+
+ GetMap()->AddObjectToSwitchList(this, on);
}
void WorldObject::setActive( bool on )
@@ -1109,21 +1193,27 @@ void WorldObject::setActive( bool on )
}
}
-void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid )
+void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid, uint32 phaseMask )
{
Object::_Create(guidlow, 0, guidhigh);
m_mapId = mapid;
+ m_phaseMask = phaseMask;
}
uint32 WorldObject::GetZoneId() const
{
- return MapManager::Instance().GetBaseMap(m_mapId)->GetZoneId(m_positionX,m_positionY);
+ return MapManager::Instance().GetBaseMap(m_mapId)->GetZoneId(m_positionX,m_positionY,m_positionZ);
}
uint32 WorldObject::GetAreaId() const
{
- return MapManager::Instance().GetBaseMap(m_mapId)->GetAreaId(m_positionX,m_positionY);
+ return MapManager::Instance().GetBaseMap(m_mapId)->GetAreaId(m_positionX,m_positionY,m_positionZ);
+}
+
+void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
+{
+ MapManager::Instance().GetBaseMap(m_mapId)->GetZoneAndAreaId(zoneid,areaid,m_positionX,m_positionY,m_positionZ);
}
InstanceData* WorldObject::GetInstanceData()
@@ -1152,6 +1242,13 @@ float WorldObject::GetDistance2d(float x, float y) const
return ( dist > 0 ? dist : 0);
}
+float WorldObject::GetExactDistance2d(const float x, const float y) const
+{
+ float dx = GetPositionX() - x;
+ float dy = GetPositionY() - y;
+ return sqrt((dx*dx) + (dy*dy));
+}
+
float WorldObject::GetDistance(const float x, const float y, const float z) const
{
float dx = GetPositionX() - x;
@@ -1238,6 +1335,25 @@ float WorldObject::GetAngle( const float x, const float y ) const
return ang;
}
+void WorldObject::GetSinCos(const float x, const float y, float &vsin, float &vcos)
+{
+ float dx = GetPositionX() - x;
+ float dy = GetPositionY() - y;
+
+ if(dx < 0.001f && dy < 0.001f)
+ {
+ float angle = rand_norm()*2*M_PI;
+ vcos = cos(angle);
+ vsin = sin(angle);
+ }
+ else
+ {
+ float dist = sqrt((dx*dx) + (dy*dy));
+ vcos = dx / dist;
+ vsin = dy / dist;
+ }
+}
+
bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
{
// always have self in arc
@@ -1359,50 +1475,17 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
namespace Trinity
{
- class MessageChatLocaleCacheDo
+ class MonsterChatBuilder
{
public:
- MessageChatLocaleCacheDo(WorldObject const& obj, ChatMsg msgtype, int32 textId, uint32 language, uint64 targetGUID, float dist)
- : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language),
- i_targetGUID(targetGUID), i_dist(dist)
- {
- }
-
- ~MessageChatLocaleCacheDo()
+ MonsterChatBuilder(WorldObject const& obj, ChatMsg msgtype, int32 textId, uint32 language, uint64 targetGUID)
+ : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {}
+ void operator()(WorldPacket& data, int32 loc_idx)
{
- for(int i = 0; i < i_data_cache.size(); ++i)
- delete i_data_cache[i];
- }
-
- void operator()(Player* p)
- {
- // skip far away players
- if(p->GetDistance(&i_object) > i_dist)
- return;
-
- uint32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
- uint32 cache_idx = loc_idx+1;
- WorldPacket* data;
-
- // create if not cached yet
- if(i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
- {
- if(i_data_cache.size() < cache_idx+1)
- i_data_cache.resize(cache_idx+1);
-
- char const* text = objmgr.GetTrinityString(i_textId,loc_idx);
-
- data = new WorldPacket(SMSG_MESSAGECHAT, 200);
-
- // TODO: i_object.GetName() also must be localized?
- i_object.BuildMonsterChat(data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
-
- i_data_cache[cache_idx] = data;
- }
- else
- data = i_data_cache[cache_idx];
+ char const* text = objmgr.GetMangosString(i_textId,loc_idx);
- p->SendDirectMessage(data);
+ // TODO: i_object.GetName() also must be localized?
+ i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
}
private:
@@ -1411,8 +1494,6 @@ namespace Trinity
int32 i_textId;
uint32 i_language;
uint64 i_targetGUID;
- float i_dist;
- std::vector<WorldPacket*> i_data_cache; // 0 = default, i => i-1 locale index
};
} // namespace Trinity
@@ -1424,9 +1505,10 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY));
- Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
- TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+ MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid);
+ MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
+ MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
+ TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, message, *GetMap());
}
@@ -1439,13 +1521,27 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::MessageChatLocaleCacheDo say_do(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL));
- Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
- TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+ MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
+ MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
+ MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
+ TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, message, *GetMap());
}
+void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid)
+{
+ MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
+ MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
+
+ uint32 zoneid = GetZoneId();
+
+ Map::PlayerList const& pList = GetMap()->GetPlayers();
+ for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
+ if(itr->getSource()->GetZoneId()==zoneid)
+ say_do(itr->getSource());
+}
+
void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote)
{
CellPair p = Trinity::ComputeCellPair(GetPositionX(), GetPositionY());
@@ -1454,9 +1550,10 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::MessageChatLocaleCacheDo say_do(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
- Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo> say_worker(say_do);
- TypeContainerVisitor<Trinity::PlayerWorker<Trinity::MessageChatLocaleCacheDo>, WorldTypeMapContainer > message(say_worker);
+ MaNGOS::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid);
+ MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> say_do(say_build);
+ MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
+ TypeContainerVisitor<MaNGOS::PlayerDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, message, *GetMap());
}
@@ -1471,7 +1568,7 @@ void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisp
char const* text = objmgr.GetTrinityString(textId,loc_idx);
WorldPacket data(SMSG_MESSAGECHAT, 200);
- BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetName(),receiver);
+ BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver);
player->GetSession()->SendPacket(&data);
}
@@ -1508,13 +1605,24 @@ void WorldObject::BuildHeartBeatMsg(WorldPacket *data) const
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
data->append(GetPackGUID());
*data << uint32(((Unit*)this)->GetUnitMovementFlags()); // movement flags
- *data << uint8(0); // 2.3.0
+ *data << uint16(0); // 2.3.0
*data << getMSTime(); // time
*data << m_positionX;
*data << m_positionY;
*data << m_positionZ;
*data << m_orientation;
- *data << uint32(0);
+ if(((Unit*)this)->m_Vehicle)
+ {
+ *data << uint64(((Unit*)this)->m_Vehicle->GetGUID());
+ *data << float (((Unit*)this)->GetTransOffsetX());
+ *data << float (((Unit*)this)->GetTransOffsetY());
+ *data << float (((Unit*)this)->GetTransOffsetZ());
+ *data << float (((Unit*)this)->GetTransOffsetO());
+ *data << uint32(((Unit*)this)->GetTransTime());
+ *data << uint8 (((Unit*)this)->GetTransSeat());
+ sLog.outError("heart seat is %u", ((Unit*)this)->GetTransTime());
+ }
+ *data << uint32(0); //fall time
}
void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float z, float ang) const
@@ -1527,12 +1635,23 @@ void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float
data->append(GetPackGUID());
*data << uint32(0); // this value increments every time
*data << uint32(((Unit*)this)->GetUnitMovementFlags()); // movement flags
- *data << uint8(0); // 2.3.0
+ *data << uint16(0); // 2.3.0
*data << getMSTime(); // time
*data << x;
*data << y;
*data << z;
*data << ang;
+ if(((Unit*)this)->m_Vehicle)
+ {
+ *data << uint64(((Unit*)this)->m_Vehicle->GetGUID());
+ *data << float (((Unit*)this)->GetTransOffsetX());
+ *data << float (((Unit*)this)->GetTransOffsetY());
+ *data << float (((Unit*)this)->GetTransOffsetZ());
+ *data << float (((Unit*)this)->GetTransOffsetO());
+ *data << uint32(((Unit*)this)->GetTransTime());
+ *data << uint8 (((Unit*)this)->GetTransSeat());
+ sLog.outError("seat is %u", ((Unit*)this)->GetTransTime());
+ }
*data << uint32(0);
}
@@ -1582,60 +1701,126 @@ void WorldObject::AddObjectToRemoveList()
map->AddObjectToRemoveList(this);
}
-Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime)
+TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float angle, SummonPropertiesEntry const *properties, uint32 duration, Unit *summoner)
{
- TemporarySummon* pCreature = new TemporarySummon(GetGUID());
+ uint32 mask = SUMMON_MASK_SUMMON;
+ if(properties)
+ {
+ if(properties->Category == SUMMON_CATEGORY_PET
+ || properties->Type == SUMMON_TYPE_GUARDIAN
+ || properties->Type == SUMMON_TYPE_MINION)
+ mask = SUMMON_MASK_GUARDIAN;
+ else if(properties->Type == SUMMON_TYPE_TOTEM)
+ mask = SUMMON_MASK_TOTEM;
+ else if(properties->Category == SUMMON_CATEGORY_VEHICLE
+ || properties->Type == SUMMON_TYPE_VEHICLE)
+ mask = SUMMON_MASK_VEHICLE;
+ }
- uint32 team = 0;
- if (GetTypeId()==TYPEID_PLAYER)
- team = ((Player*)this)->GetTeam();
+ uint32 phase = PHASEMASK_NORMAL, team = 0;
+ if(summoner)
+ {
+ phase = summoner->GetPhaseMask();
+ if(summoner->GetTypeId() == TYPEID_PLAYER)
+ team = ((Player*)summoner)->GetTeam();
+ }
- if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMap(), id, team))
+ TempSummon *summon = NULL;
+ switch(mask)
+ {
+ case SUMMON_MASK_SUMMON: summon = new TempSummon (properties, summoner); break;
+ case SUMMON_MASK_GUARDIAN: summon = new Guardian (properties, summoner); break;
+ case SUMMON_MASK_TOTEM: summon = new Totem (properties, summoner); break;
+ default: return NULL;
+ }
+ if(!summon->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, team))
{
- delete pCreature;
+ delete summon;
return NULL;
}
+ summon->Relocate(x, y, z, angle);
+ if(!summon->IsPositionValid())
+ {
+ sLog.outError("Creature (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",summon->GetGUIDLow(),summon->GetEntry(),summon->GetPositionX(),summon->GetPositionY());
+ delete summon;
+ return NULL;
+ }
+
+ Add((Creature*)summon);
+ summon->InitSummon(duration);
+
+ return summon;
+}
+
+TempSummon* WorldObject::SummonCreature(uint32 entry, float x, float y, float z, float ang, TempSummonType spwtype, uint32 duration)
+{
+ Map *map = FindMap();
+ if(!map)
+ return NULL;
+
if (x == 0.0f && y == 0.0f && z == 0.0f)
- GetClosePoint(x, y, z, pCreature->GetObjectSize());
+ GetClosePoint(x, y, z, GetObjectSize());
- pCreature->Relocate(x, y, z, ang);
+ TempSummon *pCreature = map->SummonCreature(entry, x, y, z, ang, NULL, duration, GetTypeId() == TYPEID_UNIT ? (Unit*)this : NULL);
+ if(!pCreature)
+ return NULL;
+
+ pCreature->SetHomePosition(x, y, z, ang);
+ pCreature->SetTempSummonType(spwtype);
+
+ return pCreature;
+}
+
+Vehicle* WorldObject::SummonVehicle(uint32 entry, float x, float y, float z, float ang)
+{
+ CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
+ if(!ci)
+ return NULL;
+
+ uint32 id = ci->VehicleId; //temp store id here
+ if(!id) id = 156;
+ VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
+ if(!ve)
+ return NULL;
- if(!pCreature->IsPositionValid())
+ Vehicle *v = new Vehicle;
+ Map *map = GetMap();
+ uint32 team = 0;
+ if (GetTypeId()==TYPEID_PLAYER)
+ team = ((Player*)this)->GetTeam();
+ if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, GetPhaseMask(), entry, id, team))
{
- sLog.outError("ERROR: Creature (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
- delete pCreature;
+ delete v;
return NULL;
}
- pCreature->SetHomePosition(x, y, z, ang);
- pCreature->Summon(spwtype, despwtime);
-
- if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->IsAIEnabled)
- ((Creature*)this)->AI()->JustSummoned(pCreature);
+ v->Relocate(x, y, z, ang);
- if(pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && pCreature->m_spells[0])
+ if(!v->IsPositionValid())
{
- if(GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER)
- pCreature->setFaction(((Unit*)this)->getFaction());
- pCreature->CastSpell(pCreature, pCreature->m_spells[0], false, 0, 0, GetGUID());
+ sLog.outError("ERROR: Vehicle (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ v->GetGUIDLow(), v->GetEntry(), v->GetPositionX(), v->GetPositionY());
+ delete v;
+ return NULL;
}
- //return the creature therewith the summoner has access to it
- return pCreature;
+ map->Add((Creature*)v);
+
+ return v;
}
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration)
{
- Pet* pet = new Pet(petType);
+ Pet* pet = new Pet(this, petType);
if(petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
{
// Remove Demonic Sacrifice auras (known pet)
- Unit::AuraList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
+ Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
{
- if((*itr)->GetModifier()->m_miscvalue==2228)
+ if((*itr)->GetMiscValue()==2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
@@ -1659,7 +1844,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
Map *map = GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
- if(!pet->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, entry, pet_number))
+ if(!pet->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
sLog.outError("no such creature entry %u", entry);
delete pet;
@@ -1675,15 +1860,12 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
return NULL;
}
- pet->SetOwnerGUID(GetGUID());
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, false);
- pet->AIM_Initialize();
-
map->Add((Creature*)pet);
pet->setPowerType(POWER_MANA);
@@ -1691,12 +1873,12 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
pet->InitStatsForLevel(getLevel());
+ SetGuardian(pet, true);
+
switch(petType)
{
- case GUARDIAN_PET:
case POSSESSED_PET:
pet->SetUInt32Value(UNIT_FIELD_FLAGS,0);
- AddGuardian(pet);
break;
case SUMMON_PET:
pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
@@ -1706,7 +1888,6 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
pet->InitPetCreateSpells();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- SetPet(pet);
PetSpellInitialize();
break;
}
@@ -1714,10 +1895,10 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
if(petType == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (known pet)
- Unit::AuraList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
+ Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
{
- if((*itr)->GetModifier()->m_miscvalue==2228)
+ if((*itr)->GetMiscValue()==2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
@@ -1746,7 +1927,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
}
Map *map = GetMap();
GameObject *go = new GameObject();
- if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry,map,x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,1))
+ if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,1))
{
delete go;
return NULL;
@@ -1808,5 +1989,31 @@ void WorldObject::GetGroundPoint(float &x, float &y, float &z, float dist, float
UpdateGroundPositionZ(x, y, z);
}
+void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update)
+{
+ m_phaseMask = newPhaseMask;
+ if(update && IsInWorld())
+ ObjectAccessor::UpdateObjectVisibility(this);
+}
+void WorldObject::PlayDistanceSound( uint32 sound_id, Player* target /*= NULL*/ )
+{
+ WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8);
+ data << uint32(sound_id);
+ data << GetGUID();
+ if (target)
+ target->SendDirectMessage( &data );
+ else
+ SendMessageToSet( &data, true );
+}
+
+void WorldObject::PlayDirectSound( uint32 sound_id, Player* target /*= NULL*/ )
+{
+ WorldPacket data(SMSG_PLAY_SOUND, 4);
+ data << uint32(sound_id);
+ if (target)
+ target->SendDirectMessage( &data );
+ else
+ SendMessageToSet( &data, true );
+}
diff --git a/src/game/Object.h b/src/game/Object.h
index ecba2a77f65..83c2afbb880 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -28,7 +28,6 @@
#include "GameSystem/GridReference.h"
#include "ObjectDefines.h"
#include "GridDefines.h"
-#include "CreatureAI.h"
#include "Map.h"
#include <set>
@@ -50,13 +49,14 @@ enum TypeMask
TYPEMASK_OBJECT = 0x0001,
TYPEMASK_ITEM = 0x0002,
TYPEMASK_CONTAINER = 0x0006, // TYPEMASK_ITEM | 0x0004
- TYPEMASK_UNIT = 0x0008,
+ TYPEMASK_UNIT = 0x0008, //creature or player
TYPEMASK_PLAYER = 0x0010,
TYPEMASK_GAMEOBJECT = 0x0020,
TYPEMASK_DYNAMICOBJECT = 0x0040,
TYPEMASK_CORPSE = 0x0080,
TYPEMASK_AIGROUP = 0x0100,
- TYPEMASK_AREATRIGGER = 0x0200
+ TYPEMASK_AREATRIGGER = 0x0200,
+ TYPEMASK_SEER = TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
};
enum TypeID
@@ -72,6 +72,7 @@ enum TypeID
TYPEID_AIGROUP = 8,
TYPEID_AREATRIGGER = 9
};
+#define MAX_TYPEID 10
uint32 GuidHigh2TypeId(uint32 guid_hi);
@@ -87,6 +88,12 @@ enum TempSummonType
TEMPSUMMON_MANUAL_DESPAWN = 8 // despawns when UnSummon() is called
};
+enum PhaseMasks
+{
+ PHASEMASK_NORMAL = 0x00000001,
+ PHASEMASK_ANYWHERE = 0xFFFFFFFF
+};
+
class WorldPacket;
class UpdateData;
class ByteBuffer;
@@ -96,6 +103,9 @@ class Player;
class UpdateMask;
class InstanceData;
class GameObject;
+class TempSummon;
+class Vehicle;
+class CreatureAI;
typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
@@ -117,7 +127,7 @@ class TRINITY_DLL_SPEC Object
public:
virtual ~Object ( );
- const bool& IsInWorld() const { return m_inWorld; }
+ const bool IsInWorld() const { return m_inWorld; }
virtual void AddToWorld()
{
if(m_inWorld)
@@ -210,6 +220,9 @@ class TRINITY_DLL_SPEC Object
void SetStatFloatValue( uint16 index, float value);
void SetStatInt32Value( uint16 index, int32 value);
+ bool AddUInt64Value( uint16 index, const uint64 &value );
+ bool RemoveUInt64Value( uint16 index, const uint64 &value );
+
void ApplyModUInt32Value(uint16 index, int32 val, bool apply);
void ApplyModInt32Value(uint16 index, int32 val, bool apply);
void ApplyModUInt64Value(uint16 index, int32 val, bool apply);
@@ -357,7 +370,15 @@ class TRINITY_DLL_SPEC WorldObject : public Object
virtual void Update ( uint32 /*time_diff*/ ) { }
- void _Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid );
+ void _Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid, uint32 phaseMask);
+
+ void Relocate(WorldObject *obj)
+ {
+ m_positionX = obj->GetPositionX();
+ m_positionY = obj->GetPositionY();
+ m_positionZ = obj->GetPositionZ();
+ m_orientation = obj->GetOrientation();
+ }
void Relocate(float x, float y, float z, float orientation)
{
@@ -421,8 +442,14 @@ class TRINITY_DLL_SPEC WorldObject : public Object
void SetMapId(uint32 newMap) { m_mapId = newMap; }
uint32 GetMapId() const { return m_mapId; }
+ virtual void SetPhaseMask(uint32 newPhaseMask, bool update);
+ uint32 GetPhaseMask() const { return m_phaseMask; }
+ bool InSamePhase(WorldObject const* obj) const { return InSamePhase(obj->GetPhaseMask()); }
+ bool InSamePhase(uint32 phasemask) const { return (GetPhaseMask() & phasemask); }
+
uint32 GetZoneId() const;
uint32 GetAreaId() const;
+ void GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const;
InstanceData* GetInstanceData();
@@ -436,22 +463,26 @@ class TRINITY_DLL_SPEC WorldObject : public Object
float GetDistanceSq(const float &x, const float &y, const float &z) const;
float GetDistance2d(const WorldObject* obj) const;
float GetDistance2d(const float x, const float y) const;
+ float GetExactDistance2d(const float x, const float y) const;
float GetDistanceZ(const WorldObject* obj) const;
- bool IsInMap(const WorldObject* obj) const { return GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
+ bool IsInMap(const WorldObject* obj) const
+ {
+ return IsInWorld() && obj->IsInWorld() && GetMapId()==obj->GetMapId() &&
+ GetInstanceId()==obj->GetInstanceId() && InSamePhase(obj);
+ }
bool IsWithinDistInMap(const WorldObject* obj, const float dist2compare, const bool is3D = true) const;
bool IsWithinLOS(const float x, const float y, const float z ) const;
bool IsWithinLOSInMap(const WorldObject* obj) const;
float GetAngle( const WorldObject* obj ) const;
float GetAngle( const float x, const float y ) const;
+ void GetSinCos(const float x, const float y, float &vsin, float &vcos);
bool HasInArc( const float arcangle, const WorldObject* obj ) const;
virtual void SendMessageToSet(WorldPacket *data, bool self, bool to_possessor = true);
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor = true);
void BuildHeartBeatMsg( WorldPacket *data ) const;
void BuildTeleportAckMsg( WorldPacket *data, float x, float y, float z, float ang) const;
- bool IsBeingTeleported() { return mSemaphoreTeleport; }
- void SetSemaphoreTeleport(bool semphsetting) { mSemaphoreTeleport = semphsetting; }
void MonsterSay(const char* text, uint32 language, uint64 TargetGuid);
void MonsterYell(const char* text, uint32 language, uint64 TargetGuid);
@@ -461,8 +492,12 @@ class TRINITY_DLL_SPEC WorldObject : public Object
void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
+ void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
void BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
+ void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
+ void PlayDirectSound(uint32 sound_id, Player* target = NULL);
+
void SendObjectDeSpawnAnim(uint64 guid);
virtual void SaveRespawnTime() {}
@@ -484,9 +519,10 @@ class TRINITY_DLL_SPEC WorldObject : public Object
Map * GetMap() const;
Map * FindMap() const;
Map const* GetBaseMap() const;
- Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
+ TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
+ Vehicle* SummonVehicle(uint32 entry, float x, float y, float z, float ang);
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
- Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
+ Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
bool isActiveObject() const { return m_isActive; }
void setActive(bool isActiveObject);
void SetWorldObject(bool apply);
@@ -501,16 +537,14 @@ class TRINITY_DLL_SPEC WorldObject : public Object
bool m_isActive;
private:
- uint32 m_mapId;
+ uint32 m_mapId; // object at map with map_id
+ uint32 m_InstanceId; // in map copy with instance id
+ uint32 m_phaseMask; // in area phase state
float m_positionX;
float m_positionY;
float m_positionZ;
float m_orientation;
-
- bool mSemaphoreTeleport;
-
- uint32 m_InstanceId;
};
#endif
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp
index 5ad5f036813..7daf7e5395e 100644
--- a/src/game/ObjectAccessor.cpp
+++ b/src/game/ObjectAccessor.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,8 +25,7 @@
#include "Creature.h"
#include "GameObject.h"
#include "DynamicObject.h"
-#include "Corpse.h"
-#include "WorldSession.h"
+#include "Vehicle.h"
#include "WorldPacket.h"
#include "Item.h"
#include "Corpse.h"
@@ -38,6 +37,7 @@
#include "Opcodes.h"
#include "ObjectDefines.h"
#include "MapInstanced.h"
+#include "World.h"
#include <cmath>
@@ -45,38 +45,6 @@
INSTANTIATE_SINGLETON_2(ObjectAccessor, CLASS_LOCK);
INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ZThread::FastMutex);
-namespace Trinity
-{
- struct TRINITY_DLL_DECL BuildUpdateForPlayer
- {
- Player &i_player;
- UpdateDataMapType &i_updatePlayers;
-
- BuildUpdateForPlayer(Player &player, UpdateDataMapType &data_map) : i_player(player), i_updatePlayers(data_map) {}
-
- void Visit(PlayerMapType &m)
- {
- for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
- {
- if( iter->getSource() == &i_player )
- continue;
-
- UpdateDataMapType::iterator iter2 = i_updatePlayers.find(iter->getSource());
- if( iter2 == i_updatePlayers.end() )
- {
- std::pair<UpdateDataMapType::iterator, bool> p = i_updatePlayers.insert( ObjectAccessor::UpdateDataValueType(iter->getSource(), UpdateData()) );
- assert(p.second);
- iter2 = p.first;
- }
-
- i_player.BuildValuesUpdateBlockForPlayer(&iter2->second, iter2->first);
- }
- }
-
- template<class SKIP> void Visit(GridRefManager<SKIP> &) {}
- };
-}
-
ObjectAccessor::ObjectAccessor() {}
ObjectAccessor::~ObjectAccessor() {}
@@ -113,13 +81,11 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3
return NULL;
// not unfriendly
- FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction());
- if(factionTemplate)
- {
- FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction);
- if( faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
- return NULL;
- }
+ if(FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction()))
+ if(factionTemplate->faction)
+ if(FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction))
+ if(faction->reputationListID >= 0 && player.GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
+ return NULL;
// not too far
if(!unit->IsWithinDistInMap(&player,INTERACTION_DISTANCE))
@@ -129,11 +95,14 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3
}
Creature*
-ObjectAccessor::GetCreatureOrPet(WorldObject const &u, uint64 guid)
+ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const &u, uint64 guid)
{
if(Creature *unit = GetPet(guid))
return unit;
+ if(Creature *unit = GetVehicle(guid))
+ return unit;
+
return GetCreature(u, guid);
}
@@ -162,18 +131,23 @@ ObjectAccessor::GetUnit(WorldObject const &u, uint64 guid)
if(IS_PLAYER_GUID(guid))
return FindPlayer(guid);
- return GetCreatureOrPet(u, guid);
+ return GetCreatureOrPetOrVehicle(u, guid);
}
Corpse*
ObjectAccessor::GetCorpse(WorldObject const &u, uint64 guid)
{
Corpse * ret = GetObjectInWorld(guid, (Corpse*)NULL);
- if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
+ if(!ret)
+ return NULL;
+ if(ret->GetMapId() != u.GetMapId())
+ return NULL;
+ if(ret->GetInstanceId() != u.GetInstanceId())
+ return NULL;
return ret;
}
-Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32 typemask)
+Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const &p, uint64 guid, uint32 typemask)
{
Object *obj = NULL;
@@ -185,7 +159,7 @@ Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32
if(typemask & TYPEMASK_UNIT)
{
- obj = GetCreatureOrPet(p,guid);
+ obj = GetCreatureOrPetOrVehicle(p,guid);
if(obj) return obj;
}
@@ -201,9 +175,9 @@ Object* ObjectAccessor::GetObjectByTypeMask(Player const &p, uint64 guid, uint32
if(obj) return obj;
}
- if(typemask & TYPEMASK_ITEM)
+ if(typemask & TYPEMASK_ITEM && p.GetTypeId() == TYPEID_PLAYER)
{
- obj = p.GetItemByGuid( guid );
+ obj = ((Player const &)p).GetItemByGuid( guid );
if(obj) return obj;
}
@@ -214,15 +188,25 @@ GameObject*
ObjectAccessor::GetGameObject(WorldObject const &u, uint64 guid)
{
GameObject * ret = GetObjectInWorld(guid, (GameObject*)NULL);
- if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
+ if(!ret)
+ return NULL;
+ if(ret->GetMapId() != u.GetMapId())
+ return NULL;
+ if(ret->GetInstanceId() != u.GetInstanceId())
+ return NULL;
return ret;
}
DynamicObject*
-ObjectAccessor::GetDynamicObject(Unit const &u, uint64 guid)
+ObjectAccessor::GetDynamicObject(WorldObject const &u, uint64 guid)
{
DynamicObject * ret = GetObjectInWorld(guid, (DynamicObject*)NULL);
- if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
+ if(!ret)
+ return NULL;
+ if(ret->GetMapId() != u.GetMapId())
+ return NULL;
+ if(ret->GetInstanceId() != u.GetInstanceId())
+ return NULL;
return ret;
}
@@ -273,48 +257,15 @@ ObjectAccessor::UpdateObject(Object* obj, Player* exceptPlayer)
}
void
-ObjectAccessor::AddUpdateObject(Object *obj)
-{
- Guard guard(i_updateGuard);
- i_objects.insert(obj);
-}
-
-void
-ObjectAccessor::RemoveUpdateObject(Object *obj)
-{
- Guard guard(i_updateGuard);
- std::set<Object *>::iterator iter = i_objects.find(obj);
- if( iter != i_objects.end() )
- i_objects.erase( iter );
-}
-
-void
ObjectAccessor::_buildUpdateObject(Object *obj, UpdateDataMapType &update_players)
{
- bool build_for_all = true;
- Player *pl = NULL;
- if( obj->isType(TYPEMASK_ITEM) )
- {
- Item *item = static_cast<Item *>(obj);
- pl = item->GetOwner();
- build_for_all = false;
- }
-
- if( pl != NULL )
- _buildPacket(pl, obj, update_players);
-
- // Capt: okey for all those fools who think its a real fix
- // THIS IS A TEMP FIX
- if( build_for_all )
+ if(obj->isType(TYPEMASK_ITEM))
{
- WorldObject * temp = dynamic_cast<WorldObject*>(obj);
-
- //assert(dynamic_cast<WorldObject*>(obj)!=NULL);
- if (temp)
- _buildChangeObjectForPlayer(temp, update_players);
- else
- sLog.outDebug("ObjectAccessor: Ln 405 Temp bug fix");
+ if(Player *owner = ((Item*)obj)->GetOwner())
+ _buildPacket(owner, obj, update_players);
}
+ else
+ _buildChangeObjectForPlayer((WorldObject*)obj, update_players);
}
void
@@ -351,6 +302,12 @@ ObjectAccessor::GetPet(uint64 guid)
return GetObjectInWorld(guid, (Pet*)NULL);
}
+Vehicle*
+ObjectAccessor::GetVehicle(uint64 guid)
+{
+ return GetObjectInWorld(guid, (Vehicle*)NULL);
+}
+
Corpse*
ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
{
@@ -423,18 +380,18 @@ ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* ma
}
Corpse*
-ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid)
+ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia)
{
Corpse *corpse = GetCorpseForPlayerGUID(player_guid);
if(!corpse)
{
//in fact this function is called from several places
//even when player doesn't have a corpse, not an error
- //sLog.outError("ERROR: Try remove corpse that not in map for GUID %ul", player_guid);
+ //sLog.outError("Try remove corpse that not in map for GUID %ul", player_guid);
return NULL;
}
- DEBUG_LOG("Deleting Corpse and spawning bones.\n");
+ DEBUG_LOG("Deleting Corpse and spawning bones.");
// remove corpse from player_guid -> corpse map
RemoveCorpse(corpse);
@@ -449,7 +406,10 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid)
Corpse *bones = NULL;
// create the bones only if the map and the grid is loaded at the corpse's location
- if(map && !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY()))
+ // ignore bones creating option in case insignia
+ if (map && (insignia ||
+ (map->IsBattleGroundOrArena() ? sWorld.getConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getConfig(CONFIG_DEATH_BONES_WORLD))) &&
+ !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY()))
{
// Create bones, don't change Corpse
bones = new Corpse;
@@ -465,6 +425,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid)
bones->Relocate(corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetOrientation());
bones->SetMapId(corpse->GetMapId());
bones->SetInstanceId(corpse->GetInstanceId());
+ bones->SetPhaseMask(corpse->GetPhaseMask(),false);
bones->SetUInt32Value(CORPSE_FIELD_FLAGS, CORPSE_FLAG_UNK2 | CORPSE_FLAG_BONES);
bones->SetUInt64Value(CORPSE_FIELD_OWNER, 0);
@@ -494,9 +455,8 @@ ObjectAccessor::Update(uint32 diff)
while(!i_objects.empty())
{
Object* obj = *i_objects.begin();
+ assert(obj && obj->IsInWorld());
i_objects.erase(i_objects.begin());
- if (!obj || !obj->IsInWorld())
- continue;
_buildUpdateObject(obj, update_players);
obj->ClearUpdateMask(false);
}
@@ -602,6 +562,7 @@ template <class T> ZThread::FastMutex HashMapHolder<T>::i_lock;
template class HashMapHolder<Player>;
template class HashMapHolder<Pet>;
+template class HashMapHolder<Vehicle>;
template class HashMapHolder<GameObject>;
template class HashMapHolder<DynamicObject>;
template class HashMapHolder<Creature>;
@@ -609,6 +570,7 @@ template class HashMapHolder<Corpse>;
template Player* ObjectAccessor::GetObjectInWorld<Player>(uint32 mapid, float x, float y, uint64 guid, Player* /*fake*/);
template Pet* ObjectAccessor::GetObjectInWorld<Pet>(uint32 mapid, float x, float y, uint64 guid, Pet* /*fake*/);
+template Vehicle* ObjectAccessor::GetObjectInWorld<Vehicle>(uint32 mapid, float x, float y, uint64 guid, Vehicle* /*fake*/);
template Creature* ObjectAccessor::GetObjectInWorld<Creature>(uint32 mapid, float x, float y, uint64 guid, Creature* /*fake*/);
template Corpse* ObjectAccessor::GetObjectInWorld<Corpse>(uint32 mapid, float x, float y, uint64 guid, Corpse* /*fake*/);
template GameObject* ObjectAccessor::GetObjectInWorld<GameObject>(uint32 mapid, float x, float y, uint64 guid, GameObject* /*fake*/);
diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h
index bbfc06b78b6..1f413e2db40 100644
--- a/src/game/ObjectAccessor.h
+++ b/src/game/ObjectAccessor.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@ class Corpse;
class Unit;
class GameObject;
class DynamicObject;
+class Vehicle;
class WorldObject;
class Map;
@@ -58,9 +59,7 @@ class HashMapHolder
static void Remove(T* o)
{
Guard guard(i_lock);
- typename MapType::iterator itr = m_objectMap.find(o->GetGUID());
- if (itr != m_objectMap.end())
- m_objectMap.erase(itr);
+ m_objectMap.erase(o->GetGUID());
}
static T* Find(uint64 guid)
@@ -139,17 +138,18 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor
else return NULL;
}
- static Object* GetObjectByTypeMask(Player const &, uint64, uint32 typemask);
+ static Object* GetObjectByTypeMask(WorldObject const &, uint64, uint32 typemask);
static Creature* GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint32 npcflagmask);
static Creature* GetCreature(WorldObject const &, uint64);
- static Creature* GetCreatureOrPet(WorldObject const &, uint64);
+ static Creature* GetCreatureOrPetOrVehicle(WorldObject const &, uint64);
static Unit* GetUnit(WorldObject const &, uint64);
static Pet* GetPet(Unit const &, uint64 guid) { return GetPet(guid); }
static Player* GetPlayer(Unit const &, uint64 guid) { return FindPlayer(guid); }
static GameObject* GetGameObject(WorldObject const &, uint64);
- static DynamicObject* GetDynamicObject(Unit const &, uint64);
+ static DynamicObject* GetDynamicObject(WorldObject const &, uint64);
static Corpse* GetCorpse(WorldObject const &u, uint64 guid);
static Pet* GetPet(uint64 guid);
+ static Vehicle* GetVehicle(uint64 guid);
static Player* FindPlayer(uint64);
Player* FindPlayerByName(const char *name) ;
@@ -159,6 +159,16 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor
return HashMapHolder<Player>::GetContainer();
}
+ HashMapHolder<Creature>::MapType& GetCreatures()
+ {
+ return HashMapHolder<Creature>::GetContainer();
+ }
+
+ HashMapHolder<GameObject>::MapType& GetGameObjects()
+ {
+ return HashMapHolder<GameObject>::GetContainer();
+ }
+
template<class T> void AddObject(T *object)
{
HashMapHolder<T>::Insert(object);
@@ -174,16 +184,22 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor
HashMapHolder<Player>::Remove(pl);
Guard guard(i_updateGuard);
-
- std::set<Object *>::iterator iter2 = std::find(i_objects.begin(), i_objects.end(), (Object *)pl);
- if( iter2 != i_objects.end() )
- i_objects.erase(iter2);
+ i_objects.erase((Object *)pl);
}
void SaveAllPlayers();
- void AddUpdateObject(Object *obj);
- void RemoveUpdateObject(Object *obj);
+ void AddUpdateObject(Object *obj)
+ {
+ Guard guard(i_updateGuard);
+ i_objects.insert(obj);
+ }
+
+ void RemoveUpdateObject(Object *obj)
+ {
+ Guard guard(i_updateGuard);
+ i_objects.erase( obj );
+ }
void Update(uint32 diff);
void UpdatePlayers(uint32 diff);
@@ -192,7 +208,7 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton<ObjectAccessor
void RemoveCorpse(Corpse *corpse);
void AddCorpse(Corpse* corpse);
void AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* map);
- Corpse* ConvertCorpseForPlayer(uint64 player_guid);
+ Corpse* ConvertCorpseForPlayer(uint64 player_guid, bool insignia = false);
static void UpdateObject(Object* obj, Player* exceptPlayer);
static void _buildUpdateObject(Object* obj, UpdateDataMapType &);
diff --git a/src/game/ObjectDefines.h b/src/game/ObjectDefines.h
index 53a0174ba2f..ee58e8a5f34 100644
--- a/src/game/ObjectDefines.h
+++ b/src/game/ObjectDefines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@ enum HighGuid
HIGHGUID_TRANSPORT = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT)
HIGHGUID_UNIT = 0xF130, // blizz F130
HIGHGUID_PET = 0xF140, // blizz F140
+ HIGHGUID_VEHICLE = 0xF150, // blizz F550
HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100
HIGHGUID_CORPSE = 0xF101, // blizz F100
HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT)
@@ -50,6 +51,7 @@ enum HighGuid
#define IS_CREATURE_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_UNIT )
#define IS_PET_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_PET )
+#define IS_VEHICLE_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_VEHICLE )
#define IS_CREATURE_OR_PET_GUID(Guid)( IS_CREATURE_GUID(Guid) || IS_PET_GUID(Guid) )
#define IS_PLAYER_GUID(Guid) ( GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid!=0 )
#define IS_UNIT_GUID(Guid) ( IS_CREATURE_OR_PET_GUID(Guid) || IS_PLAYER_GUID(Guid) )
@@ -87,6 +89,7 @@ inline bool IsGuidHaveEnPart(uint64 const& guid)
case HIGHGUID_TRANSPORT:
case HIGHGUID_UNIT:
case HIGHGUID_PET:
+ case HIGHGUID_VEHICLE:
case HIGHGUID_MO_TRANSPORT:
default:
return true;
@@ -106,6 +109,7 @@ inline char const* GetLogNameForGuid(uint64 guid)
case HIGHGUID_TRANSPORT: return "transport";
case HIGHGUID_UNIT: return "creature";
case HIGHGUID_PET: return "pet";
+ case HIGHGUID_VEHICLE: return "vehicle";
case HIGHGUID_DYNAMICOBJECT:return "dynobject";
case HIGHGUID_CORPSE: return "corpse";
case HIGHGUID_MO_TRANSPORT: return "mo_transport";
diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp
index b819182a50d..368edce0a53 100644
--- a/src/game/ObjectGridLoader.cpp
+++ b/src/game/ObjectGridLoader.cpp
@@ -22,11 +22,13 @@
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Creature.h"
+#include "Vehicle.h"
#include "GameObject.h"
#include "DynamicObject.h"
#include "Corpse.h"
#include "World.h"
#include "CellImpl.h"
+#include "CreatureAI.h"
class TRINITY_DLL_DECL ObjectGridRespawnMover
{
@@ -57,7 +59,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
Creature * c = iter->getSource();
++iter;
- assert(!c->isPet() && "ObjectGridRespawnMover don't must be called for pets");
+ assert(!c->isWorldCreature() && "ObjectGridRespawnMover don't must be called for pets");
Cell const& cur_cell = c->GetCurrentCell();
@@ -133,6 +135,36 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> &
}
}
+void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, CreatureMapType &m, uint32 &count, Map* map)
+{
+ for(CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
+ {
+ Creature* obj = new Creature;
+ uint32 guid = *i_guid;
+ //sLog.outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid);
+ if(!obj->LoadFromDB(guid, map))
+ {
+ delete obj;
+ obj = new Vehicle;
+ if(!((Vehicle*)obj)->LoadFromDB(guid, map))
+ {
+ delete (Vehicle*)obj;
+ continue;
+ }
+ }
+
+ obj->GetGridRef().link(&m, obj);
+
+ addUnitState(obj,cell);
+ obj->AddToWorld();
+ if(obj->isActiveObject())
+ map->AddToActive(obj);
+
+ ++count;
+
+ }
+}
+
void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType &m, uint32 &count, Map* map)
{
if(cell_corpses.empty())
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 31697f31df0..3351b001e5b 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,14 +30,13 @@
#include "SpellMgr.h"
#include "UpdateMask.h"
#include "World.h"
-#include "WorldSession.h"
#include "Group.h"
#include "Guild.h"
#include "ArenaTeam.h"
#include "Transports.h"
#include "ProgressBar.h"
#include "Language.h"
-#include "GameEvent.h"
+#include "GameEventMgr.h"
#include "Spell.h"
#include "Chat.h"
#include "AccountMgr.h"
@@ -116,6 +115,7 @@ ObjectMgr::ObjectMgr()
m_hiCharGuid = 1;
m_hiCreatureGuid = 1;
m_hiPetGuid = 1;
+ m_hiVehicleGuid = 1;
m_hiItemGuid = 1;
m_hiGoGuid = 1;
m_hiDoGuid = 1;
@@ -142,24 +142,10 @@ ObjectMgr::ObjectMgr()
ObjectMgr::~ObjectMgr()
{
for( QuestMap::iterator i = mQuestTemplates.begin( ); i != mQuestTemplates.end( ); ++i )
- {
- delete i->second;
- }
- mQuestTemplates.clear( );
-
- for( GossipTextMap::iterator i = mGossipText.begin( ); i != mGossipText.end( ); ++i )
- {
delete i->second;
- }
- mGossipText.clear( );
-
- mAreaTriggers.clear();
for(PetLevelInfoMap::iterator i = petInfo.begin( ); i != petInfo.end( ); ++i )
- {
delete[] i->second;
- }
- petInfo.clear();
// free only if loaded
for (int class_ = 0; class_ < MAX_CLASSES; ++class_)
@@ -251,7 +237,7 @@ Group * ObjectMgr::GetGroupByLeader(const uint64 &guid) const
return NULL;
}
-Guild * ObjectMgr::GetGuildById(const uint32 GuildId) const
+Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
{
GuildMap::const_iterator itr = mGuildMap.find(GuildId);
if (itr != mGuildMap.end())
@@ -269,7 +255,7 @@ Guild * ObjectMgr::GetGuildByName(const std::string& guildname) const
return NULL;
}
-std::string ObjectMgr::GetGuildNameById(const uint32 GuildId) const
+std::string ObjectMgr::GetGuildNameById(uint32 GuildId) const
{
GuildMap::const_iterator itr = mGuildMap.find(GuildId);
if (itr != mGuildMap.end())
@@ -296,7 +282,8 @@ void ObjectMgr::RemoveGuild(uint32 Id)
{
mGuildMap.erase(Id);
}
-ArenaTeam* ObjectMgr::GetArenaTeamById(const uint32 arenateamid) const
+
+ArenaTeam* ObjectMgr::GetArenaTeamById(uint32 arenateamid) const
{
ArenaTeamMap::const_iterator itr = mArenaTeamMap.find(arenateamid);
if (itr != mArenaTeamMap.end())
@@ -350,7 +337,7 @@ void ObjectMgr::LoadCreatureLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 creature locale strings. DB table `locales_creature` is empty.");
return;
}
@@ -398,7 +385,7 @@ void ObjectMgr::LoadCreatureLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u creature locale strings", mCreatureLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu creature locale strings", (unsigned long)mCreatureLocaleMap.size() );
}
void ObjectMgr::LoadNpcOptionLocales()
@@ -418,7 +405,7 @@ void ObjectMgr::LoadNpcOptionLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 npc_option locale strings. DB table `locales_npc_option` is empty.");
return;
}
@@ -466,7 +453,58 @@ void ObjectMgr::LoadNpcOptionLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u npc_option locale strings", mNpcOptionLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu npc_option locale strings", (unsigned long)mNpcOptionLocaleMap.size() );
+}
+
+void ObjectMgr::LoadPointOfInterestLocales()
+{
+ mPointOfInterestLocaleMap.clear(); // need for reload case
+
+ QueryResult *result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded 0 points_of_interest locale strings. DB table `locales_points_of_interest` is empty.");
+ return;
+ }
+
+ barGoLink bar(result->GetRowCount());
+
+ do
+ {
+ Field *fields = result->Fetch();
+ bar.step();
+
+ uint32 entry = fields[0].GetUInt32();
+
+ PointOfInterestLocale& data = mPointOfInterestLocaleMap[entry];
+
+ for(int i = 1; i < MAX_LOCALE; ++i)
+ {
+ std::string str = fields[i].GetCppString();
+ if(str.empty())
+ continue;
+
+ int idx = GetOrNewIndexForLocale(LocaleConstant(i));
+ if(idx >= 0)
+ {
+ if(data.IconName.size() <= idx)
+ data.IconName.resize(idx+1);
+
+ data.IconName[idx] = str;
+ }
+ }
+ } while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %lu points_of_interest locale strings", (unsigned long)mPointOfInterestLocaleMap.size() );
}
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
@@ -553,6 +591,18 @@ void ObjectMgr::LoadCreatureTemplates()
continue;
}
+ if(heroicInfo->AIName && *heroicInfo->AIName)
+ {
+ sLog.outErrorDb("Heroic mode creature (Entry: %u) has `AIName`, but in any case will used normal mode creature (Entry: %u) AIName.",cInfo->HeroicEntry,i);
+ continue;
+ }
+
+ if(heroicInfo->ScriptID)
+ {
+ sLog.outErrorDb("Heroic mode creature (Entry: %u) has `ScriptName`, but in any case will used normal mode creature (Entry: %u) ScriptName.",cInfo->HeroicEntry,i);
+ continue;
+ }
+
hasHeroicEntries.insert(i);
heroicEntries.insert(cInfo->HeroicEntry);
}
@@ -602,6 +652,19 @@ void ObjectMgr::LoadCreatureTemplates()
if((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE)
sLog.outErrorDb("Creature (Entry: %u) has wrong trainer type %u",cInfo->Entry,cInfo->trainer_type);
+ if(cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type))
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`",cInfo->Entry,cInfo->type);
+ const_cast<CreatureInfo*>(cInfo)->type = CREATURE_TYPE_HUMANOID;
+ }
+
+ // must exist or used hidden but used in data horse case
+ if(cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM )
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`",cInfo->Entry,cInfo->family);
+ const_cast<CreatureInfo*>(cInfo)->family = 0;
+ }
+
if(cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE)
{
sLog.outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly",cInfo->Entry,cInfo->InhabitType);
@@ -615,6 +678,15 @@ void ObjectMgr::LoadCreatureTemplates()
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
}
+ for(int i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ {
+ if(cInfo->spells[i] && !sSpellStore.LookupEntry(cInfo->spells[i]))
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, i+1,cInfo->spells[i]);
+ const_cast<CreatureInfo*>(cInfo)->spells[i] = 0;
+ }
+ }
+
if(cInfo->MovementType >= MAX_DB_MOTION_TYPE)
{
sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.",cInfo->Entry,cInfo->MovementType);
@@ -763,8 +835,47 @@ void ObjectMgr::LoadEquipmentTemplates()
{
sEquipmentStorage.Load();
+ for(uint32 i=0; i< sEquipmentStorage.MaxEntry; ++i)
+ {
+ EquipmentInfo const* eqInfo = sEquipmentStorage.LookupEntry<EquipmentInfo>(i);
+
+ if(!eqInfo)
+ continue;
+
+ for(uint8 j=0; j<3; j++)
+ {
+ if(!eqInfo->equipentry[j])
+ continue;
+
+ ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
+
+ if(!dbcitem)
+ {
+ sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
+ const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
+ continue;
+ }
+
+ if(dbcitem->InventoryType != INVTYPE_WEAPON &&
+ dbcitem->InventoryType != INVTYPE_SHIELD &&
+ dbcitem->InventoryType != INVTYPE_RANGED &&
+ dbcitem->InventoryType != INVTYPE_2HWEAPON &&
+ dbcitem->InventoryType != INVTYPE_WEAPONMAINHAND &&
+ dbcitem->InventoryType != INVTYPE_WEAPONOFFHAND &&
+ dbcitem->InventoryType != INVTYPE_HOLDABLE &&
+ dbcitem->InventoryType != INVTYPE_THROWN &&
+ dbcitem->InventoryType != INVTYPE_RANGEDRIGHT)
+ {
+ sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i);
+ const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
+ }
+ }
+ }
sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount );
sLog.outString();
+
+ // This DBC is currently only used for item templates and creature equipments checks.
+ sItemStore.Clear();
}
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid)
@@ -924,9 +1035,10 @@ void ObjectMgr::LoadCreatures()
QueryResult *result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid,"
// 4 5 6 7 8 9 10 11
"equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint,"
- // 12 13 14 15 16 17
- "curhealth, curmana, DeathState, MovementType, spawnMask, event "
- "FROM creature LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid");
+ // 12 13 14 15 16 17 18 19
+ "curhealth, curmana, DeathState, MovementType, spawnMask, phaseMask, event, pool_entry "
+ "FROM creature LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
+ "LEFT OUTER JOIN pool_creature ON creature.guid = pool_creature.guid");
if(!result)
{
@@ -934,7 +1046,7 @@ void ObjectMgr::LoadCreatures()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outErrorDb(">> Loaded 0 creature. DB table `creature` is empty.");
return;
}
@@ -953,11 +1065,19 @@ void ObjectMgr::LoadCreatures()
Field *fields = result->Fetch();
bar.step();
- uint32 guid = fields[0].GetUInt32();
+ uint32 guid = fields[ 0].GetUInt32();
+ uint32 entry = fields[ 1].GetUInt32();
+
+ CreatureInfo const* cInfo = GetCreatureTemplate(entry);
+ if(!cInfo)
+ {
+ sLog.outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
+ continue;
+ }
CreatureData& data = mCreatureDataMap[guid];
- data.id = fields[ 1].GetUInt32();
+ data.id = entry;
data.mapid = fields[ 2].GetUInt32();
data.displayid = fields[ 3].GetUInt32();
data.equipmentId = fields[ 4].GetUInt32();
@@ -973,14 +1093,9 @@ void ObjectMgr::LoadCreatures()
data.is_dead = fields[14].GetBool();
data.movementType = fields[15].GetUInt8();
data.spawnMask = fields[16].GetUInt8();
- int16 gameEvent = fields[17].GetInt16();
-
- CreatureInfo const* cInfo = GetCreatureTemplate(data.id);
- if(!cInfo)
- {
- sLog.outErrorDb("Table `creature` have creature (GUID: %u) with not existed creature entry %u, skipped.",guid,data.id );
- continue;
- }
+ data.phaseMask = fields[17].GetUInt16();
+ int16 gameEvent = fields[18].GetInt16();
+ int16 PoolId = fields[19].GetInt16();
if(heroicCreatures.find(data.id)!=heroicCreatures.end())
{
@@ -1003,6 +1118,13 @@ void ObjectMgr::LoadCreatures()
data.curhealth = cInfo->minhealth;
}
+ if(cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
+ {
+ MapEntry const* map = sMapStore.LookupEntry(data.mapid);
+ if(!map || !map->IsDungeon())
+ sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.",guid,data.id);
+ }
+
if(data.curmana < cInfo->minmana)
{
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with low current mana (%u), `creature_template`.`minmana`=%u.",guid,data.id,data.curmana, cInfo->minmana );
@@ -1031,8 +1153,15 @@ void ObjectMgr::LoadCreatures()
}
}
- if (gameEvent==0) // if not this is to be managed by GameEvent System
+ if(data.phaseMask==0)
+ {
+ sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id );
+ data.phaseMask = 1;
+ }
+
+ if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system
AddCreatureToGrid(guid, &data);
+
++count;
} while (result->NextRow());
@@ -1040,7 +1169,7 @@ void ObjectMgr::LoadCreatures()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u creatures", mCreatureDataMap.size() );
+ sLog.outString( ">> Loaded %lu creatures", (unsigned long)mCreatureDataMap.size() );
}
void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
@@ -1081,9 +1210,10 @@ void ObjectMgr::LoadGameobjects()
// 0 1 2 3 4 5 6
QueryResult *result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation,"
- // 7 8 9 10 11 12 13 14 15
- "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, event "
- "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid");
+ // 7 8 9 10 11 12 13 14 15 16 17
+ "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, event, pool_entry "
+ "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
+ "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid");
if(!result)
{
@@ -1103,11 +1233,19 @@ void ObjectMgr::LoadGameobjects()
Field *fields = result->Fetch();
bar.step();
- uint32 guid = fields[0].GetUInt32();
+ uint32 guid = fields[ 0].GetUInt32();
+ uint32 entry = fields[ 1].GetUInt32();
+
+ GameObjectInfo const* gInfo = GetGameObjectInfo(entry);
+ if(!gInfo)
+ {
+ sLog.outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
+ continue;
+ }
GameObjectData& data = mGameObjectDataMap[guid];
- data.id = fields[ 1].GetUInt32();
+ data.id = entry;
data.mapid = fields[ 2].GetUInt32();
data.posX = fields[ 3].GetFloat();
data.posY = fields[ 4].GetFloat();
@@ -1122,16 +1260,35 @@ void ObjectMgr::LoadGameobjects()
data.go_state = fields[13].GetUInt32();
data.ArtKit = 0;
data.spawnMask = fields[14].GetUInt8();
- int16 gameEvent = fields[15].GetInt16();
+ data.phaseMask = fields[15].GetUInt16();
+ int16 gameEvent = fields[16].GetInt16();
+ int16 PoolId = fields[17].GetInt16();
- GameObjectInfo const* gInfo = GetGameObjectInfo(data.id);
- if(!gInfo)
+ if(data.rotation2 < -1.0f || data.rotation2 > 1.0f)
+ {
+ sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip",guid,data.id,data.rotation2 );
+ continue;
+ }
+
+ if(data.rotation3 < -1.0f || data.rotation3 > 1.0f)
{
- sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u) with not existed gameobject entry %u, skipped.",guid,data.id );
+ sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip",guid,data.id,data.rotation3 );
continue;
}
- if (gameEvent==0) // if not this is to be managed by GameEvent System
+ if(!MapManager::IsValidMapCoord(data.mapid,data.posX,data.posY,data.posZ,data.orientation))
+ {
+ sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with invalid coordinates, skip",guid,data.id );
+ continue;
+ }
+
+ if(data.phaseMask==0)
+ {
+ sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id );
+ data.phaseMask = 1;
+ }
+
+ if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system
AddGameobjectToGrid(guid, &data);
++count;
@@ -1140,7 +1297,7 @@ void ObjectMgr::LoadGameobjects()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u gameobjects", mGameObjectDataMap.size());
+ sLog.outString( ">> Loaded %lu gameobjects", (unsigned long)mGameObjectDataMap.size());
}
void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
@@ -1210,7 +1367,7 @@ void ObjectMgr::LoadCreatureRespawnTimes()
delete result;
- sLog.outString( ">> Loaded %u creature respawn times", mCreatureRespawnTimes.size() );
+ sLog.outString( ">> Loaded %lu creature respawn times", (unsigned long)mCreatureRespawnTimes.size() );
sLog.outString();
}
@@ -1252,7 +1409,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
delete result;
- sLog.outString( ">> Loaded %u gameobject respawn times", mGORespawnTimes.size() );
+ sLog.outString( ">> Loaded %lu gameobject respawn times", (unsigned long)mGORespawnTimes.size() );
sLog.outString();
}
@@ -1355,7 +1512,7 @@ void ObjectMgr::LoadItemLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 Item locale strings. DB table `locales_item` is empty.");
return;
}
@@ -1404,7 +1561,7 @@ void ObjectMgr::LoadItemLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u Item locale strings", mItemLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu Item locale strings", (unsigned long)mItemLocaleMap.size() );
}
struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
@@ -1439,6 +1596,32 @@ void ObjectMgr::LoadItemPrototypes()
if(dbcitem)
{
+ if(proto->Class != dbcitem->Class)
+ {
+ sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
+ // It safe let use Class from DB
+ }
+ /* disabled: have some strange wrong cases for Subclass values.
+ for enable also uncomment Subclass field in ItemEntry structure and in Itemfmt[]
+ if(proto->SubClass != dbcitem->SubClass)
+ {
+ sLog.outErrorDb("Item (Entry: %u) not correct (Class: %u, Sub: %u) pair, must be (Class: %u, Sub: %u) (still using DB value).",i,proto->Class,proto->SubClass,dbcitem->Class,dbcitem->SubClass);
+ // It safe let use Subclass from DB
+ }
+ */
+
+ if(proto->Unk0 != dbcitem->Unk0)
+ {
+ sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).",i,proto->Unk0,dbcitem->Unk0);
+ // It safe let use Unk0 from DB
+ }
+
+ if(proto->Material != dbcitem->Material)
+ {
+ sLog.outErrorDb("Item (Entry: %u) not correct %i material, must be %i (still using DB value).",i,proto->Material,dbcitem->Material);
+ // It safe let use Material from DB
+ }
+
if(proto->InventoryType != dbcitem->InventoryType)
{
sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType);
@@ -1464,7 +1647,7 @@ void ObjectMgr::LoadItemPrototypes()
if(proto->Class >= MAX_ITEM_CLASS)
{
sLog.outErrorDb("Item (Entry: %u) has wrong Class value (%u)",i,proto->Class);
- const_cast<ItemPrototype*>(proto)->Class = ITEM_CLASS_JUNK;
+ const_cast<ItemPrototype*>(proto)->Class = ITEM_CLASS_MISC;
}
if(proto->SubClass >= MaxItemSubclassValues[proto->Class])
@@ -1497,14 +1680,30 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->RequiredSkill = 0;
}
- if(!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE))
{
- sLog.outErrorDb("Item (Entry: %u) not have in `AllowableClass` any playable classes (%u) and can't be equipped.",i,proto->AllowableClass);
- }
- if(!(proto->AllowableRace & RACEMASK_ALL_PLAYABLE))
- {
- sLog.outErrorDb("Item (Entry: %u) not have in `AllowableRace` any playable races (%u) and can't be equipped.",i,proto->AllowableRace);
+ // can be used in equip slot, as page read use in inventory, or spell casting at use
+ bool req = proto->InventoryType!=INVTYPE_NON_EQUIP || proto->PageText;
+ if(!req)
+ {
+ for (int j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j)
+ {
+ if(proto->Spells[j].SpellId)
+ {
+ req = true;
+ break;
+ }
+ }
+ }
+
+ if(req)
+ {
+ if(!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE))
+ sLog.outErrorDb("Item (Entry: %u) not have in `AllowableClass` any playable classes (%u) and can't be equipped or use.",i,proto->AllowableClass);
+
+ if(!(proto->AllowableRace & RACEMASK_ALL_PLAYABLE))
+ sLog.outErrorDb("Item (Entry: %u) not have in `AllowableRace` any playable races (%u) and can't be equipped or use.",i,proto->AllowableRace);
+ }
}
if(proto->RequiredSpell && !sSpellStore.LookupEntry(proto->RequiredSpell))
@@ -1530,18 +1729,35 @@ void ObjectMgr::LoadItemPrototypes()
else if(proto->RequiredReputationRank > MIN_REPUTATION_RANK)
sLog.outErrorDb("Item (Entry: %u) has RequiredReputationFaction ==0 but RequiredReputationRank > 0, rank setting is useless.",i);
+ if(proto->MaxCount < -1)
+ {
+ sLog.outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.",i,proto->MaxCount);
+ const_cast<ItemPrototype*>(proto)->MaxCount = -1;
+ }
+
if(proto->Stackable==0)
{
- sLog.outErrorDb("Item (Entry: %u) has wrong value in stackable (%u), replace by default 1.",i,proto->Stackable);
+ sLog.outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.",i,proto->Stackable);
const_cast<ItemPrototype*>(proto)->Stackable = 1;
}
+ else if(proto->Stackable < -1)
+ {
+ sLog.outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.",i,proto->Stackable);
+ const_cast<ItemPrototype*>(proto)->Stackable = -1;
+ }
else if(proto->Stackable > 255)
{
sLog.outErrorDb("Item (Entry: %u) has too large value in stackable (%u), replace by hardcoded upper limit (255).",i,proto->Stackable);
const_cast<ItemPrototype*>(proto)->Stackable = 255;
}
- for (int j = 0; j < 10; j++)
+ if(proto->StatsCount > MAX_ITEM_PROTO_STATS)
+ {
+ sLog.outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).",i,proto->StatsCount,MAX_ITEM_PROTO_STATS);
+ const_cast<ItemPrototype*>(proto)->StatsCount = MAX_ITEM_PROTO_STATS;
+ }
+
+ for (int j = 0; j < MAX_ITEM_PROTO_STATS; ++j)
{
// for ItemStatValue != 0
if(proto->ItemStat[j].ItemStatValue && proto->ItemStat[j].ItemStatType >= MAX_ITEM_MOD)
@@ -1551,7 +1767,7 @@ void ObjectMgr::LoadItemPrototypes()
}
}
- for (int j = 0; j < 5; j++)
+ for (int j = 0; j < MAX_ITEM_PROTO_DAMAGES; ++j)
{
if(proto->Damage[j].DamageType >= MAX_SPELL_SCHOOL)
{
@@ -1561,7 +1777,7 @@ void ObjectMgr::LoadItemPrototypes()
}
// special format
- if(proto->Spells[0].SpellId == SPELL_ID_GENERIC_LEARN)
+ if((proto->Spells[0].SpellId == SPELL_ID_GENERIC_LEARN) || (proto->Spells[0].SpellId == SPELL_ID_GENERIC_LEARN_PET))
{
// spell_1
if(proto->Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
@@ -1598,7 +1814,7 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
}
// allowed only in special format
- else if(proto->Spells[1].SpellId==SPELL_ID_GENERIC_LEARN)
+ else if((proto->Spells[1].SpellId==SPELL_ID_GENERIC_LEARN) || (proto->Spells[1].SpellId==SPELL_ID_GENERIC_LEARN_PET))
{
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,1+1,proto->Spells[1].SpellId);
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
@@ -1608,7 +1824,7 @@ void ObjectMgr::LoadItemPrototypes()
}
// spell_3*,spell_4*,spell_5* is empty
- for (int j = 2; j < 5; j++)
+ for (int j = 2; j < MAX_ITEM_PROTO_SPELLS; ++j)
{
if(proto->Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
{
@@ -1626,7 +1842,7 @@ void ObjectMgr::LoadItemPrototypes()
// normal spell list
else
{
- for (int j = 0; j < 5; j++)
+ for (int j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j)
{
if(proto->Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || proto->Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
{
@@ -1644,7 +1860,7 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
}
// allowed only in special format
- else if(proto->Spells[j].SpellId==SPELL_ID_GENERIC_LEARN)
+ else if((proto->Spells[j].SpellId==SPELL_ID_GENERIC_LEARN) || (proto->Spells[j].SpellId==SPELL_ID_GENERIC_LEARN_PET))
{
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,j+1,proto->Spells[j].SpellId);
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
@@ -1692,10 +1908,39 @@ void ObjectMgr::LoadItemPrototypes()
if(proto->Map && !sMapStore.LookupEntry(proto->Map))
sLog.outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,proto->Map);
+ if(proto->BagFamily)
+ {
+ // check bits
+ for(uint32 j = 0; j < sizeof(proto->BagFamily)*8; ++j)
+ {
+ uint32 mask = 1 << j;
+ if((proto->BagFamily & mask)==0)
+ continue;
+
+ ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1);
+ if(!bf)
+ {
+ sLog.outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit",i);
+ const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
+ continue;
+ }
+
+ if(BAG_FAMILY_MASK_CURRENCY_TOKENS & mask)
+ {
+ CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId);
+ if(!ctEntry)
+ {
+ sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i);
+ const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
+ }
+ }
+ }
+ }
+
if(proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory))
sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory);
- for (int j = 0; j < 3; j++)
+ for (int j = 0; j < MAX_ITEM_PROTO_SOCKETS; j++)
{
if(proto->Socket[j].Color && (proto->Socket[j].Color & SOCKET_COLOR_ALL) != proto->Socket[j].Color)
{
@@ -1712,10 +1957,13 @@ void ObjectMgr::LoadItemPrototypes()
sLog.outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)",i,proto->FoodType);
const_cast<ItemPrototype*>(proto)->FoodType = 0;
}
- }
- // this DBC used currently only for check item templates in DB.
- sItemStore.Clear();
+ if(proto->ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(proto->ItemLimitCategory))
+ {
+ sLog.outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)",i,proto->ItemLimitCategory);
+ const_cast<ItemPrototype*>(proto)->ItemLimitCategory = 0;
+ }
+ }
}
void ObjectMgr::LoadPetLevelInfo()
@@ -1756,7 +2004,10 @@ void ObjectMgr::LoadPetLevelInfo()
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
sLog.outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else
+ {
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `pet_levelstats` table, ignoring.",current_level);
+ ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
+ }
continue;
}
else if(current_level < 1)
@@ -1999,7 +2250,7 @@ void ObjectMgr::LoadPlayerInfo()
if(sWorld.getConfig(CONFIG_START_ALL_SPELLS))
result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
else
- result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
+ result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell");
uint32 count = 0;
@@ -2034,7 +2285,7 @@ void ObjectMgr::LoadPlayerInfo()
}
PlayerInfo* pInfo = &playerInfo[current_race][current_class];
- pInfo->spell.push_back(CreateSpellPair(fields[2].GetUInt16(), fields[3].GetUInt8()));
+ pInfo->spell.push_back(fields[2].GetUInt32());
bar.step();
++count;
@@ -2139,7 +2390,10 @@ void ObjectMgr::LoadPlayerInfo()
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
sLog.outErrorDb("Wrong (> %u) level %u in `player_classlevelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else
+ {
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_classlevelstats` table, ignoring.",current_level);
+ ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
+ }
continue;
}
@@ -2234,7 +2488,10 @@ void ObjectMgr::LoadPlayerInfo()
if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
sLog.outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level);
else
+ {
sLog.outDetail("Unused (> MaxPlayerLevel in Trinityd.conf) level %u in `player_levelstats` table, ignoring.",current_level);
+ ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
+ }
continue;
}
@@ -2306,6 +2563,70 @@ void ObjectMgr::LoadPlayerInfo()
}
}
}
+
+ // Loading xp per level data
+ {
+ mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
+ for (uint32 level = 0; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
+ mPlayerXPperLevel[level] = 0;
+
+ // 0 1
+ QueryResult *result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM player_xp_for_level");
+
+ uint32 count = 0;
+
+ if (!result)
+ {
+ barGoLink bar( 1 );
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u xp for level definitions", count );
+ sLog.outErrorDb( "Error loading `player_xp_for_level` table or empty table.");
+ exit(1);
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ do
+ {
+ Field* fields = result->Fetch();
+
+ uint32 current_level = fields[0].GetUInt32();
+ uint32 current_xp = fields[1].GetUInt32();
+
+ if(current_level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
+ {
+ if(current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
+ sLog.outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level);
+ else
+ {
+ sLog.outDetail("Unused (> MaxPlayerLevel in mangosd.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level);
+ ++count; // make result loading percent "expected" correct in case disabled detail mode for example.
+ }
+ continue;
+ }
+ //PlayerXPperLevel
+ mPlayerXPperLevel[current_level] = current_xp;
+ bar.step();
+ ++count;
+ }
+ while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u xp for level definitions", count );
+ }
+
+ // fill level gaps
+ for (uint32 level = 1; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
+ {
+ if( mPlayerXPperLevel[level] == 0)
+ {
+ sLog.outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.",level+1, level);
+ mPlayerXPperLevel[level] = mPlayerXPperLevel[level-1]+100;
+ }
+ }
}
void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint32 level, PlayerClassLevelInfo* info) const
@@ -2632,7 +2953,14 @@ void ObjectMgr::LoadGroups()
}
}
- InstanceSave *save = sInstanceSaveManager.AddInstanceSave(fields[1].GetUInt32(), fields[2].GetUInt32(), fields[4].GetUInt8(), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
+ MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32());
+ if(!mapEntry || !mapEntry->IsDungeon())
+ {
+ sLog.outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32());
+ continue;
+ }
+
+ InstanceSave *save = sInstanceSaveManager.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), fields[4].GetUInt8(), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
group->BindToInstance(save, fields[3].GetBool(), true);
}while( result->NextRow() );
delete result;
@@ -2658,31 +2986,31 @@ void ObjectMgr::LoadQuests()
QueryResult *result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClass, MinLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue,"
// 9 10 11 12 13 14 15 16
"RepObjectiveFaction, RepObjectiveValue, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime,"
- // 17 18 19 20 21 22 23 24 25 26
- "QuestFlags, SpecialFlags, CharTitleId, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell,"
- // 27 28 29 30 31 32 33 34 35 36
+ // 17 18 19 20 21 22 23 24 25 26 27 28
+ "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, SrcItemId, SrcItemCount, SrcSpell,"
+ // 29 30 31 32 33 34 35 36 37 38
"Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4,"
- // 37 38 39 40 41 42 43 44
+ // 39 40 41 42 43 44 45 46
"ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4,"
- // 45 46 47 48 49 50 51 52 53 54 54 55
- "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, ReqSourceRef1, ReqSourceRef2, ReqSourceRef3, ReqSourceRef4,"
- // 57 58 59 60 61 62 63 64
+ // 47 48 49 50 51 52 53 54
+ "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4,"
+ // 55 56 57 58 59 60 61 62
"ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4,"
- // 65 66 67 68
+ // 63 64 65 66
"ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4,"
- // 69 70 71 72 73 74
+ // 67 68 69 70 71 72
"RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6,"
- // 75 76 77 78 79 80
+ // 73 74 75 76 77 78
"RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6,"
- // 81 82 83 84 85 86 87 88
+ // 79 80 81 82 83 84 85 86
"RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4,"
- // 89 90 91 92 93 94 95 96 97 98
+ // 87 88 89 90 91 92 93 94 95 96
"RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5,"
- // 99 100 101 102 103 104 105 106 107 108 109
+ // 97 98 99 100 101 102 103 104 105 106 107
"RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt,"
- // 110 111 112 113 114 115 116 117 118 119
- "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4,IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4,"
- // 120 121
+ // 108 109 110 111 112 113 114 115 116 117
+ "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4,"
+ // 118 119
"StartScript, CompleteScript"
" FROM quest_template");
if(result == NULL)
@@ -2854,10 +3182,10 @@ void ObjectMgr::LoadQuests()
// no changes, quest can't be done for this requirement
}
- if(qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > Player::Reputation_Cap)
+ if(qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap)
{
sLog.outErrorDb("Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
- qinfo->GetQuestId(),qinfo->RequiredMinRepValue,Player::Reputation_Cap);
+ qinfo->GetQuestId(),qinfo->RequiredMinRepValue,ReputationMgr::Reputation_Cap);
// no changes, quest can't be done for this requirement
}
@@ -2976,20 +3304,6 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(),j+1,id,id);
// no changes, quest can't be done for this requirement
}
-
- if(!qinfo->ReqSourceCount[j])
- {
- sLog.outErrorDb("Quest %u has `ReqSourceId%d` = %u but `ReqSourceCount%d` = 0, quest can't be done.",
- qinfo->GetQuestId(),j+1,id,j+1);
- qinfo->ReqSourceId[j] = 0; // prevent incorrect work of quest
- }
-
- if(!qinfo->ReqSourceRef[j])
- {
- sLog.outErrorDb("Quest %u has `ReqSourceId%d` = %u but `ReqSourceRef%d` = 0, quest can't be done.",
- qinfo->GetQuestId(),j+1,id,j+1);
- qinfo->ReqSourceId[j] = 0; // prevent incorrect work of quest
- }
}
else
{
@@ -2999,41 +3313,6 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(),j+1,j+1,qinfo->ReqSourceCount[j]);
// no changes, quest ignore this data
}
-
- if(qinfo->ReqSourceRef[j]>0)
- {
- sLog.outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceRef%d` = %u.",
- qinfo->GetQuestId(),j+1,j+1,qinfo->ReqSourceRef[j]);
- // no changes, quest ignore this data
- }
- }
- }
-
- for(int j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j )
- {
- uint32 ref = qinfo->ReqSourceRef[j];
- if(ref)
- {
- if(ref > QUEST_OBJECTIVES_COUNT)
- {
- sLog.outErrorDb("Quest %u has `ReqSourceRef%d` = %u but max value in `ReqSourceRef%d` is %u, quest can't be done.",
- qinfo->GetQuestId(),j+1,ref,j+1,QUEST_OBJECTIVES_COUNT);
- // no changes, quest can't be done for this requirement
- }
- else
- if(!qinfo->ReqItemId[ref-1] && !qinfo->ReqSpell[ref-1])
- {
- sLog.outErrorDb("Quest %u has `ReqSourceRef%d` = %u but `ReqItemId%u` = 0 and `ReqSpellCast%u` = 0, quest can't be done.",
- qinfo->GetQuestId(),j+1,ref,ref,ref);
- // no changes, quest can't be done for this requirement
- }
- else if(qinfo->ReqItemId[ref-1] && qinfo->ReqSpell[ref-1])
- {
- sLog.outErrorDb("Quest %u has `ReqItemId%u` = %u and `ReqSpellCast%u` = %u, quest can't have both fields <> 0, then can't be done.",
- qinfo->GetQuestId(),ref,qinfo->ReqItemId[ref-1],ref,qinfo->ReqSpell[ref-1]);
- // no changes, quest can't be done for this requirement
- qinfo->ReqSourceId[j] = 0; // prevent incorrect work of quest
- }
}
}
@@ -3254,14 +3533,15 @@ void ObjectMgr::LoadQuests()
if(qinfo->NextQuestInChain)
{
- if(mQuestTemplates.find(qinfo->NextQuestInChain) == mQuestTemplates.end())
+ QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain);
+ if(qNextItr == mQuestTemplates.end())
{
sLog.outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.",
qinfo->GetQuestId(),qinfo->NextQuestInChain ,qinfo->NextQuestInChain );
qinfo->NextQuestInChain = 0;
}
else
- mQuestTemplates[qinfo->NextQuestInChain]->prevChainQuests.push_back(qinfo->GetQuestId());
+ qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId());
}
// fill additional data stores
@@ -3279,14 +3559,15 @@ void ObjectMgr::LoadQuests()
if(qinfo->NextQuestId)
{
- if (mQuestTemplates.find(abs(qinfo->GetNextQuestId())) == mQuestTemplates.end())
+ QuestMap::iterator qNextItr = mQuestTemplates.find(abs(qinfo->GetNextQuestId()));
+ if (qNextItr == mQuestTemplates.end())
{
sLog.outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
}
else
{
int32 signedQuestId = qinfo->NextQuestId < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId());
- mQuestTemplates[abs(qinfo->GetNextQuestId())]->prevQuests.push_back(signedQuestId);
+ qNextItr->second->prevQuests.push_back(signedQuestId);
}
}
@@ -3327,7 +3608,7 @@ void ObjectMgr::LoadQuests()
}
sLog.outString();
- sLog.outString( ">> Loaded %u quests definitions", mQuestTemplates.size() );
+ sLog.outString( ">> Loaded %lu quests definitions", (unsigned long)mQuestTemplates.size() );
}
void ObjectMgr::LoadQuestLocales()
@@ -3352,7 +3633,7 @@ void ObjectMgr::LoadQuestLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 Quest locale strings. DB table `locales_quest` is empty.");
return;
}
@@ -3463,7 +3744,7 @@ void ObjectMgr::LoadQuestLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u Quest locale strings", mQuestLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu Quest locale strings", (unsigned long)mQuestLocaleMap.size() );
}
void ObjectMgr::LoadPetCreateSpells()
@@ -3712,6 +3993,21 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
}
case SCRIPT_COMMAND_REMOVE_AURA:
+ {
+ if(!sSpellStore.LookupEntry(tmp.datalong))
+ {
+ sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA or SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ tablename,tmp.datalong,tmp.id);
+ continue;
+ }
+ if(tmp.datalong2 & ~0x1) // 1 bits (0,1)
+ {
+ sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ tablename,tmp.datalong2,tmp.id);
+ continue;
+ }
+ break;
+ }
case SCRIPT_COMMAND_CAST_SPELL:
{
if(!sSpellStore.LookupEntry(tmp.datalong))
@@ -3720,6 +4016,12 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
tablename,tmp.datalong,tmp.id);
continue;
}
+ if(tmp.datalong2 & ~0x3) // 2 bits
+ {
+ sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ tablename,tmp.datalong2,tmp.id);
+ continue;
+ }
break;
}
}
@@ -3968,7 +4270,7 @@ void ObjectMgr::LoadPageTextLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 PageText locale strings. DB table `locales_page_text` is empty.");
return;
}
@@ -4005,7 +4307,7 @@ void ObjectMgr::LoadPageTextLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u PageText locale strings", mPageTextLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu PageText locale strings", (unsigned long)mPageTextLocaleMap.size() );
}
struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
@@ -4035,14 +4337,20 @@ void ObjectMgr::LoadInstanceTemplate()
else if(!entry->HasResetTime())
continue;
+ //FIXME: now exist heroic instance, normal/heroic raid instances
+ // entry->resetTimeHeroic store reset time for both heroic mode instance (raid and non-raid)
+ // entry->resetTimeRaid store reset time for normal raid only
+ // for current state entry->resetTimeRaid == entry->resetTimeHeroic in case raid instances with heroic mode.
+ // but at some point wee need implement reset time dependent from raid instance mode
if(temp->reset_delay == 0)
{
// use defaults from the DBC
- if(entry->SupportsHeroicMode())
+ if(entry->resetTimeHeroic) // for both raid and non raids, read above
{
temp->reset_delay = entry->resetTimeHeroic / DAY;
}
else if (entry->resetTimeRaid && entry->map_type == MAP_RAID)
+ // for normal raid only
{
temp->reset_delay = entry->resetTimeRaid / DAY;
}
@@ -4056,27 +4364,33 @@ void ObjectMgr::LoadInstanceTemplate()
sLog.outString();
}
-void ObjectMgr::AddGossipText(GossipText *pGText)
+bool ObjectMgr::IsGameObjectOfTypeInRange(Player *player, uint64 guid, GameobjectTypes type) const
{
- ASSERT( pGText->Text_ID );
- ASSERT( mGossipText.find(pGText->Text_ID) == mGossipText.end() );
- mGossipText[pGText->Text_ID] = pGText;
+ if(GameObject *go = ObjectAccessor::GetGameObject(*player, guid))
+ {
+ if(go->GetGoType() == type)
+ {
+ // TODO: find out how the client calculates the maximal usage distance to spellless working
+ // gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number
+ if (go->IsWithinDistInMap(player, 10.0f))
+ return true;
+ sLog.outError("IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name,
+ go->GetGUIDLow(), player->GetName(), player->GetGUIDLow(), go->GetDistance(player));
+ }
+ }
+ return false;
}
-GossipText *ObjectMgr::GetGossipText(uint32 Text_ID)
+GossipText const *ObjectMgr::GetGossipText(uint32 Text_ID) const
{
- GossipTextMap::const_iterator itr;
- for (itr = mGossipText.begin(); itr != mGossipText.end(); ++itr)
- {
- if(itr->second->Text_ID == Text_ID)
- return itr->second;
- }
+ GossipTextMap::const_iterator itr = mGossipText.find(Text_ID);
+ if(itr != mGossipText.end())
+ return &itr->second;
return NULL;
}
void ObjectMgr::LoadGossipText()
{
- GossipText *pGText;
QueryResult *result = WorldDatabase.Query( "SELECT * FROM npc_text" );
int count = 0;
@@ -4103,30 +4417,29 @@ void ObjectMgr::LoadGossipText()
bar.step();
- pGText = new GossipText;
- pGText->Text_ID = fields[cic++].GetUInt32();
-
- for (int i=0; i< 8; i++)
+ uint32 Text_ID = fields[cic++].GetUInt32();
+ if(!Text_ID)
{
- pGText->Options[i].Text_0 = fields[cic++].GetCppString();
- pGText->Options[i].Text_1 = fields[cic++].GetCppString();
+ sLog.outErrorDb("Table `npc_text` has record wit reserved id 0, ignore.");
+ continue;
+ }
- pGText->Options[i].Language = fields[cic++].GetUInt32();
- pGText->Options[i].Probability = fields[cic++].GetFloat();
+ GossipText& gText = mGossipText[Text_ID];
- pGText->Options[i].Emotes[0]._Delay = fields[cic++].GetUInt32();
- pGText->Options[i].Emotes[0]._Emote = fields[cic++].GetUInt32();
+ for (int i=0; i< 8; i++)
+ {
+ gText.Options[i].Text_0 = fields[cic++].GetCppString();
+ gText.Options[i].Text_1 = fields[cic++].GetCppString();
- pGText->Options[i].Emotes[1]._Delay = fields[cic++].GetUInt32();
- pGText->Options[i].Emotes[1]._Emote = fields[cic++].GetUInt32();
+ gText.Options[i].Language = fields[cic++].GetUInt32();
+ gText.Options[i].Probability = fields[cic++].GetFloat();
- pGText->Options[i].Emotes[2]._Delay = fields[cic++].GetUInt32();
- pGText->Options[i].Emotes[2]._Emote = fields[cic++].GetUInt32();
+ for(int j=0; j < 3; ++j)
+ {
+ gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt32();
+ gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt32();
+ }
}
-
- if ( !pGText->Text_ID ) continue;
- AddGossipText( pGText );
-
} while( result->NextRow() );
sLog.outString();
@@ -4155,8 +4468,8 @@ void ObjectMgr::LoadNpcTextLocales()
bar.step();
- sLog.outString("");
- sLog.outString(">> Loaded 0 Quest locale strings. DB table `locales_npc_text` is empty.");
+ sLog.outString();
+ sLog.outString(">> Loaded 0 NpcText locale strings. DB table `locales_npc_text` is empty.");
return;
}
@@ -4206,7 +4519,7 @@ void ObjectMgr::LoadNpcTextLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u NpcText locale strings", mNpcTextLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu NpcText locale strings", (unsigned long)mNpcTextLocaleMap.size() );
}
//not very fast function but it is called only once a day, or on starting-up
@@ -4220,14 +4533,27 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
// 0 1 2 3 4 5 6 7 8 9
QueryResult* result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,itemTextId,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" I64FMTD "'", (uint64)basetime);
if ( !result )
+ {
+ barGoLink bar(1);
+ bar.step();
+ sLog.outString();
+ sLog.outString(">> Only expired mails (need to be return or delete) or DB table `mail` is empty.");
return; // any mails need to be returned or deleted
- Field *fields;
+ }
+
//std::ostringstream delitems, delmails; //will be here for optimization
//bool deletemail = false, deleteitem = false;
//delitems << "DELETE FROM item_instance WHERE guid IN ( ";
//delmails << "DELETE FROM mail WHERE id IN ( "
+
+ barGoLink bar( result->GetRowCount() );
+ uint32 count = 0;
+ Field *fields;
+
do
{
+ bar.step();
+
fields = result->Fetch();
Mail *m = new Mail;
m->messageID = fields[0].GetUInt32();
@@ -4293,8 +4619,12 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
//delmails << m->messageID << ", ";
CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", m->messageID);
delete m;
+ ++count;
} while (result->NextRow());
delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u mails", count );
}
void ObjectMgr::LoadQuestAreaTriggers()
@@ -4451,7 +4781,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
sLog.outString( ">> Loaded %u areatrigger scripts", count );
}
-uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid )
+uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team )
{
bool found = false;
float dist;
@@ -4460,24 +4790,31 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid )
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
{
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
- if(node && node->map_id == mapid)
+ if(!node || node->map_id != mapid || !node->MountCreatureID[team == ALLIANCE ? 1 : 0])
+ continue;
+
+ uint8 field = (uint8)((i - 1) / 32);
+ uint32 submask = 1<<((i-1)%32);
+
+ // skip not taxi network nodes
+ if((sTaxiNodesMask[field] & submask)==0)
+ continue;
+
+ float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
+ if(found)
{
- float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
- if(found)
+ if(dist2 < dist)
{
- if(dist2 < dist)
- {
- dist = dist2;
- id = i;
- }
- }
- else
- {
- found = true;
dist = dist2;
id = i;
}
}
+ else
+ {
+ found = true;
+ dist = dist2;
+ id = i;
+ }
}
return id;
@@ -4515,17 +4852,19 @@ uint16 ObjectMgr::GetTaxiMount( uint32 id, uint32 team )
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(id);
if(node)
{
- if (team == ALLIANCE) mount_entry = node->alliance_mount_type;
- else mount_entry = node->horde_mount_type;
-
- CreatureInfo const *cinfo = GetCreatureTemplate(mount_entry);
- if (cinfo)
+ if (team == ALLIANCE)
{
- if(! (mount_id = cinfo->GetRandomValidModelId()))
- {
- sLog.outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
- return false;
- }
+ mount_entry = node->MountCreatureID[1];
+ CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
+ if(ci)
+ mount_id = ci->Modelid1;
+ }
+ if (team == HORDE)
+ {
+ mount_entry = node->MountCreatureID[0];
+ CreatureInfo const *ci = GetCreatureTemplate(mount_entry);
+ if(ci)
+ mount_id = ci->Modelid3;
}
}
@@ -4653,7 +4992,7 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
{
// search for zone associated closest graveyard
- uint32 zoneId = MapManager::Instance().GetZoneId(MapId,x,y);
+ uint32 zoneId = MapManager::Instance().GetZoneId(MapId,x,y,z);
// Simulate std. algorithm:
// found some graveyard associated to (ghost_zone,ghost_map)
@@ -4664,7 +5003,10 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
// then check faction
GraveYardMap::const_iterator graveLow = mGraveYardMap.lower_bound(zoneId);
GraveYardMap::const_iterator graveUp = mGraveYardMap.upper_bound(zoneId);
- if(graveLow==graveUp)
+ MapEntry const* map = sMapStore.LookupEntry(MapId);
+ // not need to check validity of map object; MapId _MUST_ be valid here
+
+ if(graveLow==graveUp && !map->IsBattleArena())
{
sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team);
return NULL;
@@ -4851,7 +5193,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
uint32 count = 0;
- // 0 1 2 3 4 5 6
+ // 0 1 2 3 4 5 6
QueryResult *result = WorldDatabase.Query("SELECT id, access_id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
if( !result )
{
@@ -4892,7 +5234,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
sLog.outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID);
continue;
}
-
+
MapEntry const* mapEntry = sMapStore.LookupEntry(at.target_mapId);
if(!mapEntry)
{
@@ -4922,9 +5264,9 @@ void ObjectMgr::LoadAccessRequirements()
uint32 count = 0;
- // 0 1 2 3 4 5 6 7 8 9 10
+ // 0 1 2 3 4 5 6 7 8 9 10
QueryResult *result = WorldDatabase.Query("SELECT id, level_min, level_max, item, item2, heroic_key, heroic_key2, quest_done, quest_failed_text, heroic_quest_done, heroic_quest_failed_text FROM access_requirement");
- if( !result )
+ if( !result )
{
barGoLink bar( 1 );
@@ -5001,18 +5343,20 @@ void ObjectMgr::LoadAccessRequirements()
}
}
- if(ar.heroicQuest)
- {
- if(!mQuestTemplates[ar.heroicQuest])
- {
- sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",ar.heroicQuest,requiremt_ID);
- ar.heroicQuest = 0;
- }
- }
-
+ if(ar.heroicQuest)
+ {
+ QuestMap::iterator qReqItr = mQuestTemplates.find(ar.heroicQuest);
+ if(qReqItr == mQuestTemplates.end())
+ {
+ sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",ar.heroicQuest,requiremt_ID);
+ ar.heroicQuest = 0;
+ }
+ }
+
if(ar.quest)
{
- if(!mQuestTemplates[ar.quest])
+ QuestMap::iterator qReqItr = mQuestTemplates.find(ar.quest);
+ if(qReqItr == mQuestTemplates.end())
{
sLog.outErrorDb("Required Quest %u not exist for trigger %u, remove quest done requirement.",ar.quest,requiremt_ID);
ar.quest = 0;
@@ -5029,6 +5373,9 @@ void ObjectMgr::LoadAccessRequirements()
sLog.outString( ">> Loaded %u access requirement definitions", count );
}
+/*
+ * Searches for the areatrigger which teleports players out of the given map
+ */
AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
{
const MapEntry *mapEntry = sMapStore.LookupEntry(Map);
@@ -5045,6 +5392,23 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
return NULL;
}
+/**
+ * Searches for the areatrigger which teleports players to the given map
+ */
+AreaTrigger const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
+{
+ for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); ++itr)
+ {
+ if(itr->second.target_mapId == Map)
+ {
+ AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
+ if(atEntry)
+ return &itr->second;
+ }
+ }
+ return NULL;
+}
+
void ObjectMgr::SetHighestGuids()
{
QueryResult *result = CharacterDatabase.Query( "SELECT MAX(guid) FROM characters" );
@@ -5061,9 +5425,6 @@ void ObjectMgr::SetHighestGuids()
delete result;
}
- // pet guids are not saved to DB, set to 0 (pet guid != pet id)
- m_hiPetGuid = 0;
-
result = CharacterDatabase.Query( "SELECT MAX(guid) FROM item_instance" );
if( result )
{
@@ -5137,24 +5498,24 @@ uint32 ObjectMgr::GenerateArenaTeamId()
return m_arenaTeamId++;
}
-uint32 ObjectMgr::GenerateGuildId()
+uint32 ObjectMgr::GenerateAuctionID()
{
- if(m_guildId>=0xFFFFFFFE)
+ if(m_auctionid>=0xFFFFFFFE)
{
- sLog.outError("Guild ids overflow!! Can't continue, shutting down server. ");
+ sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
- return m_guildId++;
+ return m_auctionid++;
}
-uint32 ObjectMgr::GenerateAuctionID()
+uint32 ObjectMgr::GenerateGuildId()
{
- if(m_auctionid>=0xFFFFFFFE)
+ if(m_guildId>=0xFFFFFFFE)
{
- sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. ");
+ sLog.outError("Guild ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
- return m_auctionid++;
+ return m_guildId++;
}
uint32 ObjectMgr::GenerateMailID()
@@ -5216,6 +5577,13 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
World::StopNow(ERROR_EXIT_CODE);
}
return m_hiPetGuid++;
+ case HIGHGUID_VEHICLE:
+ if(m_hiVehicleGuid>=0x00FFFFFF)
+ {
+ sLog.outError("Vehicle guid overflow!! Can't continue, shutting down server. ");
+ World::StopNow(ERROR_EXIT_CODE);
+ }
+ return m_hiVehicleGuid++;
case HIGHGUID_PLAYER:
if(m_hiCharGuid>=0xFFFFFFFE)
{
@@ -5267,7 +5635,7 @@ void ObjectMgr::LoadGameObjectLocales()
bar.step();
- sLog.outString("");
+ sLog.outString();
sLog.outString(">> Loaded 0 gameobject locale strings. DB table `locales_gameobject` is empty.");
return;
}
@@ -5299,9 +5667,9 @@ void ObjectMgr::LoadGameObjectLocales()
}
}
- for(int i = MAX_LOCALE; i < MAX_LOCALE*2-1; ++i)
+ for(int i = 1; i < MAX_LOCALE; ++i)
{
- std::string str = fields[i].GetCppString();
+ std::string str = fields[i+(MAX_LOCALE-1)].GetCppString();
if(!str.empty())
{
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
@@ -5320,7 +5688,7 @@ void ObjectMgr::LoadGameObjectLocales()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u gameobject locale strings", mGameObjectLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu gameobject locale strings", (unsigned long)mGameObjectLocaleMap.size() );
}
struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
@@ -5332,6 +5700,61 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
}
};
+inline void CheckGOLockId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
+{
+ if (sLockStore.LookupEntry(dataN))
+ return;
+
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
+ goInfo->id,goInfo->type,N,goInfo->door.lockId,goInfo->door.lockId);
+}
+
+inline void CheckGOLinkedTrapId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
+{
+ if (GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(dataN))
+ {
+ if (trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
+ goInfo->id,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP);
+ }
+ /* disable check for while (too many error reports baout not existed in trap templates
+ else
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
+ goInfo->id,goInfo->type,N,dataN,dataN);
+ */
+}
+
+inline void CheckGOSpellId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
+{
+ if (sSpellStore.LookupEntry(dataN))
+ return;
+
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
+ goInfo->id,goInfo->type,N,dataN,dataN);
+}
+
+inline void CheckAndFixGOChairHeightId(GameObjectInfo const* goInfo,uint32 const& dataN,uint32 N)
+{
+ if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR) )
+ return;
+
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
+ goInfo->id,goInfo->type,N,dataN,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
+
+ // prevent client and server unexpected work
+ const_cast<uint32&>(dataN) = 0;
+}
+
+inline void CheckGONoDamageImmuneId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N)
+{
+ // 0/1 correct values
+ if (dataN <= 1)
+ return;
+
+ sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.",
+ goInfo->id,goInfo->type,N,dataN);
+}
+
void ObjectMgr::LoadGameobjectInfo()
{
SQLGameObjectLoader loader;
@@ -5341,139 +5764,104 @@ void ObjectMgr::LoadGameobjectInfo()
for(uint32 id = 1; id < sGOStorage.MaxEntry; id++)
{
GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(id);
- if(!goInfo)
+ if (!goInfo)
continue;
switch(goInfo->type)
{
case GAMEOBJECT_TYPE_DOOR: //0
{
- if(goInfo->door.lockId)
- {
- if(!sLockStore.LookupEntry(goInfo->door.lockId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but lock (Id: %u) not found.",
- id,goInfo->type,goInfo->door.lockId,goInfo->door.lockId);
- }
+ if (goInfo->door.lockId)
+ CheckGOLockId(goInfo,goInfo->door.lockId,1);
+ CheckGONoDamageImmuneId(goInfo,goInfo->door.noDamageImmune,3);
break;
}
case GAMEOBJECT_TYPE_BUTTON: //1
{
- if(goInfo->button.lockId)
- {
- if(!sLockStore.LookupEntry(goInfo->button.lockId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but lock (Id: %u) not found.",
- id,goInfo->type,goInfo->button.lockId,goInfo->button.lockId);
- }
+ if (goInfo->button.lockId)
+ CheckGOLockId(goInfo,goInfo->button.lockId,1);
+ CheckGONoDamageImmuneId(goInfo,goInfo->button.noDamageImmune,4);
+ break;
+ }
+ case GAMEOBJECT_TYPE_QUESTGIVER: //2
+ {
+ if (goInfo->questgiver.lockId)
+ CheckGOLockId(goInfo,goInfo->questgiver.lockId,0);
+ CheckGONoDamageImmuneId(goInfo,goInfo->questgiver.noDamageImmune,5);
break;
}
case GAMEOBJECT_TYPE_CHEST: //3
{
- if(goInfo->chest.lockId)
- {
- if(!sLockStore.LookupEntry(goInfo->chest.lockId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but lock (Id: %u) not found.",
- id,goInfo->type,goInfo->chest.lockId,goInfo->chest.lockId);
- }
- if(goInfo->chest.linkedTrapId) // linked trap
- {
- if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->chest.linkedTrapId))
- {
- if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
- id,goInfo->type,goInfo->chest.linkedTrapId,goInfo->chest.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
- }
- /* disable check for while
- else
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
- id,goInfo->type,goInfo->chest.linkedTrapId,goInfo->chest.linkedTrapId);
- */
- }
+ if (goInfo->chest.lockId)
+ CheckGOLockId(goInfo,goInfo->chest.lockId,0);
+
+ if (goInfo->chest.linkedTrapId) // linked trap
+ CheckGOLinkedTrapId(goInfo,goInfo->chest.linkedTrapId,7);
break;
}
case GAMEOBJECT_TYPE_TRAP: //6
{
- /* disable check for while
- if(goInfo->trap.spellId) // spell
- {
- if(!sSpellStore.LookupEntry(goInfo->trap.spellId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data3=%u but Spell (Entry %u) not exist.",
- id,goInfo->type,goInfo->trap.spellId,goInfo->trap.spellId);
- }
+ if (goInfo->trap.lockId)
+ CheckGOLockId(goInfo,goInfo->trap.lockId,0);
+ /* disable check for while, too many not existed spells
+ if (goInfo->trap.spellId) // spell
+ CheckGOSpellId(goInfo,goInfo->trap.spellId,3);
*/
break;
}
case GAMEOBJECT_TYPE_CHAIR: //7
- if(goInfo->chair.height > 2)
- {
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..2.",
- id,goInfo->type,goInfo->chair.height);
-
- // prevent client and server unexpected work
- const_cast<GameObjectInfo*>(goInfo)->chair.height = 0;
- }
+ CheckAndFixGOChairHeightId(goInfo,goInfo->chair.height,1);
break;
case GAMEOBJECT_TYPE_SPELL_FOCUS: //8
{
- if(goInfo->spellFocus.focusId)
+ if (goInfo->spellFocus.focusId)
{
- if(!sSpellFocusObjectStore.LookupEntry(goInfo->spellFocus.focusId))
+ if (!sSpellFocusObjectStore.LookupEntry(goInfo->spellFocus.focusId))
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
id,goInfo->type,goInfo->spellFocus.focusId,goInfo->spellFocus.focusId);
}
- if(goInfo->spellFocus.linkedTrapId) // linked trap
- {
- if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->spellFocus.linkedTrapId))
- {
- if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
- id,goInfo->type,goInfo->spellFocus.linkedTrapId,goInfo->spellFocus.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
- }
- /* disable check for while
- else
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
- id,goInfo->type,goInfo->spellFocus.linkedTrapId,goInfo->spellFocus.linkedTrapId);
- */
- }
+ if (goInfo->spellFocus.linkedTrapId) // linked trap
+ CheckGOLinkedTrapId(goInfo,goInfo->spellFocus.linkedTrapId,2);
break;
}
case GAMEOBJECT_TYPE_GOOBER: //10
{
- if(goInfo->goober.pageId) // pageId
+ if (goInfo->goober.lockId)
+ CheckGOLockId(goInfo,goInfo->goober.lockId,0);
+
+ if (goInfo->goober.pageId) // pageId
{
- if(!sPageTextStore.LookupEntry<PageText>(goInfo->goober.pageId))
+ if (!sPageTextStore.LookupEntry<PageText>(goInfo->goober.pageId))
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
id,goInfo->type,goInfo->goober.pageId,goInfo->goober.pageId);
}
- /* disable check for while
- if(goInfo->goober.spellId) // spell
- {
- if(!sSpellStore.LookupEntry(goInfo->goober.spellId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data2=%u but Spell (Entry %u) not exist.",
- id,goInfo->type,goInfo->goober.spellId,goInfo->goober.spellId);
- }
+ /* disable check for while, too many not existed spells
+ if (goInfo->goober.spellId) // spell
+ CheckGOSpellId(goInfo,goInfo->goober.spellId,10);
*/
- if(goInfo->goober.linkedTrapId) // linked trap
- {
- if(GameObjectInfo const* trapInfo = sGOStorage.LookupEntry<GameObjectInfo>(goInfo->goober.linkedTrapId))
- {
- if(trapInfo->type!=GAMEOBJECT_TYPE_TRAP)
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data12=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
- id,goInfo->type,goInfo->goober.linkedTrapId,goInfo->goober.linkedTrapId,GAMEOBJECT_TYPE_TRAP);
- }
- /* disable check for while
- else
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data12=%u but trap GO (Entry %u) not exist in `gameobject_template`.",
- id,goInfo->type,goInfo->goober.linkedTrapId,goInfo->goober.linkedTrapId);
- */
- }
+ CheckGONoDamageImmuneId(goInfo,goInfo->goober.noDamageImmune,11);
+ if (goInfo->goober.linkedTrapId) // linked trap
+ CheckGOLinkedTrapId(goInfo,goInfo->goober.linkedTrapId,12);
+ break;
+ }
+ case GAMEOBJECT_TYPE_AREADAMAGE: //12
+ {
+ if (goInfo->areadamage.lockId)
+ CheckGOLockId(goInfo,goInfo->areadamage.lockId,0);
+ break;
+ }
+ case GAMEOBJECT_TYPE_CAMERA: //13
+ {
+ if (goInfo->camera.lockId)
+ CheckGOLockId(goInfo,goInfo->camera.lockId,0);
break;
}
case GAMEOBJECT_TYPE_MO_TRANSPORT: //15
{
- if(goInfo->moTransport.taxiPathId)
+ if (goInfo->moTransport.taxiPathId)
{
- if(goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[goInfo->moTransport.taxiPathId].empty())
+ if (goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[goInfo->moTransport.taxiPathId].empty())
sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
id,goInfo->type,goInfo->moTransport.taxiPathId,goInfo->moTransport.taxiPathId);
}
@@ -5481,26 +5869,41 @@ void ObjectMgr::LoadGameobjectInfo()
}
case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18
{
- /* disabled
- if(goInfo->summoningRitual.spellId)
- {
- if(!sSpellStore.LookupEntry(goInfo->summoningRitual.spellId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but Spell (Entry %u) not exist.",
- id,goInfo->type,goInfo->summoningRitual.spellId,goInfo->summoningRitual.spellId);
- }
+ /* disable check for while, too many not existed spells
+ // always must have spell
+ CheckGOSpellId(goInfo,goInfo->summoningRitual.spellId,1);
*/
break;
}
case GAMEOBJECT_TYPE_SPELLCASTER: //22
{
- if(goInfo->spellcaster.spellId) // spell
- {
- if(!sSpellStore.LookupEntry(goInfo->spellcaster.spellId))
- sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data3=%u but Spell (Entry %u) not exist.",
- id,goInfo->type,goInfo->spellcaster.spellId,goInfo->spellcaster.spellId);
- }
+ // always must have spell
+ CheckGOSpellId(goInfo,goInfo->spellcaster.spellId,0);
break;
}
+ case GAMEOBJECT_TYPE_FLAGSTAND: //24
+ {
+ if (goInfo->flagstand.lockId)
+ CheckGOLockId(goInfo,goInfo->flagstand.lockId,0);
+ CheckGONoDamageImmuneId(goInfo,goInfo->flagstand.noDamageImmune,5);
+ break;
+ }
+ case GAMEOBJECT_TYPE_FISHINGHOLE: //25
+ {
+ if (goInfo->fishinghole.lockId)
+ CheckGOLockId(goInfo,goInfo->fishinghole.lockId,4);
+ break;
+ }
+ case GAMEOBJECT_TYPE_FLAGDROP: //26
+ {
+ if (goInfo->flagdrop.lockId)
+ CheckGOLockId(goInfo,goInfo->flagdrop.lockId,0);
+ CheckGONoDamageImmuneId(goInfo,goInfo->flagdrop.noDamageImmune,3);
+ break;
+ }
+ case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
+ CheckAndFixGOChairHeightId(goInfo,goInfo->barberChair.chairheight,0);
+ break;
}
}
@@ -5549,6 +5952,13 @@ uint32 ObjectMgr::GetBaseXP(uint32 level)
return mBaseXPTable[level] ? mBaseXPTable[level] : 0;
}
+uint32 ObjectMgr::GetXPForLevel(uint32 level)
+{
+ if (level < mPlayerXPperLevel.size())
+ return mPlayerXPperLevel[level];
+ return 0;
+}
+
void ObjectMgr::LoadPetNames()
{
uint32 count = 0;
@@ -5750,6 +6160,58 @@ void ObjectMgr::LoadReputationOnKill()
sLog.outString(">> Loaded %u creature award reputation definitions", count);
}
+void ObjectMgr::LoadPointsOfInterest()
+{
+ uint32 count = 0;
+
+ // 0 1 2 3 4 5
+ QueryResult *result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
+
+ if(!result)
+ {
+ barGoLink bar(1);
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
+ return;
+ }
+
+ barGoLink bar(result->GetRowCount());
+
+ do
+ {
+ Field *fields = result->Fetch();
+ bar.step();
+
+ uint32 point_id = fields[0].GetUInt32();
+
+ PointOfInterest POI;
+ POI.x = fields[1].GetFloat();
+ POI.y = fields[2].GetFloat();
+ POI.icon = fields[3].GetUInt32();
+ POI.flags = fields[4].GetUInt32();
+ POI.data = fields[5].GetUInt32();
+ POI.icon_name = fields[6].GetCppString();
+
+ if(!MaNGOS::IsValidMapCoord(POI.x,POI.y))
+ {
+ sLog.outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.",point_id,POI.x,POI.y);
+ continue;
+ }
+
+ mPointsOfInterest[point_id] = POI;
+
+ ++count;
+ } while (result->NextRow());
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u Points of Interest definitions", count);
+}
+
void ObjectMgr::LoadWeatherZoneChances()
{
uint32 count = 0;
@@ -5788,19 +6250,19 @@ void ObjectMgr::LoadWeatherZoneChances()
if(wzc.data[season].rainChance > 100)
{
wzc.data[season].rainChance = 25;
- sLog.outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%",zone_id,season);
+ sLog.outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%",zone_id,season);
}
if(wzc.data[season].snowChance > 100)
{
wzc.data[season].snowChance = 25;
- sLog.outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%",zone_id,season);
+ sLog.outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%",zone_id,season);
}
if(wzc.data[season].stormChance > 100)
{
wzc.data[season].stormChance = 25;
- sLog.outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%",zone_id,season);
+ sLog.outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%",zone_id,season);
}
}
@@ -6017,11 +6479,18 @@ void ObjectMgr::LoadReservedPlayersNames()
bar.step();
fields = result->Fetch();
std::string name= fields[0].GetCppString();
- if(normalizePlayerName(name))
+
+ std::wstring wstr;
+ if(!Utf8toWStr (name,wstr))
{
- m_ReservedNames.insert(name);
- ++count;
+ sLog.outError("Table `reserved_name` have invalid name: %s", name.c_str() );
+ continue;
}
+
+ wstrToLower(wstr);
+
+ m_ReservedNames.insert(wstr);
+ ++count;
} while ( result->NextRow() );
delete result;
@@ -6030,6 +6499,17 @@ void ObjectMgr::LoadReservedPlayersNames()
sLog.outString( ">> Loaded %u reserved player names", count );
}
+bool ObjectMgr::IsReservedName( const std::string& name ) const
+{
+ std::wstring wstr;
+ if(!Utf8toWStr (name,wstr))
+ return false;
+
+ wstrToLower(wstr);
+
+ return m_ReservedNames.find(wstr) != m_ReservedNames.end();
+}
+
enum LanguageType
{
LT_BASIC_LATIN = 0x0000,
@@ -6178,55 +6658,26 @@ int ObjectMgr::GetOrNewIndexForLocale( LocaleConstant loc )
return m_LocalForIndex.size()-1;
}
-void ObjectMgr::LoadBattleMastersEntry()
+void ObjectMgr::LoadGameObjectForQuests()
{
- mBattleMastersMap.clear(); // need for reload case
-
- QueryResult *result = WorldDatabase.Query( "SELECT entry,bg_template FROM battlemaster_entry" );
-
- uint32 count = 0;
+ mGameObjectForQuestSet.clear(); // need for reload case
- if( !result )
+ if( !sGOStorage.MaxEntry )
{
barGoLink bar( 1 );
bar.step();
-
sLog.outString();
- sLog.outString( ">> Loaded 0 battlemaster entries - table is empty!" );
+ sLog.outString( ">> Loaded 0 GameObjects for quests" );
return;
}
- barGoLink bar( result->GetRowCount() );
-
- do
- {
- ++count;
- bar.step();
-
- Field *fields = result->Fetch();
-
- uint32 entry = fields[0].GetUInt32();
- uint32 bgTypeId = fields[1].GetUInt32();
-
- mBattleMastersMap[entry] = bgTypeId;
-
- } while( result->NextRow() );
-
- delete result;
-
- sLog.outString();
- sLog.outString( ">> Loaded %u battlemaster entries", count );
-}
-
-void ObjectMgr::LoadGameObjectForQuests()
-{
- mGameObjectForQuestSet.clear(); // need for reload case
-
+ barGoLink bar( sGOStorage.MaxEntry - 1 );
uint32 count = 0;
// collect GO entries for GO that must activated
for(uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry)
{
+ bar.step();
GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(go_entry);
if(!goInfo)
continue;
@@ -6261,7 +6712,7 @@ void ObjectMgr::LoadGameObjectForQuests()
}
sLog.outString();
- sLog.outString( ">> Loaded %u GameObject for quests", count );
+ sLog.outString( ">> Loaded %u GameObjects for quests", count );
}
bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value)
@@ -6287,7 +6738,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi
bar.step();
- sLog.outString("");
+ sLog.outString();
if(min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings
sLog.outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table);
else
@@ -6534,13 +6985,13 @@ bool PlayerCondition::Meets(Player const * player) const
case CONDITION_ITEM:
return player->HasItemCount(value1, value2);
case CONDITION_ITEM_EQUIPPED:
- return player->GetItemOrItemWithGemEquipped(value1) != NULL;
+ return player->HasItemOrGemWithIdEquipped(value1,1);
case CONDITION_ZONEID:
return player->GetZoneId() == value1;
case CONDITION_REPUTATION_RANK:
{
FactionEntry const* faction = sFactionStore.LookupEntry(value1);
- return faction && player->GetReputationRank(faction) >= value2;
+ return faction && player->GetReputationMgr().GetRank(faction) >= value2;
}
case CONDITION_TEAM:
return player->GetTeam() == value1;
@@ -6557,7 +7008,7 @@ bool PlayerCondition::Meets(Player const * player) const
{
Unit::AuraMap const& auras = player->GetAuras();
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
- if((itr->second->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetSpellProto()->SpellVisual==3580)
+ if((itr->second->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetSpellProto()->SpellVisual[0]==3580)
return true;
return false;
}
@@ -6707,7 +7158,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
}
case CONDITION_ACTIVE_EVENT:
{
- GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
+ GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
if(value1 >=events.size() || !events[value1].isValid())
{
sLog.outErrorDb("Active event condition requires existed event id (%u), skipped", value1);
@@ -6734,7 +7185,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
return SKILL_RANGE_MONO;
case SKILL_CATEGORY_ARMOR:
case SKILL_CATEGORY_CLASS:
- if(pSkill->id != SKILL_POISONS && pSkill->id != SKILL_LOCKPICKING)
+ if(pSkill->id != SKILL_LOCKPICKING)
return SKILL_RANGE_MONO;
else
return SKILL_RANGE_LEVEL;
@@ -6749,7 +7200,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial)
return SKILL_RANGE_MONO;
default:
case SKILL_CATEGORY_ATTRIBUTES: //not found in dbc
- case SKILL_CATEGORY_NOT_DISPLAYED: //only GENEREC(DND)
+ case SKILL_CATEGORY_GENERIC: //only GENERIC(DND)
return SKILL_RANGE_NONE;
}
}
@@ -6810,11 +7261,10 @@ void ObjectMgr::LoadGameTele()
++count;
}
while (result->NextRow());
-
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u game tele's", count );
+ sLog.outString( ">> Loaded %u GameTeleports", count );
}
GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
@@ -6950,30 +7400,41 @@ void ObjectMgr::LoadTrainerSpell()
continue;
}
- TrainerSpell* pTrainerSpell = new TrainerSpell();
- pTrainerSpell->spell = spell;
- pTrainerSpell->spellcost = fields[2].GetUInt32();
- pTrainerSpell->reqskill = fields[3].GetUInt32();
- pTrainerSpell->reqskillvalue = fields[4].GetUInt32();
- pTrainerSpell->reqlevel = fields[5].GetUInt32();
+ TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
- if(!pTrainerSpell->reqlevel)
- pTrainerSpell->reqlevel = spellinfo->spellLevel;
+ TrainerSpell& trainerSpell = data.spellList[spell];
+ trainerSpell.spell = spell;
+ trainerSpell.spellCost = fields[2].GetUInt32();
+ trainerSpell.reqSkill = fields[3].GetUInt32();
+ trainerSpell.reqSkillValue = fields[4].GetUInt32();
+ trainerSpell.reqLevel = fields[5].GetUInt32();
+ if(!trainerSpell.reqLevel)
+ trainerSpell.reqLevel = spellinfo->spellLevel;
- TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
+ // calculate learned spell for profession case when stored cast-spell
+ trainerSpell.learnedSpell = spell;
+ for(int i = 0; i <3; ++i)
+ {
+ if(spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
+ continue;
+ if(SpellMgr::IsProfessionOrRidingSpell(spellinfo->EffectTriggerSpell[i]))
+ {
+ trainerSpell.learnedSpell = spellinfo->EffectTriggerSpell[i];
+ break;
+ }
+ }
- if(SpellMgr::IsProfessionSpell(spell))
+ if(SpellMgr::IsProfessionSpell(trainerSpell.learnedSpell))
data.trainerType = 2;
- data.spellList.push_back(pTrainerSpell);
++count;
} while (result->NextRow());
delete result;
sLog.outString();
- sLog.outString( ">> Loaded Trainers %d", count );
+ sLog.outString( ">> Loaded %d Trainers", count );
}
void ObjectMgr::LoadVendors()
@@ -7251,16 +7712,30 @@ void ObjectMgr::LoadScriptNames()
"SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' "
"UNION "
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
- if(result)
+
+ if( !result )
{
- do
- {
- m_scriptNames.push_back((*result)[0].GetString());
- } while (result->NextRow());
- delete result;
+ barGoLink bar( 1 );
+ bar.step();
+ sLog.outString();
+ sLog.outErrorDb(">> Loaded empty set of Script Names!");
+ return;
}
+ barGoLink bar( result->GetRowCount() );
+ uint32 count = 0;
+
+ do
+ {
+ bar.step();
+ m_scriptNames.push_back((*result)[0].GetString());
+ ++count;
+ } while (result->NextRow());
+ delete result;
+
std::sort(m_scriptNames.begin(), m_scriptNames.end());
+ sLog.outString();
+ sLog.outString( ">> Loaded %d Script Names", count );
}
uint32 ObjectMgr::GetScriptId(const char *name)
@@ -7280,13 +7755,16 @@ void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids)
{
for(ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
{
- if(itrM->second.dataint)
+ switch(itrM->second.command)
{
- if(!GetTrinityStringLocale (itrM->second.dataint))
- sLog.outErrorDb( "Table `db_script_string` has not existed string id %u", itrM->first);
+ case SCRIPT_COMMAND_TALK:
+ {
+ if(!GetTrinityStringLocale (itrM->second.dataint))
+ sLog.outErrorDb( "Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.dataint, itrMM->first);
- if(ids.count(itrM->second.dataint))
- ids.erase(itrM->second.dataint);
+ if(ids.count(itrM->second.dataint))
+ ids.erase(itrM->second.dataint);
+ }
}
}
}
@@ -7353,16 +7831,6 @@ CreatureInfo const *GetCreatureInfo(uint32 id)
return objmgr.GetCreatureTemplate(id);
}
-CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
-{
- return sCreatureStorage.LookupEntry<CreatureInfo>(entry);
-}
-
-Quest const* GetQuestTemplateStore(uint32 entry)
-{
- return objmgr.GetQuestTemplate(entry);
-}
-
void ObjectMgr::LoadTransportEvents()
{
@@ -7399,3 +7867,12 @@ void ObjectMgr::LoadTransportEvents()
delete result;
}
+CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
+{
+ return sCreatureStorage.LookupEntry<CreatureInfo>(entry);
+}
+
+Quest const* GetQuestTemplateStore(uint32 entry)
+{
+ return objmgr.GetQuestTemplate(entry);
+}
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 8de6c3333b3..3c52eaa2546 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -145,6 +145,7 @@ typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap;
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
typedef UNORDERED_MAP<uint32,TrinityStringLocale> TrinityStringLocaleMap;
typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap;
+typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
typedef std::multimap<uint32,uint32> QuestRelations;
@@ -171,6 +172,17 @@ struct ReputationOnKillEntry
bool team_dependent;
};
+struct PointOfInterest
+{
+ uint32 entry;
+ float x;
+ float y;
+ uint32 icon;
+ uint32 flags;
+ uint32 data;
+ std::string icon_name;
+};
+
struct PetCreateSpellEntry
{
uint32 spellid[4];
@@ -311,6 +323,7 @@ class ObjectMgr
typedef UNORDERED_MAP<uint32, AccessRequirement> AccessRequirementMap;
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
+ typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestMap;
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
@@ -333,13 +346,13 @@ class ObjectMgr
void RemoveGroup(Group* group) { mGroupSet.erase( group ); }
Guild* GetGuildByLeader(uint64 const&guid) const;
- Guild* GetGuildById(const uint32 GuildId) const;
+ Guild* GetGuildById(uint32 GuildId) const;
Guild* GetGuildByName(const std::string& guildname) const;
- std::string GetGuildNameById(const uint32 GuildId) const;
+ std::string GetGuildNameById(uint32 GuildId) const;
void AddGuild(Guild* guild);
void RemoveGuild(uint32 Id);
- ArenaTeam* GetArenaTeamById(const uint32 arenateamid) const;
+ ArenaTeam* GetArenaTeamById(uint32 arenateamid) const;
ArenaTeam* GetArenaTeamByName(const std::string& arenateamname) const;
ArenaTeam* GetArenaTeamByCaptain(uint64 const& guid) const;
void AddArenaTeam(ArenaTeam* arenaTeam);
@@ -394,7 +407,7 @@ class ObjectMgr
uint32 GetPlayerAccountIdByGUID(const uint64 &guid) const;
uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const;
- uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid );
+ uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team );
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
uint16 GetTaxiMount( uint32 id, uint32 team );
void GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint32>& mapIds );
@@ -414,26 +427,19 @@ class ObjectMgr
return itr->second;
return 0;
}
- bool IsTavernAreaTrigger(uint32 Trigger_ID) const { return mTavernAreaTriggerSet.count(Trigger_ID) != 0; }
- bool IsGameObjectForQuests(uint32 entry) const { return mGameObjectForQuestSet.count(entry) != 0; }
- bool IsGuildVaultGameObject(Player *player, uint64 guid) const
+ bool IsTavernAreaTrigger(uint32 Trigger_ID) const
{
- if(GameObject *go = ObjectAccessor::GetGameObject(*player, guid))
- if(go->GetGoType() == GAMEOBJECT_TYPE_GUILD_BANK)
- return true;
- return false;
+ return mTavernAreaTriggerSet.find(Trigger_ID) != mTavernAreaTriggerSet.end();
}
- uint32 GetBattleMasterBG(uint32 entry) const
+ bool IsGameObjectForQuests(uint32 entry) const
{
- BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
- if(itr != mBattleMastersMap.end())
- return itr->second;
- return 2; //BATTLEGROUND_WS - i will not add include only for constant usage!
+ return mGameObjectForQuestSet.find(entry) != mGameObjectForQuestSet.end();
}
- void AddGossipText(GossipText *pGText);
- GossipText *GetGossipText(uint32 Text_ID);
+ bool IsGameObjectOfTypeInRange(Player *player, uint64 guid, GameobjectTypes type) const;
+
+ GossipText const* GetGossipText(uint32 Text_ID) const;
WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);
@@ -458,6 +464,7 @@ class ObjectMgr
}
AreaTrigger const* GetGoBackTrigger(uint32 Map) const;
+ AreaTrigger const* GetMapEntranceTrigger(uint32 Map) const;
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
@@ -469,6 +476,14 @@ class ObjectMgr
return NULL;
}
+ PointOfInterest const* GetPointOfInterest(uint32 id) const
+ {
+ PointOfInterestMap::const_iterator itr = mPointsOfInterest.find(id);
+ if(itr != mPointsOfInterest.end())
+ return &itr->second;
+ return NULL;
+ }
+
PetCreateSpellEntry const* GetPetCreateSpellEntry(uint32 id) const
{
PetCreateSpellMap::const_iterator itr = mPetCreateSpell.find(id);
@@ -530,6 +545,7 @@ class ObjectMgr
void LoadNpcTextLocales();
void LoadPageTextLocales();
void LoadNpcOptionLocales();
+ void LoadPointOfInterestLocales();
void LoadInstanceTemplate();
void LoadGossipText();
@@ -539,7 +555,6 @@ class ObjectMgr
void LoadQuestAreaTriggers();
void LoadAreaTriggerScripts();
void LoadTavernAreaTriggers();
- void LoadBattleMastersEntry();
void LoadGameObjectForQuests();
void LoadItemTexts();
@@ -554,6 +569,7 @@ class ObjectMgr
void LoadFishingBaseSkillLevel();
void LoadReputationOnKill();
+ void LoadPointsOfInterest();
void LoadWeatherZoneChances();
void LoadGameTele();
@@ -565,6 +581,7 @@ class ObjectMgr
std::string GeneratePetName(uint32 entry);
uint32 GetBaseXP(uint32 level);
+ uint32 GetXPForLevel(uint32 level);
int32 GetFishingBaseSkillLevel(uint32 entry) const
{
@@ -576,12 +593,12 @@ class ObjectMgr
void SetHighestGuids();
uint32 GenerateLowGuid(HighGuid guidhigh);
+ uint32 GenerateArenaTeamId();
uint32 GenerateAuctionID();
- uint32 GenerateMailID();
+ uint32 GenerateGuildId();
uint32 GenerateItemTextID();
+ uint32 GenerateMailID();
uint32 GeneratePetNumber();
- uint32 GenerateArenaTeamId();
- uint32 GenerateGuildId();
void LoadPlayerInfoInCache();
PCachePlayerInfo GetPlayerInfoFromCache(uint32 unPlayerGuid) const;
@@ -670,6 +687,12 @@ class ObjectMgr
if(itr==mNpcOptionLocaleMap.end()) return NULL;
return &itr->second;
}
+ PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
+ {
+ PointOfInterestLocaleMap::const_iterator itr = mPointOfInterestLocaleMap.find(poi_id);
+ if(itr==mPointOfInterestLocaleMap.end()) return NULL;
+ return &itr->second;
+ }
GameObjectData const* GetGOData(uint32 guid) const
{
@@ -708,10 +731,7 @@ class ObjectMgr
// reserved names
void LoadReservedPlayersNames();
- bool IsReservedName(const std::string& name) const
- {
- return m_ReservedNames.find(name) != m_ReservedNames.end();
- }
+ bool IsReservedName(const std::string& name) const;
// name with valid structure and symbols
static bool IsValidName( const std::string& name, bool create = false );
@@ -786,20 +806,23 @@ class ObjectMgr
ScriptNameMap &GetScriptNames() { return m_scriptNames; }
const char * GetScriptName(uint32 id) { return id < m_scriptNames.size() ? m_scriptNames[id].c_str() : ""; }
uint32 GetScriptId(const char *name);
+
+ int GetOrNewIndexForLocale(LocaleConstant loc);
protected:
// first free id for selected id type
- uint32 m_auctionid;
- uint32 m_mailid;
- uint32 m_ItemTextId;
uint32 m_arenaTeamId;
+ uint32 m_auctionid;
uint32 m_guildId;
+ uint32 m_ItemTextId;
+ uint32 m_mailid;
uint32 m_hiPetNumber;
// first free low guid for seelcted guid type
uint32 m_hiCharGuid;
uint32 m_hiCreatureGuid;
uint32 m_hiPetGuid;
+ uint32 m_hiVehicleGuid;
uint32 m_hiItemGuid;
uint32 m_hiGoGuid;
uint32 m_hiDoGuid;
@@ -807,9 +830,8 @@ class ObjectMgr
QuestMap mQuestTemplates;
- typedef UNORDERED_MAP<uint32, GossipText*> GossipTextMap;
+ typedef UNORDERED_MAP<uint32, GossipText> GossipTextMap;
typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerMap;
- typedef UNORDERED_MAP<uint32, uint32> BattleMastersMap;
typedef UNORDERED_MAP<uint32, std::string> ItemTextMap;
typedef std::set<uint32> TavernAreaTriggerSet;
typedef std::set<uint32> GameObjectForQuestSet;
@@ -818,12 +840,9 @@ class ObjectMgr
GuildMap mGuildMap;
ArenaTeamMap mArenaTeamMap;
- ItemMap mItems;
-
ItemTextMap mItemTexts;
QuestAreaTriggerMap mQuestAreaTriggerMap;
- BattleMastersMap mBattleMastersMap;
TavernAreaTriggerSet mTavernAreaTriggerSet;
GameObjectForQuestSet mGameObjectForQuestSet;
GossipTextMap mGossipText;
@@ -833,12 +852,14 @@ class ObjectMgr
RepOnKillMap mRepOnKill;
+ PointOfInterestMap mPointsOfInterest;
+
WeatherZoneMap mWeatherZoneMap;
PetCreateSpellMap mPetCreateSpell;
//character reserved names
- typedef std::set<std::string> ReservedNamesMap;
+ typedef std::set<std::wstring> ReservedNamesMap;
ReservedNamesMap m_ReservedNames;
std::set<uint32> m_DisabledPlayerSpells;
@@ -853,7 +874,6 @@ class ObjectMgr
typedef std::vector<LocaleConstant> LocalForIndex;
LocalForIndex m_LocalForIndex;
- int GetOrNewIndexForLocale(LocaleConstant loc);
int DBCLocaleIndex;
@@ -872,6 +892,9 @@ class ObjectMgr
void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const;
PlayerInfo playerInfo[MAX_RACES][MAX_CLASSES];
+ typedef std::vector<uint32> PlayerXPperLevel; // [level]
+ PlayerXPperLevel mPlayerXPperLevel;
+
typedef std::map<uint32,uint32> BaseXPMap; // [area level][base xp]
BaseXPMap mBaseXPTable;
@@ -894,6 +917,7 @@ class ObjectMgr
PageTextLocaleMap mPageTextLocaleMap;
TrinityStringLocaleMap mTrinityStringLocaleMap;
NpcOptionLocaleMap mNpcOptionLocaleMap;
+ PointOfInterestLocaleMap mPointOfInterestLocaleMap;
RespawnTimes mCreatureRespawnTimes;
RespawnTimes mGORespawnTimes;
diff --git a/src/game/ObjectPosSelector.cpp b/src/game/ObjectPosSelector.cpp
new file mode 100644
index 00000000000..899dfec3fdb
--- /dev/null
+++ b/src/game/ObjectPosSelector.cpp
@@ -0,0 +1,157 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ObjectPosSelector.h"
+
+ObjectPosSelector::ObjectPosSelector(float x,float y,float size,float dist)
+: m_center_x(x),m_center_y(y),m_size(size),m_dist(dist)
+{
+ m_anglestep = acos(m_dist/(m_dist+2*m_size));
+
+ m_nextUsedPos[USED_POS_PLUS] = m_UsedPosLists[USED_POS_PLUS].end();
+ m_nextUsedPos[USED_POS_MINUS] = m_UsedPosLists[USED_POS_MINUS].end();
+
+ m_smallStepAngle[USED_POS_PLUS] = 0;
+ m_smallStepAngle[USED_POS_MINUS] = 0;
+
+ m_smallStepOk[USED_POS_PLUS] = false;
+ m_smallStepOk[USED_POS_MINUS] = false;
+
+ m_smallStepNextUsedPos[USED_POS_PLUS] = NULL;
+ m_smallStepNextUsedPos[USED_POS_MINUS] = NULL;
+}
+
+ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos(UsedPosType uptype)
+{
+ UsedPosList::const_iterator itr = m_nextUsedPos[uptype];
+ if(itr!=m_UsedPosLists[uptype].end())
+ ++itr;
+
+ if(itr==m_UsedPosLists[uptype].end())
+ {
+ if(!m_UsedPosLists[~uptype].empty())
+ return &*m_UsedPosLists[~uptype].rbegin();
+ else
+ return NULL;
+ }
+ else
+ return &*itr;
+}
+
+void ObjectPosSelector::AddUsedPos(float size,float angle,float dist)
+{
+ if(angle>=0)
+ m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle,UsedPos(1.0,size,dist)));
+ else
+ m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle,UsedPos(-1.0,size,dist)));
+}
+
+void ObjectPosSelector::InitializeAngle()
+{
+ m_nextUsedPos[USED_POS_PLUS] = m_UsedPosLists[USED_POS_PLUS].begin();
+ m_nextUsedPos[USED_POS_MINUS] = m_UsedPosLists[USED_POS_MINUS].begin();
+
+ m_smallStepAngle[USED_POS_PLUS] = 0;
+ m_smallStepAngle[USED_POS_MINUS] = 0;
+
+ m_smallStepOk[USED_POS_PLUS] = true;
+ m_smallStepOk[USED_POS_MINUS] = true;
+}
+
+bool ObjectPosSelector::FirstAngle(float& angle)
+{
+ if(m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() )
+ return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(),1.0,USED_POS_PLUS,angle);
+ else if(m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() )
+ return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(),-1.0,USED_POS_MINUS,angle);
+
+ return false;
+}
+
+bool ObjectPosSelector::NextAngle(float& angle)
+{
+ while(m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() ||
+ m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end() ||
+ m_smallStepOk[USED_POS_PLUS] || m_smallStepOk[USED_POS_MINUS] )
+ {
+ // calculate next possible angle
+ if(NextPosibleAngle(angle))
+ return true;
+ }
+
+ return false;
+}
+
+bool ObjectPosSelector::NextUsedAngle(float& angle)
+{
+ while(m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() ||
+ m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end() )
+ {
+ // calculate next possible angle
+ if(!NextPosibleAngle(angle))
+ return true;
+ }
+
+ return false;
+}
+
+bool ObjectPosSelector::NextPosibleAngle( float& angle )
+{
+ // ++ direction less updated
+ if( m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() &&
+ (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first) )
+ {
+ bool ok;
+ if(m_smallStepOk[USED_POS_PLUS])
+ ok = NextSmallStepAngle(1.0,USED_POS_PLUS,angle);
+ else
+ ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS],1.0,USED_POS_PLUS,angle);
+
+ if(!ok)
+ ++m_nextUsedPos[USED_POS_PLUS]; // increase. only at fail (original or checked)
+ return ok;
+ }
+ // -- direction less updated
+ else if( m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end())
+ {
+ bool ok;
+ if(m_smallStepOk[USED_POS_MINUS])
+ ok = NextSmallStepAngle(-1.0,USED_POS_MINUS,angle);
+ else
+ ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS],-1.0,USED_POS_MINUS,angle);
+
+ if(!ok)
+ ++m_nextUsedPos[USED_POS_MINUS];
+ return ok;
+ }
+ else // both list empty
+ {
+ if( m_smallStepOk[USED_POS_PLUS] && (!m_smallStepOk[USED_POS_MINUS] || m_smallStepAngle[USED_POS_PLUS] <= m_smallStepAngle[USED_POS_MINUS]) )
+ {
+ return NextSmallStepAngle(1.0,USED_POS_PLUS,angle);
+ }
+ // -- direction less updated
+ else if( m_smallStepOk[USED_POS_MINUS] )
+ {
+ return NextSmallStepAngle(-1.0,USED_POS_MINUS,angle);
+ }
+ }
+
+ // no angles
+ return false;
+}
diff --git a/src/game/ObjectPosSelector.h b/src/game/ObjectPosSelector.h
new file mode 100644
index 00000000000..84050611121
--- /dev/null
+++ b/src/game/ObjectPosSelector.h
@@ -0,0 +1,155 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _OBJECT_POS_SELECTOR_H
+#define _OBJECT_POS_SELECTOR_H
+
+#include<Common.h>
+
+#include<map>
+
+enum UsedPosType { USED_POS_PLUS, USED_POS_MINUS };
+
+inline UsedPosType operator ~(UsedPosType uptype)
+{
+ return uptype==USED_POS_PLUS ? USED_POS_MINUS : USED_POS_PLUS;
+}
+
+struct ObjectPosSelector
+{
+ struct UsedPos
+ {
+ UsedPos(float sign_, float size_,float dist_) : sign(sign_), size(size_),dist(dist_) {}
+
+ float sign;
+
+ float size; // size of point
+ float dist; // dist to central point (including central point size)
+ };
+
+ typedef std::multimap<float,UsedPos> UsedPosList; // abs(angle)->Node
+
+ ObjectPosSelector(float x,float y,float size,float dist);
+
+ void AddUsedPos(float size,float angle,float dist);
+ void InitializeAngle();
+
+ bool FirstAngle(float& angle);
+ bool NextAngle(float& angle);
+ bool NextUsedAngle(float& angle);
+
+ bool NextPosibleAngle( float& angle );
+
+ bool CheckAngle(UsedPosList::value_type const& nextUsedPos, float sign, float angle ) const
+ {
+ float angle_step2 = GetAngle(nextUsedPos.second);
+
+ float next_angle = nextUsedPos.first;
+ if(nextUsedPos.second.sign * sign < 0) // last node from diff. list (-pi+alpha)
+ next_angle = 2*M_PI-next_angle; // move to positive
+
+ return fabs(angle)+angle_step2 <= next_angle;
+ }
+
+ bool CheckOriginal() const
+ {
+ return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(),1.0,0)) &&
+ (m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(),-1.0,0));
+ }
+
+ bool IsNonBalanced() const { return m_UsedPosLists[USED_POS_PLUS].empty() != m_UsedPosLists[USED_POS_MINUS].empty(); }
+
+ bool NextAngleFor( UsedPosList::value_type const& usedPos, float sign, UsedPosType uptype, float &angle )
+ {
+ float angle_step = GetAngle(usedPos.second);
+
+ // next possible angle
+ angle = usedPos.first * usedPos.second.sign + angle_step * sign;
+
+ UsedPosList::value_type const* nextNode = nextUsedPos(uptype);
+ if(nextNode)
+ {
+ // if next node permit use selected angle, then do it
+ if(!CheckAngle(*nextNode, sign, angle))
+ {
+ m_smallStepOk[uptype] = false;
+ return false;
+ }
+ }
+
+ // possible more points
+ m_smallStepOk[uptype] = true;
+ m_smallStepAngle[uptype] = angle;
+ m_smallStepNextUsedPos[uptype] = nextNode;
+
+ return true;
+ }
+
+ bool NextSmallStepAngle( float sign, UsedPosType uptype, float &angle )
+ {
+ // next possible angle
+ angle = m_smallStepAngle[uptype] + m_anglestep * sign;
+
+ if(fabs(angle) > M_PI)
+ {
+ m_smallStepOk[uptype] = false;
+ return false;
+ }
+
+ if(m_smallStepNextUsedPos[uptype])
+ {
+ if(fabs(angle) >= m_smallStepNextUsedPos[uptype]->first)
+ {
+ m_smallStepOk[uptype] = false;
+ return false;
+ }
+
+ // if next node permit use selected angle, then do it
+ if(!CheckAngle(*m_smallStepNextUsedPos[uptype], sign, angle))
+ {
+ m_smallStepOk[uptype] = false;
+ return false;
+ }
+ }
+
+ // possible more points
+ m_smallStepAngle[uptype] = angle;
+ return true;
+ }
+
+ // next used post for m_nextUsedPos[uptype]
+ UsedPosList::value_type const* nextUsedPos(UsedPosType uptype);
+
+ // angle from used pos to next possible free pos
+ float GetAngle(UsedPos const& usedPos) const { return acos(m_dist/(usedPos.dist+usedPos.size+m_size)); }
+
+ float m_center_x;
+ float m_center_y;
+ float m_size; // size of object in center
+ float m_dist; // distance for searching pos (including central object size)
+ float m_anglestep;
+
+ UsedPosList m_UsedPosLists[2];
+ UsedPosList::const_iterator m_nextUsedPos[2];
+
+ // field for small step from first after next used pos until next pos
+ float m_smallStepAngle[2];
+ bool m_smallStepOk[2];
+ UsedPosList::value_type const* m_smallStepNextUsedPos[2];
+};
+#endif
diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp
index eebe4343797..5daa369a743 100644
--- a/src/game/Opcodes.cpp
+++ b/src/game/Opcodes.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,1065 +28,1202 @@
/// Correspondence between opcodes and their names
OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
{
- /*0x000*/ { "MSG_NULL_ACTION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x001*/ { "CMSG_BOOTME", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x002*/ { "CMSG_DBLOOKUP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x003*/ { "SMSG_DBLOOKUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x004*/ { "CMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x005*/ { "SMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x006*/ { "CMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x007*/ { "SMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x008*/ { "CMSG_WORLD_TELEPORT", STATUS_LOGGEDIN, &WorldSession::HandleWorldTeleportOpcode },
- /*0x009*/ { "CMSG_TELEPORT_TO_UNIT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL },
- /*0x00A*/ { "CMSG_ZONE_MAP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x00B*/ { "SMSG_ZONE_MAP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x00C*/ { "CMSG_DEBUG_CHANGECELLZONE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x00D*/ { "CMSG_EMBLAZON_TABARD_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x00E*/ { "CMSG_UNEMBLAZON_TABARD_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x00F*/ { "CMSG_RECHARGE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x010*/ { "CMSG_LEARN_SPELL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x011*/ { "CMSG_CREATEMONSTER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x012*/ { "CMSG_DESTROYMONSTER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x013*/ { "CMSG_CREATEITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x014*/ { "CMSG_CREATEGAMEOBJECT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x015*/ { "SMSG_CHECK_FOR_BOTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x016*/ { "CMSG_MAKEMONSTERATTACKGUID", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x017*/ { "CMSG_BOT_DETECTED2", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x018*/ { "CMSG_FORCEACTION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x019*/ { "CMSG_FORCEACTIONONOTHER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x01A*/ { "CMSG_FORCEACTIONSHOW", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x01B*/ { "SMSG_FORCEACTIONSHOW", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x01C*/ { "CMSG_PETGODMODE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x01D*/ { "SMSG_PETGODMODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x01E*/ { "SMSG_DEBUGINFOSPELLMISS_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x01F*/ { "CMSG_WEATHER_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x020*/ { "CMSG_UNDRESSPLAYER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x021*/ { "CMSG_BEASTMASTER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x022*/ { "CMSG_GODMODE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x023*/ { "SMSG_GODMODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x024*/ { "CMSG_CHEAT_SETMONEY", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x025*/ { "CMSG_LEVEL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x026*/ { "CMSG_PET_LEVEL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x027*/ { "CMSG_SET_WORLDSTATE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x028*/ { "CMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x029*/ { "CMSG_USE_SKILL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02A*/ { "CMSG_FLAG_QUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02B*/ { "CMSG_FLAG_QUEST_FINISH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02C*/ { "CMSG_CLEAR_QUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02D*/ { "CMSG_SEND_EVENT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02E*/ { "CMSG_DEBUG_AISTATE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x02F*/ { "SMSG_DEBUG_AISTATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x030*/ { "CMSG_DISABLE_PVP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x031*/ { "CMSG_ADVANCE_SPAWN_TIME", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x032*/ { "CMSG_PVP_PORT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x033*/ { "CMSG_AUTH_SRP6_BEGIN", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x034*/ { "CMSG_AUTH_SRP6_PROOF", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x035*/ { "CMSG_AUTH_SRP6_RECODE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x036*/ { "CMSG_CHAR_CREATE", STATUS_AUTHED, &WorldSession::HandleCharCreateOpcode },
- /*0x037*/ { "CMSG_CHAR_ENUM", STATUS_AUTHED, &WorldSession::HandleCharEnumOpcode },
- /*0x038*/ { "CMSG_CHAR_DELETE", STATUS_AUTHED, &WorldSession::HandleCharDeleteOpcode },
- /*0x039*/ { "SMSG_AUTH_SRP6_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x03A*/ { "SMSG_CHAR_CREATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x03B*/ { "SMSG_CHAR_ENUM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x03C*/ { "SMSG_CHAR_DELETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x03D*/ { "CMSG_PLAYER_LOGIN", STATUS_AUTHED, &WorldSession::HandlePlayerLoginOpcode },
- /*0x03E*/ { "SMSG_NEW_WORLD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x03F*/ { "SMSG_TRANSFER_PENDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x040*/ { "SMSG_TRANSFER_ABORTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x041*/ { "SMSG_CHARACTER_LOGIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x042*/ { "SMSG_LOGIN_SETTIMESPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x043*/ { "SMSG_GAMETIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x044*/ { "CMSG_GAMETIME_SET", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x045*/ { "SMSG_GAMETIME_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x046*/ { "CMSG_GAMESPEED_SET", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x047*/ { "SMSG_GAMESPEED_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x048*/ { "CMSG_SERVERTIME", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x049*/ { "SMSG_SERVERTIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x04A*/ { "CMSG_PLAYER_LOGOUT", STATUS_LOGGEDIN, &WorldSession::HandlePlayerLogoutOpcode },
- /*0x04B*/ { "CMSG_LOGOUT_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleLogoutRequestOpcode },
- /*0x04C*/ { "SMSG_LOGOUT_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x04D*/ { "SMSG_LOGOUT_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x04E*/ { "CMSG_LOGOUT_CANCEL", STATUS_LOGGEDIN, &WorldSession::HandleLogoutCancelOpcode },
- /*0x04F*/ { "SMSG_LOGOUT_CANCEL_ACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x050*/ { "CMSG_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleNameQueryOpcode },
- /*0x051*/ { "SMSG_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x052*/ { "CMSG_PET_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePetNameQuery },
- /*0x053*/ { "SMSG_PET_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x054*/ { "CMSG_GUILD_QUERY", STATUS_AUTHED, &WorldSession::HandleGuildQueryOpcode },
- /*0x055*/ { "SMSG_GUILD_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x056*/ { "CMSG_ITEM_QUERY_SINGLE", STATUS_LOGGEDIN, &WorldSession::HandleItemQuerySingleOpcode },
- /*0x057*/ { "CMSG_ITEM_QUERY_MULTIPLE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x058*/ { "SMSG_ITEM_QUERY_SINGLE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x059*/ { "SMSG_ITEM_QUERY_MULTIPLE_RESPONSE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x05A*/ { "CMSG_PAGE_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePageQueryOpcode },
- /*0x05B*/ { "SMSG_PAGE_TEXT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x05C*/ { "CMSG_QUEST_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestQueryOpcode },
- /*0x05D*/ { "SMSG_QUEST_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x05E*/ { "CMSG_GAMEOBJECT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGameObjectQueryOpcode },
- /*0x05F*/ { "SMSG_GAMEOBJECT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x060*/ { "CMSG_CREATURE_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCreatureQueryOpcode },
- /*0x061*/ { "SMSG_CREATURE_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x062*/ { "CMSG_WHO", STATUS_LOGGEDIN, &WorldSession::HandleWhoOpcode },
- /*0x063*/ { "SMSG_WHO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x064*/ { "CMSG_WHOIS", STATUS_LOGGEDIN, &WorldSession::HandleWhoisOpcode },
- /*0x065*/ { "SMSG_WHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x066*/ { "CMSG_CONTACT_LIST", STATUS_LOGGEDIN, &WorldSession::HandleFriendListOpcode },
- /*0x067*/ { "SMSG_CONTACT_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x068*/ { "SMSG_FRIEND_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x069*/ { "CMSG_ADD_FRIEND", STATUS_LOGGEDIN, &WorldSession::HandleAddFriendOpcode },
- /*0x06A*/ { "CMSG_DEL_FRIEND", STATUS_LOGGEDIN, &WorldSession::HandleDelFriendOpcode },
- /*0x06B*/ { "CMSG_SET_CONTACT_NOTES", STATUS_LOGGEDIN, &WorldSession::HandleSetFriendNoteOpcode },
- /*0x06C*/ { "CMSG_ADD_IGNORE", STATUS_LOGGEDIN, &WorldSession::HandleAddIgnoreOpcode },
- /*0x06D*/ { "CMSG_DEL_IGNORE", STATUS_LOGGEDIN, &WorldSession::HandleDelIgnoreOpcode },
- /*0x06E*/ { "CMSG_GROUP_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleGroupInviteOpcode },
- /*0x06F*/ { "SMSG_GROUP_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x070*/ { "CMSG_GROUP_CANCEL", STATUS_LOGGEDIN, &WorldSession::Handle_Deprecated },
- /*0x071*/ { "SMSG_GROUP_CANCEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x072*/ { "CMSG_GROUP_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleGroupAcceptOpcode },
- /*0x073*/ { "CMSG_GROUP_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleGroupDeclineOpcode },
- /*0x074*/ { "SMSG_GROUP_DECLINE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x075*/ { "CMSG_GROUP_UNINVITE", STATUS_LOGGEDIN, &WorldSession::HandleGroupUninviteNameOpcode },
- /*0x076*/ { "CMSG_GROUP_UNINVITE_GUID", STATUS_LOGGEDIN, &WorldSession::HandleGroupUninviteGuidOpcode },
- /*0x077*/ { "SMSG_GROUP_UNINVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x078*/ { "CMSG_GROUP_SET_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGroupSetLeaderOpcode },
- /*0x079*/ { "SMSG_GROUP_SET_LEADER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x07A*/ { "CMSG_LOOT_METHOD", STATUS_LOGGEDIN, &WorldSession::HandleLootMethodOpcode },
- /*0x07B*/ { "CMSG_GROUP_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleGroupLeaveOpcode },
- /*0x07C*/ { "SMSG_GROUP_DESTROYED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x07D*/ { "SMSG_GROUP_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x07E*/ { "SMSG_PARTY_MEMBER_STATS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x07F*/ { "SMSG_PARTY_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x080*/ { "UMSG_UPDATE_GROUP_MEMBERS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x081*/ { "CMSG_GUILD_CREATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildCreateOpcode },
- /*0x082*/ { "CMSG_GUILD_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleGuildInviteOpcode },
- /*0x083*/ { "SMSG_GUILD_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x084*/ { "CMSG_GUILD_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleGuildAcceptOpcode },
- /*0x085*/ { "CMSG_GUILD_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleGuildDeclineOpcode },
- /*0x086*/ { "SMSG_GUILD_DECLINE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x087*/ { "CMSG_GUILD_INFO", STATUS_LOGGEDIN, &WorldSession::HandleGuildInfoOpcode },
- /*0x088*/ { "SMSG_GUILD_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x089*/ { "CMSG_GUILD_ROSTER", STATUS_LOGGEDIN, &WorldSession::HandleGuildRosterOpcode },
- /*0x08A*/ { "SMSG_GUILD_ROSTER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x08B*/ { "CMSG_GUILD_PROMOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildPromoteOpcode },
- /*0x08C*/ { "CMSG_GUILD_DEMOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildDemoteOpcode },
- /*0x08D*/ { "CMSG_GUILD_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleGuildLeaveOpcode },
- /*0x08E*/ { "CMSG_GUILD_REMOVE", STATUS_LOGGEDIN, &WorldSession::HandleGuildRemoveOpcode },
- /*0x08F*/ { "CMSG_GUILD_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleGuildDisbandOpcode },
- /*0x090*/ { "CMSG_GUILD_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGuildLeaderOpcode },
- /*0x091*/ { "CMSG_GUILD_MOTD", STATUS_LOGGEDIN, &WorldSession::HandleGuildMOTDOpcode },
- /*0x092*/ { "SMSG_GUILD_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x093*/ { "SMSG_GUILD_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x094*/ { "UMSG_UPDATE_GUILD", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x095*/ { "CMSG_MESSAGECHAT", STATUS_LOGGEDIN, &WorldSession::HandleMessagechatOpcode },
- /*0x096*/ { "SMSG_MESSAGECHAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x097*/ { "CMSG_JOIN_CHANNEL", STATUS_LOGGEDIN, &WorldSession::HandleChannelJoin },
- /*0x098*/ { "CMSG_LEAVE_CHANNEL", STATUS_LOGGEDIN, &WorldSession::HandleChannelLeave },
- /*0x099*/ { "SMSG_CHANNEL_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x09A*/ { "CMSG_CHANNEL_LIST", STATUS_LOGGEDIN, &WorldSession::HandleChannelList },
- /*0x09B*/ { "SMSG_CHANNEL_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x09C*/ { "CMSG_CHANNEL_PASSWORD", STATUS_LOGGEDIN, &WorldSession::HandleChannelPassword },
- /*0x09D*/ { "CMSG_CHANNEL_SET_OWNER", STATUS_LOGGEDIN, &WorldSession::HandleChannelSetOwner },
- /*0x09E*/ { "CMSG_CHANNEL_OWNER", STATUS_LOGGEDIN, &WorldSession::HandleChannelOwner },
- /*0x09F*/ { "CMSG_CHANNEL_MODERATOR", STATUS_LOGGEDIN, &WorldSession::HandleChannelModerator },
- /*0x0A0*/ { "CMSG_CHANNEL_UNMODERATOR", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnmoderator },
- /*0x0A1*/ { "CMSG_CHANNEL_MUTE", STATUS_LOGGEDIN, &WorldSession::HandleChannelMute },
- /*0x0A2*/ { "CMSG_CHANNEL_UNMUTE", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnmute },
- /*0x0A3*/ { "CMSG_CHANNEL_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleChannelInvite },
- /*0x0A4*/ { "CMSG_CHANNEL_KICK", STATUS_LOGGEDIN, &WorldSession::HandleChannelKick },
- /*0x0A5*/ { "CMSG_CHANNEL_BAN", STATUS_LOGGEDIN, &WorldSession::HandleChannelBan },
- /*0x0A6*/ { "CMSG_CHANNEL_UNBAN", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnban },
- /*0x0A7*/ { "CMSG_CHANNEL_ANNOUNCEMENTS", STATUS_LOGGEDIN, &WorldSession::HandleChannelAnnounce },
- /*0x0A8*/ { "CMSG_CHANNEL_MODERATE", STATUS_LOGGEDIN, &WorldSession::HandleChannelModerate },
- /*0x0A9*/ { "SMSG_UPDATE_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0AA*/ { "SMSG_DESTROY_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0AB*/ { "CMSG_USE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleUseItemOpcode },
- /*0x0AC*/ { "CMSG_OPEN_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleOpenItemOpcode },
- /*0x0AD*/ { "CMSG_READ_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleReadItem },
- /*0x0AE*/ { "SMSG_READ_ITEM_OK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0AF*/ { "SMSG_READ_ITEM_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0B0*/ { "SMSG_ITEM_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0B1*/ { "CMSG_GAMEOBJ_USE", STATUS_LOGGEDIN, &WorldSession::HandleGameObjectUseOpcode },
- /*0x0B2*/ { "CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0B3*/ { "SMSG_GAMEOBJECT_CUSTOM_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0B4*/ { "CMSG_AREATRIGGER", STATUS_LOGGEDIN, &WorldSession::HandleAreaTriggerOpcode },
- /*0x0B5*/ { "MSG_MOVE_START_FORWARD", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0B6*/ { "MSG_MOVE_START_BACKWARD", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0B7*/ { "MSG_MOVE_STOP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0B8*/ { "MSG_MOVE_START_STRAFE_LEFT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0B9*/ { "MSG_MOVE_START_STRAFE_RIGHT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BA*/ { "MSG_MOVE_STOP_STRAFE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BB*/ { "MSG_MOVE_JUMP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BC*/ { "MSG_MOVE_START_TURN_LEFT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BD*/ { "MSG_MOVE_START_TURN_RIGHT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BE*/ { "MSG_MOVE_STOP_TURN", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0BF*/ { "MSG_MOVE_START_PITCH_UP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0C0*/ { "MSG_MOVE_START_PITCH_DOWN", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0C1*/ { "MSG_MOVE_STOP_PITCH", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0C2*/ { "MSG_MOVE_SET_RUN_MODE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0C3*/ { "MSG_MOVE_SET_WALK_MODE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0C4*/ { "MSG_MOVE_TOGGLE_LOGGING", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0C5*/ { "MSG_MOVE_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0C6*/ { "MSG_MOVE_TELEPORT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0C7*/ { "MSG_MOVE_TELEPORT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveTeleportAck },
- /*0x0C8*/ { "MSG_MOVE_TOGGLE_FALL_LOGGING", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0C9*/ { "MSG_MOVE_FALL_LAND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0CA*/ { "MSG_MOVE_START_SWIM", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0CB*/ { "MSG_MOVE_STOP_SWIM", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0CC*/ { "MSG_MOVE_SET_RUN_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0CD*/ { "MSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0CE*/ { "MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT",STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0CF*/ { "MSG_MOVE_SET_RUN_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D0*/ { "MSG_MOVE_SET_WALK_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D1*/ { "MSG_MOVE_SET_WALK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D2*/ { "MSG_MOVE_SET_SWIM_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D3*/ { "MSG_MOVE_SET_SWIM_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D4*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT",STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D5*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D6*/ { "MSG_MOVE_SET_ALL_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D7*/ { "MSG_MOVE_SET_TURN_RATE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D8*/ { "MSG_MOVE_SET_TURN_RATE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0D9*/ { "MSG_MOVE_TOGGLE_COLLISION_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0DA*/ { "MSG_MOVE_SET_FACING", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0DB*/ { "MSG_MOVE_SET_PITCH", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0DC*/ { "MSG_MOVE_WORLDPORT_ACK", STATUS_TRANSFER_PENDING, &WorldSession::HandleMoveWorldportAckOpcode},
- /*0x0DD*/ { "SMSG_MONSTER_MOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0DE*/ { "SMSG_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0DF*/ { "SMSG_MOVE_LAND_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0E0*/ { "MSG_MOVE_SET_RAW_POSITION_ACK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0E1*/ { "CMSG_MOVE_SET_RAW_POSITION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0E2*/ { "SMSG_FORCE_RUN_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0E3*/ { "CMSG_FORCE_RUN_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
- /*0x0E4*/ { "SMSG_FORCE_RUN_BACK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0E5*/ { "CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK",STATUS_LOGGEDIN,&WorldSession::HandleForceSpeedChangeAck },
- /*0x0E6*/ { "SMSG_FORCE_SWIM_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0E7*/ { "CMSG_FORCE_SWIM_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
- /*0x0E8*/ { "SMSG_FORCE_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0E9*/ { "CMSG_FORCE_MOVE_ROOT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveRootAck },
- /*0x0EA*/ { "SMSG_FORCE_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0EB*/ { "CMSG_FORCE_MOVE_UNROOT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveUnRootAck },
- /*0x0EC*/ { "MSG_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0ED*/ { "MSG_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0EE*/ { "MSG_MOVE_HEARTBEAT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x0EF*/ { "SMSG_MOVE_KNOCK_BACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0F0*/ { "CMSG_MOVE_KNOCK_BACK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveKnockBackAck },
- /*0x0F1*/ { "MSG_MOVE_KNOCK_BACK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0F2*/ { "SMSG_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0F3*/ { "SMSG_MOVE_NORMAL_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveHoverAck },
- /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0F8*/ { "CMSG_TRIGGER_CINEMATIC_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0F9*/ { "CMSG_OPENING_CINEMATIC", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x0FA*/ { "SMSG_TRIGGER_CINEMATIC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0FB*/ { "CMSG_NEXT_CINEMATIC_CAMERA", STATUS_LOGGEDIN, &WorldSession::HandleNextCinematicCamera },
- /*0x0FC*/ { "CMSG_COMPLETE_CINEMATIC", STATUS_LOGGEDIN, &WorldSession::HandleCompleteCinema },
- /*0x0FD*/ { "SMSG_TUTORIAL_FLAGS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x0FE*/ { "CMSG_TUTORIAL_FLAG", STATUS_LOGGEDIN, &WorldSession::HandleTutorialFlag },
- /*0x0FF*/ { "CMSG_TUTORIAL_CLEAR", STATUS_LOGGEDIN, &WorldSession::HandleTutorialClear },
- /*0x100*/ { "CMSG_TUTORIAL_RESET", STATUS_LOGGEDIN, &WorldSession::HandleTutorialReset },
- /*0x101*/ { "CMSG_STANDSTATECHANGE", STATUS_LOGGEDIN, &WorldSession::HandleStandStateChangeOpcode },
- /*0x102*/ { "CMSG_EMOTE", STATUS_LOGGEDIN, &WorldSession::HandleEmoteOpcode },
- /*0x103*/ { "SMSG_EMOTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x104*/ { "CMSG_TEXT_EMOTE", STATUS_LOGGEDIN, &WorldSession::HandleTextEmoteOpcode },
- /*0x105*/ { "SMSG_TEXT_EMOTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x106*/ { "CMSG_AUTOEQUIP_GROUND_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x107*/ { "CMSG_AUTOSTORE_GROUND_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x108*/ { "CMSG_AUTOSTORE_LOOT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutostoreLootItemOpcode },
- /*0x109*/ { "CMSG_STORE_LOOT_IN_SLOT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x10A*/ { "CMSG_AUTOEQUIP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoEquipItemOpcode },
- /*0x10B*/ { "CMSG_AUTOSTORE_BAG_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoStoreBagItemOpcode },
- /*0x10C*/ { "CMSG_SWAP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSwapItem },
- /*0x10D*/ { "CMSG_SWAP_INV_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSwapInvItemOpcode },
- /*0x10E*/ { "CMSG_SPLIT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSplitItemOpcode },
- /*0x10F*/ { "CMSG_AUTOEQUIP_ITEM_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleAutoEquipItemSlotOpcode },
- /*0x110*/ { "OBSOLETE_DROP_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x111*/ { "CMSG_DESTROYITEM", STATUS_LOGGEDIN, &WorldSession::HandleDestroyItemOpcode },
- /*0x112*/ { "SMSG_INVENTORY_CHANGE_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x113*/ { "SMSG_OPEN_CONTAINER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x114*/ { "CMSG_INSPECT", STATUS_LOGGEDIN, &WorldSession::HandleInspectOpcode },
- /*0x115*/ { "SMSG_INSPECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x116*/ { "CMSG_INITIATE_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleInitiateTradeOpcode },
- /*0x117*/ { "CMSG_BEGIN_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleBeginTradeOpcode },
- /*0x118*/ { "CMSG_BUSY_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleBusyTradeOpcode },
- /*0x119*/ { "CMSG_IGNORE_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleIgnoreTradeOpcode },
- /*0x11A*/ { "CMSG_ACCEPT_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleAcceptTradeOpcode },
- /*0x11B*/ { "CMSG_UNACCEPT_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleUnacceptTradeOpcode },
- /*0x11C*/ { "CMSG_CANCEL_TRADE", STATUS_AUTHED, &WorldSession::HandleCancelTradeOpcode },
- /*0x11D*/ { "CMSG_SET_TRADE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSetTradeItemOpcode },
- /*0x11E*/ { "CMSG_CLEAR_TRADE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleClearTradeItemOpcode },
- /*0x11F*/ { "CMSG_SET_TRADE_GOLD", STATUS_LOGGEDIN, &WorldSession::HandleSetTradeGoldOpcode },
- /*0x120*/ { "SMSG_TRADE_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x121*/ { "SMSG_TRADE_STATUS_EXTENDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x122*/ { "SMSG_INITIALIZE_FACTIONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x123*/ { "SMSG_SET_FACTION_VISIBLE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x124*/ { "SMSG_SET_FACTION_STANDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x125*/ { "CMSG_SET_FACTION_ATWAR", STATUS_LOGGEDIN, &WorldSession::HandleSetFactionAtWar },
- /*0x126*/ { "CMSG_SET_FACTION_CHEAT", STATUS_LOGGEDIN, &WorldSession::HandleSetFactionCheat },
- /*0x127*/ { "SMSG_SET_PROFICIENCY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x128*/ { "CMSG_SET_ACTION_BUTTON", STATUS_LOGGEDIN, &WorldSession::HandleSetActionButtonOpcode },
- /*0x129*/ { "SMSG_ACTION_BUTTONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x12A*/ { "SMSG_INITIAL_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x12B*/ { "SMSG_LEARNED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x12C*/ { "SMSG_SUPERCEDED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x12D*/ { "CMSG_NEW_SPELL_SLOT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x12E*/ { "CMSG_CAST_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleCastSpellOpcode },
- /*0x12F*/ { "CMSG_CANCEL_CAST", STATUS_LOGGEDIN, &WorldSession::HandleCancelCastOpcode },
- /*0x130*/ { "SMSG_CAST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x131*/ { "SMSG_SPELL_START", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x132*/ { "SMSG_SPELL_GO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x133*/ { "SMSG_SPELL_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x134*/ { "SMSG_SPELL_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x135*/ { "SMSG_COOLDOWN_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x136*/ { "CMSG_CANCEL_AURA", STATUS_LOGGEDIN, &WorldSession::HandleCancelAuraOpcode },
- /*0x137*/ { "SMSG_UPDATE_AURA_DURATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x138*/ { "SMSG_PET_CAST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x139*/ { "MSG_CHANNEL_START", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x13A*/ { "MSG_CHANNEL_UPDATE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x13B*/ { "CMSG_CANCEL_CHANNELLING", STATUS_LOGGEDIN, &WorldSession::HandleCancelChanneling },
- /*0x13C*/ { "SMSG_AI_REACTION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x13D*/ { "CMSG_SET_SELECTION", STATUS_LOGGEDIN, &WorldSession::HandleSetSelectionOpcode },
- /*0x13E*/ { "CMSG_SET_TARGET_OBSOLETE", STATUS_LOGGEDIN, &WorldSession::HandleSetTargetOpcode },
- /*0x13F*/ { "CMSG_UNUSED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x140*/ { "CMSG_UNUSED2", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x141*/ { "CMSG_ATTACKSWING", STATUS_LOGGEDIN, &WorldSession::HandleAttackSwingOpcode },
- /*0x142*/ { "CMSG_ATTACKSTOP", STATUS_LOGGEDIN, &WorldSession::HandleAttackStopOpcode },
- /*0x143*/ { "SMSG_ATTACKSTART", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x144*/ { "SMSG_ATTACKSTOP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x145*/ { "SMSG_ATTACKSWING_NOTINRANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x146*/ { "SMSG_ATTACKSWING_BADFACING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x147*/ { "SMSG_ATTACKSWING_NOTSTANDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x148*/ { "SMSG_ATTACKSWING_DEADTARGET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x149*/ { "SMSG_ATTACKSWING_CANT_ATTACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14A*/ { "SMSG_ATTACKERSTATEUPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14B*/ { "SMSG_VICTIMSTATEUPDATE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14C*/ { "SMSG_DAMAGE_DONE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14D*/ { "SMSG_DAMAGE_TAKEN_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14E*/ { "SMSG_CANCEL_COMBAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x14F*/ { "SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x150*/ { "SMSG_SPELLHEALLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x151*/ { "SMSG_SPELLENERGIZELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x152*/ { "CMSG_SHEATHE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x153*/ { "CMSG_SAVE_PLAYER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x154*/ { "CMSG_SETDEATHBINDPOINT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x155*/ { "SMSG_BINDPOINTUPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x156*/ { "CMSG_GETDEATHBINDZONE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x157*/ { "SMSG_BINDZONEREPLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x158*/ { "SMSG_PLAYERBOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x159*/ { "SMSG_CLIENT_CONTROL_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x15A*/ { "CMSG_REPOP_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleRepopRequestOpcode },
- /*0x15B*/ { "SMSG_RESURRECT_REQUEST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x15C*/ { "CMSG_RESURRECT_RESPONSE", STATUS_LOGGEDIN, &WorldSession::HandleResurrectResponseOpcode },
- /*0x15D*/ { "CMSG_LOOT", STATUS_LOGGEDIN, &WorldSession::HandleLootOpcode },
- /*0x15E*/ { "CMSG_LOOT_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleLootMoneyOpcode },
- /*0x15F*/ { "CMSG_LOOT_RELEASE", STATUS_LOGGEDIN, &WorldSession::HandleLootReleaseOpcode },
- /*0x160*/ { "SMSG_LOOT_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x161*/ { "SMSG_LOOT_RELEASE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x162*/ { "SMSG_LOOT_REMOVED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x163*/ { "SMSG_LOOT_MONEY_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x164*/ { "SMSG_LOOT_ITEM_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x165*/ { "SMSG_LOOT_CLEAR_MONEY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x166*/ { "SMSG_ITEM_PUSH_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x167*/ { "SMSG_DUEL_REQUESTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x168*/ { "SMSG_DUEL_OUTOFBOUNDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x169*/ { "SMSG_DUEL_INBOUNDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x16A*/ { "SMSG_DUEL_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x16B*/ { "SMSG_DUEL_WINNER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x16C*/ { "CMSG_DUEL_ACCEPTED", STATUS_LOGGEDIN, &WorldSession::HandleDuelAcceptedOpcode },
- /*0x16D*/ { "CMSG_DUEL_CANCELLED", STATUS_LOGGEDIN, &WorldSession::HandleDuelCancelledOpcode },
- /*0x16E*/ { "SMSG_MOUNTRESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x16F*/ { "SMSG_DISMOUNTRESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x170*/ { "SMSG_PUREMOUNT_CANCELLED_OBSOLETE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x171*/ { "CMSG_MOUNTSPECIAL_ANIM", STATUS_LOGGEDIN, &WorldSession::HandleMountSpecialAnimOpcode },
- /*0x172*/ { "SMSG_MOUNTSPECIAL_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x173*/ { "SMSG_PET_TAME_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x174*/ { "CMSG_PET_SET_ACTION", STATUS_LOGGEDIN, &WorldSession::HandlePetSetAction },
- /*0x175*/ { "CMSG_PET_ACTION", STATUS_LOGGEDIN, &WorldSession::HandlePetAction },
- /*0x176*/ { "CMSG_PET_ABANDON", STATUS_LOGGEDIN, &WorldSession::HandlePetAbandon },
- /*0x177*/ { "CMSG_PET_RENAME", STATUS_LOGGEDIN, &WorldSession::HandlePetRename },
- /*0x178*/ { "SMSG_PET_NAME_INVALID", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x179*/ { "SMSG_PET_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x17A*/ { "SMSG_PET_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x17B*/ { "CMSG_GOSSIP_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleGossipHelloOpcode },
- /*0x17C*/ { "CMSG_GOSSIP_SELECT_OPTION", STATUS_LOGGEDIN, &WorldSession::HandleGossipSelectOptionOpcode },
- /*0x17D*/ { "SMSG_GOSSIP_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x17E*/ { "SMSG_GOSSIP_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x17F*/ { "CMSG_NPC_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleNpcTextQueryOpcode },
- /*0x180*/ { "SMSG_NPC_TEXT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x181*/ { "SMSG_NPC_WONT_TALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x182*/ { "CMSG_QUESTGIVER_STATUS_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverStatusQueryOpcode},
- /*0x183*/ { "SMSG_QUESTGIVER_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x184*/ { "CMSG_QUESTGIVER_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverHelloOpcode },
- /*0x185*/ { "SMSG_QUESTGIVER_QUEST_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x186*/ { "CMSG_QUESTGIVER_QUERY_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverQuestQueryOpcode},
- /*0x187*/ { "CMSG_QUESTGIVER_QUEST_AUTOLAUNCH", STATUS_LOGGEDIN, &WorldSession::HandleQuestAutoLaunch },
- /*0x188*/ { "SMSG_QUESTGIVER_QUEST_DETAILS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x189*/ { "CMSG_QUESTGIVER_ACCEPT_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverAcceptQuestOpcode},
- /*0x18A*/ { "CMSG_QUESTGIVER_COMPLETE_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestComplete },
- /*0x18B*/ { "SMSG_QUESTGIVER_REQUEST_ITEMS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x18C*/ { "CMSG_QUESTGIVER_REQUEST_REWARD", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverRequestRewardOpcode},
- /*0x18D*/ { "SMSG_QUESTGIVER_OFFER_REWARD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x18E*/ { "CMSG_QUESTGIVER_CHOOSE_REWARD", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverChooseRewardOpcode},
- /*0x18F*/ { "SMSG_QUESTGIVER_QUEST_INVALID", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x190*/ { "CMSG_QUESTGIVER_CANCEL", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverCancel },
- /*0x191*/ { "SMSG_QUESTGIVER_QUEST_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x192*/ { "SMSG_QUESTGIVER_QUEST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x193*/ { "CMSG_QUESTLOG_SWAP_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestLogSwapQuest },
- /*0x194*/ { "CMSG_QUESTLOG_REMOVE_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestLogRemoveQuest },
- /*0x195*/ { "SMSG_QUESTLOG_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x196*/ { "SMSG_QUESTUPDATE_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x197*/ { "SMSG_QUESTUPDATE_FAILEDTIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x198*/ { "SMSG_QUESTUPDATE_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x199*/ { "SMSG_QUESTUPDATE_ADD_KILL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x19A*/ { "SMSG_QUESTUPDATE_ADD_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x19B*/ { "CMSG_QUEST_CONFIRM_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleQuestConfirmAccept },
- /*0x19C*/ { "SMSG_QUEST_CONFIRM_ACCEPT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x19D*/ { "CMSG_PUSHQUESTTOPARTY", STATUS_LOGGEDIN, &WorldSession::HandleQuestPushToParty },
- /*0x19E*/ { "CMSG_LIST_INVENTORY", STATUS_LOGGEDIN, &WorldSession::HandleListInventoryOpcode },
- /*0x19F*/ { "SMSG_LIST_INVENTORY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1A0*/ { "CMSG_SELL_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSellItemOpcode },
- /*0x1A1*/ { "SMSG_SELL_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1A2*/ { "CMSG_BUY_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleBuyItemOpcode },
- /*0x1A3*/ { "CMSG_BUY_ITEM_IN_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyItemInSlotOpcode },
- /*0x1A4*/ { "SMSG_BUY_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1A5*/ { "SMSG_BUY_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1A6*/ { "CMSG_TAXICLEARALLNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1A7*/ { "CMSG_TAXIENABLEALLNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1A8*/ { "CMSG_TAXISHOWNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1A9*/ { "SMSG_SHOWTAXINODES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1AA*/ { "CMSG_TAXINODE_STATUS_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleTaxiNodeStatusQueryOpcode },
- /*0x1AB*/ { "SMSG_TAXINODE_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1AC*/ { "CMSG_TAXIQUERYAVAILABLENODES", STATUS_LOGGEDIN, &WorldSession::HandleTaxiQueryAvailableNodesOpcode},
- /*0x1AD*/ { "CMSG_ACTIVATETAXI", STATUS_LOGGEDIN, &WorldSession::HandleActivateTaxiOpcode },
- /*0x1AE*/ { "SMSG_ACTIVATETAXIREPLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1AF*/ { "SMSG_NEW_TAXI_PATH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B0*/ { "CMSG_TRAINER_LIST", STATUS_LOGGEDIN, &WorldSession::HandleTrainerListOpcode },
- /*0x1B1*/ { "SMSG_TRAINER_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B2*/ { "CMSG_TRAINER_BUY_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleTrainerBuySpellOpcode },
- /*0x1B3*/ { "SMSG_TRAINER_BUY_SUCCEEDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B4*/ { "SMSG_TRAINER_BUY_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B5*/ { "CMSG_BINDER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleBinderActivateOpcode },
- /*0x1B6*/ { "SMSG_PLAYERBINDERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B7*/ { "CMSG_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleBankerActivateOpcode },
- /*0x1B8*/ { "SMSG_SHOW_BANK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1B9*/ { "CMSG_BUY_BANK_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyBankSlotOpcode },
- /*0x1BA*/ { "SMSG_BUY_BANK_SLOT_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1BB*/ { "CMSG_PETITION_SHOWLIST", STATUS_LOGGEDIN, &WorldSession::HandlePetitionShowListOpcode },
- /*0x1BC*/ { "SMSG_PETITION_SHOWLIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1BD*/ { "CMSG_PETITION_BUY", STATUS_LOGGEDIN, &WorldSession::HandlePetitionBuyOpcode },
- /*0x1BE*/ { "CMSG_PETITION_SHOW_SIGNATURES", STATUS_LOGGEDIN, &WorldSession::HandlePetitionShowSignOpcode },
- /*0x1BF*/ { "SMSG_PETITION_SHOW_SIGNATURES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1C0*/ { "CMSG_PETITION_SIGN", STATUS_LOGGEDIN, &WorldSession::HandlePetitionSignOpcode },
- /*0x1C1*/ { "SMSG_PETITION_SIGN_RESULTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1C2*/ { "MSG_PETITION_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandlePetitionDeclineOpcode },
- /*0x1C3*/ { "CMSG_OFFER_PETITION", STATUS_LOGGEDIN, &WorldSession::HandleOfferPetitionOpcode },
- /*0x1C4*/ { "CMSG_TURN_IN_PETITION", STATUS_LOGGEDIN, &WorldSession::HandleTurnInPetitionOpcode },
- /*0x1C5*/ { "SMSG_TURN_IN_PETITION_RESULTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1C6*/ { "CMSG_PETITION_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePetitionQueryOpcode },
- /*0x1C7*/ { "SMSG_PETITION_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1C8*/ { "SMSG_FISH_NOT_HOOKED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1C9*/ { "SMSG_FISH_ESCAPED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1CA*/ { "CMSG_BUG", STATUS_LOGGEDIN, &WorldSession::HandleBugOpcode },
- /*0x1CB*/ { "SMSG_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1CC*/ { "CMSG_PLAYED_TIME", STATUS_LOGGEDIN, &WorldSession::HandlePlayedTime },
- /*0x1CD*/ { "SMSG_PLAYED_TIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1CE*/ { "CMSG_QUERY_TIME", STATUS_LOGGEDIN, &WorldSession::HandleQueryTimeOpcode },
- /*0x1CF*/ { "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D0*/ { "SMSG_LOG_XPGAIN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D2*/ { "CMSG_RECLAIM_CORPSE", STATUS_LOGGEDIN, &WorldSession::HandleCorpseReclaimOpcode },
- /*0x1D3*/ { "CMSG_WRAP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleWrapItemOpcode },
- /*0x1D4*/ { "SMSG_LEVELUP_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D5*/ { "MSG_MINIMAP_PING", STATUS_LOGGEDIN, &WorldSession::HandleMinimapPingOpcode },
- /*0x1D6*/ { "SMSG_RESISTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D7*/ { "SMSG_ENCHANTMENTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1D8*/ { "CMSG_SET_SKILL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1D9*/ { "SMSG_START_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1DA*/ { "SMSG_PAUSE_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1DB*/ { "SMSG_STOP_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1DC*/ { "CMSG_PING", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
- /*0x1DD*/ { "SMSG_PONG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1DE*/ { "SMSG_CLEAR_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1DF*/ { "SMSG_GAMEOBJECT_PAGETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1E0*/ { "CMSG_SETSHEATHED", STATUS_LOGGEDIN, &WorldSession::HandleSetSheathedOpcode },
- /*0x1E1*/ { "SMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1E2*/ { "SMSG_SPELL_DELAYED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1E3*/ { "CMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1E4*/ { "SMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1E5*/ { "CMSG_GHOST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1E6*/ { "CMSG_GM_INVIS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1E7*/ { "SMSG_INVALID_PROMOTION_CODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1E8*/ { "MSG_GM_BIND_OTHER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1E9*/ { "MSG_GM_SUMMON", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1EA*/ { "SMSG_ITEM_TIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1EB*/ { "SMSG_ITEM_ENCHANT_TIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1EC*/ { "SMSG_AUTH_CHALLENGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1ED*/ { "CMSG_AUTH_SESSION", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
- /*0x1EE*/ { "SMSG_AUTH_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1EF*/ { "MSG_GM_SHOWLABEL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1F0*/ { "CMSG_PET_CAST_SPELL", STATUS_LOGGEDIN, &WorldSession::HandlePetCastSpellOpcode },
- /*0x1F1*/ { "MSG_SAVE_GUILD_EMBLEM", STATUS_LOGGEDIN, &WorldSession::HandleGuildSaveEmblemOpcode },
- /*0x1F2*/ { "MSG_TABARDVENDOR_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleTabardVendorActivateOpcode},
- /*0x1F3*/ { "SMSG_PLAY_SPELL_VISUAL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1F4*/ { "CMSG_ZONEUPDATE", STATUS_LOGGEDIN, &WorldSession::HandleZoneUpdateOpcode },
- /*0x1F5*/ { "SMSG_PARTYKILLLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1F6*/ { "SMSG_COMPRESSED_UPDATE_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1F7*/ { "SMSG_PLAY_SPELL_IMPACT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1F8*/ { "SMSG_EXPLORATION_EXPERIENCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1F9*/ { "CMSG_GM_SET_SECURITY_GROUP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1FA*/ { "CMSG_GM_NUKE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1FB*/ { "MSG_RANDOM_ROLL", STATUS_LOGGEDIN, &WorldSession::HandleRandomRollOpcode },
- /*0x1FC*/ { "SMSG_ENVIRONMENTALDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1FD*/ { "CMSG_RWHOIS_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x1FE*/ { "SMSG_RWHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x1FF*/ { "MSG_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLookingForGroup },
- /*0x200*/ { "CMSG_SET_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgOpcode },
- /*0x201*/ { "CMSG_UNLEARN_SPELL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x202*/ { "CMSG_UNLEARN_SKILL", STATUS_LOGGEDIN, &WorldSession::HandleUnlearnSkillOpcode },
- /*0x203*/ { "SMSG_REMOVED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x204*/ { "CMSG_DECHARGE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x205*/ { "CMSG_GMTICKET_CREATE", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketCreateOpcode },
- /*0x206*/ { "SMSG_GMTICKET_CREATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketUpdateOpcode },
- /*0x208*/ { "SMSG_GMTICKET_UPDATETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x209*/ { "SMSG_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_LOGGEDIN, &WorldSession::HandleRequestAccountData },
- /*0x20B*/ { "CMSG_UPDATE_ACCOUNT_DATA", STATUS_LOGGEDIN, &WorldSession::HandleUpdateAccountData },
- /*0x20C*/ { "SMSG_UPDATE_ACCOUNT_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x20D*/ { "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x20E*/ { "SMSG_POWERGAINLOG_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x20F*/ { "CMSG_GM_TEACH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x210*/ { "CMSG_GM_CREATE_ITEM_TARGET", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x211*/ { "CMSG_GMTICKET_GETTICKET", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketGetTicketOpcode },
- /*0x212*/ { "SMSG_GMTICKET_GETTICKET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x213*/ { "CMSG_UNLEARN_TALENTS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x214*/ { "SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x215*/ { "SMSG_GAMEOBJECT_DESPAWN_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x216*/ { "MSG_CORPSE_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCorpseQueryOpcode },
- /*0x217*/ { "CMSG_GMTICKET_DELETETICKET", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketDeleteOpcode },
- /*0x218*/ { "SMSG_GMTICKET_DELETETICKET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x219*/ { "SMSG_CHAT_WRONG_FACTION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x21A*/ { "CMSG_GMTICKET_SYSTEMSTATUS", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketSystemStatusOpcode},
- /*0x21B*/ { "SMSG_GMTICKET_SYSTEMSTATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x21C*/ { "CMSG_SPIRIT_HEALER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleSpiritHealerActivateOpcode},
- /*0x21D*/ { "CMSG_SET_STAT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x21E*/ { "SMSG_SET_REST_START", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x21F*/ { "CMSG_SKILL_BUY_STEP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x220*/ { "CMSG_SKILL_BUY_RANK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x221*/ { "CMSG_XP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x222*/ { "SMSG_SPIRIT_HEALER_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x223*/ { "CMSG_CHARACTER_POINT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x224*/ { "SMSG_GOSSIP_POI", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x225*/ { "CMSG_CHAT_IGNORED", STATUS_LOGGEDIN, &WorldSession::HandleChatIgnoredOpcode },
- /*0x226*/ { "CMSG_GM_VISION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x227*/ { "CMSG_SERVER_COMMAND", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x228*/ { "CMSG_GM_SILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x229*/ { "CMSG_GM_REVEALTO", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22A*/ { "CMSG_GM_RESURRECT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22B*/ { "CMSG_GM_SUMMONMOB", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22C*/ { "CMSG_GM_MOVECORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22D*/ { "CMSG_GM_FREEZE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22E*/ { "CMSG_GM_UBERINVIS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x22F*/ { "CMSG_GM_REQUEST_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x230*/ { "SMSG_GM_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x231*/ { "CMSG_GUILD_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildRankOpcode },
- /*0x232*/ { "CMSG_GUILD_ADD_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildAddRankOpcode },
- /*0x233*/ { "CMSG_GUILD_DEL_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildDelRankOpcode },
- /*0x234*/ { "CMSG_GUILD_SET_PUBLIC_NOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildSetPublicNoteOpcode },
- /*0x235*/ { "CMSG_GUILD_SET_OFFICER_NOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildSetOfficerNoteOpcode },
- /*0x236*/ { "SMSG_LOGIN_VERIFY_WORLD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x237*/ { "CMSG_CLEAR_EXPLORATION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x238*/ { "CMSG_SEND_MAIL", STATUS_LOGGEDIN, &WorldSession::HandleSendMail },
- /*0x239*/ { "SMSG_SEND_MAIL_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x23A*/ { "CMSG_GET_MAIL_LIST", STATUS_LOGGEDIN, &WorldSession::HandleGetMail },
- /*0x23B*/ { "SMSG_MAIL_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x23C*/ { "CMSG_BATTLEFIELD_LIST", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundListOpcode },
- /*0x23D*/ { "SMSG_BATTLEFIELD_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x23E*/ { "CMSG_BATTLEFIELD_JOIN", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x23F*/ { "SMSG_BATTLEFIELD_WIN_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x240*/ { "SMSG_BATTLEFIELD_LOSE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x241*/ { "CMSG_TAXICLEARNODE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x242*/ { "CMSG_TAXIENABLENODE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x243*/ { "CMSG_ITEM_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleItemTextQuery },
- /*0x244*/ { "SMSG_ITEM_TEXT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x245*/ { "CMSG_MAIL_TAKE_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleTakeMoney },
- /*0x246*/ { "CMSG_MAIL_TAKE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleTakeItem },
- /*0x247*/ { "CMSG_MAIL_MARK_AS_READ", STATUS_LOGGEDIN, &WorldSession::HandleMarkAsRead },
- /*0x248*/ { "CMSG_MAIL_RETURN_TO_SENDER", STATUS_LOGGEDIN, &WorldSession::HandleReturnToSender },
- /*0x249*/ { "CMSG_MAIL_DELETE", STATUS_LOGGEDIN, &WorldSession::HandleMailDelete },
- /*0x24A*/ { "CMSG_MAIL_CREATE_TEXT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleMailCreateTextItem },
- /*0x24B*/ { "SMSG_SPELLLOGMISS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x24C*/ { "SMSG_SPELLLOGEXECUTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x24D*/ { "SMSG_DEBUGAURAPROC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x24E*/ { "SMSG_PERIODICAURALOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x24F*/ { "SMSG_SPELLDAMAGESHIELD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x250*/ { "SMSG_SPELLNONMELEEDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x251*/ { "CMSG_LEARN_TALENT", STATUS_LOGGEDIN, &WorldSession::HandleLearnTalentOpcode },
- /*0x252*/ { "SMSG_RESURRECT_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x253*/ { "CMSG_TOGGLE_PVP", STATUS_LOGGEDIN, &WorldSession::HandleTogglePvP },
- /*0x254*/ { "SMSG_ZONE_UNDER_ATTACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x255*/ { "MSG_AUCTION_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleAuctionHelloOpcode },
- /*0x256*/ { "CMSG_AUCTION_SELL_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAuctionSellItem },
- /*0x257*/ { "CMSG_AUCTION_REMOVE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAuctionRemoveItem },
- /*0x258*/ { "CMSG_AUCTION_LIST_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListItems },
- /*0x259*/ { "CMSG_AUCTION_LIST_OWNER_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListOwnerItems },
- /*0x25A*/ { "CMSG_AUCTION_PLACE_BID", STATUS_LOGGEDIN, &WorldSession::HandleAuctionPlaceBid },
- /*0x25B*/ { "SMSG_AUCTION_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x25C*/ { "SMSG_AUCTION_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x25D*/ { "SMSG_AUCTION_OWNER_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x25E*/ { "SMSG_AUCTION_BIDDER_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x25F*/ { "SMSG_AUCTION_OWNER_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x260*/ { "SMSG_PROCRESIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x261*/ { "SMSG_STANDSTATE_CHANGE_FAILURE_OBSOLETE",STATUS_NEVER,&WorldSession::Handle_ServerSide },
- /*0x262*/ { "SMSG_DISPEL_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x263*/ { "SMSG_SPELLORDAMAGE_IMMUNE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x264*/ { "CMSG_AUCTION_LIST_BIDDER_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListBidderItems },
- /*0x265*/ { "SMSG_AUCTION_BIDDER_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x266*/ { "SMSG_SET_FLAT_SPELL_MODIFIER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x267*/ { "SMSG_SET_PCT_SPELL_MODIFIER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x268*/ { "CMSG_SET_AMMO", STATUS_LOGGEDIN, &WorldSession::HandleSetAmmoOpcode },
- /*0x269*/ { "SMSG_CORPSE_RECLAIM_DELAY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x26A*/ { "CMSG_SET_ACTIVE_MOVER", STATUS_LOGGEDIN, &WorldSession::HandleSetActiveMoverOpcode },
- /*0x26B*/ { "CMSG_PET_CANCEL_AURA", STATUS_LOGGEDIN, &WorldSession::HandlePetCancelAuraOpcode },
- /*0x26C*/ { "CMSG_PLAYER_AI_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x26D*/ { "CMSG_CANCEL_AUTO_REPEAT_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleCancelAutoRepeatSpellOpcode},
- /*0x26E*/ { "MSG_GM_ACCOUNT_ONLINE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x26F*/ { "MSG_LIST_STABLED_PETS", STATUS_LOGGEDIN, &WorldSession::HandleListStabledPetsOpcode },
- /*0x270*/ { "CMSG_STABLE_PET", STATUS_LOGGEDIN, &WorldSession::HandleStablePet },
- /*0x271*/ { "CMSG_UNSTABLE_PET", STATUS_LOGGEDIN, &WorldSession::HandleUnstablePet },
- /*0x272*/ { "CMSG_BUY_STABLE_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyStableSlot },
- /*0x273*/ { "SMSG_STABLE_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x274*/ { "CMSG_STABLE_REVIVE_PET", STATUS_LOGGEDIN, &WorldSession::HandleStableRevivePet },
- /*0x275*/ { "CMSG_STABLE_SWAP_PET", STATUS_LOGGEDIN, &WorldSession::HandleStableSwapPet },
- /*0x276*/ { "MSG_QUEST_PUSH_RESULT", STATUS_LOGGEDIN, &WorldSession::HandleQuestPushResult },
- /*0x277*/ { "SMSG_PLAY_MUSIC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x278*/ { "SMSG_PLAY_OBJECT_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x279*/ { "CMSG_REQUEST_PET_INFO", STATUS_LOGGEDIN, &WorldSession::HandleRequestPetInfoOpcode },
- /*0x27A*/ { "CMSG_FAR_SIGHT", STATUS_LOGGEDIN, &WorldSession::HandleFarSightOpcode },
- /*0x27B*/ { "SMSG_SPELLDISPELLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x27C*/ { "SMSG_DAMAGE_CALC_LOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x27D*/ { "CMSG_ENABLE_DAMAGE_LOG", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x27E*/ { "CMSG_GROUP_CHANGE_SUB_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleGroupChangeSubGroupOpcode },
- /*0x27F*/ { "CMSG_REQUEST_PARTY_MEMBER_STATS", STATUS_LOGGEDIN, &WorldSession::HandleRequestPartyMemberStatsOpcode},
- /*0x280*/ { "CMSG_GROUP_SWAP_SUB_GROUP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x281*/ { "CMSG_RESET_FACTION_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x282*/ { "CMSG_AUTOSTORE_BANK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoStoreBankItemOpcode },
- /*0x283*/ { "CMSG_AUTOBANK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoBankItemOpcode },
- /*0x284*/ { "MSG_QUERY_NEXT_MAIL_TIME", STATUS_LOGGEDIN, &WorldSession::HandleMsgQueryNextMailtime },
- /*0x285*/ { "SMSG_RECEIVED_MAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x286*/ { "SMSG_RAID_GROUP_ONLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x287*/ { "CMSG_SET_DURABILITY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x288*/ { "CMSG_SET_PVP_RANK_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x289*/ { "CMSG_ADD_PVP_MEDAL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x28A*/ { "CMSG_DEL_PVP_MEDAL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x28B*/ { "CMSG_SET_PVP_TITLE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x28C*/ { "SMSG_PVP_CREDIT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x28D*/ { "SMSG_AUCTION_REMOVED_NOTIFICATION",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x28E*/ { "CMSG_GROUP_RAID_CONVERT", STATUS_LOGGEDIN, &WorldSession::HandleRaidConvertOpcode },
- /*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGroupAssistantOpcode },
- /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleBuybackItem },
- /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x292*/ { "CMSG_MEETINGSTONE_JOIN", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x293*/ { "CMSG_MEETINGSTONE_LEAVE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x296*/ { "CMSG_MEETINGSTONE_INFO", STATUS_LOGGEDIN, &WorldSession::HandleMeetingStoneInfo },
- /*0x297*/ { "SMSG_MEETINGSTONE_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x298*/ { "SMSG_MEETINGSTONE_IN_PROGRESS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x299*/ { "SMSG_MEETINGSTONE_MEMBER_ADDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x29A*/ { "CMSG_GMTICKETSYSTEM_TOGGLE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x29B*/ { "CMSG_CANCEL_GROWTH_AURA", STATUS_LOGGEDIN, &WorldSession::HandleCancelGrowthAuraOpcode },
- /*0x29C*/ { "SMSG_CANCEL_AUTO_REPEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x29D*/ { "SMSG_STANDSTATE_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x29E*/ { "SMSG_LOOT_ALL_PASSED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x29F*/ { "SMSG_LOOT_ROLL_WON", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A0*/ { "CMSG_LOOT_ROLL", STATUS_LOGGEDIN, &WorldSession::HandleLootRoll },
- /*0x2A1*/ { "SMSG_LOOT_START_ROLL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A2*/ { "SMSG_LOOT_ROLL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A3*/ { "CMSG_LOOT_MASTER_GIVE", STATUS_LOGGEDIN, &WorldSession::HandleLootMasterGiveOpcode },
- /*0x2A4*/ { "SMSG_LOOT_MASTER_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A5*/ { "SMSG_SET_FORCED_REACTIONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A6*/ { "SMSG_SPELL_FAILED_OTHER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A7*/ { "SMSG_GAMEOBJECT_RESET_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2A8*/ { "CMSG_REPAIR_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleRepairItemOpcode },
- /*0x2A9*/ { "SMSG_CHAT_PLAYER_NOT_FOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2AA*/ { "MSG_TALENT_WIPE_CONFIRM", STATUS_LOGGEDIN, &WorldSession::HandleTalentWipeOpcode },
- /*0x2AB*/ { "SMSG_SUMMON_REQUEST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2AC*/ { "CMSG_SUMMON_RESPONSE", STATUS_LOGGEDIN, &WorldSession::HandleSummonResponseOpcode },
- /*0x2AD*/ { "MSG_MOVE_TOGGLE_GRAVITY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2AE*/ { "SMSG_MONSTER_MOVE_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2AF*/ { "SMSG_PET_BROKEN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2B0*/ { "MSG_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2B1*/ { "MSG_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2B2*/ { "CMSG_SERVER_BROADCAST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2B3*/ { "CMSG_SELF_RES", STATUS_LOGGEDIN, &WorldSession::HandleSelfResOpcode },
- /*0x2B4*/ { "SMSG_FEIGN_DEATH_RESISTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2B5*/ { "CMSG_RUN_SCRIPT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2B6*/ { "SMSG_SCRIPT_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2B7*/ { "SMSG_DUEL_COUNTDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2B8*/ { "SMSG_AREA_TRIGGER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2B9*/ { "CMSG_TOGGLE_HELM", STATUS_LOGGEDIN, &WorldSession::HandleToggleHelmOpcode },
- /*0x2BA*/ { "CMSG_TOGGLE_CLOAK", STATUS_LOGGEDIN, &WorldSession::HandleToggleCloakOpcode },
- /*0x2BB*/ { "SMSG_MEETINGSTONE_JOINFAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2BC*/ { "SMSG_PLAYER_SKINNED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2BD*/ { "SMSG_DURABILITY_DAMAGE_DEATH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2BE*/ { "CMSG_SET_EXPLORATION", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2BF*/ { "CMSG_SET_ACTIONBAR_TOGGLES", STATUS_AUTHED, &WorldSession::HandleSetActionBar },
- /*0x2C0*/ { "UMSG_DELETE_GUILD_CHARTER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2C1*/ { "MSG_PETITION_RENAME", STATUS_LOGGEDIN, &WorldSession::HandlePetitionRenameOpcode },
- /*0x2C2*/ { "SMSG_INIT_WORLD_STATES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2C3*/ { "SMSG_UPDATE_WORLD_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2C4*/ { "CMSG_ITEM_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleItemNameQueryOpcode },
- /*0x2C5*/ { "SMSG_ITEM_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2C6*/ { "SMSG_PET_ACTION_FEEDBACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2C7*/ { "CMSG_CHAR_RENAME", STATUS_AUTHED, &WorldSession::HandleChangePlayerNameOpcode },
- /*0x2C8*/ { "SMSG_CHAR_RENAME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2C9*/ { "CMSG_MOVE_SPLINE_DONE", STATUS_LOGGEDIN, &WorldSession::HandleTaxiNextDestinationOpcode },
- /*0x2CA*/ { "CMSG_MOVE_FALL_RESET", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x2CB*/ { "SMSG_INSTANCE_SAVE_CREATED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2CC*/ { "SMSG_RAID_INSTANCE_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2CD*/ { "CMSG_REQUEST_RAID_INFO", STATUS_LOGGEDIN, &WorldSession::HandleRequestRaidInfoOpcode },
- /*0x2CE*/ { "CMSG_MOVE_TIME_SKIPPED", STATUS_LOGGEDIN, &WorldSession::HandleMoveTimeSkippedOpcode },
- /*0x2CF*/ { "CMSG_MOVE_FEATHER_FALL_ACK", STATUS_LOGGEDIN, &WorldSession::HandleFeatherFallAck },
- /*0x2D0*/ { "CMSG_MOVE_WATER_WALK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveWaterWalkAck },
- /*0x2D1*/ { "CMSG_MOVE_NOT_ACTIVE_MOVER", STATUS_LOGGEDIN, &WorldSession::HandleNotActiveMoverOpcode },
- /*0x2D2*/ { "SMSG_PLAY_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2D3*/ { "CMSG_BATTLEFIELD_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleBattlefieldStatusOpcode },
- /*0x2D4*/ { "SMSG_BATTLEFIELD_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2D5*/ { "CMSG_BATTLEFIELD_PORT", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPlayerPortOpcode},
- /*0x2D6*/ { "MSG_INSPECT_HONOR_STATS", STATUS_LOGGEDIN, &WorldSession::HandleInspectHonorStatsOpcode },
- /*0x2D7*/ { "CMSG_BATTLEMASTER_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundHelloOpcode },
- /*0x2D8*/ { "CMSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2D9*/ { "CMSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2DA*/ { "SMSG_FORCE_WALK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2DB*/ { "CMSG_FORCE_WALK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
- /*0x2DC*/ { "SMSG_FORCE_SWIM_BACK_SPEED_CHANGE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2DD*/ { "CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK",STATUS_LOGGEDIN,&WorldSession::HandleForceSpeedChangeAck },
- /*0x2DE*/ { "SMSG_FORCE_TURN_RATE_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2DF*/ { "CMSG_FORCE_TURN_RATE_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
- /*0x2E0*/ { "MSG_PVP_LOG_DATA", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPVPlogdataOpcode},
- /*0x2E1*/ { "CMSG_LEAVE_BATTLEFIELD", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundLeaveOpcode },
- /*0x2E2*/ { "CMSG_AREA_SPIRIT_HEALER_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleAreaSpiritHealerQueryOpcode},
- /*0x2E3*/ { "CMSG_AREA_SPIRIT_HEALER_QUEUE", STATUS_LOGGEDIN, &WorldSession::HandleAreaSpiritHealerQueueOpcode},
- /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2E5*/ { "CMSG_GM_UNTEACH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2E6*/ { "SMSG_WARDEN_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_LOGGEDIN, &WorldSession::HandleWardenDataOpcode },
- /*0x2E8*/ { "SMSG_GROUP_JOINED_BATTLEGROUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2E9*/ { "MSG_BATTLEGROUND_PLAYER_POSITIONS",STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPlayerPositionsOpcode},
- /*0x2EA*/ { "CMSG_PET_STOP_ATTACK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2EB*/ { "SMSG_BINDER_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2EC*/ { "SMSG_BATTLEGROUND_PLAYER_JOINED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2ED*/ { "SMSG_BATTLEGROUND_PLAYER_LEFT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2EE*/ { "CMSG_BATTLEMASTER_JOIN", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundJoinOpcode },
- /*0x2EF*/ { "SMSG_ADDON_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F0*/ { "CMSG_PET_UNLEARN", STATUS_LOGGEDIN, &WorldSession::HandlePetUnlearnOpcode },
- /*0x2F1*/ { "SMSG_PET_UNLEARN_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F2*/ { "SMSG_PARTY_MEMBER_STATS_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F3*/ { "CMSG_PET_SPELL_AUTOCAST", STATUS_LOGGEDIN, &WorldSession::HandlePetSpellAutocastOpcode },
- /*0x2F4*/ { "SMSG_WEATHER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F5*/ { "SMSG_PLAY_TIME_WARNING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F6*/ { "SMSG_MINIGAME_SETUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F7*/ { "SMSG_MINIGAME_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2F8*/ { "CMSG_MINIGAME_MOVE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x2F9*/ { "SMSG_MINIGAME_MOVE_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2FA*/ { "SMSG_RAID_INSTANCE_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2FB*/ { "SMSG_COMPRESSED_MOVES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2FC*/ { "CMSG_GUILD_INFO_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildChangeInfoOpcode },
- /*0x2FD*/ { "SMSG_CHAT_RESTRICTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2FE*/ { "SMSG_SPLINE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x2FF*/ { "SMSG_SPLINE_SET_RUN_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x300*/ { "SMSG_SPLINE_SET_SWIM_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x301*/ { "SMSG_SPLINE_SET_WALK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x302*/ { "SMSG_SPLINE_SET_SWIM_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x303*/ { "SMSG_SPLINE_SET_TURN_RATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x304*/ { "SMSG_SPLINE_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x305*/ { "SMSG_SPLINE_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x306*/ { "SMSG_SPLINE_MOVE_NORMAL_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x307*/ { "SMSG_SPLINE_MOVE_SET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x308*/ { "SMSG_SPLINE_MOVE_UNSET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x309*/ { "SMSG_SPLINE_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30A*/ { "SMSG_SPLINE_MOVE_LAND_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30B*/ { "SMSG_SPLINE_MOVE_START_SWIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30C*/ { "SMSG_SPLINE_MOVE_STOP_SWIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30D*/ { "SMSG_SPLINE_MOVE_SET_RUN_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30E*/ { "SMSG_SPLINE_MOVE_SET_WALK_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x30F*/ { "CMSG_GM_NUKE_ACCOUNT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x310*/ { "MSG_GM_DESTROY_CORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x311*/ { "CMSG_GM_DESTROY_ONLINE_CORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x312*/ { "CMSG_ACTIVATETAXIEXPRESS", STATUS_LOGGEDIN, &WorldSession::HandleActivateTaxiFarOpcode },
- /*0x313*/ { "SMSG_SET_FACTION_ATWAR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x314*/ { "SMSG_GAMETIMEBIAS_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x315*/ { "CMSG_DEBUG_ACTIONS_START", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x316*/ { "CMSG_DEBUG_ACTIONS_STOP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x317*/ { "CMSG_SET_FACTION_INACTIVE", STATUS_LOGGEDIN, &WorldSession::HandleSetWatchedFactionInactiveOpcode},
- /*0x318*/ { "CMSG_SET_WATCHED_FACTION", STATUS_LOGGEDIN, &WorldSession::HandleSetWatchedFactionIndexOpcode},
- /*0x319*/ { "MSG_MOVE_TIME_SKIPPED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x31A*/ { "SMSG_SPLINE_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x31B*/ { "CMSG_SET_EXPLORATION_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x31C*/ { "SMSG_INVALIDATE_PLAYER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x31D*/ { "CMSG_RESET_INSTANCES", STATUS_LOGGEDIN, &WorldSession::HandleResetInstancesOpcode },
- /*0x31E*/ { "SMSG_INSTANCE_RESET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x31F*/ { "SMSG_INSTANCE_RESET_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x320*/ { "SMSG_UPDATE_LAST_INSTANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x321*/ { "MSG_RAID_TARGET_UPDATE", STATUS_LOGGEDIN, &WorldSession::HandleRaidIconTargetOpcode },
- /*0x322*/ { "MSG_RAID_READY_CHECK", STATUS_LOGGEDIN, &WorldSession::HandleRaidReadyCheckOpcode },
- /*0x323*/ { "CMSG_LUA_USAGE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x324*/ { "SMSG_PET_ACTION_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x325*/ { "SMSG_PET_DISMISS_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x326*/ { "SMSG_GHOSTEE_GONE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x327*/ { "CMSG_GM_UPDATE_TICKET_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x328*/ { "SMSG_GM_TICKET_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x329*/ { "MSG_SET_DUNGEON_DIFFICULTY", STATUS_LOGGEDIN, &WorldSession::HandleDungeonDifficultyOpcode },
- /*0x32A*/ { "CMSG_GMSURVEY_SUBMIT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL },//&WorldSession::HandleGMSurveySubmit
- /*0x32B*/ { "SMSG_UPDATE_INSTANCE_OWNERSHIP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x32C*/ { "CMSG_IGNORE_KNOCKBACK_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x32D*/ { "SMSG_CHAT_PLAYER_AMBIGUOUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x32E*/ { "MSG_DELAY_GHOST_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x32F*/ { "SMSG_SPELLINSTAKILLLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x330*/ { "SMSG_SPELL_UPDATE_CHAIN_TARGETS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x331*/ { "CMSG_CHAT_FILTERED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x332*/ { "SMSG_EXPECTED_SPAM_RECORDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x333*/ { "SMSG_SPELLSTEALLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x334*/ { "CMSG_LOTTERY_QUERY_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x335*/ { "SMSG_LOTTERY_QUERY_RESULT_OBSOLETE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x336*/ { "CMSG_BUY_LOTTERY_TICKET_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x337*/ { "SMSG_LOTTERY_RESULT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x338*/ { "SMSG_CHARACTER_PROFILE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x339*/ { "SMSG_CHARACTER_PROFILE_REALM_CONNECTED",STATUS_NEVER,&WorldSession::Handle_ServerSide },
- /*0x33A*/ { "SMSG_DEFENSE_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x33B*/ { "SMSG_INSTANCE_DIFFICULTY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x33C*/ { "MSG_GM_RESETINSTANCELIMIT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x33D*/ { "SMSG_MOTD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x33E*/ { "SMSG_MOVE_SET_FLIGHT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x33F*/ { "SMSG_MOVE_UNSET_FLIGHT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x340*/ { "CMSG_MOVE_FLIGHT_ACK_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x341*/ { "MSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x342*/ { "MSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x343*/ { "SMSG_MOVE_SET_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x344*/ { "SMSG_MOVE_UNSET_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x345*/ { "CMSG_MOVE_SET_CAN_FLY_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveFlyModeChangeAckOpcode},
- /*0x346*/ { "CMSG_MOVE_SET_FLY", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x347*/ { "CMSG_SOCKET_GEMS", STATUS_LOGGEDIN, &WorldSession::HandleSocketOpcode },
- /*0x348*/ { "CMSG_ARENA_TEAM_CREATE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x349*/ { "SMSG_ARENA_TEAM_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x34A*/ { "UMSG_UPDATE_ARENA_TEAM_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x34B*/ { "CMSG_ARENA_TEAM_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamQueryOpcode },
- /*0x34C*/ { "SMSG_ARENA_TEAM_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x34D*/ { "CMSG_ARENA_TEAM_ROSTER", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamRosterOpcode },
- /*0x34E*/ { "SMSG_ARENA_TEAM_ROSTER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x34F*/ { "CMSG_ARENA_TEAM_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamAddMemberOpcode },
- /*0x350*/ { "SMSG_ARENA_TEAM_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x351*/ { "CMSG_ARENA_TEAM_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamInviteAcceptOpcode},
- /*0x352*/ { "CMSG_ARENA_TEAM_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamInviteDeclineOpcode},
- /*0x353*/ { "CMSG_ARENA_TEAM_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamLeaveOpcode },
- /*0x354*/ { "CMSG_ARENA_TEAM_REMOVE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamRemoveFromTeamOpcode},
- /*0x355*/ { "CMSG_ARENA_TEAM_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamDisbandOpcode },
- /*0x356*/ { "CMSG_ARENA_TEAM_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamPromoteToCaptainOpcode},
- /*0x357*/ { "SMSG_ARENA_TEAM_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x358*/ { "CMSG_BATTLEMASTER_JOIN_ARENA", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundArenaJoin },
- /*0x359*/ { "MSG_MOVE_START_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x35A*/ { "MSG_MOVE_STOP_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x35B*/ { "SMSG_ARENA_TEAM_STATS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x35C*/ { "CMSG_LFG_SET_AUTOJOIN", STATUS_AUTHED, &WorldSession::HandleLfgAutoJoinOpcode },
- /*0x35D*/ { "CMSG_LFG_CLEAR_AUTOJOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfgCancelAutoJoinOpcode },
- /*0x35E*/ { "CMSG_LFM_SET_AUTOFILL", STATUS_AUTHED, &WorldSession::HandleLfmAutoAddMembersOpcode },
- /*0x35F*/ { "CMSG_LFM_CLEAR_AUTOFILL", STATUS_LOGGEDIN, &WorldSession::HandleLfmCancelAutoAddmembersOpcode},
- /*0x360*/ { "CMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x361*/ { "CMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x362*/ { "CMSG_CANCEL_PENDING_LFG", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x363*/ { "CMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearOpcode },
- /*0x364*/ { "CMSG_CLEAR_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetNoneOpcode },
- /*0x365*/ { "CMSG_SET_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetOpcode },
- /*0x366*/ { "CMSG_SET_LFG_COMMENT", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetCommentOpcode },
- /*0x367*/ { "SMSG_LFG_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x368*/ { "SMSG_LFG_OTHER_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x369*/ { "SMSG_LFG_AUTOJOIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36A*/ { "SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36B*/ { "SMSG_LFG_LEADER_IS_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36C*/ { "SMSG_LFG_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36D*/ { "SMSG_LFG_UPDATE_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36E*/ { "SMSG_LFG_UPDATE_LFG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x36F*/ { "SMSG_LFG_UPDATE_QUEUED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x370*/ { "SMSG_LFG_PENDING_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x371*/ { "SMSG_LFG_PENDING_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x372*/ { "SMSG_LFG_PENDING_MATCH_DONE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, &WorldSession::HandleChooseTitleOpcode },
- /*0x375*/ { "CMSG_CANCEL_MOUNT_AURA", STATUS_LOGGEDIN, &WorldSession::HandleDismountOpcode },
- /*0x376*/ { "SMSG_ARENA_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x377*/ { "MSG_INSPECT_ARENA_TEAMS", STATUS_LOGGEDIN, &WorldSession::HandleInspectArenaStatsOpcode },
- /*0x378*/ { "SMSG_DEATH_RELEASE_LOC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x379*/ { "CMSG_CANCEL_TEMP_ENCHANTMENT", STATUS_LOGGEDIN, &WorldSession::HandleCancelTempItemEnchantmentOpcode},
- /*0x37A*/ { "SMSG_FORCED_DEATH_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x37B*/ { "CMSG_CHEAT_SET_HONOR_CURRENCY", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x37C*/ { "CMSG_CHEAT_SET_ARENA_CURRENCY", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x37D*/ { "MSG_MOVE_SET_FLIGHT_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x37E*/ { "MSG_MOVE_SET_FLIGHT_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x37F*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT",STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x380*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x381*/ { "SMSG_FORCE_FLIGHT_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x382*/ { "CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK",STATUS_LOGGEDIN,&WorldSession::HandleForceSpeedChangeAck },
- /*0x383*/ { "SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x384*/ { "CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK",STATUS_LOGGEDIN,&WorldSession::HandleForceSpeedChangeAck },
- /*0x385*/ { "SMSG_SPLINE_SET_FLIGHT_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x386*/ { "SMSG_SPLINE_SET_FLIGHT_BACK_SPEED",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x387*/ { "CMSG_MAELSTROM_INVALIDATE_CACHE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x388*/ { "SMSG_FLIGHT_SPLINE_SYNC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x389*/ { "CMSG_SET_TAXI_BENCHMARK_MODE", STATUS_AUTHED, &WorldSession::HandleSetTaxiBenchmarkOpcode },
- /*0x38A*/ { "SMSG_JOINED_BATTLEGROUND_QUEUE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x38B*/ { "SMSG_REALM_SPLIT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x38C*/ { "CMSG_REALM_SPLIT", STATUS_AUTHED, &WorldSession::HandleRealmStateRequestOpcode },
- /*0x38D*/ { "CMSG_MOVE_CHNG_TRANSPORT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x38E*/ { "MSG_PARTY_ASSIGNMENT", STATUS_LOGGEDIN, &WorldSession::HandleGroupPromoteOpcode },
- /*0x38F*/ { "SMSG_OFFER_PETITION_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x390*/ { "SMSG_TIME_SYNC_REQ", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x391*/ { "CMSG_TIME_SYNC_RESP", STATUS_LOGGEDIN, &WorldSession::HandleAllowMoveAckOpcode },
- /*0x392*/ { "CMSG_SEND_LOCAL_EVENT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x393*/ { "CMSG_SEND_GENERAL_TRIGGER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x394*/ { "CMSG_SEND_COMBAT_TRIGGER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x395*/ { "CMSG_MAELSTROM_GM_SENT_MAIL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x396*/ { "SMSG_RESET_FAILED_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x397*/ { "SMSG_REAL_GROUP_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x398*/ { "SMSG_LFG_DISABLED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x399*/ { "CMSG_ACTIVE_PVP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x39A*/ { "CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x39B*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE",STATUS_NEVER,&WorldSession::Handle_ServerSide },
- /*0x39C*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE",STATUS_NEVER,&WorldSession::Handle_ServerSide},
- /*0x39D*/ { "SMSG_UPDATE_COMBO_POINTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x39E*/ { "SMSG_VOICE_SESSION_ROSTER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x39F*/ { "SMSG_VOICE_SESSION_LEAVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A0*/ { "SMSG_VOICE_SESSION_ADJUST_PRIORITY",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A1*/ { "CMSG_VOICE_SET_TALKER_MUTED_REQUEST",STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3A2*/ { "SMSG_VOICE_SET_TALKER_MUTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A3*/ { "SMSG_INIT_EXTRA_AURA_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A4*/ { "SMSG_SET_EXTRA_AURA_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A5*/ { "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A6*/ { "SMSG_CLEAR_EXTRA_AURA_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3A7*/ { "MSG_MOVE_START_DESCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
- /*0x3A8*/ { "CMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3A9*/ { "SMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3AA*/ { "SMSG_SPELL_CHANCE_PROC_LOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3AB*/ { "CMSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3AC*/ { "SMSG_DISMOUNT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3AD*/ { "MSG_MOVE_UPDATE_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3AE*/ { "MSG_RAID_READY_CHECK_CONFIRM", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3AF*/ { "CMSG_VOICE_SESSION_ENABLE", STATUS_AUTHED, &WorldSession::HandleVoiceSettingsOpcode },
- /*0x3B0*/ { "SMSG_VOICE_PARENTAL_CONTROLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3B1*/ { "CMSG_GM_WHISPER", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3B2*/ { "SMSG_GM_MESSAGECHAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3B3*/ { "MSG_GM_GEARRATING", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3B4*/ { "CMSG_COMMENTATOR_ENABLE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3B5*/ { "SMSG_COMMENTATOR_STATE_CHANGED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3B6*/ { "CMSG_COMMENTATOR_GET_MAP_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3B7*/ { "SMSG_COMMENTATOR_MAP_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3B8*/ { "CMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3B9*/ { "SMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3BA*/ { "SMSG_COMMENTATOR_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3BB*/ { "CMSG_COMMENTATOR_ENTER_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3BC*/ { "CMSG_COMMENTATOR_EXIT_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3BD*/ { "CMSG_COMMENTATOR_INSTANCE_COMMAND",STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3BE*/ { "SMSG_CLEAR_TARGET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3BF*/ { "CMSG_BOT_DETECTED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3C0*/ { "SMSG_CROSSED_INEBRIATION_THRESHOLD",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3C1*/ { "CMSG_CHEAT_PLAYER_LOGIN", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3C2*/ { "CMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3C3*/ { "SMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3C4*/ { "SMSG_KICK_REASON", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3C5*/ { "MSG_RAID_READY_CHECK_FINISHED", STATUS_LOGGEDIN, &WorldSession::HandleRaidReadyCheckFinishOpcode},
- /*0x3C6*/ { "CMSG_COMPLAIN", STATUS_LOGGEDIN, &WorldSession::HandleReportSpamOpcode },
- /*0x3C7*/ { "SMSG_COMPLAIN_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3C8*/ { "SMSG_FEATURE_SYSTEM_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3C9*/ { "CMSG_GM_SHOW_COMPLAINTS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CA*/ { "CMSG_GM_UNSQUELCH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CB*/ { "CMSG_CHANNEL_SILENCE_VOICE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CC*/ { "CMSG_CHANNEL_SILENCE_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CD*/ { "CMSG_CHANNEL_UNSILENCE_VOICE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CE*/ { "CMSG_CHANNEL_UNSILENCE_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3CF*/ { "CMSG_TARGET_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3D0*/ { "CMSG_TARGET_SCRIPT_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3D1*/ { "CMSG_CHANNEL_DISPLAY_LIST", STATUS_LOGGEDIN, &WorldSession::HandleChannelRosterQuery },
- /*0x3D2*/ { "CMSG_SET_ACTIVE_VOICE_CHANNEL", STATUS_AUTHED, &WorldSession::HandleChannelVoiceChatQuery },
- /*0x3D3*/ { "CMSG_GET_CHANNEL_MEMBER_COUNT", STATUS_LOGGEDIN, &WorldSession::HandleChannelInfoQuery },
- /*0x3D4*/ { "SMSG_CHANNEL_MEMBER_COUNT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3D5*/ { "CMSG_CHANNEL_VOICE_ON", STATUS_LOGGEDIN, &WorldSession::HandleChannelEnableVoiceOpcode },
- /*0x3D6*/ { "CMSG_CHANNEL_VOICE_OFF", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3D7*/ { "CMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3D8*/ { "SMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3D9*/ { "SMSG_AVAILABLE_VOICE_CHANNEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3DA*/ { "CMSG_ADD_VOICE_IGNORE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3DB*/ { "CMSG_DEL_VOICE_IGNORE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3DC*/ { "CMSG_PARTY_SILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3DD*/ { "CMSG_PARTY_UNSILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3DE*/ { "MSG_NOTIFY_PARTY_SQUELCH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3DF*/ { "SMSG_COMSAT_RECONNECT_TRY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3E0*/ { "SMSG_COMSAT_DISCONNECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3E1*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3E2*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3E3*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundReportAFK },
- /*0x3E4*/ { "CMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3E5*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQuery },
- /*0x3E6*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankTabColon },
- /*0x3E7*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3E8*/ { "CMSG_GUILD_BANK_SWAP_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankDepositItem },
- /*0x3E9*/ { "CMSG_GUILD_BANK_BUY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankBuyTab },
- /*0x3EA*/ { "CMSG_GUILD_BANK_UPDATE_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankModifyTab },
- /*0x3EB*/ { "CMSG_GUILD_BANK_DEPOSIT_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankDeposit },
- /*0x3EC*/ { "CMSG_GUILD_BANK_WITHDRAW_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankWithdraw },
- /*0x3ED*/ { "MSG_GUILD_BANK_LOG_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankLog },
- /*0x3EE*/ { "CMSG_SET_CHANNEL_WATCH", STATUS_LOGGEDIN, &WorldSession::HandleChannelJoinNotify },
- /*0x3EF*/ { "SMSG_USERLIST_ADD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F0*/ { "SMSG_USERLIST_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F1*/ { "SMSG_USERLIST_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F2*/ { "CMSG_CLEAR_CHANNEL_WATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3F3*/ { "SMSG_INSPECT_TALENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F4*/ { "SMSG_GOGOGO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F5*/ { "SMSG_ECHO_PARTY_SQUELCH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F6*/ { "CMSG_SET_TITLE_SUFFIX", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3F7*/ { "CMSG_SPELLCLICK", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3F8*/ { "SMSG_LOOT_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3F9*/ { "CMSG_GM_CHARACTER_RESTORE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3FA*/ { "CMSG_GM_CHARACTER_SAVE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x3FB*/ { "SMSG_VOICESESSION_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x3FC*/ { "MSG_GUILD_PERMISSIONS", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankGetRights },
- /*0x3FD*/ { "MSG_GUILD_BANK_MONEY_WITHDRAWN", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankGetMoneyAmount },
- /*0x3FE*/ { "MSG_GUILD_EVENT_LOG_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGuildEventLogOpcode },
- /*0x3FF*/ { "CMSG_MAELSTROM_RENAME_GUILD", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x400*/ { "CMSG_GET_MIRRORIMAGE_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x401*/ { "SMSG_MIRRORIMAGE_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x402*/ { "SMSG_FORCE_DISPLAY_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x403*/ { "SMSG_SPELL_CHANCE_RESIST_PUSHBACK",STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x404*/ { "CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT",STATUS_NEVER,&WorldSession::Handle_NULL },
- /*0x405*/ { "SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT",STATUS_NEVER,&WorldSession::Handle_ServerSide },
- /*0x406*/ { "CMSG_KEEP_ALIVE", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
- /*0x407*/ { "SMSG_RAID_READY_CHECK_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x408*/ { "CMSG_OPT_OUT_OF_LOOT", STATUS_AUTHED, &WorldSession::HandleGroupPassOnLootOpcode },
- /*0x409*/ { "MSG_QUERY_GUILD_BANK_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankTabText },
- /*0x40A*/ { "CMSG_SET_GUILD_BANK_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankSetTabText },
- /*0x40B*/ { "CMSG_SET_GRANTABLE_LEVELS", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x40C*/ { "CMSG_GRANT_LEVEL", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x40D*/ { "CMSG_REFER_A_FRIEND", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x40E*/ { "MSG_GM_CHANGE_ARENA_RATING", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x40F*/ { "CMSG_DECLINE_CHANNEL_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleChannelDeclineInvite },
- /*0x410*/ { "CMSG_GROUPACTION_THROTTLED", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x411*/ { "SMSG_OVERRIDE_LIGHT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x412*/ { "SMSG_TOTEM_CREATED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x413*/ { "CMSG_TOTEM_DESTROYED", STATUS_LOGGEDIN, &WorldSession::HandleTotemDestroy },
- /*0x414*/ { "CMSG_EXPIRE_RAID_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x415*/ { "CMSG_NO_SPELL_VARIANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x416*/ { "CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY",STATUS_LOGGEDIN,&WorldSession::HandleQuestgiverStatusQueryMultipleOpcode},
- /*0x417*/ { "SMSG_QUESTGIVER_STATUS_MULTIPLE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x418*/ { "CMSG_SET_PLAYER_DECLINED_NAMES", STATUS_AUTHED, &WorldSession::HandleDeclinedPlayerNameOpcode },
- /*0x419*/ { "SMSG_SET_PLAYER_DECLINED_NAMES_RESULT",STATUS_NEVER,&WorldSession::Handle_ServerSide },
- /*0x41A*/ { "CMSG_QUERY_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x41B*/ { "CMSG_CLEAR_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x41C*/ { "SMSG_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x41D*/ { "SMSG_SEND_UNLEARN_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x41E*/ { "SMSG_PROPOSE_LEVEL_GRANT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x41F*/ { "CMSG_ACCEPT_LEVEL_GRANT", STATUS_NEVER, &WorldSession::Handle_NULL },
- /*0x420*/ { "SMSG_REFER_A_FRIEND_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x421*/ { "SMSG_SPLINE_MOVE_SET_FLYING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x422*/ { "SMSG_SPLINE_MOVE_UNSET_FLYING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
- /*0x423*/ { "SMSG_SUMMON_CANCEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x000*/ { "MSG_NULL_ACTION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x001*/ { "CMSG_BOOTME", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x002*/ { "CMSG_DBLOOKUP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x003*/ { "SMSG_DBLOOKUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x004*/ { "CMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x005*/ { "SMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x006*/ { "CMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x007*/ { "SMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x008*/ { "CMSG_WORLD_TELEPORT", STATUS_LOGGEDIN, &WorldSession::HandleWorldTeleportOpcode },
+ /*0x009*/ { "CMSG_TELEPORT_TO_UNIT", STATUS_LOGGEDIN, &WorldSession::Handle_NULL },
+ /*0x00A*/ { "CMSG_ZONE_MAP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x00B*/ { "SMSG_ZONE_MAP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x00C*/ { "CMSG_DEBUG_CHANGECELLZONE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x00D*/ { "CMSG_MOVE_CHARACTER_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x00E*/ { "SMSG_MOVE_CHARACTER_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x00F*/ { "CMSG_RECHARGE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x010*/ { "CMSG_LEARN_SPELL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x011*/ { "CMSG_CREATEMONSTER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x012*/ { "CMSG_DESTROYMONSTER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x013*/ { "CMSG_CREATEITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x014*/ { "CMSG_CREATEGAMEOBJECT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x015*/ { "SMSG_CHECK_FOR_BOTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x016*/ { "CMSG_MAKEMONSTERATTACKGUID", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x017*/ { "CMSG_BOT_DETECTED2", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x018*/ { "CMSG_FORCEACTION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x019*/ { "CMSG_FORCEACTIONONOTHER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x01A*/ { "CMSG_FORCEACTIONSHOW", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x01B*/ { "SMSG_FORCEACTIONSHOW", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x01C*/ { "CMSG_PETGODMODE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x01D*/ { "SMSG_PETGODMODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x01E*/ { "SMSG_REFER_A_FRIEND_EXPIRED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x01F*/ { "CMSG_WEATHER_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x020*/ { "CMSG_UNDRESSPLAYER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x021*/ { "CMSG_BEASTMASTER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x022*/ { "CMSG_GODMODE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x023*/ { "SMSG_GODMODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x024*/ { "CMSG_CHEAT_SETMONEY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x025*/ { "CMSG_LEVEL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x026*/ { "CMSG_PET_LEVEL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x027*/ { "CMSG_SET_WORLDSTATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x028*/ { "CMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x029*/ { "CMSG_USE_SKILL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02A*/ { "CMSG_FLAG_QUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02B*/ { "CMSG_FLAG_QUEST_FINISH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02C*/ { "CMSG_CLEAR_QUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02D*/ { "CMSG_SEND_EVENT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02E*/ { "CMSG_DEBUG_AISTATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x02F*/ { "SMSG_DEBUG_AISTATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x030*/ { "CMSG_DISABLE_PVP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x031*/ { "CMSG_ADVANCE_SPAWN_TIME", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x032*/ { "SMSG_DESTRUCTIBLE_BUILDING_DAMAGE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x033*/ { "CMSG_AUTH_SRP6_BEGIN", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x034*/ { "CMSG_AUTH_SRP6_PROOF", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x035*/ { "CMSG_AUTH_SRP6_RECODE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x036*/ { "CMSG_CHAR_CREATE", STATUS_AUTHED, &WorldSession::HandleCharCreateOpcode },
+ /*0x037*/ { "CMSG_CHAR_ENUM", STATUS_AUTHED, &WorldSession::HandleCharEnumOpcode },
+ /*0x038*/ { "CMSG_CHAR_DELETE", STATUS_AUTHED, &WorldSession::HandleCharDeleteOpcode },
+ /*0x039*/ { "SMSG_AUTH_SRP6_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x03A*/ { "SMSG_CHAR_CREATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x03B*/ { "SMSG_CHAR_ENUM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x03C*/ { "SMSG_CHAR_DELETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x03D*/ { "CMSG_PLAYER_LOGIN", STATUS_AUTHED, &WorldSession::HandlePlayerLoginOpcode },
+ /*0x03E*/ { "SMSG_NEW_WORLD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x03F*/ { "SMSG_TRANSFER_PENDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x040*/ { "SMSG_TRANSFER_ABORTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x041*/ { "SMSG_CHARACTER_LOGIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x042*/ { "SMSG_LOGIN_SETTIMESPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x043*/ { "SMSG_GAMETIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x044*/ { "CMSG_GAMETIME_SET", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x045*/ { "SMSG_GAMETIME_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x046*/ { "CMSG_GAMESPEED_SET", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x047*/ { "SMSG_GAMESPEED_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x048*/ { "CMSG_SERVERTIME", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x049*/ { "SMSG_SERVERTIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x04A*/ { "CMSG_PLAYER_LOGOUT", STATUS_LOGGEDIN, &WorldSession::HandlePlayerLogoutOpcode },
+ /*0x04B*/ { "CMSG_LOGOUT_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleLogoutRequestOpcode },
+ /*0x04C*/ { "SMSG_LOGOUT_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x04D*/ { "SMSG_LOGOUT_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x04E*/ { "CMSG_LOGOUT_CANCEL", STATUS_LOGGEDIN, &WorldSession::HandleLogoutCancelOpcode },
+ /*0x04F*/ { "SMSG_LOGOUT_CANCEL_ACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x050*/ { "CMSG_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleNameQueryOpcode },
+ /*0x051*/ { "SMSG_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x052*/ { "CMSG_PET_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePetNameQuery },
+ /*0x053*/ { "SMSG_PET_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x054*/ { "CMSG_GUILD_QUERY", STATUS_AUTHED, &WorldSession::HandleGuildQueryOpcode },
+ /*0x055*/ { "SMSG_GUILD_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x056*/ { "CMSG_ITEM_QUERY_SINGLE", STATUS_LOGGEDIN, &WorldSession::HandleItemQuerySingleOpcode },
+ /*0x057*/ { "CMSG_ITEM_QUERY_MULTIPLE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x058*/ { "SMSG_ITEM_QUERY_SINGLE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x059*/ { "SMSG_ITEM_QUERY_MULTIPLE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x05A*/ { "CMSG_PAGE_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePageQueryOpcode },
+ /*0x05B*/ { "SMSG_PAGE_TEXT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x05C*/ { "CMSG_QUEST_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestQueryOpcode },
+ /*0x05D*/ { "SMSG_QUEST_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x05E*/ { "CMSG_GAMEOBJECT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGameObjectQueryOpcode },
+ /*0x05F*/ { "SMSG_GAMEOBJECT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x060*/ { "CMSG_CREATURE_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCreatureQueryOpcode },
+ /*0x061*/ { "SMSG_CREATURE_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x062*/ { "CMSG_WHO", STATUS_LOGGEDIN, &WorldSession::HandleWhoOpcode },
+ /*0x063*/ { "SMSG_WHO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x064*/ { "CMSG_WHOIS", STATUS_LOGGEDIN, &WorldSession::HandleWhoisOpcode },
+ /*0x065*/ { "SMSG_WHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x066*/ { "CMSG_CONTACT_LIST", STATUS_LOGGEDIN, &WorldSession::HandleFriendListOpcode },
+ /*0x067*/ { "SMSG_CONTACT_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x068*/ { "SMSG_FRIEND_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x069*/ { "CMSG_ADD_FRIEND", STATUS_LOGGEDIN, &WorldSession::HandleAddFriendOpcode },
+ /*0x06A*/ { "CMSG_DEL_FRIEND", STATUS_LOGGEDIN, &WorldSession::HandleDelFriendOpcode },
+ /*0x06B*/ { "CMSG_SET_CONTACT_NOTES", STATUS_LOGGEDIN, &WorldSession::HandleSetFriendNoteOpcode },
+ /*0x06C*/ { "CMSG_ADD_IGNORE", STATUS_LOGGEDIN, &WorldSession::HandleAddIgnoreOpcode },
+ /*0x06D*/ { "CMSG_DEL_IGNORE", STATUS_LOGGEDIN, &WorldSession::HandleDelIgnoreOpcode },
+ /*0x06E*/ { "CMSG_GROUP_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleGroupInviteOpcode },
+ /*0x06F*/ { "SMSG_GROUP_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x070*/ { "CMSG_GROUP_CANCEL", STATUS_LOGGEDIN, &WorldSession::Handle_Deprecated },
+ /*0x071*/ { "SMSG_GROUP_CANCEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x072*/ { "CMSG_GROUP_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleGroupAcceptOpcode },
+ /*0x073*/ { "CMSG_GROUP_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleGroupDeclineOpcode },
+ /*0x074*/ { "SMSG_GROUP_DECLINE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x075*/ { "CMSG_GROUP_UNINVITE", STATUS_LOGGEDIN, &WorldSession::HandleGroupUninviteNameOpcode },
+ /*0x076*/ { "CMSG_GROUP_UNINVITE_GUID", STATUS_LOGGEDIN, &WorldSession::HandleGroupUninviteGuidOpcode },
+ /*0x077*/ { "SMSG_GROUP_UNINVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x078*/ { "CMSG_GROUP_SET_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGroupSetLeaderOpcode },
+ /*0x079*/ { "SMSG_GROUP_SET_LEADER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x07A*/ { "CMSG_LOOT_METHOD", STATUS_LOGGEDIN, &WorldSession::HandleLootMethodOpcode },
+ /*0x07B*/ { "CMSG_GROUP_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleGroupLeaveOpcode },
+ /*0x07C*/ { "SMSG_GROUP_DESTROYED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x07D*/ { "SMSG_GROUP_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x07E*/ { "SMSG_PARTY_MEMBER_STATS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x07F*/ { "SMSG_PARTY_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x080*/ { "UMSG_UPDATE_GROUP_MEMBERS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x081*/ { "CMSG_GUILD_CREATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildCreateOpcode },
+ /*0x082*/ { "CMSG_GUILD_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleGuildInviteOpcode },
+ /*0x083*/ { "SMSG_GUILD_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x084*/ { "CMSG_GUILD_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleGuildAcceptOpcode },
+ /*0x085*/ { "CMSG_GUILD_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleGuildDeclineOpcode },
+ /*0x086*/ { "SMSG_GUILD_DECLINE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x087*/ { "CMSG_GUILD_INFO", STATUS_LOGGEDIN, &WorldSession::HandleGuildInfoOpcode },
+ /*0x088*/ { "SMSG_GUILD_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x089*/ { "CMSG_GUILD_ROSTER", STATUS_LOGGEDIN, &WorldSession::HandleGuildRosterOpcode },
+ /*0x08A*/ { "SMSG_GUILD_ROSTER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x08B*/ { "CMSG_GUILD_PROMOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildPromoteOpcode },
+ /*0x08C*/ { "CMSG_GUILD_DEMOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildDemoteOpcode },
+ /*0x08D*/ { "CMSG_GUILD_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleGuildLeaveOpcode },
+ /*0x08E*/ { "CMSG_GUILD_REMOVE", STATUS_LOGGEDIN, &WorldSession::HandleGuildRemoveOpcode },
+ /*0x08F*/ { "CMSG_GUILD_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleGuildDisbandOpcode },
+ /*0x090*/ { "CMSG_GUILD_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGuildLeaderOpcode },
+ /*0x091*/ { "CMSG_GUILD_MOTD", STATUS_LOGGEDIN, &WorldSession::HandleGuildMOTDOpcode },
+ /*0x092*/ { "SMSG_GUILD_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x093*/ { "SMSG_GUILD_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x094*/ { "UMSG_UPDATE_GUILD", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x095*/ { "CMSG_MESSAGECHAT", STATUS_LOGGEDIN, &WorldSession::HandleMessagechatOpcode },
+ /*0x096*/ { "SMSG_MESSAGECHAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x097*/ { "CMSG_JOIN_CHANNEL", STATUS_LOGGEDIN, &WorldSession::HandleChannelJoin },
+ /*0x098*/ { "CMSG_LEAVE_CHANNEL", STATUS_LOGGEDIN, &WorldSession::HandleChannelLeave },
+ /*0x099*/ { "SMSG_CHANNEL_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x09A*/ { "CMSG_CHANNEL_LIST", STATUS_LOGGEDIN, &WorldSession::HandleChannelList },
+ /*0x09B*/ { "SMSG_CHANNEL_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x09C*/ { "CMSG_CHANNEL_PASSWORD", STATUS_LOGGEDIN, &WorldSession::HandleChannelPassword },
+ /*0x09D*/ { "CMSG_CHANNEL_SET_OWNER", STATUS_LOGGEDIN, &WorldSession::HandleChannelSetOwner },
+ /*0x09E*/ { "CMSG_CHANNEL_OWNER", STATUS_LOGGEDIN, &WorldSession::HandleChannelOwner },
+ /*0x09F*/ { "CMSG_CHANNEL_MODERATOR", STATUS_LOGGEDIN, &WorldSession::HandleChannelModerator },
+ /*0x0A0*/ { "CMSG_CHANNEL_UNMODERATOR", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnmoderator },
+ /*0x0A1*/ { "CMSG_CHANNEL_MUTE", STATUS_LOGGEDIN, &WorldSession::HandleChannelMute },
+ /*0x0A2*/ { "CMSG_CHANNEL_UNMUTE", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnmute },
+ /*0x0A3*/ { "CMSG_CHANNEL_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleChannelInvite },
+ /*0x0A4*/ { "CMSG_CHANNEL_KICK", STATUS_LOGGEDIN, &WorldSession::HandleChannelKick },
+ /*0x0A5*/ { "CMSG_CHANNEL_BAN", STATUS_LOGGEDIN, &WorldSession::HandleChannelBan },
+ /*0x0A6*/ { "CMSG_CHANNEL_UNBAN", STATUS_LOGGEDIN, &WorldSession::HandleChannelUnban },
+ /*0x0A7*/ { "CMSG_CHANNEL_ANNOUNCEMENTS", STATUS_LOGGEDIN, &WorldSession::HandleChannelAnnounce },
+ /*0x0A8*/ { "CMSG_CHANNEL_MODERATE", STATUS_LOGGEDIN, &WorldSession::HandleChannelModerate },
+ /*0x0A9*/ { "SMSG_UPDATE_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0AA*/ { "SMSG_DESTROY_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0AB*/ { "CMSG_USE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleUseItemOpcode },
+ /*0x0AC*/ { "CMSG_OPEN_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleOpenItemOpcode },
+ /*0x0AD*/ { "CMSG_READ_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleReadItem },
+ /*0x0AE*/ { "SMSG_READ_ITEM_OK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0AF*/ { "SMSG_READ_ITEM_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0B0*/ { "SMSG_ITEM_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0B1*/ { "CMSG_GAMEOBJ_USE", STATUS_LOGGEDIN, &WorldSession::HandleGameObjectUseOpcode },
+ /*0x0B2*/ { "CMSG_DESTROY_ITEMS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0B3*/ { "SMSG_GAMEOBJECT_CUSTOM_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0B4*/ { "CMSG_AREATRIGGER", STATUS_LOGGEDIN, &WorldSession::HandleAreaTriggerOpcode },
+ /*0x0B5*/ { "MSG_MOVE_START_FORWARD", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0B6*/ { "MSG_MOVE_START_BACKWARD", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0B7*/ { "MSG_MOVE_STOP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0B8*/ { "MSG_MOVE_START_STRAFE_LEFT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0B9*/ { "MSG_MOVE_START_STRAFE_RIGHT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BA*/ { "MSG_MOVE_STOP_STRAFE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BB*/ { "MSG_MOVE_JUMP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BC*/ { "MSG_MOVE_START_TURN_LEFT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BD*/ { "MSG_MOVE_START_TURN_RIGHT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BE*/ { "MSG_MOVE_STOP_TURN", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0BF*/ { "MSG_MOVE_START_PITCH_UP", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0C0*/ { "MSG_MOVE_START_PITCH_DOWN", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0C1*/ { "MSG_MOVE_STOP_PITCH", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0C2*/ { "MSG_MOVE_SET_RUN_MODE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0C3*/ { "MSG_MOVE_SET_WALK_MODE", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0C4*/ { "MSG_MOVE_TOGGLE_LOGGING", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0C5*/ { "MSG_MOVE_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0C6*/ { "MSG_MOVE_TELEPORT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0C7*/ { "MSG_MOVE_TELEPORT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveTeleportAck },
+ /*0x0C8*/ { "MSG_MOVE_TOGGLE_FALL_LOGGING", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0C9*/ { "MSG_MOVE_FALL_LAND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0CA*/ { "MSG_MOVE_START_SWIM", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0CB*/ { "MSG_MOVE_STOP_SWIM", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0CC*/ { "MSG_MOVE_SET_RUN_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0CD*/ { "MSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0CE*/ { "MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0CF*/ { "MSG_MOVE_SET_RUN_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D0*/ { "MSG_MOVE_SET_WALK_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D1*/ { "MSG_MOVE_SET_WALK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D2*/ { "MSG_MOVE_SET_SWIM_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D3*/ { "MSG_MOVE_SET_SWIM_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D4*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D5*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D6*/ { "MSG_MOVE_SET_ALL_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D7*/ { "MSG_MOVE_SET_TURN_RATE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D8*/ { "MSG_MOVE_SET_TURN_RATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0D9*/ { "MSG_MOVE_TOGGLE_COLLISION_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0DA*/ { "MSG_MOVE_SET_FACING", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0DB*/ { "MSG_MOVE_SET_PITCH", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0DC*/ { "MSG_MOVE_WORLDPORT_ACK", STATUS_TRANSFER_PENDING,&WorldSession::HandleMoveWorldportAckOpcode},
+ /*0x0DD*/ { "SMSG_MONSTER_MOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0DE*/ { "SMSG_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0DF*/ { "SMSG_MOVE_LAND_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0E0*/ { "MSG_MOVE_SET_RAW_POSITION_ACK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0E1*/ { "CMSG_MOVE_SET_RAW_POSITION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0E2*/ { "SMSG_FORCE_RUN_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0E3*/ { "CMSG_FORCE_RUN_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x0E4*/ { "SMSG_FORCE_RUN_BACK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0E5*/ { "CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x0E6*/ { "SMSG_FORCE_SWIM_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0E7*/ { "CMSG_FORCE_SWIM_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x0E8*/ { "SMSG_FORCE_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0E9*/ { "CMSG_FORCE_MOVE_ROOT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveRootAck },
+ /*0x0EA*/ { "SMSG_FORCE_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0EB*/ { "CMSG_FORCE_MOVE_UNROOT_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveUnRootAck },
+ /*0x0EC*/ { "MSG_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0ED*/ { "MSG_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0EE*/ { "MSG_MOVE_HEARTBEAT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x0EF*/ { "SMSG_MOVE_KNOCK_BACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0F0*/ { "CMSG_MOVE_KNOCK_BACK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveKnockBackAck },
+ /*0x0F1*/ { "MSG_MOVE_KNOCK_BACK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0F2*/ { "SMSG_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0F3*/ { "SMSG_MOVE_NORMAL_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveHoverAck },
+ /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0F8*/ { "CMSG_TRIGGER_CINEMATIC_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0F9*/ { "CMSG_OPENING_CINEMATIC", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x0FA*/ { "SMSG_TRIGGER_CINEMATIC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0FB*/ { "CMSG_NEXT_CINEMATIC_CAMERA", STATUS_LOGGEDIN, &WorldSession::HandleNextCinematicCamera },
+ /*0x0FC*/ { "CMSG_COMPLETE_CINEMATIC", STATUS_LOGGEDIN, &WorldSession::HandleCompleteCinema },
+ /*0x0FD*/ { "SMSG_TUTORIAL_FLAGS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x0FE*/ { "CMSG_TUTORIAL_FLAG", STATUS_LOGGEDIN, &WorldSession::HandleTutorialFlag },
+ /*0x0FF*/ { "CMSG_TUTORIAL_CLEAR", STATUS_LOGGEDIN, &WorldSession::HandleTutorialClear },
+ /*0x100*/ { "CMSG_TUTORIAL_RESET", STATUS_LOGGEDIN, &WorldSession::HandleTutorialReset },
+ /*0x101*/ { "CMSG_STANDSTATECHANGE", STATUS_LOGGEDIN, &WorldSession::HandleStandStateChangeOpcode },
+ /*0x102*/ { "CMSG_EMOTE", STATUS_LOGGEDIN, &WorldSession::HandleEmoteOpcode },
+ /*0x103*/ { "SMSG_EMOTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x104*/ { "CMSG_TEXT_EMOTE", STATUS_LOGGEDIN, &WorldSession::HandleTextEmoteOpcode },
+ /*0x105*/ { "SMSG_TEXT_EMOTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x106*/ { "CMSG_AUTOEQUIP_GROUND_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x107*/ { "CMSG_AUTOSTORE_GROUND_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x108*/ { "CMSG_AUTOSTORE_LOOT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutostoreLootItemOpcode },
+ /*0x109*/ { "CMSG_STORE_LOOT_IN_SLOT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x10A*/ { "CMSG_AUTOEQUIP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoEquipItemOpcode },
+ /*0x10B*/ { "CMSG_AUTOSTORE_BAG_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoStoreBagItemOpcode },
+ /*0x10C*/ { "CMSG_SWAP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSwapItem },
+ /*0x10D*/ { "CMSG_SWAP_INV_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSwapInvItemOpcode },
+ /*0x10E*/ { "CMSG_SPLIT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSplitItemOpcode },
+ /*0x10F*/ { "CMSG_AUTOEQUIP_ITEM_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleAutoEquipItemSlotOpcode },
+ /*0x110*/ { "OBSOLETE_DROP_ITEM", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x111*/ { "CMSG_DESTROYITEM", STATUS_LOGGEDIN, &WorldSession::HandleDestroyItemOpcode },
+ /*0x112*/ { "SMSG_INVENTORY_CHANGE_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x113*/ { "SMSG_OPEN_CONTAINER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x114*/ { "CMSG_INSPECT", STATUS_LOGGEDIN, &WorldSession::HandleInspectOpcode },
+ /*0x115*/ { "SMSG_INSPECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x116*/ { "CMSG_INITIATE_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleInitiateTradeOpcode },
+ /*0x117*/ { "CMSG_BEGIN_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleBeginTradeOpcode },
+ /*0x118*/ { "CMSG_BUSY_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleBusyTradeOpcode },
+ /*0x119*/ { "CMSG_IGNORE_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleIgnoreTradeOpcode },
+ /*0x11A*/ { "CMSG_ACCEPT_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleAcceptTradeOpcode },
+ /*0x11B*/ { "CMSG_UNACCEPT_TRADE", STATUS_LOGGEDIN, &WorldSession::HandleUnacceptTradeOpcode },
+ /*0x11C*/ { "CMSG_CANCEL_TRADE", STATUS_AUTHED, &WorldSession::HandleCancelTradeOpcode },
+ /*0x11D*/ { "CMSG_SET_TRADE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSetTradeItemOpcode },
+ /*0x11E*/ { "CMSG_CLEAR_TRADE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleClearTradeItemOpcode },
+ /*0x11F*/ { "CMSG_SET_TRADE_GOLD", STATUS_LOGGEDIN, &WorldSession::HandleSetTradeGoldOpcode },
+ /*0x120*/ { "SMSG_TRADE_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x121*/ { "SMSG_TRADE_STATUS_EXTENDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x122*/ { "SMSG_INITIALIZE_FACTIONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x123*/ { "SMSG_SET_FACTION_VISIBLE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x124*/ { "SMSG_SET_FACTION_STANDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x125*/ { "CMSG_SET_FACTION_ATWAR", STATUS_LOGGEDIN, &WorldSession::HandleSetFactionAtWar },
+ /*0x126*/ { "CMSG_SET_FACTION_CHEAT", STATUS_LOGGEDIN, &WorldSession::HandleSetFactionCheat },
+ /*0x127*/ { "SMSG_SET_PROFICIENCY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x128*/ { "CMSG_SET_ACTION_BUTTON", STATUS_LOGGEDIN, &WorldSession::HandleSetActionButtonOpcode },
+ /*0x129*/ { "SMSG_ACTION_BUTTONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x12A*/ { "SMSG_INITIAL_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x12B*/ { "SMSG_LEARNED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x12C*/ { "SMSG_SUPERCEDED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x12D*/ { "CMSG_NEW_SPELL_SLOT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x12E*/ { "CMSG_CAST_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleCastSpellOpcode },
+ /*0x12F*/ { "CMSG_CANCEL_CAST", STATUS_LOGGEDIN, &WorldSession::HandleCancelCastOpcode },
+ /*0x130*/ { "SMSG_CAST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x131*/ { "SMSG_SPELL_START", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x132*/ { "SMSG_SPELL_GO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x133*/ { "SMSG_SPELL_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x134*/ { "SMSG_SPELL_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x135*/ { "SMSG_COOLDOWN_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x136*/ { "CMSG_CANCEL_AURA", STATUS_LOGGEDIN, &WorldSession::HandleCancelAuraOpcode },
+ /*0x137*/ { "SMSG_UPDATE_AURA_DURATION_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x138*/ { "SMSG_PET_CAST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x139*/ { "MSG_CHANNEL_START", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x13A*/ { "MSG_CHANNEL_UPDATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x13B*/ { "CMSG_CANCEL_CHANNELLING", STATUS_LOGGEDIN, &WorldSession::HandleCancelChanneling },
+ /*0x13C*/ { "SMSG_AI_REACTION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x13D*/ { "CMSG_SET_SELECTION", STATUS_LOGGEDIN, &WorldSession::HandleSetSelectionOpcode },
+ /*0x13E*/ { "CMSG_SET_TARGET_OBSOLETE", STATUS_LOGGEDIN, &WorldSession::HandleSetTargetOpcode },
+ /*0x13F*/ { "CMSG_UNUSED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x140*/ { "CMSG_UNUSED2", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x141*/ { "CMSG_ATTACKSWING", STATUS_LOGGEDIN, &WorldSession::HandleAttackSwingOpcode },
+ /*0x142*/ { "CMSG_ATTACKSTOP", STATUS_LOGGEDIN, &WorldSession::HandleAttackStopOpcode },
+ /*0x143*/ { "SMSG_ATTACKSTART", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x144*/ { "SMSG_ATTACKSTOP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x145*/ { "SMSG_ATTACKSWING_NOTINRANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x146*/ { "SMSG_ATTACKSWING_BADFACING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x147*/ { "SMSG_ATTACKSWING_NOTSTANDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x148*/ { "SMSG_ATTACKSWING_DEADTARGET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x149*/ { "SMSG_ATTACKSWING_CANT_ATTACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14A*/ { "SMSG_ATTACKERSTATEUPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14B*/ { "SMSG_VICTIMSTATEUPDATE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14C*/ { "SMSG_DAMAGE_DONE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14D*/ { "SMSG_DAMAGE_TAKEN_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14E*/ { "SMSG_CANCEL_COMBAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x14F*/ { "SMSG_SPELLBREAKLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x150*/ { "SMSG_SPELLHEALLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x151*/ { "SMSG_SPELLENERGIZELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x152*/ { "SMSG_BREAK_TARGET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x153*/ { "CMSG_SAVE_PLAYER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x154*/ { "CMSG_SETDEATHBINDPOINT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x155*/ { "SMSG_BINDPOINTUPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x156*/ { "CMSG_GETDEATHBINDZONE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x157*/ { "SMSG_BINDZONEREPLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x158*/ { "SMSG_PLAYERBOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x159*/ { "SMSG_CLIENT_CONTROL_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x15A*/ { "CMSG_REPOP_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleRepopRequestOpcode },
+ /*0x15B*/ { "SMSG_RESURRECT_REQUEST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x15C*/ { "CMSG_RESURRECT_RESPONSE", STATUS_LOGGEDIN, &WorldSession::HandleResurrectResponseOpcode },
+ /*0x15D*/ { "CMSG_LOOT", STATUS_LOGGEDIN, &WorldSession::HandleLootOpcode },
+ /*0x15E*/ { "CMSG_LOOT_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleLootMoneyOpcode },
+ /*0x15F*/ { "CMSG_LOOT_RELEASE", STATUS_LOGGEDIN, &WorldSession::HandleLootReleaseOpcode },
+ /*0x160*/ { "SMSG_LOOT_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x161*/ { "SMSG_LOOT_RELEASE_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x162*/ { "SMSG_LOOT_REMOVED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x163*/ { "SMSG_LOOT_MONEY_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x164*/ { "SMSG_LOOT_ITEM_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x165*/ { "SMSG_LOOT_CLEAR_MONEY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x166*/ { "SMSG_ITEM_PUSH_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x167*/ { "SMSG_DUEL_REQUESTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x168*/ { "SMSG_DUEL_OUTOFBOUNDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x169*/ { "SMSG_DUEL_INBOUNDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x16A*/ { "SMSG_DUEL_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x16B*/ { "SMSG_DUEL_WINNER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x16C*/ { "CMSG_DUEL_ACCEPTED", STATUS_LOGGEDIN, &WorldSession::HandleDuelAcceptedOpcode },
+ /*0x16D*/ { "CMSG_DUEL_CANCELLED", STATUS_LOGGEDIN, &WorldSession::HandleDuelCancelledOpcode },
+ /*0x16E*/ { "SMSG_MOUNTRESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x16F*/ { "SMSG_DISMOUNTRESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x170*/ { "SMSG_PUREMOUNT_CANCELLED_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x171*/ { "CMSG_MOUNTSPECIAL_ANIM", STATUS_LOGGEDIN, &WorldSession::HandleMountSpecialAnimOpcode },
+ /*0x172*/ { "SMSG_MOUNTSPECIAL_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x173*/ { "SMSG_PET_TAME_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x174*/ { "CMSG_PET_SET_ACTION", STATUS_LOGGEDIN, &WorldSession::HandlePetSetAction },
+ /*0x175*/ { "CMSG_PET_ACTION", STATUS_LOGGEDIN, &WorldSession::HandlePetAction },
+ /*0x176*/ { "CMSG_PET_ABANDON", STATUS_LOGGEDIN, &WorldSession::HandlePetAbandon },
+ /*0x177*/ { "CMSG_PET_RENAME", STATUS_LOGGEDIN, &WorldSession::HandlePetRename },
+ /*0x178*/ { "SMSG_PET_NAME_INVALID", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x179*/ { "SMSG_PET_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x17A*/ { "SMSG_PET_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x17B*/ { "CMSG_GOSSIP_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleGossipHelloOpcode },
+ /*0x17C*/ { "CMSG_GOSSIP_SELECT_OPTION", STATUS_LOGGEDIN, &WorldSession::HandleGossipSelectOptionOpcode },
+ /*0x17D*/ { "SMSG_GOSSIP_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x17E*/ { "SMSG_GOSSIP_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x17F*/ { "CMSG_NPC_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleNpcTextQueryOpcode },
+ /*0x180*/ { "SMSG_NPC_TEXT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x181*/ { "SMSG_NPC_WONT_TALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x182*/ { "CMSG_QUESTGIVER_STATUS_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverStatusQueryOpcode},
+ /*0x183*/ { "SMSG_QUESTGIVER_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x184*/ { "CMSG_QUESTGIVER_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverHelloOpcode },
+ /*0x185*/ { "SMSG_QUESTGIVER_QUEST_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x186*/ { "CMSG_QUESTGIVER_QUERY_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverQuestQueryOpcode},
+ /*0x187*/ { "CMSG_QUESTGIVER_QUEST_AUTOLAUNCH", STATUS_LOGGEDIN, &WorldSession::HandleQuestAutoLaunch },
+ /*0x188*/ { "SMSG_QUESTGIVER_QUEST_DETAILS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x189*/ { "CMSG_QUESTGIVER_ACCEPT_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverAcceptQuestOpcode},
+ /*0x18A*/ { "CMSG_QUESTGIVER_COMPLETE_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestComplete },
+ /*0x18B*/ { "SMSG_QUESTGIVER_REQUEST_ITEMS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x18C*/ { "CMSG_QUESTGIVER_REQUEST_REWARD", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverRequestRewardOpcode},
+ /*0x18D*/ { "SMSG_QUESTGIVER_OFFER_REWARD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x18E*/ { "CMSG_QUESTGIVER_CHOOSE_REWARD", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverChooseRewardOpcode},
+ /*0x18F*/ { "SMSG_QUESTGIVER_QUEST_INVALID", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x190*/ { "CMSG_QUESTGIVER_CANCEL", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverCancel },
+ /*0x191*/ { "SMSG_QUESTGIVER_QUEST_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x192*/ { "SMSG_QUESTGIVER_QUEST_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x193*/ { "CMSG_QUESTLOG_SWAP_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestLogSwapQuest },
+ /*0x194*/ { "CMSG_QUESTLOG_REMOVE_QUEST", STATUS_LOGGEDIN, &WorldSession::HandleQuestLogRemoveQuest },
+ /*0x195*/ { "SMSG_QUESTLOG_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x196*/ { "SMSG_QUESTUPDATE_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x197*/ { "SMSG_QUESTUPDATE_FAILEDTIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x198*/ { "SMSG_QUESTUPDATE_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x199*/ { "SMSG_QUESTUPDATE_ADD_KILL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x19A*/ { "SMSG_QUESTUPDATE_ADD_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x19B*/ { "CMSG_QUEST_CONFIRM_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleQuestConfirmAccept },
+ /*0x19C*/ { "SMSG_QUEST_CONFIRM_ACCEPT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x19D*/ { "CMSG_PUSHQUESTTOPARTY", STATUS_LOGGEDIN, &WorldSession::HandleQuestPushToParty },
+ /*0x19E*/ { "CMSG_LIST_INVENTORY", STATUS_LOGGEDIN, &WorldSession::HandleListInventoryOpcode },
+ /*0x19F*/ { "SMSG_LIST_INVENTORY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1A0*/ { "CMSG_SELL_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleSellItemOpcode },
+ /*0x1A1*/ { "SMSG_SELL_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1A2*/ { "CMSG_BUY_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleBuyItemOpcode },
+ /*0x1A3*/ { "CMSG_BUY_ITEM_IN_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyItemInSlotOpcode },
+ /*0x1A4*/ { "SMSG_BUY_ITEM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1A5*/ { "SMSG_BUY_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1A6*/ { "CMSG_TAXICLEARALLNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1A7*/ { "CMSG_TAXIENABLEALLNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1A8*/ { "CMSG_TAXISHOWNODES", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1A9*/ { "SMSG_SHOWTAXINODES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1AA*/ { "CMSG_TAXINODE_STATUS_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleTaxiNodeStatusQueryOpcode },
+ /*0x1AB*/ { "SMSG_TAXINODE_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1AC*/ { "CMSG_TAXIQUERYAVAILABLENODES", STATUS_LOGGEDIN, &WorldSession::HandleTaxiQueryAvailableNodes },
+ /*0x1AD*/ { "CMSG_ACTIVATETAXI", STATUS_LOGGEDIN, &WorldSession::HandleActivateTaxiOpcode },
+ /*0x1AE*/ { "SMSG_ACTIVATETAXIREPLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1AF*/ { "SMSG_NEW_TAXI_PATH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B0*/ { "CMSG_TRAINER_LIST", STATUS_LOGGEDIN, &WorldSession::HandleTrainerListOpcode },
+ /*0x1B1*/ { "SMSG_TRAINER_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B2*/ { "CMSG_TRAINER_BUY_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleTrainerBuySpellOpcode },
+ /*0x1B3*/ { "SMSG_TRAINER_BUY_SUCCEEDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B4*/ { "SMSG_TRAINER_BUY_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B5*/ { "CMSG_BINDER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleBinderActivateOpcode },
+ /*0x1B6*/ { "SMSG_PLAYERBINDERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B7*/ { "CMSG_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleBankerActivateOpcode },
+ /*0x1B8*/ { "SMSG_SHOW_BANK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1B9*/ { "CMSG_BUY_BANK_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyBankSlotOpcode },
+ /*0x1BA*/ { "SMSG_BUY_BANK_SLOT_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1BB*/ { "CMSG_PETITION_SHOWLIST", STATUS_LOGGEDIN, &WorldSession::HandlePetitionShowListOpcode },
+ /*0x1BC*/ { "SMSG_PETITION_SHOWLIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1BD*/ { "CMSG_PETITION_BUY", STATUS_LOGGEDIN, &WorldSession::HandlePetitionBuyOpcode },
+ /*0x1BE*/ { "CMSG_PETITION_SHOW_SIGNATURES", STATUS_LOGGEDIN, &WorldSession::HandlePetitionShowSignOpcode },
+ /*0x1BF*/ { "SMSG_PETITION_SHOW_SIGNATURES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1C0*/ { "CMSG_PETITION_SIGN", STATUS_LOGGEDIN, &WorldSession::HandlePetitionSignOpcode },
+ /*0x1C1*/ { "SMSG_PETITION_SIGN_RESULTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1C2*/ { "MSG_PETITION_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandlePetitionDeclineOpcode },
+ /*0x1C3*/ { "CMSG_OFFER_PETITION", STATUS_LOGGEDIN, &WorldSession::HandleOfferPetitionOpcode },
+ /*0x1C4*/ { "CMSG_TURN_IN_PETITION", STATUS_LOGGEDIN, &WorldSession::HandleTurnInPetitionOpcode },
+ /*0x1C5*/ { "SMSG_TURN_IN_PETITION_RESULTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1C6*/ { "CMSG_PETITION_QUERY", STATUS_LOGGEDIN, &WorldSession::HandlePetitionQueryOpcode },
+ /*0x1C7*/ { "SMSG_PETITION_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1C8*/ { "SMSG_FISH_NOT_HOOKED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1C9*/ { "SMSG_FISH_ESCAPED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1CA*/ { "CMSG_BUG", STATUS_LOGGEDIN, &WorldSession::HandleBugOpcode },
+ /*0x1CB*/ { "SMSG_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1CC*/ { "CMSG_PLAYED_TIME", STATUS_LOGGEDIN, &WorldSession::HandlePlayedTime },
+ /*0x1CD*/ { "SMSG_PLAYED_TIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1CE*/ { "CMSG_QUERY_TIME", STATUS_LOGGEDIN, &WorldSession::HandleQueryTimeOpcode },
+ /*0x1CF*/ { "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D0*/ { "SMSG_LOG_XPGAIN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D2*/ { "CMSG_RECLAIM_CORPSE", STATUS_LOGGEDIN, &WorldSession::HandleCorpseReclaimOpcode },
+ /*0x1D3*/ { "CMSG_WRAP_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleWrapItemOpcode },
+ /*0x1D4*/ { "SMSG_LEVELUP_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D5*/ { "MSG_MINIMAP_PING", STATUS_LOGGEDIN, &WorldSession::HandleMinimapPingOpcode },
+ /*0x1D6*/ { "SMSG_RESISTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D7*/ { "SMSG_ENCHANTMENTLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1D8*/ { "CMSG_SET_SKILL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1D9*/ { "SMSG_START_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1DA*/ { "SMSG_PAUSE_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1DB*/ { "SMSG_STOP_MIRROR_TIMER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1DC*/ { "CMSG_PING", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
+ /*0x1DD*/ { "SMSG_PONG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1DE*/ { "SMSG_CLEAR_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1DF*/ { "SMSG_GAMEOBJECT_PAGETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1E0*/ { "CMSG_SETSHEATHED", STATUS_LOGGEDIN, &WorldSession::HandleSetSheathedOpcode },
+ /*0x1E1*/ { "SMSG_COOLDOWN_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1E2*/ { "SMSG_SPELL_DELAYED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1E3*/ { "CMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1E4*/ { "SMSG_PLAYER_MACRO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1E5*/ { "CMSG_GHOST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1E6*/ { "CMSG_GM_INVIS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1E7*/ { "SMSG_INVALID_PROMOTION_CODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1E8*/ { "MSG_GM_BIND_OTHER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1E9*/ { "MSG_GM_SUMMON", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1EA*/ { "SMSG_ITEM_TIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1EB*/ { "SMSG_ITEM_ENCHANT_TIME_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1EC*/ { "SMSG_AUTH_CHALLENGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1ED*/ { "CMSG_AUTH_SESSION", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
+ /*0x1EE*/ { "SMSG_AUTH_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1EF*/ { "MSG_GM_SHOWLABEL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1F0*/ { "CMSG_PET_CAST_SPELL", STATUS_LOGGEDIN, &WorldSession::HandlePetCastSpellOpcode },
+ /*0x1F1*/ { "MSG_SAVE_GUILD_EMBLEM", STATUS_LOGGEDIN, &WorldSession::HandleGuildSaveEmblemOpcode },
+ /*0x1F2*/ { "MSG_TABARDVENDOR_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleTabardVendorActivateOpcode},
+ /*0x1F3*/ { "SMSG_PLAY_SPELL_VISUAL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1F4*/ { "CMSG_ZONEUPDATE", STATUS_LOGGEDIN, &WorldSession::HandleZoneUpdateOpcode },
+ /*0x1F5*/ { "SMSG_PARTYKILLLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1F6*/ { "SMSG_COMPRESSED_UPDATE_OBJECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1F7*/ { "SMSG_PLAY_SPELL_IMPACT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1F8*/ { "SMSG_EXPLORATION_EXPERIENCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1F9*/ { "CMSG_GM_SET_SECURITY_GROUP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1FA*/ { "CMSG_GM_NUKE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1FB*/ { "MSG_RANDOM_ROLL", STATUS_LOGGEDIN, &WorldSession::HandleRandomRollOpcode },
+ /*0x1FC*/ { "SMSG_ENVIRONMENTALDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1FD*/ { "CMSG_RWHOIS_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x1FE*/ { "SMSG_RWHOIS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x1FF*/ { "MSG_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLookingForGroup },
+ /*0x200*/ { "CMSG_SET_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleSetLfgOpcode },
+ /*0x201*/ { "CMSG_UNLEARN_SPELL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x202*/ { "CMSG_UNLEARN_SKILL", STATUS_LOGGEDIN, &WorldSession::HandleUnlearnSkillOpcode },
+ /*0x203*/ { "SMSG_REMOVED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x204*/ { "CMSG_DECHARGE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x205*/ { "CMSG_GMTICKET_CREATE", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketCreateOpcode },
+ /*0x206*/ { "SMSG_GMTICKET_CREATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketUpdateOpcode },
+ /*0x208*/ { "SMSG_GMTICKET_UPDATETEXT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x209*/ { "SMSG_ACCOUNT_DATA_TIMES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_LOGGEDIN, &WorldSession::HandleRequestAccountData },
+ /*0x20B*/ { "CMSG_UPDATE_ACCOUNT_DATA", STATUS_AUTHED, &WorldSession::HandleUpdateAccountData },
+ /*0x20C*/ { "SMSG_UPDATE_ACCOUNT_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x20D*/ { "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x20E*/ { "SMSG_POWERGAINLOG_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x20F*/ { "CMSG_GM_TEACH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x210*/ { "CMSG_GM_CREATE_ITEM_TARGET", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x211*/ { "CMSG_GMTICKET_GETTICKET", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketGetTicketOpcode },
+ /*0x212*/ { "SMSG_GMTICKET_GETTICKET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x213*/ { "CMSG_UNLEARN_TALENTS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x214*/ { "SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x215*/ { "SMSG_GAMEOBJECT_DESPAWN_ANIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x216*/ { "MSG_CORPSE_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCorpseQueryOpcode },
+ /*0x217*/ { "CMSG_GMTICKET_DELETETICKET", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketDeleteOpcode },
+ /*0x218*/ { "SMSG_GMTICKET_DELETETICKET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x219*/ { "SMSG_CHAT_WRONG_FACTION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x21A*/ { "CMSG_GMTICKET_SYSTEMSTATUS", STATUS_LOGGEDIN, &WorldSession::HandleGMTicketSystemStatusOpcode},
+ /*0x21B*/ { "SMSG_GMTICKET_SYSTEMSTATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x21C*/ { "CMSG_SPIRIT_HEALER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleSpiritHealerActivateOpcode},
+ /*0x21D*/ { "CMSG_SET_STAT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x21E*/ { "SMSG_SET_REST_START_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x21F*/ { "CMSG_SKILL_BUY_STEP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x220*/ { "CMSG_SKILL_BUY_RANK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x221*/ { "CMSG_XP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x222*/ { "SMSG_SPIRIT_HEALER_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x223*/ { "CMSG_CHARACTER_POINT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x224*/ { "SMSG_GOSSIP_POI", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x225*/ { "CMSG_CHAT_IGNORED", STATUS_LOGGEDIN, &WorldSession::HandleChatIgnoredOpcode },
+ /*0x226*/ { "CMSG_GM_VISION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x227*/ { "CMSG_SERVER_COMMAND", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x228*/ { "CMSG_GM_SILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x229*/ { "CMSG_GM_REVEALTO", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22A*/ { "CMSG_GM_RESURRECT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22B*/ { "CMSG_GM_SUMMONMOB", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22C*/ { "CMSG_GM_MOVECORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22D*/ { "CMSG_GM_FREEZE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22E*/ { "CMSG_GM_UBERINVIS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x22F*/ { "CMSG_GM_REQUEST_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x230*/ { "SMSG_GM_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x231*/ { "CMSG_GUILD_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildRankOpcode },
+ /*0x232*/ { "CMSG_GUILD_ADD_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildAddRankOpcode },
+ /*0x233*/ { "CMSG_GUILD_DEL_RANK", STATUS_LOGGEDIN, &WorldSession::HandleGuildDelRankOpcode },
+ /*0x234*/ { "CMSG_GUILD_SET_PUBLIC_NOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildSetPublicNoteOpcode },
+ /*0x235*/ { "CMSG_GUILD_SET_OFFICER_NOTE", STATUS_LOGGEDIN, &WorldSession::HandleGuildSetOfficerNoteOpcode },
+ /*0x236*/ { "SMSG_LOGIN_VERIFY_WORLD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x237*/ { "CMSG_CLEAR_EXPLORATION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x238*/ { "CMSG_SEND_MAIL", STATUS_LOGGEDIN, &WorldSession::HandleSendMail },
+ /*0x239*/ { "SMSG_SEND_MAIL_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x23A*/ { "CMSG_GET_MAIL_LIST", STATUS_LOGGEDIN, &WorldSession::HandleGetMail },
+ /*0x23B*/ { "SMSG_MAIL_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x23C*/ { "CMSG_BATTLEFIELD_LIST", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundListOpcode },
+ /*0x23D*/ { "SMSG_BATTLEFIELD_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x23E*/ { "CMSG_BATTLEFIELD_JOIN", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x23F*/ { "SMSG_BATTLEFIELD_WIN_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x240*/ { "SMSG_BATTLEFIELD_LOSE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x241*/ { "CMSG_TAXICLEARNODE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x242*/ { "CMSG_TAXIENABLENODE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x243*/ { "CMSG_ITEM_TEXT_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleItemTextQuery },
+ /*0x244*/ { "SMSG_ITEM_TEXT_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x245*/ { "CMSG_MAIL_TAKE_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleTakeMoney },
+ /*0x246*/ { "CMSG_MAIL_TAKE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleTakeItem },
+ /*0x247*/ { "CMSG_MAIL_MARK_AS_READ", STATUS_LOGGEDIN, &WorldSession::HandleMarkAsRead },
+ /*0x248*/ { "CMSG_MAIL_RETURN_TO_SENDER", STATUS_LOGGEDIN, &WorldSession::HandleReturnToSender },
+ /*0x249*/ { "CMSG_MAIL_DELETE", STATUS_LOGGEDIN, &WorldSession::HandleMailDelete },
+ /*0x24A*/ { "CMSG_MAIL_CREATE_TEXT_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleMailCreateTextItem },
+ /*0x24B*/ { "SMSG_SPELLLOGMISS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x24C*/ { "SMSG_SPELLLOGEXECUTE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x24D*/ { "SMSG_DEBUGAURAPROC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x24E*/ { "SMSG_PERIODICAURALOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x24F*/ { "SMSG_SPELLDAMAGESHIELD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x250*/ { "SMSG_SPELLNONMELEEDAMAGELOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x251*/ { "CMSG_LEARN_TALENT", STATUS_LOGGEDIN, &WorldSession::HandleLearnTalentOpcode },
+ /*0x252*/ { "SMSG_RESURRECT_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x253*/ { "CMSG_TOGGLE_PVP", STATUS_LOGGEDIN, &WorldSession::HandleTogglePvP },
+ /*0x254*/ { "SMSG_ZONE_UNDER_ATTACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x255*/ { "MSG_AUCTION_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleAuctionHelloOpcode },
+ /*0x256*/ { "CMSG_AUCTION_SELL_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAuctionSellItem },
+ /*0x257*/ { "CMSG_AUCTION_REMOVE_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAuctionRemoveItem },
+ /*0x258*/ { "CMSG_AUCTION_LIST_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListItems },
+ /*0x259*/ { "CMSG_AUCTION_LIST_OWNER_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListOwnerItems },
+ /*0x25A*/ { "CMSG_AUCTION_PLACE_BID", STATUS_LOGGEDIN, &WorldSession::HandleAuctionPlaceBid },
+ /*0x25B*/ { "SMSG_AUCTION_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x25C*/ { "SMSG_AUCTION_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x25D*/ { "SMSG_AUCTION_OWNER_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x25E*/ { "SMSG_AUCTION_BIDDER_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x25F*/ { "SMSG_AUCTION_OWNER_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x260*/ { "SMSG_PROCRESIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x261*/ { "SMSG_STANDSTATE_CHANGE_FAILURE_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x262*/ { "SMSG_DISPEL_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x263*/ { "SMSG_SPELLORDAMAGE_IMMUNE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x264*/ { "CMSG_AUCTION_LIST_BIDDER_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListBidderItems },
+ /*0x265*/ { "SMSG_AUCTION_BIDDER_LIST_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x266*/ { "SMSG_SET_FLAT_SPELL_MODIFIER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x267*/ { "SMSG_SET_PCT_SPELL_MODIFIER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x268*/ { "CMSG_SET_AMMO", STATUS_LOGGEDIN, &WorldSession::HandleSetAmmoOpcode },
+ /*0x269*/ { "SMSG_CORPSE_RECLAIM_DELAY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x26A*/ { "CMSG_SET_ACTIVE_MOVER", STATUS_LOGGEDIN, &WorldSession::HandleSetActiveMoverOpcode },
+ /*0x26B*/ { "CMSG_PET_CANCEL_AURA", STATUS_LOGGEDIN, &WorldSession::HandlePetCancelAuraOpcode },
+ /*0x26C*/ { "CMSG_PLAYER_AI_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x26D*/ { "CMSG_CANCEL_AUTO_REPEAT_SPELL", STATUS_LOGGEDIN, &WorldSession::HandleCancelAutoRepeatSpellOpcode},
+ /*0x26E*/ { "MSG_GM_ACCOUNT_ONLINE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x26F*/ { "MSG_LIST_STABLED_PETS", STATUS_LOGGEDIN, &WorldSession::HandleListStabledPetsOpcode },
+ /*0x270*/ { "CMSG_STABLE_PET", STATUS_LOGGEDIN, &WorldSession::HandleStablePet },
+ /*0x271*/ { "CMSG_UNSTABLE_PET", STATUS_LOGGEDIN, &WorldSession::HandleUnstablePet },
+ /*0x272*/ { "CMSG_BUY_STABLE_SLOT", STATUS_LOGGEDIN, &WorldSession::HandleBuyStableSlot },
+ /*0x273*/ { "SMSG_STABLE_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x274*/ { "CMSG_STABLE_REVIVE_PET", STATUS_LOGGEDIN, &WorldSession::HandleStableRevivePet },
+ /*0x275*/ { "CMSG_STABLE_SWAP_PET", STATUS_LOGGEDIN, &WorldSession::HandleStableSwapPet },
+ /*0x276*/ { "MSG_QUEST_PUSH_RESULT", STATUS_LOGGEDIN, &WorldSession::HandleQuestPushResult },
+ /*0x277*/ { "SMSG_PLAY_MUSIC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x278*/ { "SMSG_PLAY_OBJECT_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x279*/ { "CMSG_REQUEST_PET_INFO", STATUS_LOGGEDIN, &WorldSession::HandleRequestPetInfoOpcode },
+ /*0x27A*/ { "CMSG_FAR_SIGHT", STATUS_LOGGEDIN, &WorldSession::HandleFarSightOpcode },
+ /*0x27B*/ { "SMSG_SPELLDISPELLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x27C*/ { "SMSG_DAMAGE_CALC_LOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x27D*/ { "CMSG_ENABLE_DAMAGE_LOG", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x27E*/ { "CMSG_GROUP_CHANGE_SUB_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleGroupChangeSubGroupOpcode },
+ /*0x27F*/ { "CMSG_REQUEST_PARTY_MEMBER_STATS", STATUS_LOGGEDIN, &WorldSession::HandleRequestPartyMemberStatsOpcode},
+ /*0x280*/ { "CMSG_GROUP_SWAP_SUB_GROUP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x281*/ { "CMSG_RESET_FACTION_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x282*/ { "CMSG_AUTOSTORE_BANK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoStoreBankItemOpcode },
+ /*0x283*/ { "CMSG_AUTOBANK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleAutoBankItemOpcode },
+ /*0x284*/ { "MSG_QUERY_NEXT_MAIL_TIME", STATUS_LOGGEDIN, &WorldSession::HandleMsgQueryNextMailtime },
+ /*0x285*/ { "SMSG_RECEIVED_MAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x286*/ { "SMSG_RAID_GROUP_ONLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x287*/ { "CMSG_SET_DURABILITY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x288*/ { "CMSG_SET_PVP_RANK_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x289*/ { "CMSG_ADD_PVP_MEDAL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x28A*/ { "CMSG_DEL_PVP_MEDAL_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x28B*/ { "CMSG_SET_PVP_TITLE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x28C*/ { "SMSG_PVP_CREDIT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x28D*/ { "SMSG_AUCTION_REMOVED_NOTIFICATION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x28E*/ { "CMSG_GROUP_RAID_CONVERT", STATUS_LOGGEDIN, &WorldSession::HandleRaidConvertOpcode },
+ /*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleGroupAssistantOpcode },
+ /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleBuybackItem },
+ /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x292*/ { "CMSG_MEETINGSTONE_JOIN", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x293*/ { "CMSG_MEETINGSTONE_LEAVE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x296*/ { "CMSG_MEETINGSTONE_INFO", STATUS_LOGGEDIN, &WorldSession::HandleMeetingStoneInfo },
+ /*0x297*/ { "SMSG_MEETINGSTONE_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x298*/ { "SMSG_MEETINGSTONE_IN_PROGRESS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x299*/ { "SMSG_MEETINGSTONE_MEMBER_ADDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x29A*/ { "CMSG_GMTICKETSYSTEM_TOGGLE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x29B*/ { "CMSG_CANCEL_GROWTH_AURA", STATUS_LOGGEDIN, &WorldSession::HandleCancelGrowthAuraOpcode },
+ /*0x29C*/ { "SMSG_CANCEL_AUTO_REPEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x29D*/ { "SMSG_STANDSTATE_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x29E*/ { "SMSG_LOOT_ALL_PASSED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x29F*/ { "SMSG_LOOT_ROLL_WON", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A0*/ { "CMSG_LOOT_ROLL", STATUS_LOGGEDIN, &WorldSession::HandleLootRoll },
+ /*0x2A1*/ { "SMSG_LOOT_START_ROLL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A2*/ { "SMSG_LOOT_ROLL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A3*/ { "CMSG_LOOT_MASTER_GIVE", STATUS_LOGGEDIN, &WorldSession::HandleLootMasterGiveOpcode },
+ /*0x2A4*/ { "SMSG_LOOT_MASTER_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A5*/ { "SMSG_SET_FORCED_REACTIONS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A6*/ { "SMSG_SPELL_FAILED_OTHER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A7*/ { "SMSG_GAMEOBJECT_RESET_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2A8*/ { "CMSG_REPAIR_ITEM", STATUS_LOGGEDIN, &WorldSession::HandleRepairItemOpcode },
+ /*0x2A9*/ { "SMSG_CHAT_PLAYER_NOT_FOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2AA*/ { "MSG_TALENT_WIPE_CONFIRM", STATUS_LOGGEDIN, &WorldSession::HandleTalentWipeOpcode },
+ /*0x2AB*/ { "SMSG_SUMMON_REQUEST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2AC*/ { "CMSG_SUMMON_RESPONSE", STATUS_LOGGEDIN, &WorldSession::HandleSummonResponseOpcode },
+ /*0x2AD*/ { "MSG_MOVE_TOGGLE_GRAVITY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2AE*/ { "SMSG_MONSTER_MOVE_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2AF*/ { "SMSG_PET_BROKEN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2B0*/ { "MSG_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2B1*/ { "MSG_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2B2*/ { "CMSG_SERVER_BROADCAST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2B3*/ { "CMSG_SELF_RES", STATUS_LOGGEDIN, &WorldSession::HandleSelfResOpcode },
+ /*0x2B4*/ { "SMSG_FEIGN_DEATH_RESISTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2B5*/ { "CMSG_RUN_SCRIPT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2B6*/ { "SMSG_SCRIPT_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2B7*/ { "SMSG_DUEL_COUNTDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2B8*/ { "SMSG_AREA_TRIGGER_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2B9*/ { "CMSG_SHOWING_HELM", STATUS_LOGGEDIN, &WorldSession::HandleToggleHelmOpcode },
+ /*0x2BA*/ { "CMSG_SHOWING_CLOAK", STATUS_LOGGEDIN, &WorldSession::HandleToggleCloakOpcode },
+ /*0x2BB*/ { "SMSG_MEETINGSTONE_JOINFAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2BC*/ { "SMSG_PLAYER_SKINNED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2BD*/ { "SMSG_DURABILITY_DAMAGE_DEATH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2BE*/ { "CMSG_SET_EXPLORATION", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2BF*/ { "CMSG_SET_ACTIONBAR_TOGGLES", STATUS_AUTHED, &WorldSession::HandleSetActionBar },
+ /*0x2C0*/ { "UMSG_DELETE_GUILD_CHARTER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2C1*/ { "MSG_PETITION_RENAME", STATUS_LOGGEDIN, &WorldSession::HandlePetitionRenameOpcode },
+ /*0x2C2*/ { "SMSG_INIT_WORLD_STATES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2C3*/ { "SMSG_UPDATE_WORLD_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2C4*/ { "CMSG_ITEM_NAME_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleItemNameQueryOpcode },
+ /*0x2C5*/ { "SMSG_ITEM_NAME_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2C6*/ { "SMSG_PET_ACTION_FEEDBACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2C7*/ { "CMSG_CHAR_RENAME", STATUS_AUTHED, &WorldSession::HandleChangePlayerNameOpcode },
+ /*0x2C8*/ { "SMSG_CHAR_RENAME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2C9*/ { "CMSG_MOVE_SPLINE_DONE", STATUS_LOGGEDIN, &WorldSession::HandleTaxiNextDestinationOpcode },
+ /*0x2CA*/ { "CMSG_MOVE_FALL_RESET", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x2CB*/ { "SMSG_INSTANCE_SAVE_CREATED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2CC*/ { "SMSG_RAID_INSTANCE_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2CD*/ { "CMSG_REQUEST_RAID_INFO", STATUS_LOGGEDIN, &WorldSession::HandleRequestRaidInfoOpcode },
+ /*0x2CE*/ { "CMSG_MOVE_TIME_SKIPPED", STATUS_LOGGEDIN, &WorldSession::HandleMoveTimeSkippedOpcode },
+ /*0x2CF*/ { "CMSG_MOVE_FEATHER_FALL_ACK", STATUS_LOGGEDIN, &WorldSession::HandleFeatherFallAck },
+ /*0x2D0*/ { "CMSG_MOVE_WATER_WALK_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveWaterWalkAck },
+ /*0x2D1*/ { "CMSG_MOVE_NOT_ACTIVE_MOVER", STATUS_LOGGEDIN, &WorldSession::HandleMoveNotActiveMover },
+ /*0x2D2*/ { "SMSG_PLAY_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2D3*/ { "CMSG_BATTLEFIELD_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleBattlefieldStatusOpcode },
+ /*0x2D4*/ { "SMSG_BATTLEFIELD_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2D5*/ { "CMSG_BATTLEFIELD_PORT", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPlayerPortOpcode},
+ /*0x2D6*/ { "MSG_INSPECT_HONOR_STATS", STATUS_LOGGEDIN, &WorldSession::HandleInspectHonorStatsOpcode },
+ /*0x2D7*/ { "CMSG_BATTLEMASTER_HELLO", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundHelloOpcode },
+ /*0x2D8*/ { "CMSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2D9*/ { "CMSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2DA*/ { "SMSG_FORCE_WALK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2DB*/ { "CMSG_FORCE_WALK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x2DC*/ { "SMSG_FORCE_SWIM_BACK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2DD*/ { "CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x2DE*/ { "SMSG_FORCE_TURN_RATE_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2DF*/ { "CMSG_FORCE_TURN_RATE_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x2E0*/ { "MSG_PVP_LOG_DATA", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPVPlogdataOpcode},
+ /*0x2E1*/ { "CMSG_LEAVE_BATTLEFIELD", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundLeaveOpcode },
+ /*0x2E2*/ { "CMSG_AREA_SPIRIT_HEALER_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleAreaSpiritHealerQueryOpcode},
+ /*0x2E3*/ { "CMSG_AREA_SPIRIT_HEALER_QUEUE", STATUS_LOGGEDIN, &WorldSession::HandleAreaSpiritHealerQueueOpcode},
+ /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2E5*/ { "CMSG_GM_UNTEACH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2E6*/ { "SMSG_WARDEN_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_LOGGEDIN, &WorldSession::HandleWardenDataOpcode },
+ /*0x2E8*/ { "SMSG_GROUP_JOINED_BATTLEGROUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2E9*/ { "MSG_BATTLEGROUND_PLAYER_POSITIONS", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundPlayerPositionsOpcode},
+ /*0x2EA*/ { "CMSG_PET_STOP_ATTACK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2EB*/ { "SMSG_BINDER_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2EC*/ { "SMSG_BATTLEGROUND_PLAYER_JOINED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2ED*/ { "SMSG_BATTLEGROUND_PLAYER_LEFT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2EE*/ { "CMSG_BATTLEMASTER_JOIN", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundJoinOpcode },
+ /*0x2EF*/ { "SMSG_ADDON_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F0*/ { "CMSG_PET_UNLEARN", STATUS_LOGGEDIN, &WorldSession::HandlePetUnlearnOpcode },
+ /*0x2F1*/ { "SMSG_PET_UNLEARN_CONFIRM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F2*/ { "SMSG_PARTY_MEMBER_STATS_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F3*/ { "CMSG_PET_SPELL_AUTOCAST", STATUS_LOGGEDIN, &WorldSession::HandlePetSpellAutocastOpcode },
+ /*0x2F4*/ { "SMSG_WEATHER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F5*/ { "SMSG_PLAY_TIME_WARNING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F6*/ { "SMSG_MINIGAME_SETUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F7*/ { "SMSG_MINIGAME_STATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2F8*/ { "CMSG_MINIGAME_MOVE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x2F9*/ { "SMSG_MINIGAME_MOVE_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2FA*/ { "SMSG_RAID_INSTANCE_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2FB*/ { "SMSG_COMPRESSED_MOVES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2FC*/ { "CMSG_GUILD_INFO_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildChangeInfoOpcode },
+ /*0x2FD*/ { "SMSG_CHAT_RESTRICTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2FE*/ { "SMSG_SPLINE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x2FF*/ { "SMSG_SPLINE_SET_RUN_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x300*/ { "SMSG_SPLINE_SET_SWIM_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x301*/ { "SMSG_SPLINE_SET_WALK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x302*/ { "SMSG_SPLINE_SET_SWIM_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x303*/ { "SMSG_SPLINE_SET_TURN_RATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x304*/ { "SMSG_SPLINE_MOVE_UNROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x305*/ { "SMSG_SPLINE_MOVE_FEATHER_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x306*/ { "SMSG_SPLINE_MOVE_NORMAL_FALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x307*/ { "SMSG_SPLINE_MOVE_SET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x308*/ { "SMSG_SPLINE_MOVE_UNSET_HOVER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x309*/ { "SMSG_SPLINE_MOVE_WATER_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30A*/ { "SMSG_SPLINE_MOVE_LAND_WALK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30B*/ { "SMSG_SPLINE_MOVE_START_SWIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30C*/ { "SMSG_SPLINE_MOVE_STOP_SWIM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30D*/ { "SMSG_SPLINE_MOVE_SET_RUN_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30E*/ { "SMSG_SPLINE_MOVE_SET_WALK_MODE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x30F*/ { "CMSG_GM_NUKE_ACCOUNT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x310*/ { "MSG_GM_DESTROY_CORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x311*/ { "CMSG_GM_DESTROY_ONLINE_CORPSE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x312*/ { "CMSG_ACTIVATETAXIEXPRESS", STATUS_LOGGEDIN, &WorldSession::HandleActivateTaxiFarOpcode },
+ /*0x313*/ { "SMSG_SET_FACTION_ATWAR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x314*/ { "SMSG_GAMETIMEBIAS_SET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x315*/ { "CMSG_DEBUG_ACTIONS_START", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x316*/ { "CMSG_DEBUG_ACTIONS_STOP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x317*/ { "CMSG_SET_FACTION_INACTIVE", STATUS_LOGGEDIN, &WorldSession::HandleSetWatchedFactionInactiveOpcode},
+ /*0x318*/ { "CMSG_SET_WATCHED_FACTION", STATUS_LOGGEDIN, &WorldSession::HandleSetWatchedFactionIndexOpcode},
+ /*0x319*/ { "MSG_MOVE_TIME_SKIPPED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x31A*/ { "SMSG_SPLINE_MOVE_ROOT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x31B*/ { "CMSG_SET_EXPLORATION_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x31C*/ { "SMSG_INVALIDATE_PLAYER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x31D*/ { "CMSG_RESET_INSTANCES", STATUS_LOGGEDIN, &WorldSession::HandleResetInstancesOpcode },
+ /*0x31E*/ { "SMSG_INSTANCE_RESET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x31F*/ { "SMSG_INSTANCE_RESET_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x320*/ { "SMSG_UPDATE_LAST_INSTANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x321*/ { "MSG_RAID_TARGET_UPDATE", STATUS_LOGGEDIN, &WorldSession::HandleRaidIconTargetOpcode },
+ /*0x322*/ { "MSG_RAID_READY_CHECK", STATUS_LOGGEDIN, &WorldSession::HandleRaidReadyCheckOpcode },
+ /*0x323*/ { "CMSG_LUA_USAGE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x324*/ { "SMSG_PET_ACTION_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x325*/ { "SMSG_PET_DISMISS_SOUND", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x326*/ { "SMSG_GHOSTEE_GONE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x327*/ { "CMSG_GM_UPDATE_TICKET_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x328*/ { "SMSG_GM_TICKET_STATUS_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x329*/ { "MSG_SET_DUNGEON_DIFFICULTY", STATUS_LOGGEDIN, &WorldSession::HandleDungeonDifficultyOpcode },
+ /*0x32A*/ { "CMSG_GMSURVEY_SUBMIT", STATUS_NEVER, &WorldSession::Handle_NULL },//LOGGEDIN, &WorldSession::HandleGMSurveySubmit },
+ /*0x32B*/ { "SMSG_UPDATE_INSTANCE_OWNERSHIP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x32C*/ { "CMSG_IGNORE_KNOCKBACK_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x32D*/ { "SMSG_CHAT_PLAYER_AMBIGUOUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x32E*/ { "MSG_DELAY_GHOST_TELEPORT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x32F*/ { "SMSG_SPELLINSTAKILLLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x330*/ { "SMSG_SPELL_UPDATE_CHAIN_TARGETS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x331*/ { "CMSG_CHAT_FILTERED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x332*/ { "SMSG_EXPECTED_SPAM_RECORDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x333*/ { "SMSG_SPELLSTEALLOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x334*/ { "CMSG_LOTTERY_QUERY_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x335*/ { "SMSG_LOTTERY_QUERY_RESULT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x336*/ { "CMSG_BUY_LOTTERY_TICKET_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x337*/ { "SMSG_LOTTERY_RESULT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x338*/ { "SMSG_CHARACTER_PROFILE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x339*/ { "SMSG_CHARACTER_PROFILE_REALM_CONNECTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x33A*/ { "SMSG_DEFENSE_MESSAGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x33B*/ { "SMSG_INSTANCE_DIFFICULTY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x33C*/ { "MSG_GM_RESETINSTANCELIMIT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x33D*/ { "SMSG_MOTD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x33E*/ { "SMSG_MOVE_SET_FLIGHT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x33F*/ { "SMSG_MOVE_UNSET_FLIGHT_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x340*/ { "CMSG_MOVE_FLIGHT_ACK_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x341*/ { "MSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x342*/ { "MSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x343*/ { "SMSG_MOVE_SET_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x344*/ { "SMSG_MOVE_UNSET_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x345*/ { "CMSG_MOVE_SET_CAN_FLY_ACK", STATUS_LOGGEDIN, &WorldSession::HandleMoveFlyModeChangeAckOpcode},
+ /*0x346*/ { "CMSG_MOVE_SET_FLY", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x347*/ { "CMSG_SOCKET_GEMS", STATUS_LOGGEDIN, &WorldSession::HandleSocketOpcode },
+ /*0x348*/ { "CMSG_ARENA_TEAM_CREATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x349*/ { "SMSG_ARENA_TEAM_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x34A*/ { "UMSG_UPDATE_ARENA_TEAM_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x34B*/ { "CMSG_ARENA_TEAM_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamQueryOpcode },
+ /*0x34C*/ { "SMSG_ARENA_TEAM_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x34D*/ { "CMSG_ARENA_TEAM_ROSTER", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamRosterOpcode },
+ /*0x34E*/ { "SMSG_ARENA_TEAM_ROSTER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x34F*/ { "CMSG_ARENA_TEAM_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamAddMemberOpcode },
+ /*0x350*/ { "SMSG_ARENA_TEAM_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x351*/ { "CMSG_ARENA_TEAM_ACCEPT", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamInviteAcceptOpcode},
+ /*0x352*/ { "CMSG_ARENA_TEAM_DECLINE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamInviteDeclineOpcode},
+ /*0x353*/ { "CMSG_ARENA_TEAM_LEAVE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamLeaveOpcode },
+ /*0x354*/ { "CMSG_ARENA_TEAM_REMOVE", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamRemoveFromTeamOpcode},
+ /*0x355*/ { "CMSG_ARENA_TEAM_DISBAND", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamDisbandOpcode },
+ /*0x356*/ { "CMSG_ARENA_TEAM_LEADER", STATUS_LOGGEDIN, &WorldSession::HandleArenaTeamPromoteToCaptainOpcode},
+ /*0x357*/ { "SMSG_ARENA_TEAM_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x358*/ { "CMSG_BATTLEMASTER_JOIN_ARENA", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundArenaJoin },
+ /*0x359*/ { "MSG_MOVE_START_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x35A*/ { "MSG_MOVE_STOP_ASCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x35B*/ { "SMSG_ARENA_TEAM_STATS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x35C*/ { "CMSG_LFG_SET_AUTOJOIN", STATUS_AUTHED, &WorldSession::HandleLfgAutoJoinOpcode },
+ /*0x35D*/ { "CMSG_LFG_CLEAR_AUTOJOIN", STATUS_LOGGEDIN, &WorldSession::HandleLfgCancelAutoJoinOpcode },
+ /*0x35E*/ { "CMSG_LFM_SET_AUTOFILL", STATUS_AUTHED, &WorldSession::HandleLfmAutoAddMembersOpcode },
+ /*0x35F*/ { "CMSG_LFM_CLEAR_AUTOFILL", STATUS_LOGGEDIN, &WorldSession::HandleLfmCancelAutoAddmembersOpcode},
+ /*0x360*/ { "CMSG_ACCEPT_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x361*/ { "CMSG_DECLINE_LFG_MATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x362*/ { "CMSG_CANCEL_PENDING_LFG", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x363*/ { "CMSG_CLEAR_LOOKING_FOR_GROUP", STATUS_LOGGEDIN, &WorldSession::HandleLfgClearOpcode },
+ /*0x364*/ { "CMSG_CLEAR_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetNoneOpcode },
+ /*0x365*/ { "CMSG_SET_LOOKING_FOR_MORE", STATUS_LOGGEDIN, &WorldSession::HandleLfmSetOpcode },
+ /*0x366*/ { "CMSG_SET_LFG_COMMENT", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetCommentOpcode },
+ /*0x367*/ { "SMSG_LFG_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x368*/ { "SMSG_LFG_OTHER_TIMEDOUT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x369*/ { "SMSG_LFG_AUTOJOIN_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36A*/ { "SMSG_LFG_AUTOJOIN_FAILED_NO_PLAYER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36B*/ { "SMSG_LFG_LEADER_IS_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36C*/ { "SMSG_LFG_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36D*/ { "SMSG_LFG_UPDATE_LFM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36E*/ { "SMSG_LFG_UPDATE_LFG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x36F*/ { "SMSG_LFG_UPDATE_QUEUED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x370*/ { "SMSG_LFG_PENDING_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x371*/ { "SMSG_LFG_PENDING_MATCH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x372*/ { "SMSG_LFG_PENDING_MATCH_DONE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, &WorldSession::HandleChooseTitleOpcode },
+ /*0x375*/ { "CMSG_CANCEL_MOUNT_AURA", STATUS_LOGGEDIN, &WorldSession::HandleDismountOpcode },
+ /*0x376*/ { "SMSG_ARENA_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x377*/ { "MSG_INSPECT_ARENA_TEAMS", STATUS_LOGGEDIN, &WorldSession::HandleInspectArenaStatsOpcode },
+ /*0x378*/ { "SMSG_DEATH_RELEASE_LOC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x379*/ { "CMSG_CANCEL_TEMP_ENCHANTMENT", STATUS_LOGGEDIN, &WorldSession::HandleCancelTempItemEnchantmentOpcode},
+ /*0x37A*/ { "SMSG_FORCED_DEATH_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x37B*/ { "CMSG_CHEAT_SET_HONOR_CURRENCY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x37C*/ { "CMSG_CHEAT_SET_ARENA_CURRENCY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x37D*/ { "MSG_MOVE_SET_FLIGHT_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x37E*/ { "MSG_MOVE_SET_FLIGHT_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x37F*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x380*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x381*/ { "SMSG_FORCE_FLIGHT_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x382*/ { "CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x383*/ { "SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x384*/ { "CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, &WorldSession::HandleForceSpeedChangeAck },
+ /*0x385*/ { "SMSG_SPLINE_SET_FLIGHT_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x386*/ { "SMSG_SPLINE_SET_FLIGHT_BACK_SPEED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x387*/ { "CMSG_MAELSTROM_INVALIDATE_CACHE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x388*/ { "SMSG_FLIGHT_SPLINE_SYNC", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x389*/ { "CMSG_SET_TAXI_BENCHMARK_MODE", STATUS_AUTHED, &WorldSession::HandleSetTaxiBenchmarkOpcode },
+ /*0x38A*/ { "SMSG_JOINED_BATTLEGROUND_QUEUE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x38B*/ { "SMSG_REALM_SPLIT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x38C*/ { "CMSG_REALM_SPLIT", STATUS_AUTHED, &WorldSession::HandleRealmStateRequestOpcode },
+ /*0x38D*/ { "CMSG_MOVE_CHNG_TRANSPORT", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x38E*/ { "MSG_PARTY_ASSIGNMENT", STATUS_LOGGEDIN, &WorldSession::HandleGroupPromoteOpcode },
+ /*0x38F*/ { "SMSG_OFFER_PETITION_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x390*/ { "SMSG_TIME_SYNC_REQ", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x391*/ { "CMSG_TIME_SYNC_RESP", STATUS_LOGGEDIN, &WorldSession::HandleTimeSyncResp },
+ /*0x392*/ { "CMSG_SEND_LOCAL_EVENT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x393*/ { "CMSG_SEND_GENERAL_TRIGGER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x394*/ { "CMSG_SEND_COMBAT_TRIGGER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x395*/ { "CMSG_MAELSTROM_GM_SENT_MAIL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x396*/ { "SMSG_RESET_FAILED_NOTIFY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x397*/ { "SMSG_REAL_GROUP_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x398*/ { "SMSG_LFG_DISABLED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x399*/ { "CMSG_ACTIVE_PVP_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x39A*/ { "CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x39B*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x39C*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE",STATUS_NEVER,&WorldSession::Handle_ServerSide },
+ /*0x39D*/ { "SMSG_UPDATE_COMBO_POINTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x39E*/ { "SMSG_VOICE_SESSION_ROSTER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x39F*/ { "SMSG_VOICE_SESSION_LEAVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A0*/ { "SMSG_VOICE_SESSION_ADJUST_PRIORITY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A1*/ { "CMSG_VOICE_SET_TALKER_MUTED_REQUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3A2*/ { "SMSG_VOICE_SET_TALKER_MUTED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A3*/ { "SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A4*/ { "SMSG_SET_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A5*/ { "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE",STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A6*/ { "SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3A7*/ { "MSG_MOVE_START_DESCEND", STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes },
+ /*0x3A8*/ { "CMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3A9*/ { "SMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3AA*/ { "SMSG_SPELL_CHANCE_PROC_LOG", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3AB*/ { "CMSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3AC*/ { "SMSG_DISMOUNT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3AD*/ { "MSG_MOVE_UPDATE_CAN_FLY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3AE*/ { "MSG_RAID_READY_CHECK_CONFIRM", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3AF*/ { "CMSG_VOICE_SESSION_ENABLE", STATUS_AUTHED, &WorldSession::HandleVoiceSettingsOpcode },
+ /*0x3B0*/ { "SMSG_VOICE_SESSION_ENABLE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3B1*/ { "SMSG_VOICE_PARENTAL_CONTROLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3B2*/ { "CMSG_GM_WHISPER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3B3*/ { "SMSG_GM_MESSAGECHAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3B4*/ { "MSG_GM_GEARRATING", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3B5*/ { "CMSG_COMMENTATOR_ENABLE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3B6*/ { "SMSG_COMMENTATOR_STATE_CHANGED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3B7*/ { "CMSG_COMMENTATOR_GET_MAP_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3B8*/ { "SMSG_COMMENTATOR_MAP_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3B9*/ { "CMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3BA*/ { "SMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3BB*/ { "SMSG_COMMENTATOR_PLAYER_INFO", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3BC*/ { "CMSG_COMMENTATOR_ENTER_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3BD*/ { "CMSG_COMMENTATOR_EXIT_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3BE*/ { "CMSG_COMMENTATOR_INSTANCE_COMMAND", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3BF*/ { "SMSG_CLEAR_TARGET", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3C0*/ { "CMSG_BOT_DETECTED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3C1*/ { "SMSG_CROSSED_INEBRIATION_THRESHOLD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3C2*/ { "CMSG_CHEAT_PLAYER_LOGIN", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3C3*/ { "CMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3C4*/ { "SMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3C5*/ { "SMSG_KICK_REASON", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3C6*/ { "MSG_RAID_READY_CHECK_FINISHED", STATUS_LOGGEDIN, &WorldSession::HandleRaidReadyCheckFinishOpcode},
+ /*0x3C7*/ { "CMSG_COMPLAIN", STATUS_LOGGEDIN, &WorldSession::HandleReportSpamOpcode },
+ /*0x3C8*/ { "SMSG_COMPLAIN_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3C9*/ { "SMSG_FEATURE_SYSTEM_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3CA*/ { "CMSG_GM_SHOW_COMPLAINTS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3CB*/ { "CMSG_GM_UNSQUELCH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3CC*/ { "CMSG_CHANNEL_SILENCE_VOICE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3CD*/ { "CMSG_CHANNEL_SILENCE_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3CE*/ { "CMSG_CHANNEL_UNSILENCE_VOICE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3CF*/ { "CMSG_CHANNEL_UNSILENCE_ALL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3D0*/ { "CMSG_TARGET_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3D1*/ { "CMSG_TARGET_SCRIPT_CAST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3D2*/ { "CMSG_CHANNEL_DISPLAY_LIST", STATUS_LOGGEDIN, &WorldSession::HandleChannelRosterQuery },
+ /*0x3D3*/ { "CMSG_SET_ACTIVE_VOICE_CHANNEL", STATUS_AUTHED, &WorldSession::HandleChannelVoiceChatQuery },
+ /*0x3D4*/ { "CMSG_GET_CHANNEL_MEMBER_COUNT", STATUS_LOGGEDIN, &WorldSession::HandleChannelInfoQuery },
+ /*0x3D5*/ { "SMSG_CHANNEL_MEMBER_COUNT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3D6*/ { "CMSG_CHANNEL_VOICE_ON", STATUS_LOGGEDIN, &WorldSession::HandleChannelEnableVoiceOpcode },
+ /*0x3D7*/ { "CMSG_CHANNEL_VOICE_OFF", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3D8*/ { "CMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3D9*/ { "SMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3DA*/ { "SMSG_AVAILABLE_VOICE_CHANNEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3DB*/ { "CMSG_ADD_VOICE_IGNORE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3DC*/ { "CMSG_DEL_VOICE_IGNORE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3DD*/ { "CMSG_PARTY_SILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3DE*/ { "CMSG_PARTY_UNSILENCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3DF*/ { "MSG_NOTIFY_PARTY_SQUELCH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3E0*/ { "SMSG_COMSAT_RECONNECT_TRY", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3E1*/ { "SMSG_COMSAT_DISCONNECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleBattleGroundReportAFK },
+ /*0x3E5*/ { "CMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQuery },
+ /*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankTabColon },
+ /*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3E9*/ { "CMSG_GUILD_BANK_SWAP_ITEMS", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankDepositItem },
+ /*0x3EA*/ { "CMSG_GUILD_BANK_BUY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankBuyTab },
+ /*0x3EB*/ { "CMSG_GUILD_BANK_UPDATE_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankModifyTab },
+ /*0x3EC*/ { "CMSG_GUILD_BANK_DEPOSIT_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankDeposit },
+ /*0x3ED*/ { "CMSG_GUILD_BANK_WITHDRAW_MONEY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankWithdraw },
+ /*0x3EE*/ { "MSG_GUILD_BANK_LOG_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankLog },
+ /*0x3EF*/ { "CMSG_SET_CHANNEL_WATCH", STATUS_LOGGEDIN, &WorldSession::HandleChannelJoinNotify },
+ /*0x3F0*/ { "SMSG_USERLIST_ADD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F1*/ { "SMSG_USERLIST_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F2*/ { "SMSG_USERLIST_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F3*/ { "CMSG_CLEAR_CHANNEL_WATCH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3F4*/ { "SMSG_INSPECT_TALENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F5*/ { "SMSG_GOGOGO_OBSOLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F6*/ { "SMSG_ECHO_PARTY_SQUELCH", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3F7*/ { "CMSG_SET_TITLE_SUFFIX", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3F8*/ { "CMSG_SPELLCLICK", STATUS_LOGGEDIN, &WorldSession::HandleSpellClick },
+ /*0x3F9*/ { "SMSG_LOOT_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3FA*/ { "CMSG_GM_CHARACTER_RESTORE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3FB*/ { "CMSG_GM_CHARACTER_SAVE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x3FC*/ { "SMSG_VOICESESSION_FULL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x3FD*/ { "MSG_GUILD_PERMISSIONS", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankGetRights },
+ /*0x3FE*/ { "MSG_GUILD_BANK_MONEY_WITHDRAWN", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankGetMoneyAmount },
+ /*0x3FF*/ { "MSG_GUILD_EVENT_LOG_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleGuildEventLogOpcode },
+ /*0x400*/ { "CMSG_MAELSTROM_RENAME_GUILD", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x401*/ { "CMSG_GET_MIRRORIMAGE_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x402*/ { "SMSG_MIRRORIMAGE_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x403*/ { "SMSG_FORCE_DISPLAY_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x404*/ { "SMSG_SPELL_CHANCE_RESIST_PUSHBACK", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x405*/ { "CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x406*/ { "SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x407*/ { "CMSG_KEEP_ALIVE", STATUS_NEVER, &WorldSession::Handle_EarlyProccess },
+ /*0x408*/ { "SMSG_RAID_READY_CHECK_ERROR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x409*/ { "CMSG_OPT_OUT_OF_LOOT", STATUS_AUTHED, &WorldSession::HandleGroupPassOnLootOpcode },
+ /*0x40A*/ { "MSG_QUERY_GUILD_BANK_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankTabText },
+ /*0x40B*/ { "CMSG_SET_GUILD_BANK_TEXT", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankSetTabText },
+ /*0x40C*/ { "CMSG_SET_GRANTABLE_LEVELS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x40D*/ { "CMSG_GRANT_LEVEL", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x40E*/ { "CMSG_REFER_A_FRIEND", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x40F*/ { "CMSG_DECLINE_CHANNEL_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleChannelDeclineInvite },
+ /*0x410*/ { "CMSG_DECLINE_CHANNEL_INVITE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x411*/ { "CMSG_GROUPACTION_THROTTLED", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x412*/ { "SMSG_OVERRIDE_LIGHT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x413*/ { "SMSG_TOTEM_CREATED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x414*/ { "CMSG_TOTEM_DESTROYED", STATUS_LOGGEDIN, &WorldSession::HandleTotemDestroy },
+ /*0x415*/ { "CMSG_EXPIRE_RAID_INSTANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x416*/ { "CMSG_NO_SPELL_VARIANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x417*/ { "CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleQuestgiverStatusQueryMultipleOpcode},
+ /*0x418*/ { "SMSG_QUESTGIVER_STATUS_MULTIPLE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x419*/ { "CMSG_SET_PLAYER_DECLINED_NAMES", STATUS_AUTHED, &WorldSession::HandleDeclinedPlayerNameOpcode },
+ /*0x41A*/ { "SMSG_SET_PLAYER_DECLINED_NAMES_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x41B*/ { "CMSG_QUERY_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x41C*/ { "CMSG_CLEAR_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x41D*/ { "SMSG_SERVER_BUCK_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x41E*/ { "SMSG_SEND_UNLEARN_SPELLS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x41F*/ { "SMSG_PROPOSE_LEVEL_GRANT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x420*/ { "CMSG_ACCEPT_LEVEL_GRANT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x421*/ { "SMSG_REFER_A_FRIEND_FAILURE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x422*/ { "SMSG_SPLINE_MOVE_SET_FLYING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x423*/ { "SMSG_SPLINE_MOVE_UNSET_FLYING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x424*/ { "SMSG_SUMMON_CANCEL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x425*/ { "CMSG_CHANGE_PERSONAL_ARENA_RATING", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x426*/ { "CMSG_ALTER_APPEARANCE", STATUS_LOGGEDIN, &WorldSession::HandleAlterAppearance },
+ /*0x427*/ { "SMSG_ENABLE_BARBER_SHOP", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x428*/ { "SMSG_BARBER_SHOP_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x429*/ { "CMSG_CALENDAR_GET_CALENDAR", STATUS_LOGGEDIN, &WorldSession::HandleCalendarGetCalendar },
+ /*0x42A*/ { "CMSG_CALENDAR_GET_EVENT", STATUS_LOGGEDIN, &WorldSession::HandleCalendarGetEvent },
+ /*0x42B*/ { "CMSG_CALENDAR_GUILD_FILTER", STATUS_LOGGEDIN, &WorldSession::HandleCalendarGuildFilter },
+ /*0x42C*/ { "CMSG_CALENDAR_ARENA_TEAM", STATUS_LOGGEDIN, &WorldSession::HandleCalendarArenaTeam },
+ /*0x42D*/ { "CMSG_CALENDAR_ADD_EVENT", STATUS_LOGGEDIN, &WorldSession::HandleCalendarAddEvent },
+ /*0x42E*/ { "CMSG_CALENDAR_UPDATE_EVENT", STATUS_LOGGEDIN, &WorldSession::HandleCalendarUpdateEvent },
+ /*0x42F*/ { "CMSG_CALENDAR_REMOVE_EVENT", STATUS_LOGGEDIN, &WorldSession::HandleCalendarRemoveEvent },
+ /*0x430*/ { "CMSG_CALENDAR_COPY_EVENT", STATUS_LOGGEDIN, &WorldSession::HandleCalendarCopyEvent },
+ /*0x431*/ { "CMSG_CALENDAR_EVENT_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleCalendarEventInvite },
+ /*0x432*/ { "CMSG_CALENDAR_EVENT_RSVP", STATUS_LOGGEDIN, &WorldSession::HandleCalendarEventRsvp },
+ /*0x433*/ { "CMSG_CALENDAR_EVENT_REMOVE_INVITE", STATUS_LOGGEDIN, &WorldSession::HandleCalendarEventRemoveInvite },
+ /*0x434*/ { "CMSG_CALENDAR_EVENT_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleCalendarEventStatus },
+ /*0x435*/ { "CMSG_CALENDAR_EVENT_MODERATOR_STATUS", STATUS_LOGGEDIN, &WorldSession::HandleCalendarEventModeratorStatus},
+ /*0x436*/ { "SMSG_CALENDAR_SEND_CALENDAR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x437*/ { "SMSG_CALENDAR_SEND_EVENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x438*/ { "SMSG_CALENDAR_FILTER_GUILD", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x439*/ { "SMSG_CALENDAR_ARENA_TEAM", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43A*/ { "SMSG_CALENDAR_EVENT_INVITE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43B*/ { "SMSG_CALENDAR_EVENT_INVITE_REMOVED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43C*/ { "SMSG_CALENDAR_EVENT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43D*/ { "SMSG_CALENDAR_COMMAND_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43E*/ { "SMSG_CALENDAR_RAID_LOCKOUT_ADDED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x43F*/ { "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x440*/ { "SMSG_CALENDAR_EVENT_INVITE_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x441*/ { "SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x442*/ { "SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x443*/ { "SMSG_CALENDAR_EVENT_REMOVED_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x444*/ { "SMSG_CALENDAR_EVENT_UPDATED_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x445*/ { "SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x446*/ { "CMSG_CALENDAR_COMPLAIN", STATUS_LOGGEDIN, &WorldSession::HandleCalendarComplain },
+ /*0x447*/ { "CMSG_CALENDAR_GET_NUM_PENDING", STATUS_LOGGEDIN, &WorldSession::HandleCalendarGetNumPending },
+ /*0x448*/ { "SMSG_CALENDAR_SEND_NUM_PENDING", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x449*/ { "CMSG_SAVE_DANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x44A*/ { "SMSG_NOTIFY_DANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x44B*/ { "CMSG_PLAY_DANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x44C*/ { "SMSG_PLAY_DANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x44D*/ { "CMSG_LOAD_DANCES", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x44E*/ { "CMSG_STOP_DANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x44F*/ { "SMSG_STOP_DANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x450*/ { "CMSG_SYNC_DANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x451*/ { "CMSG_DANCE_QUERY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x452*/ { "SMSG_DANCE_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x453*/ { "SMSG_INVALIDATE_DANCE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x454*/ { "CMSG_DELETE_DANCE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x455*/ { "SMSG_LEARNED_DANCE_MOVES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x456*/ { "CMSG_LEARN_DANCE_MOVE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x457*/ { "CMSG_UNLEARN_DANCE_MOVE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x458*/ { "CMSG_SET_RUNE_COUNT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x459*/ { "CMSG_SET_RUNE_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x45A*/ { "MSG_MOVE_SET_PITCH_RATE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x45B*/ { "MSG_MOVE_SET_PITCH_RATE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x45C*/ { "SMSG_FORCE_PITCH_RATE_CHANGE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x45D*/ { "CMSG_FORCE_PITCH_RATE_CHANGE_ACK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x45E*/ { "SMSG_SPLINE_SET_PITCH_RATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x45F*/ { "SMSG_MOVE_ABANDON_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x460*/ { "MSG_MOVE_ABANDON_TRANSPORT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x461*/ { "CMSG_MOVE_ABANDON_TRANSPORT_ACK", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x462*/ { "CMSG_UPDATE_MISSILE_TRAJECTORY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x463*/ { "SMSG_UPDATE_ACCOUNT_DATA_COMPLETE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x464*/ { "SMSG_TRIGGER_MOVIE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x465*/ { "CMSG_COMPLETE_MOVIE", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x466*/ { "CMSG_SET_GLYPH_SLOT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x467*/ { "CMSG_SET_GLYPH", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x468*/ { "SMSG_ACHIEVEMENT_EARNED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x469*/ { "SMSG_DYNAMIC_DROP_ROLL_RESULT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x46A*/ { "SMSG_CRITERIA_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x46B*/ { "CMSG_QUERY_INSPECT_ACHIEVEMENTS", STATUS_LOGGEDIN, &WorldSession::HandleInspectAchievements },
+ /*0x46C*/ { "SMSG_RESPOND_INSPECT_ACHIEVEMENTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x46D*/ { "CMSG_DISMISS_CONTROLLED_VEHICLE", STATUS_LOGGEDIN, &WorldSession::HandleDismissControlledVehicle },
+ /*0x46E*/ { "CMSG_COMPLETE_ACHIEVEMENT_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x46F*/ { "SMSG_QUESTUPDATE_ADD_PVP_KILL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x470*/ { "CMSG_SET_CRITERIA_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x471*/ { "SMSG_GROUP_SWAP_FAILED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x472*/ { "CMSG_UNITANIMTIER_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x473*/ { "CMSG_CHAR_CUSTOMIZE", STATUS_AUTHED, &WorldSession::HandleCharCustomize },
+ /*0x474*/ { "SMSG_CHAR_CUSTOMIZE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x475*/ { "SMSG_PET_RENAMEABLE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x476*/ { "CMSG_REQUEST_VEHICLE_EXIT", STATUS_LOGGEDIN, &WorldSession::HandleRequestVehicleExit },
+ /*0x477*/ { "CMSG_REQUEST_VEHICLE_PREV_SEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x478*/ { "CMSG_REQUEST_VEHICLE_NEXT_SEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x479*/ { "CMSG_REQUEST_VEHICLE_SWITCH_SEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x47A*/ { "CMSG_PET_LEARN_TALENT", STATUS_LOGGEDIN, &WorldSession::HandlePetLearnTalent },
+ /*0x47B*/ { "CMSG_PET_UNLEARN_TALENTS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x47C*/ { "SMSG_SET_PHASE_SHIFT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x47D*/ { "SMSG_ALL_ACHIEVEMENT_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x47E*/ { "CMSG_FORCE_SAY_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x47F*/ { "SMSG_HEALTH_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x480*/ { "SMSG_POWER_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x481*/ { "CMSG_GAMEOBJ_REPORT_USE", STATUS_LOGGEDIN, &WorldSession::HandleGameobjectReportUse },
+ /*0x482*/ { "SMSG_HIGHEST_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x483*/ { "SMSG_THREAT_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x484*/ { "SMSG_THREAT_REMOVE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x485*/ { "SMSG_THREAT_CLEAR", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x486*/ { "SMSG_CONVERT_RUNE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x487*/ { "SMSG_RESYNC_RUNES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x488*/ { "SMSG_ADD_RUNE_POWER", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x489*/ { "CMSG_START_QUEST", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x48A*/ { "CMSG_REMOVE_GLYPH", STATUS_LOGGEDIN, &WorldSession::HandleRemoveGlyph },
+ /*0x48B*/ { "CMSG_DUMP_OBJECTS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x48C*/ { "SMSG_DUMP_OBJECTS_DATA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x48D*/ { "CMSG_DISMISS_CRITTER", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x48E*/ { "SMSG_NOTIFY_DEST_LOC_SPELL_CAST", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x48F*/ { "CMSG_AUCTION_LIST_PENDING_SALES", STATUS_LOGGEDIN, &WorldSession::HandleAuctionListPendingSales },
+ /*0x490*/ { "SMSG_AUCTION_LIST_PENDING_SALES", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x491*/ { "SMSG_MODIFY_COOLDOWN", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x492*/ { "SMSG_PET_UPDATE_COMBO_POINTS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x493*/ { "CMSG_ENABLETAXI", STATUS_LOGGEDIN, &WorldSession::HandleTaxiQueryAvailableNodes },
+ /*0x494*/ { "SMSG_PRE_RESURRECT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x495*/ { "SMSG_AURA_UPDATE_ALL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x496*/ { "SMSG_AURA_UPDATE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x497*/ { "CMSG_FLOOD_GRACE_CHEAT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x498*/ { "SMSG_SERVER_FIRST_ACHIEVEMENT", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x499*/ { "SMSG_PET_LEARNED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x49A*/ { "SMSG_PET_REMOVED_SPELL", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x49B*/ { "CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE", STATUS_LOGGEDIN, &WorldSession::HandleChangeSeatsOnControlledVehicle},
+ /*0x49C*/ { "CMSG_HEARTH_AND_RESURRECT", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x49D*/ { "SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x49E*/ { "SMSG_CRITERIA_DELETED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x49F*/ { "SMSG_ACHIEVEMENT_DELETED", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x4A0*/ { "CMSG_SERVER_INFO_QUERY", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4A1*/ { "SMSG_SERVER_INFO_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x4A2*/ { "CMSG_CHECK_LOGIN_CRITERIA", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4A5*/ { "SMSG_PET_GUIDS", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x4A6*/ { "SMSG_CLIENTCACHE_VERSION", STATUS_NEVER, &WorldSession::Handle_ServerSide },
+ /*0x4A7*/ { "UMSG_UNKNOWN_1191", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4A8*/ { "UMSG_UNKNOWN_1192", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4A9*/ { "UMSG_UNKNOWN_1193", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4AA*/ { "UMSG_UNKNOWN_1194", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4AB*/ { "UMSG_UNKNOWN_1195", STATUS_NEVER, &WorldSession::Handle_NULL },
+ /*0x4AC*/ { "UMSG_UNKNOWN_1196", STATUS_NEVER, &WorldSession::Handle_NULL },
};
diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h
index 12f9c9459fa..d57cfd62852 100644
--- a/src/game/Opcodes.h
+++ b/src/game/Opcodes.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -49,8 +49,8 @@ enum Opcodes
CMSG_ZONE_MAP = 0x00A,
SMSG_ZONE_MAP = 0x00B,
CMSG_DEBUG_CHANGECELLZONE = 0x00C,
- CMSG_EMBLAZON_TABARD_OBSOLETE = 0x00D,
- CMSG_UNEMBLAZON_TABARD_OBSOLETE = 0x00E,
+ CMSG_MOVE_CHARACTER_CHEAT = 0x00D,
+ SMSG_MOVE_CHARACTER_CHEAT = 0x00E,
CMSG_RECHARGE = 0x00F,
CMSG_LEARN_SPELL = 0x010,
CMSG_CREATEMONSTER = 0x011,
@@ -66,7 +66,7 @@ enum Opcodes
SMSG_FORCEACTIONSHOW = 0x01B,
CMSG_PETGODMODE = 0x01C,
SMSG_PETGODMODE = 0x01D,
- SMSG_DEBUGINFOSPELLMISS_OBSOLETE = 0x01E,
+ SMSG_REFER_A_FRIEND_EXPIRED = 0x01E,
CMSG_WEATHER_SPEED_CHEAT = 0x01F,
CMSG_UNDRESSPLAYER = 0x020,
CMSG_BEASTMASTER = 0x021,
@@ -86,7 +86,7 @@ enum Opcodes
SMSG_DEBUG_AISTATE = 0x02F,
CMSG_DISABLE_PVP_CHEAT = 0x030,
CMSG_ADVANCE_SPAWN_TIME = 0x031,
- CMSG_PVP_PORT_OBSOLETE = 0x032,
+ SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x032,
CMSG_AUTH_SRP6_BEGIN = 0x033,
CMSG_AUTH_SRP6_PROOF = 0x034,
CMSG_AUTH_SRP6_RECODE = 0x035,
@@ -214,7 +214,7 @@ enum Opcodes
SMSG_READ_ITEM_FAILED = 0x0AF,
SMSG_ITEM_COOLDOWN = 0x0B0,
CMSG_GAMEOBJ_USE = 0x0B1,
- CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE = 0x0B2,
+ CMSG_DESTROY_ITEMS = 0x0B2,
SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0B3,
CMSG_AREATRIGGER = 0x0B4,
MSG_MOVE_START_FORWARD = 0x0B5,
@@ -347,7 +347,7 @@ enum Opcodes
SMSG_SPELL_COOLDOWN = 0x134,
SMSG_COOLDOWN_EVENT = 0x135,
CMSG_CANCEL_AURA = 0x136,
- SMSG_UPDATE_AURA_DURATION = 0x137,
+ SMSG_UPDATE_AURA_DURATION_OBSOLETE = 0x137,
SMSG_PET_CAST_FAILED = 0x138,
MSG_CHANNEL_START = 0x139,
MSG_CHANNEL_UPDATE = 0x13A,
@@ -371,10 +371,10 @@ enum Opcodes
SMSG_DAMAGE_DONE_OBSOLETE = 0x14C,
SMSG_DAMAGE_TAKEN_OBSOLETE = 0x14D,
SMSG_CANCEL_COMBAT = 0x14E,
- SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE = 0x14F,
+ SMSG_SPELLBREAKLOG = 0x14F,
SMSG_SPELLHEALLOG = 0x150,
SMSG_SPELLENERGIZELOG = 0x151,
- CMSG_SHEATHE_OBSOLETE = 0x152,
+ SMSG_BREAK_TARGET = 0x152,
CMSG_SAVE_PLAYER = 0x153,
CMSG_SETDEATHBINDPOINT = 0x154,
SMSG_BINDPOINTUPDATE = 0x155,
@@ -578,7 +578,7 @@ enum Opcodes
SMSG_GMTICKET_SYSTEMSTATUS = 0x21B,
CMSG_SPIRIT_HEALER_ACTIVATE = 0x21C,
CMSG_SET_STAT_CHEAT = 0x21D,
- SMSG_SET_REST_START = 0x21E,
+ SMSG_SET_REST_START_OBSOLETE = 0x21E,
CMSG_SKILL_BUY_STEP = 0x21F,
CMSG_SKILL_BUY_RANK = 0x220,
CMSG_XP_CHEAT = 0x221,
@@ -733,8 +733,8 @@ enum Opcodes
SMSG_SCRIPT_MESSAGE = 0x2B6,
SMSG_DUEL_COUNTDOWN = 0x2B7,
SMSG_AREA_TRIGGER_MESSAGE = 0x2B8,
- CMSG_TOGGLE_HELM = 0x2B9,
- CMSG_TOGGLE_CLOAK = 0x2BA,
+ CMSG_SHOWING_HELM = 0x2B9,
+ CMSG_SHOWING_CLOAK = 0x2BA,
SMSG_MEETINGSTONE_JOINFAILED = 0x2BB,
SMSG_PLAYER_SKINNED = 0x2BC,
SMSG_DURABILITY_DAMAGE_DEATH = 0x2BD,
@@ -967,10 +967,10 @@ enum Opcodes
SMSG_VOICE_SESSION_ADJUST_PRIORITY = 0x3A0,
CMSG_VOICE_SET_TALKER_MUTED_REQUEST = 0x3A1,
SMSG_VOICE_SET_TALKER_MUTED = 0x3A2,
- SMSG_INIT_EXTRA_AURA_INFO = 0x3A3,
- SMSG_SET_EXTRA_AURA_INFO = 0x3A4,
- SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE = 0x3A5,
- SMSG_CLEAR_EXTRA_AURA_INFO = 0x3A6,
+ SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE = 0x3A3,
+ SMSG_SET_EXTRA_AURA_INFO_OBSOLETE = 0x3A4,
+ SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE = 0x3A5,
+ SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE = 0x3A6,
MSG_MOVE_START_DESCEND = 0x3A7,
CMSG_IGNORE_REQUIREMENTS_CHEAT = 0x3A8,
SMSG_IGNORE_REQUIREMENTS_CHEAT = 0x3A9,
@@ -980,127 +980,262 @@ enum Opcodes
MSG_MOVE_UPDATE_CAN_FLY = 0x3AD,
MSG_RAID_READY_CHECK_CONFIRM = 0x3AE,
CMSG_VOICE_SESSION_ENABLE = 0x3AF,
- SMSG_VOICE_PARENTAL_CONTROLS = 0x3B0,
- CMSG_GM_WHISPER = 0x3B1,
- SMSG_GM_MESSAGECHAT = 0x3B2,
- MSG_GM_GEARRATING = 0x3B3,
- CMSG_COMMENTATOR_ENABLE = 0x3B4,
- SMSG_COMMENTATOR_STATE_CHANGED = 0x3B5,
- CMSG_COMMENTATOR_GET_MAP_INFO = 0x3B6,
- SMSG_COMMENTATOR_MAP_INFO = 0x3B7,
- CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3B8,
- SMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3B9,
- SMSG_COMMENTATOR_PLAYER_INFO = 0x3BA,
- CMSG_COMMENTATOR_ENTER_INSTANCE = 0x3BB,
- CMSG_COMMENTATOR_EXIT_INSTANCE = 0x3BC,
- CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x3BD,
- SMSG_CLEAR_TARGET = 0x3BE,
- CMSG_BOT_DETECTED = 0x3BF,
- SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x3C0,
- CMSG_CHEAT_PLAYER_LOGIN = 0x3C1,
- CMSG_CHEAT_PLAYER_LOOKUP = 0x3C2,
- SMSG_CHEAT_PLAYER_LOOKUP = 0x3C3,
- SMSG_KICK_REASON = 0x3C4,
- MSG_RAID_READY_CHECK_FINISHED = 0x3C5,
- CMSG_COMPLAIN = 0x3C6,
- SMSG_COMPLAIN_RESULT = 0x3C7,
- SMSG_FEATURE_SYSTEM_STATUS = 0x3C8,
- CMSG_GM_SHOW_COMPLAINTS = 0x3C9,
- CMSG_GM_UNSQUELCH = 0x3CA,
- CMSG_CHANNEL_SILENCE_VOICE = 0x3CB,
- CMSG_CHANNEL_SILENCE_ALL = 0x3CC,
- CMSG_CHANNEL_UNSILENCE_VOICE = 0x3CD,
- CMSG_CHANNEL_UNSILENCE_ALL = 0x3CE,
- CMSG_TARGET_CAST = 0x3CF,
- CMSG_TARGET_SCRIPT_CAST = 0x3D0,
- CMSG_CHANNEL_DISPLAY_LIST = 0x3D1,
- CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x3D2,
- CMSG_GET_CHANNEL_MEMBER_COUNT = 0x3D3,
- SMSG_CHANNEL_MEMBER_COUNT = 0x3D4,
- CMSG_CHANNEL_VOICE_ON = 0x3D5,
- CMSG_CHANNEL_VOICE_OFF = 0x3D6,
- CMSG_DEBUG_LIST_TARGETS = 0x3D7,
- SMSG_DEBUG_LIST_TARGETS = 0x3D8,
- SMSG_AVAILABLE_VOICE_CHANNEL = 0x3D9,
- CMSG_ADD_VOICE_IGNORE = 0x3DA,
- CMSG_DEL_VOICE_IGNORE = 0x3DB,
- CMSG_PARTY_SILENCE = 0x3DC,
- CMSG_PARTY_UNSILENCE = 0x3DD,
- MSG_NOTIFY_PARTY_SQUELCH = 0x3DE,
- SMSG_COMSAT_RECONNECT_TRY = 0x3DF,
- SMSG_COMSAT_DISCONNECT = 0x3E0,
- SMSG_COMSAT_CONNECT_FAIL = 0x3E1,
- SMSG_VOICE_CHAT_STATUS = 0x3E2,
- CMSG_REPORT_PVP_AFK = 0x3E3,
- CMSG_REPORT_PVP_AFK_RESULT = 0x3E4,
- CMSG_GUILD_BANKER_ACTIVATE = 0x3E5,
- CMSG_GUILD_BANK_QUERY_TAB = 0x3E6,
- SMSG_GUILD_BANK_LIST = 0x3E7,
- CMSG_GUILD_BANK_SWAP_ITEMS = 0x3E8,
- CMSG_GUILD_BANK_BUY_TAB = 0x3E9,
- CMSG_GUILD_BANK_UPDATE_TAB = 0x3EA,
- CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x3EB,
- CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x3EC,
- MSG_GUILD_BANK_LOG_QUERY = 0x3ED,
- CMSG_SET_CHANNEL_WATCH = 0x3EE,
- SMSG_USERLIST_ADD = 0x3EF,
- SMSG_USERLIST_REMOVE = 0x3F0,
- SMSG_USERLIST_UPDATE = 0x3F1,
- CMSG_CLEAR_CHANNEL_WATCH = 0x3F2,
- SMSG_INSPECT_TALENT = 0x3F3,
- SMSG_GOGOGO_OBSOLETE = 0x3F4,
- SMSG_ECHO_PARTY_SQUELCH = 0x3F5,
- CMSG_SET_TITLE_SUFFIX = 0x3F6,
- CMSG_SPELLCLICK = 0x3F7,
- SMSG_LOOT_LIST = 0x3F8,
- CMSG_GM_CHARACTER_RESTORE = 0x3F9,
- CMSG_GM_CHARACTER_SAVE = 0x3FA,
- SMSG_VOICESESSION_FULL = 0x3FB,
- MSG_GUILD_PERMISSIONS = 0x3FC,
- MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x3FD,
- MSG_GUILD_EVENT_LOG_QUERY = 0x3FE,
- CMSG_MAELSTROM_RENAME_GUILD = 0x3FF,
- CMSG_GET_MIRRORIMAGE_DATA = 0x400,
- SMSG_MIRRORIMAGE_DATA = 0x401,
- SMSG_FORCE_DISPLAY_UPDATE = 0x402,
- SMSG_SPELL_CHANCE_RESIST_PUSHBACK = 0x403,
- CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x404,
- SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x405,
- CMSG_KEEP_ALIVE = 0x406,
- SMSG_RAID_READY_CHECK_ERROR = 0x407,
- CMSG_OPT_OUT_OF_LOOT = 0x408,
- MSG_QUERY_GUILD_BANK_TEXT = 0x409,
- CMSG_SET_GUILD_BANK_TEXT = 0x40A,
- CMSG_SET_GRANTABLE_LEVELS = 0x40B,
- CMSG_GRANT_LEVEL = 0x40C,
- CMSG_REFER_A_FRIEND = 0x40D,
- MSG_GM_CHANGE_ARENA_RATING = 0x40E,
- CMSG_DECLINE_CHANNEL_INVITE = 0x40F,
- CMSG_GROUPACTION_THROTTLED = 0x410,
- SMSG_OVERRIDE_LIGHT = 0x411,
- SMSG_TOTEM_CREATED = 0x412,
- CMSG_TOTEM_DESTROYED = 0x413,
- CMSG_EXPIRE_RAID_INSTANCE = 0x414,
- CMSG_NO_SPELL_VARIANCE = 0x415,
- CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x416,
- SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x417,
- CMSG_SET_PLAYER_DECLINED_NAMES = 0x418,
- SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x419,
- CMSG_QUERY_SERVER_BUCK_DATA = 0x41A,
- CMSG_CLEAR_SERVER_BUCK_DATA = 0x41B,
- SMSG_SERVER_BUCK_DATA = 0x41C,
- SMSG_SEND_UNLEARN_SPELLS = 0x41D,
- SMSG_PROPOSE_LEVEL_GRANT = 0x41E,
- CMSG_ACCEPT_LEVEL_GRANT = 0x41F,
- SMSG_REFER_A_FRIEND_FAILURE = 0x420,
- SMSG_SPLINE_MOVE_SET_FLYING = 0x421,
- SMSG_SPLINE_MOVE_UNSET_FLYING = 0x422,
- SMSG_SUMMON_CANCEL = 0x423
+ SMSG_VOICE_SESSION_ENABLE = 0x3B0,
+ SMSG_VOICE_PARENTAL_CONTROLS = 0x3B1,
+ CMSG_GM_WHISPER = 0x3B2,
+ SMSG_GM_MESSAGECHAT = 0x3B3,
+ MSG_GM_GEARRATING = 0x3B4,
+ CMSG_COMMENTATOR_ENABLE = 0x3B5,
+ SMSG_COMMENTATOR_STATE_CHANGED = 0x3B6,
+ CMSG_COMMENTATOR_GET_MAP_INFO = 0x3B7,
+ SMSG_COMMENTATOR_MAP_INFO = 0x3B8,
+ CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3B9,
+ SMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3BA,
+ SMSG_COMMENTATOR_PLAYER_INFO = 0x3BB,
+ CMSG_COMMENTATOR_ENTER_INSTANCE = 0x3BC,
+ CMSG_COMMENTATOR_EXIT_INSTANCE = 0x3BD,
+ CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x3BE,
+ SMSG_CLEAR_TARGET = 0x3BF,
+ CMSG_BOT_DETECTED = 0x3C0,
+ SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x3C1,
+ CMSG_CHEAT_PLAYER_LOGIN = 0x3C2,
+ CMSG_CHEAT_PLAYER_LOOKUP = 0x3C3,
+ SMSG_CHEAT_PLAYER_LOOKUP = 0x3C4,
+ SMSG_KICK_REASON = 0x3C5,
+ MSG_RAID_READY_CHECK_FINISHED = 0x3C6,
+ CMSG_COMPLAIN = 0x3C7,
+ SMSG_COMPLAIN_RESULT = 0x3C8,
+ SMSG_FEATURE_SYSTEM_STATUS = 0x3C9,
+ CMSG_GM_SHOW_COMPLAINTS = 0x3CA,
+ CMSG_GM_UNSQUELCH = 0x3CB,
+ CMSG_CHANNEL_SILENCE_VOICE = 0x3CC,
+ CMSG_CHANNEL_SILENCE_ALL = 0x3CD,
+ CMSG_CHANNEL_UNSILENCE_VOICE = 0x3CE,
+ CMSG_CHANNEL_UNSILENCE_ALL = 0x3CF,
+ CMSG_TARGET_CAST = 0x3D0,
+ CMSG_TARGET_SCRIPT_CAST = 0x3D1,
+ CMSG_CHANNEL_DISPLAY_LIST = 0x3D2,
+ CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x3D3,
+ CMSG_GET_CHANNEL_MEMBER_COUNT = 0x3D4,
+ SMSG_CHANNEL_MEMBER_COUNT = 0x3D5,
+ CMSG_CHANNEL_VOICE_ON = 0x3D6,
+ CMSG_CHANNEL_VOICE_OFF = 0x3D7,
+ CMSG_DEBUG_LIST_TARGETS = 0x3D8,
+ SMSG_DEBUG_LIST_TARGETS = 0x3D9,
+ SMSG_AVAILABLE_VOICE_CHANNEL = 0x3DA,
+ CMSG_ADD_VOICE_IGNORE = 0x3DB,
+ CMSG_DEL_VOICE_IGNORE = 0x3DC,
+ CMSG_PARTY_SILENCE = 0x3DD,
+ CMSG_PARTY_UNSILENCE = 0x3DE,
+ MSG_NOTIFY_PARTY_SQUELCH = 0x3DF,
+ SMSG_COMSAT_RECONNECT_TRY = 0x3E0,
+ SMSG_COMSAT_DISCONNECT = 0x3E1,
+ SMSG_COMSAT_CONNECT_FAIL = 0x3E2,
+ SMSG_VOICE_CHAT_STATUS = 0x3E3,
+ CMSG_REPORT_PVP_AFK = 0x3E4,
+ CMSG_REPORT_PVP_AFK_RESULT = 0x3E5,
+ CMSG_GUILD_BANKER_ACTIVATE = 0x3E6,
+ CMSG_GUILD_BANK_QUERY_TAB = 0x3E7,
+ SMSG_GUILD_BANK_LIST = 0x3E8,
+ CMSG_GUILD_BANK_SWAP_ITEMS = 0x3E9,
+ CMSG_GUILD_BANK_BUY_TAB = 0x3EA,
+ CMSG_GUILD_BANK_UPDATE_TAB = 0x3EB,
+ CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x3EC,
+ CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x3ED,
+ MSG_GUILD_BANK_LOG_QUERY = 0x3EE,
+ CMSG_SET_CHANNEL_WATCH = 0x3EF,
+ SMSG_USERLIST_ADD = 0x3F0,
+ SMSG_USERLIST_REMOVE = 0x3F1,
+ SMSG_USERLIST_UPDATE = 0x3F2,
+ CMSG_CLEAR_CHANNEL_WATCH = 0x3F3,
+ SMSG_INSPECT_TALENT = 0x3F4,
+ SMSG_GOGOGO_OBSOLETE = 0x3F5,
+ SMSG_ECHO_PARTY_SQUELCH = 0x3F6,
+ CMSG_SET_TITLE_SUFFIX = 0x3F7,
+ CMSG_SPELLCLICK = 0x3F8,
+ SMSG_LOOT_LIST = 0x3F9,
+ CMSG_GM_CHARACTER_RESTORE = 0x3FA,
+ CMSG_GM_CHARACTER_SAVE = 0x3FB,
+ SMSG_VOICESESSION_FULL = 0x3FC,
+ MSG_GUILD_PERMISSIONS = 0x3FD,
+ MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x3FE,
+ MSG_GUILD_EVENT_LOG_QUERY = 0x3FF,
+ CMSG_MAELSTROM_RENAME_GUILD = 0x400,
+ CMSG_GET_MIRRORIMAGE_DATA = 0x401,
+ SMSG_MIRRORIMAGE_DATA = 0x402,
+ SMSG_FORCE_DISPLAY_UPDATE = 0x403,
+ SMSG_SPELL_CHANCE_RESIST_PUSHBACK = 0x404,
+ CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x405,
+ SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x406,
+ CMSG_KEEP_ALIVE = 0x407,
+ SMSG_RAID_READY_CHECK_ERROR = 0x408,
+ CMSG_OPT_OUT_OF_LOOT = 0x409,
+ MSG_QUERY_GUILD_BANK_TEXT = 0x40A,
+ CMSG_SET_GUILD_BANK_TEXT = 0x40B,
+ CMSG_SET_GRANTABLE_LEVELS = 0x40C,
+ CMSG_GRANT_LEVEL = 0x40D,
+ CMSG_REFER_A_FRIEND = 0x40E,
+ MSG_GM_CHANGE_ARENA_RATING = 0x40F,
+ CMSG_DECLINE_CHANNEL_INVITE = 0x410,
+ CMSG_GROUPACTION_THROTTLED = 0x411,
+ SMSG_OVERRIDE_LIGHT = 0x412,
+ SMSG_TOTEM_CREATED = 0x413,
+ CMSG_TOTEM_DESTROYED = 0x414,
+ CMSG_EXPIRE_RAID_INSTANCE = 0x415,
+ CMSG_NO_SPELL_VARIANCE = 0x416,
+ CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x417,
+ SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x418,
+ CMSG_SET_PLAYER_DECLINED_NAMES = 0x419,
+ SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x41A,
+ CMSG_QUERY_SERVER_BUCK_DATA = 0x41B,
+ CMSG_CLEAR_SERVER_BUCK_DATA = 0x41C,
+ SMSG_SERVER_BUCK_DATA = 0x41D,
+ SMSG_SEND_UNLEARN_SPELLS = 0x41E,
+ SMSG_PROPOSE_LEVEL_GRANT = 0x41F,
+ CMSG_ACCEPT_LEVEL_GRANT = 0x420,
+ SMSG_REFER_A_FRIEND_FAILURE = 0x421,
+ SMSG_SPLINE_MOVE_SET_FLYING = 0x422,
+ SMSG_SPLINE_MOVE_UNSET_FLYING = 0x423,
+ SMSG_SUMMON_CANCEL = 0x424,
+ CMSG_CHANGE_PERSONAL_ARENA_RATING = 0x425,
+ CMSG_ALTER_APPEARANCE = 0x426,
+ SMSG_ENABLE_BARBER_SHOP = 0x427,
+ SMSG_BARBER_SHOP_RESULT = 0x428,
+ CMSG_CALENDAR_GET_CALENDAR = 0x429,
+ CMSG_CALENDAR_GET_EVENT = 0x42A,
+ CMSG_CALENDAR_GUILD_FILTER = 0x42B,
+ CMSG_CALENDAR_ARENA_TEAM = 0x42C,
+ CMSG_CALENDAR_ADD_EVENT = 0x42D,
+ CMSG_CALENDAR_UPDATE_EVENT = 0x42E,
+ CMSG_CALENDAR_REMOVE_EVENT = 0x42F,
+ CMSG_CALENDAR_COPY_EVENT = 0x430,
+ CMSG_CALENDAR_EVENT_INVITE = 0x431,
+ CMSG_CALENDAR_EVENT_RSVP = 0x432,
+ CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x433,
+ CMSG_CALENDAR_EVENT_STATUS = 0x434,
+ CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x435,
+ SMSG_CALENDAR_SEND_CALENDAR = 0x436,
+ SMSG_CALENDAR_SEND_EVENT = 0x437,
+ SMSG_CALENDAR_FILTER_GUILD = 0x438,
+ SMSG_CALENDAR_ARENA_TEAM = 0x439,
+ SMSG_CALENDAR_EVENT_INVITE = 0x43A,
+ SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x43B,
+ SMSG_CALENDAR_EVENT_STATUS = 0x43C,
+ SMSG_CALENDAR_COMMAND_RESULT = 0x43D,
+ SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x43E,
+ SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x43F,
+ SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x440,
+ SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x441,
+ SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x442,
+ SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x443,
+ SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x444,
+ SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x445,
+ CMSG_CALENDAR_COMPLAIN = 0x446,
+ CMSG_CALENDAR_GET_NUM_PENDING = 0x447,
+ SMSG_CALENDAR_SEND_NUM_PENDING = 0x448,
+ CMSG_SAVE_DANCE = 0x449,
+ SMSG_NOTIFY_DANCE = 0x44A,
+ CMSG_PLAY_DANCE = 0x44B,
+ SMSG_PLAY_DANCE = 0x44C,
+ CMSG_LOAD_DANCES = 0x44D,
+ CMSG_STOP_DANCE = 0x44E,
+ SMSG_STOP_DANCE = 0x44F,
+ CMSG_SYNC_DANCE = 0x450,
+ CMSG_DANCE_QUERY = 0x451,
+ SMSG_DANCE_QUERY_RESPONSE = 0x452,
+ SMSG_INVALIDATE_DANCE = 0x453,
+ CMSG_DELETE_DANCE = 0x454,
+ SMSG_LEARNED_DANCE_MOVES = 0x455,
+ CMSG_LEARN_DANCE_MOVE = 0x456,
+ CMSG_UNLEARN_DANCE_MOVE = 0x457,
+ CMSG_SET_RUNE_COUNT = 0x458,
+ CMSG_SET_RUNE_COOLDOWN = 0x459,
+ MSG_MOVE_SET_PITCH_RATE_CHEAT = 0x45A,
+ MSG_MOVE_SET_PITCH_RATE = 0x45B,
+ SMSG_FORCE_PITCH_RATE_CHANGE = 0x45C,
+ CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x45D,
+ SMSG_SPLINE_SET_PITCH_RATE = 0x45E,
+ SMSG_MOVE_ABANDON_TRANSPORT = 0x45F,
+ MSG_MOVE_ABANDON_TRANSPORT = 0x460,
+ CMSG_MOVE_ABANDON_TRANSPORT_ACK = 0x461,
+ CMSG_UPDATE_MISSILE_TRAJECTORY = 0x462,
+ SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x463,
+ SMSG_TRIGGER_MOVIE = 0x464,
+ CMSG_COMPLETE_MOVIE = 0x465,
+ CMSG_SET_GLYPH_SLOT = 0x466,
+ CMSG_SET_GLYPH = 0x467,
+ SMSG_ACHIEVEMENT_EARNED = 0x468,
+ SMSG_DYNAMIC_DROP_ROLL_RESULT = 0x469,
+ SMSG_CRITERIA_UPDATE = 0x46A,
+ CMSG_QUERY_INSPECT_ACHIEVEMENTS = 0x46B,
+ SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x46C,
+ CMSG_DISMISS_CONTROLLED_VEHICLE = 0x46D,
+ CMSG_COMPLETE_ACHIEVEMENT_CHEAT = 0x46E,
+ SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x46F,
+ CMSG_SET_CRITERIA_CHEAT = 0x470,
+ SMSG_GROUP_SWAP_FAILED = 0x471,
+ CMSG_UNITANIMTIER_CHEAT = 0x472,
+ CMSG_CHAR_CUSTOMIZE = 0x473,
+ SMSG_CHAR_CUSTOMIZE = 0x474,
+ SMSG_PET_RENAMEABLE = 0x475,
+ CMSG_REQUEST_VEHICLE_EXIT = 0x476,
+ CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x477,
+ CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x478,
+ CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x479,
+ CMSG_PET_LEARN_TALENT = 0x47A,
+ CMSG_PET_UNLEARN_TALENTS = 0x47B,
+ SMSG_SET_PHASE_SHIFT = 0x47C,
+ SMSG_ALL_ACHIEVEMENT_DATA = 0x47D,
+ CMSG_FORCE_SAY_CHEAT = 0x47E,
+ SMSG_HEALTH_UPDATE = 0x47F,
+ SMSG_POWER_UPDATE = 0x480,
+ CMSG_GAMEOBJ_REPORT_USE = 0x481,
+ SMSG_HIGHEST_THREAT_UPDATE = 0x482,
+ SMSG_THREAT_UPDATE = 0x483,
+ SMSG_THREAT_REMOVE = 0x484,
+ SMSG_THREAT_CLEAR = 0x485,
+ SMSG_CONVERT_RUNE = 0x486,
+ SMSG_RESYNC_RUNES = 0x487,
+ SMSG_ADD_RUNE_POWER = 0x488,
+ CMSG_START_QUEST = 0x489,
+ CMSG_REMOVE_GLYPH = 0x48A,
+ CMSG_DUMP_OBJECTS = 0x48B,
+ SMSG_DUMP_OBJECTS_DATA = 0x48C,
+ CMSG_DISMISS_CRITTER = 0x48D,
+ SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x48E,
+ CMSG_AUCTION_LIST_PENDING_SALES = 0x48F,
+ SMSG_AUCTION_LIST_PENDING_SALES = 0x490,
+ SMSG_MODIFY_COOLDOWN = 0x491,
+ SMSG_PET_UPDATE_COMBO_POINTS = 0x492,
+ CMSG_ENABLETAXI = 0x493,
+ SMSG_PRE_RESURRECT = 0x494,
+ SMSG_AURA_UPDATE_ALL = 0x495,
+ SMSG_AURA_UPDATE = 0x496,
+ CMSG_FLOOD_GRACE_CHEAT = 0x497,
+ SMSG_SERVER_FIRST_ACHIEVEMENT = 0x498,
+ SMSG_PET_LEARNED_SPELL = 0x499,
+ SMSG_PET_REMOVED_SPELL = 0x49A,
+ CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x49B,
+ CMSG_HEARTH_AND_RESURRECT = 0x49C,
+ SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x49D,
+ SMSG_CRITERIA_DELETED = 0x49E,
+ SMSG_ACHIEVEMENT_DELETED = 0x49F,
+ CMSG_SERVER_INFO_QUERY = 0x4A0,
+ SMSG_SERVER_INFO_RESPONSE = 0x4A1,
+ CMSG_CHECK_LOGIN_CRITERIA = 0x4A2,
+ SMSG_SERVER_BUCK_DATA_START = 0x4A3,
+ CMSG_QUERY_VEHICLE_STATUS = 0x4A4,
+ SMSG_PET_GUIDS = 0x4A5,
+ SMSG_CLIENTCACHE_VERSION = 0x4A6,
+ UMSG_UNKNOWN_1191 = 0x4A7,
+ UMSG_UNKNOWN_1192 = 0x4A8,
+ UMSG_UNKNOWN_1193 = 0x4A9,
+ UMSG_UNKNOWN_1194 = 0x4AA,
+ UMSG_UNKNOWN_1195 = 0x4AB,
+ UMSG_UNKNOWN_1196 = 0x4AC,
+ NUM_MSG_TYPES = 0x4AD
};
-// Don't forget to change this value and add opcode name to Opcodes.cpp when you add new opcode!
-#define NUM_MSG_TYPES 0x424
-
/// Player state
enum SessionStatus
{
diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp
index 99b1c9a55f0..d702ea6d047 100644
--- a/src/game/OutdoorPvP.cpp
+++ b/src/game/OutdoorPvP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -95,7 +95,7 @@ bool OutdoorPvPObjective::AddObject(uint32 type, uint32 entry, uint32 map, float
if(!pMap)
return true;
GameObject * go = new GameObject;
- if(!go->Create(guid,entry, pMap,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
+ if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
{
sLog.outError("Gameobject template %u not found in database.", entry);
delete go;
@@ -156,20 +156,19 @@ bool OutdoorPvPObjective::AddCreature(uint32 type, uint32 entry, uint32 teamval,
if(!pMap)
return true;
Creature* pCreature = new Creature;
- if (!pCreature->Create(guid, pMap, entry, teamval))
+ if (!pCreature->Create(guid, pMap, PHASEMASK_NORMAL, entry, teamval))
{
sLog.outError("Can't create creature entry: %u",entry);
delete pCreature;
- return true;
+ return false;
}
- pCreature->AIM_Initialize();
-
pCreature->Relocate(x, y, z, o);
if(!pCreature->IsPositionValid())
{
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ delete pCreature;
return false;
}
@@ -256,7 +255,7 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo
return true;
// add GO...
GameObject * go = new GameObject;
- if(!go->Create(guid,entry, pMap,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
+ if(!go->Create(guid,entry, pMap,PHASEMASK_NORMAL,x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,1))
{
sLog.outError("Gameobject template %u not found in database.", entry);
delete go;
@@ -269,20 +268,20 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo
}
// add creature...
Creature* pCreature = new Creature;
- if (!pCreature->Create(creature_guid, pMap, OPVP_TRIGGER_CREATURE_ENTRY, 0))
+ if (!pCreature->Create(creature_guid, pMap, PHASEMASK_NORMAL, OPVP_TRIGGER_CREATURE_ENTRY, 0))
{
sLog.outError("Can't create creature entry: %u",entry);
delete pCreature;
+ return false;
}
else
{
- pCreature->AIM_Initialize();
-
pCreature->Relocate(x, y, z, o);
if(!pCreature->IsPositionValid())
{
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
+ delete pCreature;
return false;
}
@@ -315,8 +314,8 @@ bool OutdoorPvPObjective::DelCreature(uint32 type)
// explicit removal from map
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
- if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
- map->Remove(cr,false);
+ //if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
+ // map->Remove(cr,false);
// delete respawn time for this creature
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
cr->AddObjectToRemoveList();
@@ -373,8 +372,8 @@ bool OutdoorPvPObjective::DelCapturePoint()
// explicit removal from map
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
- if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
- map->Remove(cr,false);
+ //if(Map * map = MapManager::Instance().FindMap(cr->GetMapId()))
+ // map->Remove(cr,false);
// delete respawn time for this creature
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
cr->AddObjectToRemoveList();
diff --git a/src/game/OutdoorPvP.h b/src/game/OutdoorPvP.h
index e7bd21059a7..c1c39c1ff65 100644
--- a/src/game/OutdoorPvP.h
+++ b/src/game/OutdoorPvP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPEP.cpp b/src/game/OutdoorPvPEP.cpp
index 41747dba100..f0ff85574c0 100644
--- a/src/game/OutdoorPvPEP.cpp
+++ b/src/game/OutdoorPvPEP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPEP.h b/src/game/OutdoorPvPEP.h
index ae242a1da16..08d31de5cf5 100644
--- a/src/game/OutdoorPvPEP.h
+++ b/src/game/OutdoorPvPEP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#include "OutdoorPvP.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
diff --git a/src/game/OutdoorPvPHP.cpp b/src/game/OutdoorPvPHP.cpp
index b31f79a6288..6058b82c102 100644
--- a/src/game/OutdoorPvPHP.cpp
+++ b/src/game/OutdoorPvPHP.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPHP.h b/src/game/OutdoorPvPHP.h
index da41761d572..a538f82b216 100644
--- a/src/game/OutdoorPvPHP.h
+++ b/src/game/OutdoorPvPHP.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPMgr.cpp b/src/game/OutdoorPvPMgr.cpp
index 5c53bf4eaba..2050a6c11f7 100644
--- a/src/game/OutdoorPvPMgr.cpp
+++ b/src/game/OutdoorPvPMgr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -143,7 +143,6 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player *plr, uint32 zoneid)
}
// add possibly beneficial buffs to plr for zone
itr->second->HandlePlayerEnterZone(plr, zoneid);
- plr->SendInitWorldStates();
sLog.outDebug("Player %u entered outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId());
}
diff --git a/src/game/OutdoorPvPMgr.h b/src/game/OutdoorPvPMgr.h
index 7426876b42b..28b01c586b7 100644
--- a/src/game/OutdoorPvPMgr.h
+++ b/src/game/OutdoorPvPMgr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPNA.cpp b/src/game/OutdoorPvPNA.cpp
index 9b59347dd2d..9030337f2cd 100644
--- a/src/game/OutdoorPvPNA.cpp
+++ b/src/game/OutdoorPvPNA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPNA.h b/src/game/OutdoorPvPNA.h
index b6be2270cda..92e0b9dcbbb 100644
--- a/src/game/OutdoorPvPNA.h
+++ b/src/game/OutdoorPvPNA.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPObjectiveAI.cpp b/src/game/OutdoorPvPObjectiveAI.cpp
index 7c4fd5e6de8..233fffd6b2f 100644
--- a/src/game/OutdoorPvPObjectiveAI.cpp
+++ b/src/game/OutdoorPvPObjectiveAI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPObjectiveAI.h b/src/game/OutdoorPvPObjectiveAI.h
index d21655795e9..dffd8885243 100644
--- a/src/game/OutdoorPvPObjectiveAI.h
+++ b/src/game/OutdoorPvPObjectiveAI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ class Creature;
class TRINITY_DLL_DECL OutdoorPvPObjectiveAI : public NullCreatureAI
{
public:
- OutdoorPvPObjectiveAI(Creature *c);
+ explicit OutdoorPvPObjectiveAI(Creature *c);
void MoveInLineOfSight(Unit *);
diff --git a/src/game/OutdoorPvPSI.cpp b/src/game/OutdoorPvPSI.cpp
index 378543da48e..2bd35ef5a54 100644
--- a/src/game/OutdoorPvPSI.cpp
+++ b/src/game/OutdoorPvPSI.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -129,7 +129,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
switch(trigger)
{
case SI_AREATRIGGER_A:
- if(plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG,0))
+ if(plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
@@ -148,13 +148,13 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
// add 19 honor
plr->RewardHonor(NULL,1,19);
// add 20 cenarion circle repu
- plr->ModifyFactionReputation(609,20);
+ plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
// complete quest
plr->KilledMonster(SI_TURNIN_QUEST_CM_A,0);
}
return true;
case SI_AREATRIGGER_H:
- if(plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG,0))
+ if(plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
@@ -173,7 +173,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
// add 19 honor
plr->RewardHonor(NULL,1,19);
// add 20 cenarion circle repu
- plr->ModifyFactionReputation(609,20);
+ plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
// complete quest
plr->KilledMonster(SI_TURNIN_QUEST_CM_H,0);
}
@@ -202,7 +202,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr);
if(!map)
return true;
- if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
+ if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
{
delete go;
}
@@ -228,7 +228,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr);
if(!map)
return true;
- if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
+ if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
{
delete go;
}
diff --git a/src/game/OutdoorPvPSI.h b/src/game/OutdoorPvPSI.h
index 4b0b5da357e..1f2331b4251 100644
--- a/src/game/OutdoorPvPSI.h
+++ b/src/game/OutdoorPvPSI.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPTF.cpp b/src/game/OutdoorPvPTF.cpp
index b94bc9246ee..01b224cffa9 100644
--- a/src/game/OutdoorPvPTF.cpp
+++ b/src/game/OutdoorPvPTF.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPZM.cpp b/src/game/OutdoorPvPZM.cpp
index b220f6a778f..29997eec920 100644
--- a/src/game/OutdoorPvPZM.cpp
+++ b/src/game/OutdoorPvPZM.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/OutdoorPvPZM.h b/src/game/OutdoorPvPZM.h
index b9d5ae7bc2e..405c0133b5c 100644
--- a/src/game/OutdoorPvPZM.h
+++ b/src/game/OutdoorPvPZM.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Path.h b/src/game/Path.h
index 2b793aed892..2fd6723b01c 100644
--- a/src/game/Path.h
+++ b/src/game/Path.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 6b5ff6c1543..59d02af930a 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,12 +21,10 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
-#include "WorldSession.h"
#include "WorldPacket.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Pet.h"
-#include "MapManager.h"
#include "Formulas.h"
#include "SpellAuras.h"
#include "CreatureAI.h"
@@ -41,71 +39,30 @@ char const* petTypeSuffix[MAX_PET_TYPE] =
"'s Companion" // MINI_PET
};
-//numbers represent minutes * 100 while happy (you get 100 loyalty points per min while happy)
-uint32 const LevelUpLoyalty[6] =
-{
- 5500,
- 11500,
- 17000,
- 23500,
- 31000,
- 39500,
-};
-
-uint32 const LevelStartLoyalty[6] =
-{
- 2000,
- 4500,
- 7000,
- 10000,
- 13500,
- 17500,
-};
+#define PET_XP_FACTOR 0.1f
-Pet::Pet(PetType type) : Creature()
+Pet::Pet(Player *owner, PetType type) : Guardian(NULL, owner),
+m_petType(type), m_removed(false), m_happinessTimer(7500), m_duration(0),
+m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0), m_auraRaidUpdateMask(0), m_loading(false),
+m_declinedname(NULL), m_owner(owner)
{
- m_isPet = true;
+ m_summonMask |= SUMMON_MASK_PET;
m_name = "Pet";
- m_petType = type;
-
- m_removed = false;
m_regenTimer = 4000;
- m_happinessTimer = 7500;
- m_loyaltyTimer = 12000;
- m_duration = 0;
- m_bonusdamage = 0;
-
- m_loyaltyPoints = 0;
- m_TrainingPoints = 0;
- m_resetTalentsCost = 0;
- m_resetTalentsTime = 0;
- m_auraUpdateMask = 0;
-
- // pets always have a charminfo, even if they are not actually charmed
- CharmInfo* charmInfo = InitCharmInfo();
-
- if(type == MINI_PET || type == POSSESSED_PET) // always passive
+ if(type == POSSESSED_PET) // always passive
SetReactState(REACT_PASSIVE);
- else if(type == GUARDIAN_PET) // always aggressive
- SetReactState(REACT_AGGRESSIVE);
-
- m_spells.clear();
- m_Auras.clear();
- m_CreatureSpellCooldowns.clear();
- m_CreatureCategoryCooldowns.clear();
- m_autospells.clear();
- m_declinedname = NULL;
- //m_isActive = true;
}
Pet::~Pet()
{
if(m_uint32Values) // only for fully created Object
{
+ if(GetOwnerGUID())
+ sLog.outCrash("Pet %u is deconstructed but it still has owner guid", GetEntry());
+
for (PetSpellMap::iterator i = m_spells.begin(); i != m_spells.end(); ++i)
delete i->second;
- ObjectAccessor::Instance().RemoveObject(this);
}
delete m_declinedname;
@@ -115,9 +72,11 @@ void Pet::AddToWorld()
{
///- Register the pet for guid lookup
if(!IsInWorld())
- {
+ {
+ ///- Register the pet for guid lookup
ObjectAccessor::Instance().AddObject(this);
Unit::AddToWorld();
+ AIM_Initialize();
}
}
@@ -126,32 +85,42 @@ void Pet::RemoveFromWorld()
///- Remove the pet from the accessor
if(IsInWorld())
{
- ObjectAccessor::Instance().RemoveObject(this);
///- Don't call the function for Creature, normal mobs + totems go in a different storage
Unit::RemoveFromWorld();
+ ObjectAccessor::Instance().RemoveObject(this);
}
}
-bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool current )
+bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool current )
{
+ m_loading = true;
+
uint32 ownerid = owner->GetGUIDLow();
QueryResult *result;
- if(petnumber)
- // known petnumber entry 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
- result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType FROM character_pet WHERE owner = '%u' AND id = '%u'",ownerid, petnumber);
- else if(current)
- // current pet (slot 0) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
- result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType FROM character_pet WHERE owner = '%u' AND slot = '0'",ownerid );
- else if(petentry)
+ if (petnumber)
+ // known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+ result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, talentpoints, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
+ "FROM character_pet WHERE owner = '%u' AND id = '%u'",
+ ownerid, petnumber);
+ else if (current)
+ // current pet (slot 0) 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+ result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, talentpoints, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
+ "FROM character_pet WHERE owner = '%u' AND slot = '%u'",
+ ownerid, PET_SAVE_AS_CURRENT );
+ else if (petentry)
// known petentry entry (unique for summoned pet, but non unique for hunter pet (only from current or not stabled pets)
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
- result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '0' OR slot = '3') ",ownerid, petentry );
+ // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+ result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, talentpoints, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
+ "FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ",
+ ownerid, petentry,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
else
// any current or other non-stabled pet (for hunter "call pet")
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
- result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType FROM character_pet WHERE owner = '%u' AND (slot = '0' OR slot = '3') ",ownerid);
+ // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+ result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, talentpoints, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
+ "FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ",
+ ownerid,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
if(!result)
return false;
@@ -160,28 +129,36 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
// update for case of current pet "slot = 0"
petentry = fields[1].GetUInt32();
- if(!petentry)
+ if (!petentry)
{
delete result;
return false;
}
- uint32 summon_spell_id = fields[21].GetUInt32();
+ uint32 summon_spell_id = fields[19].GetUInt32();
SpellEntry const* spellInfo = sSpellStore.LookupEntry(summon_spell_id);
bool is_temporary_summoned = spellInfo && GetSpellDuration(spellInfo) > 0;
// check temporary summoned pets like mage water elemental
- if(current && is_temporary_summoned)
+ if (current && is_temporary_summoned)
+ {
+ delete result;
+ return false;
+ }
+
+ uint32 pet_number = fields[0].GetUInt32();
+
+ if (current && owner->IsPetNeedBeTemporaryUnsummoned())
{
+ owner->SetTemporaryUnsummonedPetNumber(pet_number);
delete result;
return false;
}
Map *map = owner->GetMap();
uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_PET);
- uint32 pet_number = fields[0].GetUInt32();
- if(!Create(guid, map, petentry, pet_number))
+ if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
{
delete result;
return false;
@@ -189,97 +166,115 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
float px, py, pz;
owner->GetClosePoint(px, py, pz, GetObjectSize(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
-
Relocate(px, py, pz, owner->GetOrientation());
- if(!IsPositionValid())
+ if (!IsPositionValid())
{
- sLog.outError("ERROR: Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog.outError("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
delete result;
return false;
}
- setPetType(PetType(fields[22].GetUInt8()));
- SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,owner->getFaction());
+ setPetType(PetType(fields[20].GetUInt8()));
+ SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureInfo const *cinfo = GetCreatureInfo();
- if(cinfo->type == CREATURE_TYPE_CRITTER)
+ if (cinfo->type == CREATURE_TYPE_CRITTER)
{
- AIM_Initialize();
map->Add((Creature*)this);
delete result;
return true;
}
- if(getPetType()==HUNTER_PET || (getPetType()==SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK))
+
+ if (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK))
m_charmInfo->SetPetNumber(pet_number, true);
else
m_charmInfo->SetPetNumber(pet_number, false);
- SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner->GetGUID());
+
+ // set current pet as current
+ // 0=current
+ // 1..MAX_PET_STABLES in stable slot
+ // PET_SAVE_NOT_IN_SLOT(100) = not stable slot (summoning))
+ if(fields[8].GetUInt32() != 0)
+ {
+ CharacterDatabase.BeginTransaction();
+ CharacterDatabase.PExecute("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u' AND id <> '%u'",
+ PET_SAVE_NOT_IN_SLOT, ownerid, PET_SAVE_AS_CURRENT, m_charmInfo->GetPetNumber());
+ CharacterDatabase.PExecute("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND id = '%u'",
+ PET_SAVE_AS_CURRENT, ownerid, m_charmInfo->GetPetNumber());
+ CharacterDatabase.CommitTransaction();
+ }
+
SetDisplayId(fields[3].GetUInt32());
SetNativeDisplayId(fields[3].GetUInt32());
- uint32 petlevel=fields[4].GetUInt32();
- SetUInt32Value(UNIT_NPC_FLAGS , 0);
- SetName(fields[11].GetString());
+ uint32 petlevel = fields[4].GetUInt32();
+ SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ SetName(fields[9].GetString());
- switch(getPetType())
+ switch (getPetType())
{
-
case SUMMON_PET:
petlevel=owner->getLevel();
- SetUInt32Value(UNIT_FIELD_BYTES_0,2048);
+ SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
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);
- SetByteValue(UNIT_FIELD_BYTES_1, 1, fields[8].GetUInt32());
- SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5 );
-
- if(fields[12].GetBool())
- SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED);
- else
- SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
+ SetByteValue(UNIT_FIELD_BYTES_1, 1, fields[7].GetUInt32());
+ SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ SetByteValue(UNIT_FIELD_BYTES_2, 2, fields[10].GetBool() ? UNIT_RENAME_NOT_ALLOWED : UNIT_RENAME_ALLOWED);
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// this enables popup window (pet abandon, cancel)
- SetTP(fields[9].GetInt32());
- SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS));
- SetPower( POWER_HAPPINESS,fields[15].GetUInt32());
+ SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS));
+ SetPower(POWER_HAPPINESS, fields[13].GetUInt32());
setPowerType(POWER_FOCUS);
break;
default:
- sLog.outError("Pet have incorrect type (%u) for pet loading.",getPetType());
+ sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType());
}
- InitStatsForLevel( petlevel);
+
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
- SetUInt64Value(UNIT_FIELD_CREATEDBY, owner->GetGUID());
+ SetCreatorGUID(owner->GetGUID());
SetReactState( ReactStates( fields[6].GetUInt8() ));
- m_loyaltyPoints = fields[7].GetInt32();
- uint32 savedhealth = fields[13].GetUInt32();
- uint32 savedmana = fields[14].GetUInt32();
-
- // set current pet as current
- if(fields[10].GetUInt32() != 0)
+ SetCanModifyStats(true);
+ InitStatsForLevel(petlevel);
+ uint32 savedhealth = fields[11].GetUInt32();
+ uint32 savedmana = fields[12].GetUInt32();
+ if(getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current
{
- CharacterDatabase.BeginTransaction();
- CharacterDatabase.PExecute("UPDATE character_pet SET slot = '3' WHERE owner = '%u' AND slot = '0' AND id <> '%u'",ownerid, m_charmInfo->GetPetNumber());
- CharacterDatabase.PExecute("UPDATE character_pet SET slot = '0' WHERE owner = '%u' AND id = '%u'",ownerid, m_charmInfo->GetPetNumber());
- CharacterDatabase.CommitTransaction();
+ SetHealth(GetMaxHealth());
+ SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
}
+ else
+ {
+ SetHealth(savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth);
+ SetPower(POWER_MANA, savedmana > GetMaxPower(POWER_MANA) ? GetMaxPower(POWER_MANA) : savedmana);
+ }
+
+ map->Add((Creature*)this);
+ owner->SetGuardian(this, true);
+
+ m_resetTalentsCost = fields[17].GetUInt32();
+ m_resetTalentsTime = fields[18].GetUInt64();
+ learnLevelupSpells();
+ LearnPetPassives();
+ _LoadSpells();
+ _LoadSpellCooldowns();
- if(!is_temporary_summoned)
+ if (!is_temporary_summoned)
{
// permanent controlled pets store state in DB
- Tokens tokens = StrSplit(fields[16].GetString(), " ");
+ Tokens tokens = StrSplit(fields[14].GetString(), " ");
- if(tokens.size() != 20)
+ if (tokens.size() != 20)
{
delete result;
return false;
@@ -295,12 +290,18 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
// patch for old data where some spells have ACT_DECIDE but should have ACT_CAST
// so overwrite old state
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction);
- if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET) m_charmInfo->GetActionBarEntry(index)->Type = ACT_CAST;
+ if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction))
+ {
+ if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
+ m_charmInfo->GetActionBarEntry(index)->Type = ACT_DISABLED;
+
+ if(m_charmInfo->GetActionBarEntry(index)->Type == ACT_ENABLED)
+ ToggleAutocast(spellInfo->Id, true);
+ }
}
//init teach spells
- tokens = StrSplit(fields[17].GetString(), " ");
+ tokens = StrSplit(fields[15].GetString(), " ");
for (iter = tokens.begin(), index = 0; index < 4; ++iter, ++index)
{
uint32 tmp = atol((*iter).c_str());
@@ -314,56 +315,22 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
}
}
- // since last save (in seconds)
- uint32 timediff = (time(NULL) - fields[18].GetUInt32());
-
- delete result;
-
//load spells/cooldowns/auras
- SetCanModifyStats(true);
+ // Spells should be loaded after pet is added to map, because in CheckCast is check on it
+ // since last save (in seconds)
+ uint32 timediff = (time(NULL) - fields[16].GetUInt32());
_LoadAuras(timediff);
+ CastPetAuras(current);
- //init AB
- if(is_temporary_summoned)
- {
- // Temporary summoned pets always have initial spell list at load
- InitPetCreateSpells();
- }
- else
- {
- LearnPetPassives();
- CastPetAuras(current);
- }
-
- if(getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current
- {
- SetHealth(GetMaxHealth());
- SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
- }
- else
- {
- SetHealth(savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth);
- SetPower(POWER_MANA, savedmana > GetMaxPower(POWER_MANA) ? GetMaxPower(POWER_MANA) : savedmana);
- }
-
- AIM_Initialize();
- map->Add((Creature*)this);
-
- // Spells should be loaded after pet is added to map, because in CanCast is check on it
- _LoadSpells();
- _LoadSpellCooldowns();
-
- owner->SetPet(this); // in DB stored only full controlled creature
+ delete result;
sLog.outDebug("New Pet has guid %u", GetGUIDLow());
- if(owner->GetTypeId() == TYPEID_PLAYER)
- {
- ((Player*)owner)->PetSpellInitialize();
- if(((Player*)owner)->GetGroup())
- ((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_PET);
- }
+ owner->PetSpellInitialize();
+
+ if(owner->GetGroup())
+ owner->SetGroupUpdateFlag(GROUP_UPDATE_PET);
- if(owner->GetTypeId() == TYPEID_PLAYER && getPetType() == HUNTER_PET)
+ if(getPetType() == HUNTER_PET)
{
result = CharacterDatabase.PQuery("SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", owner->GetGUIDLow(), GetCharmInfo()->GetPetNumber());
@@ -381,120 +348,118 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
}
}
+ m_loading = false;
return true;
}
void Pet::SavePetToDB(PetSaveMode mode)
{
- if(!GetEntry())
+ if (!GetEntry())
return;
// save only fully controlled creature
- if(!isControlled())
+ if (!isControlled())
return;
+ // not save not player pets
+ if(!IS_PLAYER_GUID(GetOwnerGUID()))
+ return;
+
+ Player* pOwner = (Player*)GetOwner();
+ if (!pOwner)
+ return;
+
+ // not save pet as current if another pet temporary unsummoned
+ if (mode == PET_SAVE_AS_CURRENT && pOwner->GetTemporaryUnsummonedPetNumber() &&
+ pOwner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
+ {
+ // pet will lost anyway at restore temporary unsummoned
+ if(getPetType()==HUNTER_PET)
+ return;
+
+ // for warlock case
+ mode = PET_SAVE_NOT_IN_SLOT;
+ }
+
uint32 curhealth = GetHealth();
uint32 curmana = GetPower(POWER_MANA);
- switch(mode)
+ // stable and not in slot saves
+ if(mode > PET_SAVE_AS_CURRENT)
{
- case PET_SAVE_IN_STABLE_SLOT_1:
- case PET_SAVE_IN_STABLE_SLOT_2:
- case PET_SAVE_NOT_IN_SLOT:
- {
- RemoveAllAuras();
-
- //only alive hunter pets get auras saved, the others don't
- if(!(getPetType() == HUNTER_PET && isAlive()))
- m_Auras.clear();
- }
- default:
- break;
+ RemoveAllAuras();
}
_SaveSpells();
_SaveSpellCooldowns();
_SaveAuras();
- switch(mode)
+ // current/stable/not_in_slot
+ if(mode >= PET_SAVE_AS_CURRENT)
{
- case PET_SAVE_AS_CURRENT:
- case PET_SAVE_IN_STABLE_SLOT_1:
- case PET_SAVE_IN_STABLE_SLOT_2:
- case PET_SAVE_NOT_IN_SLOT:
+ uint32 owner = GUID_LOPART(GetOwnerGUID());
+ std::string name = m_name;
+ CharacterDatabase.escape_string(name);
+ CharacterDatabase.BeginTransaction();
+ // remove current data
+ CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner,m_charmInfo->GetPetNumber() );
+
+ // prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT)
+ if(mode <= PET_SAVE_LAST_STABLE_SLOT)
+ CharacterDatabase.PExecute("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u'",
+ PET_SAVE_NOT_IN_SLOT, owner, uint32(mode) );
+
+ // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT
+ if(getPetType()==HUNTER_PET && (mode==PET_SAVE_AS_CURRENT||mode > PET_SAVE_LAST_STABLE_SLOT))
+ CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')",
+ owner,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
+ // save pet
+ std::ostringstream ss;
+ ss << "INSERT INTO character_pet ( id, entry, owner, modelid, level, exp, Reactstate, talentpoints, slot, name, renamed, curhealth, curmana, curhappiness, abdata, TeachSpelldata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType) "
+ << "VALUES ("
+ << m_charmInfo->GetPetNumber() << ", "
+ << GetEntry() << ", "
+ << owner << ", "
+ << GetNativeDisplayId() << ", "
+ << getLevel() << ", "
+ << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ", "
+ << uint32(GetReactState()) << ", "
+ << uint32(GetFreeTalentPoints()) << ", "
+ << uint32(mode) << ", '"
+ << name.c_str() << "', "
+ << uint32((GetByteValue(UNIT_FIELD_BYTES_2, 2) == UNIT_RENAME_ALLOWED)?0:1) << ", "
+ << (curhealth<1?1:curhealth) << ", "
+ << curmana << ", "
+ << GetPower(POWER_HAPPINESS) << ", '";
+
+ for(uint32 i = 0; i < 10; i++)
+ ss << uint32(m_charmInfo->GetActionBarEntry(i)->Type) << " " << uint32(m_charmInfo->GetActionBarEntry(i)->SpellOrAction) << " ";
+ ss << "', '";
+
+ //save spells the pet can teach to it's Master
{
- uint32 loyalty =1;
- if(getPetType()!=HUNTER_PET)
- loyalty = GetLoyaltyLevel();
-
- uint32 owner = GUID_LOPART(GetOwnerGUID());
- std::string name = m_name;
- CharacterDatabase.escape_string(name);
- CharacterDatabase.BeginTransaction();
- // remove current data
- CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner,m_charmInfo->GetPetNumber() );
-
- // prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT)
- if(mode!=PET_SAVE_NOT_IN_SLOT)
- CharacterDatabase.PExecute("UPDATE character_pet SET slot = 3 WHERE owner = '%u' AND slot = '%u'", owner, uint32(mode) );
-
- // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT
- if(getPetType()==HUNTER_PET && (mode==PET_SAVE_AS_CURRENT||mode==PET_SAVE_NOT_IN_SLOT))
- CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '0' OR slot = '3')", owner );
- // save pet
- std::ostringstream ss;
- ss << "INSERT INTO character_pet ( id, entry, owner, modelid, level, exp, Reactstate, loyaltypoints, loyalty, trainpoint, slot, name, renamed, curhealth, curmana, curhappiness, abdata,TeachSpelldata,savetime,resettalents_cost,resettalents_time,CreatedBySpell,PetType) "
- << "VALUES ("
- << m_charmInfo->GetPetNumber() << ", "
- << GetEntry() << ", "
- << owner << ", "
- << GetNativeDisplayId() << ", "
- << getLevel() << ", "
- << GetUInt32Value(UNIT_FIELD_PETEXPERIENCE) << ", "
- << uint32(GetReactState()) << ", "
- << m_loyaltyPoints << ", "
- << GetLoyaltyLevel() << ", "
- << m_TrainingPoints << ", "
- << uint32(mode) << ", '"
- << name.c_str() << "', "
- << uint32((GetByteValue(UNIT_FIELD_BYTES_2, 2) == UNIT_RENAME_ALLOWED)?0:1) << ", "
- << (curhealth<1?1:curhealth) << ", "
- << curmana << ", "
- << GetPower(POWER_HAPPINESS) << ", '";
-
- for(uint32 i = 0; i < 10; i++)
- ss << uint32(m_charmInfo->GetActionBarEntry(i)->Type) << " " << uint32(m_charmInfo->GetActionBarEntry(i)->SpellOrAction) << " ";
- ss << "', '";
-
- //save spells the pet can teach to it's Master
- {
- int i = 0;
- for(TeachSpellMap::iterator itr = m_teachspells.begin(); i < 4 && itr != m_teachspells.end(); ++i, ++itr)
- ss << itr->first << " " << itr->second << " ";
- for(; i < 4; ++i)
- ss << uint32(0) << " " << uint32(0) << " ";
- }
-
- ss << "', "
- << time(NULL) << ", "
- << uint32(m_resetTalentsCost) << ", "
- << uint64(m_resetTalentsTime) << ", "
- << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", "
- << uint32(getPetType()) << ")";
+ int i = 0;
+ for(TeachSpellMap::iterator itr = m_teachspells.begin(); i < 4 && itr != m_teachspells.end(); ++i, ++itr)
+ ss << itr->first << " " << itr->second << " ";
+ for(; i < 4; ++i)
+ ss << uint32(0) << " " << uint32(0) << " ";
+ }
- CharacterDatabase.Execute( ss.str().c_str() );
+ ss << "', "
+ << time(NULL) << ", "
+ << uint32(m_resetTalentsCost) << ", "
+ << uint64(m_resetTalentsTime) << ", "
+ << GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", "
+ << uint32(getPetType()) << ")";
- CharacterDatabase.CommitTransaction();
- break;
- }
- case PET_SAVE_AS_DELETED:
- {
- RemoveAllAuras();
- DeleteFromDB(m_charmInfo->GetPetNumber());
- break;
- }
- default:
- sLog.outError("Unknown pet save/remove mode: %d",mode);
+ CharacterDatabase.Execute( ss.str().c_str() );
+ CharacterDatabase.CommitTransaction();
+ }
+ // delete
+ else
+ {
+ RemoveAllAuras();
+ DeleteFromDB(m_charmInfo->GetPetNumber());
}
}
@@ -512,11 +477,7 @@ void Pet::setDeathState(DeathState s) // overwrite virtual
Creature::setDeathState(s);
if(getDeathState()==CORPSE)
{
- //remove summoned pet (no corpse)
- if(getPetType()==SUMMON_PET)
- Remove(PET_SAVE_NOT_IN_SLOT);
- // other will despawn at corpse desppawning (Pet::Update code)
- else
+ if(getPetType() == HUNTER_PET)
{
// pet corpse non lootable and non skinnable
SetUInt32Value( UNIT_DYNAMIC_FLAGS, 0x00 );
@@ -527,12 +488,12 @@ void Pet::setDeathState(DeathState s) // overwrite virtual
if(!mapEntry || (mapEntry->map_type != MAP_ARENA && mapEntry->map_type != MAP_BATTLEGROUND))
ModifyPower(POWER_HAPPINESS, -HAPPINESS_LEVEL_SIZE);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
}
else if(getDeathState()==ALIVE)
{
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
CastPetAuras(true);
}
}
@@ -546,9 +507,8 @@ void Pet::Update(uint32 diff)
{
case CORPSE:
{
- if( m_deathTimer <= diff )
+ if(getPetType() != HUNTER_PET || m_deathTimer <= diff )
{
- assert(getPetType()!=SUMMON_PET && "Must be already removed.");
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
return;
}
@@ -557,8 +517,9 @@ void Pet::Update(uint32 diff)
case ALIVE:
{
// unsummon pet that lost owner
- Unit* owner = GetOwner();
+ Player* owner = GetOwner();
if(!owner || (!IsWithinDistInMap(owner, OWNER_MAX_DISTANCE) && !isPossessed()) || isControlled() && !owner->GetPetGUID())
+ //if(!owner || (!IsWithinDistInMap(owner, OWNER_MAX_DISTANCE) && (owner->GetCharmGUID() && (owner->GetCharmGUID() != GetGUID()))) || (isControlled() && !owner->GetPetGUID()))
{
Remove(PET_SAVE_NOT_IN_SLOT, true);
return;
@@ -568,6 +529,7 @@ void Pet::Update(uint32 diff)
{
if( owner->GetPetGUID() != GetGUID() )
{
+ sLog.outError("Pet %u is not pet of owner %u, removed", GetEntry(), m_owner->GetName());
Remove(getPetType()==HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
return;
}
@@ -604,14 +566,6 @@ void Pet::Update(uint32 diff)
else
m_happinessTimer -= diff;
- if(m_loyaltyTimer <= diff)
- {
- TickLoyaltyChange();
- m_loyaltyTimer = 12000;
- }
- else
- m_loyaltyTimer -= diff;
-
break;
}
default:
@@ -630,10 +584,10 @@ void Pet::RegenerateFocus()
float addvalue = 24 * sWorld.getRate(RATE_POWER_FOCUS);
- AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
- for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue == POWER_FOCUS)
- addvalue *= ((*i)->GetModifierValue() + 100) / 100.0f;
+ AuraEffectList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
+ for(AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
+ if ((*i)->GetMiscValue() == POWER_FOCUS)
+ addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
ModifyPower(POWER_FOCUS, (int32)addvalue);
}
@@ -643,83 +597,12 @@ void Pet::LooseHappiness()
uint32 curValue = GetPower(POWER_HAPPINESS);
if (curValue <= 0)
return;
- int32 addvalue = (140 >> GetLoyaltyLevel()) * 125; //value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs)
+ int32 addvalue = 670; //value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs)
if(isInCombat()) //we know in combat happiness fades faster, multiplier guess
addvalue = int32(addvalue * 1.5);
ModifyPower(POWER_HAPPINESS, -addvalue);
}
-void Pet::ModifyLoyalty(int32 addvalue)
-{
- uint32 loyaltylevel = GetLoyaltyLevel();
-
- if(addvalue > 0) //only gain influenced, not loss
- addvalue = int32((float)addvalue * sWorld.getRate(RATE_LOYALTY));
-
- if(loyaltylevel >= BEST_FRIEND && (addvalue + m_loyaltyPoints) > int32(GetMaxLoyaltyPoints(loyaltylevel)))
- return;
-
- m_loyaltyPoints += addvalue;
-
- if(m_loyaltyPoints < 0)
- {
- if(loyaltylevel > REBELLIOUS)
- {
- //level down
- --loyaltylevel;
- SetLoyaltyLevel(LoyaltyLevel(loyaltylevel));
- m_loyaltyPoints = GetStartLoyaltyPoints(loyaltylevel);
- SetTP(m_TrainingPoints - int32(getLevel()));
- }
- else
- {
- m_loyaltyPoints = 0;
- Unit* owner = GetOwner();
- if(owner && owner->GetTypeId() == TYPEID_PLAYER)
- {
- WorldPacket data(SMSG_PET_BROKEN, 0);
- ((Player*)owner)->GetSession()->SendPacket(&data);
-
- //run away
- ((Player*)owner)->RemovePet(this,PET_SAVE_AS_DELETED);
- }
- }
- }
- //level up
- else if(m_loyaltyPoints > int32(GetMaxLoyaltyPoints(loyaltylevel)))
- {
- ++loyaltylevel;
- SetLoyaltyLevel(LoyaltyLevel(loyaltylevel));
- m_loyaltyPoints = GetStartLoyaltyPoints(loyaltylevel);
- SetTP(m_TrainingPoints + getLevel());
- }
-}
-
-void Pet::TickLoyaltyChange()
-{
- int32 addvalue;
-
- switch(GetHappinessState())
- {
- case HAPPY: addvalue = 20; break;
- case CONTENT: addvalue = 10; break;
- case UNHAPPY: addvalue = -20; break;
- default:
- return;
- }
- ModifyLoyalty(addvalue);
-}
-
-void Pet::KillLoyaltyBonus(uint32 level)
-{
- if(level > 100)
- return;
-
- //at lower levels gain is faster | the lower loyalty the more loyalty is gained
- uint32 bonus = uint32(((100 - level) / 10) + (6 - GetLoyaltyLevel()));
- ModifyLoyalty(bonus);
-}
-
HappinessState Pet::GetHappinessState()
{
if(GetPower(POWER_HAPPINESS) < HAPPINESS_LEVEL_SIZE)
@@ -730,11 +613,6 @@ HappinessState Pet::GetHappinessState()
return CONTENT;
}
-void Pet::SetLoyaltyLevel(LoyaltyLevel level)
-{
- SetByteValue(UNIT_FIELD_BYTES_1, 1, level);
-}
-
bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
{
uint8 activecount = 1;
@@ -771,102 +649,9 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
return true;
}
-bool Pet::HasTPForSpell(uint32 spellid)
-{
- int32 neededtrainp = GetTPForSpell(spellid);
- if((m_TrainingPoints - neededtrainp < 0 || neededtrainp < 0) && neededtrainp != 0)
- return false;
- return true;
-}
-
-int32 Pet::GetTPForSpell(uint32 spellid)
-{
- uint32 basetrainp = 0;
-
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spellid);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spellid);
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- if(!_spell_idx->second->reqtrainpoints)
- return 0;
-
- basetrainp = _spell_idx->second->reqtrainpoints;
- break;
- }
-
- uint32 spenttrainp = 0;
- uint32 chainstart = spellmgr.GetFirstSpellInChain(spellid);
-
- for (PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
- {
- if(itr->second->state == PETSPELL_REMOVED)
- continue;
-
- if(spellmgr.GetFirstSpellInChain(itr->first) == chainstart)
- {
- SkillLineAbilityMap::const_iterator _lower = spellmgr.GetBeginSkillLineAbilityMap(itr->first);
- SkillLineAbilityMap::const_iterator _upper = spellmgr.GetEndSkillLineAbilityMap(itr->first);
-
- for(SkillLineAbilityMap::const_iterator _spell_idx2 = _lower; _spell_idx2 != _upper; ++_spell_idx2)
- {
- if(_spell_idx2->second->reqtrainpoints > spenttrainp)
- {
- spenttrainp = _spell_idx2->second->reqtrainpoints;
- break;
- }
- }
- }
- }
-
- return int32(basetrainp) - int32(spenttrainp);
-}
-
-uint32 Pet::GetMaxLoyaltyPoints(uint32 level)
-{
- return LevelUpLoyalty[level - 1];
-}
-
-uint32 Pet::GetStartLoyaltyPoints(uint32 level)
-{
- return LevelStartLoyalty[level - 1];
-}
-
-void Pet::SetTP(int32 TP)
-{
- m_TrainingPoints = TP;
- SetUInt32Value(UNIT_TRAINING_POINTS, (uint32)GetDispTP());
-}
-
-int32 Pet::GetDispTP()
-{
- if(getPetType()!= HUNTER_PET)
- return(0);
- if(m_TrainingPoints < 0)
- return -m_TrainingPoints;
- else
- return -(m_TrainingPoints + 1);
-}
-
void Pet::Remove(PetSaveMode mode, bool returnreagent)
{
- Unit* owner = GetOwner();
-
- if(owner)
- {
- if(owner->GetTypeId()==TYPEID_PLAYER)
- {
- ((Player*)owner)->RemovePet(this,mode,returnreagent);
- return;
- }
-
- // only if current pet in slot
- if(owner->GetPetGUID()==GetGUID())
- owner->SetPet(0);
- }
-
- CleanupsBeforeDelete();
- AddObjectToRemoveList();
- m_removed = true;
+ m_owner->RemovePet(this,mode,returnreagent);
}
void Pet::GivePetXP(uint32 xp)
@@ -901,7 +686,7 @@ void Pet::GivePetXP(uint32 xp)
newXP -= nextLvlXP;
SetLevel( level + 1 );
- SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(level+1))/4));
+ SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
level = getLevel();
nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP);
@@ -909,9 +694,6 @@ void Pet::GivePetXP(uint32 xp)
}
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, newXP);
-
- if(getPetType() == HUNTER_PET)
- KillLoyaltyBonus(level);
}
void Pet::GivePetLevel(uint32 level)
@@ -919,16 +701,15 @@ void Pet::GivePetLevel(uint32 level)
if(!level)
return;
- InitStatsForLevel( level);
-
- SetTP(m_TrainingPoints + (GetLoyaltyLevel() - 1));
+ InitStatsForLevel(level);
+ InitTalentForLevel();
}
bool Pet::CreateBaseAtCreature(Creature* creature)
{
if(!creature)
{
- sLog.outError("CRITICAL ERROR: NULL pointer parsed into CreateBaseAtCreature()");
+ sLog.outError("CRITICAL: NULL pointer parsed into CreateBaseAtCreature()");
return false;
}
uint32 guid=objmgr.GenerateLowGuid(HIGHGUID_PET);
@@ -938,14 +719,14 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
sLog.outDebug("Create pet");
uint32 pet_number = objmgr.GeneratePetNumber();
- if(!Create(guid, creature->GetMap(), creature->GetEntry(), pet_number))
+ if(!Create(guid, creature->GetMap(), creature->GetPhaseMask(), creature->GetEntry(), pet_number))
return false;
Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
if(!IsPositionValid())
{
- sLog.outError("ERROR: Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog.outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -953,15 +734,10 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
CreatureInfo const *cinfo = GetCreatureInfo();
if(!cinfo)
{
- sLog.outError("ERROR: CreateBaseAtCreature() failed, creatureInfo is missing!");
+ sLog.outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
return false;
}
- if(cinfo->type == CREATURE_TYPE_CRITTER)
- {
- setPetType(MINI_PET);
- return true;
- }
SetDisplayId(creature->GetDisplayId());
SetNativeDisplayId(creature->GetNativeDisplayId());
SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS));
@@ -969,45 +745,44 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
setPowerType(POWER_FOCUS);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
- SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(creature->getLevel()))/4));
- SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())*PET_XP_FACTOR);
SetUInt32Value(UNIT_NPC_FLAGS, 0);
- CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family);
- if( char* familyname = cFamily->Name[sWorld.GetDefaultDbcLocale()] )
- SetName(familyname);
+ if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
+ SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
else
- SetName(creature->GetName());
+ SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex()));
- m_loyaltyPoints = 1000;
if(cinfo->type == CREATURE_TYPE_BEAST)
{
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5 );
SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
-
- SetUInt32Value(UNIT_MOD_CAST_SPEED, creature->GetUInt32Value(UNIT_MOD_CAST_SPEED) );
- SetLoyaltyLevel(REBELLIOUS);
+ SetUInt32Value(UNIT_MOD_CAST_SPEED, creature->GetUInt32Value(UNIT_MOD_CAST_SPEED));
}
return true;
}
-bool Pet::InitStatsForLevel(uint32 petlevel)
+bool Guardian::InitStatsForLevel(uint32 petlevel)
{
CreatureInfo const *cinfo = GetCreatureInfo();
assert(cinfo);
- Unit* owner = GetOwner();
- if(!owner)
+ SetLevel(petlevel);
+
+ //Determine pet type
+ PetType petType = MAX_PET_TYPE;
+ if(HasSummonMask(SUMMON_MASK_PET) && m_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog.outError("ERROR: attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry);
- return false;
+ if(m_owner->getClass() == CLASS_WARLOCK)
+ petType = SUMMON_PET;
+ else if(m_owner->getClass() == CLASS_HUNTER)
+ petType = HUNTER_PET;
+ else
+ sLog.outError("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
}
- uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->Entry;
-
- SetLevel(petlevel);
+ uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry;
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
@@ -1019,8 +794,9 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0);
+ //scale
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family);
- if(cFamily && cFamily->minScale > 0.0f && getPetType()==HUNTER_PET)
+ if(cFamily && cFamily->minScale > 0.0f && petType==HUNTER_PET)
{
float scale;
if (getLevel() >= cFamily->maxScaleLevel)
@@ -1032,11 +808,10 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
SetFloatValue(OBJECT_FIELD_SCALE_X, scale);
}
- m_bonusdamage = 0;
+ //resistance
int32 createResistance[MAX_SPELL_SCHOOL] = {0,0,0,0,0,0,0};
-
- if(cinfo && getPetType() != HUNTER_PET)
+ if(cinfo && petType != HUNTER_PET)
{
createResistance[SPELL_SCHOOL_HOLY] = cinfo->resistance1;
createResistance[SPELL_SCHOOL_FIRE] = cinfo->resistance2;
@@ -1045,158 +820,125 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
createResistance[SPELL_SCHOOL_SHADOW] = cinfo->resistance5;
createResistance[SPELL_SCHOOL_ARCANE] = cinfo->resistance6;
}
+ for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
- switch(getPetType())
+ //health, mana, armor and resistance
+ PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
+ if(pInfo) // exist in DB
{
- case SUMMON_PET:
- {
- if(owner->GetTypeId() == TYPEID_PLAYER)
- {
- switch(owner->getClass())
- {
- case CLASS_WARLOCK:
- {
+ SetCreateHealth(pInfo->health);
+ if(petType != HUNTER_PET) //hunter pet use focus
+ SetCreateMana(pInfo->mana);
- //the damage bonus used for pets is either fire or shadow damage, whatever is higher
- uint32 fire = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
- uint32 shadow = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
- uint32 val = (fire > shadow) ? fire : shadow;
+ if(pInfo->armor > 0)
+ SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor));
- SetBonusDamage(int32 (val * 0.15f));
- //bonusAP += val * 0.57;
- break;
- }
- case CLASS_MAGE:
- {
- //40% damage bonus of mage's frost damage
- float val = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) * 0.4;
- if(val < 0)
- val = 0;
- SetBonusDamage( int32(val));
- break;
- }
- default:
- break;
- }
- }
+ for(int stat = 0; stat < MAX_STATS; ++stat)
+ SetCreateStat(Stats(stat), float(pInfo->stats[stat]));
+ }
+ else // not exist in DB, use some default fake data
+ {
+ // remove elite bonuses included in DB values
+ //SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
+ //SetCreateMana( uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
+
+ SetCreateStat(STAT_STRENGTH, 22);
+ SetCreateStat(STAT_AGILITY, 22);
+ SetCreateStat(STAT_STAMINA, 25);
+ SetCreateStat(STAT_INTELLECT, 28);
+ SetCreateStat(STAT_SPIRIT, 27);
+ }
+
+ m_bonusdamage = 0;
+ switch(petType)
+ {
+ case SUMMON_PET:
+ {
+ //the damage bonus used for pets is either fire or shadow damage, whatever is higher
+ uint32 fire = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
+ uint32 shadow = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
+ uint32 val = (fire > shadow) ? fire : shadow;
+ SetBonusDamage(int32 (val * 0.15f));
+ //bonusAP += val * 0.57;
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)) );
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));
-
- PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
- if(pInfo) // exist in DB
- {
- SetCreateHealth(pInfo->health);
- SetCreateMana(pInfo->mana);
-
- if(pInfo->armor > 0)
- SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor));
-
- for(int stat = 0; stat < MAX_STATS; ++stat)
- {
- SetCreateStat(Stats(stat), float(pInfo->stats[stat]));
- }
- }
- else // not exist in DB, use some default fake data
- {
- sLog.outErrorDb("Summoned pet (Entry: %u) not have pet stats data in DB",cinfo->Entry);
-
- // remove elite bonuses included in DB values
- SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
- SetCreateMana( uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
-
- SetCreateStat(STAT_STRENGTH, 22);
- SetCreateStat(STAT_AGILITY, 22);
- SetCreateStat(STAT_STAMINA, 25);
- SetCreateStat(STAT_INTELLECT, 28);
- SetCreateStat(STAT_SPIRIT, 27);
- }
break;
}
case HUNTER_PET:
{
- SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((Trinity::XP::xp_to_level(petlevel))/4));
-
+ SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
//these formula may not be correct; however, it is designed to be close to what it should be
//this makes dps 0.5 of pets level
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
//damage range is then petlevel / 2
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)) );
//damage is increased afterwards as strength and pet scaling modify attack power
-
- //stored standard pet stats are entry 1 in pet_levelinfo
- PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
- if(pInfo) // exist in DB
- {
- SetCreateHealth(pInfo->health);
- SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor));
- //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));
-
- for( int i = STAT_STRENGTH; i < MAX_STATS; i++)
- {
- SetCreateStat(Stats(i), float(pInfo->stats[i]));
- }
- }
- else // not exist in DB, use some default fake data
- {
- sLog.outErrorDb("Hunter pet levelstats missing in DB");
-
- // remove elite bonuses included in DB values
- SetCreateHealth( uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
-
- SetCreateStat(STAT_STRENGTH, 22);
- SetCreateStat(STAT_AGILITY, 22);
- SetCreateStat(STAT_STAMINA, 25);
- SetCreateStat(STAT_INTELLECT, 28);
- SetCreateStat(STAT_SPIRIT, 27);
- }
break;
}
- case GUARDIAN_PET:
- SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
- SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
-
+ default:
+ {
switch(GetEntry())
{
+ case 510: // mage Water Elemental
+ {
+ //40% damage bonus of mage's frost damage
+ float val = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) * 0.4;
+ if(val < 0)
+ val = 0;
+ SetBonusDamage( int32(val));
+ break;
+ }
case 1964: //force of nature
- SetCreateHealth(30 + 30*petlevel);
+ {
+ if(!pInfo)
+ SetCreateHealth(30 + 30*petlevel);
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - (petlevel / 2)));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + (petlevel / 2)));
break;
+ }
case 15352: //earth elemental 36213
- SetCreateHealth(100 + 120*petlevel);
+ {
+ if(!pInfo)
+ SetCreateHealth(100 + 120*petlevel);
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
break;
+ }
case 15438: //fire elemental
- SetCreateHealth(40*petlevel);
- SetCreateMana(28 + 10*petlevel);
+ {
+ if(!pInfo)
+ {
+ SetCreateHealth(40*petlevel);
+ SetCreateMana(28 + 10*petlevel);
+ }
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel));
break;
+ }
default:
- SetCreateMana(28 + 10*petlevel);
- SetCreateHealth(28 + 30*petlevel);
-
- // FIXME: this is wrong formula, possible each guardian pet have own damage formula
- //these formula may not be correct; however, it is designed to be close to what it should be
- //this makes dps 0.5 of pets level
- SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
- //damage range is then petlevel / 2
- SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
+ {
+ if(!pInfo)
+ {
+ SetCreateMana(28 + 10*petlevel);
+ SetCreateHealth(28 + 30*petlevel);
+ }
+ // FIXME: this is wrong formula, possible each guardian pet have own damage formula
+ //these formula may not be correct; however, it is designed to be close to what it should be
+ //this makes dps 0.5 of pets level
+ SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
+ //damage range is then petlevel / 2
+ SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
break;
+ }
}
break;
- default:
- sLog.outError("Pet have incorrect type (%u) for levelup.", getPetType());
- break;
+ }
}
- for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
-
UpdateAllStats();
SetHealth(GetMaxHealth());
@@ -1272,7 +1014,7 @@ void Pet::_LoadSpellCooldowns()
continue;
data << uint32(spell_id);
- data << uint32(uint32(db_time-curTime)*1000); // in m.secs
+ data << uint32(uint32(db_time-curTime)*IN_MILISECONDS);
_AddCreatureSpellCooldown(spell_id,db_time);
@@ -1310,7 +1052,7 @@ void Pet::_SaveSpellCooldowns()
void Pet::_LoadSpells()
{
- QueryResult *result = CharacterDatabase.PQuery("SELECT spell,slot,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
+ QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
if(result)
{
@@ -1318,7 +1060,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
- addSpell(fields[0].GetUInt16(), fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16());
+ addSpell(fields[0].GetUInt32(), fields[1].GetUInt16(), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@@ -1335,7 +1077,7 @@ void Pet::_SaveSpells()
if (itr->second->state == PETSPELL_REMOVED || itr->second->state == PETSPELL_CHANGED)
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first);
if (itr->second->state == PETSPELL_NEW || itr->second->state == PETSPELL_CHANGED)
- CharacterDatabase.PExecute("INSERT INTO pet_spell (guid,spell,slot,active) VALUES ('%u', '%u', '%u','%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second->slotId,itr->second->active);
+ CharacterDatabase.PExecute("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second->active);
if (itr->second->state == PETSPELL_REMOVED)
_removeSpell(itr->first);
@@ -1346,45 +1088,39 @@ void Pet::_SaveSpells()
void Pet::_LoadAuras(uint32 timediff)
{
+ sLog.outDebug("Loading auras for pet %u",GetGUIDLow());
m_Auras.clear();
for (int i = 0; i < TOTAL_AURAS; i++)
m_modAuras[i].clear();
- // all aura related fields
- for(int i = UNIT_FIELD_AURA; i <= UNIT_FIELD_AURASTATE; ++i)
- SetUInt32Value(i, 0);
-
- QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
+ QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
if(result)
{
do
{
+ int32 damage[3];
Field *fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
- uint32 effindex = fields[2].GetUInt32();
- uint32 stackcount= fields[3].GetUInt32();
- int32 damage = (int32)fields[4].GetUInt32();
- int32 maxduration = (int32)fields[5].GetUInt32();
- int32 remaintime = (int32)fields[6].GetUInt32();
- int32 remaincharges = (int32)fields[7].GetUInt32();
+ uint32 effmask = fields[2].GetUInt32();
+ uint32 stackcount = fields[3].GetUInt32();
+ damage[0] = int32(fields[4].GetUInt32());
+ damage[1] = int32(fields[5].GetUInt32());
+ damage[2] = int32(fields[6].GetUInt32());
+ int32 maxduration = (int32)fields[7].GetUInt32();
+ int32 remaintime = (int32)fields[8].GetUInt32();
+ int32 remaincharges = (int32)fields[9].GetUInt32();
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if(!spellproto)
{
- sLog.outError("Unknown aura (spellid %u, effindex %u), ignore.",spellid,effindex);
- continue;
- }
-
- if(effindex >= 3)
- {
- sLog.outError("Invalid effect index (spellid %u, effindex %u), ignore.",spellid,effindex);
+ sLog.outError("Unknown aura (spellid %u), ignore.",spellid);
continue;
}
// negative effects should continue counting down after logout
- if (remaintime != -1 && !IsPositiveEffect(spellid, effindex))
+ if (remaintime != -1 && !IsPositiveSpell(spellid))
{
if(remaintime <= int32(timediff))
continue;
@@ -1399,21 +1135,12 @@ void Pet::_LoadAuras(uint32 timediff)
remaincharges = spellproto->procCharges;
}
else
- remaincharges = -1;
+ remaincharges = 0;
- /// do not load single target auras (unless they were cast by the player)
- if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto))
- continue;
-
- for(uint32 i=0; i<stackcount; i++)
- {
- Aura* aura = CreateAura(spellproto, effindex, NULL, this, NULL);
-
- if(!damage)
- damage = aura->GetModifier()->m_amount;
- aura->SetLoadedState(caster_guid,damage,maxduration,remaintime,remaincharges);
- AddAura(aura);
- }
+ Aura* aura = new Aura(spellproto, effmask, NULL, this, NULL, NULL);
+ aura->SetLoadedState(caster_guid,maxduration,remaintime,remaincharges, stackcount, &damage[0]);
+ AddAura(aura);
+ sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
while( result->NextRow() );
@@ -1426,56 +1153,36 @@ void Pet::_SaveAuras()
CharacterDatabase.PExecute("DELETE FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber());
AuraMap const& auras = GetAuras();
- if (auras.empty())
- return;
-
- spellEffectPair lastEffectPair = auras.begin()->first;
- uint32 stackCounter = 1;
-
- for(AuraMap::const_iterator itr = auras.begin(); ; ++itr)
+ for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
{
- if(itr == auras.end() || lastEffectPair != itr->first)
- {
- AuraMap::const_iterator itr2 = itr;
- // save previous spellEffectPair to db
- itr2--;
- SpellEntry const *spellInfo = itr2->second->GetSpellProto();
- /// do not save single target auras (unless they were cast by the player)
- if (!(itr2->second->GetCasterGUID() != GetGUID() && IsSingleTargetSpell(spellInfo)))
- {
- if(!itr2->second->IsPassive())
- {
- // skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
- uint8 i;
- for (i = 0; i < 3; i++)
- if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH ||
- spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_OWNER ||
- spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PET )
- break;
-
- if (i == 3)
- {
- CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
- "VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
- m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->m_procCharges));
- }
- }
- }
- if(itr == auras.end())
- break;
- }
+ // skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
+ // do not save single target auras (unless they were cast by the player)
+ if (itr->second->IsPassive() || itr->second->IsAuraType(SPELL_AURA_MOD_STEALTH))
+ continue;
+ bool isCaster = itr->second->GetCasterGUID() == GetGUID();
+ if (!isCaster)
+ if (itr->second->IsSingleTarget()
+ || itr->second->IsAreaAura())
+ continue;
- if (lastEffectPair == itr->first)
- stackCounter++;
- else
+ uint32 amounts[MAX_SPELL_EFFECTS];
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
- lastEffectPair = itr->first;
- stackCounter = 1;
+ if (AuraEffect * partAura = itr->second->GetPartAura(i))
+ amounts[i]=partAura->GetAmount();
+ else
+ amounts[i]=0;
}
+
+ CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2,maxduration,remaintime,remaincharges) "
+ "VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
+ m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(),(uint32)itr->second->GetId(), (uint32)itr->second->GetEffectMask(),
+ (uint32)itr->second->GetStackAmount(), amounts[0], amounts[1], amounts[2]
+ ,int(itr->second->GetAuraMaxDuration()),int(itr->second->GetAuraDuration()),int(itr->second->GetAuraCharges()));
}
}
-bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 slot_id, PetSpellType type)
+bool Pet::addSpell(uint32 spell_id, uint16 active, PetSpellState state, PetSpellType type)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
@@ -1494,7 +1201,7 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 s
// same spells don't have autocast option
if (spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
- active = ACT_CAST;
+ active = ACT_DISABLED;
PetSpellMap::iterator itr = m_spells.find(spell_id);
if (itr != m_spells.end())
@@ -1531,40 +1238,45 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 s
else
newspell->active = active;
- uint32 chainstart = spellmgr.GetFirstSpellInChain(spell_id);
-
- for (PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
+ // talent: unlearn all other talent ranks (high and low)
+ if(TalentSpellPos const* talentPos = GetTalentSpellPos(spell_id))
{
- if(itr->second->state == PETSPELL_REMOVED) continue;
-
- if(spellmgr.GetFirstSpellInChain(itr->first) == chainstart)
+ if(TalentEntry const *talentInfo = sTalentStore.LookupEntry( talentPos->talent_id ))
{
- slot_id = itr->second->slotId;
- newspell->active = itr->second->active;
-
- if(newspell->active == ACT_ENABLED)
- ToggleAutocast(itr->first, false);
+ for(int i=0; i < MAX_TALENT_RANK; ++i)
+ {
+ // skip learning spell and no rank spell case
+ uint32 rankSpellId = talentInfo->RankID[i];
+ if(!rankSpellId || rankSpellId==spell_id)
+ continue;
- oldspell_id = itr->first;
- removeSpell(itr->first);
+ // skip unknown ranks
+ if(!HasSpell(rankSpellId))
+ continue;
+ removeSpell(rankSpellId);
+ }
}
}
-
- uint16 tmpslot=slot_id;
-
- if (tmpslot == 0xffff)
+ else if(uint32 chainstart = spellmgr.GetFirstSpellInChain(spell_id))
{
- uint16 maxid = 0;
- PetSpellMap::iterator itr;
- for (itr = m_spells.begin(); itr != m_spells.end(); ++itr)
+ for (PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{
if(itr->second->state == PETSPELL_REMOVED) continue;
- if (itr->second->slotId > maxid) maxid = itr->second->slotId;
+
+ if(spellmgr.GetFirstSpellInChain(itr->first) == chainstart)
+ {
+ newspell->active = itr->second->active;
+
+ if(newspell->active == ACT_ENABLED)
+ ToggleAutocast(itr->first, false);
+
+ oldspell_id = itr->first;
+ unlearnSpell(itr->first);
+ break;
+ }
}
- tmpslot = maxid + 1;
}
- newspell->slotId = tmpslot;
m_spells[spell_id] = newspell;
if (IsPassiveSpell(spell_id))
@@ -1575,29 +1287,70 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 s
if(newspell->active == ACT_ENABLED)
ToggleAutocast(spell_id, true);
+ uint32 talentCost = GetTalentSpellCost(spell_id);
+ if (talentCost)
+ {
+ int32 free_points = GetMaxTalentPointsForLevel(getLevel());
+ m_usedTalentCount+=talentCost;
+ // update free talent points
+ free_points-=m_usedTalentCount;
+ SetFreeTalentPoints(free_points > 0 ? free_points : 0);
+ }
return true;
}
-bool Pet::learnSpell(uint16 spell_id)
+bool Pet::learnSpell(uint32 spell_id)
{
// prevent duplicated entires in spell book
if (!addSpell(spell_id))
return false;
- Unit* owner = GetOwner();
- if(owner->GetTypeId()==TYPEID_PLAYER)
- ((Player*)owner)->PetSpellInitialize();
+ if(!m_loading)
+ {
+ WorldPacket data(SMSG_PET_LEARNED_SPELL, 2);
+ data << uint16(spell_id);
+ m_owner->GetSession()->SendPacket(&data);
+ m_owner->PetSpellInitialize();
+ }
return true;
}
-void Pet::removeSpell(uint16 spell_id)
+void Pet::learnLevelupSpells()
+{
+ PetLevelupSpellMap const * spell_map = spellmgr.GetPetLevelupSpellMap();
+ int8 level = getLevel();
+ for(PetLevelupSpellMap::const_iterator itr = spell_map->lower_bound(GetCreatureInfo()->family); itr != spell_map->upper_bound(GetCreatureInfo()->family); ++itr)
+ {
+ if(itr->second.first <= level)
+ learnSpell(itr->second.second);
+ else
+ unlearnSpell(itr->second.second);
+ }
+}
+
+bool Pet::unlearnSpell(uint32 spell_id)
+{
+ if(removeSpell(spell_id))
+ {
+ if(!m_loading)
+ {
+ WorldPacket data(SMSG_PET_REMOVED_SPELL, 2);
+ data << uint16(spell_id);
+ m_owner->GetSession()->SendPacket(&data);
+ }
+ return true;
+ }
+ return false;
+}
+
+bool Pet::removeSpell(uint32 spell_id)
{
PetSpellMap::iterator itr = m_spells.find(spell_id);
if (itr == m_spells.end())
- return;
+ return false;
if(itr->second->state == PETSPELL_REMOVED)
- return;
+ return false;
if(itr->second->state == PETSPELL_NEW)
{
@@ -1608,9 +1361,23 @@ void Pet::removeSpell(uint16 spell_id)
itr->second->state = PETSPELL_REMOVED;
RemoveAurasDueToSpell(spell_id);
+
+ uint32 talentCost = GetTalentSpellCost(spell_id);
+ if (talentCost > 0)
+ {
+ if (m_usedTalentCount > talentCost)
+ m_usedTalentCount-=talentCost;
+ else
+ m_usedTalentCount = 0;
+ // update free talent points
+ int32 free_points = GetMaxTalentPointsForLevel(getLevel()) - m_usedTalentCount;
+ SetFreeTalentPoints(free_points > 0 ? free_points : 0);
+ }
+
+ return true;
}
-bool Pet::_removeSpell(uint16 spell_id)
+bool Pet::_removeSpell(uint32 spell_id)
{
PetSpellMap::iterator itr = m_spells.find(spell_id);
if (itr != m_spells.end())
@@ -1626,8 +1393,11 @@ void Pet::InitPetCreateSpells()
{
m_charmInfo->InitPetActionBar();
+ for (PetSpellMap::iterator i = m_spells.begin(); i != m_spells.end(); ++i)
+ delete i->second;
m_spells.clear();
- int32 usedtrainpoints = 0, petspellid;
+
+ uint32 petspellid;
PetCreateSpellEntry const* CreateSpells = objmgr.GetPetCreateSpellEntry(GetEntry());
if(CreateSpells)
{
@@ -1647,7 +1417,7 @@ void Pet::InitPetCreateSpells()
if(owner->GetTypeId() == TYPEID_PLAYER && !((Player*)owner)->HasSpell(learn_spellproto->Id))
{
if(IsPassiveSpell(petspellid)) //learn passive skills when tamed, not sure if thats right
- ((Player*)owner)->learnSpell(learn_spellproto->Id);
+ ((Player*)owner)->learnSpell(learn_spellproto->Id,false);
else
AddTeachSpell(learn_spellproto->EffectTriggerSpell[0], learn_spellproto->Id);
}
@@ -1656,23 +1426,12 @@ void Pet::InitPetCreateSpells()
petspellid = learn_spellproto->Id;
addSpell(petspellid);
-
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(learn_spellproto->EffectTriggerSpell[0]);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(learn_spellproto->EffectTriggerSpell[0]);
-
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- usedtrainpoints += _spell_idx->second->reqtrainpoints;
- break;
- }
}
}
LearnPetPassives();
CastPetAuras(false);
-
- SetTP(-usedtrainpoints);
}
void Pet::CheckLearning(uint32 spellid)
@@ -1692,11 +1451,116 @@ void Pet::CheckLearning(uint32 spellid)
if(urand(0, 100) < 10)
{
- ((Player*)owner)->learnSpell(itr->second);
+ ((Player*)owner)->learnSpell(itr->second,false);
m_teachspells.erase(itr);
}
}
+bool Pet::resetTalents(bool no_cost)
+{
+ Unit *owner = GetOwner();
+ if (!owner || owner->GetTypeId()!=TYPEID_PLAYER)
+ return false;
+
+ CreatureInfo const * ci = GetCreatureInfo();
+ if(!ci)
+ return false;
+ // Check pet talent type
+ CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
+ if(!pet_family || pet_family->petTalentType < 0)
+ return false;
+
+ Player *player = (Player *)owner;
+
+ uint32 level = getLevel();
+ uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
+
+ if (m_usedTalentCount == 0)
+ {
+ SetFreeTalentPoints(talentPointsForLevel);
+ return false;
+ }
+
+ uint32 cost = 0;
+
+ if(!no_cost)
+ {
+ cost = resetTalentsCost();
+
+ if (player->GetMoney() < cost)
+ {
+ player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
+ return false;
+ }
+ }
+
+ for (unsigned int i = 0; i < sTalentStore.GetNumRows(); i++)
+ {
+ TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
+
+ if (!talentInfo) continue;
+
+ TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab );
+
+ if(!talentTabInfo)
+ continue;
+
+ // unlearn only talents for pets family talent type
+ if(!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
+ continue;
+
+ for (int j = 0; j < MAX_TALENT_RANK; j++)
+ {
+ for(PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();)
+ {
+ if(itr->second->state == PETSPELL_REMOVED)
+ {
+ ++itr;
+ continue;
+ }
+ // remove learned spells (all ranks)
+ uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
+
+ // unlearn if first rank is talent or learned by talent
+ if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
+ {
+ removeSpell(itr->first);
+ itr = m_spells.begin();
+ continue;
+ }
+ else
+ ++itr;
+ }
+ }
+ }
+
+ SetFreeTalentPoints(talentPointsForLevel);
+
+ if(!no_cost)
+ {
+ player->ModifyMoney(-(int32)cost);
+
+ m_resetTalentsCost = cost;
+ m_resetTalentsTime = time(NULL);
+ }
+ if(!m_loading)
+ player->PetSpellInitialize();
+ return true;
+}
+
+void Pet::InitTalentForLevel()
+{
+ uint32 level = getLevel();
+ uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
+ // Reset talents in case low level (on level down) or wrong points for level (hunter can unlearn TP increase talent)
+ if(talentPointsForLevel == 0 || m_usedTalentCount > talentPointsForLevel)
+ {
+ // Remove all talent points
+ resetTalents(true);
+ }
+ SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount);
+}
+
uint32 Pet::resetTalentsCost() const
{
uint32 days = (sWorld.GetGameTime() - m_resetTalentsTime)/DAY;
@@ -1715,23 +1579,31 @@ uint32 Pet::resetTalentsCost() const
return (m_resetTalentsCost + 1*GOLD > 10*GOLD ? 10*GOLD : m_resetTalentsCost + 1*GOLD);
}
+uint8 Pet::GetMaxTalentPointsForLevel(uint32 level)
+{
+ uint8 points = (level >= 20) ? ((level - 16) / 4) : 0;
+ // Mod points from owner SPELL_AURA_MOD_PET_TALENT_POINTS
+ if (Unit *owner = GetOwner())
+ points+=owner->GetTotalAuraModifier(SPELL_AURA_MOD_PET_TALENT_POINTS);
+ return points;
+}
+
void Pet::ToggleAutocast(uint32 spellid, bool apply)
{
if(IsPassiveSpell(spellid))
return;
- //if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))
- // if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER
- // && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE)
- // return;
-
- PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);
+ PetSpellMap::const_iterator itr = m_spells.find(spellid);
+ if(itr == m_spells.end())
+ return;
int i;
if(apply)
{
- for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++);
+ for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++)
+ ; // just search
+
if (i == m_autospells.size())
{
m_autospells.push_back(spellid);
@@ -1742,7 +1614,9 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
else
{
AutoSpellList::iterator itr2 = m_autospells.begin();
- for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++, itr2++);
+ for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++, itr2++)
+ ; // just search
+
if (i < m_autospells.size())
{
m_autospells.erase(itr2);
@@ -1752,10 +1626,11 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
}
}
-bool Pet::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number)
+bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
{
SetMapId(map->GetId());
SetInstanceId(map->GetInstanceId());
+ SetPhaseMask(phaseMask,false);
Object::_Create(guidlow, pet_number, HIGHGUID_PET);
@@ -1765,18 +1640,15 @@ bool Pet::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number)
if(!InitEntry(Entry))
return false;
- SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE );
- SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5 );
-
- if(getPetType() == MINI_PET) // always non-attackable
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
return true;
}
bool Pet::HasSpell(uint32 spell) const
{
- return (m_spells.find(spell) != m_spells.end());
+ PetSpellMap::const_iterator itr = m_spells.find(spell);
+ return (itr != m_spells.end() && itr->second->state != PETSPELL_REMOVED );
}
// Get all passive spells in our skill line
@@ -1797,7 +1669,7 @@ void Pet::LearnPetPassives()
// Passive 01~10, Passive 00 (20782, not used), Ferocious Inspiration (34457)
// Scale 01~03 (34902~34904, bonus from owner, not used)
for(PetFamilySpellsSet::const_iterator petSet = petStore->second.begin(); petSet != petStore->second.end(); ++petSet)
- addSpell(*petSet, ACT_DECIDE, PETSPELL_NEW, 0xffff, PETSPELL_FAMILY);
+ addSpell(*petSet, ACT_DECIDE, PETSPELL_NEW, PETSPELL_FAMILY);
}
}
@@ -1837,3 +1709,10 @@ void Pet::CastPetAura(PetAura const* aura)
CastSpell(this, auraId, true);
}
+void Pet::learnSpellHighRank(uint32 spellid)
+{
+ learnSpell(spellid);
+
+ if(uint32 next = spellmgr.GetNextSpellInChain(spellid))
+ learnSpellHighRank(next);
+}
diff --git a/src/game/Pet.h b/src/game/Pet.h
index d55c467826a..2552b1c2c09 100644
--- a/src/game/Pet.h
+++ b/src/game/Pet.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,28 +22,29 @@
#define TRINITYCORE_PET_H
#include "ObjectDefines.h"
-#include "Creature.h"
#include "Unit.h"
+#include "TemporarySummon.h"
enum PetType
{
SUMMON_PET = 0,
HUNTER_PET = 1,
- GUARDIAN_PET = 2,
- MINI_PET = 3,
- POSSESSED_PET = 4,
- MAX_PET_TYPE = 5
+ POSSESSED_PET = 2,
+ MAX_PET_TYPE = 4,
};
extern char const* petTypeSuffix[MAX_PET_TYPE];
+#define MAX_PET_STABLES 4
+
+// stored in character_pet.slot
enum PetSaveMode
{
- PET_SAVE_AS_DELETED =-1,
- PET_SAVE_AS_CURRENT = 0,
- PET_SAVE_IN_STABLE_SLOT_1 = 1,
- PET_SAVE_IN_STABLE_SLOT_2 = 2,
- PET_SAVE_NOT_IN_SLOT = 3
+ PET_SAVE_AS_DELETED = -1, // not saved in fact
+ PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
+ PET_SAVE_FIRST_STABLE_SLOT = 1,
+ PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
+ PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
};
enum HappinessState
@@ -53,16 +54,6 @@ enum HappinessState
HAPPY = 3
};
-enum LoyaltyLevel
-{
- REBELLIOUS = 1,
- UNRULY = 2,
- SUBMISSIVE = 3,
- DEPENDABLE = 4,
- FAITHFUL = 5,
- BEST_FRIEND = 6
-};
-
enum PetSpellState
{
PETSPELL_UNCHANGED = 0,
@@ -79,7 +70,6 @@ enum PetSpellType
struct PetSpell
{
- uint16 slotId;
uint16 active;
PetSpellState state : 16;
@@ -117,15 +107,12 @@ enum PetNameInvalidReason
PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 16
};
-typedef UNORDERED_MAP<uint16, PetSpell*> PetSpellMap;
+typedef UNORDERED_MAP<uint32, PetSpell*> PetSpellMap;
typedef std::map<uint32,uint32> TeachSpellMap;
typedef std::vector<uint32> AutoSpellList;
#define HAPPINESS_LEVEL_SIZE 333000
-extern const uint32 LevelUpLoyalty[6];
-extern const uint32 LevelStartLoyalty[6];
-
#define ACTIVE_SPELLS_MAX 4
#define OWNER_MAX_DISTANCE 100
@@ -133,10 +120,10 @@ extern const uint32 LevelStartLoyalty[6];
#define PET_FOLLOW_DIST 1
#define PET_FOLLOW_ANGLE (M_PI/2)
-class Pet : public Creature
+class Pet : public Guardian
{
public:
- explicit Pet(PetType type = MAX_PET_TYPE);
+ explicit Pet(Player *owner, PetType type = MAX_PET_TYPE);
virtual ~Pet();
void AddToWorld();
@@ -147,9 +134,9 @@ class Pet : public Creature
bool isControlled() const { return getPetType()==SUMMON_PET || getPetType()==HUNTER_PET; }
bool isTemporarySummoned() const { return m_duration > 0; }
- bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number);
+ bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
- bool LoadPetFromDB( Unit* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false );
+ bool LoadPetFromDB( Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false );
void SavePetToDB(PetSaveMode mode);
void Remove(PetSaveMode mode, bool returnreagent = false);
static void DeleteFromDB(uint32 guidlow);
@@ -168,24 +155,13 @@ class Pet : public Creature
void RegenerateFocus();
void LooseHappiness();
- void TickLoyaltyChange();
- void ModifyLoyalty(int32 addvalue);
HappinessState GetHappinessState();
- uint32 GetMaxLoyaltyPoints(uint32 level);
- uint32 GetStartLoyaltyPoints(uint32 level);
- void KillLoyaltyBonus(uint32 level);
- uint32 GetLoyaltyLevel() { return GetByteValue(UNIT_FIELD_BYTES_1, 1); }
- void SetLoyaltyLevel(LoyaltyLevel level);
void GivePetXP(uint32 xp);
void GivePetLevel(uint32 level);
- bool InitStatsForLevel(uint32 level);
bool HaveInDiet(ItemPrototype const* item) const;
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel);
void SetDuration(int32 dur) { m_duration = dur; }
- int32 GetBonusDamage() { return m_bonusdamage; }
- void SetBonusDamage(int32 damage) { m_bonusdamage = damage; }
-
bool UpdateStats(Stats stat);
bool UpdateAllStats();
void UpdateResistances(uint32 school);
@@ -195,10 +171,8 @@ class Pet : public Creature
void UpdateAttackPowerAndDamage(bool ranged = false);
void UpdateDamagePhysical(WeaponAttackType attType);
- bool CanTakeMoreActiveSpells(uint32 SpellIconID);
- void ToggleAutocast(uint32 spellid, bool apply);
- bool HasTPForSpell(uint32 spellid);
- int32 GetTPForSpell(uint32 spellid);
+ bool CanTakeMoreActiveSpells(uint32 SpellIconID);
+ void ToggleAutocast(uint32 spellid, bool apply);
bool HasSpell(uint32 spell) const;
void AddTeachSpell(uint32 learned_id, uint32 source_id) { m_teachspells[learned_id] = source_id; }
@@ -214,10 +188,13 @@ class Pet : public Creature
void _LoadSpells();
void _SaveSpells();
- bool addSpell(uint16 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, uint16 slot_id=0xffff, PetSpellType type = PETSPELL_NORMAL);
- bool learnSpell(uint16 spell_id);
- void removeSpell(uint16 spell_id);
- bool _removeSpell(uint16 spell_id);
+ bool addSpell(uint32 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
+ bool learnSpell(uint32 spell_id);
+ void learnSpellHighRank(uint32 spellid);
+ void learnLevelupSpells();
+ bool unlearnSpell(uint32 spell_id);
+ bool removeSpell(uint32 spell_id);
+ bool _removeSpell(uint32 spell_id);
PetSpellMap m_spells;
TeachSpellMap m_teachspells;
@@ -225,32 +202,36 @@ class Pet : public Creature
void InitPetCreateSpells();
void CheckLearning(uint32 spellid);
+
+ bool resetTalents(bool no_cost = false);
uint32 resetTalentsCost() const;
+ void InitTalentForLevel();
- void SetTP(int32 TP);
- int32 GetDispTP();
+ uint8 GetMaxTalentPointsForLevel(uint32 level);
+ uint8 GetFreeTalentPoints() { return GetByteValue(UNIT_FIELD_BYTES_1, 1); }
+ void SetFreeTalentPoints(uint8 points) { SetByteValue(UNIT_FIELD_BYTES_1, 1, points); }
- int32 m_TrainingPoints;
uint32 m_resetTalentsCost;
time_t m_resetTalentsTime;
+ uint32 m_usedTalentCount;
- uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
- void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
- void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
- void ResetAuraUpdateMask() { m_auraUpdateMask = 0; }
+ const uint64& GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
+ void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
+ void ResetAuraUpdateMaskForRaid() { m_auraRaidUpdateMask = 0; }
DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
bool m_removed; // prevent overwrite pet state in DB at next Pet::Update if pet already removed(saved)
+
+ Player *GetOwner() { return m_owner; }
protected:
- uint32 m_regenTimer;
+ Player *m_owner;
uint32 m_happinessTimer;
- uint32 m_loyaltyTimer;
PetType m_petType;
int32 m_duration; // time until unsummon (used mostly for summoned guardians and not used for controlled pets)
- int32 m_loyaltyPoints;
- int32 m_bonusdamage;
- uint64 m_auraUpdateMask;
+ uint64 m_auraRaidUpdateMask;
+ bool m_loading;
+ uint32 m_regenTimer;
DeclinedName *m_declinedname;
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index 75c1aa06c20..88327978de9 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
#include "Errors.h"
#include "Pet.h"
#include "Player.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "Spell.h"
#include "ObjectAccessor.h"
#include "SpellMgr.h"
@@ -38,7 +38,7 @@ int PetAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-PetAI::PetAI(Creature *c) : CreatureAI(c), i_pet(*c), i_tracker(TIME_INTERVAL_LOOK)
+PetAI::PetAI(Creature *c) : CreatureAI(c), i_tracker(TIME_INTERVAL_LOOK)
{
m_AllySet.clear();
UpdateAllies();
@@ -51,46 +51,46 @@ void PetAI::EnterEvadeMode()
bool PetAI::_needToStop() const
{
// This is needed for charmed creatures, as once their target was reset other effects can trigger threat
- if(i_pet.isCharmed() && i_pet.getVictim() == i_pet.GetCharmer())
+ if(m_creature->isCharmed() && m_creature->getVictim() == m_creature->GetCharmer())
return true;
- return !i_pet.canAttack(i_pet.getVictim());
+ return !m_creature->canAttack(m_creature->getVictim());
}
void PetAI::_stopAttack()
{
- if( !i_pet.isAlive() )
+ if( !m_creature->isAlive() )
{
- DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", i_pet.GetGUIDLow());
- i_pet.GetMotionMaster()->Clear();
- i_pet.GetMotionMaster()->MoveIdle();
- i_pet.CombatStop();
- i_pet.getHostilRefManager().deleteReferences();
+ DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", m_creature->GetGUIDLow());
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->CombatStop();
+ m_creature->getHostilRefManager().deleteReferences();
return;
}
- Unit* owner = i_pet.GetCharmerOrOwner();
+ Unit* owner = m_creature->GetCharmerOrOwner();
- if(owner && i_pet.GetCharmInfo() && i_pet.GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
+ if(owner && m_creature->GetCharmInfo() && m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
{
- i_pet.GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+ m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
else
{
- i_pet.clearUnitState(UNIT_STAT_FOLLOW);
- i_pet.GetMotionMaster()->Clear();
- i_pet.GetMotionMaster()->MoveIdle();
+ m_creature->clearUnitState(UNIT_STAT_FOLLOW);
+ m_creature->GetMotionMaster()->Clear();
+ m_creature->GetMotionMaster()->MoveIdle();
}
- i_pet.AttackStop();
+ m_creature->AttackStop();
}
void PetAI::UpdateAI(const uint32 diff)
{
- if (!i_pet.isAlive())
+ if (!m_creature->isAlive())
return;
- Unit* owner = i_pet.GetCharmerOrOwner();
+ Unit* owner = m_creature->GetCharmerOrOwner();
if(m_updateAlliesTimer <= diff)
// UpdateAllies self set update timer
@@ -98,12 +98,12 @@ void PetAI::UpdateAI(const uint32 diff)
else
m_updateAlliesTimer -= diff;
- // i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc.
- if( i_pet.getVictim() )
+ // m_creature->getVictim() can't be used for check in case stop fighting, m_creature->getVictim() clear at Unit death etc.
+ if( m_creature->getVictim() )
{
if( _needToStop() )
{
- DEBUG_LOG("Pet AI stoped attacking [guid=%u]", i_pet.GetGUIDLow());
+ DEBUG_LOG("Pet AI stoped attacking [guid=%u]", m_creature->GetGUIDLow());
_stopAttack();
return;
}
@@ -114,26 +114,26 @@ void PetAI::UpdateAI(const uint32 diff)
{
if(me->isInCombat())
_stopAttack();
- else if(owner && i_pet.GetCharmInfo()) //no victim
+ else if(owner && m_creature->GetCharmInfo()) //no victim
{
- if(owner->isInCombat() && !(i_pet.HasReactState(REACT_PASSIVE) || i_pet.GetCharmInfo()->HasCommandState(COMMAND_STAY)))
+ if(owner->isInCombat() && !(m_creature->HasReactState(REACT_PASSIVE) || m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY)))
AttackStart(owner->getAttackerForHelper());
- else if(i_pet.GetCharmInfo()->HasCommandState(COMMAND_FOLLOW) && !i_pet.hasUnitState(UNIT_STAT_FOLLOW))
- i_pet.GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+ else if(m_creature->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW) && !m_creature->hasUnitState(UNIT_STAT_FOLLOW))
+ m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
}
if(!me->GetCharmInfo())
return;
- if (i_pet.GetGlobalCooldown() == 0 && !i_pet.hasUnitState(UNIT_STAT_CASTING))
+ if (m_creature->GetGlobalCooldown() == 0 && !m_creature->hasUnitState(UNIT_STAT_CASTING))
{
bool inCombat = me->getVictim();
//Autocast
- for (uint8 i = 0; i < i_pet.GetPetAutoSpellSize(); i++)
+ for (uint8 i = 0; i < m_creature->GetPetAutoSpellSize(); i++)
{
- uint32 spellID = i_pet.GetPetAutoSpellOnPos(i);
+ uint32 spellID = m_creature->GetPetAutoSpellOnPos(i);
if (!spellID)
continue;
@@ -153,11 +153,11 @@ void PetAI::UpdateAI(const uint32 diff)
continue;
}
- Spell *spell = new Spell(&i_pet, spellInfo, false, 0);
+ Spell *spell = new Spell(m_creature, spellInfo, false, 0);
- if(inCombat && !i_pet.hasUnitState(UNIT_STAT_FOLLOW) && spell->CanAutoCast(i_pet.getVictim()))
+ if(inCombat && !m_creature->hasUnitState(UNIT_STAT_FOLLOW) && spell->CanAutoCast(m_creature->getVictim()))
{
- m_targetSpellStore.push_back(std::make_pair<Unit*, Spell*>(i_pet.getVictim(), spell));
+ m_targetSpellStore.push_back(std::make_pair<Unit*, Spell*>(m_creature->getVictim(), spell));
continue;
}
else
@@ -165,7 +165,7 @@ void PetAI::UpdateAI(const uint32 diff)
bool spellUsed = false;
for(std::set<uint64>::iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
{
- Unit* Target = ObjectAccessor::GetUnit(i_pet,*tar);
+ Unit* Target = ObjectAccessor::GetUnit(*m_creature,*tar);
//only buff targets that are in combat, unless the spell can only be cast while out of combat
if(!Target)
@@ -196,19 +196,19 @@ void PetAI::UpdateAI(const uint32 diff)
SpellCastTargets targets;
targets.setUnitTarget( target );
- if( !i_pet.HasInArc(M_PI, target) )
+ if( !m_creature->HasInArc(M_PI, target) )
{
- i_pet.SetInFront(target);
+ m_creature->SetInFront(target);
if( target->GetTypeId() == TYPEID_PLAYER )
- i_pet.SendUpdateToPlayer( (Player*)target );
+ m_creature->SendUpdateToPlayer( (Player*)target );
if(owner && owner->GetTypeId() == TYPEID_PLAYER)
- i_pet.SendUpdateToPlayer( (Player*)owner );
+ m_creature->SendUpdateToPlayer( (Player*)owner );
}
- i_pet.AddCreatureSpellCooldown(spell->m_spellInfo->Id);
- if(i_pet.isPet())
- ((Pet*)&i_pet)->CheckLearning(spell->m_spellInfo->Id);
+ m_creature->AddCreatureSpellCooldown(spell->m_spellInfo->Id);
+ if(m_creature->isPet())
+ ((Pet*)m_creature)->CheckLearning(spell->m_spellInfo->Id);
spell->prepare(&targets);
}
@@ -222,10 +222,10 @@ void PetAI::UpdateAI(const uint32 diff)
void PetAI::UpdateAllies()
{
- Unit* owner = i_pet.GetCharmerOrOwner();
+ Unit* owner = m_creature->GetCharmerOrOwner();
Group *pGroup = NULL;
- m_updateAlliesTimer = 10000; //update friendly targets every 10 seconds, lesser checks increase performance
+ m_updateAlliesTimer = 10*IN_MILISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance
if(!owner)
return;
@@ -240,7 +240,7 @@ void PetAI::UpdateAllies()
return;
m_AllySet.clear();
- m_AllySet.insert(i_pet.GetGUID());
+ m_AllySet.insert(m_creature->GetGUID());
if(pGroup) //add group
{
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
diff --git a/src/game/PetAI.h b/src/game/PetAI.h
index 864195701c2..a346908ee0e 100644
--- a/src/game/PetAI.h
+++ b/src/game/PetAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ class TRINITY_DLL_DECL PetAI : public CreatureAI
{
public:
- PetAI(Creature *c);
+ explicit PetAI(Creature *c);
void EnterEvadeMode();
void JustDied(Unit* who) { _stopAttack(); }
@@ -46,7 +46,6 @@ class TRINITY_DLL_DECL PetAI : public CreatureAI
void UpdateAllies();
- Creature &i_pet;
TimeTracker i_tracker;
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index 456d68ed54d..56845eaa656 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,18 +21,15 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Log.h"
#include "Opcodes.h"
#include "Spell.h"
#include "ObjectAccessor.h"
-#include "MapManager.h"
#include "CreatureAI.h"
#include "Util.h"
#include "Pet.h"
-#include "Language.h"
void WorldSession::HandlePetAction( WorldPacket & recv_data )
{
@@ -49,25 +46,39 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
// used also for charmed creature
Unit* pet= ObjectAccessor::GetUnit(*_player, guid1);
- sLog.outDetail("HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.\n", uint32(GUID_LOPART(guid1)), flag, spellid, uint32(GUID_LOPART(guid2)) );
+ sLog.outDetail("HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.", uint32(GUID_LOPART(guid1)), flag, spellid, uint32(GUID_LOPART(guid2)) );
if(!pet)
{
- sLog.outError( "Pet %u not exist.\n", uint32(GUID_LOPART(guid1)) );
+ sLog.outError( "Pet %u not exist.", uint32(GUID_LOPART(guid1)) );
return;
}
- if(pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
+ if(pet != GetPlayer()->GetFirstControlled())
{
- sLog.outError("HandlePetAction.Pet %u isn't pet of player %s.\n", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName() );
+ sLog.outError("HandlePetAction.Pet %u isn't pet of player %s.", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName() );
return;
}
- if(!pet->isAlive())
- return;
-
+ //TODO: allow control charmed player?
if(pet->GetTypeId() == TYPEID_PLAYER && !(flag == ACT_COMMAND && spellid == COMMAND_ATTACK))
return;
+ if(GetPlayer()->m_Controlled.size() == 1)
+ HandlePetActionHelper(pet, guid1, spellid, flag, guid2);
+ else
+ {
+ //If a pet is dismissed, m_Controlled will change
+ std::vector<Unit*> controlled;
+ for(Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
+ if((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive())
+ controlled.push_back(*itr);
+ for(std::vector<Unit*>::iterator itr = controlled.begin(); itr != controlled.end(); ++itr)
+ HandlePetActionHelper(*itr, guid1, spellid, flag, guid2);
+ }
+}
+
+void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2)
+{
CharmInfo *charmInfo = pet->GetCharmInfo();
if(!charmInfo)
{
@@ -107,7 +118,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
}
// only place where pet can be player
pet->clearUnitState(UNIT_STAT_FOLLOW);
- uint64 selguid = _player->GetSelection();
+ const uint64& selguid = _player->GetSelection();
Unit *TargetUnit = ObjectAccessor::GetUnit(*_player, selguid);
if(!TargetUnit)
return;
@@ -119,26 +130,33 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
//if(!pet->IsWithinLOSInMap(TargetUnit))
// return;
- if(pet->GetTypeId() != TYPEID_PLAYER && ((Creature*)pet)->IsAIEnabled)
+ // This is true if pet has no target or has target but targets differs.
+ if(pet->getVictim() != TargetUnit)
{
- ((Creature*)pet)->AI()->AttackStart(TargetUnit);
+ if (pet->getVictim())
+ pet->AttackStop();
- //10% chance to play special pet attack talk, else growl
- if(((Creature*)pet)->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
- pet->SendPetTalk((uint32)PET_TALK_ATTACK);
- else
+ if(pet->GetTypeId() != TYPEID_PLAYER && ((Creature*)pet)->IsAIEnabled)
{
- // 90% chance for pet and 100% chance for charmed creature
- pet->SendPetAIReaction(guid1);
+ ((Creature*)pet)->AI()->AttackStart(TargetUnit);
+
+ //10% chance to play special pet attack talk, else growl
+ if(((Creature*)pet)->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
+ pet->SendPetTalk((uint32)PET_TALK_ATTACK);
+ else
+ {
+ // 90% chance for pet and 100% chance for charmed creature
+ pet->SendPetAIReaction(guid1);
+ }
}
- }
- else // charmed player
- {
- if(pet->getVictim() && pet->getVictim() != TargetUnit)
- pet->AttackStop();
+ else // charmed player
+ {
+ if(pet->getVictim() && pet->getVictim() != TargetUnit)
+ pet->AttackStop();
- pet->Attack(TargetUnit,true);
- pet->SendPetAIReaction(guid1);
+ pet->Attack(TargetUnit,true);
+ pet->SendPetAIReaction(guid1);
+ }
}
break;
}
@@ -153,10 +171,10 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
p->setDeathState(CORPSE);
}
else // charmed or possessed
- _player->Uncharm();
+ _player->StopCastingCharm();
break;
default:
- sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.\n", flag, spellid);
+ sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.", flag, spellid);
}
break;
case ACT_REACTION: // 0x600
@@ -170,24 +188,22 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
break;
}
break;
- case ACT_DISABLED: //0x8100 spell (disabled), ignore
- case ACT_CAST: //0x0100
- case ACT_ENABLED: //0xc100 spell
+ case ACT_DISABLED: // 0x8100 spell (disabled), ignore
+ case ACT_PASSIVE: // 0x0100
+ case ACT_ENABLED: // 0xC100 spell
{
- Unit* unit_target;
- if(guid2)
- unit_target = ObjectAccessor::GetUnit(*_player,guid2);
- else
- unit_target = NULL;
-
+ Unit* unit_target = NULL;
if (((Creature*)pet)->GetGlobalCooldown() > 0)
return;
+ if(guid2)
+ unit_target = ObjectAccessor::GetUnit(*_player,guid2);
+
// do not cast unknown spells
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid );
if(!spellInfo)
{
- sLog.outError("WORLD: unknown PET spell id %i\n", spellid);
+ sLog.outError("WORLD: unknown PET spell id %i", spellid);
return;
}
@@ -205,9 +221,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
Spell *spell = new Spell(pet, spellInfo, false);
- int16 result = spell->PetCanCast(unit_target);
+ SpellCastResult result = spell->CheckPetCast(unit_target);
- //auto turn to target unless possessed
+ //auto turn to target unless possessed
if(result == SPELL_FAILED_UNIT_NOT_INFRONT && !pet->isPossessed())
{
pet->SetInFront(unit_target);
@@ -216,10 +232,10 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
if(Unit* powner = pet->GetCharmerOrOwner())
if(powner->GetTypeId() == TYPEID_PLAYER)
pet->SendUpdateToPlayer((Player*)powner);
- result = -1;
+ result = SPELL_CAST_OK;
}
- if(result == -1)
+ if(result == SPELL_CAST_OK)
{
((Creature*)pet)->AddCreatureSpellCooldown(spellid);
if (((Creature*)pet)->isPet())
@@ -238,12 +254,15 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
if( unit_target && !GetPlayer()->IsFriendlyTo(unit_target) && !pet->isPossessed())
{
- pet->clearUnitState(UNIT_STAT_FOLLOW);
- if(pet->getVictim())
- pet->AttackStop();
- pet->GetMotionMaster()->Clear();
- if (((Creature*)pet)->IsAIEnabled)
- ((Creature*)pet)->AI()->AttackStart(unit_target);
+ // This is true if pet has no target or has target but targets differs.
+ if (pet->getVictim() != unit_target)
+ {
+ if (pet->getVictim())
+ pet->AttackStop();
+ pet->GetMotionMaster()->Clear();
+ if (((Creature*)pet)->IsAIEnabled)
+ ((Creature*)pet)->AI()->AttackStart(unit_target);
+ }
}
spell->prepare(&(spell->m_targets));
@@ -253,15 +272,12 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
if(pet->isPossessed())
{
WorldPacket data(SMSG_CAST_FAILED, (4+1+1));
- data << uint32(spellid) << uint8(2) << uint8(result);
+ data << uint8(0) << uint32(spellid) << uint8(result);
switch (result)
{
case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
data << uint32(spellInfo->RequiresSpellFocus);
break;
- case SPELL_FAILED_REQUIRES_AREA:
- data << uint32(spellInfo->AreaId);
- break;
}
SendPacket(&data);
}
@@ -277,7 +293,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
break;
}
default:
- sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.\n", flag, spellid);
+ sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.", flag, spellid);
}
}
@@ -285,7 +301,7 @@ void WorldSession::HandlePetNameQuery( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,4+8);
- sLog.outDetail( "HandlePetNameQuery. CMSG_PET_NAME_QUERY\n" );
+ sLog.outDetail( "HandlePetNameQuery. CMSG_PET_NAME_QUERY" );
uint32 petnumber;
uint64 petguid;
@@ -298,7 +314,7 @@ void WorldSession::HandlePetNameQuery( WorldPacket & recv_data )
void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber)
{
- Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, petguid);
+ Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid);
if(!pet || !pet->GetCharmInfo() || pet->GetCharmInfo()->GetPetNumber() != petnumber)
return;
@@ -325,7 +341,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data, 8+4+2+2);
- sLog.outDetail( "HandlePetSetAction. CMSG_PET_SET_ACTION\n" );
+ sLog.outDetail( "HandlePetSetAction. CMSG_PET_SET_ACTION" );
uint64 petguid;
uint32 position;
@@ -335,16 +351,11 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
recv_data >> petguid;
- // FIXME: charmed case
- //Pet* pet = ObjectAccessor::Instance().GetPet(petguid);
- if(ObjectAccessor::FindPlayer(petguid))
- return;
-
- Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, petguid);
+ Unit* pet = ObjectAccessor::GetUnit(*_player, petguid);
- if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm()))
+ if(!pet || pet != _player->GetFirstControlled())
{
- sLog.outError( "HandlePetSetAction: Unknown pet or pet owner.\n" );
+ sLog.outError( "HandlePetSetAction: Unknown pet or pet owner." );
return;
}
@@ -362,26 +373,27 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
recv_data >> spell_id;
recv_data >> act_state;
- sLog.outDetail( "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X\n", _player->GetName(), position, spell_id, act_state);
+ sLog.outDetail( "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position, spell_id, act_state);
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
- if(!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_CAST) && spell_id && !pet->HasSpell(spell_id)))
+ if(!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !pet->HasSpell(spell_id)))
{
//sign for autocast
if(act_state == ACT_ENABLED && spell_id)
{
- if(pet->isCharmed())
- charmInfo->ToggleCreatureAutocast(spell_id, true);
- else
+ if(pet->GetTypeId() == TYPEID_UNIT && ((Creature*)pet)->isPet())
((Pet*)pet)->ToggleAutocast(spell_id, true);
+ else
+ charmInfo->ToggleCreatureAutocast(spell_id, true);
}
//sign for no/turn off autocast
else if(act_state == ACT_DISABLED && spell_id)
{
- if(pet->isCharmed())
- charmInfo->ToggleCreatureAutocast(spell_id, false);
- else
+ if(pet->GetTypeId() == TYPEID_UNIT && ((Creature*)pet)->isPet())
((Pet*)pet)->ToggleAutocast(spell_id, false);
+ else
+ charmInfo->ToggleCreatureAutocast(spell_id, false);
+
}
charmInfo->GetActionBarEntry(position)->Type = act_state;
@@ -394,7 +406,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data, 8+1);
- sLog.outDetail( "HandlePetRename. CMSG_PET_RENAME\n" );
+ sLog.outDetail( "HandlePetRename. CMSG_PET_RENAME" );
uint64 petguid;
uint8 isdeclined;
@@ -477,7 +489,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
sLog.outDetail( "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid) );
// pet/charmed
- Creature* pet = ObjectAccessor::GetCreatureOrPet(*_player, guid);
+ Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if(pet)
{
if(pet->isPet())
@@ -491,7 +503,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
_player->RemovePet((Pet*)pet,PET_SAVE_AS_DELETED);
}
else if(pet->GetGUID() == _player->GetCharmGUID())
- _player->Uncharm();
+ _player->StopCastingCharm();
}
}
@@ -501,16 +513,16 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
sLog.outDetail("CMSG_PET_UNLEARN");
uint64 guid;
- recvPacket >> guid;
+ recvPacket >> guid; // Pet guid
Pet* pet = _player->GetPet();
- if(!pet || pet->getPetType() != HUNTER_PET || pet->m_spells.size() <= 1)
+ if(!pet || pet->getPetType() != HUNTER_PET || pet->m_usedTalentCount == 0)
return;
if(guid != pet->GetGUID())
{
- sLog.outError( "HandlePetUnlearnOpcode.Pet %u isn't pet of player %s .\n", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
+ sLog.outError( "HandlePetUnlearnOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
return;
}
@@ -520,38 +532,7 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
sLog.outError("WorldSession::HandlePetUnlearnOpcode: object "I64FMTD" is considered pet-like but doesn't have a charminfo!", pet->GetGUID());
return;
}
-
- uint32 cost = pet->resetTalentsCost();
-
- if (GetPlayer()->GetMoney() < cost)
- {
- GetPlayer()->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
- return;
- }
-
- for(PetSpellMap::iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end();)
- {
- uint32 spell_id = itr->first; // Pet::removeSpell can invalidate iterator at erase NEW spell
- ++itr;
- pet->removeSpell(spell_id);
- }
-
- pet->SetTP(pet->getLevel() * (pet->GetLoyaltyLevel() - 1));
-
- for(uint8 i = 0; i < 10; i++)
- {
- if(charmInfo->GetActionBarEntry(i)->SpellOrAction && charmInfo->GetActionBarEntry(i)->Type == ACT_ENABLED || charmInfo->GetActionBarEntry(i)->Type == ACT_DISABLED)
- charmInfo->GetActionBarEntry(i)->SpellOrAction = 0;
- }
-
- // relearn pet passives
- pet->LearnPetPassives();
-
- pet->m_resetTalentsTime = time(NULL);
- pet->m_resetTalentsCost = cost;
- GetPlayer()->ModifyMoney(-(int32)cost);
-
- GetPlayer()->PetSpellInitialize();
+ pet->resetTalents();
}
void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
@@ -565,22 +546,22 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
uint8 state; //1 for on, 0 for off
recvPacket >> guid >> spellid >> spellid2 >> state;
- if(!_player->GetPet() && !_player->GetCharm())
+ if(!_player->GetGuardianPet() && !_player->GetCharm())
return;
if(ObjectAccessor::FindPlayer(guid))
return;
- Creature* pet=ObjectAccessor::GetCreatureOrPet(*_player,guid);
+ Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid);
- if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm()))
+ if(!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm()))
{
- sLog.outError( "HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .\n", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
+ sLog.outError( "HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
return;
}
// do not add not learned spells/ passive spells
- if(!pet->HasSpell(spellid) || IsPassiveSpell(spellid))
+ if(!pet->HasSpell(spellid) || IsAutocastableSpell(spellid))
return;
CharmInfo *charmInfo = pet->GetCharmInfo();
@@ -590,11 +571,10 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
return;
}
- if(pet->isCharmed())
- //state can be used as boolean
- pet->GetCharmInfo()->ToggleCreatureAutocast(spellid, state);
- else
+ if(pet->isPet())
((Pet*)pet)->ToggleAutocast(spellid, state);
+ else
+ pet->GetCharmInfo()->ToggleCreatureAutocast(spellid, state);
for(uint8 i = 0; i < 10; ++i)
{
@@ -607,21 +587,25 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
{
sLog.outDetail("WORLD: CMSG_PET_CAST_SPELL");
- CHECK_PACKET_SIZE(recvPacket,8+4);
+ CHECK_PACKET_SIZE(recvPacket,8+1+4+1);
uint64 guid;
uint32 spellid;
+ uint8 cast_count;
+ uint8 unk_flags; // flags (if 0x02 - some additional data are received)
+
+ recvPacket >> guid >> cast_count >> spellid >> unk_flags;
- recvPacket >> guid >> spellid;
+ sLog.outDebug("WORLD: CMSG_PET_CAST_SPELL, cast_count: %u, spellid %u, unk_flags %u", cast_count, spellid, unk_flags);
// This opcode is also sent from charmed and possessed units (players and creatures)
- if(!_player->GetPet() && !_player->GetCharm())
+ if(!_player->GetGuardianPet() && !_player->GetCharm())
return;
Unit* caster = ObjectAccessor::GetUnit(*_player, guid);
- if(!caster || (caster != _player->GetPet() && caster != _player->GetCharm()))
+ if(!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm()))
{
- sLog.outError( "HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .\n", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
+ sLog.outError( "HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
return;
}
@@ -631,7 +615,7 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid);
if(!spellInfo)
{
- sLog.outError("WORLD: unknown PET spell id %i\n", spellid);
+ sLog.outError("WORLD: unknown PET spell id %i", spellid);
return;
}
@@ -646,10 +630,11 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
caster->clearUnitState(UNIT_STAT_FOLLOW);
Spell *spell = new Spell(caster, spellInfo, false);
+ spell->m_cast_count = cast_count; // probably pending spell cast
spell->m_targets = targets;
- int16 result = spell->PetCanCast(NULL);
- if(result == -1)
+ SpellCastResult result = spell->CheckPetCast(NULL);
+ if(result == SPELL_CAST_OK)
{
if(caster->GetTypeId() == TYPEID_UNIT)
{
@@ -705,3 +690,15 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec
SendPacket(&data);
}
+void WorldSession::HandlePetLearnTalent( WorldPacket & recv_data )
+{
+ sLog.outDebug("WORLD: CMSG_PET_LEARN_TALENT");
+
+ CHECK_PACKET_SIZE(recv_data, 8+4+4);
+
+ uint64 guid;
+ uint32 talent_id, requested_rank;
+ recv_data >> guid >> talent_id >> requested_rank;
+
+ _player->LearnPetTalent(guid, talent_id, requested_rank);
+}
diff --git a/src/game/PetitionsHandler.cpp b/src/game/PetitionsHandler.cpp
index 7ae368140c7..61485c3eb04 100644
--- a/src/game/PetitionsHandler.cpp
+++ b/src/game/PetitionsHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +28,6 @@
#include "Opcodes.h"
#include "Guild.h"
#include "ArenaTeam.h"
-#include "MapManager.h"
#include "GossipDef.h"
#include "SocialMgr.h"
@@ -92,7 +91,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
uint32 charterid = 0;
uint32 cost = 0;
@@ -199,9 +198,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
if(!charter)
return;
- charter->SetUInt32Value(ITEM_FIELD_ENCHANTMENT, charter->GetGUIDLow());
- // ITEM_FIELD_ENCHANTMENT is guild/arenateam id
- // ITEM_FIELD_ENCHANTMENT+1 is current signatures count (showed on item)
+ charter->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1, charter->GetGUIDLow());
+ // ITEM_FIELD_ENCHANTMENT_1_1 is guild/arenateam id
+ // ITEM_FIELD_ENCHANTMENT_1_1+1 is current signatures count (showed on item)
charter->SetState(ITEM_CHANGED, _player);
_player->SendNewItem(charter, 1, true, false);
@@ -255,7 +254,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
QueryResult *result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low);
if(!result)
{
- sLog.outError("any petition on server...");
+ sLog.outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
return;
}
Field *fields = result->Fetch();
@@ -463,7 +462,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
if(!result)
{
- sLog.outError("any petition on server...");
+ sLog.outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
return;
}
@@ -565,7 +564,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
// update signs count on charter, required testing...
//Item *item = _player->GetItemByGuid(petitionguid));
//if(item)
- // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT+1, signs);
+ // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs);
// update for owner if online
if(Player *owner = objmgr.GetPlayer(ownerguid))
@@ -827,7 +826,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
if(type == 9) // create guild
{
Guild* guild = new Guild;
- if(!guild->create(_player->GetGUID(), name))
+ if(!guild->create(_player, name))
{
delete guild;
delete result;
@@ -916,7 +915,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
uint8 count = 0;
if(pCreature->isTabardDesigner())
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 0078ed535d3..c8317e96148 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +23,13 @@
#include "Database/DatabaseEnv.h"
#include "Log.h"
#include "Opcodes.h"
-#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "UpdateMask.h"
#include "Player.h"
+#include "Vehicle.h"
#include "SkillDiscovery.h"
#include "QuestDef.h"
#include "GossipDef.h"
@@ -49,7 +49,6 @@
#include "Group.h"
#include "Guild.h"
#include "Pet.h"
-#include "SpellAuras.h"
#include "Util.h"
#include "Transports.h"
#include "Weather.h"
@@ -63,11 +62,13 @@
#include "Database/DatabaseImpl.h"
#include "Spell.h"
#include "SocialMgr.h"
-#include "GameEvent.h"
+#include "GameEventMgr.h"
+#include "AchievementMgr.h"
+#include "SpellAuras.h"
#include <cmath>
-#define ZONE_UPDATE_INTERVAL 1000
+#define ZONE_UPDATE_INTERVAL (1*IN_MILISECONDS)
#define PLAYER_SKILL_INDEX(x) (PLAYER_SKILL_INFO_1_1 + ((x)*3))
#define PLAYER_SKILL_VALUE_INDEX(x) (PLAYER_SKILL_INDEX(x)+1)
@@ -132,9 +133,20 @@ PlayerTaxi::PlayerTaxi()
memset(m_taximask, 0, sizeof(m_taximask));
}
-void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 level)
+void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint32 level)
{
- // capital and taxi hub masks
+ // class specific initial known nodes
+ switch(chrClass)
+ {
+ case CLASS_DEATH_KNIGHT:
+ {
+ for(int i = 0; i < TaxiMaskSize; ++i)
+ m_taximask[i] |= sOldContinentsNodesMask[i];
+ break;
+ }
+ }
+
+ // race specific initial known nodes: capital and taxi hub masks
switch(race)
{
case RACE_HUMAN: SetTaximaskNode(2); break; // Human
@@ -149,6 +161,7 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 level)
case RACE_BLOODELF: SetTaximaskNode(82); break; // Blood Elf
case RACE_DRAENEI: SetTaximaskNode(94); break; // Draenei
}
+
// new continent starting masks (It will be accessible only at new map)
switch(Player::TeamForRace(race))
{
@@ -188,7 +201,7 @@ void PlayerTaxi::AppendTaximaskTo( ByteBuffer& data, bool all )
}
}
-bool PlayerTaxi::LoadTaxiDestinationsFromString( const std::string& values )
+bool PlayerTaxi::LoadTaxiDestinationsFromString( const std::string& values, uint32 team )
{
ClearTaxiDestinations();
@@ -216,6 +229,10 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString( const std::string& values )
return false;
}
+ // can't load taxi path without mount set (quest taxi path?)
+ if(!objmgr.GetTaxiMount(GetTaxiSource(),team))
+ return false;
+
return true;
}
@@ -245,13 +262,20 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const
return path;
}
-//== Player ====================================================
+std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi)
+{
+ ss << "'";
+ for(int i = 0; i < TaxiMaskSize; ++i)
+ ss << taxi.m_taximask[i] << " ";
+ ss << "'";
+ return ss;
+}
-const int32 Player::ReputationRank_Length[MAX_REPUTATION_RANK] = {36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000};
+//== Player ====================================================
UpdateMask Player::updateVisualBits;
-Player::Player (WorldSession *session): Unit()
+Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputationMgr(this)
{
m_transport = 0;
@@ -280,6 +304,7 @@ Player::Player (WorldSession *session): Unit()
m_comboPoints = 0;
m_usedTalentCount = 0;
+ m_questRewardTalentCount = 0;
m_regenTimer = 0;
m_weaponChangeTimer = 0;
@@ -306,7 +331,7 @@ Player::Player (WorldSession *session): Unit()
// group is initialized in the reference constructor
SetGroupInvite(NULL);
m_groupUpdateMask = 0;
- m_auraUpdateMask = 0;
+ m_auraRaidUpdateMask = 0;
duel = NULL;
@@ -315,7 +340,8 @@ Player::Player (WorldSession *session): Unit()
m_atLoginFlags = AT_LOGIN_NONE;
- m_dontMove = false;
+ mSemaphoreTeleport_Near = false;
+ mSemaphoreTeleport_Far = false;
pTrader = 0;
ClearTrade();
@@ -332,10 +358,11 @@ Player::Player (WorldSession *session): Unit()
m_DailyQuestChanged = false;
m_lastDailyQuestTime = 0;
- m_regenTimer = 0;
- m_weaponChangeTimer = 0;
- m_breathTimer = 0;
- m_isunderwater = 0;
+ for (int i=0; i<MAX_TIMERS; i++)
+ m_MirrorTimer[i] = DISABLED_MIRROR_TIMER;
+
+ m_MirrorTimerFlags = UNDERWATER_NONE;
+ m_MirrorTimerFlagsLast = UNDERWATER_NONE;
m_isInWater = false;
m_drunkTimer = 0;
m_drunk = 0;
@@ -345,12 +372,13 @@ Player::Player (WorldSession *session): Unit()
m_swingErrorMsg = 0;
- m_DetectInvTimer = 1000;
+ m_DetectInvTimer = 1*IN_MILISECONDS;
m_bgBattleGroundID = 0;
+ m_bgTypeID = BATTLEGROUND_TYPE_NONE;
for (int j=0; j < PLAYER_MAX_BATTLEGROUND_QUEUES; j++)
{
- m_bgBattleGroundQueueID[j].bgQueueType = 0;
+ m_bgBattleGroundQueueID[j].bgQueueTypeId = BATTLEGROUND_QUEUE_NONE;
m_bgBattleGroundQueueID[j].invitedToInstance = 0;
}
m_bgTeam = 0;
@@ -362,6 +390,7 @@ Player::Player (WorldSession *session): Unit()
m_canParry = false;
m_canBlock = false;
m_canDualWield = false;
+ m_canTitanGrip = false;
m_ammoDPS = 0.0f;
m_temporaryUnsummonedPetNumber = 0;
@@ -400,12 +429,22 @@ Player::Player (WorldSession *session): Unit()
m_InstanceValid = true;
m_dungeonDifficulty = DIFFICULTY_NORMAL;
+ m_lastPotionId = 0;
+
for (int i = 0; i < BASEMOD_END; i++)
{
m_auraBaseMod[i][FLAT_MOD] = 0.0f;
m_auraBaseMod[i][PCT_MOD] = 1.0f;
}
+ for (int i = 0; i < MAX_COMBAT_RATING; i++)
+ m_baseRatingValue[i] = 0;
+
+ m_baseSpellDamage = 0;
+ m_baseSpellHealing = 0;
+ m_baseFeralAP = 0;
+ m_baseManaRegen = 0;
+
// Honor System
m_lastHonorUpdateTime = time(NULL);
@@ -419,7 +458,9 @@ Player::Player (WorldSession *session): Unit()
//Default movement to run mode
m_unit_movement_flags = 0;
- m_miniPet = 0;
+ m_mover = this;
+ m_seer = this;
+
m_bgAfkReportedTimer = 0;
m_contestedPvPTimer = 0;
@@ -427,13 +468,14 @@ Player::Player (WorldSession *session): Unit()
m_isActive = true;
- m_farsightVision = false;
+ m_runes = NULL;
+
+ m_lastFallTime = 0;
+ m_lastFallZ = 0;
}
Player::~Player ()
{
- CleanupsBeforeDelete();
-
// it must be unloaded already in PlayerLogout and accessed only for loggined player
//m_social = NULL;
@@ -443,7 +485,6 @@ Player::~Player ()
if(m_items[i])
delete m_items[i];
}
- CleanupChannels();
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
delete itr->second;
@@ -457,31 +498,28 @@ Player::~Player ()
delete PlayerTalkClass;
- if (m_transport)
- {
- m_transport->RemovePassenger(this);
- }
-
for(size_t x = 0; x < ItemSetEff.size(); x++)
if(ItemSetEff[x])
delete ItemSetEff[x];
- // clean up player-instance binds, may unload some instance saves
- for(uint8 i = 0; i < TOTAL_DIFFICULTIES; i++)
- for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
- itr->second.save->RemovePlayer(this);
-
delete m_declinedname;
+ delete m_runes;
}
void Player::CleanupsBeforeDelete()
{
- if(m_uint32Values) // only for fully created Object
- {
- TradeCancel(false);
- DuelComplete(DUEL_INTERUPTED);
- }
+ TradeCancel(false);
+ DuelComplete(DUEL_INTERUPTED);
+
Unit::CleanupsBeforeDelete();
+
+ if (m_transport)
+ m_transport->RemovePassenger(this);
+
+ // clean up player-instance binds, may unload some instance saves
+ for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
+ for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
+ itr->second.save->RemovePlayer(this);
}
bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 outfitId )
@@ -517,24 +555,8 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
uint8 powertype = cEntry->powerType;
- uint32 unitfield;
-
- switch(powertype)
- {
- case POWER_ENERGY:
- case POWER_MANA:
- unitfield = 0x00000000;
- break;
- case POWER_RAGE:
- unitfield = 0x00110000;
- break;
- default:
- sLog.outError("Invalid default powertype %u for player (class %u)",powertype,class_);
- return false;
- }
-
- SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE );
- SetFloatValue(UNIT_FIELD_COMBATREACH, DEFAULT_COMBAT_REACH );
+ SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
+ SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
switch(gender)
{
@@ -557,12 +579,13 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
uint32 RaceClassGender = ( race ) | ( class_ << 8 ) | ( gender << 16 );
SetUInt32Value(UNIT_FIELD_BYTES_0, ( RaceClassGender | ( powertype << 24 ) ) );
- SetUInt32Value(UNIT_FIELD_BYTES_1, unitfield);
- SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_UNK5 );
- SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
+ SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // fix cast time showed in spell tooltip on client
+ SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3
- //-1 is default value
+ // -1 is default value
SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));
SetUInt32Value(PLAYER_BYTES, (skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)));
@@ -574,6 +597,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetUInt32Value( PLAYER_GUILD_TIMESTAMP, 0 );
SetUInt64Value( PLAYER__FIELD_KNOWN_TITLES, 0 ); // 0=disabled
+ SetUInt64Value( PLAYER__FIELD_KNOWN_TITLES1, 0 ); // 0=disabled
SetUInt32Value( PLAYER_CHOSEN_TITLE, 0 );
SetUInt32Value( PLAYER_FIELD_KILLS, 0 );
SetUInt32Value( PLAYER_FIELD_LIFETIME_HONORBALE_KILLS, 0 );
@@ -581,10 +605,20 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetUInt32Value( PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0 );
// set starting level
+ uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
+ ? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)
+ : sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
+
if (GetSession()->GetSecurity() >= SEC_MODERATOR)
- SetUInt32Value (UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_GM_LEVEL));
- else
- SetUInt32Value (UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL));
+ {
+ uint32 gm_level = sWorld.getConfig(CONFIG_START_GM_LEVEL);
+ if(gm_level > start_level)
+ start_level = gm_level;
+ }
+
+ SetUInt32Value(UNIT_FIELD_LEVEL, start_level);
+
+ InitRunes();
SetUInt32Value (PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY));
SetUInt32Value (PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_START_HONOR_POINTS));
@@ -600,40 +634,40 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
//Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
if(sWorld.getConfig(CONFIG_START_ALL_REP))
{
- SetFactionReputation(sFactionStore.LookupEntry(942),42999);
- SetFactionReputation(sFactionStore.LookupEntry(935),42999);
- SetFactionReputation(sFactionStore.LookupEntry(936),42999);
- SetFactionReputation(sFactionStore.LookupEntry(1011),42999);
- SetFactionReputation(sFactionStore.LookupEntry(970),42999);
- SetFactionReputation(sFactionStore.LookupEntry(967),42999);
- SetFactionReputation(sFactionStore.LookupEntry(989),42999);
- SetFactionReputation(sFactionStore.LookupEntry(932),42999);
- SetFactionReputation(sFactionStore.LookupEntry(934),42999);
- SetFactionReputation(sFactionStore.LookupEntry(1038),42999);
- SetFactionReputation(sFactionStore.LookupEntry(1077),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(936),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1011),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(970),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(967),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(989),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(932),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(934),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1038),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1077),42999);
// Factions depending on team, like cities and some more stuff
switch(GetTeam())
{
case ALLIANCE:
- SetFactionReputation(sFactionStore.LookupEntry(72),42999);
- SetFactionReputation(sFactionStore.LookupEntry(47),42999);
- SetFactionReputation(sFactionStore.LookupEntry(69),42999);
- SetFactionReputation(sFactionStore.LookupEntry(930),42999);
- SetFactionReputation(sFactionStore.LookupEntry(730),42999);
- SetFactionReputation(sFactionStore.LookupEntry(978),42999);
- SetFactionReputation(sFactionStore.LookupEntry(54),42999);
- SetFactionReputation(sFactionStore.LookupEntry(946),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(72),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(47),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(69),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(930),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(730),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(978),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(54),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(946),42999);
break;
case HORDE:
- SetFactionReputation(sFactionStore.LookupEntry(76),42999);
- SetFactionReputation(sFactionStore.LookupEntry(68),42999);
- SetFactionReputation(sFactionStore.LookupEntry(81),42999);
- SetFactionReputation(sFactionStore.LookupEntry(911),42999);
- SetFactionReputation(sFactionStore.LookupEntry(729),42999);
- SetFactionReputation(sFactionStore.LookupEntry(941),42999);
- SetFactionReputation(sFactionStore.LookupEntry(530),42999);
- SetFactionReputation(sFactionStore.LookupEntry(947),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(76),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(68),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(81),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(911),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(729),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(941),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(530),42999);
+ GetReputationMgr().SetReputation(sFactionStore.LookupEntry(947),42999);
break;
default:
break;
@@ -648,6 +682,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
// base stats and related field values
InitStatsForLevel();
InitTaxiNodesForLevel();
+ InitGlyphsForLevel();
InitTalentForLevel();
InitPrimaryProffesions(); // to max set before any spell added
@@ -660,8 +695,16 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetPower(POWER_MANA,GetMaxPower(POWER_MANA));
}
+ if(getPowerType() == POWER_RUNIC_POWER)
+ {
+ SetPower(POWER_RUNE, 8);
+ SetMaxPower(POWER_RUNE, 8);
+ SetPower(POWER_RUNIC_POWER, 0);
+ SetMaxPower(POWER_RUNIC_POWER, 1000);
+ }
+
// original spells
- learnDefaultSpells(true);
+ learnDefaultSpells();
// original action bar
std::list<uint16>::const_iterator action_itr[4];
@@ -703,6 +746,11 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
uint32 item_id = oEntry->ItemId[j];
+
+ // Hack for not existed item id in dbc 3.0.3
+ if(item_id==40582)
+ continue;
+
ItemPrototype const* iProto = objmgr.GetItemPrototype(item_id);
if(!iProto)
{
@@ -710,7 +758,9 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
continue;
}
- uint32 count = iProto->Stackable; // max stack by default (mostly 1)
+ // max stack by default (mostly 1), 1 for infinity stackable
+ uint32 count = iProto->Stackable > 0 ? uint32(iProto->Stackable) : 1;
+
if(iProto->Class==ITEM_CLASS_CONSUMABLE && iProto->SubClass==ITEM_SUBCLASS_FOOD)
{
switch(iProto->Spells[0].SpellCategory)
@@ -760,9 +810,9 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
}
// if this is ammo then use it
- uint8 msg = CanUseAmmo( pItem->GetProto()->ItemId );
+ uint8 msg = CanUseAmmo( pItem->GetEntry() );
if( msg == EQUIP_ERR_OK )
- SetAmmo( pItem->GetProto()->ItemId );
+ SetAmmo( pItem->GetEntry() );
}
}
}
@@ -806,25 +856,14 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
return false;
}
-void Player::StartMirrorTimer(MirrorTimerType Type, uint32 MaxValue)
+void Player::SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen)
{
- uint32 BreathRegen = (uint32)-1;
-
- WorldPacket data(SMSG_START_MIRROR_TIMER, (21));
- data << (uint32)Type;
- data << MaxValue;
- data << MaxValue;
- data << BreathRegen;
- data << (uint8)0;
- data << (uint32)0; // spell id
- GetSession()->SendPacket(&data);
-}
-
-void Player::ModifyMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, uint32 Regen)
-{
- if(Type==BREATH_TIMER)
- m_breathTimer = ((MaxValue + 1000) - CurrentValue) / Regen;
-
+ if (MaxValue == DISABLED_MIRROR_TIMER)
+ {
+ if (CurrentValue!=DISABLED_MIRROR_TIMER)
+ StopMirrorTimer(Type);
+ return;
+ }
WorldPacket data(SMSG_START_MIRROR_TIMER, (21));
data << (uint32)Type;
data << CurrentValue;
@@ -837,150 +876,199 @@ void Player::ModifyMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 Cur
void Player::StopMirrorTimer(MirrorTimerType Type)
{
- if(Type==BREATH_TIMER)
- m_breathTimer = 0;
-
+ m_MirrorTimer[Type] = DISABLED_MIRROR_TIMER;
WorldPacket data(SMSG_STOP_MIRROR_TIMER, 4);
data << (uint32)Type;
GetSession()->SendPacket( &data );
}
-void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage)
+void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
+ if(!isAlive() || isGameMaster())
+ return;
+
+ // Absorb, resist some environmental damage type
+ uint32 absorb = 0;
+ uint32 resist = 0;
+ if (type == DAMAGE_LAVA)
+ CalcAbsorbResist(this, SPELL_SCHOOL_MASK_FIRE, DIRECT_DAMAGE, damage, &absorb, &resist);
+ else if (type == DAMAGE_SLIME)
+ CalcAbsorbResist(this, SPELL_SCHOOL_MASK_NATURE, DIRECT_DAMAGE, damage, &absorb, &resist);
+
+ damage-=absorb+resist;
+
WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21));
- data << (uint64)guid;
- data << (uint8)(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
- data << (uint32)damage;
- data << (uint32)0;
- data << (uint32)0;
+ data << uint64(GetGUID());
+ data << uint8(type!=DAMAGE_FALL_TO_VOID ? type : DAMAGE_FALL);
+ data << uint32(damage);
+ data << uint32(absorb);
+ data << uint32(resist);
SendMessageToSet(&data, true);
DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- if(type==DAMAGE_FALL && !isAlive()) // DealDamage not apply item durability loss at self damage
+ if(!isAlive())
{
- DEBUG_LOG("We are fall to death, loosing 10 percents durability");
- DurabilityLossAll(0.10f,false);
- // durability lost message
- WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
- GetSession()->SendPacket(&data);
+ if(type==DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
+ {
+ DEBUG_LOG("We are fall to death, loosing 10 percents durability");
+ DurabilityLossAll(0.10f,false);
+ // durability lost message
+ WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
+ GetSession()->SendPacket(&data);
+ }
+
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
}
}
-void Player::HandleDrowning()
+int32 Player::getMaxTimer(MirrorTimerType timer)
{
- if(!m_isunderwater)
- return;
-
- //if player is GM, have waterbreath, is dead or if breathing is disabled then return
- if(waterbreath || isGameMaster() || !isAlive() || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
+ switch (timer)
{
- StopMirrorTimer(BREATH_TIMER);
- m_isunderwater = 0;
- return;
+ case FATIGUE_TIMER:
+ return MINUTE*IN_MILISECONDS;
+ case BREATH_TIMER:
+ {
+ if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
+ return DISABLED_MIRROR_TIMER;
+ int32 UnderWaterTime = 3*MINUTE*IN_MILISECONDS;
+ AuraEffectList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
+ for(AuraEffectList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
+ UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetAmount()) / 100.0f);
+ return UnderWaterTime;
+ }
+ case FIRE_TIMER:
+ {
+ if (!isAlive())
+ return DISABLED_MIRROR_TIMER;
+ return 1*IN_MILISECONDS;
+ }
+ default:
+ return 0;
}
+ return 0;
+}
- uint32 UnderWaterTime = 1*MINUTE*1000; // default length 1 min
+void Player::UpdateMirrorTimers()
+{
+ // Desync flags for update on next HandleDrowning
+ if (m_MirrorTimerFlags)
+ m_MirrorTimerFlagsLast = ~m_MirrorTimerFlags;
+}
- AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
- for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
- UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifierValue()) / 100.0f);
+void Player::HandleDrowning(uint32 time_diff)
+{
+ if (!m_MirrorTimerFlags)
+ return;
- if ((m_isunderwater & 0x01) && !(m_isunderwater & 0x80) && isAlive())
+ // In water
+ if (m_MirrorTimerFlags & UNDERWATER_INWATER)
{
- //single trigger timer
- if (!(m_isunderwater & 0x02))
- {
- m_isunderwater|= 0x02;
- m_breathTimer = UnderWaterTime + 1000;
- }
- //single trigger "Breathbar"
- if ( m_breathTimer <= UnderWaterTime && !(m_isunderwater & 0x04))
+ // Breath timer not activated - activate it
+ if (m_MirrorTimer[BREATH_TIMER] == DISABLED_MIRROR_TIMER)
{
- m_isunderwater|= 0x04;
- StartMirrorTimer(BREATH_TIMER, UnderWaterTime);
+ m_MirrorTimer[BREATH_TIMER] = getMaxTimer(BREATH_TIMER);
+ SendMirrorTimer(BREATH_TIMER, m_MirrorTimer[BREATH_TIMER], m_MirrorTimer[BREATH_TIMER], -1);
}
- //continuous trigger drowning "Damage"
- if ((m_breathTimer == 0) && (m_isunderwater & 0x01))
+ else // If activated - do tick
{
- //TODO: Check this formula
- uint64 guid = GetGUID();
- uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
-
- EnvironmentalDamage(guid, DAMAGE_DROWNING,damage);
- m_breathTimer = 2000;
+ m_MirrorTimer[BREATH_TIMER]-=time_diff;
+ // Timer limit - need deal damage
+ if (m_MirrorTimer[BREATH_TIMER] < 0)
+ {
+ m_MirrorTimer[BREATH_TIMER]+= 1*IN_MILISECONDS;
+ // Calculate and deal damage
+ // TODO: Check this formula
+ uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
+ EnvironmentalDamage(DAMAGE_DROWNING, damage);
+ }
+ else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INWATER)) // Update time in client if need
+ SendMirrorTimer(BREATH_TIMER, getMaxTimer(BREATH_TIMER), m_MirrorTimer[BREATH_TIMER], -1);
}
}
- //single trigger retract bar
- else if (!(m_isunderwater & 0x01) && !(m_isunderwater & 0x08) && (m_isunderwater & 0x02) && (m_breathTimer > 0) && isAlive())
- {
- m_isunderwater = 0x08;
-
- uint32 BreathRegen = 10;
- ModifyMirrorTimer(BREATH_TIMER, UnderWaterTime, m_breathTimer,BreathRegen);
- m_isunderwater = 0x10;
- }
- //remove bar
- else if ((m_breathTimer < 50) && !(m_isunderwater & 0x01) && (m_isunderwater == 0x10))
+ else if (m_MirrorTimer[BREATH_TIMER] != DISABLED_MIRROR_TIMER) // Regen timer
{
- StopMirrorTimer(BREATH_TIMER);
- m_isunderwater = 0;
+ int32 UnderWaterTime = getMaxTimer(BREATH_TIMER);
+ // Need breath regen
+ m_MirrorTimer[BREATH_TIMER]+=10*time_diff;
+ if (m_MirrorTimer[BREATH_TIMER] >= UnderWaterTime || !isAlive())
+ StopMirrorTimer(BREATH_TIMER);
+ else if (m_MirrorTimerFlagsLast & UNDERWATER_INWATER)
+ SendMirrorTimer(BREATH_TIMER, UnderWaterTime, m_MirrorTimer[BREATH_TIMER], 10);
}
-}
-void Player::HandleLava()
-{
- bool ValidArea = false;
-
- if ((m_isunderwater & 0x80) && isAlive())
+ // In dark water
+ if (m_MirrorTimerFlags & UNDERWARER_INDARKWATER)
{
- //Single trigger Set BreathTimer
- if (!(m_isunderwater & 0x80))
+ // Fatigue timer not activated - activate it
+ if (m_MirrorTimer[FATIGUE_TIMER] == DISABLED_MIRROR_TIMER)
{
- m_isunderwater|= 0x04;
- m_breathTimer = 1000;
+ m_MirrorTimer[FATIGUE_TIMER] = getMaxTimer(FATIGUE_TIMER);
+ SendMirrorTimer(FATIGUE_TIMER, m_MirrorTimer[FATIGUE_TIMER], m_MirrorTimer[FATIGUE_TIMER], -1);
}
- //Reset BreathTimer and still in the lava
- if (!m_breathTimer)
+ else
{
- uint64 guid = GetGUID();
- uint32 damage = urand(600, 700); // TODO: Get more detailed information about lava damage
- uint32 dmgZone = GetZoneId(); // TODO: Find correct "lava dealing zone" flag in Area Table
-
- // Deal lava damage only in lava zones.
- switch(dmgZone)
+ m_MirrorTimer[FATIGUE_TIMER]-=time_diff;
+ // Timer limit - need deal damage or teleport ghost to graveyard
+ if (m_MirrorTimer[FATIGUE_TIMER] < 0)
{
- case 0x8D:
- ValidArea = false;
- break;
- case 0x94:
- ValidArea = false;
- break;
- case 0x2CE:
- ValidArea = false;
- break;
- case 0x2CF:
- ValidArea = false;
- break;
- default:
- if (dmgZone / 5 & 0x408)
- ValidArea = true;
+ m_MirrorTimer[FATIGUE_TIMER]+= 1*IN_MILISECONDS;
+ if (isAlive()) // Calculate and deal damage
+ {
+ uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
+ EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
+ }
+ else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
+ RepopAtGraveyard();
}
-
- // if is valid area and is not gamemaster then deal damage
- if ( ValidArea && !isGameMaster() )
- EnvironmentalDamage(guid, DAMAGE_LAVA, damage);
-
- m_breathTimer = 1000;
+ else if (!(m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER))
+ SendMirrorTimer(FATIGUE_TIMER, getMaxTimer(FATIGUE_TIMER), m_MirrorTimer[FATIGUE_TIMER], -1);
}
-
}
- //Death timer disabled and WaterFlags reset
- else if (m_deathState == DEAD)
+ else if (m_MirrorTimer[FATIGUE_TIMER] != DISABLED_MIRROR_TIMER) // Regen timer
+ {
+ int32 DarkWaterTime = getMaxTimer(FATIGUE_TIMER);
+ m_MirrorTimer[FATIGUE_TIMER]+=10*time_diff;
+ if (m_MirrorTimer[FATIGUE_TIMER] >= DarkWaterTime || !isAlive())
+ StopMirrorTimer(FATIGUE_TIMER);
+ else if (m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER)
+ SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
+ }
+
+ if (m_MirrorTimerFlags & (UNDERWATER_INLAVA|UNDERWATER_INSLIME))
{
- m_breathTimer = 0;
- m_isunderwater = 0;
+ // Breath timer not activated - activate it
+ if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER)
+ m_MirrorTimer[FIRE_TIMER] = getMaxTimer(FIRE_TIMER);
+ else
+ {
+ m_MirrorTimer[FIRE_TIMER]-=time_diff;
+ if (m_MirrorTimer[FIRE_TIMER] < 0)
+ {
+ m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILISECONDS;
+ // Calculate and deal damage
+ // TODO: Check this formula
+ uint32 damage = urand(600, 700);
+ if (m_MirrorTimerFlags&UNDERWATER_INLAVA)
+ EnvironmentalDamage(DAMAGE_LAVA, damage);
+ else
+ EnvironmentalDamage(DAMAGE_SLIME, damage);
+ }
+ }
}
+ else
+ m_MirrorTimer[FIRE_TIMER] = DISABLED_MIRROR_TIMER;
+
+ // Recheck timers flag
+ m_MirrorTimerFlags&=~UNDERWATER_EXIST_TIMERS;
+ for (int i = 0; i< MAX_TIMERS; ++i)
+ if (m_MirrorTimer[i]!=DISABLED_MIRROR_TIMER)
+ {
+ m_MirrorTimerFlags|=UNDERWATER_EXIST_TIMERS;
+ break;
+ }
+ m_MirrorTimerFlagsLast = m_MirrorTimerFlags;
}
///The player sobers by 256 every 10 seconds
@@ -1058,8 +1146,6 @@ void Player::Update( uint32 p_time )
UpdateAfkReport(now);
- CheckExploreSystem();
-
if(isCharmed())
{
if(Unit *charmer = GetCharmer())
@@ -1203,14 +1289,15 @@ void Player::Update( uint32 p_time )
{
if(p_time >= m_zoneUpdateTimer)
{
- uint32 newzone = GetZoneId();
+ uint32 newzone, newarea;
+ GetZoneAndAreaId(newzone,newarea);
+
if( m_zoneUpdateId != newzone )
- UpdateZone(newzone); // also update area
+ UpdateZone(newzone,newarea); // also update area
else
{
// use area updates as well
// needed for free far all arenas for example
- uint32 newarea = GetAreaId();
if( m_areaUpdateId != newarea )
UpdateArea(newarea);
@@ -1245,21 +1332,8 @@ void Player::Update( uint32 p_time )
}
}
- //Breathtimer
- if(m_breathTimer > 0)
- {
- if(p_time >= m_breathTimer)
- m_breathTimer = 0;
- else
- m_breathTimer -= p_time;
-
- }
-
//Handle Water/drowning
- HandleDrowning();
-
- //Handle lava
- HandleLava();
+ HandleDrowning(p_time);
//Handle detect stealth players
if (m_DetectInvTimer > 0)
@@ -1286,7 +1360,7 @@ void Player::Update( uint32 p_time )
{
m_drunkTimer += p_time;
- if (m_drunkTimer > 10000)
+ if (m_drunkTimer > 10*IN_MILISECONDS)
HandleSobering();
}
@@ -1311,6 +1385,7 @@ void Player::Update( uint32 p_time )
Pet* pet = GetPet();
if(pet && !IsWithinDistInMap(pet, OWNER_MAX_DISTANCE) && !pet->isPossessed())
+ //if(pet && !IsWithinDistInMap(pet, OWNER_MAX_DISTANCE) && (GetCharmGUID() && (pet->GetGUID() != GetCharmGUID())))
{
RemovePet(pet, PET_SAVE_NOT_IN_SLOT, true);
return;
@@ -1344,16 +1419,15 @@ void Player::setDeathState(DeathState s)
//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);
- // remove uncontrolled pets
- RemoveMiniPet();
- RemoveGuardians();
-
// save value before aura remove in Unit::setDeathState
ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL);
// passive spell
if(!ressSpellId)
ressSpellId = GetResurrectionSpellId();
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1);
}
Unit::setDeathState(s);
@@ -1374,13 +1448,15 @@ void Player::setDeathState(DeathState s)
void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
{
- *p_data << GetGUID();
+ Field *fields = result->Fetch();
+
+ *p_data << uint64(GetGUID());
*p_data << m_name;
- *p_data << getRace();
+ *p_data << uint8(getRace());
uint8 pClass = getClass();
- *p_data << pClass;
- *p_data << getGender();
+ *p_data << uint8(pClass);
+ *p_data << uint8(getGender());
uint32 bytes = GetUInt32Value(PLAYER_BYTES);
*p_data << uint8(bytes);
@@ -1393,16 +1469,17 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
*p_data << uint8(getLevel()); // player level
// do not use GetMap! it will spawn a new instance since the bound instances are not loaded
- uint32 zoneId = MapManager::Instance().GetZoneId(GetMapId(), GetPositionX(),GetPositionY());
+ uint32 zoneId = MapManager::Instance().GetZoneId(GetMapId(), GetPositionX(),GetPositionY(),GetPositionZ());
sLog.outDebug("Player::BuildEnumData: m:%u, x:%f, y:%f, z:%f zone:%u", GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), zoneId);
- *p_data << zoneId;
- *p_data << GetMapId();
+ *p_data << uint32(zoneId);
+ *p_data << uint32(GetMapId());
*p_data << GetPositionX();
*p_data << GetPositionY();
*p_data << GetPositionZ();
- *p_data << (result ? result->Fetch()[13].GetUInt32() : 0);
+ // guild id
+ *p_data << (result ? fields[13].GetUInt32() : 0);
uint32 char_flags = 0;
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
@@ -1413,14 +1490,13 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
char_flags |= CHARACTER_FLAG_GHOST;
if(HasAtLoginFlag(AT_LOGIN_RENAME))
char_flags |= CHARACTER_FLAG_RENAME;
- // always send the flag if declined names aren't used
- // to let the client select a default method of declining the name
- if(!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) || (result && result->Fetch()[14].GetCppString() != ""))
+ if(sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) && (fields[14].GetCppString() != ""))
char_flags |= CHARACTER_FLAG_DECLINED;
- *p_data << (uint32)char_flags; // character flags
-
- *p_data << (uint8)1; // unknown
+ *p_data << uint32(char_flags); // character flags
+ // character customize (flags?)
+ *p_data << uint32(HasAtLoginFlag(AT_LOGIN_CUSTOMIZE) ? 1 : 0);
+ *p_data << uint8(1); // unknown
// Pets info
{
@@ -1431,8 +1507,6 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
// show pet at selection character in character list only for non-ghost character
if(result && isAlive() && (pClass == CLASS_WARLOCK || pClass == CLASS_HUNTER))
{
- Field* fields = result->Fetch();
-
uint32 entry = fields[10].GetUInt32();
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry);
if(cInfo)
@@ -1443,36 +1517,11 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
}
}
- *p_data << (uint32)petDisplayId;
- *p_data << (uint32)petLevel;
- *p_data << (uint32)petFamily;
+ *p_data << uint32(petDisplayId);
+ *p_data << uint32(petLevel);
+ *p_data << uint32(petFamily);
}
- /*ItemPrototype const *items[EQUIPMENT_SLOT_END];
- for (int i = 0; i < EQUIPMENT_SLOT_END; i++)
- items[i] = NULL;
-
- QueryResult *result = CharacterDatabase.PQuery("SELECT slot,item_template FROM character_inventory WHERE guid = '%u' AND bag = 0",GetGUIDLow());
- if (result)
- {
- do
- {
- Field *fields = result->Fetch();
- uint8 slot = fields[0].GetUInt8() & 255;
- uint32 item_id = fields[1].GetUInt32();
- if( slot >= EQUIPMENT_SLOT_END )
- continue;
-
- items[slot] = objmgr.GetItemPrototype(item_id);
- if(!items[slot])
- {
- sLog.outError( "Player::BuildEnumData: Player %s have unknown item (id: #%u) in inventory, skipped.", GetName(),item_id );
- continue;
- }
- } while (result->NextRow());
- delete result;
- }*/
-
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; slot++)
{
uint32 visualbase = PLAYER_VISIBLE_ITEM_1_0 + (slot * MAX_VISIBLE_ITEM_OFFSET);
@@ -1489,20 +1538,20 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
if (proto != NULL)
{
- *p_data << (uint32)proto->DisplayInfoID;
- *p_data << (uint8)proto->InventoryType;
- *p_data << (uint32)(enchant?enchant->aura_id:0);
+ *p_data << uint32(proto->DisplayInfoID);
+ *p_data << uint8(proto->InventoryType);
+ *p_data << uint32(enchant ? enchant->aura_id : 0);
}
else
{
- *p_data << (uint32)0;
- *p_data << (uint8)0;
- *p_data << (uint32)0; // enchant?
+ *p_data << uint32(0);
+ *p_data << uint8(0);
+ *p_data << uint32(0); // enchant?
}
}
- *p_data << (uint32)0; // first bag display id
- *p_data << (uint8)0; // first bag inventory type
- *p_data << (uint32)0; // enchant?
+ *p_data << uint32(0); // first bag display id
+ *p_data << uint8(0); // first bag inventory type
+ *p_data << uint32(0); // enchant?
}
bool Player::ToggleAFK()
@@ -1566,19 +1615,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if(!InBattleGround() && mEntry->IsBattleGroundOrArena())
return false;
- // 449 - Champions' Hall (Alliance) // 450 - Hall of Legends (Horde)
- if(mapid == 449 && GetTeam()==HORDE)
- {
- GetSession()->SendNotification(LANG_NO_ENTER_CHAMPIONS_HALL);
- return false;
- }
-
- if(mapid == 450 && GetTeam() == ALLIANCE)
- {
- GetSession()->SendNotification(LANG_NO_ENTER_HALL_OF_LEGENDS);
- return false;
- }
-
// client without expansion support
if(GetSession()->Expansion() < mEntry->Expansion())
{
@@ -1587,13 +1623,13 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if(GetTransport())
RepopAtGraveyard(); // teleport to near graveyard if on transport, looks blizz like :)
- SendTransferAborted(mapid, TRANSFER_ABORT_INSUF_EXPAN_LVL1);
+ SendTransferAborted(mapid, TRANSFER_ABORT_INSUF_EXPAN_LVL, mEntry->Expansion());
return false; // normal client can't teleport to this map...
}
else
{
- sLog.outDebug("Player %s will teleported to map %u", GetName(), mapid);
+ sLog.outDebug("Player %s is being teleported to map %u", GetName(), mapid);
}
// if we were on a transport, leave
@@ -1608,9 +1644,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
m_movementInfo.t_time = 0;
}
- SetSemaphoreTeleport(true);
-
- // The player was ported to another map and looses the duel immediatly.
+ // The player was ported to another map and looses the duel immediately.
// We have to perform this check before the teleport, otherwise the
// ObjectAccessor won't find the flag.
if (duel && GetMapId()!=mapid)
@@ -1625,68 +1659,29 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if ((GetMapId() == mapid) && (!m_transport))
{
- // prepare zone change detect
- uint32 old_zone = GetZoneId();
-
- // near teleport
- if(!GetSession()->PlayerLogout())
- {
- WorldPacket data;
- BuildTeleportAckMsg(&data, x, y, z, orientation);
- GetSession()->SendPacket(&data);
- SetPosition( x, y, z, orientation, true);
- }
- else
- // this will be used instead of the current location in SaveToDB
- m_teleport_dest = WorldLocation(mapid, x, y, z, orientation);
- SetFallInformation(0, z);
-
- //BuildHeartBeatMsg(&data);
- //SendMessageToSet(&data, true);
if (!(options & TELE_TO_NOT_UNSUMMON_PET))
{
- //same map, only remove pet if out of range
- if(pet && !IsWithinDistInMap(pet, OWNER_MAX_DISTANCE))
- {
- if(pet->isControlled() && !pet->isTemporarySummoned() )
- m_temporaryUnsummonedPetNumber = pet->GetCharmInfo()->GetPetNumber();
- else
- m_temporaryUnsummonedPetNumber = 0;
-
- RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
- }
+ //same map, only remove pet if out of range for new position
+ if(pet && pet->GetDistance(x,y,z) >= OWNER_MAX_DISTANCE)
+ UnsummonPetTemporaryIfAny();
}
if(!(options & TELE_TO_NOT_LEAVE_COMBAT))
CombatStop();
- if (!(options & TELE_TO_NOT_UNSUMMON_PET))
- {
- // resummon pet
- if(pet && m_temporaryUnsummonedPetNumber)
- {
- Pet* NewPet = new Pet;
- if(!NewPet->LoadPetFromDB(this, 0, m_temporaryUnsummonedPetNumber, true))
- delete NewPet;
-
- m_temporaryUnsummonedPetNumber = 0;
- }
- }
+ // this will be used instead of the current location in SaveToDB
+ m_teleport_dest = WorldLocation(mapid, x, y, z, orientation);
+ SetFallInformation(0, z);
+ // code for finish transfer called in WorldSession::HandleMovementOpcodes()
+ // at client packet MSG_MOVE_TELEPORT_ACK
+ SetSemaphoreTeleportNear(true);
+ // near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing
if(!GetSession()->PlayerLogout())
{
- // don't reset teleport semaphore while logging out, otherwise m_teleport_dest won't be used in Player::SaveToDB
- SetSemaphoreTeleport(false);
-
- UpdateZone(GetZoneId());
- }
-
- // new zone
- if(old_zone != GetZoneId())
- {
- // honorless target
- if(pvpInfo.inHostileArea)
- CastSpell(this, 2479, true);
+ WorldPacket data;
+ BuildTeleportAckMsg(&data, x, y, z, orientation);
+ GetSession()->SendPacket(&data);
}
}
else
@@ -1698,10 +1693,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// Check enter rights before map getting to avoid creating instance copy for player
// this check not dependent from map instance copy and same for all instance copies of selected map
if (!MapManager::Instance().CanPlayerEnter(mapid, this))
- {
- SetSemaphoreTeleport(false);
return false;
- }
// If the map is not created, assume it is possible to enter it.
// It will be created in the WorldPortAck.
@@ -1726,15 +1718,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// remove pet on map change
if (pet)
- {
- //leaving map -> delete pet right away (doing this later will cause problems)
- if(pet->isControlled() && !pet->isTemporarySummoned())
- m_temporaryUnsummonedPetNumber = pet->GetCharmInfo()->GetPetNumber();
- else
- m_temporaryUnsummonedPetNumber = 0;
-
- RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
- }
+ UnsummonPetTemporaryIfAny();
// remove all dyn objects
RemoveAllDynObjects();
@@ -1791,13 +1775,11 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// if the player is saved before worldportack (at logout for example)
// this will be used instead of the current location in SaveToDB
- RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP);
+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING);
// move packet sent by client always after far teleport
- // SetPosition(final_x, final_y, final_z, final_o, true);
- SetDontMove(true);
-
// code for finish transfer to new map called in WorldSession::HandleMoveWorldportAckOpcode at client packet
+ SetSemaphoreTeleportFar(true);
}
else
return false;
@@ -1827,9 +1809,6 @@ void Player::RemoveFromWorld()
///- Release charmed creatures, unsummon totems and remove pets/guardians
StopCastingCharm();
StopCastingBindSight();
- UnsummonAllTotems();
- RemoveMiniPet();
- RemoveGuardians();
}
for(int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; i++)
@@ -1842,6 +1821,15 @@ void Player::RemoveFromWorld()
///- It will crash when updating the ObjectAccessor
///- The player should only be removed when logging out
Unit::RemoveFromWorld();
+
+ if(m_uint32Values)
+ {
+ if(WorldObject *viewpoint = GetViewpoint())
+ {
+ sLog.outCrash("Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId());
+ SetViewpoint(viewpoint, false);
+ }
+ }
}
void Player::RewardRage( uint32 damage, uint32 weaponSpeedHitFactor, bool attacker )
@@ -1883,13 +1871,20 @@ void Player::RegenerateAll()
{
RegenerateHealth();
if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
+ {
Regenerate(POWER_RAGE);
+ if(getClass() == CLASS_DEATH_KNIGHT)
+ Regenerate(POWER_RUNIC_POWER);
+ }
}
Regenerate( POWER_ENERGY );
Regenerate( POWER_MANA );
+ if(getClass() == CLASS_DEATH_KNIGHT)
+ Regenerate( POWER_RUNE );
+
m_regenTimer = regenDelay;
}
@@ -1909,11 +1904,11 @@ void Player::Regenerate(Powers power)
if (recentCast)
{
// Trinity Updates Mana in intervals of 2s, which is correct
- addvalue = GetFloatValue(PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT) * ManaIncreaseRate * 2.00f;
+ addvalue = GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * 2.00f;
}
else
{
- addvalue = GetFloatValue(PLAYER_FIELD_MOD_MANA_REGEN) * ManaIncreaseRate * 2.00f;
+ addvalue = GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * 2.00f;
}
} break;
case POWER_RAGE: // Regenerate rage
@@ -1924,6 +1919,17 @@ void Player::Regenerate(Powers power)
case POWER_ENERGY: // Regenerate energy (rogue)
addvalue = 20;
break;
+ case POWER_RUNIC_POWER:
+ {
+ float RunicPowerDecreaseRate = sWorld.getRate(RATE_POWER_RUNICPOWER_LOSS);
+ addvalue = 30 * RunicPowerDecreaseRate; // 3 RunicPower by tick
+ } break;
+ case POWER_RUNE:
+ {
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ if(uint8 cd = GetRuneCooldown(i)) // if we have cooldown, reduce it...
+ SetRuneCooldown(i, cd - 1); // ... by 2 sec (because update is every 2 sec)
+ } break;
case POWER_FOCUS:
case POWER_HAPPINESS:
break;
@@ -1933,13 +1939,13 @@ void Player::Regenerate(Powers power)
// Exist only for POWER_MANA, POWER_ENERGY, POWER_FOCUS auras
if(power != POWER_MANA)
{
- AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
- for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue == power)
- addvalue *= ((*i)->GetModifierValue() + 100) / 100.0f;
+ AuraEffectList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
+ for(AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
+ if ((*i)->GetMiscValue() == power)
+ addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
}
- if (power != POWER_RAGE)
+ if (power != POWER_RAGE && power != POWER_RUNIC_POWER)
{
curValue += uint32(addvalue);
if (curValue > maxValue)
@@ -1975,9 +1981,9 @@ void Player::RegenerateHealth()
addvalue = OCTRegenHPPerSpirit()* HealthIncreaseRate;
if (!isInCombat())
{
- AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
- for(AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
- addvalue *= (100.0f + (*i)->GetModifierValue()) / 100.0f;
+ AuraEffectList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
+ for(AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
+ addvalue *= (100.0f + (*i)->GetAmount()) / 100.0f;
}
else if(HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f;
@@ -2037,21 +2043,27 @@ void Player::SetGameMaster(bool on)
setFaction(35);
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
- RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP);
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
ResetContestedPvP();
getHostilRefManager().setOnlineOfflineState(false);
CombatStop();
+
+ SetPhaseMask(PHASEMASK_ANYWHERE,false); // see and visible in all phases
}
else
{
+ // restore phase
+ AuraEffectList const& phases = GetAurasByType(SPELL_AURA_PHASE);
+ SetPhaseMask(!phases.empty() ? phases.front()->GetMiscValue() : PHASEMASK_NORMAL,false);
+
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
setFactionForRace(getRace());
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
// restore FFA PvP Server state
if(sWorld.IsFFAPvPRealm())
- SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
// restore FFA PvP area state, remove not allowed for GM mounts
UpdateArea(m_areaUpdateId);
@@ -2115,7 +2127,7 @@ void Player::UninviteFromGroup()
group->RemoveInvite(this);
- if(group->GetMembersCount() <= 1) // group has just 1 member => disband
+ if(group->GetMembersCount() <= 1) // group has just 1 member => disband
{
if(group->IsCreated())
{
@@ -2173,9 +2185,9 @@ void Player::GiveXP(uint32 xp, Unit* victim)
return;
// handle SPELL_AURA_MOD_XP_PCT auras
- Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
- for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- xp = uint32(xp*(1.0f + (*i)->GetModifierValue() / 100.0f));
+ Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
+ for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
+ xp = uint32(xp*(1.0f + (*i)->GetAmount() / 100.0f));
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -2223,13 +2235,15 @@ void Player::GiveLevel(uint32 level)
data << uint32(0);
data << uint32(0);
data << uint32(0);
+ data << uint32(0);
+ data << uint32(0);
// end for
for(int i = STAT_STRENGTH; i < MAX_STATS; ++i) // Stats loop (0-4)
data << uint32(int32(info.stats[i]) - GetCreateStat(Stats(i)));
GetSession()->SendPacket(&data);
- SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(level));
+ SetUInt32Value(PLAYER_NEXT_LEVEL_XP, objmgr.GetXPForLevel(level));
//update level, max level of skills
if(getLevel()!= level)
@@ -2246,6 +2260,7 @@ void Player::GiveLevel(uint32 level)
InitTalentForLevel();
InitTaxiNodesForLevel();
+ InitGlyphsForLevel();
UpdateAllStats();
@@ -2265,6 +2280,7 @@ void Player::GiveLevel(uint32 level)
Pet* pet = GetPet();
if(pet && pet->getPetType()==SUMMON_PET)
pet->GivePetLevel(level);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
}
void Player::InitTalentForLevel()
@@ -2282,7 +2298,8 @@ void Player::InitTalentForLevel()
}
else
{
- uint32 talentPointsForLevel = uint32((level-9)*sWorld.getRate(RATE_TALENT));
+ uint32 talentPointsForLevel = CalculateTalentsPoints();
+
// if used more that have then reset
if(m_usedTalentCount > talentPointsForLevel)
{
@@ -2309,7 +2326,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
objmgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info);
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) );
- SetUInt32Value(PLAYER_NEXT_LEVEL_XP, Trinity::XP::xp_to_level(getLevel()));
+ SetUInt32Value(PLAYER_NEXT_LEVEL_XP, objmgr.GetXPForLevel(getLevel()));
UpdateSkillsForLevel ();
@@ -2359,11 +2376,11 @@ void Player::InitStatsForLevel(bool reapplyMods)
SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, 0.0f );
SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, 0.0f );
- SetUInt32Value(UNIT_FIELD_ATTACK_POWER, 0 );
- SetUInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, 0 );
+ SetInt32Value(UNIT_FIELD_ATTACK_POWER, 0 );
+ SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, 0 );
SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER,0.0f);
- SetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER, 0 );
- SetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS,0 );
+ SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER, 0 );
+ SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS,0 );
SetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER,0.0f);
// Base crit values (will be recalculated in UpdateAllStats() at loading and in _ApplyAllStatBonuses() at reset
@@ -2398,9 +2415,12 @@ void Player::InitStatsForLevel(bool reapplyMods)
SetUInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,0);
for(int i = 0; i < MAX_SPELL_SCHOOL; ++i)
{
- SetFloatValue(UNIT_FIELD_POWER_COST_MODIFIER+i,0.0f);
+ SetUInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,0);
SetFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER+i,0.0f);
}
+ // Reset no reagent cost field
+ for(int i = 0; i < 3; i++)
+ SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + i, 0);
// Init data for form but skip reapply item mods for form
InitDataForForm(reapplyMods);
@@ -2417,15 +2437,18 @@ void Player::InitStatsForLevel(bool reapplyMods)
RemoveFlag( UNIT_FIELD_FLAGS,
UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 |
UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED |
- UNIT_FLAG_DISABLE_ROTATE | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
+ UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_NOT_SELECTABLE |
UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT );
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE ); // must be set
+ SetFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_REGENERATE_POWER);// must be set
+
// cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example.
- RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_FLAGS_FFA_PVP);
+ RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_ALLOW_ONLY_ABILITY);
- SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00); // one form stealth modified bytes
+ RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // one form stealth modified bytes
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY);
// restore if need some important flags
SetUInt32Value(PLAYER_FIELD_BYTES2, 0 ); // flags empty by default
@@ -2441,10 +2464,14 @@ void Player::InitStatsForLevel(bool reapplyMods)
SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE));
SetPower(POWER_FOCUS, 0);
SetPower(POWER_HAPPINESS, 0);
+ SetPower(POWER_RUNIC_POWER, 0);
}
void Player::SendInitialSpells()
{
+ time_t curTime = time(NULL);
+ time_t infTime = curTime + MONTH/2;
+
uint16 spellCount = 0;
WorldPacket data(SMSG_INITIAL_SPELLS, (1+2+4*m_spells.size()+2+m_spellCooldowns.size()*(2+2+2+4+4)));
@@ -2477,12 +2504,15 @@ void Player::SendInitialSpells()
if(!sEntry)
continue;
+ // not send infinity cooldown
+ if(itr->second.end > infTime)
+ continue;
+
data << uint16(itr->first);
time_t cooldown = 0;
- time_t curTime = time(NULL);
if(itr->second.end > curTime)
- cooldown = (itr->second.end-curTime)*1000;
+ cooldown = (itr->second.end-curTime)*IN_MILISECONDS;
data << uint16(itr->second.itemid); // cast item id
data << uint16(sEntry->Category); // spell category
@@ -2573,13 +2603,13 @@ void Player::AddNewMailDeliverTime(time_t deliver_time)
}
}
-bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading, uint16 slot_id, bool disabled)
+bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependent, bool disabled)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
{
// do character spell book cleanup (all characters)
- if(loading && !learning) // spell load case
+ if(!IsInWorld() && !learning) // spell load case
{
sLog.outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.",spell_id);
CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id);
@@ -2593,7 +2623,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
if(!SpellMgr::IsSpellValid(spellInfo,this,false))
{
// do character spell book cleanup (all characters)
- if(loading && !learning) // spell load case
+ if(!IsInWorld() && !learning) // spell load case
{
sLog.outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.",spell_id);
CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id);
@@ -2606,29 +2636,80 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
PlayerSpellState state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
+ bool dependent_set = false;
bool disabled_case = false;
bool superceded_old = false;
PlayerSpellMap::iterator itr = m_spells.find(spell_id);
if (itr != m_spells.end())
{
+ uint32 next_active_spell_id = 0;
+ // fix activate state for non-stackable low rank (and find next spell for !active case)
+ if(!SpellMgr::canStackSpellRanks(spellInfo) && spellmgr.GetSpellRank(spellInfo->Id) != 0)
+ {
+ if(uint32 next = spellmgr.GetNextSpellInChain(spell_id))
+ {
+ if(HasSpell(next))
+ {
+ // high rank already known so this must !active
+ active = false;
+ next_active_spell_id = next;
+ }
+ }
+ }
+
+ // not do anything if already known in expected state
+ if(itr->second->state != PLAYERSPELL_REMOVED && itr->second->active == active &&
+ itr->second->dependent == dependent && itr->second->disabled == disabled)
+ {
+ if(!IsInWorld() && !learning) // explicitly load from DB and then exist in it already and set correctly
+ itr->second->state = PLAYERSPELL_UNCHANGED;
+
+ return false;
+ }
+
+ // dependent spell known as not dependent, overwrite state
+ if (itr->second->state != PLAYERSPELL_REMOVED && !itr->second->dependent && dependent)
+ {
+ itr->second->dependent = dependent;
+ if (itr->second->state != PLAYERSPELL_NEW)
+ itr->second->state = PLAYERSPELL_CHANGED;
+ dependent_set = true;
+ }
+
// update active state for known spell
if(itr->second->active != active && itr->second->state != PLAYERSPELL_REMOVED && !itr->second->disabled)
{
itr->second->active = active;
- // loading && !learning == explicitly load from DB and then exist in it already and set correctly
- if(loading && !learning)
+ if(!IsInWorld() && !learning && !dependent_set) // explicitly load from DB and then exist in it already and set correctly
itr->second->state = PLAYERSPELL_UNCHANGED;
else if(itr->second->state != PLAYERSPELL_NEW)
itr->second->state = PLAYERSPELL_CHANGED;
- if(!active)
+ if(active)
{
- WorldPacket data(SMSG_REMOVED_SPELL, 4);
- data << uint16(spell_id);
- GetSession()->SendPacket(&data);
+ if (IsPassiveSpell(spell_id) && IsNeedCastPassiveSpellAtLearn(spellInfo))
+ CastSpell (this,spell_id,true);
}
+ else if(IsInWorld())
+ {
+ if(next_active_spell_id)
+ {
+ // update spell ranks in spellbook and action bar
+ WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
+ data << uint16(spell_id);
+ data << uint16(next_active_spell_id);
+ GetSession()->SendPacket( &data );
+ }
+ else
+ {
+ WorldPacket data(SMSG_REMOVED_SPELL, 4);
+ data << uint16(spell_id);
+ GetSession()->SendPacket(&data);
+ }
+ }
+
return active; // learn (show in spell book if active now)
}
@@ -2657,7 +2738,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
default: // known not saved yet spell (new or modified)
{
// can be in case spell loading but learned at some previous spell loading
- if(loading && !learning)
+ if(!IsInWorld() && !learning && !dependent_set)
itr->second->state = PLAYERSPELL_UNCHANGED;
return false;
@@ -2672,17 +2753,13 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
{
if(TalentEntry const *talentInfo = sTalentStore.LookupEntry( talentPos->talent_id ))
{
- for(int i=0; i <5; ++i)
+ for(int i=0; i < MAX_TALENT_RANK; ++i)
{
// skip learning spell and no rank spell case
uint32 rankSpellId = talentInfo->RankID[i];
if(!rankSpellId || rankSpellId==spell_id)
continue;
- // skip unknown ranks
- if(!HasSpell(rankSpellId))
- continue;
-
removeSpell(rankSpellId);
}
}
@@ -2690,16 +2767,17 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
// non talent spell: learn low ranks (recursive call)
else if(uint32 prev_spell = spellmgr.GetPrevSpellInChain(spell_id))
{
- if(loading) // at spells loading, no output, but allow save
- addSpell(prev_spell,active,true,loading,SPELL_WITHOUT_SLOT_ID,disabled);
+ if(!IsInWorld() || disabled) // at spells loading, no output, but allow save
+ addSpell(prev_spell,active,true,true,disabled);
else // at normal learning
- learnSpell(prev_spell);
+ learnSpell(prev_spell,true);
}
PlayerSpell *newspell = new PlayerSpell;
- newspell->active = active;
- newspell->state = state;
- newspell->disabled = disabled;
+ newspell->state = state;
+ newspell->active = active;
+ newspell->dependent = dependent;
+ newspell->disabled = disabled;
// replace spells in action bars and spellbook to bigger rank if only one spell rank must be accessible
if(newspell->active && !newspell->disabled && !SpellMgr::canStackSpellRanks(spellInfo) && spellmgr.GetSpellRank(spellInfo->Id) != 0)
@@ -2716,7 +2794,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
{
if(spellmgr.IsHighRankOfSpell(spell_id,itr->first))
{
- if(!loading) // not send spell (re-/over-)learn packets at loading
+ if(IsInWorld()) // not send spell (re-/over-)learn packets at loading
{
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
data << uint16(itr->first);
@@ -2726,12 +2804,13 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
// mark old spell as disable (SMSG_SUPERCEDED_SPELL replace it in client by new)
itr->second->active = false;
- itr->second->state = PLAYERSPELL_CHANGED;
+ if(itr->second->state != PLAYERSPELL_NEW)
+ itr->second->state = PLAYERSPELL_CHANGED;
superceded_old = true; // new spell replace old in action bars and spell book.
}
else if(spellmgr.IsHighRankOfSpell(itr->first,spell_id))
{
- if(!loading) // not send spell (re-/over-)learn packets at loading
+ if(IsInWorld()) // not send spell (re-/over-)learn packets at loading
{
WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
data << uint16(spell_id);
@@ -2749,23 +2828,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
}
}
- uint16 tmpslot=slot_id;
-
- if (tmpslot == SPELL_WITHOUT_SLOT_ID)
- {
- uint16 maxid = 0;
- PlayerSpellMap::iterator itr;
- for (itr = m_spells.begin(); itr != m_spells.end(); ++itr)
- {
- if(itr->second->state == PLAYERSPELL_REMOVED)
- continue;
- if (itr->second->slotId > maxid)
- maxid = itr->second->slotId;
- }
- tmpslot = maxid + 1;
- }
-
- newspell->slotId = tmpslot;
m_spells[spell_id] = newspell;
// return false if spell disabled
@@ -2785,23 +2847,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
// also cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks
else if (IsPassiveSpell(spell_id))
{
- // if spell doesn't require a stance or the player is in the required stance
- if( ( !spellInfo->Stances &&
- spell_id != 5420 && spell_id != 5419 && spell_id != 7376 &&
- spell_id != 7381 && spell_id != 21156 && spell_id != 21009 &&
- spell_id != 21178 && spell_id != 33948 && spell_id != 40121 ) ||
- m_form != 0 && (spellInfo->Stances & (1<<(m_form-1))) ||
- (spell_id == 5420 && m_form == FORM_TREE) ||
- (spell_id == 5419 && m_form == FORM_TRAVEL) ||
- (spell_id == 7376 && m_form == FORM_DEFENSIVESTANCE) ||
- (spell_id == 7381 && m_form == FORM_BERSERKERSTANCE) ||
- (spell_id == 21156 && m_form == FORM_BATTLESTANCE)||
- (spell_id == 21178 && (m_form == FORM_BEAR || m_form == FORM_DIREBEAR) ) ||
- (spell_id == 33948 && m_form == FORM_FLIGHT) ||
- (spell_id == 40121 && m_form == FORM_FLIGHT_EPIC) )
- //Check CasterAuraStates
- if (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)))
- CastSpell(this, spell_id, true);
+ if(IsNeedCastPassiveSpellAtLearn(spellInfo))
+ CastSpell(this, spell_id, true);
}
else if( IsSpellHaveEffect(spellInfo,SPELL_EFFECT_SKILL_STEP) )
{
@@ -2855,10 +2902,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
continue;
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
- // poison special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- pSkill->id==SKILL_POISONS && _spell_idx->second->max_value==0 ||
- // lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- pSkill->id==SKILL_LOCKPICKING && _spell_idx->second->max_value==0 )
+ // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
+ (pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
{
switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0))
{
@@ -2886,37 +2931,71 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
{
if(!itr->second.autoLearned)
{
- if(loading) // at spells loading, no output, but allow save
- addSpell(itr->second.spell,true,true,loading);
+ if(!IsInWorld() || !itr->second.active) // at spells loading, no output, but allow save
+ addSpell(itr->second.spell,itr->second.active,true,true,false);
else // at normal learning
- learnSpell(itr->second.spell);
+ learnSpell(itr->second.spell,true);
}
}
+ if(IsInWorld())
+ {
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL,spell_id);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,spell_id);
+ }
+
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell
return active && !disabled && !superceded_old;
}
-void Player::learnSpell(uint32 spell_id)
+bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
+{
+ bool need_cast = false;
+
+ switch(spellInfo->Id)
+ {
+ // some spells not have stance data expacted cast at form change or present
+ case 5420: need_cast = (m_form == FORM_TREE); break;
+ case 5419: need_cast = (m_form == FORM_TRAVEL); break;
+ case 7376: need_cast = (m_form == FORM_DEFENSIVESTANCE); break;
+ case 7381: need_cast = (m_form == FORM_BERSERKERSTANCE); break;
+ case 21156: need_cast = (m_form == FORM_BATTLESTANCE); break;
+ case 21178: need_cast = (m_form == FORM_BEAR || m_form == FORM_DIREBEAR); break;
+ case 33948: need_cast = (m_form == FORM_FLIGHT); break;
+ case 34764: need_cast = (m_form == FORM_FLIGHT); break;
+ case 40121: need_cast = (m_form == FORM_FLIGHT_EPIC); break;
+ case 40122: need_cast = (m_form == FORM_FLIGHT_EPIC); break;
+ // another spells have proper stance data
+ default: need_cast = !spellInfo->Stances || m_form != 0 && (spellInfo->Stances & (1<<(m_form-1))); break;
+ }
+
+ //Check CasterAuraStates
+ return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)));
+}
+
+void Player::learnSpell(uint32 spell_id, bool dependent)
{
PlayerSpellMap::iterator itr = m_spells.find(spell_id);
bool disabled = (itr != m_spells.end()) ? itr->second->disabled : false;
bool active = disabled ? itr->second->active : true;
- bool learning = addSpell(spell_id,active);
+ bool learning = addSpell(spell_id,active,true,dependent,false);
// learn all disabled higher ranks (recursive)
- SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
- if (node)
+ if(disabled)
{
- PlayerSpellMap::iterator iter = m_spells.find(node->next);
- if (disabled && iter != m_spells.end() && iter->second->disabled )
- learnSpell(node->next);
+ SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
+ if(node)
+ {
+ PlayerSpellMap::iterator iter = m_spells.find(node->next);
+ if (iter != m_spells.end() && iter->second->disabled )
+ learnSpell(node->next,false);
+ }
}
- // prevent duplicated entires in spell book
- if(!learning)
+ // prevent duplicated entires in spell book, also not send if not in world (loading)
+ if(!learning || !IsInWorld ())
return;
WorldPacket data(SMSG_LEARNED_SPELL, 4);
@@ -2924,7 +3003,7 @@ void Player::learnSpell(uint32 spell_id)
GetSession()->SendPacket(&data);
}
-void Player::removeSpell(uint32 spell_id, bool disabled)
+void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_for_low_rank)
{
PlayerSpellMap::iterator itr = m_spells.find(spell_id);
if (itr == m_spells.end())
@@ -2946,10 +3025,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled)
for (uint32 i=reqMap.count(spell_id);i>0;i--,itr2++)
removeSpell(itr2->second,disabled);
- // removing
- WorldPacket data(SMSG_REMOVED_SPELL, 4);
- data << uint16(spell_id);
- GetSession()->SendPacket(&data);
+ bool cur_active = itr->second->active;
+ bool cur_dependent = itr->second->dependent;
if (disabled)
{
@@ -3042,10 +3119,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled)
continue;
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
- // poison special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- pSkill->id==SKILL_POISONS && _spell_idx->second->max_value==0 ||
- // lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
- pSkill->id==SKILL_LOCKPICKING && _spell_idx->second->max_value==0 )
+ // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
+ (pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
{
// not reset skills for professions and racial abilities
if( (pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
@@ -3063,6 +3138,60 @@ void Player::removeSpell(uint32 spell_id, bool disabled)
for(SpellLearnSpellMap::const_iterator itr2 = spell_begin; itr2 != spell_end; ++itr2)
removeSpell(itr2->second.spell, disabled);
+
+ // activate lesser rank in spellbook/action bar, and cast it if need
+ bool prev_activate = false;
+
+ if(uint32 prev_id = spellmgr.GetPrevSpellInChain (spell_id))
+ {
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
+
+ // if talent then lesser rank also talent and need learn
+ if(talentCosts)
+ {
+ //learnSpell (prev_id,false);
+ }
+ // if ranked non-stackable spell: need activate lesser rank and update dendence state
+ else if(cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && spellmgr.GetSpellRank(spellInfo->Id) != 0)
+ {
+ // need manually update dependence state (learn spell ignore like attempts)
+ PlayerSpellMap::iterator prev_itr = m_spells.find(prev_id);
+ if (prev_itr != m_spells.end())
+ {
+ if(prev_itr->second->dependent != cur_dependent)
+ {
+ prev_itr->second->dependent = cur_dependent;
+ if(prev_itr->second->state != PLAYERSPELL_NEW)
+ prev_itr->second->state = PLAYERSPELL_CHANGED;
+ }
+
+ // now re-learn if need re-activate
+ if(cur_active && !prev_itr->second->active)
+ {
+ if(addSpell(prev_id,true,false,prev_itr->second->dependent,prev_itr->second->disabled))
+ {
+ if(update_action_bar_for_low_rank)
+ {
+ // downgrade spell ranks in spellbook and action bar
+ WorldPacket data(SMSG_SUPERCEDED_SPELL, (4));
+ data << uint16(spell_id);
+ data << uint16(prev_id);
+ GetSession()->SendPacket( &data );
+ prev_activate = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // remove from spell book if not replaced by lesser rank
+ if(!prev_activate)
+ {
+ WorldPacket data(SMSG_REMOVED_SPELL, 4);
+ data << uint16(spell_id);
+ GetSession()->SendPacket(&data);
+ }
}
void Player::RemoveArenaSpellCooldowns()
@@ -3077,13 +3206,13 @@ void Player::RemoveArenaSpellCooldowns()
SpellEntry const * entry = sSpellStore.LookupEntry(itr->first);
// check if spellentry is present and if the cooldown is less than 15 mins
if( entry &&
- entry->RecoveryTime <= 15 * MINUTE * 1000 &&
- entry->CategoryRecoveryTime <= 15 * MINUTE * 1000 )
+ entry->RecoveryTime <= 15 * MINUTE * IN_MILISECONDS &&
+ entry->CategoryRecoveryTime <= 15 * MINUTE * IN_MILISECONDS )
{
// notify player
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
data << uint32(itr->first);
- data << GetGUID();
+ data << uint64(GetGUID());
GetSession()->SendPacket(&data);
// remove cooldown
m_spellCooldowns.erase(itr);
@@ -3108,7 +3237,7 @@ void Player::RemoveAllSpellCooldown()
void Player::_LoadSpellCooldowns(QueryResult *result)
{
- m_spellCooldowns.clear();
+ // some cooldowns can be already set at aura loading...
//QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow());
@@ -3149,17 +3278,20 @@ void Player::_SaveSpellCooldowns()
CharacterDatabase.PExecute("DELETE FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow());
time_t curTime = time(NULL);
+ time_t infTime = curTime + MONTH/2;
// remove outdated and save active
for(SpellCooldowns::iterator itr = m_spellCooldowns.begin();itr != m_spellCooldowns.end();)
{
if(itr->second.end <= curTime)
m_spellCooldowns.erase(itr++);
- else
+ else if(itr->second.end <= infTime) // not save locked cooldowns, it will be reset or set at reload
{
CharacterDatabase.PExecute("INSERT INTO character_spell_cooldown (guid,spell,item,time) VALUES ('%u', '%u', '%u', '" I64FMTD "')", GetGUIDLow(), itr->first, itr->second.itemid, uint64(itr->second.end));
++itr;
}
+ else
+ ++itr;
}
}
@@ -3205,8 +3337,7 @@ bool Player::resetTalents(bool no_cost)
CharacterDatabase.PExecute("UPDATE characters set at_login = at_login & ~ %u WHERE guid ='%u'", uint32(AT_LOGIN_RESET_TALENTS), GetGUIDLow());
}
- uint32 level = getLevel();
- uint32 talentPointsForLevel = level < 10 ? 0 : uint32((level-9)*sWorld.getRate(RATE_TALENT));
+ uint32 talentPointsForLevel = CalculateTalentsPoints();
if (m_usedTalentCount == 0)
{
@@ -3244,7 +3375,7 @@ bool Player::resetTalents(bool no_cost)
if( (getClassMask() & talentTabInfo->ClassMask) == 0 )
continue;
- for (int j = 0; j < 5; j++)
+ for (int j = 0; j < MAX_TALENT_RANK; j++)
{
for(PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end();)
{
@@ -3275,6 +3406,7 @@ bool Player::resetTalents(bool no_cost)
if(!no_cost)
{
ModifyMoney(-(int32)cost);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost);
m_resetTalentsCost = cost;
m_resetTalentsTime = time(NULL);
@@ -3283,19 +3415,14 @@ bool Player::resetTalents(bool no_cost)
//FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras
RemovePet(NULL,PET_SAVE_NOT_IN_SLOT, true);
- return true;
-}
-
-bool Player::_removeSpell(uint16 spell_id)
-{
- PlayerSpellMap::iterator itr = m_spells.find(spell_id);
- if (itr != m_spells.end())
+ if(m_canTitanGrip)
{
- delete itr->second;
- m_spells.erase(itr);
- return true;
+ m_canTitanGrip = false;
+ if(sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET))
+ AutoUnequipOffhandIfNeed();
}
- return false;
+
+ return true;
}
Mail* Player::GetMail(uint32 id)
@@ -3343,50 +3470,46 @@ void Player::InitVisibleBits()
{
updateVisualBits.SetCount(PLAYER_END);
- // TODO: really implement OWNER_ONLY and GROUP_ONLY. Flags can be found in UpdateFields.h
-
updateVisualBits.SetBit(OBJECT_FIELD_GUID);
updateVisualBits.SetBit(OBJECT_FIELD_TYPE);
+ updateVisualBits.SetBit(OBJECT_FIELD_ENTRY);
updateVisualBits.SetBit(OBJECT_FIELD_SCALE_X);
-
- updateVisualBits.SetBit(UNIT_FIELD_CHARM);
- updateVisualBits.SetBit(UNIT_FIELD_CHARM+1);
-
- updateVisualBits.SetBit(UNIT_FIELD_SUMMON);
- updateVisualBits.SetBit(UNIT_FIELD_SUMMON+1);
-
- updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY);
- updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY+1);
-
- updateVisualBits.SetBit(UNIT_FIELD_TARGET);
- updateVisualBits.SetBit(UNIT_FIELD_TARGET+1);
-
- updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT);
- updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT+1);
-
+ updateVisualBits.SetBit(UNIT_FIELD_CHARM + 0);
+ updateVisualBits.SetBit(UNIT_FIELD_CHARM + 1);
+ updateVisualBits.SetBit(UNIT_FIELD_SUMMON + 0);
+ updateVisualBits.SetBit(UNIT_FIELD_SUMMON + 1);
+ updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY + 0);
+ updateVisualBits.SetBit(UNIT_FIELD_CHARMEDBY + 1);
+ updateVisualBits.SetBit(UNIT_FIELD_TARGET + 0);
+ updateVisualBits.SetBit(UNIT_FIELD_TARGET + 1);
+ updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT + 0);
+ updateVisualBits.SetBit(UNIT_FIELD_CHANNEL_OBJECT + 1);
+ updateVisualBits.SetBit(UNIT_FIELD_BYTES_0);
updateVisualBits.SetBit(UNIT_FIELD_HEALTH);
updateVisualBits.SetBit(UNIT_FIELD_POWER1);
updateVisualBits.SetBit(UNIT_FIELD_POWER2);
updateVisualBits.SetBit(UNIT_FIELD_POWER3);
updateVisualBits.SetBit(UNIT_FIELD_POWER4);
updateVisualBits.SetBit(UNIT_FIELD_POWER5);
-
+ updateVisualBits.SetBit(UNIT_FIELD_POWER6);
+ updateVisualBits.SetBit(UNIT_FIELD_POWER7);
updateVisualBits.SetBit(UNIT_FIELD_MAXHEALTH);
updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER1);
updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER2);
updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER3);
updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER4);
updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER5);
-
+ updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER6);
+ updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER7);
updateVisualBits.SetBit(UNIT_FIELD_LEVEL);
updateVisualBits.SetBit(UNIT_FIELD_FACTIONTEMPLATE);
- updateVisualBits.SetBit(UNIT_FIELD_BYTES_0);
+ updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 0);
+ updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 1);
+ updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 2);
updateVisualBits.SetBit(UNIT_FIELD_FLAGS);
updateVisualBits.SetBit(UNIT_FIELD_FLAGS_2);
- for(uint16 i = UNIT_FIELD_AURA; i < UNIT_FIELD_AURASTATE; ++i)
- updateVisualBits.SetBit(i);
updateVisualBits.SetBit(UNIT_FIELD_AURASTATE);
- updateVisualBits.SetBit(UNIT_FIELD_BASEATTACKTIME);
+ updateVisualBits.SetBit(UNIT_FIELD_BASEATTACKTIME + 0);
updateVisualBits.SetBit(UNIT_FIELD_BASEATTACKTIME + 1);
updateVisualBits.SetBit(UNIT_FIELD_BOUNDINGRADIUS);
updateVisualBits.SetBit(UNIT_FIELD_COMBATREACH);
@@ -3399,10 +3522,12 @@ void Player::InitVisibleBits()
updateVisualBits.SetBit(UNIT_DYNAMIC_FLAGS);
updateVisualBits.SetBit(UNIT_CHANNEL_SPELL);
updateVisualBits.SetBit(UNIT_MOD_CAST_SPEED);
+ updateVisualBits.SetBit(UNIT_FIELD_BASE_MANA);
updateVisualBits.SetBit(UNIT_FIELD_BYTES_2);
+ updateVisualBits.SetBit(UNIT_FIELD_HOVERHEIGHT);
- updateVisualBits.SetBit(PLAYER_DUEL_ARBITER);
- updateVisualBits.SetBit(PLAYER_DUEL_ARBITER+1);
+ updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 0);
+ updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 1);
updateVisualBits.SetBit(PLAYER_FLAGS);
updateVisualBits.SetBit(PLAYER_GUILDID);
updateVisualBits.SetBit(PLAYER_GUILDRANK);
@@ -3413,29 +3538,29 @@ void Player::InitVisibleBits()
updateVisualBits.SetBit(PLAYER_GUILD_TIMESTAMP);
// PLAYER_QUEST_LOG_x also visible bit on official (but only on party/raid)...
- for(uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i+=4)
+ for(uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i += 4)
updateVisualBits.SetBit(i);
- //Players visible items are not inventory stuff
- //431) = 884 (0x374) = main weapon
- for(uint16 i = 0; i < EQUIPMENT_SLOT_END; i++)
+ // Players visible items are not inventory stuff
+ for(uint16 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
- // item creator
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_CREATOR + (i*MAX_VISIBLE_ITEM_OFFSET) + 0);
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_CREATOR + (i*MAX_VISIBLE_ITEM_OFFSET) + 1);
+ uint32 offset = i * MAX_VISIBLE_ITEM_OFFSET;
- uint16 visual_base = PLAYER_VISIBLE_ITEM_1_0 + (i*MAX_VISIBLE_ITEM_OFFSET);
+ // item creator
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_CREATOR + 0 + offset);
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_CREATOR + 1 + offset);
// item entry
- updateVisualBits.SetBit(visual_base + 0);
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_0 + 0 + offset);
- // item enchantment IDs
- for(uint8 j = 0; j < MAX_INSPECTED_ENCHANTMENT_SLOT; ++j)
- updateVisualBits.SetBit(visual_base + 1 + j);
+ // item enchantments
+ for(uint8 j = 0; j < MAX_ENCHANTMENT_SLOT; ++j)
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_0 + 1 + j + offset);
// random properties
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_PROPERTIES + 0 + (i*MAX_VISIBLE_ITEM_OFFSET));
- updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_PROPERTIES + 1 + (i*MAX_VISIBLE_ITEM_OFFSET));
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_PROPERTIES + offset);
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_SEED + offset);
+ updateVisualBits.SetBit(PLAYER_VISIBLE_ITEM_1_PAD + offset);
}
updateVisualBits.SetBit(PLAYER_CHOSEN_TITLE);
@@ -3453,7 +3578,6 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target )
if(target == this)
{
-
for(int i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
{
if(m_items[i] == NULL)
@@ -3461,7 +3585,7 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target )
m_items[i]->BuildCreateUpdateBlockForPlayer( data, target );
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
if(m_items[i] == NULL)
continue;
@@ -3494,7 +3618,7 @@ void Player::DestroyForPlayer( Player *target ) const
m_items[i]->DestroyForPlayer( target );
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
if(m_items[i] == NULL)
continue;
@@ -3506,8 +3630,16 @@ void Player::DestroyForPlayer( Player *target ) const
bool Player::HasSpell(uint32 spell) const
{
- PlayerSpellMap::const_iterator itr = m_spells.find((uint16)spell);
- return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED && !itr->second->disabled);
+ PlayerSpellMap::const_iterator itr = m_spells.find(spell);
+ return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED &&
+ !itr->second->disabled);
+}
+
+bool Player::HasActiveSpell(uint32 spell) const
+{
+ PlayerSpellMap::const_iterator itr = m_spells.find(spell);
+ return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED &&
+ itr->second->active && !itr->second->disabled);
}
TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell) const
@@ -3515,22 +3647,22 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
if (!trainer_spell)
return TRAINER_SPELL_RED;
- if (!trainer_spell->spell)
+ if (!trainer_spell->learnedSpell)
return TRAINER_SPELL_RED;
// known spell
- if(HasSpell(trainer_spell->spell))
+ if(HasSpell(trainer_spell->learnedSpell))
return TRAINER_SPELL_GRAY;
// check race/class requirement
- if(!IsSpellFitByClassAndRace(trainer_spell->spell))
+ if(!IsSpellFitByClassAndRace(trainer_spell->learnedSpell))
return TRAINER_SPELL_RED;
// check level requirement
- if(getLevel() < trainer_spell->reqlevel)
+ if(getLevel() < trainer_spell->reqLevel)
return TRAINER_SPELL_RED;
- if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->spell))
+ if(SpellChainNode const* spell_chain = spellmgr.GetSpellChainNode(trainer_spell->learnedSpell))
{
// check prev.rank requirement
if(spell_chain->prev && !HasSpell(spell_chain->prev))
@@ -3545,11 +3677,11 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
}
// check skill requirement
- if(trainer_spell->reqskill && GetBaseSkillValue(trainer_spell->reqskill) < trainer_spell->reqskillvalue)
+ if(trainer_spell->reqSkill && GetBaseSkillValue(trainer_spell->reqSkill) < trainer_spell->reqSkillValue)
return TRAINER_SPELL_RED;
// exist, already checked at loading
- SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->spell);
+ SpellEntry const* spell = sSpellStore.LookupEntry(trainer_spell->learnedSpell);
// secondary prof. or not prof. spell
uint32 skill = spell->EffectMiscValue[1];
@@ -3582,27 +3714,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
}
// remove from arena teams
- uint32 at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_2v2);
- if(at_id != 0)
- {
- ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
- if(at)
- at->DelMember(playerguid);
- }
- at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_3v3);
- if(at_id != 0)
- {
- ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
- if(at)
- at->DelMember(playerguid);
- }
- at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_5v5);
- if(at_id != 0)
- {
- ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
- if(at)
- at->DelMember(playerguid);
- }
+ LeaveAllArenaTeams(playerguid);
// the player was uninvited already on logout so just remove from group
QueryResult *resultGroup = CharacterDatabase.PQuery("SELECT leaderGuid FROM group_member WHERE memberGuid='%u'", guid);
@@ -3643,15 +3755,16 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
MailItemsInfo mi;
if(has_items)
{
- QueryResult *resultItems = CharacterDatabase.PQuery("SELECT item_guid,item_template FROM mail_items WHERE mail_id='%u'", mail_id);
+ // data needs to be at first place for Item::LoadFromDB
+ QueryResult *resultItems = CharacterDatabase.PQuery("SELECT data,item_guid,item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail_id);
if(resultItems)
{
do
{
Field *fields2 = resultItems->Fetch();
- uint32 item_guidlow = fields2[0].GetUInt32();
- uint32 item_template = fields2[1].GetUInt32();
+ uint32 item_guidlow = fields2[1].GetUInt32();
+ uint32 item_template = fields2[2].GetUInt32();
ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_template);
if(!itemProto)
@@ -3661,7 +3774,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
}
Item *pItem = NewItemOrBag(itemProto);
- if(!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)))
+ if(!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER),resultItems))
{
pItem->FSetState(ITEM_REMOVED);
pItem->SaveToDB(); // it also deletes item object !
@@ -3724,6 +3837,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE receiver = '%u'",guid);
CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid);
CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid);
+ CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE guid = '%u'",guid);
+ CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE guid = '%u'",guid);
CharacterDatabase.CommitTransaction();
//LoginDatabase.PExecute("UPDATE realmcharacters SET numchars = numchars - 1 WHERE acctid = %d AND realmid = %d", accountId, realmID);
@@ -3754,6 +3869,10 @@ void Player::SetMovement(PlayerMovementType pType)
*/
void Player::BuildPlayerRepop()
{
+ WorldPacket data(SMSG_PRE_RESURRECT, GetPackGUID().size());
+ data.append(GetPackGUID());
+ GetSession()->SendPacket(&data);
+
if(getRace() == RACE_NIGHTELF)
CastSpell(this, 20584, true); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
CastSpell(this, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
@@ -3798,7 +3917,8 @@ void Player::BuildPlayerRepop()
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (float)1.0); //see radius of death player?
- SetByteValue(UNIT_FIELD_BYTES_1, 3, PLAYER_STATE_FLAG_ALWAYS_STAND);
+ // set and clear other
+ SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND);
}
void Player::SendDelayResponse(const uint32 ml_seconds)
@@ -3843,13 +3963,15 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent));
}
+ // trigger update zone for alive state zone updates
+ uint32 newzone, newarea;
+ GetZoneAndAreaId(newzone,newarea);
+ UpdateZone(newzone,newarea);
+
// update visibility
//ObjectAccessor::UpdateVisibilityForPlayer(this);
SetToNotify();
- // some items limited to specific map
- DestroyZoneLimitedItem( true, GetZoneId());
-
if(!applySickness)
return;
@@ -3869,13 +3991,9 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
{
int32 delta = (int32(getLevel()) - startLevel + 1)*MINUTE;
- for(int i =0; i < 3; ++i)
+ if(Aura* Aur = GetAura(SPELL_ID_PASSIVE_RESURRECTION_SICKNESS, GetGUID()))
{
- if(Aura* Aur = GetAura(SPELL_ID_PASSIVE_RESURRECTION_SICKNESS,i))
- {
- Aur->SetAuraDuration(delta*1000);
- Aur->UpdateAuraDuration();
- }
+ Aur->SetAuraDuration(delta*IN_MILISECONDS);
}
}
}
@@ -3894,7 +4012,7 @@ void Player::KillPlayer()
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable());
// 6 minutes until repop at graveyard
- m_deathTimer = 6*MINUTE*1000;
+ m_deathTimer = 6*MINUTE*IN_MILISECONDS;
UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill
SendCorpseReclaimDelay();
@@ -3915,8 +4033,7 @@ void Player::CreateCorpse()
Corpse *corpse = new Corpse( (m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE );
SetPvPDeath(false);
- if(!corpse->Create(objmgr.GenerateLowGuid(HIGHGUID_CORPSE), this, GetMapId(), GetPositionX(),
- GetPositionY(), GetPositionZ(), GetOrientation()))
+ if(!corpse->Create(objmgr.GenerateLowGuid(HIGHGUID_CORPSE), this))
{
delete corpse;
return;
@@ -3944,7 +4061,7 @@ void Player::CreateCorpse()
flags |= CORPSE_FLAG_HIDE_HELM;
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
flags |= CORPSE_FLAG_HIDE_CLOAK;
- if(InBattleGround())
+ if(InBattleGround() && !InArena())
flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia
corpse->SetUInt32Value( CORPSE_FIELD_FLAGS, flags );
@@ -4131,7 +4248,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityCostsEntry const *dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel);
if(!dcost)
{
- sLog.outError("ERROR: RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
+ sLog.outError("RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
return TotalCost;
}
@@ -4139,7 +4256,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityQualityEntry const *dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId);
if(!dQualitymodEntry)
{
- sLog.outError("ERROR: RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
+ sLog.outError("RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
return TotalCost;
}
@@ -4220,10 +4337,8 @@ void Player::RepopAtGraveyard()
WorldSafeLocsEntry const *ClosestGrave = NULL;
// Special handle for battleground maps
- BattleGround *bg = sBattleGroundMgr.GetBattleGround(GetBattleGroundId());
-
- if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY || bg->GetTypeID() == BATTLEGROUND_AV))
- ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
+ if( BattleGround *bg = GetBattleGround() )
+ ClosestGrave = bg->GetClosestGraveYard(this);
else
ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() );
@@ -4384,7 +4499,7 @@ float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const
{
if(modGroup >= BASEMOD_END || modType > MOD_END)
{
- sLog.outError("ERROR: trial to access non existed BaseModGroup or wrong BaseModType!");
+ sLog.outError("trial to access non existed BaseModGroup or wrong BaseModType!");
return 0.0f;
}
@@ -4398,7 +4513,7 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
{
if(modGroup >= BASEMOD_END)
{
- sLog.outError("ERROR: wrong BaseModGroup in GetTotalBaseModValue()!");
+ sLog.outError("wrong BaseModGroup in GetTotalBaseModValue()!");
return 0.0f;
}
@@ -4410,9 +4525,7 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
uint32 Player::GetShieldBlockValue() const
{
- BaseModGroup modGroup = SHIELD_BLOCK_VALUE;
-
- float value = GetTotalBaseModValue(modGroup) + GetStat(STAT_STRENGTH)/20 - 1;
+ float value = (m_auraBaseMod[SHIELD_BLOCK_VALUE][FLAT_MOD] + GetStat(STAT_STRENGTH) * 0.5f - 10)*m_auraBaseMod[SHIELD_BLOCK_VALUE][PCT_MOD];
value = (value < 0) ? 0 : value;
@@ -4516,24 +4629,24 @@ float Player::GetRatingBonusValue(CombatRating cr) const
uint32 Player::GetMeleeCritDamageReduction(uint32 damage) const
{
- float melee = GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*2.0f;
- if (melee>25.0f) melee = 25.0f;
+ float melee = GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*2.2f;
+ if (melee>33.0f) melee = 33.0f;
return uint32 (melee * damage /100.0f);
}
uint32 Player::GetRangedCritDamageReduction(uint32 damage) const
{
- float ranged = GetRatingBonusValue(CR_CRIT_TAKEN_RANGED)*2.0f;
- if (ranged>25.0f) ranged=25.0f;
+ float ranged = GetRatingBonusValue(CR_CRIT_TAKEN_RANGED)*2.2f;
+ if (ranged>33.0f) ranged=33.0f;
return uint32 (ranged * damage /100.0f);
}
uint32 Player::GetSpellCritDamageReduction(uint32 damage) const
{
- float spell = GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2.0f;
- // In wow script resilience limited to 25%
- if (spell>25.0f)
- spell = 25.0f;
+ float spell = GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2.2f;
+ // In wow script resilience limited to 33%
+ if (spell>33.0f)
+ spell = 33.0f;
return uint32 (spell * damage / 100.0f);
}
@@ -4601,7 +4714,18 @@ float Player::OCTRegenMPPerSpirit()
void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
{
- ApplyModUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, value, apply);
+ m_baseRatingValue[cr]+=(apply ? value : -value);
+
+ int32 amount = uint32(m_baseRatingValue[cr]);
+ // Apply bonus from SPELL_AURA_MOD_RATING_FROM_STAT
+ // stat used stored in miscValueB for this aura
+ AuraEffectList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
+ for(AuraEffectList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
+ if ((*i)->GetMiscValue() & (1<<cr))
+ amount += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetAmount() / 100.0f);
+ if (amount < 0)
+ amount = 0;
+ SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, uint32(amount));
float RatingCoeffecient = GetRatingCoefficient(cr);
float RatingChange = 0.0f;
@@ -4624,16 +4748,13 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
UpdateBlockPercentage();
break;
case CR_HIT_MELEE:
- RatingChange = value / RatingCoeffecient;
- m_modMeleeHitChance += apply ? RatingChange : -RatingChange;
+ UpdateMeleeHitChances();
break;
case CR_HIT_RANGED:
- RatingChange = value / RatingCoeffecient;
- m_modRangedHitChance += apply ? RatingChange : -RatingChange;
+ UpdateRangedHitChances();
break;
case CR_HIT_SPELL:
- RatingChange = value / RatingCoeffecient;
- m_modSpellHitChance += apply ? RatingChange : -RatingChange;
+ UpdateSpellHitChances();
break;
case CR_CRIT_MELEE:
if(affectStats)
@@ -4731,6 +4852,7 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
new_value = max;
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(new_value,max));
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,skill_id);
return true;
}
@@ -4766,7 +4888,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
if(spellEntry && spellEntry->Mechanic==MECHANIC_DISCOVERY)
{
if(uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this))
- learnSpell(discoveredSpell);
+ learnSpell(discoveredSpell,false);
}
uint32 craft_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_CRAFTING);
@@ -4793,6 +4915,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
case SKILL_HERBALISM:
case SKILL_LOCKPICKING:
case SKILL_JEWELCRAFTING:
+ case SKILL_INSCRIPTION:
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
case SKILL_SKINNING:
if( sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)==0)
@@ -4821,6 +4944,11 @@ bool Player::UpdateFishingSkill()
return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain);
}
+// levels sync. with spell requirement for skill levels to learn
+// bonus abilities in sSkillLineAbilityStore
+// Used only to avoid scan DBC at each skill grow
+static uint32 bonusSkillLevels[] = {75,150,225,300,375,450};
+
bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
{
sLog.outDebug("UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0);
@@ -4855,6 +4983,15 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
new_value = MaxValue;
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(new_value,MaxValue));
+ for(uint32* bsl = &bonusSkillLevels[0]; *bsl; ++bsl)
+ {
+ if((SkillValue < *bsl && new_value >= *bsl))
+ {
+ learnSkillRewardedSpells( SkillId, new_value);
+ break;
+ }
+ }
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,SkillId);
sLog.outDebug("Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0);
return true;
}
@@ -4902,22 +5039,8 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
UpdateAllCritPercentages();
}
-void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence)
+void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence)
{
-/* Not need, this checked on call this func from trigger system
- switch(outcome)
- {
- case MELEE_HIT_CRIT:
- case MELEE_HIT_DODGE:
- case MELEE_HIT_PARRY:
- case MELEE_HIT_BLOCK:
- case MELEE_HIT_BLOCK_CRIT:
- return;
-
- default:
- break;
- }
-*/
uint32 plevel = getLevel(); // if defense than pVictim == attacker
uint32 greylevel = Trinity::XP::GetGrayLevel(plevel);
uint32 moblevel = pVictim->getLevelForTarget(this);
@@ -5014,7 +5137,7 @@ void Player::UpdateSkillsToMaxSkillsForLevel()
if (GetUInt32Value(PLAYER_SKILL_INDEX(i)))
{
uint32 pskill = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
- if( IsProfessionSkill(pskill) || pskill == SKILL_RIDING )
+ if( IsProfessionOrRidingSkill(pskill))
continue;
uint32 data = GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i));
@@ -5042,7 +5165,12 @@ void Player::SetSkill(uint32 id, uint16 currVal, uint16 maxVal)
if(i<PLAYER_MAX_SKILLS) //has skill
{
if(currVal)
+ {
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(currVal,maxVal));
+ learnSkillRewardedSpells(id, currVal);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,id);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL,id);
+ }
else //remove
{
// clear skill fields
@@ -5050,27 +5178,11 @@ void Player::SetSkill(uint32 id, uint16 currVal, uint16 maxVal)
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),0);
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
- // remove spells that depend on this skill when removing the skill
- for (PlayerSpellMap::const_iterator itr = m_spells.begin(), next = m_spells.begin(); itr != m_spells.end(); itr = next)
- {
- ++next;
- if(itr->second->state == PLAYERSPELL_REMOVED)
- continue;
-
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(itr->first);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(itr->first);
-
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- if (_spell_idx->second->skillId == id)
- {
- // this may remove more than one spell (dependents)
- removeSpell(itr->first);
- next = m_spells.begin();
- break;
- }
- }
- }
+ // remove all spells that related to this skill
+ for (uint32 j=0; j<sSkillLineAbilityStore.GetNumRows(); ++j)
+ if(SkillLineAbilityEntry const *pAbility = sSkillLineAbilityStore.LookupEntry(j))
+ if (pAbility->skillId==id)
+ removeSpell(spellmgr.GetFirstSpellInChain(pAbility->spellId));
}
}
else if(currVal) //add
@@ -5090,24 +5202,26 @@ void Player::SetSkill(uint32 id, uint16 currVal, uint16 maxVal)
else
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(currVal,maxVal));
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,id);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL,id);
// apply skill bonuses
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
// temporary bonuses
- AuraList const& mModSkill = GetAurasByType(SPELL_AURA_MOD_SKILL);
- for(AuraList::const_iterator i = mModSkill.begin(); i != mModSkill.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue == int32(id))
+ AuraEffectList const& mModSkill = GetAurasByType(SPELL_AURA_MOD_SKILL);
+ for(AuraEffectList::const_iterator i = mModSkill.begin(); i != mModSkill.end(); ++i)
+ if ((*i)->GetMiscValue() == int32(id))
(*i)->ApplyModifier(true);
// permanent bonuses
- AuraList const& mModSkillTalent = GetAurasByType(SPELL_AURA_MOD_SKILL_TALENT);
- for(AuraList::const_iterator i = mModSkillTalent.begin(); i != mModSkillTalent.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue == int32(id))
+ AuraEffectList const& mModSkillTalent = GetAurasByType(SPELL_AURA_MOD_SKILL_TALENT);
+ for(AuraEffectList::const_iterator i = mModSkillTalent.begin(); i != mModSkillTalent.end(); ++i)
+ if ((*i)->GetMiscValue() == int32(id))
(*i)->ApplyModifier(true);
// Learn all spells for skill
- learnSkillRewardedSpells(id);
+ learnSkillRewardedSpells(id, currVal);
return;
}
}
@@ -5205,6 +5319,22 @@ uint16 Player::GetPureSkillValue(uint32 skill) const
return 0;
}
+int16 Player::GetSkillPermBonusValue(uint32 skill) const
+{
+ if(!skill)
+ return 0;
+
+ for (int i = 0; i < PLAYER_MAX_SKILLS; i++)
+ {
+ if ((GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF) == skill)
+ {
+ return SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i)));
+ }
+ }
+
+ return 0;
+}
+
int16 Player::GetSkillTempBonusValue(uint32 skill) const
{
if(!skill)
@@ -5245,12 +5375,12 @@ void Player::SendInitialActionButtons()
sLog.outDetail( "Action Buttons for '%u' Initialized", GetGUIDLow() );
}
-void Player::addActionButton(const uint8 button, const uint16 action, const uint8 type, const uint8 misc)
+bool Player::addActionButton(const uint8 button, const uint16 action, const uint8 type, const uint8 misc)
{
if(button >= MAX_ACTION_BUTTONS)
{
sLog.outError( "Action %u not added into button %u for player %s: button must be < 132", action, button, GetName() );
- return;
+ return false;
}
// check cheating with adding non-known spells to action bar
@@ -5259,13 +5389,13 @@ void Player::addActionButton(const uint8 button, const uint16 action, const uint
if(!sSpellStore.LookupEntry(action))
{
sLog.outError( "Action %u not added into button %u for player %s: spell not exist", action, button, GetName() );
- return;
+ return false;
}
if(!HasSpell(action))
{
sLog.outError( "Action %u not added into button %u for player %s: player don't known this spell", action, button, GetName() );
- return;
+ return false;
}
}
@@ -5283,6 +5413,7 @@ void Player::addActionButton(const uint8 button, const uint16 action, const uint
};
sLog.outDetail( "Player '%u' Added Action '%u' to Button '%u'", GetGUIDLow(), action, button );
+ return true;
}
void Player::removeActionButton(uint8 button)
@@ -5299,11 +5430,6 @@ void Player::removeActionButton(uint8 button)
sLog.outDetail( "Action Button '%u' Removed from Player '%u'", button, GetGUIDLow() );
}
-void Player::SetDontMove(bool dontMove)
-{
- m_dontMove = dontMove;
-}
-
bool Player::SetPosition(float x, float y, float z, float orientation, bool teleport)
{
// prevent crash when a bad coord is sent by the client
@@ -5360,17 +5486,17 @@ void Player::SaveRecallPosition()
void Player::SendMessageToSet(WorldPacket *data, bool self, bool to_possessor)
{
- MapManager::Instance().GetMap(GetMapId(), this)->MessageBroadcast(this, data, self, to_possessor);
+ GetMap()->MessageBroadcast(this, data, self, to_possessor);
}
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor)
{
- MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self, to_possessor);
+ GetMap()->MessageDistBroadcast(this, data, dist, self, to_possessor);
}
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool to_possessor, bool own_team_only)
{
- MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self, to_possessor, own_team_only);
+ GetMap()->MessageDistBroadcast(this, data, dist, self, to_possessor, own_team_only);
}
void Player::SendDirectMessage(WorldPacket *data)
@@ -5378,6 +5504,20 @@ void Player::SendDirectMessage(WorldPacket *data)
GetSession()->SendPacket(data);
}
+void Player::SendCinematicStart(uint32 CinematicSequenceId)
+{
+ WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
+ data << uint32(CinematicSequenceId);
+ SendDirectMessage(&data);
+}
+
+void Player::SendMovieStart(uint32 MovieId)
+{
+ WorldPacket data(SMSG_TRIGGER_MOVIE, 4);
+ data << uint32(MovieId);
+ SendDirectMessage(&data);
+}
+
void Player::CheckExploreSystem()
{
if (!isAlive())
@@ -5386,14 +5526,14 @@ void Player::CheckExploreSystem()
if (isInFlight())
return;
- uint16 areaFlag=MapManager::Instance().GetBaseMap(GetMapId())->GetAreaFlag(GetPositionX(),GetPositionY());
+ uint16 areaFlag=MapManager::Instance().GetBaseMap(GetMapId())->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ());
if(areaFlag==0xffff)
return;
int offset = areaFlag / 32;
if(offset >= 128)
{
- sLog.outError("ERROR: Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < 64 ).",areaFlag,GetPositionX(),GetPositionY(),offset,offset);
+ sLog.outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < 128 ).",areaFlag,GetPositionX(),GetPositionY(),offset,offset);
return;
}
@@ -5404,6 +5544,8 @@ void Player::CheckExploreSystem()
{
SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val));
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA);
+
AreaTableEntry const *p = GetAreaEntryByAreaFlagAndMap(areaFlag,GetMapId());
if(!p)
{
@@ -5484,435 +5626,27 @@ void Player::setFactionForRace(uint8 race)
setFaction( getFactionForRace(race) );
}
-void Player::UpdateReputation() const
-{
- sLog.outDetail( "WORLD: Player::UpdateReputation" );
-
- for(FactionStateList::const_iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
- {
- SendFactionState(&(itr->second));
- }
-}
-
-void Player::SendFactionState(FactionState const* faction) const
-{
- if(faction->Flags & FACTION_FLAG_VISIBLE) //If faction is visible then update it
- {
- WorldPacket data(SMSG_SET_FACTION_STANDING, (16)); // last check 2.4.0
- data << (float) 0; // unk 2.4.0
- data << (uint32) 1; // count
- // for
- data << (uint32) faction->ReputationListID;
- data << (uint32) faction->Standing;
- // end for
- GetSession()->SendPacket(&data);
- }
-}
-
-void Player::SendInitialReputations()
-{
- WorldPacket data(SMSG_INITIALIZE_FACTIONS, (4+128*5));
- data << uint32 (0x00000080);
-
- RepListID a = 0;
-
- for (FactionStateList::const_iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
- {
- // fill in absent fields
- for (; a != itr->first; a++)
- {
- data << uint8 (0x00);
- data << uint32 (0x00000000);
- }
-
- // fill in encountered data
- data << uint8 (itr->second.Flags);
- data << uint32 (itr->second.Standing);
-
- ++a;
- }
-
- // fill in absent fields
- for (; a != 128; a++)
- {
- data << uint8 (0x00);
- data << uint32 (0x00000000);
- }
-
- GetSession()->SendPacket(&data);
-}
-
-FactionState const* Player::GetFactionState( FactionEntry const* factionEntry) const
-{
- FactionStateList::const_iterator itr = m_factions.find(factionEntry->reputationListID);
- if (itr != m_factions.end())
- return &itr->second;
-
- return NULL;
-}
-
-void Player::SetFactionAtWar(FactionState* faction, bool atWar)
-{
- // not allow declare war to own faction
- if(atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED) )
- return;
-
- // already set
- if(((faction->Flags & FACTION_FLAG_AT_WAR) != 0) == atWar)
- return;
-
- if( atWar )
- faction->Flags |= FACTION_FLAG_AT_WAR;
- else
- faction->Flags &= ~FACTION_FLAG_AT_WAR;
-
- faction->Changed = true;
-}
-
-void Player::SetFactionInactive(FactionState* faction, bool inactive)
-{
- // always invisible or hidden faction can't be inactive
- if(inactive && ((faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) || !(faction->Flags & FACTION_FLAG_VISIBLE) ) )
- return;
-
- // already set
- if(((faction->Flags & FACTION_FLAG_INACTIVE) != 0) == inactive)
- return;
-
- if(inactive)
- faction->Flags |= FACTION_FLAG_INACTIVE;
- else
- faction->Flags &= ~FACTION_FLAG_INACTIVE;
-
- faction->Changed = true;
-}
-
-void Player::SetFactionVisibleForFactionTemplateId(uint32 FactionTemplateId)
-{
- FactionTemplateEntry const*factionTemplateEntry = sFactionTemplateStore.LookupEntry(FactionTemplateId);
-
- if(!factionTemplateEntry)
- return;
-
- SetFactionVisibleForFactionId(factionTemplateEntry->faction);
-}
-
-void Player::SetFactionVisibleForFactionId(uint32 FactionId)
-{
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(FactionId);
- if(!factionEntry)
- return;
-
- if(factionEntry->reputationListID < 0)
- return;
-
- FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
- if (itr == m_factions.end())
- return;
-
- SetFactionVisible(&itr->second);
-}
-
-void Player::SetFactionVisible(FactionState* faction)
-{
- // always invisible or hidden faction can't be make visible
- if(faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN))
- return;
-
- // already set
- if(faction->Flags & FACTION_FLAG_VISIBLE)
- return;
-
- faction->Flags |= FACTION_FLAG_VISIBLE;
- faction->Changed = true;
-
- if(!m_session->PlayerLoading())
- {
- // make faction visible in reputation list at client
- WorldPacket data(SMSG_SET_FACTION_VISIBLE, 4);
- data << faction->ReputationListID;
- GetSession()->SendPacket(&data);
- }
-}
-
-void Player::SetInitialFactions()
-{
- for(unsigned int i = 1; i < sFactionStore.GetNumRows(); i++)
- {
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(i);
-
- if( factionEntry && (factionEntry->reputationListID >= 0))
- {
- FactionState newFaction;
- newFaction.ID = factionEntry->ID;
- newFaction.ReputationListID = factionEntry->reputationListID;
- newFaction.Standing = 0;
- newFaction.Flags = GetDefaultReputationFlags(factionEntry);
- newFaction.Changed = true;
-
- m_factions[newFaction.ReputationListID] = newFaction;
- }
- }
-}
-
-uint32 Player::GetDefaultReputationFlags(const FactionEntry *factionEntry) const
-{
- if (!factionEntry)
- return 0;
-
- uint32 raceMask = getRaceMask();
- uint32 classMask = getClassMask();
- for (int i=0; i < 4; i++)
- {
- if( (factionEntry->BaseRepRaceMask[i] & raceMask) &&
- (factionEntry->BaseRepClassMask[i]==0 ||
- (factionEntry->BaseRepClassMask[i] & classMask) ) )
- return factionEntry->ReputationFlags[i];
- }
- return 0;
-}
-
-int32 Player::GetBaseReputation(const FactionEntry *factionEntry) const
-{
- if (!factionEntry)
- return 0;
-
- uint32 raceMask = getRaceMask();
- uint32 classMask = getClassMask();
- for (int i=0; i < 4; i++)
- {
- if( (factionEntry->BaseRepRaceMask[i] & raceMask) &&
- (factionEntry->BaseRepClassMask[i]==0 ||
- (factionEntry->BaseRepClassMask[i] & classMask) ) )
- return factionEntry->BaseRepValue[i];
- }
-
- // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i]==0
- return 0;
-}
-
-int32 Player::GetReputation(uint32 faction_id) const
-{
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(faction_id);
-
- if (!factionEntry)
- {
- sLog.outError("Player::GetReputation: Can't get reputation of %s for unknown faction (faction template id) #%u.",GetName(), faction_id);
- return 0;
- }
-
- return GetReputation(factionEntry);
-}
-
-int32 Player::GetReputation(const FactionEntry *factionEntry) const
-{
- // Faction without recorded reputation. Just ignore.
- if(!factionEntry)
- return 0;
-
- FactionStateList::const_iterator itr = m_factions.find(factionEntry->reputationListID);
- if (itr != m_factions.end())
- return GetBaseReputation(factionEntry) + itr->second.Standing;
-
- return 0;
-}
-
ReputationRank Player::GetReputationRank(uint32 faction) const
{
- FactionEntry const*factionEntry = sFactionStore.LookupEntry(faction);
- if(!factionEntry)
- return MIN_REPUTATION_RANK;
-
- return GetReputationRank(factionEntry);
-}
-
-ReputationRank Player::ReputationToRank(int32 standing) const
-{
- int32 Limit = Reputation_Cap + 1;
- for (int i = MAX_REPUTATION_RANK-1; i >= MIN_REPUTATION_RANK; --i)
- {
- Limit -= ReputationRank_Length[i];
- if (standing >= Limit )
- return ReputationRank(i);
- }
- return MIN_REPUTATION_RANK;
-}
-
-ReputationRank Player::GetReputationRank(const FactionEntry *factionEntry) const
-{
- int32 Reputation = GetReputation(factionEntry);
- return ReputationToRank(Reputation);
-}
-
-ReputationRank Player::GetBaseReputationRank(const FactionEntry *factionEntry) const
-{
- int32 Reputation = GetBaseReputation(factionEntry);
- return ReputationToRank(Reputation);
-}
-
-bool Player::ModifyFactionReputation(uint32 FactionTemplateId, int32 DeltaReputation)
-{
- FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(FactionTemplateId);
-
- if(!factionTemplateEntry)
- {
- sLog.outError("Player::ModifyFactionReputation: Can't update reputation of %s for unknown faction (faction template id) #%u.", GetName(), FactionTemplateId);
- return false;
- }
-
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction);
-
- // Faction without recorded reputation. Just ignore.
- if(!factionEntry)
- return false;
-
- return ModifyFactionReputation(factionEntry, DeltaReputation);
-}
-
-bool Player::ModifyFactionReputation(FactionEntry const* factionEntry, int32 standing)
-{
- SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID);
- if (flist)
- {
- bool res = false;
- for (SimpleFactionsList::const_iterator itr = flist->begin();itr != flist->end();++itr)
- {
- FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr);
- if(factionEntryCalc)
- res = ModifyOneFactionReputation(factionEntryCalc, standing);
- }
- return res;
- }
- else
- return ModifyOneFactionReputation(factionEntry, standing);
-}
-
-bool Player::ModifyOneFactionReputation(FactionEntry const* factionEntry, int32 standing)
-{
- FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
- if (itr != m_factions.end())
- {
- int32 BaseRep = GetBaseReputation(factionEntry);
- int32 new_rep = BaseRep + itr->second.Standing + standing;
-
- if (new_rep > Reputation_Cap)
- new_rep = Reputation_Cap;
- else
- if (new_rep < Reputation_Bottom)
- new_rep = Reputation_Bottom;
-
- if(ReputationToRank(new_rep) <= REP_HOSTILE)
- SetFactionAtWar(&itr->second,true);
-
- itr->second.Standing = new_rep - BaseRep;
- itr->second.Changed = true;
-
- SetFactionVisible(&itr->second);
-
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
- {
- if(uint32 questid = GetQuestSlotQuestId(i))
- {
- Quest const* qInfo = objmgr.GetQuestTemplate(questid);
- if( qInfo && qInfo->GetRepObjectiveFaction() == factionEntry->ID )
- {
- QuestStatusData& q_status = mQuestStatus[questid];
- if( q_status.m_status == QUEST_STATUS_INCOMPLETE )
- {
- if(GetReputation(factionEntry) >= qInfo->GetRepObjectiveValue())
- if ( CanCompleteQuest( questid ) )
- CompleteQuest( questid );
- }
- else if( q_status.m_status == QUEST_STATUS_COMPLETE )
- {
- if(GetReputation(factionEntry) < qInfo->GetRepObjectiveValue())
- IncompleteQuest( questid );
- }
- }
- }
- }
-
- SendFactionState(&(itr->second));
-
- return true;
- }
- return false;
-}
-
-bool Player::SetFactionReputation(uint32 FactionTemplateId, int32 standing)
-{
- FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(FactionTemplateId);
-
- if(!factionTemplateEntry)
- {
- sLog.outError("Player::SetFactionReputation: Can't set reputation of %s for unknown faction (faction template id) #%u.", GetName(), FactionTemplateId);
- return false;
- }
-
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction);
-
- // Faction without recorded reputation. Just ignore.
- if(!factionEntry)
- return false;
-
- return SetFactionReputation(factionEntry, standing);
-}
-
-bool Player::SetFactionReputation(FactionEntry const* factionEntry, int32 standing)
-{
- SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID);
- if (flist)
- {
- bool res = false;
- for (SimpleFactionsList::const_iterator itr = flist->begin();itr != flist->end();++itr)
- {
- FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr);
- if(factionEntryCalc)
- res = SetOneFactionReputation(factionEntryCalc, standing);
- }
- return res;
- }
- else
- return SetOneFactionReputation(factionEntry, standing);
-}
-
-bool Player::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing)
-{
- FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
- if (itr != m_factions.end())
- {
- if (standing > Reputation_Cap)
- standing = Reputation_Cap;
- else
- if (standing < Reputation_Bottom)
- standing = Reputation_Bottom;
-
- int32 BaseRep = GetBaseReputation(factionEntry);
- itr->second.Standing = standing - BaseRep;
- itr->second.Changed = true;
-
- SetFactionVisible(&itr->second);
-
- if(ReputationToRank(standing) <= REP_HOSTILE)
- SetFactionAtWar(&itr->second,true);
-
- SendFactionState(&(itr->second));
- return true;
- }
- return false;
+ FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction);
+ return GetReputationMgr().GetRank(factionEntry);
}
//Calculate total reputation percent player gain with quest/creature level
int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, bool for_quest)
{
- // for grey creature kill received 20%, in other case 100.
- int32 percent = (!for_quest && (creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel()))) ? 20 : 100;
+ float percent = 100.0f;
+
+ float rate = for_quest ? sWorld.getRate(RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld.getRate(RATE_REPUTATION_LOWLEVEL_KILL);
+
+ if(rate != 1.0f && creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))
+ percent *= rate;
int32 repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN);
percent += rep > 0 ? repMod : -repMod;
- if(percent <=0)
+ if(percent <= 0.0f)
return 0;
return int32(sWorld.getRate(RATE_REPUTATION_GAIN)*rep*percent/100);
@@ -5937,16 +5671,16 @@ void Player::RewardReputation(Unit *pVictim, float rate)
int32 donerep1 = CalculateReputationGain(pVictim->getLevel(),Rep->repvalue1,false);
donerep1 = int32(donerep1*rate);
FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1);
- uint32 current_reputation_rank1 = GetReputationRank(factionEntry1);
+ uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
if(factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
- ModifyFactionReputation(factionEntry1, donerep1);
+ GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
// Wiki: Team factions value divided by 2
if(Rep->is_teamaward1)
{
FactionEntry const *team1_factionEntry = sFactionStore.LookupEntry(factionEntry1->team);
if(team1_factionEntry)
- ModifyFactionReputation(team1_factionEntry, donerep1 / 2);
+ GetReputationMgr().ModifyReputation(team1_factionEntry, donerep1 / 2);
}
}
@@ -5955,16 +5689,16 @@ void Player::RewardReputation(Unit *pVictim, float rate)
int32 donerep2 = CalculateReputationGain(pVictim->getLevel(),Rep->repvalue2,false);
donerep2 = int32(donerep2*rate);
FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2);
- uint32 current_reputation_rank2 = GetReputationRank(factionEntry2);
+ uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
if(factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
- ModifyFactionReputation(factionEntry2, donerep2);
+ GetReputationMgr().ModifyReputation(factionEntry2, donerep2);
// Wiki: Team factions value divided by 2
if(Rep->is_teamaward2)
{
FactionEntry const *team2_factionEntry = sFactionStore.LookupEntry(factionEntry2->team);
if(team2_factionEntry)
- ModifyFactionReputation(team2_factionEntry, donerep2 / 2);
+ GetReputationMgr().ModifyReputation(team2_factionEntry, donerep2 / 2);
}
}
}
@@ -5977,10 +5711,10 @@ void Player::RewardReputation(Quest const *pQuest)
{
if(pQuest->RewRepFaction[i] && pQuest->RewRepValue[i] )
{
- int32 rep = CalculateReputationGain(pQuest->GetQuestLevel(),pQuest->RewRepValue[i],true);
+ int32 rep = CalculateReputationGain(GetQuestLevel(pQuest),pQuest->RewRepValue[i],true);
FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i]);
if(factionEntry)
- ModifyFactionReputation(factionEntry, rep);
+ GetReputationMgr().ModifyReputation(factionEntry, rep);
}
}
@@ -6098,12 +5832,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
victim_guid = 0; // Don't show HK: <rank> message, only log.
}
- if(k_level <= 5)
- k_grey = 0;
- else if( k_level <= 39 )
- k_grey = k_level - 5 - k_level/10;
- else
- k_grey = k_level - 1 - k_level/5;
+ k_grey = Trinity::XP::GetGrayLevel(k_level);
if(v_level<=k_grey)
return false;
@@ -6139,6 +5868,8 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
if(groupsize > 1)
honor /= groupsize;
+ // apply honor multiplier from aura (not stacking-get highest)
+ honor = int32(float(honor) * (float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN_PCT))+100.0f)/100.0f);
honor *= (((float)urand(8,12))/10); // approx honor: 80% - 120% of real honor
}
@@ -6168,8 +5899,8 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
{
// Check if allowed to receive it in current map
uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
- if( (MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
- || (MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
+ if( (MapType == 1 && !InBattleGround() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
+ || (MapType == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|| (MapType == 3 && !InBattleGround()) )
return true;
@@ -6227,24 +5958,18 @@ void Player::ModifyArenaPoints( int32 value )
uint32 Player::GetGuildIdFromDB(uint64 guid)
{
- std::ostringstream ss;
- ss<<"SELECT guildid FROM guild_member WHERE guid='"<<guid<<"'";
- QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
- if( result )
- {
- uint32 v = result->Fetch()[0].GetUInt32();
- delete result;
- return v;
- }
- else
+ QueryResult* result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
+ if(!result)
return 0;
+
+ uint32 id = result->Fetch()[0].GetUInt32();
+ delete result;
+ return id;
}
uint32 Player::GetRankFromDB(uint64 guid)
{
- std::ostringstream ss;
- ss<<"SELECT rank FROM guild_member WHERE guid='"<<guid<<"'";
- QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
+ QueryResult *result = CharacterDatabase.PQuery( "SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid) );
if( result )
{
uint32 v = result->Fetch()[0].GetUInt32();
@@ -6268,10 +5993,8 @@ uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
uint32 Player::GetZoneIdFromDB(uint64 guid)
{
- std::ostringstream ss;
-
- ss<<"SELECT zone FROM characters WHERE guid='"<<GUID_LOPART(guid)<<"'";
- QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
+ uint32 guidLow = GUID_LOPART(guid);
+ QueryResult *result = CharacterDatabase.PQuery( "SELECT zone FROM characters WHERE guid='%u'", guidLow );
if (!result)
return 0;
Field* fields = result->Fetch();
@@ -6281,22 +6004,19 @@ uint32 Player::GetZoneIdFromDB(uint64 guid)
if (!zone)
{
// stored zone is zero, use generic and slow zone detection
- ss.str("");
- ss<<"SELECT map,position_x,position_y FROM characters WHERE guid='"<<GUID_LOPART(guid)<<"'";
- result = CharacterDatabase.Query(ss.str().c_str());
+ result = CharacterDatabase.PQuery("SELECT map,position_x,position_y,position_z FROM characters WHERE guid='%u'", guidLow);
if( !result )
return 0;
fields = result->Fetch();
- uint32 map = fields[0].GetUInt32();
+ uint32 map = fields[0].GetUInt32();
float posx = fields[1].GetFloat();
float posy = fields[2].GetFloat();
+ float posz = fields[3].GetFloat();
delete result;
- zone = MapManager::Instance().GetZoneId(map,posx,posy);
+ zone = MapManager::Instance().GetZoneId(map,posx,posy,posz);
- ss.str("");
- ss << "UPDATE characters SET zone='"<<zone<<"' WHERE guid='"<<GUID_LOPART(guid)<<"'";
- CharacterDatabase.Execute(ss.str().c_str());
+ CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow);
}
return zone;
@@ -6313,39 +6033,38 @@ void Player::UpdateArea(uint32 newArea)
if(area && (area->flags & AREA_FLAG_ARENA))
{
if(!isGameMaster())
- SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP);
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
else
{
// remove ffa flag only if not ffapvp realm
// removal in sanctuaries and capitals is handled in zone update
- if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) && !sWorld.IsFFAPvPRealm())
- RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP);
+ if(HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) && !sWorld.IsFFAPvPRealm())
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
UpdateAreaDependentAuras(newArea);
}
-void Player::UpdateZone(uint32 newZone)
+void Player::UpdateZone(uint32 newZone, uint32 newArea)
{
- uint32 oldZoneId = m_zoneUpdateId;
+ if(m_zoneUpdateId != newZone)
+ {
+ sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
+ sOutdoorPvPMgr.HandlePlayerEnterZone(this, newZone);
+ SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
+ }
+
m_zoneUpdateId = newZone;
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
// zone changed, so area changed as well, update it
- UpdateArea(GetAreaId());
+ UpdateArea(newArea);
AreaTableEntry const* zone = GetAreaEntryByAreaID(newZone);
if(!zone)
return;
- // inform outdoor pvp
- if(oldZoneId != m_zoneUpdateId)
- {
- sOutdoorPvPMgr.HandlePlayerLeaveZone(this, oldZoneId);
- sOutdoorPvPMgr.HandlePlayerEnterZone(this, m_zoneUpdateId);
- }
-
if (sWorld.getConfig(CONFIG_WEATHER))
{
Weather *wth = sWorld.FindWeather(zone->ID);
@@ -6380,15 +6099,15 @@ void Player::UpdateZone(uint32 newZone)
pvpInfo.endTimer = time(0); // start toggle-off
}
- if(zone->flags & AREA_FLAG_SANCTUARY) // in sanctuary
+ if((zone->flags & AREA_FLAG_SANCTUARY) || zone->mapid == 609) // in sanctuary
{
- SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY);
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);
if(sWorld.IsFFAPvPRealm())
- RemoveFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
else
{
- RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY);
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);
}
if(zone->flags & AREA_FLAG_CAPITAL) // in capital city
@@ -6398,7 +6117,7 @@ void Player::UpdateZone(uint32 newZone)
InnEnter(time(0),GetMapId(),0,0,0);
if(sWorld.IsFFAPvPRealm())
- RemoveFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
else // anywhere else
{
@@ -6412,7 +6131,7 @@ void Player::UpdateZone(uint32 newZone)
SetRestType(REST_TYPE_NO);
if(sWorld.IsFFAPvPRealm())
- SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
}
else // not in tavern (leave city then)
@@ -6422,7 +6141,7 @@ void Player::UpdateZone(uint32 newZone)
// Set player to FFA PVP when not in rested environment.
if(sWorld.IsFFAPvPRealm())
- SetFlag(PLAYER_FLAGS,PLAYER_FLAGS_FFA_PVP);
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
}
}
@@ -6432,6 +6151,9 @@ void Player::UpdateZone(uint32 newZone)
if(isAlive())
DestroyZoneLimitedItem( true, newZone );
+ // check some item equip limitations (in result lost CanTitanGrip at talent reset, for example)
+ AutoUnequipOffhandIfNeed();
+
// recent client version not send leave/join channel packets for built-in local channels
UpdateLocalChannels( newZone );
@@ -6490,6 +6212,8 @@ void Player::DuelComplete(DuelCompleteType type)
if(!duel)
return;
+ sLog.outDebug("Duel Complete %s %s", GetName(), duel->opponent->GetName());
+
WorldPacket data(SMSG_DUEL_COMPLETE, (1));
data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0);
GetSession()->SendPacket(&data);
@@ -6526,26 +6250,27 @@ void Player::DuelComplete(DuelCompleteType type)
duel->initiator->RemoveGameObject(obj,true);
/* remove auras */
- std::vector<uint32> auras2remove;
- AuraMap const& vAuras = duel->opponent->GetAuras();
- for (AuraMap::const_iterator i = vAuras.begin(); i != vAuras.end(); ++i)
+ AuraMap &itsAuras = duel->opponent->GetAuras();
+ for(AuraMap::iterator i = itsAuras.begin(); i != itsAuras.end();)
{
if (!i->second->IsPositive() && i->second->GetCasterGUID() == GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
- auras2remove.push_back(i->second->GetId());
+ {
+ duel->opponent->RemoveAura(i);
+ }
+ else
+ ++i;
}
- for(size_t i=0; i<auras2remove.size(); i++)
- duel->opponent->RemoveAurasDueToSpell(auras2remove[i]);
-
- auras2remove.clear();
- AuraMap const& auras = GetAuras();
- for (AuraMap::const_iterator i = auras.begin(); i != auras.end(); ++i)
+ AuraMap &myAuras = GetAuras();
+ for(AuraMap::iterator i = myAuras.begin(); i != myAuras.end();)
{
if (!i->second->IsPositive() && i->second->GetCasterGUID() == duel->opponent->GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
- auras2remove.push_back(i->second->GetId());
+ {
+ RemoveAura(i);
+ }
+ else
+ ++i;
}
- for(size_t i=0; i<auras2remove.size(); i++)
- RemoveAurasDueToSpell(auras2remove[i]);
// cleanup combo points
if(GetComboTarget()==duel->opponent->GetGUID())
@@ -6592,7 +6317,12 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply)
sLog.outDetail("applying mods for item %u ",item->GetGUIDLow());
- uint32 attacktype = Player::GetAttackBySlot(slot);
+ uint8 attacktype = Player::GetAttackBySlot(slot);
+
+ //check disarm only on mod apply to allow remove item mods
+ if (apply && !CanUseAttackType(attacktype) )
+ return;
+
if(attacktype < MAX_ATTACK)
_ApplyWeaponDependentAuraMods(item,WeaponAttackType(attacktype),apply);
@@ -6610,19 +6340,43 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply)
sLog.outDebug("_ApplyItemMods complete.");
}
-void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
+void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply)
{
if(slot >= INVENTORY_SLOT_BAG_END || !proto)
return;
- for (int i = 0; i < 10; i++)
+ for (int i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
{
- float val = float (proto->ItemStat[i].ItemStatValue);
+ uint32 statType = 0;
+ int32 val = 0;
+
+ if(proto->ScalingStatDistribution)
+ {
+ if(ScalingStatDistributionEntry const *ssd = sScalingStatDistributionStore.LookupEntry(proto->ScalingStatDistribution))
+ {
+ statType = ssd->StatMod[i];
+
+ if(uint32 modifier = ssd->Modifier[i])
+ {
+ uint32 level = ((getLevel() > ssd->MaxLevel) ? ssd->MaxLevel : getLevel());
+ if(ScalingStatValuesEntry const *ssv = sScalingStatValuesStore.LookupEntry(level))
+ {
+ uint32 multiplier = ssv->Multiplier[proto->GetScalingStatValuesColumn()];
+ val = (multiplier * modifier) / 10000;
+ }
+ }
+ }
+ }
+ else
+ {
+ statType = proto->ItemStat[i].ItemStatType;
+ val = proto->ItemStat[i].ItemStatValue;
+ }
- if(val==0)
+ if(val == 0)
continue;
- switch (proto->ItemStat[i].ItemStatType)
+ switch (statType)
{
case ITEM_MOD_MANA:
HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(val), apply);
@@ -6740,6 +6494,32 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
case ITEM_MOD_EXPERTISE_RATING:
ApplyRatingMod(CR_EXPERTISE, int32(val), apply);
break;
+ case ITEM_MOD_ATTACK_POWER:
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(val), apply);
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply);
+ break;
+ case ITEM_MOD_RANGED_ATTACK_POWER:
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply);
+ break;
+ case ITEM_MOD_FERAL_ATTACK_POWER:
+ ApplyFeralAPBonus(int32(val), apply);
+ break;
+ case ITEM_MOD_SPELL_HEALING_DONE:
+ ApplySpellHealingBonus(int32(val), apply);
+ break;
+ case ITEM_MOD_SPELL_DAMAGE_DONE:
+ ApplySpellDamageBonus(int32(val), apply);
+ break;
+ case ITEM_MOD_MANA_REGENERATION:
+ ApplyManaRegenBonus(int32(val), apply);
+ break;
+ case ITEM_MOD_ARMOR_PENETRATION_RATING:
+ ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
+ break;
+ case ITEM_MOD_SPELL_POWER:
+ ApplySpellHealingBonus(int32(val), apply);
+ ApplySpellDamageBonus(int32(val), apply);
+ break;
}
}
@@ -6794,7 +6574,15 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
SetBaseWeaponDamage(attType, MAXDAMAGE, damage);
}
- if(!IsUseEquipedWeapon(slot==EQUIPMENT_SLOT_MAINHAND))
+ // Druids get feral AP bonus from weapon dps
+ if(getClass() == CLASS_DRUID)
+ {
+ int32 feral_bonus = proto->getFeralBonus();
+ if (feral_bonus > 0)
+ ApplyFeralAPBonus(feral_bonus, apply);
+ }
+
+ if(IsInFeralForm() || !CanUseAttackType(attType))
return;
if (proto->Delay)
@@ -6813,20 +6601,20 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply)
void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply)
{
- AuraList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
- for(AuraList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr)
+ AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
+ for(AuraEffectList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr)
_ApplyWeaponDependentAuraCritMod(item,attackType,*itr,apply);
- AuraList const& auraDamageFlatList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
- for(AuraList::const_iterator itr = auraDamageFlatList.begin(); itr!=auraDamageFlatList.end();++itr)
+ AuraEffectList const& auraDamageFlatList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
+ for(AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr!=auraDamageFlatList.end();++itr)
_ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply);
- AuraList const& auraDamagePCTList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for(AuraList::const_iterator itr = auraDamagePCTList.begin(); itr!=auraDamagePCTList.end();++itr)
+ AuraEffectList const& auraDamagePCTList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ for(AuraEffectList::const_iterator itr = auraDamagePCTList.begin(); itr!=auraDamagePCTList.end();++itr)
_ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply);
}
-void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply)
+void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply)
{
// generic not weapon specific case processes in aura code
if(aura->GetSpellProto()->EquippedItemClass == -1)
@@ -6843,15 +6631,14 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
- HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifierValue()), apply);
+ HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply);
}
}
-void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply)
+void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply)
{
// ignore spell mods for not wands
- Modifier const* modifier = aura->GetModifier();
- if((modifier->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)==0 && (getClassMask() & CLASSMASK_WAND_USERS)==0)
+ if((aura->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)==0 && (getClassMask() & CLASSMASK_WAND_USERS)==0)
return;
// generic not weapon specific case processes in aura code
@@ -6868,7 +6655,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
}
UnitModifierType unitModType = TOTAL_VALUE;
- switch(modifier->m_auraname)
+ switch(aura->GetAuraName())
{
case SPELL_AURA_MOD_DAMAGE_DONE: unitModType = TOTAL_VALUE; break;
case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: unitModType = TOTAL_PCT; break;
@@ -6877,7 +6664,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
- HandleStatModifier(unitMod, unitModType, float(aura->GetModifierValue()),apply);
+ HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()),apply);
}
}
@@ -6890,7 +6677,7 @@ void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change)
if(!proto)
return;
- for (int i = 0; i < 5; i++)
+ for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
_Spell const& spellData = proto->Spells[i];
@@ -6916,29 +6703,15 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
if(apply)
{
// Cannot be used in this stance/form
- if(GetErrorAtShapeshiftedCast(spellInfo, m_form)!=0)
+ if(GetErrorAtShapeshiftedCast(spellInfo, m_form) != SPELL_CAST_OK)
return;
if(form_change) // check aura active state from other form
{
- bool found = false;
- for (int k=0; k < 3; ++k)
- {
- spellEffectPair spair = spellEffectPair(spellInfo->Id, k);
- for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair); ++iter)
- {
- if(!item || iter->second->GetCastItemGUID() == item->GetGUID())
- {
- found = true;
- break;
- }
- }
- if(found)
- break;
- }
-
- if(found) // and skip re-cast already active aura at form change
- return;
+ AuraMap const& auras = GetAuras();
+ for(AuraMap::const_iterator itr = auras.lower_bound(spellInfo->Id); itr != auras.upper_bound(spellInfo->Id); ++itr)
+ if(!item || itr->second->GetCastItemGUID()==item->GetGUID())
+ return;
}
DEBUG_LOG("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
@@ -6950,7 +6723,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
if(form_change) // check aura compatibility
{
// Cannot be used in this stance/form
- if(GetErrorAtShapeshiftedCast(spellInfo, m_form)==0)
+ if(GetErrorAtShapeshiftedCast(spellInfo, m_form)==SPELL_CAST_OK)
return; // and remove only not compatible at form change
}
@@ -7003,7 +6776,7 @@ void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attTy
if (!Target || Target == this )
return;
- for (int i = 0; i < 5; i++)
+ for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
_Spell const& spellData = proto->Spells[i];
@@ -7031,7 +6804,7 @@ void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attTy
if(spellData.SpellPPMRate)
{
uint32 WeaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);
+ chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
}
else if(chance > 100.0f)
{
@@ -7072,6 +6845,92 @@ void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attTy
}
}
+void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex)
+{
+ ItemPrototype const* proto = item->GetProto();
+ // special learning case
+ if(proto->Spells[0].SpellId==SPELL_ID_GENERIC_LEARN || proto->Spells[0].SpellId==SPELL_ID_GENERIC_LEARN_PET)
+ {
+ uint32 learn_spell_id = proto->Spells[0].SpellId;
+ uint32 learning_spell_id = proto->Spells[1].SpellId;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(learn_spell_id);
+ if(!spellInfo)
+ {
+ sLog.outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, learn_spell_id);
+ SendEquipError(EQUIP_ERR_NONE,item,NULL);
+ return;
+ }
+
+ Spell *spell = new Spell(this, spellInfo, false);
+ spell->m_CastItem = item;
+ spell->m_cast_count = cast_count; //set count of casts
+ spell->m_currentBasePoints[0] = learning_spell_id;
+ spell->prepare(&targets);
+ return;
+ }
+
+ // use triggered flag only for items with many spell casts and for not first cast
+ int count = 0;
+
+ // item spells casted at use
+ for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
+ {
+ _Spell const& spellData = proto->Spells[i];
+
+ // no spell
+ if(!spellData.SpellId)
+ continue;
+
+ // wrong triggering type
+ if( spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
+ if(!spellInfo)
+ {
+ sLog.outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring",proto->ItemId, spellData.SpellId);
+ continue;
+ }
+
+ Spell *spell = new Spell(this, spellInfo, (count > 0));
+ spell->m_CastItem = item;
+ spell->m_cast_count = cast_count; // set count of casts
+ spell->m_glyphIndex = glyphIndex; // glyph index
+ spell->prepare(&targets);
+
+ ++count;
+ }
+
+ // Item enchantments spells casted at use
+ for(int e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot)
+ {
+ uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
+ SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+ if(!pEnchant) continue;
+ for (int s=0;s<3;s++)
+ {
+ if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_USE_SPELL)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
+ if (!spellInfo)
+ {
+ sLog.outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ continue;
+ }
+
+ Spell *spell = new Spell(this, spellInfo, (count > 0));
+ spell->m_CastItem = item;
+ spell->m_cast_count = cast_count; // set count of casts
+ spell->m_glyphIndex = glyphIndex; // glyph index
+ spell->prepare(&targets);
+
+ ++count;
+ }
+ }
+}
+
void Player::_RemoveAllItemMods()
{
sLog.outDebug("_RemoveAllItemMods start.");
@@ -7247,7 +7106,7 @@ void Player::RemovedInsignia(Player* looterPlr)
// We have to convert player corpse to bones, not to be able to resurrect there
// SpawnCorpseBones isn't handy, 'cos it saves player while he in BG
- Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID());
+ Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID(),true);
if (!bones)
return;
@@ -7276,6 +7135,9 @@ void Player::SendLootRelease( uint64 guid )
void Player::SendLoot(uint64 guid, LootType loot_type)
{
+ if (uint64 lguid = GetLootGUID())
+ m_session->DoLootRelease(lguid);
+
Loot *loot = 0;
PermissionTypes permission = ALL_PERMISSION;
@@ -7314,11 +7176,11 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
{
sLog.outDebug(" if(lootid)");
loot->clear();
- loot->FillLoot(lootid, LootTemplates_Gameobject, this);
+ loot->FillLoot(lootid, LootTemplates_Gameobject, this, false);
}
if(loot_type == LOOT_FISHING)
- go->getFishLoot(loot);
+ go->getFishLoot(loot,this);
go->SetLootState(GO_ACTIVATED);
}
@@ -7341,7 +7203,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
{
item->m_lootGenerated = true;
loot->clear();
- loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this);
+ loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this,true);
}
}
else if(loot_type == LOOT_PROSPECTING)
@@ -7352,7 +7214,18 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
{
item->m_lootGenerated = true;
loot->clear();
- loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this);
+ loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true);
+ }
+ }
+ else if(loot_type == LOOT_MILLING)
+ {
+ loot = &item->loot;
+
+ if(!item->m_lootGenerated)
+ {
+ item->m_lootGenerated = true;
+ loot->clear();
+ loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true);
}
}
else
@@ -7363,7 +7236,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
{
item->m_lootGenerated = true;
loot->clear();
- loot->FillLoot(item->GetEntry(), LootTemplates_Item, this);
+ loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true);
loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot);
}
@@ -7387,7 +7260,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
uint32 pLevel = bones->loot.gold;
bones->loot.clear();
if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV)
- loot->FillLoot(1, LootTemplates_Creature, this);
+ loot->FillLoot(1, LootTemplates_Creature, this, true);
// It may need a better formula
// Now it works like this: lvl10: ~6copper, lvl70: ~9silver
bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) );
@@ -7423,7 +7296,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
loot->clear();
if (uint32 lootid = creature->GetCreatureInfo()->pickpocketLootId)
- loot->FillLoot(lootid, LootTemplates_Pickpocketing, this);
+ loot->FillLoot(lootid, LootTemplates_Pickpocketing, this, false);
// Generate extra money for pick pocket loot
const uint32 a = urand(0, creature->getLevel()/2);
@@ -7453,7 +7326,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
loot->clear();
if (uint32 lootid = creature->GetCreatureInfo()->lootid)
- loot->FillLoot(lootid, LootTemplates_Creature, recipient);
+ loot->FillLoot(lootid, LootTemplates_Creature, recipient, false);
loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold);
@@ -7483,7 +7356,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
if (loot_type == LOOT_SKINNING)
{
loot->clear();
- loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this);
+ loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this, false);
}
// set group rights only for loot_type != LOOT_SKINNING
else
@@ -7517,41 +7390,8 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
SetLootGUID(guid);
- QuestItemList *q_list = 0;
- if (permission != NONE_PERMISSION)
- {
- QuestItemMap const& lootPlayerQuestItems = loot->GetPlayerQuestItems();
- QuestItemMap::const_iterator itr = lootPlayerQuestItems.find(GetGUIDLow());
- if (itr == lootPlayerQuestItems.end())
- q_list = loot->FillQuestLoot(this);
- else
- q_list = itr->second;
- }
-
- QuestItemList *ffa_list = 0;
- if (permission != NONE_PERMISSION)
- {
- QuestItemMap const& lootPlayerFFAItems = loot->GetPlayerFFAItems();
- QuestItemMap::const_iterator itr = lootPlayerFFAItems.find(GetGUIDLow());
- if (itr == lootPlayerFFAItems.end())
- ffa_list = loot->FillFFALoot(this);
- else
- ffa_list = itr->second;
- }
-
- QuestItemList *conditional_list = 0;
- if (permission != NONE_PERMISSION)
- {
- QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = loot->GetPlayerNonQuestNonFFAConditionalItems();
- QuestItemMap::const_iterator itr = lootPlayerNonQuestNonFFAConditionalItems.find(GetGUIDLow());
- if (itr == lootPlayerNonQuestNonFFAConditionalItems.end())
- conditional_list = loot->FillNonQuestNonFFAConditionalLoot(this);
- else
- conditional_list = itr->second;
- }
-
- // LOOT_PICKPOCKETING, LOOT_PROSPECTING, LOOT_DISENCHANTING and LOOT_INSIGNIA unsupported by client, sending LOOT_SKINNING instead
- if(loot_type == LOOT_PICKPOCKETING || loot_type == LOOT_DISENCHANTING || loot_type == LOOT_PROSPECTING || loot_type == LOOT_INSIGNIA)
+ // LOOT_PICKPOCKETING, LOOT_PROSPECTING, LOOT_DISENCHANTING, LOOT_INSIGNIA and LOOT_MILLING unsupported by client, sending LOOT_SKINNING instead
+ if(loot_type == LOOT_PICKPOCKETING || loot_type == LOOT_DISENCHANTING || loot_type == LOOT_PROSPECTING || loot_type == LOOT_INSIGNIA || loot_type == LOOT_MILLING)
loot_type = LOOT_SKINNING;
if(loot_type == LOOT_FISHINGHOLE)
@@ -7561,7 +7401,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
data << uint64(guid);
data << uint8(loot_type);
- data << LootView(*loot, q_list, ffa_list, conditional_list, this, permission);
+ data << LootView(*loot, this, permission);
SendDirectMessage(&data);
@@ -7594,20 +7434,16 @@ void Player::SendUpdateWorldState(uint32 Field, uint32 Value)
GetSession()->SendPacket(&data);
}
-void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
+void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
{
// data depends on zoneid/mapid...
BattleGround* bg = GetBattleGround();
uint16 NumberOfFields = 0;
uint32 mapid = GetMapId();
- uint32 zoneid;
- if(forceZone)
- zoneid = forceZoneId;
- else
- zoneid = GetZoneId();
OutdoorPvP * pvp = sOutdoorPvPMgr.GetOutdoorPvPToZoneId(zoneid);
- uint32 areaid = GetAreaId();
+
sLog.outDebug("Sending SMSG_INIT_WORLD_STATES to Map:%u, Zone: %u", mapid, zoneid);
+
// may be exist better way to do this...
switch(zoneid)
{
@@ -7628,46 +7464,46 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
case 1537:
case 2257:
case 2918:
- NumberOfFields = 6;
+ NumberOfFields = 8;
break;
case 139:
- NumberOfFields = 39;
+ NumberOfFields = 41;
break;
case 1377:
- NumberOfFields = 13;
+ NumberOfFields = 15;
break;
case 2597:
- NumberOfFields = 81;
+ NumberOfFields = 83;
break;
case 3277:
- NumberOfFields = 14;
+ NumberOfFields = 16;
break;
case 3358:
case 3820:
- NumberOfFields = 38;
+ NumberOfFields = 40;
break;
case 3483:
- NumberOfFields = 25;
+ NumberOfFields = 27;
break;
case 3518:
- NumberOfFields = 37;
+ NumberOfFields = 39;
break;
case 3519:
- NumberOfFields = 36;
+ NumberOfFields = 38;
break;
case 3521:
- NumberOfFields = 35;
+ NumberOfFields = 37;
break;
case 3698:
case 3702:
case 3968:
- NumberOfFields = 9;
+ NumberOfFields = 11;
break;
case 3703:
- NumberOfFields = 9;
+ NumberOfFields = 11;
break;
default:
- NumberOfFields = 10;
+ NumberOfFields = 12;
break;
}
@@ -7682,6 +7518,10 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
data << uint32(0x8d5) << uint32(0x0); // 4
data << uint32(0x8d4) << uint32(0x0); // 5
data << uint32(0x8d3) << uint32(0x0); // 6
+ // 7 1 - Arena season in progress, 0 - end of season
+ data << uint32(0xC77) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
+ // 8 Arena season id
+ data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
if(mapid == 530) // Outland
{
data << uint32(0x9bf) << uint32(0x0); // 7
@@ -8275,7 +8115,8 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
// (this will be replace mainhand weapon at auto equip instead unwonted "you don't known dual wielding" ...
if(CanDualWield())
slots[1] = EQUIPMENT_SLOT_OFFHAND;
- };break;
+ break;
+ };
case INVTYPE_SHIELD:
slots[0] = EQUIPMENT_SLOT_OFFHAND;
break;
@@ -8284,6 +8125,8 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
break;
case INVTYPE_2HWEAPON:
slots[0] = EQUIPMENT_SLOT_MAINHAND;
+ if (CanDualWield() && CanTitanGrip())
+ slots[1] = EQUIPMENT_SLOT_OFFHAND;
break;
case INVTYPE_TABARD:
slots[0] = EQUIPMENT_SLOT_TABARD;
@@ -8304,10 +8147,10 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
slots[0] = EQUIPMENT_SLOT_RANGED;
break;
case INVTYPE_BAG:
- slots[0] = INVENTORY_SLOT_BAG_1;
- slots[1] = INVENTORY_SLOT_BAG_2;
- slots[2] = INVENTORY_SLOT_BAG_3;
- slots[3] = INVENTORY_SLOT_BAG_4;
+ slots[0] = INVENTORY_SLOT_BAG_START + 0;
+ slots[1] = INVENTORY_SLOT_BAG_START + 1;
+ slots[2] = INVENTORY_SLOT_BAG_START + 2;
+ slots[3] = INVENTORY_SLOT_BAG_START + 3;
break;
case INVTYPE_RELIC:
{
@@ -8329,6 +8172,10 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
if (pClass == CLASS_WARLOCK)
slots[0] = EQUIPMENT_SLOT_RANGED;
break;
+ case ITEM_SUBCLASS_ARMOR_SIGIL:
+ if (pClass == CLASS_DEATH_KNIGHT)
+ slots[0] = EQUIPMENT_SLOT_RANGED;
+ break;
}
break;
}
@@ -8354,14 +8201,8 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
{
if ( slots[i] != NULL_SLOT && !GetItemByPos( INVENTORY_SLOT_BAG_0, slots[i] ) )
{
- // in case 2hand equipped weapon offhand slot empty but not free
- if(slots[i]==EQUIPMENT_SLOT_OFFHAND)
- {
- Item* mainItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
- if(!mainItem || mainItem->GetProto()->InventoryType != INVTYPE_2HWEAPON)
- return slots[i];
- }
- else
+ // in case 2hand equipped weapon (without titan grip) offhand slot empty but not free
+ if(slots[i]!=EQUIPMENT_SLOT_OFFHAND || !IsTwoHandUsed())
return slots[i];
}
}
@@ -8411,7 +8252,7 @@ uint8 Player::CanUnequipItems( uint32 item, uint32 count ) const
return EQUIP_ERR_OK;
}
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && pItem->GetEntry() == item )
@@ -8453,7 +8294,7 @@ uint32 Player::GetItemCount( uint32 item, bool inBankAlso, Item* skipItem ) cons
if( pItem && pItem != skipItem && pItem->GetEntry() == item )
count += pItem->GetCount();
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && pItem != skipItem && pItem->GetEntry() == item )
@@ -8513,7 +8354,7 @@ Item* Player::GetItemByGuid( uint64 guid ) const
if( pItem && pItem->GetGUID() == guid )
return pItem;
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && pItem->GetGUID() == guid )
@@ -8559,7 +8400,7 @@ Item* Player::GetItemByPos( uint16 pos ) const
Item* Player::GetItemByPos( uint8 bag, uint8 slot ) const
{
- if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_END ) )
+ if( bag == INVENTORY_SLOT_BAG_0 && ( slot < BANK_SLOT_BAG_END || slot >= KEYRING_SLOT_START && slot < QUESTBAG_SLOT_END ) )
return m_items[slot];
else if(bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END
|| bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END )
@@ -8582,14 +8423,14 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable) cons
default: return NULL;
}
- Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
+ Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (!item || item->GetProto()->Class != ITEM_CLASS_WEAPON)
return NULL;
if(!useable)
return item;
- if( item->IsBroken() || !IsUseEquipedWeapon(attackType==BASE_ATTACK) )
+ if( item->IsBroken() || IsInFeralForm())
return NULL;
return item;
@@ -8597,7 +8438,7 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable) cons
Item* Player::GetShield(bool useable) const
{
- Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ Item* item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (!item || item->GetProto()->Class != ITEM_CLASS_ARMOR)
return NULL;
@@ -8610,7 +8451,7 @@ Item* Player::GetShield(bool useable) const
return item;
}
-uint32 Player::GetAttackBySlot( uint8 slot )
+uint8 Player::GetAttackBySlot( uint8 slot )
{
switch(slot)
{
@@ -8637,7 +8478,7 @@ bool Player::IsInventoryPos( uint8 bag, uint8 slot )
return true;
if( bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END )
return true;
- if( bag == INVENTORY_SLOT_BAG_0 && ( slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_END ) )
+ if( bag == INVENTORY_SLOT_BAG_0 && ( slot >= KEYRING_SLOT_START && slot < QUESTBAG_SLOT_END ) )
return true;
return false;
}
@@ -8758,7 +8599,7 @@ bool Player::HasItemCount( uint32 item, uint32 count, bool inBankAlso ) const
return true;
}
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && pItem->GetEntry() == item )
@@ -8818,31 +8659,76 @@ bool Player::HasItemCount( uint32 item, uint32 count, bool inBankAlso ) const
return false;
}
-Item* Player::GetItemOrItemWithGemEquipped( uint32 item ) const
+bool Player::HasItemOrGemWithIdEquipped( uint32 item, uint32 count, uint8 except_slot ) const
{
- Item *pItem;
- for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++)
+ uint32 tempcount = 0;
+ for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetEntry() == item )
- return pItem;
+ if(i==int(except_slot))
+ continue;
+
+ Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+ if( pItem && pItem->GetEntry() == item)
+ {
+ tempcount += pItem->GetCount();
+ if( tempcount >= count )
+ return true;
+ }
}
ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
if (pProto && pProto->GemProperties)
{
- for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++)
+ for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetProto()->Socket[0].Color )
+ if(i==int(except_slot))
+ continue;
+
+ Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+ if( pItem && pItem->GetProto()->Socket[0].Color)
{
- if (pItem->GetGemCountWithID(item) > 0 )
- return pItem;
+ tempcount += pItem->GetGemCountWithID(item);
+ if( tempcount >= count )
+ return true;
}
}
}
- return NULL;
+ return false;
+}
+
+bool Player::HasItemOrGemWithLimitCategoryEquipped( uint32 limitCategory, uint32 count, uint8 except_slot ) const
+{
+ uint32 tempcount = 0;
+ for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
+ {
+ if(i==int(except_slot))
+ continue;
+
+ Item *pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+ if (!pItem)
+ continue;
+
+ ItemPrototype const *pProto = pItem->GetProto();
+ if (!pProto)
+ continue;
+
+ if (pProto->ItemLimitCategory == limitCategory)
+ {
+ tempcount += pItem->GetCount();
+ if( tempcount >= count )
+ return true;
+ }
+
+ if( pProto->Socket[0].Color)
+ {
+ tempcount += pItem->GetGemCountWithLimitCategory(limitCategory);
+ if( tempcount >= count )
+ return true;
+ }
+ }
+
+ return false;
}
uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count ) const
@@ -8856,12 +8742,12 @@ uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem,
}
// no maximum
- if(pProto->MaxCount == 0)
+ if(pProto->MaxCount <= 0)
return EQUIP_ERR_OK;
uint32 curcount = GetItemCount(pProto->ItemId,true,pItem);
- if( curcount + count > pProto->MaxCount )
+ if (curcount + count > uint32(pProto->MaxCount))
{
if(no_space_count)
*no_space_count = count +curcount - pProto->MaxCount;
@@ -8876,13 +8762,13 @@ bool Player::HasItemTotemCategory( uint32 TotemCategory ) const
Item *pItem;
for(uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+ pItem = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && IsTotemCategoryCompatiableWith(pItem->GetProto()->TotemCategory,TotemCategory ))
return true;
}
- for(uint8 i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i)
+ for(uint8 i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; ++i)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+ pItem = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i );
if( pItem && IsTotemCategoryCompatiableWith(pItem->GetProto()->TotemCategory,TotemCategory ))
return true;
}
@@ -8892,7 +8778,7 @@ bool Player::HasItemTotemCategory( uint32 TotemCategory ) const
{
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
- pItem = GetItemByPos( i, j );
+ pItem = GetUseableItemByPos( i, j );
if( pItem && IsTotemCategoryCompatiableWith(pItem->GetProto()->TotemCategory,TotemCategory ))
return true;
}
@@ -8920,6 +8806,18 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
if(slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_START+GetMaxKeyringSize() && !(pProto->BagFamily & BAG_FAMILY_MASK_KEYS))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
+ // vanitypet case (not use, vanity pets stored as spells)
+ if(slot >= VANITYPET_SLOT_START && slot < VANITYPET_SLOT_END)
+ return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
+
+ // currencytoken case (disabled until proper implement)
+ if(slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS))
+ return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
+
+ // guestbag case (not use)
+ if(slot >= QUESTBAG_SLOT_START && slot < QUESTBAG_SLOT_END)
+ return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
+
// prevent cheating
if(slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END || slot >= PLAYER_SLOT_END)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
@@ -8939,7 +8837,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
}
// non empty stack with space
- need_space = pProto->Stackable;
+ need_space = pProto->GetMaxStackSize();
}
// non empty slot, check item type
else
@@ -8949,10 +8847,11 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
return EQUIP_ERR_ITEM_CANT_STACK;
// check free space
- if(pItem2->GetCount() >= pProto->Stackable)
+ if(pItem2->GetCount() >= pProto->GetMaxStackSize())
return EQUIP_ERR_ITEM_CANT_STACK;
- need_space = pProto->Stackable - pItem2->GetCount();
+ // free stack space or infinity
+ need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
}
if(need_space > count)
@@ -9006,9 +8905,9 @@ uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototy
if( pItem2 )
{
- if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->Stackable )
+ if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
- uint32 need_space = pProto->Stackable - pItem2->GetCount();
+ uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if(need_space > count)
need_space = count;
@@ -9025,7 +8924,7 @@ uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototy
}
else
{
- uint32 need_space = pProto->Stackable;
+ uint32 need_space = pProto->GetMaxStackSize();
if(need_space > count)
need_space = count;
@@ -9063,9 +8962,9 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end,
if( pItem2 )
{
- if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->Stackable )
+ if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
- uint32 need_space = pProto->Stackable - pItem2->GetCount();
+ uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if(need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((INVENTORY_SLOT_BAG_0 << 8) | j, need_space);
@@ -9081,7 +8980,7 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end,
}
else
{
- uint32 need_space = pProto->Stackable;
+ uint32 need_space = pProto->GetMaxStackSize();
if(need_space > count)
need_space = count;
@@ -9160,11 +9059,11 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
if( bag != NULL_BAG )
{
// search stack in bag for merge to
- if( pProto->Stackable > 1 )
+ if( pProto->Stackable != 1 )
{
if( bag == INVENTORY_SLOT_BAG_0 ) // inventory
{
- res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
+ res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,QUESTBAG_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
{
if(no_space_count)
@@ -9250,6 +9149,44 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
+
+ res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
+ if(res!=EQUIP_ERR_OK)
+ {
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return res;
+ }
+
+ if(count==0)
+ {
+ if(no_similar_count==0)
+ return EQUIP_ERR_OK;
+
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
+ }
+ }
+ else if(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ {
+ res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
+ if(res!=EQUIP_ERR_OK)
+ {
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return res;
+ }
+
+ if(count==0)
+ {
+ if(no_similar_count==0)
+ return EQUIP_ERR_OK;
+
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
+ }
}
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot);
@@ -9298,9 +9235,9 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
// not specific bag or have space for partly store only in specific bag
// search stack for merge to
- if( pProto->Stackable > 1 )
+ if( pProto->Stackable != 1 )
{
- res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
+ res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,QUESTBAG_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
{
if(no_space_count)
@@ -9398,6 +9335,26 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
+ else if(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ {
+ res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
+ if(res!=EQUIP_ERR_OK)
+ {
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return res;
+ }
+
+ if(count==0)
+ {
+ if(no_similar_count==0)
+ return EQUIP_ERR_OK;
+
+ if(no_space_count)
+ *no_space_count = count + no_similar_count;
+ return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
+ }
+ }
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
{
@@ -9468,10 +9425,12 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
int inv_slot_items[INVENTORY_SLOT_ITEM_END-INVENTORY_SLOT_ITEM_START];
int inv_bags[INVENTORY_SLOT_BAG_END-INVENTORY_SLOT_BAG_START][MAX_BAG_SIZE];
int inv_keys[KEYRING_SLOT_END-KEYRING_SLOT_START];
+ int inv_tokens[CURRENCYTOKEN_SLOT_END-CURRENCYTOKEN_SLOT_START];
memset(inv_slot_items,0,sizeof(int)*(INVENTORY_SLOT_ITEM_END-INVENTORY_SLOT_ITEM_START));
memset(inv_bags,0,sizeof(int)*(INVENTORY_SLOT_BAG_END-INVENTORY_SLOT_BAG_START)*MAX_BAG_SIZE);
memset(inv_keys,0,sizeof(int)*(KEYRING_SLOT_END-KEYRING_SLOT_START));
+ memset(inv_tokens,0,sizeof(int)*(CURRENCYTOKEN_SLOT_END-CURRENCYTOKEN_SLOT_START));
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
{
@@ -9493,6 +9452,16 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
}
}
+ for(int i = CURRENCYTOKEN_SLOT_START; i < CURRENCYTOKEN_SLOT_END; i++)
+ {
+ pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
+
+ if (pItem2 && !pItem2->IsInTrade())
+ {
+ inv_tokens[i-CURRENCYTOKEN_SLOT_START] = pItem2->GetCount();
+ }
+ }
+
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
{
if(Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
@@ -9536,14 +9505,14 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
return res;
// search stack for merge to
- if( pProto->Stackable > 1 )
+ if( pProto->Stackable != 1 )
{
bool b_found = false;
for(int t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; t++)
{
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
- if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->Stackable )
+ if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
{
inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount();
b_found = true;
@@ -9552,10 +9521,22 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
}
if (b_found) continue;
+ for(int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; t++)
+ {
+ pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
+ if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
+ {
+ inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount();
+ b_found = true;
+ break;
+ }
+ }
+ if (b_found) continue;
+
for(int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; t++)
{
pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, t );
- if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->Stackable )
+ if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_slot_items[t-INVENTORY_SLOT_ITEM_START] + pItem->GetCount() <= pProto->GetMaxStackSize())
{
inv_slot_items[t-INVENTORY_SLOT_ITEM_START] += pItem->GetCount();
b_found = true;
@@ -9567,12 +9548,12 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++)
{
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
- if( pBag )
+ if( pBag && ItemCanGoIntoBag(pItem->GetProto(), pBag->GetProto()))
{
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
{
pItem2 = GetItemByPos( t, j );
- if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->Stackable )
+ if( pItem2 && pItem2->GetEntry() == pItem->GetEntry() && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize())
{
inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount();
b_found = true;
@@ -9604,6 +9585,21 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
if (b_found) continue;
+ if(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
+ {
+ for(uint32 t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t)
+ {
+ if( inv_tokens[t-CURRENCYTOKEN_SLOT_START] == 0 )
+ {
+ inv_tokens[t-CURRENCYTOKEN_SLOT_START] = 1;
+ b_found = true;
+ break;
+ }
+ }
+ }
+
+ if (b_found) continue;
+
for(int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; t++)
{
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
@@ -9699,11 +9695,6 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
ItemPrototype const *pProto = pItem->GetProto();
if( pProto )
{
- // May be here should be more stronger checks; STUNNED checked
- // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked.
- if (not_loading && hasUnitState(UNIT_STAT_STUNNED))
- return EQUIP_ERR_YOU_ARE_STUNNED;
-
if(pItem->IsBindedNotWith(GetGUID()))
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
@@ -9712,24 +9703,33 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
if(res != EQUIP_ERR_OK)
return res;
- // do not allow equipping gear except weapons, offhands, projectiles, relics in
- // - combat
- // - in-progress arenas
- if( !pProto->CanChangeEquipStateInCombat() )
+ // check this only in game
+ if(not_loading)
{
- if( isInCombat() )
- return EQUIP_ERR_NOT_IN_COMBAT;
+ // May be here should be more stronger checks; STUNNED checked
+ // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked.
+ if (hasUnitState(UNIT_STAT_STUNNED))
+ return EQUIP_ERR_YOU_ARE_STUNNED;
+
+ // do not allow equipping gear except weapons, offhands, projectiles, relics in
+ // - combat
+ // - in-progress arenas
+ if( !pProto->CanChangeEquipStateInCombat() )
+ {
+ if( isInCombat() )
+ return EQUIP_ERR_NOT_IN_COMBAT;
- if(BattleGround* bg = GetBattleGround())
- if( bg->isArena() && bg->GetStatus() == STATUS_IN_PROGRESS )
- return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
- }
+ if(BattleGround* bg = GetBattleGround())
+ if( bg->isArena() && bg->GetStatus() == STATUS_IN_PROGRESS )
+ return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
+ }
- if(isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0)
- return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
+ if(isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0)
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
- if(IsNonMeleeSpellCasted(false))
- return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ if(IsNonMeleeSpellCasted(false))
+ return EQUIP_ERR_CANT_DO_RIGHT_NOW;
+ }
uint8 eslot = FindEquipSlot( pProto, slot, swap );
if( eslot == NULL_SLOT )
@@ -9741,33 +9741,9 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
if( !swap && GetItemByPos( INVENTORY_SLOT_BAG_0, eslot ) )
return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE;
- // check unique-equipped on item
- if (pProto->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED)
- {
- // there is an equip limit on this item
- Item* tItem = GetItemOrItemWithGemEquipped(pProto->ItemId);
- if (tItem && (!swap || tItem->GetSlot() != eslot ) )
- return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
- }
-
- // check unique-equipped on gems
- for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
- {
- uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot));
- if(!enchant_id)
- continue;
- SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
- if(!enchantEntry)
- continue;
-
- ItemPrototype const* pGem = objmgr.GetItemPrototype(enchantEntry->GemID);
- if(pGem && (pGem->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED))
- {
- Item* tItem = GetItemOrItemWithGemEquipped(enchantEntry->GemID);
- if(tItem && (!swap || tItem->GetSlot() != eslot ))
- return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
- }
- }
+ // if swap ignore item (equipped also)
+ if(uint8 res = CanEquipUniqueItem(pItem, swap ? eslot : NULL_SLOT))
+ return res;
// check unique-equipped special item classes
if (pProto->Class == ITEM_CLASS_QUIVER)
@@ -9794,33 +9770,42 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
if(eslot == EQUIPMENT_SLOT_OFFHAND)
{
- if( type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND )
+ if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
{
if(!CanDualWield())
return EQUIP_ERR_CANT_DUAL_WIELD;
}
-
- Item *mainItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
- if(mainItem)
+ else if (type == INVTYPE_2HWEAPON)
{
- if(mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON)
- return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED;
+ if(!CanDualWield() || !CanTitanGrip())
+ return EQUIP_ERR_CANT_DUAL_WIELD;
}
+
+ if(IsTwoHandUsed())
+ return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED;
}
// equip two-hand weapon case (with possible unequip 2 items)
if( type == INVTYPE_2HWEAPON )
{
- if(eslot != EQUIPMENT_SLOT_MAINHAND)
+ if (eslot == EQUIPMENT_SLOT_OFFHAND)
+ {
+ if (!CanTitanGrip())
+ return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
+ }
+ else if (eslot != EQUIPMENT_SLOT_MAINHAND)
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
- // offhand item must can be stored in inventory for offhand item and it also must be unequipped
- Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
- ItemPosCountVec off_dest;
- if( offItem && (!not_loading ||
- CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND,false) != EQUIP_ERR_OK ||
- CanStoreItem( NULL_BAG, NULL_SLOT, off_dest, offItem, false ) != EQUIP_ERR_OK ) )
- return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL;
+ if (!CanTitanGrip())
+ {
+ // offhand item must can be stored in inventory for offhand item and it also must be unequipped
+ Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
+ ItemPosCountVec off_dest;
+ if( offItem && (!not_loading ||
+ CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND,false) != EQUIP_ERR_OK ||
+ CanStoreItem( NULL_BAG, NULL_SLOT, off_dest, offItem, false ) != EQUIP_ERR_OK ) )
+ return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL;
+ }
}
dest = ((INVENTORY_SLOT_BAG_0 << 8) | eslot);
return EQUIP_ERR_OK;
@@ -9892,29 +9877,17 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
// in specific slot
if( bag != NULL_BAG && slot != NULL_SLOT )
{
- if( pProto->InventoryType == INVTYPE_BAG )
- {
- Bag *pBag = (Bag*)pItem;
- if( pBag )
- {
- if( slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END )
- {
- if( !HasBankBagSlot( slot ) )
- return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT;
- if( uint8 cantuse = CanUseItem( pItem, not_loading ) != EQUIP_ERR_OK )
- return cantuse;
- }
- else
- {
- if( !pBag->IsEmpty() )
- return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG;
- }
- }
- }
- else
+ if( slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END )
{
- if( slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END )
+ if (!pItem->IsBag())
return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT;
+
+ Bag *pBag = (Bag*)pItem;
+ if( !HasBankBagSlot( slot ) )
+ return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT;
+
+ if( uint8 cantuse = CanUseItem( pItem, not_loading ) != EQUIP_ERR_OK )
+ return cantuse;
}
res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem);
@@ -9938,7 +9911,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
}
// search stack in bag for merge to
- if( pProto->Stackable > 1 )
+ if( pProto->Stackable != 1 )
{
if( bag == INVENTORY_SLOT_BAG_0 )
{
@@ -9990,7 +9963,7 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p
// not specific bag or have space for partly store only in specific bag
// search stack for merge to
- if( pProto->Stackable > 1 )
+ if( pProto->Stackable != 1 )
{
// in slots
res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot);
@@ -10146,7 +10119,7 @@ uint8 Player::CanUseAmmo( uint32 item ) const
}
if( pProto->RequiredSpell != 0 && !HasSpell( pProto->RequiredSpell ) )
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
- /*if( GetReputation() < pProto->RequiredReputation )
+ /*if( GetReputationMgr().GetReputation() < pProto->RequiredReputation )
return EQUIP_ERR_CANT_EQUIP_REPUTATION;
*/
if( getLevel() < pProto->RequiredLevel )
@@ -10220,7 +10193,7 @@ Item* Player::StoreItem( ItemPosCountVec const& dest, Item* pItem, bool update )
return NULL;
Item* lastItem = pItem;
-
+ uint32 entry = pItem->GetEntry();
for(ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); )
{
uint16 pos = itr->pos;
@@ -10236,7 +10209,7 @@ Item* Player::StoreItem( ItemPosCountVec const& dest, Item* pItem, bool update )
lastItem = _StoreItem(pos,pItem,count,true,update);
}
-
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry);
return lastItem;
}
@@ -10278,6 +10251,10 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo
pItem->SetSlot( slot );
pItem->SetContainer( NULL );
+ // need update known currency
+ if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)
+ UpdateKnownCurrencies(pItem->GetEntry(),true);
+
if( IsInWorld() && update )
{
pItem->AddToWorld();
@@ -10446,6 +10423,8 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
}
}
+ // only for full equip instead adding to stack
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
return pItem;
}
@@ -10560,23 +10539,32 @@ 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);
- // remove held enchantments
- if ( slot == EQUIPMENT_SLOT_MAINHAND )
- {
- if (pItem->GetItemSuffixFactor())
+ // remove held enchantments, update expertise
+ if ( slot == EQUIPMENT_SLOT_MAINHAND )
{
- pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3);
- pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4);
- }
- else
- {
- pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0);
- pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1);
+ if (pItem->GetItemSuffixFactor())
+ {
+ pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_3);
+ pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_4);
+ }
+ else
+ {
+ pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_0);
+ pItem->ClearEnchantment(PROP_ENCHANTMENT_SLOT_1);
+ }
+
+ UpdateExpertise(BASE_ATTACK);
}
+ else if( slot == EQUIPMENT_SLOT_OFFHAND )
+ UpdateExpertise(OFF_ATTACK);
}
}
+ // need update known currency
+ else if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)
+ UpdateKnownCurrencies(pItem->GetEntry(),false);
m_items[slot] = NULL;
SetUInt64Value((uint16)(PLAYER_FIELD_INV_SLOT_HEAD + (slot*2)), 0);
@@ -10595,11 +10583,6 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
pItem->SetSlot( NULL_SLOT );
if( IsInWorld() && update )
pItem->SendUpdateToPlayer( this );
-
- if( slot == EQUIPMENT_SLOT_MAINHAND )
- UpdateExpertise(BASE_ATTACK);
- else if( slot == EQUIPMENT_SLOT_OFFHAND )
- UpdateExpertise(OFF_ATTACK);
}
}
@@ -10684,9 +10667,18 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
// remove item dependent auras and casts (only weapon and armor slots)
RemoveItemDependentAurasAndCasts(pItem);
+ // update expertise
+ if ( slot == EQUIPMENT_SLOT_MAINHAND )
+ UpdateExpertise(BASE_ATTACK);
+ else if( slot == EQUIPMENT_SLOT_OFFHAND )
+ UpdateExpertise(OFF_ATTACK);
+
// equipment visual show
SetVisibleItemSlot(slot,NULL);
}
+ // need update known currency
+ else if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)
+ UpdateKnownCurrencies(pItem->GetEntry(),false);
m_items[slot] = NULL;
}
@@ -10709,60 +10701,61 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool unequip_check)
{
sLog.outDebug( "STORAGE: DestroyItemCount item = %u, count = %u", item, count);
- Item *pItem;
- ItemPrototype const *pProto;
uint32 remcount = 0;
// in inventory
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetEntry() == item )
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
{
- if( pItem->GetCount() + remcount <= count )
+ if (pItem->GetEntry() == item)
{
- // all items in inventory can unequipped
- remcount += pItem->GetCount();
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
+ if (pItem->GetCount() + remcount <= count)
+ {
+ // all items in inventory can unequipped
+ remcount += pItem->GetCount();
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- if(remcount >=count)
+ if (remcount >=count)
+ return;
+ }
+ else
+ {
+ ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
+ pItem->SetCount( pItem->GetCount() - count + remcount );
+ if (IsInWorld() & update)
+ pItem->SendUpdateToPlayer( this );
+ pItem->SetState(ITEM_CHANGED, this);
return;
- }
- else
- {
- pProto = pItem->GetProto();
- ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
- pItem->SetCount( pItem->GetCount() - count + remcount );
- if( IsInWorld() & update )
- pItem->SendUpdateToPlayer( this );
- pItem->SetState(ITEM_CHANGED, this);
- return;
+ }
}
}
}
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
+
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetEntry() == item )
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
{
- if( pItem->GetCount() + remcount <= count )
+ if (pItem->GetEntry() == item)
{
- // all keys can be unequipped
- remcount += pItem->GetCount();
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
+ if (pItem->GetCount() + remcount <= count)
+ {
+ // all keys can be unequipped
+ remcount += pItem->GetCount();
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- if(remcount >=count)
+ if (remcount >=count)
+ return;
+ }
+ else
+ {
+ ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
+ pItem->SetCount( pItem->GetCount() - count + remcount );
+ if (IsInWorld() & update)
+ pItem->SendUpdateToPlayer( this );
+ pItem->SetState(ITEM_CHANGED, this);
return;
- }
- else
- {
- pProto = pItem->GetProto();
- ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
- pItem->SetCount( pItem->GetCount() - count + remcount );
- if( IsInWorld() & update )
- pItem->SendUpdateToPlayer( this );
- pItem->SetState(ITEM_CHANGED, this);
- return;
+ }
}
}
}
@@ -10774,27 +10767,28 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
{
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
{
- pItem = pBag->GetItemByPos(j);
- if( pItem && pItem->GetEntry() == item )
+ if(Item* pItem = pBag->GetItemByPos(j))
{
- // all items in bags can be unequipped
- if( pItem->GetCount() + remcount <= count )
+ if (pItem->GetEntry() == item)
{
- remcount += pItem->GetCount();
- DestroyItem( i, j, update );
+ // all items in bags can be unequipped
+ if (pItem->GetCount() + remcount <= count)
+ {
+ remcount += pItem->GetCount();
+ DestroyItem( i, j, update );
- if(remcount >=count)
+ if (remcount >=count)
+ return;
+ }
+ else
+ {
+ ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
+ pItem->SetCount( pItem->GetCount() - count + remcount );
+ if (IsInWorld() && update)
+ pItem->SendUpdateToPlayer( this );
+ pItem->SetState(ITEM_CHANGED, this);
return;
- }
- else
- {
- pProto = pItem->GetProto();
- ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
- pItem->SetCount( pItem->GetCount() - count + remcount );
- if( IsInWorld() && update )
- pItem->SendUpdateToPlayer( this );
- pItem->SetState(ITEM_CHANGED, this);
- return;
+ }
}
}
}
@@ -10804,29 +10798,30 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
// in equipment and bag list
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
{
- pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetEntry() == item )
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
{
- if( pItem->GetCount() + remcount <= count )
+ if (pItem && pItem->GetEntry() == item)
{
- if(!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i,false) == EQUIP_ERR_OK )
+ if (pItem->GetCount() + remcount <= count)
{
- remcount += pItem->GetCount();
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
+ if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i,false) == EQUIP_ERR_OK )
+ {
+ remcount += pItem->GetCount();
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- if(remcount >=count)
- return;
+ if (remcount >=count)
+ return;
+ }
+ }
+ else
+ {
+ ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
+ pItem->SetCount( pItem->GetCount() - count + remcount );
+ if (IsInWorld() & update)
+ pItem->SendUpdateToPlayer( this );
+ pItem->SetState(ITEM_CHANGED, this);
+ return;
}
- }
- else
- {
- pProto = pItem->GetProto();
- ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
- pItem->SetCount( pItem->GetCount() - count + remcount );
- if( IsInWorld() & update )
- pItem->SendUpdateToPlayer( this );
- pItem->SetState(ITEM_CHANGED, this);
- return;
}
}
}
@@ -10838,40 +10833,28 @@ void Player::DestroyZoneLimitedItem( bool update, uint32 new_zone )
// in inventory
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- }
- for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- }
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
+
+ for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
// in inventory bags
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
- {
- Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pBag )
- {
+ if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
- {
- Item* pItem = pBag->GetItemByPos(j);
- if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
- DestroyItem( i, j, update);
- }
- }
- }
+ if (Item* pItem = pBag->GetItemByPos(j))
+ if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
+ DestroyItem( i, j, update);
// in equipment and bag list
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- }
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
}
void Player::DestroyConjuredItems( bool update )
@@ -10882,40 +10865,23 @@ void Player::DestroyConjuredItems( bool update )
// in inventory
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetProto() &&
- (pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
- (pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- }
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if (pItem->IsConjuredConsumable())
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
// in inventory bags
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
- {
- Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pBag )
- {
+ if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
- {
- Item* pItem = pBag->GetItemByPos(j);
- if( pItem && pItem->GetProto() &&
- (pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
- (pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
- DestroyItem( i, j, update);
- }
- }
- }
+ if (Item* pItem = pBag->GetItemByPos(j))
+ if (pItem->IsConjuredConsumable())
+ DestroyItem( i, j, update);
// in equipment and bag list
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
- {
- Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
- if( pItem && pItem->GetProto() &&
- (pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
- (pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
- DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
- }
+ if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if (pItem->IsConjuredConsumable())
+ DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
}
void Player::DestroyItemCount( Item* pItem, uint32 &count, bool update )
@@ -11071,6 +11037,8 @@ void Player::SwapItem( uint16 src, uint16 dst )
return;
}
+ // SRC checks
+
if(pSrcItem->m_lootGenerated) // prevent swap looting item
{
//best error message found for attempting to swap while looting
@@ -11081,8 +11049,8 @@ void Player::SwapItem( uint16 src, uint16 dst )
// check unequip potability for equipped items and bank bags
if(IsEquipmentPos ( src ) || IsBagPos ( src ))
{
- // bags can be swapped with empty bag slots
- uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ));
+ // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
+ uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty());
if(msg != EQUIP_ERR_OK)
{
SendEquipError( msg, pSrcItem, pDstItem );
@@ -11097,6 +11065,34 @@ void Player::SwapItem( uint16 src, uint16 dst )
return;
}
+ // DST checks
+
+ if (pDstItem)
+ {
+ if(pDstItem->m_lootGenerated) // prevent swap looting item
+ {
+ //best error message found for attempting to swap while looting
+ SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL );
+ return;
+ }
+
+ // check unequip potability for equipped items and bank bags
+ if(IsEquipmentPos ( dst ) || IsBagPos ( dst ))
+ {
+ // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later)
+ uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) || pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty());
+ if(msg != EQUIP_ERR_OK)
+ {
+ SendEquipError( msg, pSrcItem, pDstItem );
+ return;
+ }
+ }
+ }
+
+ // NOW this is or item move (swap with empty), or swap with another item (including bags in bag possitions)
+ // or swap empty bag with another empty or not empty bag (with items exchange)
+
+ // Move case
if( !pDstItem )
{
if( IsInventoryPos( dst ) )
@@ -11139,140 +11135,187 @@ void Player::SwapItem( uint16 src, uint16 dst )
EquipItem( dest, pSrcItem, true);
AutoUnequipOffhandIfNeed();
}
+
+ return;
}
- else // if (!pDstItem)
+
+ // attempt merge to / fill target item
+ if(!pSrcItem->IsBag() && !pDstItem->IsBag())
{
- if(pDstItem->m_lootGenerated) // prevent swap looting item
- {
- //best error message found for attempting to swap while looting
- SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL );
+ uint8 msg;
+ ItemPosCountVec sDest;
+ uint16 eDest;
+ if( IsInventoryPos( dst ) )
+ msg = CanStoreItem( dstbag, dstslot, sDest, pSrcItem, false );
+ else if( IsBankPos ( dst ) )
+ msg = CanBankItem( dstbag, dstslot, sDest, pSrcItem, false );
+ else if( IsEquipmentPos ( dst ) )
+ msg = CanEquipItem( dstslot, eDest, pSrcItem, false );
+ else
return;
- }
- // check unequip potability for equipped items and bank bags
- if(IsEquipmentPos ( dst ) || IsBagPos ( dst ))
+ // can be merge/fill
+ if(msg == EQUIP_ERR_OK)
{
- // bags can be swapped with empty bag slots
- uint8 msg = CanUnequipItem( dst, !IsBagPos ( dst ) || IsBagPos ( src ) );
- if(msg != EQUIP_ERR_OK)
+ if( pSrcItem->GetCount() + pDstItem->GetCount() <= pSrcItem->GetProto()->GetMaxStackSize())
{
- SendEquipError( msg, pSrcItem, pDstItem );
- return;
- }
- }
+ RemoveItem(srcbag, srcslot, true);
- // attempt merge to / fill target item
- {
- uint8 msg;
- ItemPosCountVec sDest;
- uint16 eDest;
- if( IsInventoryPos( dst ) )
- msg = CanStoreItem( dstbag, dstslot, sDest, pSrcItem, false );
- else if( IsBankPos ( dst ) )
- msg = CanBankItem( dstbag, dstslot, sDest, pSrcItem, false );
- else if( IsEquipmentPos ( dst ) )
- msg = CanEquipItem( dstslot, eDest, pSrcItem, false );
- else
- return;
-
- // can be merge/fill
- if(msg == EQUIP_ERR_OK)
- {
- if( pSrcItem->GetCount() + pDstItem->GetCount() <= pSrcItem->GetProto()->Stackable )
+ if( IsInventoryPos( dst ) )
+ StoreItem( sDest, pSrcItem, true);
+ else if( IsBankPos ( dst ) )
+ BankItem( sDest, pSrcItem, true);
+ else if( IsEquipmentPos ( dst ) )
{
- RemoveItem(srcbag, srcslot, true);
-
- if( IsInventoryPos( dst ) )
- StoreItem( sDest, pSrcItem, true);
- else if( IsBankPos ( dst ) )
- BankItem( sDest, pSrcItem, true);
- else if( IsEquipmentPos ( dst ) )
- {
- EquipItem( eDest, pSrcItem, true);
- AutoUnequipOffhandIfNeed();
- }
+ EquipItem( eDest, pSrcItem, true);
+ AutoUnequipOffhandIfNeed();
}
- else
+ }
+ else
+ {
+ pSrcItem->SetCount( pSrcItem->GetCount() + pDstItem->GetCount() - pSrcItem->GetProto()->GetMaxStackSize());
+ pDstItem->SetCount( pSrcItem->GetProto()->GetMaxStackSize());
+ pSrcItem->SetState(ITEM_CHANGED, this);
+ pDstItem->SetState(ITEM_CHANGED, this);
+ if( IsInWorld() )
{
- pSrcItem->SetCount( pSrcItem->GetCount() + pDstItem->GetCount() - pSrcItem->GetProto()->Stackable );
- pDstItem->SetCount( pSrcItem->GetProto()->Stackable );
- pSrcItem->SetState(ITEM_CHANGED, this);
- pDstItem->SetState(ITEM_CHANGED, this);
- if( IsInWorld() )
- {
- pSrcItem->SendUpdateToPlayer( this );
- pDstItem->SendUpdateToPlayer( this );
- }
+ pSrcItem->SendUpdateToPlayer( this );
+ pDstItem->SendUpdateToPlayer( this );
}
- return;
}
+ return;
}
+ }
- // impossible merge/fill, do real swap
- uint8 msg;
+ // impossible merge/fill, do real swap
+ uint8 msg;
- // check src->dest move possibility
- ItemPosCountVec sDest;
- uint16 eDest;
- if( IsInventoryPos( dst ) )
- msg = CanStoreItem( dstbag, dstslot, sDest, pSrcItem, true );
- else if( IsBankPos( dst ) )
- msg = CanBankItem( dstbag, dstslot, sDest, pSrcItem, true );
- else if( IsEquipmentPos( dst ) )
- {
- msg = CanEquipItem( dstslot, eDest, pSrcItem, true );
- if( msg == EQUIP_ERR_OK )
- msg = CanUnequipItem( eDest, true );
- }
+ // check src->dest move possibility
+ ItemPosCountVec sDest;
+ uint16 eDest;
+ if( IsInventoryPos( dst ) )
+ msg = CanStoreItem( dstbag, dstslot, sDest, pSrcItem, true );
+ else if( IsBankPos( dst ) )
+ msg = CanBankItem( dstbag, dstslot, sDest, pSrcItem, true );
+ else if( IsEquipmentPos( dst ) )
+ {
+ msg = CanEquipItem( dstslot, eDest, pSrcItem, true );
+ if( msg == EQUIP_ERR_OK )
+ msg = CanUnequipItem( eDest, true );
+ }
- if( msg != EQUIP_ERR_OK )
+ if( msg != EQUIP_ERR_OK )
+ {
+ SendEquipError( msg, pSrcItem, pDstItem );
+ return;
+ }
+
+ // check dest->src move possibility
+ ItemPosCountVec sDest2;
+ uint16 eDest2;
+ if( IsInventoryPos( src ) )
+ msg = CanStoreItem( srcbag, srcslot, sDest2, pDstItem, true );
+ else if( IsBankPos( src ) )
+ msg = CanBankItem( srcbag, srcslot, sDest2, pDstItem, true );
+ else if( IsEquipmentPos( src ) )
+ {
+ msg = CanEquipItem( srcslot, eDest2, pDstItem, true);
+ if( msg == EQUIP_ERR_OK )
+ msg = CanUnequipItem( eDest2, true);
+ }
+
+ if( msg != EQUIP_ERR_OK )
+ {
+ SendEquipError( msg, pDstItem, pSrcItem );
+ return;
+ }
+
+ // Check bag swap with item exchange (one from empty in not bag possition (equipped (not possible in fact) or store)
+ if(pSrcItem->IsBag() && pDstItem->IsBag())
+ {
+ Bag* emptyBag = NULL;
+ Bag* fullBag = NULL;
+ if(((Bag*)pSrcItem)->IsEmpty() && !IsBagPos(src))
{
- SendEquipError( msg, pSrcItem, pDstItem );
- return;
+ emptyBag = (Bag*)pSrcItem;
+ fullBag = (Bag*)pDstItem;
}
-
- // check dest->src move possibility
- ItemPosCountVec sDest2;
- uint16 eDest2;
- if( IsInventoryPos( src ) )
- msg = CanStoreItem( srcbag, srcslot, sDest2, pDstItem, true );
- else if( IsBankPos( src ) )
- msg = CanBankItem( srcbag, srcslot, sDest2, pDstItem, true );
- else if( IsEquipmentPos( src ) )
+ else if(((Bag*)pDstItem)->IsEmpty() && !IsBagPos(dst))
{
- msg = CanEquipItem( srcslot, eDest2, pDstItem, true);
- if( msg == EQUIP_ERR_OK )
- msg = CanUnequipItem( eDest2, true);
+ emptyBag = (Bag*)pDstItem;
+ fullBag = (Bag*)pSrcItem;
}
- if( msg != EQUIP_ERR_OK )
+ // bag swap (with items exchange) case
+ if(emptyBag && fullBag)
{
- SendEquipError( msg, pDstItem, pSrcItem );
- return;
- }
+ ItemPrototype const* emotyProto = emptyBag->GetProto();
- // now do moves, remove...
- RemoveItem(dstbag, dstslot, false);
- RemoveItem(srcbag, srcslot, false);
+ uint32 count = 0;
- // add to dest
- if( IsInventoryPos( dst ) )
- StoreItem(sDest, pSrcItem, true);
- else if( IsBankPos( dst ) )
- BankItem(sDest, pSrcItem, true);
- else if( IsEquipmentPos( dst ) )
- EquipItem(eDest, pSrcItem, true);
-
- // add to src
- if( IsInventoryPos( src ) )
- StoreItem(sDest2, pDstItem, true);
- else if( IsBankPos( src ) )
- BankItem(sDest2, pDstItem, true);
- else if( IsEquipmentPos( src ) )
- EquipItem(eDest2, pDstItem, true);
+ for(int i=0; i < fullBag->GetBagSize(); ++i)
+ {
+ Item *bagItem = fullBag->GetItemByPos(i);
+ if (!bagItem)
+ continue;
- AutoUnequipOffhandIfNeed();
+ ItemPrototype const* bagItemProto = bagItem->GetProto();
+ if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emotyProto))
+ {
+ // one from items not go to empry target bag
+ SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem );
+ return;
+ }
+
+ ++count;
+ }
+
+
+ if (count > emptyBag->GetBagSize())
+ {
+ // too small targeted bag
+ SendEquipError( EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem );
+ return;
+ }
+
+ // Items swap
+ count = 0; // will pos in new bag
+ for(int i=0; i< fullBag->GetBagSize(); ++i)
+ {
+ Item *bagItem = fullBag->GetItemByPos(i);
+ if (!bagItem)
+ continue;
+
+ fullBag->RemoveItem(i, true);
+ emptyBag->StoreItem(count, bagItem, true);
+ bagItem->SetState(ITEM_CHANGED, this);
+
+ ++count;
+ }
+ }
}
+
+ // now do moves, remove...
+ RemoveItem(dstbag, dstslot, false);
+ RemoveItem(srcbag, srcslot, false);
+
+ // add to dest
+ if( IsInventoryPos( dst ) )
+ StoreItem(sDest, pSrcItem, true);
+ else if( IsBankPos( dst ) )
+ BankItem(sDest, pSrcItem, true);
+ else if( IsEquipmentPos( dst ) )
+ EquipItem(eDest, pSrcItem, true);
+
+ // add to src
+ if( IsInventoryPos( src ) )
+ StoreItem(sDest2, pDstItem, true);
+ else if( IsBankPos( src ) )
+ BankItem(sDest2, pDstItem, true);
+ else if( IsEquipmentPos( src ) )
+ EquipItem(eDest2, pDstItem, true);
+
+ AutoUnequipOffhandIfNeed();
}
void Player::AddItemToBuyBackSlot( Item *pItem )
@@ -11840,6 +11883,40 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
((Player*)this)->ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply);
sLog.outDebug("+ %u EXPERTISE", enchant_amount);
break;
+ case ITEM_MOD_ATTACK_POWER:
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply);
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
+ sLog.outDebug("+ %u ATTACK_POWER", enchant_amount);
+ break;
+ case ITEM_MOD_RANGED_ATTACK_POWER:
+ HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
+ sLog.outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount);
+ break;
+ case ITEM_MOD_FERAL_ATTACK_POWER:
+ ((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
+ sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
+ break;
+ case ITEM_MOD_SPELL_HEALING_DONE:
+ ((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
+ sLog.outDebug("+ %u SPELL_HEALING_DONE", enchant_amount);
+ break;
+ case ITEM_MOD_SPELL_DAMAGE_DONE:
+ ((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
+ sLog.outDebug("+ %u SPELL_DAMAGE_DONE", enchant_amount);
+ break;
+ case ITEM_MOD_MANA_REGENERATION:
+ ((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
+ sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
+ break;
+ case ITEM_MOD_ARMOR_PENETRATION_RATING:
+ ((Player*)this)->ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply);
+ sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
+ break;
+ case ITEM_MOD_SPELL_POWER:
+ ((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
+ ((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
+ sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
+ break;
default:
break;
}
@@ -11863,8 +11940,14 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
}
break;
}
+ case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
+ // processed in Player::CastItemUseSpell
+ break;
+ case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
+ // nothing do..
+ break;
default:
- sLog.outError("Unknown item enchantment display type: %d",enchant_display_type);
+ sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
break;
} /*switch(enchant_display_type)*/
} /*for*/
@@ -11930,7 +12013,7 @@ void Player::SendNewItem(Item *item, uint32 count, bool received, bool created,
data << GetItemCount(item->GetEntry()); // count of items in inventory
if (broadcast && GetGroup())
- GetGroup()->BroadcastPacket(&data);
+ GetGroup()->BroadcastPacket(&data, true);
else
GetSession()->SendPacket(&data);
}
@@ -12034,7 +12117,7 @@ void Player::SendPreparedQuest( uint64 guid )
if( pCreature )
{
uint32 textid = pCreature->GetNpcTextId();
- GossipText * gossiptext = objmgr.GetGossipText(textid);
+ GossipText const* gossiptext = objmgr.GetGossipText(textid);
if( !gossiptext )
{
qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote
@@ -12225,7 +12308,7 @@ bool Player::CanCompleteQuest( uint32 quest_id )
}
uint32 repFacId = qInfo->GetRepObjectiveFaction();
- if ( repFacId && GetReputation(repFacId) < qInfo->GetRepObjectiveValue() )
+ if ( repFacId && GetReputationMgr().GetReputation(repFacId) < qInfo->GetRepObjectiveValue() )
return false;
return true;
@@ -12338,8 +12421,6 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
// if not exist then created with set uState==NEW and rewarded=false
QuestStatusData& questStatusData = mQuestStatus[quest_id];
- if (questStatusData.uState != QUEST_NEW)
- questStatusData.uState = QUEST_CHANGED;
// check for repeatable quests status reset
questStatusData.m_status = QUEST_STATUS_INCOMPLETE;
@@ -12347,21 +12428,22 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
{
- for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
+ for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
questStatusData.m_itemcount[i] = 0;
}
if ( pQuest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO) )
{
- for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
+ for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
questStatusData.m_creatureOrGOcount[i] = 0;
}
GiveQuestSourceItem( pQuest );
- AdjustQuestReqItemCount( pQuest );
+ AdjustQuestReqItemCount( pQuest, questStatusData );
if( pQuest->GetRepObjectiveFaction() )
- SetFactionVisibleForFactionId(pQuest->GetRepObjectiveFaction());
+ if(FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->GetRepObjectiveFaction()))
+ GetReputationMgr().SetVisible(factionEntry);
uint32 qtime = 0;
if( pQuest->HasFlag( QUEST_TRINITY_FLAGS_TIMED ) )
@@ -12370,10 +12452,10 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
// shared timed quest
if(questGiver && questGiver->GetTypeId()==TYPEID_PLAYER)
- limittime = ((Player*)questGiver)->getQuestStatusMap()[quest_id].m_timer / 1000;
+ limittime = ((Player*)questGiver)->getQuestStatusMap()[quest_id].m_timer / IN_MILISECONDS;
AddTimedQuest( quest_id );
- questStatusData.m_timer = limittime * 1000;
+ questStatusData.m_timer = limittime * IN_MILISECONDS;
qtime = static_cast<uint32>(time(NULL)) + limittime;
}
else
@@ -12381,10 +12463,26 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
SetQuestSlot(log_slot, quest_id, qtime);
+ if (questStatusData.uState != QUEST_NEW)
+ questStatusData.uState = QUEST_CHANGED;
+
//starting initial quest script
if(questGiver && pQuest->GetQuestStartScript()!=0)
sWorld.ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this);
+ // Some spells applied at quest activation
+ SpellAreaForQuestMapBounds saBounds = spellmgr.GetSpellAreaForQuestMapBounds(quest_id,true);
+ if(saBounds.first != saBounds.second)
+ {
+ uint32 zone, area;
+ GetZoneAndAreaId(zone,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);
+ }
+
UpdateForQuestsGO();
}
@@ -12482,10 +12580,20 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
if ( getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) )
GiveXP( XP , NULL );
else
- ModifyMoney( int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY)) );
+ {
+ uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY));
+ ModifyMoney( money );
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money);
+ }
// Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative
- ModifyMoney( pQuest->GetRewOrReqMoney() );
+ if(pQuest->GetRewOrReqMoney())
+ {
+ ModifyMoney( pQuest->GetRewOrReqMoney() );
+
+ if(pQuest->GetRewOrReqMoney() > 0)
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, pQuest->GetRewOrReqMoney());
+ }
// honor reward
if(pQuest->GetRewHonorableKills())
@@ -12498,6 +12606,12 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
SetTitle(titleEntry);
}
+ if(pQuest->GetBonusTalents())
+ {
+ m_questRewardTalentCount+=pQuest->GetBonusTalents();
+ InitTalentForLevel();
+ }
+
// Send reward mail
if(pQuest->GetRewMailTemplateId())
{
@@ -12529,12 +12643,13 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
Loot questMailLoot;
- questMailLoot.FillLoot(pQuest->GetQuestId(), LootTemplates_QuestMail, this);
+ questMailLoot.FillLoot(pQuest->GetQuestId(), LootTemplates_QuestMail, this,true);
// fill mail
MailItemsInfo mi; // item list preparing
- for(size_t i = 0; mi.size() < MAX_MAIL_ITEMS && i < questMailLoot.items.size(); ++i)
+ uint32 max_slot = questMailLoot.GetMaxSlotInLootFor(this);
+ for(uint32 i = 0; mi.size() < MAX_MAIL_ITEMS && i < max_slot; ++i)
{
if(LootItem* lootitem = questMailLoot.LootItemInSlot(i,this))
{
@@ -12546,23 +12661,14 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
}
}
- for(size_t i = 0; mi.size() < MAX_MAIL_ITEMS && i < questMailLoot.quest_items.size(); ++i)
- {
- if(LootItem* lootitem = questMailLoot.LootItemInSlot(i+questMailLoot.items.size(),this))
- {
- if(Item* item = Item::CreateItem(lootitem->itemid,lootitem->count,this))
- {
- item->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted
- mi.AddItem(item->GetGUIDLow(), item->GetEntry(), item);
- }
- }
- }
-
WorldSession::SendMailTo(this, mailType, MAIL_STATIONERY_NORMAL, senderGuidOrEntry, GetGUIDLow(), "", 0, &mi, 0, 0, MAIL_CHECK_MASK_NONE,pQuest->GetRewMailDelaySecs(),pQuest->GetRewMailTemplateId());
}
if(pQuest->IsDaily())
+ {
SetDailyQuestStatus(quest_id);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, 1);
+ }
if ( !pQuest->IsRepeatable() )
SetQuestStatus(quest_id, QUEST_STATUS_COMPLETE);
@@ -12575,6 +12681,37 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
SendQuestReward( pQuest, XP, questGiver );
if (q_status.uState != QUEST_NEW) q_status.uState = QUEST_CHANGED;
+ if (pQuest->GetZoneOrSort() > 0)
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, pQuest->GetZoneOrSort());
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST);
+
+ uint32 zone = 0;
+ uint32 area = 0;
+
+ // remove auras from spells with quest reward state limitations
+ SpellAreaForQuestMapBounds saEndBounds = spellmgr.GetSpellAreaForQuestEndMapBounds(quest_id);
+ if(saEndBounds.first != saEndBounds.second)
+ {
+ GetZoneAndAreaId(zone,area);
+
+ for(SpellAreaForAreaMap::const_iterator itr = saEndBounds.first; itr != saEndBounds.second; ++itr)
+ if(!itr->second->IsFitToRequirements(this,zone,area))
+ RemoveAurasDueToSpell(itr->second->spellId);
+ }
+
+ // Some spells applied at quest reward
+ SpellAreaForQuestMapBounds saBounds = spellmgr.GetSpellAreaForQuestMapBounds(quest_id,false);
+ 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->autocast && itr->second->IsFitToRequirements(this,zone,area))
+ if( !HasAura(itr->second->spellId) )
+ CastSpell(this,itr->second->spellId,true);
+ }
}
void Player::FailQuest( uint32 quest_id )
@@ -12599,8 +12736,9 @@ void Player::FailTimedQuest( uint32 quest_id )
{
QuestStatusData& q_status = mQuestStatus[quest_id];
- if (q_status.uState != QUEST_NEW) q_status.uState = QUEST_CHANGED;
q_status.m_timer = 0;
+ if (q_status.uState != QUEST_NEW)
+ q_status.uState = QUEST_CHANGED;
IncompleteQuest( quest_id );
@@ -12800,7 +12938,7 @@ bool Player::SatisfyQuestRace( Quest const* qInfo, bool msg )
bool Player::SatisfyQuestReputation( Quest const* qInfo, bool msg )
{
uint32 fIdMin = qInfo->GetRequiredMinRepFaction(); //Min required rep
- if(fIdMin && GetReputation(fIdMin) < qInfo->GetRequiredMinRepValue())
+ if(fIdMin && GetReputationMgr().GetReputation(fIdMin) < qInfo->GetRequiredMinRepValue())
{
if( msg )
SendCanTakeQuestResponse( INVALIDREASON_DONT_HAVE_REQ );
@@ -12808,7 +12946,7 @@ bool Player::SatisfyQuestReputation( Quest const* qInfo, bool msg )
}
uint32 fIdMax = qInfo->GetRequiredMaxRepFaction(); //Max required rep
- if(fIdMax && GetReputation(fIdMax) >= qInfo->GetRequiredMaxRepValue())
+ if(fIdMax && GetReputationMgr().GetReputation(fIdMax) >= qInfo->GetRequiredMaxRepValue())
{
if( msg )
SendCanTakeQuestResponse( INVALIDREASON_DONT_HAVE_REQ );
@@ -13086,18 +13224,18 @@ uint32 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
if( !qInfo )
return 0;
- for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
+ for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
if ( qInfo->ReqCreatureOrGOId[j] == entry )
return mQuestStatus[quest_id].m_creatureOrGOcount[j];
return 0;
}
-void Player::AdjustQuestReqItemCount( Quest const* pQuest )
+void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& questStatusData )
{
if ( pQuest->HasFlag( QUEST_TRINITY_FLAGS_DELIVER ) )
{
- for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
+ for(int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
{
uint32 reqitemcount = pQuest->ReqItemCount[i];
if( reqitemcount != 0 )
@@ -13105,9 +13243,8 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest )
uint32 quest_id = pQuest->GetQuestId();
uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i],true);
- QuestStatusData& q_status = mQuestStatus[quest_id];
- q_status.m_itemcount[i] = std::min(curitemcount, reqitemcount);
- if (q_status.uState != QUEST_NEW) q_status.uState = QUEST_CHANGED;
+ questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount);
+ if (questStatusData.uState != QUEST_NEW) questStatusData.uState = QUEST_CHANGED;
}
}
}
@@ -13115,7 +13252,7 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest )
uint16 Player::FindQuestSlot( uint32 quest_id ) const
{
- for ( uint16 i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for ( uint16 i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
if ( GetQuestSlotQuestId(i) == quest_id )
return i;
@@ -13163,7 +13300,7 @@ void Player::GroupEventHappens( uint32 questId, WorldObject const* pEventObject
void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
{
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if ( questid == 0 )
@@ -13204,7 +13341,7 @@ void Player::ItemAddedQuestCheck( uint32 entry, uint32 count )
void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
{
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if(!questid)
@@ -13246,7 +13383,8 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
void Player::KilledMonster( uint32 entry, uint64 guid )
{
uint32 addkillcount = 1;
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if(!questid)
@@ -13301,7 +13439,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
bool isCreature = IS_CREATURE_GUID(guid);
uint32 addCastCount = 1;
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
{
uint32 questid = GetQuestSlotQuestId(i);
if(!questid)
@@ -13368,7 +13506,7 @@ void Player::CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id )
void Player::TalkedToCreature( uint32 entry, uint64 guid )
{
uint32 addTalkCount = 1;
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if(!questid)
@@ -13423,7 +13561,7 @@ void Player::TalkedToCreature( uint32 entry, uint64 guid )
void Player::MoneyChanged( uint32 count )
{
- for( int i = 0; i < MAX_QUEST_LOG_SIZE; i++ )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if (!questid)
@@ -13451,15 +13589,51 @@ void Player::MoneyChanged( uint32 count )
}
}
+void Player::ReputationChanged(FactionEntry const* factionEntry )
+{
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
+ {
+ if(uint32 questid = GetQuestSlotQuestId(i))
+ {
+ if(Quest const* qInfo = objmgr.GetQuestTemplate(questid))
+ {
+ if(qInfo->GetRepObjectiveFaction() == factionEntry->ID )
+ {
+ QuestStatusData& q_status = mQuestStatus[questid];
+ if( q_status.m_status == QUEST_STATUS_INCOMPLETE )
+ {
+ if(GetReputationMgr().GetReputation(factionEntry) >= qInfo->GetRepObjectiveValue())
+ if ( CanCompleteQuest( questid ) )
+ CompleteQuest( questid );
+ }
+ else if( q_status.m_status == QUEST_STATUS_COMPLETE )
+ {
+ if(GetReputationMgr().GetReputation(factionEntry) < qInfo->GetRepObjectiveValue())
+ IncompleteQuest( questid );
+ }
+ }
+ }
+ }
+ }
+}
+
bool Player::HasQuestForItem( uint32 itemid ) const
{
- for( QuestStatusMap::const_iterator i = mQuestStatus.begin( ); i != mQuestStatus.end( ); ++i )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
- QuestStatusData const& q_status = i->second;
+ uint32 questid = GetQuestSlotQuestId(i);
+ if ( questid == 0 )
+ continue;
+
+ QuestStatusMap::const_iterator qs_itr = mQuestStatus.find(questid);
+ if(qs_itr == mQuestStatus.end())
+ continue;
+
+ QuestStatusData const& q_status = qs_itr->second;
if (q_status.m_status == QUEST_STATUS_INCOMPLETE)
{
- Quest const* qinfo = objmgr.GetQuestTemplate(i->first);
+ Quest const* qinfo = objmgr.GetQuestTemplate(questid);
if(!qinfo)
continue;
@@ -13479,28 +13653,21 @@ bool Player::HasQuestForItem( uint32 itemid ) const
for (int j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; j++)
{
// examined item is a source item
- if (qinfo->ReqSourceId[j] == itemid && qinfo->ReqSourceRef[j] > 0 && qinfo->ReqSourceRef[j] <= QUEST_OBJECTIVES_COUNT)
+ if (qinfo->ReqSourceId[j] == itemid)
{
- uint32 idx = qinfo->ReqSourceRef[j]-1;
+ ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
- // total count of created ReqItems and SourceItems is less than ReqItemCount
- if(qinfo->ReqItemId[idx] != 0 &&
- q_status.m_itemcount[idx] * qinfo->ReqSourceCount[j] + GetItemCount(itemid,true) < qinfo->ReqItemCount[idx] * qinfo->ReqSourceCount[j])
+ // 'unique' item
+ if (pProto->MaxCount && GetItemCount(itemid,true) < pProto->MaxCount)
return true;
- // total count of casted ReqCreatureOrGOs and SourceItems is less than ReqCreatureOrGOCount
- if (qinfo->ReqCreatureOrGOId[idx] != 0)
+ // allows custom amount drop when not 0
+ if (qinfo->ReqSourceCount[j])
{
- if(q_status.m_creatureOrGOcount[idx] * qinfo->ReqSourceCount[j] + GetItemCount(itemid,true) < qinfo->ReqCreatureOrGOCount[idx] * qinfo->ReqSourceCount[j])
+ if (GetItemCount(itemid,true) < qinfo->ReqSourceCount[j])
return true;
- }
- // spell with SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT (with script) case
- else if(qinfo->ReqSpell[idx] != 0)
- {
- // not casted and need more reagents/item for use.
- if(!q_status.m_explored && GetItemCount(itemid,true) < qinfo->ReqSourceCount[j])
- return true;
- }
+ } else if (GetItemCount(itemid,true) < pProto->Stackable)
+ return true;
}
}
}
@@ -13524,13 +13691,12 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
uint32 questid = pQuest->GetQuestId();
sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid );
gameeventmgr.HandleQuestComplete(questid);
- WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4+4+pQuest->GetRewItemsCount()*8) );
- data << questid;
- data << uint32(0x03);
+ WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4) );
+ data << uint32(questid);
if ( getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) )
{
- data << XP;
+ data << uint32(XP);
data << uint32(pQuest->GetRewOrReqMoney());
}
else
@@ -13538,16 +13704,9 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
data << uint32(0);
data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY)));
}
- data << uint32(0); // new 2.3.0, HonorPoints?
- data << uint32( pQuest->GetRewItemsCount() ); // max is 5
- for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
- {
- if ( pQuest->RewItemId[i] > 0 )
- data << pQuest->RewItemId[i] << pQuest->RewItemCount[i];
- else
- data << uint32(0) << uint32(0);
- }
+ data << uint32(10*Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills()));
+ data << uint32(pQuest->GetBonusTalents()); // bonus talents
GetSession()->SendPacket( &data );
if (pQuest->GetQuestCompleteScript() != 0)
@@ -13558,8 +13717,9 @@ void Player::SendQuestFailed( uint32 quest_id )
{
if( quest_id )
{
- WorldPacket data( SMSG_QUESTGIVER_QUEST_FAILED, 4 );
+ WorldPacket data( SMSG_QUESTGIVER_QUEST_FAILED, 4+4 );
data << quest_id;
+ data << uint32(0); // failed reason (4 for inventory is full)
GetSession()->SendPacket( &data );
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED");
}
@@ -13598,10 +13758,10 @@ void Player::SendPushToPartyResponse( Player *pPlayer, uint32 msg )
void Player::SendQuestUpdateAddItem( Quest const* pQuest, uint32 item_idx, uint32 count )
{
- WorldPacket data( SMSG_QUESTUPDATE_ADD_ITEM, (4+4) );
+ WorldPacket data( SMSG_QUESTUPDATE_ADD_ITEM, 0 );
sLog.outDebug( "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM" );
- data << pQuest->ReqItemId[item_idx];
- data << count;
+ //data << pQuest->ReqItemId[item_idx];
+ //data << count;
GetSession()->SendPacket( &data );
}
@@ -13647,7 +13807,7 @@ bool Player::MinimalLoadFromDB( QueryResult *result, uint32 guid )
if(!LoadValues( fields[1].GetString()))
{
- sLog.outError("ERROR: Player #%d have broken data in `data` field. Can't be loaded.",GUID_LOPART(guid));
+ sLog.outError("Player #%d have broken data in `data` field. Can't be loaded for character list.",GUID_LOPART(guid));
if(delete_result) delete result;
return false;
}
@@ -13717,7 +13877,7 @@ void Player::_LoadArenaTeamInfo(QueryResult *result)
ArenaTeam* aTeam = objmgr.GetArenaTeamById(arenateamid);
if(!aTeam)
{
- sLog.outError("FATAL: couldn't load arenateam %u", arenateamid);
+ sLog.outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u, week %u, season %u, rating %u", arenateamid, played_week, played_season, personal_rating);
continue;
}
uint8 arenaSlot = aTeam->GetSlot();
@@ -13835,13 +13995,13 @@ float Player::GetFloatValueFromDB(uint16 index, uint64 guid)
bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
- //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] [29] 30 31 32 33
- //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, data, name, race, class, 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, dungeon_difficulty, arena_pending_points FROM characters WHERE guid = '%u'", guid);
+ //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] [29] 30 31 32 33 34 35 36 37 38 39 40
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, data, name, race, class, 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, dungeon_difficulty, arena_pending_points,bgid,bgteam,bgmap,bgx,bgy,bgz,bgo FROM characters WHERE guid = '%u'", guid);
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
if(!result)
{
- sLog.outError("ERROR: Player (GUID: %u) not found in table `characters`, can't load. ",guid);
+ sLog.outError("Player (GUID: %u) not found in table `characters`, can't load. ",guid);
return false;
}
@@ -13853,7 +14013,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// player should be able to load/delete character only with correct account!
if( dbAccountId != GetSession()->GetAccountId() )
{
- sLog.outError("ERROR: Player (GUID: %u) loading from wrong account (is: %u, should be: %u)",guid,GetSession()->GetAccountId(),dbAccountId);
+ sLog.outError("Player (GUID: %u) loading from wrong account (is: %u, should be: %u)",guid,GetSession()->GetAccountId(),dbAccountId);
delete result;
return false;
}
@@ -13872,7 +14032,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(!LoadValues( fields[2].GetString()))
{
- sLog.outError("ERROR: Player #%d have broken data in `data` field. Can't be loaded.",GUID_LOPART(guid));
+ sLog.outError("Player #%d have broken data in `data` field. Can't be loaded.",GUID_LOPART(guid));
delete result;
return false;
}
@@ -13904,23 +14064,19 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
//Need to call it to initialize m_team (m_team can be calculated from m_race)
//Other way is to saves m_team into characters table.
setFactionForRace(m_race);
- SetCharm(0);
+ SetMover(this);
m_class = fields[5].GetUInt8();
- PlayerInfo const *info = objmgr.GetPlayerInfo(m_race, m_class);
- if(!info)
- {
- sLog.outError("Player have incorrect race/class pair. Can't be loaded.");
- delete result;
+ // load home bind and check in same time class/race pair, it used later for restore broken positions
+ if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND)))
return false;
- }
InitPrimaryProffesions(); // to max set before any spell loaded
+ // init saved position, and fix it later if problematic
uint32 transGUID = fields[24].GetUInt32();
Relocate(fields[6].GetFloat(),fields[7].GetFloat(),fields[8].GetFloat(),fields[10].GetFloat());
- SetFallInformation(0, fields[8].GetFloat());
SetMapId(fields[9].GetUInt32());
SetDifficulty(fields[32].GetUInt32()); // may be changed in _LoadGroup
@@ -13954,10 +14110,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(!IsPositionValid())
{
- sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
-
- SetMapId(info->mapId);
- Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
+ sLog.outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ RelocateToHomebind();
transGUID = 0;
@@ -13967,49 +14121,57 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_movementInfo.t_o = 0.0f;
}
- if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND)))
- return false;
+ uint32 bgid = fields[34].GetUInt32();
+ uint32 bgteam = fields[35].GetUInt32();
- // load the player's map here if it's not already loaded
- Map *map = GetMap();
- if (!map)
+ if(bgid) //saved in BattleGround
{
- AreaTrigger const* at = objmgr.GetGoBackTrigger(GetMapId());
- if(at)
+ SetBattleGroundEntryPoint(fields[36].GetUInt32(),fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
+
+ // check entry point and fix to homebind if need
+ MapEntry const* mapEntry = sMapStore.LookupEntry(m_bgEntryPoint.mapid);
+ if(!mapEntry || mapEntry->Instanceable() || !MapManager::IsValidMapCoord(m_bgEntryPoint))
+ SetBattleGroundEntryPoint(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ,0.0f);
+
+ BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid, BATTLEGROUND_TYPE_NONE);
+
+ if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID()))
{
- SetMapId(at->target_mapId);
- Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
- sLog.outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
+ uint32 queueSlot = AddBattleGroundQueueId(bgQueueTypeId);
+
+ SetBattleGroundId(currentBg->GetInstanceID(), currentBg->GetTypeID());
+ SetBGTeam(bgteam);
+
+ //join player to battleground group
+ currentBg->EventPlayerLoggedIn(this, GetGUID());
+ currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetGUID(), bgteam);
+
+ SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
}
else
{
- SetMapId(m_homebindMapId);
- Relocate(m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
- sLog.outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ Relocate(GetBattleGroundEntryPoint());
+ //RemoveArenaAuras(true);
}
-
- map = GetMap();
- if(!map)
+ }
+ else
+ {
+ MapEntry const* mapEntry = sMapStore.LookupEntry(GetMapId());
+ // if server restart after player save in BG or area
+ // player can have current coordinates in to BG/Arean map, fix this
+ if(!mapEntry || mapEntry->IsBattleGroundOrArena())
{
- sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ // return to BG master
+ SetMapId(fields[36].GetUInt32());
+ Relocate(fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
- SetMapId(info->mapId);
- Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
-
- map = GetMap();
- if(!map)
- {
- sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
- sLog.outError("CRASH.");
- assert(false);
- }
+ // check entry point and fix to homebind if need
+ mapEntry = sMapStore.LookupEntry(GetMapId());
+ if(!mapEntry || mapEntry->IsBattleGroundOrArena() || !IsPositionValid())
+ RelocateToHomebind();
}
}
- // since the player may not be bound to the map yet, make sure subsequent
- // getmap calls won't create new maps
- SetInstanceId(map->GetInstanceId());
-
- SaveRecallPosition();
if (transGUID != 0)
{
@@ -14024,12 +14186,11 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// transport size limited
m_movementInfo.t_x > 50 || m_movementInfo.t_y > 50 || m_movementInfo.t_z > 50 )
{
- sLog.outError("ERROR: Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",
+ sLog.outError("Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",
guid,GetPositionX()+m_movementInfo.t_x,GetPositionY()+m_movementInfo.t_y,
GetPositionZ()+m_movementInfo.t_z,GetOrientation()+m_movementInfo.t_o);
- SetMapId(info->mapId);
- Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
+ RelocateToHomebind();
m_movementInfo.t_x = 0.0f;
m_movementInfo.t_y = 0.0f;
@@ -14046,6 +14207,14 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
if( (*iter)->GetGUIDLow() == transGUID)
{
+ MapEntry const* transMapEntry = sMapStore.LookupEntry((*iter)->GetMapId());
+ // client without expansion support
+ if(GetSession()->Expansion() < transMapEntry->Expansion())
+ {
+ sLog.outDebug("Player %s using client without required expansion tried login at transport at non accessible map %u", GetName(), (*iter)->GetMapId());
+ break;
+ }
+
m_transport = *iter;
m_transport->AddPassenger(this);
SetMapId(m_transport->GetMapId());
@@ -14055,11 +14224,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(!m_transport)
{
- sLog.outError("ERROR: Player (guidlow %d) have invalid transport guid (%u). Teleport to default race/class locations.",
+ sLog.outError("Player (guidlow %d) have problems with transport guid (%u). Teleport to default race/class locations.",
guid,transGUID);
- SetMapId(info->mapId);
- Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
+ RelocateToHomebind();
m_movementInfo.t_x = 0.0f;
m_movementInfo.t_y = 0.0f;
@@ -14069,6 +14237,71 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
transGUID = 0;
}
}
+ else // not transport case
+ {
+ MapEntry const* mapEntry = sMapStore.LookupEntry(GetMapId());
+ // client without expansion support
+ if(GetSession()->Expansion() < mapEntry->Expansion())
+ {
+ sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), GetMapId());
+ RelocateToHomebind();
+ }
+ }
+
+ // NOW player must have valid map
+ // load the player's map here if it's not already loaded
+ Map *map = GetMap();
+
+ if (!map)
+ {
+ AreaTrigger const* at = objmgr.GetGoBackTrigger(GetMapId());
+ if(at)
+ {
+ SetMapId(at->target_mapId);
+ Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
+ sLog.outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ }
+ else
+ {
+ RelocateToHomebind();
+ sLog.outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ }
+
+ map = GetMap();
+ if(!map)
+ {
+ sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ delete result;
+ return false;
+
+ /*SetMapId(info->mapId);
+ Relocate(info->positionX,info->positionY,info->positionZ,0.0f);
+
+ map = GetMap();
+ if(!map)
+ {
+ sLog.outError("ERROR: Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
+ sLog.outError("CRASH.");
+ assert(false);
+ }*/
+ }
+ }
+
+ // since the player may not be bound to the map yet, make sure subsequent
+ // getmap calls won't create new maps
+ SetInstanceId(map->GetInstanceId());
+
+ // if the player is in an instance and it has been reset in the meantime teleport him to the entrance
+ if(GetInstanceId() && !sInstanceSaveManager.GetInstanceSave(GetInstanceId()))
+ {
+ AreaTrigger const* at = objmgr.GetMapEntranceTrigger(GetMapId());
+ if(at)
+ Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
+ else
+ sLog.outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no aretrigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), GetMapId());
+ }
+
+ SaveRecallPosition();
time_t now = time(NULL);
time_t logoutTime = time_t(fields[16].GetUInt64());
@@ -14119,10 +14352,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
uint32 extraflags = fields[25].GetUInt32();
m_stableSlots = fields[26].GetUInt32();
- if(m_stableSlots > 2)
+ if(m_stableSlots > MAX_PET_STABLES)
{
- sLog.outError("Player can have not more 2 stable slots, but have in DB %u",uint32(m_stableSlots));
- m_stableSlots = 2;
+ sLog.outError("Player can have not more %u stable slots, but have in DB %u",MAX_PET_STABLES,uint32(m_stableSlots));
+ m_stableSlots = MAX_PET_STABLES;
}
m_atLoginFlags = fields[27].GetUInt32();
@@ -14145,35 +14378,18 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
SetUInt32Value(UNIT_CHANNEL_SPELL,0);
// clear charm/summon related fields
- SetCharm(NULL);
- SetPet(NULL);
- SetCharmerGUID(NULL);
- SetOwnerGUID(NULL);
- SetCreatorGUID(NULL);
+ SetUInt64Value(UNIT_FIELD_CHARM, 0);
+ SetUInt64Value(UNIT_FIELD_SUMMON, 0);
+ SetUInt64Value(PLAYER_FARSIGHT, 0);
+ SetCharmerGUID(0);
+ SetOwnerGUID(0);
+ SetCreatorGUID(0);
// reset some aura modifiers before aura apply
- SetFarSight(NULL);
SetUInt32Value(PLAYER_TRACK_CREATURES, 0 );
SetUInt32Value(PLAYER_TRACK_RESOURCES, 0 );
- // reset skill modifiers and set correct unlearn flags
- for (uint32 i = 0; i < PLAYER_MAX_SKILLS; i++)
- {
- SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
-
- // set correct unlearn bit
- uint32 id = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
- if(!id) continue;
-
- SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(id);
- if(!pSkill) continue;
-
- // enable unlearn button for primary professions only
- if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION)
- SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,1));
- else
- SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
- }
+ _LoadSkills();
// make sure the unit is considered out of combat for proper loading
ClearInCombat();
@@ -14191,6 +14407,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// reset stats before loading any modifiers
InitStatsForLevel();
InitTaxiNodesForLevel();
+ InitGlyphsForLevel();
+ InitRunes();
// apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods()
@@ -14198,25 +14416,25 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
//_LoadMail();
_LoadAuras(holder->GetResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff);
-
+ _LoadGlyphAuras();
// add ghost flag (must be after aura load: PLAYER_FLAGS_GHOST set in aura)
if( HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) )
m_deathState = DEAD;
_LoadSpells(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSPELLS));
- // after spell load
- InitTalentForLevel();
- learnSkillRewardedSpells();
-
// after spell load, learn rewarded spell if need also
_LoadQuestStatus(holder->GetResult(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS));
_LoadDailyQuestStatus(holder->GetResult(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS));
+ // after spell and quest load
+ InitTalentForLevel();
+ learnDefaultSpells();
+
_LoadTutorials(holder->GetResult(PLAYER_LOGIN_QUERY_LOADTUTORIALS));
// must be before inventory (some items required reputation check)
- _LoadReputation(holder->GetResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
+ m_reputationMgr.LoadFromDB(holder->GetResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
_LoadInventory(holder->GetResult(PLAYER_LOGIN_QUERY_LOADINVENTORY), time_diff);
@@ -14230,9 +14448,6 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_social = sSocialMgr.LoadFromDB(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSOCIALLIST), GetGUIDLow());
- //if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND)))
- // return false;
-
// check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES
// note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
if(uint32 curTitle = GetUInt32Value(PLAYER_CHOSEN_TITLE))
@@ -14242,7 +14457,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
}
// Not finish taxi flight path
- if(!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes))
+ if(!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes,GetTeam()))
{
// problems with taxi path loading
TaxiNodesEntry const* nodeEntry = NULL;
@@ -14252,8 +14467,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(!nodeEntry) // don't know taxi start node, to homebind
{
sLog.outError("Character %u have wrong data in taxi destination list, teleport to homebind.",GetGUIDLow());
- SetMapId(m_homebindMapId);
- Relocate( m_homebindX, m_homebindY, m_homebindZ,0.0f);
+ RelocateToHomebind();
SaveRecallPosition(); // save as recall also to prevent recall and fall from sky
}
else // have start node, to it
@@ -14278,6 +14492,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// flight will started later
}
+ // has to be called after last Relocate() in Player::LoadFromDB
+ SetFallInformation(0, GetPositionZ());
+
_LoadSpellCooldowns(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS));
// Spell code allow apply any auras to dead character in load time in aura/spell/item loading
@@ -14311,6 +14528,28 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
break;
}
+ switch(sWorld.getConfig(CONFIG_GM_VISIBLE_STATE))
+ {
+ default:
+ case 0: SetGMVisible(false); break; // invisible
+ case 1: break; // visible
+ case 2: // save state
+ if(extraflags & PLAYER_EXTRA_GM_INVISIBLE)
+ SetGMVisible(false);
+ break;
+ }
+
+ /*switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS))
+ {
+ default:
+ case 0: break; // disable
+ case 1: SetAcceptTicket(true); break; // enable
+ case 2: // save state
+ if(extraflags & PLAYER_EXTRA_GM_ACCEPT_TICKETS)
+ SetAcceptTicket(true);
+ break;
+ }*/
+
switch(sWorld.getConfig(CONFIG_GM_CHAT))
{
default:
@@ -14336,6 +14575,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
_LoadDeclinedNames(holder->GetResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES));
+ m_achievementMgr.LoadFromDB(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS));
+ m_achievementMgr.CheckAllAchievementCriteria();
return true;
}
@@ -14373,9 +14614,15 @@ void Player::_LoadActions(QueryResult *result)
uint8 button = fields[0].GetUInt8();
- addActionButton(button, fields[1].GetUInt16(), fields[2].GetUInt8(), fields[3].GetUInt8());
+ if(addActionButton(button, fields[1].GetUInt16(), fields[2].GetUInt8(), fields[3].GetUInt8()))
+ m_actionButtons[button].uState = ACTIONBUTTON_UNCHANGED;
+ else
+ {
+ sLog.outError( " ...at loading, and will deleted in DB also");
- m_actionButtons[button].uState = ACTIONBUTTON_UNCHANGED;
+ // Will 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() );
@@ -14385,45 +14632,39 @@ void Player::_LoadActions(QueryResult *result)
void Player::_LoadAuras(QueryResult *result, uint32 timediff)
{
+ sLog.outDebug("Loading auras for player %u",GetGUIDLow());
m_Auras.clear();
for (int i = 0; i < TOTAL_AURAS; i++)
m_modAuras[i].clear();
- // all aura related fields
- for(int i = UNIT_FIELD_AURA; i <= UNIT_FIELD_AURASTATE; ++i)
- SetUInt32Value(i, 0);
-
- //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0,amount1,amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
if(result)
{
do
{
+ int32 damage[3];
Field *fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
- uint32 effindex = fields[2].GetUInt32();
+ uint32 effmask = fields[2].GetUInt32();
uint32 stackcount = fields[3].GetUInt32();
- int32 damage = (int32)fields[4].GetUInt32();
- int32 maxduration = (int32)fields[5].GetUInt32();
- int32 remaintime = (int32)fields[6].GetUInt32();
- int32 remaincharges = (int32)fields[7].GetUInt32();
+ damage[0] = int32(fields[4].GetUInt32());
+ damage[1] = int32(fields[5].GetUInt32());
+ damage[2] = int32(fields[6].GetUInt32());
+ int32 maxduration = (int32)fields[7].GetUInt32();
+ int32 remaintime = (int32)fields[8].GetUInt32();
+ int32 remaincharges = (int32)fields[9].GetUInt32();
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if(!spellproto)
{
- sLog.outError("Unknown aura (spellid %u, effindex %u), ignore.",spellid,effindex);
- continue;
- }
-
- if(effindex >= 3)
- {
- sLog.outError("Invalid effect index (spellid %u, effindex %u), ignore.",spellid,effindex);
+ sLog.outError("Unknown aura (spellid %u), ignore.",spellid);
continue;
}
// negative effects should continue counting down after logout
- if (remaintime != -1 && !IsPositiveEffect(spellid, effindex))
+ if (remaintime != -1 && !IsPositiveSpell(spellid))
{
if(remaintime <= int32(timediff))
continue;
@@ -14438,21 +14679,12 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
remaincharges = spellproto->procCharges;
}
else
- remaincharges = -1;
-
- //do not load single target auras (unless they were cast by the player)
- if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto))
- continue;
+ remaincharges = 0;
- for(uint32 i=0; i<stackcount; i++)
- {
- Aura* aura = CreateAura(spellproto, effindex, NULL, this, NULL);
- if(!damage)
- damage = aura->GetModifier()->m_amount;
- aura->SetLoadedState(caster_guid,damage,maxduration,remaintime,remaincharges);
- AddAura(aura);
- sLog.outDetail("Added aura spellid %u, effect %u", spellproto->Id, effindex);
- }
+ Aura* aura = new Aura(spellproto, effmask, NULL, this, NULL, NULL);
+ aura->SetLoadedState(caster_guid,maxduration,remaintime,remaincharges, stackcount, &damage[0]);
+ AddAura(aura);
+ sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
while( result->NextRow() );
@@ -14463,6 +14695,36 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
CastSpell(this,SPELL_ID_PASSIVE_BATTLE_STANCE,true);
}
+void Player::_LoadGlyphAuras()
+{
+ for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
+ {
+ if (uint32 glyph = GetGlyph(i))
+ {
+ if (GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph))
+ {
+ if (GlyphSlotEntry const *gs = sGlyphSlotStore.LookupEntry(GetGlyphSlot(i)))
+ {
+ if(gp->TypeFlags == gs->TypeFlags)
+ {
+ CastSpell(this, gp->SpellId, true);
+ continue;
+ }
+ else
+ sLog.outError("Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
+ }
+ else
+ sLog.outError("Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
+ }
+ else
+ sLog.outError("Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
+
+ // On any error remove glyph
+ SetGlyph(i, 0);
+ }
+ }
+}
+
void Player::LoadCorpse()
{
if( isAlive() )
@@ -14638,15 +14900,16 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
// load mailed item which should receive current player
void Player::_LoadMailedItems(Mail *mail)
{
- QueryResult* result = CharacterDatabase.PQuery("SELECT item_guid, item_template FROM mail_items WHERE mail_id='%u'", mail->messageID);
+ // data needs to be at first place for Item::LoadFromDB
+ QueryResult* result = CharacterDatabase.PQuery("SELECT data, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID);
if(!result)
return;
do
{
Field *fields = result->Fetch();
- uint32 item_guid_low = fields[0].GetUInt32();
- uint32 item_template = fields[1].GetUInt32();
+ uint32 item_guid_low = fields[1].GetUInt32();
+ uint32 item_template = fields[2].GetUInt32();
mail->AddItem(item_guid_low, item_template);
@@ -14662,7 +14925,7 @@ void Player::_LoadMailedItems(Mail *mail)
Item *item = NewItemOrBag(proto);
- if(!item->LoadFromDB(item_guid_low, 0))
+ if(!item->LoadFromDB(item_guid_low, 0, result))
{
sLog.outError( "Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, item_guid_low);
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low);
@@ -14748,7 +15011,7 @@ void Player::LoadPet()
// just not added to the map
if(IsInWorld())
{
- Pet *pet = new Pet;
+ Pet *pet = new Pet(this);
if(!pet->LoadPetFromDB(this,0,0,true))
delete pet;
}
@@ -14798,7 +15061,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
if (quest_time <= sWorld.GetGameTime())
questStatusData.m_timer = 1;
else
- questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * 1000;
+ questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILISECONDS;
}
else
quest_time = 0;
@@ -14843,6 +15106,9 @@ void Player::_LoadQuestStatus(QueryResult *result)
if(CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(pQuest->GetCharTitleId()))
SetTitle(titleEntry);
}
+
+ if(pQuest->GetBonusTalents())
+ m_questRewardTalentCount+=pQuest->GetBonusTalents();
}
sLog.outDebug("Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.m_status, quest_id, GetGUIDLow());
@@ -14901,68 +15167,9 @@ void Player::_LoadDailyQuestStatus(QueryResult *result)
m_DailyQuestChanged = false;
}
-void Player::_LoadReputation(QueryResult *result)
-{
- m_factions.clear();
-
- // Set initial reputations (so everything is nifty before DB data load)
- SetInitialFactions();
-
- //QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow());
-
- if(result)
- {
- do
- {
- Field *fields = result->Fetch();
-
- FactionEntry const *factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt32());
- if( factionEntry && (factionEntry->reputationListID >= 0))
- {
- FactionState* faction = &m_factions[factionEntry->reputationListID];
-
- // update standing to current
- faction->Standing = int32(fields[1].GetUInt32());
-
- uint32 dbFactionFlags = fields[2].GetUInt32();
-
- if( dbFactionFlags & FACTION_FLAG_VISIBLE )
- SetFactionVisible(faction); // have internal checks for forced invisibility
-
- if( dbFactionFlags & FACTION_FLAG_INACTIVE)
- SetFactionInactive(faction,true); // have internal checks for visibility requirement
-
- if( dbFactionFlags & FACTION_FLAG_AT_WAR ) // DB at war
- SetFactionAtWar(faction,true); // have internal checks for FACTION_FLAG_PEACE_FORCED
- else // DB not at war
- {
- // allow remove if visible (and then not FACTION_FLAG_INVISIBLE_FORCED or FACTION_FLAG_HIDDEN)
- if( faction->Flags & FACTION_FLAG_VISIBLE )
- SetFactionAtWar(faction,false); // have internal checks for FACTION_FLAG_PEACE_FORCED
- }
-
- // set atWar for hostile
- if(GetReputationRank(factionEntry) <= REP_HOSTILE)
- SetFactionAtWar(faction,true);
-
- // reset changed flag if values similar to saved in DB
- if(faction->Flags==dbFactionFlags)
- faction->Changed = false;
- }
- }
- while( result->NextRow() );
-
- delete result;
- }
-}
-
void Player::_LoadSpells(QueryResult *result)
{
- for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
- delete itr->second;
- m_spells.clear();
-
- //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,slot,active FROM character_spell WHERE guid = '%u'",GetGUIDLow());
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow());
if(result)
{
@@ -14970,7 +15177,7 @@ void Player::_LoadSpells(QueryResult *result)
{
Field *fields = result->Fetch();
- addSpell(fields[0].GetUInt16(), fields[2].GetBool(), false, true, fields[1].GetUInt16(), fields[3].GetBool());
+ addSpell(fields[0].GetUInt16(), fields[1].GetBool(), false, false, fields[2].GetBool());
}
while( result->NextRow() );
@@ -15042,6 +15249,14 @@ void Player::_LoadBoundInstances(QueryResult *result)
// so the value read from the DB may be wrong here but only if the InstanceSave is loaded
// and in that case it is not used
+ MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
+ if(!mapEntry || !mapEntry->IsDungeon())
+ {
+ sLog.outError("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
+ CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
+ continue;
+ }
+
if(!perm && group)
{
sLog.outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d,%d,%d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetLeaderGUID()), mapId, instanceId, difficulty);
@@ -15119,29 +15334,29 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b
void Player::SendRaidInfo()
{
+ uint32 counter = 0;
+
WorldPacket data(SMSG_RAID_INSTANCE_INFO, 4);
- uint32 counter = 0, i;
- for(i = 0; i < TOTAL_DIFFICULTIES; i++)
- for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
- if(itr->second.perm) counter++;
+ size_t p_counter = data.wpos();
+ data << uint32(counter); // placeholder
- data << counter;
- for(i = 0; i < TOTAL_DIFFICULTIES; i++)
+ for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
{
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
{
if(itr->second.perm)
{
InstanceSave *save = itr->second.save;
- data << (save->GetMapId());
- data << (uint32)(save->GetResetTime() - time(NULL));
- data << save->GetInstanceId();
- data << uint32(counter);
- counter--;
+ data << uint32(save->GetMapId());
+ data << uint32(save->GetResetTime() - time(NULL));
+ data << uint32(save->GetInstanceId());
+ data << uint32(save->GetDifficulty());
+ ++counter;
}
}
}
+ data.put<uint32>(p_counter,counter);
GetSession()->SendPacket(&data);
}
@@ -15275,7 +15490,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
if(missingItem)
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), ar->levelMin, objmgr.GetItemPrototype(missingItem)->Name1);
else if(missingKey)
- SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY2);
+ SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY);
else if(missingHeroicQuest)
GetSession()->SendAreaTriggerMessage(ar->heroicQuestFailedText.c_str());
else if(missingQuest)
@@ -15291,6 +15506,13 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
bool Player::_LoadHomeBind(QueryResult *result)
{
+ PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(), getClass());
+ if(!info)
+ {
+ sLog.outError("Player have incorrect race/class pair. Can't be loaded.");
+ return false;
+ }
+
bool ok = false;
//QueryResult *result = CharacterDatabase.PQuery("SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(playerGuid));
if (result)
@@ -15303,9 +15525,11 @@ bool Player::_LoadHomeBind(QueryResult *result)
m_homebindZ = fields[4].GetFloat();
delete result;
- // accept saved data only for valid position (and non instanceable)
+ MapEntry const* bindMapEntry = sMapStore.LookupEntry(m_homebindMapId);
+
+ // accept saved data only for valid position (and non instanceable), and accessable
if( MapManager::IsValidMapCoord(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ) &&
- !sMapStore.LookupEntry(m_homebindMapId)->Instanceable() )
+ !bindMapEntry->Instanceable() && GetSession()->Expansion() >= bindMapEntry->Expansion())
{
ok = true;
}
@@ -15315,9 +15539,6 @@ bool Player::_LoadHomeBind(QueryResult *result)
if(!ok)
{
- PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(), getClass());
- if(!info) return false;
-
m_homebindMapId = info->mapId;
m_homebindZoneId = info->zoneId;
m_homebindX = info->positionX;
@@ -15327,7 +15548,7 @@ bool Player::_LoadHomeBind(QueryResult *result)
CharacterDatabase.PExecute("INSERT INTO character_homebind (guid,map,zone,position_x,position_y,position_z) VALUES ('%u', '%u', '%u', '%f', '%f', '%f')", GetGUIDLow(), m_homebindMapId, (uint32)m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ);
}
- DEBUG_LOG("Setting player home position: mapid is: %u, zoneid is %u, X is %f, Y is %f, Z is %f\n",
+ DEBUG_LOG("Setting player home position: mapid is: %u, zoneid is %u, X is %f, Y is %f, Z is %f",
m_homebindMapId, m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ);
return true;
@@ -15345,12 +15566,6 @@ void Player::SaveToDB()
// first save/honor gain after midnight will also update the player's honor fields
UpdateHonorFields();
- // players aren't saved on battleground maps
- uint32 mapid = IsBeingTeleported() ? GetTeleportDest().mapid : GetMapId();
- const MapEntry * me = sMapStore.LookupEntry(mapid);
- if(!me || me->IsBattleGroundOrArena())
- return;
-
int is_save_resting = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0;
//save, far from tavern/city
//save, but in tavern/city
@@ -15365,10 +15580,9 @@ void Player::SaveToDB()
uint32 tmp_displayid = GetDisplayId();
// Set player sit state to standing on save, also stealth and shifted form
- SetByteValue(UNIT_FIELD_BYTES_1, 0, 0); // stand state
+ SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_STAND);
SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); // shapeshift
- SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); // stand flags?
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
SetDisplayId(GetNativeDisplayId());
bool inworld = IsInWorld();
@@ -15386,23 +15600,14 @@ void Player::SaveToDB()
"taximask, online, 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, "
- "death_expire_time, taxi_path, arena_pending_points, latency) VALUES ("
+ "death_expire_time, taxi_path, arena_pending_points, latency, bgid, bgteam, bgmap, bgx, bgy, bgz, bgo) VALUES ("
<< GetGUIDLow() << ", "
<< GetSession()->GetAccountId() << ", '"
<< sql_name << "', "
<< m_race << ", "
<< m_class << ", ";
- bool save_to_dest = false;
- if(IsBeingTeleported())
- {
- // don't save to battlegrounds or arenas
- const MapEntry *entry = sMapStore.LookupEntry(GetTeleportDest().mapid);
- if(entry && entry->map_type != MAP_BATTLEGROUND && entry->map_type != MAP_ARENA)
- save_to_dest = true;
- }
-
- if(!save_to_dest)
+ if(!IsBeingTeleported())
{
ss << GetMapId() << ", "
<< (uint32)GetDifficulty() << ", "
@@ -15427,12 +15632,11 @@ void Player::SaveToDB()
ss << GetUInt32Value(i) << " ";
}
- ss << "', '";
+ ss << "', ";
- for( i = 0; i < 8; i++ )
- ss << m_taxi.GetTaximask(i) << " ";
+ ss << m_taxi; // string with TaxiMaskSize numbers
- ss << "', ";
+ ss << ", ";
ss << (inworld ? 1 : 0);
ss << ", ";
@@ -15486,9 +15690,19 @@ void Player::SaveToDB()
ss << ", '";
ss << m_taxi.SaveTaxiDestinationsToString();
- ss << "', '0', '";
+ ss << "', '0', ";
ss << GetSession()->GetLatency();
- ss << "' )";
+ ss << ", ";
+ ss << GetBattleGroundId();
+ ss << ", ";
+ ss << GetBGTeam();
+ ss << ", ";
+ ss << m_bgEntryPoint.mapid << ", "
+ << finiteAlways(m_bgEntryPoint.x) << ", "
+ << finiteAlways(m_bgEntryPoint.y) << ", "
+ << finiteAlways(m_bgEntryPoint.z) << ", "
+ << finiteAlways(m_bgEntryPoint.o);
+ ss << ")";
CharacterDatabase.Execute( ss.str().c_str() );
@@ -15503,7 +15717,8 @@ void Player::SaveToDB()
_SaveSpellCooldowns();
_SaveActions();
_SaveAuras();
- _SaveReputation();
+ m_achievementMgr.SaveToDB();
+ m_reputationMgr.SaveToDB();
CharacterDatabase.CommitTransaction();
@@ -15517,23 +15732,6 @@ void Player::SaveToDB()
// save pet (hunter pet level and experience and all type pets health/mana).
if(Pet* pet = GetPet())
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
-
- //to prevent access to DB we should cache some data, which is used very often
- CachePlayerInfoMap::iterator _iter = objmgr.m_mPlayerInfoMap.find(GetGUIDLow());
- if(_iter != objmgr.m_mPlayerInfoMap.end())//skip new players
- {
- _iter->second->unLevel = getLevel();
-
- _iter->second->unArenaInfoSlot0 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 0 * 6 + 5);
- _iter->second->unArenaInfoSlot1 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 * 6 + 5);
- _iter->second->unArenaInfoSlot2 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 2 * 6 + 5);
-
- _iter->second->unfield = GetUInt32Value(UNIT_FIELD_BYTES_0);
-
- _iter->second->unArenaInfoId0 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (0 * 6));
- _iter->second->unArenaInfoId1 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (1 * 6));
- _iter->second->unArenaInfoId2 = GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (2 * 6));
- }
}
// fast save function for item/money cheating preventing - save only inventory and money state
@@ -15578,56 +15776,36 @@ void Player::_SaveAuras()
CharacterDatabase.PExecute("DELETE FROM character_aura WHERE guid = '%u'",GetGUIDLow());
AuraMap const& auras = GetAuras();
+ for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
+ {
+ // skip:
+ // area auras or single cast auras casted by other unit
+ // passive auras and stances
+ if (itr->second->IsPassive()
+ || itr->second->IsAuraType(SPELL_AURA_MOD_SHAPESHIFT)
+ || itr->second->IsAuraType(SPELL_AURA_MOD_STEALTH)
+ || itr->second->IsRemovedOnShapeLost())
+ continue;
+ bool isCaster = itr->second->GetCasterGUID() == GetGUID();
+ if (!isCaster)
+ if (itr->second->IsSingleTarget()
+ || itr->second->IsAreaAura())
+ continue;
- if (auras.empty())
- return;
-
- spellEffectPair lastEffectPair = auras.begin()->first;
- uint32 stackCounter = 1;
-
- for(AuraMap::const_iterator itr = auras.begin(); ; ++itr)
- {
- if(itr == auras.end() || lastEffectPair != itr->first)
+ int32 amounts[MAX_SPELL_EFFECTS];
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
- AuraMap::const_iterator itr2 = itr;
- // save previous spellEffectPair to db
- itr2--;
- SpellEntry const *spellInfo = itr2->second->GetSpellProto();
-
- //skip all auras from spells that are passive or need a shapeshift
- if (!(itr2->second->IsPassive() || itr2->second->IsRemovedOnShapeLost()))
- {
- //do not save single target auras (unless they were cast by the player)
- if (!(itr2->second->GetCasterGUID() != GetGUID() && IsSingleTargetSpell(spellInfo)))
- {
- uint8 i;
- // or apply at cast SPELL_AURA_MOD_SHAPESHIFT or SPELL_AURA_MOD_STEALTH auras
- for (i = 0; i < 3; i++)
- if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT ||
- spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH)
- break;
-
- if (i == 3)
- {
- CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
- "VALUES ('%u', '" I64FMTD "' ,'%u', '%u', '%u', '%d', '%d', '%d', '%d')",
- GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->m_procCharges));
- }
- }
- }
-
- if(itr == auras.end())
- break;
+ if (AuraEffect * partAura = itr->second->GetPartAura(i))
+ amounts[i]=partAura->GetAmount();
+ else
+ amounts[i]=0;
}
- //TODO: if need delete this
- if (lastEffectPair == itr->first)
- stackCounter++;
- else
- {
- lastEffectPair = itr->first;
- stackCounter = 1;
- }
+ CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2,maxduration,remaintime,remaincharges) "
+ "VALUES ('%u', '" I64FMTD "', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ GetGUIDLow(), itr->second->GetCasterGUID(),(uint32)itr->second->GetId(), (uint32)itr->second->GetEffectMask(),
+ (int32)itr->second->GetStackAmount(), (int32)amounts[0], (int32)amounts[1], (int32)amounts[2]
+ ,int(itr->second->GetAuraMaxDuration()),int(itr->second->GetAuraDuration()),int(itr->second->GetAuraCharges()));
}
}
@@ -15767,11 +15945,11 @@ void Player::_SaveQuestStatus()
case QUEST_NEW :
CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
"VALUES ('%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
- GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / 1000 + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
+ GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
break;
case QUEST_CHANGED :
CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" I64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ",
- i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / 1000 + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
+ i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
break;
case QUEST_UNCHANGED:
break;
@@ -15797,33 +15975,28 @@ void Player::_SaveDailyQuestStatus()
GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx),uint64(m_lastDailyQuestTime));
}
-void Player::_SaveReputation()
-{
- for(FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
- {
- if (itr->second.Changed)
- {
- CharacterDatabase.PExecute("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", GetGUIDLow(), itr->second.ID);
- CharacterDatabase.PExecute("INSERT INTO character_reputation (guid,faction,standing,flags) VALUES ('%u', '%u', '%i', '%u')", GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags);
- itr->second.Changed = false;
- }
- }
-}
-
void Player::_SaveSpells()
{
- for (PlayerSpellMap::const_iterator itr = m_spells.begin(), next = m_spells.begin(); itr != m_spells.end(); itr = next)
+ for (PlayerSpellMap::iterator itr = m_spells.begin(), next = m_spells.begin(); itr != m_spells.end();)
{
- ++next;
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED)
CharacterDatabase.PExecute("DELETE FROM character_spell WHERE guid = '%u' and spell = '%u'", GetGUIDLow(), itr->first);
- if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)
- CharacterDatabase.PExecute("INSERT INTO character_spell (guid,spell,slot,active,disabled) VALUES ('%u', '%u', '%u','%u','%u')", GetGUIDLow(), itr->first, itr->second->slotId,itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0);
+
+ // add only changed/new not dependent spells
+ if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED))
+ CharacterDatabase.PExecute("INSERT INTO character_spell (guid,spell,active,disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0);
if (itr->second->state == PLAYERSPELL_REMOVED)
- _removeSpell(itr->first);
+ {
+ delete itr->second;
+ m_spells.erase(itr++);
+ }
else
+ {
itr->second->state = PLAYERSPELL_UNCHANGED;
+ ++itr;
+ }
+
}
}
@@ -15995,6 +16168,42 @@ void Player::SetFloatValueInDB(uint16 index, float value, uint64 guid)
Player::SetUInt32ValueInDB(index, temp, guid);
}
+void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair)
+{
+ Tokens tokens;
+ if(!LoadValuesArrayFromDB(tokens, guid))
+ return;
+
+ uint32 unit_bytes0 = GetUInt32ValueFromArray(tokens, UNIT_FIELD_BYTES_0);
+ uint8 race = unit_bytes0 & 0xFF;
+ uint8 class_ = (unit_bytes0 >> 8) & 0xFF;
+
+ PlayerInfo const* info = objmgr.GetPlayerInfo(race, class_);
+ if(!info)
+ return;
+
+ unit_bytes0 &= ~(0xFF << 16);
+ unit_bytes0 |= (gender << 16);
+ SetUInt32ValueInArray(tokens, UNIT_FIELD_BYTES_0, unit_bytes0);
+
+ SetUInt32ValueInArray(tokens, UNIT_FIELD_DISPLAYID, gender ? info->displayId_f : info->displayId_m);
+ SetUInt32ValueInArray(tokens, UNIT_FIELD_NATIVEDISPLAYID, gender ? info->displayId_f : info->displayId_m);
+
+ SetUInt32ValueInArray(tokens, PLAYER_BYTES, (skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)));
+
+ uint32 player_bytes2 = GetUInt32ValueFromArray(tokens, PLAYER_BYTES_2);
+ player_bytes2 &= ~0xFF;
+ player_bytes2 |= facialHair;
+ SetUInt32ValueInArray(tokens, PLAYER_BYTES_2, player_bytes2);
+
+ uint32 player_bytes3 = GetUInt32ValueFromArray(tokens, PLAYER_BYTES_3);
+ player_bytes3 &= ~0xFF;
+ player_bytes3 |= gender;
+ SetUInt32ValueInArray(tokens, PLAYER_BYTES_3, player_bytes3);
+
+ SaveValuesArrayInDB(tokens, guid);
+}
+
void Player::SendAttackSwingNotStanding()
{
WorldPacket data(SMSG_ATTACKSWING_NOTSTANDING, 0);
@@ -16027,20 +16236,11 @@ void Player::SendAttackSwingBadFacingAttack()
void Player::SendAutoRepeatCancel()
{
- WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, 0);
+ WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, GetPackGUID().size());
+ data.append(GetPackGUID()); // may be it's target guid
GetSession()->SendPacket( &data );
}
-void Player::PlaySound(uint32 Sound, bool OnlySelf)
-{
- WorldPacket data(SMSG_PLAY_SOUND, 4);
- data << Sound;
- if (OnlySelf)
- GetSession()->SendPacket( &data );
- else
- SendMessageToSet( &data, true );
-}
-
void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
{
WorldPacket data( SMSG_EXPLORATION_EXPERIENCE, 8 );
@@ -16181,11 +16381,32 @@ void Player::UpdateDuelFlag(time_t currTime)
duel->opponent->duel->startTime = currTime;
}
+Pet* Player::GetPet() const
+{
+ if(uint64 pet_guid = GetPetGUID())
+ {
+ if(!IS_PET_GUID(pet_guid))
+ return NULL;
+
+ if(Pet* pet = ObjectAccessor::GetPet(pet_guid))
+ return pet;
+
+ //there may be a guardian in slot
+ //sLog.outError("Player::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
+ //const_cast<Player*>(this)->SetPetGUID(0);
+ }
+
+ return NULL;
+}
+
void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
{
if(!pet)
pet = GetPet();
+ if(pet)
+ sLog.outDebug("RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent);
+
if(returnreagent && (pet || m_temporaryUnsummonedPetNumber))
{
//returning of reagents only for players, so best done here
@@ -16215,25 +16436,6 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if(!pet || pet->GetOwnerGUID()!=GetGUID())
return;
- // only if current pet in slot
- switch(pet->getPetType())
- {
- case MINI_PET:
- m_miniPet = 0;
- break;
- case GUARDIAN_PET:
- m_guardianPets.erase(pet->GetGUID());
- break;
- case POSSESSED_PET:
- m_guardianPets.erase(pet->GetGUID());
- pet->RemoveCharmedOrPossessedBy(NULL);
- break;
- default:
- if(GetPetGUID() == pet->GetGUID())
- SetPet(NULL);
- break;
- }
-
pet->CombatStop();
if(returnreagent)
@@ -16250,7 +16452,18 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
}
}
- pet->SavePetToDB(mode);
+ // only if current pet in slot
+ switch(pet->getPetType())
+ {
+ case POSSESSED_PET:
+ pet->RemoveCharmedOrPossessedBy(NULL);
+ break;
+ default:
+ pet->SavePetToDB(mode);
+ break;
+ }
+
+ SetGuardian(pet, false);
pet->CleanupsBeforeDelete();
pet->AddObjectToRemoveList();
@@ -16258,8 +16471,9 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if(pet->isControlled())
{
- WorldPacket data(SMSG_PET_SPELLS, 8);
+ WorldPacket data(SMSG_PET_SPELLS, 8+4);
data << uint64(0);
+ data << uint32(0);
GetSession()->SendPacket(&data);
if(GetGroup())
@@ -16267,66 +16481,29 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
}
}
-void Player::RemoveMiniPet()
-{
- if(Pet* pet = GetMiniPet())
- {
- pet->Remove(PET_SAVE_AS_DELETED);
- m_miniPet = 0;
- }
-}
-
-Pet* Player::GetMiniPet()
-{
- if(!m_miniPet)
- return NULL;
- return ObjectAccessor::GetPet(m_miniPet);
-}
-
-void Player::RemoveGuardians()
-{
- while(!m_guardianPets.empty())
- {
- uint64 guid = *m_guardianPets.begin();
- if(Pet* pet = ObjectAccessor::GetPet(guid))
- pet->Remove(PET_SAVE_AS_DELETED);
-
- m_guardianPets.erase(guid);
- }
-}
-
-bool Player::HasGuardianWithEntry(uint32 entry)
-{
- // pet guid middle part is entry (and creature also)
- // and in guardian list must be guardians with same entry _always_
- for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
- if(GUID_ENPART(*itr)==entry)
- return true;
-
- return false;
-}
-
-void Player::Uncharm()
+void Player::StopCastingCharm()
{
Unit* charm = GetCharm();
if(!charm)
return;
- if(charm->GetTypeId() == TYPEID_UNIT && ((Creature*)charm)->isPet()
- && ((Pet*)charm)->getPetType() == POSSESSED_PET)
+ if(charm->GetTypeId() == TYPEID_UNIT)
{
- ((Pet*)charm)->Remove(PET_SAVE_AS_DELETED);
+ if(((Creature*)charm)->isPet() && ((Pet*)charm)->getPetType() == POSSESSED_PET)
+ ((Pet*)charm)->Remove(PET_SAVE_AS_DELETED);
+ else if(((Creature*)charm)->isVehicle())
+ ((Vehicle*)charm)->RemovePassenger(this);
}
- else
+ if(GetCharmGUID())
{
- charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
- charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
- charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
+ charm->RemoveAurasByType(SPELL_AURA_MOD_CHARM);
+ charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET);
+ charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS);
}
if(GetCharmGUID())
{
- sLog.outError("CRASH ALARM! Player %s is not able to uncharm unit (Entry: %u, Type: %u)", GetName(), charm->GetEntry(), charm->GetTypeId());
+ sLog.outCrash("Player %s is not able to uncharm unit (Entry: %u, Type: %u)", GetName(), charm->GetEntry(), charm->GetTypeId());
}
}
@@ -16347,6 +16524,10 @@ void Player::Say(const std::string& text, const uint32 language)
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_SAY, text, language);
SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),true);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
+ sLog.outChat("[SAY] Player %s says (language %u): %s",
+ GetName(), language, text.c_str());
}
void Player::Yell(const std::string& text, const uint32 language)
@@ -16354,6 +16535,10 @@ void Player::Yell(const std::string& text, const uint32 language)
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_YELL, text, language);
SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),true);
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
+ sLog.outChat("[YELL] Player %s yells (language %u): %s",
+ GetName(), language, text.c_str());
}
void Player::TextEmote(const std::string& text)
@@ -16361,6 +16546,10 @@ void Player::TextEmote(const std::string& text)
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL);
SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT), true );
+
+ if(sWorld.getConfig(CONFIG_CHATLOG_PUBLIC))
+ sLog.outChat("[TEXTEMOTE] Player %s emotes: %s",
+ GetName(), text.c_str());
}
void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
@@ -16370,6 +16559,10 @@ void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
Player *rPlayer = objmgr.GetPlayer(receiver);
+ if(sWorld.getConfig(CONFIG_CHATLOG_WHISPER))
+ sLog.outChat("[WHISPER] Player %s tells %s: %s",
+ GetName(), rPlayer->GetName(), text.c_str());
+
// when player you are whispering to is dnd, he cannot receive your message, unless you are in gm mode
if(!rPlayer->isDND() || isGameMaster())
{
@@ -16406,71 +16599,80 @@ void Player::PetSpellInitialize()
{
Pet* pet = GetPet();
- if(pet)
- {
- uint8 addlist = 0;
+ if(!pet)
+ return;
- sLog.outDebug("Pet Spells Groups");
+ sLog.outDebug("Pet Spells Groups");
- CreatureInfo const *cinfo = pet->GetCreatureInfo();
+ CharmInfo *charmInfo = pet->GetCharmInfo();
- if(pet->isControlled() && (pet->getPetType() == HUNTER_PET || cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK))
- {
- for(PetSpellMap::iterator itr = pet->m_spells.begin();itr != pet->m_spells.end();++itr)
- {
- if(itr->second->state == PETSPELL_REMOVED)
- continue;
- ++addlist;
- }
- }
+ WorldPacket data(SMSG_PET_SPELLS, 8+4+4+4+10*4);
+ data << uint64(pet->GetGUID());
+ data << uint32(pet->GetCreatureInfo()->family); // creature family (required for pet talents)
+ data << uint32(0);
+ data << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0);
- // first line + actionbar + spellcount + spells + last adds
- WorldPacket data(SMSG_PET_SPELLS, 16+40+1+4*addlist+25);
+ // action bar loop
+ for(uint32 i = 0; i < MAX_SPELL_CONTROL_BAR; ++i)
+ {
+ data << uint32(charmInfo->GetActionBarEntry(i)->Raw);
+ }
- CharmInfo *charmInfo = pet->GetCharmInfo();
+ size_t spellsCountPos = data.wpos();
- //16
- data << (uint64)pet->GetGUID() << uint32(0x00000000) << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0);
+ // spells count
+ uint8 addlist = 0;
+ data << uint8(addlist); // placeholder
- for(uint32 i = 0; i < 10; i++) //40
+ if(pet->isControlled() && ((pet->getPetType() == HUNTER_PET) || ((pet->GetCreatureInfo()->type == CREATURE_TYPE_DEMON) && (getClass() == CLASS_WARLOCK))))
+ {
+ // spells loop
+ for (PetSpellMap::iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
{
- data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type);
+ if(itr->second->state == PETSPELL_REMOVED)
+ continue;
+
+ data << uint16(itr->first);
+ data << uint16(itr->second->active); // pet spell active state isn't boolean
+ ++addlist;
}
+ }
- data << uint8(addlist); //1
+ data.put<uint8>(spellsCountPos, addlist);
- if(addlist && pet->isControlled())
- {
- for (PetSpellMap::iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
- {
- if(itr->second->state == PETSPELL_REMOVED)
- continue;
+ uint8 cooldownsCount = pet->m_CreatureSpellCooldowns.size() + pet->m_CreatureCategoryCooldowns.size();
+ data << uint8(cooldownsCount);
- data << uint16(itr->first);
- data << uint16(itr->second->active); // pet spell active state isn't boolean
- }
- }
+ time_t curTime = time(NULL);
- //data << uint8(0x01) << uint32(0x6010) << uint32(0x01) << uint32(0x05) << uint16(0x00); //15
- uint8 count = 3; //1+8+8+8=25
+ for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
+ {
+ time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0;
- // if count = 0, then end of packet...
- data << count;
- // uint32 value is spell id...
- // uint64 value is constant 0, unknown...
- data << uint32(0x6010) << uint64(0); // if count = 1, 2 or 3
- //data << uint32(0x5fd1) << uint64(0); // if count = 2
- data << uint32(0x8e8c) << uint64(0); // if count = 3
- data << uint32(0x8e8b) << uint64(0); // if count = 3
+ data << uint16(itr->first); // spellid
+ data << uint16(0); // spell category?
+ data << uint32(cooldown); // cooldown
+ data << uint32(0); // category cooldown
+ }
- GetSession()->SendPacket(&data);
+ for(CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureCategoryCooldowns.begin(); itr != pet->m_CreatureCategoryCooldowns.end(); ++itr)
+ {
+ time_t cooldown = (itr->second > curTime) ? (itr->second - curTime) * IN_MILISECONDS : 0;
+
+ data << uint16(itr->first); // spellid
+ data << uint16(0); // spell category?
+ data << uint32(0); // cooldown
+ data << uint32(cooldown); // category cooldown
}
+
+ data.hexlike();
+
+ GetSession()->SendPacket(&data);
}
void Player::PossessSpellInitialize()
{
Unit* charm = GetCharm();
-
if(!charm)
return;
@@ -16482,32 +16684,69 @@ void Player::PossessSpellInitialize()
return;
}
- uint8 addlist = 0;
- WorldPacket data(SMSG_PET_SPELLS, 16+40+1+4*addlist+25);// first line + actionbar + spellcount + spells + last adds
+ WorldPacket data(SMSG_PET_SPELLS, 20+40+1+1);
- //16
- data << (uint64)charm->GetGUID() << uint32(0x00000000) << uint8(0) << uint8(0) << uint16(0);
+ //basic info 20
+ data << uint64(charm->GetGUID());
+ data << uint32(0x00000000);
+ data << uint32(0);
+ data << uint32(0);
- for(uint32 i = 0; i < 10; i++) //40
- {
+ //action bar 40
+ for(uint32 i = 0; i < 10; i++)
data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type);
- }
- data << uint8(addlist); //1
+ //addlist 1
+ data << uint8(0);
- uint8 count = 3;
- data << count;
- data << uint32(0x6010) << uint64(0); // if count = 1, 2 or 3
- data << uint32(0x8e8c) << uint64(0); // if count = 3
- data << uint32(0x8e8b) << uint64(0); // if count = 3
+ //cooldown 1
+ data << uint8(0);
GetSession()->SendPacket(&data);
}
-void Player::CharmSpellInitialize()
+void Player::VehicleSpellInitialize()
{
- Unit* charm = GetCharm();
+ Unit* charm = m_Vehicle;
+ if(!charm)
+ return;
+
+ WorldPacket data(SMSG_PET_SPELLS, 8+4+4+4+4*10+1+1);
+ data << uint64(charm->GetGUID());
+ data << uint32(0x00000000);
+ data << uint32(0x00000000);
+ data << uint32(0x00000101);
+
+ for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ {
+ uint32 spellId = ((Creature*)charm)->m_spells[i];
+ if(!spellId)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo)
+ continue;
+
+ if(IsPassiveSpell(spellId) || spellInfo->activeIconID == 2158) //flight
+ {
+ charm->CastSpell(charm, spellId, true);
+ data << uint16(0) << uint8(0) << uint8(i+8);
+ }
+ else
+ data << uint16(spellId) << uint8(0) << uint8(i+8);
+ }
+
+ for(uint32 i = CREATURE_MAX_SPELLS; i < MAX_SPELL_CONTROL_BAR; ++i)
+ data << uint16(0) << uint8(0) << uint8(i+8);
+
+ data << uint8(0);
+ data << uint8(0);
+ GetSession()->SendPacket(&data);
+}
+void Player::CharmSpellInitialize()
+{
+ Unit* charm = GetFirstControlled();
if(!charm)
return;
@@ -16519,14 +16758,12 @@ void Player::CharmSpellInitialize()
}
uint8 addlist = 0;
-
if(charm->GetTypeId() != TYPEID_PLAYER)
{
CreatureInfo const *cinfo = ((Creature*)charm)->GetCreatureInfo();
-
- if(cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK)
+ //if(cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK)
{
- for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for(uint32 i = 0; i < MAX_SPELL_CHARM; ++i)
{
if(charmInfo->GetCharmSpell(i)->spellId)
++addlist;
@@ -16534,27 +16771,29 @@ void Player::CharmSpellInitialize()
}
}
- WorldPacket data(SMSG_PET_SPELLS, 16+40+1+4*addlist+25);// first line + actionbar + spellcount + spells + last adds
-
- data << (uint64)charm->GetGUID() << uint32(0x00000000);
+ WorldPacket data(SMSG_PET_SPELLS, 20+40+1+4*addlist+1);// first line + actionbar + spellcount + spells + last adds
+ //basic info 20
+ data << uint64(charm->GetGUID());
+ data << uint32(0);
+ data << uint32(0);
if(charm->GetTypeId() != TYPEID_PLAYER)
data << uint8(((Creature*)charm)->GetReactState()) << uint8(charmInfo->GetCommandState());
else
data << uint8(0) << uint8(0);
-
data << uint16(0);
- for(uint32 i = 0; i < 10; i++) //40
+ //action bar 40
+ for(uint32 i = 0; i < MAX_SPELL_CONTROL_BAR; ++i) //40
{
data << uint16(charmInfo->GetActionBarEntry(i)->SpellOrAction) << uint16(charmInfo->GetActionBarEntry(i)->Type);
}
+ //add list
data << uint8(addlist); //1
-
if(addlist)
{
- for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for(uint32 i = 0; i < MAX_SPELL_CHARM; ++i)
{
CharmSpellEntry *cspell = charmInfo->GetCharmSpell(i);
if(cspell->spellId)
@@ -16565,49 +16804,19 @@ void Player::CharmSpellInitialize()
}
}
- uint8 count = 3;
- data << count;
- data << uint32(0x6010) << uint64(0); // if count = 1, 2 or 3
- data << uint32(0x8e8c) << uint64(0); // if count = 3
- data << uint32(0x8e8b) << uint64(0); // if count = 3
+ //cooldown
+ uint8 count = 0;
+ data << uint8(count); // cooldowns count
GetSession()->SendPacket(&data);
}
-int32 Player::GetTotalFlatMods(uint32 spellId, SpellModOp op)
+void Player::SendRemoveControlBar()
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if (!spellInfo) return 0;
- int32 total = 0;
- for (SpellModList::iterator itr = m_spellMods[op].begin(); itr != m_spellMods[op].end(); ++itr)
- {
- SpellModifier *mod = *itr;
-
- if(!IsAffectedBySpellmod(spellInfo,mod))
- continue;
-
- if (mod->type == SPELLMOD_FLAT)
- total += mod->value;
- }
- return total;
-}
-
-int32 Player::GetTotalPctMods(uint32 spellId, SpellModOp op)
-{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if (!spellInfo) return 0;
- int32 total = 0;
- for (SpellModList::iterator itr = m_spellMods[op].begin(); itr != m_spellMods[op].end(); ++itr)
- {
- SpellModifier *mod = *itr;
-
- if(!IsAffectedBySpellmod(spellInfo,mod))
- continue;
-
- if (mod->type == SPELLMOD_PCT)
- total += mod->value;
- }
- return total;
+ WorldPacket data(SMSG_PET_SPELLS, 8+4);
+ data << uint64(0);
+ data << uint32(0);
+ GetSession()->SendPacket(&data);
}
bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mod, Spell const* spell)
@@ -16627,22 +16836,27 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo
return false;
}
- return spellmgr.IsAffectedBySpell(spellInfo,mod->spellId,mod->effectId,mod->mask);
+ return spellmgr.IsAffectedByMod(spellInfo, mod);
}
void Player::AddSpellMod(SpellModifier* mod, bool apply)
{
uint16 Opcode= (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER;
- for(int eff=0;eff<64;++eff)
+ uint8 i=0;
+ flag96 _mask;
+ for(int eff=0;eff<96;++eff)
{
- uint64 _mask = uint64(1) << eff;
+ if ((eff!=0) && (eff%32==0))
+ i++;
+
+ _mask[i] = uint32(1) << (eff-(32*i));
if ( mod->mask & _mask)
{
int32 val = 0;
for (SpellModList::iterator itr = m_spellMods[mod->op].begin(); itr != m_spellMods[mod->op].end(); ++itr)
{
- if ((*itr)->type == mod->type && (*itr)->mask & _mask)
+ if ((*itr)->type == mod->type && (*itr)->mask & _mask )
val += (*itr)->value;
}
val += apply ? mod->value : -(mod->value);
@@ -16679,7 +16893,7 @@ void Player::RemoveSpellMods(Spell const* spell)
if (mod && mod->charges == -1 && (mod->lastAffected == spell || mod->lastAffected==NULL))
{
- RemoveAurasDueToSpell(mod->spellId);
+ RemoveAurasDueToSpell(mod->spellId, 0, AURA_REMOVE_BY_EXPIRE);
if (m_spellMods[i].empty())
break;
else
@@ -16741,6 +16955,27 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
CharacterDatabase.CommitTransaction();
}
+void Player::LeaveAllArenaTeams(uint64 guid)
+{
+ QueryResult *result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u'", GUID_LOPART(guid));
+ if(!result)
+ return;
+
+ do
+ {
+ Field *fields = result->Fetch();
+ uint32 at_id = fields[0].GetUInt32();
+ if(at_id != 0)
+ {
+ ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
+ if(at)
+ at->DelMember(guid);
+ }
+ } while (result->NextRow());
+
+ delete result;
+}
+
void Player::SetRestBonus (float rest_bonus_new)
{
// Prevent resting on max level
@@ -16771,7 +17006,7 @@ void Player::HandleStealthedUnitsDetection()
{
std::list<Unit*> stealthedUnits;
Trinity::AnyStealthedCheck u_check;
- Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(stealthedUnits, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(this, stealthedUnits, u_check);
VisitNearbyObject(World::GetMaxVisibleDistance(), searcher);
for (std::list<Unit*>::iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i)
@@ -16919,6 +17154,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
//Checks and preparations done, DO FLIGHT
ModifyMoney(-(int32)totalcost);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost);
// prevent stealth flight
//RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
@@ -16961,7 +17197,7 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
{
data << unSpellId;
data << unTimeMs; // in m.secs
- AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/1000);
+ AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/IN_MILISECONDS);
}
}
GetSession()->SendPacket(&data);
@@ -17328,6 +17564,102 @@ void Player::UpdatePvP(bool state, bool ovrride)
}
}
+void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
+{
+ // init cooldown values
+ uint32 cat = 0;
+ int32 rec = -1;
+ int32 catrec = -1;
+
+ // some special item spells without correct cooldown in SpellInfo
+ // cooldown information stored in item prototype
+ // This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
+
+ if(itemId)
+ {
+ if(ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId))
+ {
+ for(int idx = 0; idx < 5; ++idx)
+ {
+ if(proto->Spells[idx].SpellId == spellInfo->Id)
+ {
+ cat = proto->Spells[idx].SpellCategory;
+ rec = proto->Spells[idx].SpellCooldown;
+ catrec = proto->Spells[idx].SpellCategoryCooldown;
+ break;
+ }
+ }
+ }
+ }
+
+ // if no cooldown found above then base at DBC data
+ if(rec < 0 && catrec < 0)
+ {
+ cat = spellInfo->Category;
+ rec = spellInfo->RecoveryTime;
+ catrec = spellInfo->CategoryRecoveryTime;
+ }
+
+ time_t curTime = time(NULL);
+
+ time_t catrecTime;
+ time_t recTime;
+
+ // overwrite time for selected category
+ if(infinityCooldown)
+ {
+ // use +MONTH as infinity mark for spell cooldown (will checked as MONTH/2 at save ans skipped)
+ // but not allow ignore until reset or re-login
+ catrecTime = catrec > 0 ? curTime+MONTH : 0;
+ recTime = rec > 0 ? curTime+MONTH : catrecTime;
+ }
+ else
+ {
+ // shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK)
+ // prevent 0 cooldowns set by another way
+ if (rec <= 0 && catrec <= 0 && (cat == 76 || IsAutoRepeatRangedSpell(spellInfo) && spellInfo->Id != SPELL_ID_AUTOSHOT))
+ rec = GetAttackTime(RANGED_ATTACK);
+
+ // Now we have cooldown data (if found any), time to apply mods
+ if(rec > 0)
+ ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, rec, spell);
+
+ if(catrec > 0)
+ ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, catrec, spell);
+
+ // replace negative cooldowns by 0
+ if (rec < 0) rec = 0;
+ if (catrec < 0) catrec = 0;
+
+ // no cooldown after applying spell mods
+ if( rec == 0 && catrec == 0)
+ return;
+
+ catrecTime = catrec ? curTime+catrec/IN_MILISECONDS : 0;
+ recTime = rec ? curTime+rec/IN_MILISECONDS : catrecTime;
+ }
+
+ // self spell cooldown
+ if(recTime > 0)
+ AddSpellCooldown(spellInfo->Id, itemId, recTime);
+
+ // category spells
+ if (cat && catrec > 0)
+ {
+ SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat);
+ if(i_scstore != sSpellCategoryStore.end())
+ {
+ for(SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset)
+ {
+ if(*i_scset == spellInfo->Id) // skip main spell, already handled above
+ continue;
+
+ AddSpellCooldown(*i_scset, itemId, catrecTime);
+ }
+ }
+ }
+}
+
void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
{
SpellCooldown sc;
@@ -17336,25 +17668,41 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
m_spellCooldowns[spellid] = sc;
}
-void Player::SendCooldownEvent(SpellEntry const *spellInfo)
+void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell)
{
- if ( !(spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) )
- return;
+ // start cooldowns at server side, if any
+ AddSpellAndCategoryCooldowns(spellInfo,itemId,spell);
- // Get spell cooldown
- int32 cooldown = GetSpellRecoveryTime(spellInfo);
- // Apply spellmods
- ApplySpellMod(spellInfo->Id, SPELLMOD_COOLDOWN, cooldown);
- if (cooldown < 0)
- cooldown = 0;
- // Add cooldown
- AddSpellCooldown(spellInfo->Id, 0, time(NULL) + cooldown / 1000);
- // Send activate
+ // Send activate cooldown timer (possible 0) at client side
WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8));
data << spellInfo->Id;
data << GetGUID();
SendDirectMessage(&data);
}
+
+void Player::UpdatePotionCooldown(Spell* spell)
+{
+ // no potion used i combat or still in combat
+ if(!m_lastPotionId || isInCombat())
+ return;
+
+ // 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)
+ if(ItemPrototype const* proto = ObjectMgr::GetItemPrototype(m_lastPotionId))
+ for(int idx = 0; idx < 5; ++idx)
+ if(proto->Spells[idx].SpellId && proto->Spells[idx].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
+ if(SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[idx].SpellId))
+ SendCooldownEvent(spellInfo,m_lastPotionId);
+ }
+ // from spell cases (m_lastPotionId set in Spell::SendSpellCooldown)
+ else
+ SendCooldownEvent(spell->m_spellInfo,m_lastPotionId,spell);
+
+ m_lastPotionId = 0;
+}
+
//slot to be excluded while counting
bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
{
@@ -17519,13 +17867,14 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
{
if(BattleGround *bg = GetBattleGround())
{
- bool need_debuf = bg->isBattleGround() && (bg->GetStatus() == STATUS_IN_PROGRESS) && sWorld.getConfig(CONFIG_BATTLEGROUND_CAST_DESERTER);
-
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
// call after remove to be sure that player resurrected for correct cast
- if(need_debuf)
- CastSpell(this, 26013, true); // Deserter
+ if( bg->isBattleGround() && sWorld.getConfig(CONFIG_BATTLEGROUND_CAST_DESERTER) )
+ {
+ if( bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN )
+ CastSpell(this, 26013, true); // Deserter
+ }
}
}
@@ -17571,9 +17920,13 @@ void Player::ReportedAfkBy(Player* reporter)
bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const
{
// Always can see self
- if (u == this)
+ if (m_mover == u || this == u)
return true;
+ // phased visibility (both must phased in same way)
+ if(!InSamePhase(u))
+ return false;
+
// player visible for other player if not logout and at same transport
// including case when player is out of world
bool at_same_transport =
@@ -17599,38 +17952,33 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
if(!u->IsVisibleInGridForPlayer(this))
return false;
- // If the player is currently channeling vision, update visibility from the target unit's location
- const WorldObject* target = GetFarsightTarget();
- if (!target || !HasFarsightVision()) // Vision needs to be on the farsight target
- target = this;
-
// different visible distance checks
if(isInFlight()) // what see player in flight
{
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
+ if (!m_seer->IsWithinDistInMap(u,World::GetMaxVisibleDistanceInFlight()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(!u->isAlive()) // distance for show body
{
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
+ if (!m_seer->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(u->GetTypeId()==TYPEID_PLAYER) // distance for show player
{
// Players far than max visible distance for player or not in our map are not visible too
- if (!at_same_transport && !target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
+ if (!at_same_transport && !m_seer->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
return false;
}
else if(u->GetCharmerOrOwnerGUID()) // distance for show pet/charmed
{
// Pet/charmed far than max visible distance for player or not in our map are not visible too
- if (!target->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
+ if (!m_seer->IsWithinDistInMap(u,World::GetMaxVisibleDistanceForPlayer()+(inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f), is3dDistance))
return false;
}
else // distance for show creature
{
// Units far than max visible distance for creature or not in our map are not visible too
- if (!target->IsWithinDistInMap(u
+ if (!m_seer->IsWithinDistInMap(u
, u->isActiveObject() ? (MAX_VISIBILITY_DISTANCE - (inVisibleList ? 0.0f : World::GetVisibleUnitGreyDistance()))
: (World::GetMaxVisibleDistanceForCreature() + (inVisibleList ? World::GetVisibleUnitGreyDistance() : 0.0f))
, is3dDistance))
@@ -17651,7 +17999,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
}
// GM's can see everyone with invisibilitymask with less or equal security level
- if(m_invisibilityMask || u->m_invisibilityMask)
+ if(m_mover->m_invisibilityMask || u->m_invisibilityMask)
{
if(isGameMaster())
{
@@ -17662,7 +18010,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
}
// player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting)
- if(!canDetectInvisibilityOf(u))
+ if(!m_mover->canDetectInvisibilityOf(u))
if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u))))
return false;
}
@@ -17677,7 +18025,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
detect = false;
if(m_DetectInvTimer < 300 || !HaveAtClient(u))
if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u))))
- if(!detect || !canDetectStealthOf(u, GetDistance(u)))
+ if(!detect || !m_mover->canDetectStealthOf(u, GetDistance(u)))
return false;
}
@@ -17790,7 +18138,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
void Player::SendInitialVisiblePackets(Unit* target)
{
- SendAuraDurationsForTarget(target);
+ SendAurasForTarget(target);
if(target->isAlive())
{
if(target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
@@ -17909,7 +18257,7 @@ void Player::AddComboPoints(Unit* target, int8 count)
return;
// without combo points lost (duration checked in aura)
- RemoveSpellsCausingAura(SPELL_AURA_RETAIN_COMBO_POINTS);
+ RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
if(target->GetGUID() == m_comboTarget)
{
@@ -17939,7 +18287,7 @@ void Player::ClearComboPoints()
return;
// without combopoints lost (duration checked in aura)
- RemoveSpellsCausingAura(SPELL_AURA_RETAIN_COMBO_POINTS);
+ RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
m_comboPoints = 0;
@@ -17953,7 +18301,8 @@ void Player::ClearComboPoints()
void Player::SetGroup(Group *group, int8 subgroup)
{
- if(group == NULL) m_group.unlink();
+ if(group == NULL)
+ m_group.unlink();
else
{
// never use SetGroup without a subgroup unless you specify NULL for group
@@ -17965,7 +18314,7 @@ void Player::SetGroup(Group *group, int8 subgroup)
void Player::SendInitialPacketsBeforeAddToMap()
{
- WorldPacket data(SMSG_SET_REST_START, 4);
+ WorldPacket data(SMSG_SET_REST_START_OBSOLETE, 4);
data << uint32(0); // unknown, may be rest state time or experience
GetSession()->SendPacket(&data);
@@ -17992,9 +18341,13 @@ void Player::SendInitialPacketsBeforeAddToMap()
GetSession()->SendPacket(&data);
SendInitialActionButtons();
- SendInitialReputations();
- UpdateZone(GetZoneId());
- SendInitWorldStates();
+ m_reputationMgr.SendInitialReputations();
+ m_achievementMgr.SendAllAchievementData();
+
+ // update zone
+ uint32 newzone, newarea;
+ GetZoneAndAreaId(newzone,newarea);
+ UpdateZone(newzone,newarea); // also call SendInitWorldStates();
// SMSG_SET_AURA_SINGLE
@@ -18006,10 +18359,17 @@ void Player::SendInitialPacketsBeforeAddToMap()
// set fly flag if in fly form or taxi flight to prevent visually drop at ground in showup moment
if(HasAuraType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED) || isInFlight())
AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
+
+ m_mover = this;
+ m_seer = this;
}
void Player::SendInitialPacketsAfterAddToMap()
{
+ WorldPacket data(SMSG_TIME_SYNC_REQ, 4); // new 2.0.x, enable movement
+ data << uint32(0x00000000); // on blizz it increments periodically
+ GetSession()->SendPacket(&data);
+
CastSpell(this, 836, true); // LOGINEFFECT
// set some aura effects that send packet to player client after add player to map
@@ -18023,7 +18383,7 @@ void Player::SendInitialPacketsAfterAddToMap()
};
for(AuraType const* itr = &auratypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr)
{
- Unit::AuraList const& auraList = GetAurasByType(*itr);
+ Unit::AuraEffectList const& auraList = GetAurasByType(*itr);
if(!auraList.empty())
auraList.front()->ApplyModifier(true,true);
}
@@ -18040,6 +18400,7 @@ void Player::SendInitialPacketsAfterAddToMap()
SendMessageToSet(&data,true);
}
+ SendAurasForTarget(this);
SendEnchantmentDurations(); // must be after add to map
SendItemDurations(); // must be after add to map
}
@@ -18052,16 +18413,24 @@ void Player::SendUpdateToOutOfRangeGroupMembers()
group->UpdatePlayerOutOfRange(this);
m_groupUpdateMask = GROUP_UPDATE_FLAG_NONE;
- m_auraUpdateMask = 0;
+ m_auraRaidUpdateMask = 0;
if(Pet *pet = GetPet())
- pet->ResetAuraUpdateMask();
+ pet->ResetAuraUpdateMaskForRaid();
}
-void Player::SendTransferAborted(uint32 mapid, uint16 reason)
+void Player::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg)
{
WorldPacket data(SMSG_TRANSFER_ABORTED, 4+2);
data << uint32(mapid);
- data << uint16(reason); // transfer abort reason
+ data << uint8(reason); // transfer abort reason
+ switch(reason)
+ {
+ case TRANSFER_ABORT_INSUF_EXPAN_LVL:
+ case TRANSFER_ABORT_DIFFICULTY:
+ case TRANSFER_ABORT_UNIQUE_MESSAGE:
+ data << uint8(arg);
+ break;
+ }
GetSession()->SendPacket(&data);
}
@@ -18086,7 +18455,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, uint32 time)
void Player::ApplyEquipCooldown( Item * pItem )
{
- for(int i = 0; i <5; ++i)
+ for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
_Spell const& spellData = pItem->GetProto()->Spells[i];
@@ -18127,22 +18496,18 @@ void Player::resetSpells()
learnQuestRewardedSpells();
}
-void Player::learnDefaultSpells(bool loading)
+void Player::learnDefaultSpells()
{
// learn default race/class spells
PlayerInfo const *info = objmgr.GetPlayerInfo(getRace(),getClass());
- std::list<CreateSpellPair>::const_iterator spell_itr;
- for (spell_itr = info->spell.begin(); spell_itr!=info->spell.end(); ++spell_itr)
+ for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr!=info->spell.end(); ++itr)
{
- uint16 tspell = spell_itr->first;
- if (tspell)
- {
- sLog.outDebug("PLAYER: Adding initial spell, id = %u",tspell);
- if(loading || !spell_itr->second) // not care about passive spells or loading case
- addSpell(tspell,spell_itr->second);
- else // but send in normal spell in game learn case
- learnSpell(tspell);
- }
+ uint32 tspell = *itr;
+ sLog.outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",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
+ learnSpell(tspell,true);
}
}
@@ -18234,7 +18599,7 @@ void Player::learnQuestRewardedSpells()
}
}
-void Player::learnSkillRewardedSpells(uint32 skill_id )
+void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )
{
uint32 raceMask = getRaceMask();
uint32 classMask = getClassMask();
@@ -18252,35 +18617,56 @@ void Player::learnSkillRewardedSpells(uint32 skill_id )
if (sSpellStore.LookupEntry(pAbility->spellId))
{
- // Ok need learn spell
- learnSpell(pAbility->spellId);
+ // need unlearn spell
+ if (skill_value < pAbility->req_skill_value)
+ removeSpell(pAbility->spellId);
+ // need learn
+ else if (!IsInWorld())
+ addSpell(pAbility->spellId,true,true,true,false);
+ else
+ learnSpell(pAbility->spellId,true);
}
}
}
-void Player::learnSkillRewardedSpells()
+void Player::SendAurasForTarget(Unit *target)
{
- for (uint16 i=0; i < PLAYER_MAX_SKILLS; i++)
- {
- if(!GetUInt32Value(PLAYER_SKILL_INDEX(i)))
- continue;
-
- uint32 pskill = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
+ if(!target || target->GetVisibleAuras()->empty()) // speedup things
+ return;
- learnSkillRewardedSpells(pskill);
- }
-}
+ WorldPacket data(SMSG_AURA_UPDATE_ALL);
+ data.append(target->GetPackGUID());
-void Player::SendAuraDurationsForTarget(Unit* target)
-{
- for(Unit::AuraMap::const_iterator itr = target->GetAuras().begin(); itr != target->GetAuras().end(); ++itr)
+ Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
+ for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{
- Aura* aura = itr->second;
- if(aura->GetAuraSlot() >= MAX_AURAS || aura->IsPassive() || aura->GetCasterGUID()!=GetGUID())
- continue;
+ Aura * aura=itr->second;
+ data << uint8(aura->GetAuraSlot());
+ data << uint32(aura->GetId());
- aura->SendAuraDurationForCaster(this);
+ // flags
+ data << aura->m_auraFlags;
+ // level
+ data << aura->m_auraLevel;
+ // charges
+ data << uint8(aura->GetStackAmount()>1 ? aura->GetStackAmount() : aura->GetAuraCharges());
+
+ if(!(aura->m_auraFlags & AFLAG_CASTER))
+ {
+ if (Unit * caster = aura->GetCaster())
+ data.append(caster->GetPackGUID());
+ else
+ data << uint8(0);
+ }
+
+ if(aura->m_auraFlags & AFLAG_DURATION) // include aura duration
+ {
+ data << uint32(aura->GetAuraMaxDuration());
+ data << uint32(aura->GetAuraDuration());
+ }
}
+
+ GetSession()->SendPacket(&data);
}
void Player::SetDailyQuestStatus( uint32 quest_id )
@@ -18312,7 +18698,7 @@ BattleGround* Player::GetBattleGround() const
if(GetBattleGroundId()==0)
return NULL;
- return sBattleGroundMgr.GetBattleGround(GetBattleGroundId());
+ return sBattleGroundMgr.GetBattleGround(GetBattleGroundId(), m_bgTypeID);
}
bool Player::InArena() const
@@ -18324,7 +18710,7 @@ bool Player::InArena() const
return true;
}
-bool Player::GetBGAccessByLevel(uint32 bgTypeId) const
+bool Player::GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const
{
// get a template bg instead of running one
BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
@@ -18337,46 +18723,26 @@ bool Player::GetBGAccessByLevel(uint32 bgTypeId) const
return true;
}
-uint32 Player::GetMinLevelForBattleGroundQueueId(uint32 queue_id)
-{
- if(queue_id < 1)
- return 0;
-
- if(queue_id >=6)
- queue_id = 6;
-
- return 10*(queue_id+1);
-}
-
-uint32 Player::GetMaxLevelForBattleGroundQueueId(uint32 queue_id)
-{
- if(queue_id >=6)
- return 255; // hardcoded max level
-
- return 10*(queue_id+2)-1;
-}
-
-//TODO make this more generic - current implementation is wrong
-uint32 Player::GetBattleGroundQueueIdFromLevel() const
+BGQueueIdBasedOnLevel Player::GetBattleGroundQueueIdFromLevel(BattleGroundTypeId bgTypeId) const
{
+ //returned to hardcoded version of this function, because there is no way to code it dynamic
uint32 level = getLevel();
- if(level <= 19)
- return 0;
- else if (level > 69)
- return 6;
- else
- return level/10 - 1; // 20..29 -> 1, 30-39 -> 2, ...
- /*
- assert(bgTypeId < MAX_BATTLEGROUND_TYPES);
- BattleGround *bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
- assert(bg);
- return (getLevel() - bg->GetMinLevel()) / 10;*/
+ if( bgTypeId == BATTLEGROUND_AV )
+ level--;
+
+ uint32 queue_id = (level / 10) - 1; // for ranges 0 - 19, 20 - 29, 30 - 39, 40 - 49, 50 - 59, 60 - 69, 70 -79, 80
+ if( queue_id >= MAX_BATTLEGROUND_QUEUES )
+ {
+ sLog.outError("BattleGround: too high queue_id %u this shouldn't happen", queue_id);
+ return QUEUE_ID_MAX_LEVEL_80;
+ }
+ return BGQueueIdBasedOnLevel(queue_id);
}
float Player::GetReputationPriceDiscount( Creature const* pCreature ) const
{
FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry();
- if(!vendor_faction)
+ if(!vendor_faction || !vendor_faction->faction)
return 1.0f;
ReputationRank rank = GetReputationRank(vendor_faction->faction);
@@ -18393,28 +18759,42 @@ bool Player::IsSpellFitByClassAndRace( uint32 spell_id ) const
SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id);
SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id);
+ if(lower==upper)
+ return true;
for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
{
// skip wrong race skills
if( _spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0)
- return false;
+ continue;
// skip wrong class skills
if( _spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0)
- return false;
+ continue;
+
+ return true;
}
- return true;
+
+ return false;
}
-bool Player::HasQuestForGO(int32 GOId)
+bool Player::HasQuestForGO(int32 GOId) const
{
- for( QuestStatusMap::iterator i = mQuestStatus.begin( ); i != mQuestStatus.end( ); ++i )
+ for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
- QuestStatusData qs=i->second;
+ uint32 questid = GetQuestSlotQuestId(i);
+ if ( questid == 0 )
+ continue;
+
+ QuestStatusMap::const_iterator qs_itr = mQuestStatus.find(questid);
+ if(qs_itr == mQuestStatus.end())
+ continue;
+
+ QuestStatusData const& qs = qs_itr->second;
+
if (qs.m_status == QUEST_STATUS_INCOMPLETE)
{
- Quest const* qinfo = objmgr.GetQuestTemplate(i->first);
+ Quest const* qinfo = objmgr.GetQuestTemplate(questid);
if(!qinfo)
continue;
@@ -18474,6 +18854,7 @@ void Player::SummonIfPossible(bool agree)
}
// drop flag at summon
+ // this code can be reached only when GM is summoning player who carries flag, because player should be immune to summoning spells when he carries flag
if(BattleGround *bg = GetBattleGround())
bg->EventPlayerDroppedFlag(this);
@@ -18509,9 +18890,8 @@ void Player::AutoUnequipOffhandIfNeed()
if(!offItem)
return;
- Item *mainItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );
-
- if(!mainItem || mainItem->GetProto()->InventoryType != INVTYPE_2HWEAPON)
+ // need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
+ if (CanTitanGrip() || (offItem->GetProto()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed()))
return;
ItemPosCountVec off_dest;
@@ -18523,7 +18903,16 @@ void Player::AutoUnequipOffhandIfNeed()
}
else
{
- sLog.outError("Player::EquipItem: Can's store offhand item at 2hand item equip for player (GUID: %u).",GetGUIDLow());
+ MailItemsInfo mi;
+ mi.AddItem(offItem->GetGUIDLow(), offItem->GetEntry(), offItem);
+ MoveItemFromInventory(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND, true);
+ CharacterDatabase.BeginTransaction();
+ offItem->DeleteFromInventoryDB(); // deletes item from character's inventory
+ offItem->SaveToDB(); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
+ CharacterDatabase.CommitTransaction();
+
+ std::string subject = GetSession()->GetMangosString(LANG_NOT_EQUIPPED_ITEM);
+ WorldSession::SendMailTo(this, MAIL_NORMAL, MAIL_STATIONERY_GM, GetGUIDLow(), GetGUIDLow(), subject, 0, &mi, 0, 0, MAIL_CHECK_MASK_NONE);
}
}
@@ -18544,7 +18933,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
case ITEM_CLASS_WEAPON:
{
for(int i= EQUIPMENT_SLOT_MAINHAND; i < EQUIPMENT_SLOT_TABARD; ++i)
- if(Item *item = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i ))
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
return true;
break;
@@ -18553,17 +18942,17 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
{
// tabard not have dependent spells
for(int i= EQUIPMENT_SLOT_START; i< EQUIPMENT_SLOT_MAINHAND; ++i)
- if(Item *item = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
+ if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, i ))
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
return true;
// shields can be equipped to offhand slot
- if(Item *item = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
return true;
// ranged slot can have some armor subclasses
- if(Item *item = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
+ if(Item *item = GetUseableItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
if(item!=ignoreItem && item->IsFitToSpellRequirements(spellInfo))
return true;
@@ -18577,6 +18966,24 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons
return false;
}
+bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const
+{
+ // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP
+ if (spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP &&
+ HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION))
+ return true;
+
+ // Check no reagent use mask
+ flag96 noReagentMask;
+ noReagentMask[0] = GetUInt32Value(PLAYER_NO_REAGENT_COST_1);
+ noReagentMask[1] = GetUInt32Value(PLAYER_NO_REAGENT_COST_1+1);
+ noReagentMask[2] = GetUInt32Value(PLAYER_NO_REAGENT_COST_1+2);
+ if (spellInfo->SpellFamilyFlags & noReagentMask)
+ return true;
+
+ return false;
+}
+
void Player::RemoveItemDependentAurasAndCasts( Item * pItem )
{
AuraMap& auras = GetAuras();
@@ -18600,8 +19007,7 @@ void Player::RemoveItemDependentAurasAndCasts( Item * pItem )
}
// no alt item, remove aura, restart check
- RemoveAurasDueToSpell(aura->GetId());
- itr = auras.begin();
+ RemoveAura(itr);
}
// currently casted spells can be dependent from item
@@ -18618,11 +19024,11 @@ uint32 Player::GetResurrectionSpellId()
// search priceless resurrection possibilities
uint32 prio = 0;
uint32 spell_id = 0;
- AuraList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
- for(AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
+ AuraEffectList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
{
// Soulstone Resurrection // prio: 3 (max, non death persistent)
- if( prio < 2 && (*itr)->GetSpellProto()->SpellVisual == 99 && (*itr)->GetSpellProto()->SpellIconID == 92 )
+ if( prio < 2 && (*itr)->GetSpellProto()->SpellVisual[0] == 99 && (*itr)->GetSpellProto()->SpellIconID == 92 )
{
switch((*itr)->GetId())
{
@@ -18632,6 +19038,7 @@ uint32 Player::GetResurrectionSpellId()
case 20764: spell_id = 20760; break; // rank 4
case 20765: spell_id = 20761; break; // rank 5
case 27239: spell_id = 27240; break; // rank 6
+ case 47883: spell_id = 47882; break; // rank 7
default:
sLog.outError("Unhandled spell %%u: S.Resurrection",(*itr)->GetId());
continue;
@@ -18654,6 +19061,26 @@ uint32 Player::GetResurrectionSpellId()
return spell_id;
}
+// Used in triggers for check "Only to targets that grant experience or honor" req
+bool Player::isHonorOrXPTarget(Unit* pVictim)
+{
+ uint32 v_level = pVictim->getLevel();
+ uint32 k_grey = Trinity::XP::GetGrayLevel(getLevel());
+
+ // Victim level less gray level
+ if(v_level<=k_grey)
+ return false;
+
+ if(pVictim->GetTypeId() == TYPEID_UNIT)
+ {
+ if (((Creature*)pVictim)->isTotem() ||
+ ((Creature*)pVictim)->isPet() ||
+ ((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
+ return false;
+ }
+ return true;
+}
+
bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
{
bool PvP = pVictim->isCharmedOwnedByPlayerOrPlayer();
@@ -18751,6 +19178,31 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
return xp || honored_kill;
}
+void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
+{
+ uint64 creature_guid = pRewardSource->GetTypeId()==TYPEID_UNIT ? pRewardSource->GetGUID() : uint64(0);
+
+ // prepare data for near group iteration
+ if(Group *pGroup = GetGroup())
+ {
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* pGroupGuy = itr->getSource();
+ if(!pGroupGuy)
+ continue;
+
+ if(!pGroupGuy->IsAtGroupRewardDistance(pRewardSource))
+ continue; // member (alive or dead) or his corpse at req. distance
+
+ // quest objectives updated only for alive group member or dead but with not released body
+ if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
+ pGroupGuy->KilledMonster(creature_id, creature_guid);
+ }
+ }
+ else // if (!pGroup)
+ KilledMonster(creature_id, creature_guid);
+}
+
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
{
if(pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE))
@@ -18781,6 +19233,9 @@ uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
void Player::ResurectUsingRequestData()
{
+ /// Teleport before resurrecting, otherwise the player might get attacked from creatures near his corpse
+ TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation());
+
ResurrectPlayer(0.0f,false);
if(GetMaxHealth() > m_resurrectHealth)
@@ -18798,8 +19253,6 @@ void Player::ResurectUsingRequestData()
SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY) );
SpawnCorpseBones();
-
- TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation());
}
void Player::SetClientControl(Unit* target, uint8 allowMove)
@@ -18813,29 +19266,18 @@ void Player::SetClientControl(Unit* target, uint8 allowMove)
void Player::UpdateZoneDependentAuras( uint32 newZone )
{
// remove new continent flight forms
- if( !isGameMaster() &&
- GetVirtualMapForMapAndZone(GetMapId(),newZone) != 530)
+ if( !IsAllowUseFlyMountsHere() )
{
- RemoveSpellsCausingAura(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
- RemoveSpellsCausingAura(SPELL_AURA_FLY);
+ RemoveAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
+ RemoveAurasByType(SPELL_AURA_FLY);
}
- // Some spells applied at enter into zone (with subzones)
- // Human Illusion
- // NOTE: these are removed by RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP);
- if ( newZone == 2367 ) // Old Hillsbrad Foothills
- {
- uint32 spellid = 0;
- // all horde races
- if( GetTeam() == HORDE )
- spellid = getGender() == GENDER_FEMALE ? 35481 : 35480;
- // and some alliance races
- else if( getRace() == RACE_NIGHTELF || getRace() == RACE_DRAENEI )
- spellid = getGender() == GENDER_FEMALE ? 35483 : 35482;
-
- if(spellid && !HasAura(spellid,0) )
- CastSpell(this,spellid,true);
- }
+ // Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update
+ SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAreaMapBounds(newZone);
+ for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
+ if(itr->second->autocast && itr->second->IsFitToRequirements(this,newZone,0))
+ if( !HasAura(itr->second->spellId) )
+ CastSpell(this,itr->second->spellId,true);
}
void Player::UpdateAreaDependentAuras( uint32 newArea )
@@ -18844,26 +19286,18 @@ void Player::UpdateAreaDependentAuras( uint32 newArea )
for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
{
// use m_zoneUpdateId for speed: UpdateArea called from UpdateZone or instead UpdateZone in both cases m_zoneUpdateId up-to-date
- if(!IsSpellAllowedInLocation(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea))
+ if(spellmgr.GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this) != SPELL_CAST_OK)
RemoveAura(iter);
else
++iter;
}
- // unmount if enter in this subzone
- if( newArea == 35)
- RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
- // Dragonmaw Illusion
- else if( newArea == 3759 || newArea == 3966 || newArea == 3939 )
- {
- if( GetDummyAura(40214) )
- {
- if( !HasAura(40216,0) )
- CastSpell(this,40216,true);
- if( !HasAura(42016,0) )
- CastSpell(this,42016,true);
- }
- }
+ // some auras applied at subzone enter
+ SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAreaMapBounds(newArea);
+ for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
+ if(itr->second->autocast && itr->second->IsFitToRequirements(this,m_zoneUpdateId,newArea))
+ if( !HasAura(itr->second->spellId) )
+ CastSpell(this,itr->second->spellId,true);
}
uint32 Player::GetCorpseReclaimDelay(bool pvp) const
@@ -18949,7 +19383,7 @@ void Player::SendCorpseReclaimDelay(bool load)
//! corpse reclaim delay 30 * 1000ms or longer at often deaths
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
- data << uint32(delay*1000);
+ data << uint32(delay*IN_MILISECONDS);
GetSession()->SendPacket( &data );
}
@@ -18994,21 +19428,85 @@ PartyResult Player::CanUninviteFromGroup() const
return PARTY_RESULT_OK;
}
+void Player::SetBattleGroundRaid(Group* group, int8 subgroup)
+{
+ //we must move references from m_group to m_originalGroup
+ SetOriginalGroup(GetGroup(), GetSubGroup());
+
+ m_group.unlink();
+ m_group.link(group, this);
+ m_group.setSubGroup((uint8)subgroup);
+}
+
+void Player::RemoveFromBattleGroundRaid()
+{
+ //remove existing reference
+ m_group.unlink();
+ if( Group* group = GetOriginalGroup() )
+ {
+ m_group.link(group, this);
+ m_group.setSubGroup(GetOriginalSubGroup());
+ }
+ SetOriginalGroup(NULL);
+}
+
+void Player::SetOriginalGroup(Group *group, int8 subgroup)
+{
+ if( group == NULL )
+ m_originalGroup.unlink();
+ else
+ {
+ // never use SetOriginalGroup without a subgroup unless you specify NULL for group
+ assert(subgroup >= 0);
+ m_originalGroup.link(group, this);
+ m_originalGroup.setSubGroup((uint8)subgroup);
+ }
+}
+
void Player::UpdateUnderwaterState( Map* m, float x, float y, float z )
{
- float water_z = m->GetWaterLevel(x,y);
- float height_z = m->GetHeight(x,y,z, false); // use .map base surface height
- uint8 flag1 = m->GetTerrainType(x,y);
+ LiquidData liquid_status;
+ ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status);
+ if (!res)
+ {
+ m_MirrorTimerFlags &= ~(UNDERWATER_INWATER|UNDERWATER_INLAVA|UNDERWATER_INSLIME|UNDERWARER_INDARKWATER);
+ // Small hack for enable breath in WMO
+ if (IsInWater())
+ m_MirrorTimerFlags|=UNDERWATER_INWATER;
+ return;
+ }
- //!Underwater check, not in water if underground or above water level
- if (height_z <= INVALID_HEIGHT || z < (height_z-2) || z > (water_z - 2) )
- m_isunderwater &= 0x7A;
- else if ((z < (water_z - 2)) && (flag1 & 0x01))
- m_isunderwater |= 0x01;
+ // All liquids type - check under water position
+ if (liquid_status.type&(MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN|MAP_LIQUID_TYPE_MAGMA|MAP_LIQUID_TYPE_SLIME))
+ {
+ if ( res & LIQUID_MAP_UNDER_WATER)
+ m_MirrorTimerFlags |= UNDERWATER_INWATER;
+ else
+ m_MirrorTimerFlags &= ~UNDERWATER_INWATER;
+ }
+
+ // Allow travel in dark water on taxi or transport
+ if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport())
+ m_MirrorTimerFlags |= UNDERWARER_INDARKWATER;
+ else
+ m_MirrorTimerFlags &= ~UNDERWARER_INDARKWATER;
- //!in lava check, anywhere under lava level
- if ((height_z <= INVALID_HEIGHT || z < (height_z - 0)) && (flag1 == 0x00) && IsInWater())
- m_isunderwater |= 0x80;
+ // in lava check, anywhere in lava level
+ if (liquid_status.type&MAP_LIQUID_TYPE_MAGMA)
+ {
+ if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK))
+ m_MirrorTimerFlags |= UNDERWATER_INLAVA;
+ else
+ m_MirrorTimerFlags &= ~UNDERWATER_INLAVA;
+ }
+ // in slime check, anywhere in slime level
+ if (liquid_status.type&MAP_LIQUID_TYPE_SLIME)
+ {
+ if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK))
+ m_MirrorTimerFlags |= UNDERWATER_INSLIME;
+ else
+ m_MirrorTimerFlags &= ~UNDERWATER_INSLIME;
+ }
}
void Player::SetCanParry( bool value )
@@ -19041,140 +19539,157 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
//-------------TRINITY---------------
//***********************************
-void Player::HandleFallDamage(MovementInfo& movementInfo)
+void Player::StopCastingBindSight()
{
- if(movementInfo.fallTime < 1500)
- return;
-
- // calculate total z distance of the fall
- float z_diff = m_lastFallZ - movementInfo.z;
- sLog.outDebug("zDiff = %f", z_diff);
-
- //Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
- // 14.57 can be calculated by resolving damageperc formular below to 0
- if (z_diff >= 14.57f && !isDead() && !isGameMaster() &&
- !HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
- !HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL,true) )
+ if(WorldObject* target = GetViewpoint())
{
- //Safe fall, fall height reduction
- int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
-
- float damageperc = 0.018f*(z_diff-safe_fall)-0.2426f;
-
- if(damageperc >0 )
+ if(target->isType(TYPEMASK_UNIT))
{
- uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL));
-
- float height = movementInfo.z;
- UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
-
- if (damage > 0)
- {
- //Prevent fall damage from being more than the player maximum health
- if (damage > GetMaxHealth())
- damage = GetMaxHealth();
-
- // Gust of Wind
- if (GetDummyAura(43621))
- damage = GetMaxHealth()/2;
-
- EnvironmentalDamage(GetGUID(), DAMAGE_FALL, damage);
- }
-
- //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
- DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
+ ((Unit*)target)->RemoveAura(SPELL_AURA_BIND_SIGHT, GetGUID());
+ ((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS, GetGUID());
+ ((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
}
}
}
-void Player::HandleFallUnderMap()
+void Player::SetViewpoint(WorldObject* target, bool apply)
{
- if(InBattleGround()
- && GetBattleGround()
- && GetBattleGround()->HandlePlayerUnderMap(this))
+ if(apply)
{
- // do nothing, the handle already did if returned true
+ sLog.outDebug("Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName(), target->GetEntry(), target->GetTypeId());
+
+ if(!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
+ {
+ sLog.outCrash("Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName());
+ return;
+ }
+
+ if(target->isType(TYPEMASK_UNIT) && !m_Vehicle)
+ ((Unit*)target)->AddPlayerToVision(this);
}
else
{
- // NOTE: this is actually called many times while falling
- // even after the player has been teleported away
- // TODO: discard movement packets after the player is rooted
- if(isAlive())
+ sLog.outDebug("Player::CreateViewpoint: Player %s remove seer", GetName());
+
+ if(!RemoveUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
{
- EnvironmentalDamage(GetGUID(),DAMAGE_FALL_TO_VOID, GetMaxHealth());
- // change the death state to CORPSE to prevent the death timer from
- // starting in the next player update
- KillPlayer();
- BuildPlayerRepop();
+ sLog.outCrash("Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName());
+ return;
}
- // cancel the death timer here if started
- RepopAtGraveyard();
+ if(target->isType(TYPEMASK_UNIT) && !m_Vehicle)
+ ((Unit*)target)->RemovePlayerFromVision(this);
+
+ //must immediately set seer back otherwise may crash
+ m_seer = this;
+
+ //WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
+ //GetSession()->SendPacket(&data);
}
}
-void Player::SetViewport(uint64 guid, bool moveable)
+WorldObject* Player::GetViewpoint() const
{
- WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, 8+1);
- data.appendPackGUID(guid); // Packed guid of object to set client's view to
- data << (moveable ? uint8(0x01) : uint8(0x00)); // 0 - can't move; 1 - can move
- m_session->SendPacket(&data);
- sLog.outDetail("Viewport for "I64FMT" (%s) changed to "I64FMT, GetGUID(), GetName(), guid);
+ if(uint64 guid = GetUInt64Value(PLAYER_FARSIGHT))
+ return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
+ return NULL;
}
-WorldObject* Player::GetFarsightTarget() const
-{
- // Players can have in farsight field another player's guid, a creature's guid, or a dynamic object's guid
- if (uint64 guid = GetUInt64Value(PLAYER_FARSIGHT))
- return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT);
- return NULL;
+bool Player::CanUseBattleGroundObject()
+{
+ // TODO : some spells gives player ForceReaction to one faction (ReputationMgr::ApplyForceReaction)
+ // maybe gameobject code should handle that ForceReaction usage
+ // BUG: sometimes when player clicks on flag in AB - client won't send gameobject_use, only gameobject_report_use packet
+ return ( //InBattleGround() && // in battleground - not need, check in other cases
+ //!IsMounted() && - not correct, player is dismounted when he clicks on flag
+ //player cannot use object when he is invulnerable (immune)
+ !isTotalImmune() && // not totally immune
+ //i'm not sure if these two are correct, because invisible players should get visible when they click on flag
+ !HasStealthAura() && // not stealthed
+ !HasInvisibilityAura() && // not invisible
+ !HasAura(SPELL_RECENTLY_DROPPED_FLAG) && // can't pickup
+ isAlive() // live player
+ );
}
-void Player::StopCastingBindSight()
+bool Player::CanCaptureTowerPoint()
{
- if(WorldObject* target = GetFarsightTarget())
- {
- if(target->isType(TYPEMASK_UNIT))
- {
- ((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_BIND_SIGHT, GetGUID());
- ((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_MOD_POSSESS, GetGUID());
- ((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
- }
- }
+ return ( !HasStealthAura() && // not stealthed
+ !HasInvisibilityAura() && // not invisible
+ isAlive() // live player
+ );
}
-void Player::ClearFarsight()
+uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair)
{
- if (GetUInt64Value(PLAYER_FARSIGHT))
- {
- SetUInt64Value(PLAYER_FARSIGHT, 0);
- WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
- GetSession()->SendPacket(&data);
- }
+ uint32 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);
+
+ if((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair))
+ return 0;
+
+ GtBarberShopCostBaseEntry const *bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1);
+
+ if(!bsc) // shouldn't happen
+ return 0xFFFFFFFF;
+
+ float cost = 0;
+
+ if(hairstyle != newhairstyle)
+ cost += bsc->cost; // full price
+
+ if((haircolor != newhaircolor) && (hairstyle == newhairstyle))
+ cost += bsc->cost * 0.5f; // +1/2 of price
+
+ if(facialhair != newfacialhair)
+ cost += bsc->cost * 0.75f; // +3/4 of price
+
+ return uint32(cost);
}
-void Player::SetFarsightTarget(WorldObject* obj)
+void Player::InitGlyphsForLevel()
{
- if (!obj || !obj->isType(TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT))
- return;
+ for(uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i)
+ if(GlyphSlotEntry const * gs = sGlyphSlotStore.LookupEntry(i))
+ if(gs->Order)
+ SetGlyphSlot(gs->Order - 1, gs->Id);
+
+ uint32 level = getLevel();
+ uint32 value = 0;
- // Remove the current target if there is one
- StopCastingBindSight();
+ // 0x3F = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 for 80 level
+ if(level >= 15)
+ value |= (0x01 | 0x02);
+ if(level >= 30)
+ value |= 0x08;
+ if(level >= 50)
+ value |= 0x04;
+ if(level >= 70)
+ value |= 0x10;
+ if(level >= 80)
+ value |= 0x20;
- SetUInt64Value(PLAYER_FARSIGHT, obj->GetGUID());
+ SetUInt32Value(PLAYER_GLYPHS_ENABLED, value);
}
-bool Player::isAllowUseBattleGroundObject()
+bool Player::isTotalImmune()
{
- return ( //InBattleGround() && // in battleground - not need, check in other cases
- !IsMounted() && // not mounted
- !isTotalImmunity() && // not totally immuned
- !HasStealthAura() && // not stealthed
- !HasInvisibilityAura() && // not invisible
- !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
- isAlive() // live player
- );
+ AuraEffectList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
+
+ uint32 immuneMask = 0;
+ for(AuraEffectList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
+ {
+ immuneMask |= (*itr)->GetMiscValue();
+ if( immuneMask & SPELL_SCHOOL_MASK_ALL ) // total immunity
+ return true;
+ }
+ return false;
}
bool Player::HasTitle(uint32 bitIndex)
@@ -19194,23 +19709,22 @@ void Player::SetTitle(CharTitlesEntry const* title)
SetFlag(PLAYER__FIELD_KNOWN_TITLES+fieldIndexOffset, flag);
}
-
/*-----------------------TRINITY--------------------------*/
bool Player::isTotalImmunity()
{
- AuraList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
+ AuraEffectList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
- for(AuraList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
+ for(AuraEffectList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
{
- if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_ALL) !=0) // total immunity
+ if (((*itr)->GetMiscValue() & SPELL_SCHOOL_MASK_ALL) !=0) // total immunity
{
return true;
}
- if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) !=0) // physical damage immunity
+ if (((*itr)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) !=0) // physical damage immunity
{
- for(AuraList::const_iterator i = immune.begin(); i != immune.end(); ++i)
+ for(AuraEffectList::const_iterator i = immune.begin(); i != immune.end(); ++i)
{
- if (((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) !=0) // magic immunity
+ if (((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) !=0) // magic immunity
{
return true;
}
@@ -19228,9 +19742,9 @@ void Player::UpdateCharmedAI()
//kill self if charm aura has infinite duration
if(charmer->IsInEvadeMode())
{
- AuraList const& auras = GetAurasByType(SPELL_AURA_MOD_CHARM);
- for(AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
- if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->IsPermanent())
+ AuraEffectList const& auras = GetAurasByType(SPELL_AURA_MOD_CHARM);
+ for(AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
+ if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetParentAura()->IsPermanent())
{
charmer->DealDamage(this, GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
@@ -19252,3 +19766,612 @@ void Player::UpdateCharmedAI()
}
}
+void Player::ConvertRune(uint8 index, uint8 newType)
+{
+ SetCurrentRune(index, newType);
+
+ WorldPacket data(SMSG_CONVERT_RUNE, 2);
+ data << uint8(index);
+ data << uint8(newType);
+ GetSession()->SendPacket(&data);
+}
+
+void Player::ResyncRunes(uint8 count)
+{
+ WorldPacket data(SMSG_RESYNC_RUNES, count * 2);
+ for(uint32 i = 0; i < count; ++i)
+ {
+ data << uint8(GetCurrentRune(i)); // rune type
+ data << uint8(255 - (GetRuneCooldown(i) * 51)); // passed cooldown time (0-255)
+ }
+ GetSession()->SendPacket(&data);
+}
+
+void Player::AddRunePower(uint8 index)
+{
+ WorldPacket data(SMSG_ADD_RUNE_POWER, 4);
+ data << uint32(1 << index); // mask (0x00-0x3F probably)
+ GetSession()->SendPacket(&data);
+}
+
+void Player::InitRunes()
+{
+ if(getClass() != CLASS_DEATH_KNIGHT)
+ return;
+
+ m_runes = new Runes;
+
+ m_runes->runeState = 0;
+
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ SetBaseRune(i, i / 2); // init base types
+ SetCurrentRune(i, i / 2); // init current types
+ SetRuneCooldown(i, 0); // reset cooldowns
+ m_runes->SetRuneState(i);
+ }
+
+ for(uint32 i = 0; i < NUM_RUNE_TYPES; ++i)
+ SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f);
+}
+
+void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast)
+{
+ Loot loot;
+ loot.FillLoot (loot_id,store,this,true);
+
+ uint32 max_slot = loot.GetMaxSlotInLootFor(this);
+ for(uint32 i = 0; i < max_slot; ++i)
+ {
+ LootItem* lootItem = loot.LootItemInSlot(i,this);
+
+ ItemPosCountVec dest;
+ uint8 msg = CanStoreNewItem (bag,slot,dest,lootItem->itemid,lootItem->count);
+ if(msg != EQUIP_ERR_OK && slot != NULL_SLOT)
+ msg = CanStoreNewItem( bag, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
+ if( msg != EQUIP_ERR_OK && bag != NULL_BAG)
+ msg = CanStoreNewItem( NULL_BAG, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
+ if(msg != EQUIP_ERR_OK)
+ {
+ SendEquipError( msg, NULL, NULL );
+ continue;
+ }
+
+ Item* pItem = StoreNewItem (dest,lootItem->itemid,true,lootItem->randomPropertyId);
+ SendNewItem(pItem, lootItem->count, false, false, broadcast);
+ }
+}
+
+uint32 Player::CalculateTalentsPoints() const
+{
+ uint32 base_talent = getLevel() < 10 ? 0 : uint32((getLevel()-9)*sWorld.getRate(RATE_TALENT));
+
+ if(getClass() != CLASS_DEATH_KNIGHT)
+ return base_talent;
+
+ uint32 talentPointsForLevel =
+ (getLevel() < 56 ? 0 : uint32((getLevel()-55)*sWorld.getRate(RATE_TALENT)))
+ + m_questRewardTalentCount;
+
+ if(talentPointsForLevel > base_talent)
+ talentPointsForLevel = base_talent;
+
+ return talentPointsForLevel;
+}
+
+bool Player::IsAllowUseFlyMountsHere() const
+{
+ if (isGameMaster())
+ return true;
+
+ uint32 v_map = GetVirtualMapForMapAndZone(GetMapId(), GetZoneId());
+ return v_map == 530 || v_map == 571 && HasSpell(54197);
+}
+
+void Player::learnSpellHighRank(uint32 spellid)
+{
+ learnSpell(spellid,false);
+
+ if(uint32 next = spellmgr.GetNextSpellInChain(spellid))
+ learnSpellHighRank(next);
+}
+
+void Player::_LoadSkills()
+{
+ // Note: skill data itself loaded from `data` field. This is only cleanup part of load
+
+ // reset skill modifiers and set correct unlearn flags
+ for (uint32 i = 0; i < PLAYER_MAX_SKILLS; i++)
+ {
+ SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
+
+ // set correct unlearn bit
+ uint32 id = GetUInt32Value(PLAYER_SKILL_INDEX(i)) & 0x0000FFFF;
+ if(!id) continue;
+
+ SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(id);
+ if(!pSkill) continue;
+
+ // enable unlearn button for primary professions only
+ if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION)
+ SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,1));
+ else
+ SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
+
+ // set fixed skill ranges
+ switch(GetSkillRangeType(pSkill,false))
+ {
+ case SKILL_RANGE_LANGUAGE: // 300..300
+ SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(300,300));
+ break;
+ case SKILL_RANGE_MONO: // 1..1, grey monolite bar
+ SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(1,1));
+ break;
+ default:
+ break;
+ }
+
+ uint32 vskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i)));
+ learnSkillRewardedSpells(id, vskill);
+ }
+
+ // special settings
+ if(getClass()==CLASS_DEATH_KNIGHT)
+ {
+ uint32 base_level = std::min(getLevel(),sWorld.getConfig (CONFIG_START_HEROIC_PLAYER_LEVEL));
+ if(base_level < 1)
+ base_level = 1;
+ uint32 base_skill = (base_level-1)*5; // 270 at starting level 55
+ if(base_skill < 1)
+ base_skill = 1; // skill mast be known and then > 0 in any case
+
+ if(GetPureSkillValue (SKILL_FIRST_AID) < base_skill)
+ SetSkill(SKILL_FIRST_AID,base_skill, base_skill);
+ if(GetPureSkillValue (SKILL_AXES) < base_skill)
+ SetSkill(SKILL_AXES, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_DEFENSE) < base_skill)
+ SetSkill(SKILL_DEFENSE, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_POLEARMS) < base_skill)
+ SetSkill(SKILL_POLEARMS, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_SWORDS) < base_skill)
+ SetSkill(SKILL_SWORDS, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_2H_AXES) < base_skill)
+ SetSkill(SKILL_2H_AXES, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_2H_SWORDS) < base_skill)
+ SetSkill(SKILL_2H_SWORDS, base_skill,base_skill);
+ if(GetPureSkillValue (SKILL_UNARMED) < base_skill)
+ SetSkill(SKILL_UNARMED, base_skill,base_skill);
+ }
+}
+
+uint32 Player::GetPhaseMaskForSpawn() const
+{
+ uint32 phase = PHASEMASK_NORMAL;
+ if(!isGameMaster())
+ phase = GetPhaseMask();
+ else
+ {
+ AuraEffectList const& phases = GetAurasByType(SPELL_AURA_PHASE);
+ if(!phases.empty())
+ phase = phases.front()->GetMiscValue();
+ }
+
+ // some aura phases include 1 normal map in addition to phase itself
+ if(uint32 n_phase = phase & ~PHASEMASK_NORMAL)
+ return n_phase;
+
+ return PHASEMASK_NORMAL;
+}
+
+uint8 Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const
+{
+ ItemPrototype const* pProto = pItem->GetProto();
+
+ // proto based limitations
+ if(uint8 res = CanEquipUniqueItem(pProto,eslot,limit_count))
+ return res;
+
+ // check unique-equipped on gems
+ for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
+ {
+ uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot));
+ if(!enchant_id)
+ continue;
+ SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+ if(!enchantEntry)
+ continue;
+
+ ItemPrototype const* pGem = objmgr.GetItemPrototype(enchantEntry->GemID);
+ if(!pGem)
+ continue;
+
+ // include for check equip another gems with same limit category for not equipped item (and then not counted)
+ uint32 gem_limit_count = !pItem->IsEquipped() && pGem->ItemLimitCategory
+ ? pItem->GetGemCountWithLimitCategory(pGem->ItemLimitCategory) : 1;
+
+ if(uint8 res = CanEquipUniqueItem(pGem, eslot,gem_limit_count))
+ return res;
+ }
+
+ return EQUIP_ERR_OK;
+}
+
+uint8 Player::CanEquipUniqueItem( ItemPrototype const* itemProto, uint8 except_slot, uint32 limit_count) const
+{
+ // check unique-equipped on item
+ if (itemProto->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED)
+ {
+ // there is an equip limit on this item
+ if(HasItemOrGemWithIdEquipped(itemProto->ItemId,1,except_slot))
+ return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
+ }
+
+ // check unique-equipped limit
+ if (itemProto->ItemLimitCategory)
+ {
+ ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(itemProto->ItemLimitCategory);
+ if(!limitEntry)
+ return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
+
+ if(limit_count > limitEntry->maxCount)
+ return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE; // attempt add too many limit category items (gems)
+
+ // there is an equip limit on this item
+ if(HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory,limitEntry->maxCount-limit_count+1,except_slot))
+ return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
+ }
+
+ return EQUIP_ERR_OK;
+}
+
+void Player::HandleFall(MovementInfo const& movementInfo)
+{
+ // calculate total z distance of the fall
+ float z_diff = m_lastFallZ - movementInfo.z;
+ //sLog.outDebug("zDiff = %f", z_diff);
+
+ //Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
+ // 14.57 can be calculated by resolving damageperc formular below to 0
+ if (z_diff >= 14.57f && !isDead() && !isGameMaster() &&
+ !HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
+ !HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL) )
+ {
+ //Safe fall, fall height reduction
+ int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
+
+ float damageperc = 0.018f*(z_diff-safe_fall)-0.2426f;
+
+ if(damageperc >0 )
+ {
+ uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL));
+
+ float height = movementInfo.z;
+ UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
+
+ if (damage > 0)
+ {
+ //Prevent fall damage from being more than the player maximum health
+ if (damage > GetMaxHealth())
+ damage = GetMaxHealth();
+
+ // Gust of Wind
+ if (GetDummyAura(43621))
+ damage = GetMaxHealth()/2;
+
+ EnvironmentalDamage(DAMAGE_FALL, damage);
+
+ // recheck alive, might have died of EnvironmentalDamage
+ if (isAlive())
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
+ }
+
+ //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
+ DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
+ }
+ }
+}
+
+void Player::UpdateAchievementCriteria( AchievementCriteriaTypes type, uint32 miscvalue1/*=0*/, uint32 miscvalue2/*=0*/, Unit *unit/*=NULL*/, uint32 time/*=0*/ )
+{
+ GetAchievementMgr().UpdateAchievementCriteria(type, miscvalue1,miscvalue2,unit,time);
+}
+
+void Player::LearnTalent(uint32 talentId, uint32 talentRank)
+{
+ uint32 CurTalentPoints = GetFreeTalentPoints();
+
+ if(CurTalentPoints == 0)
+ return;
+
+ if (talentRank >= MAX_TALENT_RANK)
+ return;
+
+ TalentEntry const *talentInfo = sTalentStore.LookupEntry( talentId );
+
+ if(!talentInfo)
+ return;
+
+ TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab );
+
+ if(!talentTabInfo)
+ return;
+
+ // prevent learn talent for different class (cheating)
+ if( (getClassMask() & talentTabInfo->ClassMask) == 0 )
+ return;
+
+ // find current max talent rank
+ int32 curtalent_maxrank = 0;
+ for(int32 k = MAX_TALENT_RANK-1; k > -1; --k)
+ {
+ if(talentInfo->RankID[k] && HasSpell(talentInfo->RankID[k]))
+ {
+ curtalent_maxrank = k + 1;
+ break;
+ }
+ }
+
+ // we already have same or higher talent rank learned
+ if(curtalent_maxrank >= (talentRank + 1))
+ return;
+
+ // check if we have enough talent points
+ if(CurTalentPoints < (talentRank - curtalent_maxrank + 1))
+ return;
+
+ // Check if it requires another talent
+ if (talentInfo->DependsOn > 0)
+ {
+ if(TalentEntry const *depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
+ {
+ bool hasEnoughRank = false;
+ for (int i = talentInfo->DependsOnRank; i < MAX_TALENT_RANK; i++)
+ {
+ if (depTalentInfo->RankID[i] != 0)
+ if (HasSpell(depTalentInfo->RankID[i]))
+ hasEnoughRank = true;
+ }
+ if (!hasEnoughRank)
+ return;
+ }
+ }
+
+ // Find out how many points we have in this field
+ uint32 spentPoints = 0;
+
+ uint32 tTab = talentInfo->TalentTab;
+ if (talentInfo->Row > 0)
+ {
+ unsigned int numRows = sTalentStore.GetNumRows();
+ for (unsigned int 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
+ {
+ if (tmpTalent->TalentTab == tTab)
+ {
+ for (int j = 0; j < MAX_TALENT_RANK; j++)
+ {
+ if (tmpTalent->RankID[j] != 0)
+ {
+ if (HasSpell(tmpTalent->RankID[j]))
+ {
+ spentPoints += j + 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // not have required min points spent in talent tree
+ if(spentPoints < (talentInfo->Row * MAX_TALENT_RANK))
+ return;
+
+ // spell not set in talent.dbc
+ uint32 spellid = talentInfo->RankID[talentRank];
+ if( spellid == 0 )
+ {
+ sLog.outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ return;
+ }
+
+ // already known
+ if(HasSpell(spellid))
+ return;
+
+ // learn! (other talent ranks will unlearned at learning)
+ learnSpell(spellid, false);
+ sLog.outDetail("TalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
+
+ // update free talent points
+ SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
+}
+
+void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
+{
+ Pet *pet = GetPet();
+
+ if(!pet)
+ return;
+
+ if(petGuid != pet->GetGUID())
+ return;
+
+ uint32 CurTalentPoints = pet->GetFreeTalentPoints();
+
+ if(CurTalentPoints == 0)
+ return;
+
+ if (talentRank >= MAX_PET_TALENT_RANK)
+ return;
+
+ TalentEntry const *talentInfo = sTalentStore.LookupEntry(talentId);
+
+ if(!talentInfo)
+ return;
+
+ TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+
+ if(!talentTabInfo)
+ return;
+
+ CreatureInfo const *ci = pet->GetCreatureInfo();
+
+ if(!ci)
+ return;
+
+ CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
+
+ if(!pet_family)
+ return;
+
+ if(pet_family->petTalentType < 0) // not hunter pet
+ return;
+
+ // prevent learn talent for different family (cheating)
+ if(!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
+ return;
+
+ // find current max talent rank
+ int32 curtalent_maxrank = 0;
+ for(int32 k = MAX_TALENT_RANK-1; k > -1; --k)
+ {
+ if(talentInfo->RankID[k] && pet->HasSpell(talentInfo->RankID[k]))
+ {
+ curtalent_maxrank = k + 1;
+ break;
+ }
+ }
+
+ // we already have same or higher talent rank learned
+ if(curtalent_maxrank >= (talentRank + 1))
+ return;
+
+ // check if we have enough talent points
+ if(CurTalentPoints < (talentRank - curtalent_maxrank + 1))
+ return;
+
+ // Check if it requires another talent
+ if (talentInfo->DependsOn > 0)
+ {
+ if(TalentEntry const *depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
+ {
+ bool hasEnoughRank = false;
+ for (int i = talentInfo->DependsOnRank; i < MAX_TALENT_RANK; i++)
+ {
+ if (depTalentInfo->RankID[i] != 0)
+ if (pet->HasSpell(depTalentInfo->RankID[i]))
+ hasEnoughRank = true;
+ }
+ if (!hasEnoughRank)
+ return;
+ }
+ }
+
+ // Find out how many points we have in this field
+ uint32 spentPoints = 0;
+
+ uint32 tTab = talentInfo->TalentTab;
+ if (talentInfo->Row > 0)
+ {
+ unsigned int numRows = sTalentStore.GetNumRows();
+ for (unsigned int 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
+ {
+ if (tmpTalent->TalentTab == tTab)
+ {
+ for (int j = 0; j < MAX_TALENT_RANK; j++)
+ {
+ if (tmpTalent->RankID[j] != 0)
+ {
+ if (pet->HasSpell(tmpTalent->RankID[j]))
+ {
+ spentPoints += j + 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // not have required min points spent in talent tree
+ if(spentPoints < (talentInfo->Row * MAX_PET_TALENT_RANK))
+ return;
+
+ // spell not set in talent.dbc
+ uint32 spellid = talentInfo->RankID[talentRank];
+ if( spellid == 0 )
+ {
+ sLog.outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ return;
+ }
+
+ // already known
+ if(pet->HasSpell(spellid))
+ return;
+
+ // learn! (other talent ranks will unlearned at learning)
+ pet->learnSpell(spellid);
+ sLog.outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
+
+ // update free talent points
+ pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
+}
+
+void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
+{
+ if(CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemId))
+ {
+ if(apply)
+ SetFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1)));
+ else
+ RemoveFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1)));
+ }
+}
+
+void Player::UpdateFallInformationIfNeed( MovementInfo const& minfo,uint16 opcode )
+{
+ if (m_lastFallTime >= minfo.fallTime || m_lastFallZ <=minfo.z || opcode == MSG_MOVE_FALL_LAND)
+ SetFallInformation(minfo.fallTime, minfo.z);
+}
+
+void Player::UnsummonPetTemporaryIfAny()
+{
+ Pet* pet = GetPet();
+ if(!pet)
+ return;
+
+ if(!m_temporaryUnsummonedPetNumber && pet->isControlled() && !pet->isTemporarySummoned() )
+ {
+ m_temporaryUnsummonedPetNumber = pet->GetCharmInfo()->GetPetNumber();
+ m_oldpetspell = pet->GetUInt32Value(UNIT_CREATED_BY_SPELL);
+ }
+
+ RemovePet(pet, PET_SAVE_AS_CURRENT);
+}
+
+void Player::ResummonPetTemporaryUnSummonedIfAny()
+{
+ if(!m_temporaryUnsummonedPetNumber)
+ return;
+
+ // not resummon in not appropriate state
+ if(IsPetNeedBeTemporaryUnsummoned())
+ return;
+
+ if(GetPetGUID())
+ return;
+
+ Pet* NewPet = new Pet(this);
+ if(!NewPet->LoadPetFromDB(this, 0, m_temporaryUnsummonedPetNumber, true))
+ delete NewPet;
+
+ m_temporaryUnsummonedPetNumber = 0;
+}
diff --git a/src/game/Player.h b/src/game/Player.h
index 9ba6c94ae24..3bf99f073af 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,6 +35,9 @@
#include "Pet.h"
#include "MapReference.h"
#include "Util.h" // for Tokens typedef
+#include "AchievementMgr.h"
+#include "ReputationMgr.h"
+#include "BattleGround.h"
#include<string>
#include<vector>
@@ -47,8 +50,10 @@ class Pet;
class PlayerMenu;
class Transport;
class UpdateMask;
+class SpellCastTargets;
class PlayerSocial;
class OutdoorPvP;
+class Vehicle;
typedef std::deque<Mail*> PlayerMails;
@@ -62,6 +67,18 @@ enum SpellModType
SPELLMOD_PCT = 108 // SPELL_AURA_ADD_PCT_MODIFIER
};
+// 2^n values, Player::m_isunderwater is a bitmask. These are mangos internal values, they are never send to any client
+enum PlayerUnderwaterState
+{
+ UNDERWATER_NONE = 0x00,
+ UNDERWATER_INWATER = 0x01, // terrain type is water and player is afflicted by it
+ UNDERWATER_INLAVA = 0x02, // terrain type is lava and player is afflicted by it
+ UNDERWATER_INSLIME = 0x04, // terrain type is lava and player is afflicted by it
+ UNDERWARER_INDARKWATER = 0x08, // terrain type is dark water and player is afflicted by it
+
+ UNDERWATER_EXIST_TIMERS = 0x10
+};
+
enum PlayerSpellState
{
PLAYERSPELL_UNCHANGED = 0,
@@ -72,27 +89,26 @@ enum PlayerSpellState
struct PlayerSpell
{
- uint16 slotId : 16;
PlayerSpellState state : 8;
- bool active : 1;
- bool disabled : 1;
+ bool active : 1; // show in spellbook
+ bool dependent : 1; // learned as result another spell learn, skill grow, quest reward, etc
+ bool disabled : 1; // first rank has been learned in result talent learn but currently talent unlearned, save max learned ranks
};
-#define SPELL_WITHOUT_SLOT_ID uint16(-1)
-
+// Spell modifier (used for modify other spells)
struct SpellModifier
{
+ SpellModifier() : charges(0), lastAffected(NULL) {}
SpellModOp op : 8;
SpellModType type : 8;
int16 charges : 16;
int32 value;
- uint64 mask;
+ flag96 mask;
uint32 spellId;
- uint32 effectId;
Spell const* lastAffected;
};
-typedef UNORDERED_MAP<uint16, PlayerSpell*> PlayerSpellMap;
+typedef UNORDERED_MAP<uint32, PlayerSpell*> PlayerSpellMap;
typedef std::list<SpellModifier*> SpellModList;
struct SpellCooldown
@@ -141,8 +157,6 @@ enum ActionButtonType
typedef std::map<uint8,ActionButton> ActionButtonList;
-typedef std::pair<uint16, uint8> CreateSpellPair;
-
struct PlayerCreateInfoItem
{
PlayerCreateInfoItem(uint32 id, uint32 amount) : item_id(id), item_amount(amount) {}
@@ -174,6 +188,8 @@ struct PlayerLevelInfo
uint8 stats[MAX_STATS];
};
+typedef std::list<uint32> PlayerCreateInfoSpells;
+
struct PlayerInfo
{
// existence checked by displayId != 0 // existence checked by displayId != 0
@@ -189,7 +205,7 @@ struct PlayerInfo
uint16 displayId_m;
uint16 displayId_f;
PlayerCreateInfoItems item;
- std::list<CreateSpellPair> spell;
+ PlayerCreateInfoSpells spell;
std::list<uint16> action[4];
PlayerLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
@@ -224,32 +240,38 @@ struct Areas
float y2;
};
-enum FactionFlags
+#define MAX_RUNES 6
+#define RUNE_COOLDOWN 5 // 5*2=10 sec
+
+enum RuneType
{
- FACTION_FLAG_VISIBLE = 0x01, // makes visible in client (set or can be set at interaction with target of this faction)
- FACTION_FLAG_AT_WAR = 0x02, // enable AtWar-button in client. player controlled (except opposition team always war state), Flag only set on initial creation
- FACTION_FLAG_HIDDEN = 0x04, // hidden faction from reputation pane in client (player can gain reputation, but this update not sent to client)
- FACTION_FLAG_INVISIBLE_FORCED = 0x08, // always overwrite FACTION_FLAG_VISIBLE and hide faction in rep.list, used for hide opposite team factions
- FACTION_FLAG_PEACE_FORCED = 0x10, // always overwrite FACTION_FLAG_AT_WAR, used for prevent war with own team factions
- FACTION_FLAG_INACTIVE = 0x20, // player controlled, state stored in characters.data ( CMSG_SET_FACTION_INACTIVE )
- FACTION_FLAG_RIVAL = 0x40 // flag for the two competing outland factions
+ RUNE_BLOOD = 0,
+ RUNE_UNHOLY = 1,
+ RUNE_FROST = 2,
+ RUNE_DEATH = 3,
+ NUM_RUNE_TYPES = 4
};
-typedef uint32 RepListID;
-struct FactionState
+struct RuneInfo
{
- uint32 ID;
- RepListID ReputationListID;
- uint32 Flags;
- int32 Standing;
- bool Changed;
+ uint8 BaseRune;
+ uint8 CurrentRune;
+ uint8 Cooldown;
};
-typedef std::map<RepListID,FactionState> FactionStateList;
-
-typedef std::map<uint32,ReputationRank> ForcedReactions;
+struct Runes
+{
+ RuneInfo runes[MAX_RUNES];
+ uint8 runeState; // mask of available runes
-typedef std::set<uint64> GuardianPetList;
+ void SetRuneState(uint8 index, bool set = true)
+ {
+ if(set)
+ runeState |= (1 << index); // usable
+ else
+ runeState &= ~(1 << index); // on cooldown
+ }
+};
struct EnchantDuration
{
@@ -328,52 +350,6 @@ enum DrunkenState
DRUNKEN_SMASHED = 3
};
-enum PlayerStateType
-{
- /*
- PLAYER_STATE_DANCE
- PLAYER_STATE_SLEEP
- PLAYER_STATE_SIT
- PLAYER_STATE_STAND
- PLAYER_STATE_READYUNARMED
- PLAYER_STATE_WORK
- PLAYER_STATE_POINT(DNR)
- PLAYER_STATE_NONE // not used or just no state, just standing there?
- PLAYER_STATE_STUN
- PLAYER_STATE_DEAD
- PLAYER_STATE_KNEEL
- PLAYER_STATE_USESTANDING
- PLAYER_STATE_STUN_NOSHEATHE
- PLAYER_STATE_USESTANDING_NOSHEATHE
- PLAYER_STATE_WORK_NOSHEATHE
- PLAYER_STATE_SPELLPRECAST
- PLAYER_STATE_READYRIFLE
- PLAYER_STATE_WORK_NOSHEATHE_MINING
- PLAYER_STATE_WORK_NOSHEATHE_CHOPWOOD
- PLAYER_STATE_AT_EASE
- PLAYER_STATE_READY1H
- PLAYER_STATE_SPELLKNEELSTART
- PLAYER_STATE_SUBMERGED
- */
-
- PLAYER_STATE_NONE = 0,
- PLAYER_STATE_SIT = 1,
- PLAYER_STATE_SIT_CHAIR = 2,
- PLAYER_STATE_SLEEP = 3,
- PLAYER_STATE_SIT_LOW_CHAIR = 4,
- PLAYER_STATE_SIT_MEDIUM_CHAIR = 5,
- PLAYER_STATE_SIT_HIGH_CHAIR = 6,
- PLAYER_STATE_DEAD = 7,
- PLAYER_STATE_KNEEL = 8,
-
- PLAYER_STATE_FORM_ALL = 0x00FF0000,
-
- PLAYER_STATE_FLAG_ALWAYS_STAND = 0x01, // byte 4
- PLAYER_STATE_FLAG_CREEP = 0x02000000,
- PLAYER_STATE_FLAG_UNTRACKABLE = 0x04000000,
- PLAYER_STATE_FLAG_ALL = 0xFF000000,
-};
-
enum PlayerFlags
{
PLAYER_FLAGS_GROUP_LEADER = 0x00000001,
@@ -382,17 +358,25 @@ enum PlayerFlags
PLAYER_FLAGS_GM = 0x00000008,
PLAYER_FLAGS_GHOST = 0x00000010,
PLAYER_FLAGS_RESTING = 0x00000020,
- PLAYER_FLAGS_FFA_PVP = 0x00000080,
+ PLAYER_FLAGS_UNK7 = 0x00000040,
+ PLAYER_FLAGS_UNK8 = 0x00000080, // pre-3.0.3 PLAYER_FLAGS_FFA_PVP flag for FFA PVP state
PLAYER_FLAGS_CONTESTED_PVP = 0x00000100, // Player has been involved in a PvP combat and will be attacked by contested guards
PLAYER_FLAGS_IN_PVP = 0x00000200,
PLAYER_FLAGS_HIDE_HELM = 0x00000400,
PLAYER_FLAGS_HIDE_CLOAK = 0x00000800,
- PLAYER_FLAGS_UNK1 = 0x00001000, // played long time
- PLAYER_FLAGS_UNK2 = 0x00002000, // played too long time
- PLAYER_FLAGS_UNK3 = 0x00008000, // strange visual effect (2.0.1), looks like PLAYER_FLAGS_GHOST flag
- PLAYER_FLAGS_SANCTUARY = 0x00010000, // player entered sanctuary
- PLAYER_FLAGS_UNK4 = 0x00020000, // taxi benchmark mode (on/off) (2.0.1)
- PLAYER_UNK = 0x00040000, // 2.0.8...
+ PLAYER_FLAGS_UNK13 = 0x00001000, // played long time
+ PLAYER_FLAGS_UNK14 = 0x00002000, // played too long time
+ PLAYER_FLAGS_UNK15 = 0x00004000,
+ PLAYER_FLAGS_UNK16 = 0x00008000, // strange visual effect (2.0.1), looks like PLAYER_FLAGS_GHOST flag
+ PLAYER_FLAGS_UNK17 = 0x00010000, // pre-3.0.3 PLAYER_FLAGS_SANCTUARY flag for player entered sanctuary
+ PLAYER_FLAGS_UNK18 = 0x00020000, // taxi benchmark mode (on/off) (2.0.1)
+ PLAYER_FLAGS_PVP_TIMER = 0x00040000, // 3.0.2, pvp timer active (after you disable pvp manually)
+ PLAYER_FLAGS_UNK20 = 0x00080000,
+ PLAYER_FLAGS_UNK21 = 0x00100000,
+ PLAYER_FLAGS_UNK22 = 0x00200000,
+ PLAYER_FLAGS_UNK23 = 0x00400000,
+ PLAYER_ALLOW_ONLY_ABILITY = 0x00800000, // used by bladestorm and killing spree
+ PLAYER_FLAGS_UNK25 = 0x01000000 // disabled all melee ability on tab include autoattack
};
// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1)
@@ -481,7 +465,8 @@ enum LootType
LOOT_DISENCHANTING = 5, // unsupported by client, sending LOOT_SKINNING instead
LOOT_PROSPECTING = 6, // unsupported by client, sending LOOT_SKINNING instead
LOOT_INSIGNIA = 7, // unsupported by client, sending LOOT_SKINNING instead
- LOOT_FISHINGHOLE = 8 // unsupported by client, sending LOOT_FISHING instead
+ LOOT_FISHINGHOLE = 8, // unsupported by client, sending LOOT_FISHING instead
+ LOOT_MILLING = 9 // unsupported by client, sending LOOT_SKINNING instead
};
enum MirrorTimerType
@@ -490,6 +475,8 @@ enum MirrorTimerType
BREATH_TIMER = 1,
FIRE_TIMER = 2
};
+#define MAX_TIMERS 3
+#define DISABLED_MIRROR_TIMER -1
// 2^n values
enum PlayerExtraFlags
@@ -511,7 +498,8 @@ enum AtLoginFlags
AT_LOGIN_NONE = 0,
AT_LOGIN_RENAME = 1,
AT_LOGIN_RESET_SPELLS = 2,
- AT_LOGIN_RESET_TALENTS = 4
+ AT_LOGIN_RESET_TALENTS = 4,
+ AT_LOGIN_CUSTOMIZE = 8
};
typedef std::map<uint32, QuestStatusData> QuestStatusMap;
@@ -543,11 +531,13 @@ enum PlayerSlots
// first slot for item stored (in any way in player m_items data)
PLAYER_SLOT_START = 0,
// last+1 slot for item stored (in any way in player m_items data)
- PLAYER_SLOT_END = 118,
+ PLAYER_SLOT_END = 200,
PLAYER_SLOTS_COUNT = (PLAYER_SLOT_END - PLAYER_SLOT_START)
};
-enum EquipmentSlots
+#define INVENTORY_SLOT_BAG_0 255
+
+enum EquipmentSlots // 19 slots
{
EQUIPMENT_SLOT_START = 0,
EQUIPMENT_SLOT_HEAD = 0,
@@ -572,111 +562,67 @@ enum EquipmentSlots
EQUIPMENT_SLOT_END = 19
};
-enum InventorySlots
+enum InventorySlots // 4 slots
{
- INVENTORY_SLOT_BAG_0 = 255,
INVENTORY_SLOT_BAG_START = 19,
- INVENTORY_SLOT_BAG_1 = 19,
- INVENTORY_SLOT_BAG_2 = 20,
- INVENTORY_SLOT_BAG_3 = 21,
- INVENTORY_SLOT_BAG_4 = 22,
- INVENTORY_SLOT_BAG_END = 23,
+ INVENTORY_SLOT_BAG_END = 23
+};
+enum InventoryPackSlots // 16 slots
+{
INVENTORY_SLOT_ITEM_START = 23,
- INVENTORY_SLOT_ITEM_1 = 23,
- INVENTORY_SLOT_ITEM_2 = 24,
- INVENTORY_SLOT_ITEM_3 = 25,
- INVENTORY_SLOT_ITEM_4 = 26,
- INVENTORY_SLOT_ITEM_5 = 27,
- INVENTORY_SLOT_ITEM_6 = 28,
- INVENTORY_SLOT_ITEM_7 = 29,
- INVENTORY_SLOT_ITEM_8 = 30,
- INVENTORY_SLOT_ITEM_9 = 31,
- INVENTORY_SLOT_ITEM_10 = 32,
- INVENTORY_SLOT_ITEM_11 = 33,
- INVENTORY_SLOT_ITEM_12 = 34,
- INVENTORY_SLOT_ITEM_13 = 35,
- INVENTORY_SLOT_ITEM_14 = 36,
- INVENTORY_SLOT_ITEM_15 = 37,
- INVENTORY_SLOT_ITEM_16 = 38,
INVENTORY_SLOT_ITEM_END = 39
};
-enum BankSlots
+enum BankItemSlots // 28 slots
{
BANK_SLOT_ITEM_START = 39,
- BANK_SLOT_ITEM_1 = 39,
- BANK_SLOT_ITEM_2 = 40,
- BANK_SLOT_ITEM_3 = 41,
- BANK_SLOT_ITEM_4 = 42,
- BANK_SLOT_ITEM_5 = 43,
- BANK_SLOT_ITEM_6 = 44,
- BANK_SLOT_ITEM_7 = 45,
- BANK_SLOT_ITEM_8 = 46,
- BANK_SLOT_ITEM_9 = 47,
- BANK_SLOT_ITEM_10 = 48,
- BANK_SLOT_ITEM_11 = 49,
- BANK_SLOT_ITEM_12 = 50,
- BANK_SLOT_ITEM_13 = 51,
- BANK_SLOT_ITEM_14 = 52,
- BANK_SLOT_ITEM_15 = 53,
- BANK_SLOT_ITEM_16 = 54,
- BANK_SLOT_ITEM_17 = 55,
- BANK_SLOT_ITEM_18 = 56,
- BANK_SLOT_ITEM_19 = 57,
- BANK_SLOT_ITEM_20 = 58,
- BANK_SLOT_ITEM_21 = 59,
- BANK_SLOT_ITEM_22 = 60,
- BANK_SLOT_ITEM_23 = 61,
- BANK_SLOT_ITEM_24 = 62,
- BANK_SLOT_ITEM_25 = 63,
- BANK_SLOT_ITEM_26 = 64,
- BANK_SLOT_ITEM_27 = 65,
- BANK_SLOT_ITEM_28 = 66,
- BANK_SLOT_ITEM_END = 67,
+ BANK_SLOT_ITEM_END = 67
+};
+enum BankBagSlots // 7 slots
+{
BANK_SLOT_BAG_START = 67,
- BANK_SLOT_BAG_1 = 67,
- BANK_SLOT_BAG_2 = 68,
- BANK_SLOT_BAG_3 = 69,
- BANK_SLOT_BAG_4 = 70,
- BANK_SLOT_BAG_5 = 71,
- BANK_SLOT_BAG_6 = 72,
- BANK_SLOT_BAG_7 = 73,
BANK_SLOT_BAG_END = 74
};
-enum BuyBackSlots
+enum BuyBackSlots // 12 slots
{
// stored in m_buybackitems
BUYBACK_SLOT_START = 74,
- BUYBACK_SLOT_1 = 74,
- BUYBACK_SLOT_2 = 75,
- BUYBACK_SLOT_3 = 76,
- BUYBACK_SLOT_4 = 77,
- BUYBACK_SLOT_5 = 78,
- BUYBACK_SLOT_6 = 79,
- BUYBACK_SLOT_7 = 80,
- BUYBACK_SLOT_8 = 81,
- BUYBACK_SLOT_9 = 82,
- BUYBACK_SLOT_10 = 83,
- BUYBACK_SLOT_11 = 84,
- BUYBACK_SLOT_12 = 85,
BUYBACK_SLOT_END = 86
};
-enum KeyRingSlots
+enum KeyRingSlots // 32 slots
{
KEYRING_SLOT_START = 86,
KEYRING_SLOT_END = 118
};
+enum VanityPetSlots // 18 slots
+{
+ VANITYPET_SLOT_START = 118, // not use, vanity pets stored as spells
+ VANITYPET_SLOT_END = 136 // not allowed any content in.
+};
+
+enum CurrencyTokenSlots // 32 slots
+{
+ CURRENCYTOKEN_SLOT_START = 136,
+ CURRENCYTOKEN_SLOT_END = 168
+};
+
+enum QuestBagSlots // 32 slots
+{
+ QUESTBAG_SLOT_START = 168, // not use
+ QUESTBAG_SLOT_END = 200 // not allowed any content in.
+};
+
struct ItemPosCount
{
- ItemPosCount(uint16 _pos, uint8 _count) : pos(_pos), count(_count) {}
+ ItemPosCount(uint16 _pos, uint32 _count) : pos(_pos), count(_count) {}
bool isContainedIn(std::vector<ItemPosCount> const& vec) const;
uint16 pos;
- uint8 count;
+ uint32 count;
};
typedef std::vector<ItemPosCount> ItemPosCountVec;
@@ -689,14 +635,15 @@ enum TradeSlots
enum TransferAbortReason
{
- TRANSFER_ABORT_MAX_PLAYERS = 0x0001, // Transfer Aborted: instance is full
- TRANSFER_ABORT_NOT_FOUND = 0x0002, // Transfer Aborted: instance not found
- TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x0003, // You have entered too many instances recently.
- TRANSFER_ABORT_ZONE_IN_COMBAT = 0x0005, // Unable to zone in while an encounter is in progress.
- TRANSFER_ABORT_INSUF_EXPAN_LVL1 = 0x0106, // You must have TBC expansion installed to access this area.
- TRANSFER_ABORT_DIFFICULTY1 = 0x0007, // Normal difficulty mode is not available for %s.
- TRANSFER_ABORT_DIFFICULTY2 = 0x0107, // Heroic difficulty mode is not available for %s.
- TRANSFER_ABORT_DIFFICULTY3 = 0x0207 // Epic difficulty mode is not available for %s.
+ TRANSFER_ABORT_ERROR = 0x00,
+ TRANSFER_ABORT_MAX_PLAYERS = 0x01, // Transfer Aborted: instance is full
+ TRANSFER_ABORT_NOT_FOUND = 0x02, // Transfer Aborted: instance not found
+ TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x03, // You have entered too many instances recently.
+ TRANSFER_ABORT_ZONE_IN_COMBAT = 0x05, // Unable to zone in while an encounter is in progress.
+ TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x06, // You must have <TBC,WotLK> expansion installed to access this area.
+ TRANSFER_ABORT_DIFFICULTY = 0x07, // <Normal,Heroic,Epic> difficulty mode is not available for %s.
+ TRANSFER_ABORT_UNIQUE_MESSAGE = 0x08, // Until you've escaped TLK's grasp, you cannot leave this place!
+ TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x09 // Additional instances cannot be launched, please try again later.
};
enum InstanceResetWarningType
@@ -707,41 +654,6 @@ enum InstanceResetWarningType
RAID_INSTANCE_WELCOME = 4 // Welcome to %s. This raid instance is scheduled to reset in %s.
};
-struct MovementInfo
-{
- // common
- //uint32 flags;
- uint8 unk1;
- uint32 time;
- float x, y, z, o;
- // transport
- uint64 t_guid;
- float t_x, t_y, t_z, t_o;
- uint32 t_time;
- // swimming and unk
- float s_pitch;
- // last fall time
- uint32 fallTime;
- // jumping
- float j_unk, j_sinAngle, j_cosAngle, j_xyspeed;
- // spline
- float u_unk1;
-
- MovementInfo()
- {
- //flags =
- time = t_time = fallTime = 0;
- unk1 = 0;
- x = y = z = o = t_x = t_y = t_z = t_o = s_pitch = j_unk = j_sinAngle = j_cosAngle = j_xyspeed = u_unk1 = 0.0f;
- t_guid = 0;
- }
-
- /*void SetMovementFlags(uint32 _flags)
- {
- flags = _flags;
- }*/
-};
-
// flags that use in movement check for example at spell casting
MovementFlags const movementFlagsMask = MovementFlags(
MOVEMENTFLAG_FORWARD |MOVEMENTFLAG_BACKWARD |MOVEMENTFLAG_STRAFE_LEFT|MOVEMENTFLAG_STRAFE_RIGHT|
@@ -812,8 +724,9 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES = 16,
PLAYER_LOGIN_QUERY_LOADGUILD = 17,
PLAYER_LOGIN_QUERY_LOADARENAINFO = 18,
-
- MAX_PLAYER_LOGIN_QUERY
+ PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS = 19,
+ PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS = 20,
+ MAX_PLAYER_LOGIN_QUERY = 21
};
// Player summoning auto-decline time (in secs)
@@ -840,9 +753,9 @@ struct AccessRequirement
uint32 heroicKey2;
uint32 quest;
std::string questFailedText;
- uint32 heroicQuest;
+ uint32 heroicQuest;
std::string heroicQuestFailedText;
- };
+};
class TRINITY_DLL_SPEC PlayerTaxi
{
@@ -850,11 +763,9 @@ class TRINITY_DLL_SPEC PlayerTaxi
PlayerTaxi();
~PlayerTaxi() {}
// Nodes
- void InitTaxiNodesForLevel(uint32 race, uint32 level);
+ void InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint32 level);
void LoadTaxiMask(const char* data);
- void SaveTaxiMask(const char* data);
- uint32 GetTaximask( uint8 index ) const { return m_taximask[index]; }
bool IsTaximaskNodeKnown(uint32 nodeidx) const
{
uint8 field = uint8((nodeidx - 1) / 32);
@@ -876,7 +787,7 @@ class TRINITY_DLL_SPEC PlayerTaxi
void AppendTaximaskTo(ByteBuffer& data,bool all);
// Destinations
- bool LoadTaxiDestinationsFromString(const std::string& values);
+ bool LoadTaxiDestinationsFromString(const std::string& values, uint32 team);
std::string SaveTaxiDestinationsToString();
void ClearTaxiDestinations() { m_TaxiDestinations.clear(); }
@@ -890,11 +801,15 @@ class TRINITY_DLL_SPEC PlayerTaxi
return GetTaxiDestination();
}
bool empty() const { return m_TaxiDestinations.empty(); }
+
+ friend std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi);
private:
TaxiMask m_taximask;
std::deque<uint32> m_TaxiDestinations;
};
+std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi);
+
class TRINITY_DLL_SPEC Player : public Unit
{
friend class WorldSession;
@@ -912,16 +827,6 @@ class TRINITY_DLL_SPEC Player : public Unit
void AddToWorld();
void RemoveFromWorld();
- void SetViewport(uint64 guid, bool movable);
- void StopCastingCharm() { Uncharm(); }
- void StopCastingBindSight();
- WorldObject* GetFarsightTarget() const;
- void ClearFarsight();
- void SetFarsightTarget(WorldObject* target);
- // Controls if vision is currently on farsight object, updated in FAR_SIGHT opcode
- void SetFarsightVision(bool apply) { m_farsightVision = apply; }
- bool HasFarsightVision() const { return m_farsightVision; }
-
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options = 0);
bool TeleportTo(WorldLocation const &loc, uint32 options = 0)
@@ -952,7 +857,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap();
- void SendTransferAborted(uint32 mapid, uint16 reason);
+ void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0);
void SendInstanceResetWarning(uint32 mapid, uint32 time);
bool CanInteractWithNPCs(bool alive = true) const;
@@ -965,10 +870,12 @@ class TRINITY_DLL_SPEC Player : public Unit
std::string afkMsg;
std::string dndMsg;
+ uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair);
+
PlayerSocial *GetSocial() { return m_social; }
PlayerTaxi m_taxi;
- void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(),getLevel()); }
+ void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_id = 0 , Creature* npc = NULL);
// mount_id can be used in scripting calls
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
@@ -1019,16 +926,10 @@ class TRINITY_DLL_SPEC Player : public Unit
int GetTimeInnEnter() const { return time_inn_enter; };
void UpdateInnerTime (int time) { time_inn_enter = time; };
+ Pet* GetPet() const;
Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime);
void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false);
- void RemoveMiniPet();
- Pet* GetMiniPet();
- void SetMiniPet(Pet* pet) { m_miniPet = pet->GetGUID(); }
- void RemoveGuardians();
- bool HasGuardianWithEntry(uint32 entry);
- void AddGuardian(Pet* pet) { m_guardianPets.insert(pet->GetGUID()); }
- GuardianPetList const& GetGuardians() const { return m_guardianPets; }
- void Uncharm();
+ uint32 GetPhaseMaskForSpawn() const; // used for proper set phase for DB at GM-mode creature/GO spawn
void Say(const std::string& text, const uint32 language);
void Yell(const std::string& text, const uint32 language);
@@ -1047,9 +948,15 @@ class TRINITY_DLL_SPEC Player : public Unit
Item* GetItemByGuid( uint64 guid ) const;
Item* GetItemByPos( uint16 pos ) const;
Item* GetItemByPos( uint8 bag, uint8 slot ) const;
+ inline Item* GetUseableItemByPos( uint8 bag, uint8 slot ) const //Does additional check for disarmed weapons
+ {
+ if (!CanUseAttackType(GetAttackBySlot(slot)))
+ return NULL;
+ return GetItemByPos(bag, slot);
+ }
Item* GetWeaponForAttack(WeaponAttackType attackType, bool useable = false) const;
Item* GetShield(bool useable = false) const;
- static uint32 GetAttackBySlot( uint8 slot ); // MAX_ATTACK if not weapon slot
+ static uint8 GetAttackBySlot( uint8 slot ); // MAX_ATTACK if not weapon slot
std::vector<Item *> &GetItemUpdateQueue() { return m_itemUpdateQueue; }
static bool IsInventoryPos( uint16 pos ) { return IsInventoryPos(pos >> 8,pos & 255); }
static bool IsInventoryPos( uint8 bag, uint8 slot );
@@ -1063,7 +970,9 @@ class TRINITY_DLL_SPEC Player : public Unit
bool HasBankBagSlot( uint8 slot ) const;
bool HasItemCount( uint32 item, uint32 count, bool inBankAlso = false ) const;
bool HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem = NULL);
- Item* GetItemOrItemWithGemEquipped( uint32 item ) const;
+ bool CanNoReagentCast(SpellEntry 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;
uint8 CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(),pItem->GetCount(),pItem); }
uint8 CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry,count,NULL); }
uint8 CanStoreNewItem( uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL ) const
@@ -1081,6 +990,9 @@ class TRINITY_DLL_SPEC Player : public Unit
uint8 CanStoreItems( Item **pItem,int count) const;
uint8 CanEquipNewItem( uint8 slot, uint16 &dest, uint32 item, bool swap ) const;
uint8 CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading = true ) const;
+
+ uint8 CanEquipUniqueItem( Item * pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1 ) const;
+ uint8 CanEquipUniqueItem( ItemPrototype const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1 ) const;
uint8 CanUnequipItems( uint32 item, uint32 count ) const;
uint8 CanUnequipItem( uint16 src, bool swap ) const;
uint8 CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec& dest, Item *pItem, bool swap, bool not_loading = true ) const;
@@ -1094,6 +1006,8 @@ class TRINITY_DLL_SPEC Player : public Unit
Item* EquipItem( uint16 pos, Item *pItem, bool update );
void AutoUnequipOffhandIfNeed();
bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count);
+ void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false);
+ void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG,NULL_SLOT,loot_id,store,broadcast); }
uint8 _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const;
uint8 _CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item *pItem = NULL, bool swap = false, uint32* no_space_count = NULL ) const;
@@ -1135,12 +1049,16 @@ class TRINITY_DLL_SPEC Player : public Unit
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
uint32 GetArmorProficiency() const { return m_ArmorProficiency; }
- bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
bool IsUseEquipedWeapon( bool mainhand ) const
{
// disarm applied only to mainhand weapon
return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED) );
}
+ bool IsTwoHandUsed() const
+ {
+ Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
+ return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
+ }
void SendNewItem( Item *item, uint32 count, bool received, bool created, bool broadcast = false );
bool BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint64 bagguid, uint8 slot);
@@ -1171,6 +1089,8 @@ class TRINITY_DLL_SPEC Player : public Unit
/*** QUEST SYSTEM ***/
/*********************************************************/
+ uint32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); }
+
void PrepareQuestMenu( uint64 guid );
void SendPreparedQuest( uint64 guid );
bool IsActiveQuest( uint32 quest_id ) const;
@@ -1238,7 +1158,6 @@ class TRINITY_DLL_SPEC Player : public Unit
}
}
uint32 GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry);
- void AdjustQuestReqItemCount( Quest const* pQuest );
void AreaExploredOrEventHappens( uint32 questId );
void GroupEventHappens( uint32 questId, WorldObject const* pEventObject );
void ItemAddedQuestCheck( uint32 entry, uint32 count );
@@ -1247,8 +1166,9 @@ class TRINITY_DLL_SPEC Player : public Unit
void CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id );
void TalkedToCreature( uint32 entry, uint64 guid );
void MoneyChanged( uint32 value );
+ void ReputationChanged(FactionEntry const* factionEntry );
bool HasQuestForItem( uint32 itemid ) const;
- bool HasQuestForGO(int32 GOId);
+ bool HasQuestForGO(int32 GOId) const;
void UpdateForQuestsGO();
bool CanShareQuest(uint32 quest_id) const;
@@ -1275,6 +1195,7 @@ class TRINITY_DLL_SPEC Player : public Unit
/*********************************************************/
bool LoadFromDB(uint32 guid, SqlQueryHolder *holder);
+
bool MinimalLoadFromDB(QueryResult *result, uint32 guid);
static bool LoadValuesArrayFromDB(Tokens& data,uint64 guid);
static uint32 GetUInt32ValueFromArray(Tokens const& data, uint16 index);
@@ -1296,6 +1217,7 @@ class TRINITY_DLL_SPEC Player : public Unit
static void SetFloatValueInArray(Tokens& data,uint16 index, float value);
static void SetUInt32ValueInDB(uint16 index, uint32 value, uint64 guid);
static void SetFloatValueInDB(uint16 index, float value, uint64 guid);
+ static void Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair);
static void SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint32 zone,uint64 guid);
bool m_mailsLoaded;
@@ -1352,7 +1274,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SetSelection(const uint64 &guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
uint8 GetComboPoints() { return m_comboPoints; }
- uint64 GetComboTarget() { return m_comboTarget; }
+ const uint64& GetComboTarget() const { return m_comboTarget; }
void AddComboPoints(Unit* target, int8 count);
void ClearComboPoints();
@@ -1388,10 +1310,7 @@ class TRINITY_DLL_SPEC Player : public Unit
Item* GetMItem(uint32 id)
{
ItemMap::const_iterator itr = mMitems.find(id);
- if (itr != mMitems.end())
- return itr->second;
-
- return NULL;
+ return itr != mMitems.end() ? itr->second : NULL;
}
void AddMItem(Item* it)
@@ -1403,30 +1322,30 @@ class TRINITY_DLL_SPEC Player : public Unit
bool RemoveMItem(uint32 id)
{
- ItemMap::iterator i = mMitems.find(id);
- if (i == mMitems.end())
- return false;
-
- mMitems.erase(i);
- return true;
+ return mMitems.erase(id) ? true : false;
}
void PetSpellInitialize();
void CharmSpellInitialize();
void PossessSpellInitialize();
+ void VehicleSpellInitialize();
+ void SendRemoveControlBar();
bool HasSpell(uint32 spell) const;
+ bool HasActiveSpell(uint32 spell) const; // show in spellbook
TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const;
bool IsSpellFitByClassAndRace( uint32 spell_id ) const;
+ bool IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const;
void SendProficiency(uint8 pr1, uint32 pr2);
void SendInitialSpells();
- bool addSpell(uint32 spell_id, bool active, bool learning = true, bool loading = false, uint16 slot_id=SPELL_WITHOUT_SLOT_ID, bool disabled = false);
- void learnSpell(uint32 spell_id);
- void removeSpell(uint32 spell_id, bool disabled = false);
+ bool addSpell(uint32 spell_id, bool active, bool learning, bool dependent, bool disabled);
+ void learnSpell(uint32 spell_id, bool dependent);
+ void removeSpell(uint32 spell_id, bool disabled = false, bool update_action_bar_for_low_rank = false);
void resetSpells();
- void learnDefaultSpells(bool loading = false);
+ void learnDefaultSpells();
void learnQuestRewardedSpells();
void learnQuestRewardedSpells(Quest const* quest);
+ void learnSpellHighRank(uint32 spellid);
uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); }
void SetFreeTalentPoints(uint32 points) { SetUInt32Value(PLAYER_CHARACTER_POINTS1,points); }
@@ -1434,6 +1353,17 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 resetTalentsCost() const;
void InitTalentForLevel();
+ void LearnTalent(uint32 talentId, uint32 talentRank);
+ void LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank);
+
+ uint32 CalculateTalentsPoints() const;
+
+ void InitGlyphsForLevel();
+ void SetGlyphSlot(uint8 slot, uint32 slottype) { SetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot, slottype); }
+ uint32 GetGlyphSlot(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot); }
+ void SetGlyph(uint8 slot, uint32 glyph) { SetUInt32Value(PLAYER_FIELD_GLYPHS_1 + slot, glyph); }
+ uint32 GetGlyph(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_GLYPHS_1 + slot); }
+
uint32 GetFreePrimaryProffesionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS2); }
void SetFreePrimaryProffesions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS2,profs); }
void InitPrimaryProffesions();
@@ -1442,8 +1372,6 @@ class TRINITY_DLL_SPEC Player : public Unit
PlayerSpellMap & GetSpellMap() { return m_spells; }
void AddSpellMod(SpellModifier* mod, bool apply);
- int32 GetTotalFlatMods(uint32 spellId, SpellModOp op);
- int32 GetTotalPctMods(uint32 spellId, SpellModOp op);
bool IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mod, Spell const* spell = NULL);
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell const* spell = NULL);
void RemoveSpellMods(Spell const* spell);
@@ -1459,14 +1387,17 @@ class TRINITY_DLL_SPEC Player : public Unit
time_t t = time(NULL);
return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0;
}
+ void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false );
void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
- void SendCooldownEvent(SpellEntry const *spellInfo);
+ void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
void ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs );
void RemoveSpellCooldown(uint32 spell_id) { m_spellCooldowns.erase(spell_id); }
void RemoveArenaSpellCooldowns();
void RemoveAllSpellCooldown();
void _LoadSpellCooldowns(QueryResult *result);
void _SaveSpellCooldowns();
+ void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
+ void UpdatePotionCooldown(Spell* spell = NULL);
void setResurrectRequestData(uint64 guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana)
{
@@ -1492,13 +1423,13 @@ class TRINITY_DLL_SPEC Player : public Unit
m_cinematic = cine;
}
- void addActionButton(uint8 button, uint16 action, uint8 type, uint8 misc);
+ bool addActionButton(uint8 button, uint16 action, uint8 type, uint8 misc);
void removeActionButton(uint8 button);
void SendInitialActionButtons();
PvPInfo pvpInfo;
void UpdatePvP(bool state, bool ovrride=false);
- void UpdateZone(uint32 newZone);
+ void UpdateZone(uint32 newZone,uint32 newArea);
void UpdateArea(uint32 newArea);
void UpdateZoneDependentAuras( uint32 zone_id ); // zones
@@ -1548,6 +1479,7 @@ class TRINITY_DLL_SPEC Player : public Unit
static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot);
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
+ static void LeaveAllArenaTeams(uint64 guid);
void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
uint8 GetDifficulty() { return m_dungeonDifficulty; }
@@ -1573,9 +1505,12 @@ class TRINITY_DLL_SPEC Player : public Unit
void UpdateArmor();
void UpdateMaxHealth();
void UpdateMaxPower(Powers power);
+ void ApplyFeralAPBonus(int32 amount, bool apply);
void UpdateAttackPowerAndDamage(bool ranged = false);
void UpdateShieldBlockValue();
void UpdateDamagePhysical(WeaponAttackType attType);
+ void ApplySpellDamageBonus(int32 amount, bool apply);
+ void ApplySpellHealingBonus(int32 amount, bool apply);
void UpdateSpellDamageAndHealingBonus();
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage);
@@ -1593,6 +1528,8 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 GetRangedCritDamageReduction(uint32 damage) const;
uint32 GetSpellCritDamageReduction(uint32 damage) const;
uint32 GetDotDamageReduction(uint32 damage) const;
+ uint32 GetBaseSpellDamageBonus() { return m_baseSpellDamage;}
+ uint32 GetBaseSpellHealingBonus() { return m_baseSpellHealing;}
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const;
void UpdateBlockPercentage();
@@ -1600,9 +1537,14 @@ class TRINITY_DLL_SPEC Player : public Unit
void UpdateAllCritPercentages();
void UpdateParryPercentage();
void UpdateDodgePercentage();
+ void UpdateMeleeHitChances();
+ void UpdateRangedHitChances();
+ void UpdateSpellHitChances();
+
void UpdateAllSpellCritChances();
void UpdateSpellCritChance(uint32 school);
void UpdateExpertise(WeaponAttackType attType);
+ void ApplyManaRegenBonus(int32 amount, bool apply);
void UpdateManaRegen();
const uint64& GetLootGUID() const { return m_lootGuid; }
@@ -1618,8 +1560,6 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendDelayResponse(const uint32);
void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP);
- //Low Level Packets
- void PlaySound(uint32 Sound, bool OnlySelf);
//notifiers
void SendAttackSwingCantAttack();
void SendAttackSwingCancelAttack();
@@ -1662,6 +1602,7 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 DurabilityRepairAll(bool cost, float discountMod, bool guildBank);
uint32 DurabilityRepair(uint16 pos, bool cost, float discountMod, bool guildBank);
+ void UpdateMirrorTimers();
void StopMirrorTimers()
{
StopMirrorTimer(FATIGUE_TIMER);
@@ -1679,21 +1620,25 @@ class TRINITY_DLL_SPEC Player : public Unit
void UpdateDefense();
void UpdateWeaponSkill (WeaponAttackType attType);
- void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence);
+ void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence);
void SetSkill(uint32 id, uint16 currVal, uint16 maxVal);
- uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus
+ uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus
uint16 GetPureMaxSkillValue(uint32 skill) const; // max
uint16 GetSkillValue(uint32 skill) const; // skill value + perm. bonus + temp bonus
uint16 GetBaseSkillValue(uint32 skill) const; // skill value + perm. bonus
uint16 GetPureSkillValue(uint32 skill) const; // skill value
+ int16 GetSkillPermBonusValue(uint32 skill) const;
int16 GetSkillTempBonusValue(uint32 skill) const;
bool HasSkill(uint32 skill) const;
- void learnSkillRewardedSpells( uint32 id );
- void learnSkillRewardedSpells();
+ void learnSkillRewardedSpells(uint32 id, uint32 value);
- void SetDontMove(bool dontMove);
- bool GetDontMove() const { return m_dontMove; }
+ WorldLocation& GetTeleportDest() { return m_teleport_dest; }
+ bool IsBeingTeleported() const { return mSemaphoreTeleport_Near || mSemaphoreTeleport_Far; }
+ bool IsBeingTeleportedNear() const { return mSemaphoreTeleport_Near; }
+ bool IsBeingTeleportedFar() const { return mSemaphoreTeleport_Far; }
+ void SetSemaphoreTeleportNear(bool semphsetting) { mSemaphoreTeleport_Near = semphsetting; }
+ void SetSemaphoreTeleportFar(bool semphsetting) { mSemaphoreTeleport_Far = semphsetting; }
void CheckExploreSystem(void);
@@ -1704,40 +1649,15 @@ class TRINITY_DLL_SPEC Player : public Unit
bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const;
bool RewardPlayerAndGroupAtKill(Unit* pVictim);
+ void RewardPlayerAndGroupAtEvent(uint32 creature_id,WorldObject* pRewardSource);
+ bool isHonorOrXPTarget(Unit* pVictim);
- FactionStateList m_factions;
- ForcedReactions m_forcedReactions;
- FactionStateList const& GetFactionStateList() { return m_factions; }
- uint32 GetDefaultReputationFlags(const FactionEntry *factionEntry) const;
- int32 GetBaseReputation(const FactionEntry *factionEntry) const;
- int32 GetReputation(uint32 faction_id) const;
- int32 GetReputation(const FactionEntry *factionEntry) const;
- ReputationRank GetReputationRank(uint32 faction) const;
- ReputationRank GetReputationRank(const FactionEntry *factionEntry) const;
- ReputationRank GetBaseReputationRank(const FactionEntry *factionEntry) const;
- ReputationRank ReputationToRank(int32 standing) const;
- const static int32 ReputationRank_Length[MAX_REPUTATION_RANK];
- const static int32 Reputation_Cap = 42999;
- const static int32 Reputation_Bottom = -42000;
- bool ModifyFactionReputation(uint32 FactionTemplateId, int32 DeltaReputation);
- bool ModifyFactionReputation(FactionEntry const* factionEntry, int32 standing);
- bool ModifyOneFactionReputation(FactionEntry const* factionEntry, int32 standing);
- bool SetFactionReputation(uint32 FactionTemplateId, int32 standing);
- bool SetFactionReputation(FactionEntry const* factionEntry, int32 standing);
- bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing);
- int32 CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, bool for_quest);
+ ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
+ ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
+ ReputationRank GetReputationRank(uint32 faction_id) const;
void RewardReputation(Unit *pVictim, float rate);
void RewardReputation(Quest const *pQuest);
- void SetInitialFactions();
- void UpdateReputation() const;
- void SendFactionState(FactionState const* faction) const;
- void SendInitialReputations();
- FactionState const* GetFactionState( FactionEntry const* factionEntry) const;
- void SetFactionAtWar(FactionState* faction, bool atWar);
- void SetFactionInactive(FactionState* faction, bool inactive);
- void SetFactionVisible(FactionState* faction);
- void SetFactionVisibleForFactionTemplateId(uint32 FactionTemplateId);
- void SetFactionVisibleForFactionId(uint32 FactionId);
+
void UpdateSkillsForLevel();
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
void ModifySkillBonus(uint32 skillid,int32 val, bool talent);
@@ -1770,6 +1690,8 @@ class TRINITY_DLL_SPEC Player : public Unit
void SetCanParry(bool value);
bool CanBlock() const { return m_canBlock; }
void SetCanBlock(bool value);
+ bool CanTitanGrip() const { return m_canTitanGrip ; }
+ void SetCanTitanGrip(bool value) { m_canTitanGrip = value; }
void SetRegularAttackTime();
void SetBaseModValue(BaseModGroup modGroup, BaseModType modType, float value) { m_auraBaseMod[modGroup][modType] = value; }
@@ -1781,8 +1703,8 @@ class TRINITY_DLL_SPEC Player : public Unit
void _RemoveAllStatBonuses();
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
- void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
- void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
+ void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
+ void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
void _ApplyItemMods(Item *item,uint8 slot,bool apply);
void _RemoveAllItemMods();
@@ -1798,12 +1720,13 @@ class TRINITY_DLL_SPEC Player : public Unit
void ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply, bool form_change = false);
void UpdateEquipSpellsAtFormChange();
void CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attType);
+ void CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex);
- void SendInitWorldStates(bool force = false, uint32 forceZoneId = 0);
+ void SendInitWorldStates(uint32 zone, uint32 area);
void SendUpdateWorldState(uint32 Field, uint32 Value);
void SendDirectMessage(WorldPacket *data);
- void SendAuraDurationsForTarget(Unit* target);
+ void SendAurasForTarget(Unit *target);
PlayerMenu* PlayerTalkClass;
std::vector<ItemSetEffect *> ItemSetEff;
@@ -1817,51 +1740,55 @@ class TRINITY_DLL_SPEC Player : public Unit
/*** BATTLEGROUND SYSTEM ***/
/*********************************************************/
- bool InBattleGround() const { return m_bgBattleGroundID != 0; }
- uint32 GetBattleGroundId() const { return m_bgBattleGroundID; }
+ bool InBattleGround() const { return m_bgBattleGroundID != 0; }
+ bool InArena() const;
+ uint32 GetBattleGroundId() const { return m_bgBattleGroundID; }
+ BattleGroundTypeId GetBattleGroundTypeId() const { return m_bgTypeID; }
BattleGround* GetBattleGround() const;
- bool InArena() const;
- static uint32 GetMinLevelForBattleGroundQueueId(uint32 queue_id);
- static uint32 GetMaxLevelForBattleGroundQueueId(uint32 queue_id);
- uint32 GetBattleGroundQueueIdFromLevel() const;
+
+ BGQueueIdBasedOnLevel GetBattleGroundQueueIdFromLevel(BattleGroundTypeId bgTypeId) const;
bool InBattleGroundQueue() const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- if (m_bgBattleGroundQueueID[i].bgQueueType != 0)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId != BATTLEGROUND_QUEUE_NONE)
return true;
return false;
}
- uint32 GetBattleGroundQueueId(uint32 index) const { return m_bgBattleGroundQueueID[index].bgQueueType; }
- uint32 GetBattleGroundQueueIndex(uint32 bgQueueType) const
+ BattleGroundQueueTypeId GetBattleGroundQueueTypeId(uint32 index) const { return m_bgBattleGroundQueueID[index].bgQueueTypeId; }
+ uint32 GetBattleGroundQueueIndex(BattleGroundQueueTypeId bgQueueTypeId) const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- if (m_bgBattleGroundQueueID[i].bgQueueType == bgQueueType)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
return i;
return PLAYER_MAX_BATTLEGROUND_QUEUES;
}
- bool IsInvitedForBattleGroundQueueType(uint32 bgQueueType) const
+ bool IsInvitedForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId) const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- if (m_bgBattleGroundQueueID[i].bgQueueType == bgQueueType)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
return m_bgBattleGroundQueueID[i].invitedToInstance != 0;
return PLAYER_MAX_BATTLEGROUND_QUEUES;
}
- bool InBattleGroundQueueForBattleGroundQueueType(uint32 bgQueueType) const
+ bool InBattleGroundQueueForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId) const
{
- return GetBattleGroundQueueIndex(bgQueueType) < PLAYER_MAX_BATTLEGROUND_QUEUES;
+ return GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES;
}
- void SetBattleGroundId(uint32 val) { m_bgBattleGroundID = val; }
- uint32 AddBattleGroundQueueId(uint32 val)
+ void SetBattleGroundId(uint32 val, BattleGroundTypeId bgTypeId)
+ {
+ m_bgBattleGroundID = val;
+ m_bgTypeID = bgTypeId;
+ }
+ uint32 AddBattleGroundQueueId(BattleGroundQueueTypeId val)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
{
- if (m_bgBattleGroundQueueID[i].bgQueueType == 0 || m_bgBattleGroundQueueID[i].bgQueueType == val)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == BATTLEGROUND_QUEUE_NONE || m_bgBattleGroundQueueID[i].bgQueueTypeId == val)
{
- m_bgBattleGroundQueueID[i].bgQueueType = val;
+ m_bgBattleGroundQueueID[i].bgQueueTypeId = val;
m_bgBattleGroundQueueID[i].invitedToInstance = 0;
return i;
}
@@ -1871,26 +1798,26 @@ class TRINITY_DLL_SPEC Player : public Unit
bool HasFreeBattleGroundQueueId()
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- if (m_bgBattleGroundQueueID[i].bgQueueType == 0)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == BATTLEGROUND_QUEUE_NONE)
return true;
return false;
}
- void RemoveBattleGroundQueueId(uint32 val)
+ void RemoveBattleGroundQueueId(BattleGroundQueueTypeId val)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
{
- if (m_bgBattleGroundQueueID[i].bgQueueType == val)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == val)
{
- m_bgBattleGroundQueueID[i].bgQueueType = 0;
+ m_bgBattleGroundQueueID[i].bgQueueTypeId = BATTLEGROUND_QUEUE_NONE;
m_bgBattleGroundQueueID[i].invitedToInstance = 0;
return;
}
}
}
- void SetInviteForBattleGroundQueueType(uint32 bgQueueType, uint32 instanceId)
+ void SetInviteForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId, uint32 instanceId)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
- if (m_bgBattleGroundQueueID[i].bgQueueType == bgQueueType)
+ if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
m_bgBattleGroundQueueID[i].invitedToInstance = instanceId;
}
bool IsInvitedForBattleGroundInstance(uint32 instanceId) const
@@ -1900,18 +1827,10 @@ class TRINITY_DLL_SPEC Player : public Unit
return true;
return false;
}
- uint32 GetBattleGroundEntryPointMap() const { return m_bgEntryPointMap; }
- float GetBattleGroundEntryPointX() const { return m_bgEntryPointX; }
- float GetBattleGroundEntryPointY() const { return m_bgEntryPointY; }
- float GetBattleGroundEntryPointZ() const { return m_bgEntryPointZ; }
- float GetBattleGroundEntryPointO() const { return m_bgEntryPointO; }
+ WorldLocation const& GetBattleGroundEntryPoint() const { return m_bgEntryPoint; }
void SetBattleGroundEntryPoint(uint32 Map, float PosX, float PosY, float PosZ, float PosO )
{
- m_bgEntryPointMap = Map;
- m_bgEntryPointX = PosX;
- m_bgEntryPointY = PosY;
- m_bgEntryPointZ = PosZ;
- m_bgEntryPointO = PosO;
+ m_bgEntryPoint = WorldLocation(Map,PosX,PosY,PosZ,PosO);
}
void SetBGTeam(uint32 team) { m_bgTeam = team; }
@@ -1923,9 +1842,11 @@ class TRINITY_DLL_SPEC Player : public Unit
void ReportedAfkBy(Player* reporter);
void ClearAfkReports() { m_bgAfkReporter.clear(); }
- bool GetBGAccessByLevel(uint32 bgTypeId) const;
- bool isAllowUseBattleGroundObject();
+ bool GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const;
bool isTotalImmunity();
+ bool CanUseBattleGroundObject();
+ bool isTotalImmune();
+ bool CanCaptureTowerPoint();
/*********************************************************/
/*** OUTDOOR PVP SYSTEM ***/
@@ -1939,7 +1860,7 @@ class TRINITY_DLL_SPEC Player : public Unit
/*** REST SYSTEM ***/
/*********************************************************/
- bool isRested() const { return GetRestTime() >= 10000; }
+ bool isRested() const { return GetRestTime() >= 10*IN_MILISECONDS; }
uint32 GetXPRestBonus(uint32 xp);
uint32 GetRestTime() const { return m_restTime;};
void SetRestTime(uint32 v) { m_restTime = v;};
@@ -1948,7 +1869,7 @@ class TRINITY_DLL_SPEC Player : public Unit
/*** ENVIROMENTAL SYSTEM ***/
/*********************************************************/
- void EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage);
+ void EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
/*********************************************************/
/*** FLOOD FILTER SYSTEM ***/
@@ -1961,39 +1882,36 @@ class TRINITY_DLL_SPEC Player : public Unit
/*********************************************************/
/*** VARIOUS SYSTEMS ***/
/*********************************************************/
- MovementInfo m_movementInfo;
- uint32 m_lastFallTime;
- float m_lastFallZ;
+ void UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode);
+ Unit *m_mover;
+ WorldObject *m_seer;
void SetFallInformation(uint32 time, float z)
{
m_lastFallTime = time;
m_lastFallZ = z;
}
+ void HandleFall(MovementInfo const& movementInfo);
+
bool isMoving() const { return HasUnitMovementFlag(movementFlagsMask); }
bool isMovingOrTurning() const { return HasUnitMovementFlag(movementOrTurningFlagsMask); }
bool CanFly() const { return HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); }
bool IsFlying() const { return HasUnitMovementFlag(MOVEMENTFLAG_FLYING); }
-
- void HandleDrowning();
- void HandleFallDamage(MovementInfo& movementInfo);
- void HandleFallUnderMap();
+ bool IsAllowUseFlyMountsHere() const;
void SetClientControl(Unit* target, uint8 allowMove);
- uint64 GetFarSight() const { return GetUInt64Value(PLAYER_FARSIGHT); }
- void SetFarSight(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); }
+ void SetMover(Unit* target) { m_mover = target; }
+ void SetSeer(WorldObject *target) { m_seer = target; }
+ void SetViewpoint(WorldObject *target, bool apply);
+ WorldObject* GetViewpoint() const;
+ void StopCastingCharm();
+ void StopCastingBindSight();
// Transports
Transport * GetTransport() const { return m_transport; }
void SetTransport(Transport * t) { m_transport = t; }
- float GetTransOffsetX() const { return m_movementInfo.t_x; }
- float GetTransOffsetY() const { return m_movementInfo.t_y; }
- float GetTransOffsetZ() const { return m_movementInfo.t_z; }
- float GetTransOffsetO() const { return m_movementInfo.t_o; }
- uint32 GetTransTime() const { return m_movementInfo.t_time; }
-
uint32 GetSaveTimer() const { return m_nextSave; }
void SetSaveTimer(uint32 timer) { m_nextSave = timer; }
@@ -2011,6 +1929,7 @@ class TRINITY_DLL_SPEC Player : public Unit
float m_homebindX;
float m_homebindY;
float m_homebindZ;
+ void RelocateToHomebind() { SetMapId(m_homebindMapId); Relocate(m_homebindX,m_homebindY,m_homebindZ); }
// currently visible objects at player client
typedef std::set<uint64> ClientGUIDs;
@@ -2042,9 +1961,12 @@ class TRINITY_DLL_SPEC Player : public Unit
// Temporarily removed pet cache
uint32 GetTemporaryUnsummonedPetNumber() const { return m_temporaryUnsummonedPetNumber; }
void SetTemporaryUnsummonedPetNumber(uint32 petnumber) { m_temporaryUnsummonedPetNumber = petnumber; }
- uint32 GetOldPetSpell() const { return m_oldpetspell; }
- void SetOldPetSpell(uint32 petspell) { m_oldpetspell = petspell; }
+ void UnsummonPetTemporaryIfAny();
+ void ResummonPetTemporaryUnSummonedIfAny();
+ bool IsPetNeedBeTemporaryUnsummoned() const { return !IsInWorld() || !isAlive() || IsMounted() /*+in flight*/; }
+ void SendCinematicStart(uint32 CinematicSequenceId);
+ void SendMovieStart(uint32 MovieId);
/*********************************************************/
/*** INSTANCE SYSTEM ***/
@@ -2079,22 +2001,39 @@ class TRINITY_DLL_SPEC Player : public Unit
GroupReference& GetGroupRef() { return m_group; }
void SetGroup(Group *group, int8 subgroup = -1);
uint8 GetSubGroup() const { return m_group.getSubGroup(); }
- uint32 GetGroupUpdateFlag() { return m_groupUpdateMask; }
+ uint32 GetGroupUpdateFlag() const { return m_groupUpdateMask; }
void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
- uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
- void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
- void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
+ const uint64& GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
+ void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
Player* GetNextRandomRaidMember(float radius);
PartyResult CanUninviteFromGroup() const;
+ // BattleGround Group System
+ void SetBattleGroundRaid(Group *group, int8 subgroup = -1);
+ void RemoveFromBattleGroundRaid();
+ Group * GetOriginalGroup() { return m_originalGroup.getTarget(); }
+ GroupReference& GetOriginalGroupRef() { return m_originalGroup; }
+ uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); }
+ void SetOriginalGroup(Group *group, int8 subgroup = -1);
GridReference<Player> &GetGridRef() { return m_gridRef; }
MapReference &GetMapRef() { return m_mapRef; }
bool isAllowedToLoot(Creature* creature);
- WorldLocation& GetTeleportDest() { return m_teleport_dest; }
-
DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
+ uint8 GetRunesState() const { return m_runes->runeState; }
+ uint8 GetBaseRune(uint8 index) const { return m_runes->runes[index].BaseRune; }
+ uint8 GetCurrentRune(uint8 index) const { return m_runes->runes[index].CurrentRune; }
+ uint8 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; }
+ void SetBaseRune(uint8 index, uint8 baseRune) { m_runes->runes[index].BaseRune = baseRune; }
+ void SetCurrentRune(uint8 index, uint8 currentRune) { m_runes->runes[index].CurrentRune = currentRune; }
+ void SetRuneCooldown(uint8 index, uint8 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); }
+ void ConvertRune(uint8 index, uint8 newType);
+ void ResyncRunes(uint8 count);
+ void AddRunePower(uint8 index);
+ void InitRunes();
+ AchievementMgr& GetAchievementMgr() { return m_achievementMgr; }
+ void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0);
bool HasTitle(uint32 bitIndex);
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
void SetTitle(CharTitlesEntry const* title);
@@ -2107,20 +2046,17 @@ class TRINITY_DLL_SPEC Player : public Unit
/* this variable is set to bg->m_InstanceID, when player is teleported to BG - (it is battleground's GUID)*/
uint32 m_bgBattleGroundID;
+ BattleGroundTypeId m_bgTypeID;
/*
this is an array of BG queues (BgTypeIDs) in which is player
*/
struct BgBattleGroundQueueID_Rec
{
- uint32 bgQueueType;
+ BattleGroundQueueTypeId bgQueueTypeId;
uint32 invitedToInstance;
};
BgBattleGroundQueueID_Rec m_bgBattleGroundQueueID[PLAYER_MAX_BATTLEGROUND_QUEUES];
- uint32 m_bgEntryPointMap;
- float m_bgEntryPointX;
- float m_bgEntryPointY;
- float m_bgEntryPointZ;
- float m_bgEntryPointO;
+ WorldLocation m_bgEntryPoint;
std::set<uint32> m_bgAfkReporter;
uint8 m_bgAfkReportedCount;
@@ -2144,6 +2080,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void _LoadActions(QueryResult *result);
void _LoadAuras(QueryResult *result, uint32 timediff);
+ void _LoadGlyphAuras();
void _LoadBoundInstances(QueryResult *result);
void _LoadInventory(QueryResult *result, uint32 timediff);
void _LoadMailInit(QueryResult *resultUnread, QueryResult *resultDelivery);
@@ -2152,7 +2089,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void _LoadQuestStatus(QueryResult *result);
void _LoadDailyQuestStatus(QueryResult *result);
void _LoadGroup(QueryResult *result);
- void _LoadReputation(QueryResult *result);
+ void _LoadSkills();
void _LoadSpells(QueryResult *result);
void _LoadTutorials(QueryResult *result);
void _LoadFriendList(QueryResult *result);
@@ -2170,7 +2107,6 @@ class TRINITY_DLL_SPEC Player : public Unit
void _SaveMail();
void _SaveQuestStatus();
void _SaveDailyQuestStatus();
- void _SaveReputation();
void _SaveSpells();
void _SaveTutorials();
@@ -2180,13 +2116,11 @@ class TRINITY_DLL_SPEC Player : public Unit
/*********************************************************/
/*** ENVIRONMENTAL SYSTEM ***/
/*********************************************************/
- void HandleLava();
void HandleSobering();
- void StartMirrorTimer(MirrorTimerType Type, uint32 MaxValue);
- void ModifyMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, uint32 Regen);
+ void SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen);
void StopMirrorTimer(MirrorTimerType Type);
- uint8 m_isunderwater;
- bool m_isInWater;
+ void HandleDrowning(uint32 time_diff);
+ int32 getMaxTimer(MirrorTimerType timer);
/*********************************************************/
/*** HONOR SYSTEM ***/
@@ -2194,7 +2128,6 @@ class TRINITY_DLL_SPEC Player : public Unit
time_t m_lastHonorUpdateTime;
void outDebugValues() const;
- bool _removeSpell(uint16 spell_id);
uint64 m_lootGuid;
uint32 m_race;
@@ -2227,10 +2160,16 @@ class TRINITY_DLL_SPEC Player : public Unit
PlayerMails m_mail;
PlayerSpellMap m_spells;
SpellCooldowns m_spellCooldowns;
+ uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use
ActionButtonList m_actionButtons;
float m_auraBaseMod[BASEMOD_END][MOD_END];
+ int16 m_baseRatingValue[MAX_COMBAT_RATING];
+ uint16 m_baseSpellDamage;
+ uint16 m_baseSpellHealing;
+ uint16 m_baseFeralAP;
+ uint16 m_baseManaRegen;
SpellModList m_spellMods[MAX_SPELLMOD];
int32 m_SpellModRemoveCount;
@@ -2247,8 +2186,6 @@ class TRINITY_DLL_SPEC Player : public Unit
typedef std::list<Channel*> JoinedChannelsList;
JoinedChannelsList m_channels;
- bool m_dontMove;
-
int m_cinematic;
Player *pTrader;
@@ -2264,8 +2201,6 @@ class TRINITY_DLL_SPEC Player : public Unit
bool m_DailyQuestChanged;
time_t m_lastDailyQuestTime;
- uint32 m_regenTimer;
- uint32 m_breathTimer;
uint32 m_drunkTimer;
uint16 m_drunk;
uint32 m_weaponChangeTimer;
@@ -2283,8 +2218,10 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 m_ArmorProficiency;
bool m_canParry;
bool m_canBlock;
+ bool m_canTitanGrip;
uint8 m_swingErrorMsg;
float m_ammoDPS;
+
////////////////////Rest System/////////////////////
int time_inn_enter;
uint32 inn_pos_mapid;
@@ -2301,22 +2238,17 @@ class TRINITY_DLL_SPEC Player : public Unit
uint32 m_resetTalentsCost;
time_t m_resetTalentsTime;
uint32 m_usedTalentCount;
+ uint32 m_questRewardTalentCount;
// Social
PlayerSocial *m_social;
// Groups
GroupReference m_group;
+ GroupReference m_originalGroup;
Group *m_groupInvite;
uint32 m_groupUpdateMask;
- uint64 m_auraUpdateMask;
-
- // Temporarily removed pet cache
- uint32 m_temporaryUnsummonedPetNumber;
- uint32 m_oldpetspell;
-
- uint64 m_miniPet;
- GuardianPetList m_guardianPets;
+ uint64 m_auraRaidUpdateMask;
// Player summoning
time_t m_summon_expire;
@@ -2325,12 +2257,8 @@ class TRINITY_DLL_SPEC Player : public Unit
float m_summon_y;
float m_summon_z;
- // Far Teleport
- WorldLocation m_teleport_dest;
-
- bool m_farsightVision;
-
DeclinedName *m_declinedname;
+ Runes *m_runes;
private:
// internal common parts for CanStore/StoreItem functions
uint8 _CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool swap, Item *pSrcItem ) const;
@@ -2338,11 +2266,35 @@ class TRINITY_DLL_SPEC Player : public Unit
uint8 _CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot ) const;
Item* _StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, bool update );
+ void UpdateKnownCurrencies(uint32 itemId, bool apply);
+ int32 CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, bool for_quest);
+ void AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& questStatusData );
+
GridReference<Player> m_gridRef;
MapReference m_mapRef;
void UpdateCharmedAI();
UnitAI *i_AI;
+
+ uint32 m_lastFallTime;
+ float m_lastFallZ;
+
+ int32 m_MirrorTimer[MAX_TIMERS];
+ uint8 m_MirrorTimerFlags;
+ uint8 m_MirrorTimerFlagsLast;
+ bool m_isInWater;
+
+ // Current teleport data
+ WorldLocation m_teleport_dest;
+ bool mSemaphoreTeleport_Near;
+ bool mSemaphoreTeleport_Far;
+
+ // Temporary removed pet cache
+ uint32 m_temporaryUnsummonedPetNumber;
+ uint32 m_oldpetspell;
+
+ AchievementMgr m_achievementMgr;
+ ReputationMgr m_reputationMgr;
};
void AddItemsSetItem(Player*player,Item *item);
@@ -2378,7 +2330,6 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if (mod->charges > 0 )
{
- if( !(spellInfo->SpellFamilyName == 8 && spellInfo->SpellFamilyFlags & 0x200000000LL) )
--mod->charges;
if (mod->charges == 0)
{
diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp
index b061b63a06a..f8f4a0f9f8a 100644
--- a/src/game/PlayerDump.cpp
+++ b/src/game/PlayerDump.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "ObjectMgr.h"
// Character Dump tables
-#define DUMP_TABLE_COUNT 18
+#define DUMP_TABLE_COUNT 20
struct DumpTable
{
@@ -36,24 +36,27 @@ struct DumpTable
static DumpTable dumpTables[DUMP_TABLE_COUNT] =
{
- { "characters", DTT_CHARACTER },
- { "character_queststatus", DTT_CHAR_TABLE },
- { "character_reputation", DTT_CHAR_TABLE },
- { "character_spell", DTT_CHAR_TABLE },
- { "character_spell_cooldown", DTT_CHAR_TABLE },
- { "character_action", DTT_CHAR_TABLE },
- { "character_aura", DTT_CHAR_TABLE },
- { "character_homebind", DTT_CHAR_TABLE },
- { "character_inventory", DTT_INVENTORY },
- { "mail", DTT_MAIL },
- { "mail_items", DTT_MAIL_ITEM },
- { "item_instance", DTT_ITEM },
- { "character_gifts", DTT_ITEM_GIFT },
- { "item_text", DTT_ITEM_TEXT },
- { "character_pet", DTT_PET },
- { "pet_aura", DTT_PET_TABLE },
- { "pet_spell", DTT_PET_TABLE },
- { "pet_spell_cooldown", DTT_PET_TABLE },
+ { "characters", DTT_CHARACTER },
+ { "character_achievement", DTT_CHAR_TABLE },
+ { "character_achievement_progress", DTT_CHAR_TABLE },
+ { "character_queststatus", DTT_CHAR_TABLE },
+ { "character_reputation", DTT_CHAR_TABLE },
+ { "character_spell", DTT_CHAR_TABLE },
+ { "character_spell_cooldown", DTT_CHAR_TABLE },
+ { "character_action", DTT_CHAR_TABLE },
+ { "character_aura", DTT_CHAR_TABLE },
+ { "character_homebind", DTT_CHAR_TABLE },
+// { "character_ticket", DTT_CHAR_TABLE },
+ { "character_inventory", DTT_INVENTORY },
+ { "mail", DTT_MAIL },
+ { "mail_items", DTT_MAIL_ITEM },
+ { "item_instance", DTT_ITEM },
+ { "character_gifts", DTT_ITEM_GIFT },
+ { "item_text", DTT_ITEM_TEXT },
+ { "character_pet", DTT_PET },
+ { "pet_aura", DTT_PET_TABLE },
+ { "pet_spell", DTT_PET_TABLE },
+ { "pet_spell_cooldown", DTT_PET_TABLE },
};
// Low level functions
diff --git a/src/game/PlayerDump.h b/src/game/PlayerDump.h
index 211a000103d..e3dfd192efb 100644
--- a/src/game/PlayerDump.h
+++ b/src/game/PlayerDump.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#ifndef _PLAYER_DUMP_H
#define _PLAYER_DUMP_H
+
#include <string>
#include <map>
#include <set>
@@ -28,10 +29,10 @@ enum DumpTableType
{
DTT_CHARACTER, // // characters
- DTT_CHAR_TABLE, // // character_action, character_aura, character_homebind,
- // character_queststatus, character_reputation,
- // character_spell, character_spell_cooldown, character_ticket,
- // character_tutorial
+ DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress,
+ // character_action, character_aura, character_homebind,
+ // character_queststatus, character_reputation, character_spell,
+ // character_spell_cooldown, character_ticket, character_tutorial
DTT_INVENTORY, // -> item guids collection // character_inventory
diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp
index 6117dbf903d..084dad7cfa8 100644
--- a/src/game/PointMovementGenerator.cpp
+++ b/src/game/PointMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,16 +22,16 @@
#include "Errors.h"
#include "Creature.h"
#include "CreatureAI.h"
-#include "MapManager.h"
#include "DestinationHolderImp.h"
//----- Point Movement Generator
template<class T>
void PointMovementGenerator<T>::Initialize(T &unit)
{
- unit.StopMoving();
+ //unit.StopMoving();
+ unit.clearUnitState(UNIT_STAT_MOVING);
Traveller<T> traveller(unit);
- i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z);
+ i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, !unit.hasUnitState(UNIT_STAT_JUMPING));
if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly())
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
@@ -68,7 +68,7 @@ template<class T>
void PointMovementGenerator<T>:: Finalize(T &unit)
{
if(unit.hasUnitState(UNIT_STAT_CHARGING))
- unit.clearUnitState(UNIT_STAT_CHARGING);
+ unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
else if(arrived)
MovementInform(unit);
}
diff --git a/src/game/PointMovementGenerator.h b/src/game/PointMovementGenerator.h
index 5f1bf33c348..6dfb1d6f8ec 100644
--- a/src/game/PointMovementGenerator.h
+++ b/src/game/PointMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp
new file mode 100644
index 00000000000..bb2276a6d24
--- /dev/null
+++ b/src/game/PoolHandler.cpp
@@ -0,0 +1,719 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://www.mangosproject.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "PoolHandler.h"
+#include "ObjectMgr.h"
+#include "ProgressBar.h"
+#include "Log.h"
+#include "MapManager.h"
+#include "Policies/SingletonImp.h"
+
+INSTANTIATE_SINGLETON_1(PoolHandler);
+
+////////////////////////////////////////////////////////////
+// Methods of template class PoolGroup
+
+template <class T>
+PoolGroup<T>::PoolGroup()
+{
+ Spawned = 0;
+}
+
+// Method to add a gameobject/creature guid to the proper list depending on pool type and chance value
+template <class T>
+void PoolGroup<T>::AddEntry(PoolObject& poolitem, uint32 maxentries)
+{
+ if (poolitem.chance != 0 && maxentries == 1)
+ ExplicitlyChanced.push_back(poolitem);
+ else
+ EqualChanced.push_back(poolitem);
+}
+
+// Method to check the chances are proper in this object pool
+template <class T>
+bool PoolGroup<T>::CheckPool(void)
+{
+ if (EqualChanced.size() == 0)
+ {
+ float chance = 0;
+ for (uint32 i=0; i<ExplicitlyChanced.size(); ++i)
+ chance += ExplicitlyChanced[i].chance;
+ if (chance != 100 && chance != 0)
+ return false;
+ }
+ return true;
+}
+
+// Method that tell if the gameobject, creature or pool is spawned currently
+template <class T>
+bool PoolGroup<T>::IsSpawnedObject(uint32 guid)
+{
+ for (uint32 i=0; i<ExplicitlyChanced.size(); ++i)
+ if (ExplicitlyChanced[i].guid == guid)
+ return ExplicitlyChanced[i].spawned;
+ for (uint32 i=0; i<EqualChanced.size(); ++i)
+ if (EqualChanced[i].guid == guid)
+ return EqualChanced[i].spawned;
+ return false;
+}
+
+// Method that return a guid of a rolled creature or gameobject
+// Note: Copy from loot system because it's very similar and only few things change
+template <class T>
+uint32 PoolGroup<T>::RollOne(void)
+{
+ if (!ExplicitlyChanced.empty()) // First explicitly chanced entries are checked
+ {
+ float roll = rand_chance();
+
+ for (uint32 i=0; i<ExplicitlyChanced.size(); ++i)
+ {
+ roll -= ExplicitlyChanced[i].chance;
+ if (roll < 0)
+ return ExplicitlyChanced[i].guid;
+ }
+ }
+ if (!EqualChanced.empty())
+ return EqualChanced[irand(0, EqualChanced.size()-1)].guid;
+
+ return 0; // None found
+}
+
+// Main method to despawn a creature or gameobject in a pool
+// If no guid is passed, the pool is just removed (event end case)
+// If guid is filled, cache will be used and no removal will occur, it just fill the cache
+template<class T>
+void PoolGroup<T>::DespawnObject(uint32 guid)
+{
+ for (int i=0; i<EqualChanced.size(); ++i)
+ {
+ if (EqualChanced[i].spawned)
+ {
+ if (!guid || EqualChanced[i].guid == guid)
+ {
+ if (guid)
+ CacheValue = EqualChanced[i].guid;
+ else
+ Despawn1Object(EqualChanced[i].guid);
+
+ EqualChanced[i].spawned = false;
+ Spawned--;
+ }
+ }
+ }
+}
+
+// Method that is actualy doing the removal job on one creature
+template<>
+void PoolGroup<Creature>::Despawn1Object(uint32 guid)
+{
+ if (CreatureData const* data = objmgr.GetCreatureData(guid))
+ {
+ objmgr.RemoveCreatureFromGrid(guid, data);
+
+ if (Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
+ {
+ pCreature->CleanupsBeforeDelete();
+ pCreature->AddObjectToRemoveList();
+ }
+ }
+}
+
+// Same on one gameobject
+template<>
+void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
+{
+ if (GameObjectData const* data = objmgr.GetGOData(guid))
+ {
+ objmgr.RemoveGameobjectFromGrid(guid, data);
+
+ if (GameObject* pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
+ pGameobject->AddObjectToRemoveList();
+ }
+}
+
+// Same on one pool
+template<>
+void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id)
+{
+ poolhandler.DespawnPool(child_pool_id);
+}
+
+// Method for a pool only to remove any found record causing a circular dependency loop
+template<>
+void PoolGroup<Pool>::RemoveOneRelation(uint16 child_pool_id)
+{
+ for (PoolObjectList::iterator itr = ExplicitlyChanced.begin(); itr != ExplicitlyChanced.end(); ++itr)
+ {
+ if(itr->guid == child_pool_id)
+ {
+ ExplicitlyChanced.erase(itr);
+ break;
+ }
+ }
+ for (PoolObjectList::iterator itr = EqualChanced.begin(); itr != EqualChanced.end(); ++itr)
+ {
+ if(itr->guid == child_pool_id)
+ {
+ EqualChanced.erase(itr);
+ break;
+ }
+ }
+}
+
+// Method that Spawn 1+ creatures or gameobject
+// if cache is false (initialization or event start), X creatures are spawned with X <= limit (< if limit higher that the number of creatures in pool)
+// if cache is true, this means only one has to be spawned (or respawned if the rolled one is same as cached one)
+template <class T>
+void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
+{
+ if (limit == 1) // This is the only case where explicit chance is used
+ {
+ uint32 roll = RollOne();
+ if (cache && CacheValue != roll)
+ Despawn1Object(CacheValue);
+ CacheValue = Spawn1Object(roll);
+ }
+ else if (limit < EqualChanced.size() && Spawned < limit)
+ {
+ std::vector<uint32> IndexList;
+ for (int i=0; i<EqualChanced.size(); ++i)
+ if (!EqualChanced[i].spawned)
+ IndexList.push_back(i);
+
+ while (Spawned < limit && IndexList.size() > 0)
+ {
+ uint32 roll = urand(1, IndexList.size()) - 1;
+ uint32 index = IndexList[roll];
+ if (!cache || (cache && EqualChanced[index].guid != CacheValue))
+ {
+ if (cache)
+ Despawn1Object(CacheValue);
+ EqualChanced[index].spawned = Spawn1Object(EqualChanced[index].guid);
+ }
+ else
+ EqualChanced[index].spawned = ReSpawn1Object(EqualChanced[index].guid);
+
+ if (EqualChanced[index].spawned)
+ ++Spawned; // limited group use the Spawned variable to store the number of actualy spawned creatures
+ std::vector<uint32>::iterator itr = IndexList.begin()+roll;
+ IndexList.erase(itr);
+ }
+ CacheValue = 0;
+ }
+ else // Not enough objects in pool, so spawn all
+ {
+ for (int i=0; i<EqualChanced.size(); ++i)
+ EqualChanced[i].spawned = Spawn1Object(EqualChanced[i].guid);
+ }
+}
+
+// Method that is actualy doing the spawn job on 1 creature
+template <>
+bool PoolGroup<Creature>::Spawn1Object(uint32 guid)
+{
+ CreatureData const* data = objmgr.GetCreatureData(guid);
+ if (data)
+ {
+ objmgr.AddCreatureToGrid(guid, data);
+
+ // Spawn if necessary (loaded grids only)
+ Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(data->mapid));
+ // We use spawn coords to spawn
+ if (!map->Instanceable() && !map->IsRemovalGrid(data->posX, data->posY))
+ {
+ Creature* pCreature = new Creature;
+ //sLog.outDebug("Spawning creature %u",guid);
+ if (!pCreature->LoadFromDB(guid, map))
+ {
+ delete pCreature;
+ }
+ else
+ {
+ map->Add(pCreature);
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+// Same for 1 gameobject
+template <>
+bool PoolGroup<GameObject>::Spawn1Object(uint32 guid)
+{
+ GameObjectData const* data = objmgr.GetGOData(guid);
+ if (data)
+ {
+ objmgr.AddGameobjectToGrid(guid, data);
+ // Spawn if necessary (loaded grids only)
+ // this base map checked as non-instanced and then only existed
+ Map* map = const_cast<Map*>(MapManager::Instance().GetBaseMap(data->mapid));
+ // We use current coords to unspawn, not spawn coords since creature can have changed grid
+ if (!map->Instanceable() && !map->IsRemovalGrid(data->posX, data->posY))
+ {
+ GameObject* pGameobject = new GameObject;
+ //sLog.outDebug("Spawning gameobject %u", guid);
+ if (!pGameobject->LoadFromDB(guid, map))
+ {
+ delete pGameobject;
+ }
+ else
+ {
+ if (pGameobject->isSpawnedByDefault())
+ map->Add(pGameobject);
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+// Same for 1 pool
+template <>
+bool PoolGroup<Pool>::Spawn1Object(uint32 child_pool_id)
+{
+ poolhandler.SpawnPool(child_pool_id);
+ return true;
+}
+
+// Method that does the respawn job on the specified creature
+template <>
+bool PoolGroup<Creature>::ReSpawn1Object(uint32 guid)
+{
+ CreatureData const* data = objmgr.GetCreatureData(guid);
+ if (data)
+ {
+ if (Creature* pCreature = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
+ pCreature->GetMap()->Add(pCreature);
+ return true;
+ }
+ return false;
+}
+
+// Same for 1 gameobject
+template <>
+bool PoolGroup<GameObject>::ReSpawn1Object(uint32 guid)
+{
+ GameObjectData const* data = objmgr.GetGOData(guid);
+ if (data)
+ {
+ if (GameObject* pGameobject = ObjectAccessor::Instance().GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
+ pGameobject->GetMap()->Add(pGameobject);
+ return true;
+ }
+ return false;
+}
+
+// Nothing to do for a child Pool
+template <>
+bool PoolGroup<Pool>::ReSpawn1Object(uint32 guid)
+{
+ return true;
+}
+
+
+////////////////////////////////////////////////////////////
+// Methods of class PoolHandler
+
+PoolHandler::PoolHandler()
+{
+ isSystemInit = false;
+}
+
+void PoolHandler::LoadFromDB()
+{
+ QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template");
+ if (!result)
+ {
+ sLog.outString(">> Table pool_template is empty.");
+ sLog.outString();
+ return;
+ }
+ else
+ {
+ Field *fields = result->Fetch();
+ max_pool_id = fields[0].GetUInt16();
+ delete result;
+ }
+
+ mPoolTemplate.resize(max_pool_id + 1);
+
+ result = WorldDatabase.Query("SELECT entry,max_limit FROM pool_template");
+ if (!result)
+ {
+ mPoolTemplate.clear();
+ sLog.outString(">> Table pool_template is empty:");
+ sLog.outString();
+ return;
+ }
+
+ uint32 count = 0;
+
+ barGoLink bar(result->GetRowCount());
+ do
+ {
+ ++count;
+ Field *fields = result->Fetch();
+
+ bar.step();
+
+ uint16 pool_id = fields[0].GetUInt16();
+
+ PoolTemplateData& pPoolTemplate = mPoolTemplate[pool_id];
+ pPoolTemplate.MaxLimit = fields[1].GetUInt32();
+
+ } while (result->NextRow());
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u objects pools", count );
+ delete result;
+
+ // Creatures
+
+ mPoolCreatureGroups.resize(max_pool_id + 1);
+ mCreatureSearchMap.clear();
+ // 1 2 3
+ result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature");
+
+ count = 0;
+ if (!result)
+ {
+ barGoLink bar2(1);
+ bar2.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u creatures in pools", count );
+ }
+ else
+ {
+
+ barGoLink bar2(result->GetRowCount());
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar2.step();
+
+ uint32 guid = fields[0].GetUInt32();
+ uint16 pool_id = fields[1].GetUInt16();
+ float chance = fields[2].GetFloat();
+
+ CreatureData const* data = objmgr.GetCreatureData(guid);
+ if (!data)
+ {
+ sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );
+ continue;
+ }
+ if (pool_id > max_pool_id)
+ {
+ sLog.outErrorDb("`pool_creature` pool id (%i) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
+ continue;
+ }
+ if (chance < 0 || chance > 100)
+ {
+ sLog.outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%i), skipped.", chance, guid, pool_id);
+ continue;
+ }
+ PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
+ ++count;
+
+ PoolObject plObject = PoolObject(guid, chance);
+ PoolGroup<Creature>& cregroup = mPoolCreatureGroups[pool_id];
+ cregroup.AddEntry(plObject, pPoolTemplate->MaxLimit);
+ SearchPair p(guid, pool_id);
+ mCreatureSearchMap.insert(p);
+
+ } while (result->NextRow());
+ sLog.outString();
+ sLog.outString( ">> Loaded %u creatures in pools", count );
+ delete result;
+ }
+
+ // Gameobjects
+
+ mPoolGameobjectGroups.resize(max_pool_id + 1);
+ mGameobjectSearchMap.clear();
+ // 1 2 3
+ result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_gameobject");
+
+ count = 0;
+ if (!result)
+ {
+ barGoLink bar2(1);
+ bar2.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u gameobject in pools", count );
+ }
+ else
+ {
+
+ barGoLink bar2(result->GetRowCount());
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar2.step();
+
+ uint32 guid = fields[0].GetUInt32();
+ uint16 pool_id = fields[1].GetUInt16();
+ float chance = fields[2].GetFloat();
+
+ GameObjectData const* data = objmgr.GetGOData(guid);
+ if (!data)
+ {
+ sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id );
+ continue;
+ }
+ GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(data->id);
+ if (goinfo->type != GAMEOBJECT_TYPE_CHEST &&
+ goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
+ goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
+ {
+ sLog.outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id );
+ continue;
+ }
+ if (pool_id > max_pool_id)
+ {
+ sLog.outErrorDb("`pool_gameobject` pool id (%i) is out of range compared to max pool id in `pool_template`, skipped.",pool_id);
+ continue;
+ }
+ if (chance < 0 || chance > 100)
+ {
+ sLog.outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%i), skipped.", chance, guid, pool_id);
+ continue;
+ }
+ PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id];
+
+ ++count;
+
+ PoolObject plObject = PoolObject(guid, chance);
+ PoolGroup<GameObject>& gogroup = mPoolGameobjectGroups[pool_id];
+ gogroup.AddEntry(plObject, pPoolTemplate->MaxLimit);
+ SearchPair p(guid, pool_id);
+ mGameobjectSearchMap.insert(p);
+
+ } while( result->NextRow() );
+ sLog.outString();
+ sLog.outString( ">> Loaded %u gameobject in pools", count );
+ delete result;
+ }
+
+ // Pool of pools
+ mPoolPoolGroups.resize(max_pool_id + 1);
+ // 1 2 3
+ result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool");
+
+ count = 0;
+ if( !result )
+ {
+ barGoLink bar2(1);
+ bar2.step();
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u pools in pools", count );
+ }
+ else
+ {
+
+ barGoLink bar2( result->GetRowCount() );
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar2.step();
+
+ uint16 child_pool_id = fields[0].GetUInt16();
+ uint16 mother_pool_id = fields[1].GetUInt16();
+ float chance = fields[2].GetFloat();
+
+ if (mother_pool_id > max_pool_id)
+ {
+ sLog.outErrorDb("`pool_pool` mother_pool id (%i) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id);
+ continue;
+ }
+ if (child_pool_id > max_pool_id)
+ {
+ sLog.outErrorDb("`pool_pool` included pool_id (%i) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id);
+ continue;
+ }
+ if (mother_pool_id == child_pool_id)
+ {
+ sLog.outErrorDb("`pool_pool` pool_id (%i) includes itself, dead-lock detected, skipped.",child_pool_id);
+ continue;
+ }
+ if (chance < 0 || chance > 100)
+ {
+ sLog.outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%i), skipped.", chance, child_pool_id, mother_pool_id);
+ continue;
+ }
+ PoolTemplateData *pPoolTemplateMother = &mPoolTemplate[mother_pool_id];
+
+ ++count;
+
+ PoolObject plObject = PoolObject(child_pool_id, chance);
+ PoolGroup<Pool>& plgroup = mPoolPoolGroups[mother_pool_id];
+ plgroup.AddEntry(plObject, pPoolTemplateMother->MaxLimit);
+ SearchPair p(child_pool_id, mother_pool_id);
+ mPoolSearchMap.insert(p);
+
+ } while( result->NextRow() );
+
+ // Now check for circular reference
+ for(uint16 i=0; i<max_pool_id; ++i)
+ {
+ std::set<uint16> checkedPools;
+ for(SearchMap::iterator poolItr = mPoolSearchMap.find(i); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second))
+ {
+ checkedPools.insert(poolItr->first);
+ if(checkedPools.find(poolItr->second) != checkedPools.end())
+ {
+ std::ostringstream ss;
+ ss<< "The pool(s) ";
+ for (std::set<uint16>::const_iterator itr=checkedPools.begin(); itr!=checkedPools.end(); ++itr)
+ ss << *itr << " ";
+ ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
+ << poolItr->first << " and child pool " << poolItr->second;
+ sLog.outErrorDb(ss.str().c_str());
+ mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
+ mPoolSearchMap.erase(poolItr);
+ --count;
+ break;
+ }
+ }
+ }
+ sLog.outString();
+ sLog.outString( ">> Loaded %u pools in mother pools", count );
+ delete result;
+ }
+}
+
+// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
+void PoolHandler::Initialize()
+{
+ QueryResult *result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL AND pool_pool.pool_id IS NULL");
+ uint32 count=0;
+ if (result)
+ {
+ do
+ {
+ Field *fields = result->Fetch();
+ uint16 pool_entry = fields[0].GetUInt16();
+ if (!CheckPool(pool_entry))
+ {
+ sLog.outErrorDb("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.", pool_entry);
+ continue;
+ }
+ SpawnPool(pool_entry);
+ count++;
+ } while (result->NextRow());
+ }
+
+ sLog.outBasic("Pool handling system initialized, %u pools spawned.", count);
+ isSystemInit = true;
+}
+
+// Call to spawn a pool, if cache if true the method will spawn only if cached entry is different
+// If it's same, the gameobject/creature is respawned only (added back to map)
+void PoolHandler::SpawnPool(uint16 pool_id, bool cache)
+{
+ if (!mPoolPoolGroups[pool_id].isEmpty())
+ mPoolPoolGroups[pool_id].SpawnObject(mPoolTemplate[pool_id].MaxLimit, cache);
+ if (!mPoolGameobjectGroups[pool_id].isEmpty())
+ mPoolGameobjectGroups[pool_id].SpawnObject(mPoolTemplate[pool_id].MaxLimit, cache);
+ if (!mPoolCreatureGroups[pool_id].isEmpty())
+ mPoolCreatureGroups[pool_id].SpawnObject(mPoolTemplate[pool_id].MaxLimit, cache);
+}
+
+// Call to despawn a pool, all gameobjects/creatures in this pool are removed
+void PoolHandler::DespawnPool(uint16 pool_id)
+{
+ if (!mPoolPoolGroups[pool_id].isEmpty())
+ mPoolPoolGroups[pool_id].DespawnObject();
+ if (!mPoolGameobjectGroups[pool_id].isEmpty())
+ mPoolGameobjectGroups[pool_id].DespawnObject();
+ if (!mPoolCreatureGroups[pool_id].isEmpty())
+ mPoolCreatureGroups[pool_id].DespawnObject();
+}
+
+// Call to update the pool when a gameobject/creature part of pool [pool_id] is ready to respawn
+// Here we cache only the creature/gameobject whose guid is passed as parameter
+// Then the spawn pool call will use this cache to decide
+void PoolHandler::UpdatePool(uint16 pool_id, uint32 guid, uint32 type)
+{
+ uint16 motherpoolid = IsPartOfAPool(pool_id, 0);
+
+ if (motherpoolid)
+ mPoolPoolGroups[motherpoolid].DespawnObject(pool_id);
+ else if (type == TYPEID_GAMEOBJECT && !mPoolGameobjectGroups[pool_id].isEmpty())
+ mPoolGameobjectGroups[pool_id].DespawnObject(guid);
+ else if (type != TYPEID_GAMEOBJECT && !mPoolCreatureGroups[pool_id].isEmpty())
+ mPoolCreatureGroups[pool_id].DespawnObject(guid);
+
+ if (motherpoolid)
+ SpawnPool(motherpoolid, true);
+ else
+ SpawnPool(pool_id, true);
+}
+
+// Method that tell if the gameobject/creature is part of a pool and return the pool id if yes
+uint16 PoolHandler::IsPartOfAPool(uint32 guid, uint32 type)
+{
+ if (type == 0) // pool of pool
+ {
+ SearchMap::const_iterator itr = mPoolSearchMap.find(guid);
+ if (itr != mPoolSearchMap.end())
+ return itr->second;
+ }
+ else if (type == TYPEID_GAMEOBJECT)
+ {
+ SearchMap::const_iterator itr = mGameobjectSearchMap.find(guid);
+ if (itr != mGameobjectSearchMap.end())
+ return itr->second;
+ }
+ else // creature
+ {
+ SearchMap::const_iterator itr = mCreatureSearchMap.find(guid);
+ if (itr != mCreatureSearchMap.end())
+ return itr->second;
+ }
+ return 0;
+}
+
+// Method that check chance integrity of the creatures and gameobjects in this pool
+bool PoolHandler::CheckPool(uint16 pool_id)
+{
+ return pool_id <= max_pool_id &&
+ mPoolGameobjectGroups[pool_id].CheckPool() &&
+ mPoolCreatureGroups[pool_id].CheckPool() &&
+ mPoolPoolGroups[pool_id].CheckPool();
+}
+
+// Method that tell if a creature or gameobject in pool_id is spawned currently
+bool PoolHandler::IsSpawnedObject(uint16 pool_id, uint32 guid, uint32 type)
+{
+ if (pool_id > max_pool_id)
+ return false;
+ if (type == 0)
+ return mPoolPoolGroups[pool_id].IsSpawnedObject(guid);
+ else if (type == TYPEID_GAMEOBJECT)
+ return mPoolGameobjectGroups[pool_id].IsSpawnedObject(guid);
+ else
+ return mPoolCreatureGroups[pool_id].IsSpawnedObject(guid);
+}
diff --git a/src/game/PoolHandler.h b/src/game/PoolHandler.h
new file mode 100644
index 00000000000..35e18c2d58c
--- /dev/null
+++ b/src/game/PoolHandler.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://www.mangosproject.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_POOLHANDLER_H
+#define MANGOS_POOLHANDLER_H
+
+#include "Platform/Define.h"
+#include "Policies/Singleton.h"
+#include "Creature.h"
+#include "GameObject.h"
+
+struct PoolTemplateData
+{
+ uint32 MaxLimit;
+};
+
+struct PoolObject
+{
+ uint32 guid;
+ float chance;
+ bool spawned;
+ PoolObject(uint32 _guid, float _chance): guid(_guid), chance(fabs(_chance)), spawned(false) {}
+};
+
+template <class T>
+class PoolGroup
+{
+ public:
+ PoolGroup();
+ ~PoolGroup() {};
+ bool isEmpty() { return ExplicitlyChanced.size()==0 && EqualChanced.size()==0; }
+ void AddEntry(PoolObject& poolitem, uint32 maxentries);
+ bool CheckPool(void);
+ uint32 RollOne(void);
+ bool IsSpawnedObject(uint32 guid);
+ void DespawnObject(uint32 guid=0);
+ void Despawn1Object(uint32 guid);
+ void SpawnObject(uint32 limit, bool cache=false);
+ bool Spawn1Object(uint32 guid);
+ bool ReSpawn1Object(uint32 guid);
+ void RemoveOneRelation(uint16 child_pool_id);
+ private:
+ typedef std::vector<PoolObject> PoolObjectList;
+ uint32 CacheValue; // Store the guid of the removed creature/gameobject during a pool update
+ PoolObjectList ExplicitlyChanced;
+ PoolObjectList EqualChanced;
+ uint32 Spawned; // Used to know the number of spawned objects
+};
+
+class Pool // for Pool of Pool case
+{
+};
+
+class PoolHandler
+{
+ public:
+ PoolHandler();
+ ~PoolHandler() {};
+ void LoadFromDB();
+ uint16 IsPartOfAPool(uint32 guid, uint32 type);
+ bool IsSpawnedObject(uint16 pool_id, uint32 guid, uint32 type);
+ bool CheckPool(uint16 pool_id);
+ void SpawnPool(uint16 pool_id, bool cache=false);
+ void DespawnPool(uint16 pool_id);
+ void UpdatePool(uint16 pool_id, uint32 guid, uint32 type);
+ void Initialize();
+
+ protected:
+ bool isSystemInit;
+ uint16 max_pool_id;
+ typedef std::vector<PoolTemplateData> PoolTemplateDataMap;
+ typedef std::vector<PoolGroup<Creature> > PoolGroupCreatureMap;
+ typedef std::vector<PoolGroup<GameObject> > PoolGroupGameObjectMap;
+ typedef std::vector<PoolGroup<Pool> > PoolGroupPoolMap;
+ typedef std::pair<uint32, uint16> SearchPair;
+ typedef std::map<uint32, uint16> SearchMap;
+
+ PoolTemplateDataMap mPoolTemplate;
+ PoolGroupCreatureMap mPoolCreatureGroups;
+ PoolGroupGameObjectMap mPoolGameobjectGroups;
+ PoolGroupPoolMap mPoolPoolGroups;
+ SearchMap mCreatureSearchMap;
+ SearchMap mGameobjectSearchMap;
+ SearchMap mPoolSearchMap;
+
+};
+
+#define poolhandler MaNGOS::Singleton<PoolHandler>::Instance()
+#endif
diff --git a/src/game/PossessedAI.cpp b/src/game/PossessedAI.cpp
index bda0de88882..8fd2e5ca014 100644
--- a/src/game/PossessedAI.cpp
+++ b/src/game/PossessedAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/PossessedAI.h b/src/game/PossessedAI.h
index bbfacb6454c..bef7853246e 100644
--- a/src/game/PossessedAI.h
+++ b/src/game/PossessedAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
- * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/>
+ * Thanks to the original authors: MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp
index 6a99703dbc4..2a4e08cf0d9 100644
--- a/src/game/QueryHandler.cpp
+++ b/src/game/QueryHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,8 +31,8 @@
#include "Player.h"
#include "UpdateMask.h"
#include "NPCHandler.h"
-#include "ObjectAccessor.h"
#include "Pet.h"
+#include "MapManager.h"
void WorldSession::SendNameQueryOpcode(Player *p)
{
@@ -102,20 +102,20 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32
WorldPacket data( SMSG_NAME_QUERY_RESPONSE, (8+1+4+4+4+10) );
data << MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER);
data << name;
- data << (uint8)0;
- data << (uint32)(field & 0xFF);
- data << (uint32)((field >> 16) & 0xFF);
- data << (uint32)((field >> 8) & 0xFF);
+ data << uint8(0);
+ data << uint32(field & 0xFF);
+ data << uint32((field >> 16) & 0xFF);
+ data << uint32((field >> 8) & 0xFF);
// if the first declined name field (3) is empty, the rest must be too
if(sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) && fields[3].GetCppString() != "")
{
- data << (uint8)1; // is declined
+ data << uint8(1); // is declined
for(int i = 3; i < MAX_DECLINED_NAME_CASES+3; ++i)
data << fields[i].GetCppString();
}
else
- data << (uint8)0; // is declined
+ data << uint8(0); // is declined
session->SendPacket( &data );
delete result;
@@ -123,7 +123,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult *result, uint32
void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
{
- CHECK_PACKET_SIZE(recv_data,8);
+ CHECK_PACKET_SIZE(recv_data, 8);
uint64 guid;
@@ -176,24 +176,22 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
sLog.outDetail("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name, entry);
// guess size
WorldPacket data( SMSG_CREATURE_QUERY_RESPONSE, 100 );
- data << (uint32)entry; // creature entry
+ data << uint32(entry); // creature entry
data << Name;
data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty
data << SubName;
data << ci->IconName; // "Directions" for guard, string for Icons 2.3.0
- data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1
- data << (uint32)ci->type;
- data << (uint32)ci->family; // family wdbFeild9
- data << (uint32)ci->rank; // rank wdbFeild10
- data << (uint32)0; // unknown wdbFeild11
- data << (uint32)ci->PetSpellDataId; // Id from CreatureSpellData.dbc wdbField12
+ data << uint32(ci->type_flags); // flags wdbFeild7=wad flags1
+ data << uint32(ci->type);
+ data << uint32(ci->family); // family wdbFeild9
+ data << uint32(ci->rank); // rank wdbFeild10
+ data << uint32(ci->PetSpellDataId); // Id from CreatureSpellData.dbc wdbField12
data << (uint32)ci->Modelid_A1; // Modelid_A1
data << (uint32)ci->Modelid_A2; // Modelid_A2
data << (uint32)ci->Modelid_H1; // Modelid_H1
data << (uint32)ci->Modelid_H2; // Modelid_H2
- data << (float)1.0f; // unk
- data << (float)1.0f; // unk
- data << (uint8)ci->RacialLeader;
+ data << float(ci->unk17); // unk
+ data << uint8(ci->RacialLeader);
SendPacket( &data );
sLog.outDebug( "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE " );
}
@@ -207,7 +205,7 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
WorldPacket data( SMSG_CREATURE_QUERY_RESPONSE, 4 );
data << uint32(entry | 0x80000000);
SendPacket( &data );
- sLog.outDebug( "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE " );
+ sLog.outDebug( "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE " );
}
}
@@ -224,9 +222,11 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
{
std::string Name;
+ std::string IconName;
std::string CastBarCaption;
Name = info->name;
+ IconName = info->IconName;
CastBarCaption = info->castBarCaption;
int loc_idx = GetSessionDbLocaleIndex();
@@ -243,15 +243,16 @@ void WorldSession::HandleGameObjectQueryOpcode( WorldPacket & recv_data )
}
sLog.outDetail("WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name, entryID);
WorldPacket data ( SMSG_GAMEOBJECT_QUERY_RESPONSE, 150 );
- data << entryID;
- data << (uint32)info->type;
- data << (uint32)info->displayId;
+ data << uint32(entryID);
+ data << uint32(info->type);
+ data << uint32(info->displayId);
data << Name;
data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4
- data << uint8(0); // 2.0.3, string
+ data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword)
data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting")
- data << uint8(0); // 2.0.3, probably string
- data.append(info->raw.data,24);
+ data << uint8(0); // 2.0.3, string
+ data.append(info->raw.data, 24);
+ data << float(info->size); // go size
SendPacket( &data );
sLog.outDebug( "WORLD: Sent CMSG_GAMEOBJECT_QUERY " );
}
@@ -276,20 +277,43 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
Corpse *corpse = GetPlayer()->GetCorpse();
- uint8 found = 1;
if(!corpse)
- found = 0;
+ {
+ WorldPacket data(MSG_CORPSE_QUERY, 1);
+ data << uint8(0); // corpse not found
+ SendPacket(&data);
+ return;
+ }
- WorldPacket data(MSG_CORPSE_QUERY, (1+found*(5*4)));
- data << uint8(found);
- if(found)
+ int32 mapid = corpse->GetMapId();
+ float x = corpse->GetPositionX();
+ float y = corpse->GetPositionY();
+ float z = corpse->GetPositionZ();
+ int32 corpsemapid = _player->GetMapId();
+
+ if(Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()))
{
- data << corpse->GetMapId();
- data << corpse->GetPositionX();
- data << corpse->GetPositionY();
- data << corpse->GetPositionZ();
- data << _player->GetMapId();
+ if(map->IsDungeon())
+ {
+ if(!map->GetEntrancePos(mapid, x, y))
+ return;
+
+ Map *entrance_map = MapManager::Instance().GetMap(mapid, _player);
+ if(!entrance_map)
+ return;
+
+ z = entrance_map->GetHeight(x, y, MAX_HEIGHT);
+ corpsemapid = corpse->GetMapId();
+ }
}
+
+ WorldPacket data(MSG_CORPSE_QUERY, 1+(5*4));
+ data << uint8(1); // corpse found
+ data << int32(mapid);
+ data << float(x);
+ data << float(y);
+ data << float(z);
+ data << int32(corpsemapid);
SendPacket(&data);
}
@@ -299,8 +323,6 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
uint32 textID;
uint64 guid;
- GossipText *pGossip;
- std::string GossipStr;
recv_data >> textID;
sLog.outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
@@ -308,7 +330,7 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
recv_data >> guid;
GetPlayer()->SetUInt64Value(UNIT_FIELD_TARGET, guid);
- pGossip = objmgr.GetGossipText(textID);
+ GossipText const* pGossip = objmgr.GetGossipText(textID);
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 100 ); // guess size
data << textID;
@@ -370,14 +392,11 @@ void WorldSession::HandleNpcTextQueryOpcode( WorldPacket & recv_data )
data << pGossip->Options[i].Language;
- data << pGossip->Options[i].Emotes[0]._Delay;
- data << pGossip->Options[i].Emotes[0]._Emote;
-
- data << pGossip->Options[i].Emotes[1]._Delay;
- data << pGossip->Options[i].Emotes[1]._Emote;
-
- data << pGossip->Options[i].Emotes[2]._Delay;
- data << pGossip->Options[i].Emotes[2]._Emote;
+ for(int j = 0; j < 3; ++j)
+ {
+ data << pGossip->Options[i].Emotes[j]._Delay;
+ data << pGossip->Options[i].Emotes[j]._Emote;
+ }
}
}
diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp
index 3e190d67220..799896c8280 100644
--- a/src/game/QuestDef.cpp
+++ b/src/game/QuestDef.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,88 +44,87 @@ Quest::Quest(Field * questRecord)
QuestFlags = questRecord[17].GetUInt16();
uint32 SpecialFlags = questRecord[18].GetUInt16();
CharTitleId = questRecord[19].GetUInt32();
- PrevQuestId = questRecord[20].GetInt32();
- NextQuestId = questRecord[21].GetInt32();
- ExclusiveGroup = questRecord[22].GetInt32();
- NextQuestInChain = questRecord[23].GetUInt32();
- SrcItemId = questRecord[24].GetUInt32();
- SrcItemCount = questRecord[25].GetUInt32();
- SrcSpell = questRecord[26].GetUInt32();
- Title = questRecord[27].GetCppString();
- Details = questRecord[28].GetCppString();
- Objectives = questRecord[29].GetCppString();
- OfferRewardText = questRecord[30].GetCppString();
- RequestItemsText = questRecord[31].GetCppString();
- EndText = questRecord[32].GetCppString();
+ PlayersSlain = questRecord[20].GetUInt32();
+ BonusTalents = questRecord[21].GetUInt32();
+ PrevQuestId = questRecord[22].GetInt32();
+ NextQuestId = questRecord[23].GetInt32();
+ ExclusiveGroup = questRecord[24].GetInt32();
+ NextQuestInChain = questRecord[25].GetUInt32();
+ SrcItemId = questRecord[26].GetUInt32();
+ SrcItemCount = questRecord[27].GetUInt32();
+ SrcSpell = questRecord[28].GetUInt32();
+ Title = questRecord[29].GetCppString();
+ Details = questRecord[30].GetCppString();
+ Objectives = questRecord[31].GetCppString();
+ OfferRewardText = questRecord[32].GetCppString();
+ RequestItemsText = questRecord[33].GetCppString();
+ EndText = questRecord[34].GetCppString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ObjectiveText[i] = questRecord[33+i].GetCppString();
+ ObjectiveText[i] = questRecord[35+i].GetCppString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqItemId[i] = questRecord[37+i].GetUInt32();
+ ReqItemId[i] = questRecord[39+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqItemCount[i] = questRecord[41+i].GetUInt32();
+ ReqItemCount[i] = questRecord[43+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- ReqSourceId[i] = questRecord[45+i].GetUInt32();
+ ReqSourceId[i] = questRecord[47+i].GetUInt32();
for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- ReqSourceCount[i] = questRecord[49+i].GetUInt32();
-
- for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- ReqSourceRef[i] = questRecord[53+i].GetUInt32();
+ ReqSourceCount[i] = questRecord[51+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqCreatureOrGOId[i] = questRecord[57+i].GetInt32();
+ ReqCreatureOrGOId[i] = questRecord[55+i].GetInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqCreatureOrGOCount[i] = questRecord[61+i].GetUInt32();
+ ReqCreatureOrGOCount[i] = questRecord[59+i].GetUInt32();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ReqSpell[i] = questRecord[65+i].GetUInt32();
+ ReqSpell[i] = questRecord[63+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- RewChoiceItemId[i] = questRecord[69+i].GetUInt32();
+ RewChoiceItemId[i] = questRecord[67+i].GetUInt32();
for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- RewChoiceItemCount[i] = questRecord[75+i].GetUInt32();
+ RewChoiceItemCount[i] = questRecord[73+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
- RewItemId[i] = questRecord[81+i].GetUInt32();
+ RewItemId[i] = questRecord[79+i].GetUInt32();
for (int i = 0; i < QUEST_REWARDS_COUNT; ++i)
- RewItemCount[i] = questRecord[85+i].GetUInt32();
+ RewItemCount[i] = questRecord[83+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
- RewRepFaction[i] = questRecord[89+i].GetUInt32();
+ RewRepFaction[i] = questRecord[87+i].GetUInt32();
for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i)
- RewRepValue[i] = questRecord[94+i].GetInt32();
-
- RewHonorableKills = questRecord[99].GetUInt32();
- RewOrReqMoney = questRecord[100].GetInt32();
- RewMoneyMaxLevel = questRecord[101].GetUInt32();
- RewSpell = questRecord[102].GetUInt32();
- RewSpellCast = questRecord[103].GetUInt32();
- RewMailTemplateId = questRecord[104].GetUInt32();
- RewMailDelaySecs = questRecord[105].GetUInt32();
- PointMapId = questRecord[106].GetUInt32();
- PointX = questRecord[107].GetFloat();
- PointY = questRecord[108].GetFloat();
- PointOpt = questRecord[109].GetUInt32();
+ RewRepValue[i] = questRecord[92+i].GetInt32();
+
+ RewHonorableKills = questRecord[97].GetUInt32();
+ RewOrReqMoney = questRecord[98].GetInt32();
+ RewMoneyMaxLevel = questRecord[99].GetUInt32();
+ RewSpell = questRecord[100].GetUInt32();
+ RewSpellCast = questRecord[101].GetUInt32();
+ RewMailTemplateId = questRecord[102].GetUInt32();
+ RewMailDelaySecs = questRecord[103].GetUInt32();
+ PointMapId = questRecord[104].GetUInt32();
+ PointX = questRecord[105].GetFloat();
+ PointY = questRecord[106].GetFloat();
+ PointOpt = questRecord[107].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- DetailsEmote[i] = questRecord[110+i].GetUInt32();
+ DetailsEmote[i] = questRecord[108+i].GetUInt32();
- IncompleteEmote = questRecord[114].GetUInt32();
- CompleteEmote = questRecord[115].GetUInt32();
+ IncompleteEmote = questRecord[112].GetUInt32();
+ CompleteEmote = questRecord[113].GetUInt32();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- OfferRewardEmote[i] = questRecord[116+i].GetInt32();
+ OfferRewardEmote[i] = questRecord[114+i].GetInt32();
- QuestStartScript = questRecord[120].GetUInt32();
- QuestCompleteScript = questRecord[121].GetUInt32();
+ QuestStartScript = questRecord[118].GetUInt32();
+ QuestCompleteScript = questRecord[119].GetUInt32();
QuestFlags |= SpecialFlags << 16;
@@ -164,18 +163,20 @@ uint32 Quest::XPValue( Player *pPlayer ) const
uint32 pLevel = pPlayer->getLevel();
uint32 qLevel = QuestLevel;
float fullxp = 0;
- if (qLevel >= 65)
+ if (qLevel >= 15)
fullxp = RewMoneyMaxLevel / 6.0f;
- else if (qLevel == 64)
+ else if (qLevel == 14)
fullxp = RewMoneyMaxLevel / 4.8f;
- else if (qLevel == 63)
- fullxp = RewMoneyMaxLevel / 3.6f;
- else if (qLevel == 62)
+ else if (qLevel == 13)
+ fullxp = RewMoneyMaxLevel / 3.666f;
+ else if (qLevel == 12)
fullxp = RewMoneyMaxLevel / 2.4f;
- else if (qLevel == 61)
+ else if (qLevel == 11)
fullxp = RewMoneyMaxLevel / 1.2f;
- else if (qLevel > 0 && qLevel <= 60)
+ else if (qLevel >= 1 && qLevel <= 10)
fullxp = RewMoneyMaxLevel / 0.6f;
+ else if (qLevel == 0)
+ fullxp = RewMoneyMaxLevel;
if( pLevel <= qLevel + 5 )
return (uint32)fullxp;
diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h
index 7b447c611c2..242c10bf48f 100644
--- a/src/game/QuestDef.h
+++ b/src/game/QuestDef.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,30 +44,33 @@ class ObjectMgr;
enum QuestFailedReasons
{
INVALIDREASON_DONT_HAVE_REQ = 0,
- INVALIDREASON_QUEST_FAILED_LOW_LEVEL = 1, //You are not high enough level for that quest.
- INVALIDREASON_QUEST_FAILED_WRONG_RACE = 6, //That quest is not available to your race.
- INVALIDREASON_QUEST_ALREADY_DONE = 7, //You have completed that quest.
- INVALIDREASON_QUEST_ONLY_ONE_TIMED = 12, //You can only be on one timed quest at a time.
- INVALIDREASON_QUEST_ALREADY_ON = 13, //You are already on that quest
- INVALIDREASON_QUEST_FAILED_EXPANSION = 16, //This quest requires an expansion enabled account.
- INVALIDREASON_QUEST_ALREADY_ON2 = 18, //You are already on that quest
- INVALIDREASON_QUEST_FAILED_MISSING_ITEMS = 21, //You don't have the required items with you. Check storage.
- INVALIDREASON_QUEST_FAILED_NOT_ENOUGH_MONEY = 23, //You don't have enough money for that quest.
- INVALIDREASON_DAILY_QUESTS_REMAINING = 26, //You have already completed 10 daily quests today
- INVALIDREASON_QUEST_FAILED_CAIS = 27, //You cannot complete quests once you have reached tired time
+ INVALIDREASON_QUEST_FAILED_LOW_LEVEL = 1, // You are not high enough level for that quest.
+ INVALIDREASON_QUEST_FAILED_WRONG_RACE = 6, // That quest is not available to your race.
+ INVALIDREASON_QUEST_ALREADY_DONE = 7, // You have completed that quest.
+ INVALIDREASON_QUEST_ONLY_ONE_TIMED = 12, // You can only be on one timed quest at a time.
+ INVALIDREASON_QUEST_ALREADY_ON = 13, // You are already on that quest.
+ INVALIDREASON_QUEST_FAILED_EXPANSION = 16, // This quest requires an expansion enabled account.
+ INVALIDREASON_QUEST_ALREADY_ON2 = 18, // You are already on that quest.
+ INVALIDREASON_QUEST_FAILED_MISSING_ITEMS = 21, // You don't have the required items with you. Check storage.
+ INVALIDREASON_QUEST_FAILED_NOT_ENOUGH_MONEY = 23, // You don't have enough money for that quest.
+ INVALIDREASON_DAILY_QUESTS_REMAINING = 26, // You have already completed 25 daily quests today.
+ INVALIDREASON_QUEST_FAILED_CAIS = 27, // You cannot complete quests once you have reached tired time.
+ INVALIDREASON_DAILY_QUEST_COMPLETED_TODAY = 29 // You have completed that daily quest today.
};
enum QuestShareMessages
{
- QUEST_PARTY_MSG_SHARING_QUEST = 0,
- QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1,
- QUEST_PARTY_MSG_ACCEPT_QUEST = 2,
- QUEST_PARTY_MSG_REFUSE_QUEST = 3,
- QUEST_PARTY_MSG_TOO_FAR = 4,
- QUEST_PARTY_MSG_BUSY = 5,
- QUEST_PARTY_MSG_LOG_FULL = 6,
- QUEST_PARTY_MSG_HAVE_QUEST = 7,
- QUEST_PARTY_MSG_FINISH_QUEST = 8,
+ QUEST_PARTY_MSG_SHARING_QUEST = 0,
+ QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1,
+ QUEST_PARTY_MSG_ACCEPT_QUEST = 2,
+ QUEST_PARTY_MSG_DECLINE_QUEST = 3,
+ QUEST_PARTY_MSG_BUSY = 4,
+ QUEST_PARTY_MSG_LOG_FULL = 5,
+ QUEST_PARTY_MSG_HAVE_QUEST = 6,
+ QUEST_PARTY_MSG_FINISH_QUEST = 7,
+ QUEST_PARTY_MSG_CANT_BE_SHARED_TODAY = 8,
+ QUEST_PARTY_MSG_SHARING_TIMER_EXPIRED = 9,
+ QUEST_PARTY_MSG_NOT_IN_PARTY = 10
};
enum __QuestTradeSkill
@@ -122,7 +125,7 @@ enum __QuestFlags
//QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently
QUEST_FLAGS_EPIC = 0x00000020, // Not used currently: Unsure of content
QUEST_FLAGS_RAID = 0x00000040, // Not used currently
- QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expension enabled only
+ QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only
QUEST_FLAGS_UNK2 = 0x00000100, // Not used currently: _DELIVER_MORE Quest needs more than normal _q-item_ drops from mobs
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))
QUEST_FLAGS_AUTO_REWARDED = 0x00000400, // These quests are automatically rewarded on quest complete and they will never appear in quest log client side.
@@ -190,6 +193,8 @@ class Quest
int32 GetExclusiveGroup() const { return ExclusiveGroup; }
uint32 GetNextQuestInChain() const { return NextQuestInChain; }
uint32 GetCharTitleId() const { return CharTitleId; }
+ uint32 GetPlayersSlain() const { return PlayersSlain; }
+ uint32 GetBonusTalents() const { return BonusTalents; }
uint32 GetSrcItemId() const { return SrcItemId; }
uint32 GetSrcItemCount() const { return SrcItemCount; }
uint32 GetSrcSpell() const { return SrcSpell; }
@@ -226,7 +231,6 @@ class Quest
uint32 ReqItemCount[QUEST_OBJECTIVES_COUNT];
uint32 ReqSourceId[QUEST_SOURCE_ITEM_IDS_COUNT];
uint32 ReqSourceCount[QUEST_SOURCE_ITEM_IDS_COUNT];
- uint32 ReqSourceRef[QUEST_SOURCE_ITEM_IDS_COUNT];
int32 ReqCreatureOrGOId[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
uint32 ReqCreatureOrGOCount[QUEST_OBJECTIVES_COUNT];
uint32 ReqSpell[QUEST_OBJECTIVES_COUNT];
@@ -277,6 +281,8 @@ class Quest
uint32 LimitTime;
uint32 QuestFlags;
uint32 CharTitleId;
+ uint32 PlayersSlain;
+ uint32 BonusTalents;
int32 PrevQuestId;
int32 NextQuestId;
int32 ExclusiveGroup;
diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp
index c447b170d4c..c7f83c9b7ae 100644
--- a/src/game/QuestHandler.cpp
+++ b/src/game/QuestHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -101,7 +101,7 @@ void WorldSession::HandleQuestgiverHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
pCreature->StopMoving();
@@ -180,7 +180,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
bool destroyItem = true;
for(int i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
{
- if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount != 0))
+ if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0))
{
destroyItem = false;
break;
@@ -451,12 +451,6 @@ void WorldSession::HandleQuestPushToParty(WorldPacket& recvPacket)
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST);
- if( _player->GetDistance( pPlayer ) > 10 )
- {
- _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_TOO_FAR );
- continue;
- }
-
if( !pPlayer->SatisfyQuestStatus( pQuest, false ) )
{
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_HAVE_QUEST );
@@ -586,7 +580,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32
{
if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded))
result2 = DIALOG_STATUS_REWARD_REP;
- else if (pPlayer->getLevel() <= pQuest->GetQuestLevel() + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) )
+ else if (pPlayer->getLevel() <= pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) )
{
if (pQuest->HasFlag(QUEST_FLAGS_DAILY))
result2 = DIALOG_STATUS_AVAILABLE_REP;
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp
index cb748883772..0081c702abd 100644
--- a/src/game/RandomMovementGenerator.cpp
+++ b/src/game/RandomMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
#include "DestinationHolderImp.h"
#include "Map.h"
#include "Util.h"
+#include "CreatureGroups.h"
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
@@ -114,6 +115,12 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime()));
creature.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
}
+
+ //Call for creature group update
+ if(creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
+ {
+ creature.GetFormation()->LeaderMoveTo(nx, ny, nz);
+ }
}
template<>
diff --git a/src/game/RandomMovementGenerator.h b/src/game/RandomMovementGenerator.h
index a7105284ac6..20afe23d375 100644
--- a/src/game/RandomMovementGenerator.h
+++ b/src/game/RandomMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp
index d15c71b28ef..30847405c9e 100644
--- a/src/game/ReactorAI.cpp
+++ b/src/game/ReactorAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,18 +50,18 @@ ReactorAI::IsVisible(Unit *) const
void
ReactorAI::UpdateAI(const uint32 /*time_diff*/)
{
- // update i_victimGuid if i_creature.getVictim() !=0 and changed
+ // update i_victimGuid if m_creature->getVictim() !=0 and changed
if(!UpdateVictim())
return;
- i_victimGuid = i_creature.getVictim()->GetGUID();
+ i_victimGuid = m_creature->getVictim()->GetGUID();
- if( i_creature.isAttackReady() )
+ if( m_creature->isAttackReady() )
{
- if( i_creature.IsWithinMeleeRange(i_creature.getVictim()))
+ if( m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
- i_creature.AttackerStateUpdate(i_creature.getVictim());
- i_creature.resetAttackTimer();
+ m_creature->AttackerStateUpdate(m_creature->getVictim());
+ m_creature->resetAttackTimer();
}
}
}
@@ -69,49 +69,49 @@ ReactorAI::UpdateAI(const uint32 /*time_diff*/)
void
ReactorAI::EnterEvadeMode()
{
- if( !i_creature.isAlive() )
+ if( !m_creature->isAlive() )
{
- DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", i_creature.GetGUIDLow());
- i_creature.GetMotionMaster()->MovementExpired();
- i_creature.GetMotionMaster()->MoveIdle();
+ DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", m_creature->GetGUIDLow());
+ m_creature->GetMotionMaster()->MovementExpired();
+ m_creature->GetMotionMaster()->MoveIdle();
i_victimGuid = 0;
- i_creature.CombatStop();
- i_creature.DeleteThreatList();
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
return;
}
- Unit* victim = ObjectAccessor::GetUnit(i_creature, i_victimGuid );
+ Unit* victim = ObjectAccessor::GetUnit(*m_creature, i_victimGuid );
if( !victim )
{
- DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking because victim is non exist [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim->HasStealthAura() )
{
- DEBUG_LOG("Creature stopped attacking cuz his victim is stealth [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his victim is stealth [guid=%u]", m_creature->GetGUIDLow());
}
else if( victim->isInFlight() )
{
- DEBUG_LOG("Creature stopped attacking cuz his victim is fly away [guid=%u]", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking cuz his victim is fly away [guid=%u]", m_creature->GetGUIDLow());
}
else
{
- DEBUG_LOG("Creature stopped attacking due to target %s [guid=%u]", victim->isAlive() ? "out run him" : "is dead", i_creature.GetGUIDLow());
+ DEBUG_LOG("Creature stopped attacking due to target %s [guid=%u]", victim->isAlive() ? "out run him" : "is dead", m_creature->GetGUIDLow());
}
- i_creature.RemoveAllAuras();
- i_creature.DeleteThreatList();
+ m_creature->RemoveAllAuras();
+ m_creature->DeleteThreatList();
i_victimGuid = 0;
- i_creature.CombatStop();
- i_creature.SetLootRecipient(NULL);
+ m_creature->CombatStop();
+ m_creature->SetLootRecipient(NULL);
- if(!i_creature.GetCharmerOrOwner())
+ if(!m_creature->GetCharmerOrOwner())
{
// Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead
- if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
- i_creature.GetMotionMaster()->MoveTargetedHome();
+ if( m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE )
+ m_creature->GetMotionMaster()->MoveTargetedHome();
}
- else if (i_creature.GetOwner() && i_creature.GetOwner()->isAlive())
- i_creature.GetMotionMaster()->MoveFollow(i_creature.GetOwner(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+ else if (m_creature->GetOwner() && m_creature->GetOwner()->isAlive())
+ m_creature->GetMotionMaster()->MoveFollow(m_creature->GetOwner(),PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
diff --git a/src/game/ReactorAI.h b/src/game/ReactorAI.h
index a1c99707736..baed6a8e6e1 100644
--- a/src/game/ReactorAI.h
+++ b/src/game/ReactorAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ class TRINITY_DLL_DECL ReactorAI : public CreatureAI
{
public:
- ReactorAI(Creature *c) : CreatureAI(c), i_creature(*c), i_victimGuid(0) {}
+ explicit ReactorAI(Creature *c) : CreatureAI(c), i_victimGuid(0) {}
void MoveInLineOfSight(Unit *);
void EnterEvadeMode();
@@ -39,7 +39,6 @@ class TRINITY_DLL_DECL ReactorAI : public CreatureAI
static int Permissible(const Creature *);
private:
- Creature &i_creature;
uint64 i_victimGuid;
};
#endif
diff --git a/src/game/ReputationMgr.cpp b/src/game/ReputationMgr.cpp
new file mode 100644
index 00000000000..62b9504daff
--- /dev/null
+++ b/src/game/ReputationMgr.cpp
@@ -0,0 +1,473 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ReputationMgr.h"
+#include "DBCStores.h"
+#include "Player.h"
+#include "WorldPacket.h"
+
+const int32 ReputationMgr::PointsInRank[MAX_REPUTATION_RANK] = {36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000};
+
+ReputationRank ReputationMgr::ReputationToRank(int32 standing)
+{
+ int32 limit = Reputation_Cap + 1;
+ for (int i = MAX_REPUTATION_RANK-1; i >= MIN_REPUTATION_RANK; --i)
+ {
+ limit -= PointsInRank[i];
+ if (standing >= limit )
+ return ReputationRank(i);
+ }
+ return MIN_REPUTATION_RANK;
+}
+
+int32 ReputationMgr::GetReputation(uint32 faction_id) const
+{
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry(faction_id);
+
+ if (!factionEntry)
+ {
+ sLog.outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.",m_player->GetName(), faction_id);
+ return 0;
+ }
+
+ return GetReputation(factionEntry);
+}
+
+int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
+{
+ if (!factionEntry)
+ return 0;
+
+ uint32 raceMask = m_player->getRaceMask();
+ uint32 classMask = m_player->getClassMask();
+ for (int i=0; i < 4; i++)
+ {
+ if( (factionEntry->BaseRepRaceMask[i] & raceMask) &&
+ (factionEntry->BaseRepClassMask[i]==0 ||
+ (factionEntry->BaseRepClassMask[i] & classMask) ) )
+ return factionEntry->BaseRepValue[i];
+ }
+
+ // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i]==0
+ return 0;
+}
+
+int32 ReputationMgr::GetReputation(FactionEntry const* factionEntry) const
+{
+ // Faction without recorded reputation. Just ignore.
+ if(!factionEntry)
+ return 0;
+
+ if(FactionState const* state = GetState(factionEntry))
+ return GetBaseReputation(factionEntry) + state->Standing;
+
+ return 0;
+}
+
+ReputationRank ReputationMgr::GetRank(FactionEntry const* factionEntry) const
+{
+ int32 reputation = GetReputation(factionEntry);
+ return ReputationToRank(reputation);
+}
+
+ReputationRank ReputationMgr::GetBaseRank(FactionEntry const* factionEntry) const
+{
+ int32 reputation = GetBaseReputation(factionEntry);
+ return ReputationToRank(reputation);
+}
+
+void ReputationMgr::ApplyForceReaction( uint32 faction_id,ReputationRank rank,bool apply )
+{
+ if(apply)
+ m_forcedReactions[faction_id] = rank;
+ else
+ m_forcedReactions.erase(faction_id);
+}
+
+uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) const
+{
+ if (!factionEntry)
+ return 0;
+
+ uint32 raceMask = m_player->getRaceMask();
+ uint32 classMask = m_player->getClassMask();
+ for (int i=0; i < 4; i++)
+ {
+ if( (factionEntry->BaseRepRaceMask[i] & raceMask) &&
+ (factionEntry->BaseRepClassMask[i]==0 ||
+ (factionEntry->BaseRepClassMask[i] & classMask) ) )
+ return factionEntry->ReputationFlags[i];
+ }
+ return 0;
+}
+
+void ReputationMgr::SendForceReactions()
+{
+ WorldPacket data;
+ data.Initialize(SMSG_SET_FORCED_REACTIONS, 4+m_forcedReactions.size()*(4+4));
+ data << uint32(m_forcedReactions.size());
+ for(ForcedReactions::const_iterator itr = m_forcedReactions.begin(); itr != m_forcedReactions.end(); ++itr)
+ {
+ data << uint32(itr->first); // faction_id (Faction.dbc)
+ data << uint32(itr->second); // reputation rank
+ }
+ m_player->SendDirectMessage(&data);
+}
+
+void ReputationMgr::SendState(FactionState const* faction) const
+{
+ if(faction->Flags & FACTION_FLAG_VISIBLE) //If faction is visible then update it
+ {
+ WorldPacket data(SMSG_SET_FACTION_STANDING, (16)); // last check 2.4.0
+ data << (float) 0; // unk 2.4.0
+ data << (uint8) 0; // wotlk 8634
+ data << (uint32) 1; // count
+ // for
+ data << (uint32) faction->ReputationListID;
+ data << (uint32) faction->Standing;
+ // end for
+ m_player->SendDirectMessage(&data);
+ }
+}
+
+void ReputationMgr::SendInitialReputations()
+{
+ WorldPacket data(SMSG_INITIALIZE_FACTIONS, (4+128*5));
+ data << uint32 (0x00000080);
+
+ RepListID a = 0;
+
+ for (FactionStateList::const_iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
+ {
+ // fill in absent fields
+ for (; a != itr->first; a++)
+ {
+ data << uint8 (0x00);
+ data << uint32 (0x00000000);
+ }
+
+ // fill in encountered data
+ data << uint8 (itr->second.Flags);
+ data << uint32 (itr->second.Standing);
+
+ ++a;
+ }
+
+ // fill in absent fields
+ for (; a != 128; a++)
+ {
+ data << uint8 (0x00);
+ data << uint32 (0x00000000);
+ }
+
+ m_player->SendDirectMessage(&data);
+}
+
+void ReputationMgr::SendStates() const
+{
+ for(FactionStateList::const_iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
+ SendState(&(itr->second));
+}
+
+void ReputationMgr::SendVisible(FactionState const* faction) const
+{
+ if(m_player->GetSession()->PlayerLoading())
+ return;
+
+ // make faction visible in reputation list at client
+ WorldPacket data(SMSG_SET_FACTION_VISIBLE, 4);
+ data << faction->ReputationListID;
+ m_player->SendDirectMessage(&data);
+}
+
+void ReputationMgr::Initilize()
+{
+ m_factions.clear();
+ m_visibleFactionCount = 0;
+ m_honoredFactionCount = 0;
+ m_reveredFactionCount = 0;
+ m_exaltedFactionCount = 0;
+
+ for(unsigned int i = 1; i < sFactionStore.GetNumRows(); i++)
+ {
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry(i);
+
+ if( factionEntry && (factionEntry->reputationListID >= 0))
+ {
+ FactionState newFaction;
+ newFaction.ID = factionEntry->ID;
+ newFaction.ReputationListID = factionEntry->reputationListID;
+ newFaction.Standing = 0;
+ newFaction.Flags = GetDefaultStateFlags(factionEntry);
+ newFaction.Changed = true;
+
+ if( newFaction.Flags & FACTION_FLAG_VISIBLE )
+ ++m_visibleFactionCount;
+
+ UpdateRankCounters(REP_HOSTILE,GetBaseRank(factionEntry));
+
+ m_factions[newFaction.ReputationListID] = newFaction;
+ }
+ }
+}
+
+bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental)
+{
+ SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID);
+ if (flist)
+ {
+ bool res = false;
+ for (SimpleFactionsList::const_iterator itr = flist->begin();itr != flist->end();++itr)
+ {
+ FactionEntry const *factionEntryCalc = sFactionStore.LookupEntry(*itr);
+ if(factionEntryCalc)
+ res = SetOneFactionReputation(factionEntryCalc, standing, incremental);
+ }
+ return res;
+ }
+ else
+ return SetOneFactionReputation(factionEntry, standing, incremental);
+}
+
+bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental)
+{
+ FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
+ if (itr != m_factions.end())
+ {
+ int32 BaseRep = GetBaseReputation(factionEntry);
+
+ if(incremental)
+ standing += itr->second.Standing + BaseRep;
+
+ if (standing > Reputation_Cap)
+ standing = Reputation_Cap;
+ else if (standing < Reputation_Bottom)
+ standing = Reputation_Bottom;
+
+ ReputationRank old_rank = ReputationToRank(itr->second.Standing + BaseRep);
+ ReputationRank new_rank = ReputationToRank(standing);
+
+ itr->second.Standing = standing - BaseRep;
+ itr->second.Changed = true;
+
+ SetVisible(&itr->second);
+
+ if(new_rank <= REP_HOSTILE)
+ SetAtWar(&itr->second,true);
+
+ SendState(&itr->second);
+
+ UpdateRankCounters(old_rank, new_rank);
+
+ m_player->ReputationChanged(factionEntry);
+ m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID);
+ m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID);
+ m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION,factionEntry->ID);
+ m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION,factionEntry->ID);
+ m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION,factionEntry->ID);
+
+ return true;
+ }
+ return false;
+}
+
+void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry)
+{
+ if(!factionTemplateEntry->faction)
+ return;
+
+ if(FactionEntry const *factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
+ SetVisible(factionEntry);
+}
+
+void ReputationMgr::SetVisible(FactionEntry const *factionEntry)
+{
+ if(factionEntry->reputationListID < 0)
+ return;
+
+ FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
+ if (itr == m_factions.end())
+ return;
+
+ SetVisible(&itr->second);
+}
+
+void ReputationMgr::SetVisible(FactionState* faction)
+{
+ // always invisible or hidden faction can't be make visible
+ if(faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN))
+ return;
+
+ // already set
+ if(faction->Flags & FACTION_FLAG_VISIBLE)
+ return;
+
+ faction->Flags |= FACTION_FLAG_VISIBLE;
+ faction->Changed = true;
+
+ ++m_visibleFactionCount;
+
+ SendVisible(faction);
+}
+
+void ReputationMgr::SetAtWar( RepListID repListID, bool on )
+{
+ FactionStateList::iterator itr = m_factions.find(repListID);
+ if (itr == m_factions.end())
+ return;
+
+ // always invisible or hidden faction can't change war state
+ if(itr->second.Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN) )
+ return;
+
+ SetAtWar(&itr->second,on);
+}
+
+void ReputationMgr::SetAtWar(FactionState* faction, bool atWar)
+{
+ // not allow declare war to own faction
+ if(atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED) )
+ return;
+
+ // already set
+ if(((faction->Flags & FACTION_FLAG_AT_WAR) != 0) == atWar)
+ return;
+
+ if( atWar )
+ faction->Flags |= FACTION_FLAG_AT_WAR;
+ else
+ faction->Flags &= ~FACTION_FLAG_AT_WAR;
+
+ faction->Changed = true;
+}
+
+void ReputationMgr::SetInactive( RepListID repListID, bool on )
+{
+ FactionStateList::iterator itr = m_factions.find(repListID);
+ if (itr == m_factions.end())
+ return;
+
+ SetInactive(&itr->second,on);
+}
+
+void ReputationMgr::SetInactive(FactionState* faction, bool inactive)
+{
+ // always invisible or hidden faction can't be inactive
+ if(inactive && ((faction->Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) || !(faction->Flags & FACTION_FLAG_VISIBLE) ) )
+ return;
+
+ // already set
+ if(((faction->Flags & FACTION_FLAG_INACTIVE) != 0) == inactive)
+ return;
+
+ if(inactive)
+ faction->Flags |= FACTION_FLAG_INACTIVE;
+ else
+ faction->Flags &= ~FACTION_FLAG_INACTIVE;
+
+ faction->Changed = true;
+}
+
+void ReputationMgr::LoadFromDB(QueryResult *result)
+{
+ // Set initial reputations (so everything is nifty before DB data load)
+ Initilize();
+
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow());
+
+ if(result)
+ {
+ do
+ {
+ Field *fields = result->Fetch();
+
+ FactionEntry const *factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt32());
+ if( factionEntry && (factionEntry->reputationListID >= 0))
+ {
+ FactionState* faction = &m_factions[factionEntry->reputationListID];
+
+ // update standing to current
+ faction->Standing = int32(fields[1].GetUInt32());
+
+ // update counters
+ int32 BaseRep = GetBaseReputation(factionEntry);
+ ReputationRank old_rank = ReputationToRank(BaseRep);
+ ReputationRank new_rank = ReputationToRank(BaseRep + faction->Standing);
+ UpdateRankCounters(old_rank,new_rank);
+
+ uint32 dbFactionFlags = fields[2].GetUInt32();
+
+ if( dbFactionFlags & FACTION_FLAG_VISIBLE )
+ SetVisible(faction); // have internal checks for forced invisibility
+
+ if( dbFactionFlags & FACTION_FLAG_INACTIVE)
+ SetInactive(faction,true); // have internal checks for visibility requirement
+
+ if( dbFactionFlags & FACTION_FLAG_AT_WAR ) // DB at war
+ SetAtWar(faction,true); // have internal checks for FACTION_FLAG_PEACE_FORCED
+ else // DB not at war
+ {
+ // allow remove if visible (and then not FACTION_FLAG_INVISIBLE_FORCED or FACTION_FLAG_HIDDEN)
+ if( faction->Flags & FACTION_FLAG_VISIBLE )
+ SetAtWar(faction,false); // have internal checks for FACTION_FLAG_PEACE_FORCED
+ }
+
+ // set atWar for hostile
+ if(GetRank(factionEntry) <= REP_HOSTILE)
+ SetAtWar(faction,true);
+
+ // reset changed flag if values similar to saved in DB
+ if(faction->Flags==dbFactionFlags)
+ faction->Changed = false;
+ }
+ }
+ while( result->NextRow() );
+
+ delete result;
+ }
+}
+
+void ReputationMgr::SaveToDB()
+{
+ for(FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
+ {
+ if (itr->second.Changed)
+ {
+ CharacterDatabase.PExecute("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", m_player->GetGUIDLow(), itr->second.ID);
+ CharacterDatabase.PExecute("INSERT INTO character_reputation (guid,faction,standing,flags) VALUES ('%u', '%u', '%i', '%u')", m_player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags);
+ itr->second.Changed = false;
+ }
+ }
+}
+
+void ReputationMgr::UpdateRankCounters( ReputationRank old_rank, ReputationRank new_rank )
+{
+ if(old_rank >= REP_EXALTED)
+ --m_exaltedFactionCount;
+ if(old_rank >= REP_REVERED)
+ --m_reveredFactionCount;
+ if(old_rank >= REP_HONORED)
+ --m_honoredFactionCount;
+
+ if(new_rank >= REP_EXALTED)
+ ++m_exaltedFactionCount;
+ if(new_rank >= REP_REVERED)
+ ++m_reveredFactionCount;
+ if(new_rank >= REP_HONORED)
+ ++m_honoredFactionCount;
+} \ No newline at end of file
diff --git a/src/game/ReputationMgr.h b/src/game/ReputationMgr.h
new file mode 100644
index 00000000000..b81634119df
--- /dev/null
+++ b/src/game/ReputationMgr.h
@@ -0,0 +1,146 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __MANGOS_REPUTATION_MGR_H
+#define __MANGOS_REPUTATION_MGR_H
+
+#include "Common.h"
+#include "SharedDefines.h"
+#include "DBCStructure.h"
+#include <map>
+
+enum FactionFlags
+{
+ FACTION_FLAG_VISIBLE = 0x01, // makes visible in client (set or can be set at interaction with target of this faction)
+ FACTION_FLAG_AT_WAR = 0x02, // enable AtWar-button in client. player controlled (except opposition team always war state), Flag only set on initial creation
+ FACTION_FLAG_HIDDEN = 0x04, // hidden faction from reputation pane in client (player can gain reputation, but this update not sent to client)
+ FACTION_FLAG_INVISIBLE_FORCED = 0x08, // always overwrite FACTION_FLAG_VISIBLE and hide faction in rep.list, used for hide opposite team factions
+ FACTION_FLAG_PEACE_FORCED = 0x10, // always overwrite FACTION_FLAG_AT_WAR, used for prevent war with own team factions
+ FACTION_FLAG_INACTIVE = 0x20, // player controlled, state stored in characters.data ( CMSG_SET_FACTION_INACTIVE )
+ FACTION_FLAG_RIVAL = 0x40 // flag for the two competing outland factions
+};
+
+typedef uint32 RepListID;
+struct FactionState
+{
+ uint32 ID;
+ RepListID ReputationListID;
+ uint32 Flags;
+ int32 Standing;
+ bool Changed;
+};
+
+typedef std::map<RepListID,FactionState> FactionStateList;
+typedef std::pair<FactionStateList::const_iterator,FactionStateList::const_iterator> FactionStateListPair;
+
+typedef std::map<uint32,ReputationRank> ForcedReactions;
+
+class Player;
+class QueryResult;
+
+class ReputationMgr
+{
+ public: // constructors and global modifiers
+ explicit ReputationMgr(Player* owner) : m_player(owner),
+ m_visibleFactionCount(0), m_honoredFactionCount(0), m_reveredFactionCount(0), m_exaltedFactionCount(0) {}
+ ~ReputationMgr() {}
+
+ void SaveToDB();
+ void LoadFromDB(QueryResult *result);
+ public: // statics
+ static const int32 PointsInRank[MAX_REPUTATION_RANK];
+ static const int32 Reputation_Cap = 42999;
+ static const int32 Reputation_Bottom = -42000;
+
+ static ReputationRank ReputationToRank(int32 standing);
+ public: // accessors
+ uint8 GetVisibleFactionCount() const { return m_visibleFactionCount; }
+ uint8 GetHonoredFactionCount() const { return m_honoredFactionCount; }
+ uint8 GetReveredFactionCount() const { return m_reveredFactionCount; }
+ uint8 GetExaltedFactionCount() const { return m_exaltedFactionCount; }
+
+ FactionStateList const& GetStateList() const { return m_factions; }
+
+ FactionState const* GetState(FactionEntry const* factionEntry) const
+ {
+ return factionEntry->reputationListID >= 0 ? GetState(factionEntry->reputationListID) : NULL;
+ }
+
+ FactionState const* GetState(RepListID id) const
+ {
+ FactionStateList::const_iterator repItr = m_factions.find (id);
+ return repItr != m_factions.end() ? &repItr->second : NULL;
+ }
+
+ int32 GetReputation(uint32 faction_id) const;
+ int32 GetReputation(FactionEntry const* factionEntry) const;
+ int32 GetBaseReputation(FactionEntry const* factionEntry) const;
+
+ ReputationRank GetRank(FactionEntry const* factionEntry) const;
+ ReputationRank GetBaseRank(FactionEntry const* factionEntry) const;
+
+ ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const
+ {
+ ForcedReactions::const_iterator forceItr = m_forcedReactions.find(factionTemplateEntry->faction);
+ return forceItr != m_forcedReactions.end() ? &forceItr->second : NULL;
+ }
+
+ public: // modifiers
+ bool SetReputation(FactionEntry const* factionEntry, int32 standing)
+ {
+ return SetReputation(factionEntry, standing, false);
+ }
+ bool ModifyReputation(FactionEntry const* factionEntry, int32 standing)
+ {
+ return SetReputation(factionEntry, standing, true);
+ }
+
+ void SetVisible(FactionTemplateEntry const* factionTemplateEntry);
+ void SetVisible(FactionEntry const* factionEntry);
+ void SetAtWar(RepListID repListID, bool on);
+ void SetInactive(RepListID repListID, bool on);
+
+ void ApplyForceReaction(uint32 faction_id,ReputationRank rank,bool apply);
+
+ public: // senders
+ void SendInitialReputations();
+ void SendForceReactions();
+ void SendState(FactionState const* faction) const;
+ void SendStates() const;
+
+ private: // internal helper functions
+ void Initilize();
+ uint32 GetDefaultStateFlags(const FactionEntry *factionEntry) const;
+ bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental);
+ bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental);
+ void SetVisible(FactionState* faction);
+ void SetAtWar(FactionState* faction, bool atWar);
+ void SetInactive(FactionState* faction, bool inactive);
+ void SendVisible(FactionState const* faction) const;
+ void UpdateRankCounters( ReputationRank old_rank, ReputationRank new_rank );
+ private:
+ Player* m_player;
+ FactionStateList m_factions;
+ ForcedReactions m_forcedReactions;
+ uint8 m_visibleFactionCount :8;
+ uint8 m_honoredFactionCount :8;
+ uint8 m_reveredFactionCount :8;
+ uint8 m_exaltedFactionCount :8;
+};
+
+#endif
diff --git a/src/game/ScriptCalls.cpp b/src/game/ScriptCalls.cpp
index bce96344931..a3015e88a2f 100644
--- a/src/game/ScriptCalls.cpp
+++ b/src/game/ScriptCalls.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,8 +76,10 @@ bool LoadScriptingModule(char const* libName)
||!(testScript->scriptAreaTrigger =(scriptCallAreaTrigger )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"AreaTrigger" ))
||!(testScript->ItemQuestAccept =(scriptCallItemQuestAccept )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ItemQuestAccept" ))
||!(testScript->GOQuestAccept =(scriptCallGOQuestAccept )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GOQuestAccept" ))
- ||!(testScript->ReceiveEmote =(scriptCallReceiveEmote )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ReceiveEmote" ))
||!(testScript->ItemUse =(scriptCallItemUse )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"ItemUse" ))
+ ||!(testScript->EffectDummyGameObj =(scriptCallEffectDummyGameObj )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyGameObj" ))
+ ||!(testScript->EffectDummyCreature =(scriptCallEffectDummyCreature )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyCreature" ))
+ ||!(testScript->EffectDummyItem =(scriptCallEffectDummyItem )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"EffectDummyItem" ))
||!(testScript->GetAI =(scriptCallGetAI )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"GetAI" ))
||!(testScript->CreateInstanceData =(scriptCallCreateInstanceData )TRINITY_GET_PROC_ADDR(testScript->hScriptsLib,"CreateInstanceData" ))
)
@@ -88,7 +90,8 @@ bool LoadScriptingModule(char const* libName)
return false;
}
- printf("Scripts Library %s was successfully loaded.\n",name.c_str());
+ sLog.outString();
+ sLog.outString( ">>> Scripts Library %s was successfully loaded.\n", name.c_str() );
//heh we are still there :P we have a valid library
//we reload script
diff --git a/src/game/ScriptCalls.h b/src/game/ScriptCalls.h
index 83a6572e0e1..2ace2839e28 100644
--- a/src/game/ScriptCalls.h
+++ b/src/game/ScriptCalls.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -58,8 +58,10 @@ typedef bool(TRINITY_IMPORT * scriptCallAreaTrigger)( Player *player, AreaTrigge
typedef bool(TRINITY_IMPORT * scriptCallItemQuestAccept)(Player *player, Item *, Quest const*);
typedef bool(TRINITY_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*);
typedef bool(TRINITY_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt );
-typedef bool(TRINITY_IMPORT * scriptCallReceiveEmote) ( Player *player, Creature *_Creature, uint32 emote );
typedef bool(TRINITY_IMPORT * scriptCallItemUse) (Player *player, Item *_Item, SpellCastTargets const& targets);
+typedef bool(TRINITY_IMPORT * scriptCallEffectDummyGameObj) (Unit *caster, uint32 spellId, uint32 effIndex, GameObject *gameObjTarget);
+typedef bool(TRINITY_IMPORT * scriptCallEffectDummyCreature) (Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget);
+typedef bool(TRINITY_IMPORT * scriptCallEffectDummyItem) (Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget);
typedef CreatureAI* (TRINITY_IMPORT * scriptCallGetAI) ( Creature *_Creature );
typedef InstanceData* (TRINITY_IMPORT * scriptCallCreateInstanceData) (Map *map);
@@ -86,8 +88,10 @@ typedef struct
scriptCallAreaTrigger scriptAreaTrigger;
scriptCallItemQuestAccept ItemQuestAccept;
scriptCallGOQuestAccept GOQuestAccept;
- scriptCallReceiveEmote ReceiveEmote;
scriptCallItemUse ItemUse;
+ scriptCallEffectDummyGameObj EffectDummyGameObj;
+ scriptCallEffectDummyCreature EffectDummyCreature;
+ scriptCallEffectDummyItem EffectDummyItem;
scriptCallGetAI GetAI;
scriptCallCreateInstanceData CreateInstanceData;
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 61cbcaa35ad..61c266854ff 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +24,9 @@
#include "Platform/Define.h"
#include <cassert>
+#define MaNGOS Trinity
+#define GetMangosString GetTrinityString
+
enum Gender
{
GENDER_MALE = 0,
@@ -88,7 +91,8 @@ enum Classes
#define CLASSMASK_ALL_PLAYABLE \
((1<<(CLASS_WARRIOR-1))|(1<<(CLASS_PALADIN-1))|(1<<(CLASS_HUNTER-1))| \
(1<<(CLASS_ROGUE-1)) |(1<<(CLASS_PRIEST-1)) |(1<<(CLASS_SHAMAN-1))| \
- (1<<(CLASS_MAGE-1)) |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1)) )
+ (1<<(CLASS_MAGE-1)) |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1)) | \
+ (1<<(CLASS_DEATH_KNIGHT-1)) )
#define CLASSMASK_WAND_USERS ((1<<(CLASS_PRIEST-1))|(1<<(CLASS_MAGE-1))|(1<<(CLASS_WARLOCK-1)))
@@ -134,12 +138,13 @@ enum Powers
POWER_FOCUS = 2,
POWER_ENERGY = 3,
POWER_HAPPINESS = 4,
- POWER_RUNES = 5,
+ POWER_RUNE = 5,
+ POWER_RUNIC_POWER = 6,
+ MAX_POWERS = 7,
+ POWER_ALL = 127, // default for class?
POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value)
};
-#define MAX_POWERS 5 // not count POWER_RUNES for now
-
enum SpellSchools
{
SPELL_SCHOOL_NORMAL = 0,
@@ -199,10 +204,11 @@ enum ItemQualities
ITEM_QUALITY_RARE = 3, //BLUE
ITEM_QUALITY_EPIC = 4, //PURPLE
ITEM_QUALITY_LEGENDARY = 5, //ORANGE
- ITEM_QUALITY_ARTIFACT = 6 //LIGHT YELLOW
+ ITEM_QUALITY_ARTIFACT = 6, //LIGHT YELLOW
+ ITEM_QUALITY_HEIRLOOM = 7
};
-#define MAX_ITEM_QUALITY 7
+#define MAX_ITEM_QUALITY 8
enum SpellCategory
{
@@ -217,7 +223,7 @@ enum SpellCategory
#define SPELL_ATTR_UNK0 0x00000001 // 0
#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilities have this flag
#define SPELL_ATTR_ON_NEXT_SWING_1 0x00000004 // 2 on next swing
-#define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 2.4.2
+#define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 3.0.3
#define SPELL_ATTR_UNK4 0x00000010 // 4
#define SPELL_ATTR_UNK5 0x00000020 // 5 trade spells?
#define SPELL_ATTR_PASSIVE 0x00000040 // 6 Passive spell
@@ -257,7 +263,7 @@ enum SpellCategory
#define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7
#define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state
#define SPELL_ATTR_EX_UNK9 0x00000200 // 9
-#define SPELL_ATTR_EX_UNK10 0x00000400 // 10
+#define SPELL_ATTR_EX_NO_INITIAL_AGGRO 0x00000400 // 10 no generates threat on cast 100%
#define SPELL_ATTR_EX_UNK11 0x00000800 // 11
#define SPELL_ATTR_EX_UNK12 0x00001000 // 12
#define SPELL_ATTR_EX_UNK13 0x00002000 // 13
@@ -272,7 +278,7 @@ enum SpellCategory
#define SPELL_ATTR_EX_REQ_COMBO_POINTS2 0x00400000 // 22 Req combo points on target
#define SPELL_ATTR_EX_UNK23 0x00800000 // 23
#define SPELL_ATTR_EX_UNK24 0x01000000 // 24 Req fishing pole??
-#define SPELL_ATTR_EX_UNK25 0x02000000 // 25 not set in 2.4.2
+#define SPELL_ATTR_EX_UNK25 0x02000000 // 25
#define SPELL_ATTR_EX_UNK26 0x04000000 // 26
#define SPELL_ATTR_EX_UNK27 0x08000000 // 27
#define SPELL_ATTR_EX_UNK28 0x10000000 // 28
@@ -282,33 +288,33 @@ enum SpellCategory
#define SPELL_ATTR_EX2_UNK0 0x00000001 // 0
#define SPELL_ATTR_EX2_UNK1 0x00000002 // 1
-#define SPELL_ATTR_EX2_UNK2 0x00000004 // 2 boss spells?
+#define SPELL_ATTR_EX2_CANT_REFLECTED 0x00000004 // 2 ? used for detect can or not spell reflected
#define SPELL_ATTR_EX2_UNK3 0x00000008 // 3
#define SPELL_ATTR_EX2_UNK4 0x00000010 // 4
-#define SPELL_ATTR_EX2_UNK5 0x00000020 // 5
+#define SPELL_ATTR_EX2_AUTOREPEAT_FLAG 0x00000020 // 5
#define SPELL_ATTR_EX2_UNK6 0x00000040 // 6
#define SPELL_ATTR_EX2_UNK7 0x00000080 // 7
-#define SPELL_ATTR_EX2_UNK8 0x00000100 // 8 not set in 2.4.2
+#define SPELL_ATTR_EX2_UNK8 0x00000100 // 8 not set in 3.0.3
#define SPELL_ATTR_EX2_UNK9 0x00000200 // 9
#define SPELL_ATTR_EX2_UNK10 0x00000400 // 10
#define SPELL_ATTR_EX2_HEALTH_FUNNEL 0x00000800 // 11
#define SPELL_ATTR_EX2_UNK12 0x00001000 // 12
#define SPELL_ATTR_EX2_UNK13 0x00002000 // 13
#define SPELL_ATTR_EX2_UNK14 0x00004000 // 14
-#define SPELL_ATTR_EX2_UNK15 0x00008000 // 15 not set in 2.4.2
+#define SPELL_ATTR_EX2_UNK15 0x00008000 // 15 not set in 3.0.3
#define SPELL_ATTR_EX2_TAME_BEAST 0x00010000 // 16
#define SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT 0x00020000 // 17 Hunters Shot and Stings only have this flag
#define SPELL_ATTR_EX2_UNK18 0x00040000 // 18 Only Revive pet - possible req dead pet
#define SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT 0x00080000 // 19 does not necessarly need shapeshift
#define SPELL_ATTR_EX2_UNK20 0x00100000 // 20
-#define SPELL_ATTR_EX2_UNK21 0x00200000 // 21
+#define SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD 0x00200000 // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure!
#define SPELL_ATTR_EX2_UNK22 0x00400000 // 22
#define SPELL_ATTR_EX2_UNK23 0x00800000 // 23 Only mage Arcane Concentration have this flag
#define SPELL_ATTR_EX2_UNK24 0x01000000 // 24
#define SPELL_ATTR_EX2_UNK25 0x02000000 // 25
#define SPELL_ATTR_EX2_UNK26 0x04000000 // 26 unaffected by school immunity
#define SPELL_ATTR_EX2_UNK27 0x08000000 // 27
-#define SPELL_ATTR_EX2_UNK28 0x10000000 // 28
+#define SPELL_ATTR_EX2_UNK28 0x10000000 // 28 no breaks stealth if it fails??
#define SPELL_ATTR_EX2_CANT_CRIT 0x20000000 // 29 Spell can't crit
#define SPELL_ATTR_EX2_UNK30 0x40000000 // 30
#define SPELL_ATTR_EX2_FOOD 0x80000000 // 31 food, well-fed, and a few others
@@ -329,8 +335,8 @@ enum SpellCategory
#define SPELL_ATTR_EX3_UNK13 0x00002000 // 13
#define SPELL_ATTR_EX3_UNK14 0x00004000 // 14 "Honorless Target" only this spells have this flag
#define SPELL_ATTR_EX3_UNK15 0x00008000 // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag
-#define SPELL_ATTR_EX3_UNK16 0x00010000 // 16
-#define SPELL_ATTR_EX3_NO_INITIAL_AGGRO 0x00020000 // 17 no initial aggro
+#define SPELL_ATTR_EX3_UNK16 0x00010000 // 16 no triggers effects that trigger on casting a spell??
+#define SPELL_ATTR_EX3_UNK17 0x00020000 // 17 no triggers effects that trigger on casting a spell??
#define SPELL_ATTR_EX3_UNK18 0x00040000 // 18
#define SPELL_ATTR_EX3_UNK19 0x00080000 // 19
#define SPELL_ATTR_EX3_DEATH_PERSISTENT 0x00100000 // 20 Death persistent spells
@@ -338,7 +344,7 @@ enum SpellCategory
#define SPELL_ATTR_EX3_REQ_WAND 0x00400000 // 22 Req wand
#define SPELL_ATTR_EX3_UNK23 0x00800000 // 23
#define SPELL_ATTR_EX3_REQ_OFFHAND 0x01000000 // 24 Req offhand weapon
-#define SPELL_ATTR_EX3_UNK25 0x02000000 // 25
+#define SPELL_ATTR_EX3_UNK25 0x02000000 // 25 no cause spell pushback ?
#define SPELL_ATTR_EX3_UNK26 0x04000000 // 26
#define SPELL_ATTR_EX3_UNK27 0x08000000 // 27
#define SPELL_ATTR_EX3_UNK28 0x10000000 // 28
@@ -350,9 +356,9 @@ enum SpellCategory
#define SPELL_ATTR_EX4_UNK1 0x00000002 // 1 proc on finishing move?
#define SPELL_ATTR_EX4_UNK2 0x00000004 // 2
#define SPELL_ATTR_EX4_UNK3 0x00000008 // 3
-#define SPELL_ATTR_EX4_UNK4 0x00000010 // 4
+#define SPELL_ATTR_EX4_UNK4 0x00000010 // 4 This will no longer cause guards to attack on use??
#define SPELL_ATTR_EX4_UNK5 0x00000020 // 5
-#define SPELL_ATTR_EX4_UNK6 0x00000040 // 6
+#define SPELL_ATTR_EX4_NOT_STEALABLE 0x00000040 // 6 although such auras might be dispellable, they cannot be stolen
#define SPELL_ATTR_EX4_UNK7 0x00000080 // 7
#define SPELL_ATTR_EX4_UNK8 0x00000100 // 8
#define SPELL_ATTR_EX4_UNK9 0x00000200 // 9
@@ -388,7 +394,7 @@ enum SpellCategory
#define SPELL_ATTR_EX5_UNK6 0x00000040 // 6
#define SPELL_ATTR_EX5_UNK7 0x00000080 // 7
#define SPELL_ATTR_EX5_UNK8 0x00000100 // 8
-#define SPELL_ATTR_EX5_UNK9 0x00000200 // 9
+#define SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY 0x00000200 // 9 begin periodic tick at aura apply
#define SPELL_ATTR_EX5_UNK10 0x00000400 // 10
#define SPELL_ATTR_EX5_UNK11 0x00000800 // 11
#define SPELL_ATTR_EX5_UNK12 0x00001000 // 12
@@ -413,37 +419,39 @@ enum SpellCategory
#define SPELL_ATTR_EX5_UNK31 0x80000000 // 31 Forces all nearby enemies to focus attacks caster
#define SPELL_ATTR_EX6_UNK0 0x00000001 // 0 Only Move spell have this flag
-#define SPELL_ATTR_EX6_UNK1 0x00000002 // 1 not set in 2.4.2
+#define SPELL_ATTR_EX6_UNK1 0x00000002 // 1 not set in 3.0.3
#define SPELL_ATTR_EX6_UNK2 0x00000004 // 2
#define SPELL_ATTR_EX6_UNK3 0x00000008 // 3
-#define SPELL_ATTR_EX6_UNK4 0x00000010 // 4 not set in 2.4.2
+#define SPELL_ATTR_EX6_UNK4 0x00000010 // 4
#define SPELL_ATTR_EX6_UNK5 0x00000020 // 5
#define SPELL_ATTR_EX6_UNK6 0x00000040 // 6
#define SPELL_ATTR_EX6_UNK7 0x00000080 // 7
#define SPELL_ATTR_EX6_UNK8 0x00000100 // 8
-#define SPELL_ATTR_EX6_UNK9 0x00000200 // 9 not set in 2.4.2
+#define SPELL_ATTR_EX6_UNK9 0x00000200 // 9
#define SPELL_ATTR_EX6_UNK10 0x00000400 // 10
#define SPELL_ATTR_EX6_UNK11 0x00000800 // 11
-#define SPELL_ATTR_EX6_UNK12 0x00001000 // 12 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK13 0x00002000 // 13 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK14 0x00004000 // 14 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK15 0x00008000 // 15 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK16 0x00010000 // 16 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK17 0x00020000 // 17 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK18 0x00040000 // 18 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK19 0x00080000 // 19 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK20 0x00100000 // 20 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK21 0x00200000 // 21 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK22 0x00400000 // 22 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK23 0x00800000 // 23 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK24 0x01000000 // 24 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK25 0x02000000 // 25 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK26 0x04000000 // 26 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK27 0x08000000 // 27 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK28 0x10000000 // 28 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK29 0x20000000 // 29 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 2.4.2
-#define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 2.4.2
+#define SPELL_ATTR_EX6_UNK12 0x00001000 // 12
+#define SPELL_ATTR_EX6_UNK13 0x00002000 // 13
+#define SPELL_ATTR_EX6_UNK14 0x00004000 // 14
+#define SPELL_ATTR_EX6_UNK15 0x00008000 // 15 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK16 0x00010000 // 16
+#define SPELL_ATTR_EX6_UNK17 0x00020000 // 17
+#define SPELL_ATTR_EX6_UNK18 0x00040000 // 18
+#define SPELL_ATTR_EX6_UNK19 0x00080000 // 19
+#define SPELL_ATTR_EX6_UNK20 0x00100000 // 20
+#define SPELL_ATTR_EX6_UNK21 0x00200000 // 21
+#define SPELL_ATTR_EX6_UNK22 0x00400000 // 22
+#define SPELL_ATTR_EX6_UNK23 0x00800000 // 23 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK24 0x01000000 // 24 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK25 0x02000000 // 25 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK26 0x04000000 // 26 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK27 0x08000000 // 27 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK28 0x10000000 // 28 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK29 0x20000000 // 29 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 3.0.3
+#define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 3.0.3
+
+#define MAX_GLYPH_SLOT_INDEX 6
enum SheathTypes
{
@@ -562,11 +570,11 @@ enum SpellEffects
SPELL_EFFECT_DISPEL = 38,
SPELL_EFFECT_LANGUAGE = 39,
SPELL_EFFECT_DUAL_WIELD = 40,
- SPELL_EFFECT_SUMMON_WILD = 41,
- SPELL_EFFECT_SUMMON_GUARDIAN = 42,
+ SPELL_EFFECT_JUMP = 41,
+ SPELL_EFFECT_JUMP2 = 42,
SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER= 43,
SPELL_EFFECT_SKILL_STEP = 44,
- SPELL_EFFECT_UNDEFINED_45 = 45,
+ SPELL_EFFECT_ADD_HONOR = 45,
SPELL_EFFECT_SPAWN = 46,
SPELL_EFFECT_TRADE_SKILL = 47,
SPELL_EFFECT_STEALTH = 48,
@@ -586,16 +594,16 @@ enum SpellEffects
SPELL_EFFECT_POWER_BURN = 62,
SPELL_EFFECT_THREAT = 63,
SPELL_EFFECT_TRIGGER_SPELL = 64,
- SPELL_EFFECT_HEALTH_FUNNEL = 65,
- SPELL_EFFECT_POWER_FUNNEL = 66,
+ SPELL_EFFECT_APPLY_AREA_AURA_RAID = 65,
+ SPELL_EFFECT_CREATE_MANA_GEM = 66,
SPELL_EFFECT_HEAL_MAX_HEALTH = 67,
SPELL_EFFECT_INTERRUPT_CAST = 68,
SPELL_EFFECT_DISTRACT = 69,
SPELL_EFFECT_PULL = 70,
SPELL_EFFECT_PICKPOCKET = 71,
SPELL_EFFECT_ADD_FARSIGHT = 72,
- SPELL_EFFECT_SUMMON_POSSESSED = 73,
- SPELL_EFFECT_SUMMON_TOTEM = 74,
+ SPELL_EFFECT_UNTRAIN_TALENTS = 73,
+ SPELL_EFFECT_APPLY_GLYPH = 74,
SPELL_EFFECT_HEAL_MECHANICAL = 75,
SPELL_EFFECT_SUMMON_OBJECT_WILD = 76,
SPELL_EFFECT_SCRIPT_EFFECT = 77,
@@ -608,17 +616,17 @@ enum SpellEffects
SPELL_EFFECT_STUCK = 84,
SPELL_EFFECT_SUMMON_PLAYER = 85,
SPELL_EFFECT_ACTIVATE_OBJECT = 86,
- SPELL_EFFECT_SUMMON_TOTEM_SLOT1 = 87,
- SPELL_EFFECT_SUMMON_TOTEM_SLOT2 = 88,
- SPELL_EFFECT_SUMMON_TOTEM_SLOT3 = 89,
- SPELL_EFFECT_SUMMON_TOTEM_SLOT4 = 90,
+ SPELL_EFFECT_WMO_DAMAGE = 87,
+ SPELL_EFFECT_WMO_REPAIR = 88,
+ SPELL_EFFECT_WMO_CHANGE = 89,
+ SPELL_EFFECT_KILL_CREDIT = 90,
SPELL_EFFECT_THREAT_ALL = 91,
SPELL_EFFECT_ENCHANT_HELD_ITEM = 92,
SPELL_EFFECT_SUMMON_PHANTASM = 93, //unused
SPELL_EFFECT_SELF_RESURRECT = 94,
SPELL_EFFECT_SKINNING = 95,
SPELL_EFFECT_CHARGE = 96,
- SPELL_EFFECT_SUMMON_CRITTER = 97,
+ SPELL_EFFECT_97 = 97,
SPELL_EFFECT_KNOCK_BACK = 98,
SPELL_EFFECT_DISENCHANT = 99,
SPELL_EFFECT_INEBRIATE = 100,
@@ -633,7 +641,7 @@ enum SpellEffects
SPELL_EFFECT_SUMMON_DEAD_PET = 109,
SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110,
SPELL_EFFECT_DURABILITY_DAMAGE = 111,
- SPELL_EFFECT_SUMMON_DEMON = 112,
+ SPELL_EFFECT_112 = 112,
SPELL_EFFECT_RESURRECT_NEW = 113,
SPELL_EFFECT_ATTACK_ME = 114,
SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 115,
@@ -655,19 +663,19 @@ enum SpellEffects
SPELL_EFFECT_131 = 131,
SPELL_EFFECT_132 = 132,
SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133,
- SPELL_EFFECT_KILL_CREDIT = 134,
+ SPELL_EFFECT_KILL_CREDIT2 = 134,
SPELL_EFFECT_135 = 135,
SPELL_EFFECT_HEAL_PCT = 136,
SPELL_EFFECT_ENERGIZE_PCT = 137,
SPELL_EFFECT_138 = 138,
- SPELL_EFFECT_139 = 139,
+ SPELL_EFFECT_CLEAR_QUEST = 139,
SPELL_EFFECT_FORCE_CAST = 140,
SPELL_EFFECT_141 = 141,
SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142,
SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143,
SPELL_EFFECT_KNOCK_BACK_2 = 144,
SPELL_EFFECT_145 = 145,
- SPELL_EFFECT_146 = 146,
+ SPELL_EFFECT_ACTIVATE_RUNE = 146,
SPELL_EFFECT_QUEST_FAIL = 147,
SPELL_EFFECT_148 = 148,
SPELL_EFFECT_149 = 149,
@@ -675,7 +683,201 @@ enum SpellEffects
SPELL_EFFECT_TRIGGER_SPELL_2 = 151,
SPELL_EFFECT_152 = 152,
SPELL_EFFECT_153 = 153,
- TOTAL_SPELL_EFFECTS = 154
+ SPELL_EFFECT_154 = 154,
+ SPELL_EFFECT_TITAN_GRIP = 155,
+ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156,
+ SPELL_EFFECT_CREATE_ITEM_2 = 157,
+ SPELL_EFFECT_MILLING = 158,
+ SPELL_EFFECT_ALLOW_RENAME_PET = 159,
+ TOTAL_SPELL_EFFECTS = 160
+};
+
+enum SpellCastResult
+{
+ SPELL_FAILED_AFFECTING_COMBAT = 0,
+ SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 1,
+ SPELL_FAILED_ALREADY_AT_FULL_MANA = 2,
+ SPELL_FAILED_ALREADY_AT_FULL_POWER = 3,
+ SPELL_FAILED_ALREADY_BEING_TAMED = 4,
+ SPELL_FAILED_ALREADY_HAVE_CHARM = 5,
+ SPELL_FAILED_ALREADY_HAVE_SUMMON = 6,
+ SPELL_FAILED_ALREADY_OPEN = 7,
+ SPELL_FAILED_AURA_BOUNCED = 8,
+ SPELL_FAILED_AUTOTRACK_INTERRUPTED = 9,
+ SPELL_FAILED_BAD_IMPLICIT_TARGETS = 10,
+ SPELL_FAILED_BAD_TARGETS = 11,
+ SPELL_FAILED_CANT_BE_CHARMED = 12,
+ SPELL_FAILED_CANT_BE_DISENCHANTED = 13,
+ SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 14,
+ SPELL_FAILED_CANT_BE_MILLED = 15,
+ SPELL_FAILED_CANT_BE_PROSPECTED = 16,
+ SPELL_FAILED_CANT_CAST_ON_TAPPED = 17,
+ SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 18,
+ SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 19,
+ SPELL_FAILED_CANT_STEALTH = 20,
+ SPELL_FAILED_CASTER_AURASTATE = 21,
+ SPELL_FAILED_CASTER_DEAD = 22,
+ SPELL_FAILED_CHARMED = 23,
+ SPELL_FAILED_CHEST_IN_USE = 24,
+ SPELL_FAILED_CONFUSED = 25,
+ SPELL_FAILED_DONT_REPORT = 26,
+ SPELL_FAILED_EQUIPPED_ITEM = 27,
+ SPELL_FAILED_EQUIPPED_ITEM_CLASS = 28,
+ SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 29,
+ SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 30,
+ SPELL_FAILED_ERROR = 31,
+ SPELL_FAILED_FIZZLE = 32,
+ SPELL_FAILED_FLEEING = 33,
+ SPELL_FAILED_FOOD_LOWLEVEL = 34,
+ SPELL_FAILED_HIGHLEVEL = 35,
+ SPELL_FAILED_HUNGER_SATIATED = 36,
+ SPELL_FAILED_IMMUNE = 37,
+ SPELL_FAILED_INCORRECT_AREA = 38,
+ SPELL_FAILED_INTERRUPTED = 39,
+ SPELL_FAILED_INTERRUPTED_COMBAT = 40,
+ SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 41,
+ SPELL_FAILED_ITEM_GONE = 42,
+ SPELL_FAILED_ITEM_NOT_FOUND = 43,
+ SPELL_FAILED_ITEM_NOT_READY = 44,
+ SPELL_FAILED_LEVEL_REQUIREMENT = 45,
+ SPELL_FAILED_LINE_OF_SIGHT = 46,
+ SPELL_FAILED_LOWLEVEL = 47,
+ SPELL_FAILED_LOW_CASTLEVEL = 48,
+ SPELL_FAILED_MAINHAND_EMPTY = 49,
+ SPELL_FAILED_MOVING = 50,
+ SPELL_FAILED_NEED_AMMO = 51,
+ SPELL_FAILED_NEED_AMMO_POUCH = 52,
+ SPELL_FAILED_NEED_EXOTIC_AMMO = 53,
+ SPELL_FAILED_NEED_MORE_ITEMS = 54,
+ SPELL_FAILED_NOPATH = 55,
+ SPELL_FAILED_NOT_BEHIND = 56,
+ SPELL_FAILED_NOT_FISHABLE = 57,
+ SPELL_FAILED_NOT_FLYING = 58,
+ SPELL_FAILED_NOT_HERE = 59,
+ SPELL_FAILED_NOT_INFRONT = 60,
+ SPELL_FAILED_NOT_IN_CONTROL = 61,
+ SPELL_FAILED_NOT_KNOWN = 62,
+ SPELL_FAILED_NOT_MOUNTED = 63,
+ SPELL_FAILED_NOT_ON_TAXI = 64,
+ SPELL_FAILED_NOT_ON_TRANSPORT = 65,
+ SPELL_FAILED_NOT_READY = 66,
+ SPELL_FAILED_NOT_SHAPESHIFT = 67,
+ SPELL_FAILED_NOT_STANDING = 68,
+ SPELL_FAILED_NOT_TRADEABLE = 69,
+ SPELL_FAILED_NOT_TRADING = 70,
+ SPELL_FAILED_NOT_UNSHEATHED = 71,
+ SPELL_FAILED_NOT_WHILE_GHOST = 72,
+ SPELL_FAILED_NOT_WHILE_LOOTING = 73,
+ SPELL_FAILED_NO_AMMO = 74,
+ SPELL_FAILED_NO_CHARGES_REMAIN = 75,
+ SPELL_FAILED_NO_CHAMPION = 76,
+ SPELL_FAILED_NO_COMBO_POINTS = 77,
+ SPELL_FAILED_NO_DUELING = 78,
+ SPELL_FAILED_NO_ENDURANCE = 79,
+ SPELL_FAILED_NO_FISH = 80,
+ SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 81,
+ SPELL_FAILED_NO_MOUNTS_ALLOWED = 82,
+ SPELL_FAILED_NO_PET = 83,
+ SPELL_FAILED_NO_POWER = 84,
+ SPELL_FAILED_NOTHING_TO_DISPEL = 85,
+ SPELL_FAILED_NOTHING_TO_STEAL = 86,
+ SPELL_FAILED_ONLY_ABOVEWATER = 87,
+ SPELL_FAILED_ONLY_DAYTIME = 88,
+ SPELL_FAILED_ONLY_INDOORS = 89,
+ SPELL_FAILED_ONLY_MOUNTED = 90,
+ SPELL_FAILED_ONLY_NIGHTTIME = 91,
+ SPELL_FAILED_ONLY_OUTDOORS = 92,
+ SPELL_FAILED_ONLY_SHAPESHIFT = 93,
+ SPELL_FAILED_ONLY_STEALTHED = 94,
+ SPELL_FAILED_ONLY_UNDERWATER = 95,
+ SPELL_FAILED_OUT_OF_RANGE = 96,
+ SPELL_FAILED_PACIFIED = 97,
+ SPELL_FAILED_POSSESSED = 98,
+ SPELL_FAILED_REAGENTS = 99,
+ SPELL_FAILED_REQUIRES_AREA = 100,
+ SPELL_FAILED_REQUIRES_SPELL_FOCUS = 101,
+ SPELL_FAILED_ROOTED = 102,
+ SPELL_FAILED_SILENCED = 103,
+ SPELL_FAILED_SPELL_IN_PROGRESS = 104,
+ SPELL_FAILED_SPELL_LEARNED = 105,
+ SPELL_FAILED_SPELL_UNAVAILABLE = 106,
+ SPELL_FAILED_STUNNED = 107,
+ SPELL_FAILED_TARGETS_DEAD = 108,
+ SPELL_FAILED_TARGET_AFFECTING_COMBAT = 109,
+ SPELL_FAILED_TARGET_AURASTATE = 110,
+ SPELL_FAILED_TARGET_DUELING = 111,
+ SPELL_FAILED_TARGET_ENEMY = 112,
+ SPELL_FAILED_TARGET_ENRAGED = 113,
+ SPELL_FAILED_TARGET_FRIENDLY = 114,
+ SPELL_FAILED_TARGET_IN_COMBAT = 115,
+ SPELL_FAILED_TARGET_IS_PLAYER = 116,
+ SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 117,
+ SPELL_FAILED_TARGET_NOT_DEAD = 118,
+ SPELL_FAILED_TARGET_NOT_IN_PARTY = 119,
+ SPELL_FAILED_TARGET_NOT_LOOTED = 120,
+ SPELL_FAILED_TARGET_NOT_PLAYER = 121,
+ SPELL_FAILED_TARGET_NO_POCKETS = 122,
+ SPELL_FAILED_TARGET_NO_WEAPONS = 123,
+ SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 124,
+ SPELL_FAILED_TARGET_UNSKINNABLE = 125,
+ SPELL_FAILED_THIRST_SATIATED = 126,
+ SPELL_FAILED_TOO_CLOSE = 127,
+ SPELL_FAILED_TOO_MANY_OF_ITEM = 128,
+ SPELL_FAILED_TOTEM_CATEGORY = 129,
+ SPELL_FAILED_TOTEMS = 130,
+ SPELL_FAILED_TRY_AGAIN = 131,
+ SPELL_FAILED_UNIT_NOT_BEHIND = 132,
+ SPELL_FAILED_UNIT_NOT_INFRONT = 133,
+ SPELL_FAILED_WRONG_PET_FOOD = 134,
+ SPELL_FAILED_NOT_WHILE_FATIGUED = 135,
+ SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 136,
+ SPELL_FAILED_NOT_WHILE_TRADING = 137,
+ SPELL_FAILED_TARGET_NOT_IN_RAID = 138,
+ SPELL_FAILED_TARGET_FREEFORALL = 139,
+ SPELL_FAILED_NO_EDIBLE_CORPSES = 140,
+ SPELL_FAILED_ONLY_BATTLEGROUNDS = 141,
+ SPELL_FAILED_TARGET_NOT_GHOST = 142,
+ SPELL_FAILED_TRANSFORM_UNUSABLE = 143,
+ SPELL_FAILED_WRONG_WEATHER = 144,
+ SPELL_FAILED_DAMAGE_IMMUNE = 145,
+ SPELL_FAILED_PREVENTED_BY_MECHANIC = 146,
+ SPELL_FAILED_PLAY_TIME = 147,
+ SPELL_FAILED_REPUTATION = 148,
+ SPELL_FAILED_MIN_SKILL = 149,
+ SPELL_FAILED_NOT_IN_ARENA = 150,
+ SPELL_FAILED_NOT_ON_SHAPESHIFT = 151,
+ SPELL_FAILED_NOT_ON_STEALTHED = 152,
+ SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 153,
+ SPELL_FAILED_NOT_ON_MOUNTED = 154,
+ SPELL_FAILED_TOO_SHALLOW = 155,
+ SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 156,
+ SPELL_FAILED_TARGET_IS_TRIVIAL = 157,
+ SPELL_FAILED_BM_OR_INVISGOD = 158,
+ SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 159,
+ SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 160,
+ SPELL_FAILED_NOT_IDLE = 161,
+ SPELL_FAILED_NOT_INACTIVE = 162,
+ SPELL_FAILED_PARTIAL_PLAYTIME = 163,
+ SPELL_FAILED_NO_PLAYTIME = 164,
+ SPELL_FAILED_NOT_IN_BATTLEGROUND = 165,
+ SPELL_FAILED_NOT_IN_RAID_INSTANCE = 166,
+ SPELL_FAILED_ONLY_IN_ARENA = 167,
+ SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE = 168,
+ SPELL_FAILED_ON_USE_ENCHANT = 169,
+ SPELL_FAILED_NOT_ON_GROUND = 170,
+ SPELL_FAILED_CUSTOM_ERROR = 171,
+ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 172,
+ SPELL_FAILED_TOO_MANY_SOCKETS = 173,
+ SPELL_FAILED_INVALID_GLYPH = 174,
+ SPELL_FAILED_UNIQUE_GLYPH = 175,
+ SPELL_FAILED_GLYPH_SOCKET_LOCKED = 176,
+ SPELL_FAILED_NO_VALID_TARGETS = 177,
+ SPELL_FAILED_ITEM_AT_MAX_CHARGES = 178,
+ SPELL_FAILED_NOT_IN_BARBERSHOP = 179,
+ SPELL_FAILED_FISHING_TOO_LOW = 180,
+ SPELL_FAILED_UNKNOWN = 181,
+
+ SPELL_CAST_OK = 255 //custom value, don't must be send to client
};
// Spell aura states
@@ -685,25 +887,28 @@ enum AuraState
AURA_STATE_DEFENSE = 1, // C |
AURA_STATE_HEALTHLESS_20_PERCENT = 2, // CcT |
AURA_STATE_BERSERKING = 3, // C T |
- //AURA_STATE_UNKNOWN4 = 4, // c t| some limitation to charge spells (?) and target test spells
+ AURA_STATE_FROZEN = 4, // c t| frozen target
AURA_STATE_JUDGEMENT = 5, // C |
//AURA_STATE_UNKNOWN6 = 6, // | not used
AURA_STATE_HUNTER_PARRY = 7, // C |
AURA_STATE_ROGUE_ATTACK_FROM_STEALTH = 7, // C | FIX ME: not implemented yet!
- //AURA_STATE_UNKNOWN7c = 7, // c | random/focused bursts spells (?)
+ //AURA_STATE_UNKNOWN7 = 7, // c | random/focused bursts spells (?)
//AURA_STATE_UNKNOWN8 = 8, // | not used
//AURA_STATE_UNKNOWN9 = 9, // | not used
AURA_STATE_WARRIOR_VICTORY_RUSH = 10, // C | warrior victory rush
- AURA_STATE_HUNTER_CRIT_STRIKE = 10, // C | hunter crit strike
- AURA_STATE_CRIT = 11, // C |
+ //AURA_STATE_UNKNOWN11 = 11, // t|
AURA_STATE_FAERIE_FIRE = 12, // c t|
AURA_STATE_HEALTHLESS_35_PERCENT = 13, // C T |
AURA_STATE_IMMOLATE = 14, // T |
AURA_STATE_SWIFTMEND = 15, // T |
AURA_STATE_DEADLY_POISON = 16, // T |
- AURA_STATE_FORBEARANCE = 17, // c t|
- AURA_STATE_WEAKENED_SOUL = 18, // t|
- AURA_STATE_HYPOTHERMIA = 19 // c |
+ AURA_STATE_ENRAGE = 17, // C |
+ //AURA_STATE_UNKNOWN18 = 18, // C t|
+ //AURA_STATE_UNKNOWN19 = 19, // | not used
+ //AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide)
+ //AURA_STATE_UNKNOWN21 = 21, // | not used
+ //AURA_STATE_UNKNOWN22 = 22, // C | not implemented yet (Requires Evasive Charges to use)
+ AURA_STATE_HEALTH_ABOVE_75_PERCENT = 23, // C |
};
// Spell mechanics
@@ -711,11 +916,11 @@ enum Mechanics
{
MECHANIC_NONE = 0,
MECHANIC_CHARM = 1,
- MECHANIC_CONFUSED = 2,
+ MECHANIC_DISORIENTED = 2,
MECHANIC_DISARM = 3,
MECHANIC_DISTRACT = 4,
MECHANIC_FEAR = 5,
- MECHANIC_FUMBLE = 6,
+ MECHANIC_GRIP = 6,
MECHANIC_ROOT = 7,
MECHANIC_PACIFY = 8, //0 spells use this mechanic
MECHANIC_SILENCE = 9,
@@ -731,7 +936,7 @@ enum Mechanics
MECHANIC_SHIELD = 19,
MECHANIC_SHACKLE = 20,
MECHANIC_MOUNT = 21,
- MECHANIC_PERSUADE = 22, //0 spells use this mechanic
+ MECHANIC_INFECTED = 22,
MECHANIC_TURN = 23,
MECHANIC_HORROR = 24,
MECHANIC_INVULNERABILITY = 25,
@@ -739,12 +944,13 @@ enum Mechanics
MECHANIC_DAZE = 27,
MECHANIC_DISCOVERY = 28,
MECHANIC_IMMUNE_SHIELD = 29, // Divine (Blessing) Shield/Protection and Ice Block
- MECHANIC_SAPPED = 30
+ MECHANIC_SAPPED = 30,
+ MECHANIC_ENRAGED = 31
};
// Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967da6)
#define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK ( \
- (1<<MECHANIC_CHARM )|(1<<MECHANIC_CONFUSED )|(1<<MECHANIC_FEAR )| \
+ (1<<MECHANIC_CHARM )|(1<<MECHANIC_DISORIENTED )|(1<<MECHANIC_FEAR )| \
(1<<MECHANIC_ROOT )|(1<<MECHANIC_PACIFY )|(1<<MECHANIC_SLEEP )| \
(1<<MECHANIC_SNARE )|(1<<MECHANIC_STUN )|(1<<MECHANIC_FREEZE)| \
(1<<MECHANIC_KNOCKOUT)|(1<<MECHANIC_POLYMORPH)|(1<<MECHANIC_BANISH)| \
@@ -764,7 +970,8 @@ enum DispelType
DISPEL_ALL = 7,
DISPEL_SPE_NPC_ONLY = 8,
DISPEL_ENRAGE = 9,
- DISPEL_ZG_TICKET = 10
+ DISPEL_ZG_TICKET = 10,
+ DESPEL_OLD_UNUSED = 11
};
#define DISPEL_ALL_MASK ( (1<<DISPEL_MAGIC) | (1<<DISPEL_CURSE) | (1<<DISPEL_DISEASE) | (1<<DISPEL_POISON) )
@@ -790,10 +997,9 @@ enum Targets
{
TARGET_SELF = 1,
TARGET_UNIT_CASTER = 1,
- TARGET_RANDOM_ENEMY_CHAIN_IN_AREA = 2, // only one spell has that, but regardless, it's a target type after all
- //TARGET_UNIT_NEARBY_ENEMY
- TARGET_UNIT_SINGLE_UNKNOWN = 3,
- TARGET_UNIT_NEARBY_ALLY = 4,
+ TARGET_UNIT_NEARBY_ENEMY = 2,
+ TARGET_UNIT_NEARBY_ALLY = 3,
+ TARGET_UNIT_NEARBY_ALLY_UNK = 4,
TARGET_PET = 5,
TARGET_UNIT_PET = 5,
TARGET_CHAIN_DAMAGE = 6,
@@ -816,7 +1022,6 @@ enum Targets
TARGET_UNIT_PARTY_CASTER = 20,
TARGET_SINGLE_FRIEND = 21,
TARGET_UNIT_TARGET_ALLY = 21,
- TARGET_ALL_AROUND_CASTER = 22, // used only in TargetA, target selection dependent from TargetB
TARGET_DEST_CASTER = 22,
TARGET_GAMEOBJECT = 23,
//TARGET_OBJECT_OPEN
@@ -986,9 +1191,10 @@ enum GameobjectTypes
GAMEOBJECT_TYPE_BARBER_CHAIR = 32,
GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING = 33,
GAMEOBJECT_TYPE_GUILD_BANK = 34,
+ GAMEOBJECT_TYPE_TRAPDOOR = 35
};
-#define MAX_GAMEOBJECT_TYPE 35 // sending to client this or greater value can crash client.
+#define MAX_GAMEOBJECT_TYPE 36 // sending to client this or greater value can crash client.
#define GAMEOBJECT_FISHINGNODE_ENTRY 35591 // Better to define it somewhere instead of hardcoding everywhere
@@ -1555,7 +1761,9 @@ enum LockType
LOCKTYPE_BLASTING = 16,
LOCKTYPE_SLOW_OPEN = 17,
LOCKTYPE_SLOW_CLOSE = 18,
- LOCKTYPE_FISHING = 19
+ LOCKTYPE_FISHING = 19,
+ LOCKTYPE_INSCRIPTION = 20,
+ LOCKTYPE_OPEN_FROM_VEHICLE = 21
};
enum TrainerType // this is important type for npcs!
@@ -1568,6 +1776,7 @@ enum TrainerType // this is important
#define MAX_TRAINER_TYPE 4
+// CreatureType.dbc
enum CreatureType
{
CREATURE_TYPE_BEAST = 1,
@@ -1587,6 +1796,7 @@ enum CreatureType
uint32 const CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD = (1 << (CREATURE_TYPE_HUMANOID-1)) | (1 << (CREATURE_TYPE_UNDEAD-1));
+// CreatureFamily.dbc
enum CreatureFamily
{
CREATURE_FAMILY_WOLF = 1,
@@ -1598,6 +1808,7 @@ enum CreatureFamily
CREATURE_FAMILY_CARRION_BIRD = 7,
CREATURE_FAMILY_CRAB = 8,
CREATURE_FAMILY_GORILLA = 9,
+ CREATURE_FAMILY_HORSE_CUSTOM = 10, // not exist in DBC but used for horse like beasts in DB
CREATURE_FAMILY_RAPTOR = 11,
CREATURE_FAMILY_TALLSTRIDER = 12,
CREATURE_FAMILY_FELHUNTER = 15,
@@ -1609,7 +1820,7 @@ enum CreatureFamily
CREATURE_FAMILY_IMP = 23,
CREATURE_FAMILY_BAT = 24,
CREATURE_FAMILY_HYENA = 25,
- CREATURE_FAMILY_OWL = 26,
+ CREATURE_FAMILY_BIRD_OF_PREY = 26,
CREATURE_FAMILY_WIND_SERPENT = 27,
CREATURE_FAMILY_REMOTE_CONTROL = 28,
CREATURE_FAMILY_FELGUARD = 29,
@@ -1619,14 +1830,24 @@ enum CreatureFamily
CREATURE_FAMILY_SPOREBAT = 33,
CREATURE_FAMILY_NETHER_RAY = 34,
CREATURE_FAMILY_SERPENT = 35,
- CREATURE_FAMILY_SEA_LION = 36
+ CREATURE_FAMILY_MOTH = 37,
+ CREATURE_FAMILY_CHIMAERA = 38,
+ CREATURE_FAMILY_DEVILSAUR = 39,
+ CREATURE_FAMILY_GHOUL = 40,
+ CREATURE_FAMILY_SILITHID = 41,
+ CREATURE_FAMILY_WORM = 42,
+ CREATURE_FAMILY_RHINO = 43,
+ CREATURE_FAMILY_WASP = 44,
+ CREATURE_FAMILY_CORE_HOUND = 45,
+ CREATURE_FAMILY_SPIRIT_BEAST = 46
};
enum CreatureTypeFlags
{
- CREATURE_TYPEFLAGS_TAMEABLE = 0x0001,
- CREATURE_TYPEFLAGS_HERBLOOT = 0x0100,
- CREATURE_TYPEFLAGS_MININGLOOT = 0x0200
+ CREATURE_TYPEFLAGS_TAMEABLE = 0x0001,
+ CREATURE_TYPEFLAGS_HERBLOOT = 0x0100,
+ CREATURE_TYPEFLAGS_MININGLOOT = 0x0200,
+ CREATURE_TYPEFLAGS_ENGINEERLOOT = 0x8000
};
enum CreatureEliteType
@@ -1639,6 +1860,31 @@ enum CreatureEliteType
CREATURE_UNKNOWN = 5 // found in 2.2.3 for 2 mobs
};
+// values based at Holidays.dbc
+enum HolidayIds
+{
+ HOLIDAY_FIREWORKS_SPECTACULAR = 62,
+ HOLIDAY_FEAST_OF_WINTER_VEIL = 141,
+ HOLIDAY_NOBLEGARDEN = 181,
+ HOLIDAY_CHILDRENS_WEEK = 201,
+ HOLIDAY_CALL_TO_ARMS_AV = 283,
+ HOLIDAY_CALL_TO_ARMS_WG = 284,
+ HOLIDAY_CALL_TO_ARMS_AB = 285,
+ HOLIDAY_FISHING_EXTRAVAGANZA = 301,
+ HOLIDAY_HARVEST_FESTIVAL = 321,
+ HOLIDAY_HALLOWS_END = 324,
+ HOLIDAY_LUNAR_FESTIVAL = 327,
+ HOLIDAY_LOVE_IS_IN_THE_AIR = 335,
+ HOLIDAY_FIRE_FESTIVAL = 341,
+ HOLIDAY_CALL_TO_ARMS_ES = 353,
+ HOLIDAY_BREWFEST = 372,
+ HOLIDAY_DARKMOON_FAIRE_ELWYNN = 374,
+ HOLIDAY_DARKMOON_FAIRE_THUNDER = 375,
+ HOLIDAY_DARKMOON_FAIRE_SHATTRATH = 376,
+ HOLIDAY_CALL_TO_ARMS_SA = 400,
+ HOLIDAY_WOTLK_LAUNCH = 406
+};
+
// values based at QuestInfo.dbc
enum QuestTypes
{
@@ -1651,6 +1897,8 @@ enum QuestTypes
QUEST_TYPE_LEGENDARY = 83,
QUEST_TYPE_ESCORT = 84,
QUEST_TYPE_HEROIC = 85,
+ QUEST_TYPE_RAID_10 = 88,
+ QUEST_TYPE_RAID_25 = 89
};
// values based at QuestSort.dbc
@@ -1661,7 +1909,7 @@ enum QuestSort
QUEST_SORT_SEASONAL = 22,
QUEST_SORT_UNDERCITY_OLD = 23,
QUEST_SORT_HERBALISM = 24,
- QUEST_SORT_SCARLET_MONASTERY_OLD= 25,
+ QUEST_SORT_BATTLEGROUNDS = 25,
QUEST_SORT_ULDAMN_OLD = 41,
QUEST_SORT_WARLOCK = 61,
QUEST_SORT_WARRIOR = 81,
@@ -1690,34 +1938,39 @@ enum QuestSort
QUEST_SORT_REPUTATION = 367,
QUEST_SORT_INVASION = 368,
QUEST_SORT_MIDSUMMER = 369,
- QUEST_SORT_BREWFEST = 370
+ QUEST_SORT_BREWFEST = 370,
+ QUEST_SORT_INSCRIPTION = 371,
+ QUEST_SORT_DEATH_KNIGHT = 372,
+ QUEST_SORT_JEWELCRAFTING = 373
};
inline uint8 ClassByQuestSort(int32 QuestSort)
{
switch(QuestSort)
{
- case QUEST_SORT_WARLOCK: return CLASS_WARLOCK;
- case QUEST_SORT_WARRIOR: return CLASS_WARRIOR;
- case QUEST_SORT_SHAMAN: return CLASS_SHAMAN;
- case QUEST_SORT_PALADIN: return CLASS_PALADIN;
- case QUEST_SORT_MAGE: return CLASS_MAGE;
- case QUEST_SORT_ROGUE: return CLASS_ROGUE;
- case QUEST_SORT_HUNTER: return CLASS_HUNTER;
- case QUEST_SORT_PRIEST: return CLASS_PRIEST;
- case QUEST_SORT_DRUID: return CLASS_DRUID;
+ case QUEST_SORT_WARLOCK: return CLASS_WARLOCK;
+ case QUEST_SORT_WARRIOR: return CLASS_WARRIOR;
+ case QUEST_SORT_SHAMAN: return CLASS_SHAMAN;
+ case QUEST_SORT_PALADIN: return CLASS_PALADIN;
+ case QUEST_SORT_MAGE: return CLASS_MAGE;
+ case QUEST_SORT_ROGUE: return CLASS_ROGUE;
+ case QUEST_SORT_HUNTER: return CLASS_HUNTER;
+ case QUEST_SORT_PRIEST: return CLASS_PRIEST;
+ case QUEST_SORT_DRUID: return CLASS_DRUID;
+ case QUEST_SORT_DEATH_KNIGHT: return CLASS_DEATH_KNIGHT;
}
return 0;
}
enum SkillType
{
+ SKILL_NONE = 0,
+
SKILL_FROST = 6,
SKILL_FIRE = 8,
SKILL_ARMS = 26,
SKILL_COMBAT = 38,
SKILL_SUBTLETY = 39,
- SKILL_POISONS = 40,
SKILL_SWORDS = 43,
SKILL_AXES = 44,
SKILL_BOWS = 45,
@@ -1725,8 +1978,8 @@ enum SkillType
SKILL_BEAST_MASTERY = 50,
SKILL_SURVIVAL = 51,
SKILL_MACES = 54,
- SKILL_HOLY = 56,
SKILL_2H_SWORDS = 55,
+ SKILL_HOLY = 56,
SKILL_SHADOW = 78,
SKILL_DEFENSE = 95,
SKILL_LANG_COMMON = 98,
@@ -1782,24 +2035,20 @@ enum SkillType
SKILL_PET_BOAR = 211,
SKILL_PET_CROCILISK = 212,
SKILL_PET_CARRION_BIRD = 213,
- SKILL_PET_GORILLA = 215,
SKILL_PET_CRAB = 214,
+ SKILL_PET_GORILLA = 215,
SKILL_PET_RAPTOR = 217,
SKILL_PET_TALLSTRIDER = 218,
SKILL_RACIAL_UNDED = 220,
- SKILL_WEAPON_TALENTS = 222,
SKILL_CROSSBOWS = 226,
- SKILL_SPEARS = 227,
SKILL_WANDS = 228,
SKILL_POLEARMS = 229,
SKILL_PET_SCORPID = 236,
SKILL_ARCANE = 237,
- SKILL_OPEN_LOCK = 242,
SKILL_PET_TURTLE = 251,
SKILL_ASSASSINATION = 253,
SKILL_FURY = 256,
SKILL_PROTECTION = 257,
- SKILL_BEAST_TRAINING = 261,
SKILL_PROTECTION2 = 267,
SKILL_PET_TALENTS = 270,
SKILL_PLATE_MAIL = 293,
@@ -1829,7 +2078,7 @@ enum SkillType
SKILL_LOCKPICKING = 633,
SKILL_PET_BAT = 653,
SKILL_PET_HYENA = 654,
- SKILL_PET_OWL = 655,
+ SKILL_PET_BIRD_OF_PREY = 655,
SKILL_PET_WIND_SERPENT = 656,
SKILL_LANG_GUTTERSPEAK = 673,
SKILL_RIDING_KODO = 713,
@@ -1849,10 +2098,41 @@ enum SkillType
SKILL_PET_WARP_STALKER = 766,
SKILL_PET_RAVAGER = 767,
SKILL_PET_SERPENT = 768,
- SKILL_INTERNAL = 769
+ SKILL_INTERNAL = 769,
+ SKILL_DK_BLOOD = 770,
+ SKILL_DK_FROST = 771,
+ SKILL_DK_UNHOLY = 772,
+ SKILL_INSCRIPTION = 773,
+ SKILL_PET_MOTH = 775,
+ SKILL_RUNEFORGING = 776,
+ SKILL_MOUNTS = 777,
+ SKILL_COMPANIONS = 778,
+ SKILL_PET_EXOTIC_CHIMAERA = 780,
+ SKILL_PET_EXOTIC_DEVILSAUR = 781,
+ SKILL_PET_GHOUL = 782,
+ SKILL_PET_EXOTIC_SILITHID = 783,
+ SKILL_PET_EXOTIC_WORM = 784,
+ SKILL_PET_WASP = 785,
+ SKILL_PET_EXOTIC_RHINO = 786,
+ SKILL_PET_EXOTIC_CORE_HOUND = 787,
+ SKILL_PET_EXOTIC_SPIRIT_BEAST = 788
};
-#define MAX_SKILL_TYPE 770
+#define MAX_SKILL_TYPE 789
+
+inline SkillType SkillByLockType(LockType locktype)
+{
+ switch(locktype)
+ {
+ case LOCKTYPE_PICKLOCK: return SKILL_LOCKPICKING;
+ case LOCKTYPE_HERBALISM: return SKILL_HERBALISM;
+ case LOCKTYPE_MINING: return SKILL_MINING;
+ case LOCKTYPE_FISHING: return SKILL_FISHING;
+ case LOCKTYPE_INSCRIPTION: return SKILL_INSCRIPTION;
+ default: break;
+ }
+ return SKILL_NONE;
+}
inline uint32 SkillByQuestSort(int32 QuestSort)
{
@@ -1867,25 +2147,27 @@ inline uint32 SkillByQuestSort(int32 QuestSort)
case QUEST_SORT_TAILORING: return SKILL_TAILORING;
case QUEST_SORT_COOKING: return SKILL_COOKING;
case QUEST_SORT_FIRST_AID: return SKILL_FIRST_AID;
+ case QUEST_SORT_JEWELCRAFTING: return SKILL_JEWELCRAFTING;
+ case QUEST_SORT_INSCRIPTION: return SKILL_INSCRIPTION;
}
return 0;
}
enum SkillCategory
{
- SKILL_CATEGORY_ATTRIBUTES = 5,
- SKILL_CATEGORY_WEAPON = 6,
- SKILL_CATEGORY_CLASS = 7,
- SKILL_CATEGORY_ARMOR = 8,
- SKILL_CATEGORY_SECONDARY = 9, // secondary professions
+ SKILL_CATEGORY_ATTRIBUTES = 5,
+ SKILL_CATEGORY_WEAPON = 6,
+ SKILL_CATEGORY_CLASS = 7,
+ SKILL_CATEGORY_ARMOR = 8,
+ SKILL_CATEGORY_SECONDARY = 9, // secondary professions
SKILL_CATEGORY_LANGUAGES = 10,
SKILL_CATEGORY_PROFESSION = 11, // primary professions
- SKILL_CATEGORY_NOT_DISPLAYED = 12
+ SKILL_CATEGORY_GENERIC = 12
};
enum TotemCategory
{
- TC_SKINNING_SKIFE = 1,
+ TC_SKINNING_SKIFE_OLD = 1,
TC_EARTH_TOTEM = 2,
TC_AIR_TOTEM = 3,
TC_FIRE_TOTEM = 4,
@@ -1895,15 +2177,28 @@ enum TotemCategory
TC_GOLDEN_ROD = 8,
TC_TRUESILVER_ROD = 9,
TC_ARCANITE_ROD = 10,
- TC_MINING_PICK = 11,
+ TC_MINING_PICK_OLD = 11,
TC_PHILOSOPHERS_STONE = 12,
- TC_BLACKSMITH_HAMMER = 13,
+ TC_BLACKSMITH_HAMMER_OLD = 13,
TC_ARCLIGHT_SPANNER = 14,
TC_GYROMATIC_MA = 15,
TC_MASTER_TOTEM = 21,
TC_FEL_IRON_ROD = 41,
TC_ADAMANTITE_ROD = 62,
- TC_ETERNIUM_ROD = 63
+ TC_ETERNIUM_ROD = 63,
+ TC_HOLLOW_QUILL = 81,
+ TC_RUNED_AZURITE_ROD = 101,
+ TC_VIRTUOSO_INKING_SET = 121,
+ TC_DRUMS = 141,
+ TC_GNOMISH_ARMY_KNIFE = 161,
+ TC_BLACKSMITH_HAMMER = 162,
+ TC_MINING_PICK = 165,
+ TC_SKINNING_KNIFE = 166,
+ TC_HAMMER_PICK = 167,
+ TC_BLADED_PICKAXE = 168,
+ TC_FLINT_AND_TINDER = 169,
+ TC_RUNED_COBALT_ROD = 189,
+ TC_RUNED_TITANIUM_ROD = 190
};
enum UnitDynFlags
@@ -1913,7 +2208,8 @@ enum UnitDynFlags
UNIT_DYNFLAG_OTHER_TAGGER = 0x0004,
UNIT_DYNFLAG_ROOTED = 0x0008,
UNIT_DYNFLAG_SPECIALINFO = 0x0010,
- UNIT_DYNFLAG_DEAD = 0x0020
+ UNIT_DYNFLAG_DEAD = 0x0020,
+ UNIT_DYNFLAG_REFER_A_FRIEND = 0x0040
};
enum CorpseDynFlags
@@ -1922,11 +2218,14 @@ enum CorpseDynFlags
};
// Passive Spell codes explicit used in code
-#define SPELL_ID_GENERIC_LEARN 483
-#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457
-#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007
-#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119
-#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123
+#define SPELL_ID_GENERIC_LEARN 483
+#define SPELL_ID_GENERIC_LEARN_PET 55884 // used for learning mounts and companions
+#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457
+#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007
+#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119
+#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123
+#define SPELL_ID_AUTOSHOT 75 // used for checks in other spells interruption
+#define SPELL_ID_SHADOWMELD 58984 // used for check ignore stealth stance state
enum WeatherType
{
@@ -1990,9 +2289,12 @@ enum ChatMsg
CHAT_MSG_BATTLEGROUND = 0x2C,
CHAT_MSG_BATTLEGROUND_LEADER = 0x2D,
CHAT_MSG_RESTRICTED = 0x2E,
+ CHAT_MSG_BN = 0x2F,
+ CHAT_MSG_ACHIEVEMENT = 0x30,
+ CHAT_MSG_GUILD_ACHIEVEMENT = 0x31
};
-#define MAX_CHAT_MSG_TYPE 0x2F
+#define MAX_CHAT_MSG_TYPE 0x32
// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.petDietMask
enum PetDiet
@@ -2072,27 +2374,45 @@ enum DungeonDifficulties
TOTAL_DIFFICULTIES
};
+enum SummonCategory
+{
+ SUMMON_CATEGORY_WILD = 0,
+ SUMMON_CATEGORY_ALLY = 1,
+ SUMMON_CATEGORY_PET = 2,
+ SUMMON_CATEGORY_POSSESSED = 3,
+ SUMMON_CATEGORY_VEHICLE = 4,
+};
+
enum SummonType
{
+ SUMMON_TYPE_NONE = 0,
+ SUMMON_TYPE_PET = 1,
+ SUMMON_TYPE_GUARDIAN = 2,
+ SUMMON_TYPE_MINION = 3,
+ SUMMON_TYPE_TOTEM = 4,
+ SUMMON_TYPE_MINIPET = 5,
+ SUMMON_TYPE_GUARDIAN2 = 6,
+ SUMMON_TYPE_WILD2 = 7,
+ SUMMON_TYPE_WILD3 = 8,
+ SUMMON_TYPE_WILD4 = 9,
+ SUMMON_TYPE_VEHICLE = 10,
+ SUMMON_TYPE_OBJECT = 11,
+
SUMMON_TYPE_CRITTER = 41,
- SUMMON_TYPE_GUARDIAN = 61,
- SUMMON_TYPE_TOTEM_SLOT1 = 63,
+ //SUMMON_TYPE_GUARDIAN = 61,
SUMMON_TYPE_WILD = 64,
- SUMMON_TYPE_POSESSED = 65,
SUMMON_TYPE_DEMON = 66,
SUMMON_TYPE_SUMMON = 67,
- SUMMON_TYPE_TOTEM_SLOT2 = 81,
- SUMMON_TYPE_TOTEM_SLOT3 = 82,
- SUMMON_TYPE_TOTEM_SLOT4 = 83,
- SUMMON_TYPE_TOTEM = 121,
SUMMON_TYPE_UNKNOWN3 = 181,
SUMMON_TYPE_UNKNOWN4 = 187,
SUMMON_TYPE_UNKNOWN1 = 247,
SUMMON_TYPE_CRITTER2 = 407,
SUMMON_TYPE_CRITTER3 = 307,
SUMMON_TYPE_UNKNOWN5 = 409,
- SUMMON_TYPE_POSESSED3 = 427,
- SUMMON_TYPE_POSESSED2 = 428
+ SUMMON_TYPE_FROZEN_EARTH = 429,
+ SUMMON_TYPE_FORCE_OF_NATURE = 669,
+ SUMMON_TYPE_LIGHTWELL = 1141,
+ SUMMON_TYPE_FERAL_SPIRIT = 1161
};
enum ResponseCodes
@@ -2161,42 +2481,45 @@ enum ResponseCodes
CHAR_CREATE_SERVER_QUEUE = 0x37,
CHAR_CREATE_ONLY_EXISTING = 0x38,
CHAR_CREATE_EXPANSION = 0x39,
-
- CHAR_DELETE_IN_PROGRESS = 0x3A,
- CHAR_DELETE_SUCCESS = 0x3B,
- CHAR_DELETE_FAILED = 0x3C,
- CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x3D,
- CHAR_DELETE_FAILED_GUILD_LEADER = 0x3E,
- CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x3F,
-
- CHAR_LOGIN_IN_PROGRESS = 0x40,
- CHAR_LOGIN_SUCCESS = 0x41,
- CHAR_LOGIN_NO_WORLD = 0x42,
- CHAR_LOGIN_DUPLICATE_CHARACTER = 0x43,
- CHAR_LOGIN_NO_INSTANCES = 0x44,
- CHAR_LOGIN_FAILED = 0x45,
- CHAR_LOGIN_DISABLED = 0x46,
- CHAR_LOGIN_NO_CHARACTER = 0x47,
- CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x48,
- CHAR_LOGIN_LOCKED_BY_BILLING = 0x49,
-
- CHAR_NAME_SUCCESS = 0x4A,
- CHAR_NAME_FAILURE = 0x4B,
- CHAR_NAME_NO_NAME = 0x4C,
- CHAR_NAME_TOO_SHORT = 0x4D,
- CHAR_NAME_TOO_LONG = 0x4E,
- CHAR_NAME_INVALID_CHARACTER = 0x4F,
- CHAR_NAME_MIXED_LANGUAGES = 0x50,
- CHAR_NAME_PROFANE = 0x51,
- CHAR_NAME_RESERVED = 0x52,
- CHAR_NAME_INVALID_APOSTROPHE = 0x53,
- CHAR_NAME_MULTIPLE_APOSTROPHES = 0x54,
- CHAR_NAME_THREE_CONSECUTIVE = 0x55,
- CHAR_NAME_INVALID_SPACE = 0x56,
- CHAR_NAME_CONSECUTIVE_SPACES = 0x57,
- CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x58,
- CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x59,
- CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x5A,
+ CHAR_CREATE_EXPANSION_CLASS = 0x3A,
+ CHAR_CREATE_LEVEL_REQUIREMENT = 0x3B,
+ CHAR_CREATE_UNIQUE_CLASS_LIMIT = 0x3C,
+
+ CHAR_DELETE_IN_PROGRESS = 0x3D,
+ CHAR_DELETE_SUCCESS = 0x3E,
+ CHAR_DELETE_FAILED = 0x3F,
+ CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x40,
+ CHAR_DELETE_FAILED_GUILD_LEADER = 0x41,
+ CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x42,
+
+ CHAR_LOGIN_IN_PROGRESS = 0x43,
+ CHAR_LOGIN_SUCCESS = 0x44,
+ CHAR_LOGIN_NO_WORLD = 0x45,
+ CHAR_LOGIN_DUPLICATE_CHARACTER = 0x46,
+ CHAR_LOGIN_NO_INSTANCES = 0x47,
+ CHAR_LOGIN_FAILED = 0x48,
+ CHAR_LOGIN_DISABLED = 0x49,
+ CHAR_LOGIN_NO_CHARACTER = 0x4A,
+ CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x4B,
+ CHAR_LOGIN_LOCKED_BY_BILLING = 0x4C,
+
+ CHAR_NAME_SUCCESS = 0x4D,
+ CHAR_NAME_FAILURE = 0x4E,
+ CHAR_NAME_NO_NAME = 0x4F,
+ CHAR_NAME_TOO_SHORT = 0x50,
+ CHAR_NAME_TOO_LONG = 0x51,
+ CHAR_NAME_INVALID_CHARACTER = 0x52,
+ CHAR_NAME_MIXED_LANGUAGES = 0x53,
+ CHAR_NAME_PROFANE = 0x54,
+ CHAR_NAME_RESERVED = 0x55,
+ CHAR_NAME_INVALID_APOSTROPHE = 0x56,
+ CHAR_NAME_MULTIPLE_APOSTROPHES = 0x57,
+ CHAR_NAME_THREE_CONSECUTIVE = 0x58,
+ CHAR_NAME_INVALID_SPACE = 0x59,
+ CHAR_NAME_CONSECUTIVE_SPACES = 0x5A,
+ CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x5B,
+ CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x5C,
+ CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x5D
};
/// Ban function modes
@@ -2214,5 +2537,24 @@ enum BanReturn
BAN_SYNTAX_ERROR,
BAN_NOTFOUND
};
+
+// indexes of BattlemasterList.dbc
+enum BattleGroundTypeId
+{
+ BATTLEGROUND_TYPE_NONE = 0,
+ BATTLEGROUND_AV = 1,
+ BATTLEGROUND_WS = 2,
+ BATTLEGROUND_AB = 3,
+ BATTLEGROUND_NA = 4,
+ BATTLEGROUND_BE = 5,
+ BATTLEGROUND_AA = 6,
+ BATTLEGROUND_EY = 7,
+ BATTLEGROUND_RL = 8,
+ BATTLEGROUND_SA = 9,
+ BATTLEGROUND_DS = 10,
+ BATTLEGROUND_RV = 11
+};
+#define MAX_BATTLEGROUND_TYPE_ID 12
+
#endif
diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp
index 5a5869047a5..0fbaeb0fbaf 100644
--- a/src/game/SkillDiscovery.cpp
+++ b/src/game/SkillDiscovery.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
#include "Log.h"
#include "ProgressBar.h"
#include "Policies/SingletonImp.h"
-#include "ObjectAccessor.h"
#include "World.h"
#include "Util.h"
#include "SkillDiscovery.h"
@@ -31,14 +30,15 @@
struct SkillDiscoveryEntry
{
- uint32 spellId;
- float chance;
+ uint32 spellId; // discavered spell
+ uint32 reqSkillValue; // skill level limitation
+ float chance; // chance
SkillDiscoveryEntry()
- : spellId(0), chance(0) {}
+ : spellId(0), reqSkillValue(0), chance(0) {}
- SkillDiscoveryEntry(uint16 _spellId, float _chance)
- : spellId(_spellId), chance(_chance) {}
+ SkillDiscoveryEntry(uint16 _spellId, uint32 req_skill_val, float _chance)
+ : spellId(_spellId), reqSkillValue(req_skill_val), chance(_chance) {}
};
typedef std::list<SkillDiscoveryEntry> SkillDiscoveryList;
@@ -53,8 +53,8 @@ void LoadSkillDiscoveryTable()
uint32 count = 0;
- // 0 1 2
- QueryResult *result = WorldDatabase.Query("SELECT spellId, reqSpell, chance FROM skill_discovery_template");
+ // 0 1 2 3
+ QueryResult *result = WorldDatabase.Query("SELECT spellId, reqSpell, reqSkillValue, chance FROM skill_discovery_template");
if (result)
{
@@ -69,11 +69,13 @@ void LoadSkillDiscoveryTable()
uint32 spellId = fields[0].GetUInt32();
int32 reqSkillOrSpell = fields[1].GetInt32();
- float chance = fields[2].GetFloat();
+ uint32 reqSkillValue = fields[2].GetInt32();
+ float chance = fields[3].GetFloat();
if( chance <= 0 ) // chance
{
- ssNonDiscoverableEntries << "spellId = " << spellId << " reqSkillOrSpell = " << reqSkillOrSpell << " chance = " << chance << "\n";
+ ssNonDiscoverableEntries << "spellId = " << spellId << " reqSkillOrSpell = " << reqSkillOrSpell
+ << " reqSkillValue = " << reqSkillValue << " chance = " << chance << "(chance problem)\n";
continue;
}
@@ -86,13 +88,16 @@ void LoadSkillDiscoveryTable()
continue;
}
- if( spellEntry->Mechanic != MECHANIC_DISCOVERY )
+ // mechanic discovery
+ if (spellEntry->Mechanic != MECHANIC_DISCOVERY &&
+ // explicit discovery ability
+ !IsExplicitDiscoverySpell(spellEntry))
{
- sLog.outErrorDb("Spell (ID: %u) not have have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc but listed in `skill_discovery_template` table",spellId);
+ sLog.outErrorDb("Spell (ID: %u) not have have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc and not 100% chance random discovery ability but listed in `skill_discovery_template` table",spellId);
continue;
}
- SkillDiscoveryStore[reqSkillOrSpell].push_back( SkillDiscoveryEntry(spellId, chance) );
+ SkillDiscoveryStore[reqSkillOrSpell].push_back( SkillDiscoveryEntry(spellId, reqSkillValue, chance) );
}
else if( reqSkillOrSpell == 0 ) // skill case
{
@@ -107,7 +112,7 @@ void LoadSkillDiscoveryTable()
for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
{
- SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back( SkillDiscoveryEntry(spellId, chance) );
+ SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back( SkillDiscoveryEntry(spellId, reqSkillValue, chance) );
}
}
else
@@ -115,6 +120,7 @@ void LoadSkillDiscoveryTable()
sLog.outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table",spellId);
continue;
}
+
++count;
} while (result->NextRow());
@@ -132,8 +138,48 @@ void LoadSkillDiscoveryTable()
}
}
+uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
+{
+ // explicit discovery spell chances (always success if case exist)
+ // in this case we have both skill and spell
+ SkillDiscoveryMap::iterator tab = SkillDiscoveryStore.find(spellId);
+ if(tab == SkillDiscoveryStore.end())
+ return 0;
+
+ SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spellId);
+ SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spellId);
+ uint32 skillvalue = lower != upper ? player->GetSkillValue(lower->second->skillId) : 0;
+
+ float full_chance = 0;
+ for(SkillDiscoveryList::iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
+ if(item_iter->reqSkillValue <= skillvalue)
+ if(!player->HasSpell(item_iter->spellId))
+ full_chance += item_iter->chance;
+
+ float rate = full_chance / 100.0f;
+ float roll = rand_chance() * rate; // roll now in range 0..full_chance
+
+ for(SkillDiscoveryList::iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
+ {
+ if(item_iter->reqSkillValue > skillvalue)
+ continue;
+
+ if(player->HasSpell(item_iter->spellId))
+ continue;
+
+ if(item_iter->chance > roll)
+ return item_iter->spellId;
+
+ roll -= item_iter->chance;
+ }
+
+ return 0;
+}
+
uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
{
+ uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : 0;
+
// check spell case
SkillDiscoveryMap::iterator tab = SkillDiscoveryStore.find(spellId);
@@ -142,6 +188,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
for(SkillDiscoveryList::iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
{
if( roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY))
+ && item_iter->reqSkillValue <= skillvalue
&& !player->HasSpell(item_iter->spellId) )
return item_iter->spellId;
}
@@ -149,6 +196,9 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
return 0;
}
+ if(!skillId)
+ return 0;
+
// check skill line case
tab = SkillDiscoveryStore.find(-(int32)skillId);
if(tab != SkillDiscoveryStore.end())
@@ -156,6 +206,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
for(SkillDiscoveryList::iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
{
if( roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY))
+ && item_iter->reqSkillValue <= skillvalue
&& !player->HasSpell(item_iter->spellId) )
return item_iter->spellId;
}
diff --git a/src/game/SkillDiscovery.h b/src/game/SkillDiscovery.h
index 350062101fe..9981eb133f6 100644
--- a/src/game/SkillDiscovery.h
+++ b/src/game/SkillDiscovery.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,5 +27,6 @@ class Player;
void LoadSkillDiscoveryTable();
uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player);
+uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player);
#endif
diff --git a/src/game/SkillExtraItems.cpp b/src/game/SkillExtraItems.cpp
index d89cbbdcddf..f0061f97c00 100644
--- a/src/game/SkillExtraItems.cpp
+++ b/src/game/SkillExtraItems.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/SkillExtraItems.h b/src/game/SkillExtraItems.h
index 38684b9933a..3a44619a862 100644
--- a/src/game/SkillExtraItems.h
+++ b/src/game/SkillExtraItems.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/SkillHandler.cpp b/src/game/SkillHandler.cpp
index 973d0bf9c39..06a7317d09d 100644
--- a/src/game/SkillHandler.cpp
+++ b/src/game/SkillHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,12 +23,10 @@
#include "Opcodes.h"
#include "Log.h"
#include "Player.h"
-#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "ObjectAccessor.h"
#include "UpdateMask.h"
-#include "SpellAuras.h"
void WorldSession::HandleLearnTalentOpcode( WorldPacket & recv_data )
{
@@ -37,107 +35,7 @@ void WorldSession::HandleLearnTalentOpcode( WorldPacket & recv_data )
uint32 talent_id, requested_rank;
recv_data >> talent_id >> requested_rank;
- uint32 CurTalentPoints = GetPlayer()->GetFreeTalentPoints();
-
- if(CurTalentPoints == 0)
- return;
-
- if (requested_rank > 4)
- return;
-
- TalentEntry const *talentInfo = sTalentStore.LookupEntry( talent_id );
-
- if(!talentInfo)
- return;
-
- TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentInfo->TalentTab );
-
- if(!talentTabInfo)
- return;
-
- Player * player = GetPlayer();
-
- // prevent learn talent for different class (cheating)
- if( (player->getClassMask() & talentTabInfo->ClassMask) == 0 )
- return;
-
- // prevent skip talent ranks (cheating)
- if(requested_rank > 0 && !player->HasSpell(talentInfo->RankID[requested_rank-1]))
- return;
-
- // Check if it requires another talent
- if (talentInfo->DependsOn > 0)
- {
- if(TalentEntry const *depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
- {
- bool hasEnoughRank = false;
- for (int i = talentInfo->DependsOnRank; i <= 4; i++)
- {
- if (depTalentInfo->RankID[i] != 0)
- if (player->HasSpell(depTalentInfo->RankID[i]))
- hasEnoughRank = true;
- }
- if (!hasEnoughRank)
- return;
- }
- }
-
- // Check if it requires spell
- if( talentInfo->DependsOnSpell && !player->HasSpell(talentInfo->DependsOnSpell) )
- return;
-
- // Find out how many points we have in this field
- uint32 spentPoints = 0;
-
- uint32 tTab = talentInfo->TalentTab;
- if (talentInfo->Row > 0)
- {
- unsigned int numRows = sTalentStore.GetNumRows();
- for (unsigned int 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
- {
- if (tmpTalent->TalentTab == tTab)
- {
- for (int j = 0; j <= 4; j++)
- {
- if (tmpTalent->RankID[j] != 0)
- {
- if (player->HasSpell(tmpTalent->RankID[j]))
- {
- spentPoints += j + 1;
- }
- }
- }
- }
- }
- }
- }
-
- // not have required min points spent in talent tree
- if(spentPoints < (talentInfo->Row * 5))
- return;
-
- // spell not set in talent.dbc
- uint32 spellid = talentInfo->RankID[requested_rank];
- if( spellid == 0 )
- {
- sLog.outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talent_id, requested_rank);
- return;
- }
-
- // already known
- if(GetPlayer( )->HasSpell(spellid))
- return;
-
- // learn! (other talent ranks will unlearned at learning)
- GetPlayer( )->learnSpell(spellid);
- sLog.outDetail("TalentID: %u Rank: %u Spell: %u\n", talent_id, requested_rank, spellid);
-
- // update free talent points
- GetPlayer()->SetFreeTalentPoints(CurTalentPoints - 1);
+ _player->LearnTalent(talent_id, requested_rank);
}
void WorldSession::HandleTalentWipeOpcode( WorldPacket & recv_data )
@@ -157,7 +55,7 @@ void WorldSession::HandleTalentWipeOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!(_player->resetTalents()))
{
diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp
index a0338f4abb1..529517d824a 100644
--- a/src/game/SocialMgr.cpp
+++ b/src/game/SocialMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
#include "Database/DatabaseEnv.h"
#include "Opcodes.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "World.h"
@@ -182,13 +181,6 @@ SocialMgr::~SocialMgr()
}
-void SocialMgr::RemovePlayerSocial(uint32 guid)
-{
- SocialMap::iterator itr = m_socialMap.find(guid);
- if(itr != m_socialMap.end())
- m_socialMap.erase(itr);
-}
-
void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &friendInfo)
{
if(!player)
@@ -197,7 +189,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
if(!pFriend)
- return;
+ return;
uint32 team = player->GetTeam();
uint32 security = player->GetSession()->GetSecurity();
@@ -285,7 +277,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
for(SocialMap::iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
{
- PlayerSocialMap::iterator itr2 = itr->second.m_playerSocialMap.find(guid);
+ PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(guid);
if(itr2 != itr->second.m_playerSocialMap.end() && (itr2->second.Flags & SOCIAL_FLAG_FRIEND))
{
Player *pFriend = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER));
diff --git a/src/game/SocialMgr.h b/src/game/SocialMgr.h
index f5bf3c8600c..1ca04d69707 100644
--- a/src/game/SocialMgr.h
+++ b/src/game/SocialMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -143,7 +143,8 @@ class SocialMgr
SocialMgr();
~SocialMgr();
// Misc
- void RemovePlayerSocial(uint32 guid);
+ void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
+
void GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &friendInfo);
// Packet management
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket *data);
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index ee9855dea09..cea770e0924 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +35,6 @@
#include "Unit.h"
#include "Spell.h"
#include "DynamicObject.h"
-#include "SpellAuras.h"
#include "Group.h"
#include "UpdateData.h"
#include "MapManager.h"
@@ -43,14 +42,13 @@
#include "CellImpl.h"
#include "Policies/SingletonImp.h"
#include "SharedDefines.h"
-#include "Tools.h"
#include "LootMgr.h"
#include "VMapFactory.h"
#include "BattleGround.h"
#include "Util.h"
#include "TemporarySummon.h"
-#define SPELL_CHANNEL_UPDATE_INTERVAL 1000
+#define SPELL_CHANNEL_UPDATE_INTERVAL (1*IN_MILISECONDS)
extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS];
@@ -120,6 +118,14 @@ void SpellCastTargets::setDestination(Unit *target, bool send)
m_targetMask |= TARGET_FLAG_DEST_LOCATION;
}
+void SpellCastTargets::setSource(float x, float y, float z)
+{
+ m_srcX = x;
+ m_srcY = y;
+ m_srcZ = z;
+ m_targetMask |= TARGET_FLAG_SOURCE_LOCATION;
+}
+
void SpellCastTargets::setGOTarget(GameObject *target)
{
m_GOTarget = target;
@@ -171,6 +177,8 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
if(data->rpos()+4 > data->size())
return false;
+ //data->hexlike();
+
*data >> m_targetMask;
sLog.outDebug("Spell read, target mask = %u", m_targetMask);
@@ -178,19 +186,23 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
return true;
// TARGET_FLAG_UNK2 is used for non-combat pets, maybe other?
- if( m_targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2) )
- if(!readGUID(*data, m_unitTargetGUID))
+ if( m_targetMask & ( TARGET_FLAG_UNIT | TARGET_FLAG_UNK2 ))
+ if(!data->readPackGUID(m_unitTargetGUID))
return false;
- if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK ))
- if(!readGUID(*data, m_GOTargetGUID))
+ if( m_targetMask & ( TARGET_FLAG_OBJECT ))
+ if(!data->readPackGUID(m_GOTargetGUID))
return false;
if(( m_targetMask & ( TARGET_FLAG_ITEM | TARGET_FLAG_TRADE_ITEM )) && caster->GetTypeId() == TYPEID_PLAYER)
- if(!readGUID(*data, m_itemTargetGUID))
+ if(!data->readPackGUID(m_itemTargetGUID))
+ return false;
+
+ if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) )
+ if(!data->readPackGUID(m_CorpseTargetGUID))
return false;
- /*if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION )
+ if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION )
{
if(data->rpos()+4+4+4 > data->size())
return false;
@@ -198,17 +210,23 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
*data >> m_srcX >> m_srcY >> m_srcZ;
if(!Trinity::IsValidMapCoord(m_srcX, m_srcY, m_srcZ))
return false;
- }*/
- if( m_targetMask & (TARGET_FLAG_SOURCE_LOCATION | TARGET_FLAG_DEST_LOCATION) )
+ m_hasDest = true;
+ }
+
+ if( m_targetMask & TARGET_FLAG_DEST_LOCATION )
{
- if(data->rpos()+4+4+4 > data->size())
+ if(data->rpos()+1+4+4+4 > data->size())
+ return false;
+
+ if(!data->readPackGUID(m_unitTargetGUID))
return false;
*data >> m_destX >> m_destY >> m_destZ;
- m_hasDest = true;
if(!Trinity::IsValidMapCoord(m_destX, m_destY, m_destZ))
return false;
+
+ m_hasDest = true;
}
if( m_targetMask & TARGET_FLAG_STRING )
@@ -219,10 +237,6 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
*data >> m_strTarget;
}
- if( m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE ) )
- if(!readGUID(*data, m_CorpseTargetGUID))
- return false;
-
// find real units/GOs
Update(caster);
return true;
@@ -242,7 +256,7 @@ void SpellCastTargets::write ( WorldPacket * data )
else
*data << uint8(0);
}
- else if( m_targetMask & ( TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_UNK ) )
+ else if( m_targetMask & TARGET_FLAG_OBJECT )
{
if(m_GOTarget)
data->append(m_GOTarget->GetPackGUID());
@@ -267,7 +281,14 @@ void SpellCastTargets::write ( WorldPacket * data )
*data << m_srcX << m_srcY << m_srcZ;
if( m_targetMask & TARGET_FLAG_DEST_LOCATION )
+ {
+ if(m_unitTarget)
+ data->append(m_unitTarget->GetPackGUID());
+ else
+ *data << uint8(0);
+
*data << m_destX << m_destY << m_destZ;
+ }
if( m_targetMask & TARGET_FLAG_STRING )
*data << m_strTarget;
@@ -286,6 +307,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
m_triggeringContainer = triggeringContainer;
m_referencedFromCurrentSpell = false;
m_executedCurrently = false;
+ m_needComboPoints = NeedsComboPoints(m_spellInfo);
m_delayStart = 0;
m_delayAtDamageCount = 0;
@@ -305,7 +327,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
break;
default:
// Wands
- if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_WAND)
+ if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)
m_attackType = RANGED_ATTACK;
else
m_attackType = BASE_ATTACK;
@@ -320,7 +342,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
if((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId()==TYPEID_PLAYER)
{
if(Item* pItem = ((Player*)m_caster)->GetWeaponForAttack(RANGED_ATTACK))
- m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetProto()->Damage->DamageType);
+ m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetProto()->Damage[0].DamageType);
}
}
// Set health leech amount to zero
@@ -355,14 +377,15 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
gameObjTarget = NULL;
focusObject = NULL;
m_cast_count = 0;
+ m_glyphIndex = 0;
+ m_preCastSpell = 0;
m_triggeredByAuraSpell = NULL;
+ m_spellAura = NULL;
- //Auto Shot & Shoot
- if( m_spellInfo->AttributesEx2 == 0x000020 && !triggered )
- m_autoRepeat = true;
- else
- m_autoRepeat = false;
+ //Auto Shot & Shoot (wand)
+ m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo);
+ m_runesState = 0;
m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_timer = 0; // will set to castime in prepare
@@ -372,7 +395,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
// determine reflection
m_canReflect = false;
- if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && (m_spellInfo->AttributesEx2 & 0x4)==0)
+ if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
{
for(int j=0;j<3;j++)
{
@@ -457,11 +480,11 @@ void Spell::FillTargetMap()
{
// non-standard target selection
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
- float max_range = GetSpellMaxRange(srange);
+ float max_range = GetSpellMaxRangeForHostile(srange);
WorldObject* result = NULL;
Trinity::CannibalizeObjectCheck u_check(m_caster, max_range);
- Trinity::WorldObjectSearcher<Trinity::CannibalizeObjectCheck > searcher(result, u_check);
+ Trinity::WorldObjectSearcher<Trinity::CannibalizeObjectCheck > searcher(m_caster, result, u_check);
m_caster->VisitNearbyGridObject(max_range, searcher);
if(!result)
m_caster->VisitNearbyWorldObject(max_range, searcher);
@@ -511,12 +534,15 @@ void Spell::FillTargetMap()
case SPELL_EFFECT_CREATE_ITEM:
case SPELL_EFFECT_TRIGGER_SPELL:
case SPELL_EFFECT_SKILL_STEP:
+ case SPELL_EFFECT_PROFICIENCY:
+ case SPELL_EFFECT_SUMMON_OBJECT_WILD:
case SPELL_EFFECT_SELF_RESURRECT:
case SPELL_EFFECT_REPUTATION:
case SPELL_EFFECT_LEARN_SPELL:
if(m_targets.getUnitTarget())
tmpUnitMap.push_back(m_targets.getUnitTarget());
- else
+ // Triggered spells have additional spell targets - cast them even if no explicit unit target is given (required for spell 50516 for example)
+ else if(m_spellInfo->Effect[i] == SPELL_EFFECT_TRIGGER_SPELL)
tmpUnitMap.push_back(m_caster);
break;
case SPELL_EFFECT_SUMMON_PLAYER:
@@ -543,19 +569,22 @@ void Spell::FillTargetMap()
break;
case SPELL_EFFECT_SUMMON_CHANGE_ITEM:
case SPELL_EFFECT_ADD_FARSIGHT:
+ case SPELL_EFFECT_APPLY_GLYPH:
case SPELL_EFFECT_STUCK:
+ case SPELL_EFFECT_FEED_PET:
case SPELL_EFFECT_DESTROY_ALL_TOTEMS:
tmpUnitMap.push_back(m_caster);
break;
case SPELL_EFFECT_LEARN_PET_SPELL:
- if(Pet* pet = m_caster->GetPet())
+ if(Guardian* pet = m_caster->GetGuardianPet())
tmpUnitMap.push_back(pet);
break;
/*case SPELL_EFFECT_ENCHANT_ITEM:
case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY:
+ case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
case SPELL_EFFECT_DISENCHANT:
- case SPELL_EFFECT_FEED_PET:
case SPELL_EFFECT_PROSPECTING:
+ case SPELL_EFFECT_MILLING:
if(m_targets.getItemTarget())
AddItemTarget(m_targets.getItemTarget(), i);
break;*/
@@ -596,13 +625,12 @@ void Spell::FillTargetMap()
}
}
-
if(IsChanneledSpell(m_spellInfo) && !tmpUnitMap.empty())
m_needAliveTargetMask |= (1<<i);
for (std::list<Unit*>::iterator itr = tmpUnitMap.begin() ; itr != tmpUnitMap.end();)
{
- if(!CheckTarget(*itr, i, false ))
+ if(!CheckTarget(*itr, i))
{
itr = tmpUnitMap.erase(itr);
continue;
@@ -633,37 +661,43 @@ void Spell::prepareDataForTriggerSystem()
// Ñan spell trigger another or not ( m_canTrigger )
// Create base triggers flags for Attacker and Victim ( m_procAttacker and m_procVictim)
//==========================================================================================
-
// Fill flag can spell trigger or not
- if (!m_IsTriggeredSpell)
+ // TODO: possible exist spell attribute for this
+ m_canTrigger = false;
+
+ if (m_CastItem)
+ m_canTrigger = false; // Do not trigger from item cast spell
+ else if (!m_IsTriggeredSpell)
m_canTrigger = true; // Normal cast - can trigger
else if (!m_triggeredByAuraSpell)
m_canTrigger = true; // Triggered from SPELL_EFFECT_TRIGGER_SPELL - can trigger
- else // Exceptions (some periodic triggers)
+
+ if (!m_canTrigger) // Exceptions (some periodic triggers)
{
- m_canTrigger = false; // Triggered spells can`t trigger another
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
- if (m_spellInfo->SpellFamilyFlags & 0x0000000000200080LL) m_canTrigger = true;
+ if (m_spellInfo->SpellFamilyFlags[0] & 0x200080) m_canTrigger = true;
break;
case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it
- if (m_spellInfo->SpellFamilyFlags & 0x0000800000000060LL) m_canTrigger = true;
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00008000 || m_spellInfo->SpellFamilyFlags[0] & 0x00000060) m_canTrigger = true;
+ break;
+ case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00018000) m_canTrigger = true;
break;
- case SPELLFAMILY_HUNTER: // Hunter Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect
- if (m_spellInfo->SpellFamilyFlags & 0x0000200000000014LL) m_canTrigger = true;
+ case SPELLFAMILY_ROGUE: // For poisons need do it
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00000010 || m_spellInfo->SpellFamilyFlags[0] & 0x1001E000) m_canTrigger = true;
break;
- case SPELLFAMILY_PALADIN: // For Holy Shock triggers need do it
- if (m_spellInfo->SpellFamilyFlags & 0x0001000000200000LL) m_canTrigger = true;
+ case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x01002000
+ || m_spellInfo->SpellFamilyFlags[0] & 0x00000214 ||
+ m_spellInfo->SpellFamilyFlags[2] & 0x200) m_canTrigger = true;
break;
- case SPELLFAMILY_ROGUE: // mutilate mainhand + offhand
- if (m_spellInfo->SpellFamilyFlags & 0x600000000LL) m_canTrigger = true;
+ case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00010009 || m_spellInfo->SpellFamilyFlags[0] & 0x00B80400) m_canTrigger = true;
break;
}
}
- // Do not trigger from item cast spell
- if (m_CastItem)
- m_canTrigger = false;
// Get data for type of attack and fill base info for trigger
switch (m_spellInfo->DmgClass)
@@ -673,21 +707,30 @@ void Spell::prepareDataForTriggerSystem()
m_procVictim = PROC_FLAG_TAKEN_MELEE_SPELL_HIT;
break;
case SPELL_DAMAGE_CLASS_RANGED:
- m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT;
- m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT;
+ // Auto attack
+ if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)
+ {
+ m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT;
+ m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT;
+ }
+ else // Ranged spell attack
+ {
+ m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT;
+ m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT;
+ }
break;
default:
- if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
+ if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL;
m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL;
}
- else if (m_spellInfo->Id == 5019) // Wands
+ else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack
{
- m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT;
- m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT;
+ m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT;
+ m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT;
}
- else
+ else // Negative spell
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT;
m_procVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT;
@@ -696,7 +739,7 @@ void Spell::prepareDataForTriggerSystem()
}
// Hunter traps spells (for Entrapment trigger)
// Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap ....
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->SpellFamilyFlags & 0x0000200000000014LL)
+ if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags[1] & 0x00002000 || m_spellInfo->SpellFamilyFlags[0] & 0x1C))
m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION;
}
@@ -705,8 +748,6 @@ void Spell::CleanupTargetList()
m_UniqueTargetInfo.clear();
m_UniqueGOTargetInfo.clear();
m_UniqueItemInfo.clear();
- m_countOfHit = 0;
- m_countOfMiss = 0;
m_delayMoment = 0;
}
@@ -715,6 +756,9 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
if( m_spellInfo->Effect[effIndex]==0 )
return;
+ // Check for effect immune skip if immuned
+ bool immuned = pVictim->IsImmunedToSpellEffect(m_spellInfo, effIndex);
+
uint64 targetGUID = pVictim->GetGUID();
// Lookup target in already in list
@@ -722,7 +766,8 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
{
if (targetGUID == ihit->targetGUID) // Found in list
{
- ihit->effectMask |= 1<<effIndex; // Add only effect mask
+ if (!immuned)
+ ihit->effectMask |= 1<<effIndex; // Add only effect mask if not immuned
return;
}
}
@@ -732,7 +777,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
// Get spell hit result on target
TargetInfo target;
target.targetGUID = targetGUID; // Store target GUID
- target.effectMask = 1<<effIndex; // Store index of effect
+ target.effectMask = immuned ? 0 : 1<<effIndex; // Store index of effect if not immuned
target.processed = false; // Effects not apply on target
target.damage = 0;
@@ -746,11 +791,6 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
else
target.missCondition = SPELL_MISS_EVADE; //SPELL_MISS_NONE;
- if (target.missCondition == SPELL_MISS_NONE)
- ++m_countOfHit;
- else
- ++m_countOfMiss;
-
// Spell have speed - need calculate incoming time
if (m_spellInfo->speed > 0.0f)
{
@@ -831,8 +871,6 @@ void Spell::AddGOTarget(GameObject* pVictim, uint32 effIndex)
else
target.timeDelay = 0LL;
- ++m_countOfHit;
-
// Add target to list
m_UniqueGOTargetInfo.push_back(target);
}
@@ -866,83 +904,6 @@ void Spell::AddItemTarget(Item* pitem, uint32 effIndex)
target.effectMask = 1<<effIndex;
m_UniqueItemInfo.push_back(target);
}
-/*
-void Spell::doTriggers(SpellMissInfo missInfo, uint32 damage, SpellSchoolMask damageSchoolMask, uint32 block, uint32 absorb, bool crit)
-{
- // Do triggers depends from hit result (triggers on hit do in effects)
- // Set aura states depends from hit result
- if (missInfo!=SPELL_MISS_NONE)
- {
- // Miss/dodge/parry/block only for melee based spells
- // Resist only for magic based spells
- switch (missInfo)
- {
- case SPELL_MISS_MISS:
- if(m_caster->GetTypeId()== TYPEID_PLAYER)
- ((Player*)m_caster)->UpdateWeaponSkill(BASE_ATTACK);
-
- m_caster->CastMeleeProcDamageAndSpell(unitTarget, 0, damageSchoolMask, m_attackType, MELEE_HIT_MISS, m_spellInfo, m_IsTriggeredSpell);
- break;
- case SPELL_MISS_RESIST:
- m_caster->ProcDamageAndSpell(unitTarget, PROC_FLAG_TARGET_RESISTS, PROC_FLAG_RESIST_SPELL, 0, damageSchoolMask, m_spellInfo, m_IsTriggeredSpell);
- break;
- case SPELL_MISS_DODGE:
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->UpdateDefense();
-
- // Overpower
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARRIOR)
- {
- ((Player*) m_caster)->AddComboPoints(unitTarget, 1);
- m_caster->StartReactiveTimer( REACTIVE_OVERPOWER );
- }
-
- // Riposte
- if (unitTarget->getClass() != CLASS_ROGUE)
- {
- unitTarget->ModifyAuraState(AURA_STATE_DEFENSE, true);
- unitTarget->StartReactiveTimer( REACTIVE_DEFENSE );
- }
-
- m_caster->CastMeleeProcDamageAndSpell(unitTarget, 0, damageSchoolMask, m_attackType, MELEE_HIT_DODGE, m_spellInfo, m_IsTriggeredSpell);
- break;
- case SPELL_MISS_PARRY:
- // Update victim defense ?
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->UpdateDefense();
- // Mongoose bite - set only Counterattack here
- if (unitTarget->getClass() == CLASS_HUNTER)
- {
- unitTarget->ModifyAuraState(AURA_STATE_HUNTER_PARRY,true);
- unitTarget->StartReactiveTimer( REACTIVE_HUNTER_PARRY );
- }
- else
- {
- unitTarget->ModifyAuraState(AURA_STATE_DEFENSE, true);
- unitTarget->StartReactiveTimer( REACTIVE_DEFENSE );
- }
- m_caster->CastMeleeProcDamageAndSpell(unitTarget, 0, damageSchoolMask, m_attackType, MELEE_HIT_PARRY, m_spellInfo, m_IsTriggeredSpell);
- break;
- case SPELL_MISS_BLOCK:
- unitTarget->ModifyAuraState(AURA_STATE_DEFENSE, true);
- unitTarget->StartReactiveTimer( REACTIVE_DEFENSE );
-
- m_caster->CastMeleeProcDamageAndSpell(unitTarget, 0, damageSchoolMask, m_attackType, MELEE_HIT_BLOCK, m_spellInfo, m_IsTriggeredSpell);
- break;
- // Trigger from this events not supported
- case SPELL_MISS_EVADE:
- case SPELL_MISS_IMMUNE:
- case SPELL_MISS_IMMUNE2:
- case SPELL_MISS_DEFLECT:
- case SPELL_MISS_ABSORB:
- // Trigger from reflects need do after get reflect result
- case SPELL_MISS_REFLECT:
- break;
- default:
- break;
- }
- }
-}*/
void Spell::DoAllEffectOnTarget(TargetInfo *target)
{
@@ -952,15 +913,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// Get mask of effects for target
uint32 mask = target->effectMask;
- if (mask == 0) // No effects
- return;
Unit* unit = m_caster->GetGUID()==target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster,target->targetGUID);
if (!unit)
return;
// Get original caster (if exist) and calculate damage/healing from him data
- Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster;
+ Unit *caster = m_originalCaster ? m_originalCaster : m_caster;
// Skip if m_originalCaster not avaiable
if (!caster)
@@ -980,6 +939,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
uint32 procAttacker = m_procAttacker;
uint32 procVictim = m_procVictim;
uint32 procEx = PROC_EX_NONE;
+ m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
DoSpellHitOnUnit(unit, mask);
@@ -988,6 +948,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
DoSpellHitOnUnit(m_caster, mask);
}
+ // Do not take combo points on dodge
+ if (m_needComboPoints && m_targets.getUnitTargetGUID() == target->targetGUID)
+ if( missInfo != SPELL_MISS_NONE && missInfo != SPELL_MISS_MISS)
+ m_needComboPoints = false;
/*else //TODO: This is a hack. need fix
{
uint32 tempMask = 0;
@@ -1008,7 +972,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (crit)
{
procEx |= PROC_EX_CRITICAL_HIT;
- addhealth = caster->SpellCriticalBonus(m_spellInfo, addhealth, NULL);
+ addhealth = caster->SpellCriticalHealingBonus(m_spellInfo, addhealth, NULL);
}
else
procEx |= PROC_EX_NORMAL_HIT;
@@ -1019,6 +983,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);
+ if (m_spellAura)
+ m_spellAura->SetProcDamage(addhealth);
+
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
@@ -1045,46 +1012,17 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
+ if (m_spellAura)
+ m_spellAura->SetProcDamage(damageInfo.damage);
+
caster->DealSpellDamage(&damageInfo, true);
- // Shadow Word: Death - deals damage equal to damage done to caster if victim is not killed
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellFamilyFlags&0x0000000200000000LL &&
- caster != unitTarget && unitTarget->isAlive())
- {
- // Redirect damage to caster if victim Alive
- damageInfo.target = caster;
- damageInfo.absorb = 0;
- damageInfo.resist = 0;
- damageInfo.blocked = 0;
- // Send log damage message to client
- caster->SendSpellNonMeleeDamageLog(&damageInfo);
- caster->DealSpellDamage(&damageInfo, true);
- }
// Judgement of Blood
- else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags & 0x0000000800000000LL && m_spellInfo->SpellIconID==153)
+ if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[1] & 0x00000008 && m_spellInfo->SpellIconID==153)
{
int32 damagePoint = damageInfo.damage * 33 / 100;
m_caster->CastCustomSpell(m_caster, 32220, &damagePoint, NULL, NULL, true);
}
- // Bloodthirst
- else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellInfo->SpellFamilyFlags & 0x40000000000LL)
- {
- uint32 BTAura = 0;
- switch(m_spellInfo->Id)
- {
- case 23881: BTAura = 23885; break;
- case 23892: BTAura = 23886; break;
- case 23893: BTAura = 23887; break;
- case 23894: BTAura = 23888; break;
- case 25251: BTAura = 25252; break;
- case 30335: BTAura = 30339; break;
- default:
- sLog.outError("Spell::EffectSchoolDMG: Spell %u not handled in BTAura",m_spellInfo->Id);
- break;
- }
- if (BTAura)
- m_caster->CastSpell(m_caster,BTAura,true);
- }
}
// Passive spell hits/misses or active spells only misses (only triggers)
else
@@ -1108,14 +1046,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if( !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id))
{
- if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) )
+ if( !(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) )
{
m_caster->CombatStart(unit);
}
else if(m_customAttr & SPELL_ATTR_CU_AURA_CC)
{
if(!unit->IsStandState())
- unit->SetStandState(PLAYER_STATE_NONE);
+ unit->SetStandState(UNIT_STAND_STATE_STAND);
}
}
}
@@ -1128,25 +1066,37 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
// Recheck immune (only for delayed spells)
if( m_spellInfo->speed &&
!(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
- && (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) ||
- unit->IsImmunedToSpell(m_spellInfo,true) ))
+ && (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) ||
+ unit->IsImmunedToSpell(m_spellInfo)))
{
m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE);
m_damage = 0;
return;
}
+ if (unit->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id);
+ ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id);
+ }
+
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit);
+ }
+
if( m_caster != unit )
{
- if (unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
+ // Recheck UNIT_FLAG_NON_ATTACKABLE for delayed spells
+ if (m_spellInfo->speed > 0.0f &&
+ unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE) &&
+ unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
{
- if (unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- {
- m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
+ m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
m_damage = 0;
- return;
- }
+ return;
}
+
if( !m_caster->IsFriendlyTo(unit) )
{
// for delayed spells ignore not visible explicit target
@@ -1178,7 +1128,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
m_caster->SetContestedPvP();
//m_caster->UpdatePvP(true);
}
- if( unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) )
+ if( unit->isInCombat() && !(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) )
{
m_caster->SetInCombatState(unit->GetCombatTimer() > 0);
unit->getHostilRefManager().threatAssist(m_caster, 0.0f);
@@ -1196,25 +1146,68 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
unit->IncrDiminishing(m_diminishGroup);
}
- for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
+ // Apply additional spell effects to target
+ if (m_preCastSpell)
{
- if (effectMask & (1<<effectNumber))
+ // Special spell id
+ // TODO: Handle all of special spells in one place?
+ if(m_preCastSpell==61988)
+ {
+ //Cast Forbearance
+ m_caster->CastSpell(unit,25771, true, m_CastItem);
+ // Cast Avenging Wrath Marker
+ m_caster->CastSpell(unit,61987, true, m_CastItem);
+ }
+ else
+ m_caster->CastSpell(unit,m_preCastSpell, true, m_CastItem);
+ }
+
+ uint8 aura_effmask = 0;
+ for (uint8 i = 0; i < 3; ++i)
+ if (effectMask & (1<<i) && (m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(m_spellInfo->Effect[i])))
+ aura_effmask |= 1<<i;
+
+ uint8 t_effmask = effectMask & ~aura_effmask;
+ for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
+ {
+ if (t_effmask & (1<<effectNumber))
+ HandleEffects(unit,NULL,NULL,effectNumber);
+ }
+
+ if (aura_effmask)
+ {
+ Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
+ Aura * Aur= new Aura(m_spellInfo, aura_effmask, &m_currentBasePoints[0], unit, caster , m_CastItem);
+
+ if (!Aur->IsAreaAura())
{
- HandleEffects(unit,NULL,NULL,effectNumber/*,m_damageMultipliers[effectNumber]*/);
- //Only damage and heal spells need this
- /*if ( m_applyMultiplierMask & (1 << effectNumber) )
+ // Now Reduce spell duration using data received at spell hit
+ int32 duration = Aur->GetAuraMaxDuration();
+ unit->ApplyDiminishingToDuration(m_diminishGroup,duration,caster,m_diminishLevel);
+ Aur->setDiminishGroup(m_diminishGroup);
+
+ duration = caster->ModSpellDuration(m_spellInfo, unit, duration, Aur->IsPositive());
+
+ //mod duration of channeled aura by spell haste
+ if (IsChanneledSpell(m_spellInfo))
+ caster->ModSpellCastTime(m_spellInfo, duration, this);
+
+ if(duration != Aur->GetAuraMaxDuration())
{
- // Get multiplier
- float multiplier = m_spellInfo->DmgMultiplier[effectNumber];
- // Apply multiplier mods
- if(m_originalCaster)
- if(Player* modOwner = m_originalCaster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier,this);
- m_damageMultipliers[effectNumber] *= multiplier;
- }*/
+ Aur->SetAuraMaxDuration(duration);
+ Aur->SetAuraDuration(duration);
+ }
+
+ // Prayer of Mending (jump animation), we need formal caster instead original for correct animation
+ if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020))
+ m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID);
}
+ // Set aura only when successfully applied
+ if (unit->AddAura(Aur))
+ m_spellAura = Aur;
}
+ //AI functions
if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->IsAIEnabled)
((Creature*)unit)->AI()->SpellHit(m_caster, m_spellInfo);
@@ -1226,20 +1219,24 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
int _duration=0;
for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
{
+ // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
+ // set duration equal to triggering spell
if(roll_chance_i(i->second))
{
m_caster->CastSpell(unit, i->first, true);
- // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
- // set duration equal to triggering spell
- if (GetSpellDuration(i->first)==-1)
+ }
+ if (GetSpellDuration(i->first)==-1)
+ {
+ if (Aura * triggeredAur = unit->GetAura(i->first->Id, m_caster->GetGUID()))
{
// get duration from aura-only once
if (!_duration)
{
- Aura * aur = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
+ Aura * aur = unit->GetAura(m_spellInfo->Id, m_caster->GetGUID());
_duration = aur ? aur->GetAuraDuration() : -1;
}
- unit->SetAurasDurationByCasterSpell(i->first->Id, m_caster->GetGUID(), _duration);
+ triggeredAur->SetAuraDuration(_duration);
+ triggeredAur->SetPermanent(false);
}
}
}
@@ -1373,6 +1370,16 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
if(!cur)
return;
+ // Get spell max affected targets
+ /*uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
+ Unit::AuraList const& mod = m_caster->GetAurasByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
+ for(Unit::AuraList::const_iterator m = mod.begin(); m != mod.end(); ++m)
+ {
+ if (!(*m)->isAffectedOnSpell(m_spellInfo))
+ continue;
+ unMaxTargets+=(*m)->GetAmount();
+ }*/
+
//FIXME: This very like horrible hack and wrong for most spells
if(m_spellInfo->DmgClass != SPELL_DAMAGE_CLASS_MELEE)
max_range += num * CHAIN_SPELL_JUMP_RADIUS;
@@ -1484,7 +1491,7 @@ Unit* Spell::SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 en
{
Creature* target = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, entry, true, radius);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(target, u_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, target, u_check);
m_caster->VisitNearbyObject(radius, searcher);
return target;
}
@@ -1498,13 +1505,13 @@ Unit* Spell::SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 en
case SPELL_TARGETS_ENEMY:
{
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, radius);
- Trinity::UnitLastSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(target, u_check);
+ Trinity::UnitLastSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check);
m_caster->VisitNearbyObject(radius, searcher);
}break;
case SPELL_TARGETS_ALLY:
{
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, radius);
- Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(target, u_check);
+ Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check);
m_caster->VisitNearbyObject(radius, searcher);
}break;
}
@@ -1513,21 +1520,35 @@ Unit* Spell::SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 en
void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
{
- float radius;
+ float radius_h, radius_f;
if (m_spellInfo->EffectRadiusIndex[i])
- radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ {
+ radius_h = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ radius_f = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ }
else
- radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
+ {
+ radius_h = GetSpellMaxRangeForHostile(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
+ radius_f = GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
+ }
//Chain: 2, 6, 22, 25, 45, 77
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
+ Unit::AuraEffectList const& Auras = m_caster->GetAurasByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
+ for(Unit::AuraEffectList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
+ {
+ if((*j)->isAffectedOnSpell(m_spellInfo))
+ unMaxTargets+=(*j)->GetAmount();
+ }
+
if(m_originalCaster)
{
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
{
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius,this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius_f,this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius_h,this);
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
}
}
@@ -1554,17 +1575,17 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
TagUnitMap.push_back(owner);
break;
case TARGET_UNIT_PET:
- if(Pet* pet = m_caster->GetPet())
+ if(Guardian* pet = m_caster->GetGuardianPet())
TagUnitMap.push_back(pet);
break;
case TARGET_UNIT_PARTY_CASTER:
- m_caster->GetPartyMember(TagUnitMap, radius);
+ m_caster->GetPartyMember(TagUnitMap, radius_f);
break;
case TARGET_UNIT_RAID:
- if(Unit *target = m_targets.getUnitTarget())
- TagUnitMap.push_back(target);
- else
- m_caster->GetRaidMember(TagUnitMap, radius);
+ //if(Unit *target = m_targets.getUnitTarget())
+ // TagUnitMap.push_back(target);
+ //else
+ m_caster->GetRaidMember(TagUnitMap, radius_f);
break;
}
}break;
@@ -1581,30 +1602,29 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
switch(cur)
{
case TARGET_UNIT_MINIPET:
- if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet() && ((Pet*)target)->getPetType() == MINI_PET)
+ if(target->GetGUID() == m_caster->m_SummonSlot[4])
TagUnitMap.push_back(target);
break;
case TARGET_UNIT_TARGET_ALLY:
case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_ANY: // SelectMagnetTarget()?
case TARGET_UNIT_TARGET_PARTY:
- case TARGET_UNIT_SINGLE_UNKNOWN:
TagUnitMap.push_back(target);
break;
case TARGET_UNIT_PARTY_TARGET:
- target->GetPartyMember(TagUnitMap, radius);
+ target->GetPartyMember(TagUnitMap, radius_f);
break;
case TARGET_UNIT_TARGET_ENEMY:
if(EffectChainTarget <= 1)
TagUnitMap.push_back(SelectMagnetTarget());
else if(SelectMagnetTarget()) //TODO: chain target should also use magnet target
- SearchChainTarget(TagUnitMap, radius, EffectChainTarget, SPELL_TARGETS_ENEMY);
+ SearchChainTarget(TagUnitMap, radius_h, EffectChainTarget, SPELL_TARGETS_ENEMY);
break;
case TARGET_UNIT_CHAINHEAL:
if(EffectChainTarget <= 1)
TagUnitMap.push_back(target);
else
- SearchChainTarget(TagUnitMap, radius, EffectChainTarget, SPELL_TARGETS_CHAINHEAL);
+ SearchChainTarget(TagUnitMap, radius_f, EffectChainTarget, SPELL_TARGETS_CHAINHEAL);
break;
}
}break;
@@ -1651,17 +1671,17 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
case TARGET_UNIT_AREA_ENEMY_GROUND:
m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION;
case TARGET_UNIT_AREA_ENEMY:
- SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(TagUnitMap, radius_h, PUSH_DEST_CENTER, SPELL_TARGETS_ENEMY);
break;
case TARGET_UNIT_AREA_ALLY_GROUND:
m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION;
case TARGET_UNIT_AREA_ALLY:
- SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ALLY);
+ SearchAreaTarget(TagUnitMap, radius_f, PUSH_DEST_CENTER, SPELL_TARGETS_ALLY);
break;
case TARGET_UNIT_AREA_PARTY_GROUND:
m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION;
case TARGET_UNIT_AREA_PARTY:
- m_caster->GetPartyMember(TagUnitMap, radius);
+ m_caster->GetPartyMember(TagUnitMap, radius_f);
break;
case TARGET_UNIT_AREA_ENTRY_GROUND:
m_targets.m_targetMask |= TARGET_FLAG_DEST_LOCATION;
@@ -1671,7 +1691,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id);
if(lower==upper)
{
- SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(TagUnitMap, radius_h, PUSH_DEST_CENTER, SPELL_TARGETS_ENEMY);
sLog.outErrorDb("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry());
break;
}
@@ -1683,7 +1703,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
sLog.outError( "SPELL: spell ID %u requires non-creature target\n", m_spellInfo->Id );
continue;
}
- SearchAreaTarget(TagUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_ENTRY, i_spellST->second.targetEntry);
+ SearchAreaTarget(TagUnitMap, radius_f, PUSH_DEST_CENTER, SPELL_TARGETS_ENTRY, i_spellST->second.targetEntry);
}
}
break;
@@ -1727,41 +1747,41 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
m_targets.setDestination(((Player*)m_caster)->m_homebindX,((Player*)m_caster)->m_homebindY,((Player*)m_caster)->m_homebindZ, true, ((Player*)m_caster)->m_homebindMapId);
break;
-
case TARGET_IN_FRONT_OF_CASTER:
case TARGET_UNIT_CONE_ENEMY_UNKNOWN:
if(m_customAttr & SPELL_ATTR_CU_CONE_BACK)
- SearchAreaTarget(TagUnitMap, radius, PUSH_IN_BACK, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(TagUnitMap, radius_h, PUSH_IN_BACK, SPELL_TARGETS_ENEMY);
else if(m_customAttr & SPELL_ATTR_CU_CONE_LINE)
- SearchAreaTarget(TagUnitMap, radius, PUSH_IN_LINE, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(TagUnitMap, radius_h, PUSH_IN_LINE, SPELL_TARGETS_ENEMY);
else
- SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_ENEMY);
+ SearchAreaTarget(TagUnitMap, radius_h, PUSH_IN_FRONT, SPELL_TARGETS_ENEMY);
break;
case TARGET_UNIT_CONE_ALLY:
- SearchAreaTarget(TagUnitMap, radius, PUSH_IN_FRONT, SPELL_TARGETS_ALLY);
+ SearchAreaTarget(TagUnitMap, radius_f, PUSH_IN_FRONT, SPELL_TARGETS_ALLY);
break;
// nearby target
case TARGET_UNIT_NEARBY_ALLY:
+ case TARGET_UNIT_NEARBY_ALLY_UNK:
if(!m_targets.getUnitTarget())
- m_targets.setUnitTarget(SearchNearbyTarget(radius, SPELL_TARGETS_ALLY));
+ m_targets.setUnitTarget(SearchNearbyTarget(radius_f, SPELL_TARGETS_ALLY));
if(m_targets.getUnitTarget())
{
if(EffectChainTarget <= 1)
TagUnitMap.push_back(m_targets.getUnitTarget());
else
- SearchChainTarget(TagUnitMap, radius, EffectChainTarget, SPELL_TARGETS_ALLY);
+ SearchChainTarget(TagUnitMap, radius_f, EffectChainTarget, SPELL_TARGETS_ALLY);
}
break;
- case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
+ case TARGET_UNIT_NEARBY_ENEMY:
if(!m_targets.getUnitTarget())
- m_targets.setUnitTarget(SearchNearbyTarget(radius, SPELL_TARGETS_ENEMY));
+ m_targets.setUnitTarget(SearchNearbyTarget(radius_h, SPELL_TARGETS_ENEMY));
if(m_targets.getUnitTarget())
{
if(EffectChainTarget <= 1)
TagUnitMap.push_back(m_targets.getUnitTarget());
else
- SearchChainTarget(TagUnitMap, radius, EffectChainTarget, SPELL_TARGETS_ENEMY);
+ SearchChainTarget(TagUnitMap, radius_h, EffectChainTarget, SPELL_TARGETS_ENEMY);
}
break;
case TARGET_SCRIPT:
@@ -1778,7 +1798,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
}
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
- float range = GetSpellMaxRange(srange);
+ float range = GetSpellMaxRangeForHostile(srange);
Creature* creatureScriptTarget = NULL;
GameObject* goScriptTarget = NULL;
@@ -1794,7 +1814,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
if(i_spellST->second.targetEntry)
{
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*m_caster,i_spellST->second.targetEntry,range);
- Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(p_GameObject,go_check);
+ Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(m_caster, p_GameObject,go_check);
m_caster->VisitNearbyGridObject(range, checker);
if(p_GameObject)
@@ -1824,7 +1844,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
Creature *p_Creature = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range);
- Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(p_Creature, u_check);
+ Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check);
m_caster->VisitNearbyObject(range, searcher);
if(p_Creature )
@@ -1873,7 +1893,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
Player* Target = itr->getSource();
// IsHostileTo check duel and controlled by enemy
- if( Target && targetPlayer->IsWithinDistInMap(Target, radius) &&
+ if( Target && targetPlayer->IsWithinDistInMap(Target, radius_f) &&
targetPlayer->getClass() == Target->getClass() &&
!m_caster->IsHostileTo(Target) )
{
@@ -1904,7 +1924,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
float x, y, z, angle, dist;
float objSize = m_caster->GetObjectSize();
- dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
if(dist < objSize)
dist = objSize;
else if(cur == TARGET_DEST_CASTER_RANDOM)
@@ -1947,7 +1967,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
float x, y, z, angle, dist;
float objSize = target->GetObjectSize();
- dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ dist = target->GetSpellRadiusForTarget(target, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
if(dist < objSize)
dist = objSize;
else if(cur == TARGET_DEST_CASTER_RANDOM)
@@ -1983,7 +2003,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
float x, y, z, angle, dist;
- dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
if (cur == TARGET_DEST_DEST_RANDOM)
dist *= rand_norm();
@@ -2017,10 +2037,71 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
TagUnitMap.remove(m_targets.getUnitTarget());
Trinity::RandomResizeList(TagUnitMap, unMaxTargets);
+
+ /*if(m_spellInfo->Id==57669) //Replenishment (special target selection)
+ {
+ if(pGroup)
+ {
+ typedef std::priority_queue<PrioritizeManaPlayerWraper, std::vector<PrioritizeManaPlayerWraper>, PrioritizeMana> Top10;
+ Top10 manaUsers;
+
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL && manaUsers.size() < 10; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
+ if (m_caster->GetGUID() != Target->GetGUID() && Target->getPowerType() == POWER_MANA &&
+ !Target->isDead() && m_caster->IsWithinDistInMap(Target, radius))
+ {
+ PrioritizeManaPlayerWraper WTarget(Target);
+ manaUsers.push(WTarget);
+ }
+ }
+
+ while(!manaUsers.empty())
+ {
+ TagUnitMap.push_back(manaUsers.top().getPlayer());
+ manaUsers.pop();
+ }
+ }
+ else
+ {
+ Unit* ownerOrSelf = pTarget ? pTarget : m_caster->GetCharmerOrOwnerOrSelf();
+ if ((ownerOrSelf==m_caster || m_caster->IsWithinDistInMap(ownerOrSelf, radius)) &&
+ ownerOrSelf->getPowerType() == POWER_MANA)
+ TagUnitMap.push_back(ownerOrSelf);
+
+ if(Pet* pet = ownerOrSelf->GetGuardianPet())
+ if( m_caster->IsWithinDistInMap(pet, radius) && pet->getPowerType() == POWER_MANA )
+ TagUnitMap.push_back(pet);
+ }
+ }*/
}
}
-void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
+class PrioritizeManaPlayerWraper
+{
+ friend struct PrioritizeMana;
+
+ public:
+ explicit PrioritizeManaPlayerWraper(Player* player) : player(player)
+ {
+ uint32 maxmana = player->GetMaxPower(POWER_MANA);
+ percentMana = maxmana ? player->GetPower(POWER_MANA) * 100 / maxmana : 101;
+ }
+ Player* getPlayer() const { return player; }
+ private:
+ Player* player;
+ uint32 percentMana;
+};
+
+struct PrioritizeMana
+{
+ int operator()( PrioritizeManaPlayerWraper const& x, PrioritizeManaPlayerWraper const& y ) const
+ {
+ return x.percentMana < y.percentMana;
+ }
+};
+
+void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura)
{
if(m_CastItem)
m_castItemGUID = m_CastItem->GetGUID();
@@ -2029,6 +2110,13 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
m_targets = *targets;
+ if(!m_targets.getUnitTargetGUID() && m_spellInfo->Targets & TARGET_FLAG_UNIT)
+ {
+ if(Unit *target = ObjectAccessor::GetUnit(*m_caster, m_caster->GetUInt64Value(UNIT_FIELD_TARGET)))
+ if(IsValidSingleTargetSpell(target))
+ m_targets.setUnitTarget(target);
+ }
+
m_spellState = SPELL_STATE_PREPARING;
m_caster->GetPosition(m_castPositionX, m_castPositionY, m_castPositionZ);
@@ -2042,7 +2130,7 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));
//Prevent casting at cast another spell (ServerSide check)
- if(m_caster->IsNonMeleeSpellCasted(false, true) && m_cast_count)
+ if(m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count)
{
SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS);
finish(false);
@@ -2079,13 +2167,13 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
// Fill cost data
m_powerCost = CalculatePowerCost();
- uint8 result = CanCast(true);
- if(result != 0 && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
+ SpellCastResult result = CheckCast(true);
+ if(result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
{
if(triggeredByAura)
{
SendChannelUpdate(0);
- triggeredByAura->SetAuraDuration(0);
+ triggeredByAura->GetParentAura()->SetAuraDuration(0);
}
SendCastResult(result);
finish(false);
@@ -2095,13 +2183,18 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
// Prepare data for triggers
prepareDataForTriggerSystem();
- // calculate cast time (calculated after first CanCast check to prevent charge counting for first CanCast fail)
+ // Set combo point requirement
+ if (m_IsTriggeredSpell || m_CastItem || m_caster->GetTypeId()!=TYPEID_PLAYER)
+ m_needComboPoints = false;
+
+ // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail)
m_casttime = GetSpellCastTime(m_spellInfo, this);
// set timer base at cast time
ReSetTimer();
-
- if(m_IsTriggeredSpell)
+ //Containers for channeled spells have to be set
+ //TODO:Apply this to all casted spells if needed
+ if(m_IsTriggeredSpell && !IsChanneledSpell(m_spellInfo))
cast(true);
else
{
@@ -2151,11 +2244,10 @@ void Spell::cancel()
{
Unit* unit = m_caster->GetGUID()==(*ihit).targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if( unit && unit->isAlive() )
- unit->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
+ unit->RemoveAurasDueToSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
}
}
-
- m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
+ m_caster->RemoveAurasDueToSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
SendChannelUpdate(0);
SendInterrupted(0);
SendCastResult(SPELL_FAILED_INTERRUPTED);
@@ -2179,8 +2271,6 @@ void Spell::cast(bool skipCheck)
{
SetExecutedCurrently(true);
- uint8 castResult = 0;
-
// update pointers base at GUIDs to prevent access to non-existed already object
UpdatePointers();
@@ -2195,23 +2285,12 @@ void Spell::cast(bool skipCheck)
if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)
m_caster->SetInFront(m_targets.getUnitTarget());
- if(!m_IsTriggeredSpell)
- {
- castResult = CheckPower();
- if(castResult != 0)
- {
- SendCastResult(castResult);
- finish(false);
- SetExecutedCurrently(false);
- return;
- }
- }
// triggered cast called from Spell::prepare where it was already checked
- if(!skipCheck)
+ if(!m_IsTriggeredSpell || !skipCheck)
{
- castResult = CanCast(false);
- if(castResult != 0)
+ SpellCastResult castResult = CheckCast(false);
+ if(castResult != SPELL_CAST_OK)
{
SendCastResult(castResult);
finish(false);
@@ -2222,48 +2301,70 @@ void Spell::cast(bool skipCheck)
FillTargetMap();
- if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap
+ if(m_spellInfo->SpellFamilyName)
{
- SetExecutedCurrently(false);
- return;
+ if (m_spellInfo->excludeCasterAuraSpell && !IsPositiveSpell(m_spellInfo->excludeCasterAuraSpell))
+ m_preCastSpell = m_spellInfo->excludeCasterAuraSpell;
+ else if (m_spellInfo->excludeTargetAuraSpell && !IsPositiveSpell(m_spellInfo->excludeTargetAuraSpell))
+ m_preCastSpell = m_spellInfo->excludeTargetAuraSpell;
+ }
+ switch (m_spellInfo->SpellFamilyName)
+ {
+ case SPELLFAMILY_GENERIC:
+ {
+ if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages
+ m_preCastSpell = 11196; // Recently Bandaged
+ else if(m_spellInfo->SpellIconID == 1662 && m_spellInfo->AttributesEx & 0x20)
+ m_preCastSpell = 23230; // Blood Fury - Healing Reduction
+ break;
+ }
}
-
// traded items have trade slot instead of guid in m_itemTargetGUID
// set to real guid to be sent later to the client
m_targets.updateTradeSlotItem();
- if(!m_IsTriggeredSpell)
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- //TakePower();
- TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
- }
+ if (!m_IsTriggeredSpell && m_CastItem)
+ ((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, m_CastItem->GetEntry());
- // CAST SPELL
- SendSpellCooldown();
- //SendCastResult(castResult);
- SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
-
- if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
- CalculateDamageDoneForAllTargets();
+ ((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
+ }
- //handle SPELL_AURA_ADD_TARGET_TRIGGER auras
- //are there any spells need to be triggered after hit?
- Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
- for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
+ // this is related to combo points so must be done before takepower
+ // are there any spells need to be triggered after hit?
+ // handle SPELL_AURA_ADD_TARGET_TRIGGER auras
+ Unit::AuraEffectList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
+ for(Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
{
+ if (!(*i)->isAffectedOnSpell(m_spellInfo))
+ continue;
SpellEntry const *auraSpellInfo = (*i)->GetSpellProto();
uint32 auraSpellIdx = (*i)->GetEffIndex();
- if (IsAffectedBy(auraSpellInfo, auraSpellIdx))
+ if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx]))
{
- if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx]))
- {
- // Calculate chance at that moment (can be depend for example from combo points)
- int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL);
- m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount()));
- }
+ // Calculate chance at that moment (can be depend for example from combo points)
+ int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL);
+ m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetParentAura()->GetStackAmount()));
}
}
+ // this is related to combo points so must be done before takepower
+ if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
+ CalculateDamageDoneForAllTargets();
+
+ if(!m_IsTriggeredSpell)
+ {
+ // Powers have to be taken before SendSpellGo
+ TakePower();
+ TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
+ }
+
+ // CAST SPELL
+ SendSpellCooldown();
+ //SendCastResult(castResult);
+ SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
+
if(m_customAttr & SPELL_ATTR_CU_CHARGE)
EffectCharge(0);
@@ -2285,12 +2386,6 @@ void Spell::cast(bool skipCheck)
handle_immediate();
}
- // combo points should not be taken before SPELL_AURA_ADD_TARGET_TRIGGER auras are handled
- if(!m_IsTriggeredSpell)
- {
- TakePower();
- }
-
if(m_customAttr & SPELL_ATTR_CU_LINK_CAST)
{
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id))
@@ -2309,9 +2404,18 @@ void Spell::handle_immediate()
// start channeling if applicable
if(IsChanneledSpell(m_spellInfo))
{
- m_spellState = SPELL_STATE_CASTING;
- m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags);
- SendChannelStart(GetSpellDuration(m_spellInfo));
+ int32 duration = GetSpellDuration(m_spellInfo);
+ if (duration)
+ {
+ //apply haste mods
+ m_caster->ModSpellCastTime(m_spellInfo, duration, this);
+ // Apply duration mod
+ if(Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
+ m_spellState = SPELL_STATE_CASTING;
+ m_caster->AddInterruptMask(m_spellInfo->ChannelInterruptFlags);
+ SendChannelStart(duration);
+ }
}
// process immediate effects (items, ground, etc.) also initialize some variables
@@ -2436,6 +2540,10 @@ void Spell::_handle_immediate_phase()
void Spell::_handle_finish_phase()
{
+ // Take for real after all targets are processed
+ if (m_needComboPoints)
+ ((Player*)m_caster)->ClearComboPoints();
+
// spell log
if(m_needSpellLog)
SendLogExecute();
@@ -2447,93 +2555,20 @@ void Spell::SendSpellCooldown()
return;
Player* _player = (Player*)m_caster;
- // Add cooldown for max (disable spell)
- // Cooldown started on SendCooldownEvent call
- if (m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
- {
- _player->AddSpellCooldown(m_spellInfo->Id, 0, time(NULL) - 1);
- return;
- }
-
- // init cooldown values
- uint32 cat = 0;
- int32 rec = -1;
- int32 catrec = -1;
-
- // some special item spells without correct cooldown in SpellInfo
- // cooldown information stored in item prototype
- // This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
-
- if(m_CastItem)
- {
- ItemPrototype const* proto = m_CastItem->GetProto();
- if(proto)
- {
- for(int idx = 0; idx < 5; ++idx)
- {
- if(proto->Spells[idx].SpellId == m_spellInfo->Id)
- {
- cat = proto->Spells[idx].SpellCategory;
- rec = proto->Spells[idx].SpellCooldown;
- catrec = proto->Spells[idx].SpellCategoryCooldown;
- break;
- }
- }
- }
- }
- // if no cooldown found above then base at DBC data
- if(rec < 0 && catrec < 0)
+ // mana/health/etc potions, disabled by client (until combat out as declarate)
+ if (m_CastItem && m_CastItem->IsPotion())
{
- cat = m_spellInfo->Category;
- rec = m_spellInfo->RecoveryTime;
- catrec = m_spellInfo->CategoryRecoveryTime;
+ // need in some way provided data for Spell::finish SendCooldownEvent
+ _player->SetLastPotionId(m_CastItem->GetEntry());
+ return;
}
- // shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK)
- // prevent 0 cooldowns set by another way
- if (rec <= 0 && catrec <= 0 && (cat == 76 || cat == 351))
- rec = _player->GetAttackTime(RANGED_ATTACK);
-
- // Now we have cooldown data (if found any), time to apply mods
- if(rec > 0)
- _player->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COOLDOWN, rec, this);
-
- if(catrec > 0)
- _player->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COOLDOWN, catrec, this);
-
- // replace negative cooldowns by 0
- if (rec < 0) rec = 0;
- if (catrec < 0) catrec = 0;
-
- // no cooldown after applying spell mods
- if( rec == 0 && catrec == 0)
+ // have infinity cooldown but set at aura apply // do not set cooldown for triggered spells (needed by reincarnation)
+ if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE || m_IsTriggeredSpell)
return;
- time_t curTime = time(NULL);
-
- time_t catrecTime = catrec ? curTime+catrec/1000 : 0; // in secs
- time_t recTime = rec ? curTime+rec/1000 : catrecTime;// in secs
-
- // self spell cooldown
- if(recTime > 0)
- _player->AddSpellCooldown(m_spellInfo->Id, m_CastItem ? m_CastItem->GetEntry() : 0, recTime);
-
- // category spells
- if (catrec > 0)
- {
- SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat);
- if(i_scstore != sSpellCategoryStore.end())
- {
- for(SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset)
- {
- if(*i_scset == m_spellInfo->Id) // skip main spell, already handled above
- continue;
-
- _player->AddSpellCooldown(m_spellInfo->Id, m_CastItem ? m_CastItem->GetEntry() : 0, catrecTime);
- }
- }
- }
+ _player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
}
void Spell::update(uint32 difftime)
@@ -2687,6 +2722,10 @@ void Spell::finish(bool ok)
m_caster->resetAttackTimer(RANGED_ATTACK);
}
+ // potions disabled by client, send event "not in combat" if need
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)m_caster)->UpdatePotionCooldown(this);
+
// call triggered spell only at successful cast (after clear combo points -> for add some if need)
// I assume what he means is that some triggered spells may add combo points
if(!m_TriggerSpells.empty())
@@ -2697,72 +2736,65 @@ void Spell::finish(bool ok)
m_caster->AttackStop();
}
-void Spell::SendCastResult(uint8 result)
+void Spell::SendCastResult(SpellCastResult result)
{
+ if(result == SPELL_CAST_OK)
+ return;
+
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
if(((Player*)m_caster)->GetSession()->PlayerLoading()) // don't send cast results at loading time
return;
- if(result != 0)
- {
- WorldPacket data(SMSG_CAST_FAILED, (4+1+1));
- data << uint32(m_spellInfo->Id);
- data << uint8(result); // problem
- data << uint8(m_cast_count); // single cast or multi 2.3 (0/1)
- switch (result)
- {
- case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
- data << uint32(m_spellInfo->RequiresSpellFocus);
- break;
- case SPELL_FAILED_REQUIRES_AREA:
- // hardcode areas limitation case
- switch(m_spellInfo->Id)
- {
- case 41617: // Cenarion Mana Salve
- case 41619: // Cenarion Healing Salve
- data << uint32(3905);
- break;
- case 41618: // Bottled Nethergon Energy
- case 41620: // Bottled Nethergon Vapor
- data << uint32(3842);
- break;
- case 45373: // Bloodberry Elixir
- data << uint32(4075);
- break;
- default: // default case
- data << uint32(m_spellInfo->AreaId);
- break;
- }
- break;
- case SPELL_FAILED_TOTEMS:
- if(m_spellInfo->Totem[0])
- data << uint32(m_spellInfo->Totem[0]);
- if(m_spellInfo->Totem[1])
- data << uint32(m_spellInfo->Totem[1]);
- break;
- case SPELL_FAILED_TOTEM_CATEGORY:
- if(m_spellInfo->TotemCategory[0])
- data << uint32(m_spellInfo->TotemCategory[0]);
- if(m_spellInfo->TotemCategory[1])
- data << uint32(m_spellInfo->TotemCategory[1]);
- break;
- case SPELL_FAILED_EQUIPPED_ITEM_CLASS:
- data << uint32(m_spellInfo->EquippedItemClass);
- data << uint32(m_spellInfo->EquippedItemSubClassMask);
- data << uint32(m_spellInfo->EquippedItemInventoryTypeMask);
- break;
- }
- ((Player*)m_caster)->GetSession()->SendPacket(&data);
- }
- else
+ WorldPacket data(SMSG_CAST_FAILED, (4+1+1));
+ data << uint8(m_cast_count); // single cast or multi 2.3 (0/1)
+ data << uint32(m_spellInfo->Id);
+ data << uint8(result); // problem
+ switch (result)
{
- WorldPacket data(SMSG_CLEAR_EXTRA_AURA_INFO, (8+4));
- data.append(m_caster->GetPackGUID());
- data << uint32(m_spellInfo->Id);
- ((Player*)m_caster)->GetSession()->SendPacket(&data);
+ case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
+ data << uint32(m_spellInfo->RequiresSpellFocus);
+ break;
+ case SPELL_FAILED_REQUIRES_AREA:
+ // hardcode areas limitation case
+ switch(m_spellInfo->Id)
+ {
+ case 41617: // Cenarion Mana Salve
+ case 41619: // Cenarion Healing Salve
+ data << uint32(3905);
+ break;
+ case 41618: // Bottled Nethergon Energy
+ case 41620: // Bottled Nethergon Vapor
+ data << uint32(3842);
+ break;
+ case 45373: // Bloodberry Elixir
+ data << uint32(4075);
+ break;
+ default: // default case (don't must be)
+ data << uint32(0);
+ break;
+ }
+ break;
+ case SPELL_FAILED_TOTEMS:
+ if(m_spellInfo->Totem[0])
+ data << uint32(m_spellInfo->Totem[0]);
+ if(m_spellInfo->Totem[1])
+ data << uint32(m_spellInfo->Totem[1]);
+ break;
+ case SPELL_FAILED_TOTEM_CATEGORY:
+ if(m_spellInfo->TotemCategory[0])
+ data << uint32(m_spellInfo->TotemCategory[0]);
+ if(m_spellInfo->TotemCategory[1])
+ data << uint32(m_spellInfo->TotemCategory[1]);
+ break;
+ case SPELL_FAILED_EQUIPPED_ITEM_CLASS:
+ data << uint32(m_spellInfo->EquippedItemClass);
+ data << uint32(m_spellInfo->EquippedItemSubClassMask);
+ //data << uint32(m_spellInfo->EquippedItemInventoryTypeMask);
+ break;
}
+ ((Player*)m_caster)->GetSession()->SendPacket(&data);
}
void Spell::SendSpellStart()
@@ -2775,6 +2807,13 @@ void Spell::SendSpellStart()
uint32 castFlags = CAST_FLAG_UNKNOWN1;
if(IsRangedSpell())
castFlags |= CAST_FLAG_AMMO;
+ if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
+ (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet()))
+ && m_spellInfo->powerType != POWER_HEALTH )
+ castFlags |= CAST_FLAG_POWER_LEFT_SELF;
+
+ if(m_spellInfo->runeCostID)
+ castFlags |= CAST_FLAG_UNKNOWN10;
Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
@@ -2785,14 +2824,17 @@ void Spell::SendSpellStart()
data.append(m_caster->GetPackGUID());
data.append(m_caster->GetPackGUID());
- data << uint32(m_spellInfo->Id);
- data << uint8(m_cast_count); // single cast or multi 2.3 (0/1)
- data << uint16(castFlags);
- data << uint32(m_timer);
+ data << uint8(m_cast_count); // pending spell cast?
+ data << uint32(m_spellInfo->Id); // spellId
+ data << uint32(castFlags); // cast flags
+ data << uint32(m_timer); // delay?
m_targets.write(&data);
- if( castFlags & CAST_FLAG_AMMO )
+ if(castFlags & CAST_FLAG_POWER_LEFT_SELF)
+ data << uint32(m_caster->GetPower((Powers)m_spellInfo->powerType));
+
+ if ( castFlags & CAST_FLAG_AMMO )
WriteAmmoToPacket(&data);
m_caster->SendMessageToSet(&data, true);
@@ -2811,25 +2853,72 @@ void Spell::SendSpellGo()
uint32 castFlags = CAST_FLAG_UNKNOWN3;
if(IsRangedSpell())
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
+ if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
+ (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet()))
+ && m_spellInfo->powerType != POWER_HEALTH )
+ castFlags |= CAST_FLAG_POWER_LEFT_SELF; // should only be sent to self, but the current messaging doesn't make that possible
+
+ if((m_caster->GetTypeId() == TYPEID_PLAYER) && (m_caster->getClass() == CLASS_DEATH_KNIGHT) && m_spellInfo->runeCostID)
+ {
+ castFlags |= CAST_FLAG_UNKNOWN10; // same as in SMSG_SPELL_START
+ castFlags |= CAST_FLAG_UNKNOWN7; // rune cooldowns list
+ }
WorldPacket data(SMSG_SPELL_GO, 50); // guess size
+
if(m_CastItem)
data.append(m_CastItem->GetPackGUID());
else
data.append(m_caster->GetPackGUID());
data.append(m_caster->GetPackGUID());
- data << uint32(m_spellInfo->Id);
- data << uint16(castFlags);
+ data << uint8(m_cast_count); // pending spell cast?
+ data << uint32(m_spellInfo->Id); // spellId
+ data << uint32(castFlags); // cast flags
data << uint32(getMSTime()); // timestamp
WriteSpellGoTargets(&data);
m_targets.write(&data);
- if( castFlags & CAST_FLAG_AMMO )
+ if(castFlags & CAST_FLAG_POWER_LEFT_SELF)
+ data << uint32(m_caster->GetPower((Powers)m_spellInfo->powerType));
+
+ if ( castFlags & CAST_FLAG_UNKNOWN7 ) // rune cooldowns list
+ {
+ uint8 v1 = m_runesState;
+ uint8 v2 = ((Player*)m_caster)->GetRunesState();
+ data << uint8(v1); // runes state before
+ data << uint8(v2); // runes state after
+ for(uint8 i = 0; i < MAX_RUNES; ++i)
+ {
+ uint8 m = (1 << i);
+ if(m & v1) // usable before...
+ if(!(m & v2)) // ...but on cooldown now...
+ data << uint8(0); // some unknown byte (time?)
+ }
+ }
+
+ if ( castFlags & CAST_FLAG_UNKNOWN4 ) // unknown wotlk
+ {
+ data << float(0);
+ data << uint32(0);
+ }
+
+ if ( castFlags & CAST_FLAG_AMMO )
WriteAmmoToPacket(&data);
+ if ( castFlags & CAST_FLAG_UNKNOWN5 ) // unknown wotlk
+ {
+ data << uint32(0);
+ data << uint32(0);
+ }
+
+ if ( m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION )
+ {
+ data << uint8(0);
+ }
+
m_caster->SendMessageToSet(&data, true);
}
@@ -2874,15 +2963,36 @@ void Spell::WriteAmmoToPacket( WorldPacket * data )
void Spell::WriteSpellGoTargets( WorldPacket * data )
{
- *data << (uint8)m_countOfHit;
+ // This function also fill data for channeled spells:
+ // m_needAliveTargetMask req for stop channelig if one target die
+ uint32 hit = m_UniqueGOTargetInfo.size(); // Always hits on GO
+ uint32 miss = 0;
+ for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
+ {
+ if ((*ihit).effectMask == 0) // No effect apply - all immuned add state
+ {
+ // possibly SPELL_MISS_IMMUNE2 for this??
+ ihit->missCondition = SPELL_MISS_IMMUNE2;
+ miss++;
+ }
+ else if ((*ihit).missCondition == SPELL_MISS_NONE)
+ hit++;
+ else
+ miss++;
+ }
+
+ *data << (uint8)hit;
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
if ((*ihit).missCondition == SPELL_MISS_NONE) // Add only hits
+ {
*data << uint64(ihit->targetGUID);
+ m_needAliveTargetMask |=ihit->effectMask;
+ }
for(std::list<GOTargetInfo>::iterator ighit= m_UniqueGOTargetInfo.begin();ighit != m_UniqueGOTargetInfo.end();++ighit)
*data << uint64(ighit->targetGUID); // Always hits
- *data << (uint8)m_countOfMiss;
+ *data << (uint8)miss;
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
{
if( ihit->missCondition != SPELL_MISS_NONE ) // Add only miss
@@ -2893,6 +3003,9 @@ void Spell::WriteSpellGoTargets( WorldPacket * data )
*data << uint8(ihit->reflectResult);
}
}
+ // Reset m_needAliveTargetMask for non channeled spell
+ if(!IsChanneledSpell(m_spellInfo))
+ m_needAliveTargetMask = 0;
}
void Spell::SendLogExecute()
@@ -2957,30 +3070,19 @@ void Spell::SendLogExecute()
data << uint8(0);
break;
case SPELL_EFFECT_CREATE_ITEM:
+ case SPELL_EFFECT_CREATE_ITEM_2:
data << uint32(m_spellInfo->EffectItemType[0]);
break;
case SPELL_EFFECT_SUMMON:
- case SPELL_EFFECT_SUMMON_WILD:
- case SPELL_EFFECT_SUMMON_GUARDIAN:
case SPELL_EFFECT_TRANS_DOOR:
case SPELL_EFFECT_SUMMON_PET:
- case SPELL_EFFECT_SUMMON_POSSESSED:
- case SPELL_EFFECT_SUMMON_TOTEM:
case SPELL_EFFECT_SUMMON_OBJECT_WILD:
case SPELL_EFFECT_CREATE_HOUSE:
case SPELL_EFFECT_DUEL:
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT1:
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT2:
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT3:
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT4:
- case SPELL_EFFECT_SUMMON_PHANTASM:
- case SPELL_EFFECT_SUMMON_CRITTER:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT1:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT2:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT3:
case SPELL_EFFECT_SUMMON_OBJECT_SLOT4:
- case SPELL_EFFECT_SUMMON_DEMON:
- case SPELL_EFFECT_150:
if(Unit *unit = m_targets.getUnitTarget())
data.append(unit->GetPackGUID());
else if(m_targets.getItemTargetGUID())
@@ -2999,6 +3101,13 @@ void Spell::SendLogExecute()
else
data << uint8(0);
break;
+ case SPELL_EFFECT_RESURRECT:
+ case SPELL_EFFECT_RESURRECT_NEW:
+ if(Unit *unit = m_targets.getUnitTarget())
+ data.append(unit->GetPackGUID());
+ else
+ data << uint8(0);
+ break;
default:
return;
}
@@ -3012,13 +3121,16 @@ void Spell::SendInterrupted(uint8 result)
{
WorldPacket data(SMSG_SPELL_FAILURE, (8+4+1));
data.append(m_caster->GetPackGUID());
- data << m_spellInfo->Id;
- data << result;
+ data << uint8(m_cast_count);
+ data << uint32(m_spellInfo->Id);
+ data << uint8(result);
m_caster->SendMessageToSet(&data, true);
data.Initialize(SMSG_SPELL_FAILED_OTHER, (8+4));
data.append(m_caster->GetPackGUID());
- data << m_spellInfo->Id;
+ data << uint8(m_cast_count);
+ data << uint32(m_spellInfo->Id);
+ data << uint8(result);
m_caster->SendMessageToSet(&data, true);
}
@@ -3086,10 +3198,19 @@ void Spell::SendChannelStart(uint32 duration)
void Spell::SendResurrectRequest(Player* target)
{
- WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+2+4));
- data << m_caster->GetGUID();
- data << uint32(1) << uint16(0) << uint32(1);
+ // Both players and NPCs can resurrect using spells - have a look at creature 28487 for example
+ // However, the packet structure differs slightly
+
+ const char* sentName = m_caster->GetTypeId()==TYPEID_PLAYER ?"":m_caster->GetNameForLocaleIdx(target->GetSession()->GetSessionDbLocaleIndex());
+
+ WorldPacket data(SMSG_RESURRECT_REQUEST, (8+4+strlen(sentName)+1+1+1));
+ data << uint64(m_caster->GetGUID());
+ data << uint32(strlen(sentName)+1);
+
+ data << sentName;
+ data << uint8(0);
+ data << uint8(m_caster->GetTypeId()==TYPEID_PLAYER ?0:1);
target->GetSession()->SendPacket(&data);
}
@@ -3126,7 +3247,7 @@ void Spell::TakeCastItem()
bool expendable = false;
bool withoutCharges = false;
- for (int i = 0; i<5; i++)
+ for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
if (proto->Spells[i].SpellId)
{
@@ -3142,7 +3263,7 @@ void Spell::TakeCastItem()
if (charges)
{
(charges > 0) ? --charges : ++charges; // abs(charges) less at 1 after use
- if (proto->Stackable < 2)
+ if (proto->Stackable == 1)
m_CastItem->SetSpellCharges(i, charges);
m_CastItem->SetState(ITEM_CHANGED, (Player*)m_caster);
}
@@ -3168,7 +3289,7 @@ void Spell::TakeCastItem()
void Spell::TakePower()
{
- if(m_CastItem || m_triggeredByAuraSpell || !m_powerCost)
+ if(m_CastItem || m_triggeredByAuraSpell)
return;
bool hit = true;
@@ -3181,12 +3302,27 @@ void Spell::TakePower()
{
if(ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID!=m_caster->GetGUID()*/)
hit = false;
+ if (ihit->missCondition != SPELL_MISS_NONE)
+ {
+ //lower spell cost on fail (by talent aura)
+ if(Player *modOwner = ((Player*)m_caster)->GetSpellModOwner())
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost);
+ }
break;
}
- if(hit && NeedsComboPoints(m_spellInfo))
- ((Player*)m_caster)->ClearComboPoints();
}
+ Powers powerType = Powers(m_spellInfo->powerType);
+
+ if(powerType == POWER_RUNE)
+ {
+ TakeRunePower();
+ return;
+ }
+
+ if (!m_powerCost)
+ return;
+
// health as power used
if(m_spellInfo->powerType == POWER_HEALTH)
{
@@ -3200,8 +3336,6 @@ void Spell::TakePower()
return;
}
- Powers powerType = Powers(m_spellInfo->powerType);
-
if(hit)
m_caster->ModifyPower(powerType, -m_powerCost);
else
@@ -3212,6 +3346,136 @@ void Spell::TakePower()
m_caster->SetLastManaUse(getMSTime());
}
+void Spell::TakeAmmo()
+{
+ if(m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ Item *pItem = ((Player*)m_caster)->GetWeaponForAttack( RANGED_ATTACK );
+
+ // wands don't have ammo
+ if(!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_WAND)
+ return;
+
+ if( pItem->GetProto()->InventoryType == INVTYPE_THROWN )
+ {
+ if(pItem->GetMaxStackCount()==1)
+ {
+ // decrease durability for non-stackable throw weapon
+ ((Player*)m_caster)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
+ }
+ else
+ {
+ // decrease items amount for stackable throw weapon
+ uint32 count = 1;
+ ((Player*)m_caster)->DestroyItemCount( pItem, count, true);
+ }
+ }
+ else if(uint32 ammo = ((Player*)m_caster)->GetUInt32Value(PLAYER_AMMO_ID))
+ ((Player*)m_caster)->DestroyItemCount(ammo, 1, true);
+ }
+}
+
+SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_CAST_OK;
+
+ Player *plr = (Player*)m_caster;
+
+ if(plr->getClass() != CLASS_DEATH_KNIGHT)
+ return SPELL_CAST_OK;
+
+ SpellRuneCostEntry const *src = sSpellRuneCostStore.LookupEntry(runeCostID);
+
+ if(!src)
+ return SPELL_CAST_OK;
+
+ if(src->NoRuneCost())
+ return SPELL_CAST_OK;
+
+ int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death
+
+ for(uint32 i = 0; i < RUNE_DEATH; ++i)
+ runeCost[i] = src->RuneCost[i];
+
+ runeCost[RUNE_DEATH] = MAX_RUNES; // calculated later
+
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ uint8 rune = plr->GetCurrentRune(i);
+ if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0))
+ runeCost[rune]--;
+ }
+
+ for(uint32 i = 0; i < RUNE_DEATH; ++i)
+ if(runeCost[i] > 0)
+ runeCost[RUNE_DEATH] += runeCost[i];
+
+ if(runeCost[RUNE_DEATH] > MAX_RUNES)
+ return SPELL_FAILED_NO_POWER; // not sure if result code is correct
+
+ return SPELL_CAST_OK;
+}
+
+void Spell::TakeRunePower()
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ Player *plr = (Player*)m_caster;
+
+ if(plr->getClass() != CLASS_DEATH_KNIGHT)
+ return;
+
+ SpellRuneCostEntry const *src = sSpellRuneCostStore.LookupEntry(m_spellInfo->runeCostID);
+
+ if(!src || (src->NoRuneCost() && src->NoRunicPowerGain()))
+ return;
+ m_runesState = plr->GetRunesState(); // store previous state
+
+ int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death
+
+ for(uint32 i = 0; i < RUNE_DEATH; ++i)
+ {
+ runeCost[i] = src->RuneCost[i];
+ }
+
+ runeCost[RUNE_DEATH] = 0; // calculated later
+
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ uint8 rune = plr->GetCurrentRune(i);
+ if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0))
+ {
+ plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec
+ runeCost[rune]--;
+ }
+ }
+
+ runeCost[RUNE_DEATH] = runeCost[RUNE_BLOOD] + runeCost[RUNE_UNHOLY] + runeCost[RUNE_FROST];
+
+ if(runeCost[RUNE_DEATH] > 0)
+ {
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ uint8 rune = plr->GetCurrentRune(i);
+ if((plr->GetRuneCooldown(i) == 0) && (rune == RUNE_DEATH))
+ {
+ plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec
+ runeCost[rune]--;
+ plr->ConvertRune(i, plr->GetBaseRune(i));
+ if(runeCost[RUNE_DEATH] == 0)
+ break;
+ }
+ }
+ }
+
+ // you can gain some runic power when use runes
+ float rp = src->runePowerGain;
+ rp *= sWorld.getRate(RATE_POWER_RUNICPOWER_INCOME);
+ plr->ModifyPower(POWER_RUNIC_POWER, (int32)rp);
+}
+
void Spell::TakeReagents()
{
if(m_IsTriggeredSpell) // reagents used in triggered spell removed by original spell or don't must be removed.
@@ -3220,11 +3484,9 @@ void Spell::TakeReagents()
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- if (m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP &&
- m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION))
- return;
-
Player* p_caster = (Player*)m_caster;
+ if (p_caster->CanNoReagentCast(m_spellInfo))
+ return;
for(uint32 x=0;x<8;x++)
{
@@ -3240,7 +3502,7 @@ void Spell::TakeReagents()
ItemPrototype const *proto = m_CastItem->GetProto();
if( proto && proto->ItemId == itemid )
{
- for(int s=0;s<5;s++)
+ for(int s=0;s < MAX_ITEM_PROTO_SPELLS; ++s)
{
// CastItem will be used up and does not count as reagent
int32 charges = m_CastItem->GetSpellCharges(s);
@@ -3287,14 +3549,9 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
gameObjTarget = pGOTarget;
uint8 eff = m_spellInfo->Effect[i];
- uint32 mechanic = m_spellInfo->EffectMechanic[i];
sLog.outDebug( "Spell: Effect : %u", eff);
- //Simply return. Do not display "immune" in red text on client
- if(unitTarget && unitTarget->IsImmunedToSpellEffect(eff, mechanic))
- return;
-
//we do not need DamageMultiplier here.
damage = CalculateDamage(i, NULL);
@@ -3311,7 +3568,7 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
EffectEnchantItemTmp(i);
else
{
- sLog.outError("SPELL: unknown effect %u spell id %u\n",
+ sLog.outError("SPELL: unknown effect %u spell id %u",
eff, m_spellInfo->Id);
}
}
@@ -3327,11 +3584,14 @@ void Spell::TriggerSpell()
}
}
-uint8 Spell::CanCast(bool strict)
+SpellCastResult Spell::CheckCast(bool strict)
{
// check cooldowns to prevent cheating
if(m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
{
+ //can cast triggered (by aura only?) spells while have this flag
+ if (!m_IsTriggeredSpell && ((Player*)m_caster)->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
+ return SPELL_FAILED_SPELL_IN_PROGRESS;
if(m_triggeredByAuraSpell)
return SPELL_FAILED_DONT_REPORT;
else
@@ -3348,19 +3608,59 @@ uint8 Spell::CanCast(bool strict)
// for now, ignore triggered spells
if( strict && !m_IsTriggeredSpell)
{
- // Cannot be used in this stance/form
- if(uint8 shapeError = GetErrorAtShapeshiftedCast(m_spellInfo, m_caster->m_form))
- return shapeError;
+ bool checkForm = true;
+ // Ignore form req aura
+ Unit::AuraEffectList const& ignore = m_caster->GetAurasByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
+ for(Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
+ {
+ if (!(*i)->isAffectedOnSpell(m_spellInfo))
+ continue;
+ checkForm = false;
+ break;
+ }
+ if (checkForm)
+ {
+ // Cannot be used in this stance/form
+ SpellCastResult shapeError = GetErrorAtShapeshiftedCast(m_spellInfo, m_caster->m_form);
+ if(shapeError != SPELL_CAST_OK)
+ return shapeError;
- if ((m_spellInfo->Attributes & SPELL_ATTR_ONLY_STEALTHED) && !(m_caster->HasStealthAura()))
- return SPELL_FAILED_ONLY_STEALTHED;
+ if ((m_spellInfo->Attributes & SPELL_ATTR_ONLY_STEALTHED) && !(m_caster->HasStealthAura()))
+ return SPELL_FAILED_ONLY_STEALTHED;
+ }
}
- // caster state requirements
- if(m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraState)))
- return SPELL_FAILED_CASTER_AURASTATE;
- if(m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraStateNot)))
- return SPELL_FAILED_CASTER_AURASTATE;
+ bool reqCombat=true;
+ Unit::AuraEffectList const& stateAuras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
+ for(Unit::AuraEffectList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j)
+ {
+ if((*j)->isAffectedOnSpell(m_spellInfo))
+ {
+ if ((*j)->GetMiscValue()==1)
+ {
+ reqCombat=false;
+ break;
+ }
+ }
+ }
+
+ // caster state requirements
+ // not for triggered spells (needed by execute)
+ if (!m_IsTriggeredSpell)
+ {
+ if(m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraState), m_spellInfo, m_caster))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraStateNot), m_spellInfo, m_caster))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
+ if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->excludeCasterAuraSpell && m_caster->HasAura(m_spellInfo->excludeCasterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
+ if(reqCombat && m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
+ return SPELL_FAILED_AFFECTING_COMBAT;
+ }
// cancel autorepeat spells if cast start when moving
// (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
@@ -3372,22 +3672,26 @@ uint8 Spell::CanCast(bool strict)
return SPELL_FAILED_MOVING;
}
- Unit *target = m_targets.getUnitTarget();
-
- if(target)
+ if(Unit *target = m_targets.getUnitTarget())
{
// target state requirements (not allowed state), apply to self also
- if(m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot)))
+ if(!m_IsTriggeredSpell && m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot), m_spellInfo, m_caster))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ if(m_spellInfo->targetAuraSpell && !target->HasAura(m_spellInfo->targetAuraSpell))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ if(m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
return SPELL_FAILED_TARGET_AURASTATE;
if(target != m_caster)
{
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
- if(m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState)))
+ if(!m_IsTriggeredSpell && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster))
return SPELL_FAILED_TARGET_AURASTATE;
// Not allow casting on flying player
- if (target->isInFlight())
+ if (target->hasUnitState(UNIT_STAT_UNATTACKABLE))
return SPELL_FAILED_BAD_TARGETS;
if(!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
@@ -3396,13 +3700,23 @@ uint8 Spell::CanCast(bool strict)
// auto selection spell rank implemented in WorldSession::HandleCastSpellOpcode
// this case can be triggered if rank not found (too low-level target for first rank)
if(m_caster->GetTypeId() == TYPEID_PLAYER && !IsPassiveSpell(m_spellInfo->Id) && !m_CastItem)
- {
for(int i=0;i<3;i++)
- {
if(IsPositiveEffect(m_spellInfo->Id, i) && m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
if(target->getLevel() + 10 < m_spellInfo->spellLevel)
return SPELL_FAILED_LOWLEVEL;
- }
+ }
+ else if (m_caster->GetTypeId()==TYPEID_PLAYER) // Target - is player caster
+ {
+ // Additional check for some spells
+ // If 0 spell effect empty - client not send target data (need use selection)
+ // TODO: check it on next client version
+ if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
+ m_spellInfo->EffectImplicitTargetA[1] == TARGET_CHAIN_DAMAGE)
+ {
+ if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
+ m_targets.setUnitTarget(target);
+ else
+ return SPELL_FAILED_BAD_TARGETS;
}
}
@@ -3411,7 +3725,7 @@ uint8 Spell::CanCast(bool strict)
{
if(m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET)
{
- target = m_caster->GetPet();
+ target = m_caster->GetGuardianPet();
if(!target)
{
if(m_triggeredByAuraSpell) // not report pet not existence for triggered spells
@@ -3455,14 +3769,15 @@ uint8 Spell::CanCast(bool strict)
}
if(IsPositiveSpell(m_spellInfo->Id))
- {
- if(target->IsImmunedToSpell(m_spellInfo,false))
+ if(target->IsImmunedToSpell(m_spellInfo))
return SPELL_FAILED_TARGET_AURASTATE;
- }
//Must be behind the target.
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster)
- && (m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || m_spellInfo->SpellFamilyFlags != 0x0000000000020000LL))
+ //Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
+ && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags.IsEqual(0x20000,0,0)))
+ //Mutilate no longer requires you be behind the target as of patch 3.0.3
+ && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellInfo->SpellFamilyFlags[1] & 0x200000)))
{
SendInterrupted(2);
return SPELL_FAILED_NOT_BEHIND;
@@ -3477,10 +3792,9 @@ uint8 Spell::CanCast(bool strict)
// check if target is in combat
if (target != m_caster && (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat())
- {
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
- }
}
+
// Spell casted only on battleground
if((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_BATTLEGROUND) && m_caster->GetTypeId()==TYPEID_PLAYER)
if(!((Player*)m_caster)->InBattleGround())
@@ -3490,14 +3804,19 @@ uint8 Spell::CanCast(bool strict)
// - with greater than 15 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag
// - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag
if( (m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) ||
- GetSpellRecoveryTime(m_spellInfo) > 15 * MINUTE * 1000 && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA) )
+ GetSpellRecoveryTime(m_spellInfo) > 15 * MINUTE * IN_MILISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA) )
if(MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId()))
if(mapEntry->IsBattleArena())
return SPELL_FAILED_NOT_IN_ARENA;
// zone check
- if(!IsSpellAllowedInLocation(m_spellInfo,m_caster->GetMapId(),m_caster->GetZoneId(),m_caster->GetAreaId()))
- return SPELL_FAILED_REQUIRES_AREA;
+ uint32 zone, area;
+ m_caster->GetZoneAndAreaId(zone,area);
+
+ SpellCastResult locRes= spellmgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
+ m_caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)m_caster) : NULL);
+ if(locRes != SPELL_CAST_OK)
+ return locRes;
// not let players cast spells at mount (and let do it to creatures)
if( m_caster->IsMounted() && m_caster->GetTypeId()==TYPEID_PLAYER && !m_IsTriggeredSpell &&
@@ -3511,11 +3830,14 @@ uint8 Spell::CanCast(bool strict)
// always (except passive spells) check items (focus object can be required for any type casts)
if(!IsPassiveSpell(m_spellInfo->Id))
- if(uint8 castResult = CheckItems())
+ {
+ SpellCastResult castResult = CheckItems();
+ if(castResult != SPELL_CAST_OK)
return castResult;
+ }
/*//ImpliciteTargetA-B = 38, If fact there is 0 Spell with ImpliciteTargetB=38
- if(m_UniqueTargetInfo.empty()) // skip second canCast apply (for delayed spells for example)
+ if(m_UniqueTargetInfo.empty()) // skip second CheckCast apply (for delayed spells for example)
{
for(uint8 j = 0; j < 3; j++)
{
@@ -3550,7 +3872,7 @@ uint8 Spell::CanCast(bool strict)
cell.data.Part.reserved = ALL_DISTRICT;
MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*m_caster,i_spellST->second.targetEntry,range);
- MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(p_GameObject,go_check);
+ MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck> checker(m_caster, p_GameObject,go_check);
TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -3588,7 +3910,7 @@ uint8 Spell::CanCast(bool strict)
cell.SetNoCreate(); // Really don't know what is that???
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range);
- MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(p_Creature, u_check);
+ MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check);
TypeContainerVisitor<MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
@@ -3651,13 +3973,16 @@ uint8 Spell::CanCast(bool strict)
if(!m_IsTriggeredSpell)
{
- if(uint8 castResult = CheckRange(strict))
+ SpellCastResult castResult = CheckRange(strict);
+ if(castResult != SPELL_CAST_OK)
return castResult;
- if(uint8 castResult = CheckPower())
+ castResult = CheckPower();
+ if(castResult != SPELL_CAST_OK)
return castResult;
- if(uint8 castResult = CheckCasterAuras())
+ castResult = CheckCasterAuras();
+ if(castResult != SPELL_CAST_OK)
return castResult;
}
@@ -3668,12 +3993,7 @@ uint8 Spell::CanCast(bool strict)
{
case SPELL_EFFECT_DUMMY:
{
- if(m_spellInfo->SpellIconID == 1648) // Execute
- {
- if(!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetHealth() > m_targets.getUnitTarget()->GetMaxHealth()*0.2)
- return SPELL_FAILED_BAD_TARGETS;
- }
- else if (m_spellInfo->Id == 51582) // Rocket Boots Engaged
+ if (m_spellInfo->Id == 51582) // Rocket Boots Engaged
{
if(m_caster->IsInWater())
return SPELL_FAILED_ONLY_ABOVEWATER;
@@ -3682,7 +4002,7 @@ uint8 Spell::CanCast(bool strict)
{
// spell different for friends and enemies
// hart version required facing
- if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI, target ))
+ if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI, m_targets.getUnitTarget() ))
return SPELL_FAILED_UNIT_NOT_INFRONT;
}
else if (m_spellInfo->Id == 19938) // Awaken Peon
@@ -3693,25 +4013,15 @@ uint8 Spell::CanCast(bool strict)
}
break;
}
- case SPELL_EFFECT_SCHOOL_DAMAGE:
- {
- // Hammer of Wrath
- if(m_spellInfo->SpellVisual == 7250)
- {
- if (!m_targets.getUnitTarget())
- return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
-
- if(m_targets.getUnitTarget()->GetHealth() > m_targets.getUnitTarget()->GetMaxHealth()*0.2)
- return SPELL_FAILED_BAD_TARGETS;
- }
- break;
- }
case SPELL_EFFECT_LEARN_SPELL:
{
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_BAD_TARGETS;
+
if(m_spellInfo->EffectImplicitTargetA[i] != TARGET_PET)
break;
- Pet* pet = m_caster->GetPet();
+ Pet* pet = ((Player*)m_caster)->GetPet();
if(!pet)
return SPELL_FAILED_NO_PET;
@@ -3721,21 +4031,17 @@ uint8 Spell::CanCast(bool strict)
if(!learn_spellproto)
return SPELL_FAILED_NOT_KNOWN;
- if(!pet->CanTakeMoreActiveSpells(learn_spellproto->Id))
- return SPELL_FAILED_TOO_MANY_SKILLS;
-
if(m_spellInfo->spellLevel > pet->getLevel())
return SPELL_FAILED_LOWLEVEL;
- if(!pet->HasTPForSpell(learn_spellproto->Id))
- return SPELL_FAILED_TRAINING_POINTS;
-
break;
}
case SPELL_EFFECT_LEARN_PET_SPELL:
{
- Pet* pet = m_caster->GetPet();
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_BAD_TARGETS;
+ Pet* pet = ((Player*)m_caster)->GetPet();
if(!pet)
return SPELL_FAILED_NO_PET;
@@ -3744,31 +4050,29 @@ uint8 Spell::CanCast(bool strict)
if(!learn_spellproto)
return SPELL_FAILED_NOT_KNOWN;
- if(!pet->CanTakeMoreActiveSpells(learn_spellproto->Id))
- return SPELL_FAILED_TOO_MANY_SKILLS;
-
if(m_spellInfo->spellLevel > pet->getLevel())
return SPELL_FAILED_LOWLEVEL;
- if(!pet->HasTPForSpell(learn_spellproto->Id))
- return SPELL_FAILED_TRAINING_POINTS;
-
break;
}
case SPELL_EFFECT_FEED_PET:
{
- if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_targets.getItemTarget() )
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_BAD_TARGETS;
- Pet* pet = m_caster->GetPet();
+ Item* foodItem = m_targets.getItemTarget();
+ if(!foodItem)
+ return SPELL_FAILED_BAD_TARGETS;
+
+ Pet* pet = ((Player*)m_caster)->GetPet();
if(!pet)
return SPELL_FAILED_NO_PET;
- if(!pet->HaveInDiet(m_targets.getItemTarget()->GetProto()))
+ if(!pet->HaveInDiet(foodItem->GetProto()))
return SPELL_FAILED_WRONG_PET_FOOD;
- if(!pet->GetCurrentFoodBenefitLevel(m_targets.getItemTarget()->GetProto()->ItemLevel))
+ if(!pet->GetCurrentFoodBenefitLevel(foodItem->GetProto()->ItemLevel))
return SPELL_FAILED_FOOD_LOWLEVEL;
if(m_caster->isInCombat() || pet->isInCombat())
@@ -3840,130 +4144,40 @@ uint8 Spell::CanCast(bool strict)
// In BattleGround players can use only flags and banners
if( ((Player*)m_caster)->InBattleGround() &&
- !((Player*)m_caster)->isAllowUseBattleGroundObject() )
+ !((Player*)m_caster)->CanUseBattleGroundObject() )
return SPELL_FAILED_TRY_AGAIN;
// get the lock entry
- LockEntry const *lockInfo = NULL;
+ uint32 lockId = 0;
if (GameObject* go=m_targets.getGOTarget())
- lockInfo = sLockStore.LookupEntry(go->GetLockId());
+ lockId = go->GetLockId();
else if(Item* itm=m_targets.getItemTarget())
- lockInfo = sLockStore.LookupEntry(itm->GetProto()->LockID);
-
- // check lock compatibility
- if (lockInfo)
- {
- // check for lock - key pair (checked by client also, just prevent cheating
- bool ok_key = false;
- for(int it = 0; it < 5; ++it)
- {
- switch(lockInfo->keytype[it])
- {
- case LOCK_KEY_NONE:
- break;
- case LOCK_KEY_ITEM:
- {
- if(lockInfo->key[it])
- {
- if(m_CastItem && m_CastItem->GetEntry()==lockInfo->key[it])
- ok_key =true;
- break;
- }
- }
- case LOCK_KEY_SKILL:
- {
- if(uint32(m_spellInfo->EffectMiscValue[i])!=lockInfo->key[it])
- break;
+ lockId = itm->GetProto()->LockID;
- switch(lockInfo->key[it])
- {
- case LOCKTYPE_HERBALISM:
- if(((Player*)m_caster)->HasSkill(SKILL_HERBALISM))
- ok_key =true;
- break;
- case LOCKTYPE_MINING:
- if(((Player*)m_caster)->HasSkill(SKILL_MINING))
- ok_key =true;
- break;
- default:
- ok_key =true;
- break;
- }
- }
- }
- if(ok_key)
- break;
- }
+ SkillType skillId =SKILL_NONE;
+ int32 reqSkillValue = 0;
+ int32 skillValue = 0;
- if(!ok_key)
- return SPELL_FAILED_BAD_TARGETS;
- }
+ // check lock compatibility
+ SpellCastResult res = CanOpenLock(i,lockId,skillId,reqSkillValue,skillValue);
+ if(res != SPELL_CAST_OK)
+ return res;
// chance for fail at orange mining/herb/LockPicking gathering attempt
- if (!m_selfContainer || ((*m_selfContainer) != this))
- break;
-
- // get the skill value of the player
- int32 SkillValue = 0;
- bool canFailAtMax = true;
- if (m_spellInfo->EffectMiscValue[i] == LOCKTYPE_HERBALISM)
+ // second check prevent fail at rechecks
+ if(skillId != SKILL_NONE && (!m_selfContainer || ((*m_selfContainer) != this)))
{
- SkillValue = ((Player*)m_caster)->GetSkillValue(SKILL_HERBALISM);
- canFailAtMax = false;
- }
- else if (m_spellInfo->EffectMiscValue[i] == LOCKTYPE_MINING)
- {
- SkillValue = ((Player*)m_caster)->GetSkillValue(SKILL_MINING);
- canFailAtMax = false;
- }
- else if (m_spellInfo->EffectMiscValue[i] == LOCKTYPE_PICKLOCK)
- SkillValue = ((Player*)m_caster)->GetSkillValue(SKILL_LOCKPICKING);
-
- // castitem check: rogue using skeleton keys. the skill values should not be added in this case.
- if(m_CastItem)
- SkillValue = 0;
-
- // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value)
- // TODO: is this a hack?
- SkillValue += m_currentBasePoints[i]+1;
-
- // get the required lock value
- int32 ReqValue=0;
- if (lockInfo)
- {
- // check for lock - key pair
- bool ok = false;
- for(int it = 0; it < 5; ++it)
- {
- if(lockInfo->keytype[it]==LOCK_KEY_ITEM && lockInfo->key[it] && m_CastItem && m_CastItem->GetEntry()==lockInfo->key[it])
- {
- // if so, we're good to go
- ok = true;
- break;
- }
- }
- if(ok)
- break;
+ bool canFailAtMax = skillId != SKILL_HERBALISM && skillId != SKILL_MINING;
- if (m_spellInfo->EffectMiscValue[i] == LOCKTYPE_PICKLOCK)
- ReqValue = lockInfo->requiredlockskill;
- else
- ReqValue = lockInfo->requiredminingskill;
+ // chance for failure in orange gather / lockpick (gathering skill can't fail at maxskill)
+ if((canFailAtMax || skillValue < sWorld.GetConfigMaxSkillValue()) && reqSkillValue > irand(skillValue-25, skillValue+37))
+ return SPELL_FAILED_TRY_AGAIN;
}
-
- // skill doesn't meet the required value
- if (ReqValue > SkillValue)
- return SPELL_FAILED_LOW_CASTLEVEL;
-
- // chance for failure in orange gather / lockpick (gathering skill can't fail at maxskill)
- if((canFailAtMax || SkillValue < sWorld.GetConfigMaxSkillValue()) && ReqValue > irand(SkillValue-25, SkillValue+37))
- return SPELL_FAILED_TRY_AGAIN;
-
break;
}
case SPELL_EFFECT_SUMMON_DEAD_PET:
{
- Creature *pet = m_caster->GetPet();
+ Creature *pet = m_caster->GetGuardianPet();
if(!pet)
return SPELL_FAILED_NO_PET;
@@ -3972,16 +4186,11 @@ uint8 Spell::CanCast(bool strict)
break;
}
- // This is generic summon effect now and don't make this check for summon types similar
- // SPELL_EFFECT_SUMMON_CRITTER, SPELL_EFFECT_SUMMON_WILD or SPELL_EFFECT_SUMMON_GUARDIAN.
- // These won't show up in m_caster->GetPetGUID()
+ // This is generic summon effect
case SPELL_EFFECT_SUMMON:
{
switch(m_spellInfo->EffectMiscValueB[i])
{
- case SUMMON_TYPE_POSESSED:
- case SUMMON_TYPE_POSESSED2:
- case SUMMON_TYPE_POSESSED3:
case SUMMON_TYPE_DEMON:
case SUMMON_TYPE_SUMMON:
{
@@ -3993,13 +4202,25 @@ uint8 Spell::CanCast(bool strict)
break;
}
}
+ SummonPropertiesEntry const *SummonProperties = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[i]);
+ if(!SummonProperties)
+ break;
+ switch(SummonProperties->Category)
+ {
+ case SUMMON_CATEGORY_POSSESSED:
+ {
+ if(m_caster->GetPetGUID())
+ return SPELL_FAILED_ALREADY_HAVE_SUMMON;
+
+ if(m_caster->GetCharmGUID())
+ return SPELL_FAILED_ALREADY_HAVE_CHARM;
+ break;
+ }
+ }
break;
}
- // Don't make this check for SPELL_EFFECT_SUMMON_CRITTER, SPELL_EFFECT_SUMMON_WILD or SPELL_EFFECT_SUMMON_GUARDIAN.
- // These won't show up in m_caster->GetPetGUID()
- case SPELL_EFFECT_SUMMON_POSSESSED:
+ // Not used for summon?
case SPELL_EFFECT_SUMMON_PHANTASM:
- case SPELL_EFFECT_SUMMON_DEMON:
{
if(m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
@@ -4013,13 +4234,11 @@ uint8 Spell::CanCast(bool strict)
{
if(m_caster->GetPetGUID()) //let warlock do a replacement summon
{
-
- Pet* pet = ((Player*)m_caster)->GetPet();
-
if (m_caster->GetTypeId()==TYPEID_PLAYER && m_caster->getClass()==CLASS_WARLOCK)
{
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
- pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
+ if(Pet* pet = ((Player*)m_caster)->GetPet())
+ pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
}
else
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
@@ -4055,7 +4274,7 @@ uint8 Spell::CanCast(bool strict)
case SPELL_EFFECT_LEAP:
case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
{
- float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float dis = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
float fx = m_caster->GetPositionX() + dis * cos(m_caster->GetOrientation());
float fy = m_caster->GetPositionY() + dis * sin(m_caster->GetOrientation());
// teleport a bit above terrain level to avoid falling below it
@@ -4091,25 +4310,38 @@ uint8 Spell::CanCast(bool strict)
{
case SPELL_AURA_DUMMY:
{
- if(m_spellInfo->Id == 1515)
+ //custom check
+ switch(m_spellInfo->Id)
{
- if (!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
- return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
+ case 61336:
+ if(m_caster->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm())
+ return SPELL_FAILED_ONLY_SHAPESHIFT;
+ break;
+ case 1515:
+ {
+ if (!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
+ return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
- if (m_targets.getUnitTarget()->getLevel() > m_caster->getLevel())
- return SPELL_FAILED_HIGHLEVEL;
+ if (m_targets.getUnitTarget()->getLevel() > m_caster->getLevel())
+ return SPELL_FAILED_HIGHLEVEL;
- // use SMSG_PET_TAME_FAILURE?
- if (!((Creature*)m_targets.getUnitTarget())->GetCreatureInfo()->isTameable ())
- return SPELL_FAILED_BAD_TARGETS;
+ // use SMSG_PET_TAME_FAILURE?
+ if (!((Creature*)m_targets.getUnitTarget())->GetCreatureInfo()->isTameable ())
+ return SPELL_FAILED_BAD_TARGETS;
- if(m_caster->GetPetGUID())
- return SPELL_FAILED_ALREADY_HAVE_SUMMON;
+ if(m_caster->GetPetGUID())
+ return SPELL_FAILED_ALREADY_HAVE_SUMMON;
- if(m_caster->GetCharmGUID())
- return SPELL_FAILED_ALREADY_HAVE_CHARM;
+ if(m_caster->GetCharmGUID())
+ return SPELL_FAILED_ALREADY_HAVE_CHARM;
+
+ break;
+ }
+ default:
+ break;
}
- }break;
+ break;
+ }
case SPELL_AURA_MOD_POSSESS:
case SPELL_AURA_MOD_CHARM:
{
@@ -4142,17 +4374,14 @@ uint8 Spell::CanCast(bool strict)
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
- if (m_caster->GetTypeId()==TYPEID_PLAYER && !sMapStore.LookupEntry(m_caster->GetMapId())->IsMountAllowed() && !m_IsTriggeredSpell && !m_spellInfo->AreaId)
- return SPELL_FAILED_NO_MOUNTS_ALLOWED;
-
- if (m_caster->GetAreaId()==35)
+ if (m_caster->GetTypeId()==TYPEID_PLAYER && !sMapStore.LookupEntry(m_caster->GetMapId())->IsMountAllowed() && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId)
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
ShapeshiftForm form = m_caster->m_form;
if( form == FORM_CAT || form == FORM_TREE || form == FORM_TRAVEL ||
form == FORM_AQUA || form == FORM_BEAR || form == FORM_DIREBEAR ||
form == FORM_CREATUREBEAR || form == FORM_GHOSTWOLF || form == FORM_FLIGHT ||
- form == FORM_FLIGHT_EPIC || form == FORM_MOONKIN )
+ form == FORM_FLIGHT_EPIC || form == FORM_MOONKIN || form == FORM_METAMORPHOSIS )
return SPELL_FAILED_NOT_SHAPESHIFT;
break;
@@ -4171,11 +4400,10 @@ uint8 Spell::CanCast(bool strict)
case SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED:
case SPELL_AURA_FLY:
{
- // not allow cast fly spells at old maps by players (all spells is self target)
+ // not allow cast fly spells at old maps by players (all spells is self target)
if(m_caster->GetTypeId()==TYPEID_PLAYER)
{
- if( !((Player*)m_caster)->isGameMaster() &&
- GetVirtualMapForMapAndZone(m_caster->GetMapId(),m_caster->GetZoneId()) != 530)
+ if( !((Player*)m_caster)->IsAllowUseFlyMountsHere() )
return SPELL_FAILED_NOT_HERE;
}
break;
@@ -4199,10 +4427,10 @@ uint8 Spell::CanCast(bool strict)
}
// all ok
- return 0;
+ return SPELL_CAST_OK;
}
-int16 Spell::PetCanCast(Unit* target)
+SpellCastResult Spell::CheckPetCast(Unit* target)
{
if(!m_caster->isAlive())
return SPELL_FAILED_CASTER_DEAD;
@@ -4250,20 +4478,16 @@ int16 Spell::PetCanCast(Unit* target)
return SPELL_FAILED_NOT_READY;
}
- uint16 result = CanCast(true);
- if(result != 0)
- return result;
- else
- return -1; //this allows to check spell fail 0, in combat
+ return CheckCast(true);
}
-uint8 Spell::CheckCasterAuras() const
+SpellCastResult Spell::CheckCasterAuras() const
{
// Flag drop spells totally immuned to caster auras
// FIXME: find more nice check for all totally immuned spells
// AttributesEx3 & 0x10000000?
if(m_spellInfo->Id==23336 || m_spellInfo->Id==23334 || m_spellInfo->Id==34991)
- return 0;
+ return SPELL_CAST_OK;
uint8 school_immune = 0;
uint32 mechanic_immune = 0;
@@ -4283,26 +4507,27 @@ uint8 Spell::CheckCasterAuras() const
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
}
//immune movement impairment and loss of control
- if(m_spellInfo->Id==(uint32)42292)
+ if(m_spellInfo->Id==42292 || m_spellInfo->Id==59752)
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
}
//Check whether the cast should be prevented by any state you might have.
- uint8 prevented_reason = 0;
+ SpellCastResult prevented_reason = SPELL_CAST_OK;
// Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
- if(!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) && m_caster->HasAuraType(SPELL_AURA_MOD_STUN))
+ uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state
+ if(unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
prevented_reason = SPELL_FAILED_STUNNED;
- else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED) && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
+ else if(unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
prevented_reason = SPELL_FAILED_CONFUSED;
- else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING) && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
+ else if(unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
prevented_reason = SPELL_FAILED_FLEEING;
- else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED) && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
+ else if(unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
prevented_reason = SPELL_FAILED_SILENCED;
- else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
+ else if(unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
prevented_reason = SPELL_FAILED_PACIFIED;
// Attr must make flag drop spell totally immune from all effects
- if(prevented_reason)
+ if(prevented_reason != SPELL_CAST_OK)
{
if(school_immune || mechanic_immune || dispel_immune)
{
@@ -4312,7 +4537,7 @@ uint8 Spell::CheckCasterAuras() const
{
if(itr->second)
{
- if( GetSpellMechanicMask(itr->second->GetSpellProto(), itr->second->GetEffIndex()) & mechanic_immune )
+ if( GetAllSpellMechanicMask(itr->second->GetSpellProto()) & mechanic_immune )
continue;
if( GetSpellSchoolMask(itr->second->GetSpellProto()) & school_immune )
continue;
@@ -4321,28 +4546,34 @@ uint8 Spell::CheckCasterAuras() const
//Make a second check for spell failed so the right SPELL_FAILED message is returned.
//That is needed when your casting is prevented by multiple states and you are only immune to some of them.
- switch(itr->second->GetModifier()->m_auraname)
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
- case SPELL_AURA_MOD_STUN:
- if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
- return SPELL_FAILED_STUNNED;
- break;
- case SPELL_AURA_MOD_CONFUSE:
- if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
- return SPELL_FAILED_CONFUSED;
- break;
- case SPELL_AURA_MOD_FEAR:
- if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
- return SPELL_FAILED_FLEEING;
- break;
- case SPELL_AURA_MOD_SILENCE:
- case SPELL_AURA_MOD_PACIFY:
- case SPELL_AURA_MOD_PACIFY_SILENCE:
- if( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
- return SPELL_FAILED_PACIFIED;
- else if ( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
- return SPELL_FAILED_SILENCED;
- break;
+ if (AuraEffect * part = itr->second->GetPartAura(i))
+ {
+ switch(part->GetAuraName())
+ {
+ case SPELL_AURA_MOD_STUN:
+ if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
+ return SPELL_FAILED_STUNNED;
+ break;
+ case SPELL_AURA_MOD_CONFUSE:
+ if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
+ return SPELL_FAILED_CONFUSED;
+ break;
+ case SPELL_AURA_MOD_FEAR:
+ if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
+ return SPELL_FAILED_FLEEING;
+ break;
+ case SPELL_AURA_MOD_SILENCE:
+ case SPELL_AURA_MOD_PACIFY:
+ case SPELL_AURA_MOD_PACIFY_SILENCE:
+ if( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
+ return SPELL_FAILED_PACIFIED;
+ else if ( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
+ return SPELL_FAILED_SILENCED;
+ break;
+ }
+ }
}
}
}
@@ -4351,7 +4582,7 @@ uint8 Spell::CheckCasterAuras() const
else
return prevented_reason;
}
- return 0; // all ok
+ return SPELL_CAST_OK;
}
bool Spell::CanAutoCast(Unit* target)
@@ -4364,25 +4595,26 @@ bool Spell::CanAutoCast(Unit* target)
{
if( m_spellInfo->StackAmount <= 1)
{
- if( target->HasAura(m_spellInfo->Id, j) )
+ if( target->HasAuraEffect(m_spellInfo->Id, j) )
return false;
}
else
{
- if( target->GetAuras().count(Unit::spellEffectPair(m_spellInfo->Id, j)) >= m_spellInfo->StackAmount)
- return false;
+ if( AuraEffect * aureff = target->GetAuraEffect(m_spellInfo->Id, j))
+ if (aureff->GetParentAura()->GetStackAmount() >= m_spellInfo->StackAmount)
+ return false;
}
}
else if ( IsAreaAuraEffect( m_spellInfo->Effect[j] ))
{
- if( target->HasAura(m_spellInfo->Id, j) )
+ if( target->HasAuraEffect(m_spellInfo->Id, j) )
return false;
}
}
- int16 result = PetCanCast(target);
+ SpellCastResult result = CheckPetCast(target);
- if(result == -1 || result == SPELL_FAILED_UNIT_NOT_INFRONT)
+ if(result == SPELL_CAST_OK || result == SPELL_FAILED_UNIT_NOT_INFRONT)
{
FillTargetMap();
//check if among target units, our WANTED target is as well (->only self cast spells return false)
@@ -4393,12 +4625,13 @@ bool Spell::CanAutoCast(Unit* target)
return false; //target invalid
}
-uint8 Spell::CheckRange(bool strict)
+SpellCastResult Spell::CheckRange(bool strict)
{
//float range_mod;
// self cast doesn't need range checking -- also for Starshards fix
- if (m_spellInfo->rangeIndex == 1) return 0;
+ if (m_spellInfo->rangeIndex == 1)
+ return SPELL_CAST_OK;
// i do not know why we need this
/*if (strict) //add radius of caster
@@ -4407,15 +4640,15 @@ uint8 Spell::CheckRange(bool strict)
range_mod = 6.25;*/
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
- float max_range = GetSpellMaxRange(srange); // + range_mod;
- float min_range = GetSpellMinRange(srange);
+
+ Unit *target = m_targets.getUnitTarget();
+ float max_range = m_caster->GetSpellMaxRangeForTarget(target, srange); // + range_mod;
+ float min_range = m_caster->GetSpellMinRangeForTarget(target, srange);
uint32 range_type = GetSpellRangeType(srange);
if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range, this);
- Unit *target = m_targets.getUnitTarget();
-
if(target && target != m_caster)
{
if(range_type == SPELL_RANGE_MELEE)
@@ -4449,7 +4682,7 @@ uint8 Spell::CheckRange(bool strict)
return SPELL_FAILED_TOO_CLOSE;
}
- return 0; // ok
+ return SPELL_CAST_OK;
}
int32 Spell::CalculatePowerCost()
@@ -4489,9 +4722,12 @@ int32 Spell::CalculatePowerCost()
case POWER_FOCUS:
case POWER_ENERGY:
case POWER_HAPPINESS:
- // case POWER_RUNES:
powerCost += m_spellInfo->ManaCostPercentage * m_caster->GetMaxPower(Powers(m_spellInfo->powerType)) / 100;
break;
+ case POWER_RUNE:
+ case POWER_RUNIC_POWER:
+ sLog.outDebug("Spell::CalculateManaCost: Not implemented yet!");
+ break;
default:
sLog.outError("Spell::CalculateManaCost: Unknown power type '%d' in spell %d", m_spellInfo->powerType, m_spellInfo->Id);
return 0;
@@ -4517,39 +4753,43 @@ int32 Spell::CalculatePowerCost()
return powerCost;
}
-uint8 Spell::CheckPower()
+SpellCastResult Spell::CheckPower()
{
// item cast not used power
if(m_CastItem)
- return 0;
+ return SPELL_CAST_OK;
// health as power used - need check health amount
if(m_spellInfo->powerType == POWER_HEALTH)
{
if(m_caster->GetHealth() <= m_powerCost)
return SPELL_FAILED_CASTER_AURASTATE;
- return 0;
+ return SPELL_CAST_OK;
}
// Check valid power type
if( m_spellInfo->powerType >= MAX_POWERS )
{
- sLog.outError("Spell::CheckMana: Unknown power type '%d'", m_spellInfo->powerType);
+ sLog.outError("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->powerType);
return SPELL_FAILED_UNKNOWN;
}
+
+ SpellCastResult failReason = CheckRuneCost(m_spellInfo->runeCostID);
+ if(failReason != SPELL_CAST_OK)
+ return failReason;
+
// Check power amount
Powers powerType = Powers(m_spellInfo->powerType);
if(m_caster->GetPower(powerType) < m_powerCost)
return SPELL_FAILED_NO_POWER;
else
- return 0;
+ return SPELL_CAST_OK;
}
-uint8 Spell::CheckItems()
+SpellCastResult Spell::CheckItems()
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return 0;
+ return SPELL_CAST_OK;
- uint32 itemid, itemcount;
Player* p_caster = (Player*)m_caster;
if(!m_CastItem)
@@ -4559,77 +4799,72 @@ uint8 Spell::CheckItems()
}
else
{
- itemid = m_CastItem->GetEntry();
+ uint32 itemid = m_CastItem->GetEntry();
if( !p_caster->HasItemCount(itemid,1) )
return SPELL_FAILED_ITEM_NOT_READY;
- else
- {
- ItemPrototype const *proto = m_CastItem->GetProto();
- if(!proto)
- return SPELL_FAILED_ITEM_NOT_READY;
- for (int i = 0; i<5; i++)
+ ItemPrototype const *proto = m_CastItem->GetProto();
+ if(!proto)
+ return SPELL_FAILED_ITEM_NOT_READY;
+
+ for (int i = 0; i<5; i++)
+ if (proto->Spells[i].SpellCharges)
+ if(m_CastItem->GetSpellCharges(i)==0)
+ return SPELL_FAILED_NO_CHARGES_REMAIN;
+
+ // consumable cast item checks
+ if (proto->Class == ITEM_CLASS_CONSUMABLE && m_targets.getUnitTarget())
+ {
+ // such items should only fail if there is no suitable effect at all - see Rejuvenation Potions for example
+ SpellCastResult failReason = SPELL_CAST_OK;
+ for (int i = 0; i < 3; i++)
{
- if (proto->Spells[i].SpellCharges)
+ // skip check, pet not required like checks, and for TARGET_PET m_targets.getUnitTarget() is not the real target but the caster
+ if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_PET)
+ continue;
+
+ if (m_spellInfo->Effect[i] == SPELL_EFFECT_HEAL)
{
- if(m_CastItem->GetSpellCharges(i)==0)
- return SPELL_FAILED_NO_CHARGES_REMAIN;
+ if (m_targets.getUnitTarget()->GetHealth() == m_targets.getUnitTarget()->GetMaxHealth())
+ {
+ failReason = SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
+ continue;
+ }
+ else
+ {
+ failReason = SPELL_CAST_OK;
+ break;
+ }
}
- }
- uint32 ItemClass = proto->Class;
- if (ItemClass == ITEM_CLASS_CONSUMABLE && m_targets.getUnitTarget())
- {
- // such items should only fail if there is no suitable effect at all - see Rejuvenation Potions for example
- uint8 failReason = 0;
- for (int i = 0; i < 3; i++)
+ // Mana Potion, Rage Potion, Thistle Tea(Rogue), ...
+ if (m_spellInfo->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
- // skip check, pet not required like checks, and for TARGET_PET m_targets.getUnitTarget() is not the real target but the caster
- if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_PET)
+ if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
+ {
+ failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER;
continue;
+ }
- if (m_spellInfo->Effect[i] == SPELL_EFFECT_HEAL)
+ Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
+ if (m_targets.getUnitTarget()->GetPower(power) == m_targets.getUnitTarget()->GetMaxPower(power))
{
- if (m_targets.getUnitTarget()->GetHealth() == m_targets.getUnitTarget()->GetMaxHealth())
- {
- failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
- continue;
- }
- else
- {
- failReason = 0;
- break;
- }
+ failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER;
+ continue;
}
-
- // Mana Potion, Rage Potion, Thistle Tea(Rogue), ...
- if (m_spellInfo->Effect[i] == SPELL_EFFECT_ENERGIZE)
+ else
{
- if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
- {
- failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
- continue;
- }
-
- Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
- if (m_targets.getUnitTarget()->GetPower(power) == m_targets.getUnitTarget()->GetMaxPower(power))
- {
- failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
- continue;
- }
- else
- {
- failReason = 0;
- break;
- }
+ failReason = SPELL_CAST_OK;
+ break;
}
}
- if (failReason)
- return failReason;
}
+ if (failReason != SPELL_CAST_OK)
+ return failReason;
}
}
+ // check target item
if(m_targets.getItemTargetGUID())
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -4648,6 +4883,7 @@ uint8 Spell::CheckItems()
return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
+ // check spell focus object
if(m_spellInfo->RequiresSpellFocus)
{
CellPair p(Trinity::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
@@ -4655,29 +4891,29 @@ uint8 Spell::CheckItems()
cell.data.Part.reserved = ALL_DISTRICT;
GameObject* ok = NULL;
- Trinity::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus);
- Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck> checker(ok,go_check);
+ MaNGOS::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus);
+ MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck> checker(m_caster,ok,go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
if(!ok)
- return (uint8)SPELL_FAILED_REQUIRES_SPELL_FOCUS;
+ return SPELL_FAILED_REQUIRES_SPELL_FOCUS;
focusObject = ok; // game object found in range
}
- if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP &&
- m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION)))
+ // check reagents (ignore triggered spells with reagents processed by original spell) and special reagent ignore case.
+ if (!m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo))
{
for(uint32 i=0;i<8;i++)
{
if(m_spellInfo->Reagent[i] <= 0)
continue;
- itemid = m_spellInfo->Reagent[i];
- itemcount = m_spellInfo->ReagentCount[i];
+ uint32 itemid = m_spellInfo->Reagent[i];
+ uint32 itemcount = m_spellInfo->ReagentCount[i];
// if CastItem is also spell reagent
if( m_CastItem && m_CastItem->GetEntry() == itemid )
@@ -4685,7 +4921,7 @@ uint8 Spell::CheckItems()
ItemPrototype const *proto = m_CastItem->GetProto();
if(!proto)
return SPELL_FAILED_ITEM_NOT_READY;
- for(int s=0;s<5;s++)
+ for(int s=0; s < MAX_ITEM_PROTO_SPELLS; ++s)
{
// CastItem will be used up and does not count as reagent
int32 charges = m_CastItem->GetSpellCharges(s);
@@ -4697,10 +4933,11 @@ uint8 Spell::CheckItems()
}
}
if( !p_caster->HasItemCount(itemid,itemcount) )
- return (uint8)SPELL_FAILED_ITEM_NOT_READY; //0x54
+ return SPELL_FAILED_ITEM_NOT_READY; //0x54
}
}
+ // check totem-item requirements (items presence in inventory)
uint32 totems = 2;
for(int i=0;i<2;++i)
{
@@ -4715,9 +4952,9 @@ uint8 Spell::CheckItems()
totems -= 1;
}
if(totems != 0)
- return (uint8)SPELL_FAILED_TOTEMS; //0x7C
+ return SPELL_FAILED_TOTEMS; //0x7C
- //Check items for TotemCategory
+ // Check items for TotemCategory (items presence in inventory)
uint32 TotemCategory = 2;
for(int i=0;i<2;++i)
{
@@ -4733,8 +4970,9 @@ uint8 Spell::CheckItems()
TotemCategory -= 1;
}
if(TotemCategory != 0)
- return (uint8)SPELL_FAILED_TOTEM_CATEGORY; //0x7B
+ return SPELL_FAILED_TOTEM_CATEGORY; //0x7B
+ // special checks for spell effects
for(int i = 0; i < 3; i++)
{
switch (m_spellInfo->Effect[i])
@@ -4754,6 +4992,7 @@ uint8 Spell::CheckItems()
break;
}
case SPELL_EFFECT_ENCHANT_ITEM:
+ case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
{
Item* targetItem = m_targets.getItemTarget();
if(!targetItem)
@@ -4837,13 +5076,36 @@ uint8 Spell::CheckItems()
return SPELL_FAILED_LOW_CASTLEVEL;
//make sure the player has the required ores in inventory
if(m_targets.getItemTarget()->GetCount() < 5)
- return SPELL_FAILED_PROSPECT_NEED_MORE;
+ return SPELL_FAILED_NEED_MORE_ITEMS;
if(!LootTemplates_Prospecting.HaveLootFor(m_targets.getItemTargetEntry()))
return SPELL_FAILED_CANT_BE_PROSPECTED;
break;
}
+ case SPELL_EFFECT_MILLING:
+ {
+ if(!m_targets.getItemTarget())
+ return SPELL_FAILED_CANT_BE_MILLED;
+ //ensure item is a millable herb
+ if(!(m_targets.getItemTarget()->GetProto()->BagFamily & BAG_FAMILY_MASK_HERBS) || m_targets.getItemTarget()->GetProto()->Class != ITEM_CLASS_TRADE_GOODS)
+ return SPELL_FAILED_CANT_BE_MILLED;
+ //prevent milling in trade slot
+ if( m_targets.getItemTarget()->GetOwnerGUID() != m_caster->GetGUID() )
+ return SPELL_FAILED_CANT_BE_MILLED;
+ //Check for enough skill in inscription
+ uint32 item_millingskilllevel = m_targets.getItemTarget()->GetProto()->RequiredSkillRank;
+ if(item_millingskilllevel >p_caster->GetSkillValue(SKILL_INSCRIPTION))
+ return SPELL_FAILED_LOW_CASTLEVEL;
+ //make sure the player has the required herbs in inventory
+ if(m_targets.getItemTarget()->GetCount() < 5)
+ return SPELL_FAILED_NEED_MORE_ITEMS;
+
+ if(!LootTemplates_Milling.HaveLootFor(m_targets.getItemTargetEntry()))
+ return SPELL_FAILED_CANT_BE_MILLED;
+
+ break;
+ }
case SPELL_EFFECT_WEAPON_DAMAGE:
case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
{
@@ -4912,7 +5174,7 @@ uint8 Spell::CheckItems()
}
}
- return uint8(0);
+ return SPELL_CAST_OK;
}
void Spell::Delayed() // only called in DealDamage()
@@ -4923,18 +5185,22 @@ void Spell::Delayed() // only called in DealDamage()
//if (m_spellState == SPELL_STATE_DELAYED)
// return; // spell is active and can't be time-backed
+ if(isDelayableNoMore()) // Spells may only be delayed twice
+ return;
+
// spells not loosing casting time ( slam, dynamites, bombs.. )
//if(!(m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_DAMAGE))
// return;
- //check resist chance
- int32 resistChance = 100; //must be initialized to 100 for percent modifiers
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,resistChance, this);
- resistChance += m_caster->GetTotalAuraModifier(SPELL_AURA_RESIST_PUSHBACK) - 100;
- if (roll_chance_i(resistChance))
+ //check pushback reduce
+ int32 delaytime = 500; // spellcasting delay is normally 500ms
+ int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
+ delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
+ if(delayReduce >= 100)
return;
- int32 delaytime = GetNextDelayAtDamageMsTime();
+ delaytime = delaytime * (100 - delayReduce) / 100;
if(int32(m_timer) + delaytime > m_casttime)
{
@@ -4958,14 +5224,18 @@ void Spell::DelayedChannel()
if(!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER || getState() != SPELL_STATE_CASTING)
return;
- //check resist chance
- int32 resistChance = 100; //must be initialized to 100 for percent modifiers
- ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,resistChance, this);
- resistChance += m_caster->GetTotalAuraModifier(SPELL_AURA_RESIST_PUSHBACK) - 100;
- if (roll_chance_i(resistChance))
+ if(isDelayableNoMore()) // Spells may only be delayed twice
+ return;
+
+ //check pushback reduce
+ int32 delaytime = GetSpellDuration(m_spellInfo) * 25 / 100; // channeling delay is normally 25% of its time per hit
+ int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
+ ((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,delayReduce, this);
+ delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
+ if(delayReduce >= 100)
return;
- int32 delaytime = GetNextDelayAtDamageMsTime();
+ delaytime = delaytime * (100 - delayReduce) / 100;
if(int32(m_timer) < delaytime)
{
@@ -4984,11 +5254,8 @@ void Spell::DelayedChannel()
Unit* unit = m_caster->GetGUID()==ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if (unit)
{
- for (int j=0;j<3;j++)
- if( ihit->effectMask & (1<<j) )
- unit->DelayAura(m_spellInfo->Id, j, delaytime);
+ unit->DelayAura(m_spellInfo->Id, m_caster->GetGUID(), delaytime);
}
-
}
}
@@ -5019,17 +5286,12 @@ void Spell::UpdatePointers()
m_targets.Update(m_caster);
}
-bool Spell::IsAffectedBy(SpellEntry const *spellInfo, uint32 effectId)
-{
- return spellmgr.IsAffectedBySpell(m_spellInfo,spellInfo->Id,effectId,spellInfo->EffectItemType[effectId]);
-}
-
bool Spell::CheckTargetCreatureType(Unit* target) const
{
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
// Curse of Doom : not find another way to fix spell target check :/
- if(m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags == 0x0200000000LL)
+ if(m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags.IsEqual(0,0x02,0))
{
// not allow cast at player
if(target->GetTypeId()==TYPEID_PLAYER)
@@ -5063,7 +5325,7 @@ CurrentSpellTypes Spell::GetCurrentContainer()
return(CURRENT_GENERIC_SPELL);
}
-bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase )
+bool Spell::CheckTarget( Unit* target, uint32 eff )
{
// Check targets for creature type mask and remove not appropriate (skip explicit self target case, maybe need other explicit targets)
if(m_spellInfo->EffectImplicitTargetA[eff]!=TARGET_SELF)
@@ -5072,6 +5334,12 @@ bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase )
return false;
}
+ // Check Aura spell req (need for AoE spells)
+ if(m_spellInfo->targetAuraSpell && !target->HasAura(m_spellInfo->targetAuraSpell))
+ return false;
+ if (m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
+ return false;
+
// Check targets for not_selectable unit flag and remove
// A player can cast spells on his pet (or other controlled unit) though in any state
if (target != m_caster && target->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
@@ -5132,7 +5400,13 @@ bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase )
// all ok by some way or another, skip normal check
break;
default: // normal case
- if(target!=m_caster && !target->IsWithinLOSInMap(m_caster))
+ // Get GO cast coordinates if original caster -> GO
+ WorldObject *caster = NULL;
+ if (IS_GAMEOBJECT_GUID(m_originalCasterGUID))
+ caster = ObjectAccessor::GetGameObject(*m_caster, m_originalCasterGUID);
+ if (!caster)
+ caster = m_caster;
+ if(target!=m_caster && !target->IsWithinLOSInMap(caster))
return false;
break;
}
@@ -5146,14 +5420,13 @@ Unit* Spell::SelectMagnetTarget()
if(target && m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && target->HasAuraType(SPELL_AURA_SPELL_MAGNET)) //Attributes & 0x10 what is this?
{
- Unit::AuraList const& magnetAuras = target->GetAurasByType(SPELL_AURA_SPELL_MAGNET);
- for(Unit::AuraList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
+ Unit::AuraEffectList const& magnetAuras = target->GetAurasByType(SPELL_AURA_SPELL_MAGNET);
+ for(Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
{
if(Unit* magnet = (*itr)->GetCaster())
{
- if((*itr)->m_procCharges>0)
+ if((*itr)->GetParentAura()->DropAuraCharge())
{
- (*itr)->SetAuraProcCharges((*itr)->m_procCharges-1);
target = magnet;
m_targets.setUnitTarget(target);
AddUnitTarget(target, 0);
@@ -5177,7 +5450,7 @@ Unit* Spell::SelectMagnetTarget()
bool Spell::IsNeedSendToClient() const
{
- return m_spellInfo->SpellVisual!=0 || IsChanneledSpell(m_spellInfo) ||
+ return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || IsChanneledSpell(m_spellInfo) ||
m_spellInfo->speed > 0.0f || !m_triggeredByAuraSpell && !m_IsTriggeredSpell;
}
@@ -5256,9 +5529,6 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
// another non-melee non-delayed spell is casted now, abort
m_Spell->cancel();
}
- // Check if target of channeled spell still in range
- else if (m_Spell->CheckRange(false))
- m_Spell->cancel();
else
{
// do the action (pass spell to channeling state)
@@ -5361,6 +5631,14 @@ void Spell::CalculateDamageDoneForAllTargets()
}
}
+ bool usesAmmo=true;
+ Unit::AuraEffectList const& Auras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO);
+ for(Unit::AuraEffectList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
+ {
+ if((*j)->isAffectedOnSpell(m_spellInfo))
+ usesAmmo=false;
+ }
+
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
TargetInfo &target = *ihit;
@@ -5373,6 +5651,28 @@ void Spell::CalculateDamageDoneForAllTargets()
if (!unit)
continue;
+ if (usesAmmo)
+ {
+ bool ammoTaken=false;
+ for (uint8 i=0;i<3;i++)
+ {
+ if (!(mask & 1<<i))
+ continue;
+ switch (m_spellInfo->Effect[i])
+ {
+ case SPELL_EFFECT_SCHOOL_DAMAGE:
+ case SPELL_EFFECT_WEAPON_DAMAGE:
+ case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
+ case SPELL_EFFECT_NORMALIZED_WEAPON_DMG:
+ case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
+ ammoTaken=true;
+ TakeAmmo();
+ }
+ if (ammoTaken)
+ break;
+ }
+ }
+
if (target.missCondition==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
target.damage += CalculateDamageDone(unit, mask, multiplier);
else if (target.missCondition == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
@@ -5431,3 +5731,64 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
return damageDone;
}
+SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& skillId, int32& reqSkillValue, int32& skillValue)
+{
+ if(!lockId) // possible case for GO and maybe for items.
+ return SPELL_CAST_OK;
+
+ // Get LockInfo
+ LockEntry const *lockInfo = sLockStore.LookupEntry(lockId);
+
+ if (!lockInfo)
+ return SPELL_FAILED_BAD_TARGETS;
+
+ bool reqKey = false; // some locks not have reqs
+
+ for(int j = 0; j < 8; ++j)
+ {
+ switch(lockInfo->Type[j])
+ {
+ // check key item (many fit cases can be)
+ case LOCK_KEY_ITEM:
+ if(lockInfo->Index[j] && m_CastItem && m_CastItem->GetEntry()==lockInfo->Index[j])
+ return SPELL_CAST_OK;
+ reqKey = true;
+ break;
+ // check key skill (only single first fit case can be)
+ case LOCK_KEY_SKILL:
+ {
+ reqKey = true;
+
+ // wrong locktype, skip
+ if(uint32(m_spellInfo->EffectMiscValue[effIndex]) != lockInfo->Index[j])
+ continue;
+
+ skillId = SkillByLockType(LockType(lockInfo->Index[j]));
+
+ if ( skillId != SKILL_NONE )
+ {
+ // skill bonus provided by casting spell (mostly item spells)
+ // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value)
+ uint32 spellSkillBonus = uint32(m_currentBasePoints[effIndex]+1);
+ 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 ?
+ 0 : ((Player*)m_caster)->GetSkillValue(skillId);
+
+ skillValue += spellSkillBonus;
+
+ if (skillValue < reqSkillValue)
+ return SPELL_FAILED_LOW_CASTLEVEL;
+ }
+
+ return SPELL_CAST_OK;
+ }
+ }
+ }
+
+ if(reqKey)
+ return SPELL_FAILED_BAD_TARGETS;
+
+ return SPELL_CAST_OK;
+}
diff --git a/src/game/Spell.h b/src/game/Spell.h
index df630a33432..f012fdff231 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
#define __SPELL_H
#include "GridDefines.h"
+#include "SharedDefines.h"
class WorldSession;
class Unit;
@@ -47,26 +48,51 @@ enum SpellCastTargetFlags
TARGET_FLAG_RESURRECTABLE = 0x8000*/
TARGET_FLAG_SELF = 0x00000000,
+ TARGET_FLAG_UNUSED1 = 0x00000001, // not used in any spells as of 3.0.3 (can be set dynamically)
TARGET_FLAG_UNIT = 0x00000002, // pguid
+ TARGET_FLAG_UNUSED2 = 0x00000004, // not used in any spells as of 3.0.3 (can be set dynamically)
+ TARGET_FLAG_UNUSED3 = 0x00000008, // not used in any spells as of 3.0.3 (can be set dynamically)
TARGET_FLAG_ITEM = 0x00000010, // pguid
TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // 3 float
TARGET_FLAG_DEST_LOCATION = 0x00000040, // 3 float
- TARGET_FLAG_OBJECT_UNK = 0x00000080, // ?
+ TARGET_FLAG_OBJECT_UNK = 0x00000080, // used in 7 spells only
+ TARGET_FLAG_UNIT_UNK = 0x00000100, // looks like self target (480 spells)
TARGET_FLAG_PVP_CORPSE = 0x00000200, // pguid
- TARGET_FLAG_OBJECT = 0x00000800, // pguid
- TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid
- TARGET_FLAG_STRING = 0x00002000, // string
- TARGET_FLAG_UNK1 = 0x00004000, // ?
- TARGET_FLAG_CORPSE = 0x00008000, // pguid
- TARGET_FLAG_UNK2 = 0x00010000 // pguid
+ TARGET_FLAG_UNIT_CORPSE = 0x00000400, // 10 spells (gathering professions)
+ TARGET_FLAG_OBJECT = 0x00000800, // pguid, 2 spells
+ TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid, 0 spells
+ TARGET_FLAG_STRING = 0x00002000, // string, 0 spells
+ TARGET_FLAG_UNK1 = 0x00004000, // 199 spells, opening object/lock
+ TARGET_FLAG_CORPSE = 0x00008000, // pguid, resurrection spells
+ TARGET_FLAG_UNK2 = 0x00010000, // pguid, not used in any spells as of 3.0.3 (can be set dynamically)
+ TARGET_FLAG_GLYPH = 0x00020000 // used in glyph spells
};
enum SpellCastFlags
{
+ CAST_FLAG_NONE = 0x00000000,
+ CAST_FLAG_UNKNOWN0 = 0x00000001, // may be pending spell cast
CAST_FLAG_UNKNOWN1 = 0x00000002,
+ CAST_FLAG_UNKNOWN11 = 0x00000004,
+ CAST_FLAG_UNKNOWN12 = 0x00000008,
CAST_FLAG_UNKNOWN2 = 0x00000010,
- CAST_FLAG_AMMO = 0x00000020,
- CAST_FLAG_UNKNOWN3 = 0x00000100
+ CAST_FLAG_AMMO = 0x00000020, // Projectiles visual
+ CAST_FLAG_UNKNOWN8 = 0x00000040,
+ CAST_FLAG_UNKNOWN9 = 0x00000080,
+ CAST_FLAG_UNKNOWN3 = 0x00000100,
+ CAST_FLAG_UNKNOWN13 = 0x00000200,
+ CAST_FLAG_UNKNOWN14 = 0x00000400,
+ CAST_FLAG_POWER_LEFT_SELF = 0x00000800, // wotlk
+ CAST_FLAG_UNKNOWN15 = 0x00001000,
+ CAST_FLAG_UNKNOWN16 = 0x00002000,
+ CAST_FLAG_UNKNOWN17 = 0x00004000,
+ CAST_FLAG_UNKNOWN18 = 0x00008000,
+ CAST_FLAG_UNKNOWN19 = 0x00010000,
+ CAST_FLAG_UNKNOWN4 = 0x00020000, // wotlk
+ CAST_FLAG_UNKNOWN10 = 0x00040000,
+ CAST_FLAG_UNKNOWN5 = 0x00080000, // wotlk
+ CAST_FLAG_UNKNOWN20 = 0x00100000,
+ CAST_FLAG_UNKNOWN7 = 0x00200000 // wotlk, rune cooldown list
};
enum SpellRangeFlag
@@ -136,6 +162,7 @@ class SpellCastTargets
void setUnitTarget(Unit *target);
void setDestination(float x, float y, float z, bool send = true, int32 mapId = -1);
void setDestination(Unit *target, bool send = true);
+ void setSource(float x, float y, float z);
uint64 getGOTargetGUID() const { return m_GOTargetGUID; }
GameObject *getGOTarget() const { return m_GOTarget; }
@@ -208,7 +235,7 @@ enum SpellTargets
SPELL_TARGETS_CHAINHEAL,
};
-#define SPELL_SPELL_CHANNEL_UPDATE_INTERVAL 1000
+#define SPELL_SPELL_CHANNEL_UPDATE_INTERVAL (1*IN_MILISECONDS)
typedef std::multimap<uint64, uint64> SpellTargetTimeMap;
@@ -234,6 +261,7 @@ class Spell
void EffectHealthLeech(uint32 i);
void EffectQuestComplete(uint32 i);
void EffectCreateItem(uint32 i);
+ void EffectCreateItem2(uint32 i);
void EffectPersistentAA(uint32 i);
void EffectEnergize(uint32 i);
void EffectOpenLock(uint32 i);
@@ -242,16 +270,15 @@ class Spell
void EffectProficiency(uint32 i);
void EffectApplyAreaAura(uint32 i);
void EffectSummonType(uint32 i);
- void EffectSummon(uint32 i);
void EffectLearnSpell(uint32 i);
void EffectDispel(uint32 i);
void EffectDualWield(uint32 i);
void EffectPickPocket(uint32 i);
void EffectAddFarsight(uint32 i);
- void EffectSummonPossessed(uint32 i);
void EffectSummonWild(uint32 i);
- void EffectSummonGuardian(uint32 i);
void EffectHealMechanical(uint32 i);
+ void EffectJump(uint32 i);
+ void EffectJump2(uint32 i);
void EffectTeleUnitsFaceCaster(uint32 i);
void EffectLearnSkill(uint32 i);
void EffectAddHonor(uint32 i);
@@ -276,7 +303,7 @@ class Spell
void EffectStuck(uint32 i);
void EffectSummonPlayer(uint32 i);
void EffectActivateObject(uint32 i);
- void EffectSummonTotem(uint32 i);
+ void EffectApplyGlyph(uint32 i);
void EffectEnchantHeldItem(uint32 i);
void EffectSummonObject(uint32 i);
void EffectResurrect(uint32 i);
@@ -293,6 +320,8 @@ class Spell
void EffectSkinning(uint32 i);
void EffectCharge(uint32 i);
void EffectProspecting(uint32 i);
+ void EffectMilling(uint32 i);
+ void EffectRenamePet(uint32 i);
void EffectSendTaxi(uint32 i);
void EffectSummonCritter(uint32 i);
void EffectKnockBack(uint32 i);
@@ -319,22 +348,28 @@ class Spell
void EffectKillCredit(uint32 i);
void EffectQuestFail(uint32 i);
void EffectRedirectThreat(uint32 i);
+ void EffectActivateRune(uint32 i);
+ void EffectTitanGrip(uint32 i);
+ void EffectEnchantItemPrismatic(uint32 i);
Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false );
~Spell();
- void prepare(SpellCastTargets * targets, Aura* triggeredByAura = NULL);
+ void prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura = NULL);
void cancel();
void update(uint32 difftime);
void cast(bool skipCheck = false);
void finish(bool ok = true);
void TakePower();
+ void TakeAmmo();
+
+ void TakeRunePower();
void TakeReagents();
void TakeCastItem();
void TriggerSpell();
- uint8 CanCast(bool strict);
- int16 PetCanCast(Unit* target);
- bool CanAutoCast(Unit* target);
+
+ SpellCastResult CheckCast(bool strict);
+ SpellCastResult CheckPetCast(Unit* target);
// handlers
void handle_immediate();
@@ -343,10 +378,11 @@ class Spell
void _handle_immediate_phase();
void _handle_finish_phase();
- uint8 CheckItems();
- uint8 CheckRange(bool strict);
- uint8 CheckPower();
- uint8 CheckCasterAuras() const;
+ SpellCastResult CheckItems();
+ SpellCastResult CheckRange(bool strict);
+ SpellCastResult CheckPower();
+ SpellCastResult CheckRuneCost(uint32 runeCostID);
+ SpellCastResult CheckCasterAuras() const;
int32 CalculateDamage(uint8 i, Unit* target) { return m_caster->CalculateSpellDamage(m_spellInfo,i,m_currentBasePoints[i],target); }
int32 CalculatePowerCost();
@@ -354,11 +390,10 @@ class Spell
bool HaveTargetsForEffect(uint8 effect) const;
void Delayed();
void DelayedChannel();
- inline uint32 getState() const { return m_spellState; }
+ uint32 getState() const { return m_spellState; }
void setState(uint32 state) { m_spellState = state; }
void DoCreateItem(uint32 i, uint32 itemtype);
-
void WriteSpellGoTargets( WorldPacket * data );
void WriteAmmoToPacket( WorldPacket * data );
void FillTargetMap();
@@ -366,9 +401,10 @@ class Spell
void SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap);
Unit* SelectMagnetTarget();
- bool CheckTarget( Unit* target, uint32 eff, bool hitPhase );
+ bool CheckTarget( Unit* target, uint32 eff );
+ bool CanAutoCast(Unit* target);
- void SendCastResult(uint8 result);
+ void SendCastResult(SpellCastResult result);
void SendSpellStart();
void SendSpellGo();
void SendSpellCooldown();
@@ -388,6 +424,8 @@ class Spell
Item* m_CastItem;
uint64 m_castItemGUID;
uint8 m_cast_count;
+ uint32 m_glyphIndex;
+ uint32 m_preCastSpell;
SpellCastTargets m_targets;
int32 GetCastTime() const { return m_casttime; }
@@ -424,8 +462,6 @@ class Spell
void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
- bool IsAffectedBy(SpellEntry const *spellInfo, uint32 effectId);
-
bool CheckTargetCreatureType(Unit* target) const;
void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); }
@@ -451,9 +487,17 @@ class Spell
int32 m_casttime; // Calculated spell cast time initialized only in Spell::prepare
bool m_canReflect; // can reflect this spell?
bool m_autoRepeat;
+ uint8 m_runesState;
uint8 m_delayAtDamageCount;
- int32 GetNextDelayAtDamageMsTime() { return m_delayAtDamageCount < 5 ? 1000 - (m_delayAtDamageCount++)* 200 : 200; }
+ bool isDelayableNoMore()
+ {
+ if(m_delayAtDamageCount >= 2)
+ return true;
+
+ m_delayAtDamageCount++;
+ return false;
+ }
// Delayed spells system
uint64 m_delayStart; // time of spell delay start, filled by event handler, zero = just started
@@ -464,6 +508,7 @@ class Spell
bool m_referencedFromCurrentSpell; // mark as references to prevent deleted and access by dead pointers
bool m_executedCurrently; // mark as executed to prevent deleted and access by dead pointers
bool m_needSpellLog; // need to send spell log?
+ bool m_needComboPoints;
uint8 m_applyMultiplierMask; // by effect: damage multiplier needed?
float m_damageMultipliers[3]; // by effect: damage multiplier
@@ -472,6 +517,7 @@ class Spell
Item* itemTarget;
GameObject* gameObjTarget;
int32 damage;
+ Aura * m_spellAura; // only used in DoAllEffectOnTarget
// this is set in Spell Hit, but used in Apply Aura handler
DiminishingLevels m_diminishLevel;
@@ -497,8 +543,6 @@ class Spell
// Spell target subsystem
//*****************************************
// Targets store structures and data
- uint32 m_countOfHit;
- uint32 m_countOfMiss;
struct TargetInfo
{
uint64 targetGUID;
@@ -550,6 +594,14 @@ class Spell
void SpellDamageSchoolDmg(uint32 i);
void SpellDamageWeaponDmg(uint32 i);
void SpellDamageHeal(uint32 i);
+
+ void GetSummonPosition(float &x, float &y, float &z, float radius = 0.0f, uint32 count = 0);
+ void SummonTotem (uint32 entry, SummonPropertiesEntry const *properties);
+ void SummonGuardian (uint32 entry, SummonPropertiesEntry const *properties);
+ void SummonPossessed(uint32 entry, SummonPropertiesEntry const *properties);
+ void SummonVehicle (uint32 entry, SummonPropertiesEntry const *properties);
+
+ SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue);
// -------------------------------------------
//List For Triggered Spells
@@ -585,7 +637,7 @@ namespace Trinity
const uint32& i_push_type;
float i_radius, i_radiusSq;
SpellTargets i_TargetType;
- Unit* i_caster;
+ Unit* i_source;
uint32 i_entry;
float i_x, i_y, i_z;
@@ -594,72 +646,64 @@ namespace Trinity
: i_data(&data), i_spell(spell), i_push_type(type), i_radius(radius), i_radiusSq(radius*radius)
, i_TargetType(TargetType), i_entry(entry), i_x(x), i_y(y), i_z(z)
{
- i_caster = spell.GetCaster();
+ i_source = spell.GetCaster();
+ assert(i_source);
}
template<class T> inline void Visit(GridRefManager<T> &m)
{
- assert(i_data);
-
- if(!i_caster)
- return;
-
for(typename GridRefManager<T>::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if( !itr->getSource()->isAlive() || (itr->getSource()->GetTypeId() == TYPEID_PLAYER && ((Player*)itr->getSource())->isInFlight()))
- continue;
+ Unit *target = (Unit*)itr->getSource();
switch (i_TargetType)
{
- case SPELL_TARGETS_ALLY:
- if (!itr->getSource()->isAttackableByAOE() || !i_caster->IsFriendlyTo( itr->getSource() ))
- continue;
- break;
case SPELL_TARGETS_ENEMY:
- {
- if(itr->getSource()->GetTypeId()==TYPEID_UNIT && ((Creature*)itr->getSource())->isTotem())
+ if(target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem())
continue;
- if(!itr->getSource()->isAttackableByAOE())
+ if(!target->isAttackableByAOE())
continue;
-
- Unit* check = i_caster->GetCharmerOrOwnerOrSelf();
-
- if( check->GetTypeId()==TYPEID_PLAYER )
+ if(i_source->GetTypeId()==TYPEID_PLAYER)
{
- if (check->IsFriendlyTo( itr->getSource() ))
+ if(i_source->IsFriendlyTo(target))
continue;
}
else
{
- if (!check->IsHostileTo( itr->getSource() ))
+ if(!i_source->IsHostileTo(target))
continue;
}
- }break;
+ break;
+ case SPELL_TARGETS_ALLY:
+ if(!target->isAttackableByAOE() || !i_source->IsFriendlyTo(target))
+ continue;
+ break;
case SPELL_TARGETS_ENTRY:
- {
- if(itr->getSource()->GetEntry()!= i_entry)
+ if(target->GetEntry()!= i_entry)
continue;
- }break;
- default: continue;
+ break;
+ default:
+ continue;
}
switch(i_push_type)
{
+ case PUSH_DEST_CENTER:
+ case PUSH_TARGET_CENTER:
+ if((target->GetDistanceSq(i_x, i_y, i_z) < i_radiusSq))
+ i_data->push_back(target);
+ break;
case PUSH_IN_FRONT:
- if(i_caster->isInFront((Unit*)(itr->getSource()), i_radius, M_PI/3 ))
- i_data->push_back(itr->getSource());
+ if(i_source->isInFront(target, i_radius, M_PI/3))
+ i_data->push_back(target);
break;
case PUSH_IN_BACK:
- if(i_caster->isInBack((Unit*)(itr->getSource()), i_radius, M_PI/3 ))
- i_data->push_back(itr->getSource());
+ if(i_source->isInBack(target, i_radius, M_PI/3))
+ i_data->push_back(target);
break;
case PUSH_IN_LINE:
- if(i_caster->isInLine((Unit*)(itr->getSource()), i_radius ))
- i_data->push_back(itr->getSource());
- break;
- default:
- if((itr->getSource()->GetDistanceSq(i_x, i_y, i_z) < i_radiusSq))
- i_data->push_back(itr->getSource());
+ if(i_source->isInLine(target, i_radius))
+ i_data->push_back(target);
break;
}
}
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index d8a9d73cf46..5953ae9fb13 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,14 +20,20 @@
#ifndef TRINITY_SPELLAURADEFINES_H
#define TRINITY_SPELLAURADEFINES_H
-#define MAX_AURAS 56
-#define MAX_POSITIVE_AURAS 40
+#define MAX_AURAS 64 // client support up to 255, but it will cause problems with group auras updating
+#define FRIENDLY_AA_REMOVE_TIME 2*IN_MILISECONDS
enum AURA_FLAGS
{
- AFLAG_NEGATIVE = 0x09,
- AFLAG_POSITIVE = 0x1F,
- AFLAG_MASK = 0xFF
+ AFLAG_NONE = 0x00,
+ AFLAG_EFF_INDEX_0 = 0x01,
+ AFLAG_EFF_INDEX_1 = 0x02,
+ AFLAG_EFF_INDEX_2 = 0x04,
+ AFLAG_CASTER = 0x08,
+ AFLAG_POSITIVE = 0x10,
+ AFLAG_DURATION = 0x20,
+ AFLAG_UNK2 = 0x40,
+ AFLAG_NEGATIVE = 0x80
};
//m_schoolAbsorb
@@ -60,7 +66,7 @@ enum AuraType
SPELL_AURA_MOD_INVISIBILITY = 18,
SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19,
SPELL_AURA_OBS_MOD_HEALTH = 20, //20,21 unofficial
- SPELL_AURA_OBS_MOD_MANA = 21,
+ SPELL_AURA_OBS_MOD_ENERGY = 21,
SPELL_AURA_MOD_RESISTANCE = 22,
SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,
SPELL_AURA_PERIODIC_ENERGIZE = 24,
@@ -85,11 +91,11 @@ enum AuraType
SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,
SPELL_AURA_TRACK_CREATURES = 44,
SPELL_AURA_TRACK_RESOURCES = 45,
- SPELL_AURA_MOD_PARRY_SKILL = 46,
+ SPELL_AURA_46 = 46, // Ignore all Gear test spells
SPELL_AURA_MOD_PARRY_PERCENT = 47,
- SPELL_AURA_MOD_DODGE_SKILL = 48,
+ SPELL_AURA_48 = 48, // One periodic spell
SPELL_AURA_MOD_DODGE_PERCENT = 49,
- SPELL_AURA_MOD_BLOCK_SKILL = 50,
+ SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
SPELL_AURA_MOD_BLOCK_PERCENT = 51,
SPELL_AURA_MOD_CRIT_PERCENT = 52,
SPELL_AURA_PERIODIC_LEECH = 53,
@@ -102,9 +108,9 @@ enum AuraType
SPELL_AURA_MOD_PACIFY_SILENCE = 60,
SPELL_AURA_MOD_SCALE = 61,
SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,
- SPELL_AURA_PERIODIC_MANA_FUNNEL = 63,
+ SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL
SPELL_AURA_PERIODIC_MANA_LEECH = 64,
- SPELL_AURA_MOD_CASTING_SPEED = 65,
+ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65,
SPELL_AURA_FEIGN_DEATH = 66,
SPELL_AURA_MOD_DISARM = 67,
SPELL_AURA_MOD_STALKED = 68,
@@ -129,7 +135,7 @@ enum AuraType
SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,
SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88,
SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,
- SPELL_AURA_MOD_RESIST_CHANCE = 90,
+ SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE
SPELL_AURA_MOD_DETECT_RANGE = 91,
SPELL_AURA_PREVENTS_FLEEING = 92,
SPELL_AURA_MOD_UNATTACKABLE = 93,
@@ -158,7 +164,7 @@ enum AuraType
SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116,
SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117,
SPELL_AURA_MOD_HEALING_PCT = 118,
- SPELL_AURA_SHARE_PET_TRACKING = 119,
+ SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING
SPELL_AURA_UNTRACKABLE = 120,
SPELL_AURA_EMPATHY = 121,
SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122,
@@ -184,11 +190,11 @@ enum AuraType
SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142,
SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143,
SPELL_AURA_SAFE_FALL = 144,
- SPELL_AURA_CHARISMA = 145,
- SPELL_AURA_PERSUADED = 146,
- SPELL_AURA_ADD_CREATURE_IMMUNITY = 147,
+ SPELL_AURA_MOD_PET_TALENT_POINTS = 145,
+ SPELL_AURA_ALLOW_TAME_PET_TYPE = 146,
+ SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147,
SPELL_AURA_RETAIN_COMBO_POINTS = 148,
- SPELL_AURA_RESIST_PUSHBACK = 149, // Resist Pushback
+ SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback
SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150,
SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed
SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range
@@ -212,15 +218,15 @@ enum AuraType
SPELL_AURA_DETECT_AMORE = 170,
SPELL_AURA_MOD_SPEED_NOT_STACK = 171,
SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172,
- SPELL_AURA_ALLOW_CHAMPION_SPELLS = 173,
- SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
+ SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS
+ SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175,
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
SPELL_AURA_AOE_CHARM = 177,
SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178,
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179,
SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180,
- SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS = 181, // unused - possible flat spell crit damage versus
+ SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
SPELL_AURA_MOD_CRITICAL_THREAT = 183,
SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184,
@@ -233,11 +239,11 @@ enum AuraType
SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191,
SPELL_AURA_HASTE_MELEE = 192,
SPELL_AURA_MELEE_SLOW = 193,
- SPELL_AURA_MOD_DEPRICATED_1 = 194, // not used now, old SPELL_AURA_MOD_SPELL_DAMAGE_OF_INTELLECT
- SPELL_AURA_MOD_DEPRICATED_2 = 195, // not used now, old SPELL_AURA_MOD_SPELL_HEALING_OF_INTELLECT
+ SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL = 194,
+ SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL = 195,
SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath
SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197,
- SPELL_AURA_MOD_ALL_WEAPON_SKILLS = 198,
+ SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199,
SPELL_AURA_MOD_XP_PCT = 200,
SPELL_AURA_FLY = 201,
@@ -262,20 +268,20 @@ enum AuraType
SPELL_AURA_MOD_RATING_FROM_STAT = 220,
SPELL_AURA_221 = 221,
SPELL_AURA_222 = 222,
- SPELL_AURA_223 = 223,
+ SPELL_AURA_RAID_PROC_FROM_CHARGE = 223,
SPELL_AURA_224 = 224,
- SPELL_AURA_PRAYER_OF_MENDING = 225,
+ SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE = 225,
SPELL_AURA_PERIODIC_DUMMY = 226,
- SPELL_AURA_227 = 227,
+ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227,
SPELL_AURA_DETECT_STEALTH = 228,
SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229,
SPELL_AURA_230 = 230,
- SPELL_AURA_231 = 231,
+ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231,
SPELL_AURA_MECHANIC_DURATION_MOD = 232,
SPELL_AURA_233 = 233,
SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234,
SPELL_AURA_MOD_DISPEL_RESIST = 235,
- SPELL_AURA_236 = 236,
+ SPELL_AURA_CONTROL_VEHICLE = 236,
SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237,
SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238,
SPELL_AURA_MOD_SCALE_2 = 239,
@@ -284,29 +290,57 @@ enum AuraType
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
SPELL_AURA_243 = 243,
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
- SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245,
- SPELL_AURA_246 = 246,
+ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245,
+ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246,
SPELL_AURA_247 = 247,
SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
- SPELL_AURA_249 = 249,
+ SPELL_AURA_CONVERT_RUNE = 249,
SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
SPELL_AURA_MOD_ENEMY_DODGE = 251,
SPELL_AURA_252 = 252,
- SPELL_AURA_253 = 253,
- SPELL_AURA_254 = 254,
- SPELL_AURA_255 = 255,
- SPELL_AURA_256 = 256,
- SPELL_AURA_257 = 257,
+ SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253,
+ SPELL_AURA_MOD_DISARM_OFFHAND = 254,
+ SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255,
+ SPELL_AURA_NO_REAGENT_USE = 256,
+ SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257,
SPELL_AURA_258 = 258,
- SPELL_AURA_259 = 259,
- SPELL_AURA_260 = 260,
- SPELL_AURA_261 = 261,
- TOTAL_AURAS=262
+ SPELL_AURA_MOD_HOT_PCT = 259,
+ SPELL_AURA_SCREEN_EFFECT = 260,
+ SPELL_AURA_PHASE = 261,
+ SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262,
+ SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
+ SPELL_AURA_264 = 264,
+ SPELL_AURA_265 = 265,
+ SPELL_AURA_266 = 266,
+ SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267,
+ SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268,
+ SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269,
+ SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive
+ SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
+ SPELL_AURA_272 = 272,
+ SPELL_AURA_273 = 273,
+ SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274,
+ SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275,
+ SPELL_AURA_276 = 276, // Only "Test Mod Damage % Mechanic" spell, possible mod damage done
+ SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277,
+ SPELL_AURA_MOD_DISARM_RANGED = 278,
+ SPELL_AURA_279 = 279,
+ SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE = 280,
+ SPELL_AURA_MOD_HONOR_GAIN_PCT = 281,
+ SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
+ SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
+ SPELL_AURA_284,
+ SPELL_AURA_285,
+ SPELL_AURA_286,
+ SPELL_AURA_DEFLECT_SPELLS,
+ SPELL_AURA_288,
+ TOTAL_AURAS = 289
};
enum AreaAuraType
{
AREA_AURA_PARTY,
+ AREA_AURA_RAID,
AREA_AURA_FRIEND,
AREA_AURA_ENEMY,
AREA_AURA_PET,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 1a837de8775..9a682ed22b0 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,11 +31,9 @@
#include "Player.h"
#include "Unit.h"
#include "Spell.h"
-#include "SpellAuras.h"
#include "DynamicObject.h"
#include "Group.h"
#include "UpdateData.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "Policies/SingletonImp.h"
#include "Totem.h"
@@ -45,310 +43,323 @@
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "CreatureAI.h"
+#include "ScriptCalls.h"
#include "Util.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
-#define NULL_AURA_SLOT 0xFF
-
pAuraHandler AuraHandler[TOTAL_AURAS]=
{
- &Aura::HandleNULL, // 0 SPELL_AURA_NONE
- &Aura::HandleBindSight, // 1 SPELL_AURA_BIND_SIGHT
- &Aura::HandleModPossess, // 2 SPELL_AURA_MOD_POSSESS
- &Aura::HandlePeriodicDamage, // 3 SPELL_AURA_PERIODIC_DAMAGE
- &Aura::HandleAuraDummy, // 4 SPELL_AURA_DUMMY
- &Aura::HandleModConfuse, // 5 SPELL_AURA_MOD_CONFUSE
- &Aura::HandleModCharm, // 6 SPELL_AURA_MOD_CHARM
- &Aura::HandleModFear, // 7 SPELL_AURA_MOD_FEAR
- &Aura::HandlePeriodicHeal, // 8 SPELL_AURA_PERIODIC_HEAL
- &Aura::HandleModAttackSpeed, // 9 SPELL_AURA_MOD_ATTACKSPEED
- &Aura::HandleModThreat, // 10 SPELL_AURA_MOD_THREAT
- &Aura::HandleModTaunt, // 11 SPELL_AURA_MOD_TAUNT
- &Aura::HandleAuraModStun, // 12 SPELL_AURA_MOD_STUN
- &Aura::HandleModDamageDone, // 13 SPELL_AURA_MOD_DAMAGE_DONE
- &Aura::HandleNoImmediateEffect, // 14 SPELL_AURA_MOD_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
- &Aura::HandleNoImmediateEffect, // 15 SPELL_AURA_DAMAGE_SHIELD implemented in Unit::DoAttackDamage
- &Aura::HandleModStealth, // 16 SPELL_AURA_MOD_STEALTH
- &Aura::HandleNoImmediateEffect, // 17 SPELL_AURA_MOD_STEALTH_DETECT
- &Aura::HandleInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY
- &Aura::HandleInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION
- &Aura::HandleAuraModTotalHealthPercentRegen, // 20 SPELL_AURA_OBS_MOD_HEALTH
- &Aura::HandleAuraModTotalManaPercentRegen, // 21 SPELL_AURA_OBS_MOD_MANA
- &Aura::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE
- &Aura::HandlePeriodicTriggerSpell, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
- &Aura::HandlePeriodicEnergize, // 24 SPELL_AURA_PERIODIC_ENERGIZE
- &Aura::HandleAuraModPacify, // 25 SPELL_AURA_MOD_PACIFY
- &Aura::HandleAuraModRoot, // 26 SPELL_AURA_MOD_ROOT
- &Aura::HandleAuraModSilence, // 27 SPELL_AURA_MOD_SILENCE
- &Aura::HandleNoImmediateEffect, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
- &Aura::HandleAuraModStat, // 29 SPELL_AURA_MOD_STAT
- &Aura::HandleAuraModSkill, // 30 SPELL_AURA_MOD_SKILL
- &Aura::HandleAuraModIncreaseSpeed, // 31 SPELL_AURA_MOD_INCREASE_SPEED
- &Aura::HandleAuraModIncreaseMountedSpeed, // 32 SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
- &Aura::HandleAuraModDecreaseSpeed, // 33 SPELL_AURA_MOD_DECREASE_SPEED
- &Aura::HandleAuraModIncreaseHealth, // 34 SPELL_AURA_MOD_INCREASE_HEALTH
- &Aura::HandleAuraModIncreaseEnergy, // 35 SPELL_AURA_MOD_INCREASE_ENERGY
- &Aura::HandleAuraModShapeshift, // 36 SPELL_AURA_MOD_SHAPESHIFT
- &Aura::HandleAuraModEffectImmunity, // 37 SPELL_AURA_EFFECT_IMMUNITY
- &Aura::HandleAuraModStateImmunity, // 38 SPELL_AURA_STATE_IMMUNITY
- &Aura::HandleAuraModSchoolImmunity, // 39 SPELL_AURA_SCHOOL_IMMUNITY
- &Aura::HandleAuraModDmgImmunity, // 40 SPELL_AURA_DAMAGE_IMMUNITY
- &Aura::HandleAuraModDispelImmunity, // 41 SPELL_AURA_DISPEL_IMMUNITY
- &Aura::HandleAuraProcTriggerSpell, // 42 SPELL_AURA_PROC_TRIGGER_SPELL implemented in Unit::ProcDamageAndSpellFor and Unit::HandleProcTriggerSpell
- &Aura::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in Unit::ProcDamageAndSpellFor
- &Aura::HandleAuraTrackCreatures, // 44 SPELL_AURA_TRACK_CREATURES
- &Aura::HandleAuraTrackResources, // 45 SPELL_AURA_TRACK_RESOURCES
- &Aura::HandleUnused, // 46 SPELL_AURA_MOD_PARRY_SKILL obsolete?
- &Aura::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
- &Aura::HandleUnused, // 48 SPELL_AURA_MOD_DODGE_SKILL obsolete?
- &Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
- &Aura::HandleUnused, // 50 SPELL_AURA_MOD_BLOCK_SKILL obsolete?
- &Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
- &Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT
- &Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH
- &Aura::HandleModHitChance, // 54 SPELL_AURA_MOD_HIT_CHANCE
- &Aura::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE
- &Aura::HandleAuraTransform, // 56 SPELL_AURA_TRANSFORM
- &Aura::HandleModSpellCritChance, // 57 SPELL_AURA_MOD_SPELL_CRIT_CHANCE
- &Aura::HandleAuraModIncreaseSwimSpeed, // 58 SPELL_AURA_MOD_INCREASE_SWIM_SPEED
- &Aura::HandleNoImmediateEffect, // 59 SPELL_AURA_MOD_DAMAGE_DONE_CREATURE implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
- &Aura::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
- &Aura::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE
- &Aura::HandleNULL, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL
- &Aura::HandleUnused, // 63 SPELL_AURA_PERIODIC_MANA_FUNNEL obsolete?
- &Aura::HandlePeriodicManaLeech, // 64 SPELL_AURA_PERIODIC_MANA_LEECH
- &Aura::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED
- &Aura::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH
- &Aura::HandleAuraModDisarm, // 67 SPELL_AURA_MOD_DISARM
- &Aura::HandleAuraModStalked, // 68 SPELL_AURA_MOD_STALKED
- &Aura::HandleSchoolAbsorb, // 69 SPELL_AURA_SCHOOL_ABSORB implemented in Unit::CalcAbsorbResist
- &Aura::HandleUnused, // 70 SPELL_AURA_EXTRA_ATTACKS Useless, used by only one spell that has only visual effect
- &Aura::HandleModSpellCritChanceShool, // 71 SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
- &Aura::HandleModPowerCostPCT, // 72 SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
- &Aura::HandleModPowerCost, // 73 SPELL_AURA_MOD_POWER_COST_SCHOOL
- &Aura::HandleNoImmediateEffect, // 74 SPELL_AURA_REFLECT_SPELLS_SCHOOL implemented in Unit::SpellHitResult
- &Aura::HandleNoImmediateEffect, // 75 SPELL_AURA_MOD_LANGUAGE
- &Aura::HandleFarSight, // 76 SPELL_AURA_FAR_SIGHT
- &Aura::HandleModMechanicImmunity, // 77 SPELL_AURA_MECHANIC_IMMUNITY
- &Aura::HandleAuraMounted, // 78 SPELL_AURA_MOUNTED
- &Aura::HandleModDamagePercentDone, // 79 SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
- &Aura::HandleModPercentStat, // 80 SPELL_AURA_MOD_PERCENT_STAT
- &Aura::HandleNoImmediateEffect, // 81 SPELL_AURA_SPLIT_DAMAGE_PCT
- &Aura::HandleWaterBreathing, // 82 SPELL_AURA_WATER_BREATHING
- &Aura::HandleModBaseResistance, // 83 SPELL_AURA_MOD_BASE_RESISTANCE
- &Aura::HandleModRegen, // 84 SPELL_AURA_MOD_REGEN
- &Aura::HandleModPowerRegen, // 85 SPELL_AURA_MOD_POWER_REGEN
- &Aura::HandleChannelDeathItem, // 86 SPELL_AURA_CHANNEL_DEATH_ITEM
- &Aura::HandleNoImmediateEffect, // 87 SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
- &Aura::HandleNoImmediateEffect, // 88 SPELL_AURA_MOD_HEALTH_REGEN_PERCENT
- &Aura::HandlePeriodicDamagePCT, // 89 SPELL_AURA_PERIODIC_DAMAGE_PERCENT
- &Aura::HandleUnused, // 90 SPELL_AURA_MOD_RESIST_CHANCE Useless
- &Aura::HandleNoImmediateEffect, // 91 SPELL_AURA_MOD_DETECT_RANGE implemented in Creature::GetAttackDistance
- &Aura::HandlePreventFleeing, // 92 SPELL_AURA_PREVENTS_FLEEING
- &Aura::HandleModUnattackable, // 93 SPELL_AURA_MOD_UNATTACKABLE
- &Aura::HandleNoImmediateEffect, // 94 SPELL_AURA_INTERRUPT_REGEN implemented in Player::RegenerateAll
- &Aura::HandleAuraGhost, // 95 SPELL_AURA_GHOST
- &Aura::HandleNoImmediateEffect, // 96 SPELL_AURA_SPELL_MAGNET implemented in Spell::SelectMagnetTarget
- &Aura::HandleManaShield, // 97 SPELL_AURA_MANA_SHIELD implemented in Unit::CalcAbsorbResist
- &Aura::HandleAuraModSkill, // 98 SPELL_AURA_MOD_SKILL_TALENT
- &Aura::HandleAuraModAttackPower, // 99 SPELL_AURA_MOD_ATTACK_POWER
- &Aura::HandleUnused, //100 SPELL_AURA_AURAS_VISIBLE obsolete? all player can see all auras now
- &Aura::HandleModResistancePercent, //101 SPELL_AURA_MOD_RESISTANCE_PCT
- &Aura::HandleNoImmediateEffect, //102 SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
- &Aura::HandleAuraModTotalThreat, //103 SPELL_AURA_MOD_TOTAL_THREAT
- &Aura::HandleAuraWaterWalk, //104 SPELL_AURA_WATER_WALK
- &Aura::HandleAuraFeatherFall, //105 SPELL_AURA_FEATHER_FALL
- &Aura::HandleAuraHover, //106 SPELL_AURA_HOVER
- &Aura::HandleAddModifier, //107 SPELL_AURA_ADD_FLAT_MODIFIER
- &Aura::HandleAddModifier, //108 SPELL_AURA_ADD_PCT_MODIFIER
- &Aura::HandleNoImmediateEffect, //109 SPELL_AURA_ADD_TARGET_TRIGGER
- &Aura::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT
- &Aura::HandleNULL, //111 SPELL_AURA_ADD_CASTER_HIT_TRIGGER
- &Aura::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
- &Aura::HandleNoImmediateEffect, //113 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
- &Aura::HandleNoImmediateEffect, //114 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
- &Aura::HandleNoImmediateEffect, //115 SPELL_AURA_MOD_HEALING implemented in Unit::SpellBaseHealingBonusForVictim
- &Aura::HandleNoImmediateEffect, //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT
- &Aura::HandleNoImmediateEffect, //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE implemented in Unit::MagicSpellHitResult
- &Aura::HandleNoImmediateEffect, //118 SPELL_AURA_MOD_HEALING_PCT implemented in Unit::SpellHealingBonus
- &Aura::HandleUnused, //119 SPELL_AURA_SHARE_PET_TRACKING useless
- &Aura::HandleAuraUntrackable, //120 SPELL_AURA_UNTRACKABLE
- &Aura::HandleAuraEmpathy, //121 SPELL_AURA_EMPATHY
- &Aura::HandleModOffhandDamagePercent, //122 SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT
- &Aura::HandleModTargetResistance, //123 SPELL_AURA_MOD_TARGET_RESISTANCE
- &Aura::HandleAuraModRangedAttackPower, //124 SPELL_AURA_MOD_RANGED_ATTACK_POWER
- &Aura::HandleNoImmediateEffect, //125 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
- &Aura::HandleNoImmediateEffect, //126 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
- &Aura::HandleNoImmediateEffect, //127 SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
- &Aura::HandleModPossessPet, //128 SPELL_AURA_MOD_POSSESS_PET
- &Aura::HandleAuraModIncreaseSpeed, //129 SPELL_AURA_MOD_SPEED_ALWAYS
- &Aura::HandleAuraModIncreaseMountedSpeed, //130 SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
- &Aura::HandleNoImmediateEffect, //131 SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
- &Aura::HandleAuraModIncreaseEnergyPercent, //132 SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
- &Aura::HandleAuraModIncreaseHealthPercent, //133 SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
- &Aura::HandleAuraModRegenInterrupt, //134 SPELL_AURA_MOD_MANA_REGEN_INTERRUPT
- &Aura::HandleModHealingDone, //135 SPELL_AURA_MOD_HEALING_DONE
- &Aura::HandleNoImmediateEffect, //136 SPELL_AURA_MOD_HEALING_DONE_PERCENT implemented in Unit::SpellHealingBonus
- &Aura::HandleModTotalPercentStat, //137 SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
- &Aura::HandleHaste, //138 SPELL_AURA_MOD_HASTE
- &Aura::HandleForceReaction, //139 SPELL_AURA_FORCE_REACTION
- &Aura::HandleAuraModRangedHaste, //140 SPELL_AURA_MOD_RANGED_HASTE
- &Aura::HandleRangedAmmoHaste, //141 SPELL_AURA_MOD_RANGED_AMMO_HASTE
- &Aura::HandleAuraModBaseResistancePCT, //142 SPELL_AURA_MOD_BASE_RESISTANCE_PCT
- &Aura::HandleAuraModResistanceExclusive, //143 SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
- &Aura::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes
- &Aura::HandleUnused, //145 SPELL_AURA_CHARISMA obsolete?
- &Aura::HandleUnused, //146 SPELL_AURA_PERSUADED obsolete?
- &Aura::HandleNULL, //147 SPELL_AURA_ADD_CREATURE_IMMUNITY
- &Aura::HandleAuraRetainComboPoints, //148 SPELL_AURA_RETAIN_COMBO_POINTS
- &Aura::HandleNoImmediateEffect, //149 SPELL_AURA_RESIST_PUSHBACK
- &Aura::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
- &Aura::HandleAuraTrackStealthed, //151 SPELL_AURA_TRACK_STEALTHED
- &Aura::HandleNoImmediateEffect, //152 SPELL_AURA_MOD_DETECTED_RANGE implemented in Creature::GetAttackDistance
- &Aura::HandleNoImmediateEffect, //153 SPELL_AURA_SPLIT_DAMAGE_FLAT
- &Aura::HandleNoImmediateEffect, //154 SPELL_AURA_MOD_STEALTH_LEVEL
- &Aura::HandleNoImmediateEffect, //155 SPELL_AURA_MOD_WATER_BREATHING
- &Aura::HandleNoImmediateEffect, //156 SPELL_AURA_MOD_REPUTATION_GAIN
- &Aura::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI
- &Aura::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE
- &Aura::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell
- &Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult
- &Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT
- &Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA
- &Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE
- &Aura::HandleUnused, //164 useless, only one test spell
- &Aura::HandleNoImmediateEffect, //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
- &Aura::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT
- &Aura::HandleAuraModRangedAttackPowerPercent, //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
- &Aura::HandleNoImmediateEffect, //168 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus
- &Aura::HandleNoImmediateEffect, //169 SPELL_AURA_MOD_CRIT_PERCENT_VERSUS implemented in Unit::DealDamageBySchool, Unit::DoAttackDamage, Unit::SpellCriticalBonus
- &Aura::HandleNULL, //170 SPELL_AURA_DETECT_AMORE only for Detect Amore spell
- &Aura::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
- &Aura::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
- &Aura::HandleUnused, //173 SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell
- &Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT)
- &Aura::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus
- &Aura::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
- &Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM
- &Aura::HandleNoImmediateEffect, //178 SPELL_AURA_MOD_DEBUFF_RESISTANCE implemented in Unit::MagicSpellHitResult
- &Aura::HandleNoImmediateEffect, //179 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE implemented in Unit::SpellCriticalBonus
- &Aura::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus
- &Aura::HandleUnused, //181 SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS unused
- &Aura::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT
- &Aura::HandleNULL, //183 SPELL_AURA_MOD_CRITICAL_THREAT
- &Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
- &Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
- &Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult
- &Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
- &Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
- &Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING
- &Aura::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN
- &Aura::HandleAuraModUseNormalSpeed, //191 SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
- &Aura::HandleModMeleeRangedSpeedPct, //192 SPELL_AURA_HASTE_MELEE
- &Aura::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) speed pct)
- &Aura::HandleUnused, //194 SPELL_AURA_MOD_DEPRICATED_1 not used now (old SPELL_AURA_MOD_SPELL_DAMAGE_OF_INTELLECT)
- &Aura::HandleUnused, //195 SPELL_AURA_MOD_DEPRICATED_2 not used now (old SPELL_AURA_MOD_SPELL_HEALING_OF_INTELLECT)
- &Aura::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN
- &Aura::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
- &Aura::HandleUnused, //198 SPELL_AURA_MOD_ALL_WEAPON_SKILLS
- &Aura::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult
- &Aura::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::GiveXP
- &Aura::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...
- &Aura::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst
- &Aura::HandleNoImmediateEffect, //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
- &Aura::HandleNoImmediateEffect, //204 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
- &Aura::HandleNULL, //205 vulnerable to school dmg?
- &Aura::HandleNULL, //206 SPELL_AURA_MOD_SPEED_MOUNTED
- &Aura::HandleAuraModIncreaseFlightSpeed, //207 SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
- &Aura::HandleAuraModIncreaseFlightSpeed, //208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Flight Form (Passive)
- &Aura::HandleAuraModIncreaseFlightSpeed, //209 SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS
- &Aura::HandleNULL, //210 Commentator's Command
- &Aura::HandleAuraModIncreaseFlightSpeed, //211 SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
- &Aura::HandleAuraModRangedAttackPowerOfStatPercent, //212 SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT
- &Aura::HandleNoImmediateEffect, //213 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT implemented in Player::RewardRage
- &Aura::HandleNULL, //214 Tamed Pet Passive
- &Aura::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION
- &Aura::HandleModCastingSpeed, //216 SPELL_AURA_HASTE_SPELLS
- &Aura::HandleUnused, //217 unused
- &Aura::HandleAuraModRangedHaste, //218 SPELL_AURA_HASTE_RANGED
- &Aura::HandleModManaRegen, //219 SPELL_AURA_MOD_MANA_REGEN_FROM_STAT
- &Aura::HandleNULL, //220 SPELL_AURA_MOD_RATING_FROM_STAT
- &Aura::HandleNULL, //221 ignored
- &Aura::HandleUnused, //222 unused
- &Aura::HandleNULL, //223 Cold Stare
- &Aura::HandleUnused, //224 unused
- &Aura::HandleNoImmediateEffect, //225 SPELL_AURA_PRAYER_OF_MENDING
- &Aura::HandleAuraPeriodicDummy, //226 SPELL_AURA_PERIODIC_DUMMY
- &Aura::HandleNULL, //227 periodic trigger spell
- &Aura::HandleNoImmediateEffect, //228 stealth detection
- &Aura::HandleNULL, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
- &Aura::HandleAuraModIncreaseMaxHealth, //230 Commanding Shout
- &Aura::HandleNULL, //231
- &Aura::HandleNoImmediateEffect, //232 SPELL_AURA_MECHANIC_DURATION_MOD implement in Unit::CalculateSpellDuration
- &Aura::HandleNULL, //233 set model id to the one of the creature with id m_modifier.m_miscvalue
- &Aura::HandleNoImmediateEffect, //234 SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK implement in Unit::CalculateSpellDuration
- &Aura::HandleAuraModDispelResist, //235 SPELL_AURA_MOD_DISPEL_RESIST implement in Unit::MagicSpellHitResult
- &Aura::HandleUnused, //236 unused
- &Aura::HandleModSpellDamagePercentFromAttackPower, //237 SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER implemented in Unit::SpellBaseDamageBonus
- &Aura::HandleModSpellHealingPercentFromAttackPower, //238 SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER implemented in Unit::SpellBaseHealingBonus
- &Aura::HandleAuraModScale, //239 SPELL_AURA_MOD_SCALE_2 only in Noggenfogger Elixir (16595) before 2.3.0 aura 61
- &Aura::HandleAuraModExpertise, //240 SPELL_AURA_MOD_EXPERTISE
- &Aura::HandleForceMoveForward, //241 Forces the player to move forward
- &Aura::HandleUnused, //242 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING
- &Aura::HandleUnused, //243 used by two test spells
- &Aura::HandleComprehendLanguage, //244 Comprehend language
- &Aura::HandleUnused, //245 SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS
- &Aura::HandleUnused, //246 unused
- &Aura::HandleUnused, //247 unused
- &Aura::HandleNoImmediateEffect, //248 SPELL_AURA_MOD_COMBAT_RESULT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
- &Aura::HandleNULL, //249
- &Aura::HandleAuraModIncreaseHealth, //250 SPELL_AURA_MOD_INCREASE_HEALTH_2
- &Aura::HandleNULL, //251 SPELL_AURA_MOD_ENEMY_DODGE
- &Aura::HandleUnused, //252 unused
- &Aura::HandleUnused, //253 unused
- &Aura::HandleUnused, //254 unused
- &Aura::HandleUnused, //255 unused
- &Aura::HandleUnused, //256 unused
- &Aura::HandleUnused, //257 unused
- &Aura::HandleUnused, //258 unused
- &Aura::HandleUnused, //259 unused
- &Aura::HandleUnused, //260 unused
- &Aura::HandleNULL //261 SPELL_AURA_261 some phased state (44856 spell)
+ &AuraEffect::HandleNULL, // 0 SPELL_AURA_NONE
+ &AuraEffect::HandleBindSight, // 1 SPELL_AURA_BIND_SIGHT
+ &AuraEffect::HandleModPossess, // 2 SPELL_AURA_MOD_POSSESS
+ &AuraEffect::HandlePeriodicDamage, // 3 SPELL_AURA_PERIODIC_DAMAGE
+ &AuraEffect::HandleAuraDummy, // 4 SPELL_AURA_DUMMY
+ &AuraEffect::HandleModConfuse, // 5 SPELL_AURA_MOD_CONFUSE
+ &AuraEffect::HandleModCharm, // 6 SPELL_AURA_MOD_CHARM
+ &AuraEffect::HandleModFear, // 7 SPELL_AURA_MOD_FEAR
+ &AuraEffect::HandlePeriodicHeal, // 8 SPELL_AURA_PERIODIC_HEAL
+ &AuraEffect::HandleModAttackSpeed, // 9 SPELL_AURA_MOD_ATTACKSPEED
+ &AuraEffect::HandleModThreat, // 10 SPELL_AURA_MOD_THREAT
+ &AuraEffect::HandleModTaunt, // 11 SPELL_AURA_MOD_TAUNT
+ &AuraEffect::HandleAuraModStun, // 12 SPELL_AURA_MOD_STUN
+ &AuraEffect::HandleModDamageDone, // 13 SPELL_AURA_MOD_DAMAGE_DONE
+ &AuraEffect::HandleNoImmediateEffect, // 14 SPELL_AURA_MOD_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, // 15 SPELL_AURA_DAMAGE_SHIELD implemented in Unit::DoAttackDamage
+ &AuraEffect::HandleModStealth, // 16 SPELL_AURA_MOD_STEALTH
+ &AuraEffect::HandleNoImmediateEffect, // 17 SPELL_AURA_MOD_STEALTH_DETECT
+ &AuraEffect::HandleInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY
+ &AuraEffect::HandleInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION
+ &AuraEffect::HandleAuraModTotalHealthPercentRegen, // 20 SPELL_AURA_OBS_MOD_HEALTH
+ &AuraEffect::HandleAuraModTotalEnergyPercentRegen, // 21 SPELL_AURA_OBS_MOD_ENERGY
+ &AuraEffect::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE
+ &AuraEffect::HandlePeriodicTriggerSpell, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
+ &AuraEffect::HandlePeriodicEnergize, // 24 SPELL_AURA_PERIODIC_ENERGIZE
+ &AuraEffect::HandleAuraModPacify, // 25 SPELL_AURA_MOD_PACIFY
+ &AuraEffect::HandleAuraModRoot, // 26 SPELL_AURA_MOD_ROOT
+ &AuraEffect::HandleAuraModSilence, // 27 SPELL_AURA_MOD_SILENCE
+ &AuraEffect::HandleNoImmediateEffect, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
+ &AuraEffect::HandleAuraModStat, // 29 SPELL_AURA_MOD_STAT
+ &AuraEffect::HandleAuraModSkill, // 30 SPELL_AURA_MOD_SKILL
+ &AuraEffect::HandleAuraModIncreaseSpeed, // 31 SPELL_AURA_MOD_INCREASE_SPEED
+ &AuraEffect::HandleAuraModIncreaseMountedSpeed, // 32 SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
+ &AuraEffect::HandleAuraModDecreaseSpeed, // 33 SPELL_AURA_MOD_DECREASE_SPEED
+ &AuraEffect::HandleAuraModIncreaseHealth, // 34 SPELL_AURA_MOD_INCREASE_HEALTH
+ &AuraEffect::HandleAuraModIncreaseEnergy, // 35 SPELL_AURA_MOD_INCREASE_ENERGY
+ &AuraEffect::HandleAuraModShapeshift, // 36 SPELL_AURA_MOD_SHAPESHIFT
+ &AuraEffect::HandleAuraModEffectImmunity, // 37 SPELL_AURA_EFFECT_IMMUNITY
+ &AuraEffect::HandleAuraModStateImmunity, // 38 SPELL_AURA_STATE_IMMUNITY
+ &AuraEffect::HandleAuraModSchoolImmunity, // 39 SPELL_AURA_SCHOOL_IMMUNITY
+ &AuraEffect::HandleAuraModDmgImmunity, // 40 SPELL_AURA_DAMAGE_IMMUNITY
+ &AuraEffect::HandleAuraModDispelImmunity, // 41 SPELL_AURA_DISPEL_IMMUNITY
+ &AuraEffect::HandleAuraProcTriggerSpell, // 42 SPELL_AURA_PROC_TRIGGER_SPELL implemented in Unit::ProcDamageAndSpellFor and Unit::HandleProcTriggerSpell
+ &AuraEffect::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in Unit::ProcDamageAndSpellFor
+ &AuraEffect::HandleAuraTrackCreatures, // 44 SPELL_AURA_TRACK_CREATURES
+ &AuraEffect::HandleAuraTrackResources, // 45 SPELL_AURA_TRACK_RESOURCES
+ &AuraEffect::HandleUnused, // 46 SPELL_AURA_46 (used in test spells 54054 and 54058, and spell 48050) (3.0.8a)
+ &AuraEffect::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
+ &AuraEffect::HandleNULL, // 48 SPELL_AURA_48 spell Napalm (area damage spell with additional delayed damage effect)
+ &AuraEffect::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
+ &AuraEffect::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT implemented in Unit::SpellCriticalHealingBonus
+ &AuraEffect::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
+ &AuraEffect::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT
+ &AuraEffect::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH
+ &AuraEffect::HandleModHitChance, // 54 SPELL_AURA_MOD_HIT_CHANCE
+ &AuraEffect::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ &AuraEffect::HandleAuraTransform, // 56 SPELL_AURA_TRANSFORM
+ &AuraEffect::HandleModSpellCritChance, // 57 SPELL_AURA_MOD_SPELL_CRIT_CHANCE
+ &AuraEffect::HandleAuraModIncreaseSwimSpeed, // 58 SPELL_AURA_MOD_INCREASE_SWIM_SPEED
+ &AuraEffect::HandleNoImmediateEffect, // 59 SPELL_AURA_MOD_DAMAGE_DONE_CREATURE implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
+ &AuraEffect::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
+ &AuraEffect::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE
+ &AuraEffect::HandlePeriodicHealthFunnel, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL
+ &AuraEffect::HandleUnused, // 63 unused (3.0.8a) old SPELL_AURA_PERIODIC_MANA_FUNNEL
+ &AuraEffect::HandlePeriodicManaLeech, // 64 SPELL_AURA_PERIODIC_MANA_LEECH
+ &AuraEffect::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
+ &AuraEffect::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH
+ &AuraEffect::HandleAuraModDisarm, // 67 SPELL_AURA_MOD_DISARM
+ &AuraEffect::HandleAuraModStalked, // 68 SPELL_AURA_MOD_STALKED
+ &AuraEffect::HandleSchoolAbsorb, // 69 SPELL_AURA_SCHOOL_ABSORB implemented in Unit::CalcAbsorbResist
+ &AuraEffect::HandleUnused, // 70 SPELL_AURA_EXTRA_ATTACKS Useless, used by only one spell that has only visual effect
+ &AuraEffect::HandleModSpellCritChanceShool, // 71 SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
+ &AuraEffect::HandleModPowerCostPCT, // 72 SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
+ &AuraEffect::HandleModPowerCost, // 73 SPELL_AURA_MOD_POWER_COST_SCHOOL
+ &AuraEffect::HandleNoImmediateEffect, // 74 SPELL_AURA_REFLECT_SPELLS_SCHOOL implemented in Unit::SpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, // 75 SPELL_AURA_MOD_LANGUAGE
+ &AuraEffect::HandleFarSight, // 76 SPELL_AURA_FAR_SIGHT
+ &AuraEffect::HandleModMechanicImmunity, // 77 SPELL_AURA_MECHANIC_IMMUNITY
+ &AuraEffect::HandleAuraMounted, // 78 SPELL_AURA_MOUNTED
+ &AuraEffect::HandleModDamagePercentDone, // 79 SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
+ &AuraEffect::HandleModPercentStat, // 80 SPELL_AURA_MOD_PERCENT_STAT
+ &AuraEffect::HandleNoImmediateEffect, // 81 SPELL_AURA_SPLIT_DAMAGE_PCT
+ &AuraEffect::HandleWaterBreathing, // 82 SPELL_AURA_WATER_BREATHING
+ &AuraEffect::HandleModBaseResistance, // 83 SPELL_AURA_MOD_BASE_RESISTANCE
+ &AuraEffect::HandleModRegen, // 84 SPELL_AURA_MOD_REGEN
+ &AuraEffect::HandleModPowerRegen, // 85 SPELL_AURA_MOD_POWER_REGEN
+ &AuraEffect::HandleChannelDeathItem, // 86 SPELL_AURA_CHANNEL_DEATH_ITEM
+ &AuraEffect::HandleNoImmediateEffect, // 87 SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, // 88 SPELL_AURA_MOD_HEALTH_REGEN_PERCENT
+ &AuraEffect::HandlePeriodicDamagePCT, // 89 SPELL_AURA_PERIODIC_DAMAGE_PERCENT
+ &AuraEffect::HandleUnused, // 90 unused (3.0.8a) old SPELL_AURA_MOD_RESIST_CHANCE
+ &AuraEffect::HandleNoImmediateEffect, // 91 SPELL_AURA_MOD_DETECT_RANGE implemented in Creature::GetAttackDistance
+ &AuraEffect::HandlePreventFleeing, // 92 SPELL_AURA_PREVENTS_FLEEING
+ &AuraEffect::HandleModUnattackable, // 93 SPELL_AURA_MOD_UNATTACKABLE
+ &AuraEffect::HandleNoImmediateEffect, // 94 SPELL_AURA_INTERRUPT_REGEN implemented in Player::RegenerateAll
+ &AuraEffect::HandleAuraGhost, // 95 SPELL_AURA_GHOST
+ &AuraEffect::HandleNoImmediateEffect, // 96 SPELL_AURA_SPELL_MAGNET implemented in Spell::SelectMagnetTarget
+ &AuraEffect::HandleManaShield, // 97 SPELL_AURA_MANA_SHIELD implemented in Unit::CalcAbsorbResist
+ &AuraEffect::HandleAuraModSkill, // 98 SPELL_AURA_MOD_SKILL_TALENT
+ &AuraEffect::HandleAuraModAttackPower, // 99 SPELL_AURA_MOD_ATTACK_POWER
+ &AuraEffect::HandleUnused, //100 SPELL_AURA_AURAS_VISIBLE obsolete? all player can see all auras now, but still have spells including GM-spell
+ &AuraEffect::HandleModResistancePercent, //101 SPELL_AURA_MOD_RESISTANCE_PCT
+ &AuraEffect::HandleNoImmediateEffect, //102 SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleAuraModTotalThreat, //103 SPELL_AURA_MOD_TOTAL_THREAT
+ &AuraEffect::HandleAuraWaterWalk, //104 SPELL_AURA_WATER_WALK
+ &AuraEffect::HandleAuraFeatherFall, //105 SPELL_AURA_FEATHER_FALL
+ &AuraEffect::HandleAuraHover, //106 SPELL_AURA_HOVER
+ &AuraEffect::HandleAddModifier, //107 SPELL_AURA_ADD_FLAT_MODIFIER
+ &AuraEffect::HandleAddModifier, //108 SPELL_AURA_ADD_PCT_MODIFIER
+ &AuraEffect::HandleAddTargetTrigger, //109 SPELL_AURA_ADD_TARGET_TRIGGER
+ &AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT
+ &AuraEffect::HandleNULL, //111 SPELL_AURA_ADD_CASTER_HIT_TRIGGER chance redirect attack to caster
+ &AuraEffect::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
+ &AuraEffect::HandleNoImmediateEffect, //113 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, //114 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, //115 SPELL_AURA_MOD_HEALING implemented in Unit::SpellBaseHealingBonusForVictim
+ &AuraEffect::HandleNoImmediateEffect, //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT
+ &AuraEffect::HandleNoImmediateEffect, //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE implemented in Unit::MagicSpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, //118 SPELL_AURA_MOD_HEALING_PCT implemented in Unit::SpellHealingBonus
+ &AuraEffect::HandleUnused, //119 unused (3.0.8a) old SPELL_AURA_SHARE_PET_TRACKING
+ &AuraEffect::HandleAuraUntrackable, //120 SPELL_AURA_UNTRACKABLE
+ &AuraEffect::HandleAuraEmpathy, //121 SPELL_AURA_EMPATHY
+ &AuraEffect::HandleModOffhandDamagePercent, //122 SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT
+ &AuraEffect::HandleModTargetResistance, //123 SPELL_AURA_MOD_TARGET_RESISTANCE
+ &AuraEffect::HandleAuraModRangedAttackPower, //124 SPELL_AURA_MOD_RANGED_ATTACK_POWER
+ &AuraEffect::HandleNoImmediateEffect, //125 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, //126 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, //127 SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleModPossessPet, //128 SPELL_AURA_MOD_POSSESS_PET
+ &AuraEffect::HandleAuraModIncreaseSpeed, //129 SPELL_AURA_MOD_SPEED_ALWAYS
+ &AuraEffect::HandleAuraModIncreaseMountedSpeed, //130 SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
+ &AuraEffect::HandleNoImmediateEffect, //131 SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleAuraModIncreaseEnergyPercent, //132 SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
+ &AuraEffect::HandleAuraModIncreaseHealthPercent, //133 SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
+ &AuraEffect::HandleAuraModRegenInterrupt, //134 SPELL_AURA_MOD_MANA_REGEN_INTERRUPT
+ &AuraEffect::HandleModHealingDone, //135 SPELL_AURA_MOD_HEALING_DONE
+ &AuraEffect::HandleNoImmediateEffect, //136 SPELL_AURA_MOD_HEALING_DONE_PERCENT implemented in Unit::SpellHealingBonus
+ &AuraEffect::HandleModTotalPercentStat, //137 SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
+ &AuraEffect::HandleHaste, //138 SPELL_AURA_MOD_HASTE
+ &AuraEffect::HandleForceReaction, //139 SPELL_AURA_FORCE_REACTION
+ &AuraEffect::HandleAuraModRangedHaste, //140 SPELL_AURA_MOD_RANGED_HASTE
+ &AuraEffect::HandleRangedAmmoHaste, //141 SPELL_AURA_MOD_RANGED_AMMO_HASTE
+ &AuraEffect::HandleAuraModBaseResistancePCT, //142 SPELL_AURA_MOD_BASE_RESISTANCE_PCT
+ &AuraEffect::HandleAuraModResistanceExclusive, //143 SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
+ &AuraEffect::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes
+ &AuraEffect::HandleAuraModPetTalentsPoints, //145 SPELL_AURA_MOD_PET_TALENT_POINTS
+ &AuraEffect::HandleNoImmediateEffect, //146 SPELL_AURA_ALLOW_TAME_PET_TYPE
+ &AuraEffect::HandleModStateImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK
+ &AuraEffect::HandleAuraRetainComboPoints, //148 SPELL_AURA_RETAIN_COMBO_POINTS
+ &AuraEffect::HandleNoImmediateEffect, //149 SPELL_AURA_REDUCE_PUSHBACK
+ &AuraEffect::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
+ &AuraEffect::HandleAuraTrackStealthed, //151 SPELL_AURA_TRACK_STEALTHED
+ &AuraEffect::HandleNoImmediateEffect, //152 SPELL_AURA_MOD_DETECTED_RANGE implemented in Creature::GetAttackDistance
+ &AuraEffect::HandleNoImmediateEffect, //153 SPELL_AURA_SPLIT_DAMAGE_FLAT
+ &AuraEffect::HandleNoImmediateEffect, //154 SPELL_AURA_MOD_STEALTH_LEVEL
+ &AuraEffect::HandleNoImmediateEffect, //155 SPELL_AURA_MOD_WATER_BREATHING
+ &AuraEffect::HandleNoImmediateEffect, //156 SPELL_AURA_MOD_REPUTATION_GAIN
+ &AuraEffect::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI
+ &AuraEffect::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE
+ &AuraEffect::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell
+ &AuraEffect::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT
+ &AuraEffect::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA
+ &AuraEffect::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE
+ &AuraEffect::HandleUnused, //164 unused (3.0.8a), only one test spell
+ &AuraEffect::HandleNoImmediateEffect, //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
+ &AuraEffect::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT
+ &AuraEffect::HandleAuraModRangedAttackPowerPercent, //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
+ &AuraEffect::HandleNoImmediateEffect, //168 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus
+ &AuraEffect::HandleNoImmediateEffect, //169 SPELL_AURA_MOD_CRIT_PERCENT_VERSUS implemented in Unit::DealDamageBySchool, Unit::DoAttackDamage, Unit::SpellCriticalBonus
+ &AuraEffect::HandleNULL, //170 SPELL_AURA_DETECT_AMORE different spells that ignore transformation effects
+ &AuraEffect::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
+ &AuraEffect::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
+ &AuraEffect::HandleUnused, //173 unused (3.0.8a) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell
+ &AuraEffect::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus
+ &AuraEffect::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus
+ &AuraEffect::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
+ &AuraEffect::HandleNULL, //177 SPELL_AURA_AOE_CHARM
+ &AuraEffect::HandleNoImmediateEffect, //178 SPELL_AURA_MOD_DEBUFF_RESISTANCE implemented in Unit::MagicSpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, //179 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE implemented in Unit::SpellCriticalBonus
+ &AuraEffect::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus
+ &AuraEffect::HandleUnused, //181 unused (3.0.8a) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS
+ &AuraEffect::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT
+ &AuraEffect::HandleNULL, //183 SPELL_AURA_MOD_CRITICAL_THREAT only used in 28746
+ &AuraEffect::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
+ &AuraEffect::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
+ &AuraEffect::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
+ &AuraEffect::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
+ &AuraEffect::HandleModRating, //189 SPELL_AURA_MOD_RATING
+ &AuraEffect::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN
+ &AuraEffect::HandleAuraModUseNormalSpeed, //191 SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
+ &AuraEffect::HandleModMeleeRangedSpeedPct, //192 SPELL_AURA_HASTE_MELEE
+ &AuraEffect::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) speed pct)
+ &AuraEffect::HandleNULL, //194 SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
+ &AuraEffect::HandleNoImmediateEffect, //195 SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
+ &AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN
+ &AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
+ &AuraEffect::HandleUnused, //198 unused (3.0.8a) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
+ &AuraEffect::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult
+ &AuraEffect::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::GiveXP
+ &AuraEffect::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...
+ &AuraEffect::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst
+ &AuraEffect::HandleNoImmediateEffect, //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
+ &AuraEffect::HandleNoImmediateEffect, //204 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
+ &AuraEffect::HandleNULL, //205 vulnerable to school dmg?
+ &AuraEffect::HandleNULL, //206 SPELL_AURA_MOD_SPEED_MOUNTED
+ &AuraEffect::HandleAuraModIncreaseFlightSpeed, //207 SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
+ &AuraEffect::HandleAuraModIncreaseFlightSpeed, //208 SPELL_AURA_MOD_SPEED_FLIGHT, used only in spell: Flight Form (Passive)
+ &AuraEffect::HandleAuraModIncreaseFlightSpeed, //209 SPELL_AURA_MOD_FLIGHT_SPEED_ALWAYS
+ &AuraEffect::HandleNULL, //210 Commentator's Command
+ &AuraEffect::HandleAuraModIncreaseFlightSpeed, //211 SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
+ &AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent, //212 SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT
+ &AuraEffect::HandleNoImmediateEffect, //213 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT implemented in Player::RewardRage
+ &AuraEffect::HandleNULL, //214 Tamed Pet Passive
+ &AuraEffect::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION
+ &AuraEffect::HandleModCastingSpeed, //216 SPELL_AURA_HASTE_SPELLS
+ &AuraEffect::HandleUnused, //217 unused (3.0.8a)
+ &AuraEffect::HandleAuraModRangedHaste, //218 SPELL_AURA_HASTE_RANGED
+ &AuraEffect::HandleModManaRegen, //219 SPELL_AURA_MOD_MANA_REGEN_FROM_STAT
+ &AuraEffect::HandleModRatingFromStat, //220 SPELL_AURA_MOD_RATING_FROM_STAT
+ &AuraEffect::HandleNULL, //221 ignored
+ &AuraEffect::HandleUnused, //222 unused (3.0.8a) only for spell 44586 that not used in real spell cast
+ &AuraEffect::HandleNoImmediateEffect, //223 SPELL_AURA_RAID_PROC_FROM_CHARGE
+ &AuraEffect::HandleUnused, //224 unused (3.0.8a)
+ &AuraEffect::HandleNoImmediateEffect, //225 SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE
+ &AuraEffect::HandleAuraPeriodicDummy, //226 SPELL_AURA_PERIODIC_DUMMY
+ &AuraEffect::HandlePeriodicTriggerSpellWithValue, //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
+ &AuraEffect::HandleNoImmediateEffect, //228 stealth detection
+ &AuraEffect::HandleNULL, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
+ &AuraEffect::HandleAuraModIncreaseHealth, //230 SPELL_AURA_MOD_INCREASE_HEALTH_2
+ &AuraEffect::HandleNoImmediateEffect, //231 SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
+ &AuraEffect::HandleNoImmediateEffect, //232 SPELL_AURA_MECHANIC_DURATION_MOD implement in Unit::CalculateSpellDuration
+ &AuraEffect::HandleNULL, //233 set model id to the one of the creature with id GetMiscValue()
+ &AuraEffect::HandleNoImmediateEffect, //234 SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK implement in Unit::CalculateSpellDuration
+ &AuraEffect::HandleAuraModDispelResist, //235 SPELL_AURA_MOD_DISPEL_RESIST implement in Unit::MagicSpellHitResult
+ &AuraEffect::HandleAuraControlVehicle, //236 SPELL_AURA_CONTROL_VEHICLE
+ &AuraEffect::HandleModSpellDamagePercentFromAttackPower, //237 SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER implemented in Unit::SpellBaseDamageBonus
+ &AuraEffect::HandleModSpellHealingPercentFromAttackPower, //238 SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER implemented in Unit::SpellBaseHealingBonus
+ &AuraEffect::HandleAuraModScale, //239 SPELL_AURA_MOD_SCALE_2 only in Noggenfogger Elixir (16595) before 2.3.0 aura 61
+ &AuraEffect::HandleAuraModExpertise, //240 SPELL_AURA_MOD_EXPERTISE
+ &AuraEffect::HandleForceMoveForward, //241 Forces the player to move forward
+ &AuraEffect::HandleUnused, //242 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING
+ &AuraEffect::HandleNULL, //243 faction reaction override spells
+ &AuraEffect::HandleComprehendLanguage, //244 Comprehend language
+ &AuraEffect::HandleNoImmediateEffect, //245 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
+ &AuraEffect::HandleNoImmediateEffect, //246 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK implemented in Spell::EffectApplyAura
+ &AuraEffect::HandleNULL, //247 target to become a clone of the caster
+ &AuraEffect::HandleNoImmediateEffect, //248 SPELL_AURA_MOD_COMBAT_RESULT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
+ &AuraEffect::HandleAuraConvertRune, //249 SPELL_AURA_CONVERT_RUNE
+ &AuraEffect::HandleAuraModIncreaseHealth, //250 SPELL_AURA_MOD_INCREASE_HEALTH_2
+ &AuraEffect::HandleNoImmediateEffect, //251 SPELL_AURA_MOD_ENEMY_DODGE
+ &AuraEffect::HandleNULL, //252 haste all?
+ &AuraEffect::HandleNoImmediateEffect, //253 SPELL_AURA_MOD_BLOCK_CRIT_CHANCE implemented in Unit::isBlockCritical
+ &AuraEffect::HandleAuraModDisarm, //254 SPELL_AURA_MOD_DISARM_OFFHAND
+ &AuraEffect::HandleNoImmediateEffect, //255 SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT implemented in Unit::SpellDamageBonus
+ &AuraEffect::HandleNoReagentUseAura, //256 SPELL_AURA_NO_REAGENT_USE Use SpellClassMask for spell select
+ &AuraEffect::HandleNULL, //257 SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS Use SpellClassMask for spell select
+ &AuraEffect::HandleNULL, //258 SPELL_AURA_MOD_SPELL_VISUAL
+ &AuraEffect::HandleNoImmediateEffect, //259 SPELL_AURA_MOD_HOT_PCT implemented in Unit::SpellHealingBonus
+ &AuraEffect::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code
+ &AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE undetactable invisibility? implemented in Unit::isVisibleForOrDetect
+ &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in spell::cancast
+ &AuraEffect::HandleAuraAllowOnlyAbility, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask
+ &AuraEffect::HandleUnused, //264 unused (3.0.8a)
+ &AuraEffect::HandleUnused, //265 unused (3.0.8a)
+ &AuraEffect::HandleUnused, //266 unused (3.0.8a)
+ &AuraEffect::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmunedToSpellEffect
+ &AuraEffect::HandleAuraModAttackPowerOfStatPercent, //268 SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT
+ &AuraEffect::HandleNoImmediateEffect, //269 SPELL_AURA_MOD_IGNORE_TARGET_RESIST implemented in Unit::CalcAbsorbResist and CalcArmorReducedDamage
+ &AuraEffect::HandleNoImmediateEffect, //270 SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST implemented in Unit::CalcAbsorbResist and CalcArmorReducedDamage
+ &AuraEffect::HandleNoImmediateEffect, //271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonus
+ &AuraEffect::HandleNULL, //272 reduce spell cast time?
+ &AuraEffect::HandleUnused, //273 clientside
+ &AuraEffect::HandleNoImmediateEffect, //274 SPELL_AURA_CONSUME_NO_AMMO implemented in spell::CalculateDamageDoneForAllTargets
+ &AuraEffect::HandleNoImmediateEffect, //275 SPELL_AURA_MOD_IGNORE_SHAPESHIFT Use SpellClassMask for spell select
+ &AuraEffect::HandleNULL, //276 mod damage % mechanic?
+ &AuraEffect::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap
+ &AuraEffect::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
+ &AuraEffect::HandleNULL, //279 visual effects? 58836 and 57507
+ &AuraEffect::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE
+ &AuraEffect::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
+ &AuraEffect::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT
+ &AuraEffect::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
+ &AuraEffect::HandleUnused, //284 not used by any spells (3.08a)
+ &AuraEffect::HandleUnused, //285 not used by any spells (3.08a)
+ &AuraEffect::HandleUnused, //286 not used by any spells (3.08a)
+ &AuraEffect::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
+ &AuraEffect::HandleUnused, //288 not used by any spells (3.09) except 1 test spell.
};
-Aura::Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
-m_procCharges(0), m_stackAmount(1), m_spellmod(NULL), m_effIndex(eff), m_caster_guid(0), m_target(target),
-m_timeCla(1000), m_castItemGuid(castItem?castItem->GetGUID():0), m_auraSlot(MAX_AURAS),
-m_positive(false), m_permanent(false), m_isPeriodic(false), m_isTrigger(false), m_isAreaAura(false),
-m_isPersistent(false), m_updated(false), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_isRemovedOnShapeLost(true), m_in_use(false),
-m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
-,m_tickNumber(0)
+Aura::Aura(SpellEntry const* spellproto, uint32 effMask, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
+m_caster_guid(0), m_castItemGuid(castItem?castItem->GetGUID():0), m_target(target),
+m_timeCla(1000), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
+m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_isRemoved(false)
{
assert(target);
assert(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
- m_spellProto = spellproto;
+ m_auraFlags = effMask;
- int32 damage;
- if(currentBasePoints)
- {
- damage = *currentBasePoints;
- m_currentBasePoints = damage - 1;
- }
- else
- {
- m_currentBasePoints = m_spellProto->EffectBasePoints[eff];
- if(caster)
- damage = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, target);
- else
- damage = m_currentBasePoints + 1;
- }
+ m_spellProto = spellproto;
m_isPassive = IsPassiveSpell(GetId());
- m_positive = IsPositiveEffect(GetId(), m_effIndex);
+
+ m_auraStateMask = 0;
+
+ m_isSingleTargetAura = IsSingleTargetSpell(m_spellProto);
m_applyTime = time(NULL);
@@ -356,112 +367,192 @@ m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
{
m_caster_guid = target->GetGUID();
//damage = m_currentBasePoints+1; // stored value-1
- m_maxduration = target->CalculateSpellDuration(m_spellProto, m_effIndex, target);
+ m_maxduration = target->CalcSpellDuration(m_spellProto);
}
else
{
m_caster_guid = caster->GetGUID();
//damage = caster->CalculateSpellDamage(m_spellProto,m_effIndex,m_currentBasePoints,target);
- m_maxduration = caster->CalculateSpellDuration(m_spellProto, m_effIndex, target);
-
- if (!damage && castItem && castItem->GetItemSuffixFactor())
- {
- ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
- if(item_rand_suffix)
- {
- for (int k=0; k<3; k++)
- {
- SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
- if(pEnchant)
- {
- for (int t=0; t<3; t++)
- if(pEnchant->spellid[t] == m_spellProto->Id)
- {
- damage = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 );
- break;
- }
- }
-
- if(damage)
- break;
- }
- }
- }
+ m_maxduration = caster->CalcSpellDuration(m_spellProto);
}
if(m_maxduration == -1 || m_isPassive && m_spellProto->DurationIndex == 0)
m_permanent = true;
+ else
+ m_permanent = false;
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
if(!m_permanent && modOwner)
+ {
modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, m_maxduration);
+ // Get zero duration aura after - need set m_maxduration > 0 for apply/remove aura work
+ if (m_maxduration<=0)
+ m_maxduration = 1;
+ }
m_duration = m_maxduration;
- if(modOwner)
- modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_periodicTimer);
-
- sLog.outDebug("Aura: construct Spellid : %u, Aura : %u Duration : %d Target : %d Damage : %d", m_spellProto->Id, m_spellProto->EffectApplyAuraName[eff], m_maxduration, m_spellProto->EffectImplicitTargetA[eff],damage);
+ m_isDeathPersist = IsDeathPersistentSpell(m_spellProto);
- m_effIndex = eff;
- SetModifier(AuraType(m_spellProto->EffectApplyAuraName[eff]), damage, m_spellProto->EffectAmplitude[eff], m_spellProto->EffectMiscValue[eff]);
+ m_procCharges = m_spellProto->procCharges;
+ if(modOwner)
+ modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
- m_isDeathPersist = IsDeathPersistentSpell(m_spellProto);
+ m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() &&
+ m_spellProto->Stances &&
+ !(m_spellProto->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) &&
+ !(m_spellProto->Attributes & SPELL_ATTR_NOT_SHAPESHIFT));
- if(m_spellProto->procCharges)
+ for (uint8 i=0 ;i<MAX_SPELL_EFFECTS;++i)
{
- m_procCharges = m_spellProto->procCharges;
-
- if(modOwner)
- modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
+ if (m_auraFlags & (uint8(1) << i))
+ {
+ if (&currentBasePoints[0])
+ m_partAuras[i]=CreateAuraEffect(this, i,&currentBasePoints[0]+i, caster);
+ else
+ m_partAuras[i]=CreateAuraEffect(this, i, NULL , caster);
+ // correct flags if aura couldn't be created
+ if (!m_partAuras[i])
+ m_auraFlags &= uint8(~(1<< i));
+ }
+ else
+ {
+ m_partAuras[i]=NULL;
+ }
}
- else
- m_procCharges = -1;
- m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() && m_spellProto->Stances &&
- !(m_spellProto->AttributesEx2 & 0x80000) && !(m_spellProto->Attributes & 0x10000));
+ // Aura is positive when it is casted by friend and at least one aura is positive
+ // or when it is casted by enemy and at least one aura is negative
+ bool swap=false;
+ if (!caster || caster==target) // caster == target - 1 negative effect is enough for aura to be negative
+ m_positive = false;
+ else
+ m_positive = !caster->IsHostileTo(m_target);
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
+ {
+ if (!(1<<i & GetEffectMask()))
+ continue;
+ if (m_positive == IsPositiveEffect(GetId(), i))
+ {
+ swap = true;
+ break;
+ }
+ }
+ if (!swap)
+ m_positive=!m_positive;
}
Aura::~Aura()
{
+ // free part auras memory
+ for (uint8 i=0 ; i<MAX_SPELL_EFFECTS;++i)
+ if (m_partAuras[i])
+ delete m_partAuras[i];
+}
+
+AuraEffect::AuraEffect(Aura * parentAura, uint8 effIndex, int32 * currentBasePoints , Unit * caster, Item* castItem) :
+m_parentAura(parentAura), m_spellmod(NULL), m_periodicTimer(0), m_isPeriodic(false), m_isAreaAura(false), m_isPersistent(false),
+m_target(parentAura->GetTarget()), m_tickNumber(0)
+{
+ m_spellProto = parentAura->GetSpellProto();
+ m_effIndex = effIndex;
+ m_auraName = AuraType(m_spellProto->EffectApplyAuraName[m_effIndex]);
+
+ if(currentBasePoints)
+ m_currentBasePoints = *currentBasePoints;
+ else
+ m_currentBasePoints = m_spellProto->EffectBasePoints[m_effIndex];
+
+ if(caster)
+ m_amount = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, m_target);
+ else
+ m_amount = m_currentBasePoints + 1;
+
+ if (!m_amount && castItem && castItem->GetItemSuffixFactor())
+ {
+ ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
+ if(item_rand_suffix)
+ {
+ for (int k=0; k<3; k++)
+ {
+ SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
+ if(pEnchant)
+ {
+ for (int t=0; t<3; t++)
+ if(pEnchant->spellid[t] == m_spellProto->Id)
+ {
+ m_amount = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000 );
+ break;
+ }
+ }
+
+ if(m_amount)
+ break;
+ }
+ }
+ }
+
+ Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
+ m_amplitude = m_spellProto->EffectAmplitude[m_effIndex];
+
+ //apply casting time mods for channeled spells
+ if (modOwner && m_amplitude && IsChanneledSpell(m_spellProto))
+ modOwner->ModSpellCastTime(m_spellProto, m_amplitude);
+
+ // Apply periodic time mod
+ if(modOwner && m_amplitude)
+ modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_amplitude);
+
+ // Start periodic on next tick or at aura apply
+ if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY))
+ m_periodicTimer += m_amplitude;
}
-AreaAura::AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
-Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)
+AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster, Item * castItem)
+: AuraEffect(parentAura, effIndex, currentBasePoints, caster, castItem)
{
+ m_removeTime = FRIENDLY_AA_REMOVE_TIME;
m_isAreaAura = true;
- // caster==NULL in constructor args if target==caster in fact
- Unit* caster_ptr = caster ? caster : target;
+ Unit* caster_ptr = caster ? caster : m_target;
+
+ if (m_spellProto->Effect[effIndex] == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
+ m_radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[m_effIndex]));
+ else
+ m_radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[m_effIndex]));
- m_radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(GetSpellProto()->EffectRadiusIndex[m_effIndex]));
if(Player* modOwner = caster_ptr->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, m_radius);
- switch(spellproto->Effect[eff])
+ switch(m_spellProto->Effect[effIndex])
{
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
m_areaAuraType = AREA_AURA_PARTY;
- if(target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem())
- m_modifier.m_auraname = SPELL_AURA_NONE;
+ if(m_target->GetTypeId() == TYPEID_UNIT && ((Creature*)m_target)->isTotem())
+ m_auraName = SPELL_AURA_NONE;
+ break;
+ case SPELL_EFFECT_APPLY_AREA_AURA_RAID:
+ m_areaAuraType = AREA_AURA_RAID;
+ if(m_target->GetTypeId() == TYPEID_UNIT && ((Creature*)m_target)->isTotem())
+ m_auraName = SPELL_AURA_NONE;
break;
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
m_areaAuraType = AREA_AURA_FRIEND;
break;
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
m_areaAuraType = AREA_AURA_ENEMY;
- if(target == caster_ptr)
- m_modifier.m_auraname = SPELL_AURA_NONE; // Do not do any effect on self
+ if(m_target == caster_ptr)
+ m_auraName = SPELL_AURA_NONE; // Do not do any effect on self
break;
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
m_areaAuraType = AREA_AURA_PET;
break;
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
m_areaAuraType = AREA_AURA_OWNER;
- if(target == caster_ptr)
- m_modifier.m_auraname = SPELL_AURA_NONE;
+ if(m_target == caster_ptr)
+ m_auraName = SPELL_AURA_NONE;
break;
default:
sLog.outError("Wrong spell effect in AreaAura constructor");
@@ -470,26 +561,30 @@ Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target,
}
}
-AreaAura::~AreaAura()
+AreaAuraEffect::~AreaAuraEffect()
{
}
-PersistentAreaAura::PersistentAreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
-Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, target, caster, castItem)
+PersistentAreaAuraEffect::PersistentAreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster,Item * castItem)
+: AuraEffect(parentAura, effIndex, currentBasePoints, caster, castItem)
{
m_isPersistent = true;
}
-PersistentAreaAura::~PersistentAreaAura()
+PersistentAreaAuraEffect::~PersistentAreaAuraEffect()
{
}
-Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem)
+AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem)
{
- if (IsAreaAuraEffect(spellproto->Effect[eff]))
- return new AreaAura(spellproto, eff, currentBasePoints, target, caster, castItem);
-
- return new Aura(spellproto, eff, currentBasePoints, target, caster, castItem);
+ assert (parentAura);
+ if (IsAreaAuraEffect(parentAura->GetSpellProto()->Effect[effIndex]))
+ return new AreaAuraEffect(parentAura, effIndex, currentBasePoints, caster, castItem);
+ else if (parentAura->GetSpellProto()->Effect[effIndex] == SPELL_EFFECT_APPLY_AURA)
+ return new AuraEffect(parentAura, effIndex, currentBasePoints, caster, castItem);
+ else if (parentAura->GetSpellProto()->Effect[effIndex] == SPELL_EFFECT_PERSISTENT_AREA_AURA)
+ return new PersistentAreaAuraEffect(parentAura, effIndex, currentBasePoints, caster, castItem);
+ else return NULL;
}
Unit* Aura::GetCaster() const
@@ -503,14 +598,6 @@ Unit* Aura::GetCaster() const
return unit && unit->IsInWorld() ? unit : NULL;
}
-void Aura::SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue)
-{
- m_modifier.m_auraname = t;
- m_modifier.m_amount = a;
- m_modifier.m_miscvalue = miscValue;
- m_modifier.periodictime = pt;
-}
-
void Aura::Update(uint32 diff)
{
if (m_duration > 0)
@@ -518,49 +605,72 @@ void Aura::Update(uint32 diff)
m_duration -= diff;
if (m_duration < 0)
m_duration = 0;
- m_timeCla -= diff;
- // GetEffIndex()==0 prevent double/triple apply manaPerSecond/manaPerSecondPerLevel to same spell with many auras
// all spells with manaPerSecond/manaPerSecondPerLevel have aura in effect 0
- if(GetEffIndex()==0 && m_timeCla <= 0)
+ if(m_timeCla > 0)
+ m_timeCla -= diff;
+ if(m_timeCla <= 0)
{
if(Unit* caster = GetCaster())
{
- Powers powertype = Powers(m_spellProto->powerType);
- int32 manaPerSecond = m_spellProto->manaPerSecond + m_spellProto->manaPerSecondPerLevel * caster->getLevel();
- m_timeCla = 1000;
- if (manaPerSecond)
+ if(int32 manaPerSecond = m_spellProto->manaPerSecond + m_spellProto->manaPerSecondPerLevel * caster->getLevel())
{
- if(powertype==POWER_HEALTH)
- caster->ModifyHealth(-manaPerSecond);
+ m_timeCla = 1000;
+
+ Powers powertype = Powers(m_spellProto->powerType);
+ if(powertype == POWER_HEALTH)
+ {
+ if (caster->GetHealth() > manaPerSecond)
+ caster->ModifyHealth(-manaPerSecond);
+ else
+ {
+ m_target->RemoveAura(this);
+ return;
+ }
+ }
else
- caster->ModifyPower(powertype,-manaPerSecond);
+ {
+ if (caster->GetPower(powertype) >= manaPerSecond)
+ caster->ModifyPower(powertype, -manaPerSecond);
+ else
+ {
+ m_target->RemoveAura(this);
+ return;
+ }
+ }
}
}
}
}
- // Channeled aura required check distance from caster except in possessed cases
- if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID() && !m_target->isPossessed())
+ // Channeled aura required check distance from caster
+ if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID()
+ && !IsAreaAura() && !IsPersistent() // check for these is done in auraeffect
+ /* && !m_target->isPossessed()*/)
{
Unit* caster = GetCaster();
if(!caster)
{
- m_target->RemoveAura(GetId(),GetEffIndex());
+ m_target->RemoveAura(this);
return;
}
-
// Get spell range
- float radius;
+ float radius=-1.0f;
SpellModOp mod;
- if (m_spellProto->EffectRadiusIndex[GetEffIndex()])
+ // get part aura with lowest radius
+ for (uint8 i=0;i<3;++i)
{
- radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellProto->EffectRadiusIndex[GetEffIndex()]));
- mod = SPELLMOD_RADIUS;
+ if (HasEffect(i) && m_spellProto->EffectRadiusIndex[i])
+ {
+ float new_radius = caster->GetSpellRadiusForTarget(m_target, sSpellRadiusStore.LookupEntry(m_spellProto->EffectRadiusIndex[i]));
+ if (radius < 0.0f || radius > new_radius)
+ radius = new_radius;
+ mod = SPELLMOD_RADIUS;
+ }
}
- else
+ if (radius < 0.0f)
{
- radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex));
+ radius = caster->GetSpellMaxRangeForTarget(m_target, sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex)) ;
mod = SPELLMOD_RANGE;
}
@@ -569,46 +679,38 @@ void Aura::Update(uint32 diff)
if(!caster->IsWithinDistInMap(m_target,radius))
{
- m_target->RemoveAura(GetId(),GetEffIndex());
+ m_target->RemoveAura(this);
return;
}
}
- if(m_isPeriodic && (m_duration >= 0 || m_isPassive || m_permanent))
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if (m_partAuras[i])
+ m_partAuras[i]->Update(diff);
+}
+
+void AuraEffect::Update(uint32 diff)
+{
+ if (m_isPeriodic && (GetParentAura()->GetAuraDuration() >=0 || GetParentAura()->IsPassive() || GetParentAura()->IsPermanent()))
{
m_periodicTimer -= diff;
- if(m_periodicTimer <= 0) // tick also at m_periodicTimer==0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N
+ if(m_periodicTimer <= 0) // tick also at m_periodicTimer==0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N
{
++m_tickNumber;
- if( m_modifier.m_auraname == SPELL_AURA_MOD_REGEN ||
- m_modifier.m_auraname == SPELL_AURA_MOD_POWER_REGEN ||
- // Cannibalize, eating items and other spells
- m_modifier.m_auraname == SPELL_AURA_OBS_MOD_HEALTH ||
- // Eating items and other spells
- m_modifier.m_auraname == SPELL_AURA_OBS_MOD_MANA )
- {
- ApplyModifier(true);
- return;
- }
// update before applying (aura can be removed in TriggerSpell or PeriodicTick calls)
- m_periodicTimer += m_modifier.periodictime;
+ m_periodicTimer += m_amplitude;
if(!m_target->hasUnitState(UNIT_STAT_ISOLATED))
- {
- if(m_isTrigger)
- TriggerSpell();
- else
- PeriodicTick();
- }
+ PeriodicTick();
}
}
}
-void AreaAura::Update(uint32 diff)
+void AreaAuraEffect::Update(uint32 diff)
{
// update for the caster of the aura
- if(m_caster_guid == m_target->GetGUID())
+ if(GetCasterGUID() == m_target->GetGUID())
{
Unit* caster = m_target;
@@ -621,17 +723,20 @@ void AreaAura::Update(uint32 diff)
case AREA_AURA_PARTY:
caster->GetPartyMember(targets, m_radius);
break;
+ case AREA_AURA_RAID:
+ caster->GetRaidMember(targets, m_radius);
+ break;
case AREA_AURA_FRIEND:
{
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(caster, caster, m_radius);
- Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(caster, targets, u_check);
caster->VisitNearbyObject(m_radius, searcher);
break;
}
case AREA_AURA_ENEMY:
{
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(caster, caster, m_radius); // No GetCharmer in searcher
- Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(targets, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(caster, targets, u_check);
caster->VisitNearbyObject(m_radius, searcher);
break;
}
@@ -646,7 +751,7 @@ void AreaAura::Update(uint32 diff)
for(std::list<Unit *>::iterator tIter = targets.begin(); tIter != targets.end(); tIter++)
{
- if((*tIter)->HasAura(GetId(), m_effIndex))
+ if((*tIter)->HasAuraEffect(GetId(), GetEffIndex(), caster->GetGUID()))
continue;
if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel()))
@@ -655,136 +760,167 @@ void AreaAura::Update(uint32 diff)
// recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?)
//if(actualSpellInfo != GetSpellProto())
// actualBasePoints = actualSpellInfo->EffectBasePoints[m_effIndex];
- AreaAura *aur;
- if(actualSpellInfo == GetSpellProto())
- aur = new AreaAura(actualSpellInfo, m_effIndex, &m_modifier.m_amount, (*tIter), caster, NULL);
- else
- aur = new AreaAura(actualSpellInfo, m_effIndex, NULL, (*tIter), caster, NULL);
- (*tIter)->AddAura(aur);
+ Aura * aur = (*tIter)->AddAuraEffect(actualSpellInfo->Id, GetEffIndex(), caster);
if(m_areaAuraType == AREA_AURA_ENEMY)
caster->CombatStart(*tIter);
}
}
}
- Aura::Update(diff);
+ AuraEffect::Update(diff);
}
else // aura at non-caster
{
- Unit * tmp_target = m_target;
- Unit* caster = GetCaster();
- uint32 tmp_spellId = GetId(), tmp_effIndex = m_effIndex;
-
// WARNING: the aura may get deleted during the update
// DO NOT access its members after update!
- Aura::Update(diff);
+ AuraEffect::Update(diff);
+
+ // Speedup - no need to do more checks
+ if (GetParentAura()->IsRemoved())
+ return;
+
+ // Caster may be deleted due to update
+ Unit* caster = GetCaster();
// remove aura if out-of-range from caster (after teleport for example)
// or caster is isolated or caster no longer has the aura
// or caster is (no longer) friendly
bool needFriendly = (m_areaAuraType == AREA_AURA_ENEMY ? false : true);
if( !caster || caster->hasUnitState(UNIT_STAT_ISOLATED) ||
- !caster->IsWithinDistInMap(tmp_target, m_radius) ||
- !caster->HasAura(tmp_spellId, tmp_effIndex) ||
- caster->IsFriendlyTo(tmp_target) != needFriendly
+ !caster->HasAuraEffect(GetId(), m_effIndex) ||
+ caster->IsFriendlyTo(m_target) != needFriendly
)
{
- tmp_target->RemoveAura(tmp_spellId, tmp_effIndex);
+ m_target->RemoveAura(GetParentAura());
}
- else if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
+ else if (!caster->IsWithinDistInMap(m_target, m_radius))
{
- if(!tmp_target->IsInPartyWith(caster))
- tmp_target->RemoveAura(tmp_spellId, tmp_effIndex);
+ if (needFriendly)
+ {
+ m_removeTime -= diff;
+ if (m_removeTime < 0)
+ m_target->RemoveAura(GetParentAura());
+ }
+ else
+ m_target->RemoveAura(GetParentAura());
}
- else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
+ else
{
- if( tmp_target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
- tmp_target->RemoveAura(tmp_spellId, tmp_effIndex);
+ // Reset aura remove timer
+ m_removeTime = FRIENDLY_AA_REMOVE_TIME;
+ if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
+ {
+ if(!m_target->IsInPartyWith(caster))
+ m_target->RemoveAura(GetParentAura());
+ }
+ else if( m_areaAuraType == AREA_AURA_RAID)
+ {
+ if(!m_target->IsInRaidWith(caster))
+ m_target->RemoveAura(GetParentAura());
+ }
+ else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
+ {
+ if( m_target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
+ m_target->RemoveAura(GetParentAura());
+ }
}
}
}
-void PersistentAreaAura::Update(uint32 diff)
+void PersistentAreaAuraEffect::Update(uint32 diff)
{
- bool remove = false;
-
- // remove the aura if its caster or the dynamic object causing it was removed
- // or if the target moves too far from the dynamic object
- Unit *caster = GetCaster();
- if (caster)
+ if(Unit *caster = GetCaster())
{
- DynamicObject *dynObj = caster->GetDynObject(GetId(), GetEffIndex());
- if (dynObj)
+ if(DynamicObject *dynObj = caster->GetDynObject(GetId(), GetEffIndex()))
{
- if (!m_target->IsWithinDistInMap(dynObj, dynObj->GetRadius()))
- remove = true;
+ if(m_target->IsWithinDistInMap(dynObj, dynObj->GetRadius()))
+ {
+ AuraEffect::Update(diff);
+ return;
+ }
}
- else
- remove = true;
}
- else
- remove = true;
- Unit *tmp_target = m_target;
- uint32 tmp_id = GetId(), tmp_index = GetEffIndex();
-
- // WARNING: the aura may get deleted during the update
- // DO NOT access its members after update!
- Aura::Update(diff);
-
- if(remove)
- tmp_target->RemoveAura(tmp_id, tmp_index);
+ // remove the aura if its caster or the dynamic object causing it was removed
+ // or if the target moves too far from the dynamic object
+ m_target->RemoveAura(GetParentAura());
}
-void Aura::ApplyModifier(bool apply, bool Real)
+void AuraEffect::ApplyModifier(bool apply, bool Real)
{
- AuraType aura = m_modifier.m_auraname;
+ if (GetParentAura()->IsRemoved())
+ return;
- m_in_use = true;
- if(aura<TOTAL_AURAS)
- (*this.*AuraHandler [aura])(apply,Real);
- m_in_use = false;
+ if(m_auraName<TOTAL_AURAS)
+ (*this.*AuraHandler [m_auraName])(apply,Real);
}
-void Aura::UpdateAuraDuration()
+void AuraEffect::CleanupTriggeredSpells()
{
- if(m_auraSlot >= MAX_AURAS || m_isPassive)
+ uint32 tSpellId = m_spellProto->EffectTriggerSpell[GetEffIndex()];
+ if(!tSpellId)
return;
- if( m_target->GetTypeId() == TYPEID_PLAYER)
- {
- WorldPacket data(SMSG_UPDATE_AURA_DURATION, 5);
- data << (uint8)m_auraSlot << (uint32)m_duration;
- ((Player*)m_target)->SendDirectMessage(&data);
+ SpellEntry const* tProto = sSpellStore.LookupEntry(tSpellId);
+ if(!tProto)
+ return;
- data.Initialize(SMSG_SET_EXTRA_AURA_INFO, (8+1+4+4+4));
- data.append(m_target->GetPackGUID());
- data << uint8(m_auraSlot);
- data << uint32(GetId());
- data << uint32(GetAuraMaxDuration());
- data << uint32(GetAuraDuration());
- ((Player*)m_target)->SendDirectMessage(&data);
- }
+ if(GetSpellDuration(tProto) != -1)
+ return;
- // not send in case player loading (will not work anyway until player not added to map), sent in visibility change code
- if(m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading())
+ // needed for spell 43680, maybe others
+ // TODO: is there a spell flag, which can solve this in a more sophisticated way?
+ if(m_spellProto->EffectApplyAuraName[GetEffIndex()] == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
+ GetSpellDuration(m_spellProto) == m_spellProto->EffectAmplitude[GetEffIndex()])
return;
- Unit* caster = GetCaster();
+ m_target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
+}
- if(caster && caster->GetTypeId() == TYPEID_PLAYER && caster != m_target)
- SendAuraDurationForCaster((Player*)caster);
+void Aura::ApplyAllModifiers(bool apply, bool Real)
+{
+ for (uint8 i = 0; i<MAX_SPELL_EFFECTS;++i)
+ if (m_partAuras[i])
+ m_partAuras[i]->ApplyModifier(apply, Real);
}
-void Aura::SendAuraDurationForCaster(Player* caster)
+void Aura::SendAuraUpdate()
{
- WorldPacket data(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE, (8+1+4+4+4));
+ if (m_auraSlot>=MAX_AURAS)
+ return;
+ WorldPacket data(SMSG_AURA_UPDATE);
+
data.append(m_target->GetPackGUID());
data << uint8(m_auraSlot);
+
+ if(!m_target->GetVisibleAura(m_auraSlot))
+ {
+ data << uint32(0);
+ sLog.outDebug("Aura %u removed slot %u",GetId(), m_auraSlot);
+ m_target->SendMessageToSet(&data, true);
+ return;
+ }
+
data << uint32(GetId());
- data << uint32(GetAuraMaxDuration()); // full
- data << uint32(GetAuraDuration()); // remain
- caster->GetSession()->SendPacket(&data);
+ data << uint8(m_auraFlags);
+ data << uint8(m_auraLevel);
+ data << uint8(m_stackAmount>1 ? m_stackAmount : m_procCharges);
+
+ if(!(m_auraFlags & AFLAG_CASTER))
+ {
+ if (Unit * caster = GetCaster())
+ data.append(caster->GetPackGUID());
+ else
+ data << uint8(0);
+ }
+
+ if(m_auraFlags & AFLAG_DURATION)
+ {
+ data << uint32(m_maxduration);
+ data << uint32(m_duration);
+ }
+
+ m_target->SendMessageToSet(&data, true);
}
void Aura::_AddAura()
@@ -794,139 +930,157 @@ void Aura::_AddAura()
if(!m_target)
return;
- // we can found aura in NULL_AURA_SLOT and then need store state instead check slot != NULL_AURA_SLOT
- bool secondaura = false;
- uint8 slot = NULL_AURA_SLOT;
+ Unit* caster = GetCaster();
- for(uint8 i = 0; i < 3; i++)
+ // set infinity cooldown state for spells
+ if(caster && caster->GetTypeId() == TYPEID_PLAYER)
{
- Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
- for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
+ if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
+ {
+ Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
+ ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
+ }
+ }
+
+ // passive auras (except totem auras) do not get placed in the slots
+ // area auras with SPELL_AURA_NONE are not shown on target
+ if((m_spellProto->Attributes & 0x80 && GetTalentSpellPos(GetId()))
+ || !m_isPassive
+ || (caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())
+ || (IsAuraType(SPELL_AURA_ABILITY_IGNORE_AURASTATE))
+ && (!IsAreaAura()
+ || m_target!=caster ||
+ (m_spellProto->Effect[0]!=SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
+ && m_spellProto->Effect[1]!=SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
+ && m_spellProto->Effect[2]!=SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)))
+ {
+ // Try find slot for aura
+ uint8 slot = MAX_AURAS;
+ // Lookup for auras already applied from spell
+ if (Aura * foundAura = m_target->GetAura(GetId(), GetCasterGUID()))
{
// allow use single slot only by auras from same caster
- if(itr->second->GetCasterGUID()==GetCasterGUID())
+ slot = foundAura->GetAuraSlot();
+ }
+ else
+ {
+ Unit::VisibleAuraMap const * visibleAuras= m_target->GetVisibleAuras();
+ // lookup for free slots in units visibleAuras
+ Unit::VisibleAuraMap::const_iterator itr = visibleAuras->find(0);
+ for(uint32 freeSlot = 0; freeSlot < MAX_AURAS; ++itr , ++freeSlot)
{
- secondaura = true;
- slot = itr->second->GetAuraSlot();
- break;
+ if(itr == visibleAuras->end() || itr->first != freeSlot)
+ {
+ slot = freeSlot;
+ break;
+ }
}
}
- if(secondaura)
- break;
+ // Register Visible Aura
+ if(slot < MAX_AURAS)
+ {
+ m_auraFlags |= (IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE) |
+ (GetCasterGUID() == m_target->GetGUID() ? AFLAG_CASTER : AFLAG_NONE) |
+ (GetAuraMaxDuration() > 0 ? AFLAG_DURATION : AFLAG_NONE);
+ m_auraLevel = (caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
+ SetAuraSlot( slot );
+ m_target->SetVisibleAura(slot, this);
+ m_target->UpdateAuraForGroup(slot);
+ SendAuraUpdate();
+ sLog.outDebug("Aura: %u Effect: %d put to unit visible auras slot: %u",GetId(), GetEffectMask(), slot);
+ }
+ else
+ sLog.outDebug("Aura: %u Effect: %d could not find empty unit visible slot",GetId(), GetEffectMask());
}
- Unit* caster = GetCaster();
+ // Sitdown on apply aura req seated
+ if (m_spellProto->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED && !m_target->IsSitState())
+ m_target->SetStandState(UNIT_STAND_STATE_SIT);
- // not call total regen auras at adding
- switch (m_modifier.m_auraname)
- {
- /*case SPELL_AURA_PERIODIC_DAMAGE:
- case SPELL_AURA_PERIODIC_LEECH:
- if(caster)
- m_modifier.m_amount = caster->SpellDamageBonus(m_target, m_spellProto, m_modifier.m_amount, DOT);
- break;
- case SPELL_AURA_PERIODIC_HEAL:
- if(caster)
- m_modifier.m_amount = caster->SpellHealingBonus(m_spellProto, m_modifier.m_amount, DOT, m_target);
- break;*/
- case SPELL_AURA_OBS_MOD_HEALTH:
- case SPELL_AURA_OBS_MOD_MANA:
- m_periodicTimer = m_modifier.periodictime;
- break;
- case SPELL_AURA_MOD_REGEN:
- case SPELL_AURA_MOD_POWER_REGEN:
- case SPELL_AURA_MOD_MANA_REGEN_FROM_STAT:
- m_periodicTimer = 5000;
- break;
- }
-
- // register aura
+ // register aura diminishing on apply
if (getDiminishGroup() != DIMINISHING_NONE )
m_target->ApplyDiminishingAura(getDiminishGroup(),true);
- // passive auras (except totem auras) do not get placed in the slots
- // area auras with SPELL_AURA_NONE are not shown on target
- if((!m_isPassive || (caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) &&
- (m_spellProto->Effect[GetEffIndex()] != SPELL_EFFECT_APPLY_AREA_AURA_ENEMY || m_target != caster))
+ // Apply linked auras (On first aura apply)
+ uint32 id = GetId();
+ if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA)
{
- if(!secondaura) // new slot need
- {
- if (IsPositive()) // empty positive slot
- {
- for (uint8 i = 0; i < MAX_POSITIVE_AURAS; i++)
- {
- if (m_target->GetUInt32Value((uint16)(UNIT_FIELD_AURA + i)) == 0)
- {
- slot = i;
- break;
- }
- }
- }
- else // empty negative slot
+ if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
+ for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
- for (uint8 i = MAX_POSITIVE_AURAS; i < MAX_AURAS; i++)
- {
- if (m_target->GetUInt32Value((uint16)(UNIT_FIELD_AURA + i)) == 0)
- {
- slot = i;
- break;
- }
- }
+ if(*itr < 0)
+ m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), m_target);
+ else if(Unit* caster = GetCaster())
+ m_target->AddAura(*itr, m_target);
}
+ }
- SetAuraSlot( slot );
+ //*****************************************************
+ // Update target aura state flag
+ //*****************************************************
- // Not update fields for not first spell's aura, all data already in fields
- if(slot < MAX_AURAS) // slot found
- {
- SetAura(slot, false);
- SetAuraFlag(slot, true);
- SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
- UpdateAuraCharges();
+ // Update Seals information
+ if (IsSealSpell(m_spellProto))
+ SetAuraState(AURA_STATE_JUDGEMENT);
- // update for out of range group members
- m_target->UpdateAuraForGroup(slot);
- }
- }
- else // use found slot
- {
- SetAuraSlot( slot );
- }
+ // Conflagrate aura state on Immolate
+ if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[0] & 4)
+ SetAuraState(AURA_STATE_IMMOLATE);
+
+ // Faerie Fire (druid versions)
+ if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[0] & 0x400)
+ SetAuraState(AURA_STATE_FAERIE_FIRE);
- UpdateSlotCounterAndDuration();
+ // Victorious
+ if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags[1] & 0x00040000)
+ SetAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH);
- // Update Seals information
- if( IsSealSpell(GetSpellProto()) )
- m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
+ // Swiftmend state on Regrowth & Rejuvenation
+ if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[0] & 0x50 )
+ SetAuraState(AURA_STATE_SWIFTMEND);
- // Conflagrate aura state
- if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 4))
- m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true);
+ // Deadly poison aura state
+ if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellProto->SpellFamilyFlags[0] & 0x10000)
+ SetAuraState(AURA_STATE_DEADLY_POISON);
- if(GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
- && (GetSpellProto()->SpellFamilyFlags == 0x40 || GetSpellProto()->SpellFamilyFlags == 0x10))
+ // Enrage aura state
+ if(m_spellProto->Dispel == DISPEL_ENRAGE)
+ SetAuraState(AURA_STATE_ENRAGE);
+
+ if(GetSpellSchoolMask(m_spellProto) & SPELL_SCHOOL_MASK_FROST)
+ {
+ for (uint8 i = 0;i<MAX_SPELL_EFFECTS;++i)
{
- m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, true);
+ if (m_spellProto->EffectApplyAuraName[i]==SPELL_AURA_MOD_STUN
+ || m_spellProto->EffectApplyAuraName[i]==SPELL_AURA_MOD_ROOT)
+ {
+ SetAuraState(AURA_STATE_FROZEN);
+ break;
+ }
}
}
+
+ m_target->ApplyModFlag(UNIT_FIELD_AURASTATE, GetAuraStateMask(), true);
+}
+
+bool Aura::SetPartAura(AuraEffect* aurEff, uint8 effIndex)
+{
+ if (IsRemoved())
+ return false;
+ if (m_auraFlags & (1<<effIndex))
+ return false;
+ m_auraFlags |= 1<<effIndex;
+ m_partAuras[effIndex]=aurEff;
+ m_target->HandleAuraEffect(aurEff, true);
+ SendAuraUpdate();
+ return true;
}
void Aura::_RemoveAura()
{
Unit* caster = GetCaster();
- if(caster && IsPersistent())
- {
- DynamicObject *dynObj = caster->GetDynObject(GetId(), GetEffIndex());
- if (dynObj)
- dynObj->RemoveAffected(m_target);
- }
-
- // unregister aura
- if (getDiminishGroup() != DIMINISHING_NONE )
- m_target->ApplyDiminishingAura(getDiminishGroup(),false);
-
//passive auras do not get put in slots
// Note: but totem can be not accessible for aura target in time remove (to far for find in grid)
//if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem()))
@@ -934,185 +1088,423 @@ void Aura::_RemoveAura()
uint8 slot = GetAuraSlot();
- if(slot >= MAX_AURAS) // slot not set
- return;
+ if (Aura * foundAura = m_target->GetAura(GetId(), GetCasterGUID()))
+ {
+ // allow use single slot only by auras from same caster
+ slot = foundAura->GetAuraSlot();
+ if(slot < MAX_AURAS) // slot not set
+ if (Aura *entry = m_target->GetVisibleAura(slot))
+ {
+ // set not valid slot for aura - prevent removing other visible aura
+ slot = MAX_AURAS;
+ }
+ }
- if(m_target->GetUInt32Value((uint16)(UNIT_FIELD_AURA + slot)) == 0)
- return;
+ // update for out of range group members
+ if (slot < MAX_AURAS)
+ {
+ m_target->RemoveVisibleAura(slot);
+ m_target->UpdateAuraForGroup(slot);
+ SendAuraUpdate();
+ }
- bool samespell = false;
+ // unregister aura diminishing (and store last time)
+ if (getDiminishGroup() != DIMINISHING_NONE )
+ m_target->ApplyDiminishingAura(getDiminishGroup(),false);
- // find other aura in same slot (current already removed from list)
- for(uint8 i = 0; i < 3; i++)
+ // Check needed only if aura applies aurastate
+ if(GetAuraStateMask())
{
- Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i);
- for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr)
+ uint32 foundMask = 0;
+ Unit::AuraMap& Auras = m_target->GetAuras();
+ // Get mask of all aurastates from remaining auras
+ for(Unit::AuraMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
{
- if(itr->second->GetAuraSlot()==slot)
+ foundMask|=(*i).second->GetAuraStateMask();
+ }
+ // Remove only aurastates which were not found
+ foundMask = GetAuraStateMask() &~foundMask;
+ if (foundMask)
+ m_target->ApplyModFlag(UNIT_FIELD_AURASTATE, foundMask, false);
+ }
+
+ // since now aura cannot apply/remove it's modifiers
+ m_isRemoved = true;
+ // disable client server communication for removed aura
+ SetAuraSlot(MAX_AURAS);
+
+ // reset cooldown state for spells
+ if(caster && caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if ( GetSpellProto()->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE )
+ // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
+ ((Player*)caster)->SendCooldownEvent(GetSpellProto());
+ }
+ uint32 id = GetId();
+ // Remove Linked Auras
+ if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE)
+ {
+ if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)id))
+ for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
- samespell = true;
+ if(*itr < 0)
+ m_target->RemoveAurasDueToSpell(-(*itr));
+ else if(Unit* caster = GetCaster())
+ if (m_removeMode==AURA_REMOVE_BY_EXPIRE)
+ m_target->CastSpell(m_target, *itr, true, 0, 0, caster->GetGUID());
+ }
+ }
+ if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA)
+ {
+ if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
+ for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
+ {
+ if(*itr < 0)
+ m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), false);
+ else
+ m_target->RemoveAurasDueToSpell(*itr);
+ }
+ }
- break;
+ // Proc on aura remove (only spell flags for now)
+ if (caster)
+ {
+ uint32 procEx=0;
+ if (m_removeMode == AURA_REMOVE_BY_ENEMY_SPELL)
+ procEx = PROC_EX_AURA_REMOVE_DESTROY;
+ else if (m_removeMode == AURA_REMOVE_BY_EXPIRE || m_removeMode == AURA_REMOVE_BY_CANCEL)
+ procEx = PROC_EX_AURA_REMOVE_EXPIRE;
+ if (procEx)
+ {
+ uint32 ProcCaster, ProcVictim;
+ if (IsPositiveSpell(GetId()))
+ {
+ ProcCaster = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL;
+ ProcVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL;
}
+ else
+ {
+ ProcCaster = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT;
+ ProcVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT;
+ }
+ caster->ProcDamageAndSpell(m_target,ProcCaster, ProcVictim, procEx, m_procDamage, BASE_ATTACK, m_spellProto);
}
- if(samespell)
- break;
}
+}
- // only remove icon when the last aura of the spell is removed (current aura already removed from list)
- if (!samespell)
+void Aura::SetStackAmount(uint8 stackAmount)
+{
+ if (stackAmount != m_stackAmount)
{
- SetAura(slot, true);
- SetAuraFlag(slot, false);
- SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
-
- SetAuraApplication(slot, 0);
- // update for out of range group members
- m_target->UpdateAuraForGroup(slot);
-
- if( IsSealSpell(GetSpellProto()) )
- m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
-
- // Conflagrate aura state
- if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 4))
- m_target->ModifyAuraState(AURA_STATE_IMMOLATE, false);
-
- // Swiftmend aura state
- if(GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
- && (GetSpellProto()->SpellFamilyFlags == 0x40 || GetSpellProto()->SpellFamilyFlags == 0x10))
+ Unit *target = GetTarget();
+ Unit *caster = GetCaster();
+ if (target && caster)
{
- bool found = false;
- Unit::AuraList const& RejorRegr = m_target->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
- for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
+ m_stackAmount = stackAmount;
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
- if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
- && ((*i)->GetSpellProto()->SpellFamilyFlags == 0x40 || (*i)->GetSpellProto()->SpellFamilyFlags == 0x10) )
+ if (AuraEffect * part = GetPartAura(i))
{
- found = true;
- break;
+ int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, part->GetEffIndex(), part->GetBasePoints(), target);
+ // Reapply if amount change
+ if (amount!=part->GetAmount())
+ {
+ // Auras which are applying spellmod should have removed spellmods for real
+ part->ApplyModifier(false,true);
+ part->SetAmount(amount);
+ part->ApplyModifier(true,true);
+ }
}
}
- if(!found)
- m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, false);
}
+ }
+ RefreshAura();
+}
+
+bool Aura::modStackAmount(int32 num)
+{
+ // Can`t mod
+ if (!m_spellProto->StackAmount)
+ return true;
+
+ // Modify stack but limit it
+ int32 stackAmount = m_stackAmount + num;
+ if (stackAmount > m_spellProto->StackAmount)
+ stackAmount = m_spellProto->StackAmount;
+ else if (stackAmount <=0) // Last aura from stack removed
+ {
+ m_stackAmount = 0;
+ return true; // need remove aura
+ }
+
+ // Update stack amount
+ SetStackAmount(stackAmount);
+ return false;
+}
+
+void Aura::SetAuraDuration(int32 duration)
+{
+ m_duration = duration;
+ //if (duration<0)
+ //m_permanent=true;
+ //else
+ //m_permanent=false;
+ SendAuraUpdate();
+}
- // reset cooldown state for spells
- if(caster && caster->GetTypeId() == TYPEID_PLAYER)
+void Aura::SetAuraCharges(uint8 charges)
+{
+ if (m_procCharges == charges)
+ return;
+ m_procCharges = charges;
+ SendAuraUpdate();
+}
+
+bool Aura::DropAuraCharge()
+{
+ if (m_procCharges == 0)
+ return false;
+ m_procCharges--;
+ SendAuraUpdate();
+ // return true if last charge dropped
+ return m_procCharges == 0;
+}
+
+bool Aura::IsPersistent() const
+{
+ for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
+ {
+ if (m_partAuras[i])
{
- if ( GetSpellProto()->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE )
- ((Player*)caster)->SendCooldownEvent(GetSpellProto());
+ if (m_partAuras[i]->IsPersistent())
+ return true;
}
}
+ return false;
}
-void Aura::SetAuraFlag(uint32 slot, bool add)
+bool Aura::IsAreaAura() const
{
- uint32 index = slot / 4;
- uint32 byte = (slot % 4) * 8;
- uint32 val = m_target->GetUInt32Value(UNIT_FIELD_AURAFLAGS + index);
- val &= ~((uint32)AFLAG_MASK << byte);
- if(add)
+ for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
{
- if (IsPositive())
- val |= ((uint32)AFLAG_POSITIVE << byte);
- else
- val |= ((uint32)AFLAG_NEGATIVE << byte);
+ if (m_partAuras[i])
+ {
+ if (m_partAuras[i]->IsAreaAura())
+ return true;
+ }
}
- m_target->SetUInt32Value(UNIT_FIELD_AURAFLAGS + index, val);
+ return false;
}
-void Aura::SetAuraLevel(uint32 slot,uint32 level)
+bool Aura::IsAuraType(AuraType type) const
{
- uint32 index = slot / 4;
- uint32 byte = (slot % 4) * 8;
- uint32 val = m_target->GetUInt32Value(UNIT_FIELD_AURALEVELS + index);
- val &= ~(0xFF << byte);
- val |= (level << byte);
- m_target->SetUInt32Value(UNIT_FIELD_AURALEVELS + index, val);
+ for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
+ {
+ if (m_partAuras[i])
+ {
+ if (m_partAuras[i]->GetAuraName()==type)
+ return true;
+ }
+ }
+ return false;
}
-void Aura::SetAuraApplication(uint32 slot, int8 count)
+void Aura::SetLoadedState(uint64 caster_guid,int32 maxduration,int32 duration,int32 charges, uint8 stackamount, int32 * amount)
{
- uint32 index = slot / 4;
- uint32 byte = (slot % 4) * 8;
- uint32 val = m_target->GetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS + index);
- val &= ~(0xFF << byte);
- val |= ((uint8(count)) << byte);
- m_target->SetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS + index, val);
+ m_caster_guid = caster_guid;
+ m_maxduration = maxduration;
+ m_duration = duration;
+ m_procCharges = charges;
+ m_stackAmount = stackamount;
+ for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
+ if (m_partAuras[i])
+ m_partAuras[i]->SetAmount(amount[i]);
}
-void Aura::UpdateSlotCounterAndDuration()
+void AuraEffect::HandleShapeshiftBoosts(bool apply)
{
- uint8 slot = GetAuraSlot();
- if(slot >= MAX_AURAS)
- return;
+ uint32 spellId = 0;
+ uint32 spellId2 = 0;
+ uint32 HotWSpellId = 0;
+
+ switch(GetMiscValue())
+ {
+ case FORM_CAT:
+ spellId = 3025;
+ HotWSpellId = 24900;
+ break;
+ case FORM_TREE:
+ spellId = 5420;
+ spellId2 = 34123;
+ break;
+ case FORM_TRAVEL:
+ spellId = 5419;
+ break;
+ case FORM_AQUA:
+ spellId = 5421;
+ break;
+ case FORM_BEAR:
+ spellId = 1178;
+ spellId2 = 21178;
+ HotWSpellId = 24899;
+ break;
+ case FORM_DIREBEAR:
+ spellId = 9635;
+ spellId2 = 21178;
+ HotWSpellId = 24899;
+ break;
+ case FORM_BATTLESTANCE:
+ spellId = 21156;
+ break;
+ case FORM_DEFENSIVESTANCE:
+ spellId = 7376;
+ break;
+ case FORM_BERSERKERSTANCE:
+ spellId = 7381;
+ break;
+ case FORM_MOONKIN:
+ spellId = 24905;
+ // aura from effect trigger spell
+ spellId2 = 24907;
+ break;
+ case FORM_FLIGHT:
+ spellId = 33948;
+ spellId2 = 34764;
+ break;
+ case FORM_FLIGHT_EPIC:
+ spellId = 40122;
+ spellId2 = 40121;
+ break;
+ case FORM_METAMORPHOSIS:
+ spellId = 54817;
+ spellId2 = 54879;
+ break;
+ case FORM_SPIRITOFREDEMPTION:
+ spellId = 27792;
+ spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation.
+ break;
+ case FORM_GHOSTWOLF:
+ case FORM_AMBIENT:
+ case FORM_GHOUL:
+ case FORM_SHADOW:
+ case FORM_STEALTH:
+ case FORM_CREATURECAT:
+ case FORM_CREATUREBEAR:
+ spellId = 0;
+ break;
+ }
+
+ uint32 form = GetMiscValue()-1;
+
+ if(apply)
+ {
+ if (spellId) m_target->CastSpell(m_target, spellId, true, NULL, this );
+ if (spellId2) m_target->CastSpell(m_target, spellId2, true, NULL, this);
+
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ {
+ const PlayerSpellMap& sp_list = ((Player *)m_target)->GetSpellMap();
+ for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ {
+ if(itr->second->state == PLAYERSPELL_REMOVED) continue;
+ if(itr->first==spellId || itr->first==spellId2) continue;
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
+ if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | (1<<7)))) continue;
+ if (spellInfo->Stances & (1<<form))
+ m_target->CastSpell(m_target, itr->first, true, NULL, this);
+ }
+ //LotP
+ if (((Player*)m_target)->HasSpell(17007))
+ {
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(24932);
+ if (spellInfo && spellInfo->Stances & (1<<form))
+ m_target->CastSpell(m_target, 24932, true, NULL, this);
+ }
+ // HotW
+ if (HotWSpellId)
+ {
+ Unit::AuraEffectList const& mModTotalStatPct = m_target->GetAurasByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE);
+ for(Unit::AuraEffectList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
+ {
+ if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetMiscValue() == 3)
+ {
+ int32 HotWMod = (*i)->GetAmount();
+ if(GetMiscValue() == FORM_CAT)
+ HotWMod /= 2;
- // Three possibilities:
- // Charge = 0; Stack >= 0
- // Charge = 1; Stack >= 0
- // Charge > 1; Stack = 0
- if(m_procCharges < 2)
- SetAuraApplication(slot, m_stackAmount-1);
+ m_target->CastCustomSpell(m_target, HotWSpellId, &HotWMod, NULL, NULL, true, NULL, this);
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ m_target->RemoveAurasDueToSpell(spellId);
+ m_target->RemoveAurasDueToSpell(spellId2);
- UpdateAuraDuration();
+ Unit::AuraMap& tAuras = m_target->GetAuras();
+ for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
+ {
+ if (itr->second->IsRemovedOnShapeLost())
+ {
+ m_target->RemoveAura(itr);
+ }
+ else
+ {
+ ++itr;
+ }
+ }
+ }
+}
+
+bool AuraEffect::isAffectedOnSpell(SpellEntry const *spell) const
+{
+ if (!spell)
+ return false;
+ // Check family name
+ if (spell->SpellFamilyName != m_spellProto->SpellFamilyName)
+ return false;
+ // Check EffectClassMask
+ if (m_spellProto->EffectSpellClassMask[m_effIndex] & spell->SpellFamilyFlags)
+ return true;
+ return false;
}
/*********************************************************/
/*** BASIC AURA FUNCTION ***/
/*********************************************************/
-void Aura::HandleAddModifier(bool apply, bool Real)
+void AuraEffect::HandleAddModifier(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER || !Real)
return;
- SpellEntry const *spellInfo = GetSpellProto();
- if(!spellInfo)
- return;
-
- if(m_modifier.m_miscvalue >= MAX_SPELLMOD)
+ if(GetMiscValue() >= MAX_SPELLMOD)
return;
if (apply)
{
- // Add custom charges for some mod aura
- switch (m_spellProto->Id)
- {
- case 17941: // Shadow Trance
- case 22008: // Netherwind Focus
- case 34936: // Backlash
- m_procCharges = 1;
- break;
- }
SpellModifier *mod = new SpellModifier;
- mod->op = SpellModOp(m_modifier.m_miscvalue);
- mod->value = GetModifierValue();
- mod->type = SpellModType(m_modifier.m_auraname); // SpellModType value == spell aura types
+ mod->op = SpellModOp(GetMiscValue());
+ mod->value = m_amount;
+ mod->type = SpellModType(m_auraName); // SpellModType value == spell aura types
mod->spellId = GetId();
- mod->effectId = m_effIndex;
- mod->lastAffected = NULL;
-
- uint64 spellAffectMask = spellmgr.GetSpellAffectMask(GetId(), m_effIndex);
-
- if (spellAffectMask)
- mod->mask = spellAffectMask;
- else
- mod->mask = spellInfo->EffectItemType[m_effIndex];
- if (m_procCharges > 0)
- mod->charges = m_procCharges;
- else
- mod->charges = 0;
+ flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
+ if (!spellAffect)
+ spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
+ mod->mask = *spellAffect;
+ mod->charges = GetParentAura()->GetAuraCharges();
m_spellmod = mod;
}
- uint64 spellFamilyMask = m_spellmod->mask;
-
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reapply some passive spells after add/remove related spellmods
- if(spellInfo->SpellFamilyName==SPELLFAMILY_WARRIOR && (spellFamilyMask & 0x0000100000000000LL))
+ if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && (m_spellmod->mask[1] & 0x00001000))
{
m_target->RemoveAurasDueToSpell(45471);
@@ -1120,8 +1512,31 @@ void Aura::HandleAddModifier(bool apply, bool Real)
m_target->CastSpell(m_target,45471,true);
}
}
+void AuraEffect::HandleAddTargetTrigger(bool apply, bool Real)
+{
+ // Use SpellModifier structure for check
+ // used only fields:
+ // spellId, mask, mask2
+ if (apply)
+ {
+ SpellModifier *mod = new SpellModifier;
+ mod->spellId = GetId();
+
+ flag96 const *spellAffect = spellmgr.GetSpellAffect(GetId(), m_effIndex);
+ if (!spellAffect)
+ spellAffect = &m_spellProto->EffectSpellClassMask[m_effIndex];
+
+ mod->mask = *spellAffect;
+ m_spellmod = mod;
+ }
+ else
+ {
+ delete m_spellmod;
+ m_spellmod = NULL;
+ }
+}
-void Aura::TriggerSpell()
+void AuraEffect::TriggerSpell()
{
Unit* caster = GetCaster();
Unit* target = GetTriggerTarget();
@@ -1132,8 +1547,6 @@ void Aura::TriggerSpell()
// generic casting code with custom spells and target/caster customs
uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];
- uint64 originalCasterGUID = GetCasterGUID();
-
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
SpellEntry const *auraSpellInfo = GetSpellProto();
uint32 auraId = auraSpellInfo->Id;
@@ -1172,7 +1585,7 @@ void Aura::TriggerSpell()
}
// remove old enchanting before applying new
((Player*)caster)->ApplyEnchantment(item,TEMP_ENCHANTMENT_SLOT,false);
- item->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, m_modifier.periodictime+1000, 0);
+ item->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, m_amplitude+1000, 0);
// add new enchanting
((Player*)caster)->ApplyEnchantment(item,TEMP_ENCHANTMENT_SLOT,true);
return;
@@ -1228,7 +1641,7 @@ void Aura::TriggerSpell()
caster->ModifyPower( POWER_MANA, mana );
caster->SendEnergizeSpellLog(caster, 23493, mana, POWER_MANA);
}
- break;
+ return;
}
// // Stoneclaw Totem Passive TEST
// case 23792: break;
@@ -1285,8 +1698,13 @@ void Aura::TriggerSpell()
} break;
// // Steam Tank Passive
// case 27747: break;
-// // Frost Blast
-// case 27808: break;
+ // Frost Blast
+ case 27808:
+ {
+ int32 bpDamage = target->GetMaxHealth()*26/100;
+ caster->CastCustomSpell(target,29879,&bpDamage,NULL,NULL,true,NULL,this);
+ return;
+ }
// // Detonate Mana
// case 27819: break;
// // Controller Timer
@@ -1307,8 +1725,11 @@ void Aura::TriggerSpell()
// case 28522: break;
// // Silithyst
// case 29519: break;
-// // Inoculate Nestlewood Owlkin
- case 29528: trigger_spell_id = 28713; break;
+ // Inoculate Nestlewood Owlkin
+ case 29528:
+ if(target->GetTypeId()!=TYPEID_UNIT)// prevent error reports in case ignored player target
+ return;
+ break;
// // Overload
// case 29768: break;
// // Return Fire
@@ -1341,32 +1762,15 @@ void Aura::TriggerSpell()
Creature* creature = (Creature*)target;
// missing lootid has been reported on startup - just return
if (!creature->GetCreatureInfo()->SkinLootId)
- {
return;
- }
- Loot *loot = &creature->loot;
- loot->clear();
- loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, NULL);
- for(uint8 i=0;i<loot->items.size();i++)
- {
- LootItem *item = loot->LootItemInSlot(i,player);
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, item->itemid, item->count );
- if ( msg == EQUIP_ERR_OK )
- {
- Item * newitem = player->StoreNewItem( dest, item->itemid, true, item->randomPropertyId);
-
- player->SendNewItem(newitem, uint32(item->count), false, false, true);
- }
- else
- player->SendEquipError( msg, NULL, NULL );
- }
+
+ player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId,LootTemplates_Skinning,true);
+
creature->setDeathState(JUST_DIED);
creature->RemoveCorpse();
creature->SetHealth(0); // just for nice GM-mode view
}
return;
- break;
}
// Quake
case 30576: trigger_spell_id = 30571; break;
@@ -1569,13 +1973,13 @@ void Aura::TriggerSpell()
// Aura of Desire
case 41350:
{
- Unit::AuraList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
- for(Unit::AuraList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
+ Unit::AuraEffectList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
+ for(Unit::AuraEffectList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
{
if ((*i)->GetId() == 41350)
{
(*i)->ApplyModifier(false);
- (*i)->GetModifier()->m_amount -= 5;
+ (*i)->SetAmount((*i)->GetAmount()-5);
(*i)->ApplyModifier(true);
break;
}
@@ -1616,11 +2020,8 @@ void Aura::TriggerSpell()
{
// Invisibility
case 66:
- {
- if(!m_duration)
- m_target->CastSpell(m_target, 32612, true, NULL, this);
+ // Here need periodic triger reducing threat spell (or do it manually)
return;
- }
default:
break;
}
@@ -1666,7 +2067,7 @@ void Aura::TriggerSpell()
case 22896:
case 26999:
{
- int32 LifePerRage = GetModifier()->m_amount;
+ int32 LifePerRage = GetAmount();
int32 lRage = m_target->GetPower(POWER_RAGE);
if(lRage > 100) // rage stored as rage*10
@@ -1730,7 +2131,7 @@ void Aura::TriggerSpell()
{
SpellEntry const* spell = itr->second->GetSpellProto();
if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
- spell->SpellFamilyFlags & 0x0000000000000400L)
+ spell->SpellFamilyFlags[0] & 0x400)
return;
}
target->RemoveAurasDueToSpell(28820);
@@ -1740,9 +2141,9 @@ void Aura::TriggerSpell()
case 38443:
{
bool all = true;
- for(int i = 0; i < MAX_TOTEM; ++i)
+ for(int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
{
- if(!caster->m_TotemSlot[i])
+ if(!caster->m_SummonSlot[i])
{
all = false;
break;
@@ -1763,13 +2164,9 @@ void Aura::TriggerSpell()
default:
break;
}
+
// Reget trigger spell proto
triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id);
- if(triggeredSpellInfo == NULL)
- {
- sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
- return;
- }
}
else
{
@@ -1786,22 +2183,22 @@ void Aura::TriggerSpell()
// 2) maybe aura must be replace by new with accumulative stat mods instead stacking
// prevent cast by triggered auras
- if(m_caster_guid == m_target->GetGUID())
+ if(GetCasterGUID() == m_target->GetGUID())
return;
// stop triggering after each affected stats lost > 90
int32 intellectLoss = 0;
int32 spiritLoss = 0;
- Unit::AuraList const& mModStat = m_target->GetAurasByType(SPELL_AURA_MOD_STAT);
- for(Unit::AuraList::const_iterator i = mModStat.begin(); i != mModStat.end(); ++i)
+ Unit::AuraEffectList const& mModStat = m_target->GetAurasByType(SPELL_AURA_MOD_STAT);
+ for(Unit::AuraEffectList::const_iterator i = mModStat.begin(); i != mModStat.end(); ++i)
{
if ((*i)->GetId() == 1010)
{
- switch((*i)->GetModifier()->m_miscvalue)
+ switch((*i)->GetMiscValue())
{
- case STAT_INTELLECT: intellectLoss += (*i)->GetModifierValue(); break;
- case STAT_SPIRIT: spiritLoss += (*i)->GetModifierValue(); break;
+ case STAT_INTELLECT: intellectLoss += (*i)->GetAmount(); break;
+ case STAT_SPIRIT: spiritLoss += (*i)->GetAmount(); break;
default: break;
}
}
@@ -1811,36 +2208,53 @@ void Aura::TriggerSpell()
return;
caster = target;
- originalCasterGUID = 0;
break;
}
// Mana Tide
case 16191:
{
- caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this, originalCasterGUID);
+ caster->CastCustomSpell(target, trigger_spell_id, &m_amount, NULL, NULL, true, NULL, this);
return;
}
}
}
- if(!GetSpellMaxRange(sSpellRangeStore.LookupEntry(triggeredSpellInfo->rangeIndex)))
- target = m_target; //for druid dispel poison
- m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID);
+
+ if(triggeredSpellInfo)
+ {
+ if(!caster->GetSpellMaxRangeForTarget(m_target,sSpellRangeStore.LookupEntry(triggeredSpellInfo->rangeIndex)))
+ target = m_target; //for druid dispel poison
+ m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, GetCasterGUID());
+ }
+ else if(target->GetTypeId()!=TYPEID_UNIT || !Script->EffectDummyCreature(caster, GetId(), GetEffIndex(), (Creature*)target))
+ sLog.outError("AuraEffect::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
}
-Unit* Aura::GetTriggerTarget() const
+Unit* AuraEffect::GetTriggerTarget() const
{
- Unit* target = ObjectAccessor::GetUnit(*m_target,
- /*m_target->GetTypeId()==TYPEID_PLAYER ?
- ((Player*)m_target)->GetSelection() :*/
- m_target->GetUInt64Value(UNIT_FIELD_TARGET));
+ Unit* target = ObjectAccessor::GetUnit(*m_target, m_target->GetUInt64Value(UNIT_FIELD_TARGET));
return target ? target : m_target;
}
+void AuraEffect::TriggerSpellWithValue()
+{
+ Unit* caster = GetCaster();
+ Unit* target = GetTriggerTarget();
+
+ if(!caster || !target)
+ return;
+
+ // generic casting code with custom spells and target/caster customs
+ uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];
+ int32 basepoints0 = this->GetAmount();
+
+ caster->CastCustomSpell(target, trigger_spell_id, &basepoints0, 0, 0, true, 0, this);
+}
+
/*********************************************************/
/*** AURA EFFECTS ***/
/*********************************************************/
-void Aura::HandleAuraDummy(bool apply, bool Real)
+void AuraEffect::HandleAuraDummy(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -1853,6 +2267,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
switch(GetId())
{
+ // Haunting Spirits - perdiodic trigger demon
+ case 7057:
+ m_isPeriodic = true;
+ m_amplitude = irand (0, 60) + 30;
+ m_amplitude *= IN_MILISECONDS;
+ return;
case 1515: // Tame beast
// FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
if( caster && m_target->CanHaveThreatList())
@@ -1863,13 +2283,50 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if(caster)
caster->CastSpell(caster,13138,true,NULL,this);
return;
+ case 34026: // kill command
+ {
+ Unit * pet = m_target->GetGuardianPet();
+ if (!pet)
+ return;
+
+ m_target->CastSpell(m_target,34027,true,NULL,this);
+
+ // set 3 stacks and 3 charges (to make all auras not disappear at once)
+ Aura* owner_aura = m_target->GetAura(34027,GetCasterGUID());
+ Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
+ if( owner_aura )
+ {
+ owner_aura->SetStackAmount(owner_aura->GetSpellProto()->StackAmount);
+ }
+ if( pet_aura )
+ {
+ pet_aura->SetAuraCharges(0);
+ pet_aura->SetStackAmount(owner_aura->GetSpellProto()->StackAmount);
+ }
+ return;
+ }
+ case 55198: // Tidal Force
+ {
+ m_target->CastSpell(m_target,55166,true,NULL,this);
+ // set 3 stacks and 3 charges (to make all auras not disappear at once)
+ Aura* owner_aura = m_target->GetAura(55166,GetCasterGUID());
+ if( owner_aura )
+ {
+ // This aura lasts 2 sec, need this hack to properly proc spells
+ // TODO: drop aura charges for ApplySpellMod in ProcDamageAndSpell
+ GetParentAura()->SetAuraDuration(owner_aura->GetAuraDuration());
+ // Make aura be not charged-this prevents removing charge on not crit spells
+ owner_aura->SetAuraCharges(0);
+ owner_aura->SetStackAmount(owner_aura->GetSpellProto()->StackAmount);
+ }
+ return;
+ }
case 39850: // Rocket Blast
if(roll_chance_i(20)) // backfire stun
m_target->CastSpell(m_target, 51581, true, NULL, this);
return;
case 43873: // Headless Horseman Laugh
- if(caster->GetTypeId() == TYPEID_PLAYER)
- ((Player*)caster)->SendPlaySound(11965, false);
+ m_target->PlayDistanceSound(11965);
return;
case 46354: // Blood Elf Illusion
if(caster)
@@ -1894,24 +2351,26 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
// Earth Shield
- if ( caster && GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellFamilyFlags & 0x40000000000LL))
+ if ( caster && GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellFamilyFlags[1] & 0x400))
{
// prevent double apply bonuses
if(m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
- m_modifier.m_amount = caster->SpellHealingBonus(GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE, m_target);
+ m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_amount, SPELL_DIRECT_DAMAGE);
return;
}
+ //Druid, Survival Instincts
+ if(GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID && GetSpellProto()->SpellFamilyFlags[2]& 0x40 )
+ {
+ if(!m_target)
+ return;
+
+ int32 bp0 = int32(m_target->GetMaxHealth() * m_amount / 100);
+ m_target->CastCustomSpell(m_target, 50322, &bp0, NULL, NULL, true);
+ }
}
// AT REMOVE
else
{
- if( m_target->GetTypeId() == TYPEID_PLAYER && GetSpellProto()->Effect[0]==72 )
- {
- // spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
- ((Player*)m_target)->ClearFarsight();
- return;
- }
-
if( (IsQuestTameSpell(GetId())) && caster && caster->isAlive() && m_target->isAlive())
{
uint32 finalSpelId = 0;
@@ -1965,6 +2424,29 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
m_target->SetReducedThreatPercent(0, 0);
return;
}
+
+ switch(m_spellProto->SpellFamilyName)
+ {
+ case SPELLFAMILY_WARLOCK:
+ // Haunt
+ if(m_spellProto->SpellFamilyFlags[1] & 0x40000)
+ {
+ int32 bp0 = GetParentAura()->GetProcDamage() * m_amount / 100;
+ if(caster)
+ caster->CastCustomSpell(caster, 48210, &bp0, 0, 0, true, NULL, this);
+ return;
+ }
+ break;
+ case SPELLFAMILY_MAGE:
+ // Living Bomb
+ if(m_spellProto->SpellFamilyFlags[1] & 0x20000)
+ {
+ if(caster && (GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL || GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_DEATH || GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE))
+ caster->CastSpell(m_target, GetAmount(), true);
+ return;
+ }
+ break;
+ }
}
// AT APPLY & REMOVE
@@ -2005,12 +2487,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
m_target->RemoveAurasDueToSpell(spellId);
return;
}
- // Victorious
- if(GetId()==32216 && m_target->getClass()==CLASS_WARRIOR)
- {
- m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, apply);
- return;
- }
//Summon Fire Elemental
if (GetId() == 40133 && caster)
{
@@ -2043,35 +2519,102 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
case SPELLFAMILY_MAGE:
{
- // Hypothermia
- if( GetId()==41425 )
+ break;
+ }
+ case SPELLFAMILY_PRIEST:
+ {
+ // Pain and Suffering
+ if( m_spellProto->SpellIconID == 2874 && m_target->GetTypeId()==TYPEID_PLAYER )
{
- m_target->ModifyAuraState(AURA_STATE_HYPOTHERMIA,apply);
+ if(apply)
+ {
+ // Reduce backfire damage (dot damage) from Shadow Word: Death
+ SpellModifier *mod = new SpellModifier;
+ mod->op = SPELLMOD_DOT;
+ mod->value = m_amount;
+ mod->type = SPELLMOD_PCT;
+ mod->spellId = GetId();
+ mod->mask[1] = 0x00002000;
+ m_spellmod = mod;
+ }
+ ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
return;
}
break;
}
case SPELLFAMILY_DRUID:
{
+ switch(GetId())
+ {
+ case 34246: // Idol of the Emerald Queen
+ {
+ if (m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(apply)
+ {
+ SpellModifier *mod = new SpellModifier;
+ mod->op = SPELLMOD_DOT;
+ mod->value = m_amount/7;
+ mod->type = SPELLMOD_FLAT;
+ mod->spellId = GetId();
+ mod->mask[1] = 0x0010;
+
+ m_spellmod = mod;
+ }
+
+ ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
+ return;
+ }
+ case 61336: // Survival Instincts
+ {
+ if(apply)
+ {
+ if (!m_target->IsInFeralForm())
+ return;
+
+ int32 bp0 = int32(m_target->GetMaxHealth() * m_amount / 100);
+ m_target->CastCustomSpell(m_target, 50322, &bp0, NULL, NULL, true);
+ }
+ else
+ m_target-> RemoveAurasDueToSpell(50322);
+ return;
+ }
+ }
+
// Lifebloom
- if ( GetSpellProto()->SpellFamilyFlags & 0x1000000000LL )
+ if ( GetSpellProto()->SpellFamilyFlags[1] & 0x10 )
{
if ( apply )
{
if ( caster )
// prevent double apply bonuses
if(m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
- m_modifier.m_amount = caster->SpellHealingBonus(GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE, m_target);
+ m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_amount, SPELL_DIRECT_DAMAGE);
}
- // Do final heal for real !apply
- else if (Real)
+ else
{
- if (GetAuraDuration() <= 0 || m_removeMode==AURA_REMOVE_BY_DISPEL)
+ // Final heal only on dispelled or duration end
+ if (GetParentAura()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetParentAura()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
+ return;
+
+ // final heal
+ if(m_target->IsInWorld())
+ m_target->CastCustomSpell(m_target,33778,&m_amount,NULL,NULL,true,NULL,this,GetCasterGUID());
+
+ /*// have a look if there is still some other Lifebloom dummy aura
+ Unit::AuraList auras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraList::iterator itr = auras.begin(); itr!=auras.end(); ++itr)
+ if((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
+ (*itr)->GetSpellProto()->SpellFamilyFlags & 0x1000000000LL)
+ return;
+
+ // final heal
+ if(m_target->IsInWorld() && m_stackAmount > 0)
{
- // final heal
- if(m_target->IsInWorld())
- m_target->CastCustomSpell(m_target,33778,&m_modifier.m_amount,NULL,NULL,true,NULL,this,GetCasterGUID());
- }
+ int32 amount = m_amount / m_stackAmount;
+ m_target->CastCustomSpell(m_target,33778,&amount,NULL,NULL,true,NULL,this,GetCasterGUID());
+ }*/
}
return;
}
@@ -2082,20 +2625,22 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
((Player*)m_target)->UpdateAttackPowerAndDamage();
return;
}
- // Idol of the Emerald Queen
- if ( GetId() == 34246 && m_target->GetTypeId()==TYPEID_PLAYER )
+ break;
+ }
+ case SPELLFAMILY_HUNTER:
+ {
+ // Improved Aspect of the Viper
+ if( GetId()==38390 && m_target->GetTypeId()==TYPEID_PLAYER )
{
if(apply)
{
+ // + effect value for Aspect of the Viper
SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_DOT;
- mod->value = m_modifier.m_amount/7;
+ mod->op = SPELLMOD_EFFECT1;
+ mod->value = m_amount;
mod->type = SPELLMOD_FLAT;
mod->spellId = GetId();
- mod->effectId = m_effIndex;
- mod->lastAffected = NULL;
- mod->mask = 0x001000000000LL;
- mod->charges = 0;
+ mod->mask[1] = 0x40000;
m_spellmod = mod;
}
@@ -2103,29 +2648,22 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
return;
}
- break;
- }
- case SPELLFAMILY_HUNTER:
- {
- // Improved Aspect of the Viper
- if( GetId()==38390 && m_target->GetTypeId()==TYPEID_PLAYER )
+ // Glyph of Aspect of the Monkey
+ if(m_spellProto->Id==56833)
{
if(apply)
{
- // + effect value for Aspect of the Viper
+ // Reduce backfire damage (dot damage) from Shadow Word: Death
SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_EFFECT1;
- mod->value = m_modifier.m_amount;
+ mod->op = SPELLMOD_CHANCE_OF_SUCCESS;
+ mod->value = 100;
mod->type = SPELLMOD_FLAT;
mod->spellId = GetId();
- mod->effectId = m_effIndex;
- mod->lastAffected = NULL;
- mod->mask = 0x4000000000000LL;
- mod->charges = 0;
-
+ mod->mask[2] = 8192;
+ mod->mask[1] = 0x00000000;
+ mod->mask[0] = 524288;
m_spellmod = mod;
}
-
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
return;
}
@@ -2140,21 +2678,18 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
SpellModifier *mod = new SpellModifier;
mod->op = SPELLMOD_EFFECT1;
- mod->value = m_modifier.m_amount;
+ mod->value = m_amount;
mod->type = SPELLMOD_PCT;
mod->spellId = GetId();
- mod->effectId = m_effIndex;
- mod->lastAffected = NULL;
switch (m_effIndex)
{
case 0:
- mod->mask = 0x00200000000LL; // Windfury Totem
+ mod->mask[1] = 0x002; // Windfury Totem
break;
case 1:
- mod->mask = 0x00400000000LL; // Flametongue Totem
+ mod->mask[1] = 0x004; // Flametongue Totem
break;
}
- mod->charges = 0;
m_spellmod = mod;
}
@@ -2168,7 +2703,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
if (apply)
{
- uint64 guid = caster->m_TotemSlot[3];
+ uint64 guid = caster->m_SummonSlot[3];
if (guid)
{
Creature *totem = ObjectAccessor::GetCreature(*caster, guid);
@@ -2193,45 +2728,32 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
m_target->RemovePetAura(petSpell);
return;
}
-}
-
-void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
-{
- // spells required only Real aura add/remove
- if(!Real)
- return;
- SpellEntry const*spell = GetSpellProto();
- switch( spell->SpellFamilyName)
+ if(GetEffIndex()==0 && m_target->GetTypeId()==TYPEID_PLAYER)
{
- case SPELLFAMILY_ROGUE:
+ SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
+ if(saBounds.first != saBounds.second)
{
- // Master of Subtlety
- if (spell->Id==31666 && !apply && Real)
- {
- m_target->RemoveAurasDueToSpell(31665);
- break;
- }
- break;
- }
- case SPELLFAMILY_HUNTER:
- {
- // Aspect of the Viper
- if (spell->SpellFamilyFlags&0x0004000000000000LL)
+ uint32 zone, area;
+ m_target->GetZoneAndAreaId(zone,area);
+
+ for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
- // Update regen on remove
- if (!apply && m_target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_target)->UpdateManaRegen();
- break;
+ // some auras remove at aura remove
+ if(!itr->second->IsFitToRequirements((Player*)m_target,zone,area))
+ m_target->RemoveAurasDueToSpell(itr->second->spellId);
+ // some auras applied at aura apply
+ else if(itr->second->autocast)
+ {
+ if( !m_target->HasAuraEffect(itr->second->spellId,0) )
+ m_target->CastSpell(m_target,itr->second->spellId,true);
+ }
}
- break;
}
}
-
- m_isPeriodic = apply;
}
-void Aura::HandleAuraMounted(bool apply, bool Real)
+void AuraEffect::HandleAuraMounted(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -2239,10 +2761,10 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
if(apply)
{
- CreatureInfo const* ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue);
+ CreatureInfo const* ci = objmgr.GetCreatureTemplate(GetMiscValue());
if(!ci)
{
- sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)", m_modifier.m_miscvalue);
+ sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)",GetMiscValue());
return;
}
@@ -2263,7 +2785,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
}
}
-void Aura::HandleAuraWaterWalk(bool apply, bool Real)
+void AuraEffect::HandleAuraWaterWalk(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -2279,7 +2801,7 @@ void Aura::HandleAuraWaterWalk(bool apply, bool Real)
m_target->SendMessageToSet(&data,true);
}
-void Aura::HandleAuraFeatherFall(bool apply, bool Real)
+void AuraEffect::HandleAuraFeatherFall(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -2295,7 +2817,7 @@ void Aura::HandleAuraFeatherFall(bool apply, bool Real)
m_target->SendMessageToSet(&data,true);
}
-void Aura::HandleAuraHover(bool apply, bool Real)
+void AuraEffect::HandleAuraHover(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -2311,31 +2833,21 @@ void Aura::HandleAuraHover(bool apply, bool Real)
m_target->SendMessageToSet(&data,true);
}
-void Aura::HandleWaterBreathing(bool apply, bool Real)
+void AuraEffect::HandleWaterBreathing(bool apply, bool Real)
{
- if(apply)
- m_target->waterbreath = true;
- else if(m_target->GetAurasByType(SPELL_AURA_WATER_BREATHING).empty())
- {
- m_target->waterbreath = false;
-
- // update for enable timer in case not moving target
- if(m_target->GetTypeId()==TYPEID_PLAYER && m_target->IsInWorld())
- {
- ((Player*)m_target)->UpdateUnderwaterState(m_target->GetMap(),m_target->GetPositionX(),m_target->GetPositionY(),m_target->GetPositionZ());
- ((Player*)m_target)->HandleDrowning();
- }
- }
+ // update timers in client
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ ((Player*)m_target)->UpdateMirrorTimers();
}
-void Aura::HandleAuraModShapeshift(bool apply, bool Real)
+void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real)
{
if(!Real)
return;
uint32 modelid = 0;
Powers PowerType = POWER_MANA;
- ShapeshiftForm form = ShapeshiftForm(m_modifier.m_miscvalue);
+ ShapeshiftForm form = ShapeshiftForm(GetMiscValue());
switch(form)
{
case FORM_CAT:
@@ -2396,6 +2908,9 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
else
modelid = 21244;
break;
+ case FORM_METAMORPHOSIS:
+ modelid = 25277;
+ break;
case FORM_AMBIENT:
case FORM_SHADOW:
case FORM_STEALTH:
@@ -2412,7 +2927,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
modelid = 16031;
break;
default:
- sLog.outError("Auras: Unknown Shapeshift Type: %u", m_modifier.m_miscvalue);
+ sLog.outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue());
}
// remove polymorph before changing display id to keep new display id
@@ -2428,8 +2943,8 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
case FORM_FLIGHT:
case FORM_MOONKIN:
// remove movement affects
- m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
- m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
+ m_target->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
+ m_target->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
// and polymorphic affects
if(m_target->IsPolymorphed())
@@ -2443,7 +2958,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
{
// remove other shapeshift before applying a new one
if(m_target->m_ShapeShiftFormSpellId)
- m_target->RemoveAurasDueToSpell(m_target->m_ShapeShiftFormSpellId,this);
+ m_target->RemoveAurasDueToSpell(m_target->m_ShapeShiftFormSpellId);
m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form);
@@ -2464,17 +2979,17 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
{
// get furor proc chance
uint32 FurorChance = 0;
- Unit::AuraList const& mDummy = m_target->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i)
+ Unit::AuraEffectList const& mDummy = m_target->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i)
{
if ((*i)->GetSpellProto()->SpellIconID == 238)
{
- FurorChance = (*i)->GetModifier()->m_amount;
+ FurorChance = (*i)->GetAmount();
break;
}
}
- if (m_modifier.m_miscvalue == FORM_CAT)
+ if (GetMiscValue() == FORM_CAT)
{
m_target->SetPower(POWER_ENERGY,0);
if(urand(1,100) <= FurorChance)
@@ -2535,14 +3050,14 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
case FORM_DIREBEAR:
case FORM_CAT:
{
- if(Aura* dummy = m_target->GetDummyAura(37315) )
+ if(AuraEffect* dummy = m_target->GetDummyAura(37315) )
m_target->CastSpell(m_target,37316,true,NULL,dummy);
break;
}
// Nordrassil Regalia - bonus
case FORM_MOONKIN:
{
- if(Aura* dummy = m_target->GetDummyAura(37324) )
+ if(AuraEffect* dummy = m_target->GetDummyAura(37324) )
m_target->CastSpell(m_target,37325,true,NULL,dummy);
break;
}
@@ -2557,18 +3072,18 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
((Player*)m_target)->InitDataForForm();
}
-void Aura::HandleAuraTransform(bool apply, bool Real)
+void AuraEffect::HandleAuraTransform(bool apply, bool Real)
{
if (apply)
{
// special case (spell specific functionality)
- if(m_modifier.m_miscvalue==0)
+ if(GetMiscValue()==0)
{
// player applied only
- if(m_target->GetTypeId()!=TYPEID_PLAYER)
+ if (m_target->GetTypeId()!=TYPEID_PLAYER)
return;
- switch(GetId())
+ switch (GetId())
{
// Orb of Deception
case 16739:
@@ -2627,12 +3142,12 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
}
else
{
- CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_modifier.m_miscvalue);
+ CreatureInfo const * ci = objmgr.GetCreatureTemplate(GetMiscValue());
if(!ci)
{
//pig pink ^_^
m_target->SetDisplayId(16358);
- sLog.outError("Auras: unknown creature id = %d (only need its modelid) Form Spell Aura Transform in Spell ID = %d", m_modifier.m_miscvalue, GetId());
+ sLog.outError("Auras: unknown creature id = %d (only need its modelid) Form Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
}
else
{
@@ -2644,38 +3159,41 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED).empty())
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
}
- m_target->setTransForm(GetId());
}
+ // update active transform spell only not set or not overwriting negative by positive case
+ if (!m_target->getTransForm() || !IsPositiveSpell(GetId()) || IsPositiveSpell(m_target->getTransForm()))
+ m_target->setTransForm(GetId());
+
// polymorph case
- if( Real && m_target->GetTypeId() == TYPEID_PLAYER && m_target->IsPolymorphed())
+ if (Real && m_target->GetTypeId() == TYPEID_PLAYER && m_target->IsPolymorphed())
{
// for players, start regeneration after 1s (in polymorph fast regeneration case)
// only if caster is Player (after patch 2.4.2)
- if(IS_PLAYER_GUID(GetCasterGUID()) )
- ((Player*)m_target)->setRegenTimer(1000);
+ if (IS_PLAYER_GUID(GetCasterGUID()) )
+ ((Player*)m_target)->setRegenTimer(1*IN_MILISECONDS);
//dismount polymorphed target (after patch 2.4.2)
if (m_target->IsMounted())
- m_target->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ m_target->RemoveAurasByType(SPELL_AURA_MOUNTED);
}
}
else
{
- Unit::AuraList const& otherTransforms = m_target->GetAurasByType(SPELL_AURA_TRANSFORM);
- if(otherTransforms.empty())
- {
- m_target->SetDisplayId(m_target->GetNativeDisplayId());
- m_target->setTransForm(0);
- }
- else
+ // ApplyModifier(true) will reapply it if need
+ m_target->setTransForm(0);
+ m_target->SetDisplayId(m_target->GetNativeDisplayId());
+
+ // re-aplly some from still active with preference negative cases
+ Unit::AuraEffectList const& otherTransforms = m_target->GetAurasByType(SPELL_AURA_TRANSFORM);
+ if (!otherTransforms.empty())
{
// look for other transform auras
- Aura* handledAura = *otherTransforms.begin();
- for(Unit::AuraList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
+ AuraEffect* handledAura = *otherTransforms.begin();
+ for(Unit::AuraEffectList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i)
{
// negative auras are preferred
- if(!IsPositiveSpell((*i)->GetSpellProto()->Id))
+ if (!IsPositiveSpell((*i)->GetSpellProto()->Id))
{
handledAura = *i;
break;
@@ -2685,11 +3203,11 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
}
// Dragonmaw Illusion (restore mount model)
- if(GetId()==42016 && m_target->GetMountID()==16314)
+ if (GetId()==42016 && m_target->GetMountID()==16314)
{
- if(!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
+ if (!m_target->GetAurasByType(SPELL_AURA_MOUNTED).empty())
{
- uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetModifier()->m_miscvalue;
+ uint32 cr_id = m_target->GetAurasByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
if(CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
{
uint32 team = 0;
@@ -2708,7 +3226,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real)
}
}
-void Aura::HandleForceReaction(bool apply, bool Real)
+void AuraEffect::HandleForceReaction(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -2718,44 +3236,32 @@ void Aura::HandleForceReaction(bool apply, bool Real)
Player* player = (Player*)m_target;
- uint32 faction_id = m_modifier.m_miscvalue;
- uint32 faction_rank = m_modifier.m_amount;
+ uint32 faction_id = GetMiscValue();
+ uint32 faction_rank = m_amount;
- if(apply)
- player->m_forcedReactions[faction_id] = ReputationRank(faction_rank);
- else
- player->m_forcedReactions.erase(faction_id);
-
- WorldPacket data;
- data.Initialize(SMSG_SET_FORCED_REACTIONS, 4+player->m_forcedReactions.size()*(4+4));
- data << uint32(player->m_forcedReactions.size());
- for(ForcedReactions::const_iterator itr = player->m_forcedReactions.begin(); itr != player->m_forcedReactions.end(); ++itr)
- {
- data << uint32(itr->first); // faction_id (Faction.dbc)
- data << uint32(itr->second); // reputation rank
- }
- player->SendDirectMessage(&data);
+ player->GetReputationMgr().ApplyForceReaction(faction_id,ReputationRank(faction_rank),apply);
+ player->GetReputationMgr().SendForceReactions();
}
-void Aura::HandleAuraModSkill(bool apply, bool Real)
+void AuraEffect::HandleAuraModSkill(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
uint32 prot=GetSpellProto()->EffectMiscValue[m_effIndex];
- int32 points = GetModifierValue();
+ int32 points = m_amount;
- ((Player*)m_target)->ModifySkillBonus(prot,(apply ? points: -points),m_modifier.m_auraname==SPELL_AURA_MOD_SKILL_TALENT);
+ ((Player*)m_target)->ModifySkillBonus(prot,(apply ? points: -points),m_auraName==SPELL_AURA_MOD_SKILL_TALENT);
if(prot == SKILL_DEFENSE)
((Player*)m_target)->UpdateDefenseBonusesMod();
}
-void Aura::HandleChannelDeathItem(bool apply, bool Real)
+void AuraEffect::HandleChannelDeathItem(bool apply, bool Real)
{
if(Real && !apply)
{
Unit* caster = GetCaster();
- Unit* victim = GetTarget();
+ Unit* victim = m_target;
if(!caster || caster->GetTypeId() != TYPEID_PLAYER || !victim)// || m_removeMode!=AURA_REMOVE_BY_DEATH)
return;
@@ -2763,6 +3269,9 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real)
//talent will remove the caster's aura->interrupt channel->remove victim aura
if(victim->GetHealth() > 0)
return;
+ // Item amount
+ if (m_amount <= 0)
+ return;
SpellEntry const *spellInfo = GetSpellProto();
if(spellInfo->EffectItemType[m_effIndex] == 0)
@@ -2773,100 +3282,156 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real)
(victim->getLevel() <= Trinity::XP::GetGrayLevel(caster->getLevel()) ||
victim->GetTypeId()==TYPEID_UNIT && !((Player*)caster)->isAllowedToLoot((Creature*)victim)) )
return;
+ //Adding items
+ uint32 noSpaceForCount = 0;
+ uint32 count = m_amount;
+
ItemPosCountVec dest;
- uint8 msg = ((Player*)caster)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, spellInfo->EffectItemType[m_effIndex], 1 );
+ uint8 msg = ((Player*)caster)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, spellInfo->EffectItemType[m_effIndex], count, &noSpaceForCount);
if( msg != EQUIP_ERR_OK )
{
+ count-=noSpaceForCount;
((Player*)caster)->SendEquipError( msg, NULL, NULL );
- return;
+ if (count==0)
+ return;
}
Item* newitem = ((Player*)caster)->StoreNewItem(dest, spellInfo->EffectItemType[m_effIndex], true);
- ((Player*)caster)->SendNewItem(newitem, 1, true, false);
+ ((Player*)caster)->SendNewItem(newitem, count, true, false);
}
}
-void Aura::HandleBindSight(bool apply, bool Real)
+void AuraEffect::HandleBindSight(bool apply, bool Real)
{
Unit* caster = GetCaster();
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
- if (apply)
- m_target->AddPlayerToVision((Player*)caster);
- else
- m_target->RemovePlayerFromVision((Player*)caster);
+ ((Player*)caster)->SetViewpoint(m_target, apply);
}
-void Aura::HandleFarSight(bool apply, bool Real)
+void AuraEffect::HandleFarSight(bool apply, bool Real)
{
- Unit* caster = GetCaster();
- if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- ((Player*)caster)->SetFarSight(apply ? m_target->GetGUID() : NULL);
+ //Handled by client
}
-void Aura::HandleAuraTrackCreatures(bool apply, bool Real)
+void AuraEffect::HandleAuraTrackCreatures(bool apply, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
- if(apply)
- m_target->RemoveNoStackAurasDueToAura(this);
- m_target->SetUInt32Value(PLAYER_TRACK_CREATURES, apply ? ((uint32)1)<<(m_modifier.m_miscvalue-1) : 0 );
+ m_target->SetUInt32Value(PLAYER_TRACK_CREATURES, apply ? ((uint32)1)<<(GetMiscValue()-1) : 0 );
}
-void Aura::HandleAuraTrackResources(bool apply, bool Real)
+void AuraEffect::HandleAuraTrackResources(bool apply, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
- if(apply)
- m_target->RemoveNoStackAurasDueToAura(this);
- m_target->SetUInt32Value(PLAYER_TRACK_RESOURCES, apply ? ((uint32)1)<<(m_modifier.m_miscvalue-1): 0 );
+ m_target->SetUInt32Value(PLAYER_TRACK_RESOURCES, apply ? ((uint32)1)<<(GetMiscValue()-1): 0 );
}
-void Aura::HandleAuraTrackStealthed(bool apply, bool Real)
+void AuraEffect::HandleAuraTrackStealthed(bool apply, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
- if(apply)
- m_target->RemoveNoStackAurasDueToAura(this);
-
m_target->ApplyModFlag(PLAYER_FIELD_BYTES,PLAYER_FIELD_BYTE_TRACK_STEALTHED,apply);
}
-void Aura::HandleAuraModScale(bool apply, bool Real)
+void AuraEffect::HandleAuraModScale(bool apply, bool Real)
{
- m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,GetModifierValue(),apply);
+ m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,m_amount,apply);
}
-void Aura::HandleModPossess(bool apply, bool Real)
+/*void AuraEffect::HandleModPossess(bool apply, bool Real)
{
if(!Real)
return;
+ if(m_target->getLevel() > m_amount)
+ return;
+
+ // not possess yourself
+ if(GetCasterGUID() == m_target->GetGUID())
+ return;
+
Unit* caster = GetCaster();
- if(caster && caster->GetTypeId() == TYPEID_UNIT)
- {
- HandleModCharm(apply, Real);
+ if(!caster)
return;
- }
- if(apply)
+ if( apply )
{
- if(m_target->getLevel() > m_modifier.m_amount)
- return;
+ m_target->SetCharmerGUID(GetCasterGUID());
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
- m_target->SetCharmedOrPossessedBy(caster, true);
+ caster->SetCharm(m_target);
+
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)caster)->SetFarSightGUID(m_target->GetGUID());
+ ((Player*)caster)->SetClientControl(m_target, 1);
+ }
+
+ m_target->CombatStop();
+ m_target->DeleteThreatList();
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ m_target->StopMoving();
+ m_target->GetMotionMaster()->Clear();
+ m_target->GetMotionMaster()->MoveIdle();
+ }
+ else if(m_target->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)m_target)->SetClientControl(m_target, 0);
+ }
+
+ if(CharmInfo *charmInfo = m_target->InitCharmInfo(m_target))
+ charmInfo->InitPossessCreateSpells();
+
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)caster)->PossessSpellInitialize();
}
else
- m_target->RemoveCharmedOrPossessedBy(caster);
+ {
+ m_target->SetCharmerGUID(0);
+ caster->InterruptSpell(CURRENT_CHANNELED_SPELL); // the spell is not automatically canceled when interrupted, do it now
+
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)m_target)->setFactionForRace(m_target->getRace());
+ ((Player*)m_target)->SetClientControl(m_target, 1);
+ }
+ else if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+ }
+
+ caster->SetCharm(NULL);
+
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)caster)->SetFarSightGUID(0);
+ ((Player*)caster)->SetClientControl(m_target,0);
+
+ WorldPacket data(SMSG_PET_SPELLS, 8+4);
+ data << uint64(0);
+ data << uint32(0);
+ ((Player*)caster)->GetSession()->SendPacket(&data);
+ }
+
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ ((Creature*)m_target)->AIM_Initialize();
+
+ if (((Creature*)m_target)->AI())
+ ((Creature*)m_target)->AI()->AttackedBy(caster);
+ }
+ }
}
-void Aura::HandleModPossessPet(bool apply, bool Real)
+void AuraEffect::HandleModPossessPet(bool apply, bool Real)
{
if(!Real)
return;
@@ -2875,46 +3440,155 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
+ Pet *pet = caster->GetGuardianPet();
+ if(!pet || pet != m_target)
+ return;
+
if(apply)
- {
- if(caster->GetPet() != m_target)
- return;
+ pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
+ else
+ pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
- m_target->SetCharmedOrPossessedBy(caster, true);
+ ((Player*)caster)->SetFarSightGUID(apply ? pet->GetGUID() : 0);
+ ((Player*)caster)->SetCharm(apply ? pet : NULL);
+ ((Player*)caster)->SetClientControl(pet, apply ? 1 : 0);
+
+ if(apply)
+ {
+ pet->StopMoving();
+ pet->GetMotionMaster()->Clear();
+ pet->GetMotionMaster()->MoveIdle();
}
else
{
- m_target->RemoveCharmedOrPossessedBy(caster);
-
- // Reinitialize the pet bar and make the pet come back to the owner
- ((Player*)caster)->PetSpellInitialize();
- if(!m_target->getVictim())
- {
- m_target->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
- }
+ pet->AttackStop();
+ pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ pet->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
}
+}*/
+
+void AuraEffect::HandleAuraModPetTalentsPoints(bool Apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ // Recalculate pet tlaent points
+ if (Pet *pet = ((Player*)m_target)->GetPet())
+ pet->InitTalentForLevel();
}
-void Aura::HandleModCharm(bool apply, bool Real)
+/*void AuraEffect::HandleModCharm(bool apply, bool Real)
{
if(!Real)
return;
+ // not charm yourself
+ if(GetCasterGUID() == m_target->GetGUID())
+ return;
+
Unit* caster = GetCaster();
+ if(!caster)
+ return;
- if(apply)
+ if(int32(m_target->getLevel()) <= m_amount)
{
- if(int32(m_target->getLevel()) > m_modifier.m_amount)
- return;
+ if( apply )
+ {
+ m_target->SetCharmerGUID(GetCasterGUID());
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
+ m_target->CastStop(m_target==caster ? GetId() : 0);
+ caster->SetCharm(m_target);
- m_target->SetCharmedOrPossessedBy(caster, false);
+ m_target->CombatStop();
+ m_target->DeleteThreatList();
+
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ ((Creature*)m_target)->AIM_Initialize();
+ CharmInfo *charmInfo = m_target->InitCharmInfo(m_target);
+ charmInfo->InitCharmCreateSpells();
+ charmInfo->SetReactState( REACT_DEFENSIVE );
+
+ if(caster->GetTypeId() == TYPEID_PLAYER && caster->getClass() == CLASS_WARLOCK)
+ {
+ CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
+ if(cinfo && cinfo->type == CREATURE_TYPE_DEMON)
+ {
+ //to prevent client crash
+ m_target->SetFlag(UNIT_FIELD_BYTES_0, 2048);
+ //just to enable stat window
+ charmInfo->SetPetNumber(objmgr.GeneratePetNumber(), true);
+ //if charmed two demons the same session, the 2nd gets the 1st one's name
+ m_target->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
+ }
+ }
+ }
+
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)caster)->CharmSpellInitialize();
+ }
+ }
+ else
+ {
+ m_target->SetCharmerGUID(0);
+
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)m_target)->setFactionForRace(m_target->getRace());
+ else
+ {
+ CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
+
+ // restore faction
+ if(((Creature*)m_target)->isPet())
+ {
+ if(Unit* owner = m_target->GetOwner())
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,owner->getFaction());
+ else if(cinfo)
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+ }
+ else if(cinfo) // normal creature
+ m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+
+ // restore UNIT_FIELD_BYTES_0
+ if(cinfo && caster->GetTypeId() == TYPEID_PLAYER && caster->getClass() == CLASS_WARLOCK && cinfo->type == CREATURE_TYPE_DEMON)
+ {
+ CreatureDataAddon const *cainfo = ((Creature*)m_target)->GetCreatureAddon();
+ if(cainfo && cainfo->bytes0 != 0)
+ m_target->SetUInt32Value(UNIT_FIELD_BYTES_0, cainfo->bytes0);
+ else
+ m_target->RemoveFlag(UNIT_FIELD_BYTES_0, 2048);
+
+ if(m_target->GetCharmInfo())
+ m_target->GetCharmInfo()->SetPetNumber(0, true);
+ else
+ sLog.outError("AuraEffect::HandleModCharm: target="I64FMTD" with typeid=%d has a charm aura but no charm info!", m_target->GetGUID(), m_target->GetTypeId());
+ }
+ }
+
+ caster->SetCharm(NULL);
+
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ WorldPacket data(SMSG_PET_SPELLS, 8+4);
+ data << uint64(0);
+ data << uint32(0);
+ ((Player*)caster)->GetSession()->SendPacket(&data);
+ }
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ ((Creature*)m_target)->AIM_Initialize();
+ if (((Creature*)m_target)->AI())
+ ((Creature*)m_target)->AI()->AttackedBy(caster);
+ }
+ }
}
- else
- m_target->RemoveCharmedOrPossessedBy(caster);
-}
+}*/
-void Aura::HandleModConfuse(bool apply, bool Real)
+void AuraEffect::HandleModConfuse(bool apply, bool Real)
{
if(!Real)
return;
@@ -2923,7 +3597,7 @@ void Aura::HandleModConfuse(bool apply, bool Real)
m_target->SetControlled(apply, UNIT_STAT_CONFUSED);
}
-void Aura::HandleModFear(bool apply, bool Real)
+void AuraEffect::HandleModFear(bool apply, bool Real)
{
if (!Real)
return;
@@ -2932,7 +3606,7 @@ void Aura::HandleModFear(bool apply, bool Real)
m_target->SetControlled(apply, UNIT_STAT_FLEEING);
}
-void Aura::HandleFeignDeath(bool apply, bool Real)
+void AuraEffect::HandleFeignDeath(bool apply, bool Real)
{
if(!Real)
return;
@@ -2951,7 +3625,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
std::list<Unit*> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_target, m_target, World::GetMaxVisibleDistance());
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_target, targets, u_check);
m_target->VisitNearbyObject(World::GetMaxVisibleDistance(), searcher);
for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
@@ -2968,7 +3642,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
}
}
// blizz like 2.0.x
- m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN6);
+ m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
// blizz like 2.0.x
m_target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
// blizz like 2.0.x
@@ -2976,10 +3650,10 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
m_target->addUnitState(UNIT_STAT_DIED);
m_target->CombatStop();
- m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
// prevent interrupt message
- if(m_caster_guid==m_target->GetGUID() && m_target->m_currentSpells[CURRENT_GENERIC_SPELL])
+ if(GetCasterGUID()==m_target->GetGUID() && m_target->m_currentSpells[CURRENT_GENERIC_SPELL])
m_target->m_currentSpells[CURRENT_GENERIC_SPELL]->finish();
m_target->InterruptNonMeleeSpells(true);
m_target->getHostilRefManager().deleteReferences();
@@ -2993,7 +3667,7 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
m_target->SendMessageToSet(&data,true);
*/
// blizz like 2.0.x
- m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN6);
+ m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
// blizz like 2.0.x
m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
// blizz like 2.0.x
@@ -3003,221 +3677,142 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
}
}
-void Aura::HandleAuraModDisarm(bool apply, bool Real)
+void AuraEffect::HandleAuraModDisarm(bool apply, bool Real)
{
- if(!Real)
+ if (!Real)
return;
+ AuraType type = AuraType(GetAuraName());
- if(!apply && m_target->HasAuraType(SPELL_AURA_MOD_DISARM))
+ //Prevent handling aura twice
+ if(apply && m_target->GetAurasByType(type).size()>1)
return;
-
- // not sure for it's correctness
+ if(!apply && m_target->HasAuraType(type))
+ return;
+ uint32 field, flag, slot;
+ WeaponAttackType attType;
+ switch (type)
+ {
+ case SPELL_AURA_MOD_DISARM:
+ field=UNIT_FIELD_FLAGS;
+ flag=UNIT_FLAG_DISARMED;
+ slot=EQUIPMENT_SLOT_MAINHAND;
+ attType=BASE_ATTACK;
+ break;
+ case SPELL_AURA_MOD_DISARM_OFFHAND:
+ field=UNIT_FIELD_FLAGS_2;
+ flag=UNIT_FLAG2_DISARM_OFFHAND;
+ slot=EQUIPMENT_SLOT_OFFHAND;
+ attType=OFF_ATTACK;
+ break;
+ case SPELL_AURA_MOD_DISARM_RANGED:
+ field=UNIT_FIELD_FLAGS_2;
+ flag=UNIT_FLAG2_DISARM_RANGED;
+ slot=EQUIPMENT_SLOT_RANGED;
+ attType=RANGED_ATTACK;
+ break;
+ }
if(apply)
- m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED);
+ m_target->SetFlag(field, flag);
else
- m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED);
+ m_target->RemoveFlag(field, flag);
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
- // main-hand attack speed already set to special value for feral form already and don't must change and reset at remove.
- if (((Player *)m_target)->IsInFeralForm())
- return;
-
- if (apply)
- m_target->SetAttackTime(BASE_ATTACK,BASE_ATTACK_TIME);
- else
- ((Player *)m_target)->SetRegularAttackTime();
- }
- else
- {
- // creature does not have equipment
- if(apply && !((Creature*)m_target)->GetCurrentEquipmentId())
+ Item *pItem = ((Player*)m_target)->GetItemByPos( INVENTORY_SLOT_BAG_0, slot );
+ if(!pItem )
return;
+ ((Player*)m_target)->_ApplyItemMods(pItem, slot, !apply);
}
-
- m_target->UpdateDamagePhysical(BASE_ATTACK);
+ else if (((Creature*)m_target)->GetCurrentEquipmentId())
+ m_target->UpdateDamagePhysical(attType);
}
-void Aura::HandleAuraModStun(bool apply, bool Real)
+void AuraEffect::HandleModStealth(bool apply, bool Real)
{
if(!Real)
return;
- m_target->SetControlled(apply, UNIT_STAT_STUNNED);
-}
-
-void Aura::HandleModStealth(bool apply, bool Real)
-{
if(apply)
{
- if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
- {
- // drop flag at stealth in bg
- m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
-
- // remove player from the objective's active player count at stealth
- if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
- pvp->HandlePlayerActivityChanged((Player*)m_target);
- }
+ // drop flag at stealth in bg
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
- // only at real aura add
- if(Real)
- {
- m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x02);
- if(m_target->GetTypeId()==TYPEID_PLAYER)
- m_target->SetFlag(PLAYER_FIELD_BYTES2, 0x2000);
-
- // apply only if not in GM invisibility (and overwrite invisibility state)
- if(m_target->GetVisibility()!=VISIBILITY_OFF)
- {
- //m_target->SetVisibility(VISIBILITY_GROUP_NO_DETECT);
- //m_target->SetVisibility(VISIBILITY_OFF);
- m_target->SetVisibility(VISIBILITY_GROUP_STEALTH);
- }
+ m_target->SetStandFlags(UNIT_STAND_FLAGS_CREEP);
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ m_target->SetFlag(PLAYER_FIELD_BYTES2, 0x2000);
- // for RACE_NIGHTELF stealth
- if(m_target->GetTypeId()==TYPEID_PLAYER && GetId()==20580)
- m_target->CastSpell(m_target, 21009, true, NULL, this);
- }
+ // apply only if not in GM invisibility (and overwrite invisibility state)
+ if(m_target->GetVisibility() != VISIBILITY_OFF)
+ m_target->SetVisibility(VISIBILITY_GROUP_STEALTH);
}
- else
+ else if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH)) // if last SPELL_AURA_MOD_STEALTH
{
- // only at real aura remove
- if(Real)
- {
- // for RACE_NIGHTELF stealth
- if(m_target->GetTypeId()==TYPEID_PLAYER && GetId()==20580)
- m_target->RemoveAurasDueToSpell(21009);
-
- // if last SPELL_AURA_MOD_STEALTH and no GM invisibility
- if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH) && m_target->GetVisibility()!=VISIBILITY_OFF)
- {
- m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00);
- if(m_target->GetTypeId()==TYPEID_PLAYER)
- m_target->RemoveFlag(PLAYER_FIELD_BYTES2, 0x2000);
-
- // restore invisibility if any
- if(m_target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY))
- {
- //m_target->SetVisibility(VISIBILITY_GROUP_NO_DETECT);
- //m_target->SetVisibility(VISIBILITY_GROUP_INVISIBILITY);
- m_target->SetVisibility(VISIBILITY_ON);
- }
- else
- {
- m_target->SetVisibility(VISIBILITY_ON);
- if(m_target->GetTypeId() == TYPEID_PLAYER)
- if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
- pvp->HandlePlayerActivityChanged((Player*)m_target);
- }
- }
- }
- }
+ m_target->RemoveStandFlags(UNIT_STAND_FLAGS_CREEP);
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ m_target->RemoveFlag(PLAYER_FIELD_BYTES2, 0x2000);
- // Master of Subtlety
- Unit::AuraList const& mDummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
- {
- if ((*i)->GetSpellProto()->SpellIconID == 2114 && Real)
- {
- if (apply)
- {
- int32 bp = (*i)->GetModifier()->m_amount;
- m_target->CastCustomSpell(m_target,31665,&bp,NULL,NULL,true);
- }
- else
- m_target->CastSpell(m_target,31666,true);
- break;
- }
+ if(m_target->GetVisibility() != VISIBILITY_OFF)
+ m_target->SetVisibility(VISIBILITY_ON);
}
}
-void Aura::HandleInvisibility(bool apply, bool Real)
+void AuraEffect::HandleInvisibility(bool apply, bool Real)
{
if(apply)
{
- m_target->m_invisibilityMask |= (1 << m_modifier.m_miscvalue);
-
- m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
+ m_target->m_invisibilityMask |= (1 << GetMiscValue());
- if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
+ if(Real)
{
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
+
// apply glow vision
- m_target->SetFlag(PLAYER_FIELD_BYTES2,PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
- // remove player from the objective's active player count at invisibility
- if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
- pvp->HandlePlayerActivityChanged((Player*)m_target);
- }
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ m_target->SetFlag(PLAYER_FIELD_BYTES2,PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
- // apply only if not in GM invisibility and not stealth
- if(m_target->GetVisibility()==VISIBILITY_ON)
- {
- // Aura not added yet but visibility code expect temporary add aura
- //m_target->SetVisibility(VISIBILITY_GROUP_NO_DETECT);
- //m_target->SetVisibility(VISIBILITY_GROUP_INVISIBILITY);
- m_target->SetVisibility(VISIBILITY_ON);
+ m_target->SetToNotify();
}
}
else
{
// recalculate value at modifier remove (current aura already removed)
m_target->m_invisibilityMask = 0;
- Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
- for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
- m_target->m_invisibilityMask |= (1 << m_modifier.m_miscvalue);
+ Unit::AuraEffectList const& auras = m_target->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
+ for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ m_target->m_invisibilityMask |= (1 << GetMiscValue());
// only at real aura remove and if not have different invisibility auras.
- if(Real && m_target->m_invisibilityMask==0)
+ if(Real)
{
// remove glow vision
- if(m_target->GetTypeId() == TYPEID_PLAYER)
+ if(!m_target->m_invisibilityMask && m_target->GetTypeId() == TYPEID_PLAYER)
m_target->RemoveFlag(PLAYER_FIELD_BYTES2,PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
- // apply only if not in GM invisibility & not stealthed while invisible
- if(m_target->GetVisibility()!=VISIBILITY_OFF)
- {
- // if have stealth aura then already have stealth visibility
- if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH))
- {
- m_target->SetVisibility(VISIBILITY_ON);
- if(m_target->GetTypeId() == TYPEID_PLAYER)
- if(OutdoorPvP * pvp = ((Player*)m_target)->GetOutdoorPvP())
- pvp->HandlePlayerActivityChanged((Player*)m_target);
- }
- }
+ m_target->SetToNotify();
}
}
}
-void Aura::HandleInvisibilityDetect(bool apply, bool Real)
+void AuraEffect::HandleInvisibilityDetect(bool apply, bool Real)
{
if(apply)
{
- m_target->m_detectInvisibilityMask |= (1 << m_modifier.m_miscvalue);
+ m_target->m_detectInvisibilityMask |= (1 << GetMiscValue());
}
else
{
// recalculate value at modifier remove (current aura already removed)
m_target->m_detectInvisibilityMask = 0;
- Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
- for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
- m_target->m_detectInvisibilityMask |= (1 << m_modifier.m_miscvalue);
+ Unit::AuraEffectList const& auras = m_target->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
+ for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ m_target->m_detectInvisibilityMask |= (1 << GetMiscValue());
}
if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
//ObjectAccessor::UpdateVisibilityForPlayer((Player*)m_target);
m_target->SetToNotify();
}
-void Aura::HandleAuraModRoot(bool apply, bool Real)
-{
- // only at real add/remove aura
- if(!Real)
- return;
-
- m_target->SetControlled(apply, UNIT_STAT_ROOT);
-}
-
-void Aura::HandleAuraModSilence(bool apply, bool Real)
+void AuraEffect::HandleAuraModSilence(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -3228,18 +3823,8 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED);
// Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL;i++)
- {
- Spell* currentSpell = m_target->m_currentSpells[i];
- if (currentSpell && currentSpell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
- {
- uint32 state = currentSpell->getState();
- // Stop spells on prepare or casting state
- if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING )
- {
- currentSpell->cancel();
- }
- }
- }
+ if (m_target->m_currentSpells[i] && m_target->m_currentSpells[i]->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
+ m_target->InterruptSpell(i,false); // Stop spells on prepare or casting state
switch (GetId())
{
@@ -3251,10 +3836,10 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
return;
// Search Mana Tap auras on caster
- Aura * dummy = m_target->GetDummyAura(28734);
+ AuraEffect * dummy = caster->GetDummyAura(28734);
if (dummy)
{
- int32 bp = dummy->GetStackAmount() * 10;
+ int32 bp = dummy->GetParentAura()->GetStackAmount() * 10;
caster->CastCustomSpell(caster, 25048, &bp, NULL, NULL, true);
m_target->RemoveAurasDueToSpell(28734);
}
@@ -3271,7 +3856,7 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
}
}
-void Aura::HandleModThreat(bool apply, bool Real)
+void AuraEffect::HandleModThreat(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -3301,19 +3886,19 @@ void Aura::HandleModThreat(bool apply, bool Real)
break;
}
if (level_diff > 0)
- m_modifier.m_amount += multiplier * level_diff;
+ m_amount += multiplier * level_diff;
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
{
- if(m_modifier.m_miscvalue & int32(1<<x))
+ if(GetMiscValue() & int32(1<<x))
{
if(m_target->GetTypeId() == TYPEID_PLAYER)
- ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_positive ? GetModifierValue() : -GetModifierValue(), apply);
+ ApplyPercentModFloatVar(m_target->m_threatModifier[x], GetParentAura()->IsPositive() ? m_amount : -m_amount, apply);
}
}
}
-void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
+void AuraEffect::HandleAuraModTotalThreat(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -3329,14 +3914,14 @@ void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
float threatMod = 0.0f;
if(apply)
- threatMod = float(GetModifierValue());
+ threatMod = float(m_amount);
else
- threatMod = float(-GetModifierValue());
+ threatMod = float(-m_amount);
m_target->getHostilRefManager().threatAssist(caster, threatMod);
}
-void Aura::HandleModTaunt(bool apply, bool Real)
+void AuraEffect::HandleModTaunt(bool apply, bool Real)
{
// only at real add/remove aura
if(!Real)
@@ -3362,7 +3947,7 @@ void Aura::HandleModTaunt(bool apply, bool Real)
/*********************************************************/
/*** MODIFY SPEED ***/
/*********************************************************/
-void Aura::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -3371,7 +3956,7 @@ void Aura::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real)
m_target->UpdateSpeed(MOVE_RUN, true);
}
-void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -3380,14 +3965,14 @@ void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real)
m_target->UpdateSpeed(MOVE_RUN, true);
}
-void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
+void AuraEffect::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
return;
// Enable Fly mode for flying mounts
- if (m_modifier.m_auraname == SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED)
+ if (m_auraName == SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED)
{
WorldPacket data;
if(apply)
@@ -3403,14 +3988,14 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real)
m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,MECHANIC_POLYMORPH,apply);
// Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
- if( apply && m_target->HasAura(42016,0) && m_target->GetMountID())
+ if( apply && m_target->HasAuraEffect(42016,0) && m_target->GetMountID())
m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
}
m_target->UpdateSpeed(MOVE_FLIGHT, true);
}
-void Aura::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -3419,7 +4004,7 @@ void Aura::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real)
m_target->UpdateSpeed(MOVE_SWIM, true);
}
-void Aura::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -3430,7 +4015,7 @@ void Aura::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real)
m_target->UpdateSpeed(MOVE_FLIGHT, true);
}
-void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -3445,51 +4030,81 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
/*** IMMUNITY ***/
/*********************************************************/
-void Aura::HandleModMechanicImmunity(bool apply, bool Real)
+void AuraEffect::HandleModStateImmunityMask(bool apply, bool Real)
+{
+ std::list <AuraType> immunity_list;
+ if (GetMiscValue() & (1<<10))
+ immunity_list.push_back(SPELL_AURA_MOD_STUN);
+ if (GetMiscValue() & (1<<7))
+ immunity_list.push_back(SPELL_AURA_MOD_DISARM);
+ if (GetMiscValue() & (1<<1))
+ immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
+
+ // These flag can be recognized wrong:
+ if (GetMiscValue() & (1<<6))
+ immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
+ if (GetMiscValue() & (1<<0))
+ immunity_list.push_back(SPELL_AURA_MOD_ROOT);
+ if (GetMiscValue() & (1<<3))
+ immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
+ if (GetMiscValue() & (1<<9))
+ immunity_list.push_back(SPELL_AURA_MOD_FEAR);
+
+ // Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated.
+ // however not all mechanic specified in immunity
+ if (apply && GetId()==46924)
+ {
+ m_target->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
+ m_target->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
+ }
+
+ if(apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
+ {
+ for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();++iter)
+ {
+ m_target->RemoveAurasByType(*iter);
+ }
+ }
+ for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();++iter)
+ {
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,*iter,apply);
+ }
+}
+
+void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real)
{
- uint32 mechanic = 1 << m_modifier.m_miscvalue;
+ uint32 mechanic;
+ mechanic = 1 << GetMiscValue();
//immune movement impairment and loss of control
- if(GetId()==42292)
+ if(GetId()==42292 || GetId()==59752)
mechanic=IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+ if (!mechanic)
+ return;
if(apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
{
Unit::AuraMap& Auras = m_target->GetAuras();
- for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
+ for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end();)
{
- next = iter;
- ++next;
SpellEntry const *spell = iter->second->GetSpellProto();
- if (!( spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) // spells unaffected by invulnerability
- && !iter->second->IsPositive() // only remove negative spells
- && spell->Id != GetId())
+ if (!( spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) && // spells unaffected by invulnerability
+ spell->Id != GetId())
{
//check for mechanic mask
- if(GetSpellMechanicMask(spell, iter->second->GetEffIndex()) & mechanic)
+ if(GetAllSpellMechanicMask(spell) & mechanic)
{
- m_target->RemoveAurasDueToSpell(spell->Id);
- if(Auras.empty())
- break;
- else
- next = Auras.begin();
+ m_target->RemoveAura(iter);
}
+ else
+ ++iter;
}
+ else
+ ++iter;
}
}
- m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,m_modifier.m_miscvalue,apply);
-
- // special cases
- switch(m_modifier.m_miscvalue)
- {
- case MECHANIC_INVULNERABILITY:
- m_target->ModifyAuraState(AURA_STATE_FORBEARANCE,apply);
- break;
- case MECHANIC_SHIELD:
- m_target->ModifyAuraState(AURA_STATE_WEAKENED_SOUL,apply);
- break;
- }
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,GetMiscValue(),apply);
// Bestial Wrath
if ( GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->Id == 19574)
@@ -3498,8 +4113,8 @@ void Aura::HandleModMechanicImmunity(bool apply, bool Real)
if ( Unit* owner = m_target->GetOwner() )
{
// Search talent
- Unit::AuraList const& m_dummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = m_dummyAuras.begin(); i != m_dummyAuras.end(); ++i)
+ Unit::AuraEffectList const& m_dummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = m_dummyAuras.begin(); i != m_dummyAuras.end(); ++i)
{
if ( (*i)->GetSpellProto()->SpellIconID == 2229 )
{
@@ -3531,103 +4146,82 @@ void Aura::HandleModMechanicImmunity(bool apply, bool Real)
m_target->RemoveAurasDueToSpell(26592);
}
}
+
+ // Heroic Fury (remove Intercept cooldown)
+ if( apply && GetId() == 60970 && m_target->GetTypeId() == TYPEID_PLAYER )
+ {
+ ((Player*)m_target)->RemoveSpellCooldown(20252);
+
+ WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
+ data << uint32(20252);
+ data << uint64(m_target->GetGUID());
+ ((Player*)m_target)->GetSession()->SendPacket(&data);
+ }
}
-void Aura::HandleAuraModEffectImmunity(bool apply, bool Real)
+//this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect
+void AuraEffect::HandleAuraModEffectImmunity(bool apply, bool Real)
{
- if(!apply)
+ // when removing flag aura, handle flag drop
+ if( !apply && m_target->GetTypeId() == TYPEID_PLAYER
+ && (GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION) )
{
if(m_target->GetTypeId() == TYPEID_PLAYER)
{
if(((Player*)m_target)->InBattleGround())
{
- BattleGround *bg = ((Player*)m_target)->GetBattleGround();
- if(bg)
- {
- switch(bg->GetTypeID())
- {
- case BATTLEGROUND_AV:
- {
- break;
- }
- case BATTLEGROUND_WS:
- {
- // Warsong Flag, horde // Silverwing Flag, alliance
- if(GetId() == 23333 || GetId() == 23335)
- bg->EventPlayerDroppedFlag(((Player*)m_target));
- break;
- }
- case BATTLEGROUND_AB:
- {
- break;
- }
- case BATTLEGROUND_EY:
- {
- if(GetId() == 34976)
- bg->EventPlayerDroppedFlag(((Player*)m_target));
- break;
- }
- }
- }
+ if( BattleGround *bg = ((Player*)m_target)->GetBattleGround() )
+ bg->EventPlayerDroppedFlag(((Player*)m_target));
}
else
sOutdoorPvPMgr.HandleDropFlag((Player*)m_target,GetSpellProto()->Id);
}
}
- m_target->ApplySpellImmune(GetId(),IMMUNITY_EFFECT,m_modifier.m_miscvalue,apply);
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_EFFECT,GetMiscValue(),apply);
}
-void Aura::HandleAuraModStateImmunity(bool apply, bool Real)
+void AuraEffect::HandleAuraModStateImmunity(bool apply, bool Real)
{
if(apply && Real && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
{
- Unit::AuraList const& auraList = m_target->GetAurasByType(AuraType(m_modifier.m_miscvalue));
- for(Unit::AuraList::const_iterator itr = auraList.begin(); itr != auraList.end();)
- {
- if (auraList.front() != this) // skip itself aura (it already added)
- {
- m_target->RemoveAurasDueToSpell(auraList.front()->GetId());
- itr = auraList.begin();
- }
- else
- ++itr;
- }
+ m_target->RemoveAurasByType(AuraType(GetMiscValue()), NULL , GetParentAura());
}
- m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,m_modifier.m_miscvalue,apply);
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,GetMiscValue(),apply);
}
-void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real)
+void AuraEffect::HandleAuraModSchoolImmunity(bool apply, bool Real)
{
- if(apply && m_modifier.m_miscvalue == SPELL_SCHOOL_MASK_NORMAL)
- m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
+ if(apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
+
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_SCHOOL,GetMiscValue(),apply);
- m_target->ApplySpellImmune(GetId(),IMMUNITY_SCHOOL,m_modifier.m_miscvalue,apply);
+ // remove all flag auras (they are positive, but they must be removed when you are immune)
+ if( this->GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY
+ && this->GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD )
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
- if(Real && apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
+ // TODO: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
+ if( Real && apply
+ && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY
+ && IsPositiveSpell(GetId()) ) //Only positive immunity removes auras
{
- if(IsPositiveSpell(GetId())) //Only positive immunity removes auras
+ uint32 school_mask = GetMiscValue();
+ Unit::AuraMap& Auras = m_target->GetAuras();
+ for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end();)
{
- uint32 school_mask = m_modifier.m_miscvalue;
- Unit::AuraMap& Auras = m_target->GetAuras();
- for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
+ SpellEntry const *spell = iter->second->GetSpellProto();
+ if((GetSpellSchoolMask(spell) & school_mask)//Check for school mask
+ && !( spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) //Spells unaffected by invulnerability
+ && !iter->second->IsPositive() //Don't remove positive spells
+ && spell->Id != GetId() ) //Don't remove self
{
- next = iter;
- ++next;
- SpellEntry const *spell = iter->second->GetSpellProto();
- if((GetSpellSchoolMask(spell) & school_mask)//Check for school mask
- && !( spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) //Spells unaffected by invulnerability
- && !iter->second->IsPositive() //Don't remove positive spells
- && spell->Id != GetId() ) //Don't remove self
- {
- m_target->RemoveAurasDueToSpell(spell->Id);
- if(Auras.empty())
- break;
- else
- next = Auras.begin();
- }
+ m_target->RemoveAura(iter);
}
+ else
+ ++iter;
}
}
if( Real && GetSpellProto()->Mechanic == MECHANIC_BANISH )
@@ -3639,40 +4233,27 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real)
}
}
-void Aura::HandleAuraModDmgImmunity(bool apply, bool Real)
+void AuraEffect::HandleAuraModDmgImmunity(bool apply, bool Real)
{
- m_target->ApplySpellImmune(GetId(),IMMUNITY_DAMAGE,m_modifier.m_miscvalue,apply);
+ m_target->ApplySpellImmune(GetId(),IMMUNITY_DAMAGE,GetMiscValue(),apply);
}
-void Aura::HandleAuraModDispelImmunity(bool apply, bool Real)
+void AuraEffect::HandleAuraModDispelImmunity(bool apply, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
return;
- m_target->ApplySpellDispelImmunity(m_spellProto, DispelType(m_modifier.m_miscvalue), apply);
+ m_target->ApplySpellDispelImmunity(m_spellProto, DispelType(GetMiscValue()), apply);
}
-void Aura::HandleAuraProcTriggerSpell(bool apply, bool Real)
+void AuraEffect::HandleAuraProcTriggerSpell(bool apply, bool Real)
{
if(!Real)
return;
-
- if(apply)
- {
- // some spell have charges by functionality not have its in spell data
- switch (GetId())
- {
- case 28200: // Ascendance (Talisman of Ascendance trinket)
- m_procCharges = 6;
- UpdateAuraCharges();
- break;
- default: break;
- }
- }
}
-void Aura::HandleAuraModStalked(bool apply, bool Real)
+void AuraEffect::HandleAuraModStalked(bool apply, bool Real)
{
// used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
if(apply)
@@ -3685,20 +4266,19 @@ void Aura::HandleAuraModStalked(bool apply, bool Real)
/*** PERIODIC ***/
/*********************************************************/
-void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real)
+void AuraEffect::HandlePeriodicTriggerSpell(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
m_isPeriodic = apply;
- m_isTrigger = apply;
-
- // Curse of the Plaguebringer
- if (!apply && m_spellProto->Id == 29213 && m_removeMode!=AURA_REMOVE_BY_DISPEL)
+ if (m_spellProto->Id == 66 && !apply)
{
- // Cast Wrath of the Plaguebringer if not dispelled
- m_target->CastSpell(m_target, 29214, true, 0, this);
+ if (GetParentAura()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
+ m_target->CastSpell(m_target, 32612, true, NULL, this);
}
+}
+
+void AuraEffect::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real)
+{
+ m_isPeriodic = apply;
// Wrath of the Astromancer
if(!apply && m_spellProto->Id == 42783)
@@ -3707,89 +4287,83 @@ void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real)
}
}
-void Aura::HandlePeriodicEnergize(bool apply, bool Real)
+void AuraEffect::HandlePeriodicEnergize(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
+ if (!Real)
+ return;
m_isPeriodic = apply;
+
+ // Replenishment (0.25% from max)
+ // Infinite Replenishment
+ if (m_spellProto->SpellIconID == 3184 && m_spellProto->SpellVisual[0] == 12495)
+ m_amount = m_target->GetMaxPower(POWER_MANA) * 25 / 10000;
}
-void Aura::HandlePeriodicHeal(bool apply, bool Real)
+void AuraEffect::HandleAuraPowerBurn(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
m_isPeriodic = apply;
+}
- // only at real apply
- if (Real && apply && GetSpellProto()->Mechanic == MECHANIC_BANDAGE)
- {
- // provided m_target as original caster to prevent apply aura caster selection for this negative buff
- m_target->CastSpell(m_target,11196,true,NULL,this,m_target->GetGUID());
- }
+void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real)
+{
+ // spells required only Real aura add/remove
+ if(!Real)
+ return;
// For prevent double apply bonuses
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
- if(!loading && apply)
+ Unit* caster = GetCaster();
+
+ SpellEntry const*spell = GetSpellProto();
+ switch( spell->SpellFamilyName)
{
- switch (m_spellProto->SpellFamilyName)
+ case SPELLFAMILY_HUNTER:
{
- case SPELLFAMILY_DRUID:
- {
- // Rejuvenation
- if(m_spellProto->SpellFamilyFlags & 0x0000000000000010LL)
- {
- if(Unit* caster = GetCaster())
- {
- Unit::AuraList const& classScripts = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator k = classScripts.begin(); k != classScripts.end(); ++k)
- {
- int32 tickcount = GetSpellDuration(m_spellProto) / m_spellProto->EffectAmplitude[m_effIndex];
- switch((*k)->GetModifier()->m_miscvalue)
- {
- case 4953: // Increased Rejuvenation Healing - Harold's Rejuvenating Broach Aura
- case 4415: // Increased Rejuvenation Healing - Idol of Rejuvenation Aura
- {
- m_modifier.m_amount += (*k)->GetModifier()->m_amount / tickcount;
- break;
- }
- }
- }
- }
- }
- }
+ // Explosive Shot
+ if (apply && !loading && caster)
+ m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 16 / 100);
+ break;
}
}
+
+ m_isPeriodic = apply;
+}
+
+void AuraEffect::HandlePeriodicHeal(bool apply, bool Real)
+{
+ m_isPeriodic = apply;
}
-void Aura::HandlePeriodicDamage(bool apply, bool Real)
+void AuraEffect::HandlePeriodicDamage(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
return;
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
m_isPeriodic = apply;
// For prevent double apply bonuses
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
+ // Custom damage calculation after
+ if (!apply || loading)
+ return;
+
Unit *caster = GetCaster();
+ if (!caster)
+ return;
switch (m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
// Pounce Bleed
- if ( m_spellProto->SpellIconID == 147 && m_spellProto->SpellVisual == 0 )
+ if ( m_spellProto->SpellIconID == 147 && m_spellProto->SpellVisual[0] == 0 )
{
// $AP*0.18/6 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 3 / 100);
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 3 / 100);
return;
}
break;
@@ -3797,18 +4371,14 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_WARRIOR:
{
// Rend
- if (m_spellProto->SpellFamilyFlags & 0x0000000000000020LL)
+ if (m_spellProto->SpellFamilyFlags[0] & 0x20)
{
- // 0.00743*(($MWB+$mwb)/2+$AP/14*$MWS) bonus per tick
- if (apply && !loading && caster)
- {
- float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
- int32 mws = caster->GetAttackTime(BASE_ATTACK);
- float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE);
- float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
- // WARNING! in 3.0 multiplier 0.00743f change to 0.6
- m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.00743f);
- }
+ // $0.2*(($MWB+$mwb)/2+$AP/14*$MWS) bonus per tick
+ float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ int32 mws = caster->GetAttackTime(BASE_ATTACK);
+ float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE);
+ float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
+ m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f);
return;
}
break;
@@ -3816,92 +4386,80 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_DRUID:
{
// Rake
- if (m_spellProto->SpellFamilyFlags & 0x0000000000001000LL)
+ if (m_spellProto->SpellFamilyFlags[0] & 0x1000)
{
- // $AP*0.06/3 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 / 100);
+ // $AP*0.06 bonus per tick
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 6 / 100);
return;
}
// Lacerate
- if (m_spellProto->SpellFamilyFlags & 0x000000010000000000LL)
+ if (m_spellProto->SpellFamilyFlags[1] & 0x0000000100)
{
// $AP*0.05/5 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
return;
}
// Rip
- if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL)
+ if (m_spellProto->SpellFamilyFlags[1] & 0x800000)
{
- // $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, whether 4 or 5 CPs are being used]
- if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
- {
- uint8 cp = ((Player*)caster)->GetComboPoints();
+ // 0.01*$AP*cp
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ uint8 cp = ((Player*)caster)->GetComboPoints();
- // Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
- Unit::AuraList const& dummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
+ // Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
+ Unit::AuraEffectList const& dummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
+ {
+ if((*itr)->GetId()==34241)
{
- if((*itr)->GetId()==34241)
- {
- m_modifier.m_amount += cp * (*itr)->GetModifier()->m_amount;
- break;
- }
+ m_amount += cp * (*itr)->GetAmount();
+ break;
}
-
- if (cp > 4) cp = 4;
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * cp / 100);
}
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * cp / 100);
+ return;
+ }
+ // Lock Jaw
+ if (m_spellProto->SpellFamilyFlags[1] & 0x10000000)
+ {
+ // 0.15*$AP
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 15 / 100);
return;
}
break;
}
case SPELLFAMILY_ROGUE:
{
- // Deadly poison aura state
- if((m_spellProto->SpellFamilyFlags & 0x10000) && m_spellProto->SpellVisual==5100)
+ // Rupture
+ if (m_spellProto->SpellFamilyFlags[0] & 0x100000)
{
- if(apply)
- m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON,true);
- else
- {
- // current aura already removed, search present of another
- bool found = false;
- Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
- {
- SpellEntry const* itr_spell = (*itr)->GetSpellProto();
- if(itr_spell && itr_spell->SpellFamilyName==SPELLFAMILY_ROGUE && (itr_spell->SpellFamilyFlags & 0x10000) && itr_spell->SpellVisual==5100)
- {
- found = true;
- break;
- }
- }
- // this has been last deadly poison aura
- if(!found)
- m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON,false);
- }
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+ //1 point : ${($m1+$b1*1+0.015*$AP)*4} damage over 8 secs
+ //2 points: ${($m1+$b1*2+0.024*$AP)*5} damage over 10 secs
+ //3 points: ${($m1+$b1*3+0.03*$AP)*6} damage over 12 secs
+ //4 points: ${($m1+$b1*4+0.03428571*$AP)*7} damage over 14 secs
+ //5 points: ${($m1+$b1*5+0.0375*$AP)*8} damage over 16 secs
+ float AP_per_combo[] = {0, 0.015f, 0.024, 0.03, 0.03428571, 0.0375};
+ uint8 cp = ((Player*)caster)->GetComboPoints();
+ if (cp > 5) cp = 5;
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * AP_per_combo[cp]);
return;
}
- // Rupture
- if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL)
+ // Garrote
+ if (m_spellProto->SpellFamilyFlags[0] & 0x100)
{
- // Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP increase the contribution from AP]
- if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER)
- {
- uint8 cp = ((Player*)caster)->GetComboPoints();
- if (cp > 3) cp = 3;
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * cp / 100);
- }
+ // $AP*0.07 bonus per tick
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 7 / 100);
return;
}
- // Garrote
- if (m_spellProto->SpellFamilyFlags & 0x000000000000000100LL)
+ // Deadly Poison
+ if (m_spellProto->SpellFamilyFlags[0] & 0x10000)
{
- // $AP*0.18/6 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 3 / 100);
+ // 0.08*$AP / 4 * amount of stack
+ m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 * GetParentAura()->GetStackAmount() / 100);
return;
}
break;
@@ -3909,47 +4467,17 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_HUNTER:
{
// Serpent Sting
- if (m_spellProto->SpellFamilyFlags & 0x0000000000004000LL)
+ if (m_spellProto->SpellFamilyFlags[0] & 0x4000)
{
// $RAP*0.1/5 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
+ m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
return;
}
// Immolation Trap
- if (m_spellProto->SpellFamilyFlags & 0x0000000000000004LL && m_spellProto->SpellIconID == 678)
+ if (m_spellProto->SpellFamilyFlags[0] & 0x4 && m_spellProto->SpellIconID == 678)
{
// $RAP*0.1/5 bonus per tick
- if (apply && !loading && caster)
- m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
- return;
- }
- break;
- }
- case SPELLFAMILY_PALADIN:
- {
- // Consecration
- if (m_spellProto->SpellFamilyFlags & 0x0000000000000020LL)
- {
- if (apply && !loading)
- {
- if(Unit* caster = GetCaster())
- {
- Unit::AuraList const& classScripts = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator k = classScripts.begin(); k != classScripts.end(); ++k)
- {
- int32 tickcount = GetSpellDuration(m_spellProto) / m_spellProto->EffectAmplitude[m_effIndex];
- switch((*k)->GetModifier()->m_miscvalue)
- {
- case 5147: // Improved Consecration - Libram of the Eternal Rest
- {
- m_modifier.m_amount += (*k)->GetModifier()->m_amount / tickcount;
- break;
- }
- }
- }
- }
- }
+ m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
return;
}
break;
@@ -3959,27 +4487,23 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
}
}
-void Aura::HandlePeriodicDamagePCT(bool apply, bool Real)
+void AuraEffect::HandlePeriodicDamagePCT(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
m_isPeriodic = apply;
}
-void Aura::HandlePeriodicLeech(bool apply, bool Real)
+void AuraEffect::HandlePeriodicLeech(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
m_isPeriodic = apply;
}
-void Aura::HandlePeriodicManaLeech(bool apply, bool Real)
+void AuraEffect::HandlePeriodicManaLeech(bool apply, bool Real)
{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
+ m_isPeriodic = apply;
+}
+void AuraEffect::HandlePeriodicHealthFunnel(bool apply, bool Real)
+{
m_isPeriodic = apply;
}
@@ -3991,90 +4515,82 @@ void Aura::HandlePeriodicManaLeech(bool apply, bool Real)
/*** RESISTANCE ***/
/********************************/
-void Aura::HandleAuraModResistanceExclusive(bool apply, bool Real)
+void AuraEffect::HandleAuraModResistanceExclusive(bool apply, bool Real)
{
for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
{
- if(m_modifier.m_miscvalue & int32(1<<x))
+ if(GetMiscValue() & int32(1<<x))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_amount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER)
- m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,GetModifierValue(), apply);
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x),GetParentAura()->IsPositive(),m_amount, apply);
}
}
}
-void Aura::HandleAuraModResistance(bool apply, bool Real)
+void AuraEffect::HandleAuraModResistance(bool apply, bool Real)
{
for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
{
- if(m_modifier.m_miscvalue & int32(1<<x))
+ if(GetMiscValue() & int32(1<<x))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_amount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,GetModifierValue(), apply);
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x),GetParentAura()->IsPositive(),m_amount, apply);
}
}
- // Faerie Fire (druid versions)
- if( (m_spellProto->SpellIconID == 109 &&
- m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID &&
- m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
- || m_spellProto->Id == 35325)
- {
- m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE,apply);
- }
}
-void Aura::HandleAuraModBaseResistancePCT(bool apply, bool Real)
+void AuraEffect::HandleAuraModBaseResistancePCT(bool apply, bool Real)
{
// only players have base stats
if(m_target->GetTypeId() != TYPEID_PLAYER)
{
//pets only have base armor
- if(((Creature*)m_target)->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(GetModifierValue()), apply);
+ if(((Creature*)m_target)->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
+ m_target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_amount), apply);
}
else
{
for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
{
- if(m_modifier.m_miscvalue & int32(1<<x))
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(GetModifierValue()), apply);
+ if(GetMiscValue() & int32(1<<x))
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(m_amount), apply);
}
}
}
-void Aura::HandleModResistancePercent(bool apply, bool Real)
+void AuraEffect::HandleModResistancePercent(bool apply, bool Real)
{
for(int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
{
- if(m_modifier.m_miscvalue & int32(1<<i))
+ if(GetMiscValue() & int32(1<<i))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_amount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
{
- m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),true,GetModifierValue(), apply);
- m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),false,GetModifierValue(), apply);
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),true,m_amount, apply);
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),false,m_amount, apply);
}
}
}
}
-void Aura::HandleModBaseResistance(bool apply, bool Real)
+void AuraEffect::HandleModBaseResistance(bool apply, bool Real)
{
// only players have base stats
if(m_target->GetTypeId() != TYPEID_PLAYER)
{
//only pets have base stats
- if(((Creature*)m_target)->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(GetModifierValue()), apply);
+ if(((Creature*)m_target)->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
+ m_target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(m_amount), apply);
}
else
{
for(int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
- if(m_modifier.m_miscvalue & (1<<i))
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(GetModifierValue()), apply);
+ if(GetMiscValue() & (1<<i))
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(m_amount), apply);
}
}
@@ -4082,30 +4598,30 @@ void Aura::HandleModBaseResistance(bool apply, bool Real)
/*** STAT ***/
/********************************/
-void Aura::HandleAuraModStat(bool apply, bool Real)
+void AuraEffect::HandleAuraModStat(bool apply, bool Real)
{
- if (m_modifier.m_miscvalue < -2 || m_modifier.m_miscvalue > 4)
+ if (GetMiscValue() < -2 || GetMiscValue() > 4)
{
- sLog.outError("WARNING: Spell %u effect %u have unsupported misc value (%i) for SPELL_AURA_MOD_STAT ",GetId(),GetEffIndex(),m_modifier.m_miscvalue);
+ sLog.outError("WARNING: Spell %u effect %u have unsupported misc value (%i) for SPELL_AURA_MOD_STAT ",GetId(),GetEffIndex(),GetMiscValue());
return;
}
for(int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
{
// -1 or -2 is all stats ( misc < -2 checked in function beginning )
- if (m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue == i)
+ if (GetMiscValue() < 0 || GetMiscValue() == i)
{
- //m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply);
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(GetModifierValue()), apply);
+ //m_target->ApplyStatMod(Stats(i), m_amount,apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_amount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyStatBuffMod(Stats(i),GetModifierValue(),apply);
+ m_target->ApplyStatBuffMod(Stats(i),m_amount,apply);
}
}
}
-void Aura::HandleModPercentStat(bool apply, bool Real)
+void AuraEffect::HandleModPercentStat(bool apply, bool Real)
{
- if (m_modifier.m_miscvalue < -1 || m_modifier.m_miscvalue > 4)
+ if (GetMiscValue() < -1 || GetMiscValue() > 4)
{
sLog.outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
return;
@@ -4117,12 +4633,12 @@ void Aura::HandleModPercentStat(bool apply, bool Real)
for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
- if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1)
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(GetModifierValue()), apply);
+ if(GetMiscValue() == i || GetMiscValue() == -1)
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_amount), apply);
}
}
-void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real)
+void AuraEffect::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4133,7 +4649,7 @@ void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateSpellDamageAndHealingBonus();
}
-void Aura::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool Real)
+void AuraEffect::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4142,7 +4658,7 @@ void Aura::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateSpellDamageAndHealingBonus();
}
-void Aura::HandleAuraModDispelResist(bool apply, bool Real)
+void AuraEffect::HandleAuraModDispelResist(bool apply, bool Real)
{
if(!Real || !apply)
return;
@@ -4151,7 +4667,7 @@ void Aura::HandleAuraModDispelResist(bool apply, bool Real)
m_target->CastSpell(m_target,44416,true,NULL,this,GetCasterGUID());
}
-void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real)
+void AuraEffect::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4162,7 +4678,7 @@ void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateSpellDamageAndHealingBonus();
}
-void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real)
+void AuraEffect::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4171,7 +4687,7 @@ void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real
((Player*)m_target)->UpdateSpellDamageAndHealingBonus();
}
-void Aura::HandleModHealingDone(bool /*apply*/, bool Real)
+void AuraEffect::HandleModHealingDone(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -4180,9 +4696,9 @@ void Aura::HandleModHealingDone(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateSpellDamageAndHealingBonus();
}
-void Aura::HandleModTotalPercentStat(bool apply, bool Real)
+void AuraEffect::HandleModTotalPercentStat(bool apply, bool Real)
{
- if (m_modifier.m_miscvalue < -1 || m_modifier.m_miscvalue > 4)
+ if (GetMiscValue() < -1 || GetMiscValue() > 4)
{
sLog.outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
return;
@@ -4194,16 +4710,16 @@ void Aura::HandleModTotalPercentStat(bool apply, bool Real)
for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
{
- if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1)
+ if(GetMiscValue() == i || GetMiscValue() == -1)
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_amount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyStatPercentBuffMod(Stats(i), GetModifierValue(), apply );
+ m_target->ApplyStatPercentBuffMod(Stats(i), m_amount, apply );
}
}
//recalculate current HP/MP after applying aura modifications (only for spells with 0x10 flag)
- if ((m_modifier.m_miscvalue == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & 0x10))
+ if ((GetMiscValue() == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & 0x10))
{
// newHP = (curHP / maxHP) * newMaxHP = (newMaxHP * curHP) / maxHP -> which is better because no int -> double -> int conversion is needed
uint32 newHPValue = (m_target->GetMaxHealth() * curHPValue) / maxHPValue;
@@ -4211,12 +4727,12 @@ void Aura::HandleModTotalPercentStat(bool apply, bool Real)
}
}
-void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
- if(m_modifier.m_miscvalue != SPELL_SCHOOL_MASK_NORMAL)
+ if(GetMiscValue() != SPELL_SCHOOL_MASK_NORMAL)
{
// support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
@@ -4231,128 +4747,53 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real)
/********************************/
/*** HEAL & ENERGIZE ***/
/********************************/
-void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real)
+void AuraEffect::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real)
{
- /*
- Need additional checking for auras who reduce or increase healing, magic effect like Dumpen Magic,
- so this aura not fully working.
- */
- if(apply)
- {
- if(!m_target->isAlive())
- return;
-
- if((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && !m_target->IsSitState())
- m_target->SetStandState(PLAYER_STATE_SIT);
-
- if(m_periodicTimer <= 0)
- {
- m_periodicTimer += m_modifier.periodictime;
-
- if(m_target->GetHealth() < m_target->GetMaxHealth())
- {
- // PeriodicTick can cast triggered spells with stats changes
- PeriodicTick();
- }
- }
- }
-
m_isPeriodic = apply;
}
-void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real)
+void AuraEffect::HandleAuraModTotalEnergyPercentRegen(bool apply, bool Real)
{
- if((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && apply && !m_target->IsSitState())
- m_target->SetStandState(PLAYER_STATE_SIT);
- if(apply)
- {
- if(m_modifier.periodictime == 0)
- m_modifier.periodictime = 1000;
- if(m_periodicTimer <= 0 && m_target->getPowerType() == POWER_MANA)
- {
- m_periodicTimer += m_modifier.periodictime;
-
- if(m_target->GetPower(POWER_MANA) < m_target->GetMaxPower(POWER_MANA))
- {
- // PeriodicTick can cast triggered spells with stats changes
- PeriodicTick();
- }
- }
- }
+ if(m_amplitude == 0)
+ m_amplitude = 1000;
+ m_periodicTimer = m_amplitude;
m_isPeriodic = apply;
}
-void Aura::HandleModRegen(bool apply, bool Real) // eating
+void AuraEffect::HandleModRegen(bool apply, bool Real) // eating
{
- if(apply)
- {
- if(!m_target->isAlive())
- return;
-
- if ((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && !m_target->IsSitState())
- m_target->SetStandState(PLAYER_STATE_SIT);
-
- if(m_periodicTimer <= 0)
- {
- m_periodicTimer += 5000;
- int32 gain = m_target->ModifyHealth(GetModifierValue());
- Unit *caster = GetCaster();
- if (caster)
- {
- SpellEntry const *spellProto = GetSpellProto();
- if (spellProto)
- m_target->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, spellProto);
- }
- }
- }
+ if(m_amplitude == 0)
+ m_amplitude = 5000;
+ m_periodicTimer = 5000;
m_isPeriodic = apply;
}
-void Aura::HandleModPowerRegen(bool apply, bool Real) // drinking
+void AuraEffect::HandleModPowerRegen(bool apply, bool Real) // drinking
{
- if ((GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) && apply && !m_target->IsSitState())
- m_target->SetStandState(PLAYER_STATE_SIT);
+ if (!Real)
+ return;
- if(apply && m_periodicTimer <= 0)
+ Powers pt = m_target->getPowerType();
+ if(m_amplitude == 0)
{
-
- Powers pt = m_target->getPowerType();
+ // Anger Management (only spell use this aura for rage)
if (pt == POWER_RAGE)
- m_periodicTimer = 3000;
- else
- m_periodicTimer = 2000;
+ m_amplitude = 3000;
+ else
+ m_amplitude = 2000;
+ }
- if(int32(pt) != m_modifier.m_miscvalue)
- return;
+ m_periodicTimer = 5000;
- if ( GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED )
- {
- // eating anim
- m_target->HandleEmoteCommand(EMOTE_ONESHOT_EAT);
- }
- else if( GetId() == 20577 )
- {
- // cannibalize anim
- m_target->HandleEmoteCommand(398);
- }
+ if (m_target->GetTypeId() == TYPEID_PLAYER && GetMiscValue() == POWER_MANA)
+ ((Player*)m_target)->UpdateManaRegen();
- // Warrior talent, gain 1 rage every 3 seconds while in combat
- // Anger Menagement
- // amount = 1+ 16 = 17 = 3,4*5 = 10,2*5/3
- // so 17 is rounded amount for 5 sec tick grow ~ 1 range grow in 3 sec
- if(pt == POWER_RAGE)
- {
- m_target->ModifyPower(pt, m_modifier.m_amount*3/5);
- }
- }
m_isPeriodic = apply;
- if (Real && m_target->GetTypeId() == TYPEID_PLAYER && m_modifier.m_miscvalue == POWER_MANA)
- ((Player*)m_target)->UpdateManaRegen();
}
-void Aura::HandleModPowerRegenPCT(bool /*apply*/, bool Real)
+void AuraEffect::HandleModPowerRegenPCT(bool /*apply*/, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4362,11 +4803,11 @@ void Aura::HandleModPowerRegenPCT(bool /*apply*/, bool Real)
return;
// Update manaregen value
- if (m_modifier.m_miscvalue == POWER_MANA)
+ if (GetMiscValue() == POWER_MANA)
((Player*)m_target)->UpdateManaRegen();
}
-void Aura::HandleModManaRegen(bool /*apply*/, bool Real)
+void AuraEffect::HandleModManaRegen(bool /*apply*/, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4379,7 +4820,7 @@ void Aura::HandleModManaRegen(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateManaRegen();
}
-void Aura::HandleComprehendLanguage(bool apply, bool Real)
+void AuraEffect::HandleComprehendLanguage(bool apply, bool Real)
{
if(apply)
m_target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_COMPREHEND_LANG);
@@ -4387,32 +4828,32 @@ void Aura::HandleComprehendLanguage(bool apply, bool Real)
m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_COMPREHEND_LANG);
}
-void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real)
+void AuraEffect::HandleAuraModIncreaseHealth(bool apply, bool Real)
{
if(Real)
{
if(apply)
{
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetModifierValue()), apply);
- m_target->ModifyHealth(m_modifier.m_amount);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_amount), apply);
+ m_target->ModifyHealth(m_amount);
}
else
{
- if (int32(m_target->GetHealth()) > m_modifier.m_amount)
- m_target->ModifyHealth(-m_modifier.m_amount);
+ if (int32(m_target->GetHealth()) > m_amount)
+ m_target->ModifyHealth(-m_amount);
else
m_target->SetHealth(1);
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_amount), apply);
}
}
}
-void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real)
+void AuraEffect::HandleAuraModIncreaseMaxHealth(bool apply, bool Real)
{
uint32 oldhealth = m_target->GetHealth();
double healthPercentage = (double)oldhealth / (double)m_target->GetMaxHealth();
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_amount), apply);
// refresh percentage
if(oldhealth > 0)
@@ -4425,38 +4866,43 @@ void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real)
}
}
-void Aura::HandleAuraModIncreaseEnergy(bool apply, bool Real)
+void AuraEffect::HandleAuraModIncreaseEnergy(bool apply, bool Real)
{
Powers powerType = m_target->getPowerType();
- if(int32(powerType) != m_modifier.m_miscvalue)
+ if(int32(powerType) != GetMiscValue())
return;
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
- m_target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(unitMod, TOTAL_VALUE, float(m_amount), apply);
}
-void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/)
+void AuraEffect::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/)
{
Powers powerType = m_target->getPowerType();
- if(int32(powerType) != m_modifier.m_miscvalue)
+ if(int32(powerType) != GetMiscValue())
return;
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
- m_target->HandleStatModifier(unitMod, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(unitMod, TOTAL_PCT, float(m_amount), apply);
+}
+
+void AuraEffect::HandleAuraModIncreaseHealthPercent(bool apply, bool /*Real*/)
+{
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(m_amount), apply);
}
-void Aura::HandleAuraModIncreaseHealthPercent(bool apply, bool /*Real*/)
+void AuraEffect::HandleAuraIncreaseBaseHealthPercent(bool apply, bool /*Real*/)
{
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(m_amount), apply);
}
/********************************/
/*** FIGHT ***/
/********************************/
-void Aura::HandleAuraModParryPercent(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModParryPercent(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
@@ -4464,25 +4910,25 @@ void Aura::HandleAuraModParryPercent(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateParryPercentage();
}
-void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModDodgePercent(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
((Player*)m_target)->UpdateDodgePercentage();
- //sLog.outError("BONUS DODGE CHANCE: + %f", float(m_modifier.m_amount));
+ //sLog.outError("BONUS DODGE CHANCE: + %f", float(m_amount));
}
-void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModBlockPercent(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
((Player*)m_target)->UpdateBlockPercentage();
- //sLog.outError("BONUS BLOCK CHANCE: + %f", float(m_modifier.m_amount));
+ //sLog.outError("BONUS BLOCK CHANCE: + %f", float(m_amount));
}
-void Aura::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4494,7 +4940,7 @@ void Aura::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateManaRegen();
}
-void Aura::HandleAuraModCritPercent(bool apply, bool Real)
+void AuraEffect::HandleAuraModCritPercent(bool apply, bool Real)
{
if(m_target->GetTypeId()!=TYPEID_PLAYER)
return;
@@ -4509,13 +4955,13 @@ void Aura::HandleAuraModCritPercent(bool apply, bool Real)
// mods must be applied base at equipped weapon class and subclass comparison
// with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
- // m_modifier.m_miscvalue comparison with item generated damage types
+ // GetMiscValue() comparison with item generated damage types
if (GetSpellProto()->EquippedItemClass == -1)
{
- ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetModifierValue()), apply);
- ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (GetModifierValue()), apply);
- ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (GetModifierValue()), apply);
+ ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply);
}
else
{
@@ -4523,18 +4969,33 @@ void Aura::HandleAuraModCritPercent(bool apply, bool Real)
}
}
-void Aura::HandleModHitChance(bool apply, bool Real)
+void AuraEffect::HandleModHitChance(bool apply, bool Real)
{
- m_target->m_modMeleeHitChance += apply ? GetModifierValue() : -GetModifierValue();
- m_target->m_modRangedHitChance += apply ? GetModifierValue() : -GetModifierValue();
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)m_target)->UpdateMeleeHitChances();
+ ((Player*)m_target)->UpdateRangedHitChances();
+ }
+ else
+ {
+ m_target->m_modMeleeHitChance += apply ? m_amount : (-m_amount);
+ m_target->m_modRangedHitChance += apply ? m_amount : (-m_amount);
+ }
}
-void Aura::HandleModSpellHitChance(bool apply, bool Real)
+void AuraEffect::HandleModSpellHitChance(bool apply, bool Real)
{
- m_target->m_modSpellHitChance += apply ? GetModifierValue(): -GetModifierValue();
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)m_target)->UpdateSpellHitChances();
+ }
+ else
+ {
+ m_target->m_modSpellHitChance += apply ? m_amount: (-m_amount);
+ }
}
-void Aura::HandleModSpellCritChance(bool apply, bool Real)
+void AuraEffect::HandleModSpellCritChance(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4546,11 +5007,11 @@ void Aura::HandleModSpellCritChance(bool apply, bool Real)
}
else
{
- m_target->m_baseSpellCritChance += apply ? GetModifierValue():-GetModifierValue();
+ m_target->m_baseSpellCritChance += apply ? m_amount:-m_amount;
}
}
-void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real)
+void AuraEffect::HandleModSpellCritChanceShool(bool /*apply*/, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4560,7 +5021,7 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real)
return;
for(int school = SPELL_SCHOOL_NORMAL; school < MAX_SPELL_SCHOOL; ++school)
- if (m_modifier.m_miscvalue & (1<<school))
+ if (GetMiscValue() & (1<<school))
((Player*)m_target)->UpdateSpellCritChance(school);
}
@@ -4568,109 +5029,111 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real)
/*** ATTACK SPEED ***/
/********************************/
-void Aura::HandleModCastingSpeed(bool apply, bool Real)
+void AuraEffect::HandleModCastingSpeed(bool apply, bool Real)
{
- m_target->ApplyCastTimePercentMod(GetModifierValue(),apply);
+ m_target->ApplyCastTimePercentMod(m_amount,apply);
}
-void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool Real)
+void AuraEffect::HandleModMeleeRangedSpeedPct(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK,GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, GetModifierValue(), apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_amount, apply);
}
-void Aura::HandleModCombatSpeedPct(bool apply, bool Real)
+void AuraEffect::HandleModCombatSpeedPct(bool apply, bool Real)
{
- m_target->ApplyCastTimePercentMod(GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK,GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, GetModifierValue(), apply);
+ m_target->ApplyCastTimePercentMod(m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_amount, apply);
}
-void Aura::HandleModAttackSpeed(bool apply, bool Real)
+void AuraEffect::HandleModAttackSpeed(bool apply, bool Real)
{
if(!m_target->isAlive() )
return;
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,GetModifierValue(),apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_amount,apply);
}
-void Aura::HandleHaste(bool apply, bool Real)
+void AuraEffect::HandleHaste(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK, GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK, GetModifierValue(),apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,GetModifierValue(),apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_amount,apply);
}
-void Aura::HandleAuraModRangedHaste(bool apply, bool Real)
+void AuraEffect::HandleAuraModRangedHaste(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, GetModifierValue(), apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_amount, apply);
}
-void Aura::HandleRangedAmmoHaste(bool apply, bool Real)
+void AuraEffect::HandleRangedAmmoHaste(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,GetModifierValue(), apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_amount, apply);
}
/********************************/
/*** ATTACK POWER ***/
/********************************/
-void Aura::HandleAuraModAttackPower(bool apply, bool Real)
+void AuraEffect::HandleAuraModAttackPower(bool apply, bool Real)
{
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(m_amount), apply);
}
-void Aura::HandleAuraModRangedAttackPower(bool apply, bool Real)
+void AuraEffect::HandleAuraModRangedAttackPower(bool apply, bool Real)
{
if((m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0)
return;
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(m_amount), apply);
}
-void Aura::HandleAuraModAttackPowerPercent(bool apply, bool Real)
+void AuraEffect::HandleAuraModAttackPowerPercent(bool apply, bool Real)
{
//UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(m_amount), apply);
}
-void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real)
+void AuraEffect::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real)
{
if((m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0)
return;
//UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(m_amount), apply);
}
-void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real)
+void AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
return;
- if(m_target->GetTypeId() == TYPEID_PLAYER && (m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0)
- return;
+ // Recalculate bonus
+ if(m_target->GetTypeId() == TYPEID_PLAYER && !(m_target->getClassMask() & CLASSMASK_WAND_USERS))
+ ((Player*)m_target)->UpdateAttackPowerAndDamage(true);
+}
- if(m_modifier.m_miscvalue != STAT_INTELLECT)
- {
- // support required adding UpdateAttackPowerAndDamage calls at stat update
- sLog.outError("Aura SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT (212) need support non-intellect stats!");
+void AuraEffect::HandleAuraModAttackPowerOfStatPercent(bool apply, bool Real)
+{
+ // spells required only Real aura add/remove
+ if(!Real)
return;
- }
// Recalculate bonus
- ((Player*)m_target)->UpdateAttackPowerAndDamage(true);
+ if(m_target->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)m_target)->UpdateAttackPowerAndDamage(false);
}
/********************************/
/*** DAMAGE BONUS ***/
/********************************/
-void Aura::HandleModDamageDone(bool apply, bool Real)
+void AuraEffect::HandleModDamageDone(bool apply, bool Real)
{
// apply item specific bonuses for already equipped weapon
if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
@@ -4680,23 +5143,23 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
((Player*)m_target)->_ApplyWeaponDependentAuraDamageMod(pItem,WeaponAttackType(i),this,apply);
}
- // m_modifier.m_miscvalue is bitmask of spell schools
+ // GetMiscValue() is bitmask of spell schools
// 1 ( 0-bit ) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)
// 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wands
// 127 - full bitmask any damages
//
// mods must be applied base at equipped weapon class and subclass comparison
// with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
- // m_modifier.m_miscvalue comparison with item generated damage types
+ // GetMiscValue() comparison with item generated damage types
- if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0)
+ if((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) != 0)
{
// apply generic physical damage bonuses including wand case
if (GetSpellProto()->EquippedItemClass == -1 || m_target->GetTypeId() != TYPEID_PLAYER)
{
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(GetModifierValue()), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(GetModifierValue()), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(m_amount), apply);
}
else
{
@@ -4705,15 +5168,15 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
if(m_target->GetTypeId() == TYPEID_PLAYER)
{
- if(m_positive)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,GetModifierValue(),apply);
+ if(GetParentAura()->IsPositive())
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,m_amount,apply);
else
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,GetModifierValue(),apply);
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,m_amount,apply);
}
}
// Skip non magic case for speedup
- if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) == 0)
+ if((GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) == 0)
return;
if( GetSpellProto()->EquippedItemClass != -1 || GetSpellProto()->EquippedItemInventoryTypeMask != 0 )
@@ -4729,31 +5192,31 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
// This information for client side use only
if(m_target->GetTypeId() == TYPEID_PLAYER)
{
- if(m_positive)
+ if(GetParentAura()->IsPositive())
{
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
{
- if((m_modifier.m_miscvalue & (1<<i)) != 0)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i,GetModifierValue(),apply);
+ if((GetMiscValue() & (1<<i)) != 0)
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i,m_amount,apply);
}
}
else
{
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
{
- if((m_modifier.m_miscvalue & (1<<i)) != 0)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,GetModifierValue(),apply);
+ if((GetMiscValue() & (1<<i)) != 0)
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,m_amount,apply);
}
}
- Pet* pet = m_target->GetPet();
+ Pet* pet = ((Player*)m_target)->GetPet();
if(pet)
pet->UpdateAttackPowerAndDamage();
}
}
-void Aura::HandleModDamagePercentDone(bool apply, bool Real)
+void AuraEffect::HandleModDamagePercentDone(bool apply, bool Real)
{
- sLog.outDebug("AURA MOD DAMAGE type:%u negative:%u", m_modifier.m_miscvalue, m_positive ? 0 : 1);
+ sLog.outDebug("AURA MOD DAMAGE type:%u negative:%u", GetMiscValue(), GetParentAura()->IsPositive() ? 0 : 1);
// apply item specific bonuses for already equipped weapon
if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
@@ -4763,23 +5226,23 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
((Player*)m_target)->_ApplyWeaponDependentAuraDamageMod(pItem,WeaponAttackType(i),this,apply);
}
- // m_modifier.m_miscvalue is bitmask of spell schools
+ // GetMiscValue() is bitmask of spell schools
// 1 ( 0-bit ) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)
// 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wand
// 127 - full bitmask any damages
//
// mods must be applied base at equipped weapon class and subclass comparison
// with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
- // m_modifier.m_miscvalue comparison with item generated damage types
+ // GetMiscValue() comparison with item generated damage types
- if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0)
+ if((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) != 0)
{
// apply generic physical damage bonuses including wand case
if (GetSpellProto()->EquippedItemClass == -1 || m_target->GetTypeId() != TYPEID_PLAYER)
{
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(GetModifierValue()), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(GetModifierValue()), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(m_amount), apply);
}
else
{
@@ -4787,11 +5250,11 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
}
// For show in client
if(m_target->GetTypeId() == TYPEID_PLAYER)
- m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,m_modifier.m_amount/100.0f,apply);
+ m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,m_amount/100.0f,apply);
}
// Skip non magic case for speedup
- if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) == 0)
+ if((GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) == 0)
return;
if( GetSpellProto()->EquippedItemClass != -1 || GetSpellProto()->EquippedItemInventoryTypeMask != 0 )
@@ -4807,10 +5270,10 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
// Send info to client
if(m_target->GetTypeId() == TYPEID_PLAYER)
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+i,m_modifier.m_amount/100.0f,apply);
+ m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+i,m_amount/100.0f,apply);
}
-void Aura::HandleModOffhandDamagePercent(bool apply, bool Real)
+void AuraEffect::HandleModOffhandDamagePercent(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -4818,177 +5281,75 @@ void Aura::HandleModOffhandDamagePercent(bool apply, bool Real)
sLog.outDebug("AURA MOD OFFHAND DAMAGE");
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(GetModifierValue()), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_amount), apply);
}
/********************************/
/*** POWER COST ***/
/********************************/
-void Aura::HandleModPowerCostPCT(bool apply, bool Real)
+void AuraEffect::HandleModPowerCostPCT(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
return;
- float amount = GetModifierValue() /100.0f;
+ float amount = m_amount /100.0f;
for(int i = 0; i < MAX_SPELL_SCHOOL; ++i)
- if(m_modifier.m_miscvalue & (1<<i))
+ if(GetMiscValue() & (1<<i))
m_target->ApplyModSignedFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER+i,amount,apply);
}
-void Aura::HandleModPowerCost(bool apply, bool Real)
+void AuraEffect::HandleModPowerCost(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
return;
for(int i = 0; i < MAX_SPELL_SCHOOL; ++i)
- if(m_modifier.m_miscvalue & (1<<i))
- m_target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,GetModifierValue(),apply);
+ if(GetMiscValue() & (1<<i))
+ m_target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,m_amount,apply);
+}
+
+void AuraEffect::HandleNoReagentUseAura(bool Apply, bool Real)
+{
+ // spells required only Real aura add/remove
+ if(!Real)
+ return;
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+ flag96 mask;
+ Unit::AuraEffectList const& noReagent = m_target->GetAurasByType(SPELL_AURA_NO_REAGENT_USE);
+ for(Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
+ mask |= (*i)->m_spellProto->EffectSpellClassMask[(*i)->m_effIndex];
+
+ m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]);
+ m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+1, mask[1]);
+ m_target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+2, mask[2]);
}
/*********************************************************/
/*** OTHERS ***/
/*********************************************************/
-void Aura::HandleShapeshiftBoosts(bool apply)
+void AuraEffect::HandleAuraAllowOnlyAbility(bool apply, bool Real)
{
- uint32 spellId = 0;
- uint32 spellId2 = 0;
- uint32 HotWSpellId = 0;
-
- switch(GetModifier()->m_miscvalue)
- {
- case FORM_CAT:
- spellId = 3025;
- HotWSpellId = 24900;
- break;
- case FORM_TREE:
- spellId = 5420;
- break;
- case FORM_TRAVEL:
- spellId = 5419;
- break;
- case FORM_AQUA:
- spellId = 5421;
- break;
- case FORM_BEAR:
- spellId = 1178;
- spellId2 = 21178;
- HotWSpellId = 24899;
- break;
- case FORM_DIREBEAR:
- spellId = 9635;
- spellId2 = 21178;
- HotWSpellId = 24899;
- break;
- case FORM_BATTLESTANCE:
- spellId = 21156;
- break;
- case FORM_DEFENSIVESTANCE:
- spellId = 7376;
- break;
- case FORM_BERSERKERSTANCE:
- spellId = 7381;
- break;
- case FORM_MOONKIN:
- spellId = 24905;
- // aura from effect trigger spell
- spellId2 = 24907;
- break;
- case FORM_FLIGHT:
- spellId = 33948;
- break;
- case FORM_FLIGHT_EPIC:
- spellId = 40122;
- spellId2 = 40121;
- break;
- case FORM_SPIRITOFREDEMPTION:
- spellId = 27792;
- spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation.
- break;
- case FORM_GHOSTWOLF:
- case FORM_AMBIENT:
- case FORM_GHOUL:
- case FORM_SHADOW:
- case FORM_STEALTH:
- case FORM_CREATURECAT:
- case FORM_CREATUREBEAR:
- spellId = 0;
- break;
- }
-
- uint32 form = GetModifier()->m_miscvalue-1;
-
- if(apply)
- {
- if (spellId) m_target->CastSpell(m_target, spellId, true, NULL, this );
- if (spellId2) m_target->CastSpell(m_target, spellId2, true, NULL, this);
+ if(!Real)
+ return;
- if(m_target->GetTypeId() == TYPEID_PLAYER)
- {
- const PlayerSpellMap& sp_list = ((Player *)m_target)->GetSpellMap();
- for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
- {
- if(itr->second->state == PLAYERSPELL_REMOVED) continue;
- if(itr->first==spellId || itr->first==spellId2) continue;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if (!spellInfo || !(spellInfo->Attributes & ((1<<6) | (1<<7)))) continue;
- if (spellInfo->Stances & (1<<form))
- m_target->CastSpell(m_target, itr->first, true, NULL, this);
- }
- //LotP
- if (((Player*)m_target)->HasSpell(17007))
- {
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(24932);
- if (spellInfo && spellInfo->Stances & (1<<form))
- m_target->CastSpell(m_target, 24932, true, NULL, this);
- }
- // HotW
- if (HotWSpellId)
- {
- Unit::AuraList const& mModTotalStatPct = m_target->GetAurasByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE);
- for(Unit::AuraList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
- {
- if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetModifier()->m_miscvalue == 3)
- {
- int32 HotWMod = (*i)->GetModifier()->m_amount;
- if(GetModifier()->m_miscvalue == FORM_CAT)
- HotWMod /= 2;
+ if(!apply && m_target->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY))
+ return;
- m_target->CastCustomSpell(m_target, HotWSpellId, &HotWMod, NULL, NULL, true, NULL, this);
- break;
- }
- }
- }
- }
- }
- else
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
{
- m_target->RemoveAurasDueToSpell(spellId);
- m_target->RemoveAurasDueToSpell(spellId2);
-
- Unit::AuraMap& tAuras = m_target->GetAuras();
- for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
- {
- if (itr->second->IsRemovedOnShapeLost())
- {
- m_target->RemoveAurasDueToSpell(itr->second->GetId());
- itr = tAuras.begin();
- }
- else
- {
- ++itr;
- }
- }
+ if (apply)
+ m_target->SetFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
+ else
+ m_target->RemoveFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
}
-
- /*double healthPercentage = (double)m_target->GetHealth() / (double)m_target->GetMaxHealth();
- m_target->SetHealth(uint32(ceil((double)m_target->GetMaxHealth() * healthPercentage)));*/
}
-void Aura::HandleAuraEmpathy(bool apply, bool Real)
+void AuraEffect::HandleAuraEmpathy(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_UNIT)
return;
@@ -4998,15 +5359,15 @@ void Aura::HandleAuraEmpathy(bool apply, bool Real)
m_target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
}
-void Aura::HandleAuraUntrackable(bool apply, bool Real)
+void AuraEffect::HandleAuraUntrackable(bool apply, bool Real)
{
if(apply)
- m_target->SetFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE);
+ m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE);
else
- m_target->RemoveFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE);
+ m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE);
}
-void Aura::HandleAuraModPacify(bool apply, bool Real)
+void AuraEffect::HandleAuraModPacify(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -5017,13 +5378,13 @@ void Aura::HandleAuraModPacify(bool apply, bool Real)
m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
}
-void Aura::HandleAuraModPacifyAndSilence(bool apply, bool Real)
+void AuraEffect::HandleAuraModPacifyAndSilence(bool apply, bool Real)
{
HandleAuraModPacify(apply,Real);
HandleAuraModSilence(apply,Real);
}
-void Aura::HandleAuraGhost(bool apply, bool Real)
+void AuraEffect::HandleAuraGhost(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -5038,7 +5399,7 @@ void Aura::HandleAuraGhost(bool apply, bool Real)
}
}
-void Aura::HandleAuraAllowFlight(bool apply, bool Real)
+void AuraEffect::HandleAuraAllowFlight(bool apply, bool Real)
{
// all applied/removed only at real aura add/remove
if(!Real)
@@ -5047,15 +5408,29 @@ void Aura::HandleAuraAllowFlight(bool apply, bool Real)
// allow fly
WorldPacket data;
if(apply)
+ {
data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
+ m_target->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
+ }
+ }
else
+ {
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
+ if(m_target->GetTypeId() == TYPEID_UNIT)
+ {
+ m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
+ m_target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);
+ }
+ }
data.append(m_target->GetPackGUID());
data << uint32(0); // unk
m_target->SendMessageToSet(&data, true);
}
-void Aura::HandleModRating(bool apply, bool Real)
+void AuraEffect::HandleModRating(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -5065,11 +5440,25 @@ void Aura::HandleModRating(bool apply, bool Real)
return;
for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
- if (m_modifier.m_miscvalue & (1 << rating))
- ((Player*)m_target)->ApplyRatingMod(CombatRating(rating), GetModifierValue(), apply);
+ if (GetMiscValue() & (1 << rating))
+ ((Player*)m_target)->ApplyRatingMod(CombatRating(rating), m_amount, apply);
+}
+
+void AuraEffect::HandleModRatingFromStat(bool apply, bool Real)
+{
+ // spells required only Real aura add/remove
+ if(!Real)
+ return;
+
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+ // Just recalculate ratings
+ for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
+ if (GetMiscValue() & (1 << rating))
+ ((Player*)m_target)->ApplyRatingMod(CombatRating(rating), 0, apply);
}
-void Aura::HandleForceMoveForward(bool apply, bool Real)
+void AuraEffect::HandleForceMoveForward(bool apply, bool Real)
{
if(!Real || m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -5079,7 +5468,7 @@ void Aura::HandleForceMoveForward(bool apply, bool Real)
m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE);
}
-void Aura::HandleAuraModExpertise(bool /*apply*/, bool Real)
+void AuraEffect::HandleAuraModExpertise(bool /*apply*/, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
@@ -5088,7 +5477,7 @@ void Aura::HandleAuraModExpertise(bool /*apply*/, bool Real)
((Player*)m_target)->UpdateExpertise(OFF_ATTACK);
}
-void Aura::HandleModTargetResistance(bool apply, bool Real)
+void AuraEffect::HandleModTargetResistance(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -5096,25 +5485,25 @@ void Aura::HandleModTargetResistance(bool apply, bool Real)
// applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
// show armor penetration
- if (m_target->GetTypeId() == TYPEID_PLAYER && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,GetModifierValue(), apply);
+ if (m_target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
+ m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,m_amount, apply);
// show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
- if (m_target->GetTypeId() == TYPEID_PLAYER && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_SPELL)==SPELL_SCHOOL_MASK_SPELL)
- m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,GetModifierValue(), apply);
+ if (m_target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_SPELL)==SPELL_SCHOOL_MASK_SPELL)
+ m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,m_amount, apply);
}
-void Aura::HandleShieldBlockValue(bool apply, bool Real)
+void AuraEffect::HandleShieldBlockValue(bool apply, bool Real)
{
BaseModType modType = FLAT_MOD;
- if(m_modifier.m_auraname == SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT)
+ if(m_auraName == SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT)
modType = PCT_MOD;
if(m_target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_target)->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(GetModifierValue()), apply);
+ ((Player*)m_target)->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(m_amount), apply);
}
-void Aura::HandleAuraRetainComboPoints(bool apply, bool Real)
+void AuraEffect::HandleAuraRetainComboPoints(bool apply, bool Real)
{
// spells required only Real aura add/remove
if(!Real)
@@ -5127,23 +5516,26 @@ void Aura::HandleAuraRetainComboPoints(bool apply, bool Real)
// combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
- if( !apply && m_duration==0 && target->GetComboTarget())
+ if( !apply && GetParentAura()->GetAuraDuration()==0 && target->GetComboTarget())
if(Unit* unit = ObjectAccessor::GetUnit(*m_target,target->GetComboTarget()))
- target->AddComboPoints(unit, -GetModifierValue());
+ target->AddComboPoints(unit, -m_amount);
}
-void Aura::HandleModUnattackable( bool Apply, bool Real )
+void AuraEffect::HandleModUnattackable( bool Apply, bool Real )
{
- if(Real && Apply)
+ if(!Real)
+ return;
+
+ if(Apply)
{
m_target->CombatStop();
- m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
+ m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
}
- m_target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE,Apply);
+ m_target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, Apply);
}
-void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
+void AuraEffect::HandleSpiritOfRedemption( bool apply, bool Real )
{
// spells required only Real aura add/remove
if(!Real)
@@ -5159,7 +5551,7 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
// set stand state (expected in this form)
if(!m_target->IsStandState())
- m_target->SetStandState(PLAYER_STATE_NONE);
+ m_target->SetStandState(UNIT_STAND_STATE_STAND);
}
m_target->SetHealth(1);
@@ -5169,36 +5561,7 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
m_target->setDeathState(JUST_DIED);
}
-void Aura::CleanupTriggeredSpells()
-{
- uint32 tSpellId = m_spellProto->EffectTriggerSpell[GetEffIndex()];
- if(!tSpellId)
- return;
-
- SpellEntry const* tProto = sSpellStore.LookupEntry(tSpellId);
- if(!tProto)
- return;
-
- if(GetSpellDuration(tProto) != -1)
- return;
-
- // needed for spell 43680, maybe others
- // TODO: is there a spell flag, which can solve this in a more sophisticated way?
- if(m_spellProto->EffectApplyAuraName[GetEffIndex()] == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
- GetSpellDuration(m_spellProto) == m_spellProto->EffectAmplitude[GetEffIndex()])
- return;
- m_target->RemoveAurasDueToSpell(tSpellId);
-}
-
-void Aura::HandleAuraPowerBurn(bool apply, bool Real)
-{
- if (m_periodicTimer <= 0)
- m_periodicTimer += m_modifier.periodictime;
-
- m_isPeriodic = apply;
-}
-
-void Aura::HandleSchoolAbsorb(bool apply, bool Real)
+void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real)
{
if(!Real)
return;
@@ -5212,29 +5575,26 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
switch(m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_PRIEST:
- if(m_spellProto->SpellFamilyFlags == 0x1) //PW:S
+ if(m_spellProto->SpellFamilyFlags.IsEqual(0x1)) //PW:S
{
//+30% from +healing bonus
DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(m_spellProto)) * 0.3f;
- break;
}
break;
case SPELLFAMILY_MAGE:
- if(m_spellProto->SpellFamilyFlags == 0x80100 || m_spellProto->SpellFamilyFlags == 0x8 || m_spellProto->SpellFamilyFlags == 0x100000000LL)
+ if(m_spellProto->SpellFamilyFlags.IsEqual(0x80100) || m_spellProto->SpellFamilyFlags.IsEqual(0x8) || m_spellProto->SpellFamilyFlags.IsEqual(0,0x1))
{
//frost ward, fire ward, ice barrier
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
- break;
}
break;
case SPELLFAMILY_WARLOCK:
- if(m_spellProto->SpellFamilyFlags == 0x00)
+ if(m_spellProto->SpellFamilyFlags.IsEqual(0,0,0x40))
{
//shadow ward
//+10% from +spd bonus
DoneActualBenefit = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) * 0.1f;
- break;
}
break;
default:
@@ -5243,17 +5603,17 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
- m_modifier.m_amount += (int32)DoneActualBenefit;
+ m_amount += (int32)DoneActualBenefit;
}
}
}
-void Aura::PeriodicTick()
+void AuraEffect::PeriodicTick()
{
if(!m_target->isAlive())
return;
- switch(m_modifier.m_auraname)
+ switch(GetAuraName())
{
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
@@ -5271,7 +5631,7 @@ void Aura::PeriodicTick()
return;
// some auras remove at specific health level or more
- if(m_modifier.m_auraname==SPELL_AURA_PERIODIC_DAMAGE)
+ if(m_auraName==SPELL_AURA_PERIODIC_DAMAGE)
{
switch(GetId())
{
@@ -5298,18 +5658,18 @@ void Aura::PeriodicTick()
}
case 41337:// aura of anger
{
- Unit::AuraList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for(Unit::AuraList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
+ Unit::AuraEffectList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ for(Unit::AuraEffectList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
{
if ((*i)->GetId() == 41337)
{
(*i)->ApplyModifier(false);
- (*i)->GetModifier()->m_amount += 5;
+ (*i)->SetAmount((*i)->GetAmount()+5);
(*i)->ApplyModifier(true);
break;
}
}
- m_modifier.m_amount = 100 * m_tickNumber;
+ m_amount = 100 * m_tickNumber;
}break;
default:
break;
@@ -5321,30 +5681,27 @@ void Aura::PeriodicTick()
CleanDamage cleanDamage = CleanDamage(0, BASE_ATTACK, MELEE_HIT_NORMAL );
// ignore non positive values (can be result apply spellmods to aura damage
- uint32 amount = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
-
- uint32 pdamage;
+ //uint32 amount = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
+ uint32 pdamage = GetAmount() > 0 ? GetAmount() : 0;
- if(m_modifier.m_auraname == SPELL_AURA_PERIODIC_DAMAGE)
+ if(GetAuraName() == SPELL_AURA_PERIODIC_DAMAGE)
{
- pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),amount,DOT);
+ pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
// Calculate armor mitigation if it is a physical spell
// But not for bleed mechanic spells
if ( GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL &&
GetEffectMechanic(GetSpellProto(), m_effIndex) != MECHANIC_BLEED)
{
- uint32 pdamageReductedArmor = pCaster->CalcArmorReducedDamage(m_target, pdamage);
+ uint32 pdamageReductedArmor = pCaster->CalcArmorReducedDamage(m_target, pdamage, GetSpellProto());
cleanDamage.damage += pdamage - pdamageReductedArmor;
pdamage = pdamageReductedArmor;
}
- //pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),pdamage,DOT);
-
// Curse of Agony damage-per-tick calculation
- if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 0x0000000000000400LL) && GetSpellProto()->SpellIconID==544)
+ if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags[0] & 0x400) && GetSpellProto()->SpellIconID==544)
{
- uint32 totalTick = m_maxduration / m_modifier.periodictime;
+ uint32 totalTick = GetParentAura()->GetAuraMaxDuration() / m_amplitude;
// 1..4 ticks, 1/2 from normal tick damage
if(m_tickNumber <= totalTick / 3)
pdamage = pdamage/2;
@@ -5355,16 +5712,14 @@ void Aura::PeriodicTick()
}
}
else
- pdamage = uint32(m_target->GetMaxHealth()*amount/100);
+ pdamage = uint32(m_target->GetMaxHealth()*pdamage/100);
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
// Reduce dot damage from resilience for players
if (m_target->GetTypeId()==TYPEID_PLAYER)
pdamage-=((Player*)m_target)->GetDotDamageReduction(pdamage);
- pdamage *= GetStackAmount();
-
- pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist);
+ pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist, m_spellProto);
sLog.outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId(),absorb);
@@ -5374,8 +5729,9 @@ void Aura::PeriodicTick()
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
- data << uint32(m_modifier.m_auraname);
+ data << uint32(m_auraName);
data << (uint32)pdamage;
+ data << uint32(0); // overkill
data << (uint32)GetSpellSchoolMask(GetSpellProto()); // will be mask in 2.4.x
data << (uint32)absorb;
data << (uint32)resist;
@@ -5396,6 +5752,7 @@ void Aura::PeriodicTick()
break;
}
case SPELL_AURA_PERIODIC_LEECH:
+ case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
{
Unit *pCaster = GetCaster();
if(!pCaster)
@@ -5408,7 +5765,7 @@ void Aura::PeriodicTick()
pCaster->SpellHitResult(m_target,GetSpellProto(),false)!=SPELL_MISS_NONE)
return;
- // Check for immune (not use charges)
+ // Check for immune
if(m_target->IsImmunedToDamage(GetSpellSchoolMask(GetSpellProto())))
return;
@@ -5416,80 +5773,24 @@ void Aura::PeriodicTick()
uint32 resist=0;
CleanDamage cleanDamage = CleanDamage(0, BASE_ATTACK, MELEE_HIT_NORMAL );
- uint32 pdamage = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
- pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),pdamage,DOT);
+ //uint32 pdamage = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
+ uint32 pdamage = GetAmount() > 0 ? GetAmount() : 0;
+ pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
//Calculate armor mitigation if it is a physical spell
if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL)
{
- uint32 pdamageReductedArmor = pCaster->CalcArmorReducedDamage(m_target, pdamage);
+ uint32 pdamageReductedArmor = pCaster->CalcArmorReducedDamage(m_target, pdamage, GetSpellProto());
cleanDamage.damage += pdamage - pdamageReductedArmor;
pdamage = pdamageReductedArmor;
}
- //pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),pdamage,DOT);
-
- // talent Soul Siphon add bonus to Drain Life spells
- if( GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 0x8) )
- {
- // find talent max bonus percentage
- Unit::AuraList const& mClassScriptAuras = pCaster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator i = mClassScriptAuras.begin(); i != mClassScriptAuras.end(); ++i)
- {
- if ((*i)->GetModifier()->m_miscvalue == 4992 || (*i)->GetModifier()->m_miscvalue == 4993)
- {
- if((*i)->GetEffIndex()!=1)
- {
- sLog.outError("Expected spell %u structure change, need code update",(*i)->GetId());
- break;
- }
-
- // effect 1 m_amount
- int32 maxPercent = (*i)->GetModifier()->m_amount;
- // effect 0 m_amount
- int32 stepPercent = pCaster->CalculateSpellDamage((*i)->GetSpellProto(),0,(*i)->GetSpellProto()->EffectBasePoints[0],pCaster);
-
- // count affliction effects and calc additional damage in percentage
- int32 modPercent = 0;
- Unit::AuraMap const& victimAuras = m_target->GetAuras();
- for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
- {
- Aura* aura = itr->second;
- if (aura->IsPositive())continue;
- SpellEntry const* m_spell = aura->GetSpellProto();
- if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK)
- continue;
-
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(m_spell->Id);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(m_spell->Id);
-
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- if(_spell_idx->second->skillId == SKILL_AFFLICTION)
- {
- modPercent += stepPercent;
- if (modPercent >= maxPercent)
- {
- modPercent = maxPercent;
- break;
- }
- }
- }
- }
- pdamage += (pdamage*modPercent/100);
- break;
- }
- }
- }
-
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
// Reduce dot damage from resilience for players
if (m_target->GetTypeId()==TYPEID_PLAYER)
pdamage-=((Player*)m_target)->GetDotDamageReduction(pdamage);
- pdamage *= GetStackAmount();
-
- pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist);
+ pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist, m_spellProto);
if(m_target->GetHealth() < pdamage)
pdamage = uint32(m_target->GetHealth());
@@ -5499,10 +5800,10 @@ void Aura::PeriodicTick()
pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0);
-
Unit* target = m_target; // aura can be deleted in DealDamage
SpellEntry const* spellProto = GetSpellProto();
float multiplier = spellProto->EffectMultipleValue[GetEffIndex()] > 0 ? spellProto->EffectMultipleValue[GetEffIndex()] : 1;
+ int32 stackAmount = GetParentAura()->GetStackAmount();
// Set trigger flag
uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;// | PROC_FLAG_SUCCESSFUL_HARMFUL_SPELL_HIT;
@@ -5526,7 +5827,8 @@ void Aura::PeriodicTick()
if(Player *modOwner = pCaster->GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
- uint32 heal = pCaster->SpellHealingBonus(spellProto, uint32(new_damage * multiplier), DOT, pCaster);
+ // Don't apply heal mods for this aura
+ uint32 heal = uint32(new_damage * multiplier);//pCaster->SpellHealingBonus(pCaster, spellProto, uint32(new_damage * multiplier), DOT, stackAmount);
int32 gain = pCaster->ModifyHealth(heal);
pCaster->getHostilRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
@@ -5542,22 +5844,20 @@ void Aura::PeriodicTick()
return;
// heal for caster damage (must be alive)
- if(m_target != pCaster && GetSpellProto()->SpellVisual==163 && !pCaster->isAlive())
+ if(m_target != pCaster && GetSpellProto()->SpellVisual[0]==163 && !pCaster->isAlive())
return;
- // ignore non positive values (can be result apply spellmods to aura damage
- uint32 amount = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
+ if(GetParentAura()->GetAuraDuration() ==-1 && m_target->GetHealth()==m_target->GetMaxHealth())
+ return;
- uint32 pdamage;
+ // ignore non positive values (can be result apply spellmods to aura damage
+ //uint32 amount = GetModifierValuePerStack() > 0 ? GetModifierValuePerStack() : 0;
+ int32 pdamage = GetAmount() > 0 ? GetAmount() : 0;
- if(m_modifier.m_auraname==SPELL_AURA_OBS_MOD_HEALTH)
- pdamage = uint32(m_target->GetMaxHealth() * amount/100);
+ if(m_auraName==SPELL_AURA_OBS_MOD_HEALTH)
+ pdamage = uint32(m_target->GetMaxHealth() * pdamage * GetParentAura()->GetStackAmount() / 100);
else
- pdamage = pCaster->SpellHealingBonus(GetSpellProto(), amount, DOT, m_target);
-
- pdamage *= GetStackAmount();
-
- //pdamage = pCaster->SpellHealingBonus(GetSpellProto(), pdamage, DOT, m_target);
+ pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetParentAura()->GetStackAmount());
sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
@@ -5567,8 +5867,9 @@ void Aura::PeriodicTick()
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
- data << uint32(m_modifier.m_auraname);
+ data << uint32(m_auraName);
data << (uint32)pdamage;
+ data << uint32(0); // wotlk
m_target->SendMessageToSet(&data,true);
int32 gain = m_target->ModifyHealth(pdamage);
@@ -5579,16 +5880,16 @@ void Aura::PeriodicTick()
bg->UpdatePlayerScore(((Player*)pCaster), SCORE_HEALING_DONE, gain);
//Do check before because m_modifier.auraName can be invalidate by DealDamage.
- bool procSpell = (m_modifier.m_auraname == SPELL_AURA_PERIODIC_HEAL && m_target != pCaster);
+ bool procSpell = (m_auraName == SPELL_AURA_PERIODIC_HEAL && m_target != pCaster);
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
Unit* target = m_target; // aura can be deleted in DealDamage
SpellEntry const* spellProto = GetSpellProto();
- bool haveCastItem = GetCastItemGUID()!=0;
+ bool haveCastItem = GetParentAura()->GetCastItemGUID()!=0;
// heal for caster damage
- if(m_target!=pCaster && spellProto->SpellVisual==163)
+ if(m_target!=pCaster && spellProto->SpellVisual[0]==163)
{
uint32 dmg = spellProto->manaPerSecond;
if(pCaster->GetHealth() <= dmg && pCaster->GetTypeId()==TYPEID_PLAYER)
@@ -5624,6 +5925,15 @@ void Aura::PeriodicTick()
}
case SPELL_AURA_PERIODIC_MANA_LEECH:
{
+ if(GetMiscValue() < 0 || GetMiscValue() >= MAX_POWERS)
+ return;
+
+ Powers power = Powers(GetMiscValue());
+
+ // power type might have changed between aura applying and tick (druid's shapeshift)
+ if(m_target->getPowerType() != power)
+ return;
+
Unit *pCaster = GetCaster();
if(!pCaster)
return;
@@ -5640,20 +5950,22 @@ void Aura::PeriodicTick()
return;
// ignore non positive values (can be result apply spellmods to aura damage
- uint32 pdamage = GetModifierValue() > 0 ? GetModifierValue() : 0;
+ uint32 pdamage = m_amount > 0 ? m_amount : 0;
+
+ // Special case: draining x% of mana (up to a maximum of 2*x% of the caster's maximum mana)
+ // It's mana percent cost spells, m_amount is percent drain from target
+ if (m_spellProto->ManaCostPercentage)
+ {
+ // max value
+ uint32 maxmana = pCaster->GetMaxPower(power) * pdamage * 2 / 100;
+ pdamage = m_target->GetMaxPower(power) * pdamage / 100;
+ if(pdamage > maxmana)
+ pdamage = maxmana;
+ }
sLog.outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
- if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue > 4)
- break;
-
- Powers power = Powers(m_modifier.m_miscvalue);
-
- // power type might have changed between aura applying and tick (druid's shapeshift)
- if(m_target->getPowerType() != power)
- break;
-
int32 drain_amount = m_target->GetPower(power) > pdamage ? pdamage : m_target->GetPower(power);
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
@@ -5677,7 +5989,7 @@ void Aura::PeriodicTick()
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
- data << uint32(m_modifier.m_auraname);
+ data << uint32(m_auraName);
data << (uint32)power; // power type
data << (uint32)drain_amount;
data << (float)gain_multiplier;
@@ -5696,7 +6008,7 @@ void Aura::PeriodicTick()
{
m_target->CastSpell(m_target, 31463, true, 0, this);
// Remove aura
- SetAuraDuration(0);
+ GetParentAura()->SetAuraDuration(0);
}
// Mark of Kazzak
@@ -5709,67 +6021,78 @@ void Aura::PeriodicTick()
{
m_target->CastSpell(m_target, 32961, true, 0, this);
// Remove aura
- SetAuraDuration(0);
+ GetParentAura()->SetAuraDuration(0);
}
}
break;
}
- case SPELL_AURA_PERIODIC_ENERGIZE:
+ case SPELL_AURA_OBS_MOD_ENERGY:
{
- // ignore non positive values (can be result apply spellmods to aura damage
- uint32 pdamage = GetModifierValue() > 0 ? GetModifierValue() : 0;
+ if(GetMiscValue() < 0)
+ return;
- sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
- GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
+ Powers power;
+ if (GetMiscValue() == POWER_ALL)
+ power = m_target->getPowerType();
+ else
+ power = Powers(GetMiscValue());
- if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue > 4)
- break;
+ if(m_target->GetMaxPower(power) == 0)
+ return;
- Powers power = Powers(m_modifier.m_miscvalue);
+ if(GetParentAura()->GetAuraDuration() ==-1 && m_target->GetPower(power)==m_target->GetMaxPower(power))
+ return;
- if(m_target->GetMaxPower(power) == 0)
- break;
+ uint32 amount = m_amount * m_target->GetMaxPower(power) /100;
+ sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), amount, GetId());
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
data.append(m_target->GetPackGUID());
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
- data << uint32(m_modifier.m_auraname);
- data << (uint32)power; // power type
- data << (uint32)pdamage;
+ data << uint32(m_auraName);
+ data << uint32(power); // power type
+ data << (uint32)amount;
m_target->SendMessageToSet(&data,true);
- int32 gain = m_target->ModifyPower(power,pdamage);
+ int32 gain = m_target->ModifyPower(power,amount);
if(Unit* pCaster = GetCaster())
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
break;
}
- case SPELL_AURA_OBS_MOD_MANA:
+ case SPELL_AURA_PERIODIC_ENERGIZE:
{
// ignore non positive values (can be result apply spellmods to aura damage
- uint32 amount = GetModifierValue() > 0 ? GetModifierValue() : 0;
+ if(m_amount < 0 || GetMiscValue() >= MAX_POWERS)
+ return;
- uint32 pdamage = uint32(m_target->GetMaxPower(POWER_MANA) * amount/100);
+ Powers power = Powers(GetMiscValue());
- sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u mana inflicted by %u",
- GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
+ if(m_target->GetMaxPower(power) == 0)
+ return;
- if(m_target->GetMaxPower(POWER_MANA) == 0)
- break;
+ if(GetParentAura()->GetAuraDuration() ==-1 && m_target->GetPower(power)==m_target->GetMaxPower(power))
+ return;
+
+ uint32 amount = m_amount;
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
data.append(m_target->GetPackGUID());
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
- data << uint32(m_modifier.m_auraname);
- data << (uint32)0; // ?
- data << (uint32)pdamage;
+ data << uint32(m_auraName);
+ data << (uint32)power; // power type
+ data << (uint32)amount;
m_target->SendMessageToSet(&data,true);
- int32 gain = m_target->ModifyPower(POWER_MANA, pdamage);
+ sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), amount, GetId());
+
+ int32 gain = m_target->ModifyPower(power,amount);
if(Unit* pCaster = GetCaster())
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
@@ -5785,9 +6108,9 @@ void Aura::PeriodicTick()
if(m_target->IsImmunedToDamage(GetSpellSchoolMask(GetSpellProto())))
return;
- int32 pdamage = GetModifierValue() > 0 ? GetModifierValue() : 0;
+ int32 pdamage = m_amount > 0 ? m_amount : 0;
- Powers powerType = Powers(m_modifier.m_miscvalue);
+ Powers powerType = Powers(GetMiscValue());
if(!m_target->isAlive() || m_target->getPowerType() != powerType)
return;
@@ -5819,127 +6142,143 @@ void Aura::PeriodicTick()
pCaster->DealSpellDamage(&damageInfo, true);
break;
}
+ case SPELL_AURA_MOD_REGEN:
+ {
+ int32 gain = m_target->ModifyHealth(m_amount);
+ if (Unit *caster = GetCaster())
+ m_target->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto());
+ break;
+ }
+ case SPELL_AURA_MOD_POWER_REGEN:
+ {
+ Powers pt = m_target->getPowerType();
+ if(int32(pt) != GetMiscValue())
+ return;
+
+ if ( GetSpellProto()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED )
+ {
+ // eating anim
+ m_target->HandleEmoteCommand(EMOTE_ONESHOT_EAT);
+ }
+ else if( GetId() == 20577 )
+ {
+ // cannibalize anim
+ m_target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE);
+ }
+
+ // Anger Management
+ // amount = 1+ 16 = 17 = 3,4*5 = 10,2*5/3
+ // so 17 is rounded amount for 5 sec tick grow ~ 1 range grow in 3 sec
+ if(pt == POWER_RAGE)
+ m_target->ModifyPower(pt, m_amount*3/5);
+ break;
+ }
+ case SPELL_AURA_DUMMY:
+ {
+ // Haunting Spirits
+ if (GetId() == 7057)
+ {
+ m_target->CastSpell((Unit*)NULL , m_amount , true);
+ m_amplitude = irand (0 , 60 ) + 30;
+ m_amplitude *= IN_MILISECONDS;
+ break;
+ }
+ break;
+ }
// Here tick dummy auras
case SPELL_AURA_PERIODIC_DUMMY:
{
PeriodicDummyTick();
break;
}
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
+ {
+ TriggerSpell();
+ break;
+ }
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
+ {
+ TriggerSpellWithValue();
+ break;
+ }
default:
break;
}
}
-void Aura::PeriodicDummyTick()
+void AuraEffect::PeriodicDummyTick()
{
+ Unit *caster = GetCaster();
SpellEntry const* spell = GetSpellProto();
- switch (spell->Id)
- {
- // Drink
- case 430:
- case 431:
- case 432:
- case 1133:
- case 1135:
- case 1137:
- case 10250:
- case 22734:
- case 27089:
- case 34291:
- case 43706:
- case 46755:
- {
- if (m_target->GetTypeId() != TYPEID_PLAYER)
- return;
- // Search SPELL_AURA_MOD_POWER_REGEN aura for this spell and add bonus
- Unit::AuraList const& aura = m_target->GetAurasByType(SPELL_AURA_MOD_POWER_REGEN);
- for(Unit::AuraList::const_iterator i = aura.begin(); i != aura.end(); ++i)
+ switch (spell->SpellFamilyName)
+ {
+ case SPELLFAMILY_GENERIC:
+ switch (spell->Id)
+ {
+ // Drink
+ case 430:
+ case 431:
+ case 432:
+ case 1133:
+ case 1135:
+ case 1137:
+ case 10250:
+ case 22734:
+ case 27089:
+ case 34291:
+ case 43706:
+ case 46755:
+ case 49472: // Drink Coffee
+ case 61830:
{
- if ((*i)->GetId() == GetId())
+ if (m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+ // Search SPELL_AURA_MOD_POWER_REGEN aura for this spell and add bonus
+ Unit::AuraEffectList const& aura = m_target->GetAurasByType(SPELL_AURA_MOD_POWER_REGEN);
+ for(Unit::AuraEffectList::const_iterator i = aura.begin(); i != aura.end(); ++i)
{
- // Get tick number
- int32 tick = (m_maxduration - m_duration) / m_modifier.periodictime;
- // Default case (not on arenas)
- if (tick == 0)
+ if ((*i)->GetId() == GetId())
{
- (*i)->GetModifier()->m_amount = m_modifier.m_amount;
+ (*i)->SetAmount(m_amount);
((Player*)m_target)->UpdateManaRegen();
// Disable continue
m_isPeriodic = false;
- }
- return;
- //**********************************************
- // Code commended since arena patch not added
- // This feature uses only in arenas
- //**********************************************
- // Here need increase mana regen per tick (6 second rule)
- // on 0 tick - 0 (handled in 2 second)
- // on 1 tick - 166% (handled in 4 second)
- // on 2 tick - 133% (handled in 6 second)
- // Not need update after 3 tick
- /*
- if (tick > 3)
return;
- // Apply bonus for 0 - 3 tick
- switch (tick)
- {
- case 0: // 0%
- (*i)->GetModifier()->m_amount = m_modifier.m_amount = 0;
- break;
- case 1: // 166%
- (*i)->GetModifier()->m_amount = m_modifier.m_amount * 5 / 3;
- break;
- case 2: // 133%
- (*i)->GetModifier()->m_amount = m_modifier.m_amount * 4 / 3;
- break;
- default: // 100% - normal regen
- (*i)->GetModifier()->m_amount = m_modifier.m_amount;
- break;
}
- ((Player*)m_target)->UpdateManaRegen();
- return;*/
}
+ return;
+ }
+ // Forsaken Skills
+ case 7054:
+ {
+ // Possibly need cast one of them (but
+ // 7038 Forsaken Skill: Swords
+ // 7039 Forsaken Skill: Axes
+ // 7040 Forsaken Skill: Daggers
+ // 7041 Forsaken Skill: Maces
+ // 7042 Forsaken Skill: Staves
+ // 7043 Forsaken Skill: Bows
+ // 7044 Forsaken Skill: Guns
+ // 7045 Forsaken Skill: 2H Axes
+ // 7046 Forsaken Skill: 2H Maces
+ // 7047 Forsaken Skill: 2H Swords
+ // 7048 Forsaken Skill: Defense
+ // 7049 Forsaken Skill: Fire
+ // 7050 Forsaken Skill: Frost
+ // 7051 Forsaken Skill: Holy
+ // 7053 Forsaken Skill: Shadow
+ return;
}
- return;
- }
// // Panda
// case 19230: break;
-// // Master of Subtlety
-// case 31666: break;
// // Gossip NPC Periodic - Talk
// case 33208: break;
// // Gossip NPC Periodic - Despawn
// case 33209: break;
-// // Force of Nature
-// case 33831: break;
- // Aspect of the Viper
- case 34074:
- {
- if (m_target->GetTypeId() != TYPEID_PLAYER)
- return;
- // Should be manauser
- if (m_target->getPowerType()!=POWER_MANA)
- return;
- Unit *caster = GetCaster();
- if (!caster)
- return;
- // Regen amount is max (100% from spell) on 21% or less mana and min on 92.5% or greater mana (20% from spell)
- int mana = m_target->GetPower(POWER_MANA);
- int max_mana = m_target->GetMaxPower(POWER_MANA);
- int32 base_regen = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, m_target);
- float regen_pct = 1.20f - 1.1f * mana / max_mana;
- if (regen_pct > 1.0f) regen_pct = 1.0f;
- else if (regen_pct < 0.2f) regen_pct = 0.2f;
- m_modifier.m_amount = int32 (base_regen * regen_pct);
- ((Player*)m_target)->UpdateManaRegen();
- return;
- }
// // Steal Weapon
// case 36207: break;
// // Simon Game START timer, (DND)
// case 39993: break;
-// // Harpooner's Mark
-// case 40084: break;
// // Knockdown Fel Cannon: break; The Aggro Burst
// case 40119: break;
// // Old Mount Spell
@@ -5952,6 +6291,8 @@ void Aura::PeriodicDummyTick()
// case 40846: break;
// // Copy Weapon
// case 41054: break;
+// // Dementia
+// case 41404: break;
// // Ethereal Ring Visual, Lightning Aura
// case 41477: break;
// // Ethereal Ring Visual, Lightning Aura (Fork)
@@ -6000,6 +6341,8 @@ void Aura::PeriodicDummyTick()
// case 43310: break;
// // Headless Horseman - Maniacal Laugh, Maniacal, Delayed 17
// case 43884: break;
+// // Wretched!
+// case 43963: break;
// // Headless Horseman - Maniacal Laugh, Maniacal, other, Delayed 17
// case 44000: break;
// // Energy Feedback
@@ -6066,25 +6409,199 @@ void Aura::PeriodicDummyTick()
// case 47407: break;
// // Mole Machine Port Schedule
// case 47489: break;
+// case 47941: break; // Crystal Spike
+// case 48200: break; // Healer Aura
+// case 48630: break; // Summon Gauntlet Mobs Periodic
+// case 49313: break; // Proximity Mine Area Aura
// // Mole Machine Portal Schedule
// case 49466: break;
-// // Drink Coffee
-// case 49472: break;
+// case 49555: break; // Corpse Explode
+// case 49592: break; // Temporal Rift
+// case 49957: break; // Cutting Laser
+// case 50085: break; // Slow Fall
// // Listening to Music
// case 50493: break;
// // Love Rocket Barrage
// case 50530: break;
+// Exist more after, need add later
+ default:
+ break;
+ }
+ break;
+ case SPELLFAMILY_MAGE:
+ {
+ // Mirror Image
+// if (spell->Id == 55342)
+// return;
+ break;
+ }
+ case SPELLFAMILY_WARRIOR:
+ {
+ // Armored to the Teeth
+ if (spell->SpellIconID == 3516)
+ {
+ // Increases your attack power by $s1 for every $s2 armor value you have.
+ // Calculate AP bonus (from 1 efect of this spell)
+ int32 apBonus = m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
+ m_target->CastCustomSpell(m_target, 61217, &apBonus, &apBonus, 0, true, 0, this);
+ return;
+ }
+ break;
+ }
+ case SPELLFAMILY_DRUID:
+ {
+ switch (spell->Id)
+ {
+ // Frenzied Regeneration
+ case 22842:
+ {
+ // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
+ // Should be manauser
+ if (m_target->getPowerType()!=POWER_RAGE)
+ return;
+ uint32 rage = m_target->GetPower(POWER_RAGE);
+ // Nothing todo
+ if (rage == 0)
+ return;
+ int32 mod = (rage < 100) ? rage : 100;
+ int32 points = m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
+ int32 regen = m_target->GetMaxHealth() * (mod * points / 10) / 1000;
+ m_target->CastCustomSpell(m_target, 22845, &regen, 0, 0, true, 0, this);
+ m_target->SetPower(POWER_RAGE, rage-mod);
+ return;
+ }
+ // Force of Nature
+ case 33831:
+ return;
+ default:
+ break;
+ }
+ break;
+ }
+ case SPELLFAMILY_ROGUE:
+ {
+ switch (spell->Id)
+ {
+ // Killing Spree
+// case 51690: break;
+ // Overkill
+ case 58428:
+ if (!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH))
+ m_target->RemoveAurasDueToSpell(58427);
+ break;
+ // Master of Subtlety
+ case 31666:
+ if (!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH))
+ m_target->RemoveAurasDueToSpell(31665);
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case SPELLFAMILY_HUNTER:
+ {
+ // Explosive Shot
+ if (spell->SpellFamilyFlags[1] & 0x80000000)
+ {
+ if (!caster)
+ return;
+ int32 damage = m_amount;
+ caster->CastCustomSpell(m_target, 56298, &damage, 0, 0, true, 0, this);
+ return;
+ }
+ switch (spell->Id)
+ {
+ // Harpooner's Mark
+ // case 40084:
+ // return;
+ // Feeding Frenzy Rank 1
+ case 53511:
+ if ( m_target->GetHealth() * 100 < m_target->GetMaxHealth() * 35 )
+ m_target->CastSpell(m_target, 60096, true, 0, this);
+ return;
+ // Feeding Frenzy Rank 2
+ case 53512:
+ if ( m_target->GetHealth() * 100 < m_target->GetMaxHealth() * 35 )
+ m_target->CastSpell(m_target, 60097, true, 0, this);
+ return;
+ default:
+ break;
+ }
+ break;
+ }
+ case SPELLFAMILY_SHAMAN:
+ {
+ // Astral Shift
+ if (spell->Id == 52179)
+ {
+ // Periodic need for remove visual on stun/fear/silence lost
+ if (!(m_target->GetUInt32Value(UNIT_FIELD_FLAGS)&(UNIT_FLAG_STUNNED|UNIT_FLAG_FLEEING|UNIT_FLAG_SILENCED)))
+ m_target->RemoveAurasDueToSpell(52179);
+ return;
+ }
+ break;
+ }
+ case SPELLFAMILY_DEATHKNIGHT:
+ {
+ // Death and Decay
+ if (spell->SpellFamilyFlags[0] & 0x20)
+ {
+ if (caster)
+ caster->CastCustomSpell(m_target, 52212, &m_amount, NULL, NULL, true, 0, this);
+ return;
+ }
+ // Raise Dead
+// if (spell->SpellFamilyFlags & 0x0000000000001000LL)
+// return;
+ // Chains of Ice
+ if (spell->SpellFamilyFlags[1] & 0x00004000)
+ {
+ // Get 0 effect aura
+ AuraEffect *slow = m_target->GetAuraEffect(GetId(), 0);
+ if (slow)
+ {
+ slow->ApplyModifier(false);;
+ slow->SetAmount(GetAmount()*2);
+ if (slow->GetAmount() > 0) slow->SetAmount(0);
+ slow->ApplyModifier(true);
+ }
+ return;
+ }
+ // Summon Gargoyle
+// if (spell->SpellFamilyFlags & 0x0000008000000000LL)
+// return;
+ // Death Rune Mastery
+// if (spell->SpellFamilyFlags & 0x0000000000004000LL)
+// return;
+ // Bladed Armor
+ if (spell->SpellIconID == 2653)
+ {
+ // Increases your attack power by $s1 for every $s2 armor value you have.
+ // Calculate AP bonus (from 1 efect of this spell)
+ int32 apBonus = m_amount * m_target->GetArmor() / m_target->CalculateSpellDamage(spell, 1, spell->EffectBasePoints[1], m_target);
+ m_target->CastCustomSpell(m_target, 61217, &apBonus, &apBonus, 0, true, 0, this);
+ return;
+ }
+ // Reaping
+// if (spell->SpellIconID == 22)
+// return;
+ // Blood of the North
+// if (spell->SpellIconID == 30412)
+// return;
+ break;
+ }
default:
break;
}
}
-void Aura::HandlePreventFleeing(bool apply, bool Real)
+void AuraEffect::HandlePreventFleeing(bool apply, bool Real)
{
if(!Real)
return;
- Unit::AuraList const& fearAuras = m_target->GetAurasByType(SPELL_AURA_MOD_FEAR);
+ Unit::AuraEffectList const& fearAuras = m_target->GetAurasByType(SPELL_AURA_MOD_FEAR);
if( !fearAuras.empty() )
{
m_target->SetControlled(!apply, UNIT_STAT_FLEEING);
@@ -6095,7 +6612,7 @@ void Aura::HandlePreventFleeing(bool apply, bool Real)
}
}
-void Aura::HandleManaShield(bool apply, bool Real)
+void AuraEffect::HandleManaShield(bool apply, bool Real)
{
if(!Real)
return;
@@ -6109,7 +6626,7 @@ void Aura::HandleManaShield(bool apply, bool Real)
switch(m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_MAGE:
- if(m_spellProto->SpellFamilyFlags & 0x8000)
+ if(m_spellProto->SpellFamilyFlags[0] & 0x8000)
{
// Mana Shield
// +50% from +spd bonus
@@ -6123,12 +6640,12 @@ void Aura::HandleManaShield(bool apply, bool Real)
DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellProto());
- m_modifier.m_amount += (int32)DoneActualBenefit;
+ m_amount += (int32)DoneActualBenefit;
}
}
}
-void Aura::HandleArenaPreparation(bool apply, bool Real)
+void AuraEffect::HandleArenaPreparation(bool apply, bool Real)
{
if(!Real)
return;
@@ -6139,3 +6656,220 @@ void Aura::HandleArenaPreparation(bool apply, bool Real)
m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION);
}
+void AuraEffect::HandleAuraControlVehicle(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(Pet *pet = ((Player*)m_target)->GetPet())
+ pet->Remove(PET_SAVE_AS_CURRENT);
+
+ //WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
+ //((Player*)m_target)->GetSession()->SendPacket(&data);
+}
+
+void AuraEffect::HandleAuraConvertRune(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ if(m_target->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ Player *plr = (Player*)m_target;
+
+ if(plr->getClass() != CLASS_DEATH_KNIGHT)
+ return;
+
+ // how to determine what rune need to be converted?
+ for(uint32 i = 0; i < MAX_RUNES; ++i)
+ {
+ if(apply)
+ {
+ if(!plr->GetRuneCooldown(i))
+ {
+ plr->ConvertRune(i, GetSpellProto()->EffectMiscValueB[m_effIndex]);
+ break;
+ }
+ }
+ else
+ {
+ if(plr->GetCurrentRune(i) == GetSpellProto()->EffectMiscValueB[m_effIndex])
+ {
+ plr->ConvertRune(i, plr->GetBaseRune(i));
+ break;
+ }
+ }
+ }
+}
+
+// Control Auras
+
+void AuraEffect::HandleAuraModStun(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ m_target->SetControlled(apply, UNIT_STAT_STUNNED);
+}
+
+void AuraEffect::HandleAuraModRoot(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ m_target->SetControlled(apply, UNIT_STAT_ROOT);
+}
+
+// Charm Auras
+
+void AuraEffect::HandleModPossess(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ Unit* caster = GetCaster();
+ if(caster && caster->GetTypeId() == TYPEID_UNIT)
+ {
+ HandleModCharm(apply, Real);
+ return;
+ }
+
+ if(apply)
+ {
+ if(m_target->getLevel() > m_amount)
+ return;
+
+ m_target->SetCharmedOrPossessedBy(caster, true);
+ }
+ else
+ m_target->RemoveCharmedOrPossessedBy(caster);
+}
+
+void AuraEffect::HandleModPossessPet(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ Unit* caster = GetCaster();
+ if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ if(apply)
+ {
+ if(caster->GetGuardianPet() != m_target)
+ return;
+
+ m_target->SetCharmedOrPossessedBy(caster, true);
+ }
+ else
+ {
+ m_target->RemoveCharmedOrPossessedBy(caster);
+
+ // Reinitialize the pet bar and make the pet come back to the owner
+ ((Player*)caster)->PetSpellInitialize();
+ if(!m_target->getVictim())
+ {
+ m_target->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
+ }
+ }
+}
+
+void AuraEffect::HandleModCharm(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ Unit* caster = GetCaster();
+
+ if(apply)
+ {
+ if(int32(m_target->getLevel()) > m_amount)
+ return;
+
+ m_target->SetCharmedOrPossessedBy(caster, false);
+ }
+ else
+ m_target->RemoveCharmedOrPossessedBy(caster);
+}
+
+void AuraEffect::HandlePhase(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ // always non stackable
+ if(apply)
+ {
+ m_target->RemoveAurasByType(SPELL_AURA_PHASE, NULL, GetParentAura());
+ }
+
+ // no-phase is also phase state so same code for apply and remove
+
+ // phase auras normally not expected at BG but anyway better check
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ {
+ // drop flag at invisible in bg
+ if(((Player*)m_target)->InBattleGround())
+ if(BattleGround *bg = ((Player*)m_target)->GetBattleGround())
+ bg->EventPlayerDroppedFlag((Player*)m_target);
+
+ // GM-mode have mask 0xFFFFFFFF
+ if(!((Player*)m_target)->isGameMaster())
+ m_target->SetPhaseMask(apply ? GetMiscValue() : PHASEMASK_NORMAL,false);
+
+ ((Player*)m_target)->GetSession()->SendSetPhaseShift(apply ? GetMiscValue() : PHASEMASK_NORMAL);
+
+ if(GetEffIndex()==0)
+ {
+ SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
+ if(saBounds.first != saBounds.second)
+ {
+ uint32 zone, area;
+ m_target->GetZoneAndAreaId(zone,area);
+
+ for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
+ {
+ // some auras remove at aura remove
+ if(!itr->second->IsFitToRequirements((Player*)m_target,zone,area))
+ m_target->RemoveAurasDueToSpell(itr->second->spellId);
+ // some auras applied at aura apply
+ else if(itr->second->autocast)
+ {
+ if( !m_target->HasAura(itr->second->spellId,0) )
+ m_target->CastSpell(m_target,itr->second->spellId,true);
+ }
+ }
+ }
+ }
+ }
+ else
+ m_target->SetPhaseMask(apply ? GetMiscValue() : PHASEMASK_NORMAL,false);
+
+ // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
+ if(m_target->GetVisibility()!=VISIBILITY_OFF)
+ m_target->SetVisibility(m_target->GetVisibility());
+}
+
+void Aura::UnregisterSingleCastAura()
+{
+ if (IsSingleTarget())
+ {
+ Unit* caster = NULL;
+ caster = GetCaster();
+ if(caster)
+ {
+ caster->GetSingleCastAuras().remove(this);
+ }
+ else
+ {
+ sLog.outError("Couldn't find the caster of the single target aura, may crash later!");
+ assert(false);
+ }
+ m_isSingleTargetAura = false;
+ }
+}
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 40552a3cb40..698df1f9a30 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,23 +22,6 @@
#include "SpellAuraDefines.h"
-struct DamageManaShield
-{
- uint32 m_spellId;
- uint32 m_modType;
- int32 m_schoolType;
- uint32 m_totalAbsorb;
- uint32 m_currAbsorb;
-};
-
-struct Modifier
-{
- AuraType m_auraname;
- int32 m_amount;
- int32 m_miscvalue;
- uint32 periodictime;
-};
-
class Unit;
struct SpellEntry;
struct SpellModifier;
@@ -46,8 +29,9 @@ struct ProcTriggerSpell;
// forward decl
class Aura;
+class AuraEffect;
-typedef void(Aura::*pAuraHandler)(bool Apply, bool Real);
+typedef void(AuraEffect::*pAuraHandler)(bool Apply, bool Real);
// Real == true at aura add/remove
// Real == false at aura mod unapply/reapply; when adding/removing dependent aura/item/stat mods
//
@@ -63,9 +47,127 @@ typedef void(Aura::*pAuraHandler)(bool Apply, bool Real);
class TRINITY_DLL_SPEC Aura
{
- friend Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem);
+ friend void Player::SendAurasForTarget(Unit *target);
+ public:
+ virtual ~Aura();
+ Aura(SpellEntry const* spellproto, uint32 effMask, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
+
+ SpellEntry const* GetSpellProto() const { return m_spellProto; }
+ uint32 GetId() const{ return m_spellProto->Id; }
+ uint64 GetCastItemGUID() const { return m_castItemGuid; }
+
+ uint64 const& GetCasterGUID() const { return m_caster_guid; }
+ Unit* GetCaster() const;
+ Unit* GetTarget() const { return m_target; }
+
+ time_t GetAuraApplyTime() const { return m_applyTime; }
+
+ int32 GetAuraMaxDuration() const { return m_maxduration; }
+ void SetAuraMaxDuration(int32 duration) { m_maxduration = duration; }
+ int32 GetAuraDuration() const { return m_duration; }
+ void SetAuraDuration(int32 duration);
+ void RefreshAura(){ SetAuraDuration (m_maxduration); }
+
+ void SendAuraUpdate();
+ uint8 GetAuraSlot() const { return m_auraSlot; }
+ void SetAuraSlot(uint8 slot) { m_auraSlot = slot; }
+ uint8 GetAuraCharges() const { return m_procCharges; }
+ void SetAuraCharges(uint8 charges);
+ bool DropAuraCharge();
+ void SetProcDamage(uint32 val) { m_procDamage = val; }
+ uint32 GetProcDamage() const { return m_procDamage; }
+
+ int8 GetStackAmount() const {return m_stackAmount;}
+ void SetStackAmount(uint8 num);
+ bool modStackAmount(int32 num); // return true if last charge dropped
+ uint32 GetAuraStateMask(){return m_auraStateMask;}
+ void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies aura's aura state (not unit!)
+
+ void SetRemoveMode(AuraRemoveMode mode) { m_removeMode = mode; }
+ uint8 GetRemoveMode() const {return m_removeMode;}
+
+ inline uint8 GetEffectMask() const {return m_auraFlags & 7;}
+ AuraEffect * GetPartAura (uint8 effIndex) const {return m_partAuras[effIndex];}
+ bool SetPartAura(AuraEffect* aurEff, uint8 effIndex);
+
+ bool IsPositive() const { return m_positive; }
+ void SetNegative() { m_positive = false; }
+ void SetPositive() { m_positive = true; }
+ bool IsPermanent() const { return m_permanent; }
+ void SetPermanent(bool val) { m_permanent = val; }
+
+ bool IsPassive() const { return m_isPassive; }
+ bool IsDeathPersistent() const { return m_isDeathPersist; }
+ bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
+ bool IsUpdated() const { return m_updated; }
+ bool IsRemoved() const { return m_isRemoved; }
+ void SetUpdated(bool val) { m_updated = val; }
+
+ bool IsPersistent() const;
+ bool IsAreaAura() const;
+ bool IsAuraType(AuraType type) const;
+ void SetLoadedState(uint64 caster_guid,int32 maxduration,int32 duration,int32 charges, uint8 stackamount, int32 * amount);
+ bool HasEffect(uint8 effIndex) const {return bool (m_partAuras[effIndex]);}
+ inline void HandleEffects(bool apply)
+ {
+ for (uint8 i = 0; i<MAX_SPELL_EFFECTS;++i)
+ if (m_partAuras[i])
+ m_target->HandleAuraEffect(m_partAuras[i], apply);
+ }
+ void ApplyAllModifiers(bool apply, bool Real=false);
+
+ void Update(uint32 diff);
+
+ void _AddAura();
+ void _RemoveAura();
+
+ // Allow Apply Aura Handler to modify and access m_AuraDRGroup
+ void setDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
+ DiminishingGroup getDiminishGroup() const { return m_AuraDRGroup; }
+
+ // Single cast aura helpers
+ void UnregisterSingleCastAura();
+ bool IsSingleTarget() const {return m_isSingleTargetAura;}
+ void SetIsSingleTarget(bool val) { m_isSingleTargetAura = val;}
+
+ private:
+ SpellEntry const *m_spellProto;
+ Unit * const m_target;
+ uint64 m_caster_guid;
+ uint64 m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
+ time_t m_applyTime;
+
+ int32 m_maxduration; // Max aura duration
+ int32 m_duration; // Current time
+ int32 m_timeCla; // Timer for power per sec calcultion
+ AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
+ DiminishingGroup m_AuraDRGroup:8; // Diminishing
+
+ uint8 m_auraSlot; // Aura slot on unit (for show in client)
+ uint8 m_auraFlags; // Aura info flag (for send data to client)
+ uint8 m_auraLevel; // Aura level (store caster level for correct show level dep amount)
+ uint8 m_procCharges; // Aura charges (0 for infinite)
+ uint32 m_procDamage; // used in aura proc code
+ uint8 m_stackAmount; // Aura stack amount
+ uint32 m_auraStateMask;
+ AuraEffect * m_partAuras[3];
+
+ bool m_isDeathPersist:1;
+ bool m_isRemovedOnShapeLost:1;
+ bool m_isPassive:1;
+ bool m_positive:1;
+ bool m_permanent:1;
+ bool m_isRemoved:1;
+ bool m_updated:1; // Prevent remove aura by stack if set
+ bool m_isSingleTargetAura:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
+};
+
+class TRINITY_DLL_SPEC AuraEffect
+{
public:
+ friend AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem);
+ friend void Aura::SetStackAmount(uint8 stackAmount);
//aura handlers
void HandleNULL(bool, bool)
{
@@ -100,6 +202,7 @@ class TRINITY_DLL_SPEC Aura
void HandleAuraFeatherFall(bool Apply, bool Real);
void HandleAuraHover(bool Apply, bool Real);
void HandleAddModifier(bool Apply, bool Real);
+ void HandleAddTargetTrigger(bool Apply, bool Real);
void HandleAuraModStun(bool Apply, bool Real);
void HandleModDamageDone(bool Apply, bool Real);
void HandleAuraUntrackable(bool Apply, bool Real);
@@ -111,13 +214,15 @@ class TRINITY_DLL_SPEC Aura
void HandleAuraModRegenInterrupt(bool Apply, bool Real);
void HandleHaste(bool Apply, bool Real);
void HandlePeriodicTriggerSpell(bool Apply, bool Real);
+ void HandlePeriodicTriggerSpellWithValue(bool apply, bool Real);
void HandlePeriodicEnergize(bool Apply, bool Real);
void HandleAuraModResistanceExclusive(bool Apply, bool Real);
+ void HandleAuraModPetTalentsPoints(bool Apply, bool Real);
void HandleModStealth(bool Apply, bool Real);
void HandleInvisibility(bool Apply, bool Real);
void HandleInvisibilityDetect(bool Apply, bool Real);
void HandleAuraModTotalHealthPercentRegen(bool Apply, bool Real);
- void HandleAuraModTotalManaPercentRegen(bool Apply, bool Real);
+ void HandleAuraModTotalEnergyPercentRegen(bool Apply, bool Real);
void HandleAuraModResistance(bool Apply, bool Real);
void HandleAuraModRoot(bool Apply, bool Real);
void HandleAuraModSilence(bool Apply, bool Real);
@@ -147,6 +252,7 @@ class TRINITY_DLL_SPEC Aura
void HandleModSpellHitChance(bool Apply, bool Real);
void HandleAuraModScale(bool Apply, bool Real);
void HandlePeriodicManaLeech(bool Apply, bool Real);
+ void HandlePeriodicHealthFunnel(bool apply, bool Real);
void HandleModCastingSpeed(bool Apply, bool Real);
void HandleAuraMounted(bool Apply, bool Real);
void HandleWaterBreathing(bool Apply, bool Real);
@@ -165,6 +271,7 @@ class TRINITY_DLL_SPEC Aura
void HandleFarSight(bool Apply, bool Real);
void HandleModPossessPet(bool Apply, bool Real);
void HandleModMechanicImmunity(bool Apply, bool Real);
+ void HandleModStateImmunityMask(bool apply, bool Real);
void HandleAuraModSkill(bool Apply, bool Real);
void HandleModDamagePercentDone(bool Apply, bool Real);
void HandleModPercentStat(bool Apply, bool Real);
@@ -184,10 +291,12 @@ class TRINITY_DLL_SPEC Aura
void HandleAuraGhost(bool Apply, bool Real);
void HandleAuraAllowFlight(bool Apply, bool Real);
void HandleModRating(bool apply, bool Real);
+ void HandleModRatingFromStat(bool apply, bool Real);
void HandleModTargetResistance(bool apply, bool Real);
void HandleAuraModAttackPowerPercent(bool apply, bool Real);
void HandleAuraModRangedAttackPowerPercent(bool apply, bool Real);
void HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real);
+ void HandleAuraModAttackPowerOfStatPercent(bool apply, bool Real);
void HandleSpiritOfRedemption(bool apply, bool Real);
void HandleModManaRegen(bool apply, bool Real);
void HandleComprehendLanguage(bool apply, bool Real);
@@ -197,6 +306,7 @@ class TRINITY_DLL_SPEC Aura
void HandleModSpellDamagePercentFromStat(bool apply, bool Real);
void HandleModSpellHealingPercentFromStat(bool apply, bool Real);
void HandleAuraModDispelResist(bool apply, bool Real);
+ void HandleAuraControlVehicle(bool apply, bool Real);
void HandleModSpellDamagePercentFromAttackPower(bool apply, bool Real);
void HandleModSpellHealingPercentFromAttackPower(bool apply, bool Real);
void HandleAuraModPacifyAndSilence(bool Apply, bool Real);
@@ -209,171 +319,90 @@ class TRINITY_DLL_SPEC Aura
void HandlePreventFleeing(bool apply, bool Real);
void HandleManaShield(bool apply, bool Real);
void HandleArenaPreparation(bool apply, bool Real);
+ void HandleAuraConvertRune(bool apply, bool Real);
+ void HandleAuraIncreaseBaseHealthPercent(bool Apply, bool Real);
+ void HandleNoReagentUseAura(bool Apply, bool Real);
+ void HandlePhase(bool Apply, bool Real);
+ void HandleAuraAllowOnlyAbility(bool apply, bool Real);
- virtual ~Aura();
+ // add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
+ void HandleShapeshiftBoosts(bool apply);
- void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue);
- Modifier* GetModifier() {return &m_modifier;}
- int32 GetModifierValuePerStack() {return m_modifier.m_amount;}
- int32 GetModifierValue() {return m_modifier.m_amount * m_stackAmount;}
- int32 GetMiscValue() {return m_spellProto->EffectMiscValue[m_effIndex];}
- int32 GetMiscBValue() {return m_spellProto->EffectMiscValueB[m_effIndex];}
+ inline Unit * GetCaster() const{ return m_parentAura->GetCaster(); }
+ inline uint64 GetCasterGUID() const{ return m_parentAura->GetCasterGUID(); }
+ Aura * GetParentAura() const { return m_parentAura; }
SpellEntry const* GetSpellProto() const { return m_spellProto; }
- uint32 GetId() const{ return m_spellProto->Id; }
- uint64 GetCastItemGUID() const { return m_castItemGuid; }
- uint32 GetEffIndex() const{ return m_effIndex; }
+ uint32 GetId() const { return m_spellProto->Id; }
+ uint32 GetEffIndex() const { return m_effIndex; }
int32 GetBasePoints() const { return m_currentBasePoints; }
+ int32 GetAuraAmplitude(){return m_amplitude;}
+ virtual void Update(uint32 diff);
- int32 GetAuraMaxDuration() const { return m_maxduration; }
- void SetAuraMaxDuration(int32 duration) { m_maxduration = duration; }
- int32 GetAuraDuration() const { return m_duration; }
- void SetAuraDuration(int32 duration)
- {
- m_duration = duration;
- if (duration<0)
- m_permanent=true;
- else
- m_permanent=false;
- }
- time_t GetAuraApplyTime() { return m_applyTime; }
- void UpdateAuraDuration();
- void SendAuraDurationForCaster(Player* caster);
- void UpdateSlotCounterAndDuration();
uint32 GetTickNumber() const { return m_tickNumber; }
-
- uint64 const& GetCasterGUID() const { return m_caster_guid; }
- Unit* GetCaster() const;
- Unit* GetTarget() const { return m_target; }
- void SetTarget(Unit* target) { m_target = target; }
- void SetLoadedState(uint64 caster_guid,int32 damage,int32 maxduration,int32 duration,int32 charges)
- {
- m_caster_guid = caster_guid;
- m_modifier.m_amount = damage;
- m_maxduration = maxduration;
- m_duration = duration;
- m_procCharges = charges;
- }
-
- uint8 GetAuraSlot() const { return m_auraSlot; }
- void SetAuraSlot(uint8 slot) { m_auraSlot = slot; }
- void UpdateAuraCharges()
- {
- uint8 slot = GetAuraSlot();
-
- // only aura in slot with charges and without stack limitation
- if (slot < MAX_AURAS && m_procCharges >= 1 && GetSpellProto()->StackAmount==0)
- SetAuraApplication(slot, m_procCharges - 1);
- }
-
- bool IsPositive() { return m_positive; }
- void SetNegative() { m_positive = false; }
- void SetPositive() { m_positive = true; }
-
- bool IsPermanent() const { return m_permanent; }
bool IsAreaAura() const { return m_isAreaAura; }
bool IsPeriodic() const { return m_isPeriodic; }
- bool IsTrigger() const { return m_isTrigger; }
- bool IsPassive() const { return m_isPassive; }
bool IsPersistent() const { return m_isPersistent; }
- bool IsDeathPersistent() const { return m_isDeathPersist; }
- bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
- bool IsInUse() const { return m_in_use;}
- void CleanupTriggeredSpells();
+ bool isAffectedOnSpell(SpellEntry const *spell) const;
- virtual void Update(uint32 diff);
void ApplyModifier(bool apply, bool Real = false);
-
- void _AddAura();
- void _RemoveAura();
-
- void TriggerSpell();
-
- bool IsUpdated() { return m_updated; }
- void SetUpdated(bool val) { m_updated = val; }
- void SetRemoveMode(AuraRemoveMode mode) { m_removeMode = mode; }
-
- int32 m_procCharges;
- void SetAuraProcCharges(int32 charges) { m_procCharges = charges; }
+ void HandleAuraEffect(bool apply);
+ void ApplyAllModifiers(bool apply, bool Real);
Unit* GetTriggerTarget() const;
-
- // add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
- void HandleShapeshiftBoosts(bool apply);
-
- // Allow Apply Aura Handler to modify and access m_AuraDRGroup
- void setDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
- DiminishingGroup getDiminishGroup() const { return m_AuraDRGroup; }
-
+ void TriggerSpell();
+ void TriggerSpellWithValue();
void PeriodicTick();
void PeriodicDummyTick();
- int32 GetStackAmount() {return m_stackAmount;}
- void SetStackAmount(int32 amount) {m_stackAmount=amount;}
+ int32 GetMiscBValue() const {return m_spellProto->EffectMiscValueB[m_effIndex];}
+ int32 GetMiscValue() const {return m_spellProto->EffectMiscValue[m_effIndex];}
+ uint32 GetAuraName() const {return m_auraName;}
+ int32 GetAmount() const {return m_amount;}
+ void SetAmount(int32 amount) { m_amount = amount; }
+ void CleanupTriggeredSpells();
+
protected:
- Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
+ AuraEffect (Aura * parentAura, uint8 effIndex, int32 * currentBasePoints , Unit * caster,Item * castItem);
+ Aura * const m_parentAura;
+ Unit * const m_target;
- Modifier m_modifier;
- SpellModifier *m_spellmod;
- uint32 m_effIndex;
SpellEntry const *m_spellProto;
- int32 m_currentBasePoints; // cache SpellEntry::EffectBasePoints and use for set custom base points
- uint64 m_caster_guid;
- Unit* m_target;
- int32 m_maxduration;
- int32 m_duration;
uint32 m_tickNumber;
- int32 m_timeCla;
- uint64 m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
- time_t m_applyTime;
- AuraRemoveMode m_removeMode;
+ uint8 m_effIndex;
+ AuraType m_auraName;
+ int32 m_currentBasePoints;
+ int32 m_amount;
- uint8 m_auraSlot;
+ SpellModifier *m_spellmod;
+
+ int32 m_periodicTimer; // Timer for periodic auras
+ int32 m_amplitude;
- bool m_positive:1;
- bool m_permanent:1;
bool m_isPeriodic:1;
- bool m_isTrigger:1;
bool m_isAreaAura:1;
- bool m_isPassive:1;
bool m_isPersistent:1;
- bool m_isDeathPersist:1;
- bool m_isRemovedOnShapeLost:1;
- bool m_updated:1;
- bool m_in_use:1; // true while in Aura::ApplyModifier call
-
- int32 m_periodicTimer;
- uint32 m_PeriodicEventId;
- DiminishingGroup m_AuraDRGroup;
-
- int32 m_stackAmount;
- private:
- void SetAura(uint32 slot, bool remove) { m_target->SetUInt32Value(UNIT_FIELD_AURA + slot, remove ? 0 : GetId()); }
- void SetAuraFlag(uint32 slot, bool add);
- void SetAuraLevel(uint32 slot, uint32 level);
- void SetAuraApplication(uint32 slot, int8 count);
};
-class TRINITY_DLL_SPEC AreaAura : public Aura
+class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
{
public:
- AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
- ~AreaAura();
+ AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster=NULL, Item * castItem=NULL);
+ ~AreaAuraEffect();
void Update(uint32 diff);
private:
float m_radius;
+ int32 m_removeTime;
AreaAuraType m_areaAuraType;
};
-class TRINITY_DLL_SPEC PersistentAreaAura : public Aura
+class TRINITY_DLL_SPEC PersistentAreaAuraEffect : public AuraEffect
{
public:
- PersistentAreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
- ~PersistentAreaAura();
+ PersistentAreaAuraEffect(Aura * parentAura, uint32 eff, int32 *currentBasePoints, Unit *caster = NULL, Item* castItem = NULL);
+ ~PersistentAreaAuraEffect();
void Update(uint32 diff);
};
-
-Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
+AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem = NULL);
#endif
-
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index af7d2ee8a98..ae468f0fdbb 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,10 +19,8 @@
*/
#include "Common.h"
-#include "SharedDefines.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "Opcodes.h"
#include "Log.h"
#include "UpdateMask.h"
@@ -32,7 +30,6 @@
#include "Player.h"
#include "SkillExtraItems.h"
#include "Unit.h"
-#include "CreatureAI.h"
#include "Spell.h"
#include "DynamicObject.h"
#include "SpellAuras.h"
@@ -47,6 +44,7 @@
#include "Creature.h"
#include "Totem.h"
#include "CreatureAI.h"
+#include "BattleGroundMgr.h"
#include "BattleGround.h"
#include "BattleGroundEY.h"
#include "BattleGroundWS.h"
@@ -60,6 +58,9 @@
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
+#include "SkillDiscovery.h"
+#include "Formulas.h"
+#include "Vehicle.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
@@ -104,8 +105,8 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectDispel, // 38 SPELL_EFFECT_DISPEL
&Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE
&Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD
- &Spell::EffectSummonWild, // 41 SPELL_EFFECT_SUMMON_WILD
- &Spell::EffectSummonGuardian, // 42 SPELL_EFFECT_SUMMON_GUARDIAN
+ &Spell::EffectJump, // 41 SPELL_EFFECT_JUMP
+ &Spell::EffectJump, // 42 SPELL_EFFECT_JUMP2
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
&Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
@@ -128,16 +129,16 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectPowerBurn, // 62 SPELL_EFFECT_POWER_BURN
&Spell::EffectThreat, // 63 SPELL_EFFECT_THREAT
&Spell::EffectTriggerSpell, // 64 SPELL_EFFECT_TRIGGER_SPELL
- &Spell::EffectUnused, // 65 SPELL_EFFECT_HEALTH_FUNNEL unused
- &Spell::EffectUnused, // 66 SPELL_EFFECT_POWER_FUNNEL unused
+ &Spell::EffectApplyAreaAura, // 65 SPELL_EFFECT_APPLY_AREA_AURA_RAID
+ &Spell::EffectUnused, // 66 SPELL_EFFECT_CREATE_MANA_GEM (possibly recharge it, misc - is item ID)
&Spell::EffectHealMaxHealth, // 67 SPELL_EFFECT_HEAL_MAX_HEALTH
&Spell::EffectInterruptCast, // 68 SPELL_EFFECT_INTERRUPT_CAST
&Spell::EffectDistract, // 69 SPELL_EFFECT_DISTRACT
&Spell::EffectPull, // 70 SPELL_EFFECT_PULL one spell: Distract Move
&Spell::EffectPickPocket, // 71 SPELL_EFFECT_PICKPOCKET
&Spell::EffectAddFarsight, // 72 SPELL_EFFECT_ADD_FARSIGHT
- &Spell::EffectSummonPossessed, // 73 SPELL_EFFECT_SUMMON_POSSESSED
- &Spell::EffectSummonTotem, // 74 SPELL_EFFECT_SUMMON_TOTEM
+ &Spell::EffectUnused, // 73 SPELL_EFFECT_UNTRAIN_TALENTS
+ &Spell::EffectApplyGlyph, // 74 SPELL_EFFECT_APPLY_GLYPH
&Spell::EffectHealMechanical, // 75 SPELL_EFFECT_HEAL_MECHANICAL one spell: Mechanical Patch Kit
&Spell::EffectSummonObjectWild, // 76 SPELL_EFFECT_SUMMON_OBJECT_WILD
&Spell::EffectScriptEffect, // 77 SPELL_EFFECT_SCRIPT_EFFECT
@@ -150,17 +151,17 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectStuck, // 84 SPELL_EFFECT_STUCK
&Spell::EffectSummonPlayer, // 85 SPELL_EFFECT_SUMMON_PLAYER
&Spell::EffectActivateObject, // 86 SPELL_EFFECT_ACTIVATE_OBJECT
- &Spell::EffectSummonTotem, // 87 SPELL_EFFECT_SUMMON_TOTEM_SLOT1
- &Spell::EffectSummonTotem, // 88 SPELL_EFFECT_SUMMON_TOTEM_SLOT2
- &Spell::EffectSummonTotem, // 89 SPELL_EFFECT_SUMMON_TOTEM_SLOT3
- &Spell::EffectSummonTotem, // 90 SPELL_EFFECT_SUMMON_TOTEM_SLOT4
+ &Spell::EffectUnused, // 87 SPELL_EFFECT_WMO_DAMAGE
+ &Spell::EffectUnused, // 88 SPELL_EFFECT_WMO_REPAIR
+ &Spell::EffectUnused, // 89 SPELL_EFFECT_WMO_CHANGE
+ &Spell::EffectUnused, // 90 SPELL_EFFECT_KILL_CREDIT
&Spell::EffectUnused, // 91 SPELL_EFFECT_THREAT_ALL one spell: zzOLDBrainwash
&Spell::EffectEnchantHeldItem, // 92 SPELL_EFFECT_ENCHANT_HELD_ITEM
&Spell::EffectUnused, // 93 SPELL_EFFECT_SUMMON_PHANTASM
&Spell::EffectSelfResurrect, // 94 SPELL_EFFECT_SELF_RESURRECT
&Spell::EffectSkinning, // 95 SPELL_EFFECT_SKINNING
&Spell::EffectUnused, // 96 SPELL_EFFECT_CHARGE
- &Spell::EffectSummonCritter, // 97 SPELL_EFFECT_SUMMON_CRITTER
+ &Spell::EffectUnused, // 97 SPELL_EFFECT_97
&Spell::EffectKnockBack, // 98 SPELL_EFFECT_KNOCK_BACK
&Spell::EffectDisEnchant, // 99 SPELL_EFFECT_DISENCHANT
&Spell::EffectInebriate, //100 SPELL_EFFECT_INEBRIATE
@@ -175,7 +176,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectSummonDeadPet, //109 SPELL_EFFECT_SUMMON_DEAD_PET
&Spell::EffectDestroyAllTotems, //110 SPELL_EFFECT_DESTROY_ALL_TOTEMS
&Spell::EffectDurabilityDamage, //111 SPELL_EFFECT_DURABILITY_DAMAGE
- &Spell::EffectSummonDemon, //112 SPELL_EFFECT_SUMMON_DEMON
+ &Spell::EffectUnused, //112 SPELL_EFFECT_112
&Spell::EffectResurrectNew, //113 SPELL_EFFECT_RESURRECT_NEW
&Spell::EffectTaunt, //114 SPELL_EFFECT_ATTACK_ME
&Spell::EffectDurabilityDamagePCT, //115 SPELL_EFFECT_DURABILITY_DAMAGE_PCT
@@ -195,21 +196,21 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
&Spell::EffectRedirectThreat, //130 SPELL_EFFECT_REDIRECT_THREAT
&Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells
- &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value
+ &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc)
&Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization
&Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry
&Spell::EffectNULL, //135 SPELL_EFFECT_CALL_PET
&Spell::EffectHealPct, //136 SPELL_EFFECT_HEAL_PCT
&Spell::EffectEnergisePct, //137 SPELL_EFFECT_ENERGIZE_PCT
- &Spell::EffectNULL, //138 SPELL_EFFECT_138 Leap
- &Spell::EffectUnused, //139 SPELL_EFFECT_139 unused
+ &Spell::EffectJump2, //138 SPELL_EFFECT_138 Leap
+ &Spell::EffectUnused, //139 SPELL_EFFECT_CLEAR_QUEST (misc - is quest ID)
&Spell::EffectForceCast, //140 SPELL_EFFECT_FORCE_CAST
&Spell::EffectNULL, //141 SPELL_EFFECT_141 damage and reduce speed?
&Spell::EffectTriggerSpellWithValue, //142 SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
&Spell::EffectApplyAreaAura, //143 SPELL_EFFECT_APPLY_AREA_AURA_OWNER
&Spell::EffectKnockBack, //144 SPELL_EFFECT_KNOCK_BACK_2 Spectral Blast
&Spell::EffectPlayerPull, //145 SPELL_EFFECT_145 Black Hole Effect
- &Spell::EffectUnused, //146 SPELL_EFFECT_146 unused
+ &Spell::EffectActivateRune, //146 SPELL_EFFECT_ACTIVATE_RUNE
&Spell::EffectQuestFail, //147 SPELL_EFFECT_QUEST_FAIL quest fail
&Spell::EffectUnused, //148 SPELL_EFFECT_148 unused
&Spell::EffectNULL, //149 SPELL_EFFECT_149 swoop
@@ -217,6 +218,12 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectTriggerRitualOfSummoning, //151 SPELL_EFFECT_TRIGGER_SPELL_2
&Spell::EffectNULL, //152 SPELL_EFFECT_152 summon Refer-a-Friend
&Spell::EffectNULL, //153 SPELL_EFFECT_CREATE_PET misc value is creature entry
+ &Spell::EffectNULL, //154 unused
+ &Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
+ &Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
+ &Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
+ &Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
+ &Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
};
void Spell::EffectNULL(uint32 /*i*/)
@@ -291,13 +298,13 @@ void Spell::EffectEnvirinmentalDMG(uint32 i)
// Note: this hack with damage replace required until GO casting not implemented
// environment damage spells already have around enemies targeting but this not help in case not existed GO casting support
// currently each enemy selected explicitly and self cast damage, we prevent apply self casted spell bonuses/etc
- damage = m_spellInfo->EffectBasePoints[i]+m_spellInfo->EffectBaseDice[i];
+ damage = m_spellInfo->CalculateSimpleValue(i);
- m_caster->CalcAbsorbResist(m_caster,GetSpellSchoolMask(m_spellInfo), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
+ m_caster->CalcAbsorbResist(m_caster,GetSpellSchoolMask(m_spellInfo), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist, m_spellInfo);
m_caster->SendSpellNonMeleeDamageLog(m_caster, m_spellInfo->Id, damage, GetSpellSchoolMask(m_spellInfo), absorb, resist, false, 0, false);
if(m_caster->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_caster)->EnvironmentalDamage(m_caster->GetGUID(),DAMAGE_FIRE,damage);
+ ((Player*)m_caster)->EnvironmentalDamage(DAMAGE_FIRE,damage);
}
void Spell::EffectSchoolDMG(uint32 effect_idx)
@@ -333,7 +340,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
{
case 35354: //Hand of Death
{
- if(unitTarget && unitTarget->HasAura(38528,0)) //Protection of Elune
+ if(unitTarget && unitTarget->HasAura(38528)) //Protection of Elune
{
damage = 0;
}
@@ -347,6 +354,13 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage = 200;
break;
}
+ // Intercept (warrior spell trigger)
+ case 20253:
+ case 61491:
+ {
+ damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.12f);
+ break;
+ }
// arcane charge. must only affect demons (also undead?)
case 45072:
{
@@ -362,7 +376,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
+ float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
if(!radius) return;
float distance = m_caster->GetDistance2d(unitTarget);
damage = (distance > radius ) ? 0 : (int32)(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius));
@@ -374,7 +388,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
case SPELLFAMILY_MAGE:
{
// Arcane Blast
- if(m_spellInfo->SpellFamilyFlags & 0x20000000LL)
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x20000000)
{
m_caster->CastSpell(m_caster,36032,true);
}
@@ -383,109 +397,112 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
case SPELLFAMILY_WARRIOR:
{
// Bloodthirst
- if(m_spellInfo->SpellFamilyFlags & 0x40000000000LL)
+ if(m_spellInfo->SpellFamilyFlags[1] & 0x400)
{
damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100);
}
// Shield Slam
- else if(m_spellInfo->SpellFamilyFlags & 0x100000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category==1209)
damage += int32(m_caster->GetShieldBlockValue());
// Victory Rush
- else if(m_spellInfo->SpellFamilyFlags & 0x10000000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x100)
{
damage = uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
m_caster->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, false);
}
+ // Revenge ${$m1+$AP*0.207} to ${$M1+$AP*0.207}
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x400)
+ damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.207f);
+ // Heroic Throw ${$m1+$AP*.50}
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x00000001)
+ damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f);
+ // Shockwave ${$m3/100*$AP}
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x00008000)
+ {
+ int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
+ if (pct > 0)
+ damage+= int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * pct / 100);
+ break;
+ }
+ // Thunder Clap
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x80)
+ {
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 12 / 100);
+ break;
+ }
+ // Concussion Blow
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x4000000)
+ {
+ int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * pct / 100);
+ break;
+ }
break;
}
case SPELLFAMILY_WARLOCK:
{
// Incinerate Rank 1 & 2
- if((m_spellInfo->SpellFamilyFlags & 0x00004000000000LL) && m_spellInfo->SpellIconID==2128)
+ if((m_spellInfo->SpellFamilyFlags[1] & 0x000040) && m_spellInfo->SpellIconID==2128)
{
// Incinerate does more dmg (dmg*0.25) if the target is Immolated.
- if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE))
- damage += int32(damage*0.25);
+ if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE, m_spellInfo, m_caster))
+ damage += int32(damage*0.25f);
}
-
// Conflagrate - consumes immolate
if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
{
// for caster applied auras only
- Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
+ Unit::AuraEffectList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
- if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4) &&
+ if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags[0] & 4) &&
(*i)->GetCasterGUID()==m_caster->GetGUID() )
{
- unitTarget->RemoveAurasByCasterSpell((*i)->GetId(), m_caster->GetGUID());
+ unitTarget->RemoveAurasDueToSpell((*i)->GetId(), m_caster->GetGUID());
break;
}
}
}
break;
}
+ case SPELLFAMILY_PRIEST:
+ {
+ // Shadow Word: Death - deals damage equal to damage done to caster
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x2)
+ m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true);
+ break;
+ }
case SPELLFAMILY_DRUID:
{
// Ferocious Bite
- if((m_spellInfo->SpellFamilyFlags & 0x000800000) && m_spellInfo->SpellVisual==6587)
+ if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[0] & 0x000800000) && m_spellInfo->SpellVisual[0]==6587)
{
- // converts each extra point of energy into ($f1+$AP/630) additional damage
- float multiple = m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 630 + m_spellInfo->DmgMultiplier[effect_idx];
+ // converts each extra point of energy into ($f1+$AP/410) additional damage
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ float multiple = ap / 410 + m_spellInfo->DmgMultiplier[effect_idx];
damage += int32(m_caster->GetPower(POWER_ENERGY) * multiple);
+ damage += int32(((Player*)m_caster)->GetComboPoints() * ap * 7 / 100);
m_caster->SetPower(POWER_ENERGY,0);
}
// Rake
- else if(m_spellInfo->SpellFamilyFlags & 0x0000000000001000LL)
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x1000)
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
}
// Swipe
- else if(m_spellInfo->SpellFamilyFlags & 0x0010000000000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x00100000)
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.08f);
}
- // Starfire
- else if ( m_spellInfo->SpellFamilyFlags & 0x0004LL )
- {
- Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
- {
- // Starfire Bonus (caster)
- switch((*i)->GetModifier()->m_miscvalue)
- {
- case 5481: // Nordrassil Regalia - bonus
- {
- Unit::AuraList const& m_periodicDamageAuras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- for(Unit::AuraList::const_iterator itr = m_periodicDamageAuras.begin(); itr != m_periodicDamageAuras.end(); ++itr)
- {
- // Moonfire or Insect Swarm (target debuff from any casters)
- if ( (*itr)->GetSpellProto()->SpellFamilyFlags & 0x00200002LL )
- {
- int32 mod = (*i)->GetModifier()->m_amount;
- damage += damage*mod/100;
- break;
- }
- }
- break;
- }
- case 5148: //Improved Starfire - Ivory Idol of the Moongoddes Aura
- {
- damage += (*i)->GetModifier()->m_amount;
- break;
- }
- }
- }
- }
//Mangle Bonus for the initial damage of Lacerate and Rake
- if((m_spellInfo->SpellFamilyFlags==0x0000000000001000LL && m_spellInfo->SpellIconID==494) ||
- (m_spellInfo->SpellFamilyFlags==0x0000010000000000LL && m_spellInfo->SpellIconID==2246))
+ if((m_spellInfo->SpellFamilyFlags.IsEqual(0x1000,0,0) && m_spellInfo->SpellIconID==494) ||
+ (m_spellInfo->SpellFamilyFlags.IsEqual(0,0x100,0) && m_spellInfo->SpellIconID==2246))
{
- Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
- if((*i)->GetSpellProto()->SpellFamilyFlags & 0x0000044000000000LL && (*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID)
+ Unit::AuraEffectList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
+ if((*i)->GetSpellProto()->SpellFamilyFlags[1] & 0x00000440 && (*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID)
{
- damage = int32(damage*(100.0f+(*i)->GetModifier()->m_amount)/100.0f);
+ damage = int32(damage*(100.0f+(*i)->GetAmount())/100.0f);
break;
}
}
@@ -494,78 +511,97 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
case SPELLFAMILY_ROGUE:
{
// Envenom
- if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & 0x800000000LL))
+ if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[1] & 0x8))
{
// consume from stack dozes not more that have combo-points
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{
- // count consumed deadly poison doses at target
- uint32 doses = 0;
-
- // remove consumed poison doses
- Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end() && combo;)
- {
- // Deadly poison (only attacker applied)
- if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && ((*itr)->GetSpellProto()->SpellFamilyFlags & 0x10000) &&
- (*itr)->GetSpellProto()->SpellVisual==5100 && (*itr)->GetCasterGUID()==m_caster->GetGUID() )
+ Aura *poison = 0;
+ // Lookup for Deadly poison (only attacker applied)
+ Unit::AuraEffectList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
+ if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
+ (*itr)->GetSpellProto()->SpellFamilyFlags[0] & 0x10000 &&
+ (*itr)->GetCasterGUID()==m_caster->GetGUID() )
{
- --combo;
- ++doses;
-
- unitTarget->RemoveSingleAuraFromStack((*itr)->GetId(), (*itr)->GetEffIndex());
-
- itr = auras.begin();
+ poison = (*itr)->GetParentAura();
+ break;
}
- else
- ++itr;
+ // count consumed deadly poison doses at target
+ if (poison)
+ {
+ uint32 spellId = poison->GetId();
+ uint32 doses = poison->GetStackAmount();
+ if (doses > combo)
+ doses = combo;
+ for (int i=0; i< doses; i++)
+ unitTarget->RemoveAuraFromStack(spellId);
+ damage *= doses;
+ damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
}
-
- damage *= doses;
- damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
-
// Eviscerate and Envenom Bonus Damage (item set effect)
if(m_caster->GetDummyAura(37169))
damage += ((Player*)m_caster)->GetComboPoints()*40;
}
}
// Eviscerate
- else if((m_spellInfo->SpellFamilyFlags & 0x00020000LL) && m_caster->GetTypeId()==TYPEID_PLAYER)
+ else if((m_spellInfo->SpellFamilyFlags[0] & 0x00020000) && m_caster->GetTypeId()==TYPEID_PLAYER)
{
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{
- damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * combo * 0.03f);
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
// Eviscerate and Envenom Bonus Damage (item set effect)
if(m_caster->GetDummyAura(37169))
damage += combo*40;
}
}
+ // Gouge
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x8)
+ {
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.02f);
+ }
+ // Instant Poison
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x2000)
+ {
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.10f);
+ }
+ // Wound Poison
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x10000000)
+ {
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.04f);
+ }
break;
}
case SPELLFAMILY_HUNTER:
{
// Mongoose Bite
- if((m_spellInfo->SpellFamilyFlags & 0x000000002) && m_spellInfo->SpellVisual==342)
+ if((m_spellInfo->SpellFamilyFlags[0] & 0x2) && m_spellInfo->SpellVisual[0]==342)
+ {
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
+ }
+ // Counterattack
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x00080000)
{
- damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2);
+ damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
}
// Arcane Shot
- else if((m_spellInfo->SpellFamilyFlags & 0x00000800) && m_spellInfo->maxLevel > 0)
+ else if((m_spellInfo->SpellFamilyFlags[0] & 0x00000800) && m_spellInfo->maxLevel > 0)
{
- damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.15);
+ damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.15f);
}
// Steady Shot
- else if(m_spellInfo->SpellFamilyFlags & 0x100000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x1)
{
int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE));
- damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f);
+ damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f);
bool found = false;
// check dazed affect
- Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
- for(Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
+ Unit::AuraEffectList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
+ for(Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
{
if((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0)
{
@@ -578,28 +614,59 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if(found)
damage += m_spellInfo->EffectBasePoints[1];
}
- //Explosive Trap Effect
- else if(m_spellInfo->SpellFamilyFlags & 0x00000004)
+ // Explosive Trap Effect
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x00000004)
{
- damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1);
+ damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f);
}
break;
}
case SPELLFAMILY_PALADIN:
{
- //Judgement of Vengeance
- if((m_spellInfo->SpellFamilyFlags & 0x800000000LL) && m_spellInfo->SpellIconID==2292)
+ // Judgement of Vengeance/Corruption ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance/Blood Corruption on the target
+ if((m_spellInfo->SpellFamilyFlags[1] & 0x400000) && m_spellInfo->SpellIconID==2292)
{
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
+ m_caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellInfo), unitTarget);
+ damage+=int32(ap * 0.14f) + int32(holy * 22 / 100);
+ // Get stack of Holy Vengeance/Blood Corruption on the target added by caster
uint32 stacks = 0;
- Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
- if((*itr)->GetId() == 31803 && (*itr)->GetCasterGUID()==m_caster->GetGUID())
- ++stacks;
- if(!stacks)
- //No damage if the target isn't affected by this
- damage = -1;
- else
- damage *= stacks;
+ Unit::AuraEffectList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
+ if(((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==m_caster->GetGUID())
+ {
+ stacks = (*itr)->GetParentAura()->GetStackAmount();
+ break;
+ }
+ // + 10% for each application of Holy Vengeance/Blood Corruption on the target
+ if(stacks)
+ damage += damage * stacks * 10 /100;
+ }
+ // Avenger's Shield ($m1+0.07*$SPH+0.07*$AP)
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x4000)
+ {
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ damage += int32(ap * 0.07f);
+ }
+ // Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x00000080)
+ {
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ damage += int32(ap * 0.15f);
+ }
+ // Hammer of the Righteous
+ else if(m_spellInfo->SpellFamilyFlags[1]&0x00040000)
+ {
+ // Add main hand dps * effect[2] amount
+ float averange = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
+ int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
+ damage += count * int32(averange * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
+ }
+ // Shield of Righteousness
+ else if(m_spellInfo->SpellFamilyFlags[1]&0x00100000)
+ {
+ damage+=int32(m_caster->GetShieldBlockValue());
}
break;
}
@@ -659,7 +726,7 @@ void Spell::EffectDummy(uint32 i)
if (!creatureTarget || !pGameObj) return;
- if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, creatureTarget->GetMap(),
+ if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, creatureTarget->GetMap(), creatureTarget->GetPhaseMask(),
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, 1))
{
@@ -767,12 +834,6 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastCustomSpell(unitTarget, 12721, &deepWoundsDotBasePoints0, NULL, NULL, true, NULL);
return;
}
- case 12975: //Last Stand
- {
- int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth()*0.3);
- m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
- return;
- }
case 13120: // net-o-matic
{
if(!unitTarget)
@@ -809,30 +870,6 @@ void Spell::EffectDummy(uint32 i)
}
return;
}
- case 14185: // Preparation Rogue
- {
- if(m_caster->GetTypeId()!=TYPEID_PLAYER)
- return;
-
- //immediately finishes the cooldown on certain Rogue abilities
- const PlayerSpellMap& sp_list = ((Player *)m_caster)->GetSpellMap();
- for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
- {
- uint32 classspell = itr->first;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(classspell);
-
- if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & 0x26000000860LL))
- {
- ((Player*)m_caster)->RemoveSpellCooldown(classspell);
-
- WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
- data << uint32(classspell);
- data << uint64(m_caster->GetGUID());
- ((Player*)m_caster)->GetSession()->SendPacket(&data);
- }
- }
- return;
- }
case 15998: // Capture Worg Pup
case 29435: // Capture Female Kaliri Hatchling
{
@@ -897,19 +934,20 @@ void Spell::EffectDummy(uint32 i)
if(creatureTarget->isPet())
return;
+ GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-time(NULL));
+ sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019");
+
creatureTarget->setDeathState(JUST_DIED);
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
- GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-time(NULL));
- sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019\n");
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << uint64(Crystal_Prison->GetGUID());
m_caster->SendMessageToSet(&data,true);
return;
}
- case 23074: // Arc. Dragonling
+ case 23074: // Arcanite Dragonling
if (!m_CastItem) return;
m_caster->CastSpell(m_caster,19804,true,m_CastItem);
return;
@@ -957,7 +995,7 @@ void Spell::EffectDummy(uint32 i)
float flyspeed = m_caster->GetSpeedRate(MOVE_FLIGHT);
float speed = m_caster->GetSpeedRate(MOVE_RUN);
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
//5 different spells used depending on mounted speed and if mount can fly or not
if (flyspeed >= 4.1f)
@@ -983,7 +1021,7 @@ void Spell::EffectDummy(uint32 i)
}
case 28730: // Arcane Torrent (Mana)
{
- Aura * dummy = m_caster->GetDummyAura(28734);
+ Aura * dummy = m_caster->GetAura(28734, m_caster->GetGUID());
if (dummy)
{
int32 bp = damage * dummy->GetStackAmount();
@@ -1021,6 +1059,13 @@ void Spell::EffectDummy(uint32 i)
else // backfire 20%
m_caster->CastSpell(unitTarget, 30504, true, m_CastItem);
return;
+ case 55004: //Nitro Boosts
+ if(!m_CastItem) return;
+ if(roll_chance_i(95)) //success
+ m_caster->CastSpell(m_caster, 54861, true, m_CastItem);
+ else //backfire 5%
+ m_caster->CastSpell(m_caster, 46014, true, m_CastItem);
+ return;
case 33060: // Make a Wish
{
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
@@ -1121,36 +1166,6 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster,42337,true,NULL);
return;
}
- case 37573: //Temporal Phase Modulator
- {
- if(!unitTarget)
- return;
-
- TemporarySummon* tempSummon = dynamic_cast<TemporarySummon*>(unitTarget);
- if(!tempSummon)
- return;
-
- uint32 health = tempSummon->GetHealth();
- const uint32 entry_list[6] = {21821, 21820, 21817};
-
- float x = tempSummon->GetPositionX();
- float y = tempSummon->GetPositionY();
- float z = tempSummon->GetPositionZ();
- float o = tempSummon->GetOrientation();
-
- tempSummon->UnSummon();
-
- Creature* pCreature = m_caster->SummonCreature(entry_list[urand(0, 2)], x, y, z, o,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,180000);
- if (!pCreature)
- return;
-
- pCreature->SetHealth(health);
-
- if(pCreature->IsAIEnabled)
- pCreature->AI()->AttackStart(m_caster);
-
- return;
- }
case 34665: //Administer Antidote
{
if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER )
@@ -1159,7 +1174,7 @@ void Spell::EffectDummy(uint32 i)
if(!unitTarget)
return;
- TemporarySummon* tempSummon = dynamic_cast<TemporarySummon*>(unitTarget);
+ TempSummon* tempSummon = dynamic_cast<TempSummon*>(unitTarget);
if(!tempSummon)
return;
@@ -1176,7 +1191,7 @@ void Spell::EffectDummy(uint32 i)
return;
pCreature->SetHealth(health);
- ((Player*)m_caster)->KilledMonster(16992,pCreature->GetGUID());
+ ((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992,pCreature);
if (pCreature->IsAIEnabled)
pCreature->AI()->AttackStart(m_caster);
@@ -1226,7 +1241,34 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 30452, true, NULL);
return;
- }
+ }
+ case 52308:
+ {
+ switch(i)
+ {
+ case 0:
+ {
+ uint32 spellID = m_spellInfo->CalculateSimpleValue(0);
+ uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(1);
+
+ if (m_caster->HasAuraEffect(reqAuraID,0))
+ m_caster->CastSpell(m_caster,spellID,true,NULL);
+ return;
+ }
+ case 1:
+ return; // additional data for dummy[0]
+ }
+ return;
+ }
+ case 53341:
+ case 53343:
+ {
+ m_caster->CastSpell(m_caster,54586,true);
+ return;
+ }
+ case 58418: // Portal to Orgrimmar
+ case 58420: // Portal to Stormwind
+ return; // implemented in EffectScript[0]
}
//All IconID Check in there
@@ -1300,65 +1342,129 @@ void Spell::EffectDummy(uint32 i)
break;
case SPELLFAMILY_WARRIOR:
// Charge
- if(m_spellInfo->SpellFamilyFlags & 0x1 && m_spellInfo->SpellVisual == 867)
+ if(m_spellInfo->SpellFamilyFlags & 0x1 && m_spellInfo->SpellVisual[0] == 867)
{
int32 chargeBasePoints0 = damage;
m_caster->CastCustomSpell(m_caster,34846,&chargeBasePoints0,NULL,NULL,true);
return;
}
+ //Slam
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x200000 && m_spellInfo->SpellIconID == 559)
+ {
+ int32 bp0 = damage;
+ m_caster->CastCustomSpell(unitTarget, 50783, &bp0, NULL, NULL, true, 0);
+ return;
+ }
// Execute
- if(m_spellInfo->SpellFamilyFlags & 0x20000000)
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x20000000)
{
if(!unitTarget)
return;
+ uint32 rage = m_caster->GetPower(POWER_RAGE);
+ // Glyph of Execution bonus
+ if (AuraEffect *aura = m_caster->GetDummyAura(58367))
+ rage+=aura->GetAmount();
+
spell_id = 20647;
- bp = damage+int32(m_caster->GetPower(POWER_RAGE) * m_spellInfo->DmgMultiplier[i]);
- m_caster->SetPower(POWER_RAGE,0);
+ bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
+ m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
+ // Sudden death cost modifier
+ if (Aura * aur = m_caster->GetAura(52437))
+ {
+ m_caster->ModifyPower(POWER_RAGE,- m_powerCost);
+ if (m_caster->GetPower(POWER_RAGE)<100)
+ m_caster->SetPower(POWER_RAGE,100);
+ m_caster->RemoveAura(aur);
+ }
+ else
+ m_caster->SetPower(POWER_RAGE,0);
break;
}
- if(m_spellInfo->Id==21977) //Warrior's Wrath
+ // Slam
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x200000)
{
if(!unitTarget)
return;
-
- m_caster->CastSpell(unitTarget,21887,true); // spell mod
+ m_damage+=m_caster->CalculateDamage(m_attackType, false);
+ m_damage+=damage;
return;
}
+ switch(m_spellInfo->Id)
+ {
+ // Warrior's Wrath
+ case 21977:
+ {
+ if(!unitTarget)
+ return;
+ m_caster->CastSpell(unitTarget,21887,true); // spell mod
+ return;
+ }
+ // Last Stand
+ case 12975:
+ {
+ int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth()*0.3);
+ m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ return;
+ }
+ // Bloodthirst
+ case 23881:
+ {
+ m_caster->CastCustomSpell(unitTarget, 23885, &damage, NULL, NULL, true, NULL);
+ return;
+ }
+ }
break;
case SPELLFAMILY_WARLOCK:
- //Life Tap (only it have this with dummy effect)
- if (m_spellInfo->SpellFamilyFlags == 0x40000)
+ // Life Tap
+ if (m_spellInfo->SpellFamilyFlags[0] & 0x40000)
{
- float cost = damage;
-
- if(Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, cost,this);
-
- int32 dmg = m_caster->SpellDamageBonus(m_caster, m_spellInfo,uint32(cost > 0 ? cost : 0), SPELL_DIRECT_DAMAGE);
-
- if(int32(m_caster->GetHealth()) > dmg)
+ // In 303 exist spirit depend
+ uint32 spirit = uint32(m_caster->GetStat(STAT_SPIRIT));
+ switch (m_spellInfo->Id)
+ {
+ case 1454: damage+=spirit; break;
+ case 1455: damage+=spirit*15/10; break;
+ case 1456: damage+=spirit*2; break;
+ case 11687: damage+=spirit*25/10; break;
+ case 11688:
+ case 11689:
+ case 27222:
+ case 57946: damage+=spirit*3; break;
+ default:
+ sLog.outError("Spell::EffectDummy: %u Life Tap need set spirit multipler", m_spellInfo->Id);
+ return;
+ }
+// Think its not need (also need remove Life Tap from SpellDamageBonus or add new value)
+// damage = m_caster->SpellDamageBonus(m_caster, m_spellInfo,uint32(damage > 0 ? damage : 0), SPELL_DIRECT_DAMAGE);
+ if(int32(unitTarget->GetHealth()) > damage)
{
// Shouldn't Appear in Combat Log
- m_caster->ModifyHealth(-dmg);
+ unitTarget->ModifyHealth(-damage);
- int32 mana = dmg;
-
- Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
+ int32 mana = damage;
+ // Improved Life Tap mod
+ Unit::AuraEffectList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
{
- // only Imp. Life Tap have this in combination with dummy aura
if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208)
- mana = ((*itr)->GetModifier()->m_amount + 100)* mana / 100;
+ mana = ((*itr)->GetAmount() + 100)* mana / 100;
}
-
- m_caster->CastCustomSpell(m_caster,31818,&mana,NULL,NULL,true,NULL);
+ m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true);
// Mana Feed
- int32 manaFeedVal = m_caster->CalculateSpellDamage(m_spellInfo,1, m_spellInfo->EffectBasePoints[1],m_caster);
- manaFeedVal = manaFeedVal * mana / 100;
+ int32 manaFeedVal = 0;
+ Unit::AuraEffectList const& mod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
+ for(Unit::AuraEffectList::const_iterator itr = mod.begin(); itr != mod.end(); ++itr)
+ {
+ if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982)
+ manaFeedVal+= (*itr)->GetAmount();
+ }
if(manaFeedVal > 0)
- m_caster->CastCustomSpell(m_caster,32553,&manaFeedVal,NULL,NULL,true,NULL);
+ {
+ manaFeedVal = manaFeedVal * mana / 100;
+ m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, NULL, NULL, true, NULL);
+ }
}
else
SendCastResult(SPELL_FAILED_FIZZLE);
@@ -1366,52 +1472,54 @@ void Spell::EffectDummy(uint32 i)
}
break;
case SPELLFAMILY_PRIEST:
- switch(m_spellInfo->Id )
+ // Penance
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00800000)
{
- case 28598: // Touch of Weakness triggered spell
+ if (!unitTarget)
+ return;
+
+ int hurt = 0;
+ int heal = 0;
+ switch(m_spellInfo->Id)
{
- if(!unitTarget || !m_triggeredByAuraSpell)
+ case 47540: hurt = 47758; heal = 47757; break;
+ case 53005: hurt = 53001; heal = 52986; break;
+ case 53006: hurt = 53002; heal = 52987; break;
+ case 53007: hurt = 53003; heal = 52988; break;
+ default:
+ sLog.outError("Spell::EffectDummy: Spell %u Penance need set correct heal/damage spell", m_spellInfo->Id);
return;
-
- uint32 spellid = 0;
- switch(m_triggeredByAuraSpell->Id)
- {
- case 2652: spellid = 2943; break; // Rank 1
- case 19261: spellid = 19249; break; // Rank 2
- case 19262: spellid = 19251; break; // Rank 3
- case 19264: spellid = 19252; break; // Rank 4
- case 19265: spellid = 19253; break; // Rank 5
- case 19266: spellid = 19254; break; // Rank 6
- case 25461: spellid = 25460; break; // Rank 7
- default:
- sLog.outError("Spell::EffectDummy: Spell 28598 triggered by unhandled spell %u",m_triggeredByAuraSpell->Id);
- return;
- }
- m_caster->CastSpell(unitTarget, spellid, true, NULL);
- return;
}
+ if (m_caster->IsFriendlyTo(unitTarget))
+ m_caster->CastSpell(unitTarget, heal, true, 0);
+ else
+ m_caster->CastSpell(unitTarget, hurt, true, 0);
+ return;
}
break;
case SPELLFAMILY_DRUID:
- switch(m_spellInfo->Id )
+ // Starfall
+ if (m_spellInfo->SpellFamilyFlags[2] & 0x100)
{
- case 5420: // Tree of Life passive
+ //Shapeshifting into an animal form or mounting cancels the effect.
+ if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
{
- // Tree of Life area effect
- int32 health_mod = int32(m_caster->GetStat(STAT_SPIRIT)/4);
- m_caster->CastCustomSpell(m_caster,34123,&health_mod,NULL,NULL,true,NULL);
+ if(m_triggeredByAuraSpell)
+ m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id);
return;
}
+
+ //Any effect which causes you to lose control of your character will supress the starfall effect.
+ if(m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
+ return;
+
+ m_caster->CastSpell(unitTarget, damage, true);
+ return;
}
break;
case SPELLFAMILY_ROGUE:
switch(m_spellInfo->Id )
{
- case 31231: // Cheat Death
- {
- m_caster->CastSpell(m_caster,45182,true);
- return;
- }
case 5938: // Shiv
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -1447,36 +1555,38 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(unitTarget, 5940, true);
return;
}
- }
- break;
- case SPELLFAMILY_HUNTER:
- // Kill command
- if(m_spellInfo->SpellFamilyFlags & 0x00080000000000LL)
- {
- if(m_caster->getClass()!=CLASS_HUNTER)
- return;
+ case 14185: // Preparation Rogue
+ {
+ if(m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
- // clear hunter crit aura state
- m_caster->ModifyAuraState(AURA_STATE_HUNTER_CRIT_STRIKE,false);
+ //immediately finishes the cooldown on certain Rogue abilities
+ const PlayerSpellMap& sp_list = ((Player *)m_caster)->GetSpellMap();
+ for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ {
+ uint32 classspell = itr->first;
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(classspell);
- // additional damage from pet to pet target
- Pet* pet = m_caster->GetPet();
- if(!pet || !pet->getVictim())
- return;
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags[1] & 0x00000240 || spellInfo->SpellFamilyFlags[0] & 0x00000860))
+ {
+ ((Player*)m_caster)->RemoveSpellCooldown(classspell);
- uint32 spell_id = 0;
- switch (m_spellInfo->Id)
+ WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
+ data << uint32(classspell);
+ data << uint64(m_caster->GetGUID());
+ ((Player*)m_caster)->GetSession()->SendPacket(&data);
+ }
+ }
+ return;
+ }
+ case 31231: // Cheat Death
{
- case 34026: spell_id = 34027; break; // rank 1
- default:
- sLog.outError("Spell::EffectDummy: Spell %u not handled in KC",m_spellInfo->Id);
+ m_caster->CastSpell(m_caster,45182,true);
return;
}
-
- pet->CastSpell(pet->getVictim(), spell_id, true);
- return;
}
-
+ break;
+ case SPELLFAMILY_HUNTER:
switch(m_spellInfo->Id)
{
case 23989: //Readiness talent
@@ -1519,6 +1629,13 @@ void Spell::EffectDummy(uint32 i)
case SPELLFAMILY_PALADIN:
switch(m_spellInfo->SpellIconID)
{
+ // Divine Storm
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x20000)
+ {
+ int32 damage=m_currentBasePoints[0] * damage /100;
+ m_caster->CastCustomSpell(unitTarget, 54172, &damage , 0, 0, true);
+ return;
+ }
case 156: // Holy Shock
{
if(!unitTarget)
@@ -1534,6 +1651,8 @@ void Spell::EffectDummy(uint32 i)
case 20930: hurt = 25902; heal = 25903; break;
case 27174: hurt = 27176; heal = 27175; break;
case 33072: hurt = 33073; heal = 33074; break;
+ case 48824: hurt = 48822; heal = 48820; break;
+ case 48825: hurt = 48823; heal = 48821; break;
default:
sLog.outError("Spell::EffectDummy: Spell %u not handled in HS",m_spellInfo->Id);
return;
@@ -1546,32 +1665,31 @@ void Spell::EffectDummy(uint32 i)
return;
}
- case 561: // Judgement of command
+ }
+
+ switch(m_spellInfo->Id)
+ {
+ case 20425: // Judgement of command
{
if(!unitTarget)
return;
- uint32 spell_id = m_spellInfo->EffectBasePoints[i]+1;//m_currentBasePoints[i]+1;
- SpellEntry const* spell_proto = sSpellStore.LookupEntry(spell_id);
+ SpellEntry const* spell_proto = sSpellStore.LookupEntry(damage);
if(!spell_proto)
return;
- if( !unitTarget->hasUnitState(UNIT_STAT_STUNNED) && m_caster->GetTypeId()==TYPEID_PLAYER)
+ if(unitTarget->hasUnitState(UNIT_STAT_STUNNED) && m_caster->GetTypeId()==TYPEID_PLAYER)
{
- // decreased damage (/2) for non-stunned target.
+ // always critical for stunned target
SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_DAMAGE;
- mod->value = -50;
- mod->type = SPELLMOD_PCT;
+ mod->op = SPELLMOD_CRITICAL_CHANCE;
+ mod->value = 100;
+ mod->type = SPELLMOD_FLAT;
mod->spellId = m_spellInfo->Id;
- mod->effectId = i;
- mod->lastAffected = NULL;
- mod->mask = 0x0000020000000000LL;
- mod->charges = 0;
+ mod->mask[1] = 0x00000200;
((Player*)m_caster)->AddSpellMod(mod, true);
m_caster->CastSpell(unitTarget,spell_proto,true,NULL);
- // mod deleted
((Player*)m_caster)->AddSpellMod(mod, false);
}
else
@@ -1579,10 +1697,6 @@ void Spell::EffectDummy(uint32 i)
return;
}
- }
-
- switch(m_spellInfo->Id)
- {
case 31789: // Righteous Defense (step 1)
{
// 31989 -> dummy effect (step 1) + dummy effect (step 2) -> 31709 (taunt like spell for each target)
@@ -1649,8 +1763,10 @@ void Spell::EffectDummy(uint32 i)
break;
case SPELLFAMILY_SHAMAN:
//Shaman Rockbiter Weapon
- if (m_spellInfo->SpellFamilyFlags == 0x400000)
+ if (m_spellInfo->SpellFamilyFlags.IsEqual(0x400000))
{
+ // TODO: use expect spell for enchant (if exist talent)
+ // In 3.0.3 no mods present for rockbiter
uint32 spell_id = 0;
switch(m_spellInfo->Id)
{
@@ -1658,11 +1774,6 @@ void Spell::EffectDummy(uint32 i)
case 8018: spell_id = 36750; break; // Rank 2
case 8019: spell_id = 36755; break; // Rank 3
case 10399: spell_id = 36759; break; // Rank 4
- case 16314: spell_id = 36763; break; // Rank 5
- case 16315: spell_id = 36766; break; // Rank 6
- case 16316: spell_id = 36771; break; // Rank 7
- case 25479: spell_id = 36775; break; // Rank 8
- case 25485: spell_id = 36499; break; // Rank 9
default:
sLog.outError("Spell::EffectDummy: Spell %u not handled in RW",m_spellInfo->Id);
return;
@@ -1672,7 +1783,7 @@ void Spell::EffectDummy(uint32 i)
if(!spellInfo)
{
- sLog.outError("WORLD: unknown spell id %i\n", spell_id);
+ sLog.outError("WORLD: unknown spell id %i", spell_id);
return;
}
@@ -1700,18 +1811,83 @@ void Spell::EffectDummy(uint32 i)
}
return;
}
-
- if(m_spellInfo->Id == 39610) // Mana-Tide Totem effect
+ // Healing Stream Totem
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x2000)
+ {
+ m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
+ return;
+ }
+ // Mana Spring Totem
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x4000)
+ {
+ if(unitTarget->getPowerType()!=POWER_MANA)
+ return;
+ m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
+ return;
+ }
+ if(m_spellInfo->Id == 39610) // Mana Tide Totem effect
{
if(!unitTarget || unitTarget->getPowerType() != POWER_MANA)
return;
-
+ // Glyph of Mana Tide
+ Unit *owner = m_caster->GetOwner();
+ if (owner)
+ if (AuraEffect *dummy = owner->GetDummyAura(55441))
+ damage+=dummy->GetAmount();
// Regenerate 6% of Total Mana Every 3 secs
int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100;
m_caster->CastCustomSpell(unitTarget,39609,&EffectBasePoints0,NULL,NULL,true,NULL,NULL,m_originalCasterGUID);
return;
}
+ // Lava Lash
+ if (m_spellInfo->SpellFamilyFlags[2] & 0x00000004)
+ {
+ if (m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
+ Item *item = ((Player*)m_caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ if (item)
+ {
+ if (m_caster->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000))
+ {
+ m_damage += m_damage * damage / 100;
+ }
+ }
+ return;
+ }
+ break;
+ case SPELLFAMILY_DEATHKNIGHT:
+ // Death strike dummy aura apply
+ // Used to proc healing later
+ if (m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
+ {
+ spell_id=45469;
+ m_caster->CastSpell(m_caster,spell_id,true);
+ return;
+ }
+ // Death Coil
+ else if(m_spellInfo->SpellFamilyFlags[0] & 0x002000)
+ {
+ if(m_caster->IsFriendlyTo(unitTarget))
+ {
+ if(unitTarget->GetCreatureType() != CREATURE_TYPE_UNDEAD)
+ return;
+ int32 bp = damage * 1.5f;
+ m_caster->CastCustomSpell(unitTarget,47633,&bp,NULL,NULL,true);
+ }
+ else
+ {
+ int32 bp = damage;
+ m_caster->CastCustomSpell(unitTarget,47632,&bp,NULL,NULL,true);
+ }
+ return;
+ }
+ // Death Grip
+ else if(m_spellInfo->Id == 49560)
+ {
+ unitTarget->CastSpell(m_caster, damage, true);
+ return;
+ }
break;
}
@@ -1739,6 +1915,15 @@ void Spell::EffectDummy(uint32 i)
m_caster->AddPetAura(petSpell);
return;
}
+
+ // Script based implementation. Must be used only for not good for implementation in core spell effects
+ // So called only for not proccessed cases
+ if(gameObjTarget)
+ Script->EffectDummyGameObj(m_caster, m_spellInfo->Id, i, gameObjTarget);
+ else if(unitTarget && unitTarget->GetTypeId()==TYPEID_UNIT)
+ Script->EffectDummyCreature(m_caster, m_spellInfo->Id, i, (Creature*)unitTarget);
+ else if(itemTarget)
+ Script->EffectDummyItem(m_caster, m_spellInfo->Id, i, itemTarget);
}
void Spell::EffectTriggerSpellWithValue(uint32 i)
@@ -1750,7 +1935,7 @@ void Spell::EffectTriggerSpellWithValue(uint32 i)
if(!spellInfo)
{
- sLog.outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id,triggered_spell_id);
+ sLog.outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id);
return;
}
@@ -1776,8 +1961,8 @@ void Spell::EffectTriggerRitualOfSummoning(uint32 i)
targets.setUnitTarget( unitTarget);
spell->prepare(&targets);
- m_caster->SetCurrentCastedSpell(spell);
- spell->m_selfContainer = &(m_caster->m_currentSpells[spell->GetCurrentContainer()]);
+ //m_caster->SetCurrentCastedSpell(spell);
+ //spell->m_selfContainer = &(m_caster->m_currentSpells[spell->GetCurrentContainer()]);
}
@@ -1810,9 +1995,9 @@ void Spell::EffectTriggerSpell(uint32 i)
// Vanish
case 18461:
{
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
- m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_STALKED);
+ m_caster->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
+ m_caster->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
+ m_caster->RemoveAurasByType(SPELL_AURA_MOD_STALKED);
// if this spell is given to NPC it must handle rest by it's own AI
if ( m_caster->GetTypeId() != TYPEID_PLAYER )
@@ -1820,6 +2005,7 @@ void Spell::EffectTriggerSpell(uint32 i)
// get highest rank of the Stealth spell
uint32 spellId = 0;
+ SpellEntry const *spellInfo;
const PlayerSpellMap& sp_list = ((Player*)m_caster)->GetSpellMap();
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
{
@@ -1827,11 +2013,11 @@ void Spell::EffectTriggerSpell(uint32 i)
if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
continue;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
+ spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo)
continue;
- if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_STEALTH)
+ if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_STEALTH)
{
spellId = spellInfo->Id;
break;
@@ -1846,7 +2032,8 @@ void Spell::EffectTriggerSpell(uint32 i)
if(((Player*)m_caster)->HasSpellCooldown(spellId))
((Player*)m_caster)->RemoveSpellCooldown(spellId);
- m_caster->CastSpell(m_caster, spellId, true);
+ // Push stealth to list because it must be handled after combat remove
+ m_TriggerSpells.push_back(spellInfo);
return;
}
// just skip
@@ -1886,7 +2073,7 @@ void Spell::EffectTriggerSpell(uint32 i)
{
uint32 dispelMask = GetDispellMask(DISPEL_ALL);
Unit::AuraMap& Auras = m_caster->GetAuras();
- for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); ++iter)
+ for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end();)
{
// remove all harmful spells on you...
SpellEntry const* spell = iter->second->GetSpellProto();
@@ -1895,16 +2082,17 @@ void Spell::EffectTriggerSpell(uint32 i)
// ignore positive and passive auras
&& !iter->second->IsPositive() && !iter->second->IsPassive())
{
- m_caster->RemoveAurasDueToSpell(spell->Id);
- iter = Auras.begin();
+ m_caster->RemoveAura(iter);
}
+ else
+ iter++;
}
return;
}
// Priest Shadowfiend (34433) need apply mana gain trigger aura on pet
case 41967:
{
- if (Unit *pet = m_caster->GetPet())
+ if (Unit *pet = m_caster->GetGuardianPet())
pet->CastSpell(pet, 28305, true);
return;
}
@@ -1988,12 +2176,65 @@ void Spell::EffectTriggerMissileSpell(uint32 effect_idx)
if (m_CastItem)
DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id);
- Spell *spell = new Spell(m_caster, spellInfo, true, m_originalCasterGUID );
+ m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo->Id, true, m_CastItem, 0, m_originalCasterGUID);
+}
- SpellCastTargets targets;
- targets.setDestination(m_targets.m_destX,m_targets.m_destY,m_targets.m_destZ);
- spell->m_CastItem = m_CastItem;
- spell->prepare(&targets, NULL);
+void Spell::EffectJump(uint32 i)
+{
+ if(m_caster->isInFlight())
+ return;
+
+ // Init dest coordinates
+ float x,y,z,o;
+ if(m_targets.HasDest())
+ {
+ x = m_targets.m_destX;
+ y = m_targets.m_destY;
+ z = m_targets.m_destZ;
+
+ if(m_spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_TARGET_BACK)
+ {
+ // explicit cast data from client or server-side cast
+ // some spell at client send caster
+ Unit* pTarget = NULL;
+ if(m_targets.getUnitTarget() && m_targets.getUnitTarget()!=m_caster)
+ pTarget = m_targets.getUnitTarget();
+ else if(unitTarget->getVictim())
+ pTarget = m_caster->getVictim();
+ else if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());
+
+ o = pTarget ? pTarget->GetOrientation() : m_caster->GetOrientation();
+ }
+ else
+ o = m_caster->GetOrientation();
+ }
+ else if(unitTarget)
+ {
+ unitTarget->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
+ o = m_caster->GetOrientation();
+ }
+ else if(gameObjTarget)
+ {
+ gameObjTarget->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
+ o = m_caster->GetOrientation();
+ }
+ else
+ {
+ sLog.outError( "Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id );
+ return;
+ }
+
+ //m_caster->NearTeleportTo(x,y,z,o,true);
+ float speedZ;
+ if(m_spellInfo->EffectMiscValue[i])
+ speedZ = float(m_spellInfo->EffectMiscValue[i])/10;
+ else if(m_spellInfo->EffectMiscValueB[i])
+ speedZ = float(m_spellInfo->EffectMiscValueB[i])/10;
+ else
+ speedZ = 10.0f;
+ float speedXY = m_caster->GetExactDistance2d(x, y) * 10.0f / speedZ;
+ m_caster->GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ);
}
void Spell::EffectTeleportUnits(uint32 i)
@@ -2007,6 +2248,7 @@ void Spell::EffectTeleportUnits(uint32 i)
sLog.outError( "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id );
return;
}
+
// Init dest coordinates
int32 mapid = m_targets.m_mapId;
if(mapid < 0) mapid = (int32)unitTarget->GetMapId();
@@ -2015,16 +2257,11 @@ void Spell::EffectTeleportUnits(uint32 i)
float z = m_targets.m_destZ;
float orientation = m_targets.getUnitTarget() ? m_targets.getUnitTarget()->GetOrientation() : unitTarget->GetOrientation();
sLog.outDebug("Spell::EffectTeleportUnits - teleport unit to %u %f %f %f\n", mapid, x, y, z);
- // Teleport
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
- else
- {
- MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
- WorldPacket data;
- unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
- unitTarget->SendMessageToSet(&data, false);
- }
+
+ if(mapid == unitTarget->GetMapId())
+ unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster);
+ else if(unitTarget->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, unitTarget==m_caster ? TELE_TO_SPELL : 0);
// post effects for TARGET_TABLE_X_Y_Z_COORDINATES
switch ( m_spellInfo->Id )
@@ -2125,84 +2362,7 @@ void Spell::EffectTeleportUnits(uint32 i)
void Spell::EffectApplyAura(uint32 i)
{
- if(!unitTarget)
- return;
-
- SpellImmuneList const& list = unitTarget->m_spellImmune[IMMUNITY_STATE];
- for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
- if(itr->type == m_spellInfo->EffectApplyAuraName[i])
- return;
-
- // ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
- if( !unitTarget->isAlive() && m_spellInfo->Id != 20584 && m_spellInfo->Id != 8326 &&
- (unitTarget->GetTypeId()!=TYPEID_PLAYER || !((Player*)unitTarget)->GetSession()->PlayerLoading()) )
- return;
-
- Unit* caster = m_originalCasterGUID ? m_originalCaster : m_caster;
- if(!caster)
- return;
-
- sLog.outDebug("Spell: Aura is: %u", m_spellInfo->EffectApplyAuraName[i]);
-
- Aura* Aur = CreateAura(m_spellInfo, i, &damage, unitTarget, caster, m_CastItem);
-
- // Now Reduce spell duration using data received at spell hit
- int32 duration = Aur->GetAuraMaxDuration();
- unitTarget->ApplyDiminishingToDuration(m_diminishGroup,duration,caster,m_diminishLevel);
- Aur->setDiminishGroup(m_diminishGroup);
-
- // if Aura removed and deleted, do not continue.
- if(duration== 0 && !(Aur->IsPermanent()))
- {
- delete Aur;
- return;
- }
-
- if(duration != Aur->GetAuraMaxDuration())
- {
- Aur->SetAuraMaxDuration(duration);
- Aur->SetAuraDuration(duration);
- }
-
- bool added = unitTarget->AddAura(Aur);
-
- // Aura not added and deleted in AddAura call;
- if (!added)
- return;
-
- // found crash at character loading, broken pointer to Aur...
- // Aur was deleted in AddAura()...
- if(!Aur)
- return;
-
- // TODO Make a way so it works for every related spell!
- if(unitTarget->GetTypeId()==TYPEID_PLAYER ||( unitTarget->GetTypeId()==TYPEID_UNIT && ((Creature*)unitTarget)->isPet() ) ) // Negative buff should only be applied on players
- {
- uint32 spellId = 0;
- if(m_spellInfo->CasterAuraStateNot==AURA_STATE_WEAKENED_SOUL || m_spellInfo->TargetAuraStateNot==AURA_STATE_WEAKENED_SOUL)
- spellId = 6788; // Weakened Soul
- else if(m_spellInfo->CasterAuraStateNot==AURA_STATE_FORBEARANCE || m_spellInfo->TargetAuraStateNot==AURA_STATE_FORBEARANCE)
- spellId = 25771; // Forbearance
- else if(m_spellInfo->CasterAuraStateNot==AURA_STATE_HYPOTHERMIA)
- spellId = 41425; // Hypothermia
- else if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages
- spellId = 11196; // Recently Bandaged
- else if( (m_spellInfo->AttributesEx & 0x20) && (m_spellInfo->AttributesEx2 & 0x20000) )
- spellId = 23230; // Blood Fury - Healing Reduction
-
- SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(spellId);
- if (AdditionalSpellInfo)
- {
- // applied at target by target
- Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, 0, NULL, unitTarget,unitTarget, 0);
- unitTarget->AddAura(AdditionalAura);
- sLog.outDebug("Spell: Additional Aura is: %u", AdditionalSpellInfo->EffectApplyAuraName[0]);
- }
- }
-
- // Prayer of Mending (jump animation), we need formal caster instead original for correct animation
- if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & 0x00002000000000LL))
- m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID);
+ return; //handled elsewhere
}
void Spell::EffectUnlearnSpecialization( uint32 i )
@@ -2252,7 +2412,8 @@ void Spell::EffectPowerDrain(uint32 i)
unitTarget->ModifyPower(drain_power,-new_damage);
- if(drain_power == POWER_MANA)
+ // Don`t restore from self drain
+ if(drain_power == POWER_MANA && m_caster != unitTarget)
{
float manaMultiplier = m_spellInfo->EffectMultipleValue[i];
if(manaMultiplier==0)
@@ -2271,60 +2432,9 @@ void Spell::EffectPowerDrain(uint32 i)
void Spell::EffectSendEvent(uint32 EffectIndex)
{
- if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->InBattleGround())
- {
- BattleGround* bg = ((Player *)m_caster)->GetBattleGround();
- if(bg && bg->GetStatus() == STATUS_IN_PROGRESS)
- {
- switch(m_spellInfo->Id)
- {
- case 23333: // Pickup Horde Flag
- /*do not uncomment .
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
- sLog.outDebug("Send Event Horde Flag Picked Up");
- break;
- /* not used :
- case 23334: // Drop Horde Flag
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerDroppedFlag((Player*)m_caster);
- sLog.outDebug("Drop Horde Flag");
- break;
- */
- case 23335: // Pickup Alliance Flag
- /*do not uncomment ... (it will cause crash, because of null targetobject!) anyway this is a bad way to call that event, because it would cause recursion
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
- sLog.outDebug("Send Event Alliance Flag Picked Up");
- break;
- /* not used :
- case 23336: // Drop Alliance Flag
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerDroppedFlag((Player*)m_caster);
- sLog.outDebug("Drop Alliance Flag");
- break;
- case 23385: // Alliance Flag Returns
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
- sLog.outDebug("Alliance Flag Returned");
- break;
- case 23386: // Horde Flag Returns
- if(bg->GetTypeID()==BATTLEGROUND_WS)
- bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
- sLog.outDebug("Horde Flag Returned");
- break;*/
- case 34976:
- /*
- if(bg->GetTypeID()==BATTLEGROUND_EY)
- bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
- */
- break;
- default:
- sLog.outDebug("Unknown spellid %u in BG event", m_spellInfo->Id);
- break;
- }
- }
- }
+ /*
+ we do not handle a flag dropping or clicking on flag in battleground by sendevent system
+ */
sLog.outDebug("Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[EffectIndex], m_spellInfo->Id);
sWorld.ScriptsStart(sEventScripts, m_spellInfo->EffectMiscValue[EffectIndex], m_caster, focusObject);
}
@@ -2345,10 +2455,20 @@ void Spell::EffectPowerBurn(uint32 i)
if(damage < 0)
return;
+ Unit* caster = m_originalCaster ? m_originalCaster : m_caster;
+
+ // burn x% of target's mana, up to maximum of 2x% of caster's mana (Mana Burn)
+ if(m_spellInfo->ManaCostPercentage)
+ {
+ uint32 maxdamage = m_caster->GetMaxPower(powertype) * damage * 2 / 100;
+ damage = unitTarget->GetMaxPower(powertype) * damage / 100;
+ if(damage > maxdamage) damage = maxdamage;
+ }
+
int32 curPower = int32(unitTarget->GetPower(powertype));
- // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
uint32 power = damage;
+ // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
if ( powertype == POWER_MANA && unitTarget->GetTypeId() == TYPEID_PLAYER )
power -= ((Player*)unitTarget)->GetSpellCritDamageReduction(power);
@@ -2390,27 +2510,27 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
{
// Amount of heal - depends from stacked Holy Energy
int damageAmount = 0;
- Unit::AuraList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
+ Unit::AuraEffectList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 45062)
- damageAmount+=(*i)->GetModifierValue();
+ damageAmount+=(*i)->GetAmount();
if (damageAmount)
m_caster->RemoveAurasDueToSpell(45062);
addhealth += damageAmount;
}
// Swiftmend - consumes Regrowth or Rejuvenation
- else if (m_spellInfo->TargetAuraState == AURA_STATE_SWIFTMEND && unitTarget->HasAuraState(AURA_STATE_SWIFTMEND))
+ else if (m_spellInfo->TargetAuraState == AURA_STATE_SWIFTMEND && unitTarget->HasAuraState(AURA_STATE_SWIFTMEND, m_spellInfo, m_caster))
{
- Unit::AuraList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
+ Unit::AuraEffectList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
// find most short by duration
- Aura *targetAura = NULL;
- for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
+ AuraEffect *targetAura = NULL;
+ for(Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
- && ((*i)->GetSpellProto()->SpellFamilyFlags == 0x40 || (*i)->GetSpellProto()->SpellFamilyFlags == 0x10) )
+ && ((*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x40) || (*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x10)) )
{
- if(!targetAura || (*i)->GetAuraDuration() < targetAura->GetAuraDuration())
+ if(!targetAura || (*i)->GetParentAura()->GetAuraDuration() < targetAura->GetParentAura()->GetAuraDuration())
targetAura = *i;
}
}
@@ -2421,29 +2541,43 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
return;
}
- int32 tickheal = targetAura->GetModifierValuePerStack();
+ int32 tickheal = targetAura->GetAmount();
if(Unit* auraCaster = targetAura->GetCaster())
- tickheal = auraCaster->SpellHealingBonus(targetAura->GetSpellProto(), tickheal, DOT, unitTarget);
+ tickheal = auraCaster->SpellHealingBonus(unitTarget, targetAura->GetSpellProto(), tickheal, DOT);
//int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1;
//It is said that talent bonus should not be included
- //int32 tickheal = targetAura->GetModifierValue();
+
int32 tickcount = 0;
if(targetAura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID)
{
- switch(targetAura->GetSpellProto()->SpellFamilyFlags)//TODO: proper spellfamily for 3.0.x
+ switch(targetAura->GetSpellProto()->SpellFamilyFlags[0])
{
case 0x10: tickcount = 4; break; // Rejuvenation
case 0x40: tickcount = 6; break; // Regrowth
}
}
addhealth += tickheal * tickcount;
- unitTarget->RemoveAurasByCasterSpell(targetAura->GetId(), targetAura->GetCasterGUID());
+
+ // Glyph of Swiftmend
+ if(!caster->GetDummyAura(54824))
+ unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID());
//addhealth += tickheal * tickcount;
//addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget);
}
+ // Riptide - increase healing done by Chain Heal
+ else if (m_spellInfo->SpellFamilyName==SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100)
+ {
+ if (AuraEffect * aurEff = unitTarget->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, m_originalCasterGUID))
+ {
+ addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL);
+ addhealth *= 1.25f;
+ // consume aura
+ unitTarget->RemoveAura(aurEff->GetParentAura());
+ }
+ }
else
- addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget);
+ addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL);
m_damage -= addhealth;
}
@@ -2461,6 +2595,9 @@ void Spell::EffectHealPct( uint32 /*i*/ )
return;
uint32 addhealth = unitTarget->GetMaxHealth() * damage / 100;
+ if(Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DAMAGE, addhealth, this);
+
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, false);
int32 gain = unitTarget->ModifyHealth( int32(addhealth) );
@@ -2484,7 +2621,7 @@ void Spell::EffectHealMechanical( uint32 /*i*/ )
if (!caster)
return;
- uint32 addhealth = caster->SpellHealingBonus(m_spellInfo, uint32(damage), HEAL, unitTarget);
+ uint32 addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, uint32(damage), HEAL);
caster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, false);
unitTarget->ModifyHealth( int32(damage) );
}
@@ -2515,7 +2652,7 @@ void Spell::EffectHealthLeech(uint32 i)
if(m_caster->isAlive())
{
- new_damage = m_caster->SpellHealingBonus(m_spellInfo, new_damage, HEAL, m_caster);
+ new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL);
m_caster->ModifyHealth(new_damage);
@@ -2568,8 +2705,8 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
if (num_to_add < 1)
num_to_add = 1;
- if (num_to_add > pProto->Stackable)
- num_to_add = pProto->Stackable;
+ if (num_to_add > pProto->GetMaxStackSize())
+ num_to_add = pProto->GetMaxStackSize();
// init items_count to 1, since 1 item will be created regardless of specialization
int items_count=1;
@@ -2627,7 +2764,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
// we succeeded in creating at least one item, so a levelup is possible
player->UpdateCraftSkill(m_spellInfo->Id);
- }
+ }
}
void Spell::EffectCreateItem(uint32 i)
@@ -2635,9 +2772,24 @@ void Spell::EffectCreateItem(uint32 i)
DoCreateItem(i,m_spellInfo->EffectItemType[i]);
}
+void Spell::EffectCreateItem2(uint32 i)
+{
+ // special case: generate using spell_loot_template
+ if(!m_spellInfo->EffectItemType[i])
+ {
+ if(m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
+
+ // create some random items
+ ((Player*)m_caster)->AutoStoreLoot(m_spellInfo->Id,LootTemplates_Spell);
+ return;
+ }
+ DoCreateItem(i,m_spellInfo->EffectItemType[i]);
+}
+
void Spell::EffectPersistentAA(uint32 i)
{
- float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
@@ -2666,6 +2818,8 @@ void Spell::EffectEnergize(uint32 i)
if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
return;
+ Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
+
// Some level depends spells
int multiplier = 0;
int level_diff = 0;
@@ -2693,11 +2847,18 @@ void Spell::EffectEnergize(uint32 i)
if (level_diff > 0)
damage -= multiplier * level_diff;
+ //Judgement of wisdom energize effect
+ if(m_spellInfo->Id == 20268)
+ {
+ if(unitTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ damage = unitTarget->GetCreateMana() * damage / 100;
+ }
+ }
+
if(damage < 0)
return;
- Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
-
if(unitTarget->GetMaxPower(power) == 0)
return;
@@ -2765,7 +2926,7 @@ void Spell::EffectEnergisePct(uint32 i)
uint32 gain = damage * maxPower / 100;
unitTarget->ModifyPower(power, gain);
- m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, damage, power);
+ m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, gain, power);
}
void Spell::SendLoot(uint64 guid, LootType loottype)
@@ -2853,7 +3014,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
player->SendLoot(guid, loottype);
}
-void Spell::EffectOpenLock(uint32 /*i*/)
+void Spell::EffectOpenLock(uint32 effIndex)
{
if(!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER)
{
@@ -2863,7 +3024,6 @@ void Spell::EffectOpenLock(uint32 /*i*/)
Player* player = (Player*)m_caster;
- LootType loottype = LOOT_CORPSE;
uint32 lockId = 0;
uint64 guid = 0;
@@ -2875,7 +3035,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
if( goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune ||
goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK )
{
- //isAllowUseBattleGroundObject() already called in CanCast()
+ //CanUseBattleGroundObject() already called in CheckCast()
// in battleground check
if(BattleGround *bg = player->GetBattleGround())
{
@@ -2887,7 +3047,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
}
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
{
- //isAllowUseBattleGroundObject() already called in CanCast()
+ //CanUseBattleGroundObject() already called in CheckCast()
// in battleground check
if(BattleGround *bg = player->GetBattleGround())
{
@@ -2914,93 +3074,39 @@ void Spell::EffectOpenLock(uint32 /*i*/)
return;
}
- if(!lockId) // possible case for GO and maybe for items.
- {
- SendLoot(guid, loottype);
- return;
- }
+ SkillType skillId = SKILL_NONE;
+ int32 reqSkillValue = 0;
+ int32 skillValue;
- // Get LockInfo
- LockEntry const *lockInfo = sLockStore.LookupEntry(lockId);
-
- if (!lockInfo)
+ SpellCastResult res = CanOpenLock(effIndex,lockId,skillId,reqSkillValue,skillValue);
+ if(res != SPELL_CAST_OK)
{
- sLog.outError( "Spell::EffectOpenLock: %s [guid = %u] has an unknown lockId: %u!",
- (gameObjTarget ? "gameobject" : "item"), GUID_LOPART(guid), lockId);
- SendCastResult(SPELL_FAILED_BAD_TARGETS);
+ SendCastResult(res);
return;
}
- // check key
- for(int i = 0; i < 5; ++i)
- {
- // type==1 This means lockInfo->key[i] is an item
- if(lockInfo->keytype[i]==LOCK_KEY_ITEM && lockInfo->key[i] && m_CastItem && m_CastItem->GetEntry()==lockInfo->key[i])
- {
- SendLoot(guid, loottype);
- return;
- }
- }
-
- uint32 SkillId = 0;
- // Check and skill-up skill
- if( m_spellInfo->Effect[1] == SPELL_EFFECT_SKILL )
- SkillId = m_spellInfo->EffectMiscValue[1];
- // pickpocketing spells
- else if( m_spellInfo->EffectMiscValue[0] == LOCKTYPE_PICKLOCK )
- SkillId = SKILL_LOCKPICKING;
+ SendLoot(guid, LOOT_SKINNING);
- // skill bonus provided by casting spell (mostly item spells)
- uint32 spellSkillBonus = uint32(damage/*m_currentBasePoints[0]+1*/);
-
- uint32 reqSkillValue = lockInfo->requiredminingskill;
-
- if(lockInfo->requiredlockskill) // required pick lock skill applying
+ // not allow use skill grow at item base open
+ if(!m_CastItem && skillId != SKILL_NONE)
{
- if(SkillId != SKILL_LOCKPICKING) // wrong skill (cheating?)
- {
- SendCastResult(SPELL_FAILED_FIZZLE);
- return;
- }
-
- reqSkillValue = lockInfo->requiredlockskill;
- }
- else if(SkillId == SKILL_LOCKPICKING) // apply picklock skill to wrong target
- {
- SendCastResult(SPELL_FAILED_BAD_TARGETS);
- return;
- }
-
- if ( SkillId )
- {
- loottype = LOOT_SKINNING;
- if ( player->GetSkillValue(SkillId) + spellSkillBonus < reqSkillValue )
- {
- SendCastResult(SPELL_FAILED_LOW_CASTLEVEL);
- return;
- }
-
// update skill if really known
- uint32 SkillValue = player->GetPureSkillValue(SkillId);
- if(SkillValue) // non only item base skill
+ if(uint32 pureSkillValue = player->GetPureSkillValue(skillId))
{
if(gameObjTarget)
{
// Allow one skill-up until respawned
if ( !gameObjTarget->IsInSkillupList( player->GetGUIDLow() ) &&
- player->UpdateGatherSkill(SkillId, SkillValue, reqSkillValue) )
+ player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue) )
gameObjTarget->AddToSkillupList( player->GetGUIDLow() );
}
else if(itemTarget)
{
// Do one skill-up
- uint32 SkillValue = player->GetPureSkillValue(SkillId);
- player->UpdateGatherSkill(SkillId, SkillValue, reqSkillValue);
+ player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue);
}
}
}
-
- SendLoot(guid, loottype);
}
void Spell::EffectSummonChangeItem(uint32 i)
@@ -3126,100 +3232,63 @@ void Spell::EffectProficiency(uint32 /*i*/)
void Spell::EffectApplyAreaAura(uint32 i)
{
- if(!unitTarget)
+ return;
+/* if(!unitTarget)
return;
if(!unitTarget->isAlive())
return;
AreaAura* Aur = new AreaAura(m_spellInfo, i, &damage, unitTarget, m_caster, m_CastItem);
- unitTarget->AddAura(Aur);
+ unitTarget->AddAura(Aur);*/
}
void Spell::EffectSummonType(uint32 i)
{
- switch(m_spellInfo->EffectMiscValueB[i])
- {
- case SUMMON_TYPE_GUARDIAN:
- EffectSummonGuardian(i);
- break;
- case SUMMON_TYPE_POSESSED:
- case SUMMON_TYPE_POSESSED2:
- case SUMMON_TYPE_POSESSED3:
- EffectSummonPossessed(i);
- break;
- case SUMMON_TYPE_WILD:
- EffectSummonWild(i);
- break;
- case SUMMON_TYPE_DEMON:
- EffectSummonDemon(i);
- break;
- case SUMMON_TYPE_SUMMON:
- EffectSummon(i);
- break;
- case SUMMON_TYPE_CRITTER:
- case SUMMON_TYPE_CRITTER2:
- case SUMMON_TYPE_CRITTER3:
- EffectSummonCritter(i);
- break;
- case SUMMON_TYPE_TOTEM_SLOT1:
- case SUMMON_TYPE_TOTEM_SLOT2:
- case SUMMON_TYPE_TOTEM_SLOT3:
- case SUMMON_TYPE_TOTEM_SLOT4:
- case SUMMON_TYPE_TOTEM:
- EffectSummonTotem(i);
- break;
- case SUMMON_TYPE_UNKNOWN1:
- case SUMMON_TYPE_UNKNOWN3:
- case SUMMON_TYPE_UNKNOWN4:
- case SUMMON_TYPE_UNKNOWN5:
- break;
- default:
- sLog.outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[i]);
- break;
- }
-}
-
-void Spell::EffectSummon(uint32 i)
-{
- uint32 pet_entry = m_spellInfo->EffectMiscValue[i];
- if(!pet_entry)
+ uint32 entry = m_spellInfo->EffectMiscValue[i];
+ if(!entry)
return;
- if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER)
+ SummonPropertiesEntry const *properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[i]);
+ if(!properties)
{
- EffectSummonWild(i);
+ sLog.outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[i]);
return;
}
- Player *owner = (Player*)m_originalCaster;
-
- if(owner->GetPetGUID())
- return;
-
- // Summon in dest location
- float x,y,z;
- if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
+ switch(properties->Category)
{
- x = m_targets.m_destX;
- y = m_targets.m_destY;
- z = m_targets.m_destZ;
+ default:
+ switch(properties->Type)
+ {
+ case SUMMON_TYPE_PET:
+ case SUMMON_TYPE_GUARDIAN:
+ case SUMMON_TYPE_MINION:
+ SummonGuardian(entry, properties);
+ break;
+ case SUMMON_TYPE_VEHICLE:
+ SummonVehicle(entry, properties);
+ break;
+ case SUMMON_TYPE_TOTEM:
+ SummonTotem(entry, properties);
+ break;
+ case SUMMON_TYPE_MINIPET:
+ EffectSummonCritter(i);
+ break;
+ default:
+ EffectSummonWild(i);
+ break;
+ }
+ break;
+ case SUMMON_CATEGORY_PET:
+ SummonGuardian(entry, properties);
+ break;
+ case SUMMON_CATEGORY_POSSESSED:
+ SummonPossessed(entry, properties);
+ break;
+ case SUMMON_CATEGORY_VEHICLE:
+ SummonVehicle(entry, properties);
+ break;
}
- else
- m_caster->GetClosePoint(x,y,z,owner->GetObjectSize());
-
- Pet *spawnCreature = owner->SummonPet(pet_entry, x, y, z, m_caster->GetOrientation(), SUMMON_PET, GetSpellDuration(m_spellInfo));
- if(!spawnCreature)
- return;
-
- spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
- spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
-
- std::string name = owner->GetName();
- name.append(petTypeSuffix[spawnCreature->getPetType()]);
- spawnCreature->SetName( name );
-
- spawnCreature->SetReactState( REACT_DEFENSIVE );
}
void Spell::EffectLearnSpell(uint32 i)
@@ -3237,8 +3306,8 @@ void Spell::EffectLearnSpell(uint32 i)
Player *player = (Player*)unitTarget;
- uint32 spellToLearn = (m_spellInfo->Id==SPELL_ID_GENERIC_LEARN) ? damage : m_spellInfo->EffectTriggerSpell[i];
- player->learnSpell(spellToLearn);
+ uint32 spellToLearn = ((m_spellInfo->Id==SPELL_ID_GENERIC_LEARN) || (m_spellInfo->Id==SPELL_ID_GENERIC_LEARN_PET)) ? damage : m_spellInfo->EffectTriggerSpell[i];
+ player->learnSpell(spellToLearn,false);
sLog.outDebug( "Spell: Player %u have learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow() );
}
@@ -3248,8 +3317,7 @@ void Spell::EffectDispel(uint32 i)
if(!unitTarget)
return;
- // Fill possible dispel list
- std::vector <Aura *> dispel_list;
+ std::list < Aura * > dispel_list;
// Create dispel mask by dispel type
uint32 dispel_type = m_spellInfo->EffectMiscValue[i];
@@ -3258,7 +3326,7 @@ void Spell::EffectDispel(uint32 i)
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura *aur = (*itr).second;
- if (aur && (1<<aur->GetSpellProto()->Dispel) & dispelMask)
+ if (aur && ((1<<aur->GetSpellProto()->Dispel) & dispelMask))
{
if(aur->GetSpellProto()->Dispel == DISPEL_MAGIC)
{
@@ -3273,80 +3341,67 @@ void Spell::EffectDispel(uint32 i)
if(positive == unitTarget->IsFriendlyTo(m_caster))
continue;
}
- // Add every aura stack to dispel list
- for(uint32 stack_amount = 0; stack_amount < aur->GetStackAmount(); ++stack_amount)
+ for (uint8 i = aur->GetStackAmount();i!=0;--i)
dispel_list.push_back(aur);
}
}
// Ok if exist some buffs for dispel try dispel it
- if (!dispel_list.empty())
+ if (uint32 list_size = dispel_list.size())
{
- std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
- std::list < uint32 > fail_list; // spell_id
- int32 list_size = dispel_list.size();
+ uint32 failCount = 0;
+ std::list < Aura * > success_list;
+ WorldPacket dataFail(SMSG_DISPEL_FAILED, 8+8+4+4+damage*4);
// dispel N = damage buffs (or while exist buffs for dispel)
- for (int32 count=0; count < damage && list_size > 0; ++count)
+ for (int32 count=0; count < damage && list_size > 0; ++count, list_size = dispel_list.size())
{
// Random select buff for dispel
- Aura *aur = dispel_list[urand(0, list_size-1)];
-
- SpellEntry const* spellInfo = aur->GetSpellProto();
- // Base dispel chance
- // TODO: possible chance depend from spell level??
- int32 miss_chance = 0;
- // Apply dispel mod from aura caster
- if (Unit *caster = aur->GetCaster())
+ std::list < Aura * > ::iterator itr = dispel_list.begin();
+ for (uint32 i=urand(0, list_size-1);i>0;--i)
+ itr++;
+
+ if (GetDispelChance((*itr)->GetCaster(), (*itr)->GetId()))
{
- if ( Player* modOwner = caster->GetSpellModOwner() )
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, this);
+ success_list.push_back(*itr);
+ dispel_list.erase(itr);
}
- // Try dispel
- if (roll_chance_i(miss_chance))
- fail_list.push_back(aur->GetId());
else
- success_list.push_back(std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));
- // Remove buff from list for prevent doubles
- for (std::vector<Aura *>::iterator j = dispel_list.begin(); j != dispel_list.end(); )
{
- Aura *dispelled = *j;
- if (dispelled->GetId() == aur->GetId() && dispelled->GetCasterGUID() == aur->GetCasterGUID())
+ if (!failCount)
{
- j = dispel_list.erase(j);
- --list_size;
- break;
+ // Failed to dispell
+ dataFail << uint64(m_caster->GetGUID()); // Caster GUID
+ dataFail << uint64(unitTarget->GetGUID()); // Victim GUID
+ dataFail << uint32(m_spellInfo->Id); // dispel spell id
}
- else
- ++j;
+ failCount++;
+ dataFail << uint32((*itr)->GetId()); // Spell Id
}
}
- // Send success log and really remove auras
- if (!success_list.empty())
+ if (failCount)
{
- int32 count = success_list.size();
- WorldPacket data(SMSG_SPELLDISPELLOG, 8+8+4+1+4+count*5);
- data.append(unitTarget->GetPackGUID()); // Victim GUID
- data.append(m_caster->GetPackGUID()); // Caster GUID
- data << uint32(m_spellInfo->Id); // dispel spell id
- data << uint8(0); // not used
- data << uint32(count); // count
- for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
+ m_caster->SendMessageToSet(&dataFail, true);
+ }
+ if (success_list.size())
+ {
+ WorldPacket dataSuccess(SMSG_SPELLDISPELLOG, 8+8+4+1+4+damage*5);
+ // Send packet header
+ dataSuccess.append(unitTarget->GetPackGUID()); // Victim GUID
+ dataSuccess.append(m_caster->GetPackGUID()); // Caster GUID
+ dataSuccess << uint32(m_spellInfo->Id); // dispel spell id
+ dataSuccess << uint8(0); // not used
+ dataSuccess << uint32(success_list.size()); // count
+ for (std::list < Aura * > ::iterator itr = success_list.begin();itr!=success_list.end();++itr)
{
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
- data << uint32(spellInfo->Id); // Spell Id
- data << uint8(0); // 0 - dispelled !=0 cleansed
- if(spellInfo->StackAmount!= 0)
- {
- //Why are Aura's Removed by EffIndex? Auras should be removed as a whole.....
- unitTarget->RemoveSingleAuraFromStackByDispel(spellInfo->Id);
- }
- else
- unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster);
- }
- m_caster->SendMessageToSet(&data, true);
+ // Send dispelled spell info
+ dataSuccess << uint32((*itr)->GetId()); // Spell Id
+ dataSuccess << uint8(0); // 0 - dispelled !=0 cleansed
+ unitTarget->RemoveAurasDueToSpellByDispel((*itr)->GetId(), (*itr)->GetCasterGUID(), m_caster);
+ }
+ m_caster->SendMessageToSet(&dataSuccess, true);
// On succes dispel
// Devour Magic
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == 12)
+ if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
{
uint32 heal_spell = 0;
switch (m_spellInfo->Id)
@@ -3357,6 +3412,7 @@ void Spell::EffectDispel(uint32 i)
case 19736: heal_spell = 19735; break;
case 27276: heal_spell = 27278; break;
case 27277: heal_spell = 27279; break;
+ case 48011: heal_spell = 48010; break;
default:
sLog.outDebug("Spell for Devour Magic %d not handled in Spell::EffectDispel", m_spellInfo->Id);
break;
@@ -3365,18 +3421,6 @@ void Spell::EffectDispel(uint32 i)
m_caster->CastSpell(m_caster, heal_spell, true);
}
}
- // Send fail log to client
- if (!fail_list.empty())
- {
- // Failed to dispell
- WorldPacket data(SMSG_DISPEL_FAILED, 8+8+4+4*fail_list.size());
- data << uint64(m_caster->GetGUID()); // Caster GUID
- data << uint64(unitTarget->GetGUID()); // Victim GUID
- data << uint32(m_spellInfo->Id); // dispel spell id
- for (std::list< uint32 >::iterator j = fail_list.begin(); j != fail_list.end(); ++j)
- data << uint32(*j); // Spell Id
- m_caster->SendMessageToSet(&data, true);
- }
}
}
@@ -3418,7 +3462,7 @@ void Spell::EffectDistract(uint32 /*i*/)
// Set creature Distracted, Stop it, And turn it
unitTarget->SetOrientation(angle);
unitTarget->StopMoving();
- unitTarget->GetMotionMaster()->MoveDistract(damage*1000);
+ unitTarget->GetMotionMaster()->MoveDistract(damage*IN_MILISECONDS);
}
}
@@ -3446,8 +3490,7 @@ void Spell::EffectPickPocket(uint32 /*i*/)
{
// Reveal action + get attack
m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
- if (((Creature*)unitTarget)->IsAIEnabled)
- ((Creature*)unitTarget)->AI()->AttackStart(m_caster);
+ m_caster->CombatStart(unitTarget);
}
}
}
@@ -3457,7 +3500,7 @@ void Spell::EffectAddFarsight(uint32 i)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
int32 duration = GetSpellDuration(m_spellInfo);
DynamicObject* dynObj = new DynamicObject;
if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, 4, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
@@ -3473,8 +3516,8 @@ void Spell::EffectAddFarsight(uint32 i)
dynObj->GetMap()->Add(dynObj); //grid will also be loaded
// Need to update visibility of object for client to accept farsight guid
+ ((Player*)m_caster)->SetViewpoint(dynObj, true);
((Player*)m_caster)->UpdateVisibilityOf(dynObj);
- ((Player*)m_caster)->SetFarsightTarget(dynObj);
}
void Spell::EffectSummonWild(uint32 i)
@@ -3499,35 +3542,14 @@ void Spell::EffectSummonWild(uint32 i)
}
}
- // select center of summon position
- float center_x = m_targets.m_destX;
- float center_y = m_targets.m_destY;
- float center_z = m_targets.m_destZ;
-
- float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
int32 amount = damage > 0 ? damage : 1;
for(int32 count = 0; count < amount; ++count)
{
float px, py, pz;
- // If dest location if present
- if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
- {
- // Summon 1 unit in dest location
- if (count == 0)
- {
- px = m_targets.m_destX;
- py = m_targets.m_destY;
- pz = m_targets.m_destZ;
- }
- // Summon in random point all other units if location present
- else
- m_caster->GetRandomPoint(center_x,center_y,center_z,radius,px,py,pz);
- }
- // Summon if dest location not present near caster
- else
- m_caster->GetClosePoint(px,py,pz,3.0f);
+ GetSummonPosition(px, py, pz, radius, count);
int32 duration = GetSpellDuration(m_spellInfo);
@@ -3540,124 +3562,6 @@ void Spell::EffectSummonWild(uint32 i)
}
}
-void Spell::EffectSummonGuardian(uint32 i)
-{
- uint32 pet_entry = m_spellInfo->EffectMiscValue[i];
- if(!pet_entry)
- return;
-
- // Jewelery statue case (totem like)
- if(m_spellInfo->SpellIconID==2056)
- {
- EffectSummonTotem(i);
- return;
- }
-
- Player *caster = NULL;
- if(m_originalCaster)
- {
- if(m_originalCaster->GetTypeId() == TYPEID_PLAYER)
- caster = (Player*)m_originalCaster;
- else if(((Creature*)m_originalCaster)->isTotem())
- caster = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself();
- }
-
- if(!caster)
- {
- EffectSummonWild(i);
- return;
- }
-
- // set timer for unsummon
- int32 duration = GetSpellDuration(m_spellInfo);
-
- // Search old Guardian only for players (if casted spell not have duration or cooldown)
- // FIXME: some guardians have control spell applied and controlled by player and anyway player can't summon in this time
- // so this code hack in fact
- if(duration <= 0 || GetSpellRecoveryTime(m_spellInfo)==0)
- if(caster->HasGuardianWithEntry(pet_entry))
- return; // find old guardian, ignore summon
-
- // in another case summon new
- uint32 level = caster->getLevel();
-
- // level of pet summoned using engineering item based at engineering skill level
- if(m_CastItem)
- {
- ItemPrototype const *proto = m_CastItem->GetProto();
- if(proto && proto->RequiredSkill == SKILL_ENGINERING)
- {
- uint16 skill202 = caster->GetSkillValue(SKILL_ENGINERING);
- if(skill202)
- {
- level = skill202/5;
- }
- }
- }
-
- // select center of summon position
- float center_x = m_targets.m_destX;
- float center_y = m_targets.m_destY;
- float center_z = m_targets.m_destZ;
-
- float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
-
- int32 amount = damage > 0 ? damage : 1;
-
- for(int32 count = 0; count < amount; ++count)
- {
- float px, py, pz;
- // If dest location if present
- if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
- {
- // Summon 1 unit in dest location
- if (count == 0)
- {
- px = m_targets.m_destX;
- py = m_targets.m_destY;
- pz = m_targets.m_destZ;
- }
- // Summon in random point all other units if location present
- else
- m_caster->GetRandomPoint(center_x,center_y,center_z,radius,px,py,pz);
- }
- // Summon if dest location not present near caster
- else
- m_caster->GetClosePoint(px,py,pz,m_caster->GetObjectSize());
-
- Pet *spawnCreature = caster->SummonPet(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(), GUARDIAN_PET, duration);
- if(!spawnCreature)
- return;
-
- spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0);
- spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
- }
-}
-
-void Spell::EffectSummonPossessed(uint32 i)
-{
- uint32 entry = m_spellInfo->EffectMiscValue[i];
- if(!entry)
- return;
-
- if(m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- uint32 level = m_caster->getLevel();
-
- float x, y, z;
- m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
-
- int32 duration = GetSpellDuration(m_spellInfo);
-
- Pet* pet = ((Player*)m_caster)->SummonPet(entry, x, y, z, m_caster->GetOrientation(), POSSESSED_PET, duration);
- if(!pet)
- return;
-
- pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
- pet->SetCharmedOrPossessedBy(m_caster, true);
-}
-
void Spell::EffectTeleUnitsFaceCaster(uint32 i)
{
if(!unitTarget)
@@ -3666,16 +3570,12 @@ void Spell::EffectTeleUnitsFaceCaster(uint32 i)
if(unitTarget->isInFlight())
return;
- uint32 mapid = m_caster->GetMapId();
- float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float dis = m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
float fx,fy,fz;
m_caster->GetClosePoint(fx,fy,fz,unitTarget->GetObjectSize(),dis);
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, -m_caster->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
- else
- m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, fx, fy, fz, -m_caster->GetOrientation());
+ unitTarget->NearTeleportTo(fx,fy,fz,-m_caster->GetOrientation(),unitTarget==m_caster);
}
void Spell::EffectLearnSkill(uint32 i)
@@ -3696,13 +3596,27 @@ void Spell::EffectAddHonor(uint32 /*i*/)
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- sLog.outDebug("SpellEffect::AddHonor called for spell_id %u , that rewards %d honor points to player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow());
-
- // TODO: find formula for honor reward based on player's level!
+ // not scale value for item based reward (/10 value expected)
+ if(m_CastItem)
+ {
+ ((Player*)unitTarget)->RewardHonor(NULL, 1, damage/10);
+ sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),((Player*)unitTarget)->GetGUIDLow());
+ return;
+ }
- // now fixed only for level 70 players:
- if (((Player*)unitTarget)->getLevel() == 70)
+ // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80
+ if( damage <= 50)
+ {
+ uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage);
+ ((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward);
+ sLog.outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, ((Player*)unitTarget)->GetGUIDLow());
+ }
+ else
+ {
+ //maybe we have correct honor_gain in damage already
((Player*)unitTarget)->RewardHonor(NULL, 1, damage);
+ sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow());
+ }
}
void Spell::EffectTradeSkill(uint32 /*i*/)
@@ -3714,7 +3628,7 @@ void Spell::EffectTradeSkill(uint32 /*i*/)
// ((Player*)unitTarget)->SetSkill(skillid,skillval?skillval:1,skillmax+75);
}
-void Spell::EffectEnchantItemPerm(uint32 i)
+void Spell::EffectEnchantItemPerm(uint32 effect_idx)
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
return;
@@ -3723,37 +3637,95 @@ void Spell::EffectEnchantItemPerm(uint32 i)
Player* p_caster = (Player*)m_caster;
+ // not grow at item use at item case
p_caster->UpdateCraftSkill(m_spellInfo->Id);
- if (m_spellInfo->EffectMiscValue[i])
+ uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
+ if (!enchant_id)
+ return;
+
+ SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+ if(!pEnchant)
+ return;
+
+ // item can be in trade slot and have owner diff. from caster
+ Player* item_owner = itemTarget->GetOwner();
+ if(!item_owner)
+ return;
+
+ if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
{
- uint32 enchant_id = m_spellInfo->EffectMiscValue[i];
+ sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
+ p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
+ itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
+ item_owner->GetName(),item_owner->GetSession()->GetAccountId());
+ }
- SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
- if(!pEnchant)
- return;
+ // remove old enchanting before applying new if equipped
+ item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false);
- // item can be in trade slot and have owner diff. from caster
- Player* item_owner = itemTarget->GetOwner();
- if(!item_owner)
- return;
+ itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0);
+
+ // add new enchanting if equipped
+ item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
+}
+
+void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+ if (!itemTarget)
+ return;
- if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
+ Player* p_caster = (Player*)m_caster;
+
+ uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
+ if (!enchant_id)
+ return;
+
+ SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
+ if(!pEnchant)
+ return;
+
+ // support only enchantings with add socket in this slot
+ {
+ bool add_socket = false;
+ for(int i = 0; i < 3; ++i)
+ {
+ if(pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
+ {
+ add_socket = true;
+ break;
+ }
+ }
+ if(!add_socket)
{
- sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
- p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
- itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
- item_owner->GetName(),item_owner->GetSession()->GetAccountId());
+ sLog.outError("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.",
+ m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
+ return;
}
+ }
- // remove old enchanting before applying new if equipped
- item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false);
-
- itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0);
+ // item can be in trade slot and have owner diff. from caster
+ Player* item_owner = itemTarget->GetOwner();
+ if(!item_owner)
+ return;
- // add new enchanting if equipped
- item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
+ if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
+ {
+ sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
+ p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
+ itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
+ item_owner->GetName(),item_owner->GetSession()->GetAccountId());
}
+
+ // remove old enchanting before applying new if equipped
+ item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,false);
+
+ itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0);
+
+ // add new enchanting if equipped
+ item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,true);
}
void Spell::EffectEnchantItemTmp(uint32 i)
@@ -3848,13 +3820,13 @@ void Spell::EffectEnchantItemTmp(uint32 i)
else if(m_spellInfo->SpellFamilyName==SPELLFAMILY_SHAMAN)
duration = 1800; // 30 mins
// other cases with this SpellVisual already selected
- else if(m_spellInfo->SpellVisual==215)
+ else if(m_spellInfo->SpellVisual[0]==215)
duration = 1800; // 30 mins
// some fishing pole bonuses
- else if(m_spellInfo->SpellVisual==563)
+ else if(m_spellInfo->SpellVisual[0]==563)
duration = 600; // 10 mins
// shaman rockbiter enchantments
- else if(m_spellInfo->SpellVisual==0)
+ else if(m_spellInfo->SpellVisual[0]==0)
duration = 1800; // 30 mins
else if(m_spellInfo->Id==29702)
duration = 300; // 5 mins
@@ -3917,17 +3889,19 @@ void Spell::EffectTameCreature(uint32 /*i*/)
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
+ uint32 level = (creatureTarget->getLevel() < (m_caster->getLevel() - 5)) ? (m_caster->getLevel() - 5) : creatureTarget->getLevel();
+
// prepare visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1);
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);
// add to world
pet->GetMap()->Add((Creature*)pet);
// visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel());
+ pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);
// caster have pet now
- m_caster->SetPet(pet);
+ m_caster->SetGuardian(pet, true);
if(m_caster->GetTypeId() == TYPEID_PLAYER)
{
@@ -3947,14 +3921,16 @@ void Spell::EffectSummonPet(uint32 i)
owner = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself();
}
+ uint32 petentry = m_spellInfo->EffectMiscValue[i];
+
if(!owner)
{
- EffectSummonWild(i);
+ SummonPropertiesEntry const *properties = sSummonPropertiesStore.LookupEntry(67);
+ if(properties)
+ SummonGuardian(petentry, properties);
return;
}
- uint32 petentry = m_spellInfo->EffectMiscValue[i];
-
Pet *OldSummon = owner->GetPet();
// if pet requested type already exist
@@ -3993,7 +3969,7 @@ void Spell::EffectSummonPet(uint32 i)
Pet* pet = owner->SummonPet(petentry, x, y, z, owner->GetOrientation(), SUMMON_PET, 0);
if(!pet)
return;
-
+
if(m_caster->GetTypeId() == TYPEID_UNIT)
{
if ( ((Creature*)m_caster)->isTotem() )
@@ -4005,9 +3981,12 @@ void Spell::EffectSummonPet(uint32 i)
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
- pet->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ pet->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
+
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
+ pet->InitTalentForLevel();
// generate new name for summon pet
std::string new_name=objmgr.GeneratePetName(petentry);
if(!new_name.empty())
@@ -4031,7 +4010,6 @@ void Spell::EffectLearnPetSpell(uint32 i)
if(!learn_spellproto)
return;
- pet->SetTP(pet->m_TrainingPoints - pet->GetTPForSpell(learn_spellproto->Id));
pet->learnSpell(learn_spellproto->Id);
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
@@ -4085,7 +4063,6 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
}
// some spell specific modifiers
- //float weaponDamagePercentMod = 1.0f; // applied to weapon damage (and to fixed effect damage bonus if customBonusDamagePercentMod not set
float totalDamagePercentMod = 1.0f; // applied to final bonus+weapon damage
int32 fixed_bonus = 0;
int32 spell_bonus = 0; // bonus specific for spell
@@ -4095,23 +4072,18 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
case SPELLFAMILY_WARRIOR:
{
// Devastate bonus and sunder armor refresh
- if(m_spellInfo->SpellVisual == 671 && m_spellInfo->SpellIconID == 1508)
+ if(m_spellInfo->SpellFamilyFlags[1] & 0x40)
{
+ if (m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
+ SpellEntry const *spellInfo = NULL;
uint32 stack = 0;
- Unit::AuraList const& list = unitTarget->GetAurasByType(SPELL_AURA_MOD_RESISTANCE);
- for(Unit::AuraList::const_iterator itr=list.begin();itr!=list.end();++itr)
+ if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_MOD_RESISTANCE,SPELLFAMILY_WARRIOR,SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR, 0, 0, m_caster->GetGUID()))
{
- SpellEntry const *proto = (*itr)->GetSpellProto();
- if(proto->SpellFamilyName == SPELLFAMILY_WARRIOR
- && proto->SpellFamilyFlags == SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR)
- {
- int32 duration = GetSpellDuration(proto);
- (*itr)->SetAuraDuration(duration);
- (*itr)->UpdateAuraDuration();
- stack = (*itr)->GetStackAmount();
- break;
- }
+ aur->GetParentAura()->RefreshAura();
+ spellInfo = aur->GetSpellProto();
+ stack = aur->GetParentAura()->GetStackAmount();
}
for(int j = 0; j < 3; j++)
@@ -4123,7 +4095,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
}
}
- if(stack < 5)
+ if(!spellInfo)
{
// get highest rank of the Sunder Armor spell
const PlayerSpellMap& sp_list = ((Player*)m_caster)->GetSpellMap();
@@ -4133,66 +4105,97 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
continue;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if (!spellInfo)
+ SpellEntry const *spellProto = sSpellStore.LookupEntry(itr->first);
+ if (!spellProto)
continue;
- if (spellInfo->SpellFamilyFlags == SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR
- && spellInfo->Id != m_spellInfo->Id
- && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR)
+ if (spellProto->SpellFamilyFlags[0] & SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR
+ && spellProto->Id != m_spellInfo->Id
+ && spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR)
{
- m_caster->CastSpell(unitTarget, spellInfo, true);
+ spellInfo = spellProto;
break;
}
}
}
+ if (!spellInfo)
+ break;
+ m_caster->CastSpell(unitTarget, spellInfo, true);
+ if (stack)
+ spell_bonus += stack * CalculateDamage(2, unitTarget);
}
break;
}
case SPELLFAMILY_ROGUE:
{
// Hemorrhage
- if(m_spellInfo->SpellFamilyFlags & 0x2000000)
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x2000000)
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
+ // Fan of Knives
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x40000)
+ {
+ // 50% more damage with daggers
+ if (Item* item = ((Player*)m_caster)->GetWeaponForAttack(m_attackType))
+ if (item->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
+ totalDamagePercentMod *= 1.5f;
+ }
// Mutilate (for each hand)
- else if(m_spellInfo->SpellFamilyFlags & 0x600000000LL)
+ else if(m_spellInfo->SpellFamilyFlags[1] & 0x6)
{
- Unit::AuraMap const& auras = unitTarget->GetAuras();
- for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
+ bool found = false;
+ // fast check
+ if(unitTarget->HasAuraState(AURA_STATE_DEADLY_POISON, m_spellInfo, m_caster))
+ found = true;
+ // full aura scan
+ else
{
- if(itr->second->GetSpellProto()->Dispel == DISPEL_POISON)
+ Unit::AuraMap const& auras = unitTarget->GetAuras();
+ for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
- totalDamagePercentMod *= 1.5f; // 150% if poisoned
- break;
+ if(itr->second->GetSpellProto()->Dispel == DISPEL_POISON)
+ {
+ found = true;
+ break;
+ }
}
}
+
+ if(found)
+ totalDamagePercentMod *= 1.2f; // 120% if poisoned
}
break;
}
case SPELLFAMILY_PALADIN:
{
// Seal of Command - receive benefit from Spell Damage and Healing
- if(m_spellInfo->SpellFamilyFlags & 0x00000002000000LL)
+ if(m_spellInfo->SpellFamilyFlags[0] & 0x2000000)
{
- spell_bonus += int32(0.20f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
+ spell_bonus += int32(0.23f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
spell_bonus += int32(0.29f*m_caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellInfo), unitTarget));
}
+
+ // Seal of Command Unleashed
+ else if(m_spellInfo->Id==20467)
+ {
+ spell_bonus += int32(0.16f*m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
+ spell_bonus += int32(0.25f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
+ }
break;
}
case SPELLFAMILY_SHAMAN:
{
// Skyshatter Harness item set bonus
// Stormstrike
- if(m_spellInfo->SpellFamilyFlags & 0x001000000000LL)
+ if(m_spellInfo->SpellFamilyFlags[1] & 0x0010)
{
- Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
+ Unit::AuraEffectList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(Unit::AuraEffectList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
{
// Stormstrike AP Buff
- if ( (*i)->GetModifier()->m_miscvalue == 5634 )
+ if ( (*i)->GetMiscValue() == 5634 )
{
m_caster->CastSpell(m_caster,38430,true,NULL,*i);
break;
@@ -4204,7 +4207,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
case SPELLFAMILY_DRUID:
{
// Mangle (Cat): CP
- if(m_spellInfo->SpellFamilyFlags==0x0000040000000000LL)
+ if(m_spellInfo->SpellFamilyFlags.IsEqual(0,0x00000400))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget,1);
@@ -4229,6 +4232,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
break;
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
weaponDamagePercentMod *= float(CalculateDamage(j,unitTarget)) / 100.0f;
+ break;
default:
break; // not weapon damage effect, just skip
}
@@ -4289,33 +4293,6 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
// Add melee damage bonuses (also check for negative)
m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo);
m_damage+= eff_damage;
-
- // take ammo
- if(m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER)
- {
- Item *pItem = ((Player*)m_caster)->GetWeaponForAttack( RANGED_ATTACK );
-
- // wands don't have ammo
- if(!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_WAND)
- return;
-
- if( pItem->GetProto()->InventoryType == INVTYPE_THROWN )
- {
- if(pItem->GetMaxStackCount()==1)
- {
- // decrease durability for non-stackable throw weapon
- ((Player*)m_caster)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
- }
- else
- {
- // decrease items amount for stackable throw weapon
- uint32 count = 1;
- ((Player*)m_caster)->DestroyItemCount( pItem, count, true);
- }
- }
- else if(uint32 ammo = ((Player*)m_caster)->GetUInt32Value(PLAYER_AMMO_ID))
- ((Player*)m_caster)->DestroyItemCount(ammo, 1, true);
- }
}
void Spell::EffectThreat(uint32 /*i*/)
@@ -4360,7 +4337,7 @@ void Spell::EffectInterruptCast(uint32 i)
{
if(m_originalCaster)
{
- int32 duration = m_originalCaster->CalculateSpellDuration(m_spellInfo, i, unitTarget);
+ int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false);
unitTarget->ProhibitSpellScholl(GetSpellSchoolMask(unitTarget->m_currentSpells[i]->m_spellInfo), duration/*GetSpellDuration(m_spellInfo)*/);
}
unitTarget->InterruptSpell(i,false);
@@ -4392,14 +4369,14 @@ void Spell::EffectSummonObjectWild(uint32 i)
Map *map = target->GetMap();
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
- x, y, z, target->GetOrientation(), 0, 0, 0, 0, 100, 1))
+ m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
{
delete pGameObj;
return;
}
int32 duration = GetSpellDuration(m_spellInfo);
- pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
pGameObj->SetSpellId(m_spellInfo->Id);
if(pGameObj->GetGoType() != GAMEOBJECT_TYPE_FLAGDROP) // make dropped flag clickable for other players (not set owner guid (created by) for this)...
@@ -4440,9 +4417,9 @@ void Spell::EffectSummonObjectWild(uint32 i)
{
GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
- x, y, z, target->GetOrientation(), 0, 0, 0, 0, 100, 1))
+ m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
{
- linkedGO->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
linkedGO->SetSpellId(m_spellInfo->Id);
m_caster->AddGameObject(linkedGO);
@@ -4461,441 +4438,638 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{
// TODO: we must implement hunter pet summon at login there (spell 6962)
- // by spell id
- switch(m_spellInfo->Id)
+ switch(m_spellInfo->SpellFamilyName)
{
- // PX-238 Winter Wondervolt TRAP
- case 26275:
+ case SPELLFAMILY_GENERIC:
{
- if( unitTarget->HasAura(26272,0)
- || unitTarget->HasAura(26157,0)
- || unitTarget->HasAura(26273,0)
- || unitTarget->HasAura(26274,0))
- return;
+ switch(m_spellInfo->Id)
+ {
+ // PX-238 Winter Wondervolt TRAP
+ case 26275:
+ {
+ uint32 spells[4] = { 26272, 26157, 26273, 26274 };
- uint32 iTmpSpellId;
+ // check presence
+ for(int j = 0; j < 4; ++j)
+ if(unitTarget->HasAuraEffect(spells[j],0))
+ return;
- switch(urand(0,3))
- {
- case 0:
- iTmpSpellId = 26272;
- break;
- case 1:
- iTmpSpellId = 26157;
- break;
- case 2:
- iTmpSpellId = 26273;
- break;
- case 3:
- iTmpSpellId = 26274;
- break;
- }
+ // select spell
+ uint32 iTmpSpellId = spells[urand(0,3)];
- unitTarget->CastSpell(unitTarget, iTmpSpellId, true);
+ // cast
+ unitTarget->CastSpell(unitTarget, iTmpSpellId, true);
+ return;
+ }
+ // Bending Shinbone
+ case 8856:
+ {
+ if(!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
- return;
- }
+ uint32 spell_id = 0;
+ switch(urand(1,5))
+ {
+ case 1: spell_id = 8854; break;
+ default: spell_id = 8855; break;
+ }
- // Bending Shinbone
- case 8856:
- {
- if(!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)
- return;
+ m_caster->CastSpell(m_caster,spell_id,true,NULL);
+ return;
+ }
+ // Brittle Armor - need remove one 24575 Brittle Armor aura
+ case 24590:
+ unitTarget->RemoveAuraFromStack(24575);
+ return;
+ // Mercurial Shield - need remove one 26464 Mercurial Shield aura
+ case 26465:
+ unitTarget->RemoveAuraFromStack(26464);
+ return;
+ // Orb teleport spells
+ case 25140:
+ case 25143:
+ case 25650:
+ case 25652:
+ case 29128:
+ case 29129:
+ case 35376:
+ case 35727:
+ {
+ if(!unitTarget)
+ return;
- uint32 spell_id = 0;
- switch(urand(1,5))
- {
- case 1: spell_id = 8854; break;
- default: spell_id = 8855; break;
- }
+ uint32 spellid;
+ switch(m_spellInfo->Id)
+ {
+ case 25140: spellid = 32571; break;
+ case 25143: spellid = 32572; break;
+ case 25650: spellid = 30140; break;
+ case 25652: spellid = 30141; break;
+ case 29128: spellid = 32568; break;
+ case 29129: spellid = 32569; break;
+ case 35376: spellid = 25649; break;
+ case 35727: spellid = 35730; break;
+ default:
+ return;
+ }
- m_caster->CastSpell(m_caster,spell_id,true,NULL);
- return;
- }
+ unitTarget->CastSpell(unitTarget,spellid,false);
+ return;
+ }
+ // Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
+ case 22539:
+ case 22972:
+ case 22975:
+ case 22976:
+ case 22977:
+ case 22978:
+ case 22979:
+ case 22980:
+ case 22981:
+ case 22982:
+ case 22983:
+ case 22984:
+ case 22985:
+ {
+ if(!unitTarget || !unitTarget->isAlive())
+ return;
- // Healthstone creating spells
- case 6201:
- case 6202:
- case 5699:
- case 11729:
- case 11730:
- case 27230:
- {
- uint32 itemtype;
- uint32 rank = 0;
- Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
- {
- if((*i)->GetId() == 18692)
+ // Onyxia Scale Cloak
+ if(unitTarget->GetDummyAura(22683))
+ return;
+
+ // Shadow Flame
+ m_caster->CastSpell(unitTarget, 22682, true);
+ return;
+ }
+ // Summon Black Qiraji Battle Tank
+ case 26656:
+ {
+ if(!unitTarget)
+ return;
+
+ // Prevent stacking of mounts
+ unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
+
+ // Two separate mounts depending on area id (allows use both in and out of specific instance)
+ if (unitTarget->GetAreaId() == 3428)
+ unitTarget->CastSpell(unitTarget, 25863, false);
+ else
+ unitTarget->CastSpell(unitTarget, 26655, false);
+ return;
+ }
+ // Piccolo of the Flaming Fire
+ case 17512:
{
- rank = 1;
+ if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ return;
+ unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
+ return;
+ }
+ // Escape artist
+ case 20589:
+ {
+ if(!unitTarget)
+ return;
+ // It is said that removing effects by script should include dispel resist mods
+ unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_ROOT, this);
+ unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this);
+ return;
+ }
+ // Mirren's Drinking Hat
+ case 29830:
+ {
+ uint32 item = 0;
+ switch ( urand(1,6) )
+ {
+ case 1:case 2:case 3:
+ item = 23584;break; // Loch Modan Lager
+ case 4:case 5:
+ item = 23585;break; // Stouthammer Lite
+ case 6:
+ item = 23586;break; // Aerie Peak Pale Ale
+ }
+ if (item)
+ DoCreateItem(effIndex,item);
break;
}
- else if((*i)->GetId() == 18693)
+ // Improved Sprint
+ case 30918:
{
- rank = 2;
+ // Removes snares and roots.
+ uint32 mechanic_mask = (1<<MECHANIC_ROOT) | (1<<MECHANIC_SNARE);
+ Unit::AuraMap& Auras = unitTarget->GetAuras();
+ for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end();)
+ {
+ Aura *aur = iter->second;
+ if (!aur->IsPositive()) //only remove negative spells
+ {
+ // check for mechanic mask
+ if(GetAllSpellMechanicMask(aur->GetSpellProto()) & mechanic_mask)
+ {
+ unitTarget->RemoveAura(iter);
+ }
+ else
+ iter++;
+ }
+ else
+ iter++;
+ }
break;
}
- }
+ /*// Flame Crash
+ case 41126:
+ {
+ if(!unitTarget)
+ return;
- static uint32 const itypes[6][3] = {
- { 5512,19004,19005}, // Minor Healthstone
- { 5511,19006,19007}, // Lesser Healthstone
- { 5509,19008,19009}, // Healthstone
- { 5510,19010,19011}, // Greater Healthstone
- { 9421,19012,19013}, // Major Healthstone
- {22103,22104,22105} // Master Healthstone
- };
+ unitTarget->CastSpell(unitTarget, 41131, true);
+ break;
+ }*/
+ // Draw Soul
+ case 40904:
+ {
+ if(!unitTarget)
+ return;
- switch(m_spellInfo->Id)
- {
- case 6201: itemtype=itypes[0][rank];break; // Minor Healthstone
- case 6202: itemtype=itypes[1][rank];break; // Lesser Healthstone
- case 5699: itemtype=itypes[2][rank];break; // Healthstone
- case 11729: itemtype=itypes[3][rank];break; // Greater Healthstone
- case 11730: itemtype=itypes[4][rank];break; // Major Healthstone
- case 27230: itemtype=itypes[5][rank];break; // Master Healthstone
- default:
- return;
- }
- DoCreateItem( effIndex, itemtype );
- return;
- }
- // Brittle Armor - need remove one 24575 Brittle Armor aura
- case 24590:
- unitTarget->RemoveSingleAuraFromStack(24575, 0);
- unitTarget->RemoveSingleAuraFromStack(24575, 1);
- return;
- // Mercurial Shield - need remove one 26464 Mercurial Shield aura
- case 26465:
- unitTarget->RemoveSingleAuraFromStack(26464, 0);
- return;
- // Orb teleport spells
- case 25140:
- case 25143:
- case 25650:
- case 25652:
- case 29128:
- case 29129:
- case 35376:
- case 35727:
- {
- if(!unitTarget)
- return;
+ unitTarget->CastSpell(m_caster, 40903, true);
+ break;
+ }
+ case 48025: // Headless Horseman's Mount
+ {
+ if(!unitTarget)
+ return;
- uint32 spellid;
- switch(m_spellInfo->Id)
- {
- case 25140: spellid = 32571; break;
- case 25143: spellid = 32572; break;
- case 25650: spellid = 30140; break;
- case 25652: spellid = 30141; break;
- case 29128: spellid = 32568; break;
- case 29129: spellid = 32569; break;
- case 35376: spellid = 25649; break;
- case 35727: spellid = 35730; break;
- default:
- return;
- }
+ switch(((Player*)unitTarget)->GetBaseSkillValue(762))
+ {
+ case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;;
+ case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
+ case 225: unitTarget->CastSpell(unitTarget, 51617, true); break;
+ case 300: unitTarget->CastSpell(unitTarget, 48023, true); break;
+ default: break;
+ }
+ break;
+ }
+ case 47977: // Magic Broom
+ {
+ if(!unitTarget)
+ return;
- unitTarget->CastSpell(unitTarget,spellid,false);
- return;
- }
+ if(unitTarget)
+ {
+ switch(((Player*)unitTarget)->GetBaseSkillValue(762))
+ {
+ case 75: unitTarget->CastSpell(unitTarget, 42680, true); break;;
+ case 150: case 225: case 300: unitTarget->CastSpell(unitTarget, 42683, true); break;
+ default: break;
+ }
+ }
+ break;
+ }
+ case 41931:
+ {
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
- // Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
- case 22539:
- case 22972:
- case 22975:
- case 22976:
- case 22977:
- case 22978:
- case 22979:
- case 22980:
- case 22981:
- case 22982:
- case 22983:
- case 22984:
- case 22985:
- {
- if(!unitTarget || !unitTarget->isAlive())
- return;
+ int bag=19;
+ int slot=0;
+ Item* item = NULL;
- // Onyxia Scale Cloak
- if(unitTarget->GetDummyAura(22683))
- return;
+ while (bag < 256)
+ {
+ item = ((Player*)m_caster)->GetItemByPos(bag,slot);
+ if (item && item->GetEntry() == 38587) break;
+ slot++;
+ if (slot == 39)
+ {
+ slot = 0;
+ bag++;
+ }
+ }
+ if (bag < 256)
+ {
+ if (((Player*)m_caster)->GetItemByPos(bag,slot)->GetCount() == 1) ((Player*)m_caster)->RemoveItem(bag,slot,true);
+ else ((Player*)m_caster)->GetItemByPos(bag,slot)->SetCount(((Player*)m_caster)->GetItemByPos(bag,slot)->GetCount()-1);
+ // Spell 42518 (Braufest - Gratisprobe des Braufest herstellen)
+ m_caster->CastSpell(m_caster,42518,true);
+ return;
+ }
+ break;
+ }
+ // Force Cast - Portal Effect: Sunwell Isle
+ case 44876:
+ {
+ if(!unitTarget)
+ return;
- // Shadow Flame
- m_caster->CastSpell(unitTarget, 22682, true);
- return;
- }
- break;
+ unitTarget->CastSpell(unitTarget, 44870, true);
+ break;
+ }
+ // Goblin Weather Machine
+ case 46203:
+ {
+ if(!unitTarget)
+ return;
- // Summon Black Qiraji Battle Tank
- case 26656:
- {
- if(!unitTarget)
- return;
+ uint32 spellId;
+ switch(rand()%4)
+ {
+ case 0: spellId = 46740; break;
+ case 1: spellId = 46739; break;
+ case 2: spellId = 46738; break;
+ case 3: spellId = 46736; break;
+ }
+ unitTarget->CastSpell(unitTarget, spellId, true);
+ break;
+ }
+ //5,000 Gold
+ case 46642:
+ {
+ if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+ return;
- // Prevent stacking of mounts
- unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
+ ((Player*)unitTarget)->ModifyMoney(50000000);
- // Two separate mounts depending on area id (allows use both in and out of specific instance)
- if (unitTarget->GetAreaId() == 3428)
- unitTarget->CastSpell(unitTarget, 25863, false);
- else
- unitTarget->CastSpell(unitTarget, 26655, false);
- break;
- }
- // Piccolo of the Flaming Fire
- case 17512:
- {
- if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
- unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
- break;
- }
- // Netherbloom
- case 28702:
- {
- if(!unitTarget)
- return;
- // 25% chance of casting a random buff
- if(roll_chance_i(75))
- return;
+ break;
+ }
+ // Emblazon Runeblade
+ case 51770:
+ {
+ if(!m_originalCaster)
+ return;
+
+ m_originalCaster->CastSpell(m_originalCaster, damage, false);
+ break;
+ }
+ // Death Gate
+ case 52751:
+ {
+ if(!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT)
+ return;
+ // triggered spell is stored in m_spellInfo->EffectBasePoints[0]
+ unitTarget->CastSpell(unitTarget, damage, false);
+ break;
+ }
+ case 58418: // Portal to Orgrimmar
+ case 58420: // Portal to Stormwind
+ {
+ if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex!=0)
+ return;
+
+ uint32 spellID = m_spellInfo->CalculateSimpleValue(0);
+ uint32 questID = m_spellInfo->CalculateSimpleValue(1);
- // triggered spells are 28703 to 28707
- // Note: some sources say, that there was the possibility of
- // receiving a debuff. However, this seems to be removed by a patch.
- const uint32 spellid = 28703;
+ if( ((Player*)unitTarget)->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE && !((Player*)unitTarget)->GetQuestRewardStatus (questID) )
+ unitTarget->CastSpell(unitTarget, spellID, true);
- // don't overwrite an existing aura
- for(uint8 i=0; i<5; i++)
- if(unitTarget->HasAura(spellid+i, 0))
return;
- unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
- break;
- }
+ }
+ // random spell learn instead placeholder
+ case 60893: // Northrend Alchemy Research
+ case 61177: // Northrend Inscription Research
+ case 61288: // Minor Inscription Research
+ case 61756: // Northrend Inscription Research (FAST QA VERSION)
+ {
+ if(!IsExplicitDiscoverySpell(m_spellInfo))
+ {
+ sLog.outError("Wrong explicit discovery spell %u structure, or outdated...",m_spellInfo->Id);
+ return;
+ }
- // Nightmare Vine
- case 28720:
- {
- if(!unitTarget)
- return;
- // 25% chance of casting Nightmare Pollen
- if(roll_chance_i(75))
- return;
- unitTarget->CastSpell(unitTarget, 28721, true);
- break;
- }
+ if(m_caster->GetTypeId()!=TYPEID_PLAYER)
+ return;
+ Player* player = (Player*)m_caster;
- // Mirren's Drinking Hat
- case 29830:
- {
- uint32 item = 0;
- switch ( urand(1,6) )
- {
- case 1: case 2: case 3: item = 23584; break;// Loch Modan Lager
- case 4: case 5: item = 23585; break;// Stouthammer Lite
- case 6: item = 23586; break;// Aerie Peak Pale Ale
+ // need replace effect 0 item by loot
+ uint32 reagent_id = m_spellInfo->EffectItemType[0];
+
+ if(!player->HasItemCount(reagent_id,1))
+ return;
+
+ // remove reagent
+ uint32 count = 1;
+ player->DestroyItemCount (reagent_id,count,true);
+
+ // create some random items
+ player->AutoStoreLoot(m_spellInfo->Id,LootTemplates_Spell);
+
+ // learn random explicit discovery recipe (if any)
+ if(uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, player))
+ player->learnSpell(discoveredSpell,false);
+ return;
+ }
}
- if (item)
- DoCreateItem(effIndex,item);
break;
}
- // Improved Sprint
- case 30918:
+ case SPELLFAMILY_WARLOCK:
{
- // Removes snares and roots.
- uint32 mechanic_mask = (1<<MECHANIC_ROOT) | (1<<MECHANIC_SNARE);
- Unit::AuraMap& Auras = unitTarget->GetAuras();
- for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
+ switch(m_spellInfo->Id)
{
- next = iter;
- ++next;
- Aura *aur = iter->second;
- if (!aur->IsPositive()) //only remove negative spells
+ // Healthstone creating spells
+ case 6201:
+ case 6202:
+ case 5699:
+ case 11729:
+ case 11730:
+ case 27230:
+ case 47871:
+ case 47878:
{
- // check for mechanic mask
- if(GetSpellMechanicMask(aur->GetSpellProto(), aur->GetEffIndex()) & mechanic_mask)
+ uint32 itemtype;
+ uint32 rank = 0;
+ Unit::AuraEffectList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
{
- unitTarget->RemoveAurasDueToSpell(aur->GetId());
- if(Auras.empty())
+ if((*i)->GetId() == 18692)
+ {
+ rank = 1;
break;
- else
- next = Auras.begin();
+ }
+ else if((*i)->GetId() == 18693)
+ {
+ rank = 2;
+ break;
+ }
}
- }
- }
- break;
- }
- // Goblin Weather Machine
- case 46203:
- {
- if(!unitTarget)
- return;
-
- uint32 spellId;
- switch(rand()%4)
- {
- case 0:
- spellId=46740;
- break;
- case 1:
- spellId=46739;
- break;
- case 2:
- spellId=46738;
- break;
- case 3:
- spellId=46736;
- break;
- }
- unitTarget->CastSpell(unitTarget, spellId, true);
- break;
- }
- case 48025: // Headless Horseman's Mount
- {
- if(!unitTarget)
- return;
+ static uint32 const itypes[8][3] = {
+ { 5512,19004,19005}, // Minor Healthstone
+ { 5511,19006,19007}, // Lesser Healthstone
+ { 5509,19008,19009}, // Healthstone
+ { 5510,19010,19011}, // Greater Healthstone
+ { 9421,19012,19013}, // Major Healthstone
+ {22103,22104,22105}, // Master Healthstone
+ {36889,36890,36891}, // Demonic Healthstone
+ {36892,36893,36894} // Fel Healthstone
+ };
- if(unitTarget)
- {
- switch(((Player*)unitTarget)->GetBaseSkillValue(762))
+ switch(m_spellInfo->Id)
{
- case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;;
- case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
- case 225: unitTarget->CastSpell(unitTarget, 51617, true); break;
- case 300: unitTarget->CastSpell(unitTarget, 48023, true); break;
- default: break;
+ case 6201:
+ itemtype=itypes[0][rank];break; // Minor Healthstone
+ case 6202:
+ itemtype=itypes[1][rank];break; // Lesser Healthstone
+ case 5699:
+ itemtype=itypes[2][rank];break; // Healthstone
+ case 11729:
+ itemtype=itypes[3][rank];break; // Greater Healthstone
+ case 11730:
+ itemtype=itypes[4][rank];break; // Major Healthstone
+ case 27230:
+ itemtype=itypes[5][rank];break; // Master Healthstone
+ case 47871:
+ itemtype=itypes[6][rank];break; // Demonic Healthstone
+ case 47878:
+ itemtype=itypes[7][rank];break; // Fel Healthstone
+ default:
+ return;
}
+ DoCreateItem( effIndex, itemtype );
+ return;
}
- break;
+ // Everlasting Affliction
+ case 47422:
+ // Refresh corruption on target
+ if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, m_caster->GetGUID()))
+ aur->GetParentAura()->RefreshAura();
+ return;
+ }
+ break;
}
- case 47977: // Magic Broom
+ case SPELLFAMILY_PRIEST:
{
- if(!unitTarget)
- return;
-
- if(unitTarget)
+ switch(m_spellInfo->Id)
{
- switch(((Player*)unitTarget)->GetBaseSkillValue(762))
+ // Pain and Suffering
+ case 47948:
+ {
+ if (!unitTarget)
+ return;
+ // Refresh Shadow Word: Pain on target
+ if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, m_caster->GetGUID()))
+ aur->GetParentAura()->RefreshAura();
+ return;
+ }
+ // Divine Hymn
+ case 47951:
{
- case 75: unitTarget->CastSpell(unitTarget, 42680, true); break;;
- case 150: case 225: case 300: unitTarget->CastSpell(unitTarget, 42683, true); break;
- default: break;
+ if (!unitTarget)
+ return;
+ Unit * target=NULL;
+ unitTarget->CastSpell(target, 59600, false);
+ unitTarget->CastSpell(target, 47953, false);
+ return;
}
+ default:
+ break;
}
break;
}
- }
-
- if(!unitTarget || !unitTarget->isAlive()) // can we remove this check?
- {
- sLog.outError("Spell %u in EffectScriptEffect does not have unitTarget", m_spellInfo->Id);
- return;
- }
-
- switch(m_spellInfo->Id)
- {
- // Dreaming Glory
- case 28698: unitTarget->CastSpell(unitTarget, 28694, true); break;
- // Needle Spine
- //case 39835: unitTarget->CastSpell(unitTarget, 39968, true); break;
- // Draw Soul
- case 40904: unitTarget->CastSpell(m_caster, 40903, true); break;
- // Flame Crash
- //case 41126: unitTarget->CastSpell(unitTarget, 41131, true); break;
- case 41931:
+ case SPELLFAMILY_HUNTER:
{
- int bag=19;
- int slot=0;
- Item* item = NULL;
-
- while (bag < 256)
+ switch(m_spellInfo->Id)
{
- item = ((Player*)m_caster)->GetItemByPos(bag,slot);
- if (item && item->GetEntry() == 38587) break;
- slot++;
- if (slot == 39)
+ // Chimera Shot
+ case 53209:
{
- slot = 0;
- bag++;
+ uint32 spellId = 0;
+ int32 basePoint = 0;
+ Unit::AuraMap& Auras = unitTarget->GetAuras();
+ for(Unit::AuraMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
+ {
+ Aura *aura = (*i).second;
+ if (aura->GetCasterGUID() != m_caster->GetGUID())
+ continue;
+ // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
+ flag96 familyFlag = aura->GetSpellProto()->SpellFamilyFlags;
+ if (!(familyFlag[1] & 0x00000080 || familyFlag[0] & 0x0000C000))
+ continue;
+
+ // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
+ if (familyFlag[0] & 0x4000)
+ {
+ spellId = 53353; // 53353 Chimera Shot - Serpent
+ basePoint = aura->GetPartAura(0)->GetAmount() * 5 * 40 / 100;
+ }
+ // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
+ if (familyFlag[1] & 0x00000080)
+ {
+ int32 tickCount = (aura->GetAuraMaxDuration() - aura->GetAuraDuration()) / aura->GetPartAura(0)->GetAuraAmplitude();
+ spellId = 53358; // 53358 Chimera Shot - Viper
+ // Amount of one aura tick
+ basePoint = aura->GetPartAura(0)->GetAmount() * aura->GetTarget()->GetMaxPower(POWER_MANA) / 100 ;
+ int32 casterBasePoint = aura->GetPartAura(0)->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50 ;
+ if (basePoint > casterBasePoint)
+ basePoint = casterBasePoint;
+ basePoint = basePoint * tickCount * 60 / 100;
+ }
+ // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
+ if (familyFlag[0] & 0x00008000)
+ spellId = 53359; // 53359 Chimera Shot - Scorpid
+ // ?? nothing say in spell desc (possibly need addition check)
+ //if (familyFlag & 0x0000010000000000LL || // dot
+ // familyFlag & 0x0000100000000000LL) // stun
+ //{
+ // spellId = 53366; // 53366 Chimera Shot - Wyvern
+ //}
+
+ // Refresh aura duration
+ aura->RefreshAura();
+ break;
+ }
+ if (spellId)
+ m_caster->CastCustomSpell(unitTarget, spellId, &basePoint, 0, 0, true);
+ return;
}
+ default:
+ break;
}
- if (bag < 256)
- {
- if (((Player*)m_caster)->GetItemByPos(bag,slot)->GetCount() == 1) ((Player*)m_caster)->RemoveItem(bag,slot,true);
- else ((Player*)m_caster)->GetItemByPos(bag,slot)->SetCount(((Player*)m_caster)->GetItemByPos(bag,slot)->GetCount()-1);
- // Spell 42518 (Braufest - Gratisprobe des Braufest herstellen)
- m_caster->CastSpell(m_caster,42518,true);
- return;
- }
- }
- // Force Cast - Portal Effect: Sunwell Isle
- case 44876: unitTarget->CastSpell(unitTarget, 44870, true); break;
- //5,000 Gold
- case 46642:
- {
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->ModifyMoney(50000000);
break;
}
- }
-
- if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN )
- {
- switch(m_spellInfo->SpellFamilyFlags)
+ case SPELLFAMILY_PALADIN:
{
// Judgement
- case 0x800000:
+ if (m_spellInfo->SpellFamilyFlags[0] & 0x800000)
{
+ if(!unitTarget || !unitTarget->isAlive())
+ return;
+ uint32 spellId1 = 0;
uint32 spellId2 = 0;
- // all seals have aura dummy
- Unit::AuraList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr)
+ // Judgement self add switch
+ switch (m_spellInfo->Id)
{
- SpellEntry const *spellInfo = (*itr)->GetSpellProto();
-
- // search seal (all seals have judgement's aura dummy spell id in 2 effect
- if ( !spellInfo || !IsSealSpell((*itr)->GetSpellProto()) || (*itr)->GetEffIndex() != 2 )
- continue;
-
- // must be calculated base at raw base points in spell proto, GetModifier()->m_value for S.Righteousness modified by SPELLMOD_DAMAGE
- spellId2 = (*itr)->GetSpellProto()->EffectBasePoints[2]+1;
-
- if(spellId2 <= 1)
- continue;
-
- // found, remove seal
- m_caster->RemoveAurasDueToSpell((*itr)->GetId());
-
- // Sanctified Judgement
- Unit::AuraList const& m_auras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = m_auras.begin(); i != m_auras.end(); ++i)
+ case 41467: break; // Judgement
+ case 53407: spellId1 = 20184; break; // Judgement of Justice
+ case 20271: // Judgement of Light
+ case 57774: spellId1 = 20185; break; // Judgement of Light
+ case 53408: spellId1 = 20186; break; // Judgement of Wisdom
+ default:
+ return;
+ }
+ // all seals have aura dummy in 2 effect
+ Unit::AuraMap & sealAuras = m_caster->GetAuras();
+ for(Unit::AuraMap::iterator iter = sealAuras.begin(); iter != sealAuras.end();)
+ {
+ if (IsSealSpell(iter->second->GetSpellProto()))
{
- if ((*i)->GetSpellProto()->SpellIconID == 205 && (*i)->GetSpellProto()->Attributes == 0x01D0LL)
+ if (AuraEffect * aureff = iter->second->GetPartAura(2))
+ if (aureff->GetAuraName()==SPELL_AURA_DUMMY)
+ {
+ if (sSpellStore.LookupEntry(aureff->GetAmount()))
+ spellId2 = aureff->GetAmount();
+ break;
+ }
+ if (!spellId2)
{
- int32 chance = (*i)->GetModifier()->m_amount;
- if ( roll_chance_i(chance) )
+ switch (iter->first)
{
- int32 mana = spellInfo->manaCost;
- if ( Player* modOwner = m_caster->GetSpellModOwner() )
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_COST, mana);
- mana = int32(mana* 0.8f);
- m_caster->CastCustomSpell(m_caster,31930,&mana,NULL,NULL,true,NULL,*i);
+ // Seal of light, wisdom, justice
+ case 20165:
+ case 20166:
+ case 20164:
+ spellId2 = 54158;
}
- break;
}
+ break;
}
+ else
+ ++iter;
+ }
+ if (spellId1)
+ m_caster->CastSpell(unitTarget, spellId1, true);
+ if (spellId2)
+ m_caster->CastSpell(unitTarget, spellId2, true);
+ return;
+ }
+ }
+ case SPELLFAMILY_POTION:
+ {
+ switch(m_spellInfo->Id)
+ {
+ // Dreaming Glory
+ case 28698:
+ {
+ if(!unitTarget)
+ return;
+ unitTarget->CastSpell(unitTarget, 28694, true);
+ break;
+ }
+ // Netherbloom
+ case 28702:
+ {
+ if(!unitTarget)
+ return;
+ // 25% chance of casting a random buff
+ if(roll_chance_i(75))
+ return;
+
+ // triggered spells are 28703 to 28707
+ // Note: some sources say, that there was the possibility of
+ // receiving a debuff. However, this seems to be removed by a patch.
+ const uint32 spellid = 28703;
+ // don't overwrite an existing aura
+ for(uint8 i=0; i<5; i++)
+ if(unitTarget->HasAuraEffect(spellid+i, 0))
+ return;
+ unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
break;
}
- m_caster->CastSpell(unitTarget,spellId2,true);
- return;
+ // Nightmare Vine
+ case 28720:
+ {
+ if(!unitTarget)
+ return;
+ // 25% chance of casting Nightmare Pollen
+ if(roll_chance_i(75))
+ return;
+ unitTarget->CastSpell(unitTarget, 28721, true);
+ break;
+ }
}
+ break;
}
}
@@ -4911,7 +5085,7 @@ void Spell::EffectSanctuary(uint32 /*i*/)
std::list<Unit*> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, World::GetMaxVisibleDistance());
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(unitTarget, targets, u_check);
unitTarget->VisitNearbyObject(World::GetMaxVisibleDistance(), searcher);
for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
@@ -4931,9 +5105,9 @@ void Spell::EffectSanctuary(uint32 /*i*/)
unitTarget->CombatStop();
unitTarget->getHostilRefManager().deleteReferences(); // stop all fighting
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
- if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_VANISH))
+ if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VANISH))
{
- ((Player *)m_caster)->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
+ ((Player *)m_caster)->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
}
}
@@ -4966,6 +5140,7 @@ void Spell::EffectDuel(uint32 i)
// Players can only fight a duel with each other outside (=not inside dungeons and not in capital cities)
// Don't have to check the target's map since you cannot challenge someone across maps
if(caster->GetMap()->Instanceable())
+ //if( mapid != 0 && mapid != 1 && mapid != 530 && mapid != 571 && mapid != 609)
{
SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here
return;
@@ -4991,11 +5166,12 @@ void Spell::EffectDuel(uint32 i)
uint32 gameobject_id = m_spellInfo->EffectMiscValue[i];
Map *map = m_caster->GetMap();
- if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
+ if(!pGameObj->Create(objmgr.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 ,
m_caster->GetPositionZ(),
- m_caster->GetOrientation(), 0, 0, 0, 0, 0, 1))
+ m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
{
delete pGameObj;
return;
@@ -5004,7 +5180,7 @@ void Spell::EffectDuel(uint32 i)
pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction() );
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()+1 );
int32 duration = GetSpellDuration(m_spellInfo);
- pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
pGameObj->SetSpellId(m_spellInfo->Id);
m_caster->AddGameObject(pGameObj);
@@ -5081,7 +5257,7 @@ void Spell::EffectSummonPlayer(uint32 /*i*/)
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*1000); // auto decline after msecs
+ data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILISECONDS); // auto decline after msecs
((Player*)unitTarget)->GetSession()->SendPacket(&data);
}
@@ -5104,89 +5280,40 @@ void Spell::EffectActivateObject(uint32 effect_idx)
sWorld.ScriptCommandStart(activateCommand, delay_secs, m_caster, gameObjTarget);
}
-void Spell::EffectSummonTotem(uint32 i)
+void Spell::EffectApplyGlyph(uint32 i)
{
- uint8 slot = 0;
- switch(m_spellInfo->EffectMiscValueB[i])
- {
- case SUMMON_TYPE_TOTEM_SLOT1: slot = 0; break;
- case SUMMON_TYPE_TOTEM_SLOT2: slot = 1; break;
- case SUMMON_TYPE_TOTEM_SLOT3: slot = 2; break;
- case SUMMON_TYPE_TOTEM_SLOT4: slot = 3; break;
- // Battle standard case
- case SUMMON_TYPE_TOTEM: slot = 254; break;
- // jewelery statue case, like totem without slot
- case SUMMON_TYPE_GUARDIAN: slot = 255; break;
- default: return;
- }
-
- if(slot < MAX_TOTEM)
- {
- uint64 guid = m_caster->m_TotemSlot[slot];
- if(guid != 0)
- {
- Creature *OldTotem = ObjectAccessor::GetCreature(*m_caster, guid);
- if(OldTotem && OldTotem->isTotem())
- ((Totem*)OldTotem)->UnSummon();
- }
- }
-
- uint32 team = 0;
- if (m_caster->GetTypeId()==TYPEID_PLAYER)
- team = ((Player*)m_caster)->GetTeam();
-
- Totem* pTotem = new Totem;
-
- if(!pTotem->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_spellInfo->EffectMiscValue[i], team ))
- {
- delete pTotem;
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- }
-
- float angle = slot < MAX_TOTEM ? M_PI/MAX_TOTEM - (slot*2*M_PI/MAX_TOTEM) : 0;
-
- float x,y,z;
- m_caster->GetClosePoint(x,y,z,pTotem->GetObjectSize(),2.0f,angle);
- // totem must be at same Z in case swimming caster and etc.
- if( fabs( z - m_caster->GetPositionZ() ) > 5 )
- z = m_caster->GetPositionZ();
-
- pTotem->Relocate(x, y, z, m_caster->GetOrientation());
-
- if(slot < MAX_TOTEM)
- m_caster->m_TotemSlot[slot] = pTotem->GetGUID();
-
- pTotem->SetOwner(m_caster->GetGUID());
- pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initilized
-
- int32 duration=GetSpellDuration(m_spellInfo);
- if(Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id,SPELLMOD_DURATION, duration);
- pTotem->SetDuration(duration);
+ Player *player = (Player*)m_caster;
- if (damage) // if not spell info, DB values used
+ // apply new one
+ if(uint32 glyph = m_spellInfo->EffectMiscValue[i])
{
- pTotem->SetMaxHealth(damage);
- pTotem->SetHealth(damage);
- }
-
- pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
- pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
-
- pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true);
- pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_TRANSFORM,true);
+ if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph))
+ {
+ if(GlyphSlotEntry const *gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex)))
+ {
+ if(gp->TypeFlags != gs->TypeFlags)
+ {
+ SendCastResult(SPELL_FAILED_INVALID_GLYPH);
+ return; // glyph slot mismatch
+ }
+ }
- pTotem->Summon(m_caster);
+ // remove old glyph
+ if(uint32 oldglyph = player->GetGlyph(m_glyphIndex))
+ {
+ if(GlyphPropertiesEntry const *old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
+ {
+ player->RemoveAurasDueToSpell(old_gp->SpellId);
+ player->SetGlyph(m_glyphIndex, 0);
+ }
+ }
- if(slot < MAX_TOTEM && m_caster->GetTypeId() == TYPEID_PLAYER)
- {
- WorldPacket data(SMSG_TOTEM_CREATED, 1+8+4+4);
- data << uint8(slot);
- data << uint64(pTotem->GetGUID());
- data << uint32(duration);
- data << uint32(m_spellInfo->Id);
- ((Player*)m_caster)->SendDirectMessage(&data);
+ player->CastSpell(m_caster, gp->SpellId, true);
+ player->SetGlyph(m_glyphIndex, glyph);
+ }
}
}
@@ -5227,7 +5354,7 @@ void Spell::EffectEnchantHeldItem(uint32 i)
return;
// Apply the temporary enchantment
- item->SetEnchantment(slot, enchant_id, duration*1000, 0);
+ item->SetEnchantment(slot, enchant_id, duration*IN_MILISECONDS, 0);
item_owner->ApplyEnchantment(item,slot,true);
}
}
@@ -5270,7 +5397,8 @@ void Spell::EffectFeedPet(uint32 i)
Player *_player = (Player*)m_caster;
- if(!itemTarget)
+ Item* foodItem = m_targets.getItemTarget();
+ if(!foodItem)
return;
Pet *pet = _player->GetPet();
@@ -5280,15 +5408,15 @@ void Spell::EffectFeedPet(uint32 i)
if(!pet->isAlive())
return;
- int32 benefit = pet->GetCurrentFoodBenefitLevel(itemTarget->GetProto()->ItemLevel);
+ int32 benefit = pet->GetCurrentFoodBenefitLevel(foodItem->GetProto()->ItemLevel);
if(benefit <= 0)
return;
uint32 count = 1;
- _player->DestroyItemCount(itemTarget,count,true);
+ _player->DestroyItemCount(foodItem,count,true);
// TODO: fix crash when a spell has two effects, both pointed at the same item target
- m_caster->CastCustomSpell(m_caster,m_spellInfo->EffectTriggerSpell[i],&benefit,NULL,NULL,true);
+ m_caster->CastCustomSpell(pet,m_spellInfo->EffectTriggerSpell[i],&benefit,NULL,NULL,true);
}
void Spell::EffectDismissPet(uint32 /*i*/)
@@ -5296,7 +5424,7 @@ void Spell::EffectDismissPet(uint32 /*i*/)
if(m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- Pet* pet = m_caster->GetPet();
+ Pet* pet = ((Player*)m_caster)->GetPet();
// not let dismiss dead pet
if(!pet||!pet->isAlive())
@@ -5332,9 +5460,6 @@ void Spell::EffectSummonObject(uint32 i)
GameObject* pGameObj = new GameObject;
- float rot2 = sin(m_caster->GetOrientation()/2);
- float rot3 = cos(m_caster->GetOrientation()/2);
-
float x,y,z;
// If dest location if present
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
@@ -5348,7 +5473,8 @@ void Spell::EffectSummonObject(uint32 i)
m_caster->GetClosePoint(x,y,z,DEFAULT_WORLD_OBJECT_SIZE);
Map *map = m_caster->GetMap();
- if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map, x, y, z, m_caster->GetOrientation(), 0, 0, rot2, rot3, 0, 1))
+ if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
+ m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
{
delete pGameObj;
return;
@@ -5356,7 +5482,7 @@ void Spell::EffectSummonObject(uint32 i)
//pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL,m_caster->getLevel());
int32 duration = GetSpellDuration(m_spellInfo);
- pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
pGameObj->SetSpellId(m_spellInfo->Id);
m_caster->AddGameObject(pGameObj);
@@ -5427,18 +5553,14 @@ void Spell::EffectAddExtraAttacks(uint32 /*i*/)
void Spell::EffectParry(uint32 /*i*/)
{
- if (unitTarget->GetTypeId() == TYPEID_PLAYER)
- {
+ if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
((Player*)unitTarget)->SetCanParry(true);
- }
}
void Spell::EffectBlock(uint32 /*i*/)
{
- if (unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- ((Player*)unitTarget)->SetCanBlock(true);
+ if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)unitTarget)->SetCanBlock(true);
}
void Spell::EffectMomentMove(uint32 i)
@@ -5450,7 +5572,7 @@ void Spell::EffectMomentMove(uint32 i)
return;
uint32 mapid = m_caster->GetMapId();
- float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float dis = m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
// src point
float *fx = new float[11], *fy = new float[11], *fz = new float[11];
@@ -5488,26 +5610,9 @@ void Spell::EffectMomentMove(uint32 i)
if (hit == false)
itr_j = last_valid;
-
- if (unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, fx[itr_j], fy[itr_j], fz[itr_j] + 0.07531, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget == m_caster ? TELE_TO_SPELL : 0));
- else
- MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx[itr_j], fy[itr_j], fz[itr_j] + 0.07531, orientation);
+ unitTarget->NearTeleportTo(fx[itr_j], fy[itr_j], fz[itr_j] + 0.07531, orientation, unitTarget==m_caster);
delete [] fx; delete [] fy; delete [] fz;
-
-/* uint32 mapid = unitTarget->GetMapId();
- float ox,oy,oz;
- unitTarget->GetPosition(ox,oy,oz);
-
- float fx,fy,fz; // getObjectHitPos overwrite last args in any result case
- if(VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(mapid, ox,oy,oz+0.5, m_targets.m_destX,m_targets.m_destY,oz+0.5,fx,fy,fz, -0.5))
- unitTarget->UpdateGroundPositionZ(fx,fy,fz);
-
- if(unitTarget->GetTypeId() == TYPEID_PLAYER)
- ((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, unitTarget->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
- else
- MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx, fy, fz, unitTarget->GetOrientation());*/
}
void Spell::EffectReputation(uint32 i)
@@ -5526,7 +5631,7 @@ void Spell::EffectReputation(uint32 i)
if(!factionEntry)
return;
- _player->ModifyFactionReputation(factionEntry,rep_change);
+ _player->GetReputationMgr().ModifyReputation(factionEntry,rep_change);
}
void Spell::EffectQuestComplete(uint32 i)
@@ -5630,76 +5735,32 @@ void Spell::EffectSummonCritter(uint32 i)
if(!pet_entry)
return;
- Pet* old_critter = player->GetMiniPet();
-
- // for same pet just despawn
- if(old_critter && old_critter->GetEntry() == pet_entry)
- {
- player->RemoveMiniPet();
- return;
- }
-
- // despawn old pet before summon new
- if(old_critter)
- player->RemoveMiniPet();
-
- // summon new pet
- Pet* critter = new Pet(MINI_PET);
-
- Map *map = m_caster->GetMap();
- uint32 pet_number = objmgr.GeneratePetNumber();
- if(!critter->Create(objmgr.GenerateLowGuid(HIGHGUID_PET),
- map, pet_entry, pet_number))
- {
- sLog.outError("Spell::EffectSummonCritter, spellid %u: no such creature entry %u", m_spellInfo->Id, pet_entry);
- delete critter;
- return;
- }
-
float x,y,z;
- // If dest location if present
- if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
- {
- x = m_targets.m_destX;
- y = m_targets.m_destY;
- z = m_targets.m_destZ;
- }
- // Summon if dest location not present near caster
- else
- m_caster->GetClosePoint(x,y,z,critter->GetObjectSize());
-
- critter->Relocate(x,y,z,m_caster->GetOrientation());
+ GetSummonPosition(x, y, z);
- if(!critter->IsPositionValid())
- {
- sLog.outError("ERROR: Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",
- critter->GetGUIDLow(), critter->GetEntry(), critter->GetPositionX(), critter->GetPositionY());
- delete critter;
+ int32 duration = GetSpellDuration(m_spellInfo);
+ TempSummon *critter = m_caster->GetMap()->SummonCreature(pet_entry, x, y, z, m_caster->GetOrientation(), sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[i]), duration, m_caster);
+ if(!critter)
return;
- }
critter->SetOwnerGUID(m_caster->GetGUID());
critter->SetCreatorGUID(m_caster->GetGUID());
critter->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster->getFaction());
critter->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
- critter->AIM_Initialize();
- critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter...
+ //critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter...
critter->SetMaxHealth(1);
critter->SetHealth(1);
critter->SetLevel(1);
- // set timer for unsummon
- int32 duration = GetSpellDuration(m_spellInfo);
- if(duration > 0)
- critter->SetDuration(duration);
+ critter->SetReactState(REACT_PASSIVE);
+ critter->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
+ critter->GetMotionMaster()->MoveTargetedHome();
std::string name = player->GetName();
- name.append(petTypeSuffix[critter->getPetType()]);
+ name.append(petTypeSuffix[3]);
critter->SetName( name );
- player->SetMiniPet(critter);
-
- map->Add((Creature*)critter);
}
void Spell::EffectKnockBack(uint32 i)
@@ -5707,10 +5768,6 @@ void Spell::EffectKnockBack(uint32 i)
if(!unitTarget)
return;
- // Effect only works on players
- if(unitTarget->GetTypeId()!=TYPEID_PLAYER)
- return;
-
float x, y;
if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
{
@@ -5723,31 +5780,29 @@ void Spell::EffectKnockBack(uint32 i)
y = m_caster->GetPositionY();
}
- float dx = unitTarget->GetPositionX() - x;
- float dy = unitTarget->GetPositionY() - y;
- float vcos, vsin;
- if(dx < 0.001f && dy < 0.001f)
+ float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
+ float speedz = float(damage/10);
+
+ unitTarget->KnockbackFrom(x, y, speedxy, speedz);
+}
+
+void Spell::EffectJump2(uint32 i)
+{
+ if(!unitTarget)
+ return;
+
+ float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
+ float speedz = float(damage/10);
+ if(!speedxy)
{
- float angle = rand_norm()*2*M_PI;
- vcos = cos(angle);
- vsin = sin(angle);
+ if(m_targets.getUnitTarget())
+ unitTarget->JumpTo(m_targets.getUnitTarget(), speedz);
}
else
{
- float dist = sqrt((dx*dx) + (dy*dy));
- vcos = dx / dist;
- vsin = dy / dist;
+ //1891: Disengage
+ unitTarget->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891);
}
-
- WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
- data.append(unitTarget->GetPackGUID());
- data << uint32(0); // Sequence
- data << float(vcos); // x direction
- data << float(vsin); // y direction
- data << float(m_spellInfo->EffectMiscValue[i])/10; // Horizontal speed
- data << float(damage/-10); // Z Movement speed (vertical)
-
- ((Player*)unitTarget)->GetSession()->SendPacket(&data);
}
void Spell::EffectSendTaxi(uint32 i)
@@ -5768,17 +5823,26 @@ void Spell::EffectSendTaxi(uint32 i)
uint32 mountid = 0;
switch(m_spellInfo->Id)
{
- case 31606: //Stormcrow Amulet
+ case 31606: //Stormcrow Amulet
mountid = 17447;
break;
- case 45071: //Quest - Sunwell Daily - Dead Scar Bombing Run
- case 45113: //Quest - Sunwell Daily - Ship Bombing Run
- case 45353: //Quest - Sunwell Daily - Ship Bombing Run Return
+ case 45071: //Quest - Sunwell Daily - Dead Scar Bombing Run
+ case 45113: //Quest - Sunwell Daily - Ship Bombing Run
+ case 45353: //Quest - Sunwell Daily - Ship Bombing Run Return
mountid = 22840;
break;
- case 34905: //Stealth Flight
+ case 34905: //Stealth Flight
mountid = 6851;
break;
+ case 45883: //Amber Ledge to Beryl Point
+ mountid = 23524;
+ break;
+ case 46064: //Amber Ledge to Coldarra
+ mountid = 6371;
+ break;
+ case 53335: //Stormwind Harbor Flight - Peaceful
+ mountid = 6852;
+ break;
case 41533: //Fly of the Netherwing
case 41540: //Fly of the Netherwing
mountid = 23468;
@@ -5820,22 +5884,24 @@ void Spell::EffectDispelMechanic(uint32 i)
uint32 mechanic = m_spellInfo->EffectMiscValue[i];
+ std::queue < Aura * > dispel_list;
+
Unit::AuraMap& Auras = unitTarget->GetAuras();
- for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
+ for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); iter++)
+ {
+ if(GetAllSpellMechanicMask(iter->second->GetSpellProto()) & (1<<(mechanic)))
+ {
+ dispel_list.push(iter->second);
+ }
+ }
+
+ for(;dispel_list.size();dispel_list.pop())
{
- next = iter;
- ++next;
- SpellEntry const *spell = sSpellStore.LookupEntry(iter->second->GetSpellProto()->Id);
- if(spell->Mechanic == mechanic || spell->EffectMechanic[iter->second->GetEffIndex()] == mechanic)
+ if (GetDispelChance(dispel_list.front()->GetCaster(), dispel_list.front()->GetId()))
{
- unitTarget->RemoveAurasDueToSpell(spell->Id);
- if(Auras.empty())
- break;
- else
- next = Auras.begin();
+ unitTarget->RemoveAura(dispel_list.front(), AURA_REMOVE_BY_ENEMY_SPELL);
}
}
- return;
}
void Spell::EffectSummonDeadPet(uint32 /*i*/)
@@ -5850,36 +5916,40 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/)
return;
if(damage < 0)
return;
+
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->setDeathState( ALIVE );
pet->clearUnitState(UNIT_STAT_ALL_STATE);
pet->SetHealth( uint32(pet->GetMaxHealth()*(float(damage)/100)));
- pet->AIM_Initialize();
-
- _player->PetSpellInitialize();
+ //pet->AIM_Initialize();
+ //_player->PetSpellInitialize();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
}
void Spell::EffectDestroyAllTotems(uint32 /*i*/)
{
float mana = 0;
- for(int slot = 0; slot < MAX_TOTEM; ++slot)
+ for(int slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
{
- if(!m_caster->m_TotemSlot[slot])
+ if(!m_caster->m_SummonSlot[slot])
continue;
- Creature* totem = ObjectAccessor::GetCreature(*m_caster,m_caster->m_TotemSlot[slot]);
+ Creature* totem = ObjectAccessor::GetCreature(*m_caster,m_caster->m_SummonSlot[slot]);
if(totem && totem->isTotem())
{
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id);
if(spellInfo)
- mana += spellInfo->manaCost * damage / 100;
+ {
+ mana += spellInfo->manaCost;
+ mana += spellInfo->ManaCostPercentage * m_caster->GetCreateMana() / 100;
+ }
((Totem*)totem)->UnSummon();
}
}
+ mana = mana * damage / 100;
int32 gain = m_caster->ModifyPower(POWER_MANA,int32(mana));
m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA);
@@ -5965,13 +6035,14 @@ void Spell::EffectTransmitted(uint32 effIndex)
//FIXME: this can be better check for most objects but still hack
else if(m_spellInfo->EffectRadiusIndex[effIndex] && m_spellInfo->speed==0)
{
- float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
+ float dis = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
m_caster->GetClosePoint(fx,fy,fz,DEFAULT_WORLD_OBJECT_SIZE, dis);
}
else
{
- float min_dis = GetSpellMinRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
- float max_dis = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
+ //GO is always friendly to it's creator, get range for friends
+ float min_dis = GetSpellMinRangeForFriend(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
+ float max_dis = GetSpellMaxRangeForFriend(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
float dis = rand_norm() * (max_dis - min_dis) + min_dis;
m_caster->GetClosePoint(fx,fy,fz,DEFAULT_WORLD_OBJECT_SIZE, dis);
@@ -6000,7 +6071,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
GameObject* pGameObj = new GameObject;
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
- fx, fy, fz, m_caster->GetOrientation(), 0, 0, 0, 0, 100, 1))
+ m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
{
delete pGameObj;
return;
@@ -6013,10 +6084,6 @@ void Spell::EffectTransmitted(uint32 effIndex)
case GAMEOBJECT_TYPE_FISHINGNODE:
{
m_caster->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT,pGameObj->GetGUID());
- // Orientation3
- pGameObj->SetFloatValue(GAMEOBJECT_ROTATION + 2, 0.88431775569915771 );
- // Orientation4
- pGameObj->SetFloatValue(GAMEOBJECT_ROTATION + 3, -0.4668855369091033 );
m_caster->AddGameObject(pGameObj); // will removed at spell cancel
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo))
@@ -6030,7 +6097,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
case 3: lastSec = 17; break;
}
- duration = duration - lastSec*1000 + FISHING_BOBBER_READY_TIME*1000;
+ duration = duration - lastSec*IN_MILISECONDS + FISHING_BOBBER_READY_TIME*IN_MILISECONDS;
break;
}
case GAMEOBJECT_TYPE_SUMMONING_RITUAL:
@@ -6050,14 +6117,14 @@ void Spell::EffectTransmitted(uint32 effIndex)
}
}
- pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
pGameObj->SetOwnerGUID(m_caster->GetGUID() );
//pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
pGameObj->SetSpellId(m_spellInfo->Id);
- DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted\n");
+ DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted");
//m_caster->AddGameObject(pGameObj);
//m_ObjToDel.push_back(pGameObj);
@@ -6071,9 +6138,9 @@ void Spell::EffectTransmitted(uint32 effIndex)
{
GameObject* linkedGO = new GameObject;
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
- fx, fy, fz, m_caster->GetOrientation(), 0, 0, 0, 0, 100, 1))
+ m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
{
- linkedGO->SetRespawnTime(duration > 0 ? duration/1000 : 0);
+ linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
linkedGO->SetSpellId(m_spellInfo->Id);
linkedGO->SetOwnerGUID(m_caster->GetGUID() );
@@ -6111,6 +6178,28 @@ void Spell::EffectProspecting(uint32 /*i*/)
((Player*)m_caster)->SendLoot(itemTarget->GetGUID(), LOOT_PROSPECTING);
}
+void Spell::EffectMilling(uint32 /*i*/)
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ Player* p_caster = (Player*)m_caster;
+ if(!itemTarget || !(itemTarget->GetProto()->BagFamily & BAG_FAMILY_MASK_HERBS))
+ return;
+
+ if(itemTarget->GetCount() < 5)
+ return;
+
+ if( sWorld.getConfig(CONFIG_SKILL_MILLING))
+ {
+ uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION);
+ uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
+ p_caster->UpdateGatherSkill(SKILL_INSCRIPTION, SkillValue, reqSkillValue);
+ }
+
+ ((Player*)m_caster)->SendLoot(itemTarget->GetGUID(), LOOT_MILLING);
+}
+
void Spell::EffectSkill(uint32 /*i*/)
{
sLog.outDebug("WORLD: SkillEFFECT");
@@ -6118,26 +6207,34 @@ void Spell::EffectSkill(uint32 /*i*/)
void Spell::EffectSummonDemon(uint32 i)
{
- float px = m_targets.m_destX;
- float py = m_targets.m_destY;
- float pz = m_targets.m_destZ;
+ float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
- Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,3600000);
- if (!Charmed)
- return;
+ int32 amount = damage > 0 ? damage : 1;
- // might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
- Charmed->SetLevel(m_caster->getLevel());
+ for(int32 count = 0; count < amount; ++count)
+ {
+ float px, py, pz;
+ GetSummonPosition(px, py, pz, radius, count);
- // TODO: Add damage/mana/hp according to level
+ int32 duration = GetSpellDuration(m_spellInfo);
- if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon
- {
- // Enslave demon effect, without mana cost and cooldown
- m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved
+ Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,duration);
+ if (!Charmed) // something fatal, not attempt more
+ return;
- // Inferno effect
- Charmed->CastSpell(Charmed, 22703, true, 0);
+ // might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
+ Charmed->SetLevel(m_caster->getLevel());
+
+ // TODO: Add damage/mana/hp according to level
+
+ if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon
+ {
+ // Enslave demon effect, without mana cost and cooldown
+ m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved
+
+ // Inferno effect
+ Charmed->CastSpell(Charmed, 22703, true, 0);
+ }
}
}
@@ -6179,7 +6276,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
if(!unitTarget || unitTarget==m_caster) // can't steal from self
return;
- std::vector <Aura *> steal_list;
+ std::list <Aura *> steal_list;
// Create dispel mask by dispel type
uint32 dispelMask = GetDispellMask( DispelType(m_spellInfo->EffectMiscValue[i]) );
Unit::AuraMap const& auras = unitTarget->GetAuras();
@@ -6189,53 +6286,38 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
if (aur && (1<<aur->GetSpellProto()->Dispel) & dispelMask)
{
// Need check for passive? this
- if (aur->IsPositive() && !aur->IsPassive())
+ if (aur->IsPositive() && !aur->IsPassive() && !(aur->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE))
steal_list.push_back(aur);
}
}
// Ok if exist some buffs for dispel try dispel it
- if (!steal_list.empty())
+ if (uint32 list_size = steal_list.size())
{
- std::list < std::pair<uint32,uint64> > success_list;
- int32 list_size = steal_list.size();
+ std::list < Aura * > success_list;
+
// dispel N = damage buffs (or while exist buffs for dispel)
- for (int32 count=0; count < damage && list_size > 0; ++count)
+ for (int32 count=0; count < damage && list_size > 0; ++count, list_size = steal_list.size())
{
// Random select buff for dispel
- Aura *aur = steal_list[urand(0, list_size-1)];
- // Not use chance for steal
- // TODO possible need do it
- success_list.push_back( std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));
-
- // Remove buff from list for prevent doubles
- for (std::vector<Aura *>::iterator j = steal_list.begin(); j != steal_list.end(); )
- {
- Aura *stealed = *j;
- if (stealed->GetId() == aur->GetId() && stealed->GetCasterGUID() == aur->GetCasterGUID())
- {
- j = steal_list.erase(j);
- --list_size;
- }
- else
- ++j;
- }
+ std::list < Aura * > ::iterator itr = steal_list.begin();
+ for (uint32 i=urand(0, list_size-1);i>0;--i)
+ itr++;
+ success_list.push_back(*itr);
+ steal_list.erase(itr);
}
- // Really try steal and send log
- if (!success_list.empty())
+ if (success_list.size())
{
- int32 count = success_list.size();
- WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+count*5);
+ WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+damage*5);
data.append(unitTarget->GetPackGUID()); // Victim GUID
data.append(m_caster->GetPackGUID()); // Caster GUID
data << uint32(m_spellInfo->Id); // dispel spell id
data << uint8(0); // not used
- data << uint32(count); // count
- for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
+ data << uint32(success_list.size()); // count
+ for (std::list < Aura * > ::iterator itr = success_list.begin();itr!=success_list.end();++itr)
{
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
- data << uint32(spellInfo->Id); // Spell Id
+ data << uint32((*itr)->GetId()); // Spell Id
data << uint8(0); // 0 - steals !=0 transfers
- unitTarget->RemoveAurasDueToSpellBySteal(spellInfo->Id, j->second, m_caster);
+ unitTarget->RemoveAurasDueToSpellBySteal((*itr)->GetId(), (*itr)->GetCasterGUID(), m_caster);
}
m_caster->SendMessageToSet(&data, true);
}
@@ -6247,7 +6329,7 @@ void Spell::EffectKillCredit(uint32 i)
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- ((Player*)unitTarget)->KilledMonster(m_spellInfo->EffectMiscValue[i], 0);
+ ((Player*)unitTarget)->RewardPlayerAndGroupAtEvent(m_spellInfo->EffectMiscValue[i], unitTarget);
}
void Spell::EffectQuestFail(uint32 i)
@@ -6258,9 +6340,220 @@ void Spell::EffectQuestFail(uint32 i)
((Player*)unitTarget)->FailQuest(m_spellInfo->EffectMiscValue[i]);
}
+void Spell::EffectActivateRune(uint32 eff_idx)
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ Player *plr = (Player*)m_caster;
+
+ if(plr->getClass() != CLASS_DEATH_KNIGHT)
+ return;
+
+ for(uint32 j = 0; j < MAX_RUNES; ++j)
+ {
+ if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == m_spellInfo->EffectMiscValue[eff_idx])
+ {
+ plr->SetRuneCooldown(j, 0);
+ }
+ }
+}
+
+void Spell::EffectTitanGrip(uint32 /*eff_idx*/)
+{
+ if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)unitTarget)->SetCanTitanGrip(true);
+}
+
void Spell::EffectRedirectThreat(uint32 /*i*/)
{
if(unitTarget)
m_caster->SetReducedThreatPercent((uint32)damage, unitTarget->GetGUID());
}
+void Spell::SummonTotem(uint32 entry, SummonPropertiesEntry const *properties)
+{
+ int8 slot = (int8)properties->Slot;
+
+ if(slot >= SUMMON_SLOT_TOTEM && slot < MAX_TOTEM_SLOT)
+ {
+ uint64 guid = m_caster->m_SummonSlot[slot];
+ if(guid != 0)
+ {
+ Creature *OldTotem = ObjectAccessor::GetCreature(*m_caster, guid);
+ if(OldTotem && OldTotem->isTotem())
+ ((Totem*)OldTotem)->UnSummon();
+ }
+ }
+
+ uint32 team = 0;
+ if (m_caster->GetTypeId()==TYPEID_PLAYER)
+ team = ((Player*)m_caster)->GetTeam();
+
+ Totem* pTotem = new Totem(properties, m_caster);
+
+ if(!pTotem->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), m_caster->GetMap(), m_caster->GetPhaseMask(),
+ entry, team ))
+ {
+ delete pTotem;
+ return;
+ }
+
+ float x,y,z;
+ GetSummonPosition(x, y, z);
+
+ // totem must be at same Z in case swimming caster and etc.
+ if( fabs( z - m_caster->GetPositionZ() ) > 5 )
+ z = m_caster->GetPositionZ();
+
+ pTotem->Relocate(x, y, z, m_caster->GetOrientation());
+
+ if(slot >= SUMMON_SLOT_TOTEM && slot < MAX_TOTEM_SLOT)
+ m_caster->m_SummonSlot[slot] = pTotem->GetGUID();
+
+ pTotem->SetOwner(m_caster->GetGUID());
+ pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initilized
+
+ int32 duration=GetSpellDuration(m_spellInfo);
+ if(Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod(m_spellInfo->Id,SPELLMOD_DURATION, duration);
+ pTotem->SetDuration(duration);
+
+ if (damage) // if not spell info, DB values used
+ {
+ pTotem->SetMaxHealth(damage);
+ pTotem->SetHealth(damage);
+ }
+
+ pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
+
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
+
+ pTotem->Summon(m_caster);
+
+ if(slot >= SUMMON_SLOT_TOTEM && slot < MAX_TOTEM_SLOT && m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ WorldPacket data(SMSG_TOTEM_CREATED, 1+8+4+4);
+ data << uint8(slot-1);
+ data << uint64(pTotem->GetGUID());
+ data << uint32(duration);
+ data << uint32(m_spellInfo->Id);
+ ((Player*)m_caster)->SendDirectMessage(&data);
+ }
+}
+
+void Spell::SummonGuardian(uint32 entry, SummonPropertiesEntry const *properties)
+{
+ Unit *caster = m_originalCaster;
+ if(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())
+ caster = caster->GetOwner();
+ if(!caster)
+ return;
+
+ // in another case summon new
+ uint32 level = caster->getLevel();
+
+ // level of pet summoned using engineering item based at engineering skill level
+ if(m_CastItem && caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ItemPrototype const *proto = m_CastItem->GetProto();
+ if(proto && proto->RequiredSkill == SKILL_ENGINERING)
+ {
+ uint16 skill202 = ((Player*)caster)->GetSkillValue(SKILL_ENGINERING);
+ if(skill202)
+ {
+ level = skill202/5;
+ }
+ }
+ }
+
+ //float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
+ float radius = 5.0f;
+ int32 amount = damage > 0 ? damage : 1;
+ int32 duration = GetSpellDuration(m_spellInfo);
+ TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
+ Map *map = caster->GetMap();
+
+ for(int32 count = 0; count < amount; ++count)
+ {
+ float px, py, pz;
+ GetSummonPosition(px, py, pz, radius, count);
+
+ TempSummon *summon = map->SummonCreature(entry, px, py, pz, m_caster->GetOrientation(), properties, duration, caster);
+ if(!summon)
+ return;
+
+ if(summon->HasSummonMask(SUMMON_MASK_GUARDIAN))
+ ((Guardian*)summon)->InitStatsForLevel(level);
+
+ summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+ }
+}
+
+void Spell::SummonPossessed(uint32 entry, SummonPropertiesEntry const *properties)
+{
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ uint32 level = m_caster->getLevel();
+
+ float x, y, z;
+ m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
+
+ int32 duration = GetSpellDuration(m_spellInfo);
+
+ Pet* pet = ((Player*)m_caster)->SummonPet(entry, x, y, z, m_caster->GetOrientation(), POSSESSED_PET, duration);
+ if(!pet)
+ return;
+
+ pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+ pet->SetCharmedOrPossessedBy(m_caster, true);
+}
+
+void Spell::SummonVehicle(uint32 entry, SummonPropertiesEntry const *properties)
+{
+ float x, y, z;
+ m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
+ Vehicle *vehicle = m_caster->SummonVehicle(entry, x, y, z, m_caster->GetOrientation());
+ if(!vehicle)
+ return;
+
+ vehicle->SetOwnerGUID(m_caster->GetGUID());
+ vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+
+ if(damage)
+ {
+ m_caster->CastSpell(vehicle, damage, true);
+ vehicle->AddPassenger(m_caster);
+ }
+}
+
+void Spell::GetSummonPosition(float &x, float &y, float &z, float radius, uint32 count)
+{
+ if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
+ {
+ // Summon 1 unit in dest location
+ if (count == 0)
+ {
+ x = m_targets.m_destX;
+ y = m_targets.m_destY;
+ z = m_targets.m_destZ;
+ }
+ // Summon in random point all other units if location present
+ else
+ m_caster->GetRandomPoint(m_targets.m_destX,m_targets.m_destY,m_targets.m_destZ,radius,x,y,z);
+ }
+ // Summon if dest location not present near caster
+ else
+ m_caster->GetClosePoint(x,y,z,3.0f);
+}
+
+void Spell::EffectRenamePet(uint32 /*eff_idx*/)
+{
+ if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT ||
+ !((Creature*)unitTarget)->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET)
+ return;
+
+ unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
+}
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index 3da05d37f3d..19a33dff75a 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,36 +19,40 @@
*/
#include "Common.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Log.h"
#include "Opcodes.h"
#include "Spell.h"
-#include "SpellAuras.h"
-#include "BattleGround.h"
-#include "MapManager.h"
#include "ScriptCalls.h"
#include "Totem.h"
#include "TemporarySummon.h"
+#include "SpellAuras.h"
void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
{
// TODO: add targets.read() check
- CHECK_PACKET_SIZE(recvPacket,1+1+1+1+8);
+ CHECK_PACKET_SIZE(recvPacket,1+1+1+4+8+4+1);
Player* pUser = _player;
+
+ // ignore for remote control state
+ if(pUser->m_mover != pUser)
+ return;
+
uint8 bagIndex, slot;
- uint8 spell_count; // number of spells at item, not used
+ uint8 unk_flags; // flags (if 0x02 - some additional data are received)
uint8 cast_count; // next cast if exists (single or not)
uint64 item_guid;
+ uint32 glyphIndex; // something to do with glyphs?
+ uint32 spellid; // casted spell id
- recvPacket >> bagIndex >> slot >> spell_count >> cast_count >> item_guid;
+ recvPacket >> bagIndex >> slot >> cast_count >> spellid >> item_guid >> glyphIndex >> unk_flags;
- Item *pItem = pUser->GetItemByPos(bagIndex, slot);
+ Item *pItem = pUser->GetUseableItemByPos(bagIndex, slot);
if(!pItem)
{
pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL );
@@ -61,7 +65,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
return;
}
- sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, spell_count: %u , cast_count: %u, Item: %u, data length = %i", bagIndex, slot, spell_count, cast_count, pItem->GetEntry(), recvPacket.size());
+ sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, cast_count: %u, spellid: %u, Item: %u, glyphIndex: %u, unk_flags: %u, data length = %i", bagIndex, slot, cast_count, spellid, pItem->GetEntry(), glyphIndex, unk_flags, (uint32)recvPacket.size());
ItemPrototype const *proto = pItem->GetProto();
if(!proto)
@@ -95,7 +99,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
if (pUser->isInCombat())
{
- for(int i = 0; i < 5; ++i)
+ for(int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
if (SpellEntry const *spellInfo = sSpellStore.LookupEntry(proto->Spells[i].SpellId))
{
@@ -126,57 +130,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
if(!Script->ItemUse(pUser,pItem,targets))
{
// no script or script not process request by self
-
- // special learning case
- if(pItem->GetProto()->Spells[0].SpellId==SPELL_ID_GENERIC_LEARN)
- {
- uint32 learning_spell_id = pItem->GetProto()->Spells[1].SpellId;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(SPELL_ID_GENERIC_LEARN);
- if(!spellInfo)
- {
- sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, SPELL_ID_GENERIC_LEARN);
- pUser->SendEquipError(EQUIP_ERR_NONE,pItem,NULL);
- return;
- }
-
- Spell *spell = new Spell(pUser, spellInfo, false);
- spell->m_CastItem = pItem;
- spell->m_cast_count = cast_count; //set count of casts
- spell->m_currentBasePoints[0] = learning_spell_id;
- spell->prepare(&targets);
- return;
- }
-
- // use triggered flag only for items with many spell casts and for not first cast
- int count = 0;
-
- for(int i = 0; i < 5; ++i)
- {
- _Spell const& spellData = pItem->GetProto()->Spells[i];
-
- // no spell
- if(!spellData.SpellId)
- continue;
-
- // wrong triggering type
- if( spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
- continue;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
- if(!spellInfo)
- {
- sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, spellData.SpellId);
- continue;
- }
-
- Spell *spell = new Spell(pUser, spellInfo, (count > 0));
- spell->m_CastItem = pItem;
- spell->m_cast_count = cast_count; //set count of casts
- spell->prepare(&targets);
-
- ++count;
- }
+ pUser->CastItemUseSpell(pItem,targets,cast_count,glyphIndex);
}
}
@@ -190,9 +144,14 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket,1+1);
- sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",recvPacket.size());
+ sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size());
Player* pUser = _player;
+
+ // ignore for remote control state
+ if(pUser->m_mover != pUser)
+ return;
+
uint8 bagIndex, slot;
recvPacket >> bagIndex >> slot;
@@ -227,7 +186,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
}
// required picklocking
- if(lockInfo->requiredlockskill || lockInfo->requiredminingskill)
+ if(lockInfo->Skill[1] || lockInfo->Skill[0])
{
pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, pItem, NULL );
return;
@@ -270,6 +229,11 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
recv_data >> guid;
sLog.outDebug( "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
+
+ // ignore for remote control state
+ if(_player->m_mover != _player)
+ return;
+
GameObject *obj = ObjectAccessor::GetGameObject(*_player, guid);
if(!obj)
@@ -281,17 +245,46 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
obj->Use(_player);
}
+void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
+{
+ CHECK_PACKET_SIZE(recvPacket,8);
+
+ uint64 guid;
+ recvPacket >> guid;
+
+ sLog.outDebug( "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid));
+
+ // ignore for remote control state
+ if(_player->m_mover != _player)
+ return;
+
+ GameObject* go = ObjectAccessor::GetGameObject(*_player,guid);
+ if(!go)
+ return;
+
+ if(!go->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
+ return;
+
+ _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, go->GetEntry());
+}
+
void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
{
- CHECK_PACKET_SIZE(recvPacket,4+1+2);
+ CHECK_PACKET_SIZE(recvPacket,1+4+1);
uint32 spellId;
- uint8 cast_count;
- recvPacket >> spellId;
+ uint8 cast_count, unk_flags;
recvPacket >> cast_count;
+ recvPacket >> spellId;
+ recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received)
+
+ // ignore for remote control state (for player case)
+ Unit* mover = _player->m_mover;
+ if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
+ return;
- sLog.outDebug("WORLD: got cast spell packet, spellId - %u, cast_count: %u data length = %i",
- spellId, cast_count, recvPacket.size());
+ sLog.outDebug("WORLD: got cast spell packet, spellId - %u, cast_count: %u, unk_flags %u, data length = %i",
+ spellId, cast_count, unk_flags, (uint32)recvPacket.size());
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@@ -301,11 +294,23 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
return;
}
- // not have spell or spell passive and not casted by client
- if ( !_player->HasSpell (spellId) || IsPassiveSpell(spellId) )
+ if(mover->GetTypeId()==TYPEID_PLAYER)
{
- //cheater? kick? ban?
- return;
+ // not have spell in spellbook or spell passive and not casted by client
+ if (!((Player*)mover)->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
+ {
+ //cheater? kick? ban?
+ return;
+ }
+ }
+ else
+ {
+ // not have spell in spellbook or spell passive and not casted by client
+ if (!((Creature*)mover)->HasSpell(spellId) || IsPassiveSpell(spellId) )
+ {
+ //cheater? kick? ban?
+ return;
+ }
}
// can't use our own spells when we're in possession of another unit,
@@ -314,7 +319,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// client provided targets
SpellCastTargets targets;
- if(!targets.read(&recvPacket,_player))
+ if(!targets.read(&recvPacket,mover))
return;
// auto-selection buff level base at target level (in spellInfo)
@@ -327,30 +332,42 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
spellInfo = actualSpellInfo;
}
- Spell *spell = new Spell(_player, spellInfo, false);
+ Spell *spell = new Spell(mover, spellInfo, false);
spell->m_cast_count = cast_count; // set count of casts
spell->prepare(&targets);
}
void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket)
{
- CHECK_PACKET_SIZE(recvPacket,4);
+ CHECK_PACKET_SIZE(recvPacket,5);
+
+ // ignore for remote control state (for player case)
+ Unit* mover = _player->m_mover;
+ if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
+ return;
+ // increments with every CANCEL packet, don't use for now
+ uint8 counter;
uint32 spellId;
+ recvPacket >> counter;
recvPacket >> spellId;
//FIXME: hack, ignore unexpected client cancel Deadly Throw cast
if(spellId==26679)
return;
- if(_player->IsNonMeleeSpellCasted(false))
- _player->InterruptNonMeleeSpells(false,spellId);
+ if(mover->IsNonMeleeSpellCasted(false))
+ mover->InterruptNonMeleeSpells(false,spellId);
}
void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket,4);
+ // ignore for remote control state
+ if(_player->m_mover != _player)
+ return;
+
uint32 spellId;
recvPacket >> spellId;
@@ -362,49 +379,27 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL))
return;
- // lifebloom must delete final heal effect
- if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && (spellInfo->SpellFamilyFlags & 0x1000000000LL) )
- {
- Unit::AuraMap::iterator iter;
- while((iter = _player->m_Auras.find(Unit::spellEffectPair(spellId, 1))) != _player->m_Auras.end())
- {
- _player->m_modAuras[SPELL_AURA_DUMMY].remove(iter->second);
-
- Aura* Aur = iter->second;
- _player->m_Auras.erase(iter);
- ++_player->m_removedAuras; // internal count used by unit update
-
- delete Aur;
-
- if( _player->m_Auras.empty() )
- iter = _player->m_Auras.end();
- else
- iter = _player->m_Auras.begin();
-
- }
- }
-
// channeled spell case (it currently casted then)
- if(IsChanneledSpell(spellInfo))
+ if (IsChanneledSpell(spellInfo))
{
- if(Spell* spell = _player->m_currentSpells[CURRENT_CHANNELED_SPELL])
- {
- if(spell->m_spellInfo->Id==spellId)
- {
- spell->cancel();
- }
- }
+ if (_player->m_currentSpells[CURRENT_CHANNELED_SPELL] &&
+ _player->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spellId)
+ _player->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
// non channeled case
- _player->RemoveAurasDueToSpellByCancel(spellId);
+ _player->RemoveAurasDueToSpell(spellId, _player->GetGUID(), AURA_REMOVE_BY_CANCEL);
}
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket, 8+4);
+ // ignore for remote control state
+ if(_player->m_mover != _player)
+ return;
+
uint64 guid;
uint32 spellId;
@@ -418,7 +413,7 @@ void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
return;
}
- Creature* pet=ObjectAccessor::GetCreatureOrPet(*_player,guid);
+ Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid);
if(!pet)
{
@@ -426,7 +421,7 @@ void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
return;
}
- if(pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
+ if(pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
{
sLog.outError( "HandlePetCancelAura.Pet %u isn't pet of player %s", uint32(GUID_LOPART(guid)),GetPlayer()->GetName() );
return;
@@ -452,7 +447,7 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode( WorldPacket& /*recvPacket*
{
// may be better send SMSG_CANCEL_AUTO_REPEAT?
// cancel and prepare for deleting
- _player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
+ _player->m_mover->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
}
/// \todo Complete HandleCancelChanneling function
@@ -470,17 +465,22 @@ void WorldSession::HandleTotemDestroy( WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket, 1);
+ // ignore for remote control state
+ if(_player->m_mover != _player)
+ return;
+
uint8 slotId;
recvPacket >> slotId;
- if (slotId >= MAX_TOTEM)
+ ++slotId;
+ if (slotId >= MAX_TOTEM_SLOT)
return;
- if(!_player->m_TotemSlot[slotId])
+ if(!_player->m_SummonSlot[slotId])
return;
- Creature* totem = ObjectAccessor::GetCreature(*_player,_player->m_TotemSlot[slotId]);
+ Creature* totem = ObjectAccessor::GetCreature(*_player,_player->m_SummonSlot[slotId]);
// Don't unsummon sentry totem
if(totem && totem->isTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY)
((Totem*)totem)->UnSummon();
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 30112caa75a..af8a04740f8 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,10 +22,11 @@
#include "ObjectMgr.h"
#include "SpellAuraDefines.h"
#include "ProgressBar.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "World.h"
#include "Chat.h"
#include "Spell.h"
+#include "BattleGroundMgr.h"
bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS];
@@ -38,25 +39,17 @@ SpellMgr::SpellMgr()
case SPELL_EFFECT_PERSISTENT_AREA_AURA: //27
case SPELL_EFFECT_SUMMON: //28
case SPELL_EFFECT_TRIGGER_MISSILE: //32
- case SPELL_EFFECT_SUMMON_WILD: //41
- case SPELL_EFFECT_SUMMON_GUARDIAN: //42
case SPELL_EFFECT_TRANS_DOOR: //50 summon object
case SPELL_EFFECT_SUMMON_PET: //56
case SPELL_EFFECT_ADD_FARSIGHT: //72
- case SPELL_EFFECT_SUMMON_POSSESSED: //73
- case SPELL_EFFECT_SUMMON_TOTEM: //74
case SPELL_EFFECT_SUMMON_OBJECT_WILD: //76
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT1: //87
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT2: //88
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT3: //89
- case SPELL_EFFECT_SUMMON_TOTEM_SLOT4: //90
- case SPELL_EFFECT_SUMMON_CRITTER: //97
+ //case SPELL_EFFECT_SUMMON_CRITTER: //97 not 303
case SPELL_EFFECT_SUMMON_OBJECT_SLOT1: //104
case SPELL_EFFECT_SUMMON_OBJECT_SLOT2: //105
case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: //106
case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: //107
case SPELL_EFFECT_SUMMON_DEAD_PET: //109
- case SPELL_EFFECT_SUMMON_DEMON: //112
+ //case SPELL_EFFECT_SUMMON_DEMON: //112 not 303
case SPELL_EFFECT_TRIGGER_SPELL_2: //151 ritual of summon
EffectTargetType[i] = SPELL_REQUIRE_DEST;
break;
@@ -73,6 +66,8 @@ SpellMgr::SpellMgr()
case SPELL_EFFECT_DISENCHANT:
case SPELL_EFFECT_FEED_PET:
case SPELL_EFFECT_PROSPECTING:
+ case SPELL_EFFECT_MILLING:
+ case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
EffectTargetType[i] = SPELL_REQUIRE_ITEM;
break;
//caster must be pushed otherwise no sound
@@ -81,6 +76,7 @@ SpellMgr::SpellMgr()
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
+ case SPELL_EFFECT_JUMP2: //42
EffectTargetType[i] = SPELL_REQUIRE_CASTER;
break;
default:
@@ -105,7 +101,6 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_TARGET_ALLY:
case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_ANY:
- case TARGET_UNIT_SINGLE_UNKNOWN:
case TARGET_UNIT_TARGET_ENEMY:
case TARGET_UNIT_TARGET_PARTY:
case TARGET_UNIT_PARTY_TARGET:
@@ -235,6 +230,21 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo)
return (du->Duration[2] == -1) ? -1 : abs(du->Duration[2]);
}
+bool GetDispelChance(Unit* caster, uint32 spellId)
+{
+ // we assume that aura dispel chance is 100% on start
+ // need formula for level difference based chance
+ int32 miss_chance = 0;
+ // Apply dispel mod from aura caster
+ if (caster)
+ {
+ if ( Player* modOwner = caster->GetSpellModOwner() )
+ modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance);
+ }
+ // Try dispel
+ return !roll_chance_i(miss_chance);
+}
+
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
{
SpellCastTimesEntry const *spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->CastingTimeIndex);
@@ -245,19 +255,8 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
int32 castTime = spellCastTimeEntry->CastTime;
- if (spell)
- {
- if(Player* modOwner = spell->GetCaster()->GetSpellModOwner())
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell);
-
- if( !(spellInfo->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_UNK5)) )
- castTime = int32(castTime * spell->GetCaster()->GetFloatValue(UNIT_MOD_CAST_SPEED));
- else
- {
- if (spell->IsRangedSpell() && !spell->IsAutoRepeat())
- castTime = int32(castTime * spell->GetCaster()->m_modAttackSpeedPct[RANGED_ATTACK]);
- }
- }
+ if (spell && spell->GetCaster())
+ spell->GetCaster()->ModSpellCastTime(spellInfo, castTime, spell);
if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !(spell->IsAutoRepeat())))
castTime += 500;
@@ -273,32 +272,21 @@ bool IsPassiveSpell(uint32 spellId)
return (spellInfo->Attributes & SPELL_ATTR_PASSIVE) != 0;
}
-/*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
+bool IsAutocastableSpell(uint32 spellId)
{
- SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
- SpellEntry const *spellInfo_2 = sSpellStore.LookupEntry(spellId_2);
- if(!spellInfo_1 || !spellInfo_2) return false;
- if(spellInfo_1->Id == spellId_2) return false;
-
- if (spellInfo_1->Effect[effIndex_1] != spellInfo_2->Effect[effIndex_2] ||
- spellInfo_1->EffectItemType[effIndex_1] != spellInfo_2->EffectItemType[effIndex_2] ||
- spellInfo_1->EffectMiscValue[effIndex_1] != spellInfo_2->EffectMiscValue[effIndex_2] ||
- spellInfo_1->EffectApplyAuraName[effIndex_1] != spellInfo_2->EffectApplyAuraName[effIndex_2])
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo)
+ return false;
+ if(spellInfo->Attributes & SPELL_ATTR_PASSIVE)
+ return false;
+ if(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
return false;
-
return true;
-}*/
+}
-int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
+bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2)
{
- SpellEntry const*spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
- SpellEntry const*spellInfo_2 = sSpellStore.LookupEntry(spellId_2);
- if(!spellInfo_1 || !spellInfo_2) return 0;
- if (spellId_1 == spellId_2) return 0;
-
- int32 diff = spellInfo_1->EffectBasePoints[effIndex_1] - spellInfo_2->EffectBasePoints[effIndex_2];
- if (spellInfo_1->EffectBasePoints[effIndex_1]+1 < 0 && spellInfo_2->EffectBasePoints[effIndex_2]+1 < 0) return -diff;
- else return diff;
+ return spellmgr.GetSpellRank(spellId_1)<spellmgr.GetSpellRank(spellId_2);
}
SpellSpecific GetSpellSpecific(uint32 spellId)
@@ -315,31 +303,54 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED)
{
for(int i = 0; i < 3; i++)
- if( spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_POWER_REGEN)
+ if( spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POWER_REGEN
+ || spellInfo->EffectApplyAuraName[i] == SPELL_AURA_OBS_MOD_ENERGY)
return SPELL_DRINK;
- else if ( spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_REGEN)
+ else if ( spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_REGEN
+ || spellInfo->EffectApplyAuraName[i] == SPELL_AURA_OBS_MOD_HEALTH)
return SPELL_FOOD;
}
// this may be a hack
else if((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD)
&& !spellInfo->Category)
return SPELL_WELL_FED;
- break;
+ // scrolls effects
+ else
+ {
+ uint32 firstSpell = spellmgr.GetFirstSpellInChain(spellInfo->Id);
+ switch (firstSpell)
+ {
+ // Strength
+ case 8118:
+ // Stamina
+ case 8099:
+ // Spirit
+ case 8112:
+ //Intellect
+ case 8096:
+ // Agility
+ case 8115:
+ // Armor
+ case 8091:
+ return SPELL_SCROLL;
+ }
+ break;
+ }
}
case SPELLFAMILY_MAGE:
{
// family flags 18(Molten), 25(Frost/Ice), 28(Mage)
- if (spellInfo->SpellFamilyFlags & 0x12040000)
+ if (spellInfo->SpellFamilyFlags[0] & 0x12040000)
return SPELL_MAGE_ARMOR;
- if ((spellInfo->SpellFamilyFlags & 0x1000000) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
+ if ((spellInfo->SpellFamilyFlags[0] & 0x1000000) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
return SPELL_MAGE_POLYMORPH;
break;
}
case SPELLFAMILY_WARRIOR:
{
- if (spellInfo->SpellFamilyFlags & 0x00008000010000LL)
+ if (spellInfo->SpellFamilyFlags[1] & 0x000080 || spellInfo->SpellFamilyFlags[0] & 0x10000LL)
return SPELL_POSITIVE_SHOUT;
break;
@@ -350,12 +361,12 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (spellInfo->Dispel == DISPEL_CURSE)
return SPELL_CURSE;
- // family flag 37 (only part spells have family name)
- if (spellInfo->SpellFamilyFlags & 0x2000000000LL)
+ // Warlock (Demon Armor | Demon Skin | Fel Armor)
+ if (spellInfo->SpellFamilyFlags[1] & 0x20000020 || spellInfo->SpellFamilyFlags[2] & 0x00000010)
return SPELL_WARLOCK_ARMOR;
//seed of corruption and corruption
- if (spellInfo->SpellFamilyFlags & 0x1000000002LL)
+ if (spellInfo->SpellFamilyFlags[1] & 0x10 || spellInfo->SpellFamilyFlags[0] & 0x2)
return SPELL_WARLOCK_CORRUPTION;
break;
}
@@ -365,6 +376,10 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (spellInfo->Dispel == DISPEL_POISON)
return SPELL_STING;
+ // only hunter aspects have this
+ if( spellInfo->SpellFamilyFlags[1] & 0x00440000 || spellInfo->SpellFamilyFlags[0] & 0x00380000 || spellInfo->SpellFamilyFlags[2] & 0x00001010)
+ return SPELL_ASPECT;
+
break;
}
case SPELLFAMILY_PALADIN:
@@ -372,16 +387,16 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (IsSealSpell(spellInfo))
return SPELL_SEAL;
- if (spellInfo->SpellFamilyFlags & 0x10000100LL)
+ if (spellInfo->SpellFamilyFlags[0] & 0x11010002)
return SPELL_BLESSING;
- if ((spellInfo->SpellFamilyFlags & 0x00000820180400LL) && (spellInfo->AttributesEx3 & 0x200))
+ if ((spellInfo->SpellFamilyFlags[1] & 0x000008 || spellInfo->SpellFamilyFlags[0] & 0x20180400) && (spellInfo->AttributesEx3 & 0x200))
return SPELL_JUDGEMENT;
for (int i = 0; i < 3; i++)
{
- // only paladin auras have this
- if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PARTY)
+ // only paladin auras have this (for palaldin class family)
+ if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_RAID)
return SPELL_AURA;
}
break;
@@ -396,19 +411,11 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
case SPELLFAMILY_POTION:
return spellmgr.GetSpellElixirSpecific(spellInfo->Id);
- }
-
- // only warlock armor/skin have this (in additional to family cases)
- if( spellInfo->SpellVisual == 130 && spellInfo->SpellIconID == 89)
- {
- return SPELL_WARLOCK_ARMOR;
- }
- // only hunter aspects have this (but not all aspects in hunter family)
- if( spellInfo->activeIconID == 122 && (GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_NATURE) &&
- (spellInfo->Attributes & 0x50000) != 0 && (spellInfo->Attributes & 0x9000010) == 0)
- {
- return SPELL_ASPECT;
+ case SPELLFAMILY_DEATHKNIGHT:
+ if ((spellInfo->Attributes & 0x10) && (spellInfo->AttributesEx2 & 0x10) && (spellInfo->AttributesEx4 & 0x200000))
+ return SPELL_PRESENCE;
+ break;
}
for(int i = 0; i < 3; ++i)
@@ -417,18 +424,17 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
{
switch(spellInfo->EffectApplyAuraName[i])
{
- case SPELL_AURA_TRACK_CREATURES:
- case SPELL_AURA_TRACK_RESOURCES:
- case SPELL_AURA_TRACK_STEALTHED:
- return SPELL_TRACKER;
case SPELL_AURA_MOD_CHARM:
case SPELL_AURA_MOD_POSSESS_PET:
case SPELL_AURA_MOD_POSSESS:
return SPELL_CHARM;
+ case SPELL_AURA_TRACK_CREATURES:
+ case SPELL_AURA_TRACK_RESOURCES:
+ case SPELL_AURA_TRACK_STEALTHED:
+ return SPELL_TRACKER;
}
}
}
-
// elixirs can have different families, but potion most ofc.
if(SpellSpecific sp = spellmgr.GetSpellElixirSpecific(spellInfo->Id))
return sp;
@@ -464,10 +470,12 @@ bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1,uint32 spellSpec2)
case SPELL_MAGE_ARMOR:
case SPELL_ELEMENTAL_SHIELD:
case SPELL_MAGE_POLYMORPH:
+ case SPELL_PRESENCE:
case SPELL_WELL_FED:
case SPELL_DRINK:
case SPELL_FOOD:
case SPELL_CHARM:
+ case SPELL_SCROLL:
return spellSpec1==spellSpec2;
case SPELL_BATTLE_ELIXIR:
return spellSpec2==SPELL_BATTLE_ELIXIR
@@ -497,8 +505,6 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
case TARGET_CURRENT_ENEMY_COORDINATES:
case TARGET_UNIT_CHANNEL:
return false;
- case TARGET_ALL_AROUND_CASTER:
- return (targetB == TARGET_ALL_PARTY || targetB == TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER);
default:
break;
}
@@ -507,20 +513,13 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
return true;
}
-bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
+bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
{
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
if (!spellproto) return false;
switch(spellId)
{
- case 23333: // BG spell
- case 23335: // BG spell
- case 34976: // BG spell
- case 31579: // Arcane Empowerment Rank1 talent aura with one positive and one negative (check not needed in wotlk)
- case 31582: // Arcane Empowerment Rank2
- case 31583: // Arcane Empowerment Rank3
- return true;
case 28441: // not positive dummy spell
case 37675: // Chaos Blast
case 41519: // Mark of Stormrage
@@ -528,6 +527,16 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
case 34700: // Allergic Reaction
case 31719: // Suspension
return false;
+ case 12042: // Arcane Power
+ return true;
+ }
+
+ switch(spellproto->Mechanic)
+ {
+ case MECHANIC_IMMUNE_SHIELD:
+ return true;
+ default:
+ break;
}
switch(spellproto->Effect[effIndex])
@@ -553,6 +562,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
{
case 13139: // net-o-matic special effect
case 23445: // evil twin
+ case 35679: // Protectorate Demolitionist
case 38637: // Nether Exhaustion (red)
case 38638: // Nether Exhaustion (green)
case 38639: // Nether Exhaustion (blue)
@@ -564,15 +574,16 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
case SPELL_AURA_MOD_STAT:
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
case SPELL_AURA_MOD_HEALING_DONE:
+ case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE:
{
- if(spellproto->EffectBasePoints[effIndex]+int32(spellproto->EffectBaseDice[effIndex]) < 0)
+ if(spellproto->CalculateSimpleValue(effIndex) < 0)
return false;
break;
}
case SPELL_AURA_ADD_TARGET_TRIGGER:
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
- if(spellId != spellproto->EffectTriggerSpell[effIndex])
+ if(!deep)
{
uint32 spellTriggeredId = spellproto->EffectTriggerSpell[effIndex];
SpellEntry const *spellTriggeredProto = sSpellStore.LookupEntry(spellTriggeredId);
@@ -582,14 +593,15 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
// non-positive targets of main spell return early
for(int i = 0; i < 3; ++i)
{
+ if (!spellTriggeredProto->Effect[i])
+ continue;
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
- if(IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex],spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !IsPositiveEffect(spellTriggeredId,i))
+ if(IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex],spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !IsPositiveEffect(spellTriggeredId,i, true))
return false;
}
}
}
- break;
case SPELL_AURA_PROC_TRIGGER_SPELL:
// many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example)
break;
@@ -663,19 +675,35 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
switch(spellproto->EffectMiscValue[effIndex])
{
case SPELLMOD_COST: // dependent from bas point sign (negative -> positive)
- if(spellproto->EffectBasePoints[effIndex]+int32(spellproto->EffectBaseDice[effIndex]) > 0)
- return false;
+ if(spellproto->CalculateSimpleValue(effIndex) > 0)
+ {
+ if (!deep)
+ {
+ bool negative = true;
+ for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
+ {
+ if (i != effIndex)
+ if (IsPositiveEffect(spellId, i, true))
+ {
+ negative = false;
+ break;
+ }
+ }
+ if (negative)
+ return false;
+ }
+ }
break;
default:
break;
}
} break;
case SPELL_AURA_MOD_HEALING_PCT:
- if(spellproto->EffectBasePoints[effIndex]+int32(spellproto->EffectBaseDice[effIndex]) < 0)
+ if(spellproto->CalculateSimpleValue(effIndex) < 0)
return false;
break;
case SPELL_AURA_MOD_SKILL:
- if(spellproto->EffectBasePoints[effIndex]+int32(spellproto->EffectBaseDice[effIndex]) < 0)
+ if(spellproto->CalculateSimpleValue(effIndex) < 0)
return false;
break;
case SPELL_AURA_FORCE_REACTION:
@@ -699,11 +727,17 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
if(spellproto->AttributesEx & SPELL_ATTR_EX_NEGATIVE)
return false;
+ if (!deep && spellproto->EffectTriggerSpell[effIndex]
+ && !spellproto->EffectApplyAuraName[effIndex]
+ && IsPositiveTarget(spellproto->EffectImplicitTargetA[effIndex],spellproto->EffectImplicitTargetB[effIndex])
+ && !IsPositiveSpell(spellproto->EffectTriggerSpell[effIndex], true))
+ return false;
+
// ok, positive
return true;
}
-bool IsPositiveSpell(uint32 spellId)
+bool IsPositiveSpell(uint32 spellId, bool deep)
{
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
if (!spellproto) return false;
@@ -711,7 +745,7 @@ bool IsPositiveSpell(uint32 spellId)
// spells with at least one negative effect are considered negative
// some self-applied spells have negative effects but in self casting case negative check ignored.
for (int i = 0; i < 3; i++)
- if (!IsPositiveEffect(spellId, i))
+ if (!IsPositiveEffect(spellId, i, deep))
return false;
return true;
}
@@ -772,13 +806,13 @@ bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId)
return false;
}
-uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form)
+SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form)
{
// talents that learn spells can have stance requirements that need ignore
// (this requirement only for client-side stance show in talent description)
if( GetTalentSpellCost(spellInfo->Id) > 0 &&
(spellInfo->Effect[0]==SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[1]==SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[2]==SPELL_EFFECT_LEARN_SPELL) )
- return 0;
+ return SPELL_CAST_OK;
uint32 stanceMask = (form ? 1 << (form - 1) : 0);
@@ -786,7 +820,7 @@ uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form)
return SPELL_FAILED_NOT_SHAPESHIFT;
if (stanceMask & spellInfo->Stances) // can explicitly be casted in this stance
- return 0;
+ return SPELL_CAST_OK;
bool actAsShifted = false;
if (form > 0)
@@ -795,7 +829,7 @@ uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form)
if (!shapeInfo)
{
sLog.outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
- return 0;
+ return SPELL_CAST_OK;
}
actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
}
@@ -814,7 +848,7 @@ uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form)
return SPELL_FAILED_ONLY_SHAPESHIFT;
}
- return 0;
+ return SPELL_CAST_OK;
}
void SpellMgr::LoadSpellTargetPositions()
@@ -908,8 +942,8 @@ void SpellMgr::LoadSpellAffects()
uint32 count = 0;
- // 0 1 2
- QueryResult *result = WorldDatabase.Query("SELECT entry, effectId, SpellFamilyMask FROM spell_affect");
+ // 0 1 2 3 4
+ QueryResult *result = WorldDatabase.Query("SELECT entry, effectId, SpellClassMask0, SpellClassMask1, SpellClassMask2 FROM spell_affect");
if( !result )
{
@@ -956,26 +990,22 @@ void SpellMgr::LoadSpellAffects()
continue;
}
- uint64 spellAffectMask = fields[2].GetUInt64();
+ flag96 affect(fields[2].GetUInt32(), fields[3].GetUInt32(), fields[4].GetUInt32());
- // Spell.dbc have own data for low part of SpellFamilyMask
- if( spellInfo->EffectItemType[effectId])
- {
- if(spellInfo->EffectItemType[effectId] == spellAffectMask)
- {
- sLog.outErrorDb("Spell %u listed in `spell_affect` have redundant (same with EffectItemType%d) data for effect index (%u) and not needed, skipped.", entry,effectId+1,effectId);
- continue;
- }
+ // Spell.dbc have own data
+ if (effectId>3)
+ continue;
- // 24429 have wrong data in EffectItemType and overwrites by DB, possible bug in client
- if(spellInfo->Id!=24429 && spellInfo->EffectItemType[effectId] != spellAffectMask)
- {
- sLog.outErrorDb("Spell %u listed in `spell_affect` have different low part from EffectItemType%d for effect index (%u) and not needed, skipped.", entry,effectId+1,effectId);
- continue;
- }
+ flag96 dbc_affect;
+ dbc_affect = spellInfo->EffectSpellClassMask[effectId];
+ if(dbc_affect[0] == affect[0] || dbc_affect[1] == affect[1] || dbc_affect[2] == affect[2])
+ {
+ char text[]="ABC";
+ sLog.outErrorDb("Spell %u listed in `spell_affect` have redundant (same with EffectSpellClassMask%c) data for effect index (%u) and not needed, skipped.", entry, text[effectId], effectId);
+ continue;
}
- mSpellAffectMap.insert(SpellAffectMap::value_type((entry<<8) + effectId,spellAffectMask));
+ mSpellAffectMap[(entry<<8) + effectId] = affect;
++count;
} while( result->NextRow() );
@@ -983,7 +1013,7 @@ void SpellMgr::LoadSpellAffects()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u spell affect definitions", count );
+ sLog.outString( ">> Loaded %u custom spell affect definitions", count );
for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id)
{
@@ -999,7 +1029,9 @@ void SpellMgr::LoadSpellAffects()
spellInfo->EffectApplyAuraName[effectId] != SPELL_AURA_ADD_TARGET_TRIGGER) )
continue;
- if(spellInfo->EffectItemType[effectId] != 0)
+ flag96 dbc_affect;
+ dbc_affect = spellInfo->EffectSpellClassMask[effectId];
+ if(dbc_affect)
continue;
if(mSpellAffectMap.find((id<<8) + effectId) != mSpellAffectMap.end())
@@ -1010,33 +1042,19 @@ void SpellMgr::LoadSpellAffects()
}
}
-bool SpellMgr::IsAffectedBySpell(SpellEntry const *spellInfo, uint32 spellId, uint8 effectId, uint64 familyFlags) const
+bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const
{
// false for spellInfo == NULL
- if (!spellInfo)
+ if (!spellInfo || !mod)
return false;
- SpellEntry const *affect_spell = sSpellStore.LookupEntry(spellId);
- // false for affect_spell == NULL
- if (!affect_spell)
+ SpellEntry const *affect_spell = sSpellStore.LookupEntry(mod->spellId);
+ // False if affect_spell == NULL or spellFamily not equal
+ if (!affect_spell || affect_spell->SpellFamilyName != spellInfo->SpellFamilyName)
return false;
- // False if spellFamily not equal
- if (affect_spell->SpellFamilyName != spellInfo->SpellFamilyName)
- return false;
-
- // If familyFlags == 0
- if (!familyFlags)
- {
- // Get it from spellAffect table
- familyFlags = GetSpellAffectMask(spellId,effectId);
- // false if familyFlags == 0
- if (!familyFlags)
- return false;
- }
-
// true
- if (familyFlags & spellInfo->SpellFamilyFlags)
+ if (mod->mask & spellInfo->SpellFamilyFlags)
return true;
return false;
@@ -1048,15 +1066,12 @@ void SpellMgr::LoadSpellProcEvents()
uint32 count = 0;
- // 0 1 2 3 4 5 6 7 8
- QueryResult *result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
+ // 0 1 2 3 4 5 6 7 8 9 10
+ QueryResult *result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if( !result )
{
-
barGoLink bar( 1 );
-
bar.step();
-
sLog.outString();
sLog.outString( ">> Loaded %u spell proc event conditions", count );
return;
@@ -1070,7 +1085,7 @@ void SpellMgr::LoadSpellProcEvents()
bar.step();
- uint16 entry = fields[0].GetUInt16();
+ uint32 entry = fields[0].GetUInt32();
const SpellEntry *spell = sSpellStore.LookupEntry(entry);
if (!spell)
@@ -1083,12 +1098,14 @@ void SpellMgr::LoadSpellProcEvents()
spe.schoolMask = fields[1].GetUInt32();
spe.spellFamilyName = fields[2].GetUInt32();
- spe.spellFamilyMask = fields[3].GetUInt64();
- spe.procFlags = fields[4].GetUInt32();
- spe.procEx = fields[5].GetUInt32();
- spe.ppmRate = fields[6].GetFloat();
- spe.customChance = fields[7].GetFloat();
- spe.cooldown = fields[8].GetUInt32();
+ spe.spellFamilyMask[0] = fields[3].GetUInt32();
+ spe.spellFamilyMask[1] = fields[4].GetUInt32();
+ spe.spellFamilyMask[2] = fields[5].GetUInt32();
+ spe.procFlags = fields[6].GetUInt32();
+ spe.procEx = fields[7].GetUInt32();
+ spe.ppmRate = fields[8].GetFloat();
+ spe.customChance = fields[9].GetFloat();
+ spe.cooldown = fields[10].GetUInt32();
mSpellProcEventMap[entry] = spe;
@@ -1108,82 +1125,56 @@ void SpellMgr::LoadSpellProcEvents()
sLog.outString();
if (customProc)
- sLog.outString( ">> Loaded %u custom spell proc event conditions +%u custom", count, customProc );
+ sLog.outString( ">> Loaded %u extra spell proc event conditions +%u custom", count, customProc );
else
- sLog.outString( ">> Loaded %u spell proc event conditions", count );
+ sLog.outString( ">> Loaded %u extra spell proc event conditions", count );
+}
- /*
- // Commented for now, as it still produces many errors (still quite many spells miss spell_proc_event)
- for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id)
+void SpellMgr::LoadSpellBonusess()
+{
+ mSpellBonusMap.clear(); // need for reload case
+ uint32 count = 0;
+ // 0 1 2 3
+ QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus FROM spell_bonus_data");
+ if( !result )
{
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(id);
- if (!spellInfo)
- continue;
-
- bool found = false;
- for (int effectId = 0; effectId < 3; ++effectId)
- {
- // at this moment check only SPELL_AURA_PROC_TRIGGER_SPELL
- if( spellInfo->EffectApplyAuraName[effectId] == SPELL_AURA_PROC_TRIGGER_SPELL )
- {
- found = true;
- break;
- }
- }
+ barGoLink bar( 1 );
+ bar.step();
+ sLog.outString();
+ sLog.outString( ">> Loaded %u spell bonus data", count);
+ return;
+ }
- if(!found)
- continue;
+ barGoLink bar( result->GetRowCount() );
+ do
+ {
+ Field *fields = result->Fetch();
+ bar.step();
+ uint32 entry = fields[0].GetUInt32();
- if(GetSpellProcEvent(id))
+ const SpellEntry *spell = sSpellStore.LookupEntry(entry);
+ if (!spell)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry);
continue;
+ }
- sLog.outErrorDb("Spell %u (%s) misses spell_proc_event",id,spellInfo->SpellName[sWorld.GetDBClang()]);
- }
- */
-}
-
-/*
-bool SpellMgr::IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, SpellEntry const * procSpell, uint32 procFlags )
-{
- if((procFlags & spellProcEvent->procFlags) == 0)
- return false;
+ SpellBonusEntry sbe;
- // Additional checks in case spell cast/hit/crit is the event
- // Check (if set) school, category, skill line, spell talent mask
- if(spellProcEvent->schoolMask && (!procSpell || (GetSpellSchoolMask(procSpell) & spellProcEvent->schoolMask) == 0))
- return false;
- if(spellProcEvent->category && (!procSpell || procSpell->Category != spellProcEvent->category))
- return false;
- if(spellProcEvent->skillId)
- {
- if (!procSpell)
- return false;
+ sbe.direct_damage = fields[1].GetFloat();
+ sbe.dot_damage = fields[2].GetFloat();
+ sbe.ap_bonus = fields[3].GetFloat();
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(procSpell->Id);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(procSpell->Id);
+ mSpellBonusMap[entry] = sbe;
+ } while( result->NextRow() );
- bool found = false;
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- if(_spell_idx->second->skillId == spellProcEvent->skillId)
- {
- found = true;
- break;
- }
- }
- if (!found)
- return false;
- }
- if(spellProcEvent->spellFamilyName && (!procSpell || spellProcEvent->spellFamilyName != procSpell->SpellFamilyName))
- return false;
- if(spellProcEvent->spellFamilyMask && (!procSpell || (spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags) == 0))
- return false;
+ delete result;
- return true;
+ sLog.outString();
+ sLog.outString( ">> Loaded %u extra spell bonus data", count);
}
-*/
-bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active)
+bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active)
{
// No extra req need
uint32 procEvent_procEx = PROC_EX_NONE;
@@ -1193,9 +1184,8 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
return false;
// Always trigger for this
- if (EventProcFlag & (PROC_FLAG_KILLED | PROC_FLAG_KILL_AND_GET_XP))
+ if (EventProcFlag & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_ON_TRAP_ACTIVATION))
return true;
-
if (spellProcEvent) // Exist event data
{
// Store extra req
@@ -1221,7 +1211,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
// spellFamilyName is Ok need check for spellFamilyMask if present
if(spellProcEvent->spellFamilyMask)
{
- if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags) == 0)
+ if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0)
return false;
active = true; // Spell added manualy -> so its active spell
}
@@ -1320,36 +1310,44 @@ bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellI
bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
{
+ if(IsPassiveSpell(spellInfo->Id)) // ranked passive spell
+ return false;
if(spellInfo->powerType != POWER_MANA && spellInfo->powerType != POWER_HEALTH)
return false;
- if(IsProfessionSpell(spellInfo->Id))
+ if(IsProfessionOrRidingSpell(spellInfo->Id))
+ return false;
+
+ if(spellmgr.IsSkillBonusSpell(spellInfo->Id))
return false;
// All stance spells. if any better way, change it.
for (int i = 0; i < 3; i++)
{
- // Paladin aura Spell
- if(spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN
- && spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AREA_AURA_PARTY)
- return false;
- // Druid form Spell
- if(spellInfo->SpellFamilyName == SPELLFAMILY_DRUID
- && spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA
- && spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
- return false;
- // Rogue Stealth
- if(spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE
- && spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA
- && spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
- return false;
+ switch(spellInfo->SpellFamilyName)
+ {
+ case SPELLFAMILY_PALADIN:
+ // Paladin aura Spell
+ if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AREA_AURA_RAID)
+ return false;
+ break;
+ case SPELLFAMILY_DRUID:
+ // Druid form Spell
+ if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA &&
+ spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
+ return false;
+ break;
+ case SPELLFAMILY_ROGUE:
+ // Rogue Stealth
+ if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA &&
+ spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
+ return false;
+ }
}
return true;
}
bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool sameCaster) const
{
- //if(spellId_1 == spellId_2) // auras due to the same spell
- // return false;
SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
SpellEntry const *spellInfo_2 = sSpellStore.LookupEntry(spellId_2);
@@ -1363,29 +1361,9 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
||(IsSingleFromSpellSpecificPerCaster(spellId_spec_1, spellId_spec_2) && sameCaster))
return true;
- // spells with different specific always stack
- if(spellId_spec_1 || spellId_spec_2)
- return false;
-
if(spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName)
return false;
- // generic spells
- if(!spellInfo_1->SpellFamilyName)
- {
- if(!spellInfo_1->SpellIconID
- || spellInfo_1->SpellIconID == 1
- || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID)
- return false;
- }
-
- // check for class spells
- else
- {
- if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
- return false;
- }
-
if(!sameCaster)
{
for(uint32 i = 0; i < 3; ++i)
@@ -1402,7 +1380,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_POWER_BURN_MANA:
- case SPELL_AURA_OBS_MOD_MANA:
+ case SPELL_AURA_OBS_MOD_ENERGY:
case SPELL_AURA_OBS_MOD_HEALTH:
return false;
default:
@@ -1410,23 +1388,61 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
}
}
-// not needed now because we compare effects last rank of spells
-// if(spellInfo_1->SpellFamilyName && IsRankSpellDueToSpell(spellInfo_1, spellId_2))
-// return true;
+ // hack for Incanter's Absorption
+ if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413)
+ return false;
+
+ spellId_2 = GetLastSpellInChain(spellId_2);
+ spellId_1 = GetLastSpellInChain(spellId_1);
+ if (spellId_1 == spellId_2)
+ return true;
+
+ // generic spells
+ if(!spellInfo_1->SpellFamilyName)
+ {
+ if(!spellInfo_1->SpellIconID
+ || spellInfo_1->SpellIconID == 1
+ || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID)
+ return false;
+ }
+ // check for class spells
+ else
+ {
+ if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
+ return false;
+ }
//use data of highest rank spell(needed for spells which ranks have different effects)
- spellInfo_1=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_1));
- spellInfo_2=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_2));
+ spellInfo_1=sSpellStore.LookupEntry(spellId_1);
+ spellInfo_2=sSpellStore.LookupEntry(spellId_2);
//if spells have exactly the same effect they cannot stack
for(uint32 i = 0; i < 3; ++i)
if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i]
+ // Allow dummy auras stack (needed by 31666 and 58428)
+ || spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_DUMMY
+ || spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_DUMMY
|| spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]
|| spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i]) // paladin resist aura
return false; // need itemtype check? need an example to add that check
return true;
}
+
+bool SpellMgr::IsProfessionOrRidingSpell(uint32 spellId)
+{
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo)
+ return false;
+
+ if(spellInfo->Effect[1] != SPELL_EFFECT_SKILL)
+ return false;
+
+ uint32 skill = spellInfo->EffectMiscValue[1];
+
+ return IsProfessionOrRidingSkill(skill);
+}
+
bool SpellMgr::IsProfessionSpell(uint32 spellId)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
@@ -1460,6 +1476,24 @@ bool SpellMgr::IsPrimaryProfessionFirstRankSpell(uint32 spellId) const
return IsPrimaryProfessionSpell(spellId) && GetSpellRank(spellId)==1;
}
+bool SpellMgr::IsSkillBonusSpell(uint32 spellId) const
+{
+ SkillLineAbilityMap::const_iterator lower = GetBeginSkillLineAbilityMap(spellId);
+ SkillLineAbilityMap::const_iterator upper = GetEndSkillLineAbilityMap(spellId);
+
+ for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
+ {
+ SkillLineAbilityEntry const *pAbility = _spell_idx->second;
+ if (!pAbility || pAbility->learnOnGetSkill != ABILITY_LEARNED_ON_GET_PROFESSION_SKILL)
+ continue;
+
+ if(pAbility->req_skill_value > 0)
+ return true;
+ }
+
+ return false;
+}
+
SpellEntry const* SpellMgr::SelectAuraRankForPlayerLevel(SpellEntry const* spellInfo, uint32 playerLevel) const
{
// ignore passive spells
@@ -1471,7 +1505,8 @@ SpellEntry const* SpellMgr::SelectAuraRankForPlayerLevel(SpellEntry const* spell
{
if( IsPositiveEffect(spellInfo->Id, i) && (
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA ||
- spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PARTY
+ spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
+ spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_RAID
) )
{
needRankSelection = true;
@@ -1546,21 +1581,31 @@ struct SpellRankEntry
uint32 RangeIndex;
uint32 SpellVisual;
uint32 ProcFlags;
- uint64 SpellFamilyFlags;
+ flag96 SpellFamilyFlags;
uint32 TargetAuraState;
uint32 ManaCost;
-
- bool operator()(const SpellRankEntry & _Left,const SpellRankEntry & _Right)const
- {
- return (_Left.SkillId != _Right.SkillId ? _Left.SkillId < _Right.SkillId
- : _Left.SpellName!=_Right.SpellName ? _Left.SpellName < _Right.SpellName
- : _Left.ProcFlags!=_Right.ProcFlags ? _Left.ProcFlags < _Right.ProcFlags
- : _Left.SpellFamilyFlags!=_Right.SpellFamilyFlags ? _Left.SpellFamilyFlags < _Right.SpellFamilyFlags
- : (_Left.SpellVisual!=_Right.SpellVisual) && (!_Left.SpellVisual || !_Right.SpellVisual) ? _Left.SpellVisual < _Right.SpellVisual
- : (_Left.ManaCost!=_Right.ManaCost) && (!_Left.ManaCost || !_Right.ManaCost) ? _Left.ManaCost < _Right.ManaCost
- : (_Left.DurationIndex!=_Right.DurationIndex) && (!_Left.DurationIndex || !_Right.DurationIndex)? _Left.DurationIndex < _Right.DurationIndex
- : (_Left.RangeIndex!=_Right.RangeIndex) && (!_Left.RangeIndex || !_Right.RangeIndex || _Left.RangeIndex==1 || !_Right.RangeIndex==1) ? _Left.RangeIndex < _Right.RangeIndex
- : _Left.TargetAuraState < _Right.TargetAuraState
+ uint32 CastingTimeIndex;
+ flag96 Effect;
+ flag96 Aura;
+ uint16 TalentID;
+
+ bool operator < (const SpellRankEntry & _Right) const
+ {
+ return (SkillId != _Right.SkillId ? SkillId < _Right.SkillId
+ : SpellName!=_Right.SpellName ? SpellName < _Right.SpellName
+ : ProcFlags!=_Right.ProcFlags ? ProcFlags < _Right.ProcFlags
+
+ : Effect!=_Right.Effect ? Effect < _Right.Effect
+ : Aura!=_Right.Aura ? Aura < _Right.Aura
+ : TalentID!=_Right.TalentID ? TalentID < _Right.TalentID
+ : (CastingTimeIndex!=_Right.CastingTimeIndex) && (!CastingTimeIndex || !_Right.CastingTimeIndex || CastingTimeIndex==1 || !_Right.CastingTimeIndex==1) ? CastingTimeIndex < _Right.CastingTimeIndex
+
+ : SpellFamilyFlags!=_Right.SpellFamilyFlags ? SpellFamilyFlags < _Right.SpellFamilyFlags
+ : (SpellVisual!=_Right.SpellVisual) && (!SpellVisual || !_Right.SpellVisual) ? SpellVisual < _Right.SpellVisual
+ : (ManaCost!=_Right.ManaCost) && (!ManaCost || !_Right.ManaCost) ? ManaCost < _Right.ManaCost
+ : (DurationIndex!=_Right.DurationIndex) && (!DurationIndex || !_Right.DurationIndex)? DurationIndex < _Right.DurationIndex
+ : (RangeIndex!=_Right.RangeIndex) && (!RangeIndex || !_Right.RangeIndex || RangeIndex==1 || !_Right.RangeIndex==1) ? RangeIndex < _Right.RangeIndex
+ : TargetAuraState < _Right.TargetAuraState
);
}
};
@@ -1569,6 +1614,7 @@ struct SpellRankValue
{
uint32 Id;
char const *Rank;
+ bool strict;
};
void SpellMgr::LoadSpellChains()
@@ -1581,14 +1627,12 @@ void SpellMgr::LoadSpellChains()
SkillLineAbilityEntry const *AbilityInfo=sSkillLineAbilityStore.LookupEntry(ability_id);
if (!AbilityInfo)
continue;
- if (AbilityInfo->spellId==20154) //exception to these rules (not needed in 3.0.3)
- continue;
if (!AbilityInfo->forward_spellid)
continue;
ChainedSpells.push_back(AbilityInfo->forward_spellid);
}
- std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry> RankMap;
+ std::multimap<SpellRankEntry, SpellRankValue> RankMap;
for (uint32 ability_id=0;ability_id<sSkillLineAbilityStore.GetNumRows();ability_id++)
{
@@ -1598,8 +1642,6 @@ void SpellMgr::LoadSpellChains()
//get only spell with lowest ability_id to prevent doubles
uint32 spell_id=AbilityInfo->spellId;
- if (spell_id==20154) //exception to these rules (not needed in 3.0.3)
- continue;
bool found=false;
for (uint32 i=0; i<ChainedSpells.size(); i++)
{
@@ -1618,7 +1660,7 @@ void SpellMgr::LoadSpellChains()
if(sRank.empty())
continue;
//exception to polymorph spells-make pig and turtle other chain than sheep
- if ((SpellInfo->SpellFamilyName==SPELLFAMILY_MAGE) && (SpellInfo->SpellFamilyFlags & 0x1000000) && (SpellInfo->SpellIconID!=82))
+ if ((SpellInfo->SpellFamilyName==SPELLFAMILY_MAGE) && (SpellInfo->SpellFamilyFlags[0] & 0x1000000) && (SpellInfo->SpellIconID!=82))
continue;
SpellRankEntry entry;
@@ -1630,14 +1672,16 @@ void SpellMgr::LoadSpellChains()
entry.ProcFlags=SpellInfo->procFlags;
entry.SpellFamilyFlags=SpellInfo->SpellFamilyFlags;
entry.TargetAuraState=SpellInfo->TargetAuraState;
- entry.SpellVisual=SpellInfo->SpellVisual;
+ entry.SpellVisual=SpellInfo->SpellVisual[0];
entry.ManaCost=SpellInfo->manaCost;
-
+ entry.CastingTimeIndex=0;
+ entry.TalentID=0;
for (;;)
{
AbilityInfo=mSkillLineAbilityMap.lower_bound(spell_id)->second;
value.Id=spell_id;
value.Rank=SpellInfo->Rank[sWorld.GetDefaultDbcLocale()];
+ value.strict=false;
RankMap.insert(std::pair<SpellRankEntry, SpellRankValue>(entry,value));
spell_id=AbilityInfo->forward_spellid;
SpellInfo=sSpellStore.LookupEntry(spell_id);
@@ -1650,48 +1694,109 @@ void SpellMgr::LoadSpellChains()
uint32 count=0;
- for (std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator itr = RankMap.begin();itr!=RankMap.end();)
+ for (std::multimap<SpellRankEntry, SpellRankValue>::iterator itr = RankMap.begin();itr!=RankMap.end();)
{
SpellRankEntry entry=itr->first;
//trac errors in extracted data
- std::multimap<char const *, std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator> RankErrorMap;
- for (std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator itr2 = RankMap.lower_bound(entry);itr2!=RankMap.upper_bound(entry);itr2++)
+ std::multimap<char const *, std::multimap<SpellRankEntry, SpellRankValue>::iterator> RankErrorMap;
+ for (std::multimap<SpellRankEntry, SpellRankValue>::iterator itr2 = RankMap.lower_bound(entry);itr2!=RankMap.upper_bound(entry);itr2++)
{
bar.step();
- RankErrorMap.insert(std::pair<char const *, std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator>(itr2->second.Rank,itr2));
+ RankErrorMap.insert(std::pair<char const *, std::multimap<SpellRankEntry, SpellRankValue>::iterator>(itr2->second.Rank,itr2));
}
- for (std::multimap<char const *, std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator>::iterator itr2 = RankErrorMap.begin();itr2!=RankErrorMap.end();)
- {
- char const * err_entry=itr2->first;
- uint32 rank_count=RankErrorMap.count(itr2->first);
- if (rank_count>1)
- for (itr2 = RankErrorMap.lower_bound(err_entry);itr2!=RankErrorMap.upper_bound(err_entry);itr2++)
+
+ bool error=false;
+ //if strict == true strict check is not needed
+ if (!itr->second.strict)
+ //check for rank duplicates, if there are any do strict check
+ for (std::multimap<char const *, std::multimap<SpellRankEntry, SpellRankValue>::iterator>::iterator itr2 = RankErrorMap.begin();itr2!=RankErrorMap.end();)
{
- sLog.outDebug("There is a duplicate rank entry (%s) for spell: %u",itr2->first,itr2->second->second.Id);
- sLog.outDebug("Spell %u removed from chain data.",itr2->second->second.Id);
- RankMap.erase(itr2->second);
- itr=RankMap.lower_bound(entry);
+ char const * err_entry=itr2->first;
+ uint32 rank_count=RankErrorMap.count(itr2->first);
+ if (rank_count>1)
+ {
+ error=true;
+ break;
+ }
+ else
+ itr2++;
}
- else
- itr2++;
- }
- //do not proceed for spells with less than 2 ranks
- uint32 spell_max_rank=RankMap.count(entry);
- if (spell_max_rank<2)
+ bool allHaveTalents=true;
+ if (error)
{
- itr=RankMap.upper_bound(entry);
+ std::list<uint32> ConflictedSpells;
+ for (std::multimap<SpellRankEntry, SpellRankValue>::iterator itr2 = RankMap.lower_bound(entry);itr2!=RankMap.upper_bound(entry);itr2=RankMap.lower_bound(entry))
+ {
+ ConflictedSpells.push_back(itr2->second.Id);
+ if (!GetTalentSpellPos(itr2->second.Id))
+ allHaveTalents=false;
+ RankMap.erase(itr2);
+ }
+ SpellRankEntry nextEntry, currEntry;
+ for (;!ConflictedSpells.empty();ConflictedSpells.pop_front())
+ {
+ SpellEntry const *SpellInfo=sSpellStore.LookupEntry(ConflictedSpells.front());
+ currEntry.SkillId=entry.SkillId;
+ currEntry.SpellName=SpellInfo->SpellName[sWorld.GetDefaultDbcLocale()];
+ currEntry.DurationIndex=SpellInfo->DurationIndex;
+ currEntry.RangeIndex=SpellInfo->rangeIndex;
+ currEntry.ProcFlags=SpellInfo->procFlags;
+ currEntry.SpellFamilyFlags=SpellInfo->SpellFamilyFlags;
+ //compare talents only when all spells from chain have entry
+ //to prevent wrong results with spells which have first rank talented and other not
+ if (allHaveTalents)
+ currEntry.TalentID=GetTalentSpellPos(ConflictedSpells.front())->talent_id;
+ else
+ currEntry.TalentID=0;
+ currEntry.TargetAuraState=SpellInfo->TargetAuraState;
+ currEntry.SpellVisual=SpellInfo->SpellVisual[0];
+ currEntry.ManaCost=SpellInfo->manaCost;
+
+ //compare effects and casting time
+ currEntry.CastingTimeIndex=SpellInfo->CastingTimeIndex;
+ currEntry.Effect[0]=SpellInfo->Effect[0];
+ currEntry.Effect[1]=SpellInfo->Effect[1];
+ currEntry.Effect[2]=SpellInfo->Effect[2];
+
+ currEntry.Aura[0]=SpellInfo->EffectApplyAuraName[0];
+ currEntry.Aura[1]=SpellInfo->EffectApplyAuraName[1];
+ currEntry.Aura[2]=SpellInfo->EffectApplyAuraName[2];
+
+ SpellRankValue currValue;
+ currValue.Id=ConflictedSpells.front();
+ currValue.Rank=SpellInfo->Rank[sWorld.GetDefaultDbcLocale()];
+ currValue.strict=true;
+ RankMap.insert(std::pair<SpellRankEntry, SpellRankValue>(currEntry,currValue));
+ }
+ itr=RankMap.begin();
continue;
}
+ else
+ for (std::multimap<char const *, std::multimap<SpellRankEntry, SpellRankValue>::iterator>::iterator itr2 = RankErrorMap.begin();itr2!=RankErrorMap.end();)
+ {
+ char const * err_entry=itr2->first;
+ uint32 rank_count=RankErrorMap.count(itr2->first);
+ if (rank_count>1)
+ for (itr2 = RankErrorMap.lower_bound(err_entry);itr2!=RankErrorMap.upper_bound(err_entry);itr2++)
+ {
+ sLog.outDebug("There is a duplicate rank entry (%s) for spell: %u",itr2->first,itr2->second->second.Id);
+ if (!(itr2->second->second.Id==52375 || itr2->second->second.Id==45902))
+ {
+ sLog.outDebug("Spell %u removed from chain data.",itr2->second->second.Id);
+ RankMap.erase(itr2->second);
+ }
+ }
+ else
+ itr2++;
+ }
- itr=RankMap.upper_bound(entry);
-
- //order spells by spells by spellLevel
+ //order spells by spellLevel
std::list<uint32> RankedSpells;
uint32 min_spell_lvl=0;
- std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator min_itr;
+ std::multimap<SpellRankEntry, SpellRankValue>::iterator min_itr;
for (;RankMap.count(entry);)
{
- for (std::multimap<SpellRankEntry, SpellRankValue,SpellRankEntry>::iterator itr2 = RankMap.lower_bound(entry);itr2!=RankMap.upper_bound(entry);itr2++)
+ for (std::multimap<SpellRankEntry, SpellRankValue>::iterator itr2 = RankMap.lower_bound(entry);itr2!=RankMap.upper_bound(entry);itr2++)
{
SpellEntry const *SpellInfo=sSpellStore.LookupEntry(itr2->second.Id);
if (SpellInfo->spellLevel<min_spell_lvl || itr2==RankMap.lower_bound(entry))
@@ -1727,9 +1832,13 @@ void SpellMgr::LoadSpellChains()
}
}
+ //do not proceed for spells with less than 2 ranks
+ itr=RankMap.begin();
+ if (RankedSpells.size()<2)
+ continue;
+
count++;
- itr=RankMap.upper_bound(entry);
uint32 spell_rank=1;
for(std::list<uint32>::iterator itr2 = RankedSpells.begin();itr2!=RankedSpells.end();spell_rank++)
{
@@ -1753,8 +1862,8 @@ void SpellMgr::LoadSpellChains()
}
//uncomment these two lines to print yourself list of spell_chains on startup
-// for (UNORDERED_MAP<uint32, SpellChainNode>::iterator itr=mSpellChains.begin();itr!=mSpellChains.end();itr++)
-// sLog.outString( "Id: %u, Rank: %d , %s",itr->first,itr->second.rank, sSpellStore.LookupEntry(itr->first)->Rank[sWorld.GetDefaultDbcLocale()]);
+ //for (UNORDERED_MAP<uint32, SpellChainNode>::iterator itr=mSpellChains.begin();itr!=mSpellChains.end();itr++)
+ //sLog.outString( "Id: %u, Rank: %d , %s, %u, %u, %u, %u",itr->first,itr->second.rank, sSpellStore.LookupEntry(itr->first)->Rank[sWorld.GetDefaultDbcLocale()], itr->second.first, itr->second.last,itr->second.next ,itr->second.prev);
sLog.outString();
sLog.outString( ">> Loaded %u spell chains",count);
@@ -1766,8 +1875,10 @@ void SpellMgr::LoadSpellLearnSkills()
// search auto-learned skills and add its to map also for use in unlearn spells/talents
uint32 dbc_count = 0;
+ barGoLink bar( sSpellStore.GetNumRows() );
for(uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell)
{
+ bar.step();
SpellEntry const* entry = sSpellStore.LookupEntry(spell);
if(!entry)
@@ -1780,10 +1891,10 @@ void SpellMgr::LoadSpellLearnSkills()
SpellLearnSkillNode dbc_node;
dbc_node.skill = entry->EffectMiscValue[i];
if ( dbc_node.skill != SKILL_RIDING )
- dbc_node.value = 1;
+ dbc_node.value = 1;
else
- dbc_node.value = (entry->EffectBasePoints[i]+1)*75;
- dbc_node.maxvalue = (entry->EffectBasePoints[i]+1)*75;
+ dbc_node.value = entry->CalculateSimpleValue(i)*75;
+ dbc_node.maxvalue = entry->CalculateSimpleValue(i)*75;
SpellLearnSkillNode const* db_node = GetSpellLearnSkill(spell);
@@ -1802,7 +1913,8 @@ void SpellMgr::LoadSpellLearnSpells()
{
mSpellLearnSpells.clear(); // need for reload case
- QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID FROM spell_learn_spell");
+ // 0 1 2
+ QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if(!result)
{
barGoLink bar( 1 );
@@ -1826,6 +1938,7 @@ void SpellMgr::LoadSpellLearnSpells()
SpellLearnSpellNode node;
node.spell = fields[1].GetUInt32();
+ node.active = fields[2].GetBool();
node.autoLearned= false;
if(!sSpellStore.LookupEntry(spell_id))
@@ -1862,7 +1975,16 @@ void SpellMgr::LoadSpellLearnSpells()
{
SpellLearnSpellNode dbc_node;
dbc_node.spell = entry->EffectTriggerSpell[i];
- dbc_node.autoLearned = true;
+ dbc_node.active = true; // all dbc based learned spells is active (show in spell book or hide by client itself)
+
+ // ignore learning not existed spells (broken/outdated/or generic learnig spell 483
+ if(!sSpellStore.LookupEntry(dbc_node.spell))
+ continue;
+
+ // talent or passive spells or skill-step spells auto-casted and not need dependent learning,
+ // pet teaching spells don't must be dependent learning (casted)
+ // other required explicit dependent learning
+ dbc_node.autoLearned = entry->EffectImplicitTargetA[i]==TARGET_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
SpellLearnSpellMap::const_iterator db_node_begin = GetBeginSpellLearnSpell(spell);
SpellLearnSpellMap::const_iterator db_node_end = GetEndSpellLearnSpell(spell);
@@ -2094,7 +2216,7 @@ void SpellMgr::LoadSpellPetAuras()
continue;
}
- PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]);
+ PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->CalculateSimpleValue(i));
mSpellPetAuraMap[spell] = pa;
}
@@ -2179,9 +2301,17 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->Effect[j] = SPELL_EFFECT_TRIGGER_MISSILE;
break;
}
+
+ switch(SpellTargetType[spellInfo->EffectImplicitTargetA[j]])
+ {
+ case TARGET_TYPE_UNIT_TARGET:
+ case TARGET_TYPE_DEST_TARGET:
+ spellInfo->Targets |= TARGET_FLAG_UNIT;
+ break;
+ }
}
- if(spellInfo->SpellVisual == 3879)
+ if(spellInfo->SpellVisual[0] == 3879)
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK;
switch(i)
@@ -2209,7 +2339,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 45027: // Revitalize
case 45976: // Muru Portal Channel
case 39365: // Thundering Storm
- case 41071: // Raise Dead
+ case 41071: // Raise Dead (HACK)
spellInfo->MaxAffectedTargets = 1;
break;
case 41376: // Spite
@@ -2220,6 +2350,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 46771: //Flame Sear
case 45248: //Shadow Blades
case 41303: // Soul Drain
+ case 54172: // Divine Storm (heal)
spellInfo->MaxAffectedTargets = 3;
break;
case 38310: //Multi-Shot
@@ -2246,10 +2377,45 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->MaxAffectedTargets = 1;
spellInfo->EffectTriggerSpell[0] = 33760;
break;
+ case 1122: // Inferno
+ case 18662: // Curse of Doom
+ spellInfo->EffectBasePoints[0] = 0; //prevent summon too many of them
+ break;
+ case 17941: // Shadow Trance
+ case 22008: // Netherwind Focus
+ case 31834: // Light's Grace
+ case 34754: // Clearcasting
+ case 34936: // Backlash
+ case 48108: // Hot Streak
+ case 51124: // Killing Machine
+ case 54741: // Firestarter
+ case 57761: // Fireball!
+ case 39805: // Lightning Overload
+ case 52437: // Sudden Death
+ spellInfo->procCharges=1;
+ break;
+ case 44544: // Fingers of Frost
+ spellInfo->procCharges=2;
+ break;
+ case 28200: // Ascendance (Talisman of Ascendance trinket)
+ spellInfo->procCharges=6;
+ break;
default:
break;
}
+
+ switch(spellInfo->SpellFamilyName)
+ {
+ case SPELLFAMILY_DRUID:
+ //starfall
+ if(spellInfo->SpellFamilyFlags[2] & 0x100)
+ spellInfo->MaxAffectedTargets = 2;
+ break;
+ }
}
+
+ SummonPropertiesEntry *properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121));
+ properties->Type = SUMMON_TYPE_TOTEM;
}
void SpellMgr::LoadSpellLinked()
@@ -2326,6 +2492,48 @@ void SpellMgr::LoadSpellLinked()
}
/// Some checks for spells, to prevent adding depricated/broken spells for trainers, spell book, etc
+void SpellMgr::LoadPetLevelupSpellMap()
+{
+ mPetLevelupSpellMap.clear(); // need for reload case
+
+ uint32 count=0;
+ for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
+ {
+ CreatureFamilyEntry const *creatureFamily=sCreatureFamilyStore.LookupEntry(i);
+ if(!creatureFamily) // not exist
+ continue;
+
+ for (uint8 j = 0; j < 2; ++j)
+ {
+ if (creatureFamily->skillLine[j]==0)
+ continue;
+
+ for (uint32 k=0;k<sSkillLineAbilityStore.GetNumRows();++k)
+ {
+ SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(k);
+ if (!skillLine)
+ continue;
+ if (creatureFamily->skillLine[j]!=skillLine->skillId)
+ continue;
+ SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId);
+ // not exist
+ if(!spell)
+ continue;
+ if (!spell->spellLevel)
+ continue;
+ if (!spell->SpellFamilyName)
+ continue;
+ mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id )));
+ count++;
+ }
+ }
+ }
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u pet levelup spells", count );
+}
+
+/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
{
// not exist
@@ -2400,82 +2608,326 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
return true;
}
-bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 zone_id,uint32 area_id)
+void SpellMgr::LoadSpellAreas()
{
- // normal case
- if( spellInfo->AreaId && spellInfo->AreaId != zone_id && spellInfo->AreaId != area_id )
- return false;
+ mSpellAreaMap.clear(); // need for reload case
+ mSpellAreaForQuestMap.clear();
+ mSpellAreaForActiveQuestMap.clear();
+ mSpellAreaForQuestEndMap.clear();
+ mSpellAreaForAuraMap.clear();
+
+ uint32 count = 0;
+
+ // 0 1 2 3 4 5 6 7 8
+ QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
+
+ if( !result )
+ {
+ barGoLink bar( 1 );
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u spell area requirements", count );
+ return;
+ }
- // elixirs (all area dependent elixirs have family SPELLFAMILY_POTION, use this for speedup)
- if(spellInfo->SpellFamilyName==SPELLFAMILY_POTION)
+ barGoLink bar( result->GetRowCount() );
+
+ do
{
- if(uint32 mask = spellmgr.GetSpellElixirMask(spellInfo->Id))
+ Field *fields = result->Fetch();
+
+ bar.step();
+
+ uint32 spell = fields[0].GetUInt32();
+ SpellArea spellArea;
+ spellArea.spellId = spell;
+ spellArea.areaId = fields[1].GetUInt32();
+ spellArea.questStart = fields[2].GetUInt32();
+ spellArea.questStartCanActive = fields[3].GetBool();
+ spellArea.questEnd = fields[4].GetUInt32();
+ spellArea.auraSpell = fields[5].GetInt32();
+ spellArea.raceMask = fields[6].GetUInt32();
+ spellArea.gender = Gender(fields[7].GetUInt8());
+ spellArea.autocast = fields[8].GetBool();
+
+ if(!sSpellStore.LookupEntry(spell))
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` does not exist", spell);
+ continue;
+ }
+
{
- if(mask & ELIXIR_BATTLE_MASK)
+ bool ok = true;
+ SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId);
+ for(SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
+ {
+ if(spellArea.spellId && itr->second.spellId && spellArea.spellId != itr->second.spellId)
+ continue;
+ if(spellArea.areaId && itr->second.areaId && spellArea.areaId!= itr->second.areaId)
+ continue;
+ if(spellArea.questStart && itr->second.questStart && spellArea.questStart!= itr->second.questStart)
+ continue;
+ if(spellArea.auraSpell && itr->second.auraSpell && spellArea.auraSpell!= itr->second.auraSpell)
+ continue;
+ if(spellArea.raceMask && itr->second.raceMask && (spellArea.raceMask & itr->second.raceMask)==0)
+ continue;
+ if(spellArea.gender != GENDER_NONE && itr->second.gender != GENDER_NONE && spellArea.gender!= itr->second.gender)
+ continue;
+
+ // duplicate by requirements
+ ok =false;
+ break;
+ }
+
+ if(!ok)
{
- if(spellInfo->Id==45373) // Bloodberry Elixir
- return zone_id==4075;
+ sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
+ continue;
}
- if(mask & ELIXIR_UNSTABLE_MASK)
+
+ }
+
+ if(spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId);
+ continue;
+ }
+
+ if(spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart))
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
+ continue;
+ }
+
+ if(spellArea.questEnd)
+ {
+ if(!objmgr.GetQuestTemplate(spellArea.questEnd))
{
- // in the Blade's Edge Mountains Plateaus and Gruul's Lair.
- return zone_id ==3522 || map_id==565;
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
+ continue;
}
- if(mask & ELIXIR_SHATTRATH_MASK)
+
+ if(spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive)
{
- // in Tempest Keep, Serpentshrine Cavern, Caverns of Time: Mount Hyjal, Black Temple, Sunwell Plateau
- if(zone_id ==3607 || map_id==534 || map_id==564 || zone_id==4075)
- return true;
+ sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd);
+ continue;
+ }
+ }
- MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
- if(!mapEntry)
- return false;
+ if(spellArea.auraSpell)
+ {
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell));
+ if(!spellInfo)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell));
+ continue;
+ }
- return mapEntry->multimap_id==206;
+ if(spellInfo->EffectApplyAuraName[0]!=SPELL_AURA_DUMMY && spellInfo->EffectApplyAuraName[0]!=SPELL_AURA_PHASE)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell requirement (%u) without dummy/phase aura in effect 0", spell,abs(spellArea.auraSpell));
+ continue;
}
- // elixirs not have another limitations
- return true;
+ if(abs(spellArea.auraSpell)==spellArea.spellId)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell,abs(spellArea.auraSpell));
+ continue;
+ }
+
+ // not allow autocast chains by auraSpell field (but allow use as alternative if not present)
+ if(spellArea.autocast && spellArea.auraSpell > 0)
+ {
+ bool chain = false;
+ SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
+ for(SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
+ {
+ if(itr->second->autocast && itr->second->auraSpell > 0)
+ {
+ chain = true;
+ break;
+ }
+ }
+
+ if(chain)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
+ continue;
+ }
+
+ SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
+ for(SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
+ {
+ if(itr2->second.autocast && itr2->second.auraSpell > 0)
+ {
+ chain = true;
+ break;
+ }
+ }
+
+ if(chain)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
+ continue;
+ }
+ }
+ }
+
+ if(spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask);
+ continue;
+ }
+
+ if(spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell,spellArea.gender);
+ continue;
+ }
+
+ SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second;
+
+ // for search by current zone/subzone at zone/subzone change
+ if(spellArea.areaId)
+ mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa));
+
+ // for search at quest start/reward
+ if(spellArea.questStart)
+ {
+ if(spellArea.questStartCanActive)
+ mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
+ else
+ mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
}
+
+ // for search at quest start/reward
+ if(spellArea.questEnd)
+ mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa));
+
+ // for search at aura apply
+ if(spellArea.auraSpell)
+ mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa));
+
+ ++count;
+ } while( result->NextRow() );
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u spell area requirements", count );
+}
+
+SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player)
+{
+ // normal case
+ if( spellInfo->AreaGroupId > 0)
+ {
+ bool found = false;
+
+ AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(spellInfo->AreaGroupId);
+ if(groupEntry)
+ {
+ for (uint8 i=0; i<7; i++)
+ if( groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id )
+ found = true;
+ }
+
+ if(!found)
+ return SPELL_FAILED_INCORRECT_AREA;
}
- // special cases zone check (maps checked by multimap common id)
+ // DB base check (if non empty then must fit at least single for allow)
+ SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id);
+ if(saBounds.first != saBounds.second)
+ {
+ for(SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
+ {
+ if(itr->second.IsFitToRequirements(player,zone_id,area_id))
+ return SPELL_CAST_OK;
+ }
+ return SPELL_FAILED_INCORRECT_AREA;
+ }
+
+ // bg spell checks
switch(spellInfo->Id)
{
- case 41618: // Bottled Nethergon Energy
- case 41620: // Bottled Nethergon Vapor
+ case 23333: // Warsong Flag
+ case 23335: // Silverwing Flag
+ return map_id == 489 && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
+ case 34976: // Netherstorm Flag
+ return map_id == 566 && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
+ case 2584: // Waiting to Resurrect
+ case 22011: // Spirit Heal Channel
+ case 22012: // Spirit Heal
+ case 24171: // Resurrection Impact Visual
+ case 42792: // Recently Dropped Flag
+ case 43681: // Inactive
+ case 44535: // Spirit Heal (mana)
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry)
- return false;
+ return SPELL_FAILED_INCORRECT_AREA;
- return mapEntry->multimap_id==206;
+ return mapEntry->IsBattleGround() && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
- case 41617: // Cenarion Mana Salve
- case 41619: // Cenarion Healing Salve
+ case 44521: // Preparation
{
+ if(!player)
+ return SPELL_FAILED_REQUIRES_AREA;
+
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry)
- return false;
+ return SPELL_FAILED_INCORRECT_AREA;
+
+ if(!mapEntry->IsBattleGround())
+ return SPELL_FAILED_REQUIRES_AREA;
- return mapEntry->multimap_id==207;
+ BattleGround* bg = player->GetBattleGround();
+ return bg && bg->GetStatus()==STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
+ }
+ case 32724: // Gold Team (Alliance)
+ case 32725: // Green Team (Alliance)
+ case 35774: // Gold Team (Horde)
+ case 35775: // Green Team (Horde)
+ {
+ MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
+ if(!mapEntry)
+ return SPELL_FAILED_INCORRECT_AREA;
+
+ return mapEntry->IsBattleArena() && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
+ }
+ case 32727: // Arena Preparation
+ {
+ if(!player)
+ return SPELL_FAILED_REQUIRES_AREA;
+
+ MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
+ if(!mapEntry)
+ return SPELL_FAILED_INCORRECT_AREA;
+
+ if(!mapEntry->IsBattleArena())
+ return SPELL_FAILED_REQUIRES_AREA;
+
+ BattleGround* bg = player->GetBattleGround();
+ return bg && bg->GetStatus()==STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
- case 40216: // Dragonmaw Illusion
- case 42016: // Dragonmaw Illusion
- return area_id == 3759 || area_id == 3966 || area_id == 3939;
}
- return true;
+ return SPELL_CAST_OK;
}
void SpellMgr::LoadSkillLineAbilityMap()
{
mSkillLineAbilityMap.clear();
+ barGoLink bar( sSkillLineAbilityStore.GetNumRows() );
uint32 count = 0;
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); i++)
{
+ bar.step();
SkillLineAbilityEntry const *SkillInfo = sSkillLineAbilityStore.LookupEntry(i);
if(!SkillInfo)
continue;
@@ -2485,7 +2937,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
}
sLog.outString();
- sLog.outString(">> Loaded %u SkillLineAbility MultiMap", count);
+ sLog.outString(">> Loaded %u SkillLineAbility MultiMap Data", count);
}
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto, bool triggered)
@@ -2493,56 +2945,49 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
// Explicit Diminishing Groups
switch(spellproto->SpellFamilyName)
{
- case SPELLFAMILY_MAGE:
- {
- // Polymorph
- if ((spellproto->SpellFamilyFlags & 0x00001000000LL) && spellproto->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
- return DIMINISHING_POLYMORPH;
- break;
- }
case SPELLFAMILY_ROGUE:
{
// Kidney Shot
- if (spellproto->SpellFamilyFlags & 0x00000200000LL)
+ if (spellproto->SpellFamilyFlags[0] & 0x200000)
return DIMINISHING_KIDNEYSHOT;
// Sap
- else if (spellproto->SpellFamilyFlags & 0x00000000080LL)
+ else if (spellproto->SpellFamilyFlags[0] & 0x80)
return DIMINISHING_POLYMORPH;
// Gouge
- else if (spellproto->SpellFamilyFlags & 0x00000000008LL)
+ else if (spellproto->SpellFamilyFlags[0] & 0x8)
return DIMINISHING_POLYMORPH;
// Blind
- else if (spellproto->SpellFamilyFlags & 0x00001000000LL)
+ else if (spellproto->SpellFamilyFlags[0] & 0x00001000000)
return DIMINISHING_BLIND_CYCLONE;
break;
}
case SPELLFAMILY_WARLOCK:
{
// Death Coil
- if (spellproto->SpellFamilyFlags & 0x00000080000LL)
+ if (spellproto->SpellFamilyFlags[0] & 0x00000080000)
return DIMINISHING_DEATHCOIL;
// Seduction
- if (spellproto->SpellFamilyFlags & 0x00040000000LL)
+ if (spellproto->SpellFamilyFlags[0] & 0x00040000000)
return DIMINISHING_FEAR;
// Fear
//else if (spellproto->SpellFamilyFlags & 0x40840000000LL)
// return DIMINISHING_WARLOCK_FEAR;
// Curses/etc
- else if (spellproto->SpellFamilyFlags & 0x00080000000LL)
+ else if (spellproto->SpellFamilyFlags[0] & 0x80000000)
return DIMINISHING_LIMITONLY;
break;
}
case SPELLFAMILY_DRUID:
{
// Cyclone
- if (spellproto->SpellFamilyFlags & 0x02000000000LL)
+ if (spellproto->SpellFamilyFlags[1] & 0x020)
return DIMINISHING_BLIND_CYCLONE;
break;
}
case SPELLFAMILY_WARRIOR:
{
// Hamstring - limit duration to 10s in PvP
- if (spellproto->SpellFamilyFlags & 0x00000000002LL)
+ if (spellproto->SpellFamilyFlags[0] & 0x00000000002)
return DIMINISHING_LIMITONLY;
break;
}
@@ -2551,30 +2996,21 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
}
// Get by mechanic
- for (uint8 i=0;i<3;++i)
- {
- if (spellproto->Mechanic == MECHANIC_STUN || spellproto->EffectMechanic[i] == MECHANIC_STUN)
- return triggered ? DIMINISHING_TRIGGER_STUN : DIMINISHING_CONTROL_STUN;
- else if (spellproto->Mechanic == MECHANIC_SLEEP || spellproto->EffectMechanic[i] == MECHANIC_SLEEP)
- return DIMINISHING_SLEEP;
- else if (spellproto->Mechanic == MECHANIC_ROOT || spellproto->EffectMechanic[i] == MECHANIC_ROOT)
- return triggered ? DIMINISHING_TRIGGER_ROOT : DIMINISHING_CONTROL_ROOT;
- else if (spellproto->Mechanic == MECHANIC_FEAR || spellproto->EffectMechanic[i] == MECHANIC_FEAR)
- return DIMINISHING_FEAR;
- else if (spellproto->Mechanic == MECHANIC_CHARM || spellproto->EffectMechanic[i] == MECHANIC_CHARM)
- return DIMINISHING_CHARM;
- else if (spellproto->Mechanic == MECHANIC_SILENCE || spellproto->EffectMechanic[i] == MECHANIC_SILENCE)
- return DIMINISHING_SILENCE;
- else if (spellproto->Mechanic == MECHANIC_DISARM || spellproto->EffectMechanic[i] == MECHANIC_DISARM)
- return DIMINISHING_DISARM;
- else if (spellproto->Mechanic == MECHANIC_FREEZE || spellproto->EffectMechanic[i] == MECHANIC_FREEZE)
- return DIMINISHING_FREEZE;
- else if (spellproto->Mechanic == MECHANIC_KNOCKOUT|| spellproto->EffectMechanic[i] == MECHANIC_KNOCKOUT ||
- spellproto->Mechanic == MECHANIC_SAPPED || spellproto->EffectMechanic[i] == MECHANIC_SAPPED)
- return DIMINISHING_KNOCKOUT;
- else if (spellproto->Mechanic == MECHANIC_BANISH || spellproto->EffectMechanic[i] == MECHANIC_BANISH)
- return DIMINISHING_BANISH;
- }
+ uint32 mechanic = GetAllSpellMechanicMask(spellproto);
+ if (mechanic == MECHANIC_NONE) return DIMINISHING_NONE;
+ if (mechanic & (1<<MECHANIC_STUN)) return triggered ? DIMINISHING_TRIGGER_STUN : DIMINISHING_CONTROL_STUN;
+ if (mechanic & (1<<MECHANIC_SLEEP)) return DIMINISHING_SLEEP;
+ if (mechanic & (1<<MECHANIC_POLYMORPH)) return DIMINISHING_POLYMORPH;
+ if (mechanic & (1<<MECHANIC_ROOT)) return triggered ? DIMINISHING_TRIGGER_ROOT : DIMINISHING_CONTROL_ROOT;
+ if (mechanic & (1<<MECHANIC_FEAR)) return DIMINISHING_FEAR;
+ if (mechanic & (1<<MECHANIC_CHARM)) return DIMINISHING_CHARM;
+ if (mechanic & (1<<MECHANIC_SILENCE)) return DIMINISHING_SILENCE;
+ if (mechanic & (1<<MECHANIC_DISARM)) return DIMINISHING_DISARM;
+ if (mechanic & (1<<MECHANIC_FREEZE)) return DIMINISHING_FREEZE;
+ if (mechanic & ((1<<MECHANIC_KNOCKOUT) | (1<<MECHANIC_SAPPED))) return DIMINISHING_KNOCKOUT;
+ if (mechanic & (1<<MECHANIC_BANISH)) return DIMINISHING_BANISH;
+ if (mechanic & (1<<MECHANIC_HORROR)) return DIMINISHING_DEATHCOIL;
+
return DIMINISHING_NONE;
}
@@ -2631,3 +3067,55 @@ DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
return DRTYPE_NONE;
}
+bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const
+{
+ if(gender!=GENDER_NONE)
+ {
+ // not in expected gender
+ if(!player || gender != player->getGender())
+ return false;
+ }
+
+ if(raceMask)
+ {
+ // not in expected race
+ if(!player || !(raceMask & player->getRaceMask()))
+ return false;
+ }
+
+ if(areaId)
+ {
+ // not in expected zone
+ if(newZone!=areaId && newArea!=areaId)
+ return false;
+ }
+
+ if(questStart)
+ {
+ // not in expected required quest state
+ if(!player || (!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart))
+ return false;
+ }
+
+ if(questEnd)
+ {
+ // not in expected forbidden quest state
+ if(!player || player->GetQuestRewardStatus(questEnd))
+ return false;
+ }
+
+ if(auraSpell)
+ {
+ // not have expected aura
+ if(!player)
+ return false;
+ if(auraSpell > 0)
+ // have expected aura
+ return player->HasAura(auraSpell);
+ else
+ // not have expected aura
+ return !player->HasAura(-auraSpell);
+ }
+
+ return true;
+}
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 35d867dce2b..41a6cf41cf3 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -10,12 +10,12 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _SPELLMGR_H
@@ -25,10 +25,13 @@
// For more high level function for sSpellStore data
#include "SharedDefines.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
#include "Database/SQLStorage.h"
#include "Utilities/UnorderedMap.h"
+
+#include "Player.h"
+
#include <map>
class Player;
@@ -36,177 +39,11 @@ class Spell;
extern SQLStorage sSpellThreatStore;
-enum SpellFailedReason
-{
- SPELL_FAILED_AFFECTING_COMBAT = 0x00,
- SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 0x01,
- SPELL_FAILED_ALREADY_AT_FULL_MANA = 0x02,
- SPELL_FAILED_ALREADY_AT_FULL_POWER = 0x03,
- SPELL_FAILED_ALREADY_BEING_TAMED = 0x04,
- SPELL_FAILED_ALREADY_HAVE_CHARM = 0x05,
- SPELL_FAILED_ALREADY_HAVE_SUMMON = 0x06,
- SPELL_FAILED_ALREADY_OPEN = 0x07,
- SPELL_FAILED_AURA_BOUNCED = 0x08,
- SPELL_FAILED_AUTOTRACK_INTERRUPTED = 0x09,
- SPELL_FAILED_BAD_IMPLICIT_TARGETS = 0x0A,
- SPELL_FAILED_BAD_TARGETS = 0x0B,
- SPELL_FAILED_CANT_BE_CHARMED = 0x0C,
- SPELL_FAILED_CANT_BE_DISENCHANTED = 0x0D,
- SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 0x0E,
- SPELL_FAILED_CANT_BE_PROSPECTED = 0x0F,
- SPELL_FAILED_CANT_CAST_ON_TAPPED = 0x10,
- SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 0x11,
- SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 0x12,
- SPELL_FAILED_CANT_STEALTH = 0x13,
- SPELL_FAILED_CASTER_AURASTATE = 0x14,
- SPELL_FAILED_CASTER_DEAD = 0x15,
- SPELL_FAILED_CHARMED = 0x16,
- SPELL_FAILED_CHEST_IN_USE = 0x17,
- SPELL_FAILED_CONFUSED = 0x18,
- SPELL_FAILED_DONT_REPORT = 0x19,
- SPELL_FAILED_EQUIPPED_ITEM = 0x1A,
- SPELL_FAILED_EQUIPPED_ITEM_CLASS = 0x1B,
- SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 0x1C,
- SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 0x1D,
- SPELL_FAILED_ERROR = 0x1E,
- SPELL_FAILED_FIZZLE = 0x1F,
- SPELL_FAILED_FLEEING = 0x20,
- SPELL_FAILED_FOOD_LOWLEVEL = 0x21,
- SPELL_FAILED_HIGHLEVEL = 0x22,
- SPELL_FAILED_HUNGER_SATIATED = 0x23,
- SPELL_FAILED_IMMUNE = 0x24,
- SPELL_FAILED_INTERRUPTED = 0x25,
- SPELL_FAILED_INTERRUPTED_COMBAT = 0x26,
- SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 0x27,
- SPELL_FAILED_ITEM_GONE = 0x28,
- SPELL_FAILED_ITEM_NOT_FOUND = 0x29,
- SPELL_FAILED_ITEM_NOT_READY = 0x2A,
- SPELL_FAILED_LEVEL_REQUIREMENT = 0x2B,
- SPELL_FAILED_LINE_OF_SIGHT = 0x2C,
- SPELL_FAILED_LOWLEVEL = 0x2D,
- SPELL_FAILED_LOW_CASTLEVEL = 0x2E,
- SPELL_FAILED_MAINHAND_EMPTY = 0x2F,
- SPELL_FAILED_MOVING = 0x30,
- SPELL_FAILED_NEED_AMMO = 0x31,
- SPELL_FAILED_NEED_AMMO_POUCH = 0x32,
- SPELL_FAILED_NEED_EXOTIC_AMMO = 0x33,
- SPELL_FAILED_NOPATH = 0x34,
- SPELL_FAILED_NOT_BEHIND = 0x35,
- SPELL_FAILED_NOT_FISHABLE = 0x36,
- SPELL_FAILED_NOT_FLYING = 0x37,
- SPELL_FAILED_NOT_HERE = 0x38,
- SPELL_FAILED_NOT_INFRONT = 0x39,
- SPELL_FAILED_NOT_IN_CONTROL = 0x3A,
- SPELL_FAILED_NOT_KNOWN = 0x3B,
- SPELL_FAILED_NOT_MOUNTED = 0x3C,
- SPELL_FAILED_NOT_ON_TAXI = 0x3D,
- SPELL_FAILED_NOT_ON_TRANSPORT = 0x3E,
- SPELL_FAILED_NOT_READY = 0x3F,
- SPELL_FAILED_NOT_SHAPESHIFT = 0x40,
- SPELL_FAILED_NOT_STANDING = 0x41,
- SPELL_FAILED_NOT_TRADEABLE = 0x42,
- SPELL_FAILED_NOT_TRADING = 0x43,
- SPELL_FAILED_NOT_UNSHEATHED = 0x44,
- SPELL_FAILED_NOT_WHILE_GHOST = 0x45,
- SPELL_FAILED_NO_AMMO = 0x46,
- SPELL_FAILED_NO_CHARGES_REMAIN = 0x47,
- SPELL_FAILED_NO_CHAMPION = 0x48,
- SPELL_FAILED_NO_COMBO_POINTS = 0x49,
- SPELL_FAILED_NO_DUELING = 0x4A,
- SPELL_FAILED_NO_ENDURANCE = 0x4B,
- SPELL_FAILED_NO_FISH = 0x4C,
- SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 0x4D,
- SPELL_FAILED_NO_MOUNTS_ALLOWED = 0x4E,
- SPELL_FAILED_NO_PET = 0x4F,
- SPELL_FAILED_NO_POWER = 0x50,
- SPELL_FAILED_NOTHING_TO_DISPEL = 0x51,
- SPELL_FAILED_NOTHING_TO_STEAL = 0x52,
- SPELL_FAILED_ONLY_ABOVEWATER = 0x53,
- SPELL_FAILED_ONLY_DAYTIME = 0x54,
- SPELL_FAILED_ONLY_INDOORS = 0x55,
- SPELL_FAILED_ONLY_MOUNTED = 0x56,
- SPELL_FAILED_ONLY_NIGHTTIME = 0x57,
- SPELL_FAILED_ONLY_OUTDOORS = 0x58,
- SPELL_FAILED_ONLY_SHAPESHIFT = 0x59,
- SPELL_FAILED_ONLY_STEALTHED = 0x5A,
- SPELL_FAILED_ONLY_UNDERWATER = 0x5B,
- SPELL_FAILED_OUT_OF_RANGE = 0x5C,
- SPELL_FAILED_PACIFIED = 0x5D,
- SPELL_FAILED_POSSESSED = 0x5E,
- SPELL_FAILED_REAGENTS = 0x5F,
- SPELL_FAILED_REQUIRES_AREA = 0x60,
- SPELL_FAILED_REQUIRES_SPELL_FOCUS = 0x61,
- SPELL_FAILED_ROOTED = 0x62,
- SPELL_FAILED_SILENCED = 0x63,
- SPELL_FAILED_SPELL_IN_PROGRESS = 0x64,
- SPELL_FAILED_SPELL_LEARNED = 0x65,
- SPELL_FAILED_SPELL_UNAVAILABLE = 0x66,
- SPELL_FAILED_STUNNED = 0x67,
- SPELL_FAILED_TARGETS_DEAD = 0x68,
- SPELL_FAILED_TARGET_AFFECTING_COMBAT = 0x69,
- SPELL_FAILED_TARGET_AURASTATE = 0x6A,
- SPELL_FAILED_TARGET_DUELING = 0x6B,
- SPELL_FAILED_TARGET_ENEMY = 0x6C,
- SPELL_FAILED_TARGET_ENRAGED = 0x6D,
- SPELL_FAILED_TARGET_FRIENDLY = 0x6E,
- SPELL_FAILED_TARGET_IN_COMBAT = 0x6F,
- SPELL_FAILED_TARGET_IS_PLAYER = 0x70,
- SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 0x71,
- SPELL_FAILED_TARGET_NOT_DEAD = 0x72,
- SPELL_FAILED_TARGET_NOT_IN_PARTY = 0x73,
- SPELL_FAILED_TARGET_NOT_LOOTED = 0x74,
- SPELL_FAILED_TARGET_NOT_PLAYER = 0x75,
- SPELL_FAILED_TARGET_NO_POCKETS = 0x76,
- SPELL_FAILED_TARGET_NO_WEAPONS = 0x77,
- SPELL_FAILED_TARGET_UNSKINNABLE = 0x78,
- SPELL_FAILED_THIRST_SATIATED = 0x79,
- SPELL_FAILED_TOO_CLOSE = 0x7A,
- SPELL_FAILED_TOO_MANY_OF_ITEM = 0x7B,
- SPELL_FAILED_TOTEM_CATEGORY = 0x7C,
- SPELL_FAILED_TOTEMS = 0x7D,
- SPELL_FAILED_TRAINING_POINTS = 0x7E,
- SPELL_FAILED_TRY_AGAIN = 0x7F,
- SPELL_FAILED_UNIT_NOT_BEHIND = 0x80,
- SPELL_FAILED_UNIT_NOT_INFRONT = 0x81,
- SPELL_FAILED_WRONG_PET_FOOD = 0x82,
- SPELL_FAILED_NOT_WHILE_FATIGUED = 0x83,
- SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 0x84,
- SPELL_FAILED_NOT_WHILE_TRADING = 0x85,
- SPELL_FAILED_TARGET_NOT_IN_RAID = 0x86,
- SPELL_FAILED_DISENCHANT_WHILE_LOOTING = 0x87,
- SPELL_FAILED_PROSPECT_WHILE_LOOTING = 0x88,
- SPELL_FAILED_PROSPECT_NEED_MORE = 0x89,
- SPELL_FAILED_TARGET_FREEFORALL = 0x8A,
- SPELL_FAILED_NO_EDIBLE_CORPSES = 0x8B,
- SPELL_FAILED_ONLY_BATTLEGROUNDS = 0x8C,
- SPELL_FAILED_TARGET_NOT_GHOST = 0x8D,
- SPELL_FAILED_TOO_MANY_SKILLS = 0x8E,
- SPELL_FAILED_TRANSFORM_UNUSABLE = 0x8F,
- SPELL_FAILED_WRONG_WEATHER = 0x90,
- SPELL_FAILED_DAMAGE_IMMUNE = 0x91,
- SPELL_FAILED_PREVENTED_BY_MECHANIC = 0x92,
- SPELL_FAILED_PLAY_TIME = 0x93,
- SPELL_FAILED_REPUTATION = 0x94,
- SPELL_FAILED_MIN_SKILL = 0x95,
- SPELL_FAILED_NOT_IN_ARENA = 0x96,
- SPELL_FAILED_NOT_ON_SHAPESHIFT = 0x97,
- SPELL_FAILED_NOT_ON_STEALTHED = 0x98,
- SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 0x99,
- SPELL_FAILED_NOT_ON_MOUNTED = 0x9A,
- SPELL_FAILED_TOO_SHALLOW = 0x9B,
- SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 0x9C,
- SPELL_FAILED_TARGET_IS_TRIVIAL = 0x9D,
- SPELL_FAILED_BM_OR_INVISGOD = 0x9E,
- SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 0x9F,
- SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 0xA0,
- SPELL_FAILED_NOT_IDLE = 0xA1,
- SPELL_FAILED_NOT_INACTIVE = 0xA2,
- SPELL_FAILED_PARTIAL_PLAYTIME = 0xA3,
- SPELL_FAILED_NO_PLAYTIME = 0xA4,
- SPELL_FAILED_NOT_IN_BATTLEGROUND = 0xA5,
- SPELL_FAILED_ONLY_IN_ARENA = 0xA6,
- SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE = 0xA7,
- SPELL_FAILED_UNKNOWN = 0xA8,
+// only used in code
+enum SpellCategories
+{
+ SPELLCATEGORY_HEALTH_MANA_POTIONS = 4,
+ SPELLCATEGORY_DEVOUR_MAGIC = 12
};
enum SpellFamilyNames
@@ -223,8 +60,12 @@ enum SpellFamilyNames
SPELLFAMILY_HUNTER = 9,
SPELLFAMILY_PALADIN = 10,
SPELLFAMILY_SHAMAN = 11,
- SPELLFAMILY_UNK2 = 12,
- SPELLFAMILY_POTION = 13
+ SPELLFAMILY_UNK2 = 12, // 2 spells (silence resistance)
+ SPELLFAMILY_POTION = 13,
+ // 14 - unused
+ SPELLFAMILY_DEATHKNIGHT = 15,
+ // 16 - unused
+ SPELLFAMILY_PET = 17
};
enum SpellDisableTypes
@@ -256,15 +97,15 @@ enum SpellSelectTargetTypes
};
//Some SpellFamilyFlags
-#define SPELLFAMILYFLAG_ROGUE_VANISH 0x000000800LL
-#define SPELLFAMILYFLAG_ROGUE_STEALTH 0x000400000LL
-#define SPELLFAMILYFLAG_ROGUE_BACKSTAB 0x000800004LL
-#define SPELLFAMILYFLAG_ROGUE_SAP 0x000000080LL
-#define SPELLFAMILYFLAG_ROGUE_FEINT 0x008000000LL
-#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT 0x000200000LL
-#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE 0x9003E0000LL
-#define SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR 0x000004000LL
-#define SPELLFAMILYFLAG_SHAMAN_FROST_SHOCK 0x080000000LL
+#define SPELLFAMILYFLAG_ROGUE_VANISH 0x00000800
+#define SPELLFAMILYFLAG_ROGUE_STEALTH 0x00400000
+#define SPELLFAMILYFLAG_ROGUE_BACKSTAB 0x00800004
+#define SPELLFAMILYFLAG_ROGUE_SAP 0x00000080
+#define SPELLFAMILYFLAG_ROGUE_FEINT 0x08000000
+#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT 0x00200000
+//#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE 0x9003E0000LL
+#define SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR 0x00004000
+#define SPELLFAMILYFLAG_SHAMAN_FROST_SHOCK 0x80000000
// Spell clasification
enum SpellSpecific
@@ -290,7 +131,9 @@ enum SpellSpecific
SPELL_WELL_FED = 18,
SPELL_DRINK = 19,
SPELL_FOOD = 20,
- SPELL_CHARM = 21,
+ SPELL_PRESENCE = 21,
+ SPELL_CHARM = 22,
+ SPELL_SCROLL = 23
};
#define SPELL_LINKED_MAX_SPELLS 200000
@@ -306,19 +149,36 @@ enum SpellLinkedType
SpellSpecific GetSpellSpecific(uint32 spellId);
// Different spell properties
-inline float GetSpellRadius(SpellRadiusEntry const *radius) { return (radius ? radius->Radius : 0); }
+inline float GetSpellRadiusForHostile(SpellRadiusEntry const *radius) { return (radius ? radius->radiusHostile : 0); }
+inline float GetSpellRadiusForFriend(SpellRadiusEntry const *radius) { return (radius ? radius->radiusFriend : 0); }
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
-inline float GetSpellMinRange(SpellRangeEntry const *range) { return (range ? range->minRange : 0); }
-inline float GetSpellMaxRange(SpellRangeEntry const *range) { return (range ? range->maxRange : 0); }
+bool GetDispelChance(Unit* caster, uint32 spellId);
+inline float GetSpellMinRangeForHostile(SpellRangeEntry const *range) { return (range ? range->minRangeHostile : 0); }
+inline float GetSpellMaxRangeForHostile(SpellRangeEntry const *range) { return (range ? range->maxRangeHostile : 0); }
+inline float GetSpellMinRangeForFriend(SpellRangeEntry const *range) { return (range ? range->minRangeFriend : 0); }
+inline float GetSpellMaxRangeForFriend(SpellRangeEntry const *range) { return (range ? range->maxRangeFriend : 0); }
inline uint32 GetSpellRangeType(SpellRangeEntry const *range) { return (range ? range->type : 0); }
inline uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo) { return spellInfo->RecoveryTime > spellInfo->CategoryRecoveryTime ? spellInfo->RecoveryTime : spellInfo->CategoryRecoveryTime; }
int32 GetSpellDuration(SpellEntry const *spellInfo);
int32 GetSpellMaxDuration(SpellEntry const *spellInfo);
+/*struct DispelEntry
+{
+ uint64 casterGuid;
+ uint32 spellId;
+ Unit * caster;
+ uint8 stackAmount;
+
+ bool operator < (const DispelEntry & _Right) const
+ {
+ return (spellId != _Right.spellId ? spellId < _Right.spellId : casterGuid < _Right.casterGuid);
+ }
+};*/
+
inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
{
for(int i= 0; i < 3; ++i)
- if(spellInfo->Effect[i]==effect)
+ if(SpellEffects(spellInfo->Effect[i])==effect)
return true;
return false;
}
@@ -329,30 +189,46 @@ inline bool IsSealSpell(SpellEntry const *spellInfo)
{
//Collection of all the seal family flags. No other paladin spell has any of those.
return spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN &&
- ( spellInfo->SpellFamilyFlags & 0x4000A000200LL );
+ ( spellInfo->SpellFamilyFlags[1] & 0x26000C00
+ || spellInfo->SpellFamilyFlags[0] & 0x0A000000 );
}
inline bool IsElementalShield(SpellEntry const *spellInfo)
{
// family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus
- return (spellInfo->SpellFamilyFlags & 0x42000000400LL) || spellInfo->Id == 23552;
+ return (spellInfo->SpellFamilyFlags[1] & 0x420
+ || spellInfo->SpellFamilyFlags[0] & 0x00000400)
+ || spellInfo->Id == 23552;
+}
+
+inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
+{
+ return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT;
}
-int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
+inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
+{
+ return spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 &&
+ (spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT || !spellInfo->EffectItemType[0]);
+}
+
+bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1, uint32 spellSpec2);
bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1, uint32 spellSpec2);
bool IsPassiveSpell(uint32 spellId);
+bool IsAutocastableSpell(uint32 spellId);
-inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
+inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
{
- switch(spellInfo->Id)
- {
- case 40214: // Dragonmaw Illusion
- case 35480: case 35481: case 35482: // Human Illusion
- case 35483: case 39824: // Human Illusion
- return true;
- }
+ if(!IsPassiveSpell(spellProto->Id))
+ return false;
+
+ return !IsSpellHaveEffect(spellProto,SPELL_EFFECT_APPLY_AURA);
+}
+
+inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
+{
return spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DEATH_PERSISTENT;
}
@@ -361,8 +237,8 @@ inline bool IsNonCombatSpell(SpellEntry const *spellInfo)
return (spellInfo->Attributes & SPELL_ATTR_CANT_USED_IN_COMBAT) != 0;
}
-bool IsPositiveSpell(uint32 spellId);
-bool IsPositiveEffect(uint32 spellId, uint32 effIndex);
+bool IsPositiveSpell(uint32 spellId, bool deep = false);
+bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep = false);
bool IsPositiveTarget(uint32 targetA, uint32 targetB);
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
@@ -370,9 +246,8 @@ bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellI
bool IsAuraAddedBySpell(uint32 auraType, uint32 spellId);
-bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 zone_id,uint32 area_id);
-
extern bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS];
+
inline bool IsAreaOfEffectSpell(SpellEntry const *spellInfo)
{
if(IsAreaEffectTarget[spellInfo->EffectImplicitTargetA[0]] || IsAreaEffectTarget[spellInfo->EffectImplicitTargetB[0]])
@@ -387,6 +262,7 @@ inline bool IsAreaOfEffectSpell(SpellEntry const *spellInfo)
inline bool IsAreaAuraEffect(uint32 effect)
{
if( effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
+ effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID ||
effect == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
effect == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY ||
effect == SPELL_EFFECT_APPLY_AREA_AURA_PET ||
@@ -419,7 +295,12 @@ inline bool isSpellBreakStealth(SpellEntry const* spellInfo)
return !(spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH);
}
-uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form);
+inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo)
+{
+ return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG);
+}
+
+SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form);
inline bool IsChanneledSpell(SpellEntry const* spellInfo)
{
@@ -446,6 +327,17 @@ inline uint32 GetSpellMechanicMask(SpellEntry const* spellInfo, int32 effect)
return mask;
}
+inline uint32 GetAllSpellMechanicMask(SpellEntry const* spellInfo)
+{
+ uint32 mask = 0;
+ if (spellInfo->Mechanic)
+ mask |= 1<<spellInfo->Mechanic;
+ for (int i=0; i< 3; ++i)
+ if (spellInfo->EffectMechanic[i])
+ mask |= 1<<spellInfo->EffectMechanic[i];
+ return mask;
+}
+
inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect)
{
if (spellInfo->EffectMechanic[effect])
@@ -470,7 +362,7 @@ bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group);
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group);
// Spell affects related declarations (accessed using SpellMgr functions)
-typedef std::map<uint32, uint64> SpellAffectMap;
+typedef UNORDERED_MAP<uint32, flag96> SpellAffectMap;
// Spell proc event related declarations (accessed using SpellMgr functions)
enum ProcFlags
@@ -478,16 +370,16 @@ enum ProcFlags
PROC_FLAG_NONE = 0x00000000,
PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor
- PROC_FLAG_KILL_AND_GET_XP = 0x00000002, // 01 Kill that yields experience or honor
+ PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward)
- PROC_FLAG_SUCCESSFUL_MILEE_HIT = 0x00000004, // 02 Successful melee attack
- PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee strike hit
+ PROC_FLAG_SUCCESSFUL_MILEE_HIT = 0x00000004, // 02 Successful melee auto attack
+ PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee auto attack hit
PROC_FLAG_SUCCESSFUL_MELEE_SPELL_HIT = 0x00000010, // 04 Successful attack by Spell that use melee weapon
PROC_FLAG_TAKEN_MELEE_SPELL_HIT = 0x00000020, // 05 Taken damage by Spell that use melee weapon
- PROC_FLAG_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged attack (all ranged attack deal as spell so newer set :( )
- PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged attack (all ranged attack deal as spell so newer set :( )
+ PROC_FLAG_SUCCESSFUL_RANGED_HIT = 0x00000040, // 06 Successful Ranged auto attack
+ PROC_FLAG_TAKEN_RANGED_HIT = 0x00000080, // 07 Taken damage from ranged auto attack
PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon
PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon
@@ -512,6 +404,7 @@ enum ProcFlags
PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used)
PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks
+// PROC_FLAG_DEATH = 0x01000000
};
#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_SUCCESSFUL_MILEE_HIT | \
@@ -538,19 +431,20 @@ enum ProcFlagsEx
PROC_EX_DEFLECT = 0x0000200,
PROC_EX_ABSORB = 0x0000400,
PROC_EX_REFLECT = 0x0000800,
- PROC_EX_INTERRUPT = 0x0001000, // Melle hit result can be Interrupt (not used)
- PROC_EX_RESERVED1 = 0x0002000,
- PROC_EX_RESERVED2 = 0x0004000,
- PROC_EX_RESERVED3 = 0x0008000,
+ PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used)
+ PROC_EX_AURA_REMOVE_DESTROY = 0x0002000, // aura absorb destroy or dispel
+ PROC_EX_AURA_REMOVE_EXPIRE = 0x0004000, // aura remove by default and by cancel
PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges
- PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time
+ PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time (not used)
};
+#define AURA_REMOVE_PROC_EX_MASK \
+ (PROC_EX_AURA_REMOVE_DESTROY | PROC_EX_AURA_REMOVE_EXPIRE)
struct SpellProcEventEntry
{
uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2
uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value
- uint64 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
+ flag96 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
uint32 procFlags; // bitmask for matching proc event
uint32 procEx; // proc Extend info (see ProcFlagsEx)
float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc
@@ -558,7 +452,15 @@ struct SpellProcEventEntry
uint32 cooldown; // hidden cooldown used for some spell proc events, applied to _triggered_spell_
};
+struct SpellBonusEntry
+{
+ float direct_damage;
+ float dot_damage;
+ float ap_bonus;
+};
+
typedef UNORDERED_MAP<uint32, SpellProcEventEntry> SpellProcEventMap;
+typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
#define ELIXIR_BATTLE_MASK 0x1
#define ELIXIR_GUARDIAN_MASK 0x2
@@ -651,6 +553,32 @@ class PetAura
};
typedef std::map<uint16, PetAura> SpellPetAuraMap;
+struct SpellArea
+{
+ uint32 spellId;
+ uint32 areaId; // zone/subzone/or 0 is not limited to zone
+ uint32 questStart; // quest start (quest must be active or rewarded for spell apply)
+ uint32 questEnd; // quest end (quest don't must be rewarded for spell apply)
+ int32 auraSpell; // spell aura must be applied for spell apply )if possitive) and it don't must be applied in other case
+ uint32 raceMask; // can be applied only to races
+ Gender gender; // can be applied only to gender
+ bool questStartCanActive; // if true then quest start can be active (not only rewarded)
+ bool autocast; // if true then auto applied at area enter, in other case just allowed to cast
+
+ // helpers
+ bool IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const;
+};
+
+typedef std::multimap<uint32,SpellArea> SpellAreaMap;
+typedef std::multimap<uint32,SpellArea const*> SpellAreaForQuestMap;
+typedef std::multimap<uint32,SpellArea const*> SpellAreaForAuraMap;
+typedef std::multimap<uint32,SpellArea const*> SpellAreaForAreaMap;
+typedef std::pair<SpellAreaMap::const_iterator,SpellAreaMap::const_iterator> SpellAreaMapBounds;
+typedef std::pair<SpellAreaForQuestMap::const_iterator,SpellAreaForQuestMap::const_iterator> SpellAreaForQuestMapBounds;
+typedef std::pair<SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator> SpellAreaForAuraMapBounds;
+typedef std::pair<SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator> SpellAreaForAreaMapBounds;
+
+
// Spell rank chain (accessed using SpellMgr functions)
struct SpellChainNode
{
@@ -681,6 +609,7 @@ typedef std::map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
struct SpellLearnSpellNode
{
uint32 spell;
+ bool active; // show in spellbook or not
bool autoLearned;
};
@@ -688,6 +617,9 @@ typedef std::multimap<uint32, SpellLearnSpellNode> SpellLearnSpellMap;
typedef std::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap;
+typedef std::multimap<uint32, std::pair < uint32,uint32 > >PetLevelupSpellMap;
+//typedef std::map<uint32, PetLevelupSpellSet> PetLevelupSpellMap;
+
inline bool IsPrimaryProfessionSkill(uint32 skill)
{
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(skill);
@@ -725,6 +657,11 @@ typedef std::vector<uint32> SpellCustomAttribute;
typedef std::map<int32, std::vector<int32> > SpellLinkedMap;
+inline bool IsProfessionOrRidingSkill(uint32 skill)
+{
+ return IsProfessionSkill(skill) || skill == SKILL_RIDING;
+}
+
class SpellMgr
{
// Constructors
@@ -732,18 +669,18 @@ class SpellMgr
SpellMgr();
~SpellMgr();
- // Accessors (const or static functions)
+ // Accessors (const or static functions)
public:
// Spell affects
- uint64 GetSpellAffectMask(uint16 spellId, uint8 effectId) const
+ flag96 const*GetSpellAffect(uint16 spellId, uint8 effectId) const
{
SpellAffectMap::const_iterator itr = mSpellAffectMap.find((spellId<<8) + effectId);
if( itr != mSpellAffectMap.end( ) )
- return itr->second;
+ return &itr->second;
return 0;
}
- bool IsAffectedBySpell(SpellEntry const *spellInfo, uint32 spellId, uint8 effectId, uint64 familyFlags) const;
+ bool IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const;
SpellElixirMap const& GetSpellElixirMap() const { return mSpellElixirs; }
@@ -778,7 +715,24 @@ class SpellMgr
return NULL;
}
- static bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active);
+ bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active);
+
+ // Spell bonus data
+ SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const
+ {
+ // Lookup data
+ SpellBonusMap::const_iterator itr = mSpellBonusMap.find(spellId);
+ if( itr != mSpellBonusMap.end( ) )
+ return &itr->second;
+ // Not found, try lookup for 1 spell rank if exist
+ if (uint32 rank_1 = GetFirstSpellInChain(spellId))
+ {
+ SpellBonusMap::const_iterator itr = mSpellBonusMap.find(rank_1);
+ if( itr != mSpellBonusMap.end( ) )
+ return &itr->second;
+ }
+ return NULL;
+ }
// Spell target coordinates
SpellTargetPosition const* GetSpellTargetPosition(uint32 spell_id) const
@@ -824,6 +778,14 @@ class SpellMgr
return 0;
}
+ uint32 GetNextSpellInChain(uint32 spell_id) const
+ {
+ if(SpellChainNode const* node = GetSpellChainNode(spell_id))
+ return node->next;
+
+ return 0;
+ }
+
SpellsRequiringSpellMap const& GetSpellsRequiringSpell() const { return mSpellsReqSpell; }
// Note: not use rank for compare to spell ranks: spell chains isn't linear order
@@ -880,7 +842,7 @@ class SpellMgr
bool IsSpellLearnSpell(uint32 spell_id) const
{
- return mSpellLearnSpells.count(spell_id)!=0;
+ return mSpellLearnSpells.find(spell_id) != mSpellLearnSpells.end();
}
SpellLearnSpellMap::const_iterator GetBeginSpellLearnSpell(uint32 spell_id) const
@@ -903,10 +865,14 @@ class SpellMgr
return false;
}
+ static bool IsProfessionOrRidingSpell(uint32 spellId);
static bool IsProfessionSpell(uint32 spellId);
static bool IsPrimaryProfessionSpell(uint32 spellId);
bool IsPrimaryProfessionFirstRankSpell(uint32 spellId) const;
+ bool IsSkillBonusSpell(uint32 spellId) const;
+
+
// Spell script targets
SpellScriptTarget::const_iterator GetBeginSpellScriptTarget(uint32 spell_id) const
{
@@ -946,11 +912,6 @@ class SpellMgr
return 0;
else
return mSpellCustomAttr[spell_id];
- /*SpellCustomAttrMap::const_iterator itr = mSpellCustomAttrMap.find(spell_id);
- if(itr != mSpellCustomAttrMap.end())
- return itr->second;
- else
- return 0;*/
}
const std::vector<int32> *GetSpellLinked(int32 spell_id) const
@@ -962,7 +923,42 @@ class SpellMgr
SpellEffectTargetTypes EffectTargetType[TOTAL_SPELL_EFFECTS];
SpellSelectTargetTypes SpellTargetType[TOTAL_SPELL_TARGETS];
- // Modifiers
+ SpellCastResult GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL);
+
+ SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const
+ {
+ return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id),mSpellAreaMap.upper_bound(spell_id));
+ }
+
+ SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const
+ {
+ if(active)
+ return SpellAreaForQuestMapBounds(mSpellAreaForActiveQuestMap.lower_bound(quest_id),mSpellAreaForActiveQuestMap.upper_bound(quest_id));
+ else
+ return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id),mSpellAreaForQuestMap.upper_bound(quest_id));
+ }
+
+ SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const
+ {
+ return SpellAreaForQuestMapBounds(mSpellAreaForQuestEndMap.lower_bound(quest_id),mSpellAreaForQuestEndMap.upper_bound(quest_id));
+ }
+
+ SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const
+ {
+ return SpellAreaForAuraMapBounds(mSpellAreaForAuraMap.lower_bound(spell_id),mSpellAreaForAuraMap.upper_bound(spell_id));
+ }
+
+ SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const
+ {
+ return SpellAreaForAreaMapBounds(mSpellAreaForAreaMap.lower_bound(area_id),mSpellAreaForAreaMap.upper_bound(area_id));
+ }
+
+ PetLevelupSpellMap const * GetPetLevelupSpellMap() const
+ {
+ return &mPetLevelupSpellMap;
+ }
+
+ // Modifiers
public:
static SpellMgr& Instance();
@@ -975,12 +971,15 @@ class SpellMgr
void LoadSpellAffects();
void LoadSpellElixirs();
void LoadSpellProcEvents();
+ void LoadSpellBonusess();
void LoadSpellTargetPositions();
void LoadSpellThreats();
void LoadSkillLineAbilityMap();
void LoadSpellPetAuras();
void LoadSpellCustomAttr();
void LoadSpellLinked();
+ void LoadPetLevelupSpellMap();
+ void LoadSpellAreas();
private:
SpellScriptTarget mSpellScriptTarget;
@@ -993,10 +992,18 @@ class SpellMgr
SpellAffectMap mSpellAffectMap;
SpellElixirMap mSpellElixirs;
SpellProcEventMap mSpellProcEventMap;
+ SpellBonusMap mSpellBonusMap;
SkillLineAbilityMap mSkillLineAbilityMap;
SpellPetAuraMap mSpellPetAuraMap;
SpellCustomAttribute mSpellCustomAttr;
SpellLinkedMap mSpellLinkedMap;
+ PetLevelupSpellMap mPetLevelupSpellMap;
+ SpellAreaMap mSpellAreaMap;
+ SpellAreaForQuestMap mSpellAreaForQuestMap;
+ SpellAreaForQuestMap mSpellAreaForActiveQuestMap;
+ SpellAreaForQuestMap mSpellAreaForQuestEndMap;
+ SpellAreaForAuraMap mSpellAreaForAuraMap;
+ SpellAreaForAreaMap mSpellAreaForAreaMap;
};
#define spellmgr SpellMgr::Instance()
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index ae96953e337..c24999e8fe5 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,24 +51,17 @@ bool Player::UpdateStats(Stats stat)
switch(stat)
{
case STAT_STRENGTH:
- UpdateAttackPowerAndDamage();
UpdateShieldBlockValue();
break;
case STAT_AGILITY:
UpdateArmor();
- UpdateAttackPowerAndDamage(true);
- if(getClass() == CLASS_ROGUE || getClass() == CLASS_HUNTER || getClass() == CLASS_DRUID && m_form==FORM_CAT)
- UpdateAttackPowerAndDamage();
-
UpdateAllCritPercentages();
UpdateDodgePercentage();
break;
-
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT:
UpdateMaxPower(POWER_MANA);
UpdateAllSpellCritChances();
- UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intellect currently
UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently
break;
@@ -78,11 +71,60 @@ bool Player::UpdateStats(Stats stat)
default:
break;
}
+
+ if (stat == STAT_STRENGTH)
+ {
+ UpdateAttackPowerAndDamage(false);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(true);
+ }
+ else if (stat == STAT_AGILITY)
+ {
+ UpdateAttackPowerAndDamage(false);
+ UpdateAttackPowerAndDamage(true);
+ }
+ else
+ {
+ // Need update (exist AP from stat auras)
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(false);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(true);
+ }
+
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
+
+ // Update ratings in exist SPELL_AURA_MOD_RATING_FROM_STAT and only depends from stat
+ uint32 mask = 0;
+ AuraEffectList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
+ for(AuraEffectList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
+ if (Stats((*i)->GetMiscBValue()) == stat)
+ mask |= (*i)->GetMiscValue();
+ if (mask)
+ {
+ for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
+ if (mask & (1 << rating))
+ ApplyRatingMod(CombatRating(rating), 0, true);
+ }
return true;
}
+void Player::ApplySpellDamageBonus(int32 amount, bool apply)
+{
+ m_baseSpellDamage+=apply?amount:-amount;
+ // For speed just update for client
+ for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
+ ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, amount, apply);
+}
+
+void Player::ApplySpellHealingBonus(int32 amount, bool apply)
+{
+ m_baseSpellHealing+=apply?amount:-amount;
+ // For speed just update for client
+ ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
+}
+
void Player::UpdateSpellDamageAndHealingBonus()
{
// Magic damage modifiers implemented in Unit::SpellDamageBonus
@@ -150,12 +192,11 @@ void Player::UpdateArmor()
value += GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
- AuraList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
- for(AuraList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
+ AuraEffectList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
+ for(AuraEffectList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- if(mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
- value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifierValue() / 100.0f);
+ if((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
+ value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetAmount() / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
@@ -213,6 +254,12 @@ void Player::UpdateMaxPower(Powers power)
SetMaxPower(power, uint32(value));
}
+void Player::ApplyFeralAPBonus(int32 amount, bool apply)
+{
+ m_baseFeralAP+= apply ? amount:-amount;
+ UpdateAttackPowerAndDamage();
+}
+
void Player::UpdateAttackPowerAndDamage(bool ranged )
{
float val2 = 0.0f;
@@ -253,11 +300,12 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
{
switch(getClass())
{
- case CLASS_WARRIOR: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
- case CLASS_PALADIN: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
- case CLASS_ROGUE: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
- case CLASS_HUNTER: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
- case CLASS_SHAMAN: val2 = level*2.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ case CLASS_WARRIOR: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ case CLASS_PALADIN: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ case CLASS_DEATH_KNIGHT: val2 = level*3.0f + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ case CLASS_ROGUE: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
+ case CLASS_HUNTER: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
+ case CLASS_SHAMAN: val2 = level*2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break;
case CLASS_DRUID:
{
//Check if Predatory Strikes is skilled
@@ -269,13 +317,13 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
case FORM_DIREBEAR:
case FORM_MOONKIN:
{
- Unit::AuraList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
+ Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
{
// Predatory Strikes
if ((*itr)->GetSpellProto()->SpellIconID == 1563)
{
- mLevelMult = (*itr)->GetModifier()->m_amount / 100.0f;
+ mLevelMult = (*itr)->GetAmount() / 100.0f;
break;
}
}
@@ -286,12 +334,12 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
switch(m_form)
{
case FORM_CAT:
- val2 = getLevel()*(mLevelMult+2.0f) + GetStat(STAT_STRENGTH)*2.0f + GetStat(STAT_AGILITY) - 20.0f; break;
+ val2 = getLevel()*(mLevelMult+2.0f) + GetStat(STAT_STRENGTH)*2.0f + GetStat(STAT_AGILITY) - 20.0f + m_baseFeralAP; break;
case FORM_BEAR:
case FORM_DIREBEAR:
- val2 = getLevel()*(mLevelMult+3.0f) + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ val2 = getLevel()*(mLevelMult+3.0f) + GetStat(STAT_STRENGTH)*2.0f - 20.0f + m_baseFeralAP; break;
case FORM_MOONKIN:
- val2 = getLevel()*(mLevelMult+1.5f) + GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
+ val2 = getLevel()*(mLevelMult+1.5f) + GetStat(STAT_STRENGTH)*2.0f - 20.0f + m_baseFeralAP; break;
default:
val2 = GetStat(STAT_STRENGTH)*2.0f - 20.0f; break;
}
@@ -309,17 +357,26 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
- if( ranged && (getClassMask() & CLASSMASK_WAND_USERS)==0)
+ if( ranged )
+ {
+ if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
+ {
+ AuraEffectList const& mRAPbyStat = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
+ for(AuraEffectList::const_iterator i = mRAPbyStat.begin();i != mRAPbyStat.end(); ++i)
+ attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
+ }
+ }
+ else
{
- AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
- for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
- attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifierValue() / 100.0f);
+ AuraEffectList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
+ for(AuraEffectList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i)
+ attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
}
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
- SetUInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
- SetUInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
+ SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
+ SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
//automatically update weapon damage after attack power modification
@@ -386,8 +443,15 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl
weapon_mindamage = lvl*0.85*att_speed;
weapon_maxdamage = lvl*1.25*att_speed;
}
- else if(!IsUseEquipedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc)
+ else if(!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case)
{
+ //cannot use ranged/off attack, set values to 0
+ if (attType != BASE_ATTACK)
+ {
+ min_damage=0;
+ max_damage=0;
+ return;
+ }
weapon_mindamage = BASE_MINDAMAGE;
weapon_maxdamage = BASE_MAXDAMAGE;
}
@@ -554,6 +618,24 @@ void Player::UpdateSpellCritChance(uint32 school)
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
}
+void Player::UpdateMeleeHitChances()
+{
+ m_modMeleeHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ m_modMeleeHitChance+= GetRatingBonusValue(CR_HIT_MELEE);
+}
+
+void Player::UpdateRangedHitChances()
+{
+ m_modRangedHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ m_modRangedHitChance+= GetRatingBonusValue(CR_HIT_RANGED);
+}
+
+void Player::UpdateSpellHitChances()
+{
+ m_modSpellHitChance = GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ m_modSpellHitChance+= GetRatingBonusValue(CR_HIT_SPELL);
+}
+
void Player::UpdateAllSpellCritChances()
{
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
@@ -569,15 +651,15 @@ void Player::UpdateExpertise(WeaponAttackType attack)
Item *weapon = GetWeaponForAttack(attack);
- AuraList const& expAuras = GetAurasByType(SPELL_AURA_MOD_EXPERTISE);
- for(AuraList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
+ AuraEffectList const& expAuras = GetAurasByType(SPELL_AURA_MOD_EXPERTISE);
+ for(AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
{
// item neutral spell
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
- expertise += (*itr)->GetModifierValue();
+ expertise += (*itr)->GetAmount();
// item dependent spell
else if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
- expertise += (*itr)->GetModifierValue();
+ expertise += (*itr)->GetAmount();
}
if(expertise < 0)
@@ -591,6 +673,12 @@ void Player::UpdateExpertise(WeaponAttackType attack)
}
}
+void Player::ApplyManaRegenBonus(int32 amount, bool apply)
+{
+ m_baseManaRegen+= apply ? amount : -amount;
+ UpdateManaRegen();
+}
+
void Player::UpdateManaRegen()
{
float Intellect = GetStat(STAT_INTELLECT);
@@ -600,33 +688,22 @@ void Player::UpdateManaRegen()
power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA);
// Mana regen from SPELL_AURA_MOD_POWER_REGEN aura
- float power_regen_mp5 = GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f;
+ float power_regen_mp5 = (GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) + m_baseManaRegen) / 5.0f;
// Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura
- AuraList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
- for(AuraList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
+ AuraEffectList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
+ for(AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * (*i)->GetModifierValue() / 500.0f;
+ power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f;
}
- // Bonus from some dummy auras
- AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_PERIODIC_DUMMY);
- for(AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
- if((*i)->GetId() == 34074) // Aspect of the Viper
- {
- power_regen_mp5 += (*i)->GetModifier()->m_amount * Intellect / 500.0f;
- // Add regen bonus from level in this dummy
- power_regen_mp5 += getLevel() * 35 / 100;
- }
-
// Set regen rate in cast state apply only on spirit based regen
int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
if (modManaRegenInterrupt > 100)
modManaRegenInterrupt = 100;
- SetStatFloatValue(PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f);
+ SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f);
- SetStatFloatValue(PLAYER_FIELD_MOD_MANA_REGEN, power_regen_mp5 + power_regen);
+ SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen);
}
void Player::_ApplyAllStatBonuses()
@@ -712,6 +789,27 @@ void Creature::UpdateMaxPower(Powers power)
void Creature::UpdateAttackPowerAndDamage(bool ranged)
{
+ UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
+
+ uint16 index = UNIT_FIELD_ATTACK_POWER;
+ uint16 index_mod = UNIT_FIELD_ATTACK_POWER_MODS;
+ uint16 index_mult = UNIT_FIELD_ATTACK_POWER_MULTIPLIER;
+
+ if(ranged)
+ {
+ index = UNIT_FIELD_RANGED_ATTACK_POWER;
+ index_mod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS;
+ index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER;
+ }
+
+ float base_attPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT);
+ float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
+ float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
+
+ SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
+ SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
+ SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
+
//automatically update weapon damage after attack power modification
if(ranged)
UpdateDamagePhysical(RANGED_ATTACK);
@@ -755,7 +853,7 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
- if(attType == BASE_ATTACK && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED))
+ if(!CanUseAttackType(attType))
{
weapon_mindamage = 0;
weapon_maxdamage = 0;
@@ -923,7 +1021,7 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged)
if(getPetType() == HUNTER_PET) //hunter pets benefit from owner's attack power
{
bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f;
- SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.125f));
+ SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f));
}
//demons benefit from warlocks shadow or fire damage
else if(getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)
@@ -954,9 +1052,9 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged)
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
//UNIT_FIELD_(RANGED)_ATTACK_POWER field
- SetUInt32Value(UNIT_FIELD_ATTACK_POWER, (uint32)base_attPower);
+ SetInt32Value(UNIT_FIELD_ATTACK_POWER, (int32)base_attPower);
//UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
- SetUInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, (uint32)attPowerMod);
+ SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, (int32)attPowerMod);
//UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, attPowerMultiplier);
diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp
index acdf7762b71..6aa4be19765 100644
--- a/src/game/TargetedMovementGenerator.cpp
+++ b/src/game/TargetedMovementGenerator.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
#include "TargetedMovementGenerator.h"
#include "Errors.h"
#include "Creature.h"
-#include "MapManager.h"
#include "DestinationHolderImp.h"
#include "World.h"
@@ -95,8 +94,6 @@ template<class T>
void
TargetedMovementGenerator<T>::Initialize(T &owner)
{
- if(!&owner)
- return;
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
diff --git a/src/game/TargetedMovementGenerator.h b/src/game/TargetedMovementGenerator.h
index 609e517078c..2083dd95369 100644
--- a/src/game/TargetedMovementGenerator.h
+++ b/src/game/TargetedMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp
index c65a4214892..c6e68ad2cbd 100644
--- a/src/game/TaxiHandler.cpp
+++ b/src/game/TaxiHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "WorldSession.h"
#include "Opcodes.h"
#include "Log.h"
-#include "World.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "UpdateMask.h"
@@ -56,7 +55,7 @@ void WorldSession::SendTaxiStatus( uint64 guid )
return;
}
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
// not found nearest
if(curloc == 0)
@@ -71,7 +70,7 @@ void WorldSession::SendTaxiStatus( uint64 guid )
sLog.outDebug( "WORLD: Sent SMSG_TAXINODE_STATUS" );
}
-void WorldSession::HandleTaxiQueryAvailableNodesOpcode( WorldPacket & recv_data )
+void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
{
CHECK_PACKET_SIZE(recv_data,8);
@@ -90,7 +89,7 @@ void WorldSession::HandleTaxiQueryAvailableNodesOpcode( WorldPacket & recv_data
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// unknown taxi node case
if( SendLearnNewTaxiNode(unit) )
@@ -103,7 +102,7 @@ void WorldSession::HandleTaxiQueryAvailableNodesOpcode( WorldPacket & recv_data
void WorldSession::SendTaxiMenu( Creature* unit )
{
// find current node
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 )
return;
@@ -124,7 +123,7 @@ void WorldSession::SendDoFlight( uint16 MountId, uint32 path, uint32 pathNode )
{
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
- GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
while(GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()==FLIGHT_MOTION_TYPE)
GetPlayer()->GetMotionMaster()->MovementExpired(false);
@@ -136,7 +135,7 @@ void WorldSession::SendDoFlight( uint16 MountId, uint32 path, uint32 pathNode )
bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
{
// find current node
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
if ( curloc == 0 )
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index bbe8fa9c104..c87ad91ff90 100644
--- a/src/game/TemporarySummon.cpp
+++ b/src/game/TemporarySummon.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,19 +18,26 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "TemporarySummon.h"
-#include "WorldPacket.h"
-#include "MapManager.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
+#include "ObjectMgr.h"
+#include "TemporarySummon.h"
-TemporarySummon::TemporarySummon( uint64 summoner ) :
-Creature(), m_type(TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN), m_timer(0), m_lifetime(0), m_summoner(summoner)
+TempSummon::TempSummon(SummonPropertiesEntry const *properties, Unit *owner) :
+Creature(), m_type(TEMPSUMMON_MANUAL_DESPAWN), m_timer(0), m_lifetime(0)
+, m_Properties(properties)
{
+ m_summonerGUID = owner ? owner->GetGUID() : 0;
+ m_summonMask |= SUMMON_MASK_SUMMON;
}
-void TemporarySummon::Update( uint32 diff )
+Unit* TempSummon::GetSummoner() const
+{
+ return m_summonerGUID ? ObjectAccessor::GetUnit(*this, m_summonerGUID) : NULL;
+}
+
+void TempSummon::Update( uint32 diff )
{
if (m_deathState == DEAD)
{
@@ -159,30 +166,125 @@ void TemporarySummon::Update( uint32 diff )
Creature::Update( diff );
}
-void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
+void TempSummon::InitSummon(uint32 duration)
{
- m_type = type;
- m_timer = lifetime;
- m_lifetime = lifetime;
+ assert(!isPet());
+
+ m_timer = duration;
+ m_lifetime = duration;
+
+ if(m_type == TEMPSUMMON_MANUAL_DESPAWN)
+ m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
+
+ Unit* owner = GetSummoner();
+ if(owner)
+ {
+ if(owner->GetTypeId()==TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled)
+ ((Creature*)owner)->AI()->JustSummoned(this);
+
+ if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0])
+ {
+ setFaction(owner->getFaction());
+ CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
+ }
+ }
- MapManager::Instance().GetMap(GetMapId(), this)->Add((Creature*)this);
+ if(!m_Properties)
+ return;
+
+ if(uint32 slot = m_Properties->Slot)
+ {
+ if(owner)
+ {
+ if(owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
+ {
+ Creature *OldTotem = ObjectAccessor::GetCreature(*this, owner->m_SummonSlot[slot]);
+ if(OldTotem && OldTotem->isSummon())
+ ((TempSummon*)OldTotem)->UnSummon();
+ }
+ owner->m_SummonSlot[slot] = GetGUID();
+ }
+ }
- AIM_Initialize();
+ if(m_Properties->Faction)
+ setFaction(m_Properties->Faction);
}
-void TemporarySummon::UnSummon()
+void TempSummon::SetTempSummonType(TempSummonType type)
{
+ m_type = type;
+}
+
+void TempSummon::UnSummon()
+{
+ assert(!isPet());
+
+ Unit* owner = GetSummoner();
+ if(owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->IsAIEnabled)
+ ((Creature*)owner)->AI()->SummonedCreatureDespawn(this);
+
CleanupsBeforeDelete();
AddObjectToRemoveList();
+}
+
+void TempSummon::RemoveFromWorld()
+{
+ if(!IsInWorld())
+ return;
- Unit* sum = m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL;
- if (sum && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->IsAIEnabled)
+ if(m_Properties)
{
- ((Creature*)sum)->AI()->SummonedCreatureDespawn(this);
+ if(uint32 slot = m_Properties->Slot)
+ {
+ if(Unit* owner = GetSummoner())
+ {
+ if(owner->m_SummonSlot[slot] = GetGUID())
+ owner->m_SummonSlot[slot] = 0;
+ }
+ }
}
+
+ if(GetOwnerGUID())
+ sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
+
+ Creature::RemoveFromWorld();
}
-void TemporarySummon::SaveToDB()
+void TempSummon::SaveToDB()
{
}
+Guardian::Guardian(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
+, m_owner(owner), m_bonusdamage(0)
+{
+ m_summonMask |= SUMMON_MASK_GUARDIAN;
+ InitCharmInfo();
+}
+
+void Guardian::InitSummon(uint32 duration)
+{
+ TempSummon::InitSummon(duration);
+
+ SetReactState(REACT_AGGRESSIVE);
+
+ SetCreatorGUID(m_owner->GetGUID());
+ setFaction(m_owner->getFaction());
+
+ if(m_owner->GetTypeId() == TYPEID_PLAYER)
+ {
+ m_charmInfo->InitCharmCreateSpells();
+ //((Player*)m_owner)->CharmSpellInitialize();
+ }
+
+ m_owner->SetGuardian(this, true);
+}
+
+void Guardian::RemoveFromWorld()
+{
+ if(!IsInWorld())
+ return;
+
+ m_owner->SetGuardian(this, false);
+ TempSummon::RemoveFromWorld();
+}
+
diff --git a/src/game/TemporarySummon.h b/src/game/TemporarySummon.h
index fe9763f5301..cb5651d3194 100644
--- a/src/game/TemporarySummon.h
+++ b/src/game/TemporarySummon.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,23 +22,45 @@
#define TRINITYCORE_TEMPSUMMON_H
#include "Creature.h"
-#include "ObjectAccessor.h"
-class TemporarySummon : public Creature
+class TempSummon : public Creature
{
public:
- explicit TemporarySummon(uint64 summoner = 0);
- virtual ~TemporarySummon(){};
+ explicit TempSummon(SummonPropertiesEntry const *properties, Unit *owner);
+ virtual ~TempSummon(){};
void Update(uint32 time);
- void Summon(TempSummonType type, uint32 lifetime);
+ virtual void InitSummon(uint32 lifetime);
void UnSummon();
+ void RemoveFromWorld();
+ void SetTempSummonType(TempSummonType type);
void SaveToDB();
- Unit* GetSummoner() const { return m_summoner ? ObjectAccessor::GetUnit(*this, m_summoner) : NULL; }
+ Unit* GetSummoner() const;
+
+ SummonPropertiesEntry const *m_Properties;
private:
TempSummonType m_type;
uint32 m_timer;
uint32 m_lifetime;
- uint64 m_summoner;
+ uint64 m_summonerGUID;
+};
+
+class Guardian : public TempSummon
+{
+ public:
+ Guardian(SummonPropertiesEntry const *properties, Unit *owner);
+ bool Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
+ void InitSummon(uint32 duration);
+ void RemoveFromWorld();
+ bool InitStatsForLevel(uint32 level);
+
+ int32 GetBonusDamage() { return m_bonusdamage; }
+ void SetBonusDamage(int32 damage) { m_bonusdamage = damage; }
+
+ Unit *GetOwner() { return m_owner; }
+ protected:
+ Unit *m_owner;
+ int32 m_bonusdamage;
};
+
#endif
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp
index ac124da6951..336f02c4470 100644
--- a/src/game/ThreatManager.cpp
+++ b/src/game/ThreatManager.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Map.h"
-#include "MapManager.h"
#include "Player.h"
#include "ObjectAccessor.h"
#include "UnitEvents.h"
@@ -84,7 +83,7 @@ void HostilReference::sourceObjectDestroyLink()
//============================================================
// Inform the source, that the status of the reference changed
-void HostilReference::fireStatusChanged(const ThreatRefStatusChangeEvent& pThreatRefStatusChangeEvent)
+void HostilReference::fireStatusChanged(ThreatRefStatusChangeEvent& pThreatRefStatusChangeEvent)
{
if(getSource())
getSource()->processThreatEvent(&pThreatRefStatusChangeEvent);
@@ -100,7 +99,11 @@ void HostilReference::addThreat(float pMod)
if(!isOnline())
updateOnlineStatus();
if(pMod != 0.0f)
- fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_THREAT_CHANGE, this, pMod));
+ {
+ ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, pMod);
+ fireStatusChanged(event);
+ }
+
if(isValid() && pMod >= 0)
{
Unit* victim_owner = getTarget()->GetCharmerOrOwner();
@@ -155,8 +158,10 @@ void HostilReference::setOnlineOfflineState(bool pIsOnline)
{
iOnline = pIsOnline;
if(!iOnline)
- setAccessibleState(false); // if not online that not accessible as well
- fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_ONLINE_STATUS, this));
+ setAccessibleState(false); // if not online that not accessable as well
+
+ ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ONLINE_STATUS, this);
+ fireStatusChanged(event);
}
}
@@ -167,7 +172,9 @@ void HostilReference::setAccessibleState(bool pIsAccessible)
if(iAccessible != pIsAccessible)
{
iAccessible = pIsAccessible;
- fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_ASSECCIBLE_STATUS, this));
+
+ ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ASSECCIBLE_STATUS, this);
+ fireStatusChanged(event);
}
}
@@ -178,7 +185,9 @@ void HostilReference::setAccessibleState(bool pIsAccessible)
void HostilReference::removeReference()
{
invalidate();
- fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_REMOVE_FROM_LIST, this));
+
+ ThreatRefStatusChangeEvent event(UEV_THREAT_REF_REMOVE_FROM_LIST, this);
+ fireStatusChanged(event);
}
//============================================================
@@ -267,26 +276,36 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
{
HostilReference* currentRef = NULL;
bool found = false;
+ bool noPriorityTargetFound = false;
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
lastRef--;
- for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
+ for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
{
currentRef = (*iter);
Unit* target = currentRef->getTarget();
assert(target); // if the ref has status online the target must be there !
- // some units are preferred in comparison to others
- if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
- target->hasUnitState(UNIT_STAT_CONFUSED)
- ) )
+ // some units are prefered in comparison to others
+ if(!noPriorityTargetFound && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask()) || target->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_DAMAGE)) )
{
- // current victim is a second choice target, so don't compare threat with it below
- if(currentRef == pCurrentVictim)
- pCurrentVictim = NULL;
- continue;
+ if(iter != lastRef)
+ {
+ // current victim is a second choice target, so don't compare threat with it below
+ if(currentRef == pCurrentVictim)
+ pCurrentVictim = NULL;
+ ++iter;
+ continue;
+ }
+ else
+ {
+ // if we reached to this point, everyone in the threatlist is a second choice target. In such a situation the target with the highest threat should be attacked.
+ noPriorityTargetFound = true;
+ iter = iThreatList.begin();
+ continue;
+ }
}
if(!pAttacker->IsOutOfThreatArea(target)) // skip non attackable currently targets
@@ -314,6 +333,7 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
break;
}
}
+ ++iter;
}
if(!found)
currentRef = NULL;
@@ -347,12 +367,18 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, SpellSchoolMask scho
//players and pets have only InHateListOf
//HateOfflineList is used co contain unattackable victims (in-flight, in-water, GM etc.)
- if (pVictim == getOwner()) // only for same creatures :)
+ // not to self
+ if (pVictim == getOwner())
return;
+ // not to GM
if(!pVictim || (pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->isGameMaster()) )
return;
+ // not to dead and not for dead
+ if(!pVictim->isAlive() || !getOwner()->isAlive() )
+ return;
+
assert(getOwner()->GetTypeId()== TYPEID_UNIT);
float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, schoolMask, pThreatSpell);
@@ -450,18 +476,13 @@ void ThreatManager::setCurrentVictim(HostilReference* pHostilReference)
// The hated unit is gone, dead or deleted
// return true, if the event is consumed
-bool ThreatManager::processThreatEvent(const UnitBaseEvent* pUnitBaseEvent)
+void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent)
{
- bool consumed = false;
-
- ThreatRefStatusChangeEvent* threatRefStatusChangeEvent;
- HostilReference* hostilReference;
-
- threatRefStatusChangeEvent = (ThreatRefStatusChangeEvent*) pUnitBaseEvent;
threatRefStatusChangeEvent->setThreatManager(this); // now we can set the threat manager
- hostilReference = threatRefStatusChangeEvent->getReference();
- switch(pUnitBaseEvent->getType())
+ HostilReference* hostilReference = threatRefStatusChangeEvent->getReference();
+
+ switch(threatRefStatusChangeEvent->getType())
{
case UEV_THREAT_REF_THREAT_CHANGE:
if((getCurrentVictim() == hostilReference && threatRefStatusChangeEvent->getFValue()<0.0f) ||
@@ -499,6 +520,5 @@ bool ThreatManager::processThreatEvent(const UnitBaseEvent* pUnitBaseEvent)
iThreatOfflineContainer.remove(hostilReference);
break;
}
- return consumed;
}
diff --git a/src/game/ThreatManager.h b/src/game/ThreatManager.h
index 56281b9f8f3..aa84cb7d52c 100644
--- a/src/game/ThreatManager.h
+++ b/src/game/ThreatManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -45,20 +45,8 @@ class ThreatCalcHelper
};
//==============================================================
-
class TRINITY_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager>
{
- private:
- float iThreat;
- float iTempThreatModifyer; // used for taunt
- uint64 iUnitGuid;
- bool iOnline;
- bool iAccessible;
- private:
- // Inform the source, that the status of that reference was changed
- void fireStatusChanged(const ThreatRefStatusChangeEvent& pThreatRefStatusChangeEvent);
-
- Unit* getSourceUnit();
public:
HostilReference(Unit* pUnit, ThreatManager *pThreatManager, float pThreat);
@@ -125,6 +113,17 @@ class TRINITY_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager>
// Tell our refFrom (source) object, that the link is cut (Target destroyed)
void sourceObjectDestroyLink();
+ private:
+ // Inform the source, that the status of that reference was changed
+ void fireStatusChanged(ThreatRefStatusChangeEvent& pThreatRefStatusChangeEvent);
+
+ Unit* getSourceUnit();
+ private:
+ float iThreat;
+ float iTempThreatModifyer; // used for taunt
+ uint64 iUnitGuid;
+ bool iOnline;
+ bool iAccessible;
};
//==============================================================
@@ -170,14 +169,9 @@ class TRINITY_DLL_SPEC ThreatContainer
class TRINITY_DLL_SPEC ThreatManager
{
- private:
- HostilReference* iCurrentVictim;
- Unit* iOwner;
- ThreatContainer iThreatContainer;
- ThreatContainer iThreatOfflineContainer;
-
- void _addThreat(Unit* target, float threat);
public:
+ friend class HostilReference;
+
explicit ThreatManager(Unit *pOwner);
~ThreatManager() { clearReferences(); }
@@ -191,7 +185,7 @@ class TRINITY_DLL_SPEC ThreatManager
bool isThreatListEmpty() { return iThreatContainer.empty();}
- bool processThreatEvent(const UnitBaseEvent* pUnitBaseEvent);
+ void processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent);
HostilReference* getCurrentVictim() { return iCurrentVictim; }
@@ -208,10 +202,17 @@ class TRINITY_DLL_SPEC ThreatManager
// methods to access the lists from the outside to do sume dirty manipulation (scriping and such)
// I hope they are used as little as possible.
- inline std::list<HostilReference*>& getThreatList() { return iThreatContainer.getThreatList(); }
- inline std::list<HostilReference*>& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); }
- inline ThreatContainer& getOnlineContainer() { return iThreatContainer; }
- inline ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
+ std::list<HostilReference*>& getThreatList() { return iThreatContainer.getThreatList(); }
+ std::list<HostilReference*>& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); }
+ ThreatContainer& getOnlineContainer() { return iThreatContainer; }
+ ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
+ private:
+ void _addThreat(Unit *pVictim, float threat);
+
+ HostilReference* iCurrentVictim;
+ Unit* iOwner;
+ ThreatContainer iThreatContainer;
+ ThreatContainer iThreatOfflineContainer;
};
//=================================================
diff --git a/src/game/TicketHandler.cpp b/src/game/TicketHandler.cpp
index 640faacc155..f4af95bb169 100644
--- a/src/game/TicketHandler.cpp
+++ b/src/game/TicketHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS
+ * Copyright (C) 2005-2009 MaNGOS
*
- * Copyright (C) 2008 Trinity
+ * Copyright (C) 2008-2009 Trinity
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/TicketMgr.cpp b/src/game/TicketMgr.cpp
index 5b5ecf5a9fb..69022b7dd27 100644
--- a/src/game/TicketMgr.cpp
+++ b/src/game/TicketMgr.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS
+ * Copyright (C) 2005-2009 MaNGOS
*
- * Copyright (C) 2008 Trinity
+ * Copyright (C) 2008-2009 Trinity
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/TicketMgr.h b/src/game/TicketMgr.h
index 4cf1b46d97e..491e6657f40 100644
--- a/src/game/TicketMgr.h
+++ b/src/game/TicketMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS
+ * Copyright (C) 2005-2009 MaNGOS
*
- * Copyright (C) 2008 Trinity
+ * Copyright (C) 2008-2009 Trinity
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Tools.cpp b/src/game/Tools.cpp
index e553b86f8e9..d1728c78c9e 100644
--- a/src/game/Tools.cpp
+++ b/src/game/Tools.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Tools.h b/src/game/Tools.h
index 2a71121129b..bdb3ad8e762 100644
--- a/src/game/Tools.h
+++ b/src/game/Tools.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index de58a7ef15f..6969960e7ea 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,16 +20,15 @@
#include "Totem.h"
#include "WorldPacket.h"
-#include "MapManager.h"
#include "Log.h"
#include "Group.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
-Totem::Totem() : Creature()
+Totem::Totem(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
{
- m_isTotem = true;
+ m_summonMask |= SUMMON_MASK_TOTEM;
m_duration = 0;
m_type = TOTEM_PASSIVE;
}
@@ -89,8 +88,6 @@ void Totem::Summon(Unit* owner)
data << GetGUID();
SendMessageToSet(&data,true);
- AIM_Initialize();
-
switch(m_type)
{
case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break;
@@ -112,11 +109,11 @@ void Totem::UnSummon()
if (owner)
{
// clear owenr's totem slot
- for(int i = 0; i < MAX_TOTEM; ++i)
+ for(int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
{
- if(owner->m_TotemSlot[i]==GetGUID())
+ if(owner->m_SummonSlot[i]==GetGUID())
{
- owner->m_TotemSlot[i] = 0;
+ owner->m_SummonSlot[i] = 0;
break;
}
}
@@ -178,19 +175,19 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)
m_type = TOTEM_STATUE; //Jewelery statue
}
-bool Totem::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
+bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
-/* for (int i=0;i<3;i++)
+ // TODO: possibly all negative auras immuned?
+ switch(spellInfo->EffectApplyAuraName[index])
{
- switch(spellInfo->EffectApplyAuraName[i])
- {
- case SPELL_AURA_PERIODIC_DAMAGE:
- case SPELL_AURA_PERIODIC_LEECH:
- return true;
- default:
- continue;
- }
- }*/
- return Creature::IsImmunedToSpell(spellInfo, useCharges);
+ case SPELL_AURA_PERIODIC_DAMAGE:
+ case SPELL_AURA_PERIODIC_LEECH:
+ case SPELL_AURA_MOD_FEAR:
+ case SPELL_AURA_TRANSFORM:
+ return true;
+ default:
+ break;
+ }
+ return Creature::IsImmunedToSpellEffect(spellInfo, index);
}
diff --git a/src/game/Totem.h b/src/game/Totem.h
index 82b183d5d62..40e2744bbeb 100644
--- a/src/game/Totem.h
+++ b/src/game/Totem.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#ifndef TRINITYCORE_TOTEM_H
#define TRINITYCORE_TOTEM_H
-#include "Creature.h"
+#include "TemporarySummon.h"
enum TotemType
{
@@ -32,10 +32,10 @@ enum TotemType
#define SENTRY_TOTEM_ENTRY 3968
-class Totem : public Creature
+class Totem : public TempSummon
{
public:
- explicit Totem();
+ explicit Totem(SummonPropertiesEntry const *properties, Unit *owner);
virtual ~Totem(){};
void Update( uint32 time );
void Summon(Unit* owner);
@@ -57,7 +57,7 @@ class Totem : public Creature
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
- bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
+ bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
protected:
TotemType m_type;
diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp
index 3593f8396a1..4efced3bc3a 100644
--- a/src/game/TotemAI.cpp
+++ b/src/game/TotemAI.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,9 +21,7 @@
#include "TotemAI.h"
#include "Totem.h"
#include "Creature.h"
-#include "Player.h"
-#include "Database/DBCStores.h"
-#include "MapManager.h"
+#include "DBCStores.h"
#include "ObjectAccessor.h"
#include "SpellMgr.h"
@@ -40,8 +38,9 @@ TotemAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-TotemAI::TotemAI(Creature *c) : CreatureAI(c), i_totem(static_cast<Totem&>(*c)), i_victimGuid(0)
+TotemAI::TotemAI(Creature *c) : CreatureAI(c), i_victimGuid(0)
{
+ assert(c->isTotem());
}
void
@@ -51,52 +50,41 @@ TotemAI::MoveInLineOfSight(Unit *)
void TotemAI::EnterEvadeMode()
{
- i_totem.CombatStop();
+ m_creature->CombatStop();
}
void
TotemAI::UpdateAI(const uint32 /*diff*/)
{
- if (i_totem.GetTotemType() != TOTEM_ACTIVE)
+ if (((Totem*)m_creature)->GetTotemType() != TOTEM_ACTIVE)
return;
- if (!i_totem.isAlive() || i_totem.IsNonMeleeSpellCasted(false))
+ if (!m_creature->isAlive() || m_creature->IsNonMeleeSpellCasted(false))
return;
// Search spell
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_totem.GetSpell());
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(((Totem*)m_creature)->GetSpell());
if (!spellInfo)
return;
- // Get spell rangy
+ // Get spell range
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
- float max_range = GetSpellMaxRange(srange);
+ float max_range = GetSpellMaxRangeForHostile(srange);
// SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems
// pointer to appropriate target if found any
- Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(i_totem, i_victimGuid) : NULL;
+ Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*m_creature, i_victimGuid) : NULL;
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
if( !victim ||
- !victim->isTargetableForAttack() || !i_totem.IsWithinDistInMap(victim, max_range) ||
- i_totem.IsFriendlyTo(victim) || !victim->isVisibleForOrDetect(&i_totem,false) )
+ !victim->isTargetableForAttack() || !m_creature->IsWithinDistInMap(victim, max_range) ||
+ m_creature->IsFriendlyTo(victim) || !victim->isVisibleForOrDetect(m_creature,false) )
{
- CellPair p(Trinity::ComputeCellPair(i_totem.GetPositionX(),i_totem.GetPositionY()));
- Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
-
victim = NULL;
-
- Trinity::NearestAttackableUnitInObjectRangeCheck u_check(&i_totem, &i_totem, max_range);
- Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(victim, u_check);
-
- TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
- TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
-
- CellLock<GridReadGuard> cell_lock(cell, p);
- cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(i_totem.GetMapId(), &i_totem));
- cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(i_totem.GetMapId(), &i_totem));
+ Trinity::NearestAttackableUnitInObjectRangeCheck u_check(m_creature, m_creature, max_range);
+ Trinity::UnitLastSearcher<Trinity::NearestAttackableUnitInObjectRangeCheck> checker(m_creature, victim, u_check);
+ m_creature->VisitNearbyObject(max_range, checker);
}
// If have target
@@ -106,30 +94,23 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
i_victimGuid = victim->GetGUID();
// attack
- i_totem.SetInFront(victim); // client change orientation by self
- i_totem.CastSpell(victim, i_totem.GetSpell(), false);
+ m_creature->SetInFront(victim); // client change orientation by self
+ m_creature->CastSpell(victim, ((Totem*)m_creature)->GetSpell(), false);
}
else
i_victimGuid = 0;
}
-bool
-TotemAI::IsVisible(Unit *) const
-{
- return false;
-}
-
void
TotemAI::AttackStart(Unit *)
{
// Sentry totem sends ping on attack
- if (i_totem.GetEntry() == SENTRY_TOTEM_ENTRY && i_totem.GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ if (m_creature->GetEntry() == SENTRY_TOTEM_ENTRY && m_creature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(MSG_MINIMAP_PING, (8+4+4));
- data << i_totem.GetGUID();
- data << i_totem.GetPositionX();
- data << i_totem.GetPositionY();
- ((Player*)i_totem.GetOwner())->GetSession()->SendPacket(&data);
+ data << m_creature->GetGUID();
+ data << m_creature->GetPositionX();
+ data << m_creature->GetPositionY();
+ ((Player*)m_creature->GetOwner())->GetSession()->SendPacket(&data);
}
}
-
diff --git a/src/game/TotemAI.h b/src/game/TotemAI.h
index 50ea764abfd..003f5d5ca13 100644
--- a/src/game/TotemAI.h
+++ b/src/game/TotemAI.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,18 +31,16 @@ class TRINITY_DLL_DECL TotemAI : public CreatureAI
{
public:
- TotemAI(Creature *c);
+ explicit TotemAI(Creature *c);
void MoveInLineOfSight(Unit *);
void AttackStart(Unit *);
void EnterEvadeMode();
- bool IsVisible(Unit *) const;
void UpdateAI(const uint32);
static int Permissible(const Creature *);
private:
- Totem &i_totem;
uint64 i_victimGuid;
};
#endif
diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp
index 278bb37c81c..cc3bcab62d2 100644
--- a/src/game/TradeHandler.cpp
+++ b/src/game/TradeHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp
index df2ad178550..c8f89b337bc 100644
--- a/src/game/Transports.cpp
+++ b/src/game/Transports.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
#include "Path.h"
#include "WorldPacket.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "ProgressBar.h"
#include "World.h"
@@ -89,8 +89,6 @@ void MapManager::LoadTransports()
continue;
}
- t->m_name = goinfo->name;
-
float x, y, z, o;
uint32 mapid;
x = t->m_WayPoints[0].x; y = t->m_WayPoints[0].y; z = t->m_WayPoints[0].z; mapid = t->m_WayPoints[0].mapid; o = 1;
@@ -139,7 +137,7 @@ void MapManager::LoadTransports()
Transport::Transport() : GameObject()
{
// 2.3.2 - 0x5A
- m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HASPOSITION);
+ m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION);
}
bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
@@ -147,10 +145,11 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
Relocate(x,y,z,ang);
SetMapId(mapid);
+ // instance id and phaseMask isn't set to values different from std.
if(!IsPositionValid())
{
- sLog.outError("ERROR: Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog.outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow,x,y);
return false;
}
@@ -170,9 +169,10 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
- SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
-
- SetUInt32Value(OBJECT_FIELD_ENTRY, goinfo->id);
+ //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
+ SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64));
+ SetUInt32Value(GAMEOBJECT_LEVEL, m_period);
+ SetEntry(goinfo->id);
SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId);
@@ -181,7 +181,9 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z,
SetGoAnimProgress(animprogress);
if(dynflags)
- SetUInt32Value(GAMEOBJECT_DYN_FLAGS, dynflags);
+ SetUInt32Value(GAMEOBJECT_DYNAMIC, MAKE_PAIR32(0, dynflags));
+
+ SetName(goinfo->name);
return true;
}
@@ -414,7 +416,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
uint32 timer = t;
- // sLog.outDetail(" Generated %d waypoints, total time %u.", m_WayPoints.size(), timer);
+ // sLog.outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
m_curr = m_WayPoints.begin();
m_curr = GetNextWayPoint();
@@ -437,11 +439,9 @@ Transport::WayPointMap::iterator Transport::GetNextWayPoint()
void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
- //MapManager::Instance().GetMap(oldMapid)->Remove((GameObject *)this, false);
+ Map const* oldMap = GetMap();
SetMapId(newMapid);
- //MapManager::Instance().LoadGrid(newMapid,x,y,true);
Relocate(x, y, z);
- //MapManager::Instance().GetMap(newMapid)->Add<GameObject>((GameObject *)this);
for(PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
{
@@ -465,13 +465,21 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
//data << uint32(0);
//plr->GetSession()->SendPacket(&data);
}
+
+ Map const* newMap = GetMap();
+
+ if(oldMap != newMap)
+ {
+ UpdateForMap(oldMap);
+ UpdateForMap(newMap);
+ }
}
bool Transport::AddPassenger(Player* passenger)
{
if (m_passengers.find(passenger) == m_passengers.end())
{
- sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), this->m_name.c_str());
+ sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
m_passengers.insert(passenger);
}
return true;
@@ -479,11 +487,8 @@ bool Transport::AddPassenger(Player* passenger)
bool Transport::RemovePassenger(Player* passenger)
{
- if (m_passengers.find(passenger) != m_passengers.end())
- {
- sLog.outDetail("Player %s removed from transport %s.", passenger->GetName(), this->m_name.c_str());
- m_passengers.erase(passenger);
- }
+ if (m_passengers.erase(passenger))
+ sLog.outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
return true;
}
@@ -512,7 +517,6 @@ void Transport::Update(uint32 /*p_time*/)
}
else
{
- //MapManager::Instance().GetMap(m_curr->second.mapid)->GameobjectRelocation((GameObject *)this, m_curr->second.x, m_curr->second.y, m_curr->second.z, this->m_orientation);
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z);
}
/*
@@ -550,10 +554,6 @@ void Transport::Update(uint32 /*p_time*/)
if (m_curr == m_WayPoints.begin() && (sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
sLog.outDetail(" ************ BEGIN ************** %s", this->m_name.c_str());
- // MapManager::Instance().GetMap(m_curr->second.mapid)->Add(&this); // -> // ->Add(t);
- //MapManager::Instance().GetMap(m_curr->second.mapid)->Remove((GameObject *)this, false); // -> // ->Add(t);
- //MapManager::Instance().GetMap(m_curr->second.mapid)->Add((GameObject *)this); // -> // ->Add(t);
-
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
sLog.outDetail("%s moved to %d %f %f %f %d", this->m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
@@ -562,3 +562,36 @@ void Transport::Update(uint32 /*p_time*/)
}
}
+void Transport::UpdateForMap(Map const* targetMap)
+{
+ Map::PlayerList const& pl = targetMap->GetPlayers();
+ if(pl.isEmpty())
+ return;
+
+ if(GetMapId()==targetMap->GetId())
+ {
+ for(Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
+ {
+ if(this != itr->getSource()->GetTransport())
+ {
+ UpdateData transData;
+ BuildCreateUpdateBlockForPlayer(&transData, itr->getSource());
+ WorldPacket packet;
+ transData.BuildPacket(&packet, true);
+ itr->getSource()->SendDirectMessage(&packet);
+ }
+ }
+ }
+ else
+ {
+ UpdateData transData;
+ BuildOutOfRangeUpdateBlock(&transData);
+ WorldPacket out_packet;
+ transData.BuildPacket(&out_packet, true);
+
+ for(Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
+ if(this != itr->getSource()->GetTransport())
+ itr->getSource()->SendDirectMessage(&out_packet);
+ }
+}
+
diff --git a/src/game/Transports.h b/src/game/Transports.h
index a814a0f70b9..5e0f954c3b7 100644
--- a/src/game/Transports.h
+++ b/src/game/Transports.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,16 +38,16 @@ class TransportPath
uint32 delay;
};
- inline void SetLength(const unsigned int sz)
+ void SetLength(const unsigned int sz)
{
i_nodes.resize( sz );
}
- inline unsigned int Size(void) const { return i_nodes.size(); }
- inline bool Empty(void) const { return i_nodes.empty(); }
- inline void Resize(unsigned int sz) { i_nodes.resize(sz); }
- inline void Clear(void) { i_nodes.clear(); }
- inline PathNode* GetNodes(void) { return static_cast<PathNode *>(&i_nodes[0]); }
+ unsigned int Size(void) const { return i_nodes.size(); }
+ bool Empty(void) const { return i_nodes.empty(); }
+ void Resize(unsigned int sz) { i_nodes.resize(sz); }
+ void Clear(void) { i_nodes.clear(); }
+ PathNode* GetNodes(void) { return static_cast<PathNode *>(&i_nodes[0]); }
PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; }
const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; }
@@ -56,7 +56,7 @@ class TransportPath
std::vector<PathNode> i_nodes;
};
-class Transport : private GameObject
+class Transport : protected GameObject
{
public:
explicit Transport();
@@ -83,7 +83,6 @@ class Transport : private GameObject
typedef std::set<Player*> PlayerSet;
PlayerSet const& GetPassengers() const { return m_passengers; }
- std::string m_name;
private:
struct WayPoint
{
@@ -114,6 +113,7 @@ class Transport : private GameObject
private:
void TeleportTransport(uint32 newMapid, float x, float y, float z);
+ void UpdateForMap(Map const* map);
WayPointMap::iterator GetNextWayPoint();
};
#endif
diff --git a/src/game/Traveller.h b/src/game/Traveller.h
index ee2ec55833f..702cc6413b0 100644
--- a/src/game/Traveller.h
+++ b/src/game/Traveller.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,11 +21,9 @@
#ifndef TRINITY_TRAVELLER_H
#define TRINITY_TRAVELLER_H
-#include "MapManager.h"
#include "Creature.h"
#include "Player.h"
#include <cassert>
-#include "CreatureGroups.h"
/** Traveller is a wrapper for units (creatures or players) that
* travel from point A to point B using the destination holder.
@@ -47,22 +45,39 @@ struct TRINITY_DLL_DECL Traveller
operator T&(void) { return i_traveller; }
operator const T&(void) { return i_traveller; }
- inline float GetPositionX() const { return i_traveller.GetPositionX(); }
- inline float GetPositionY() const { return i_traveller.GetPositionY(); }
- inline float GetPositionZ() const { return i_traveller.GetPositionZ(); }
- inline T& GetTraveller(void) { return i_traveller; }
+ float GetPositionX() const { return i_traveller.GetPositionX(); }
+ float GetPositionY() const { return i_traveller.GetPositionY(); }
+ float GetPositionZ() const { return i_traveller.GetPositionZ(); }
+ T& GetTraveller(void) { return i_traveller; }
float Speed(void) { assert(false); return 0.0f; }
+ float GetMoveDestinationTo(float x, float y, float z);
+ uint32 GetTotalTrevelTimeTo(float x, float y, float z);
+
void Relocation(float x, float y, float z, float orientation) {}
void Relocation(float x, float y, float z) { Relocation(x, y, z, i_traveller.GetOrientation()); }
void MoveTo(float x, float y, float z, uint32 t) {}
};
+template<class T>
+inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
+{
+ float dist = GetMoveDestinationTo(x,y,z);
+ float speed = 0.001f;
+ if (Speed() <= 0.0f)
+ return 0xfffffffe; // almost infinity-unit should stop
+ else
+ speed *= Speed(); // speed is in seconds so convert from second to millisecond
+ return static_cast<uint32>(dist/speed);
+}
+
// specialization for creatures
template<>
inline float Traveller<Creature>::Speed()
{
- if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
+ if(i_traveller.hasUnitState(UNIT_STAT_CHARGING))
+ return i_traveller.m_TempSpeed;
+ else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
return i_traveller.GetSpeed(MOVE_WALK);
else if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING2))
return i_traveller.GetSpeed(MOVE_FLIGHT);
@@ -73,29 +88,59 @@ inline float Traveller<Creature>::Speed()
template<>
inline void Traveller<Creature>::Relocation(float x, float y, float z, float orientation)
{
- MapManager::Instance().GetMap(i_traveller.GetMapId(), &i_traveller)->CreatureRelocation(&i_traveller, x, y, z, orientation);
+ i_traveller.GetMap()->CreatureRelocation(&i_traveller, x, y, z, orientation);
+}
+
+template<>
+inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z)
+{
+ float dx = x - GetPositionX();
+ float dy = y - GetPositionY();
+ float dz = z - GetPositionZ();
+
+ if(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_FLYING2))
+ return sqrt((dx*dx) + (dy*dy) + (dz*dz));
+ else //Walking on the ground
+ return sqrt((dx*dx) + (dy*dy));
}
+
template<>
inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
{
- i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
+ //i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
+ i_traveller.SendMonsterMove(x, y, z, t);
}
// specialization for players
template<>
inline float Traveller<Player>::Speed()
{
- if (i_traveller.isInFlight())
+ if(i_traveller.hasUnitState(UNIT_STAT_CHARGING))
+ return i_traveller.m_TempSpeed;
+ else if(i_traveller.isInFlight())
return PLAYER_FLIGHT_SPEED;
else
return i_traveller.GetSpeed(i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN);
}
template<>
+inline float Traveller<Player>::GetMoveDestinationTo(float x, float y, float z)
+{
+ float dx = x - GetPositionX();
+ float dy = y - GetPositionY();
+ float dz = z - GetPositionZ();
+
+ if (i_traveller.isInFlight())
+ return sqrt((dx*dx) + (dy*dy) + (dz*dz));
+ else //Walking on the ground
+ return sqrt((dx*dx) + (dy*dy));
+}
+
+template<>
inline void Traveller<Player>::Relocation(float x, float y, float z, float orientation)
{
- MapManager::Instance().GetMap(i_traveller.GetMapId(), &i_traveller)->PlayerRelocation(&i_traveller, x, y, z, orientation);
+ i_traveller.GetMap()->PlayerRelocation(&i_traveller, x, y, z, orientation);
}
template<>
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 468859726e1..281679bc3e6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -49,6 +49,9 @@
#include "CreatureGroups.h"
#include "PetAI.h"
#include "NullCreatureAI.h"
+#include "Traveller.h"
+#include "TemporarySummon.h"
+#include "Vehicle.h"
#include <math.h>
@@ -62,102 +65,27 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
3.141594f, // MOVE_TURN_RATE
7.0f, // MOVE_FLIGHT
4.5f, // MOVE_FLIGHT_BACK
+ 3.14f // MOVE_PITCH_RATE
};
-void InitTriggerAuraData();
-
-// auraTypes contains attacker auras capable of proc'ing cast auras
-static Unit::AuraTypeSet GenerateAttakerProcCastAuraTypes()
-{
- static Unit::AuraTypeSet auraTypes;
- auraTypes.insert(SPELL_AURA_DUMMY);
- auraTypes.insert(SPELL_AURA_PROC_TRIGGER_SPELL);
- auraTypes.insert(SPELL_AURA_MOD_HASTE);
- auraTypes.insert(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- return auraTypes;
-}
-
-// auraTypes contains victim auras capable of proc'ing cast auras
-static Unit::AuraTypeSet GenerateVictimProcCastAuraTypes()
-{
- static Unit::AuraTypeSet auraTypes;
- auraTypes.insert(SPELL_AURA_DUMMY);
- auraTypes.insert(SPELL_AURA_PRAYER_OF_MENDING);
- auraTypes.insert(SPELL_AURA_PROC_TRIGGER_SPELL);
- return auraTypes;
-}
-
-// auraTypes contains auras capable of proc effect/damage (but not cast) for attacker
-static Unit::AuraTypeSet GenerateAttakerProcEffectAuraTypes()
-{
- static Unit::AuraTypeSet auraTypes;
- auraTypes.insert(SPELL_AURA_MOD_DAMAGE_DONE);
- auraTypes.insert(SPELL_AURA_PROC_TRIGGER_DAMAGE);
- auraTypes.insert(SPELL_AURA_MOD_CASTING_SPEED);
- auraTypes.insert(SPELL_AURA_MOD_RATING);
- return auraTypes;
-}
-
-// auraTypes contains auras capable of proc effect/damage (but not cast) for victim
-static Unit::AuraTypeSet GenerateVictimProcEffectAuraTypes()
-{
- static Unit::AuraTypeSet auraTypes;
- auraTypes.insert(SPELL_AURA_MOD_RESISTANCE);
- auraTypes.insert(SPELL_AURA_PROC_TRIGGER_DAMAGE);
- auraTypes.insert(SPELL_AURA_MOD_PARRY_PERCENT);
- auraTypes.insert(SPELL_AURA_MOD_BLOCK_PERCENT);
- auraTypes.insert(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
- return auraTypes;
-}
-
-static Unit::AuraTypeSet attackerProcCastAuraTypes = GenerateAttakerProcCastAuraTypes();
-static Unit::AuraTypeSet attackerProcEffectAuraTypes = GenerateAttakerProcEffectAuraTypes();
-
-static Unit::AuraTypeSet victimProcCastAuraTypes = GenerateVictimProcCastAuraTypes();
-static Unit::AuraTypeSet victimProcEffectAuraTypes = GenerateVictimProcEffectAuraTypes();
-
-// auraTypes contains auras capable of proc'ing for attacker and victim
-static Unit::AuraTypeSet GenerateProcAuraTypes()
-{
- InitTriggerAuraData();
-
- Unit::AuraTypeSet auraTypes;
- auraTypes.insert(attackerProcCastAuraTypes.begin(),attackerProcCastAuraTypes.end());
- auraTypes.insert(attackerProcEffectAuraTypes.begin(),attackerProcEffectAuraTypes.end());
- auraTypes.insert(victimProcCastAuraTypes.begin(),victimProcCastAuraTypes.end());
- auraTypes.insert(victimProcEffectAuraTypes.begin(),victimProcEffectAuraTypes.end());
- return auraTypes;
-}
-
-static Unit::AuraTypeSet procAuraTypes = GenerateProcAuraTypes();
-
-bool IsPassiveStackableSpell( uint32 spellId )
-{
- if(!IsPassiveSpell(spellId))
- return false;
-
- SpellEntry const* spellProto = sSpellStore.LookupEntry(spellId);
- if(!spellProto)
- return false;
-
- for(int j = 0; j < 3; ++j)
- {
- if(std::find(procAuraTypes.begin(),procAuraTypes.end(),spellProto->EffectApplyAuraName[j])!=procAuraTypes.end())
- return false;
- }
-
- return true;
-}
+// Used for prepare can/can`t triggr aura
+static bool InitTriggerAuraData();
+// Define can trigger auras
+static bool isTriggerAura[TOTAL_AURAS];
+// Define can`t trigger auras (need for disable second trigger)
+static bool isNonTriggerAura[TOTAL_AURAS];
+// Prepare lists
+static bool procPrepared = InitTriggerAuraData();
Unit::Unit()
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
, m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false)
-, i_AI(NULL), i_disabledAI(NULL)
+, i_AI(NULL), i_disabledAI(NULL), m_removedAurasCount(0), m_Vehicle(NULL)
{
m_objectType |= TYPEMASK_UNIT;
m_objectTypeId = TYPEID_UNIT;
// 2.3.2 - 0x70
- m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HASPOSITION);
+ m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION);
m_attackTimer[BASE_ATTACK] = 0;
m_attackTimer[OFF_ATTACK] = 0;
@@ -178,15 +106,14 @@ Unit::Unit()
m_addDmgOnce = 0;
- for(int i = 0; i < MAX_TOTEM; ++i)
- m_TotemSlot[i] = 0;
+ for(int i = 0; i < MAX_SUMMON_SLOT; ++i)
+ m_SummonSlot[i] = 0;
m_ObjectSlot[0] = m_ObjectSlot[1] = m_ObjectSlot[2] = m_ObjectSlot[3] = 0;
//m_Aura = NULL;
//m_AurasCheck = 2000;
//m_removeAuraTimer = 4;
//tmpAura = NULL;
- waterbreath = false;
m_Visibility = VISIBILITY_ON;
@@ -209,7 +136,7 @@ Unit::Unit()
// implement 50% base damage from offhand
m_auraModifiersGroup[UNIT_MOD_DAMAGE_OFFHAND][TOTAL_PCT] = 0.5f;
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < MAX_ATTACK; ++i)
{
m_weaponDamage[i][MINDAMAGE] = BASE_MINDAMAGE;
m_weaponDamage[i][MAXDAMAGE] = BASE_MAXDAMAGE;
@@ -233,7 +160,6 @@ Unit::Unit()
for (int i = 0; i < MAX_MOVE_TYPE; ++i)
m_speed_rate[i] = 1.0f;
- m_removedAuras = 0;
m_charmInfo = NULL;
m_unit_movement_flags = 0;
m_reducedThreatPercent = 0;
@@ -264,6 +190,7 @@ Unit::~Unit()
assert(!m_attacking);
assert(m_attackers.empty());
assert(m_sharedVision.empty());
+ assert(m_Controlled.empty());
}
void Unit::Update( uint32 p_time )
@@ -313,6 +240,7 @@ void Unit::Update( uint32 p_time )
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, GetHealth() < GetMaxHealth()*0.20f);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, GetHealth() < GetMaxHealth()*0.35f);
+ ModifyAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, GetHealth() > GetMaxHealth()*0.75f);
i_motionMaster.UpdateMotion(p_time);
}
@@ -329,28 +257,23 @@ void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player)
{
float x, y, z;
if(GetMotionMaster()->GetDestination(x, y, z))
- SendMonsterMoveWithSpeed(x, y, z, GetUnitMovementFlags(), 0, player);
+ SendMonsterMoveWithSpeed(x, y, z, 0, player);
}
-void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFlags, uint32 transitTime, Player* player)
+void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player)
{
if (!transitTime)
{
- float dx = x - GetPositionX();
- float dy = y - GetPositionY();
- float dz = z - GetPositionZ();
-
- float dist = ((dx*dx) + (dy*dy) + (dz*dz));
- if(dist<0)
- dist = 0;
+ if(GetTypeId()==TYPEID_PLAYER)
+ {
+ Traveller<Player> traveller(*(Player*)this);
+ transitTime = traveller.GetTotalTrevelTimeTo(x,y,z);
+ }
else
- dist = sqrt(dist);
-
- double speed = GetSpeed((MovementFlags & MOVEMENTFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN);
- if(speed<=0)
- speed = 2.5f;
- speed *= 0.001f;
- transitTime = static_cast<uint32>(dist / speed + 0.5);
+ {
+ Traveller<Creature> traveller(*(Creature*)this);
+ transitTime = traveller.GetTotalTrevelTimeTo(x,y,z);
+ }
}
//float orientation = (float)atan2((double)dy, (double)dx);
SendMonsterMove(x, y, z, transitTime, player);
@@ -368,7 +291,7 @@ void Unit::SendMonsterStop()
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
{
- WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
+ WorldPacket data( SMSG_MONSTER_MOVE, 12+4+1+4+4+4+12+GetPackGUID().size());
data.append(GetPackGUID());
data << GetPositionX() << GetPositionY() << GetPositionZ();
@@ -387,38 +310,66 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T
SendMessageToSet( &data, true );
}
+void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player)
+{
+ WorldPacket data( SMSG_MONSTER_MOVE, 12+4+1+4+4+4+12+GetPackGUID().size());
+ data.append(GetPackGUID());
+
+ data << GetPositionX() << GetPositionY() << GetPositionZ();
+ data << getMSTime();
+
+ data << uint8(0);
+ data << MoveFlags;
+
+ if(MoveFlags & MOVEFLAG_JUMP)
+ {
+ data << time;
+ data << speedZ;
+ data << (uint32)0; // walk time after jump
+ }
+ else
+ data << time;
+
+ data << uint32(1); // 1 single waypoint
+ data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B
+
+ if(player)
+ player->GetSession()->SendPacket(&data);
+ else
+ SendMessageToSet( &data, true );
+}
+
/*void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player)
{
WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
data.append(GetPackGUID());
- // Point A, starting location
data << GetPositionX() << GetPositionY() << GetPositionZ();
- // unknown field - unrelated to orientation
- // seems to increment about 1000 for every 1.7 seconds
- // for now, we'll just use mstime
- data << getMSTime();
+ data << uint32(getMSTime());
data << uint8(type); // unknown
switch(type)
{
case 0: // normal packet
break;
- case 1: // stop packet
+ case 1: // stop packet (raw pos?)
SendMessageToSet( &data, true );
return;
+ case 2: // facing spot, not used currently
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ break;
case 3: // not used currently
- data << uint64(0); // probably target guid
+ data << uint64(0); // probably target guid (facing target?)
break;
case 4: // not used currently
- data << float(0); // probably orientation
+ data << float(0); // facing angle
break;
}
- //Movement Flags (0x0 = walk, 0x100 = run, 0x200 = fly/swim)
- data << uint32((MovementFlags & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK);
-
- data << Time; // Time in between points
+ data << uint32(MovementFlags);
+ data << uint32(Time); // Time in between points
data << uint32(1); // 1 single waypoint
data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B
@@ -439,16 +390,12 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end)
data << GetPositionX();
data << GetPositionY();
data << GetPositionZ();
-
data << getMSTime();
-
data << uint8( 0 );
data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight())? (MOVEFLAG_FLY|MOVEFLAG_WALK) : MOVEFLAG_WALK);
data << uint32( traveltime );
data << uint32( pathSize );
data.append( (char*)path.GetNodes(start), pathSize * 4 * 3 );
-
- //WPAssert( data.size() == 37 + pathnodes.Size( ) * 4 * 3 );
SendMessageToSet(&data, true);
}
@@ -503,71 +450,22 @@ void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z,
, GetAngle(obj) + (attacker_number ? (M_PI/2 - M_PI * rand_norm()) * (float)attacker_number / combat_reach / 3 : 0));
}
-void Unit::RemoveSpellsCausingAura(AuraType auraType)
-{
- if (auraType >= TOTAL_AURAS) return;
- AuraList::iterator iter, next;
- for (iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); iter = next)
- {
- next = iter;
- ++next;
-
- if (*iter)
- {
- RemoveAurasDueToSpell((*iter)->GetId());
- if (!m_modAuras[auraType].empty())
- next = m_modAuras[auraType].begin();
- else
- return;
- }
- }
-}
-
-void Unit::RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID)
-{
- if (auraType >= TOTAL_AURAS) return;
- AuraList::iterator iter, next;
- for(iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); iter = next)
- {
- next = iter;
- ++next;
-
- if (*iter)
- {
- RemoveAurasByCasterSpell((*iter)->GetId(), casterGUID);
- if (!m_modAuras[auraType].empty())
- next = m_modAuras[auraType].begin();
- else
- return;
- }
- }
-}
-
void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
{
if(!(m_interruptMask & flag))
return;
// interrupt auras
- AuraList::iterator iter, next;
- for (iter = m_interruptableAuras.begin(); iter != m_interruptableAuras.end(); iter = next)
+ for (AuraList::iterator iter = m_interruptableAuras.begin(); iter != m_interruptableAuras.end();)
{
- next = iter;
- ++next;
-
- //sLog.outDetail("auraflag:%u flag:%u = %u",(*iter)->GetSpellProto()->AuraInterruptFlags,flag,(*iter)->GetSpellProto()->AuraInterruptFlags & flag);
- if(*iter && ((*iter)->GetSpellProto()->AuraInterruptFlags & flag))
+ Aura * aur = *iter;
+ ++iter;
+ if ((aur->GetSpellProto()->AuraInterruptFlags & flag) && (!except || aur->GetId() != except))
{
- if((*iter)->IsInUse())
- sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag);
- else if(!except || (*iter)->GetId() != except)
- {
- RemoveAurasDueToSpell((*iter)->GetId());
- if (!m_interruptableAuras.empty())
- next = m_interruptableAuras.begin();
- else
- break;
- }
+ uint32 removedAuras = m_removedAurasCount;
+ RemoveAura(aur, AURA_REMOVE_BY_ENEMY_SPELL);
+ if (removedAuras+1 < m_removedAurasCount)
+ iter=m_interruptableAuras.begin();
}
}
@@ -594,11 +492,6 @@ void Unit::UpdateInterruptMask()
m_interruptMask |= spell->m_spellInfo->ChannelInterruptFlags;
}
-bool Unit::HasAuraType(AuraType auraType) const
-{
- return (!m_modAuras[auraType].empty());
-}
-
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
{
@@ -606,26 +499,24 @@ void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
uint32 max_dmg = getLevel() > 8 ? 25 * getLevel() - 150 : 50;
float chance = float(damage) / max_dmg * 100.0f;
- AuraList::iterator i, next;
- for(i = m_ccAuras.begin(); i != m_ccAuras.end(); i = next)
+ // interrupt auras
+ for (AuraList::iterator iter = m_ccAuras.begin(); iter != m_ccAuras.end();)
{
- next = i;
- ++next;
-
- if(*i && (!spell || (*i)->GetId() != spell) && roll_chance_f(chance))
+ Aura * aur = *iter;
+ ++iter;
+ if ((!spell || aur->GetId() != spell) && roll_chance_f(chance))
{
- RemoveAurasDueToSpell((*i)->GetId());
- if (!m_ccAuras.empty())
- next = m_ccAuras.begin();
- else
- return;
+ uint32 removedAuras = m_removedAurasCount;
+ RemoveAura(aur, AURA_REMOVE_BY_ENEMY_SPELL);
+ if (removedAuras+1 < m_removedAurasCount)
+ iter=m_ccAuras.begin();
}
}
}
uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss)
{
- if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
+ if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return 0;
//You don't lose health from damage taken from another player while in a sanctuary
@@ -684,30 +575,27 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
return 0;
}
- if(pVictim->GetTypeId() != TYPEID_PLAYER)
+ // no xp,health if type 8 /critters/
+ if(pVictim->GetTypeId() != TYPEID_PLAYER && pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
{
- // no xp,health if type 8 /critters/
- if ( pVictim->GetCreatureType() == CREATURE_TYPE_CRITTER)
+ // allow loot only if has loot_id in creature_template
+ if(damage >= pVictim->GetHealth())
{
- // allow loot only if has loot_id in creature_template
- if(damage >= pVictim->GetHealth())
- {
- pVictim->setDeathState(JUST_DIED);
- pVictim->SetHealth(0);
-
- CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
- if(cInfo && cInfo->lootid)
- pVictim->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ pVictim->setDeathState(JUST_DIED);
+ pVictim->SetHealth(0);
- // some critters required for quests
- if(GetTypeId() == TYPEID_PLAYER)
- ((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
- }
- else
- pVictim->ModifyHealth(- (int32)damage);
+ CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
+ if(cInfo && cInfo->lootid)
+ pVictim->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- return damage;
+ // some critters required for quests
+ if(GetTypeId() == TYPEID_PLAYER)
+ ((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
}
+ else
+ pVictim->ModifyHealth(- (int32)damage);
+
+ return damage;
}
DEBUG_LOG("DealDamageStart");
@@ -777,29 +665,174 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{
DEBUG_LOG("DealDamage: victim just died");
Kill(pVictim, durabilityLoss);
- }
- else // if (health <= damage)
- {
- DEBUG_LOG("DealDamageAlive");
- pVictim->ModifyHealth(- (int32)damage);
+ /*// find player: owner of controlled `this` or `this` itself maybe
+ Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();
- if(damagetype != DOT)
+ if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->GetLootRecipient())
+ player = ((Creature*)pVictim)->GetLootRecipient();
+ // Reward player, his pets, and group/raid members
+ // call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
+ if(player && player!=pVictim)
{
- if(!getVictim())
- /*{
- // if have target and damage pVictim just call AI reaction
- if(pVictim != getVictim() && pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->IsAIEnabled)
- ((Creature*)pVictim)->AI()->AttackedBy(this);
+ player->RewardPlayerAndGroupAtKill(pVictim);
+ player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
+ }
+
+ DEBUG_LOG("DealDamageAttackStop");
+
+ // stop combat
+ pVictim->CombatStop();
+ pVictim->getHostilRefManager().deleteReferences();
+
+ bool damageFromSpiritOfRedemtionTalent = spellProto && spellProto->Id == 27795;
+
+ // if talent known but not triggered (check priest class for speedup check)
+ Aura* spiritOfRedemtionTalentReady = NULL;
+ if( !damageFromSpiritOfRedemtionTalent && // not called from SPELL_AURA_SPIRIT_OF_REDEMPTION
+ pVictim->GetTypeId()==TYPEID_PLAYER && pVictim->getClass()==CLASS_PRIEST )
+ {
+ AuraList const& vDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr)
+ {
+ if((*itr)->GetSpellProto()->SpellIconID==1654)
+ {
+ spiritOfRedemtionTalentReady = *itr;
+ break;
+ }
}
- else*/
+ }
+
+ DEBUG_LOG("SET JUST_DIED");
+ if(!spiritOfRedemtionTalentReady)
+ pVictim->setDeathState(JUST_DIED);
+
+ DEBUG_LOG("DealDamageHealth1");
+
+ if(spiritOfRedemtionTalentReady)
+ {
+ // save value before aura remove
+ uint32 ressSpellId = pVictim->GetUInt32Value(PLAYER_SELF_RES_SPELL);
+ if(!ressSpellId)
+ ressSpellId = ((Player*)pVictim)->GetResurrectionSpellId();
+
+ //Remove all expected to remove at death auras (most important negative case like DoT or periodic triggers)
+ pVictim->RemoveAllAurasOnDeath();
+
+ // restore for use at real death
+ pVictim->SetUInt32Value(PLAYER_SELF_RES_SPELL,ressSpellId);
+
+ // FORM_SPIRITOFREDEMPTION and related auras
+ pVictim->CastSpell(pVictim,27827,true,NULL,spiritOfRedemtionTalentReady);
+ }
+ else
+ pVictim->SetHealth(0);
+
+ // remember victim PvP death for corpse type and corpse reclaim delay
+ // at original death (not at SpiritOfRedemtionTalent timeout)
+ if( pVictim->GetTypeId()==TYPEID_PLAYER && !damageFromSpiritOfRedemtionTalent )
+ ((Player*)pVictim)->SetPvPDeath(player!=NULL);
+
+ // Call KilledUnit for creatures
+ if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI())
+ ((Creature*)this)->AI()->KilledUnit(pVictim);
+
+ // achievement stuff
+ if (pVictim->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (GetTypeId() == TYPEID_UNIT)
+ ((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry());
+ else if(GetTypeId() == TYPEID_PLAYER && pVictim != this)
+ ((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ((Player*)this)->GetTeam());
+ }
+
+ // 10% durability loss on death
+ // clean InHateListOf
+ if (pVictim->GetTypeId() == TYPEID_PLAYER)
+ {
+ // only if not player and not controlled by player pet. And not at BG
+ if (durabilityLoss && !player && !((Player*)pVictim)->InBattleGround())
+ {
+ DEBUG_LOG("We are dead, loosing 10 percents durability");
+ ((Player*)pVictim)->DurabilityLossAll(0.10f,false);
+ // durability lost message
+ WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
+ ((Player*)pVictim)->GetSession()->SendPacket(&data);
+ }
+ }
+ else // creature died
+ {
+ DEBUG_LOG("DealDamageNotPlayer");
+ Creature *cVictim = (Creature*)pVictim;
+
+ if(!cVictim->isPet())
+ {
+ cVictim->DeleteThreatList();
+ cVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ }
+ // Call creature just died function
+ if (cVictim->AI())
+ cVictim->AI()->JustDied(this);
+
+ // Dungeon specific stuff, only applies to players killing creatures
+ if(cVictim->GetInstanceId())
{
- // if not have main target then attack state with target (including AI call)
- //start melee attacks only after melee hit
- Attack(pVictim,(damagetype == DIRECT_DAMAGE));
+ Map *m = cVictim->GetMap();
+ Player *creditedPlayer = GetCharmerOrOwnerPlayerOrPlayerItself();
+ // TODO: do instance binding anyway if the charmer/owner is offline
+
+ if(m->IsDungeon() && creditedPlayer)
+ {
+ if(m->IsRaid() || m->IsHeroic())
+ {
+ if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
+ ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
+ }
+ else
+ {
+ // the reset time is set but not added to the scheduler
+ // until the players leave the instance
+ time_t resettime = cVictim->GetRespawnTimeEx() + 2 * HOUR;
+ if(InstanceSave *save = sInstanceSaveManager.GetInstanceSave(cVictim->GetInstanceId()))
+ if(save->GetResetTime() < resettime) save->SetResetTime(resettime);
+ }
+ }
}
}
+ // last damage from non duel opponent or opponent controlled creature
+ if(duel_hasEnded)
+ {
+ assert(pVictim->GetTypeId()==TYPEID_PLAYER);
+ Player *he = (Player*)pVictim;
+
+ assert(he->duel);
+
+ he->duel->opponent->CombatStopWithPets(true);
+ he->CombatStopWithPets(true);
+
+ he->DuelComplete(DUEL_INTERUPTED);
+ }
+
+ // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
+ if(pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->InBattleGround())
+ {
+ Player *killed = ((Player*)pVictim);
+ if(BattleGround *bg = killed->GetBattleGround())
+ if(player)
+ bg->HandleKillPlayer(killed, player);
+ //later we can add support for creature->player kills here i'm
+ //not sure, but i guess those kills also get counted in av
+ //else if(GetTypeId() == TYPEID_UNIT)
+ // bg->HandleKillPlayer(killed,(Creature*)this);
+ }*/
+ }
+ else // if (health <= damage)
+ {
+ DEBUG_LOG("DealDamageAlive");
+
+ pVictim->ModifyHealth(- (int32)damage);
+
if(damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE)
{
//TODO: This is from procflag, I do not know which spell needs this
@@ -807,7 +840,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
//if (!spellProto || !(spellProto->AuraInterruptFlags&AURA_INTERRUPT_FLAG_DIRECT_DAMAGE))
pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
}
-
if (pVictim->GetTypeId() != TYPEID_PLAYER)
{
if(spellProto && IsDamageToThreatSpell(spellProto))
@@ -874,7 +906,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if(spell->getState() == SPELL_STATE_PREPARING)
{
uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
- if(interruptFlags & SPELL_INTERRUPT_FLAG_DAMAGE)
+ if(interruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG)
pVictim->InterruptNonMeleeSpells(false);
else if(interruptFlags & SPELL_INTERRUPT_FLAG_PUSH_BACK)
spell->Delayed();
@@ -924,7 +956,7 @@ void Unit::CastStop(uint32 except_spellid)
InterruptSpell(i,false);
}
-void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@@ -937,7 +969,7 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster);
}
-void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
if(!spellInfo)
{
@@ -991,20 +1023,20 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
spell->prepare(&targets, triggeredByAura);
}
-void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
if(!spellInfo)
{
- sLog.outError("CastCustomSpell: unknown spell id %i\n", spellId);
+ sLog.outError("CastCustomSpell: unknown spell id %i", spellId);
return;
}
CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggeredByAura, originalCaster);
}
-void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
if(!spellInfo)
{
@@ -1055,7 +1087,7 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const
}
// used for scripting
-void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
@@ -1080,7 +1112,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
}
// used for scripting
-void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster)
+void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
if(!go)
return;
@@ -1187,6 +1219,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
if (blocked)
{
damageInfo->blocked = uint32(pVictim->GetShieldBlockValue());
+ //double blocked amount if block is critical
+ if (isBlockCritical())
+ damageInfo->blocked+=damageInfo->blocked;
if (damage < damageInfo->blocked)
damageInfo->blocked = damage;
damage-=damageInfo->blocked;
@@ -1201,7 +1236,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
if (crit)
{
damageInfo->HitInfo|= SPELL_HIT_TYPE_CRIT;
- damage = SpellCriticalBonus(spellInfo, damage, pVictim);
+ damage = SpellCriticalDamageBonus(spellInfo, damage, pVictim);
// Resilience - reduce crit damage
if (pVictim->GetTypeId()==TYPEID_PLAYER)
damage -= ((Player*)pVictim)->GetSpellCritDamageReduction(damage);
@@ -1211,12 +1246,12 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
}
if( damageSchoolMask & SPELL_SCHOOL_MASK_NORMAL )
- damage = CalcArmorReducedDamage(pVictim, damage);
+ damage = CalcArmorReducedDamage(pVictim, damage, spellInfo, attackType);
// Calculate absorb resist
if(damage > 0)
{
- CalcAbsorbResist(pVictim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist);
+ CalcAbsorbResist(pVictim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo);
damage-= damageInfo->absorb + damageInfo->resist;
}
else
@@ -1224,6 +1259,37 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
damageInfo->damage = damage;
}
+int32 Unit::GetIgnoredArmorMultiplier(SpellEntry const *spellInfo, WeaponAttackType attackType)
+{
+ if (GetTypeId() != TYPEID_PLAYER)
+ return 0;
+ //check if spell uses weapon
+ if (!spellInfo || spellInfo->EquippedItemClass!=ITEM_CLASS_WEAPON)
+ return 0;
+ Item *item = NULL;
+ if(attackType == BASE_ATTACK)
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
+ else if (attackType == OFF_ATTACK)
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ else if (attackType == RANGED_ATTACK)
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
+ if (!item)
+ return 0;
+
+ AuraEffectList const& armAuras = GetAurasByType(SPELL_AURA_MOD_WEAPONTYPE_IGNORE_TARGET_RESISTANCE);
+ int32 armorIgnored = 0;
+ for(AuraEffectList::const_iterator i = armAuras.begin();i != armAuras.end(); ++i)
+ {
+ if (!((*i)->GetSpellProto()->EquippedItemClass==item->GetProto()->Class
+ && (*i)->GetSpellProto()->EquippedItemSubClassMask & (1<<item->GetProto()->SubClass)))
+ continue;
+
+ if((*i)->GetAmount())
+ armorIgnored += (*i)->GetAmount();
+ }
+ return (-armorIgnored);
+}
+
void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
{
if (damageInfo==0)
@@ -1234,7 +1300,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
if(!this || !pVictim)
return;
- if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
+ if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return;
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
@@ -1253,20 +1319,6 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
return;
}
- // update at damage Judgement aura duration that applied by attacker at victim
- if(damageInfo->damage && spellProto->Id == 35395)
- {
- AuraMap& vAuras = pVictim->GetAuras();
- for(AuraMap::iterator itr = vAuras.begin(); itr != vAuras.end(); ++itr)
- {
- SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
- if( spellInfo->AttributesEx3 & 0x40000 && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && ((*itr).second->GetCasterGUID() == GetGUID()))
- {
- (*itr).second->SetAuraDuration((*itr).second->GetAuraMaxDuration());
- (*itr).second->UpdateAuraDuration();
- }
- }
- }
// Call default DealDamage
CleanDamage cleanDamage(damageInfo->cleanDamage, BASE_ATTACK, MELEE_HIT_NORMAL);
DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, SpellSchoolMask(damageInfo->schoolMask), spellProto, durabilityLoss);
@@ -1320,7 +1372,7 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
}
// Physical Immune check
- if(damageInfo->target->IsImmunedToDamage(SpellSchoolMask(damageInfo->damageSchoolMask),true))
+ if(damageInfo->target->IsImmunedToDamage(SpellSchoolMask(damageInfo->damageSchoolMask)))
{
damageInfo->HitInfo |= HITINFO_NORMALSWING;
damageInfo->TargetState = VICTIMSTATE_IS_IMMUNE;
@@ -1334,7 +1386,7 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
// Add melee damage bonus
MeleeDamageBonus(damageInfo->target, &damage, damageInfo->attackType);
// Calculate armor reduction
- damageInfo->damage = CalcArmorReducedDamage(damageInfo->target, damage);
+ damageInfo->damage = CalcArmorReducedDamage(damageInfo->target, damage, NULL , damageInfo->attackType);
damageInfo->cleanDamage += damage - damageInfo->damage;
damageInfo->hitOutCome = RollMeleeOutcomeAgainst(damageInfo->target, damageInfo->attackType);
@@ -1422,8 +1474,12 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
case MELEE_HIT_BLOCK:
{
damageInfo->TargetState = VICTIMSTATE_NORMAL;
+ damageInfo->HitInfo |= HITINFO_BLOCK;
damageInfo->procEx|=PROC_EX_BLOCK;
damageInfo->blocked_amount = damageInfo->target->GetShieldBlockValue();
+ //double blocked amount if block is critical
+ if (isBlockCritical())
+ damageInfo->blocked_amount+=damageInfo->blocked_amount;
if (damageInfo->blocked_amount >= damageInfo->damage)
{
damageInfo->TargetState = VICTIMSTATE_BLOCKS;
@@ -1487,7 +1543,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
if(!this || !pVictim)
return;
- if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
+ if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return;
//You don't lose health from damage taken from another player while in a sanctuary
@@ -1570,41 +1626,26 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
CastSpell(pVictim, 1604, true);
}
- // update at damage Judgement aura duration that applied by attacker at victim
- if(damageInfo->damage)
- {
- AuraMap& vAuras = pVictim->GetAuras();
- for(AuraMap::iterator itr = vAuras.begin(); itr != vAuras.end(); ++itr)
- {
- SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
- if( spellInfo->AttributesEx3 & 0x40000 && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && ((*itr).second->GetCasterGUID() == GetGUID()))
- {
- (*itr).second->SetAuraDuration((*itr).second->GetAuraMaxDuration());
- (*itr).second->UpdateAuraDuration();
- }
- }
- }
-
// If not miss
if (!(damageInfo->HitInfo & HITINFO_MISS))
{
if(GetTypeId() == TYPEID_PLAYER && pVictim->isAlive())
{
for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++)
- ((Player*)this)->CastItemCombatSpell(((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0,i), pVictim, damageInfo->attackType);
+ ((Player*)this)->CastItemCombatSpell(((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0,i), pVictim, damageInfo->attackType);
}
// victim's damage shield
- std::set<Aura*> alreadyDone;
- uint32 removedAuras = pVictim->m_removedAuras;
- AuraList const& vDamageShields = pVictim->GetAurasByType(SPELL_AURA_DAMAGE_SHIELD);
- for(AuraList::const_iterator i = vDamageShields.begin(), next = vDamageShields.begin(); i != vDamageShields.end(); i = next)
+ std::set<AuraEffect*> alreadyDone;
+ uint32 removedAuras = pVictim->m_removedAurasCount;
+ AuraEffectList const& vDamageShields = pVictim->GetAurasByType(SPELL_AURA_DAMAGE_SHIELD);
+ for(AuraEffectList::const_iterator i = vDamageShields.begin(), next = vDamageShields.begin(); i != vDamageShields.end(); i = next)
{
next++;
if (alreadyDone.find(*i) == alreadyDone.end())
{
alreadyDone.insert(*i);
- uint32 damage=(*i)->GetModifier()->m_amount;
+ uint32 damage=(*i)->GetAmount();
SpellEntry const *spellProto = sSpellStore.LookupEntry((*i)->GetId());
if(!spellProto)
continue;
@@ -1614,18 +1655,20 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
//CalcAbsorbResist(pVictim, SpellSchools(spellProto->School), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
//damage-=absorb + resist;
- WorldPacket data(SMSG_SPELLDAMAGESHIELD,(8+8+4+4));
+ WorldPacket data(SMSG_SPELLDAMAGESHIELD,(8+8+4+4+4+4));
data << uint64(pVictim->GetGUID());
data << uint64(GetGUID());
+ data << uint32(spellProto->Id);
+ data << uint32(damage); // Damage
+ data << uint32(0); // Overkill
data << uint32(spellProto->SchoolMask);
- data << uint32(damage);
pVictim->SendMessageToSet(&data, true );
pVictim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, GetSpellSchoolMask(spellProto), spellProto, true);
- if (pVictim->m_removedAuras > removedAuras)
+ if (pVictim->m_removedAurasCount > removedAuras)
{
- removedAuras = pVictim->m_removedAuras;
+ removedAuras = pVictim->m_removedAurasCount;
next = vDamageShields.begin();
}
}
@@ -1637,28 +1680,50 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
void Unit::HandleEmoteCommand(uint32 anim_id)
{
WorldPacket data( SMSG_EMOTE, 12 );
- data << anim_id << GetGUID();
- WPAssert(data.size() == 12);
-
+ data << uint32(anim_id);
+ data << uint64(GetGUID());
SendMessageToSet(&data, true);
}
-uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
+uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType)
{
uint32 newdamage = 0;
float armor = pVictim->GetArmor();
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura
armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL);
- if (armor<0.0f) armor=0.0f;
+ armor *= float((GetIgnoredArmorMultiplier(spellInfo, attackType)+100.0f)/100.0f);
+ if(spellInfo)
+ if(Player *modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_IGNORE_ARMOR, armor);
+
+ AuraEffectList const& ResIgnoreAurasAb = GetAurasByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
+ for(AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin();j != ResIgnoreAurasAb.end(); ++j)
+ {
+ if( (*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL
+ && (*j)->isAffectedOnSpell(spellInfo))
+ armor= int32(float(armor) * (float(100-(*j)->GetAmount())/100.0f));
+ }
+
+ AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
+ for(AuraEffectList::const_iterator j = ResIgnoreAuras.begin();j != ResIgnoreAuras.end(); ++j)
+ {
+ if( (*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
+ armor= int32(float(armor) * (float(100-(*j)->GetAmount())/100.0f));
+ }
+
+ // Apply Player CR_ARMOR_PENETRATION rating
+ if (GetTypeId()==TYPEID_PLAYER)
+ armor *= 1.0f - ((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;
+
+ if (armor < 0.0f) armor=0.0f;
- float tmpvalue = 0.0f;
- if(getLevel() <= 59) //Level 1-59
- tmpvalue = armor / (armor + 400.0f + 85.0f * getLevel());
- else if(getLevel() < 70) //Level 60-69
- tmpvalue = armor / (armor - 22167.5f + 467.5f * getLevel());
- else //Level 70+
- tmpvalue = armor / (armor + 10557.5f);
+ float levelModifier = getLevel();
+ if ( levelModifier > 59 )
+ levelModifier = levelModifier + (4.5f * (levelModifier-59));
+
+ float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
+ tmpvalue = tmpvalue/(1.0f + tmpvalue);
if(tmpvalue < 0.0f)
tmpvalue = 0.0f;
@@ -1669,7 +1734,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
return (newdamage > 1) ? newdamage : 1;
}
-void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist)
+void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellEntry const *spellInfo)
{
if(!pVictim || !pVictim->isAlive() || !damage)
return;
@@ -1705,124 +1770,336 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
*resist += uint32(damage * m / 4);
if(*resist > damage)
*resist = damage;
+
+ AuraEffectList const& ResIgnoreAurasAb = GetAurasByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
+ for(AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin();j != ResIgnoreAurasAb.end(); ++j)
+ {
+ if( (*j)->GetMiscValue() & schoolMask
+ && (*j)->isAffectedOnSpell(spellInfo))
+ *resist= int32(float(*resist) * (float(100-(*j)->GetAmount())/100.0f));
+ }
+
+ AuraEffectList const& ResIgnoreAuras = GetAurasByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST);
+ for(AuraEffectList::const_iterator j = ResIgnoreAuras.begin();j != ResIgnoreAuras.end(); ++j)
+ {
+ if( (*j)->GetMiscValue() & schoolMask)
+ *resist= int32(float(*resist) * (float(100-(*j)->GetAmount())/100.0f));
+ }
}
else
*resist = 0;
int32 RemainingDamage = damage - *resist;
-
+ int32 TotalAbsorb = RemainingDamage;
+ // Get unit state (need for some absorb check)
+ uint32 unitflag = pVictim->GetUInt32Value(UNIT_FIELD_FLAGS);
+ // Reflect damage spells (not cast any damage spell in aura lookup)
+ uint32 reflectSpell = 0;
+ int32 reflectDamage = 0;
+ uint32 healSpell = 0;
+ int32 healAmount = 0;
+ Unit * healCaster = NULL;
+ // Need remove expired auras after
+ bool existExpired = false;
// absorb without mana cost
- int32 reflectDamage = 0;
- Aura* reflectAura = NULL;
- AuraList const& vSchoolAbsorb = pVictim->GetAurasByType(SPELL_AURA_SCHOOL_ABSORB);
- for(AuraList::const_iterator i = vSchoolAbsorb.begin(), next; i != vSchoolAbsorb.end() && RemainingDamage > 0; i = next)
+ AuraEffectList const& vSchoolAbsorb = pVictim->GetAurasByType(SPELL_AURA_SCHOOL_ABSORB);
+ for(AuraEffectList::const_iterator i = vSchoolAbsorb.begin(); i != vSchoolAbsorb.end() && RemainingDamage > 0; ++i)
{
- next = i; ++next;
-
- if (((*i)->GetModifier()->m_miscvalue & schoolMask)==0)
+ if (!((*i)->GetMiscValue() & schoolMask))
continue;
- // Cheat Death
- if((*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && (*i)->GetSpellProto()->SpellIconID == 2109)
+ SpellEntry const* spellProto = (*i)->GetSpellProto();
+
+ // Max Amount can be absorbed by this aura
+ int32 currentAbsorb = (*i)->GetAmount();
+
+ // Found empty aura (impossible but..)
+ if (currentAbsorb <=0)
{
- if (((Player*)pVictim)->HasSpellCooldown(31231))
- continue;
- if (pVictim->GetHealth() <= RemainingDamage)
+ existExpired = true;
+ continue;
+ }
+ // Handle custom absorb auras
+ // TODO: try find better way
+ switch(spellProto->SpellFamilyName)
+ {
+ case SPELLFAMILY_GENERIC:
{
- int32 chance = (*i)->GetModifier()->m_amount;
- if (roll_chance_i(chance))
+ // Astral Shift
+ if (spellProto->SpellIconID == 3066)
{
- pVictim->CastSpell(pVictim,31231,true);
- ((Player*)pVictim)->AddSpellCooldown(31231,0,time(NULL)+60);
-
- // with health > 10% lost health until health==10%, in other case no losses
- uint32 health10 = pVictim->GetMaxHealth()/10;
- RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0;
+ //reduces all damage taken while stun, fear or silence
+ if (unitflag & (UNIT_FLAG_STUNNED|UNIT_FLAG_FLEEING|UNIT_FLAG_SILENCED))
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ // Nerves of Steel
+ if (spellProto->SpellIconID == 2115)
+ {
+ // while affected by Stun and Fear
+ if (unitflag&(UNIT_FLAG_STUNNED|UNIT_FLAG_FLEEING))
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ // Spell Deflection
+ if (spellProto->SpellIconID == 3006)
+ {
+ // You have a chance equal to your Parry chance
+ if (damagetype == DIRECT_DAMAGE && // Only for direct damage
+ roll_chance_f(pVictim->GetUnitParryChance())) // Roll chance
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ // Reflective Shield (Lady Malande boss)
+ if (spellProto->Id == 41475)
+ {
+ if(RemainingDamage < currentAbsorb)
+ reflectDamage = RemainingDamage / 2;
+ else
+ reflectDamage = currentAbsorb / 2;
+ reflectSpell = 33619;
+ break;
+ }
+ if (spellProto->Id == 39228 || // Argussian Compass
+ spellProto->Id == 60218) // Essence of Gossamer
+ {
+ // Max absorb stored in 1 dummy effect
+ if (spellProto->EffectBasePoints[1] < currentAbsorb)
+ currentAbsorb = spellProto->EffectBasePoints[1];
+ break;
}
+ break;
}
- continue;
- }
-
- int32 currentAbsorb;
-
- //Reflective Shield
- if ((pVictim != this) && (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST && (*i)->GetSpellProto()->SpellFamilyFlags == 0x1)
- {
- if(Unit* caster = (*i)->GetCaster())
+ case SPELLFAMILY_DRUID:
{
- AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(AuraList::const_iterator k = vOverRideCS.begin(); k != vOverRideCS.end(); ++k)
+ // Primal Tenacity
+ if (spellProto->SpellIconID == 2253)
{
- switch((*k)->GetModifier()->m_miscvalue)
+ //reduces all damage taken while Stunned
+ if (unitflag & UNIT_FLAG_STUNNED)
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ break;
+ }
+ case SPELLFAMILY_ROGUE:
+ {
+ // Cheat Death
+ if(spellProto->SpellIconID == 2109)
+ {
+ if (pVictim->GetTypeId()==TYPEID_PLAYER && // Only players
+ pVictim->GetHealth() <= RemainingDamage && // Only if damage kill
+ !((Player*)pVictim)->HasSpellCooldown(31231) && // Only if no cooldown
+ roll_chance_i(currentAbsorb)) // Only if roll
{
- case 5065: // Rank 1
- case 5064: // Rank 2
- case 5063: // Rank 3
- case 5062: // Rank 4
- case 5061: // Rank 5
- {
- if(RemainingDamage >= (*i)->GetModifier()->m_amount)
- reflectDamage = (*i)->GetModifier()->m_amount * (*k)->GetModifier()->m_amount/100;
- else
- reflectDamage = (*k)->GetModifier()->m_amount * RemainingDamage/100;
- reflectAura = *i;
-
- } break;
- default: break;
+ pVictim->CastSpell(pVictim,31231,true);
+ ((Player*)pVictim)->AddSpellCooldown(31231,0,time(NULL)+60);
+ // with health > 10% lost health until health==10%, in other case no losses
+ uint32 health10 = pVictim->GetMaxHealth()/10;
+ RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0;
+ }
+ continue;
+ }
+ break;
+ }
+ case SPELLFAMILY_PRIEST:
+ {
+ // Guardian Spirit
+ if (spellProto->Id==47788)
+ {
+ if (pVictim->GetHealth() <= RemainingDamage) // Killing Blow
+ {
+ healAmount = pVictim->GetMaxHealth()/2;
+ healCaster = pVictim;
+ healSpell = 48153;
+ (*i)->SetAmount(0);
+ RemainingDamage=0;
}
+ continue;
+ }
- if(reflectDamage)
+ // Reflective Shield
+ if (spellProto->SpellFamilyFlags.IsEqual(0x1, 0, 0x400))
+ {
+ if (pVictim == this)
+ break;
+ Unit* caster = (*i)->GetCaster();
+ if (!caster)
+ break;
+ AuraEffectList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator k = vOverRideCS.begin(); k != vOverRideCS.end(); ++k)
+ {
+ if((*k)->GetSpellProto()->SpellFamilyName != SPELLFAMILY_PRIEST)
+ continue;
+ switch((*k)->GetMiscValue())
+ {
+ case 5065: // Rank 1
+ case 5064: // Rank 2
+ case 5063: // Rank 3
+ {
+ if(RemainingDamage >= currentAbsorb)
+ reflectDamage = (*k)->GetAmount() * currentAbsorb/100;
+ else
+ reflectDamage = (*k)->GetAmount() * RemainingDamage/100;
+ reflectSpell = 33619;
+ } break;
+ }
+ }
+ }
+ // no break here, rapture can proc with reflective shield
+ // Rapture
+ if (spellProto->SpellFamilyFlags.HasFlag(0x1, 0x1000000))
+ {
+ if (pVictim == this)
+ break;
+ healCaster = (*i)->GetCaster();
+ if (!healCaster)
break;
+
+ AuraEffectList const& lOverRideCS = pVictim->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator k = lOverRideCS.begin(); k != lOverRideCS.end(); ++k)
+ {
+ switch((*k)->GetMiscValue())
+ {
+ case 7556: // Rank 1
+ case 7555: // Rank 2
+ case 7554: // Rank 3
+ case 7553: // Rank 4
+ case 7552: // Rank 5
+ {
+ healSpell = 47755;
+ healAmount += ((pVictim->getLevel() * (-0.2) + 18) / 1000000) * currentAbsorb * pVictim->GetMaxPower(POWER_MANA);
+ // limitation based on aura amount
+ if(healAmount > pVictim->GetMaxPower(POWER_MANA) * (*k)->GetAmount() / 1000)
+ healAmount = pVictim->GetMaxPower(POWER_MANA) * (*k)->GetAmount() / 1000;
+ } break;
+ }
+ }
}
+ break;
}
+ case SPELLFAMILY_SHAMAN:
+ {
+ // Astral Shift
+ if (spellProto->SpellIconID == 3066)
+ {
+ //reduces all damage taken while stun, fear or silence
+ if (unitflag & (UNIT_FLAG_STUNNED|UNIT_FLAG_FLEEING|UNIT_FLAG_SILENCED))
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ break;
+ }
+ case SPELLFAMILY_DEATHKNIGHT:
+ {
+ // Shadow of Death
+ if (spellProto->SpellIconID == 1958)
+ {
+ // TODO: absorb only while transform
+ continue;
+ }
+ // Anti-Magic Shell (on self)
+ if (spellProto->Id == 48707)
+ {
+ // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
+ // This, if I'm not mistaken, shows that we get back ~2% of the absorbed damage as runic power.
+ int32 absorbed = RemainingDamage * currentAbsorb / 100;
+ int32 regen = absorbed * 2 / 10;
+ pVictim->CastCustomSpell(pVictim, 49088, &regen, 0, 0, true, 0, (*i));
+ RemainingDamage -= absorbed;
+ continue;
+ }
+ // Anti-Magic Shell (on single party/raid member)
+ if (spellProto->Id == 50462)
+ {
+ RemainingDamage -= RemainingDamage * currentAbsorb / 100;
+ continue;
+ }
+ // Anti-Magic Zone
+ if (spellProto->Id == 50461)
+ {
+ Unit* caster = (*i)->GetCaster();
+ if (!caster)
+ continue;
+ int32 absorbed = RemainingDamage * currentAbsorb / 100;
+ int32 canabsorb = caster->GetHealth();
+ if (canabsorb < absorbed)
+ absorbed = canabsorb;
+ DealDamage(caster, absorbed, NULL, damagetype, schoolMask, 0, false);
+ RemainingDamage -= absorbed;
+ continue;
+ }
+ break;
+ }
+ default:
+ break;
}
- if (RemainingDamage >= (*i)->GetModifier()->m_amount)
- {
- currentAbsorb = (*i)->GetModifier()->m_amount;
- pVictim->RemoveAurasDueToSpell((*i)->GetId());
- next = vSchoolAbsorb.begin();
- }
- else
- {
+ // currentAbsorb - damage can be absorbed by shield
+ // If need absorb less damage
+ if (RemainingDamage < currentAbsorb)
currentAbsorb = RemainingDamage;
- (*i)->GetModifier()->m_amount -= RemainingDamage;
- }
RemainingDamage -= currentAbsorb;
+
+ // Reduce shield amount
+ (*i)->SetAmount((*i)->GetAmount() -currentAbsorb);
+ // Need remove it later
+ if ((*i)->GetAmount()<=0)
+ existExpired = true;
}
- // do not cast spells while looping auras; auras can get invalid otherwise
- if (reflectDamage)
- pVictim->CastCustomSpell(this, 33619, &reflectDamage, NULL, NULL, true, NULL, reflectAura);
+ if(healSpell && healCaster)
+ healCaster->CastCustomSpell(healCaster, healSpell, &healAmount, NULL, NULL, true);
+
+ // Remove all expired absorb auras
+ if (existExpired)
+ {
+ for(AuraEffectList::const_iterator i = vSchoolAbsorb.begin(); i != vSchoolAbsorb.end();)
+ {
+ Aura *aura=(*i)->GetParentAura();
+ AuraEffect *auraeff =(*i);
+ ++i;
+ if (auraeff->GetAmount()<=0)
+ {
+ uint32 removedAuras = pVictim->m_removedAurasCount;
+ pVictim->RemoveAura(aura, AURA_REMOVE_BY_ENEMY_SPELL);
+ if (removedAuras+1<pVictim->m_removedAurasCount)
+ i=vSchoolAbsorb.begin();
+ }
+ }
+ }
+ // Cast back reflect damage spell
+ if (reflectSpell)
+ pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true);
// absorb by mana cost
- AuraList const& vManaShield = pVictim->GetAurasByType(SPELL_AURA_MANA_SHIELD);
- for(AuraList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && RemainingDamage > 0; i = next)
+ AuraEffectList const& vManaShield = pVictim->GetAurasByType(SPELL_AURA_MANA_SHIELD);
+ for(AuraEffectList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && RemainingDamage > 0; i = next)
{
next = i; ++next;
// check damage school mask
- if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0)
+ if(((*i)->GetMiscValue() & schoolMask)==0)
continue;
int32 currentAbsorb;
- if (RemainingDamage >= (*i)->GetModifier()->m_amount)
- currentAbsorb = (*i)->GetModifier()->m_amount;
+ if (RemainingDamage >= (*i)->GetAmount())
+ currentAbsorb = (*i)->GetAmount();
else
currentAbsorb = RemainingDamage;
float manaMultiplier = (*i)->GetSpellProto()->EffectMultipleValue[(*i)->GetEffIndex()];
- if(Player *modOwner = GetSpellModOwner())
+ if(Player *modOwner = pVictim->GetSpellModOwner())
modOwner->ApplySpellMod((*i)->GetId(), SPELLMOD_MULTIPLE_VALUE, manaMultiplier);
int32 maxAbsorb = int32(pVictim->GetPower(POWER_MANA) / manaMultiplier);
if (currentAbsorb > maxAbsorb)
currentAbsorb = maxAbsorb;
- (*i)->GetModifier()->m_amount -= currentAbsorb;
- if((*i)->GetModifier()->m_amount <= 0)
+ (*i)->SetAmount((*i)->GetAmount()-currentAbsorb);
+ if((*i)->GetAmount() <= 0)
{
- pVictim->RemoveAurasDueToSpell((*i)->GetId());
+ pVictim->RemoveAura((*i)->GetParentAura(), AURA_REMOVE_BY_ENEMY_SPELL);
next = vManaShield.begin();
}
@@ -1835,13 +2112,13 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
// only split damage if not damaging yourself
if(pVictim != this)
{
- AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
- for(AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next)
+ AuraEffectList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
+ for(AuraEffectList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next)
{
next = i; ++next;
// check damage school mask
- if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0)
+ if(((*i)->GetMiscValue() & schoolMask)==0)
continue;
// Damage can be splitted only if aura has an alive caster
@@ -1850,8 +2127,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
continue;
int32 currentAbsorb;
- if (RemainingDamage >= (*i)->GetModifier()->m_amount)
- currentAbsorb = (*i)->GetModifier()->m_amount;
+ if (RemainingDamage >= (*i)->GetAmount())
+ currentAbsorb = (*i)->GetAmount();
else
currentAbsorb = RemainingDamage;
@@ -1863,13 +2140,13 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
DealDamage(caster, currentAbsorb, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false);
}
- AuraList const& vSplitDamagePct = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_PCT);
- for(AuraList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && RemainingDamage >= 0; i = next)
+ AuraEffectList const& vSplitDamagePct = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_PCT);
+ for(AuraEffectList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && RemainingDamage >= 0; i = next)
{
next = i; ++next;
// check damage school mask
- if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0)
+ if(((*i)->GetMiscValue() & schoolMask)==0)
continue;
// Damage can be splitted only if aura has an alive caster
@@ -1877,7 +2154,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
if(!caster || caster == pVictim || !caster->IsInWorld() || !caster->isAlive())
continue;
- int32 splitted = int32(RemainingDamage * (*i)->GetModifier()->m_amount / 100.0f);
+ int32 splitted = int32(RemainingDamage * (*i)->GetAmount() / 100.0f);
RemainingDamage -= splitted;
@@ -1888,409 +2165,53 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
}
}
- *absorb = damage - RemainingDamage - *resist;
-}
-
-/*
-void Unit::DoAttackDamage (Unit *pVictim, uint32 *damage, CleanDamage *cleanDamage, uint32 *blocked_amount, SpellSchoolMask damageSchoolMask, uint32 *hitInfo, VictimState *victimState, uint32 *absorbDamage, uint32 *resistDamage, WeaponAttackType attType, SpellEntry const *spellCasted, bool isTriggeredSpell)
-{
- MeleeHitOutcome outcome;
-
- // If is casted Melee spell, calculate like physical
- if(!spellCasted)
- outcome = RollMeleeOutcomeAgainst (pVictim, attType);
- else
- outcome = RollPhysicalOutcomeAgainst (pVictim, attType, spellCasted);
-
- if(outcome == MELEE_HIT_MISS ||outcome == MELEE_HIT_DODGE ||outcome == MELEE_HIT_BLOCK ||outcome == MELEE_HIT_PARRY)
- pVictim->AddThreat(this, 0.0f);
- switch(outcome)
- {
- case MELEE_HIT_EVADE:
- {
- *hitInfo |= HITINFO_MISS;
- *damage = 0;
- cleanDamage->damage = 0;
- return;
- }
- case MELEE_HIT_MISS:
- {
- *hitInfo |= HITINFO_MISS;
- *damage = 0;
- cleanDamage->damage = 0;
- if(GetTypeId()== TYPEID_PLAYER)
- ((Player*)this)->UpdateWeaponSkill(attType);
- return;
- }
- }
-
- /// If this is a creature and it attacks from behind it has a probability to daze it's victim
- if( (outcome==MELEE_HIT_CRIT || outcome==MELEE_HIT_CRUSHING || outcome==MELEE_HIT_NORMAL || outcome==MELEE_HIT_GLANCING) &&
- GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this)
- && pVictim->GetTypeId() == TYPEID_PLAYER)
- {
- // -probability is between 0% and 40%
- // 20% base chance
- float Probability = 20;
-
- //there is a newbie protection, at level 10 just 7% base chance; assuming linear function
- if( pVictim->getLevel() < 30 )
- Probability = 0.65f*pVictim->getLevel()+0.5;
-
- uint32 VictimDefense=pVictim->GetDefenseSkillValue(this);
- uint32 AttackerMeleeSkill=GetUnitMeleeSkill(pVictim);
-
- Probability *= AttackerMeleeSkill/(float)VictimDefense;
-
- if(Probability > 40.0f)
- Probability = 40.0f;
-
- if(roll_chance_f(Probability))
- CastSpell(pVictim, 1604, true);
- }
-
- //Calculate the damage after armor mitigation if SPELL_SCHOOL_NORMAL
- if (damageSchoolMask & SPELL_SCHOOL_MASK_NORMAL)
+ TotalAbsorb = (TotalAbsorb - RemainingDamage > 0) ? TotalAbsorb - RemainingDamage : 0;
+ // TODO: School should be checked for absorbing auras or for attacks?
+ int32 auraAbsorbMod = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL);
+ AuraEffectList const& AbsIgnoreAurasAb = GetAurasByType(SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL);
+ for(AuraEffectList::const_iterator i = AbsIgnoreAurasAb.begin();i != AbsIgnoreAurasAb.end(); ++i)
{
- uint32 damageAfterArmor = CalcArmorReducedDamage(pVictim, *damage);
-
- // random durability for main hand weapon (ABSORB)
- if(damageAfterArmor < *damage)
- if(pVictim->GetTypeId() == TYPEID_PLAYER)
- if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_ABSORB)))
- ((Player*)pVictim)->DurabilityPointLossForEquipSlot(EquipmentSlots(urand(EQUIPMENT_SLOT_START,EQUIPMENT_SLOT_BACK)));
-
- cleanDamage->damage += *damage - damageAfterArmor;
- *damage = damageAfterArmor;
+ if ((*i)->GetAmount() > auraAbsorbMod
+ && (*i)->isAffectedOnSpell(spellInfo))
+ auraAbsorbMod = (*i)->GetAmount();
}
- if(GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() != TYPEID_PLAYER && pVictim->GetCreatureType() != CREATURE_TYPE_CRITTER )
- ((Player*)this)->UpdateCombatSkills(pVictim, attType, outcome, false);
+ // Ignore absorb - add reduced amount again to damage
+ RemainingDamage += auraAbsorbMod * TotalAbsorb / 100;
- if(GetTypeId() != TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
- ((Player*)pVictim)->UpdateCombatSkills(this, attType, outcome, true);
+ *absorb = damage - RemainingDamage - *resist;
- switch (outcome)
+ if (*absorb)
{
- case MELEE_HIT_BLOCK_CRIT:
- case MELEE_HIT_CRIT:
+ bool found = false;
+ int32 spell_dmg=0;
+ // Incanter's Absorption
+ AuraEffectList const& DummmyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator i = DummmyAuras.begin(); i != DummmyAuras.end(); ++i)
{
- //*hitInfo = 0xEA;
- // 0xEA
- *hitInfo = HITINFO_CRITICALHIT | HITINFO_NORMALSWING2 | 0x8;
-
- // Crit bonus calc
- uint32 crit_bonus;
- crit_bonus = *damage;
-
- // Apply crit_damage bonus for melee spells
- if (spellCasted)
+ SpellEntry const* spellInfo = (*i)->GetSpellProto();
+ if (spellmgr.GetFirstSpellInChain(spellInfo->Id) == 44394)
{
- if(Player* modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellCasted->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus);
-
- uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
- AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS);
- for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- crit_bonus = uint32(crit_bonus * ((*i)->GetModifierValue()+100.0f)/100.0f);
- }
-
- *damage += crit_bonus;
-
- uint32 resilienceReduction = 0;
-
- if(attType == RANGED_ATTACK)
- {
- int32 mod = pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE);
- *damage = int32((*damage) * float((100.0f + mod)/100.0f));
- // Resilience - reduce crit damage
- if (pVictim->GetTypeId()==TYPEID_PLAYER)
- resilienceReduction = ((Player*)pVictim)->GetRangedCritDamageReduction(*damage);
- }
- else
- {
- int32 mod = pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE);
- mod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE);
- *damage = int32((*damage) * float((100.0f + mod)/100.0f));
- // Resilience - reduce crit damage
- if (pVictim->GetTypeId()==TYPEID_PLAYER)
- resilienceReduction = ((Player*)pVictim)->GetMeleeCritDamageReduction(*damage);
- }
-
- *damage -= resilienceReduction;
- cleanDamage->damage += resilienceReduction;
-
- if(GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() != TYPEID_PLAYER && pVictim->GetCreatureType() != CREATURE_TYPE_CRITTER )
- ((Player*)this)->UpdateWeaponSkill(attType);
-
- ModifyAuraState(AURA_STATE_CRIT, true);
- StartReactiveTimer( REACTIVE_CRIT );
-
- if(getClass()==CLASS_HUNTER)
- {
- ModifyAuraState(AURA_STATE_HUNTER_CRIT_STRIKE, true);
- StartReactiveTimer( REACTIVE_HUNTER_CRIT );
- }
-
- if ( outcome == MELEE_HIT_BLOCK_CRIT )
- {
- *blocked_amount = pVictim->GetShieldBlockValue();
-
- if (pVictim->GetUnitBlockChance())
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYSHIELD);
- else
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYUNARMED);
-
- //Only set VICTIMSTATE_BLOCK on a full block
- if (*blocked_amount >= uint32(*damage))
- {
- *victimState = VICTIMSTATE_BLOCKS;
- *blocked_amount = uint32(*damage);
- }
-
- if(pVictim->GetTypeId() == TYPEID_PLAYER)
+ int32 total_dmg=0;
+ // Get total bonus from auras
+ AuraEffectList const& BonusAuras = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
+ for(AuraEffectList::const_iterator itr = BonusAuras.begin(); itr != BonusAuras.end(); ++itr)
{
- // Update defense
- ((Player*)pVictim)->UpdateDefense();
-
- // random durability for main hand weapon (BLOCK)
- if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_BLOCK)))
- ((Player*)pVictim)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_OFFHAND);
+ if ((*itr)->GetId()==44413)
+ total_dmg += (*itr)->GetMiscValue();
}
-
- pVictim->ModifyAuraState(AURA_STATE_DEFENSE,true);
- pVictim->StartReactiveTimer( REACTIVE_DEFENSE );
- break;
- }
-
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_WOUNDCRITICAL);
- break;
- }
- case MELEE_HIT_PARRY:
- {
- if(attType == RANGED_ATTACK) //range attack - no parry
- {
- outcome = MELEE_HIT_NORMAL;
- break;
- }
-
- cleanDamage->damage += *damage;
- *damage = 0;
- *victimState = VICTIMSTATE_PARRY;
-
- // instant (maybe with small delay) counter attack
- {
- float offtime = float(pVictim->getAttackTimer(OFF_ATTACK));
- float basetime = float(pVictim->getAttackTimer(BASE_ATTACK));
-
- // after parry nearest next attack time will reduced at %40 from full attack time.
- // The delay cannot be reduced to less than 20% of your weapon base swing delay.
- if (pVictim->haveOffhandWeapon() && offtime < basetime)
- {
- float percent20 = pVictim->GetAttackTime(OFF_ATTACK)*0.20;
- float percent60 = 3*percent20;
- // set to 20% if in range 20%...20+40% of full time
- if(offtime > percent20 && offtime <= percent60)
- {
- pVictim->setAttackTimer(OFF_ATTACK,uint32(percent20));
- }
- // decrease at %40 from full time
- else if(offtime > percent60)
- {
- offtime -= 2*percent20;
- pVictim->setAttackTimer(OFF_ATTACK,uint32(offtime));
- }
- // ELSE not changed
- }
- else
- {
- float percent20 = pVictim->GetAttackTime(BASE_ATTACK)*0.20;
- float percent60 = 3*percent20;
- // set to 20% if in range 20%...20+40% of full time
- if(basetime > percent20 && basetime <= percent60)
- {
- pVictim->setAttackTimer(BASE_ATTACK,uint32(percent20));
- }
- // decrease at %40 from full time
- else if(basetime > percent60)
- {
- basetime -= 2*percent20;
- pVictim->setAttackTimer(BASE_ATTACK,uint32(basetime));
- }
- // ELSE not changed
- }
- }
-
- if(pVictim->GetTypeId() == TYPEID_PLAYER)
- {
- // Update victim defense ?
- ((Player*)pVictim)->UpdateDefense();
-
- // random durability for main hand weapon (PARRY)
- if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_PARRY)))
- ((Player*)pVictim)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_MAINHAND);
- }
-
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYUNARMED);
-
- if (pVictim->getClass() == CLASS_HUNTER)
- {
- pVictim->ModifyAuraState(AURA_STATE_HUNTER_PARRY,true);
- pVictim->StartReactiveTimer( REACTIVE_HUNTER_PARRY );
- }
- else
- {
- pVictim->ModifyAuraState(AURA_STATE_DEFENSE, true);
- pVictim->StartReactiveTimer( REACTIVE_DEFENSE );
- }
-
- CastMeleeProcDamageAndSpell(pVictim, 0, damageSchoolMask, attType, outcome, spellCasted, isTriggeredSpell);
- return;
- }
- case MELEE_HIT_DODGE:
- {
- if(attType == RANGED_ATTACK) //range attack - no dodge
- {
- outcome = MELEE_HIT_NORMAL;
+ spell_dmg = int32(*absorb * (*i)->GetAmount() / 100);
+ // Do not apply more auras if more than 5% hp
+ if(total_dmg+spell_dmg > int32(GetMaxHealth() * 5 / 100))
+ break;
+ found=true;
break;
- }
-
- cleanDamage->damage += *damage;
- *damage = 0;
- *victimState = VICTIMSTATE_DODGE;
-
- if(pVictim->GetTypeId() == TYPEID_PLAYER)
- ((Player*)pVictim)->UpdateDefense();
-
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYUNARMED);
-
- if (pVictim->getClass() != CLASS_ROGUE) // Riposte
- {
- pVictim->ModifyAuraState(AURA_STATE_DEFENSE, true);
- pVictim->StartReactiveTimer( REACTIVE_DEFENSE );
- }
-
- // Overpower
- if (GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR)
- {
- ((Player*)this)->AddComboPoints(pVictim, 1);
- StartReactiveTimer( REACTIVE_OVERPOWER );
- }
-
- CastMeleeProcDamageAndSpell(pVictim, 0, damageSchoolMask, attType, outcome, spellCasted, isTriggeredSpell);
- return;
- }
- case MELEE_HIT_BLOCK:
- {
- *blocked_amount = pVictim->GetShieldBlockValue();
-
- if (pVictim->GetUnitBlockChance())
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYSHIELD);
- else
- pVictim->HandleEmoteCommand(EMOTE_ONESHOT_PARRYUNARMED);
-
- //Only set VICTIMSTATE_BLOCK on a full block
- if (*blocked_amount >= uint32(*damage))
- {
- *victimState = VICTIMSTATE_BLOCKS;
- *blocked_amount = uint32(*damage);
- }
-
- if(pVictim->GetTypeId() == TYPEID_PLAYER)
- {
- // Update defense
- ((Player*)pVictim)->UpdateDefense();
-
- // random durability for main hand weapon (BLOCK)
- if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_BLOCK)))
- ((Player*)pVictim)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_OFFHAND);
- }
-
- pVictim->ModifyAuraState(AURA_STATE_DEFENSE,true);
- pVictim->StartReactiveTimer( REACTIVE_DEFENSE );
-
- break;
- }
- case MELEE_HIT_GLANCING:
- {
- int32 leveldif = int32(pVictim->getLevel()) - int32(getLevel());
- if (leveldif > 3) leveldif = 3;
- *damage *= (1 - leveldif * 0.1f);
- cleanDamage->damage = *damage;
- *hitInfo |= HITINFO_GLANCING;
- break;
- }
- case MELEE_HIT_CRUSHING:
- {
- // 150% normal damage
- *damage += (*damage / 2);
- cleanDamage->damage = *damage;
- *hitInfo |= HITINFO_CRUSHING;
- // TODO: victimState, victim animation?
- break;
- }
- default:
- break;
- }
-
- // apply melee damage bonus and absorb only if base damage not fully blocked to prevent negative damage or damage with full block
- if(*victimState != VICTIMSTATE_BLOCKS)
- {
- MeleeDamageBonus(pVictim, damage,attType,spellCasted);
- CalcAbsorbResist(pVictim, damageSchoolMask, DIRECT_DAMAGE, *damage-*blocked_amount, absorbDamage, resistDamage);
- }
-
- if (*absorbDamage) *hitInfo |= HITINFO_ABSORB;
- if (*resistDamage) *hitInfo |= HITINFO_RESIST;
-
- cleanDamage->damage += *blocked_amount;
-
- if (*damage <= *absorbDamage + *resistDamage + *blocked_amount)
- {
- //*hitInfo = 0x00010020;
- //*hitInfo |= HITINFO_SWINGNOHITSOUND;
- //*damageType = 0;
- CastMeleeProcDamageAndSpell(pVictim, 0, damageSchoolMask, attType, outcome, spellCasted, isTriggeredSpell);
- return;
- }
-
- // update at damage Judgement aura duration that applied by attacker at victim
- if(*damage)
- {
- AuraMap const& vAuras = pVictim->GetAuras();
- for(AuraMap::const_iterator itr = vAuras.begin(); itr != vAuras.end(); ++itr)
- {
- SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
- if( (spellInfo->AttributesEx3 & 0x40000) && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN &&
- ((*itr).second->GetCasterGUID() == GetGUID() && (!spellCasted || spellCasted->Id == 35395)) )
- {
- (*itr).second->SetAuraDuration((*itr).second->GetAuraMaxDuration());
- (*itr).second->UpdateAuraDuration();
- }
- }
- }
-
- CastMeleeProcDamageAndSpell(pVictim, (*damage - *absorbDamage pVictim->SpellNonMeleeDamageLog(this, (*i)->GetId(), (*i)->GetModifier()->m_amount, false, false);eld
- // yet another hack to fix crashes related to the aura getting removed during iteration
- std::set<Aura*> alreadyDone;
- uint32 removedAuras = pVictim->m_removedAuras;
- AuraList const& vDamageShields = pVictim->GetAurasByType(SPELL_AURA_DAMAGE_SHIELD);
- for(AuraList::const_iterator i = vDamageShields.begin(), next = vDamageShields.begin(); i != vDamageShields.end(); i = next)
- {
- ++next;
- if (alreadyDone.find(*i) == alreadyDone.end())
- {
- alreadyDone.insert(*i);
- pVictim->SpellNonMeleeDamageLog(this, (*i)->GetId(), (*i)->GetModifierValue(), false, false);
- if (pVictim->m_removedAuras > removedAuras)
- {
- removedAuras = pVictim->m_removedAuras;
- next = vDamageShields.begin();
- }
+ }
}
+ if (found)
+ pVictim->CastCustomSpell(pVictim, 44413, &spell_dmg, NULL, NULL, false);
}
-}*/
+}
void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool extra )
{
@@ -2329,6 +2250,10 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
}
}
+ // if damage pVictim call AI reaction
+ //if(pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI())
+ // ((Creature*)pVictim)->AI()->AttackedBy(this);
+
return;
}
@@ -2356,68 +2281,11 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
--m_extraAttacks;
}
}
-}
-
-/*
-MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAttackType attType, SpellEntry const *spellInfo)
-{
- // Miss chance based on melee
- float miss_chance = MeleeMissChanceCalc(pVictim, attType);
-
- // Critical hit chance
- float crit_chance = GetUnitCriticalChance(attType, pVictim);
- // this is to avoid compiler issue when declaring variables inside if
- float block_chance, parry_chance, dodge_chance;
-
- // cannot be dodged/parried/blocked
- if(spellInfo->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)
- {
- block_chance = 0.0f;
- parry_chance = 0.0f;
- dodge_chance = 0.0f;
- }
- else
- {
- // parry can be avoided only by some abilities
- parry_chance = pVictim->GetUnitParryChance();
- // block might be bypassed by it as well
- block_chance = pVictim->GetUnitBlockChance();
- // stunned target cannot dodge and this is check in GetUnitDodgeChance()
- dodge_chance = pVictim->GetUnitDodgeChance();
- }
-
- // Only players can have Talent&Spell bonuses
- if (GetTypeId() == TYPEID_PLAYER)
- {
- // Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura
- crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask);
-
- if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents for speed
- {
- AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
- for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i)
- {
- // can't be dodged rogue finishing move
- if((*i)->GetModifier()->m_miscvalue == VICTIMSTATE_DODGE)
- {
- if(spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE))
- {
- dodge_chance = 0.0f;
- break;
- }
- }
- }
- }
- }
- // Spellmods
- if(Player* modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CRITICAL_CHANCE, crit_chance);
-
- DEBUG_LOG("PHYSICAL OUTCOME: miss %f crit %f dodge %f parry %f block %f",miss_chance,crit_chance,dodge_chance,parry_chance, block_chance);
-
- return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100),int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100), true);
-}*/
+ // if damage pVictim call AI reaction
+ //if(pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI())
+ // ((Creature*)pVictim)->AI()->AttackedBy(this);
+}
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackType attType) const
{
@@ -2438,10 +2306,10 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT
// Useful if want to specify crit & miss chances for melee, else it could be removed
DEBUG_LOG("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance);
- return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100), false);
+ return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100));
}
-MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted ) const
+MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
{
if(pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
return MELEE_HIT_EVADE;
@@ -2454,7 +2322,6 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// bonus from skills is 0.04%
int32 skillBonus = 4 * ( attackerWeaponSkill - victimMaxSkillValueForLevel );
- int32 skillBonus2 = 4 * ( attackerMaxSkillValueForLevel - victimDefenseSkill );
int32 sum = 0, tmp = 0;
int32 roll = urand (0, 10000);
@@ -2492,6 +2359,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// Modify dodge chance by attacker SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
dodge_chance+= GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE);
+ dodge_chance = int32 (float (dodge_chance) * GetTotalAuraMultiplier(SPELL_AURA_MOD_ENEMY_DODGE));
tmp = dodge_chance;
if ( (tmp > 0) // check if unit _can_ dodge
@@ -2535,16 +2403,6 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
&& ((tmp -= skillBonus) > 0)
&& (roll < (sum += tmp)))
{
- // Critical chance
- tmp = crit_chance + skillBonus2;
- if ( GetTypeId() == TYPEID_PLAYER && SpellCasted && tmp > 0 )
- {
- if ( roll_chance_i(tmp/100))
- {
- DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCKED CRIT");
- return MELEE_HIT_BLOCK_CRIT;
- }
- }
DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
return MELEE_HIT_BLOCK;
}
@@ -2552,7 +2410,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
}
// Critical chance
- tmp = crit_chance + skillBonus2;
+ tmp = crit_chance;
if (tmp > 0 && roll < (sum += tmp))
{
@@ -2564,7 +2422,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
}
// Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon)
- if( attType != RANGED_ATTACK && !SpellCasted &&
+ if( attType != RANGED_ATTACK &&
(GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->isPet()) &&
pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->isPet() &&
getLevel() < pVictim->getLevelForTarget(this) )
@@ -2583,10 +2441,14 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
}
}
- if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet() && !SpellCasted /*Only autoattack can be crushing blow*/ )
+ // mobs can score crushing blows if they're 4 or more levels above victim
+ if (getLevelForTarget(pVictim) >= pVictim->getLevelForTarget(this) + 4 &&
+ // can be from by creature (if can) or from controlled player that considered as creature
+ (GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->isPet() &&
+ !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) ||
+ GetTypeId()==TYPEID_PLAYER && GetCharmerOrOwnerGUID()))
{
- // mobs can score crushing blows if they're 3 or more levels above victim
- // or when their weapon skill is 15 or more above victim's defense skill
+ // when their weapon skill is 15 or more above victim's defense skill
tmp = victimDefenseSkill;
int32 tmpmax = victimMaxSkillValueForLevel;
// having defense above your maximum (from items, talents etc.) has no effect
@@ -2696,32 +2558,52 @@ bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAtt
{
if (pVictim->HasInArc(M_PI,this))
{
- float blockChance = GetUnitBlockChance();
- blockChance += (GetWeaponSkillValue(attackType) - pVictim->GetMaxSkillValueForLevel() )*0.04;
+ /* Currently not exist spells with ignore block
+ // Ignore combat result aura (parry/dodge check on prepare)
+ AuraList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
+ for(AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
+ {
+ if (!(*i)->isAffectedOnSpell(spellProto))
+ continue;
+ if ((*i)->GetMiscValue() == )
+ return false;
+ }
+ */
+
+ // Check creatures flags_extra for disable block
+ if(pVictim->GetTypeId()==TYPEID_UNIT &&
+ ((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK )
+ return false;
+
+ float blockChance = pVictim->GetUnitBlockChance();
+ blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(pVictim->GetMaxSkillValueForLevel()))*0.04f;
if (roll_chance_f(blockChance))
return true;
}
return false;
}
+bool Unit::isBlockCritical()
+{
+ if (roll_chance_i(GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_CRIT_CHANCE)))
+ return true;
+ return false;
+}
+
// Melee based spells can be miss, parry or dodge on this step
// Crit or block - determined on damage calculation phase! (and can be both in some time)
-float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
+/*float Unit::MeleeSpellMissChance(Unit *pVictim, WeaponAttackType attType, int32 skillDiff, SpellEntry const *spell)
{
// Calculate hit chance (more correct for chance mod)
int32 HitChance;
// PvP - PvE melee chances
- /*int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7;
+ int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7;
int32 leveldif = pVictim->getLevelForTarget(this) - getLevelForTarget(pVictim);
if(leveldif < 3)
HitChance = 95 - leveldif;
else
- HitChance = 93 - (leveldif - 2) * lchance;*/
- if (spellId || attType == RANGED_ATTACK || !haveOffhandWeapon())
- HitChance = 95.0f;
- else
- HitChance = 76.0f;
+ HitChance = 93 - (leveldif - 2) * lchance;
// Hit chance depends from victim auras
if(attType == RANGED_ATTACK)
@@ -2730,11 +2612,8 @@ float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType,
HitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE);
// Spellmod from SPELLMOD_RESIST_MISS_CHANCE
- if(spellId)
- {
- if(Player *modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_MISS_CHANCE, HitChance);
- }
+ if(Player *modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, HitChance);
// Miss = 100 - hit
float miss_chance= 100.0f - HitChance;
@@ -2746,12 +2625,7 @@ float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType,
miss_chance -= m_modMeleeHitChance;
// bonus from skills is 0.04%
- //miss_chance -= skillDiff * 0.04f;
- int32 diff = -skillDiff;
- if(pVictim->GetTypeId()==TYPEID_PLAYER)
- miss_chance += diff > 0 ? diff * 0.04 : diff * 0.02;
- else
- miss_chance += diff > 10 ? 2 + (diff - 10) * 0.4 : diff * 0.1;
+ miss_chance -= skillDiff * 0.04f;
// Limit miss chance from 0 to 60%
if (miss_chance < 0.0f)
@@ -2759,7 +2633,7 @@ float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType,
if (miss_chance > 60.0f)
return 60.0f;
return miss_chance;
-}
+}*/
// Melee based spells hit result calculations
SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
@@ -2775,68 +2649,117 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
int32 fullSkillDiff = attackerWeaponSkill - int32(pVictim->GetDefenseSkillValue(this));
uint32 roll = urand (0, 10000);
- uint32 missChance = uint32(MeleeSpellMissChance(pVictim, attType, fullSkillDiff, spell->Id)*100.0f);
+ uint32 missChance = uint32(MeleeSpellMissChance(pVictim, attType, fullSkillDiff, spell->Id)*100.0f);
// Roll miss
uint32 tmp = missChance;
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(int eff = 0; eff < 3; ++eff)
+ {
+ int32 effect_mech = GetEffectMechanic(spell, eff);
+ if (effect_mech)
+ {
+ int32 temp = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
+ if (resist_mech < temp*100)
+ resist_mech = temp*100;
+ }
+ }
+ // Roll chance
+ tmp += resist_mech;
+ if (roll < tmp)
+ return SPELL_MISS_RESIST;
+
+ bool canDodge = true;
+ bool canParry = true;
+
// Same spells cannot be parry/dodge
if (spell->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)
return SPELL_MISS_NONE;
- // Ranged attack can`t miss too
+ // Ranged attack cannot be parry/dodge only deflect
if (attType == RANGED_ATTACK)
+ {
+ // only if in front
+ if (pVictim->HasInArc(M_PI,this))
+ {
+ int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
+ tmp+=deflect_chance;
+ if (roll < tmp)
+ return SPELL_MISS_DEFLECT;
+ }
return SPELL_MISS_NONE;
+ }
- bool attackFromBehind = !pVictim->HasInArc(M_PI,this);
-
- // Roll dodge
- int32 dodgeChance = int32(pVictim->GetUnitDodgeChance()*100.0f) - skillDiff * 4;
- // Reduce enemy dodge chance by SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
- dodgeChance+= GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE);
-
- // Reduce dodge chance by attacker expertise rating
- if (GetTypeId() == TYPEID_PLAYER)
- dodgeChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
- if (dodgeChance < 0)
- dodgeChance = 0;
-
- // Can`t dodge from behind in PvP (but its possible in PvE)
- if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER && attackFromBehind)
- dodgeChance = 0;
-
- // Rogue talent`s cant be dodged
- AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
- for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i)
+ // Check for attack from behind
+ if (!pVictim->HasInArc(M_PI,this))
+ {
+ // Can`t dodge from behind in PvP (but its possible in PvE)
+ if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
+ canDodge = false;
+ // Can`t parry
+ canParry = false;
+ }
+ // Check creatures flags_extra for disable parry
+ if(pVictim->GetTypeId()==TYPEID_UNIT)
+ {
+ uint32 flagEx = ((Creature*)pVictim)->GetCreatureInfo()->flags_extra;
+ if( flagEx & CREATURE_FLAG_EXTRA_NO_PARRY )
+ canParry = false;
+ }
+ // Ignore combat result aura
+ AuraEffectList const& ignore = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
+ for(AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
{
- if((*i)->GetModifier()->m_miscvalue == VICTIMSTATE_DODGE) // can't be dodged rogue finishing move
+ if (!(*i)->isAffectedOnSpell(spell))
+ continue;
+ switch((*i)->GetMiscValue())
{
- if(spell->SpellFamilyName==SPELLFAMILY_ROGUE && (spell->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE))
- {
- dodgeChance = 0;
+ case MELEE_HIT_DODGE: canDodge = false; break;
+ case MELEE_HIT_BLOCK: break; // Block check in hit step
+ case MELEE_HIT_PARRY: canParry = false; break;
+ default:
+ DEBUG_LOG("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
break;
- }
}
}
- tmp += dodgeChance;
- if (roll < tmp)
- return SPELL_MISS_DODGE;
+ if (canDodge)
+ {
+ // Roll dodge
+ int32 dodgeChance = int32(pVictim->GetUnitDodgeChance()*100.0f) - skillDiff * 4;
+ // Reduce enemy dodge chance by SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
+ dodgeChance+= GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE)*100;
+ dodgeChance = int32 (float (dodgeChance) * GetTotalAuraMultiplier(SPELL_AURA_MOD_ENEMY_DODGE));
+ // Reduce dodge chance by attacker expertise rating
+ if (GetTypeId() == TYPEID_PLAYER)
+ dodgeChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ if (dodgeChance < 0)
+ dodgeChance = 0;
- // Roll parry
- int32 parryChance = int32(pVictim->GetUnitParryChance()*100.0f) - skillDiff * 4;
- // Reduce parry chance by attacker expertise rating
- if (GetTypeId() == TYPEID_PLAYER)
- parryChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
- // Can`t parry from behind
- if (parryChance < 0 || attackFromBehind)
- parryChance = 0;
+ tmp += dodgeChance;
+ if (roll < tmp)
+ return SPELL_MISS_DODGE;
+ }
- tmp += parryChance;
- if (roll < tmp)
- return SPELL_MISS_PARRY;
+ if (canParry)
+ {
+ // Roll parry
+ int32 parryChance = int32(pVictim->GetUnitParryChance()*100.0f) - skillDiff * 4;
+ // Reduce parry chance by attacker expertise rating
+ if (GetTypeId() == TYPEID_PLAYER)
+ parryChance-=int32(((Player*)this)->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
+ if (parryChance < 0)
+ parryChance = 0;
+
+ tmp += parryChance;
+ if (roll < tmp)
+ return SPELL_MISS_PARRY;
+ }
return SPELL_MISS_NONE;
}
@@ -2901,11 +2824,24 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
HitChance -= int32(((Player*)pVictim)->GetRatingBonusValue(CR_HIT_TAKEN_SPELL)*100.0f);
if (HitChance < 100) HitChance = 100;
- if (HitChance > 9900) HitChance = 9900;
+ if (HitChance > 10000) HitChance = 10000;
+
+ int32 tmp = 10000 - HitChance;
uint32 rand = urand(0,10000);
- if (rand > HitChance)
+
+ if (rand < tmp)
return SPELL_MISS_RESIST;
+
+ // cast by caster in front of victim
+ if (pVictim->HasInArc(M_PI,this))
+ {
+ int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
+ tmp+=deflect_chance;
+ if (rand < tmp)
+ return SPELL_MISS_DEFLECT;
+ }
+
return SPELL_MISS_NONE;
}
@@ -2927,8 +2863,8 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
if (spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
return SPELL_MISS_NONE;
- // Check for immune (use charges)
- if (pVictim->IsImmunedToSpell(spell,true))
+ // Check for immune
+ if (pVictim->IsImmunedToSpell(spell))
return SPELL_MISS_IMMUNE;
// All positive spells can`t miss
@@ -2937,8 +2873,8 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
&&(!IsHostileTo(pVictim))) //prevent from affecting enemy by "positive" spell
return SPELL_MISS_NONE;
- // Check for immune (use charges)
- if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell),true))
+ // Check for immune
+ if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell)))
return SPELL_MISS_IMMUNE;
if(this == pVictim)
@@ -2948,10 +2884,10 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
if (CanReflect)
{
int32 reflectchance = pVictim->GetTotalAuraModifier(SPELL_AURA_REFLECT_SPELLS);
- Unit::AuraList const& mReflectSpellsSchool = pVictim->GetAurasByType(SPELL_AURA_REFLECT_SPELLS_SCHOOL);
- for(Unit::AuraList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i)
- if((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spell))
- reflectchance = (*i)->GetModifierValue();
+ Unit::AuraEffectList const& mReflectSpellsSchool = pVictim->GetAurasByType(SPELL_AURA_REFLECT_SPELLS_SCHOOL);
+ for(Unit::AuraEffectList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i)
+ if((*i)->GetMiscValue() & GetSpellSchoolMask(spell))
+ reflectchance += (*i)->GetAmount();
if (reflectchance > 0 && roll_chance_i(reflectchance))
{
// Start triggers for remove charges if need (trigger only for victim, and mark as active spell)
@@ -3126,7 +3062,7 @@ float Unit::GetUnitBlockChance() const
Player const* player = (Player const*)this;
if(player->CanBlock() )
{
- Item *tmpitem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ Item *tmpitem = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block)
return GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
}
@@ -3192,6 +3128,9 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVict
crit -= ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE);
}
+ // Apply crit chance from defence skill
+ crit += (int32(GetMaxSkillValueForLevel(pVictim)) - int32(pVictim->GetDefenseSkillValue(this))) * 0.04f;
+
if (crit < 0.0f)
crit = 0.0f;
return crit;
@@ -3212,7 +3151,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
return 0;
}
- if(((Player*)this)->IsInFeralForm())
+ if(IsInFeralForm())
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
// weapon skill or (unarmed for base attack)
@@ -3236,6 +3175,67 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
return value;
}
+void Unit::_DeleteAuras()
+{
+ for (AuraList::iterator i = m_removedAuras.begin(); i != m_removedAuras.end();i = m_removedAuras.begin())
+ {
+ Aura * Aur = *i;
+ SpellEntry const* AurSpellInfo = Aur->GetSpellProto();
+ // Statue unsummoned at aura delete
+ Totem* statue = NULL;
+ if(Aur->GetAuraDuration() && !Aur->IsPersistent() && IsChanneledSpell(Aur->GetSpellProto()))
+ {
+ Unit* caster = Aur->GetCaster();
+ if(caster && caster->isAlive())
+ {
+ // stop caster chanelling state
+ if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
+ {
+ // same spell
+ if (AurSpellInfo == caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo
+ //prevent recurential call
+ && caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)
+ {
+ if (caster==this || !IsAreaOfEffectSpell(AurSpellInfo))
+ {
+ // remove auras only for non-aoe spells or when chanelled aura is removed
+ // because aoe spells don't require aura on target to continue
+ caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
+ }
+
+ if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE)
+ statue = ((Totem*)caster);
+ }
+ }
+
+ // Unsummon summon as possessed creatures on spell cancel
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ for(int i = 0; i < 3; ++i)
+ {
+ if(AurSpellInfo->Effect[i] == SPELL_EFFECT_SUMMON)
+ if(SummonPropertiesEntry const *SummonProperties = sSummonPropertiesStore.LookupEntry(AurSpellInfo->EffectMiscValueB[i]))
+ if(SummonProperties->Category == SUMMON_CATEGORY_POSSESSED)
+ {
+ ((Player*)caster)->StopCastingCharm();
+ break;
+ }
+ }
+ }
+ }
+ }
+ if(statue)
+ {
+ sLog.outDebug("Statue %d is unsummoned by aura %d delete from unit %d", statue->GetGUIDLow(), Aur->GetId(),GetGUIDLow());
+ statue->UnSummon();
+ }
+
+ sLog.outDebug("Aura %d is deleted from unit %d", Aur->GetId(), GetGUIDLow());
+ m_removedAuras.pop_front();
+ delete (Aur);
+ }
+}
+
void Unit::_UpdateSpells( uint32 time )
{
if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL])
@@ -3252,54 +3252,48 @@ void Unit::_UpdateSpells( uint32 time )
}
// TODO: Find a better way to prevent crash when multiple auras are removed.
- m_removedAuras = 0;
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
- if ((*i).second)
- (*i).second->SetUpdated(false);
+ i->second->SetUpdated(false);
- for (AuraMap::iterator i = m_Auras.begin(), next; i != m_Auras.end(); i = next)
+ for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
{
- next = i;
- ++next;
- if ((*i).second)
+ Aura *aur = i->second;
+
+ // prevent double update
+ if(aur->IsUpdated())
{
- // prevent double update
- if ((*i).second->IsUpdated())
- continue;
- (*i).second->SetUpdated(true);
- (*i).second->Update( time );
- // several auras can be deleted due to update
- if (m_removedAuras)
- {
- if (m_Auras.empty()) break;
- next = m_Auras.begin();
- m_removedAuras = 0;
- }
+ ++i;
+ continue;
}
- }
- for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
- {
- if ((*i).second)
+ aur->SetUpdated(true);
+
+ m_removedAurasCount = 0;
+ aur->Update( time );
+
+ // several auras can be deleted due to update
+ if(m_removedAurasCount)
{
- if ( !(*i).second->GetAuraDuration() && !((*i).second->IsPermanent() || ((*i).second->IsPassive())) )
- {
- RemoveAura(i);
- }
- else
- {
- ++i;
- }
+ m_removedAurasCount = 0;
+ i = m_Auras.begin();
}
else
- {
++i;
- }
}
+ for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
+ {
+ if(!i->second->GetAuraDuration() && !(i->second->IsPermanent() || (i->second->IsPassive())))
+ RemoveAura(i, AURA_REMOVE_BY_EXPIRE);
+ else
+ ++i;
+ }
+
+ _DeleteAuras();
+
if(!m_gameObj.empty())
{
- std::list<GameObject*>::iterator ite1, dnext1;
+ GameObjectList::iterator ite1, dnext1;
for (ite1 = m_gameObj.begin(); ite1 != m_gameObj.end(); ite1 = dnext1)
{
dnext1 = ite1;
@@ -3323,7 +3317,7 @@ void Unit::_UpdateAutoRepeatSpell()
if ( (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) || IsNonMeleeSpellCasted(false,false,true) )
{
// cancel wand shoot
- if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Category == 351)
+ if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != SPELL_ID_AUTOSHOT)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
m_AutoRepeatFirstCast = true;
return;
@@ -3338,7 +3332,7 @@ void Unit::_UpdateAutoRepeatSpell()
if (isAttackReady(RANGED_ATTACK))
{
// Check if able to cast
- if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->CanCast(true))
+ if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->CheckCast(true) != SPELL_CAST_OK)
{
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
return;
@@ -3376,7 +3370,7 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
if ( m_currentSpells[CURRENT_AUTOREPEAT_SPELL] )
{
// break autorepeat if not Auto Shot
- if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Category == 351)
+ if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != SPELL_ID_AUTOSHOT)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
m_AutoRepeatFirstCast = true;
}
@@ -3391,7 +3385,7 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
// it also does break autorepeat if not Auto Shot
if ( m_currentSpells[CURRENT_AUTOREPEAT_SPELL] &&
- m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Category == 351 )
+ m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != SPELL_ID_AUTOSHOT )
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
addUnitState(UNIT_STAT_CASTING);
} break;
@@ -3399,7 +3393,7 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
case CURRENT_AUTOREPEAT_SPELL:
{
// only Auto Shoot does not break anything
- if (pSpell->m_spellInfo->Category == 351)
+ if (pSpell->m_spellInfo->Id != SPELL_ID_AUTOSHOT)
{
// generic autorepeats break generic non-delayed and channeled non-delayed spells
InterruptSpell(CURRENT_GENERIC_SPELL,false);
@@ -3476,40 +3470,16 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id)
{
// generic spells are interrupted if they are not finished or delayed
- Spell *spell = m_currentSpells[CURRENT_GENERIC_SPELL];
- if (spell && (!spell_id || spell->m_spellInfo->Id==spell_id))
- {
- m_currentSpells[CURRENT_GENERIC_SPELL] = NULL;
+ if (m_currentSpells[CURRENT_GENERIC_SPELL] && (!spell_id || m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id==spell_id))
+ InterruptSpell(CURRENT_GENERIC_SPELL,withDelayed);
- if ( (spell->getState() != SPELL_STATE_FINISHED) &&
- (withDelayed || spell->getState() != SPELL_STATE_DELAYED) )
- spell->cancel();
- spell->SetReferencedFromCurrent(false);
- }
-
- spell = m_currentSpells[CURRENT_AUTOREPEAT_SPELL];
// autorepeat spells are interrupted if they are not finished or delayed
- if (spell && (!spell_id || spell->m_spellInfo->Id==spell_id))
- {
- m_currentSpells[CURRENT_AUTOREPEAT_SPELL] = NULL;
- // send disable autorepeat packet in any case
- if(GetTypeId()==TYPEID_PLAYER)
- ((Player*)this)->SendAutoRepeatCancel();
- if ( (spell->getState() != SPELL_STATE_FINISHED) &&
- (withDelayed || spell->getState() != SPELL_STATE_DELAYED) )
- spell->cancel();
- spell->SetReferencedFromCurrent(false);
- }
+ if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && (!spell_id || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id==spell_id))
+ InterruptSpell(CURRENT_AUTOREPEAT_SPELL,withDelayed);
// channeled spells are interrupted if they are not finished, even if they are delayed
- spell = m_currentSpells[CURRENT_CHANNELED_SPELL];
- if (spell && (!spell_id || spell->m_spellInfo->Id==spell_id))
- {
- m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL;
- if (spell->getState() != SPELL_STATE_FINISHED)
- spell->cancel();
- spell->SetReferencedFromCurrent(false);
- }
+ if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id))
+ InterruptSpell(CURRENT_CHANNELED_SPELL,true);
}
Spell* Unit::FindCurrentSpellBySpellId(uint32 spell_id) const
@@ -3571,9 +3541,9 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- modifier += (*i)->GetModifierValue();
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ modifier += (*i)->GetAmount();
return modifier;
}
@@ -3582,23 +3552,22 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype) const
{
float multiplier = 1.0f;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ multiplier *= (100.0f + (*i)->GetAmount())/100.0f;
return multiplier;
}
-int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
+int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype)
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- int32 amount = (*i)->GetModifierValue();
- if (amount > modifier)
- modifier = amount;
+ if ((*i)->GetAmount() > modifier)
+ modifier = (*i)->GetAmount();
}
return modifier;
@@ -3608,13 +3577,10 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- {
- int32 amount = (*i)->GetModifierValue();
- if (amount < modifier)
- modifier = amount;
- }
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ if ((*i)->GetAmount() < modifier)
+ modifier = (*i)->GetAmount();
return modifier;
}
@@ -3623,12 +3589,11 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask)
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- if (mod->m_miscvalue & misc_mask)
- modifier += (*i)->GetModifierValue();
+ if ((*i)->GetMiscValue()& misc_mask)
+ modifier += (*i)->GetAmount();
}
return modifier;
}
@@ -3637,12 +3602,11 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask
{
float multiplier = 1.0f;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- if (mod->m_miscvalue & misc_mask)
- multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
+ if ((*i)->GetMiscValue()& misc_mask)
+ multiplier *= (100.0f + (*i)->GetAmount())/100.0f;
}
return multiplier;
}
@@ -3651,13 +3615,11 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- int32 amount = (*i)->GetModifierValue();
- if (mod->m_miscvalue & misc_mask && amount > modifier)
- modifier = amount;
+ if ((*i)->GetMiscValue()& misc_mask && (*i)->GetAmount() > modifier)
+ modifier = (*i)->GetAmount();
}
return modifier;
@@ -3667,13 +3629,11 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- int32 amount = (*i)->GetModifierValue();
- if (mod->m_miscvalue & misc_mask && amount < modifier)
- modifier = amount;
+ if ((*i)->GetMiscValue()& misc_mask && (*i)->GetAmount() < modifier)
+ modifier = (*i)->GetAmount();
}
return modifier;
@@ -3683,12 +3643,11 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value)
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- if (mod->m_miscvalue == misc_value)
- modifier += (*i)->GetModifierValue();
+ if ((*i)->GetMiscValue()== misc_value)
+ modifier += (*i)->GetAmount();
}
return modifier;
}
@@ -3697,12 +3656,11 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu
{
float multiplier = 1.0f;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- if (mod->m_miscvalue == misc_value)
- multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
+ if ((*i)->GetMiscValue()== misc_value)
+ multiplier *= (100.0f + (*i)->GetAmount())/100.0f;
}
return multiplier;
}
@@ -3711,13 +3669,11 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- int32 amount = (*i)->GetModifierValue();
- if (mod->m_miscvalue == misc_value && amount > modifier)
- modifier = amount;
+ if ((*i)->GetMiscValue()== misc_value && (*i)->GetAmount() > modifier)
+ modifier = (*i)->GetAmount();
}
return modifier;
@@ -3727,13 +3683,11 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
{
int32 modifier = 0;
- AuraList const& mTotalAuraList = GetAurasByType(auratype);
- for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
- Modifier* mod = (*i)->GetModifier();
- int32 amount = (*i)->GetModifierValue();
- if (mod->m_miscvalue == misc_value && amount < modifier)
- modifier = amount;
+ if ((*i)->GetMiscValue()== misc_value && (*i)->GetAmount() < modifier)
+ modifier = (*i)->GetAmount();
}
return modifier;
@@ -3741,6 +3695,13 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
bool Unit::AddAura(Aura *Aur)
{
+ // aura doesn't apply effects-return
+ if (!Aur->GetEffectMask())
+ {
+ delete Aur;
+ return false;
+ }
+
// ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
if( !isAlive() && Aur->GetId() != 20584 && Aur->GetId() != 8326 && Aur->GetId() != 2584 &&
(GetTypeId()!=TYPEID_PLAYER || !((Player*)this)->GetSession()->PlayerLoading()) )
@@ -3751,8 +3712,8 @@ bool Unit::AddAura(Aura *Aur)
if(Aur->GetTarget() != this)
{
- sLog.outError("Aura (spell %u eff %u) add to aura list of %s (lowguid: %u) but Aura target is %s (lowguid: %u)",
- Aur->GetId(),Aur->GetEffIndex(),(GetTypeId()==TYPEID_PLAYER?"player":"creature"),GetGUIDLow(),
+ sLog.outError("Aura (spell %u) add to aura list of %s (lowguid: %u) but Aura target is %s (lowguid: %u)",
+ Aur->GetId(),(GetTypeId()==TYPEID_PLAYER?"player":"creature"),GetGUIDLow(),
(Aur->GetTarget()->GetTypeId()==TYPEID_PLAYER?"player":"creature"),Aur->GetTarget()->GetGUIDLow());
delete Aur;
return false;
@@ -3760,66 +3721,30 @@ bool Unit::AddAura(Aura *Aur)
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
- spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());
-
- bool stackModified=false;
// passive and persistent auras can stack with themselves any number of times
- if (!Aur->IsPassive() && !Aur->IsPersistent())
+ if (!Aur->IsPassive() && !Aur->IsPersistent() && aurSpellInfo->StackAmount>1)
{
- for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair);)
+ // find current aura from spell and change it's stackamount
+ if (Aura * foundAura = GetAura(aurSpellInfo->Id,Aur->GetCasterGUID()))
{
- if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
- {
- if (!stackModified)
- {
- // replace aura if next will > spell StackAmount
- if(aurSpellInfo->StackAmount)
- {
- // prevent adding stack more than once
- stackModified=true;
- Aur->SetStackAmount(i2->second->GetStackAmount());
- if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
- Aur->SetStackAmount(Aur->GetStackAmount()+1);
- }
- RemoveAura(i2,AURA_REMOVE_BY_STACK);
- i2=m_Auras.lower_bound(spair);
- continue;
- }
- }
- switch(aurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()])
- {
- // DOT or HOT from different casters will stack
- case SPELL_AURA_PERIODIC_DAMAGE:
- case SPELL_AURA_PERIODIC_HEAL:
- case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
- case SPELL_AURA_PERIODIC_ENERGIZE:
- case SPELL_AURA_PERIODIC_MANA_LEECH:
- case SPELL_AURA_PERIODIC_LEECH:
- case SPELL_AURA_POWER_BURN_MANA:
- case SPELL_AURA_OBS_MOD_MANA:
- case SPELL_AURA_OBS_MOD_HEALTH:
- ++i2;
- continue;
- }
- RemoveAura(i2,AURA_REMOVE_BY_STACK);
- i2=m_Auras.lower_bound(spair);
- continue;
+ if(foundAura->GetStackAmount() < aurSpellInfo->StackAmount)
+ foundAura->SetStackAmount(foundAura->GetStackAmount()+1);
+ else
+ foundAura->RefreshAura();
+ delete Aur;
+ return false;
}
}
- // passive auras stack with all (except passive spell proc auras)
- if ((!Aur->IsPassive() || !IsPassiveStackableSpell(Aur->GetId())) &&
- !(Aur->GetId() == 20584 || Aur->GetId() == 8326))
+ // passive auras not stacable with other ranks
+ if (!RemoveNoStackAurasDueToAura(Aur))
{
- if (!RemoveNoStackAurasDueToAura(Aur))
- {
- delete Aur;
- return false; // couldn't remove conflicting aura with higher rank
- }
+ delete Aur;
+ return false; // couldn't remove conflicting aura with higher rank
}
// update single target auras list (before aura add to aura list, to prevent unexpected remove recently added aura)
- if (IsSingleTargetSpell(aurSpellInfo) && Aur->GetTarget())
+ if (Aur->IsSingleTarget() && Aur->GetTarget())
{
// caster pointer can be deleted in time aura remove, find it by guid at each iteration
for(;;)
@@ -3835,12 +3760,7 @@ bool Unit::AddAura(Aura *Aur)
if( (*itr)->GetTarget() != Aur->GetTarget() &&
IsSingleTargetSpells((*itr)->GetSpellProto(),aurSpellInfo) )
{
- if ((*itr)->IsInUse())
- {
- sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for IsSingleTargetSpell", (*itr)->GetId(), (*itr)->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
- continue;
- }
- (*itr)->GetTarget()->RemoveAura((*itr)->GetId(), (*itr)->GetEffIndex());
+ (*itr)->GetTarget()->RemoveAurasDueToSpell((*itr)->GetId(), caster->GetGUID(), AURA_REMOVE_BY_STACK);
restart = true;
break;
}
@@ -3857,63 +3777,24 @@ bool Unit::AddAura(Aura *Aur)
// add aura, register in lists and arrays
Aur->_AddAura();
- m_Auras.insert(AuraMap::value_type(spellEffectPair(Aur->GetId(), Aur->GetEffIndex()), Aur));
- if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
+ m_Auras.insert(AuraMap::value_type(Aur->GetId(), Aur));
+
+ if(Aur->GetSpellProto()->AuraInterruptFlags)
{
- m_modAuras[Aur->GetModifier()->m_auraname].push_back(Aur);
- if(Aur->GetSpellProto()->AuraInterruptFlags)
- {
- m_interruptableAuras.push_back(Aur);
- AddInterruptMask(Aur->GetSpellProto()->AuraInterruptFlags);
- }
- if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE)
- && (Aur->GetModifier()->m_auraname != SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
- {
- m_ccAuras.push_back(Aur);
- }
+ m_interruptableAuras.push_back(Aur);
+ AddInterruptMask(Aur->GetSpellProto()->AuraInterruptFlags);
}
-
- Aur->ApplyModifier(true,true);
-
- uint32 id = Aur->GetId();
- if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA)
+ if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE
+ && !Aur->IsAuraType(SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
+ || ((GetAllSpellMechanicMask(Aur->GetSpellProto()) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
{
- if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
- for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
- if(*itr < 0)
- ApplySpellImmune(id, IMMUNITY_ID, -(*itr), true);
- else if(Unit* caster = Aur->GetCaster())
- caster->AddAura(*itr, this);
+ m_ccAuras.push_back(Aur);
}
- sLog.outDebug("Aura %u now is in use", Aur->GetModifier()->m_auraname);
- return true;
-}
+ Aur->HandleEffects(true);
-void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
-{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if(!spellInfo)
- return;
- AuraMap::iterator i,next;
- for (i = m_Auras.begin(); i != m_Auras.end(); i = next)
- {
- next = i;
- ++next;
- uint32 i_spellId = (*i).second->GetId();
- if((*i).second && i_spellId && i_spellId != spellId)
- {
- if(spellmgr.IsRankSpellDueToSpell(spellInfo,i_spellId))
- {
- RemoveAurasDueToSpell(i_spellId);
-
- if( m_Auras.empty() )
- break;
- else
- next = m_Auras.begin();
- }
- }
- }
+ sLog.outDebug("Aura %u now is in use", Aur->GetId());
+ return true;
}
bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
@@ -3922,34 +3803,34 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
return false;
SpellEntry const* spellProto = Aur->GetSpellProto();
- if (!spellProto)
- return false;
uint32 spellId = Aur->GetId();
- uint32 effIndex = Aur->GetEffIndex();
+
+ // passive spell special case (only non stackable with ranks)
+ if(IsPassiveSpell(spellId))
+ {
+ if(IsPassiveSpellStackableWithRanks(spellProto))
+ return true;
+ }
SpellSpecific spellId_spec = GetSpellSpecific(spellId);
+ //bool linked = spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_LINK_AURA? true : false;
+
AuraMap::iterator i,next;
for (i = m_Auras.begin(); i != m_Auras.end(); i = next)
{
next = i;
++next;
- if (!(*i).second) continue;
SpellEntry const* i_spellProto = (*i).second->GetSpellProto();
- if (!i_spellProto)
- continue;
-
uint32 i_spellId = i_spellProto->Id;
- if (spellId==i_spellId)
- continue;
-
if(IsPassiveSpell(i_spellId))
{
- if(IsPassiveStackableSpell(i_spellId))
+ // passive non-stackable spells not stackable only for same caster
+ if(Aur->GetCasterGUID()!=i->second->GetCasterGUID())
continue;
// passive non-stackable spells not stackable only with another rank of same spell
@@ -3957,180 +3838,133 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
continue;
}
- uint32 i_effIndex = (*i).second->GetEffIndex();
-
bool is_triggered_by_spell = false;
// prevent triggered aura of removing aura that triggered it
for(int j = 0; j < 3; ++j)
if (i_spellProto->EffectTriggerSpell[j] == spellProto->Id)
is_triggered_by_spell = true;
- if (is_triggered_by_spell) continue;
- for(int j = 0; j < 3; ++j)
- {
- // prevent remove dummy triggered spells at next effect aura add
- switch(spellProto->Effect[j]) // main spell auras added added after triggered spell
- {
- case SPELL_EFFECT_DUMMY:
- switch(spellId)
- {
- case 5420: if(i_spellId==34123) is_triggered_by_spell = true; break;
- }
- break;
- }
+ // check if they can stack
+ bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID();
- if(is_triggered_by_spell)
- break;
-
- // prevent remove form main spell by triggered passive spells
- switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell
- {
- case SPELL_AURA_MOD_SHAPESHIFT:
- switch(i_spellId)
+ /*// Dont remove by stack with linked auras
+ // Not needed for now
+ if(sameCaster && linked)
+ {
+ if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(spellId + SPELL_LINK_AURA))
+ for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
+ if(*itr>0 && *itr==i_spellId)
{
- case 24858: if(spellId==24905) is_triggered_by_spell = true; break;
- case 33891: if(spellId==5420 || spellId==34123) is_triggered_by_spell = true; break;
- case 34551: if(spellId==22688) is_triggered_by_spell = true; break;
+ is_triggered_by_spell=true;
+ break;
}
- break;
- }
- }
+ }*/
- if(!is_triggered_by_spell)
- {
- bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID();
- if( spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId, sameCaster) )
- {
- //some spells should be not removed by lower rank of them (totem, paladin aura)
- if (!sameCaster
- &&(spellProto->Effect[effIndex]==SPELL_EFFECT_APPLY_AREA_AURA_PARTY)
- &&(spellProto->DurationIndex==21)
- &&(spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
- &&(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0))
- return false;
+ if (is_triggered_by_spell)
+ continue;
- // Its a parent aura (create this aura in ApplyModifier)
- if ((*i).second->IsInUse())
- {
- sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
- continue;
- }
+ if(!spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId, sameCaster))
+ continue;
- uint64 caster = (*i).second->GetCasterGUID();
- // Remove all auras by aura caster
- for (uint8 a=0;a<3;++a)
- {
- spellEffectPair spair = spellEffectPair(i_spellId, a);
- for(AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
- {
- if(iter->second->GetCasterGUID()==caster)
- {
- RemoveAura(iter, AURA_REMOVE_BY_STACK);
- iter = m_Auras.lower_bound(spair);
- }
- else
- ++iter;
- }
- }
+ //some spells should be not removed by lower rank of them (totem, paladin aura)
+ if (!sameCaster
+ &&(Aur->IsAreaAura())
+ &&(spellProto->DurationIndex==21)
+ &&(spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
+ &&(IsHigherHankOfSpell(spellId,i_spellId)))
+ return false;
- if( m_Auras.empty() )
- break;
- else
- next = m_Auras.begin();
- }
- }
+ // Remove all auras by aura caster
+ RemoveAura(i, AURA_REMOVE_BY_STACK);
+ next=i;
}
return true;
}
-void Unit::RemoveAura(uint32 spellId, uint32 effindex, Aura* except)
+void Unit::RemoveAura(uint32 spellId, uint64 caster ,AuraRemoveMode removeMode)
{
- spellEffectPair spair = spellEffectPair(spellId, effindex);
- for(AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
+ for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- if(iter->second!=except)
+ if (!caster || iter->second->GetCasterGUID()==caster)
{
- RemoveAura(iter);
- iter = m_Auras.lower_bound(spair);
+ RemoveAura(iter, removeMode);
+ return;
}
else
++iter;
}
}
-void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID)
+void Unit::RemoveAura(Aura * aur ,AuraRemoveMode mode)
{
- for(int k = 0; k < 3; ++k)
+ // no need to remove
+ if (!aur || aur->IsRemoved())
+ return;
+ for(AuraMap::iterator iter = m_Auras.lower_bound(aur->GetId()); iter != m_Auras.upper_bound(aur->GetId());)
{
- spellEffectPair spair = spellEffectPair(spellId, k);
- for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
+ if (aur == iter->second)
{
- if (iter->second->GetCasterGUID() == casterGUID)
- {
- RemoveAura(iter);
- iter = m_Auras.upper_bound(spair); // overwrite by more appropriate
- }
- else
- ++iter;
+ RemoveAura(iter, mode);
+ return;
}
+ else
+ ++iter;
}
}
-void Unit::SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration)
+void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 caster ,AuraRemoveMode removeMode)
{
- for(uint8 i = 0; i < 3; ++i)
+ for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- spellEffectPair spair = spellEffectPair(spellId, i);
- for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
+ if (!caster || iter->second->GetCasterGUID()==caster)
{
- if(itr->second->GetCasterGUID()==casterGUID)
- {
- itr->second->SetAuraDuration(duration);
- break;
- }
+ RemoveAura(iter, removeMode);
+ iter = m_Auras.lower_bound(spellId);
}
+ else
+ ++iter;
}
}
-Aura* Unit::GetAuraByCasterSpell(uint32 spellId, uint64 casterGUID)
+void Unit::RemoveAuraFromStack(uint32 spellId, uint64 caster ,AuraRemoveMode removeMode)
{
- // Returns first found aura from spell-use only in cases where effindex of spell doesn't matter!
- for(uint8 i = 0; i < 3; ++i)
+ for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- spellEffectPair spair = spellEffectPair(spellId, i);
- for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
+ if (!caster || iter->second->GetCasterGUID()==caster)
{
- if(itr->second->GetCasterGUID()==casterGUID)
- return itr->second;
+ RemoveAuraFromStack(iter, removeMode);
+ return;
}
+ else
+ ++iter;
}
- return NULL;
+}
+
+inline void Unit::RemoveAuraFromStack(AuraMap::iterator &iter,AuraRemoveMode removeMode)
+{
+ if (iter->second->modStackAmount(-1))
+ RemoveAura(iter, removeMode);
}
void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler)
{
- for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
+ for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- Aura *aur = iter->second;
- if (aur->GetId() == spellId && aur->GetCasterGUID() == casterGUID)
+ Aura * aur= iter->second;
+ if (casterGUID == aur->GetCasterGUID())
{
- // Custom dispel case
// Unstable Affliction
- if (aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aur->GetSpellProto()->SpellFamilyFlags & 0x010000000000LL))
+ if (aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aur->GetSpellProto()->SpellFamilyFlags[1] & 0x0100))
{
- int32 damage = aur->GetModifier()->m_amount*9;
+ int32 damage = aur->GetPartAura(0)->GetAmount()*9;
uint64 caster_guid = aur->GetCasterGUID();
-
- // Remove aura
- RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
-
+ RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
// backfire damage and silence
dispeler->CastCustomSpell(dispeler, 31117, &damage, NULL, NULL, true, NULL, NULL,caster_guid);
-
- iter = m_Auras.begin(); // iterator can be invalidate at cast if self-dispel
+ return;
}
- else
- RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
+ RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
+ return;
}
else
++iter;
@@ -4139,130 +3973,83 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer)
{
- for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
+ if (casterGUID == stealer->GetGUID())
+ return;
+
+ for(AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- Aura *aur = iter->second;
- if (aur->GetId() == spellId && aur->GetCasterGUID() == casterGUID)
+ Aura * aur= iter->second;
+ if (casterGUID == aur->GetCasterGUID())
{
- int32 basePoints = aur->GetBasePoints();
- // construct the new aura for the attacker
- Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), NULL/*&basePoints*/, stealer);
- if(!new_aur)
- continue;
-
- // set its duration and maximum duration
- // max duration 2 minutes (in msecs)
- int32 dur = aur->GetAuraDuration();
- const int32 max_dur = 2*MINUTE*1000;
- new_aur->SetAuraMaxDuration( max_dur > dur ? dur : max_dur );
- new_aur->SetAuraDuration( max_dur > dur ? dur : max_dur );
+ int32 damage[3];
+ for (uint8 i=0;i<3;++i)
+ {
+ if (aur->GetPartAura(i))
+ damage[i]=aur->GetPartAura(i)->GetAmount();
+ else
+ damage[i]=NULL;
+ }
+ int32 dur = 2*MINUTE*IN_MILISECONDS < aur->GetAuraDuration() ? 2*MINUTE*IN_MILISECONDS : aur->GetAuraDuration();
+ Aura * new_aur = new Aura(aur->GetSpellProto(),aur->GetEffectMask(), NULL, stealer, stealer, NULL);
+ new_aur->SetLoadedState(aur->GetCasterGUID(), dur, dur, aur->GetAuraCharges(), aur->GetStackAmount(), &damage[0]);
- // add the new aura to stealer
+ // Unregister _before_ adding to stealer
+ aur->UnregisterSingleCastAura();
+ // strange but intended behaviour: Stolen single target auras won't be treated as single targeted
+ new_aur->SetIsSingleTarget(false);
stealer->AddAura(new_aur);
-
- // Remove aura as dispel
- RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
+ RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
+ return;
}
else
++iter;
}
}
-void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId)
-{
- for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
- {
- if (iter->second->GetId() == spellId)
- RemoveAura(iter, AURA_REMOVE_BY_CANCEL);
- else
- ++iter;
- }
-}
-
-void Unit::RemoveAurasWithDispelType( DispelType type )
-{
- // Create dispel mask by dispel type
- uint32 dispelMask = GetDispellMask(type);
- // Dispel all existing auras vs current dispel type
- AuraMap& auras = GetAuras();
- for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); )
- {
- SpellEntry const* spell = itr->second->GetSpellProto();
- if( (1<<spell->Dispel) & dispelMask )
- {
- // Dispel aura
- RemoveAurasDueToSpell(spell->Id);
- itr = auras.begin();
- }
- else
- ++itr;
- }
-}
-
-void Unit::RemoveSingleAuraFromStackByDispel(uint32 spellId)
+void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
{
- for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
+ for (AuraMap::iterator iter = m_Auras.lower_bound(spellId); iter != m_Auras.upper_bound(spellId);)
{
- Aura *aur = iter->second;
- if (aur->GetId() == spellId)
+ if (!castItem || iter->second->GetCastItemGUID()==castItem->GetGUID())
{
- if(iter->second->GetStackAmount() > 1)
- {
- // reapply modifier with reduced stack amount
- iter->second->ApplyModifier(false,true);
- iter->second->SetStackAmount(iter->second->GetStackAmount()-1);
- iter->second->ApplyModifier(true,true);
-
- iter->second->UpdateSlotCounterAndDuration();
- return; // not remove aura if stack amount > 1
- }
- else
- RemoveAura(iter,AURA_REMOVE_BY_DISPEL);
+ RemoveAura(iter);
+ iter = m_Auras.upper_bound(spellId); // overwrite by more appropriate
}
else
++iter;
}
}
-void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex)
+void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except)
{
- AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
- if(iter != m_Auras.end())
+ if (auraType >= TOTAL_AURAS) return;
+ for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();)
{
- if(iter->second->GetStackAmount() > 1)
+ Aura * aur = (*iter)->GetParentAura();
+ ++iter;
+ if (aur != except && (!casterGUID || aur->GetCasterGUID()==casterGUID))
{
- // reapply modifier with reduced stack amount
- iter->second->ApplyModifier(false,true);
- iter->second->SetStackAmount(iter->second->GetStackAmount()-1);
- iter->second->ApplyModifier(true,true);
-
- iter->second->UpdateSlotCounterAndDuration();
- return; // not remove aura if stack amount > 1
+ uint32 removedAuras = m_removedAurasCount;
+ RemoveAura(aur);
+ if (removedAuras+1< m_removedAurasCount)
+ iter=m_modAuras[auraType].begin();
}
- RemoveAura(iter);
}
}
-void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except)
-{
- for (int i = 0; i < 3; ++i)
- RemoveAura(spellId,i,except);
-}
-
-void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId)
+void Unit::RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell)
{
- for (int k=0; k < 3; ++k)
+ if (auraType >= TOTAL_AURAS) return;
+ for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();)
{
- spellEffectPair spair = spellEffectPair(spellId, k);
- for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair);)
+ Aura * aur = (*iter)->GetParentAura();
+ ++iter;
+ if (GetDispelChance(aur->GetCaster(), aur->GetId()))
{
- if (iter->second->GetCastItemGUID() == castItem->GetGUID())
- {
- RemoveAura(iter);
- iter = m_Auras.upper_bound(spair); // overwrite by more appropriate
- }
- else
- ++iter;
+ uint32 removedAuras = m_removedAurasCount;
+ RemoveAura(aur, AURA_REMOVE_BY_ENEMY_SPELL);
+ if (removedAuras+1<m_removedAurasCount)
+ iter=m_modAuras[auraType].begin();
}
}
}
@@ -4280,182 +4067,63 @@ void Unit::RemoveNotOwnSingleTargetAuras()
// single target auras at other targets
AuraList& scAuras = GetSingleCastAuras();
- for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end(); )
+ for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
{
- Aura* aura = *iter;
- if (aura->GetTarget()!=this)
+ Aura * aur=*iter;
+ ++iter;
+ if (aur->GetTarget()!=this)
{
- scAuras.erase(iter); // explicitly remove, instead waiting remove in RemoveAura
- aura->GetTarget()->RemoveAura(aura->GetId(),aura->GetEffIndex());
- iter = scAuras.begin();
+ uint32 removedAuras = m_removedAurasCount;
+ aur->GetTarget()->RemoveAura(aur->GetId(),aur->GetCasterGUID());
+ if (removedAuras+1<m_removedAurasCount)
+ iter=scAuras.begin();
}
- else
- ++iter;
}
-
}
void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
{
Aura* Aur = i->second;
- SpellEntry const* AurSpellInfo = Aur->GetSpellProto();
// some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura
// remove aura from list before to prevent deleting it before
m_Auras.erase(i);
- ++m_removedAuras; // internal count used by unit update
+ m_removedAurasCount += 1;
- Unit* caster = NULL;
- if (IsSingleTargetSpell(AurSpellInfo))
+ Aur->UnregisterSingleCastAura();
+
+ if(Aur->GetSpellProto()->AuraInterruptFlags)
{
- caster = Aur->GetCaster();
- if(caster)
- {
- AuraList& scAuras = caster->GetSingleCastAuras();
- scAuras.remove(Aur);
- }
- else
- {
- sLog.outError("Couldn't find the caster of the single target aura, may crash later!");
- assert(false);
- }
+ m_interruptableAuras.remove(Aur);
+ UpdateInterruptMask();
}
- // remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
- if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
+ if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE
+ && !Aur->IsAuraType(SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
+ || ((GetAllSpellMechanicMask(Aur->GetSpellProto()) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
{
- m_modAuras[Aur->GetModifier()->m_auraname].remove(Aur);
-
- if(Aur->GetSpellProto()->AuraInterruptFlags)
- {
- m_interruptableAuras.remove(Aur);
- UpdateInterruptMask();
- }
-
- if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE)
- && (Aur->GetModifier()->m_auraname != SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
- {
- m_ccAuras.remove(Aur);
- }
+ m_ccAuras.remove(Aur);
}
- // Set remove mode
Aur->SetRemoveMode(mode);
- // Statue unsummoned at aura remove
- Totem* statue = NULL;
- bool channeled = false;
- if(Aur->GetAuraDuration() && !Aur->IsPersistent() && IsChanneledSpell(AurSpellInfo))
- {
- if(!caster) // can be already located for IsSingleTargetSpell case
- caster = Aur->GetCaster();
-
- if(caster && caster->isAlive())
- {
- // stop caster chanelling state
- if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL]
- //prevent recurential call
- && caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)
- {
- if (caster==this || !IsAreaOfEffectSpell(AurSpellInfo))
- {
- // remove auras only for non-aoe spells or when chanelled aura is removed
- // because aoe spells don't require aura on target to continue
- if (AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!=SPELL_AURA_PERIODIC_DUMMY
- && AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
- //don't stop channeling of scripted spells (this is actually a hack)
- {
- caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
- caster->m_currentSpells[CURRENT_CHANNELED_SPELL]=NULL;
-
- }
- }
-
- if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE)
- statue = ((Totem*)caster);
- }
-
- // Unsummon summon as possessed creatures on spell cancel
- if(caster->GetTypeId() == TYPEID_PLAYER)
- {
- for(int i = 0; i < 3; ++i)
- {
- if(AurSpellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&
- (AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||
- AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||
- AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3))
- {
- ((Player*)caster)->StopCastingCharm();
- break;
- }
- }
- }
- }
- }
+ sLog.outDebug("Aura %u now is remove mode %d", Aur->GetId(), mode);
+ Aur->HandleEffects(false);
- sLog.outDebug("Aura %u (%u) now is remove mode %d", Aur->GetId(), Aur->GetModifier()->m_auraname, mode);
- assert(!Aur->IsInUse());
- Aur->ApplyModifier(false,true);
-
- Aur->SetStackAmount(0);
+ // set aura to be removed during unit::_updatespells
+ m_removedAuras.push_back(Aur);
Aur->_RemoveAura();
- bool stack = false;
- spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());
- for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
- {
- if (itr->second->GetCasterGUID()==GetGUID())
- {
- stack = true;
- }
- }
- if (!stack)
- {
- // Remove all triggered by aura spells vs unlimited duration
- Aur->CleanupTriggeredSpells();
-
- // Remove Linked Auras
- uint32 id = Aur->GetId();
- if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE)
- {
- if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)id))
- for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
- if(*itr < 0)
- RemoveAurasDueToSpell(-(*itr));
- else if(Unit* caster = Aur->GetCaster())
- CastSpell(this, *itr, true, 0, 0, caster->GetGUID());
- }
- if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA)
- {
- if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
- for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
- if(*itr < 0)
- ApplySpellImmune(id, IMMUNITY_ID, -(*itr), false);
- else
- RemoveAurasDueToSpell(*itr);
- }
- }
-
- delete Aur;
-
- if(statue)
- statue->UnSummon();
-
// only way correctly remove all auras from list
- if( m_Auras.empty() )
- i = m_Auras.end();
- else
- i = m_Auras.begin();
+ i = m_Auras.begin();
}
void Unit::RemoveAllAuras()
{
+ AuraMap::iterator iter = m_Auras.begin();
while (!m_Auras.empty())
- {
- AuraMap::iterator iter = m_Auras.begin();
RemoveAura(iter);
- }
}
void Unit::RemoveArenaAuras(bool onleave)
@@ -4487,17 +4155,17 @@ void Unit::RemoveAllAurasOnDeath()
}
}
-void Unit::DelayAura(uint32 spellId, uint32 effindex, int32 delaytime)
+void Unit::DelayAura(uint32 spellId, uint64 caster, int32 delaytime)
{
- AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
- if (iter != m_Auras.end())
+ if (Aura * aur = GetAura(spellId, caster))
{
- if (iter->second->GetAuraDuration() < delaytime)
- iter->second->SetAuraDuration(0);
+ if (aur->GetAuraDuration() < delaytime)
+ aur->SetAuraDuration(0);
else
- iter->second->SetAuraDuration(iter->second->GetAuraDuration() - delaytime);
- iter->second->UpdateAuraDuration();
- sLog.outDebug("Aura %u partially interrupted on unit %u, new duration: %u ms",iter->second->GetModifier()->m_auraname, GetGUIDLow(), iter->second->GetAuraDuration());
+ aur->SetAuraDuration(aur->GetAuraDuration() - delaytime);
+ // update for out of range group members (on 1 slot use)
+ UpdateAuraForGroup(aur->GetAuraSlot());
+ sLog.outDebug("Aura %u partially interrupted on unit %u, new duration: %u ms",aur->GetId(), GetGUIDLow(), aur->GetAuraDuration());
}
}
@@ -4505,7 +4173,7 @@ void Unit::_RemoveAllAuraMods()
{
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
{
- (*i).second->ApplyModifier(false);
+ (*i).second->ApplyAllModifiers(false);
}
}
@@ -4513,15 +4181,94 @@ void Unit::_ApplyAllAuraMods()
{
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
{
- (*i).second->ApplyModifier(true);
+ (*i).second->ApplyAllModifiers(true);
}
}
-Aura* Unit::GetAura(uint32 spellId, uint32 effindex)
+bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const
{
- AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
- if (iter != m_Auras.end())
- return iter->second;
+ AuraEffectList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ if (miscvalue == (*i)->GetMiscValue())
+ return true;
+ return false;
+}
+
+bool Unit::HasAuraType(AuraType auraType) const
+{
+ return (!m_modAuras[auraType].empty());
+}
+
+bool Unit::HasAura(uint32 spellId, uint64 caster) const
+{
+ //Special case for non existing spell
+ if (spellId==61988)
+ return HasAura(61987, caster) || HasAura(25771, caster);
+
+ if (Aura * aur = GetAura(spellId, caster))
+ return true;
+ return false;
+}
+
+bool Unit::HasAura(Aura * aur) const
+{
+ // no need to find aura
+ if (!aur || aur->IsRemoved())
+ return false;
+ for(AuraMap::const_iterator iter = m_Auras.lower_bound(aur->GetId()); iter != m_Auras.upper_bound(aur->GetId());)
+ {
+ if (aur == iter->second)
+ return true;
+ else
+ ++iter;
+ }
+ return false;
+}
+
+bool Unit::HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const
+{
+ if (Aura * aur = GetAura(spellId, caster))
+ return bool(aur->HasEffect(effIndex));
+ return false;
+}
+
+Aura * Unit::GetAura(uint32 spellId, uint64 caster) const
+{
+ if (!caster)
+ {
+ AuraMap::const_iterator itr = m_Auras.find(spellId);
+ return itr != m_Auras.end() ? itr->second : NULL;
+ }
+ else
+ {
+ AuraMap const& auras = GetAuras();
+ for(AuraMap::const_iterator itr = auras.lower_bound(spellId); itr != auras.upper_bound(spellId); ++itr)
+ if(itr->second->GetCasterGUID()==caster)
+ return itr->second;
+ return NULL;
+ }
+}
+
+AuraEffect * Unit::GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const
+{
+ if (Aura * aur = GetAura(spellId, caster))
+ return aur->GetPartAura(effIndex);
+ return false;
+}
+
+AuraEffect* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID)
+{
+ AuraEffectList const& auras = GetAurasByType(type);
+ for(AuraEffectList::const_iterator i = auras.begin();i != auras.end(); ++i)
+ {
+ SpellEntry const *spell = (*i)->GetSpellProto();
+ if (spell->SpellFamilyName == family && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
+ {
+ if (casterGUID && (*i)->GetCasterGUID()!=casterGUID)
+ continue;
+ return (*i);
+ }
+ }
return NULL;
}
@@ -4598,27 +4345,54 @@ DynamicObject * Unit::GetDynObject(uint32 spellId)
return NULL;
}
+GameObject* Unit::GetGameObject(uint32 spellId) const
+{
+ for (GameObjectList::const_iterator i = m_gameObj.begin(); i != m_gameObj.end();)
+ if ((*i)->GetSpellId() == spellId)
+ return *i;
+
+ return NULL;
+}
+
void Unit::AddGameObject(GameObject* gameObj)
{
assert(gameObj && gameObj->GetOwnerGUID()==0);
m_gameObj.push_back(gameObj);
gameObj->SetOwnerGUID(GetGUID());
+
+ if ( GetTypeId()==TYPEID_PLAYER && gameObj->GetSpellId() )
+ {
+ SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId());
+ // Need disable spell use for owner
+ if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
+ // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
+ ((Player*)this)->AddSpellAndCategoryCooldowns(createBySpell,0,NULL,true);
+ }
}
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
{
assert(gameObj && gameObj->GetOwnerGUID()==GetGUID());
+ gameObj->SetOwnerGUID(0);
+
// GO created by some spell
- if ( GetTypeId()==TYPEID_PLAYER && gameObj->GetSpellId() )
+ if (uint32 spellid = gameObj->GetSpellId())
{
- SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId());
- // Need activate spell use for owner
- if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
- ((Player*)this)->SendCooldownEvent(createBySpell);
+ RemoveAurasDueToSpell(spellid);
+
+ if (GetTypeId()==TYPEID_PLAYER)
+ {
+ SpellEntry const* createBySpell = sSpellStore.LookupEntry(spellid );
+ // Need activate spell use for owner
+ if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
+ // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
+ ((Player*)this)->SendCooldownEvent(createBySpell);
+ }
}
- gameObj->SetOwnerGUID(0);
+
m_gameObj.remove(gameObj);
+
if(del)
{
gameObj->SetRespawnTime(0);
@@ -4630,7 +4404,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
{
if(m_gameObj.empty())
return;
- std::list<GameObject*>::iterator i, next;
+ GameObjectList::iterator i, next;
for (i = m_gameObj.begin(); i != m_gameObj.end(); i = next)
{
next = i;
@@ -4653,7 +4427,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
void Unit::RemoveAllGameObjects()
{
// remove references to unit
- for(std::list<GameObject*>::iterator i = m_gameObj.begin(); i != m_gameObj.end();)
+ for(GameObjectList::iterator i = m_gameObj.begin(); i != m_gameObj.end();)
{
(*i)->SetOwnerGUID(0);
(*i)->SetRespawnTime(0);
@@ -4669,6 +4443,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
data.append(log->attacker->GetPackGUID());
data << uint32(log->SpellID);
data << uint32(log->damage); //damage amount
+ data << uint32(0);
data << uint8 (log->schoolMask); //damage school
data << uint32(log->absorb); //AbsorbedDamage
data << uint32(log->resist); //resist
@@ -4688,6 +4463,7 @@ void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage,
data.append(GetPackGUID());
data << uint32(SpellID);
data << uint32(Damage-AbsorbedDamage-Resist-Blocked);
+ data << uint32(0); // wotlk
data << uint8(damageSchoolMask); // spell school
data << uint32(AbsorbedDamage); // AbsorbedDamage
data << uint32(Resist); // resist
@@ -4726,25 +4502,65 @@ void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo)
{
- WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+84)); // we guess size
+ uint32 count = 1;
+ WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
data << (uint32)damageInfo->HitInfo;
data.append(GetPackGUID());
data.append(damageInfo->target->GetPackGUID());
data << (uint32)(damageInfo->damage); // Full damage
+ data << uint32(0); // overkill value
+
+ data << (uint8)count; // Sub damage count
+
+ for(int i = 0; i < count; ++i)
+ {
+ data << (uint32)(damageInfo->damageSchoolMask); // School of sub damage
+ data << (float)damageInfo->damage; // sub damage
+ data << (uint32)damageInfo->damage; // Sub Damage
+ }
+
+ if(damageInfo->HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2))
+ {
+ for(int i = 0; i < count; ++i)
+ data << (uint32)damageInfo->absorb; // Absorb
+ }
+
+ if(damageInfo->HitInfo & (HITINFO_RESIST | HITINFO_RESIST2))
+ {
+ for(int i = 0; i < count; ++i)
+ data << (uint32)damageInfo->resist; // Resist
+ }
- data << (uint8)1; // Sub damage count
- //=== Sub damage description
- data << (uint32)(damageInfo->damageSchoolMask); // School of sub damage
- data << (float)damageInfo->damage; // sub damage
- data << (uint32)damageInfo->damage; // Sub Damage
- data << (uint32)damageInfo->absorb; // Absorb
- data << (uint32)damageInfo->resist; // Resist
- //=================================================
- data << (uint32)damageInfo->TargetState;
+ data << (uint8)damageInfo->TargetState;
data << (uint32)0;
data << (uint32)0;
- data << (uint32)damageInfo->blocked_amount;
- SendMessageToSet( &data, true );/**/
+
+ if(damageInfo->HitInfo & HITINFO_BLOCK)
+ data << (uint32)damageInfo->blocked_amount;
+
+ if(damageInfo->HitInfo & HITINFO_UNK3)
+ data << uint32(0);
+
+ if(damageInfo->HitInfo & HITINFO_UNK1)
+ {
+ data << uint32(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ for(uint8 i = 0; i < 5; ++i)
+ {
+ data << float(0);
+ data << float(0);
+ }
+ data << uint32(0);
+ }
+
+ SendMessageToSet( &data, true );
}
void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
@@ -4752,176 +4568,76 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType,
sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
WorldPacket data(SMSG_ATTACKERSTATEUPDATE, (16+45)); // we guess size
- data << (uint32)HitInfo;
+ data << uint32(HitInfo); // flags
data.append(GetPackGUID());
data.append(target->GetPackGUID());
- data << (uint32)(Damage-AbsorbDamage-Resist-BlockedAmount);
+ data << uint32(Damage-AbsorbDamage-Resist-BlockedAmount);// damage
+ data << uint32(0); // overkill value
data << (uint8)SwingType; // count?
// for(i = 0; i < SwingType; ++i)
data << (uint32)damageSchoolMask;
data << (float)(Damage-AbsorbDamage-Resist-BlockedAmount);
- // still need to double check damage
data << (uint32)(Damage-AbsorbDamage-Resist-BlockedAmount);
- data << (uint32)AbsorbDamage;
- data << (uint32)Resist;
// end loop
- data << (uint32)TargetState;
-
- if( AbsorbDamage == 0 ) //also 0x3E8 = 0x3E8, check when that happens
- data << (uint32)0;
- else
- data << (uint32)-1;
-
- data << (uint32)0;
- data << (uint32)BlockedAmount;
-
- SendMessageToSet( &data, true );
-}
-/*
-void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 damage, SpellSchoolMask damageSchoolMask, SpellEntry const *procSpell, bool isTriggeredSpell, WeaponAttackType attType)
-{
- sLog.outDebug("ProcDamageAndSpell: attacker flags are 0x%x, victim flags 0x%x", procAttacker, procVictim);
- if(procSpell)
- sLog.outDebug("ProcDamageAndSpell: invoked due to spell id %u %s", procSpell->Id, (isTriggeredSpell?"(triggered)":""));
-
- // Assign melee/ranged proc flags for magic attacks, that are actually melee/ranged abilities
- // not assign for spell proc triggered spell to prevent infinity (or unexpected 2-3 times) melee damage spell proc call with melee damage effect
- // That is the question though if it's fully correct
- if(procSpell && !isTriggeredSpell)
+ if(HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2))
{
- if(procSpell->DmgClass == SPELL_DAMAGE_CLASS_MELEE)
- {
- if(procAttacker & PROC_FLAG_HIT_SPELL) procAttacker |= PROC_FLAG_HIT_MELEE;
- if(procAttacker & PROC_FLAG_CRIT_SPELL) procAttacker |= PROC_FLAG_CRIT_MELEE;
- if(procVictim & PROC_FLAG_STRUCK_SPELL) procVictim |= PROC_FLAG_STRUCK_MELEE;
- if(procVictim & PROC_FLAG_STRUCK_CRIT_SPELL) procVictim |= PROC_FLAG_STRUCK_CRIT_MELEE;
- attType = BASE_ATTACK; // Melee abilities are assumed to be dealt with mainhand weapon
- }
- else if (procSpell->DmgClass == SPELL_DAMAGE_CLASS_RANGED)
- {
- if(procAttacker & PROC_FLAG_HIT_SPELL) procAttacker |= PROC_FLAG_HIT_RANGED;
- if(procAttacker & PROC_FLAG_CRIT_SPELL) procAttacker |= PROC_FLAG_CRIT_RANGED;
- if(procVictim & PROC_FLAG_STRUCK_SPELL) procVictim |= PROC_FLAG_STRUCK_RANGED;
- if(procVictim & PROC_FLAG_STRUCK_CRIT_SPELL) procVictim |= PROC_FLAG_STRUCK_CRIT_RANGED;
- attType = RANGED_ATTACK;
- }
+ // for(i = 0; i < SwingType; ++i)
+ data << uint32(AbsorbDamage);
+ // end loop
}
- if(damage && (procVictim & (PROC_FLAG_STRUCK_MELEE|PROC_FLAG_STRUCK_RANGED|PROC_FLAG_STRUCK_SPELL)))
- procVictim |= (PROC_FLAG_TAKE_DAMAGE|PROC_FLAG_TOUCH);
- // Not much to do if no flags are set.
- if (procAttacker)
+ if(HitInfo & (HITINFO_RESIST | HITINFO_RESIST2))
{
- // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
- ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcEffectAuraTypes,attType, procSpell, damage, damageSchoolMask);
- ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcCastAuraTypes,attType, procSpell, damage, damageSchoolMask);
+ // for(i = 0; i < SwingType; ++i)
+ data << uint32(Resist);
+ // end loop
}
- // Now go on with a victim's events'n'auras
- // Not much to do if no flags are set or there is no victim
- if(pVictim && pVictim->isAlive() && procVictim)
+ data << (uint8)TargetState;
+ data << (uint32)0;
+ data << (uint32)0;
+
+ if(HitInfo & HITINFO_BLOCK)
{
- // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set
- pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcEffectAuraTypes,attType,procSpell, damage, damageSchoolMask);
- pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcCastAuraTypes,attType,procSpell, damage, damageSchoolMask);
+ data << uint32(BlockedAmount);
}
-}
-
-void Unit::CastMeleeProcDamageAndSpell(Unit* pVictim, uint32 damage, SpellSchoolMask damageSchoolMask, WeaponAttackType attType, MeleeHitOutcome outcome, SpellEntry const *spellCasted, bool isTriggeredSpell)
-{
- if(!pVictim)
- return;
- uint32 procAttacker = PROC_FLAG_NONE;
- uint32 procVictim = PROC_FLAG_NONE;
-
- switch(outcome)
+ if(HitInfo & HITINFO_UNK3)
{
- case MELEE_HIT_EVADE:
- return;
- case MELEE_HIT_MISS:
- if(attType == BASE_ATTACK || attType == OFF_ATTACK)
- {
- procAttacker = PROC_FLAG_MISS;
- }
- break;
- case MELEE_HIT_BLOCK_CRIT:
- case MELEE_HIT_CRIT:
- if(spellCasted && attType == BASE_ATTACK)
- {
- procAttacker |= PROC_FLAG_CRIT_SPELL;
- procVictim |= PROC_FLAG_STRUCK_CRIT_SPELL;
- if ( outcome == MELEE_HIT_BLOCK_CRIT )
- {
- procVictim |= PROC_FLAG_BLOCK;
- procAttacker |= PROC_FLAG_TARGET_BLOCK;
- }
- }
- else if(attType == BASE_ATTACK || attType == OFF_ATTACK)
- {
- procAttacker = PROC_FLAG_HIT_MELEE | PROC_FLAG_CRIT_MELEE;
- procVictim = PROC_FLAG_STRUCK_MELEE | PROC_FLAG_STRUCK_CRIT_MELEE;
- }
- else
- {
- procAttacker = PROC_FLAG_HIT_RANGED | PROC_FLAG_CRIT_RANGED;
- procVictim = PROC_FLAG_STRUCK_RANGED | PROC_FLAG_STRUCK_CRIT_RANGED;
- }
- break;
- case MELEE_HIT_PARRY:
- procAttacker = PROC_FLAG_TARGET_DODGE_OR_PARRY;
- procVictim = PROC_FLAG_PARRY;
- break;
- case MELEE_HIT_BLOCK:
- procAttacker = PROC_FLAG_TARGET_BLOCK;
- procVictim = PROC_FLAG_BLOCK;
- break;
- case MELEE_HIT_DODGE:
- procAttacker = PROC_FLAG_TARGET_DODGE_OR_PARRY;
- procVictim = PROC_FLAG_DODGE;
- break;
- case MELEE_HIT_CRUSHING:
- if(attType == BASE_ATTACK || attType == OFF_ATTACK)
- {
- procAttacker = PROC_FLAG_HIT_MELEE | PROC_FLAG_CRIT_MELEE;
- procVictim = PROC_FLAG_STRUCK_MELEE | PROC_FLAG_STRUCK_CRIT_MELEE;
- }
- else
- {
- procAttacker = PROC_FLAG_HIT_RANGED | PROC_FLAG_CRIT_RANGED;
- procVictim = PROC_FLAG_STRUCK_RANGED | PROC_FLAG_STRUCK_CRIT_RANGED;
- }
- break;
- default:
- if(attType == BASE_ATTACK || attType == OFF_ATTACK)
- {
- procAttacker = PROC_FLAG_HIT_MELEE;
- procVictim = PROC_FLAG_STRUCK_MELEE;
- }
- else
- {
- procAttacker = PROC_FLAG_HIT_RANGED;
- procVictim = PROC_FLAG_STRUCK_RANGED;
- }
- break;
+ data << uint32(0);
}
- if(damage > 0)
- procVictim |= PROC_FLAG_TAKE_DAMAGE;
+ if(HitInfo & HITINFO_UNK1)
+ {
+ data << uint32(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ data << float(0);
+ for(uint8 i = 0; i < 5; ++i)
+ {
+ data << float(0);
+ data << float(0);
+ }
+ data << uint32(0);
+ }
- if(procAttacker != PROC_FLAG_NONE || procVictim != PROC_FLAG_NONE)
- ProcDamageAndSpell(pVictim, procAttacker, procVictim, damage, damageSchoolMask, spellCasted, isTriggeredSpell, attType);
-}*/
+ SendMessageToSet( &data, true );
+}
-bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown)
+bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown)
{
SpellEntry const *hasteSpell = triggeredByAura->GetSpellProto();
- Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
- ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
+ Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
+ ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
uint32 triggered_spell_id = 0;
Unit* target = pVictim;
@@ -4979,34 +4695,59 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true;
}
-bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
+bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
{
SpellEntry const *dummySpell = triggeredByAura->GetSpellProto ();
- uint32 effIndex = triggeredByAura->GetEffIndex ();
+ uint32 effIndex = triggeredByAura->GetEffIndex();
+ int32 triggerAmount = triggeredByAura->GetAmount();
- Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
- ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
+ Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
+ ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
uint32 triggered_spell_id = 0;
Unit* target = pVictim;
int32 basepoints0 = 0;
+ // Master of subtlety (checked here because ranks have different spellfamilynames)
+ if (dummySpell->Id == 31223 || dummySpell->Id == 31221 || dummySpell->Id == 31222)
+ {
+ if (procEx & AURA_REMOVE_PROC_EX_MASK)
+ triggered_spell_id = 31666;
+ else
+ {
+ triggered_spell_id = 31665;
+ basepoints0 = triggerAmount;
+ }
+ }
switch(dummySpell->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
switch (dummySpell->Id)
{
- // Eye of Eye
+ // Improved Divine Spirit
+ case 33174:
+ case 33182:
+ {
+ // Tricky thing here, we find current aura from spell by caster and change its modifier value
+ int32 spelldmg = CalculateSpellDamage(procSpell, 0, procSpell->EffectBasePoints[0],pVictim);
+ if (AuraEffect * Aur = pVictim->GetAuraEffect(procSpell->Id, effIndex+1, triggeredByAura->GetCasterGUID()))
+ {
+ // Remove aura mods
+ Aur->ApplyModifier(false);
+ Aur->SetAmount(Aur->GetAmount() + spelldmg * triggerAmount / 100);
+ // Apply extended aura mods
+ Aur->ApplyModifier(true);
+ return true;
+ }
+ return false;
+ }
+ // Eye for an Eye
case 9799:
case 25988:
{
- // prevent damage back from weapon special attacks
- if (!procSpell || procSpell->DmgClass != SPELL_DAMAGE_CLASS_MAGIC )
- return false;
-
// return damage % to attacker but < 50% own total health
- basepoints0 = triggeredByAura->GetModifier()->m_amount*int32(damage)/100;
+ basepoints0 = triggerAmount*int32(damage)/100;
if(basepoints0 > GetMaxHealth()/2)
basepoints0 = GetMaxHealth()/2;
@@ -5035,15 +4776,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (!procSpell || procSpell->Id == 24659)
return false;
// Need remove one 24659 aura
- RemoveSingleAuraFromStack(24659, 0);
- RemoveSingleAuraFromStack(24659, 1);
+ RemoveAuraFromStack(24659);
return true;
}
// Restless Strength
case 24661:
{
// Need remove one 24662 aura
- RemoveSingleAuraFromStack(24662, 0);
+ RemoveAuraFromStack(24662);
return true;
}
// Adaptive Warding (Frostfire Regalia set)
@@ -5054,12 +4794,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// find Mage Armor
bool found = false;
- AuraList const& mRegenInterupt = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
- for(AuraList::const_iterator iter = mRegenInterupt.begin(); iter != mRegenInterupt.end(); ++iter)
+ AuraEffectList const& mRegenInterupt = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT);
+ for(AuraEffectList::const_iterator iter = mRegenInterupt.begin(); iter != mRegenInterupt.end(); ++iter)
{
if(SpellEntry const* iterSpellProto = (*iter)->GetSpellProto())
{
- if(iterSpellProto->SpellFamilyName==SPELLFAMILY_MAGE && (iterSpellProto->SpellFamilyFlags & 0x10000000))
+ if(iterSpellProto->SpellFamilyName==SPELLFAMILY_MAGE && (iterSpellProto->SpellFamilyFlags[0] & 0x10000000))
{
found=true;
break;
@@ -5117,15 +4857,26 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if(!target)
return false;
- basepoints0 = int32(damage * 2.5f); // manaregen
triggered_spell_id = 34650;
break;
}
+ // Overkill
+ case 58426:
+ {
+ if (procEx & AURA_REMOVE_PROC_EX_MASK)
+ triggered_spell_id = 58428;
+ else
+ {
+ basepoints0 = -triggerAmount;
+ triggered_spell_id = 58427;
+ }
+ break;
+ }
// Mark of Malice
case 33493:
{
// Cast finish spell at last charge
- if (triggeredByAura->m_procCharges > 1)
+ if (triggeredByAura->GetParentAura()->GetAuraCharges() > 1)
return false;
target = this;
@@ -5328,6 +5079,57 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
return false;
}
+ // Living Seed
+ case 48504:
+ {
+ triggered_spell_id = 48503;
+ basepoints0 = triggerAmount;
+ target = this;
+ break;
+ }
+ // Kill command
+ case 58914:
+ {
+ // Remove aura stack from pet
+ RemoveAuraFromStack(58914);
+ Unit* owner = GetOwner();
+ if(!owner)
+ return true;
+ // reduce the owner's aura stack
+ owner->RemoveAuraFromStack(34027);
+ return true;
+ }
+ // Vampiric Touch (generic, used by some boss)
+ case 52723:
+ case 60501:
+ {
+ triggered_spell_id = 52724;
+ basepoints0 = damage / 2;
+ target = this;
+ break;
+ }
+ // Divine purpose
+ case 31871:
+ case 31872:
+ {
+ // Roll chane
+ if (!roll_chance_i(triggerAmount))
+ return false;
+
+ // Remove any stun effect on target
+ AuraMap& Auras = pVictim->GetAuras();
+ for(AuraMap::iterator iter = Auras.begin(); iter != Auras.end();)
+ {
+ SpellEntry const *spell = iter->second->GetSpellProto();
+ if( GetAllSpellMechanicMask(spell) & 1<<(MECHANIC_STUN))
+ {
+ pVictim->RemoveAura(iter);
+ }
+ else
+ ++iter;
+ }
+ return true;
+ }
}
break;
}
@@ -5340,7 +5142,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// mana reward
- basepoints0 = (triggeredByAura->GetModifier()->m_amount * GetMaxPower(POWER_MANA) / 100);
+ basepoints0 = (triggerAmount * GetMaxPower(POWER_MANA) / 100);
target = this;
triggered_spell_id = 29442;
break;
@@ -5352,7 +5154,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// mana cost save
- basepoints0 = procSpell->manaCost * triggeredByAura->GetModifier()->m_amount/100;
+ int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
+ basepoints0 = cost * triggerAmount/100;
if( basepoints0 <=0 )
return false;
@@ -5360,8 +5163,53 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 29077;
break;
}
+ // Shattered Barrier
+ if (dummySpell->SpellIconID == 2945)
+ {
+ // only on dispel/remove aura by destroy
+ target = NULL;
+ triggered_spell_id = 55080;
+ CastSpell(target, triggered_spell_id, true);
+ return true;
+ }
+ // Hot Streak
+ if (dummySpell->SpellIconID == 2999)
+ {
+ if (effIndex!=0)
+ return false;
+ AuraEffect *counter = GetAuraEffect(triggeredByAura->GetId(), 1);
+ if (!counter)
+ return true;
+
+ // Count spell criticals in a row in second aura
+ if (procEx & PROC_EX_CRITICAL_HIT)
+ {
+ counter->SetAmount(counter->GetAmount()*2);
+ if (counter->GetAmount() < 100) // not enough
+ return true;
+ // Crititcal counted -> roll chance
+ if (roll_chance_i(triggerAmount))
+ CastSpell(this, 48108, true, castItem, triggeredByAura);
+ }
+ counter->SetAmount(25);
+ return true;
+ }
+ // Burnout
+ if (dummySpell->SpellIconID == 2998)
+ {
+ if(!procSpell)
+ return false;
+
+ int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
+ basepoints0 = cost * triggerAmount/100;
+ if( basepoints0 <=0 )
+ return false;
+ triggered_spell_id = 44450;
+ target = this;
+ break;
+ }
// Incanter's Regalia set (add trigger chance to Mana Shield)
- if (dummySpell->SpellFamilyFlags & 0x0000000000008000LL)
+ if (dummySpell->SpellFamilyFlags[0] & 0x8000)
{
if(GetTypeId() != TYPEID_PLAYER)
return false;
@@ -5398,7 +5246,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 11129:
{
//last charge and crit
- if (triggeredByAura->m_procCharges <= 1 && (procEx & PROC_EX_CRITICAL_HIT) )
+ if (triggeredByAura->GetParentAura()->GetAuraCharges() <= 1 && (procEx & PROC_EX_CRITICAL_HIT) )
{
RemoveAurasDueToSpell(28682); //-> remove Combustion auras
return true; // charge counting (will removed)
@@ -5413,7 +5261,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_WARRIOR:
{
// Retaliation
- if(dummySpell->SpellFamilyFlags==0x0000000800000000LL)
+ if(dummySpell->SpellFamilyFlags.IsEqual(0, 0x8, 0))
{
// check attack comes not from behind
if (!HasInArc(M_PI, pVictim))
@@ -5422,26 +5270,51 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 22858;
break;
}
- else if (dummySpell->SpellIconID == 1697) // Second Wind
+ // Glyph of Devastate
+ if(dummySpell->Id==58388)
+ {
+ // get highest rank of the Sunder Armor spell
+ if (GetTypeId()!=TYPEID_PLAYER)
+ return false;
+ const PlayerSpellMap& sp_list = ((Player*)this)->GetSpellMap();
+ for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ {
+ // only highest rank is shown in spell book, so simply check if shown in spell book
+ if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
+ if (!spellInfo)
+ continue;
+
+ if (spellInfo->SpellFamilyFlags.IsEqual(SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR)
+ && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR)
+ {
+ triggered_spell_id = spellInfo->Id;
+ break;
+ }
+ }
+ if (!triggered_spell_id)
+ return false;
+ for (int32 value = CalculateSpellDamage(dummySpell, 0 , dummySpell->EffectBasePoints[0], pVictim);value>0;value--)
+ CastSpell(target,triggered_spell_id,true);
+ return true;
+ }
+ // Second Wind
+ if (dummySpell->SpellIconID == 1697)
{
// only for spells and hit/crit (trigger start always) and not start from self casted spells (5530 Mace Stun Effect for example)
if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == pVictim)
return false;
// Need stun or root mechanic
- if (procSpell->Mechanic != MECHANIC_ROOT && procSpell->Mechanic != MECHANIC_STUN)
- {
- int32 i;
- for (i=0; i<3; i++)
- if (procSpell->EffectMechanic[i] == MECHANIC_ROOT || procSpell->EffectMechanic[i] == MECHANIC_STUN)
- break;
- if (i == 3)
- return false;
- }
+ if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_ROOT)|(1<<MECHANIC_STUN))))
+ return false;
switch (dummySpell->Id)
{
case 29838: triggered_spell_id=29842; break;
case 29834: triggered_spell_id=29841; break;
+ case 42770: triggered_spell_id=42771; break;
default:
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)",dummySpell->Id);
return false;
@@ -5450,16 +5323,23 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = this;
break;
}
+ // Damage Shield
+ if (dummySpell->SpellIconID == 3214)
+ {
+ triggered_spell_id = 59653;
+ // % of amount blocked
+ basepoints0 = GetShieldBlockValue() * triggerAmount / 100;
+ break;
+ }
break;
}
case SPELLFAMILY_WARLOCK:
{
// Seed of Corruption
- if (dummySpell->SpellFamilyFlags & 0x0000001000000000LL)
+ if (dummySpell->SpellFamilyFlags[1] & 0x00000010)
{
- Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need or target die from damage deal finish spell
- if( mod->m_amount <= damage || GetHealth() <= damage )
+ if( triggeredByAura->GetAmount() <= damage || GetHealth() <= damage )
{
// remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID();
@@ -5474,15 +5354,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
// Damage counting
- mod->m_amount-=damage;
+ triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage);
return true;
}
// Seed of Corruption (Mobs cast) - no die req
- if (dummySpell->SpellFamilyFlags == 0x00LL && dummySpell->SpellIconID == 1932)
+ if (dummySpell->SpellFamilyFlags.IsEqual(0,0,0) && dummySpell->SpellIconID == 1932)
{
- Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need deal finish spell
- if( mod->m_amount <= damage )
+ if( triggeredByAura->GetAmount() <= damage )
{
// remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID();
@@ -5496,9 +5375,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true; // no hidden cooldown
}
// Damage counting
- mod->m_amount-=damage;
+ triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage);
return true;
}
+ // Fel Synergy
+ if (dummySpell->SpellIconID == 3222)
+ {
+ target = GetGuardianPet();
+ if (!target)
+ return false;
+ triggered_spell_id = 54181;
+ basepoints0 = damage * 15 / 100;
+ break;
+ }
switch(dummySpell->Id)
{
// Nightfall
@@ -5514,12 +5403,45 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 30295:
case 30296:
{
+ // Improved Soul Leech
+ AuraEffectList const& SoulLeechAuras = GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator i = SoulLeechAuras.begin();i != SoulLeechAuras.end(); ++i)
+ {
+ if ((*i)->GetId()==54117 || (*i)->GetId()==54118)
+ {
+ basepoints0 = int32((*i)->GetAmount());
+ if (target = GetGuardianPet())
+ {
+ // regen mana for pet
+ CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ }
+ // regen mana for caster
+ CastCustomSpell(this,59117,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ break;
+ }
+ }
// health
- basepoints0 = int32(damage*triggeredByAura->GetModifier()->m_amount/100);
+ basepoints0 = int32(damage*triggerAmount/100);
target = this;
triggered_spell_id = 30294;
break;
}
+ // Improved Fear
+ case 53754:
+ {
+ if(!pVictim || !pVictim->isAlive())
+ return false;
+ pVictim->CastSpell(pVictim, 60946,true);
+ return true;
+ }
+ // Improved Fear (Rank 2)
+ case 53759:
+ {
+ if(!pVictim || !pVictim->isAlive())
+ return false;
+ pVictim->CastSpell(pVictim, 60947,true);
+ return true;
+ }
// Shadowflame (Voidheart Raiment set bonus)
case 37377:
{
@@ -5529,12 +5451,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Pet Healing (Corruptor Raiment or Rift Stalker Armor)
case 37381:
{
- target = GetPet();
+ target = GetGuardianPet();
if(!target)
return false;
// heal amount
- basepoints0 = damage * triggeredByAura->GetModifier()->m_amount/100;
+ basepoints0 = damage * triggerAmount/100;
triggered_spell_id = 37382;
break;
}
@@ -5550,7 +5472,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_PRIEST:
{
// Vampiric Touch
- if( dummySpell->SpellFamilyFlags & 0x0000040000000000LL )
+ if( dummySpell->SpellFamilyFlags[1] & 0x00000400 )
{
if(!pVictim || !pVictim->isAlive())
return false;
@@ -5560,10 +5482,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// energize amount
- basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100;
+ basepoints0 = triggerAmount*damage/100;
pVictim->CastCustomSpell(pVictim,34919,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
return true; // no hidden cooldown
}
+ // Divine Aegis
+ if (dummySpell->SpellIconID == 2820)
+ {
+ basepoints0 = damage * triggerAmount/100;
+ triggered_spell_id = 47753;
+ break;
+ }
switch(dummySpell->Id)
{
// Vampiric Embrace
@@ -5577,18 +5506,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// heal amount
- basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100;
- pVictim->CastCustomSpell(pVictim,15290,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ int32 team = triggerAmount*damage/500;
+ int32 self = triggerAmount*damage/100 - team;
+ pVictim->CastCustomSpell(pVictim,15290,&team,&self,NULL,true,castItem,triggeredByAura);
return true; // no hidden cooldown
}
// Priest Tier 6 Trinket (Ashtongue Talisman of Acumen)
case 40438:
{
// Shadow Word: Pain
- if( procSpell->SpellFamilyFlags & 0x0000000000008000LL )
+ if( procSpell->SpellFamilyFlags[0] & 0x8000 )
triggered_spell_id = 40441;
// Renew
- else if( procSpell->SpellFamilyFlags & 0x0000000000000010LL )
+ else if( procSpell->SpellFamilyFlags[0] & 0x10 )
triggered_spell_id = 40440;
else
return false;
@@ -5596,6 +5526,39 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = this;
break;
}
+ // Glyph of Power Word: Shield
+ case 55672:
+ {
+ basepoints0 = damage * triggerAmount/100;
+ triggered_spell_id = 56160;
+ break;
+ }
+ // Psychic Horror
+ case 47571:
+ {
+ if(!pVictim || !pVictim->isAlive())
+ return false;
+ pVictim->CastSpell(pVictim, 59980,true);
+ return true;
+ }
+ // Psychic Horror (Rank 2)
+ case 47572:
+ {
+ if(!pVictim || !pVictim->isAlive())
+ return false;
+ pVictim->CastSpell(pVictim, 59981,true);
+ return true;
+ }
+ // Glyph of Dispel Magic
+ case 55677:
+ {
+ if(!target->IsFriendlyTo(this))
+ return false;
+
+ basepoints0 = int32(target->GetMaxHealth() * triggerAmount / 100);
+ triggered_spell_id = 56131;
+ break;
+ }
// Oracle Healing Bonus ("Garments of the Oracle" set)
case 26169:
{
@@ -5612,12 +5575,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// heal amount
- basepoints0 = int32(damage * 2 / 100);
+ basepoints0 = damage * triggerAmount/100;
target = this;
triggered_spell_id = 39373;
break;
}
- // Vestments of Faith (Priest Tier 3) - 4 pieces bonus
+ // Greater Heal (Vestments of Faith (Priest Tier 3) - 4 pieces bonus)
case 28809:
{
triggered_spell_id = 28810;
@@ -5630,6 +5593,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
switch(dummySpell->Id)
{
+ // Leader of the Pack
+ case 24932:
+ {
+ if (triggerAmount <= 0)
+ return false;
+ basepoints0 = triggerAmount * GetMaxHealth() / 100;
+ target = this;
+ triggered_spell_id = 34299;
+ if (triggeredByAura->GetCaster() != this)
+ break;
+ int32 basepoints1 = triggerAmount * 2;
+ CastCustomSpell(this,60889,&basepoints1,0,0,true,0,triggeredByAura);
+ break;
+ }
// Healing Touch (Dreamwalker Raiment set)
case 28719:
{
@@ -5660,19 +5637,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
float chance;
// Starfire
- if( procSpell->SpellFamilyFlags & 0x0000000000000004LL )
+ if( procSpell->SpellFamilyFlags[0] & 0x4 )
{
triggered_spell_id = 40445;
chance = 25.f;
}
// Rejuvenation
- else if( procSpell->SpellFamilyFlags & 0x0000000000000010LL )
+ else if( procSpell->SpellFamilyFlags[0] & 0x10 )
{
triggered_spell_id = 40446;
chance = 25.f;
}
// Mangle (cat/bear)
- else if( procSpell->SpellFamilyFlags & 0x0000044000000000LL )
+ else if( procSpell->SpellFamilyFlags[1] & 0x00000440)
{
triggered_spell_id = 40452;
chance = 40.f;
@@ -5694,6 +5671,39 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
}
+ // Eclipse
+ if (dummySpell->SpellIconID == 2856)
+ {
+ if (!procSpell)
+ return false;
+ // Only 0 aura can proc
+ if (effIndex!=0)
+ return false;
+ // Wrath crit
+ if (procSpell->SpellFamilyFlags[0] & 0x1)
+ {
+ if (!roll_chance_i(60))
+ return false;
+ triggered_spell_id = 48518;
+ target = this;
+ break;
+ }
+ // Starfire crit
+ if (procSpell->SpellFamilyFlags[0] & 0x4)
+ {
+ triggered_spell_id = 48517;
+ target = this;
+ break;
+ }
+ return false;
+ }
+ // Living Seed
+ else if (dummySpell->SpellIconID == 2860)
+ {
+ triggered_spell_id = 48504;
+ basepoints0 = triggerAmount * damage / 100;
+ break;
+ }
break;
}
case SPELLFAMILY_ROGUE:
@@ -5711,19 +5721,32 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
}
+ // Cut to the Chase
+ if( dummySpell->SpellIconID == 2909 )
+ {
+ // "refresh your Slice and Dice duration to its 5 combo point maximum"
+ // lookup Slice and Dice
+ if (AuraEffect * aur = GetAura(SPELL_AURA_MOD_HASTE, SPELLFAMILY_ROGUE,0x40000, 0, 0))
+ {
+ aur->GetParentAura()->SetAuraDuration(GetSpellMaxDuration(aur->GetSpellProto()));
+ return true;
+ }
+ return false;
+ }
+ // Deadly Brew
+ else if( dummySpell->SpellIconID == 2963 )
+ {
+ triggered_spell_id = 25809;
+ break;
+ }
// Quick Recovery
- if( dummySpell->SpellIconID == 2116 )
+ else if( dummySpell->SpellIconID == 2116 )
{
if(!procSpell)
return false;
- // only rogue's finishing moves (maybe need additional checks)
- if( procSpell->SpellFamilyName!=SPELLFAMILY_ROGUE ||
- (procSpell->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE) == 0)
- return false;
-
// energy cost save
- basepoints0 = procSpell->manaCost * triggeredByAura->GetModifier()->m_amount/100;
+ basepoints0 = procSpell->manaCost * triggerAmount/100;
if(basepoints0 <= 0)
return false;
@@ -5742,7 +5765,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// mana cost save
- basepoints0 = procSpell->manaCost * 40/100;
+ int32 mana = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
+ basepoints0 = mana * 40/100;
if(basepoints0 <= 0)
return false;
@@ -5750,75 +5774,142 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 34720;
break;
}
+ // Hunting Party
+ if ( dummySpell->SpellIconID == 3406 )
+ {
+ triggered_spell_id = 57669;
+ target = this;
+ break;
+ }
+ // Lock and Load
+ if ( dummySpell->SpellIconID == 3579 )
+ {
+ // Proc only from periodic (from trap activation proc another aura of this spell)
+ if (!(procFlag & PROC_FLAG_ON_DO_PERIODIC) || !roll_chance_i(triggerAmount))
+ return false;
+ triggered_spell_id = 56453;
+ target = this;
+ break;
+ }
+ // Rapid Recuperation
+ if ( dummySpell->SpellIconID == 3560 )
+ {
+ // This effect only from Rapid Killing (mana regen)
+ if (!(procSpell->SpellFamilyFlags[1] & 0x01000000))
+ return false;
+ triggered_spell_id = 56654;
+ target = this;
+ break;
+ }
break;
}
case SPELLFAMILY_PALADIN:
{
- // Seal of Righteousness - melee proc dummy
- if (dummySpell->SpellFamilyFlags&0x000000008000000LL && triggeredByAura->GetEffIndex()==0)
+ // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
+ if (dummySpell->SpellFamilyFlags[0]&0x8000000)
{
- if(GetTypeId() != TYPEID_PLAYER)
+ if (effIndex!=0)
return false;
-
- uint32 spellId;
- switch (triggeredByAura->GetId())
- {
- case 21084: spellId = 25742; break; // Rank 1
- case 20287: spellId = 25740; break; // Rank 2
- case 20288: spellId = 25739; break; // Rank 3
- case 20289: spellId = 25738; break; // Rank 4
- case 20290: spellId = 25737; break; // Rank 5
- case 20291: spellId = 25736; break; // Rank 6
- case 20292: spellId = 25735; break; // Rank 7
- case 20293: spellId = 25713; break; // Rank 8
- case 27155: spellId = 27156; break; // Rank 9
- default:
- sLog.outError("Unit::HandleDummyAuraProc: non handled possibly SoR (Id = %u)", triggeredByAura->GetId());
- return false;
- }
- Item *item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
- float speed = (item ? item->GetProto()->Delay : BASE_ATTACK_TIME)/1000.0f;
-
- float damageBasePoints;
- if(item && item->GetProto()->InventoryType == INVTYPE_2HWEAPON)
- // two hand weapon
- damageBasePoints=1.20f*triggeredByAura->GetModifier()->m_amount * 1.2f * 1.03f * speed/100.0f + 1;
- else
- // one hand weapon/no weapon
- damageBasePoints=0.85f*ceil(triggeredByAura->GetModifier()->m_amount * 1.2f * 1.03f * speed/100.0f) - 1;
-
- int32 damagePoint = int32(damageBasePoints + 0.03f * (GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE)+GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE))/2.0f) + 1;
-
- // apply damage bonuses manually
- if(damagePoint >= 0)
- damagePoint = SpellDamageBonus(pVictim, dummySpell, damagePoint, SPELL_DIRECT_DAMAGE);
-
- CastCustomSpell(pVictim,spellId,&damagePoint,NULL,NULL,true,NULL, triggeredByAura);
- return true; // no hidden cooldown
+ triggered_spell_id = 25742;
+ float ap = GetTotalAttackPowerValue(BASE_ATTACK);
+ int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
+ SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, pVictim);
+ basepoints0 = GetAttackTime(BASE_ATTACK) * int32(ap*0.022f + 0.044f * holy) / 1000;
+ break;
}
- // Seal of Blood do damage trigger
- if(dummySpell->SpellFamilyFlags & 0x0000040000000000LL)
+ // Light's Beacon - Beacon of Light
+ if ( dummySpell->Id == 53651 )
{
- switch(triggeredByAura->GetEffIndex())
+ if (Unit * caster = triggeredByAura->GetCaster())
{
- case 0:
- triggered_spell_id = 31893;
- break;
- case 1:
+ // do not proc when target of beacon of light is healed
+ if (caster == pVictim)
+ return false;
+ if (Aura * aur = caster->GetAura(53563))
{
- // damage
- damage += CalculateDamage(BASE_ATTACK, false) * 35 / 100; // add spell damage from prev effect (35%)
- basepoints0 = triggeredByAura->GetModifier()->m_amount * damage / 100;
-
- target = this;
- triggered_spell_id = 32221;
- break;
+ if (Unit * paladin = aur->GetCaster())
+ {
+ if (paladin != this)
+ return false;
+ basepoints0 = damage;
+ triggered_spell_id = 53654;
+ target = caster;
+ break;
+ }
+ else
+ {
+ pVictim->RemoveAura(triggeredByAura->GetParentAura());
+ return false;
+ }
}
}
+ else return false;
+ }
+ // Judgements of the Wise
+ if (dummySpell->SpellIconID == 3017)
+ {
+ // hardcoded amount
+ basepoints0 = 15 * GetCreatePowers(POWER_MANA)/100;
+ target = this;
+ triggered_spell_id = 31930;
+ // replenishment
+ CastSpell(this,57669,true);
+ break;
+ }
+ // Sanctified Wrath
+ if (dummySpell->SpellIconID == 3029)
+ {
+ triggered_spell_id = 57318;
+ target = this;
+ basepoints0 = triggerAmount;
+ CastCustomSpell(target,triggered_spell_id,&basepoints0,&basepoints0,NULL,true,castItem,triggeredByAura);
+ return true;
+ }
+ // Sacred Shield
+ if (dummySpell->SpellFamilyFlags[1]&0x00080000)
+ {
+ triggered_spell_id = 58597;
+ target = this;
+ break;
+ }
+ // Righteous Vengeance
+ if (dummySpell->SpellIconID == 3025)
+ {
+ // 4 damage tick
+ basepoints0 = triggerAmount*damage/400;
+ triggered_spell_id = 61840;
+ break;
+ }
+ // Sheath of Light
+ if (dummySpell->SpellIconID == 3030)
+ {
+ // 4 healing tick
+ basepoints0 = triggerAmount*damage/400;
+ triggered_spell_id = 54203;
+ break;
}
-
switch(dummySpell->Id)
{
+ // Judgement of Light
+ case 20185:
+ {
+ // Get judgement caster
+ Unit *caster = triggeredByAura->GetCaster();
+ if (!caster)
+ return false;
+ float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ int32 holy = caster->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
+ caster->SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, this);
+ basepoints0 = int32(ap*0.10f + 0.10f*holy);
+ pVictim->CastCustomSpell(pVictim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
+ return true;
+ }
+ // Judgement of Wisdom
+ case 20186:
+ {
+ pVictim->CastSpell(pVictim, 20268, true, NULL, triggeredByAura);
+ return true;
+ }
// Holy Power (Redemption Armor set)
case 28789:
{
@@ -5850,7 +5941,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
break;
}
- //Seal of Vengeance
+ // Seal of Vengeance (damage calc on apply aura)
case 31801:
{
if(effIndex != 0) // effect 1,2 used by seal unleashing code
@@ -5859,7 +5950,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 31803;
break;
}
- // Spiritual Att.
+ // Seal of Corruption
+ case 53736:
+ {
+ if(effIndex != 0) // effect 1,2 used by seal unleashing code
+ return false;
+
+ triggered_spell_id = 53742;
+ break;
+ }
+ // Spiritual Attunement
case 31785:
case 33776:
{
@@ -5868,11 +5968,45 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// heal amount
- basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100;
+ basepoints0 = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
}
+ // Seal of Blood do damage trigger
+ case 31892:
+ {
+ if (effIndex == 0) // 0 effect - is proc on enemy
+ triggered_spell_id = 31893;
+ else if (effIndex == 1) // 1 effect - is proc on self
+ {
+ // add spell damage from prev effect (27%)
+ damage += CalculateDamage(BASE_ATTACK, false) * 27 / 100;
+ basepoints0 = triggerAmount * damage / 100;
+ target = this;
+ triggered_spell_id = 32221;
+ }
+ else
+ return true;
+ break;
+ }
+ // Seal of the Martyr do damage trigger
+ case 53720:
+ {
+ if (effIndex == 0) // 0 effect - is proc on enemy
+ triggered_spell_id = 53719;
+ else if (effIndex == 1) // 1 effect - is proc on self
+ {
+ // add spell damage from prev effect (27%)
+ damage += CalculateDamage(BASE_ATTACK, false) * 27 / 100;
+ basepoints0 = triggerAmount * damage / 100;
+ target = this;
+ triggered_spell_id = 53718;
+ }
+ else
+ return true;
+ break;
+ }
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470:
{
@@ -5882,13 +6016,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
float chance;
// Flash of light/Holy light
- if( procSpell->SpellFamilyFlags & 0x00000000C0000000LL)
+ if( procSpell->SpellFamilyFlags[0] & 0xC0000000)
{
triggered_spell_id = 40471;
chance = 15.f;
}
// Judgement
- else if( procSpell->SpellFamilyFlags & 0x0000000000800000LL )
+ else if( procSpell->SpellFamilyFlags[0] & 0x800000 )
{
triggered_spell_id = 40472;
chance = 50.f;
@@ -5901,6 +6035,33 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
+ // Glyph of Divinity
+ case 54939:
+ {
+ // Lookup base amount mana restore
+ for (int i=0; i<3;i++)
+ if (procSpell->Effect[i] == SPELL_EFFECT_ENERGIZE)
+ {
+ int32 mana = procSpell->EffectBasePoints[i];
+ CastCustomSpell(this, 54986, 0, &mana, 0, true, castItem, triggeredByAura);
+ break;
+ }
+ return true;
+ }
+ // Glyph of Flash of Light
+ case 54936:
+ {
+ triggered_spell_id = 54957;
+ basepoints0 = triggerAmount*damage/100;
+ break;
+ }
+ // Glyph of Holy Light
+ case 54937:
+ {
+ triggered_spell_id = 54968;
+ basepoints0 = triggerAmount*damage/100;
+ break;
+ }
}
break;
}
@@ -5908,6 +6069,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
switch(dummySpell->Id)
{
+ // Improved fire nova totem
+ case 16544:
+ {
+ triggered_spell_id = 16086;
+ break;
+ }
+ // Tidal Force
+ case 55198:
+ {
+ // Remove aura stack from caster
+ RemoveAuraFromStack(55166);
+ // drop charges
+ return false;
+ }
// Totemic Power (The Earthshatterer set)
case 28823:
{
@@ -5959,14 +6134,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if( cooldown && ((Player*)this)->HasSpellCooldown(dummySpell->Id))
return false;
+ // Now amount of extra power stored in 1 effect of Enchant spell
+ // Get it by item enchant id
uint32 spellId;
switch (castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)))
{
- case 283: spellId = 33757; break; //1 Rank
- case 284: spellId = 33756; break; //2 Rank
- case 525: spellId = 33755; break; //3 Rank
- case 1669:spellId = 33754; break; //4 Rank
- case 2636:spellId = 33727; break; //5 Rank
+ case 283: spellId = 8232; break; // 1 Rank
+ case 284: spellId = 8235; break; // 2 Rank
+ case 525: spellId = 10486; break; // 3 Rank
+ case 1669:spellId = 16362; break; // 4 Rank
+ case 2636:spellId = 25505; break; // 5 Rank
+ case 3785:spellId = 58801; break; // 6 Rank
+ case 3786:spellId = 58803; break; // 7 Rank
+ case 3787:spellId = 58804; break; // 8 Rank
default:
{
sLog.outError("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
@@ -5982,7 +6162,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
}
- int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry,0,windfurySpellEntry->EffectBasePoints[0],pVictim);
+ int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry, 1, windfurySpellEntry->EffectBasePoints[1], pVictim);
// Off-Hand case
if ( castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND )
@@ -6016,17 +6196,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
float chance;
- if (procSpell->SpellFamilyFlags & 0x0000000000000001LL)
+ if (procSpell->SpellFamilyFlags[0] & 0x1)
{
triggered_spell_id = 40465; // Lightning Bolt
chance = 15.f;
}
- else if (procSpell->SpellFamilyFlags & 0x0000000000000080LL)
+ else if (procSpell->SpellFamilyFlags[0] & 0x80)
{
triggered_spell_id = 40465; // Lesser Healing Wave
chance = 10.f;
}
- else if (procSpell->SpellFamilyFlags & 0x0000001000000000LL)
+ else if (procSpell->SpellFamilyFlags[1] & 0x00000010)
{
triggered_spell_id = 40466; // Stormstrike
chance = 50.f;
@@ -6040,20 +6220,69 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = this;
break;
}
+ // Glyph of Healing Wave
+ case 55440:
+ {
+ // Not proc from self heals
+ if (this==pVictim)
+ return false;
+ basepoints0 = triggerAmount * damage / 100;
+ target = this;
+ triggered_spell_id = 55533;
+ break;
+ }
+ // Spirit Hunt
+ case 58877:
+ {
+ // Cast on owner
+ target = GetOwner();
+ if(!target)
+ return false;
+ basepoints0 = triggerAmount * damage / 100;
+ triggered_spell_id = 58879;
+ break;
+ }
+ }
+ // Ancestral Awakening
+ if (dummySpell->SpellIconID == 3065)
+ {
+ // TODO: frite dummy fot triggered spell
+ triggered_spell_id = 52759;
+ basepoints0 = triggerAmount * damage / 100;
+ target = this;
+ break;
}
-
// Earth Shield
- if(dummySpell->SpellFamilyFlags==0x40000000000LL)
+ if(dummySpell->SpellFamilyFlags[1] & 0x00000400)
{
- if(GetTypeId() != TYPEID_PLAYER)
- return false;
-
- // heal
- basepoints0 = triggeredByAura->GetModifier()->m_amount;
+ basepoints0 = triggerAmount;
target = this;
triggered_spell_id = 379;
break;
}
+ // Improved Water Shield
+ if (dummySpell->SpellIconID == 2287)
+ {
+ // Lesser Healing Wave need aditional 60% roll
+ if (procSpell->SpellFamilyFlags[0] & 0x80 && !roll_chance_i(60))
+ return false;
+ // lookup water shield
+ AuraEffectList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
+ for(AuraEffectList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr)
+ {
+ if( (*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN &&
+ (*itr)->GetSpellProto()->SpellFamilyFlags[1] & 0x00000020)
+ {
+ uint32 spell = (*itr)->GetSpellProto()->EffectTriggerSpell[(*itr)->GetEffIndex()];
+ CastSpell(this, spell, true, castItem, triggeredByAura);
+ if ((*itr)->GetParentAura()->DropAuraCharge())
+ RemoveAurasDueToSpell((*itr)->GetId());
+ return true;
+ }
+ }
+ return false;
+ break;
+ }
// Lightning Overload
if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
{
@@ -6081,6 +6310,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 15208: spellId = 45294; break; // Rank 10
case 25448: spellId = 45295; break; // Rank 11
case 25449: spellId = 45296; break; // Rank 12
+ case 49237: spellId = 49239; break; // Rank 13
+ case 49238: spellId = 49240; break; // Rank 14
// Chain Lightning
case 421: spellId = 45297; break; // Rank 1
case 930: spellId = 45298; break; // Rank 2
@@ -6088,40 +6319,148 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 10605: spellId = 45300; break; // Rank 4
case 25439: spellId = 45301; break; // Rank 5
case 25442: spellId = 45302; break; // Rank 6
+ case 49268: spellId = 49270; break; // Rank 7
+ case 49269: spellId = 49271; break; // Rank 8
default:
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
return false;
}
- // No thread generated mod
- SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_THREAT;
- mod->value = -100;
- mod->type = SPELLMOD_PCT;
- mod->spellId = dummySpell->Id;
- mod->effectId = 0;
- mod->lastAffected = NULL;
- mod->mask = 0x0000000000000003LL;
- mod->charges = 0;
- ((Player*)this)->AddSpellMod(mod, true);
-
- // Remove cooldown (Chain Lightning - have Category Recovery time)
- if (procSpell->SpellFamilyFlags & 0x0000000000000002LL)
- ((Player*)this)->RemoveSpellCooldown(spellId);
-
- // Hmmm.. in most case spells already set half basepoints but...
- // Lightning Bolt (2-10 rank) have full basepoint and half bonus from level
- // As on wiki:
- // BUG: Rank 2 to 10 (and maybe 11) of Lightning Bolt will proc another Bolt with FULL damage (not halved). This bug is known and will probably be fixed soon.
- // So - no add changes :)
- CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
+ // Apply spellmod
+ CastSpell(this, 39805, true, castItem, triggeredByAura);
- ((Player*)this)->AddSpellMod(mod, false);
-
- if( cooldown && GetTypeId()==TYPEID_PLAYER )
- ((Player*)this)->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown);
+ CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
return true;
}
+ // Static Shock
+ if(dummySpell->SpellIconID == 3059)
+ {
+ // lookup Lightning Shield
+ AuraEffectList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
+ for(AuraEffectList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr)
+ {
+ if( (*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN &&
+ (*itr)->GetSpellProto()->SpellFamilyFlags[0] & 0x400)
+ {
+ uint32 spell = 0;
+ switch ((*itr)->GetId())
+ {
+ case 324: spell = 26364; break;
+ case 325: spell = 26365; break;
+ case 905: spell = 26366; break;
+ case 945: spell = 26367; break;
+ case 8134: spell = 26369; break;
+ case 10431: spell = 26370; break;
+ case 10432: spell = 26363; break;
+ case 25469: spell = 26371; break;
+ case 25472: spell = 26372; break;
+ case 49280: spell = 49278; break;
+ case 49281: spell = 49279; break;
+ default:
+ return false;
+ }
+ CastSpell(this, spell, true, castItem, triggeredByAura);
+ if ((*itr)->GetParentAura()->DropAuraCharge())
+ RemoveAurasDueToSpell((*itr)->GetId());
+ return true;
+ }
+ }
+ return false;
+ break;
+ }
+ break;
+ }
+ case SPELLFAMILY_DEATHKNIGHT:
+ {
+ // Blood Aura
+ if (dummySpell->SpellIconID == 2636)
+ {
+ if (GetTypeId() != TYPEID_PLAYER || !((Player*)this)->isHonorOrXPTarget(pVictim))
+ return false;
+ basepoints0 = triggerAmount * damage / 100;
+ triggered_spell_id = 53168;
+ break;
+ }
+ // Butchery
+ if (dummySpell->SpellIconID == 2664)
+ {
+ basepoints0 = triggerAmount;
+ triggered_spell_id = 50163;
+ target = this;
+ break;
+ }
+ // Dancing Rune Weapon
+ if (dummySpell->Id == 49028)
+ {
+ // 1 dummy aura for dismiss rune blade
+ if (effIndex!=2)
+ return false;
+ // TODO: wite script for this "fights on its own, doing the same attacks"
+ // NOTE: Trigger here on every attack and spell cast
+ return false;
+ }
+ // Mark of Blood
+ if (dummySpell->Id == 49005)
+ {
+ // TODO: need more info (cooldowns/PPM)
+ triggered_spell_id = 50424;
+ break;
+ }
+ // Vendetta
+ if (dummySpell->SpellFamilyFlags[0] & 0x10000)
+ {
+ basepoints0 = triggerAmount * GetMaxHealth() / 100;
+ triggered_spell_id = 50181;
+ target = this;
+ break;
+ }
+ // Necrosis
+ if (dummySpell->SpellIconID == 2709)
+ {
+ basepoints0 = triggerAmount * damage / 100;
+ triggered_spell_id = 51460;
+ break;
+ }
+ // Runic Power Back on Snare/Root
+ if (dummySpell->Id == 61257)
+ {
+ // only for spells and hit/crit (trigger start always) and not start from self casted spells
+ if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == pVictim)
+ return false;
+ // Need snare or root mechanic
+ if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_ROOT)|(1<<MECHANIC_SNARE))))
+ return false;
+ triggered_spell_id = 61258;
+ target = this;
+ break;
+ }
+ // Wandering Plague
+ if (dummySpell->SpellIconID == 1614)
+ {
+ if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, pVictim)))
+ return false;
+ basepoints0 = triggerAmount * damage / 100;
+ triggered_spell_id = 50526;
+ break;
+ }
+ // Death Strike healing effect
+ if (dummySpell->Id == 45469)
+ {
+ uint8 n=0;
+ Unit::AuraEffectList const& decSpeedList = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
+ {
+ if((*iter)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DEATHKNIGHT
+ && (*iter)->GetCasterGUID() == GetGUID()
+ && (*iter)->GetSpellProto()->Dispel == DISPEL_DISEASE)
+ {
+ n++;
+ }
+ }
+ int32 heal=0.5f*n*damage+damage;
+ CastCustomSpell(this,45470,&heal,NULL,NULL,true);
+ return true;
+ }
break;
}
case SPELLFAMILY_POTION:
@@ -6140,13 +6479,35 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
triggered_spell_id = 21400;
}
- else continue;
+ else
+ continue;
+
basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f;
CastCustomSpell(this,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
}
return true;
}
}
+ break;
+ }
+ case SPELLFAMILY_PET:
+ {
+ // improved cower
+ if (dummySpell->SpellIconID == 958 && procSpell->SpellIconID == 958)
+ {
+ triggered_spell_id = dummySpell->Id == 53180 ? 54200 : 54201;
+ target = this;
+ break;
+ }
+ // guard dog
+ if (dummySpell->SpellIconID == 201 && procSpell->SpellIconID == 201)
+ {
+ triggered_spell_id = 54445;
+ target = this;
+ pVictim->AddThreat(this,procSpell->EffectBasePoints[0]*triggerAmount/100);
+ break;
+ }
+ break;
}
default:
break;
@@ -6181,1172 +6542,570 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true;
}
-/*
-bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attackType, uint32 cooldown)
+
+bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
{
- SpellEntry const* auraSpellInfo = triggeredByAura->GetSpellProto();
+ SpellEntry const *dummySpell = triggeredByAura->GetSpellProto ();
+ uint32 effIndex = triggeredByAura->GetEffIndex();
+ int32 triggerAmount = triggeredByAura->GetAmount();
- Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
- ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
+ Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
+ ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
- uint32 triggered_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()];
- Unit* target = !(procFlags & PROC_FLAG_HEAL) && IsPositiveSpell(triggered_spell_id) ? this : pVictim;
+ uint32 triggered_spell_id = 0;
+ Unit* target = pVictim;
int32 basepoints0 = 0;
- switch(auraSpellInfo->SpellFamilyName)
+ switch(dummySpell->SpellFamilyName)
{
- case SPELLFAMILY_GENERIC:
+ case SPELLFAMILY_HUNTER:
{
- switch(auraSpellInfo->Id)
+ // Aspect of the Viper
+ if ( dummySpell->SpellFamilyFlags[1] & 0x40000 )
{
- // Aegis of Preservation
- case 23780:
- //Aegis Heal (instead non-existed triggered spell)
- triggered_spell_id = 23781;
- target = this;
- break;
- // Elune's Touch (moonkin mana restore)
- case 24905:
- {
- // Elune's Touch (instead non-existed triggered spell)
- triggered_spell_id = 33926;
- basepoints0 = int32(0.3f * GetTotalAttackPowerValue(BASE_ATTACK));
- target = this;
+ uint32 maxmana = GetMaxPower(POWER_MANA);
+ basepoints0 = maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f;
+
+ target = this;
+ triggered_spell_id = 34075;
+ break;
+ }
+ break;
+ }
+ }
+ // processed charge only counting case
+ if(!triggered_spell_id)
+ return true;
+
+ SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
+
+ if(!triggerEntry)
+ {
+ sLog.outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id);
+ return false;
+ }
+
+ // default case
+ if(!target || target!=this && !target->isAlive())
+ return false;
+
+ if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
+ return false;
+
+ if(basepoints0)
+ CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ else
+ CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
+
+ if( cooldown && GetTypeId()==TYPEID_PLAYER )
+ ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
+
+ return true;
+}
+
+bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown)
+{
+ // Get triggered aura spell info
+ SpellEntry const* auraSpellInfo = triggeredByAura->GetSpellProto();
+
+ // Basepoints of trigger aura
+ int32 triggerAmount = triggeredByAura->GetAmount();
+
+ // Set trigger spell id, target, custom basepoints
+ uint32 trigger_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()];
+ Unit* target = NULL;
+ int32 basepoints0 = 0;
+
+ if(triggeredByAura->GetAuraName() == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE)
+ basepoints0 = triggerAmount;
+
+ Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
+ ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
+
+ // Try handle unknown trigger spells
+ if (sSpellStore.LookupEntry(trigger_spell_id)==NULL)
+ {
+ switch (auraSpellInfo->SpellFamilyName)
+ {
+ case SPELLFAMILY_GENERIC:
+ //if (auraSpellInfo->Id==59532) // Abandon Passengers on Poly
+ //if (auraSpellInfo->Id==54775) // Abandon Vehicle on Poly
+ //if (auraSpellInfo->Id==34082) // Advantaged State (DND)
+ if (auraSpellInfo->Id == 23780) // Aegis of Preservation (Aegis of Preservation trinket)
+ trigger_spell_id = 23781;
+ //else if (auraSpellInfo->Id==43504) // Alterac Valley OnKill Proc Aura
+ //else if (auraSpellInfo->Id == 48876) // Beast's Mark
+ //{
+ // trigger_spell_id = 48877;
+ //}
+ //else if (auraSpellInfo->Id == 59237) // Beast's Mark
+ //{
+ // trigger_spell_id = 59233;
+ //}
+ //else if (auraSpellInfo->Id==46939) // Black Bow of the Betrayer
+ //{
+ // trigger_spell_id = 29471; // gain mana
+ // 27526; // drain mana if possible
+ //}
+ //else if (auraSpellInfo->Id==50844) // Blood Mirror
+ //else if (auraSpellInfo->Id==54476) // Blood Presence
+ //else if (auraSpellInfo->Id==50689) // Blood Presence (Rank 1)
+ //else if (auraSpellInfo->Id==37030) // Chaotic Temperament
+ //else if (auraSpellInfo->Id==52856) // Charge
+ else if (auraSpellInfo->Id==43820) // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
+ {
+ // Pct value stored in dummy
+ basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100;
+ target = pVictim;
break;
}
- // Enlightenment
- case 29601:
- {
- // only for cast with mana price
- if(!procSpell || procSpell->powerType!=POWER_MANA || procSpell->manaCost==0 && procSpell->ManaCostPercentage==0 && procSpell->manaCostPerlevel==0)
- return false;
- break; // fall through to normal cast
+ //else if (auraSpellInfo->Id==41248) // Consuming Strikes
+ // trigger_spell_id = 41249;
+ //else if (auraSpellInfo->Id==45205) // Copy Offhand Weapon
+ //else if (auraSpellInfo->Id==57594) // Copy Ranged Weapon
+ //else if (auraSpellInfo->Id==41054) // Copy Weapon
+ // trigger_spell_id = 41055;
+ //else if (auraSpellInfo->Id==45343) // Dark Flame Aura
+ //else if (auraSpellInfo->Id==47300) // Dark Flame Aura
+ else if (auraSpellInfo->Id==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;stat = GetStat(STAT_SPIRIT); }
}
- // Health Restore
- case 33510:
+ //else if (auraSpellInfo->Id==31255) // Deadly Swiftness (Rank 1)
+ //else if (auraSpellInfo->Id==5301) // Defensive State (DND)
+ //else if (auraSpellInfo->Id==13358) // Defensive State (DND)
+ //else if (auraSpellInfo->Id==16092) // Defensive State (DND)
+ //else if (auraSpellInfo->Id==24949) // Defensive State 2 (DND)
+ //else if (auraSpellInfo->Id==40329) // Demo Shout Sensor
+ else if (auraSpellInfo->Id == 33896) // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher)
+ trigger_spell_id = 33898;
+ //else if (auraSpellInfo->Id==18943) // Double Attack
+ //else if (auraSpellInfo->Id==19194) // Double Attack
+ //else if (auraSpellInfo->Id==19817) // Double Attack
+ //else if (auraSpellInfo->Id==19818) // Double Attack
+ //else if (auraSpellInfo->Id==22835) // Drunken Rage
+ // trigger_spell_id = 14822;
+ /*
+ else if (auraSpellInfo->SpellIconID==191) // Elemental Response
{
- // at melee hit call std triggered spell
- if(procFlags & PROC_FLAG_HIT_MELEE)
- break; // fall through to normal cast
-
- // Mark of Conquest - else (at range hit) called custom case
- triggered_spell_id = 39557;
- target = this;
- break;
+ switch (auraSpellInfo->Id && auraSpellInfo->AttributesEx==0)
+ {
+ case 34191:
+ case 34329:
+ case 34524:
+ case 34582:
+ case 36733:
+ break;
+ default:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Elemental Response",auraSpellInfo->Id);
+ return false;
+ }
+ //This generic aura self-triggers a different spell for each school of magic that lands on the wearer:
+ switch (procSpell->School)
+ {
+ case SPELL_SCHOOL_FIRE: trigger_spell_id = 34192; break;
+ case SPELL_SCHOOL_FROST: trigger_spell_id = 34193; break;
+ case SPELL_SCHOOL_ARCANE:trigger_spell_id = 34194; break;
+ case SPELL_SCHOOL_NATURE:trigger_spell_id = 34195; break;
+ case SPELL_SCHOOL_SHADOW:trigger_spell_id = 34196; break;
+ case SPELL_SCHOOL_HOLY: trigger_spell_id = 34197; break;
+ case SPELL_SCHOOL_NORMAL:trigger_spell_id = 34198; break;
+ default:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u Elemental Response wrong school",auraSpellInfo->Id);
+ return false;
+ }
}
- // Shaleskin
- case 36576:
- return true; // nothing to do
- // Forgotten Knowledge (Blade of Wizardry)
- case 38319:
- // only for harmful enemy targeted spell
- if(!pVictim || pVictim==this || !procSpell || IsPositiveSpell(procSpell->Id))
- return false;
- break; // fall through to normal cast
- // Aura of Wrath (Darkmoon Card: Wrath trinket bonus)
- case 39442:
- {
- // proc only at non-crit hits
- if(procFlags & (PROC_FLAG_CRIT_MELEE|PROC_FLAG_CRIT_RANGED|PROC_FLAG_CRIT_SPELL))
- return false;
- break; // fall through to normal cast
+ */
+ //else if (auraSpellInfo->Id==40364) // Entangling Roots Sensor
+ //else if (auraSpellInfo->Id==33207) // Gossip NPC Periodic - Fidget
+ //else if (auraSpellInfo->Id==50051) // Ethereal Pet Aura
+ //else if (auraSpellInfo->Id==35321) // Gushing Wound
+ //else if (auraSpellInfo->Id==38363) // Gushing Wound
+ //else if (auraSpellInfo->Id==39215) // Gushing Wound
+ //else if (auraSpellInfo->Id==44527) // Hate Monster (Spar Buddy) (30 sec)
+ //else if (auraSpellInfo->Id==44819) // Hate Monster (Spar Buddy) (>30% Health)
+ //else if (auraSpellInfo->Id==44526) // Hate Monster (Spar) (30 sec)
+ //else if (auraSpellInfo->Id==44820) // Hate Monster (Spar) (<30%)
+ //else if (auraSpellInfo->Id==49059) // Horde, Hate Monster (Spar Buddy) (>30% Health)
+ //else if (auraSpellInfo->Id==40250) // Improved Duration
+ //else if (auraSpellInfo->Id==59288) // Infra-Green Shield
+ //else if (auraSpellInfo->Id==54072) // Knockback Ball Passive
+ else if (auraSpellInfo->Id==27522 || auraSpellInfo->Id==40336)
+ // Mana Drain Trigger
+ {
+ // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target.
+ if (this && this->isAlive())
+ CastSpell(this, 29471, true, castItem, triggeredByAura);
+ if (pVictim && pVictim->isAlive())
+ CastSpell(pVictim, 27526, true, castItem, triggeredByAura);
+ return true;
}
- // Augment Pain (Timbal's Focusing Crystal trinket bonus)
- case 45054:
+ //else if (auraSpellInfo->Id==55580) // Mana Link
+ //else if (auraSpellInfo->Id==45903) // Offensive State
+ //else if (auraSpellInfo->Id==44326) // Pure Energy Passive
+ //else if (auraSpellInfo->Id==43453) // Rune Ward
+ //else if (auraSpellInfo->Id== 7137) // Shadow Charge (Rank 1)
+ //else if (auraSpellInfo->Id==36576) // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger
+ //else if (auraSpellInfo->Id==34783) // Spell Reflection
+ //else if (auraSpellInfo->Id==36096) // Spell Reflection
+ //else if (auraSpellInfo->Id==57587) // Steal Ranged ()
+ //else if (auraSpellInfo->Id==36207) // Steal Weapon
+ //else if (auraSpellInfo->Id== 7377) // Take Immune Periodic Damage <Not Working>
+ //else if (auraSpellInfo->Id==35205) // Vanish
+ //else if (auraSpellInfo->Id==42730) // Woe Strike
+ //else if (auraSpellInfo->Id==59735) // Woe Strike
+ //else if (auraSpellInfo->Id==46146) // [PH] Ahune Spanky Hands
+ break;
+ case SPELLFAMILY_MAGE:
+ if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed
{
- if(!procSpell)
- return false;
-
- //only periodic damage can trigger spell
- bool found = false;
- for(int j = 0; j < 3; ++j)
+ switch (auraSpellInfo->Id)
{
- if( procSpell->EffectApplyAuraName[j]==SPELL_AURA_PERIODIC_DAMAGE ||
- procSpell->EffectApplyAuraName[j]==SPELL_AURA_PERIODIC_DAMAGE_PERCENT ||
- procSpell->EffectApplyAuraName[j]==SPELL_AURA_PERIODIC_LEECH )
- {
- found = true;
+ case 31641: // Rank 1
+ case 31642: // Rank 2
+ trigger_spell_id = 31643;
break;
- }
+ default:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id);
+ return false;
}
- if(!found)
- return false;
-
- break; // fall through to normal cast
}
- // Evasive Maneuvers (Commendation of Kael'thas)
- case 45057:
+ break;
+ case SPELLFAMILY_WARRIOR:
+ if (auraSpellInfo->Id == 50421) // Scent of Blood
+ trigger_spell_id = 50422;
+ break;
+ case SPELLFAMILY_WARLOCK:
+ {
+ // Pyroclasm
+ if (auraSpellInfo->SpellIconID == 1137)
{
- // damage taken that reduces below 35% health
- // does NOT mean you must have been >= 35% before
- if (int32(GetHealth())-int32(damage) >= int32(GetMaxHealth()*0.35f))
+ if(!pVictim || !pVictim->isAlive() || pVictim == this || procSpell == NULL)
+ return false;
+ // Calculate spell tick count for spells
+ uint32 tick = 1; // Default tick = 1
+
+ // Hellfire have 15 tick
+ if (procSpell->SpellFamilyFlags[0]&0x40)
+ tick = 15;
+ // Rain of Fire have 4 tick
+ else if (procSpell->SpellFamilyFlags[0]&0x20)
+ tick = 4;
+ else
return false;
- break; // fall through to normal cast
- }
- }
- switch(triggered_spell_id)
- {
- // Setup
- case 15250:
- {
- // applied only for main target
- if(!pVictim || pVictim != getVictim())
+ // Calculate chance = baseChance / tick
+ float chance = 0;
+ switch (auraSpellInfo->Id)
+ {
+ case 18096: chance = 13.0f / tick; break;
+ case 18073: chance = 26.0f / tick; break;
+ }
+ // Roll chance
+ if (!roll_chance_f(chance))
return false;
- // continue normal case
- break;
+ trigger_spell_id = 18093;
}
- // Shamanistic Rage triggered spell
- case 30824:
- basepoints0 = int32(GetTotalAttackPowerValue(BASE_ATTACK)*triggeredByAura->GetModifier()->m_amount/100);
- break;
- }
- break;
- }
- case SPELLFAMILY_MAGE:
- {
- switch(auraSpellInfo->SpellIconID)
- {
- // Blazing Speed
- case 2127:
- //Blazing Speed (instead non-existed triggered spell)
- triggered_spell_id = 31643;
- target = this;
- break;
- }
- switch(auraSpellInfo->Id)
- {
- // Persistent Shield (Scarab Brooch)
- case 26467:
- basepoints0 = int32(damage * 0.15f);
- break;
- }
- break;
- }
- case SPELLFAMILY_WARRIOR:
- {
- //Rampage
- if((auraSpellInfo->SpellFamilyFlags & 0x100000) && auraSpellInfo->SpellIconID==2006)
- {
- //all ranks have effect[0]==AURA (Proc Trigger Spell, non-existed)
- //and effect[1]==TriggerSpell
- if(auraSpellInfo->Effect[1]!=SPELL_EFFECT_TRIGGER_SPELL)
+ // Drain Soul
+ else if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000)
{
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u have wrong effect in RM",triggeredByAura->GetSpellProto()->Id);
- return false;
- }
- triggered_spell_id = auraSpellInfo->EffectTriggerSpell[1];
- break; // fall through to normal cast
- }
- break;
- }
- case SPELLFAMILY_WARLOCK:
- {
- // Pyroclasm
- if(auraSpellInfo->SpellFamilyFlags == 0x0000000000000000 && auraSpellInfo->SpellIconID==1137)
- {
- // last case for Hellfire that damage caster also but don't must stun caster
- if( pVictim == this )
+ Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
+ for(Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
+ {
+ if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113)
+ {
+ int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this);
+ // Drain Soul
+ CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
+ break;
+ }
+ }
+ // Not remove charge (aura removed on death in any cases)
+ // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
return false;
-
- // custom chance
- float chance = 0;
- switch (triggeredByAura->GetId())
- {
- case 18096: chance = 13.0f; break;
- case 18073: chance = 26.0f; break;
}
- if (!roll_chance_f(chance))
- return false;
-
- // Pyroclasm (instead non-existed triggered spell)
- triggered_spell_id = 18093;
- target = pVictim;
- break;
- }
- // Drain Soul
- if(auraSpellInfo->SpellFamilyFlags & 0x0000000000004000)
- {
- bool found = false;
- Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
- for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
+ // Nether Protection
+ else if (auraSpellInfo->SpellIconID == 1985)
{
- //Improved Drain Soul
- if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113)
+ if (!procSpell)
+ return false;
+ switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell)))
{
- int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this);
- basepoints0 = value2 * GetMaxPower(POWER_MANA) / 100;
- // Drain Soul
- CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
- break;
+ case SPELL_SCHOOL_NORMAL:
+ case SPELL_SCHOOL_HOLY:
+ return false; // ignore
+ 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;
}
}
- // Not remove charge (aura removed on death in any cases)
- // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
- return false;
+ break;
}
- break;
- }
- case SPELLFAMILY_PRIEST:
- {
- //Blessed Recovery
- if(auraSpellInfo->SpellFamilyFlags == 0x00000000LL && auraSpellInfo->SpellIconID==1875)
+ case SPELLFAMILY_PRIEST:
{
- switch (triggeredByAura->GetSpellProto()->Id)
+ // Greater Heal Refund
+ if (auraSpellInfo->Id==37594)
+ trigger_spell_id = 37595;
+ // Blessed Recovery
+ else if (auraSpellInfo->SpellIconID == 1875)
{
- case 27811: triggered_spell_id = 27813; break;
- case 27815: triggered_spell_id = 27817; break;
- case 27816: triggered_spell_id = 27818; break;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR",triggeredByAura->GetSpellProto()->Id);
- return false;
- }
-
- int32 heal_amount = damage * triggeredByAura->GetModifier()->m_amount / 100;
- basepoints0 = heal_amount/3;
- target = this;
- break;
- }
- // Shadowguard
- if((auraSpellInfo->SpellFamilyFlags & 0x80000000LL) && auraSpellInfo->SpellVisual==7958)
- {
- switch(triggeredByAura->GetSpellProto()->Id)
- {
- case 18137:
- triggered_spell_id = 28377; break; // Rank 1
- case 19308:
- triggered_spell_id = 28378; break; // Rank 2
- case 19309:
- triggered_spell_id = 28379; break; // Rank 3
- case 19310:
- triggered_spell_id = 28380; break; // Rank 4
- case 19311:
- triggered_spell_id = 28381; break; // Rank 5
- case 19312:
- triggered_spell_id = 28382; break; // Rank 6
- case 25477:
- triggered_spell_id = 28385; break; // Rank 7
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in SG",triggeredByAura->GetSpellProto()->Id);
+ 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:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
return false;
+ }
+ basepoints0 = damage * triggerAmount / 100 / 3;
+ target = this;
}
- target = pVictim;
break;
}
- break;
- }
- case SPELLFAMILY_DRUID:
- {
- switch(auraSpellInfo->Id)
+ case SPELLFAMILY_DRUID:
{
- // Leader of the Pack (triggering Improved Leader of the Pack heal)
- case 24932:
- {
- if (triggeredByAura->GetModifier()->m_amount == 0)
- return false;
- basepoints0 = triggeredByAura->GetModifier()->m_amount * GetMaxHealth() / 100;
- triggered_spell_id = 34299;
- break;
- };
- // Druid Forms Trinket (Druid Tier5 Trinket, triggers different spells per Form)
- case 37336:
+ // Druid Forms Trinket
+ if (auraSpellInfo->Id==37336)
{
switch(m_form)
{
+ case FORM_NONE: trigger_spell_id = 37344;break;
+ case FORM_CAT: trigger_spell_id = 37341;break;
case FORM_BEAR:
- case FORM_DIREBEAR:
- triggered_spell_id=37340; break;// Ursine Blessing
- case FORM_CAT:
- triggered_spell_id=37341; break;// Feline Blessing
- case FORM_TREE:
- triggered_spell_id=37342; break;// Slyvan Blessing
- case FORM_MOONKIN:
- triggered_spell_id=37343; break;// Lunar Blessing
- case FORM_NONE:
- triggered_spell_id=37344; break;// Cenarion Blessing (for caster form, except FORM_MOONKIN)
+ 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;
}
-
- target = this;
- break;
}
+ //else if (auraSpellInfo->Id==40363)// Entangling Roots ()
+ // trigger_spell_id = ????;
+ break;
}
- break;
- }
- case SPELLFAMILY_ROGUE:
- {
- if(auraSpellInfo->SpellFamilyFlags == 0x0000000000000000LL)
+ case SPELLFAMILY_HUNTER:
+ break;
+ case SPELLFAMILY_PALADIN:
{
- switch(auraSpellInfo->SpellIconID)
+ /*
+ // Blessed Life
+ if (auraSpellInfo->SpellIconID == 2137)
{
- // Combat Potency
- case 2260:
+ switch (auraSpellInfo->Id)
{
- // skip non offhand attacks
- if(attackType!=OFF_ATTACK)
+ case 31828: // Rank 1
+ case 31829: // Rank 2
+ case 31830: // Rank 3
+ break;
+ default:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blessed Life", auraSpellInfo->Id);
return false;
- break; // fall through to normal cast
}
}
- }
- break;
- }
- case SPELLFAMILY_PALADIN:
- {
- if(auraSpellInfo->SpellFamilyFlags == 0x00000000LL)
- {
- switch(auraSpellInfo->Id)
+ */
+ // Healing Discount
+ if (auraSpellInfo->Id==37705)
{
- // Lightning Capacitor
- case 37657:
- {
- // trinket ProcTriggerSpell but for safe checks for player
- if(!castItem || !pVictim || !pVictim->isAlive() || GetTypeId()!=TYPEID_PLAYER)
- return false;
-
- if(((Player*)this)->HasSpellCooldown(37657))
- return false;
-
- // stacking
- CastSpell(this, 37658, true, castItem, triggeredByAura);
- // 2.5s cooldown before it can stack again, current system allow 1 sec step in cooldown
- ((Player*)this)->AddSpellCooldown(37657,0,time(NULL)+(roll_chance_i(50) ? 2 : 3));
-
- // counting
- Aura * dummy = GetDummyAura(37658);
- if (!dummy)
- return false;
-
- // release at 3 aura in stack
- if(dummy->GetStackAmount() <= 2)
- return true; // main triggered spell casted anyway
-
- RemoveAurasDueToSpell(37658);
- CastSpell(pVictim, 37661, true, castItem, triggeredByAura);
- return true;
- }
- // Healing Discount
- case 37705:
- // Healing Trance (instead non-existed triggered spell)
- triggered_spell_id = 37706;
- target = this;
- break;
- // HoTs on Heals (Fel Reaver's Piston trinket)
- case 38299:
- {
- // at direct heal effect
- if(!procSpell || !IsSpellHaveEffect(procSpell,SPELL_EFFECT_HEAL))
- return false;
-
- // single proc at time
- AuraList const& scAuras = GetSingleCastAuras();
- for(AuraList::const_iterator itr = scAuras.begin(); itr != scAuras.end(); ++itr)
- if((*itr)->GetId()==triggered_spell_id)
- return false;
-
- // positive cast at victim instead self
- target = pVictim;
- break;
- }
+ trigger_spell_id = 37706;
+ target = this;
}
- switch(auraSpellInfo->SpellIconID)
+ // Soul Preserver
+ if (auraSpellInfo->Id==60510)
{
- case 241:
- {
- switch(auraSpellInfo->EffectTriggerSpell[0])
- {
- //Illumination
- case 18350:
- {
- if(!procSpell)
- return false;
-
- // procspell is triggered spell but we need mana cost of original casted spell
- uint32 originalSpellId = procSpell->Id;
-
- // Holy Shock
- if(procSpell->SpellFamilyName == SPELLFAMILY_PALADIN)
- {
- if(procSpell->SpellFamilyFlags & 0x0001000000000000LL)
- {
- 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;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id);
- return false;
- }
- }
- }
-
- SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId);
- if(!originalSpell)
- {
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId);
- return false;
- }
-
- // percent stored in effect 1 (class scripts) base points
- int32 percent = auraSpellInfo->EffectBasePoints[1]+1;
-
- basepoints0 = originalSpell->manaCost*percent/100;
- triggered_spell_id = 20272;
- target = this;
- break;
- }
- }
- break;
- }
+ trigger_spell_id = 60515;
+ target = this;
}
- }
- if(auraSpellInfo->SpellFamilyFlags & 0x00080000)
- {
- switch(auraSpellInfo->SpellIconID)
+ // Illumination
+ else if (auraSpellInfo->SpellIconID==241)
{
- //Judgement of Wisdom (overwrite non existing triggered spell call in spell.dbc
- case 206:
+ if(!procSpell)
+ return false;
+ // procspell is triggered spell but we need mana cost of original casted spell
+ uint32 originalSpellId = procSpell->Id;
+ // Holy Shock heal
+ if(procSpell->SpellFamilyFlags[1] & 0x00010000)
{
- if(!pVictim || !pVictim->isAlive())
- return false;
-
- switch(triggeredByAura->GetSpellProto()->Id)
+ switch(procSpell->Id)
{
- case 20186:
- triggered_spell_id = 20268; // Rank 1
- break;
- case 20354:
- triggered_spell_id = 20352; // Rank 2
- break;
- case 20355:
- triggered_spell_id = 20353; // Rank 3
- break;
- case 27164:
- triggered_spell_id = 27165; // Rank 4
- break;
+ 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:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in JoW",triggeredByAura->GetSpellProto()->Id);
- return false;
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id);
+ return false;
}
-
- pVictim->CastSpell(pVictim,triggered_spell_id,true,castItem,triggeredByAura,GetGUID());
- return true; // no hidden cooldown
}
- //Judgement of Light
- case 299:
+ SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId);
+ if(!originalSpell)
{
- if(!pVictim || !pVictim->isAlive())
- return false;
-
- // overwrite non existing triggered spell call in spell.dbc
- switch(triggeredByAura->GetSpellProto()->Id)
- {
- case 20185:
- triggered_spell_id = 20267; // Rank 1
- break;
- case 20344:
- triggered_spell_id = 20341; // Rank 2
- break;
- case 20345:
- triggered_spell_id = 20342; // Rank 3
- break;
- case 20346:
- triggered_spell_id = 20343; // Rank 4
- break;
- case 27162:
- triggered_spell_id = 27163; // Rank 5
- break;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in JoL",triggeredByAura->GetSpellProto()->Id);
- return false;
- }
- pVictim->CastSpell(pVictim,triggered_spell_id,true,castItem,triggeredByAura,GetGUID());
- return true; // no hidden cooldown
+ sLog.outError("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 = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100;
+ basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100;
+ trigger_spell_id = 20272;
+ target = this;
}
- }
- // custom check for proc spell
- switch(auraSpellInfo->Id)
- {
- // Bonus Healing (item spell)
- case 40971:
+ // Lightning Capacitor
+ else if (auraSpellInfo->Id==37657)
{
if(!pVictim || !pVictim->isAlive())
return false;
+ // stacking
+ CastSpell(this, 37658, true, NULL, triggeredByAura);
- // bonus if health < 50%
- if(pVictim->GetHealth() >= pVictim->GetMaxHealth()*triggeredByAura->GetModifier()->m_amount/100)
+ AuraEffect * dummy = GetDummyAura(37658);
+ // release at 3 aura in stack (cont contain in basepoint of trigger aura)
+ if(!dummy || dummy->GetParentAura()->GetStackAmount() < triggerAmount)
return false;
- // cast at target positive spell
+ RemoveAurasDueToSpell(37658);
+ trigger_spell_id = 37661;
target = pVictim;
- break;
}
- }
- switch(triggered_spell_id)
- {
- // Seal of Command
- case 20424:
- // prevent chain of triggered spell from same triggered spell
- if(procSpell && procSpell->Id==20424)
+ // Thunder Capacitor
+ else if (auraSpellInfo->Id == 54841)
+ {
+ if(!pVictim || !pVictim->isAlive())
return false;
- break;
+ // stacking
+ CastSpell(this, 54842, true, NULL, triggeredByAura);
+
+ // counting
+ AuraEffect * dummy = GetDummyAura(54842);
+ // release at 3 aura in stack (cont contain in basepoint of trigger aura)
+ if(!dummy || dummy->GetParentAura()->GetStackAmount() < triggerAmount)
+ return false;
+
+ RemoveAurasDueToSpell(54842);
+ trigger_spell_id = 54843;
+ target = pVictim;
+ }
+ break;
}
- break;
- }
- case SPELLFAMILY_SHAMAN:
- {
- if(auraSpellInfo->SpellFamilyFlags == 0x0000000000000000)
+ case SPELLFAMILY_SHAMAN:
{
- switch(auraSpellInfo->SpellIconID)
+ // Lightning Shield (overwrite non existing triggered spell call in spell.dbc
+ if(auraSpellInfo->SpellFamilyFlags[0] & 0x400)
{
- case 19:
- {
- switch(auraSpellInfo->Id)
- {
- case 23551: // Lightning Shield - Tier2: 8 pieces proc shield
- {
- // Lightning Shield (overwrite non existing triggered spell call in spell.dbc)
- triggered_spell_id = 23552;
- target = pVictim;
- break;
- }
- case 23552: // Lightning Shield - trigger shield damage
- {
- // Lightning Shield (overwrite non existing triggered spell call in spell.dbc)
- triggered_spell_id = 27635;
- target = pVictim;
- break;
- }
- }
- break;
- }
- // Mana Surge (Shaman T1 bonus)
- case 87:
+ switch(auraSpellInfo->Id)
{
- if(!procSpell)
- return false;
-
- basepoints0 = procSpell->manaCost * 35/100;
- triggered_spell_id = 23571;
- target = this;
- break;
+ case 324: // Rank 1
+ trigger_spell_id = 26364; break;
+ case 325: // Rank 2
+ trigger_spell_id = 26365; break;
+ case 905: // Rank 3
+ trigger_spell_id = 26366; break;
+ case 945: // Rank 4
+ trigger_spell_id = 26367; break;
+ case 8134: // Rank 5
+ trigger_spell_id = 26369; break;
+ case 10431: // Rank 6
+ trigger_spell_id = 26370; break;
+ case 10432: // Rank 7
+ trigger_spell_id = 26363; break;
+ case 25469: // Rank 8
+ trigger_spell_id = 26371; break;
+ case 25472: // Rank 9
+ trigger_spell_id = 26372; break;
+ case 49280: // Rank 10
+ trigger_spell_id = 49278; break;
+ case 49281: // Rank 11
+ trigger_spell_id = 49279; break;
+ default:
+ sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id);
+ return false;
}
- //Nature's Guardian
- case 2013:
- {
- if(GetTypeId()!=TYPEID_PLAYER)
- return false;
-
- // damage taken that reduces below 30% health
- // does NOT mean you must have been >= 30% before
- if (10*(int32(GetHealth())-int32(damage)) >= 3*GetMaxHealth())
- return false;
-
- triggered_spell_id = 31616;
+ }
+ // Lightning Shield (The Ten Storms set)
+ else if (auraSpellInfo->Id == 23551)
+ {
+ trigger_spell_id = 23552;
+ target = pVictim;
+ }
+ // Damage from Lightning Shield (The Ten Storms set)
+ else if (auraSpellInfo->Id == 23552)
+ trigger_spell_id = 27635;
+ // Mana Surge (The Earthfury set)
+ else if (auraSpellInfo->Id == 23572)
+ {
+ if(!procSpell)
+ return false;
+ basepoints0 = procSpell->manaCost * 35 / 100;
+ trigger_spell_id = 23571;
+ target = this;
+ }
+ // Nature's Guardian
+ else if (auraSpellInfo->SpellIconID == 2013)
+ {
+ // Check health condition - should drop to less 30% (damage deal after this!)
+ if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth()))
+ return false;
- // need check cooldown now
- if( cooldown && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
- return false;
+ if(pVictim && pVictim->isAlive())
+ pVictim->getThreatManager().modifyThreatPercent(this,-10);
- basepoints0 = triggeredByAura->GetModifier()->m_amount * GetMaxHealth() / 100;
- target = this;
- if(pVictim && pVictim->isAlive())
- pVictim->getThreatManager().modifyThreatPercent(this,-10);
- break;
- }
+ basepoints0 = triggerAmount * GetMaxHealth() / 100;
+ trigger_spell_id = 31616;
+ target = this;
}
- }
-
- // Water Shield (we can't set cooldown for main spell - it's player casted spell
- if((auraSpellInfo->SpellFamilyFlags & 0x0000002000000000LL) && auraSpellInfo->SpellVisual==7358)
- {
- target = this;
break;
}
-
- // Lightning Shield
- if((auraSpellInfo->SpellFamilyFlags & 0x00000400) && auraSpellInfo->SpellVisual==37)
- {
- // overwrite non existing triggered spell call in spell.dbc
- switch(triggeredByAura->GetSpellProto()->Id)
- {
- case 324:
- triggered_spell_id = 26364; break; // Rank 1
- case 325:
- triggered_spell_id = 26365; break; // Rank 2
- case 905:
- triggered_spell_id = 26366; break; // Rank 3
- case 945:
- triggered_spell_id = 26367; break; // Rank 4
- case 8134:
- triggered_spell_id = 26369; break; // Rank 5
- case 10431:
- triggered_spell_id = 26370; break; // Rank 6
- case 10432:
- triggered_spell_id = 26363; break; // Rank 7
- case 25469:
- triggered_spell_id = 26371; break; // Rank 8
- case 25472:
- triggered_spell_id = 26372; break; // Rank 9
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield",triggeredByAura->GetSpellProto()->Id);
+ case SPELLFAMILY_DEATHKNIGHT:
+ {
+ // Acclimation
+ if (auraSpellInfo->SpellIconID == 1930)
+ {
+ if (!procSpell)
return false;
+ switch(GetFirstSchoolInMask(GetSpellSchoolMask(procSpell)))
+ {
+ 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 = 54373; break;
+ default:
+ return false;
+ }
+ }
+ // Blood Presence
+ else if (auraSpellInfo->Id == 48266)
+ {
+ if (GetTypeId() != TYPEID_PLAYER)
+ return false;
+ if (!((Player*)this)->isHonorOrXPTarget(pVictim))
+ return false;
+ trigger_spell_id = 50475;
+ basepoints0 = damage * triggerAmount / 100;
}
-
- target = pVictim;
break;
}
- break;
- }
- }
-
- // standard non-dummy case
- if(!triggered_spell_id)
- {
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex());
- return false;
- }
-
- SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id);
-
- if(!triggerEntry)
- {
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u have not existed EffectTriggered[%d]=%u, not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex(),triggered_spell_id);
- return false;
- }
-
- // not allow proc extra attack spell at extra attack
- if( m_extraAttacks && IsSpellHaveEffect(triggerEntry,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
- return false;
-
- if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id))
- return false;
-
- // default case
- if(!target || target!=this && !target->isAlive())
- return false;
-
- if(basepoints0)
- CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
- else
- CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
-
- if( cooldown && GetTypeId()==TYPEID_PLAYER )
- ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
-
- return true;
-}
-*/
-
-bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown)
-{
- // Get triggered aura spell info
- SpellEntry const* auraSpellInfo = triggeredByAura->GetSpellProto();
-
- // Basepoints of trigger aura
- int32 triggerAmount = triggeredByAura->GetModifier()->m_amount;
-
- // Set trigger spell id, target, custom basepoints
- uint32 trigger_spell_id = auraSpellInfo->EffectTriggerSpell[triggeredByAura->GetEffIndex()];
- Unit* target = NULL;
- int32 basepoints0 = 0;
-
- Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
- ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
-
- // Try handle uncnown trigger spells
- if (sSpellStore.LookupEntry(trigger_spell_id)==NULL)
- switch (auraSpellInfo->SpellFamilyName)
- {
- //=====================================================================
- // Generic class
- // ====================================================================
- // .....
- //=====================================================================
- case SPELLFAMILY_GENERIC:
-// if (auraSpellInfo->Id==34082) // Advantaged State (DND)
-// trigger_spell_id = ???;
- if (auraSpellInfo->Id == 23780) // Aegis of Preservation (Aegis of Preservation trinket)
- trigger_spell_id = 23781;
-// else if (auraSpellInfo->Id==43504) // Alterac Valley OnKill Proc Aura
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==37030) // Chaotic Temperament
-// trigger_spell_id = ;
- else if (auraSpellInfo->Id==43820) // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
- {
- // Pct value stored in dummy
- basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100;
- target = pVictim;
- break;
- }
-// else if (auraSpellInfo->Id==41248) // Consuming Strikes
-// trigger_spell_id = 41249;
-// else if (auraSpellInfo->Id==41054) // Copy Weapon
-// trigger_spell_id = 41055;
-// else if (auraSpellInfo->Id==31255) // Deadly Swiftness (Rank 1)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==5301) // Defensive State (DND)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==13358) // Defensive State (DND)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==16092) // Defensive State (DND)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==24949) // Defensive State 2 (DND)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==40329) // Demo Shout Sensor
-// trigger_spell_id = ;
- // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher)
- else if (auraSpellInfo->Id == 33896)
- trigger_spell_id = 33898;
-// else if (auraSpellInfo->Id==18943) // Double Attack
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==19194) // Double Attack
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==19817) // Double Attack
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==19818) // Double Attack
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==22835) // Drunken Rage
-// trigger_spell_id = 14822;
- /*
- else if (auraSpellInfo->SpellIconID==191) // Elemental Response
- {
- switch (auraSpellInfo->Id && auraSpellInfo->AttributesEx==0)
- {
- case 34191:
- case 34329:
- case 34524:
- case 34582:
- case 36733:break;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Elemental Response",auraSpellInfo->Id);
- return false;
- }
- //This generic aura self-triggers a different spell for each school of magic that lands on the wearer:
- switch (procSpell->School)
- {
- case SPELL_SCHOOL_FIRE: trigger_spell_id = 34192;break;//Fire: 34192
- case SPELL_SCHOOL_FROST: trigger_spell_id = 34193;break;//Frost: 34193
- case SPELL_SCHOOL_ARCANE: trigger_spell_id = 34194;break;//Arcane: 34194
- case SPELL_SCHOOL_NATURE: trigger_spell_id = 34195;break;//Nature: 34195
- case SPELL_SCHOOL_SHADOW: trigger_spell_id = 34196;break;//Shadow: 34196
- case SPELL_SCHOOL_HOLY: trigger_spell_id = 34197;break;//Holy: 34197
- case SPELL_SCHOOL_NORMAL: trigger_spell_id = 34198;break;//Physical: 34198
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u Elemental Response wrong school",auraSpellInfo->Id);
- return false;
- }
- }*/
-// else if (auraSpellInfo->Id==6542) // Enraged Defense
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==40364) // Entangling Roots Sensor
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==33207) // Gossip NPC Periodic - Fidget
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==35321) // Gushing Wound
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==38363) // Gushing Wound
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==39215) // Gushing Wound
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==40250) // Improved Duration
-// trigger_spell_id = ;
- else if (auraSpellInfo->Id==27522) // Mana Drain Trigger
- {
- // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target.
- if (this && this->isAlive())
- CastSpell(this, 29471, true, castItem, triggeredByAura);
- if (pVictim && pVictim->isAlive())
- CastSpell(pVictim, 27526, true, castItem, triggeredByAura);
- return true;
- }
- else if (auraSpellInfo->Id==24905) // Moonkin Form (Passive)
- {
- // Elune's Touch (instead non-existed triggered spell) 30% from AP
- trigger_spell_id = 33926;
- basepoints0 = GetTotalAttackPowerValue(BASE_ATTACK) * 30 / 100;
- target = this;
- }
-// else if (auraSpellInfo->Id==43453) // Rune Ward
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==7137) // Shadow Charge (Rank 1)
-// trigger_spell_id = ;
- // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger
-// else if (auraSpellInfo->Id==36576)
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==34783) // Spell Reflection
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==36096) // Spell Reflection
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==36207) // Steal Weapon
-// trigger_spell_id = ;
-// else if (auraSpellInfo->Id==35205) // Vanish
- break;
- //=====================================================================
- // Mage
- //=====================================================================
- // Blazing Speed (Rank 1,2) trigger = 18350
- //=====================================================================
- case SPELLFAMILY_MAGE:
- // Blazing Speed
- if (auraSpellInfo->SpellIconID == 2127)
- {
- switch (auraSpellInfo->Id)
- {
- case 31641: // Rank 1
- case 31642: // Rank 2
- trigger_spell_id = 31643;
- break;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id);
- return false;
- }
- }
- break;
- //=====================================================================
- // Warrior
- //=====================================================================
- // Rampage (Rank 1-3) trigger = 18350
- //=====================================================================
- case SPELLFAMILY_WARRIOR:
- // Rampage
- if (auraSpellInfo->SpellIconID == 2006 && auraSpellInfo->SpellFamilyFlags==0x100000)
- {
- switch(auraSpellInfo->Id)
- {
- case 29801: trigger_spell_id = 30029; break; // Rank 1
- case 30030: trigger_spell_id = 30031; break; // Rank 2
- case 30033: trigger_spell_id = 30032; break; // Rank 3
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in Rampage",auraSpellInfo->Id);
- return false;
- }
- }
- break;
- //=====================================================================
- // Warlock
- //=====================================================================
- // Pyroclasm trigger = 18350
- // Drain Soul (Rank 1-5) trigger = 0
- //=====================================================================
- case SPELLFAMILY_WARLOCK:
- {
- // Pyroclasm
- if (auraSpellInfo->SpellIconID == 1137)
- {
- if(!pVictim || !pVictim->isAlive() || pVictim == this || procSpell == NULL)
- return false;
- // Calculate spell tick count for spells
- uint32 tick = 1; // Default tick = 1
-
- // Hellfire have 15 tick
- if (procSpell->SpellFamilyFlags&0x0000000000000040LL)
- tick = 15;
- // Rain of Fire have 4 tick
- else if (procSpell->SpellFamilyFlags&0x0000000000000020LL)
- tick = 4;
- else
- return false;
-
- // Calculate chance = baseChance / tick
- float chance = 0;
- switch (auraSpellInfo->Id)
- {
- case 18096: chance = 13.0f / tick; break;
- case 18073: chance = 26.0f / tick; break;
- }
- // Roll chance
- if (!roll_chance_f(chance))
- return false;
-
- trigger_spell_id = 18093;
- }
- // Drain Soul
- else if (auraSpellInfo->SpellFamilyFlags & 0x0000000000004000LL)
- {
- Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
- for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
- {
- if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113)
- {
- int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this);
- basepoints0 = value2 * GetMaxPower(POWER_MANA) / 100;
- }
- }
- if ( basepoints0 == 0 )
- return false;
- trigger_spell_id = 18371;
- }
- break;
- }
- //=====================================================================
- // Priest
- //=====================================================================
- // Greater Heal Refund trigger = 18350
- // Blessed Recovery (Rank 1-3) trigger = 18350
- // Shadowguard (1-7) trigger = 28376
- //=====================================================================
- case SPELLFAMILY_PRIEST:
- {
- // Greater Heal Refund
- if (auraSpellInfo->Id==37594)
- trigger_spell_id = 37595;
- // Shadowguard
- else if(auraSpellInfo->SpellFamilyFlags==0x100080000000LL && auraSpellInfo->SpellVisual==7958)
- {
- switch(auraSpellInfo->Id)
- {
- case 18137: trigger_spell_id = 28377; break; // Rank 1
- case 19308: trigger_spell_id = 28378; break; // Rank 2
- case 19309: trigger_spell_id = 28379; break; // Rank 3
- case 19310: trigger_spell_id = 28380; break; // Rank 4
- case 19311: trigger_spell_id = 28381; break; // Rank 5
- case 19312: trigger_spell_id = 28382; break; // Rank 6
- case 25477: trigger_spell_id = 28385; break; // Rank 7
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in SG", auraSpellInfo->Id);
- return false;
- }
- }
- // Blessed Recovery
- else 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:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
- return false;
- }
- basepoints0 = damage * triggerAmount / 100 / 3;
- target = this;
- }
- break;
- }
- //=====================================================================
- // Druid
- // ====================================================================
- // Druid Forms Trinket trigger = 18350
- // Entangling Roots trigger = 30023
- // Leader of the Pack trigger = 18350
- //=====================================================================
- case SPELLFAMILY_DRUID:
- {
- // Druid Forms Trinket
- if (auraSpellInfo->Id==37336)
- {
- switch(m_form)
- {
- case 0: 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;
- }
- }
-// else if (auraSpellInfo->Id==40363)// Entangling Roots ()
-// trigger_spell_id = ????;
- // Leader of the Pack
- else if (auraSpellInfo->Id == 24932)
- {
- if (triggerAmount == 0)
- return false;
- basepoints0 = triggerAmount * GetMaxHealth() / 100;
- trigger_spell_id = 34299;
- }
- break;
- }
- //=====================================================================
- // Hunter
- // ====================================================================
- // ......
- //=====================================================================
- case SPELLFAMILY_HUNTER:
- break;
- //=====================================================================
- // Paladin
- // ====================================================================
- // Blessed Life trigger = 31934
- // Healing Discount trigger = 18350
- // Illumination (Rank 1-5) trigger = 18350
- // Judgement of Light (Rank 1-5) trigger = 5373
- // Judgement of Wisdom (Rank 1-4) trigger = 1826
- // Lightning Capacitor trigger = 18350
- //=====================================================================
- case SPELLFAMILY_PALADIN:
- {
- /* // Blessed Life
- if (auraSpellInfo->SpellIconID == 2137)
- {
- switch (auraSpellInfo->Id)
- {
- case 31828: // Rank 1
- case 31829: // Rank 2
- case 31830: // Rank 3
+ default:
break;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blessed Life", auraSpellInfo->Id);
- return false;
- }
- }*/
- // Healing Discount
- if (auraSpellInfo->Id==37705)
- {
- trigger_spell_id = 37706;
- target = this;
- }
- // Judgement of Light and Judgement of Wisdom
- else if (auraSpellInfo->SpellFamilyFlags & 0x0000000000080000LL)
- {
- switch (auraSpellInfo->Id)
- {
- // Judgement of Light
- case 20185: trigger_spell_id = 20267;break; // Rank 1
- case 20344: trigger_spell_id = 20341;break; // Rank 2
- case 20345: trigger_spell_id = 20342;break; // Rank 3
- case 20346: trigger_spell_id = 20343;break; // Rank 4
- case 27162: trigger_spell_id = 27163;break; // Rank 5
- // Judgement of Wisdom
- case 20186: trigger_spell_id = 20268;break; // Rank 1
- case 20354: trigger_spell_id = 20352;break; // Rank 2
- case 20355: trigger_spell_id = 20353;break; // Rank 3
- case 27164: trigger_spell_id = 27165;break; // Rank 4
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Judgement of Light/Wisdom", auraSpellInfo->Id);
- return false;
- }
- pVictim->CastSpell(pVictim, trigger_spell_id, true, castItem, triggeredByAura);
- return true; // no hidden cooldown
- }
- // Illumination
- else if (auraSpellInfo->SpellIconID==241)
- {
- if(!procSpell)
- return false;
- // procspell is triggered spell but we need mana cost of original casted spell
- uint32 originalSpellId = procSpell->Id;
- // Holy Shock
- if(procSpell->SpellFamilyFlags & 0x00200000)
- {
- 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;
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id);
- return false;
- }
- }
- SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId);
- if(!originalSpell)
- {
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId);
- return false;
- }
- // percent stored in effect 1 (class scripts) base points
- basepoints0 = originalSpell->manaCost*(auraSpellInfo->EffectBasePoints[1]+1)/100;
- trigger_spell_id = 20272;
- target = this;
- }
- // Lightning Capacitor
- else if (auraSpellInfo->Id==37657)
- {
- if(!pVictim || !pVictim->isAlive())
- return false;
- // stacking
- CastSpell(this, 37658, true, NULL, triggeredByAura);
- // counting
- Aura * dummy = GetDummyAura(37658);
- if (!dummy)
- return false;
- // release at 3 aura in stack (cont contain in basepoint of trigger aura)
- if(dummy->GetStackAmount() <= 2)
- return false;
-
- RemoveAurasDueToSpell(37658);
- trigger_spell_id = 37661;
- target = pVictim;
- }
- break;
- }
- //=====================================================================
- // Shaman
- //====================================================================
- // Lightning Shield trigger = 18350
- // Mana Surge trigger = 18350
- // Nature's Guardian (Rank 1-5) trigger = 18350
- //=====================================================================
- case SPELLFAMILY_SHAMAN:
- {
- //Lightning Shield (overwrite non existing triggered spell call in spell.dbc
- if(auraSpellInfo->SpellFamilyFlags==0x00000400 && auraSpellInfo->SpellVisual==37)
- {
- switch(auraSpellInfo->Id)
- {
- case 324: trigger_spell_id = 26364; break; // Rank 1
- case 325: trigger_spell_id = 26365; break; // Rank 2
- case 905: trigger_spell_id = 26366; break; // Rank 3
- case 945: trigger_spell_id = 26367; break; // Rank 4
- case 8134: trigger_spell_id = 26369; break; // Rank 5
- case 10431: trigger_spell_id = 26370; break; // Rank 6
- case 10432: trigger_spell_id = 26363; break; // Rank 7
- case 25469: trigger_spell_id = 26371; break; // Rank 8
- case 25472: trigger_spell_id = 26372; break; // Rank 9
- default:
- sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id);
- return false;
- }
- }
- // Lightning Shield (The Ten Storms set)
- else if (auraSpellInfo->Id == 23551)
- {
- trigger_spell_id = 23552;
- target = pVictim;
- }
- // Damage from Lightning Shield (The Ten Storms set)
- else if (auraSpellInfo->Id == 23552)
- trigger_spell_id = 27635;
- // Mana Surge (The Earthfury set)
- else if (auraSpellInfo->Id == 23572)
- {
- if(!procSpell)
- return false;
- basepoints0 = procSpell->manaCost * 35 / 100;
- trigger_spell_id = 23571;
- target = this;
- }
- else if (auraSpellInfo->SpellIconID == 2013) //Nature's Guardian
- {
- // Check health condition - should drop to less 30% (damage deal after this!)
- if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth()))
- return false;
-
- if(pVictim && pVictim->isAlive())
- pVictim->getThreatManager().modifyThreatPercent(this,-10);
-
- basepoints0 = triggerAmount * GetMaxHealth() / 100;
- trigger_spell_id = 31616;
- target = this;
- }
- break;
- }
- // default
- default:
- break;
+ }
}
// All ok. Check current trigger spell
@@ -7420,6 +7179,15 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
break;
}
+ // Rapid Recuperation
+ case 53228:
+ case 53232:
+ {
+ // This effect only from Rapid Fire (ability cast)
+ if (!(procSpell->SpellFamilyFlags[0] & 0x20))
+ return false;
+ break;
+ }
}
// Costum basepoints/target for exist spell
@@ -7449,11 +7217,16 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
// Need add combopoint AFTER finish movie (or they dropped in finish phase)
break;
}
+ // Bloodthirst (($m/100)% of max health)
+ case 23880:
+ {
+ basepoints0 = int32(GetMaxHealth() * triggerAmount / 100);
+ break;
+ }
// Shamanistic Rage triggered spell
case 30824:
{
basepoints0 = int32(GetTotalAttackPowerValue(BASE_ATTACK) * triggerAmount / 100);
- trigger_spell_id = 30824;
break;
}
// Enlightenment (trigger only from mana cost spells)
@@ -7463,6 +7236,59 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
break;
}
+ // Brain Freeze
+ case 57761:
+ {
+ if(!procSpell)
+ return false;
+ // For trigger from Blizzard need exist Improved Blizzard
+ if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags[0] & 0x80)
+ {
+ bool found = false;
+ AuraEffectList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
+ {
+ int32 script = (*i)->GetMiscValue();
+ if(script==836 || script==988 || script==989)
+ {
+ found=true;
+ break;
+ }
+ }
+ if(!found)
+ return false;
+ }
+ break;
+ }
+ // Astral Shift
+ case 52179:
+ {
+ if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == pVictim)
+ return false;
+
+ // Need stun, fear or silence mechanic
+ if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_SILENCE)|(1<<MECHANIC_STUN)|(1<<MECHANIC_FEAR))))
+ return false;
+ break;
+ }
+ // Burning Determination
+ case 54748:
+ {
+ if(!procSpell)
+ return false;
+ // Need Interrupt or Silenced mechanic
+ if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_INTERRUPT)|(1<<MECHANIC_SILENCE))))
+ return false;
+ break;
+ }
+ // Lock and Load
+ case 56453:
+ {
+ // Proc only from trap activation (from periodic proc another aura of this spell)
+ if (!(procFlags & PROC_FLAG_ON_TRAP_ACTIVATION) || !roll_chance_i(triggerAmount))
+ return false;
+ break;
+ }
}
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(trigger_spell_id))
@@ -7489,15 +7315,15 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return true;
}
-bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, Aura *triggeredByAura, SpellEntry const *procSpell, uint32 cooldown)
+bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraEffect *triggeredByAura, SpellEntry const *procSpell, uint32 cooldown)
{
- int32 scriptId = triggeredByAura->GetModifier()->m_miscvalue;
+ int32 scriptId = triggeredByAura->GetMiscValue();
if(!pVictim || !pVictim->isAlive())
return false;
- Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
- ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL;
+ Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
+ ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
uint32 triggered_spell_id = 0;
@@ -7505,21 +7331,21 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, Aura *triggeredByAur
{
case 836: // Improved Blizzard (Rank 1)
{
- if (!procSpell || procSpell->SpellVisual!=9487)
+ if (!procSpell || procSpell->SpellVisual[0]!=9487)
return false;
triggered_spell_id = 12484;
break;
}
case 988: // Improved Blizzard (Rank 2)
{
- if (!procSpell || procSpell->SpellVisual!=9487)
+ if (!procSpell || procSpell->SpellVisual[0]!=9487)
return false;
triggered_spell_id = 12485;
break;
}
case 989: // Improved Blizzard (Rank 3)
{
- if (!procSpell || procSpell->SpellVisual!=9487)
+ if (!procSpell || procSpell->SpellVisual[0]!=9487)
return false;
triggered_spell_id = 12486;
break;
@@ -7556,6 +7382,29 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, Aura *triggeredByAur
case 5497: // Improved Mana Gems (Serpent-Coil Braid)
triggered_spell_id = 37445; // Mana Surge
break;
+ case 8152: // Serendipity
+ {
+ // if heal your target over maximum health
+ if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth())
+ return false;
+ int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
+ int32 basepoints0 = cost * triggeredByAura->GetAmount()/100;
+ CastCustomSpell(this, 47762, &basepoints0, 0, 0, true, 0, triggeredByAura);
+ return true;
+ }
+ // Rapture
+ case 7556: // Rank 1
+ case 7555: // Rank 2
+ case 7554: // Rank 3
+ case 7553: // Rank 4
+ case 7552: // Rank 5
+ {
+ int32 basepoints0 = ((getLevel() * (-0.2) + 18) / 1000000) * damage * GetMaxPower(POWER_MANA);
+ if(basepoints0 > (GetMaxPower(POWER_MANA) / 100) * (triggeredByAura->GetAmount() / 10))
+ basepoints0 = (GetMaxPower(POWER_MANA) / 100) * (triggeredByAura->GetAmount() / 10);
+ CastCustomSpell(this, 47755, &basepoints0, 0, 0, true, 0, triggeredByAura);
+ return true;
+ }
}
// not processed
@@ -7647,6 +7496,8 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
bool Unit::IsHostileTo(Unit const* unit) const
{
+ if(!unit)
+ return false;
// always non-hostile to self
if(unit==this)
return false;
@@ -7697,11 +7548,11 @@ bool Unit::IsHostileTo(Unit const* unit) const
return false;
// Sanctuary
- if(pTarget->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY) && pTester->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY))
+ if(pTarget->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY) && pTester->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY))
return false;
// PvP FFA state
- if(pTester->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) && pTarget->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
+ if(pTester->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) && pTarget->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
return true;
//= PvP states
@@ -7726,28 +7577,31 @@ bool Unit::IsHostileTo(Unit const* unit) const
if(tester->GetTypeId()==TYPEID_PLAYER)
{
// forced reaction
- ForcedReactions::const_iterator forceItr = ((Player*)tester)->m_forcedReactions.find(target_faction->faction);
- if(forceItr!=((Player*)tester)->m_forcedReactions.end())
- return forceItr->second <= REP_HOSTILE;
-
- // if faction have reputation then hostile state for tester at 100% dependent from at_war state
- if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
- if(raw_target_faction->reputationListID >=0)
- if(FactionState const* factionState = ((Player*)tester)->GetFactionState(raw_target_faction))
+ if(target_faction->faction)
+ {
+ if(ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
+ return *force <= REP_HOSTILE;
+
+ // if faction have reputation then hostile state for tester at 100% dependent from at_war state
+ if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
+ if(FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
return (factionState->Flags & FACTION_FLAG_AT_WAR);
+ }
}
// CvP forced reaction and reputation case
else if(target->GetTypeId()==TYPEID_PLAYER)
{
// forced reaction
- ForcedReactions::const_iterator forceItr = ((Player const*)target)->m_forcedReactions.find(tester_faction->faction);
- if(forceItr!=((Player const*)target)->m_forcedReactions.end())
- return forceItr->second <= REP_HOSTILE;
+ if(tester_faction->faction)
+ {
+ if(ReputationRank const* force = ((Player*)target)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
+ return *force <= REP_HOSTILE;
- // apply reputation state
- FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
- if(raw_tester_faction && raw_tester_faction->reputationListID >=0 )
- return ((Player const*)target)->GetReputationRank(raw_tester_faction) <= REP_HOSTILE;
+ // apply reputation state
+ FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction);
+ if(raw_tester_faction && raw_tester_faction->reputationListID >=0 )
+ return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction) <= REP_HOSTILE;
+ }
}
// common faction based case (CvC,PvC,CvP)
@@ -7806,11 +7660,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
return true;
// Sanctuary
- if(pTarget->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY) && pTester->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY))
+ if(pTarget->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY) && pTester->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY))
return true;
// PvP FFA state
- if(pTester->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) && pTarget->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
+ if(pTester->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) && pTarget->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
return false;
//= PvP states
@@ -7835,28 +7689,31 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
if(tester->GetTypeId()==TYPEID_PLAYER)
{
// forced reaction
- ForcedReactions::const_iterator forceItr = ((Player const*)tester)->m_forcedReactions.find(target_faction->faction);
- if(forceItr!=((Player const*)tester)->m_forcedReactions.end())
- return forceItr->second >= REP_FRIENDLY;
+ if(target_faction->faction)
+ {
+ if(ReputationRank const* force =((Player*)tester)->GetReputationMgr().GetForcedRankIfAny(target_faction))
+ return *force >= REP_FRIENDLY;
- // if faction have reputation then friendly state for tester at 100% dependent from at_war state
- if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
- if(raw_target_faction->reputationListID >=0)
- if(FactionState const* FactionState = ((Player*)tester)->GetFactionState(raw_target_faction))
- return !(FactionState->Flags & FACTION_FLAG_AT_WAR);
+ // if faction have reputation then friendly state for tester at 100% dependent from at_war state
+ if(FactionEntry const* raw_target_faction = sFactionStore.LookupEntry(target_faction->faction))
+ if(FactionState const* factionState = ((Player*)tester)->GetReputationMgr().GetState(raw_target_faction))
+ return !(factionState->Flags & FACTION_FLAG_AT_WAR);
+ }
}
// CvP forced reaction and reputation case
else if(target->GetTypeId()==TYPEID_PLAYER)
{
// forced reaction
- ForcedReactions::const_iterator forceItr = ((Player const*)target)->m_forcedReactions.find(tester_faction->faction);
- if(forceItr!=((Player const*)target)->m_forcedReactions.end())
- return forceItr->second >= REP_FRIENDLY;
+ if(tester_faction->faction)
+ {
+ if(ReputationRank const* force =((Player*)target)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
+ return *force >= REP_FRIENDLY;
- // apply reputation state
- if(FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
- if(raw_tester_faction->reputationListID >=0 )
- return ((Player const*)target)->GetReputationRank(raw_tester_faction) >= REP_FRIENDLY;
+ // apply reputation state
+ if(FactionEntry const* raw_tester_faction = sFactionStore.LookupEntry(tester_faction->faction))
+ if(raw_tester_faction->reputationListID >=0 )
+ return ((Player const*)target)->GetReputationMgr().GetRank(raw_tester_faction) >= REP_FRIENDLY;
+ }
}
// common faction based case (CvC,PvC,CvP)
@@ -7866,7 +7723,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
bool Unit::IsHostileToPlayers() const
{
FactionTemplateEntry const* my_faction = getFactionTemplateEntry();
- if(!my_faction)
+ if(!my_faction || !my_faction->faction)
return false;
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
@@ -7879,7 +7736,7 @@ bool Unit::IsHostileToPlayers() const
bool Unit::IsNeutralToAll() const
{
FactionTemplateEntry const* my_faction = getFactionTemplateEntry();
- if(!my_faction)
+ if(!my_faction || !my_faction->faction)
return true;
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
@@ -7916,7 +7773,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
// remove SPELL_AURA_MOD_UNATTACKABLE at attack (in case non-interruptible spells stun aura applied also that not let attack)
if(HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
- RemoveSpellsCausingAura(SPELL_AURA_MOD_UNATTACKABLE);
+ RemoveAurasByType(SPELL_AURA_MOD_UNATTACKABLE);
if (m_attacking)
{
@@ -7931,34 +7788,43 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
}
return false;
}
- AttackStop();
+
+ //switch target
+ InterruptSpell(CURRENT_MELEE_SPELL);
+ if(!meleeAttack)
+ clearUnitState(UNIT_STAT_MELEE_ATTACKING);
}
+ if(m_attacking)
+ m_attacking->_removeAttacker(this);
+
+ m_attacking = victim;
+ m_attacking->_addAttacker(this);
+
//Set our target
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
if(meleeAttack)
addUnitState(UNIT_STAT_MELEE_ATTACKING);
- m_attacking = victim;
- m_attacking->_addAttacker(this);
- //if(m_attacking->GetTypeId()==TYPEID_UNIT && ((Creature*)m_attacking)->IsAIEnabled)
- // ((Creature*)m_attacking)->AI()->AttackedBy(this);
+ // set position before any AI calls/assistance
+ //if(GetTypeId()==TYPEID_UNIT)
+ // ((Creature*)this)->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
if(GetTypeId()==TYPEID_UNIT)
{
+ // should not let player enter combat by right clicking target
+ SetInCombatWith(victim);
+ if(victim->GetTypeId() == TYPEID_PLAYER)
+ victim->SetInCombatWith(this);
+ AddThreat(victim, 0.0f);
+
WorldPacket data(SMSG_AI_REACTION, 12);
data << uint64(GetGUID());
data << uint32(AI_REACTION_AGGRO); // Aggro sound
((WorldObject*)this)->SendMessageToSet(&data, true);
((Creature*)this)->CallAssistance();
-
- // should not let player enter combat by right clicking target
- SetInCombatWith(victim);
- if(victim->GetTypeId() == TYPEID_PLAYER)
- victim->SetInCombatWith(this);
- AddThreat(victim, 0.0f);
}
// delay offhand weapon attack to next attack time
@@ -8014,17 +7880,9 @@ void Unit::CombatStop(bool cast)
void Unit::CombatStopWithPets(bool cast)
{
CombatStop(cast);
- if(Pet* pet = GetPet())
- pet->CombatStop(cast);
- if(Unit* charm = GetCharm())
- charm->CombatStop(cast);
- if(GetTypeId()==TYPEID_PLAYER)
- {
- GuardianPetList const& guardians = ((Player*)this)->GetGuardians();
- for(GuardianPetList::const_iterator itr = guardians.begin(); itr != guardians.end(); ++itr)
- if(Unit* guardian = Unit::GetUnit(*this,*itr))
- guardian->CombatStop(cast);
- }
+
+ for(ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
+ (*itr)->CombatStop(cast);
}
bool Unit::isAttackingPlayer() const
@@ -8032,23 +7890,15 @@ bool Unit::isAttackingPlayer() const
if(hasUnitState(UNIT_STAT_ATTACK_PLAYER))
return true;
- Pet* pet = GetPet();
- if(pet && pet->isAttackingPlayer())
- return true;
-
- Unit* charmed = GetCharm();
- if(charmed && charmed->isAttackingPlayer())
- return true;
+ for(ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
+ if((*itr)->isAttackingPlayer())
+ return true;
- for (int8 i = 0; i < MAX_TOTEM; i++)
- {
- if(m_TotemSlot[i])
- {
- Creature *totem = ObjectAccessor::GetCreature(*this, m_TotemSlot[i]);
- if(totem && totem->isAttackingPlayer())
- return true;
- }
- }
+ for(int8 i = 0; i < MAX_SUMMON_SLOT; ++i)
+ if(m_SummonSlot[i])
+ if(Creature *summon = ObjectAccessor::GetCreature(*this, m_SummonSlot[i]))
+ if(summon->isAttackingPlayer())
+ return true;
return false;
}
@@ -8100,7 +7950,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
{
// exceptions (applied at state but not removed at state change)
// Rampage
- if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags==0x100000)
+ if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags[0]==0x100000)
{
++itr;
continue;
@@ -8115,6 +7965,18 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
}
}
+bool Unit::HasAuraState(AuraState flag, SpellEntry const *spellProto, Unit * Caster) const
+{
+ if (Caster && spellProto)
+ {
+ AuraEffectList const& stateAuras = Caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
+ for(AuraEffectList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j)
+ if((*j)->isAffectedOnSpell(spellProto))
+ return true;
+ }
+ return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
+}
+
Unit *Unit::GetOwner() const
{
uint64 ownerid = GetOwnerGUID();
@@ -8139,15 +8001,16 @@ Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() const
return GetTypeId()==TYPEID_PLAYER ? (Player*)this : NULL;
}
-Pet* Unit::GetPet() const
+Guardian* Unit::GetGuardianPet() const
{
if(uint64 pet_guid = GetPetGUID())
{
- if(Pet* pet = ObjectAccessor::GetPet(pet_guid))
- return pet;
+ if(Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, pet_guid))
+ if(pet->HasSummonMask(SUMMON_MASK_GUARDIAN))
+ return (Guardian*)pet;
- sLog.outError("Unit::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
- const_cast<Unit*>(this)->SetPet(0);
+ sLog.outError("Unit::GetGuardianPet: Pet %u not exist.",GUID_LOPART(pet_guid));
+ const_cast<Unit*>(this)->SetPetGUID(0);
}
return NULL;
@@ -8161,28 +8024,236 @@ Unit* Unit::GetCharm() const
return pet;
sLog.outError("Unit::GetCharm: Charmed creature %u not exist.",GUID_LOPART(charm_guid));
- const_cast<Unit*>(this)->SetCharm(0);
+ const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_CHARM, 0);
}
return NULL;
}
-void Unit::SetPet(Pet* pet)
+void Unit::SetGuardian(Guardian* guardian, bool apply)
+{
+ sLog.outDebug("SetGuardian %u for %u, apply %u", guardian->GetEntry(), GetEntry(), apply);
+
+ if(apply)
+ {
+ if(!guardian->AddUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID()))
+ {
+ sLog.outCrash("Guardian %u is summoned by %u but it already has a owner", guardian->GetEntry(), GetEntry());
+ return;
+ }
+
+ m_Controlled.insert(guardian);
+
+ if(guardian->isPet() || guardian->m_Properties && guardian->m_Properties->Category == SUMMON_CATEGORY_PET)
+ {
+ if(Guardian* oldPet = GetGuardianPet())
+ {
+ if(oldPet != guardian && (oldPet->isPet() || guardian->isPet() || oldPet->GetEntry() != guardian->GetEntry()))
+ {
+ // remove existing guardian pet
+ if(oldPet->isPet())
+ ((Pet*)oldPet)->Remove(PET_SAVE_AS_CURRENT);
+ else
+ oldPet->UnSummon();
+ SetPetGUID(guardian->GetGUID());
+ SetGuardianGUID(0);
+ }
+ }
+ else
+ {
+ SetPetGUID(guardian->GetGUID());
+ SetGuardianGUID(0);
+ }
+ }
+
+ if(AddUInt64Value(UNIT_FIELD_SUMMON, guardian->GetGUID()))
+ {
+ if(GetTypeId() == TYPEID_PLAYER && !GetCharmGUID())
+ {
+ if(guardian->isPet())
+ ((Player*)this)->PetSpellInitialize();
+ else
+ ((Player*)this)->CharmSpellInitialize();
+ }
+ }
+
+ // FIXME: hack, speed must be set only at follow
+ if(GetTypeId() == TYPEID_PLAYER && guardian->HasSummonMask(SUMMON_MASK_PET))
+ for(int i = 0; i < MAX_MOVE_TYPE; ++i)
+ guardian->SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
+ }
+ else
+ {
+ if(!guardian->RemoveUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID()))
+ {
+ sLog.outCrash("Pet %u is unsummoned by %u but it has another owner", guardian->GetEntry(), GetEntry());
+ return;
+ }
+
+ m_Controlled.erase(guardian);
+
+ if(guardian->isPet() || guardian->m_Properties && guardian->m_Properties->Category == SUMMON_CATEGORY_PET)
+ {
+ if(GetPetGUID() == guardian->GetGUID())
+ SetPetGUID(0);
+ }
+
+ if(RemoveUInt64Value(UNIT_FIELD_SUMMON, guardian->GetGUID()))
+ {
+ //Check if there is another guardian
+ for(ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
+ {
+ if(GetCharmGUID() == (*itr)->GetGUID())
+ continue;
+
+ assert((*itr)->GetOwnerGUID() == GetGUID());
+ assert((*itr)->GetTypeId() == TYPEID_UNIT);
+ if(AddUInt64Value(UNIT_FIELD_SUMMON, (*itr)->GetGUID()))
+ {
+ //show another pet bar if there is no charm bar
+ if(GetTypeId() == TYPEID_PLAYER && !GetCharmGUID())
+ {
+ if(((Creature*)(*itr))->isPet())
+ ((Player*)this)->PetSpellInitialize();
+ else
+ ((Player*)this)->CharmSpellInitialize();
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+
+void Unit::SetCharm(Unit* charm, bool apply)
{
- SetUInt64Value(UNIT_FIELD_SUMMON, pet ? pet->GetGUID() : 0);
+ if(apply)
+ {
+ if(GetTypeId() == TYPEID_PLAYER)
+ {
+ if(!AddUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
+ sLog.outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
+ }
+
+ if(!charm->AddUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
+ sLog.outCrash("Unit %u is being charmed, but it already has a charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
+
+ m_Controlled.insert(charm);
+ }
+ else
+ {
+ if(GetTypeId() == TYPEID_PLAYER)
+ {
+ if(!RemoveUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
+ sLog.outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit %u", GetName(), charm->GetEntry(), GetCharmGUID());
+ }
+
+ if(!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
+ sLog.outCrash("Unit %u is being uncharmed, but it has another charmer %u", charm->GetEntry(), charm->GetCharmerGUID());
+
+ m_Controlled.erase(charm);
+ }
+}
- // FIXME: hack, speed must be set only at follow
- if(pet)
- for(int i = 0; i < MAX_MOVE_TYPE; ++i)
- pet->SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
+Unit* Unit::GetFirstControlled() const
+{
+ //Sequence: charmed, pet, other guardians
+ Unit *unit = GetCharm();
+ if(!unit)
+ {
+ if(uint64 guid = GetUInt64Value(UNIT_FIELD_SUMMON))
+ unit = ObjectAccessor::GetUnit(*this, guid);
+ }
+ return unit;
}
-void Unit::SetCharm(Unit* pet)
+void Unit::RemoveAllControlled()
{
+ //possessed pet and vehicle
if(GetTypeId() == TYPEID_PLAYER)
- SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet->GetGUID() : 0);
+ ((Player*)this)->StopCastingCharm();
+
+ while(!m_Controlled.empty())
+ {
+ Unit *target = *m_Controlled.begin();
+ m_Controlled.erase(m_Controlled.begin());
+ if(target->GetCharmerGUID() == GetGUID())
+ {
+ target->RemoveCharmAuras();
+ }
+ else if(target->GetOwnerGUID() == GetGUID()
+ && target->GetTypeId() == TYPEID_UNIT
+ && ((Creature*)target)->HasSummonMask(SUMMON_MASK_SUMMON))
+ {
+
+ if(!((TempSummon*)target)->isPet())
+ ((TempSummon*)target)->UnSummon();
+ }
+ else
+ {
+ sLog.outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
+ }
+ }
+ if(GetPetGUID() != GetUInt64Value(UNIT_FIELD_SUMMON))
+ sLog.outCrash("Unit %u is not able to release its summon %u", GetEntry(), GetPetGUID());
+ if(GetCharmGUID())
+ sLog.outCrash("Unit %u is not able to release its charm %u", GetEntry(), GetCharmGUID());
+}
+
+Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
+{
+ Player* player = NULL;
+ if(GetTypeId() == TYPEID_PLAYER)
+ player = (Player*)this;
+ // Should we enable this also for charmed units?
+ else if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
+ player=(Player*)GetOwner();
+
+ if (!player)
+ return NULL;
+ Group *pGroup = player->GetGroup();
+ //When there is no group check pet presence
+ if (!pGroup)
+ {
+ // We are pet now, return owner
+ if(player!=this)
+ return IsWithinDistInMap(player, radius) ? player : NULL;
+ Unit * pet = GetGuardianPet();
+ //No pet, no group, nothing to return
+ if (!pet)
+ return NULL;
+ // We are owner now, return pet
+ return IsWithinDistInMap(pet, radius) ? pet : NULL;
+ }
+
+ std::vector<Unit*> nearMembers;
+ //reserve place for players and pets because resizing vector every unit push is unefficient (vector is reallocated then)
+ nearMembers.reserve(pGroup->GetMembersCount()*2);
+
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
+
+ // IsHostileTo check duel and controlled by enemy
+ if( Target && Target !=this && Target->isAlive() && IsWithinDistInMap(Target, radius) &&
+ !IsHostileTo(Target) )
+ nearMembers.push_back(Target);
+
+ // Push player's pet to vector
+ Unit * pet = Target->GetGuardianPet();
+ if (pet && pet !=this && pet->isAlive() && IsWithinDistInMap(pet, radius) &&
+ !IsHostileTo(pet) )
+ nearMembers.push_back(pet);
+ }
+
+ if (nearMembers.empty())
+ return NULL;
+
+ uint32 randTarget = urand(0,nearMembers.size()-1);
+ return nearMembers[randTarget];
}
+//only called in Player::SetSeer
void Unit::AddPlayerToVision(Player* plr)
{
if(m_sharedVision.empty())
@@ -8191,9 +8262,9 @@ void Unit::AddPlayerToVision(Player* plr)
SetWorldObject(true);
}
m_sharedVision.push_back(plr);
- plr->SetFarsightTarget(this);
}
+//only called in Player::SetSeer
void Unit::RemovePlayerFromVision(Player* plr)
{
m_sharedVision.remove(plr);
@@ -8202,31 +8273,30 @@ void Unit::RemovePlayerFromVision(Player* plr)
setActive(false);
SetWorldObject(false);
}
- plr->ClearFarsight();
}
void Unit::RemoveBindSightAuras()
{
- RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
+ RemoveAurasByType(SPELL_AURA_BIND_SIGHT);
}
void Unit::RemoveCharmAuras()
{
- RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
- RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
- RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
+ RemoveAurasByType(SPELL_AURA_MOD_CHARM);
+ RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET);
+ RemoveAurasByType(SPELL_AURA_MOD_POSSESS);
}
void Unit::UnsummonAllTotems()
{
- for (int8 i = 0; i < MAX_TOTEM; ++i)
+ for (int8 i = 0; i < MAX_SUMMON_SLOT; ++i)
{
- if(!m_TotemSlot[i])
+ if(!m_SummonSlot[i])
continue;
- Creature *OldTotem = ObjectAccessor::GetCreature(*this, m_TotemSlot[i]);
- if (OldTotem && OldTotem->isTotem())
- ((Totem*)OldTotem)->UnSummon();
+ Creature *OldTotem = ObjectAccessor::GetCreature(*this, m_SummonSlot[i]);
+ if(OldTotem && OldTotem->isSummon())
+ ((TempSummon*)OldTotem)->UnSummon();
}
}
@@ -8238,6 +8308,7 @@ void Unit::SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool c
data.append(GetPackGUID());
data << uint32(SpellID);
data << uint32(Damage);
+ data << uint32(0); // over healing?
data << uint8(critical ? 1 : 0);
data << uint8(0); // unused in client?
SendMessageToSet(&data, true);
@@ -8254,426 +8325,319 @@ void Unit::SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Po
SendMessageToSet(&data, true);
}
-uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype)
+uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack)
{
if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE )
return pdamage;
- //if(spellProto->SchoolMask == SPELL_SCHOOL_MASK_NORMAL)
- // return pdamage;
- //damage = CalcArmorReducedDamage(pVictim, damage);
-
- int32 BonusDamage = 0;
- if( GetTypeId()==TYPEID_UNIT )
- {
- // Pets just add their bonus damage to their spell damage
- // note that their spell damage is just gain of their own auras
- if (((Creature*)this)->isPet())
- {
- BonusDamage = ((Pet*)this)->GetBonusDamage();
- }
- // For totems get damage bonus from owner (statue isn't totem in fact)
- else if (((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE)
- {
- if(Unit* owner = GetOwner())
- return owner->SpellDamageBonus(pVictim, spellProto, pdamage, damagetype);
- }
- }
-
- // Damage Done
- uint32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
-
- // Taken/Done fixed damage bonus auras
- int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto))+BonusDamage;
- int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
-
- // Damage over Time spells bonus calculation
- float DotFactor = 1.0f;
- if(damagetype == DOT)
+ // For totems get damage bonus from owner (statue isn't totem in fact)
+ if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE)
{
- int32 DotDuration = GetSpellDuration(spellProto);
- // 200% limit
- if(DotDuration > 0)
- {
- if(DotDuration > 30000) DotDuration = 30000;
- if(!IsChanneledSpell(spellProto)) DotFactor = DotDuration / 15000.0f;
- int x = 0;
- for(int j = 0; j < 3; j++)
- {
- if( spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
- spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE ||
- spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) )
- {
- x = j;
- break;
- }
- }
- int DotTicks = 6;
- if(spellProto->EffectAmplitude[x] != 0)
- DotTicks = DotDuration / spellProto->EffectAmplitude[x];
- if(DotTicks)
- {
- DoneAdvertisedBenefit /= DotTicks;
- TakenAdvertisedBenefit /= DotTicks;
- }
- }
+ if(Unit* owner = GetOwner())
+ return owner->SpellDamageBonus(pVictim, spellProto, pdamage, damagetype);
}
// Taken/Done total percent damage auras
float DoneTotalMod = 1.0f;
float TakenTotalMod = 1.0f;
+ int32 DoneTotal = 0;
+ int32 TakenTotal = 0;
// ..done
- AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
+ // Pet damage
+ if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet() )
+ DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->rank);
+
+ AuraEffectList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ for(AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
{
- if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) &&
+ if( ((*i)->GetMiscValue() & GetSpellSchoolMask(spellProto)) &&
(*i)->GetSpellProto()->EquippedItemClass == -1 &&
// -1 == any item class (not wand then)
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 )
// 0 == any inventory type (not wand then)
{
- DoneTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
}
}
uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
- AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
- for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- DoneTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
-
- // ..taken
- AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
- for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
- if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
- TakenTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
-
- // .. taken pct: scripted (increases damage of * against targets *)
- AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
- {
- switch((*i)->GetModifier()->m_miscvalue)
- {
- //Molten Fury
- case 4920: case 4919:
- if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT))
- TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; break;
- }
- }
-
- bool hasmangle=false;
- // .. taken pct: dummy auras
- AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
- for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
- {
- switch((*i)->GetSpellProto()->SpellIconID)
+ // Add flat bonus from spell damage versus
+ DoneTotal += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS, creatureTypeMask);
+ AuraEffectList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
+ for(AuraEffectList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+
+ // done scripted mod (take it from owner)
+ Unit *owner = GetOwner();
+ if (!owner) owner = this;
+ AuraEffectList const& mOverrideClassScript= owner->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
+ {
+ if (!(*i)->isAffectedOnSpell(spellProto))
+ continue;
+ switch((*i)->GetMiscValue())
{
- //Cheat Death
- case 2109:
- if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) )
- {
- if(pVictim->GetTypeId() != TYPEID_PLAYER)
- continue;
- float mod = -((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4;
- if (mod < (*i)->GetModifier()->m_amount)
- mod = (*i)->GetModifier()->m_amount;
- TakenTotalMod *= (mod+100.0f)/100.0f;
- }
+ case 4920: // Molten Fury
+ case 4919:
+ case 6917: // Death's Embrace
+ case 6926:
+ case 6928:
+ {
+ if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
+ DoneTotalMod *= (100.0f+(*i)->GetAmount())/100.0f;
break;
- //This is changed in WLK, using aura 255
- //Mangle
- case 2312:
- case 44955:
- // don't apply mod twice
- if (hasmangle)
- break;
- hasmangle=true;
- for(int j=0;j<3;j++)
- {
- if(GetEffectMechanic(spellProto, j)==MECHANIC_BLEED)
+ }
+ // Soul Siphon
+ case 4992:
+ case 4993:
+ {
+ // effect 1 m_amount
+ int32 maxPercent = (*i)->GetAmount();
+ // effect 0 m_amount
+ int32 stepPercent = CalculateSpellDamage((*i)->GetSpellProto(), 0, (*i)->GetSpellProto()->EffectBasePoints[0], this);
+ // count affliction effects and calc additional damage in percentage
+ int32 modPercent = 0;
+ AuraMap const& victimAuras = pVictim->GetAuras();
+ for (AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = itr->second->GetSpellProto();
+ if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags[1] & 0x0004071B || m_spell->SpellFamilyFlags[0] & 0x8044C402))
+ continue;
+ modPercent += stepPercent * itr->second->GetStackAmount();
+ if (modPercent >= maxPercent)
{
- TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
+ modPercent = maxPercent;
break;
}
}
+ DoneTotalMod *= (modPercent+100.0f)/100.0f;
break;
- }
- }
-
- // Distribute Damage over multiple effects, reduce by AoE
- CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );
-
- // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing
- for(int j = 0; j < 3; ++j)
- {
- if( spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
- spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH )
- {
- CastingTime /= 2;
- break;
- }
- }
-
- switch(spellProto->SpellFamilyName)
- {
- case SPELLFAMILY_GENERIC:
- // Siphon Essence - 0%
- if(spellProto->AttributesEx == 268435456 && spellProto->SpellIconID == 2027)
- {
- CastingTime = 0;
- }
- // Goblin Rocket Launcher - 0%
- else if (spellProto->SpellIconID == 184 && spellProto->Attributes == 4259840)
- {
- CastingTime = 0;
- }
- // Darkmoon Card: Vengeance - 0.1%
- else if (spellProto->SpellVisual == 9850 && spellProto->SpellIconID == 2230)
- {
- CastingTime = 3.5;
- }
- case SPELLFAMILY_MAGE:
- // Ignite - do not modify, it is (8*Rank)% damage of procing Spell
- if(spellProto->Id==12654)
- {
- return pdamage;
- }
- // Ice Lance
- else if((spellProto->SpellFamilyFlags & 0x20000LL) && spellProto->SpellIconID == 186)
- {
- CastingTime /= 3; // applied 1/3 bonuses in case generic target
- if(pVictim->isFrozen()) // and compensate this for frozen target.
- TakenTotalMod *= 3.0f;
- }
- // Pyroblast - 115% of Fire Damage, DoT - 20% of Fire Damage
- else if((spellProto->SpellFamilyFlags & 0x400000LL) && spellProto->SpellIconID == 184 )
- {
- DotFactor = damagetype == DOT ? 0.2f : 1.0f;
- CastingTime = damagetype == DOT ? 3500 : 4025;
- }
- // Fireball - 100% of Fire Damage, DoT - 0% of Fire Damage
- else if((spellProto->SpellFamilyFlags & 0x1LL) && spellProto->SpellIconID == 185)
- {
- CastingTime = 3500;
- DotFactor = damagetype == DOT ? 0.0f : 1.0f;
- }
- // Molten armor
- else if (spellProto->SpellFamilyFlags & 0x0000000800000000LL)
- {
- CastingTime = 0;
- }
- // Arcane Missiles triggered spell
- else if ((spellProto->SpellFamilyFlags & 0x200000LL) && spellProto->SpellIconID == 225)
- {
- CastingTime = 1000;
- }
- // Blizzard triggered spell
- else if ((spellProto->SpellFamilyFlags & 0x80080LL) && spellProto->SpellIconID == 285)
- {
- CastingTime = 500;
- }
- break;
- case SPELLFAMILY_WARLOCK:
- // Life Tap
- if((spellProto->SpellFamilyFlags & 0x40000LL) && spellProto->SpellIconID == 208)
- {
- CastingTime = 2800; // 80% from +shadow damage
- DoneTotalMod = 1.0f;
- TakenTotalMod = 1.0f;
- }
- // Dark Pact
- else if((spellProto->SpellFamilyFlags & 0x80000000LL) && spellProto->SpellIconID == 154 && GetPetGUID())
- {
- CastingTime = 3360; // 96% from +shadow damage
- DoneTotalMod = 1.0f;
- TakenTotalMod = 1.0f;
- }
- // Soul Fire - 115% of Fire Damage
- else if((spellProto->SpellFamilyFlags & 0x8000000000LL) && spellProto->SpellIconID == 184)
- {
- CastingTime = 4025;
- }
- // Curse of Agony - 120% of Shadow Damage
- else if((spellProto->SpellFamilyFlags & 0x0000000400LL) && spellProto->SpellIconID == 544)
- {
- DotFactor = 1.2f;
}
- // Drain Mana - 0% of Shadow Damage
- else if((spellProto->SpellFamilyFlags & 0x10LL) && spellProto->SpellIconID == 548)
+ case 6916: // Death's Embrace
+ case 6925:
+ case 6927:
+ if (HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, spellProto, this))
+ DoneTotalMod *= (100.0f+(*i)->GetAmount())/100.0f;
+ break;
+ case 5481: // Starfire Bonus
{
- CastingTime = 0;
+ if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x200002, 0))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
}
- // Drain Soul 214.3%
- else if ((spellProto->SpellFamilyFlags & 0x4000LL) && spellProto->SpellIconID == 113 )
+ case 4418: // Increased Shock Damage
+ case 4554: // Increased Lightning Damage
+ case 4555: // Improved Moonfire
+ case 5142: // Increased Lightning Damage
+ case 5147: // Improved Consecration / Libram of Resurgence
+ case 5148: // Idol of the Shooting Star
+ case 6008: // Increased Lightning Damage / Totem of Hex
{
- CastingTime = 7500;
+ DoneTotal+=(*i)->GetAmount();
+ break;
}
- // Hellfire
- else if ((spellProto->SpellFamilyFlags & 0x40LL) && spellProto->SpellIconID == 937)
+ // Tundra Stalker
+ // Merciless Combat
+ case 7277:
{
- CastingTime = damagetype == DOT ? 5000 : 500; // self damage seems to be so
+ // Merciless Combat
+ if ((*i)->GetSpellProto()->SpellIconID == 2656)
+ {
+ if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
+ DoneTotalMod *= (100.0f+(*i)->GetAmount())/100.0f;
+ }
+ else // Tundra Stalker
+ {
+ if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_DEATHKNIGHT,0, 0x04000000,0))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
+ }
+ break;
}
- // Unstable Affliction - 180%
- else if (spellProto->Id == 31117 && spellProto->SpellIconID == 232)
+ case 7293: // Rage of Rivendare
{
- CastingTime = 6300;
+ if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
}
- // Corruption 93%
- else if ((spellProto->SpellFamilyFlags & 0x2LL) && spellProto->SpellIconID == 313)
+ // Twisted Faith
+ case 7377:
{
- DotFactor = 0.93f;
+ if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID()))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
}
- break;
- case SPELLFAMILY_PALADIN:
- // Consecration - 95% of Holy Damage
- if((spellProto->SpellFamilyFlags & 0x20LL) && spellProto->SpellIconID == 51)
+ // Marked for Death
+ case 7598:
+ case 7599:
+ case 7600:
+ case 7601:
+ case 7602:
{
- DotFactor = 0.95f;
- CastingTime = 3500;
+ if (pVictim->GetAura(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
}
- // Seal of Righteousness - 10.2%/9.8% ( based on weapon type ) of Holy Damage, multiplied by weapon speed
- else if((spellProto->SpellFamilyFlags & 0x8000000LL) && spellProto->SpellIconID == 25)
- {
- Item *item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
- float wspeed = GetAttackTime(BASE_ATTACK)/1000.0f;
+ }
+ }
- if( item && item->GetProto()->InventoryType == INVTYPE_2HWEAPON)
- CastingTime = uint32(wspeed*3500*0.102f);
- else
- CastingTime = uint32(wspeed*3500*0.098f);
- }
- // Judgement of Righteousness - 73%
- else if ((spellProto->SpellFamilyFlags & 1024) && spellProto->SpellIconID == 25)
- {
- CastingTime = 2555;
- }
- // Seal of Vengeance - 17% per Fully Stacked Tick - 5 Applications
- else if ((spellProto->SpellFamilyFlags & 0x80000000000LL) && spellProto->SpellIconID == 2292)
- {
- DotFactor = 0.85f;
- CastingTime = 3500;
- }
- // Holy shield - 5% of Holy Damage
- else if ((spellProto->SpellFamilyFlags & 0x4000000000LL) && spellProto->SpellIconID == 453)
- {
- CastingTime = 175;
- }
- // Blessing of Sanctuary - 0%
- else if ((spellProto->SpellFamilyFlags & 0x10000000LL) && spellProto->SpellIconID == 29)
- {
- CastingTime = 0;
- }
- // Seal of Righteousness trigger - already computed for parent spell
- else if ( spellProto->SpellFamilyName==SPELLFAMILY_PALADIN && spellProto->SpellIconID==25 && spellProto->AttributesEx4 & 0x00800000LL )
- {
- return pdamage;
- }
- break;
- case SPELLFAMILY_SHAMAN:
- // totem attack
- if (spellProto->SpellFamilyFlags & 0x000040000000LL)
- {
- if (spellProto->SpellIconID == 33) // Fire Nova totem attack must be 21.4%(untested)
- CastingTime = 749; // ignore CastingTime and use as modifier
- else if (spellProto->SpellIconID == 680) // Searing Totem attack 8%
- CastingTime = 280; // ignore CastingTime and use as modifier
- else if (spellProto->SpellIconID == 37) // Magma totem attack must be 6.67%(untested)
- CastingTime = 234; // ignore CastingTimePenalty and use as modifier
- }
- // Lightning Shield (and proc shield from T2 8 pieces bonus ) 33% per charge
- else if( (spellProto->SpellFamilyFlags & 0x00000000400LL) || spellProto->Id == 23552)
- CastingTime = 1155; // ignore CastingTimePenalty and use as modifier
- break;
- case SPELLFAMILY_PRIEST:
- // Mana Burn - 0% of Shadow Damage
- if((spellProto->SpellFamilyFlags & 0x10LL) && spellProto->SpellIconID == 212)
- {
- CastingTime = 0;
- }
- // Mind Flay - 59% of Shadow Damage
- else if((spellProto->SpellFamilyFlags & 0x800000LL) && spellProto->SpellIconID == 548)
- {
- CastingTime = 2065;
- }
- // Holy Fire - 86.71%, DoT - 16.5%
- else if ((spellProto->SpellFamilyFlags & 0x100000LL) && spellProto->SpellIconID == 156)
- {
- DotFactor = damagetype == DOT ? 0.165f : 1.0f;
- CastingTime = damagetype == DOT ? 3500 : 3035;
- }
- // Shadowguard - 28% per charge
- else if ((spellProto->SpellFamilyFlags & 0x2000000LL) && spellProto->SpellIconID == 19)
- {
- CastingTime = 980;
- }
- // Touch of Weakeness - 10%
- else if ((spellProto->SpellFamilyFlags & 0x80000LL) && spellProto->SpellIconID == 1591)
- {
- CastingTime = 350;
- }
- // Reflective Shield (back damage) - 0% (other spells fit to check not have damage effects/auras)
- else if (spellProto->SpellFamilyFlags == 0 && spellProto->SpellIconID == 566)
- {
- CastingTime = 0;
- }
- // Holy Nova - 14%
- else if ((spellProto->SpellFamilyFlags & 0x400000LL) && spellProto->SpellIconID == 1874)
- {
- CastingTime = 500;
- }
- break;
- case SPELLFAMILY_DRUID:
- // Hurricane triggered spell
- if((spellProto->SpellFamilyFlags & 0x400000LL) && spellProto->SpellIconID == 220)
+ // Custom scripted damage
+ // Ice Lance
+ if (spellProto->SpellFamilyName == SPELLFAMILY_MAGE && spellProto->SpellIconID == 186)
+ {
+ if (pVictim->HasAuraState(AURA_STATE_FROZEN, spellProto, this))
+ DoneTotalMod *= 3.0f;
+ }
+
+ // Torment the weak
+ if (spellProto->SpellFamilyName== SPELLFAMILY_MAGE && (spellProto->SpellFamilyFlags[0]&0x20200021 || spellProto->SpellFamilyFlags[1]& 0x9000))
+ {
+ if(pVictim->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED))
+ {
+ AuraEffectList const& mDumyAuras = GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i)
{
- CastingTime = 500;
+ if ((*i)->GetSpellProto()->SpellIconID == 3263)
+ {
+ DoneTotalMod *=float((*i)->GetAmount() + 100.f) / 100.f;
+ break;
+ }
}
- break;
- case SPELLFAMILY_WARRIOR:
- case SPELLFAMILY_HUNTER:
- case SPELLFAMILY_ROGUE:
- CastingTime = 0;
- break;
- default:
- break;
+ }
}
- float LvlPenalty = CalculateLevelPenalty(spellProto);
-
- // Spellmod SpellDamage
- //float SpellModSpellDamage = 100.0f;
- float CoefficientPtc = DotFactor * 100.0f;
- if(spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL)
- CoefficientPtc *= ((float)CastingTime/3500.0f);
+ // ..taken
+ AuraEffectList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
+ for(AuraEffectList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
+ if( (*i)->GetMiscValue() & GetSpellSchoolMask(spellProto) )
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
- if(Player* modOwner = GetSpellModOwner())
- //modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_SPELL_BONUS_DAMAGE,SpellModSpellDamage);
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_SPELL_BONUS_DAMAGE,CoefficientPtc);
+ // .. taken pct: dummy auras
+ if (pVictim->GetTypeId() == TYPEID_PLAYER)
+ {
+ //Cheat Death
+ if (AuraEffect *dummy = pVictim->GetDummyAura(45182))
+ {
+ float mod = -((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4;
+ if (mod < dummy->GetAmount())
+ mod = dummy->GetAmount();
+ TakenTotalMod *= (mod+100.0f)/100.0f;
+ }
+ }
- //SpellModSpellDamage /= 100.0f;
- CoefficientPtc /= 100.0f;
+ // From caster spells
+ AuraEffectList const& mOwnerTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
+ for(AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
+ if( (*i)->GetCasterGUID() == GetGUID() && (*i)->isAffectedOnSpell(spellProto))
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
- //float DoneActualBenefit = DoneAdvertisedBenefit * (CastingTime / 3500.0f) * DotFactor * SpellModSpellDamage * LvlPenalty;
+ // Mod damage from spell mechanic
+ uint32 mechanicMask = GetAllSpellMechanicMask(spellProto);
+ if (mechanicMask)
+ {
+ AuraEffectList const& mDamageDoneMechanic = pVictim->GetAurasByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT);
+ for(AuraEffectList::const_iterator i = mDamageDoneMechanic.begin();i != mDamageDoneMechanic.end(); ++i)
+ if(mechanicMask & uint32(1<<((*i)->GetMiscValue())))
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ }
- float DoneActualBenefit = DoneAdvertisedBenefit * CoefficientPtc * LvlPenalty;
- float TakenActualBenefit = TakenAdvertisedBenefit * DotFactor * LvlPenalty;
- if(spellProto->SpellFamilyName && spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL)
- TakenActualBenefit *= ((float)CastingTime / 3500.0f);
+ // Taken/Done fixed damage bonus auras
+ int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto));
+ int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
+ // Pets just add their bonus damage to their spell damage
+ // note that their spell damage is just gain of their own auras
+ if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
+ DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage();
+
+ // Check for table values
+ float coeff;
+ SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id);
+ if (bonus)
+ {
+ if (damagetype == DOT)
+ coeff = bonus->dot_damage;
+ else
+ coeff = bonus->direct_damage;
+ if (bonus->ap_bonus)
+ DoneTotal+=bonus->ap_bonus * GetTotalAttackPowerValue(BASE_ATTACK) * stack;
+ }
+ // Default calculation
+ if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
+ {
+ if(!bonus)
+ {
+ // Damage Done from spell damage bonus
+ int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ // Damage over Time spells bonus calculation
+ float DotFactor = 1.0f;
+ if(damagetype == DOT)
+ {
+ int32 DotDuration = GetSpellDuration(spellProto);
+ // 200% limit
+ if(DotDuration > 0)
+ {
+ if(DotDuration > 30000) DotDuration = 30000;
+ if(!IsChanneledSpell(spellProto)) DotFactor = DotDuration / 15000.0f;
+ int x = 0;
+ for(int j = 0; j < 3; j++)
+ {
+ if( spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
+ spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE ||
+ spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) )
+ {
+ x = j;
+ break;
+ }
+ }
+ int32 DotTicks = 6;
+ if(spellProto->EffectAmplitude[x] != 0)
+ DotTicks = DotDuration / spellProto->EffectAmplitude[x];
+ if(DotTicks)
+ {
+ DoneAdvertisedBenefit /= DotTicks;
+ TakenAdvertisedBenefit /= DotTicks;
+ }
+ }
+ }
+ // Distribute Damage over multiple effects, reduce by AoE
+ CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );
- float tmpDamage = (float(pdamage)+DoneActualBenefit)*DoneTotalMod;
+ // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing
+ for(int j = 0; j < 3; ++j)
+ {
+ if( spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
+ spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH )
+ {
+ CastingTime /= 2;
+ break;
+ }
+ }
+ if(spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL)
+ coeff = (CastingTime / 3500.0f) * DotFactor;
+ else
+ coeff = DotFactor;
+ }
- // Add flat bonus from spell damage versus
- tmpDamage += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS, creatureTypeMask);
+ float coeff2 = CalculateLevelPenalty(spellProto) * stack;
+ if(spellProto->SpellFamilyName) //TODO: fix this
+ TakenTotal+= TakenAdvertisedBenefit * coeff * coeff2;
+ if(Player* modOwner = GetSpellModOwner())
+ {
+ coeff *= 100.0f;
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_SPELL_BONUS_DAMAGE, coeff);
+ coeff /= 100.0f;
+ }
+ DoneTotal += DoneAdvertisedBenefit * coeff * coeff2;
+ }
- // apply spellmod to Done damage
+ float tmpDamage = (pdamage + DoneTotal) * DoneTotalMod;
+ // apply spellmod to Done damage (flat and pct)
if(Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage);
- tmpDamage = (tmpDamage+TakenActualBenefit)*TakenTotalMod;
-
- if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet() )
- tmpDamage *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->rank);
+ tmpDamage = (tmpDamage + TakenTotal) * TakenTotalMod;
return tmpDamage > 0 ? uint32(tmpDamage) : 0;
}
@@ -8683,39 +8647,36 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask)
int32 DoneAdvertisedBenefit = 0;
// ..done
- AuraList const& mDamageDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
- for(AuraList::const_iterator i = mDamageDone.begin();i != mDamageDone.end(); ++i)
- if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0 &&
+ AuraEffectList const& mDamageDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
+ for(AuraEffectList::const_iterator i = mDamageDone.begin();i != mDamageDone.end(); ++i)
+ if(((*i)->GetMiscValue() & schoolMask) != 0 &&
(*i)->GetSpellProto()->EquippedItemClass == -1 &&
// -1 == any item class (not wand then)
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 )
// 0 == any inventory type (not wand then)
- DoneAdvertisedBenefit += (*i)->GetModifierValue();
+ DoneAdvertisedBenefit += (*i)->GetAmount();
if (GetTypeId() == TYPEID_PLAYER)
{
+ // Base value
+ DoneAdvertisedBenefit +=((Player*)this)->GetBaseSpellDamageBonus();
+
// Damage bonus from stats
- AuraList const& mDamageDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
- for(AuraList::const_iterator i = mDamageDoneOfStatPercent.begin();i != mDamageDoneOfStatPercent.end(); ++i)
+ AuraEffectList const& mDamageDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
+ for(AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin();i != mDamageDoneOfStatPercent.end(); ++i)
{
- if((*i)->GetModifier()->m_miscvalue & schoolMask)
+ if((*i)->GetMiscValue() & schoolMask)
{
- SpellEntry const* iSpellProto = (*i)->GetSpellProto();
- uint8 eff = (*i)->GetEffIndex();
-
- // stat used dependent from next effect aura SPELL_AURA_MOD_SPELL_HEALING presence and misc value (stat index)
- Stats usedStat = STAT_INTELLECT;
- if(eff < 2 && iSpellProto->EffectApplyAuraName[eff+1]==SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT)
- usedStat = Stats(iSpellProto->EffectMiscValue[eff+1]);
-
- DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifierValue() / 100.0f);
+ // stat used stored in miscValueB for this aura
+ Stats usedStat = Stats((*i)->GetMiscBValue());
+ DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetAmount() / 100.0f);
}
}
// ... and attack power
- AuraList const& mDamageDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER);
- for(AuraList::const_iterator i =mDamageDonebyAP.begin();i != mDamageDonebyAP.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue & schoolMask)
- DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifierValue() / 100.0f);
+ AuraEffectList const& mDamageDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER);
+ for(AuraEffectList::const_iterator i =mDamageDonebyAP.begin();i != mDamageDonebyAP.end(); ++i)
+ if ((*i)->GetMiscValue() & schoolMask)
+ DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetAmount() / 100.0f);
}
return DoneAdvertisedBenefit;
@@ -8727,16 +8688,16 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic
int32 TakenAdvertisedBenefit = 0;
// ..done (for creature type by mask) in taken
- AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
- for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- TakenAdvertisedBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
+ for(AuraEffectList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ TakenAdvertisedBenefit += (*i)->GetAmount();
// ..taken
- AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
- for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
- if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
- TakenAdvertisedBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
+ for(AuraEffectList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
+ if(((*i)->GetMiscValue() & schoolMask) != 0)
+ TakenAdvertisedBenefit += (*i)->GetAmount();
return TakenAdvertisedBenefit;
}
@@ -8765,30 +8726,87 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, schoolMask);
}
// taken
- if (pVictim && !IsPositiveSpell(spellProto->Id))
- {
- // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
- crit_chance += pVictim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
- // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
- crit_chance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE);
- // Modify by player victim resilience
- if (pVictim->GetTypeId() == TYPEID_PLAYER)
- crit_chance -= ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL);
+ if (pVictim)
+ {
+ if (!IsPositiveSpell(spellProto->Id))
+ {
+ // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
+ crit_chance += pVictim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
+ // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
+ crit_chance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE);
+ // Modify by player victim resilience
+ if (pVictim->GetTypeId() == TYPEID_PLAYER)
+ crit_chance -= ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL);
+ }
// scripted (increase crit chance ... against ... target by x%
- if(pVictim->isFrozen()) // Shatter
+ AuraEffectList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
- AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
+ if (!((*i)->isAffectedOnSpell(spellProto)))
+ continue;
+ int32 modChance=0;
+ switch((*i)->GetMiscValue())
{
- switch((*i)->GetModifier()->m_miscvalue)
+ // Shatter
+ case 911: modChance+= 16.0f;
+ case 910: modChance+= 17.0f;
+ case 849: modChance+= 17.0f;
+ if (!pVictim->HasAuraState(AURA_STATE_FROZEN, spellProto, this))
+ break;
+ crit_chance+=modChance;
+ // Fingers of Frost
+ // TODO: Change this code to less hacky
+ if (Aura * aur = GetAura(44544))
+ if (aur->DropAuraCharge())
+ RemoveAura(aur);
+ break;
+ case 7917: // Glyph of Shadowburn
+ if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
+ crit_chance+=(*i)->GetAmount();
+ break;
+ case 7997: // Renewed Hope
+ case 7998:
+ if (pVictim->HasAura(6788))
+ crit_chance+=(*i)->GetAmount();
+ break;
+ case 21: // Test of Faith
+ case 6935:
+ case 6918:
+ if (pVictim->GetHealth() < pVictim->GetMaxHealth()/2)
+ crit_chance+=(*i)->GetAmount();
+ break;
+ default:
+ break;
+ }
+ }
+ // Custom crit by class
+ switch(spellProto->SpellFamilyName)
+ {
+ case SPELLFAMILY_PALADIN:
+ // Sacred Shield
+ if (spellProto->SpellFamilyFlags[0] & 0x40000000)
{
- case 849: crit_chance+= 10.0f; break; //Shatter Rank 1
- case 910: crit_chance+= 20.0f; break; //Shatter Rank 2
- case 911: crit_chance+= 30.0f; break; //Shatter Rank 3
- case 912: crit_chance+= 40.0f; break; //Shatter Rank 4
- case 913: crit_chance+= 50.0f; break; //Shatter Rank 5
+ AuraEffect *aura = pVictim->GetDummyAura(58597);
+ if (aura && aura->GetCasterGUID() == GetGUID())
+ crit_chance+=aura->GetAmount();
+ break;
}
- }
+ break;
+ case SPELLFAMILY_SHAMAN:
+ // Lava Burst
+ if (spellProto->SpellFamilyFlags[1] & 0x00001000)
+ {
+ if (AuraEffect *flameShock = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 10000000, 0,0, GetGUID()))
+ {
+ // Consume shock aura if not have Glyph of Flame Shock
+ if (!GetAuraEffect(55447, 0))
+ pVictim->RemoveAurasDueToSpell(flameShock->GetId(), GetGUID());
+ return true;
+ }
+ break;
+ }
+ break;
+
}
}
break;
@@ -8799,7 +8817,6 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (pVictim)
{
crit_chance = GetUnitCriticalChance(attackType, pVictim);
- crit_chance+= (int32(GetMaxSkillValueForLevel(pVictim)) - int32(pVictim->GetDefenseSkillValue(this))) * 0.04f;
crit_chance+= GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, schoolMask);
}
break;
@@ -8818,7 +8835,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
return false;
}
-uint32 Unit::SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
+uint32 Unit::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
{
// Calculate critical bonus
int32 crit_bonus;
@@ -8850,233 +8867,306 @@ uint32 Unit::SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Uni
return damage;
}
-uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, Unit *pVictim)
+uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
{
+ // Calculate critical bonus
+ int32 crit_bonus;
+ switch(spellProto->DmgClass)
+ {
+ case SPELL_DAMAGE_CLASS_MELEE: // for melee based spells is 100%
+ case SPELL_DAMAGE_CLASS_RANGED:
+ // TODO: write here full calculation for melee/ranged spells
+ crit_bonus = damage;
+ break;
+ default:
+ crit_bonus = damage / 2; // for spells is 50%
+ break;
+ }
+
+
+ if(pVictim)
+ {
+ uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
+ crit_bonus = int32(crit_bonus * GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, creatureTypeMask));
+ }
+
+ if(crit_bonus > 0)
+ damage += crit_bonus;
+
+ damage = int32(float(damage) * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT));
+
+ return damage;
+}
+
+uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack)
+{
+ // No heal amount for this class spells
+ if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
+ return healamount;
+
// For totems get healing bonus from owner (statue isn't totem in fact)
if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE)
if(Unit* owner = GetOwner())
- return owner->SpellHealingBonus(spellProto, healamount, damagetype, pVictim);
+ return owner->SpellHealingBonus(pVictim, spellProto, healamount, damagetype, stack);
// Healing Done
+ // Taken/Done total percent damage auras
+ float DoneTotalMod = 1.0f;
+ float TakenTotalMod = 1.0f;
+ int32 DoneTotal = 0;
+ int32 TakenTotal = 0;
- // These Spells are doing fixed amount of healing (TODO found less hack-like check)
- if (spellProto->Id == 15290 || spellProto->Id == 39373 ||
- spellProto->Id == 33778 || spellProto->Id == 379 ||
- spellProto->Id == 38395 || spellProto->Id == 40972 ||
- spellProto->Id == 22845 || spellProto->Id == 33504 ||
- spellProto->Id == 34299 || spellProto->Id == 27813 ||
- spellProto->Id == 27817 || spellProto->Id == 27818)
- return healamount;
-
- int32 AdvertisedBenefit = SpellBaseHealingBonus(GetSpellSchoolMask(spellProto));
- uint32 CastingTime = GetSpellCastTime(spellProto);
-
- // Healing Taken
- AdvertisedBenefit += SpellBaseHealingBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
+ // Healing done percent
+ AuraEffectList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
+ for(AuraEffectList::const_iterator i = mHealingDonePct.begin();i != mHealingDonePct.end(); ++i)
+ DoneTotalMod *= (100.0f + (*i)->GetAmount()) / 100.0f;
- // Blessing of Light dummy effects healing taken from Holy Light and Flash of Light
- if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN && (spellProto->SpellFamilyFlags & 0x00000000C0000000LL))
+ // done scripted mod (take it from owner)
+ Unit *owner = GetOwner();
+ if (!owner) owner = this;
+ AuraEffectList const& mOverrideClassScript= owner->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
- AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
- for(AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
+ if (!(*i)->isAffectedOnSpell(spellProto))
+ continue;
+ switch((*i)->GetMiscValue())
{
- if((*i)->GetSpellProto()->SpellVisual == 9180)
+ case 4415: // Increased Rejuvenation Healing
+ case 4953:
+ case 3736: // Hateful Totem of the Third Wind / Increased Lesser Healing Wave / LK Arena (4/5/6) Totem of the Third Wind / Savage Totem of the Third Wind
+ DoneTotal+=(*i)->GetAmount();
+ break;
+ case 7997: // Renewed Hope
+ case 7998:
+ if (pVictim->HasAura(6788))
+ DoneTotalMod *=((*i)->GetAmount() + 100.0f)/100.0f;
+ break;
+ case 21: // Test of Faith
+ case 6935:
+ case 6918:
+ if (pVictim->GetHealth() < pVictim->GetMaxHealth()/2)
+ DoneTotalMod *=((*i)->GetAmount() + 100.0f)/100.0f;
+ break;
+ case 7798: // Glyph of Regrowth
{
- // Flash of Light
- if ((spellProto->SpellFamilyFlags & 0x0000000040000000LL) && (*i)->GetEffIndex() == 1)
- AdvertisedBenefit += (*i)->GetModifier()->m_amount;
- // Holy Light
- else if ((spellProto->SpellFamilyFlags & 0x0000000080000000LL) && (*i)->GetEffIndex() == 0)
- AdvertisedBenefit += (*i)->GetModifier()->m_amount;
+ if (pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x40, 0))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
}
- }
- }
-
- float ActualBenefit = 0.0f;
-
- if (AdvertisedBenefit != 0)
- {
- // Healing over Time spells
- float DotFactor = 1.0f;
- if(damagetype == DOT)
- {
- int32 DotDuration = GetSpellDuration(spellProto);
- if(DotDuration > 0)
+ case 8477: // Nourish Heal Boost
{
- // 200% limit
- if(DotDuration > 30000) DotDuration = 30000;
- if(!IsChanneledSpell(spellProto)) DotFactor = DotDuration / 15000.0f;
- int x = 0;
- for(int j = 0; j < 3; j++)
+ int32 stepPercent = (*i)->GetAmount();
+ int32 modPercent = 0;
+ AuraMap const& victimAuras = pVictim->GetAuras();
+ for (AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
{
- if( spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
- spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_HEAL ||
- spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) )
- {
- x = j;
- break;
- }
+ if (itr->second->GetCasterGUID()!=GetGUID())
+ continue;
+ SpellEntry const* m_spell = itr->second->GetSpellProto();
+ if ( m_spell->SpellFamilyName != SPELLFAMILY_DRUID ||
+ !(m_spell->SpellFamilyFlags[1] & 0x00000010 || m_spell->SpellFamilyFlags[0] & 0x50))
+ continue;
+ modPercent += stepPercent * itr->second->GetStackAmount();
}
- int DotTicks = 6;
- if(spellProto->EffectAmplitude[x] != 0)
- DotTicks = DotDuration / spellProto->EffectAmplitude[x];
- if(DotTicks)
- AdvertisedBenefit /= DotTicks;
+ DoneTotalMod *= (modPercent+100.0f)/100.0f;
+ break;
}
+ case 7871: // Glyph of Lesser Healing Wave
+ {
+ if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0 , 0x00000400, 0, GetGUID()))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
+ break;
+ }
+ default:
+ break;
}
+ }
- // distribute healing to all effects, reduce AoE damage
- CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );
+ // Taken/Done fixed damage bonus auras
+ int32 DoneAdvertisedBenefit = SpellBaseHealingBonus(GetSpellSchoolMask(spellProto));
+ int32 TakenAdvertisedBenefit = SpellBaseHealingBonusForVictim(GetSpellSchoolMask(spellProto), pVictim);
- // 0% bonus for damage and healing spells for leech spells from healing bonus
- for(int j = 0; j < 3; ++j)
+ // Check for table values
+ SpellBonusEntry const* bonus = spellmgr.GetSpellBonusData(spellProto->Id);
+ float coeff;
+ bool scripted = false;
+ if (bonus)
+ {
+ if (damagetype == DOT)
+ coeff = bonus->dot_damage;
+ else
+ coeff = bonus->direct_damage;
+ if (bonus->ap_bonus)
+ DoneTotal+=bonus->ap_bonus * GetTotalAttackPowerValue(BASE_ATTACK) * stack;
+ }
+ else // scripted bonus
+ {
+ // Gift of the Naaru
+ if (spellProto->Id==59547)
{
- if( spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
- spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH )
+ scripted = true;
+ uint32 apBonus = GetTotalAttackPowerValue(BASE_ATTACK);
+ if (apBonus > DoneAdvertisedBenefit)
{
- CastingTime = 0;
- break;
+ DoneTotal+=apBonus * stack;
+ coeff = 0.0f;
}
+ else
+ coeff = 1.0f;
}
+ }
- // Exception
- switch (spellProto->SpellFamilyName)
+ // Default calculation
+ if (DoneAdvertisedBenefit || TakenAdvertisedBenefit)
+ {
+ if(!bonus && !scripted)
{
- case SPELLFAMILY_SHAMAN:
- // Healing stream from totem (add 6% per tick from hill bonus owner)
- if (spellProto->SpellFamilyFlags & 0x000000002000LL)
- CastingTime = 210;
- // Earth Shield 30% per charge
- else if (spellProto->SpellFamilyFlags & 0x40000000000LL)
- CastingTime = 1050;
- break;
- case SPELLFAMILY_DRUID:
- // Lifebloom
- if (spellProto->SpellFamilyFlags & 0x1000000000LL)
- {
- CastingTime = damagetype == DOT ? 3500 : 1200;
- DotFactor = damagetype == DOT ? 0.519f : 1.0f;
- }
- // Tranquility triggered spell
- else if (spellProto->SpellFamilyFlags & 0x80LL)
- CastingTime = 667;
- // Rejuvenation
- else if (spellProto->SpellFamilyFlags & 0x10LL)
- DotFactor = 0.845f;
- // Regrowth
- else if (spellProto->SpellFamilyFlags & 0x40LL)
+ // Damage Done from spell damage bonus
+ int32 CastingTime = !IsChanneledSpell(spellProto) ? GetSpellCastTime(spellProto) : GetSpellDuration(spellProto);
+ // Damage over Time spells bonus calculation
+ float DotFactor = 1.0f;
+ if(damagetype == DOT)
+ {
+ int32 DotDuration = GetSpellDuration(spellProto);
+ // 200% limit
+ if(DotDuration > 0)
{
- DotFactor = damagetype == DOT ? 0.705f : 1.0f;
- CastingTime = damagetype == DOT ? 3500 : 1010;
+ if(DotDuration > 30000) DotDuration = 30000;
+ if(!IsChanneledSpell(spellProto)) DotFactor = DotDuration / 15000.0f;
+ int x = 0;
+ for(int j = 0; j < 3; j++)
+ {
+ if( spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
+ spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE ||
+ spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) )
+ {
+ x = j;
+ break;
+ }
+ }
+ int32 DotTicks = 6;
+ if(spellProto->EffectAmplitude[x] != 0)
+ DotTicks = DotDuration / spellProto->EffectAmplitude[x];
+ if(DotTicks)
+ {
+ DoneAdvertisedBenefit = DoneAdvertisedBenefit * int32(stack) / DotTicks;
+ TakenAdvertisedBenefit = TakenAdvertisedBenefit * int32(stack) / DotTicks;
+ }
}
- // Improved Leader of the Pack
- else if (spellProto->AttributesEx2 == 536870912 && spellProto->SpellIconID == 312
- && spellProto->AttributesEx3 == 33554432)
+ }
+ // Distribute Damage over multiple effects, reduce by AoE
+ CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );
+ // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing
+ for(int j = 0; j < 3; ++j)
+ {
+ if( spellProto->Effect[j] == SPELL_EFFECT_HEALTH_LEECH ||
+ spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH )
{
- CastingTime = 0;
+ CastingTime /= 2;
+ break;
}
- break;
- case SPELLFAMILY_PRIEST:
- // Holy Nova - 14%
- if ((spellProto->SpellFamilyFlags & 0x8000000LL) && spellProto->SpellIconID == 1874)
- CastingTime = 500;
- break;
- case SPELLFAMILY_PALADIN:
- // Seal and Judgement of Light
- if ( spellProto->SpellFamilyFlags & 0x100040000LL )
- CastingTime = 0;
- break;
- case SPELLFAMILY_WARRIOR:
- case SPELLFAMILY_ROGUE:
- case SPELLFAMILY_HUNTER:
- CastingTime = 0;
- break;
+ }
+ // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
+ coeff = (CastingTime / 3500.0f) * DotFactor * 1.88f;
}
- float LvlPenalty = CalculateLevelPenalty(spellProto);
-
- // Spellmod SpellDamage
- //float SpellModSpellDamage = 100.0f;
- float CoefficientPtc = ((float)CastingTime/3500.0f)*DotFactor*100.0f;
-
+ float coeff2 = CalculateLevelPenalty(spellProto)* stack;
+ TakenTotal += TakenAdvertisedBenefit * coeff * coeff2;
if(Player* modOwner = GetSpellModOwner())
- //modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_SPELL_BONUS_DAMAGE,SpellModSpellDamage);
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_SPELL_BONUS_DAMAGE,CoefficientPtc);
-
- //SpellModSpellDamage /= 100.0f;
- CoefficientPtc /= 100.0f;
-
- //ActualBenefit = (float)AdvertisedBenefit * ((float)CastingTime / 3500.0f) * DotFactor * SpellModSpellDamage * LvlPenalty;
- ActualBenefit = (float)AdvertisedBenefit * CoefficientPtc * LvlPenalty;
+ {
+ coeff *= 100.0f;
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_SPELL_BONUS_DAMAGE, coeff);
+ coeff /= 100.0f;
+ }
+ DoneTotal += DoneAdvertisedBenefit * coeff * coeff2;
}
// use float as more appropriate for negative values and percent applying
- float heal = healamount + ActualBenefit;
-
- // TODO: check for ALL/SPELLS type
- // Healing done percent
- AuraList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
- for(AuraList::const_iterator i = mHealingDonePct.begin();i != mHealingDonePct.end(); ++i)
- heal *= (100.0f + (*i)->GetModifierValue()) / 100.0f;
-
+ float heal = (healamount + DoneTotal)*DoneTotalMod;
// apply spellmod to Done amount
if(Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal);
+ // Nourish cast
+ if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000)
+ {
+ // Rejuvenation, Regrowth, Lifebloom, or Wild Growth
+ if (pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0))
+ //increase healing by 20%
+ TakenTotalMod *= 1.2f;
+ }
+
+ // Taken mods
// Healing Wave cast
- if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags & 0x0000000000000040LL)
+ if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[0] & 0x40)
{
- // Search for Healing Way on Victim (stack up to 3 time)
- int32 pctMod = 0;
- Unit::AuraList const& auraDummy = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr!=auraDummy.end(); ++itr)
+ // Search for Healing Way on Victim
+ Unit::AuraEffectList const& auraDummy = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator itr = auraDummy.begin(); itr!=auraDummy.end(); ++itr)
if((*itr)->GetId() == 29203)
- pctMod += (*itr)->GetModifier()->m_amount;
- // Apply bonus
- if (pctMod)
- heal = heal * (100 + pctMod) / 100;
+ TakenTotalMod *= ((*itr)->GetAmount()+100.0f) / 100.0f;
}
// Healing taken percent
float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(minval)
- heal *= (100.0f + minval) / 100.0f;
+ TakenTotalMod *= (100.0f + minval) / 100.0f;
float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if(maxval)
- heal *= (100.0f + maxval) / 100.0f;
+ TakenTotalMod *= (100.0f + maxval) / 100.0f;
+
+ if(damagetype==DOT)
+ {
+ // Healing over time taken percent
+ float minval_hot = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
+ if(minval_hot)
+ TakenTotalMod *= (100.0f + minval_hot) / 100.0f;
+
+ float maxval_hot = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
+ if(maxval_hot)
+ TakenTotalMod *= (100.0f + maxval_hot) / 100.0f;
+ }
- if (heal < 0) heal = 0;
+ AuraEffectList const& mHealingGet= pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING_RECEIVED);
+ for(AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
+ if (GetGUID()==(*i)->GetCasterGUID() && (*i)->isAffectedOnSpell(spellProto) )
+ TakenTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
- return uint32(heal);
+ heal = (heal + TakenTotal) * TakenTotalMod;
+
+ return heal < 0 ? 0 : uint32(heal);
}
int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
{
int32 AdvertisedBenefit = 0;
- AuraList const& mHealingDone = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE);
- for(AuraList::const_iterator i = mHealingDone.begin();i != mHealingDone.end(); ++i)
- if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
- AdvertisedBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mHealingDone = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE);
+ for(AuraEffectList::const_iterator i = mHealingDone.begin();i != mHealingDone.end(); ++i)
+ if(((*i)->GetMiscValue() & schoolMask) != 0)
+ AdvertisedBenefit += (*i)->GetAmount();
// Healing bonus of spirit, intellect and strength
if (GetTypeId() == TYPEID_PLAYER)
{
+ // Base value
+ AdvertisedBenefit +=((Player*)this)->GetBaseSpellHealingBonus();
+
// Healing bonus from stats
- AuraList const& mHealingDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);
- for(AuraList::const_iterator i = mHealingDoneOfStatPercent.begin();i != mHealingDoneOfStatPercent.end(); ++i)
+ AuraEffectList const& mHealingDoneOfStatPercent = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);
+ for(AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin();i != mHealingDoneOfStatPercent.end(); ++i)
{
// stat used dependent from misc value (stat index)
Stats usedStat = Stats((*i)->GetSpellProto()->EffectMiscValue[(*i)->GetEffIndex()]);
- AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifierValue() / 100.0f);
+ AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetAmount() / 100.0f);
}
// ... and attack power
- AuraList const& mHealingDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER);
- for(AuraList::const_iterator i = mHealingDonebyAP.begin();i != mHealingDonebyAP.end(); ++i)
- if ((*i)->GetModifier()->m_miscvalue & schoolMask)
- AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifierValue() / 100.0f);
+ AuraEffectList const& mHealingDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER);
+ for(AuraEffectList::const_iterator i = mHealingDonebyAP.begin();i != mHealingDonebyAP.end(); ++i)
+ if ((*i)->GetMiscValue() & schoolMask)
+ AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetAmount() / 100.0f);
}
return AdvertisedBenefit;
}
@@ -9084,14 +9174,14 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
int32 Unit::SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim)
{
int32 AdvertisedBenefit = 0;
- AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING);
- for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
- if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
- AdvertisedBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING);
+ for(AuraEffectList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
+ if(((*i)->GetMiscValue() & schoolMask) != 0)
+ AdvertisedBenefit += (*i)->GetAmount();
return AdvertisedBenefit;
}
-bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask, bool useCharges)
+bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask)
{
//If m_immuneToSchool type contain this school type, IMMUNE damage.
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
@@ -9108,7 +9198,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask, bool useCharges)
return false;
}
-bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
+bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
{
if (!spellInfo)
return false;
@@ -9129,12 +9219,15 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
return true;
}
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
- for(SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
+ if (spellInfo->Mechanic)
{
- if(itr->type == spellInfo->Mechanic)
+ SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
+ for(SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
{
- return true;
+ if(itr->type == spellInfo->Mechanic)
+ {
+ return true;
+ }
}
}
@@ -9150,18 +9243,39 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
return false;
}
-bool Unit::IsImmunedToSpellEffect(uint32 effect, uint32 mechanic) const
+bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const
{
+ if (!spellInfo)
+ return false;
//If m_immuneToEffect type contain this effect type, IMMUNE effect.
+ uint32 effect = spellInfo->Effect[index];
SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT];
for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr)
if(itr->type == effect)
return true;
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
- for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- if(itr->type == mechanic)
- return true;
+ if(uint32 mechanic = spellInfo->EffectMechanic[index])
+ {
+ SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
+ for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
+ if(itr->type == spellInfo->EffectMechanic[index])
+ return true;
+ }
+
+ if(uint32 aura = spellInfo->EffectApplyAuraName[index])
+ {
+ SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
+ for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
+ if(itr->type == aura)
+ return true;
+ // Check for immune to application of harmful magical effects
+ AuraEffectList const& immuneAuraApply = GetAurasByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
+ for(AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
+ if (spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff
+ ((*iter)->GetMiscValue() & GetSpellSchoolMask(spellInfo)) && // Check school
+ !IsPositiveEffect(spellInfo->Id, index)) // Harmful
+ return true;
+ }
return false;
}
@@ -9196,10 +9310,10 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
int32 TakenFlatBenefit = 0;
// ..done (for creature type by mask) in taken
- AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
- for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- DoneFlatBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
+ for(AuraEffectList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ DoneFlatBenefit += (*i)->GetAmount();
// ..done
// SPELL_AURA_MOD_DAMAGE_DONE included in weapon damage
@@ -9211,20 +9325,20 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
// ..done (base at attack power and creature type)
- AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS);
- for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- APbonus += (*i)->GetModifierValue();
+ AuraEffectList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS);
+ for(AuraEffectList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ APbonus += (*i)->GetAmount();
}
else
{
APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS);
// ..done (base at attack power and creature type)
- AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS);
- for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- APbonus += (*i)->GetModifierValue();
+ AuraEffectList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS);
+ for(AuraEffectList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ APbonus += (*i)->GetAmount();
}
if (APbonus!=0) // Can be negative
@@ -9246,10 +9360,10 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
}
// ..taken
- AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
- for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
- if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
- TakenFlatBenefit += (*i)->GetModifierValue();
+ AuraEffectList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
+ for(AuraEffectList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
+ if((*i)->GetMiscValue() & GetMeleeDamageSchoolMask())
+ TakenFlatBenefit += (*i)->GetAmount();
if(attType!=RANGED_ATTACK)
TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN);
@@ -9257,39 +9371,39 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN);
// Done/Taken total percent damage auras
- float DoneTotalMod = 1;
- float TakenTotalMod = 1;
+ float DoneTotalMod = 1.0f;
+ float TakenTotalMod = 1.0f;
// ..done
// SPELL_AURA_MOD_DAMAGE_PERCENT_DONE included in weapon damage
// SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT included in weapon damage
- AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
- for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
- if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- DoneTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
+ AuraEffectList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
+ for(AuraEffectList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
+ if(creatureTypeMask & uint32((*i)->GetMiscValue()))
+ DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
// ..taken
- AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
- for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
- if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
- TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
+ AuraEffectList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
+ for(AuraEffectList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
+ if((*i)->GetMiscValue() & GetMeleeDamageSchoolMask())
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
// .. taken pct: dummy auras
- AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
- for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
+ AuraEffectList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
{
switch((*i)->GetSpellProto()->SpellIconID)
{
//Cheat Death
case 2109:
- if((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
+ if((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
{
if(pVictim->GetTypeId() != TYPEID_PLAYER)
continue;
float mod = ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f);
- if (mod < (*i)->GetModifier()->m_amount)
- mod = (*i)->GetModifier()->m_amount;
+ if (mod < (*i)->GetAmount())
+ mod = (*i)->GetAmount();
TakenTotalMod *= (mod+100.0f)/100.0f;
}
break;
@@ -9298,22 +9412,22 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
if(spellProto==NULL)
break;
// Should increase Shred (initial Damage of Lacerate and Rake handled in Spell::EffectSchoolDMG)
- if(spellProto->SpellFamilyName==SPELLFAMILY_DRUID && (spellProto->SpellFamilyFlags==0x00008000LL))
- TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
+ if(spellProto->SpellFamilyName==SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags.IsEqual (0x00008000,0,0))
+ TakenTotalMod *= (100.0f+(*i)->GetAmount())/100.0f;
break;
}
}
// .. taken pct: class scripts
- AuraList const& mclassScritAuras = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(AuraList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i)
+ AuraEffectList const& mclassScritAuras = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i)
{
switch((*i)->GetMiscValue())
{
case 6427: case 6428: // Dirty Deeds
- if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
+ if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this))
{
- Aura* eff0 = GetAura((*i)->GetId(),0);
+ AuraEffect* eff0 = GetAuraEffect((*i)->GetId(),0,GetGUID());
if(!eff0 || (*i)->GetEffIndex()!=1)
{
sLog.outError("Spell structure of DD (%u) changed.",(*i)->GetId());
@@ -9321,7 +9435,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
}
// effect 0 have expected value but in negative state
- TakenTotalMod *= (-eff0->GetModifier()->m_amount+100.0f)/100.0f;
+ TakenTotalMod *= (-eff0->GetAmount()+100.0f)/100.0f;
}
break;
}
@@ -9329,15 +9443,15 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
if(attType != RANGED_ATTACK)
{
- AuraList const& mModMeleeDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT);
- for(AuraList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i)
- TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
+ AuraEffectList const& mModMeleeDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT);
+ for(AuraEffectList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i)
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
}
else
{
- AuraList const& mModRangedDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT);
- for(AuraList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i)
- TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
+ AuraEffectList const& mModRangedDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT);
+ for(AuraEffectList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i)
+ TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
}
float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod;
@@ -9392,7 +9506,23 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty
ApplySpellImmune(spellProto->Id,IMMUNITY_DISPEL, type, apply);
if (apply && spellProto->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
- RemoveAurasWithDispelType(type);
+ {
+ // Create dispel mask by dispel type
+ uint32 dispelMask = GetDispellMask(type);
+ // Dispel all existing auras vs current dispel type
+ AuraMap& auras = GetAuras();
+ for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); )
+ {
+ SpellEntry const* spell = itr->second->GetSpellProto();
+ if( (1<<spell->Dispel) & dispelMask )
+ {
+ // Dispel aura
+ RemoveAura(itr);
+ }
+ else
+ ++itr;
+ }
+ }
}
float Unit::GetWeaponProcChance() const
@@ -9406,10 +9536,15 @@ float Unit::GetWeaponProcChance() const
return 0;
}
-float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const
+float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * spellProto) const
{
// proc per minute chance calculation
if (PPM <= 0) return 0.0f;
+ // Apply chance modifer aura
+ if (spellProto)
+ if(Player* modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,PPM);
+
uint32 result = uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
return result;
}
@@ -9427,21 +9562,7 @@ void Unit::Mount(uint32 mount)
// unsummon pet
if(GetTypeId() == TYPEID_PLAYER)
- {
- Pet* pet = GetPet();
- if(pet)
- {
- if(pet->isControlled())
- {
- ((Player*)this)->SetTemporaryUnsummonedPetNumber(pet->GetCharmInfo()->GetPetNumber());
- ((Player*)this)->SetOldPetSpell(pet->GetUInt32Value(UNIT_CREATED_BY_SPELL));
- }
-
- ((Player*)this)->RemovePet(NULL,PET_SAVE_NOT_IN_SLOT);
- }
- else
- ((Player*)this)->SetTemporaryUnsummonedPetNumber(0);
- }
+ ((Player*)this)->UnsummonPetTemporaryIfAny();
}
void Unit::Unmount()
@@ -9457,14 +9578,8 @@ void Unit::Unmount()
// only resummon old pet if the player is already added to a map
// this prevents adding a pet to a not created map which would otherwise cause a crash
// (it could probably happen when logging in after a previous crash)
- if(GetTypeId() == TYPEID_PLAYER && IsInWorld() && ((Player*)this)->GetTemporaryUnsummonedPetNumber() && isAlive())
- {
- Pet* NewPet = new Pet;
- if(!NewPet->LoadPetFromDB(this, 0, ((Player*)this)->GetTemporaryUnsummonedPetNumber(), true))
- delete NewPet;
-
- ((Player*)this)->SetTemporaryUnsummonedPetNumber(0);
- }
+ if(GetTypeId() == TYPEID_PLAYER)
+ ((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
}
void Unit::SetInCombatWith(Unit* enemy)
@@ -9492,14 +9607,14 @@ void Unit::SetInCombatWith(Unit* enemy)
void Unit::CombatStart(Unit* target)
{
if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/)
- target->SetStandState(PLAYER_STATE_NONE);
+ target->SetStandState(UNIT_STAND_STATE_STAND);
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
&& !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled)
{
((Creature*)target)->AI()->AttackStart(this);
if(((Creature*)target)->GetFormation())
- {
+ {
((Creature*)target)->GetFormation()->MemberAttackStart((Creature*)target, this);
sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);");
}
@@ -9520,7 +9635,6 @@ void Unit::CombatStart(Unit* target)
me->UpdatePvP(true);
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
}
-
}
void Unit::SetInCombatState(bool PvP)
@@ -9560,6 +9674,8 @@ void Unit::ClearInCombat()
// Player's state will be cleared in Player::UpdateContestedPvP
if(GetTypeId()!=TYPEID_PLAYER)
clearUnitState(UNIT_STAT_ATTACK_PLAYER);
+ else
+ ((Player*)this)->UpdatePotionCooldown();
if(GetTypeId() != TYPEID_PLAYER && ((Creature*)this)->isPet())
{
@@ -9617,7 +9733,7 @@ bool Unit::isAttackableByAOE() const
if(GetTypeId()==TYPEID_PLAYER && ((Player *)this)->isGameMaster())
return false;
- return !isInFlight();
+ return !hasUnitState(UNIT_STAT_UNATTACKABLE);
}
int32 Unit::ModifyHealth(int32 dVal)
@@ -9701,8 +9817,8 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
{
if(m_invisibilityMask & u->m_invisibilityMask) // same group
return true;
- AuraList const& auras = u->GetAurasByType(SPELL_AURA_MOD_STALKED); // Hunter mark
- for(AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
+ AuraEffectList const& auras = u->GetAurasByType(SPELL_AURA_MOD_STALKED); // Hunter mark
+ for(AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID()==GetGUID())
return true;
@@ -9715,10 +9831,10 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
// find invisibility level
uint32 invLevel = 0;
- Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
- for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
- if(((*itr)->GetModifier()->m_miscvalue)==i && invLevel < (*itr)->GetModifier()->m_amount)
- invLevel = (*itr)->GetModifier()->m_amount;
+ Unit::AuraEffectList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
+ for(Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
+ if(((*itr)->GetMiscValue())==i && invLevel < (*itr)->GetAmount())
+ invLevel = (*itr)->GetAmount();
// find invisibility detect level
uint32 detectLevel = 0;
@@ -9728,10 +9844,10 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
}
else
{
- Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
- for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
- if(((*itr)->GetModifier()->m_miscvalue)==i && detectLevel < (*itr)->GetModifier()->m_amount)
- detectLevel = (*itr)->GetModifier()->m_amount;
+ Unit::AuraEffectList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
+ for(Unit::AuraEffectList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
+ if(((*itr)->GetMiscValue())==i && detectLevel < (*itr)->GetAmount())
+ detectLevel = (*itr)->GetAmount();
}
if(invLevel <= detectLevel)
@@ -9753,8 +9869,8 @@ bool Unit::canDetectStealthOf(Unit const* target, float distance) const
if(HasAuraType(SPELL_AURA_DETECT_STEALTH))
return true;
- AuraList const& auras = target->GetAurasByType(SPELL_AURA_MOD_STALKED); // Hunter mark
- for(AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
+ AuraEffectList const& auras = target->GetAurasByType(SPELL_AURA_MOD_STALKED); // Hunter mark
+ for(AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID()==GetGUID())
return true;
@@ -9776,7 +9892,7 @@ void Unit::DestroyForNearbyPlayers()
std::list<Unit*> targets;
Trinity::AnyUnitInObjectRangeCheck check(this, World::GetMaxVisibleDistance());
- Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(targets, check);
+ Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(this, targets, check);
VisitNearbyWorldObject(World::GetMaxVisibleDistance(), searcher);
for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
if(*iter != this && (*iter)->GetTypeId() == TYPEID_PLAYER
@@ -9900,38 +10016,37 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
propagateSpeedChange();
- // Send speed change packet only for player
- if (GetTypeId()!=TYPEID_PLAYER)
- return;
-
WorldPacket data;
if(!forced)
{
switch(mtype)
{
case MOVE_WALK:
- data.Initialize(MSG_MOVE_SET_WALK_SPEED, 8+4+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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+1+4+4+4+4+4+4+4);
+ 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:
sLog.outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype);
@@ -9939,22 +10054,30 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
}
data.append(GetPackGUID());
- data << uint32(0); //movement flags
- data << uint8(0); //unk
+ data << uint32(0); // movement flags
+ data << uint16(0); // unk flags
data << uint32(getMSTime());
data << float(GetPositionX());
data << float(GetPositionY());
data << float(GetPositionZ());
data << float(GetOrientation());
- data << uint32(0); //flag unk
+ data << uint32(0); // fall time
data << float(GetSpeed(mtype));
SendMessageToSet( &data, true );
}
else
{
- // register forced speed changes for WorldSession::HandleForceSpeedChangeAck
- // and do it only for real sent packets and use run for run/mounted as client expected
- ++((Player*)this)->m_forced_speed_changes[mtype];
+ 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
+ ++((Player*)this)->m_forced_speed_changes[mtype];
+
+ if(!isInCombat())
+ if(Pet* pet = ((Player*)this)->GetPet())
+ pet->SetSpeed(mtype, m_speed_rate[mtype], forced);
+ }
+
switch(mtype)
{
case MOVE_WALK:
@@ -9981,6 +10104,9 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
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:
sLog.outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype);
return;
@@ -9992,9 +10118,6 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data << float(GetSpeed(mtype));
SendMessageToSet( &data, true );
}
- if(GetPetGUID() && !isInCombat())
- if(Pet* pet = GetPet())
- pet->SetSpeed(mtype, m_speed_rate[mtype], forced);
}
void Unit::SetHover(bool on)
@@ -10020,8 +10143,11 @@ void Unit::setDeathState(DeathState s)
if (s == JUST_DIED)
{
- RemoveAllAurasOnDeath();
UnsummonAllTotems();
+ RemoveAllControlled();
+ RemoveAllAurasOnDeath();
+ if(m_Vehicle) m_Vehicle->RemovePassenger(this);
+ //This is needed to clear visible auras after unit dies
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
@@ -10065,6 +10191,10 @@ bool Unit::CanHaveThreatList() const
if( ((Creature*)this)->isTotem() )
return false;
+ // vehicles can not have threat list
+ if( ((Creature*)this)->isVehicle() )
+ return false;
+
// pets can not have a threat list, unless they are controlled by a creature
if( ((Creature*)this)->isPet() && IS_PLAYER_GUID(((Pet*)this)->GetOwnerGUID()) )
return false;
@@ -10169,18 +10299,44 @@ Unit* Creature::SelectVictim()
//or who does not have threat (totem/pet/critter)
//otherwise enterevademode every update
- Unit* target = NULL;
- if(!m_ThreatManager.isThreatListEmpty())
+
+ Unit* target = NULL;
+ // First checking if we have some taunt on us
+ const AuraEffectList& tauntAuras = GetAurasByType(SPELL_AURA_MOD_TAUNT);
+ if ( !tauntAuras.empty() )
{
- if(!HasAuraType(SPELL_AURA_MOD_TAUNT))
+ Unit* caster;
+
+ // The last taunt aura caster is alive an we are happy to attack him
+ if ( (caster = tauntAuras.back()->GetCaster()) && caster->isAlive() )
+ return getVictim();
+ else if (tauntAuras.size() > 1)
{
- target = m_ThreatManager.getHostilTarget();
+ // We do not have last taunt aura caster but we have more taunt auras,
+ // so find first available target
+
+ // Auras are pushed_back, last caster will be on the end
+ AuraEffectList::const_iterator aura = --tauntAuras.end();
+ do
+ {
+ --aura;
+ if ( (caster = (*aura)->GetCaster()) &&
+ caster->IsInMap(this) && canAttack(caster) && caster->isInAccessiblePlaceFor((Creature*)this) )
+ {
+ target = caster;
+ break;
+ }
+ }while (aura != tauntAuras.begin());
}
else
target = getVictim();
}
+ if ( !target && !m_ThreatManager.isThreatListEmpty() )
+ // No taunt aura or taunt aura caster is dead standart target selection
+ target = m_ThreatManager.getHostilTarget();
+
if(target)
{
if(!hasUnitState(UNIT_STAT_STUNNED))
@@ -10213,9 +10369,9 @@ Unit* Creature::SelectVictim()
if(m_invisibilityMask)
{
- Unit::AuraList const& iAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
- for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
- if((*itr)->IsPermanent())
+ Unit::AuraEffectList const& iAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
+ for(Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
+ if((*itr)->GetParentAura()->IsPermanent())
{
AI()->EnterEvadeMode();
break;
@@ -10252,8 +10408,11 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel);
float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index];
- // prevent random generator from getting confused by spells casted with Unit::CastCustomSpell
- int32 randvalue = spellProto->EffectBaseDice[effect_index] >= randomPoints ? spellProto->EffectBaseDice[effect_index]:irand(spellProto->EffectBaseDice[effect_index], randomPoints);
+ // range can have possitive and negative values, so order its for irand
+ int32 randvalue = int32(spellProto->EffectBaseDice[effect_index]) >= randomPoints
+ ? irand(randomPoints, int32(spellProto->EffectBaseDice[effect_index]))
+ : irand(int32(spellProto->EffectBaseDice[effect_index]), randomPoints);
+
int32 value = basePoints + randvalue;
//random damage
if(comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/)
@@ -10286,7 +10445,7 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
return value;
}
-int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target)
+int32 Unit::CalcSpellDuration(SpellEntry const* spellProto)
{
Player* unitPlayer = (GetTypeId() == TYPEID_PLAYER) ? (Player*)this : NULL;
@@ -10302,14 +10461,24 @@ int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_in
else
duration = minduration;
- if (duration > 0)
+ return duration;
+}
+
+int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, int32 duration, bool positive)
+{
+ //don't mod permament auras duration
+ if (duration<0)
+ return duration;
+
+ //cut duration only of negative effects
+ if (!positive)
{
- int32 mechanic = GetEffectMechanic(spellProto, effect_index);
+ int32 mechanic = spellProto->Mechanic;
+
// Find total mod value (negative bonus)
int32 durationMod_always = target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD, mechanic);
// Find max mod (negative bonus)
int32 durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, mechanic);
-
int32 durationMod = 0;
// Select strongest negative mod
if (durationMod_always > durationMod_not_stack)
@@ -10318,12 +10487,41 @@ int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_in
durationMod = durationMod_always;
if (durationMod != 0)
- duration = int32(int64(duration) * (100+durationMod) /100);
+ duration = int32( float (duration) * float(100.0f+durationMod) /100.0f);
+
+ // there are only negative mods currently
+ durationMod_always =target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL, spellProto->Dispel);
+ durationMod_not_stack=target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK, spellProto->Dispel);
+
+ durationMod=0;
+ if (durationMod_always > durationMod_not_stack)
+ durationMod += durationMod_not_stack;
+ else
+ durationMod += durationMod_always;
- if (duration < 0) duration = 0;
+ if (durationMod != 0)
+ duration = int32( float (duration) * float(100.0f+durationMod) /100.0f);
}
+ //else positive mods here, there are no currently
+ //when there will be, change GetTotalAuraModifierByMiscValue to GetTotalPositiveAuraModifierByMiscValue
+ return duration>0 ? duration : 0;
+}
- return duration;
+void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell const * spell)
+{
+ if (!spellProto || castTime<0)
+ return;
+ //called from caster
+ if(Player* modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell);
+
+ if( !(spellProto->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_UNK5)) && spellProto->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && spellProto->SpellFamilyName)
+ castTime = int32( float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
+ else
+ {
+ if (spellProto->Attributes & SPELL_ATTR_RANGED && !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG))
+ castTime = int32 (float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
+ }
}
DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
@@ -10357,21 +10555,15 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
void Unit::IncrDiminishing(DiminishingGroup group)
{
// Checking for existing in the table
- bool IsExist = false;
for(Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i)
{
if(i->DRGroup != group)
continue;
-
- IsExist = true;
if(i->hitCount < DIMINISHING_LEVEL_IMMUNE)
i->hitCount += 1;
-
- break;
+ return;
}
-
- if(!IsExist)
- m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2));
+ m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2));
}
void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level)
@@ -10420,17 +10612,50 @@ void Unit::ApplyDiminishingAura( DiminishingGroup group, bool apply )
if(i->DRGroup != group)
continue;
- i->hitTime = getMSTime();
-
if(apply)
i->stack += 1;
else if(i->stack)
+ {
i->stack -= 1;
-
+ // Remember time after last aura from group removed
+ if (i->stack == 0)
+ i->hitTime = getMSTime();
+ }
break;
}
}
+uint32 Unit::GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry)
+{
+ if (!rangeEntry)
+ return 0;
+ if (rangeEntry->maxRangeHostile == rangeEntry->maxRangeFriend)
+ return rangeEntry->maxRangeFriend;
+ if (IsHostileTo(target))
+ return rangeEntry->maxRangeHostile;
+ return rangeEntry->maxRangeFriend;
+};
+uint32 Unit::GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry)
+{
+ if (!rangeEntry)
+ return 0;
+ if (rangeEntry->minRangeHostile == rangeEntry->minRangeFriend)
+ return rangeEntry->minRangeFriend;
+ if (IsHostileTo(target))
+ return rangeEntry->minRangeHostile;
+ return rangeEntry->minRangeFriend;
+};
+uint32 Unit::GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry)
+{
+ if (!radiusEntry)
+ return 0;
+ if (radiusEntry->radiusHostile == radiusEntry->radiusFriend)
+ return radiusEntry->radiusFriend;
+ if (IsHostileTo(target))
+ return radiusEntry->radiusHostile;
+ return radiusEntry->radiusFriend;
+};
+
Unit* Unit::GetUnit(WorldObject& object, uint64 guid)
{
return ObjectAccessor::GetUnit(object,guid);
@@ -10448,14 +10673,14 @@ Creature* Unit::GetCreature(WorldObject& object, uint64 guid)
bool Unit::isVisibleForInState( Player const* u, bool inVisibleList ) const
{
- return isVisibleForOrDetect(u, false, inVisibleList, false);
+ return u->canSeeOrDetect(this, false, inVisibleList, false);
}
uint32 Unit::GetCreatureType() const
{
if(GetTypeId() == TYPEID_PLAYER)
{
- SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(((Player*)this)->m_form);
+ SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(m_form);
if(ssEntry && ssEntry->creatureType > 0)
return ssEntry->creatureType;
else
@@ -10518,7 +10743,9 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
case UNIT_MOD_RAGE:
case UNIT_MOD_FOCUS:
case UNIT_MOD_ENERGY:
- case UNIT_MOD_HAPPINESS: UpdateMaxPower(GetPowerTypeByAuraGroup(unitMod)); break;
+ case UNIT_MOD_HAPPINESS:
+ case UNIT_MOD_RUNE:
+ case UNIT_MOD_RUNIC_POWER: UpdateMaxPower(GetPowerTypeByAuraGroup(unitMod)); break;
case UNIT_MOD_RESISTANCE_HOLY:
case UNIT_MOD_RESISTANCE_FIRE:
@@ -10545,7 +10772,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
{
if( unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog.outError("ERROR: trial to access non existed modifier value from UnitMods!");
+ sLog.outError("trial to access non existed modifier value from UnitMods!");
return 0.0f;
}
@@ -10575,7 +10802,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
{
if(unitMod >= UNIT_MOD_END)
{
- sLog.outError("ERROR: trial to access non existed UnitMods in GetTotalAuraModValue()!");
+ sLog.outError("trial to access non existed UnitMods in GetTotalAuraModValue()!");
return 0.0f;
}
@@ -10631,32 +10858,36 @@ Stats Unit::GetStatByAuraGroup(UnitMods unitMod) const
Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const
{
- Powers power = POWER_MANA;
-
switch(unitMod)
{
- case UNIT_MOD_MANA: power = POWER_MANA; break;
- case UNIT_MOD_RAGE: power = POWER_RAGE; break;
- case UNIT_MOD_FOCUS: power = POWER_FOCUS; break;
- case UNIT_MOD_ENERGY: power = POWER_ENERGY; break;
- case UNIT_MOD_HAPPINESS: power = POWER_HAPPINESS; break;
-
- default:
- break;
+ case UNIT_MOD_MANA: return POWER_MANA;
+ case UNIT_MOD_RAGE: return POWER_RAGE;
+ case UNIT_MOD_FOCUS: return POWER_FOCUS;
+ case UNIT_MOD_ENERGY: return POWER_ENERGY;
+ case UNIT_MOD_HAPPINESS: return POWER_HAPPINESS;
+ case UNIT_MOD_RUNE: return POWER_RUNE;
+ case UNIT_MOD_RUNIC_POWER:return POWER_RUNIC_POWER;
}
- return power;
+ return POWER_MANA;
}
float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const
{
- UnitMods unitMod = (attType == RANGED_ATTACK) ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
-
- float val = GetTotalAuraModValue(unitMod);
- if(val < 0.0f)
- val = 0.0f;
-
- return val;
+ if (attType == RANGED_ATTACK)
+ {
+ int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS);
+ if (ap < 0)
+ return 0.0f;
+ return ap * (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER));
+ }
+ else
+ {
+ int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS);
+ if (ap < 0)
+ return 0.0f;
+ return ap * (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER));
+ }
}
float Unit::GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const
@@ -10744,6 +10975,12 @@ void Unit::SetPower(Powers power, uint32 val)
SetStatInt32Value(UNIT_FIELD_POWER1 + power, val);
+ WorldPacket data(SMSG_POWER_UPDATE);
+ data.append(GetPackGUID());
+ data << uint8(power);
+ data << uint32(val);
+ SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false);
+
// group update
if(GetTypeId() == TYPEID_PLAYER)
{
@@ -10838,15 +11075,6 @@ void Unit::ApplyMaxPowerMod(Powers power, uint32 val, bool apply)
}
}
-void Unit::ApplyAuraProcTriggerDamage( Aura* aura, bool apply )
-{
- AuraList& tAuraProcTriggerDamage = m_modAuras[SPELL_AURA_PROC_TRIGGER_DAMAGE];
- if(apply)
- tAuraProcTriggerDamage.push_back(aura);
- else
- tAuraProcTriggerDamage.remove(aura);
-}
-
uint32 Unit::GetCreatePowers( Powers power ) const
{
// POWER_FOCUS and POWER_HAPPINESS only have hunter pet
@@ -10857,6 +11085,7 @@ uint32 Unit::GetCreatePowers( Powers power ) const
case POWER_FOCUS: return (GetTypeId()==TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType()!=HUNTER_PET ? 0 : 100);
case POWER_ENERGY: return 100;
case POWER_HAPPINESS: return (GetTypeId()==TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType()!=HUNTER_PET ? 0 : 1050000);
+ case POWER_RUNIC_POWER: return 1000;
}
return 0;
@@ -10876,22 +11105,32 @@ void Unit::AddToWorld()
void Unit::RemoveFromWorld()
{
// cleanup
+ assert(GetGUID());
+
if(IsInWorld())
{
+ UnsummonAllTotems();
+ RemoveAllControlled();
RemoveCharmAuras();
RemoveBindSightAuras();
RemoveNotOwnSingleTargetAuras();
+ if(m_Vehicle) m_Vehicle->RemovePassenger(this);
+
+ if(GetCharmerGUID())
+ sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry());
+
WorldObject::RemoveFromWorld();
}
}
void Unit::CleanupsBeforeDelete()
{
- assert(m_uint32Values);
+ assert(GetGUID());
//A unit may be in removelist and not in world, but it is still in grid
//and may have some references during delete
RemoveAllAuras();
+ _DeleteAuras();
InterruptNonMeleeSpells(true);
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
CombatStop();
@@ -11002,7 +11241,7 @@ void CharmInfo::InitEmptyActionBar(bool withAttack)
for(uint32 x = 0; x < 10; ++x)
{
- PetActionBar[x].Type = ACT_CAST;
+ PetActionBar[x].Type = ACT_PASSIVE;
PetActionBar[x].SpellOrAction = 0;
}
if (withAttack)
@@ -11024,7 +11263,7 @@ void CharmInfo::InitPossessCreateSpells()
if(IsPassiveSpell(spellid))
m_unit->CastSpell(m_unit, spellid, true);
else
- AddSpellToAB(0, spellid, ACT_CAST);
+ AddSpellToAB(0, spellid, ACT_DISABLED);
}
}
}
@@ -11039,7 +11278,7 @@ void CharmInfo::InitCharmCreateSpells()
InitPetActionBar();
- for(uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x)
+ for(uint32 x = 0; x < MAX_SPELL_CHARM; ++x)
{
uint32 spellId = ((Creature*)m_unit)->m_spells[x];
m_charmspells[x].spellId = spellId;
@@ -11068,7 +11307,7 @@ void CharmInfo::InitCharmCreateSpells()
if(onlyselfcast || !IsPositiveSpell(spellId)) //only self cast and spells versus enemies are autocastable
newstate = ACT_DISABLED;
else
- newstate = ACT_CAST;
+ newstate = ACT_PASSIVE;
AddSpellToAB(0, spellId, newstate);
}
@@ -11079,7 +11318,7 @@ bool CharmInfo::AddSpellToAB(uint32 oldid, uint32 newid, ActiveStates newstate)
{
for(uint8 i = 0; i < 10; i++)
{
- if((PetActionBar[i].Type == ACT_DISABLED || PetActionBar[i].Type == ACT_ENABLED || PetActionBar[i].Type == ACT_CAST) && PetActionBar[i].SpellOrAction == oldid)
+ if((PetActionBar[i].Type == ACT_DISABLED || PetActionBar[i].Type == ACT_ENABLED || PetActionBar[i].Type == ACT_PASSIVE) && PetActionBar[i].SpellOrAction == oldid)
{
PetActionBar[i].SpellOrAction = newid;
if(!oldid)
@@ -11101,7 +11340,7 @@ void CharmInfo::ToggleCreatureAutocast(uint32 spellid, bool apply)
if(IsPassiveSpell(spellid))
return;
- for(uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x)
+ for(uint32 x = 0; x < MAX_SPELL_CHARM; ++x)
{
if(spellid == m_charmspells[x].spellId)
{
@@ -11121,209 +11360,29 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow)
bool Unit::isFrozen() const
{
- AuraList const& mRoot = GetAurasByType(SPELL_AURA_MOD_ROOT);
- for(AuraList::const_iterator i = mRoot.begin(); i != mRoot.end(); ++i)
- if( GetSpellSchoolMask((*i)->GetSpellProto()) & SPELL_SCHOOL_MASK_FROST)
- return true;
- return false;
+ return HasAuraState(AURA_STATE_FROZEN);
}
-/*
struct ProcTriggeredData
{
- ProcTriggeredData(Aura* _triggeredByAura, uint32 _cooldown)
- : triggeredByAura(_triggeredByAura),
- triggeredByAura_SpellPair(Unit::spellEffectPair(triggeredByAura->GetId(),triggeredByAura->GetEffIndex())),
- cooldown(_cooldown)
- {}
-
- Aura* triggeredByAura; // triggred aura, can be invalidate at triggered aura proccessing
- Unit::spellEffectPair triggeredByAura_SpellPair; // spell pair, used for re-find aura (by pointer comparison in range)
- uint32 cooldown; // possible hidden cooldown
-};
-
-typedef std::list< ProcTriggeredData > ProcTriggeredList;
-
-void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask )
-{
- for(AuraTypeSet::const_iterator aur = procAuraTypes.begin(); aur != procAuraTypes.end(); ++aur)
+ ProcTriggeredData(Aura* _aura)
+ : aura(_aura)
{
- // List of spells (effects) that proceed. Spell prototype and aura-specific value (damage for TRIGGER_DAMAGE)
- ProcTriggeredList procTriggered;
-
- AuraList const& auras = GetAurasByType(*aur);
- for(AuraList::const_iterator i = auras.begin(), next; i != auras.end(); i = next)
- {
- next = i; ++next;
-
- Aura* i_aura = *i;
-
- uint32 cooldown; // returned at next line
- if(!IsTriggeredAtSpellProcEvent(i_aura->GetSpellProto(), procSpell, procFlag,attType,isVictim,cooldown))
- continue;
-
- procTriggered.push_back( ProcTriggeredData(i_aura, cooldown) );
- }
-
- // Handle effects proceed this time
- for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
- {
- // Some auras can be deleted in function called in this loop (except first, ofc)
- // Until storing auras in std::multimap to hard check deleting by another way
- if(i != procTriggered.begin())
- {
- bool found = false;
- AuraMap::const_iterator lower = GetAuras().lower_bound(i->triggeredByAura_SpellPair);
- AuraMap::const_iterator upper = GetAuras().upper_bound(i->triggeredByAura_SpellPair);
- for(AuraMap::const_iterator itr = lower; itr!= upper; ++itr)
- {
- if(itr->second==i->triggeredByAura)
- {
- found = true;
- break;
- }
- }
-
- if(!found)
- {
- sLog.outError("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler",*aur,i->triggeredByAura_SpellPair.first,i->triggeredByAura_SpellPair.second);
- sLog.outError("It can be deleted one from early processed auras:");
- for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2)
- sLog.outError(" Spell aura %u (id:%u effect:%u)",*aur,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second);
- sLog.outError(" <end of list>");
- continue;
- }
- }
-
- /// this is aura triggering code call
- Aura* triggeredByAura = i->triggeredByAura;
-
- /// save charges existence before processing to prevent crash at access to deleted triggered aura after
- /// used in speedup code check before check aura existance.
- bool triggeredByAuraWithCharges = triggeredByAura->m_procCharges > 0;
-
- /// success in event proccesing
- /// used in speedup code check before check aura existance.
- bool casted = false;
-
- /// process triggered code
- switch(*aur)
- {
- case SPELL_AURA_PROC_TRIGGER_SPELL:
- {
- sLog.outDebug("ProcDamageAndSpell: casting spell (triggered by %s proc aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- casted = HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, attType, i->cooldown);
- break;
- }
- case SPELL_AURA_PROC_TRIGGER_DAMAGE:
- {
- uint32 triggered_damage = triggeredByAura->GetModifier()->m_amount;
- sLog.outDebug("ProcDamageAndSpell: doing %u damage (triggered by %s aura of spell %u)",
- triggered_damage, (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- SpellNonMeleeDamageLog(pTarget, triggeredByAura->GetId(), triggered_damage, true, true);
- casted = true;
- break;
- }
- case SPELL_AURA_DUMMY:
- {
- uint32 effect = triggeredByAura->GetEffIndex();
- sLog.outDebug("ProcDamageAndSpell: casting spell (triggered by %s dummy aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- casted = HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag,i->cooldown);
- break;
- }
- case SPELL_AURA_PRAYER_OF_MENDING:
- {
- sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
-
- casted = HandleMeandingAuraProc(triggeredByAura);
- break;
- }
- case SPELL_AURA_MOD_HASTE:
- {
- sLog.outDebug("ProcDamageAndSpell: casting spell (triggered by %s haste aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- casted = HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag,i->cooldown);
- break;
- }
- case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
- {
- // nothing do, just charges counter
- // but count only in case appropriate school damage
- casted = triggeredByAura->GetModifier()->m_miscvalue & damageSchoolMask;
- break;
- }
- case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
- {
- sLog.outDebug("ProcDamageAndSpell: casting spell (triggered by %s class script aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- casted = HandleOverrideClassScriptAuraProc(pTarget, triggeredByAura, procSpell,i->cooldown);
- break;
- }
- default:
- {
- // nothing do, just charges counter
- casted = true;
- break;
- }
- }
-
- /// Update charge (aura can be removed by triggers)
- if(casted && triggeredByAuraWithCharges)
- {
- /// need re-found aura (can be dropped by triggers)
- AuraMap::const_iterator lower = GetAuras().lower_bound(i->triggeredByAura_SpellPair);
- AuraMap::const_iterator upper = GetAuras().upper_bound(i->triggeredByAura_SpellPair);
- for(AuraMap::const_iterator itr = lower; itr!= upper; ++itr)
- {
- if(itr->second == triggeredByAura) // pointer still valid
- {
- if(triggeredByAura->m_procCharges > 0)
- triggeredByAura->m_procCharges -= 1;
-
- triggeredByAura->UpdateAuraCharges();
- break;
- }
- }
- }
- }
-
- /// Safely remove auras with zero charges
- for(AuraList::const_iterator i = auras.begin(), next; i != auras.end(); i = next)
- {
- next = i; ++next;
- if((*i)->m_procCharges == 0)
- {
- RemoveAurasDueToSpell((*i)->GetId());
- next = auras.begin();
- }
- }
+ effMask = 0;
+ spellProcEvent = NULL;
}
-}
-*/
-struct ProcTriggeredData
-{
- ProcTriggeredData(SpellProcEventEntry const * _spellProcEvent, Aura* _triggeredByAura)
- : spellProcEvent(_spellProcEvent), triggeredByAura(_triggeredByAura),
- triggeredByAura_SpellPair(Unit::spellEffectPair(triggeredByAura->GetId(),triggeredByAura->GetEffIndex()))
- {}
SpellProcEventEntry const *spellProcEvent;
- Aura* triggeredByAura;
- Unit::spellEffectPair triggeredByAura_SpellPair;
+ Aura * aura;
+ uint32 effMask;
};
typedef std::list< ProcTriggeredData > ProcTriggeredList;
-typedef std::list< uint32> RemoveSpellList;
// List of auras that CAN be trigger but may not exist in spell_proc_event
// in most case need for drop charges
// in some types of aura need do additional check
// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic
-static bool isTriggerAura[TOTAL_AURAS];
-static bool isNonTriggerAura[TOTAL_AURAS];
-void InitTriggerAuraData()
+bool InitTriggerAuraData()
{
for (int i=0;i<TOTAL_AURAS;i++)
{
@@ -11342,7 +11401,7 @@ void InitTriggerAuraData()
isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true;
isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true;
isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true;
- isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED] = true;
+ isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true;
isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true;
isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true;
isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true;
@@ -11356,10 +11415,16 @@ void InitTriggerAuraData()
isTriggerAura[SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS] = true;
isTriggerAura[SPELL_AURA_MOD_HASTE] = true;
isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE]=true;
- isTriggerAura[SPELL_AURA_PRAYER_OF_MENDING] = true;
+ isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true;
+ isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true;
+ isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true;
+ isTriggerAura[SPELL_AURA_MOD_DAMAGE_FROM_CASTER] = true;
+ isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true;
isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true;
- isNonTriggerAura[SPELL_AURA_RESIST_PUSHBACK]=true;
+ isNonTriggerAura[SPELL_AURA_REDUCE_PUSHBACK]=true;
+
+ return true;
}
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
@@ -11400,18 +11465,8 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
return procEx;
}
-static int deep = 0;
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
{
- deep ++;
- if (deep > 5)
- {
- sLog.outError("Prevent possible stack owerflow in Unit::ProcDamageAndSpellFor");
- if (procSpell)
- sLog.outError(" Spell %u", procSpell->Id);
- deep--;
- return;
- }
// For melee/ranged based attack need update skills and set some Aura states
if (procFlag & MELEE_BASED_TRIGGER_MASK)
{
@@ -11422,7 +11477,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (procExtra&(PROC_EX_NORMAL_HIT|PROC_EX_MISS|PROC_EX_RESIST))
{
if (pTarget->GetTypeId() != TYPEID_PLAYER && pTarget->GetCreatureType() != CREATURE_TYPE_CRITTER)
- ((Player*)this)->UpdateCombatSkills(pTarget, attType, MELEE_HIT_MISS, isVictim);
+ ((Player*)this)->UpdateCombatSkills(pTarget, attType, isVictim);
}
// Update defence if player is victim and parry/dodge/block
if (isVictim && procExtra&(PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK))
@@ -11474,199 +11529,196 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
((Player*)this)->AddComboPoints(pTarget, 1);
StartReactiveTimer( REACTIVE_OVERPOWER );
}
- // Enable AURA_STATE_CRIT on crit
- if (procExtra & PROC_EX_CRITICAL_HIT)
- {
- ModifyAuraState(AURA_STATE_CRIT, true);
- StartReactiveTimer( REACTIVE_CRIT );
- if(getClass()==CLASS_HUNTER)
- {
- ModifyAuraState(AURA_STATE_HUNTER_CRIT_STRIKE, true);
- StartReactiveTimer( REACTIVE_HUNTER_CRIT );
- }
- }
}
}
}
- RemoveSpellList removedSpells;
ProcTriggeredList procTriggered;
// Fill procTriggered list
for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr)
{
- SpellProcEventEntry const* spellProcEvent = NULL;
- if(!IsTriggeredAtSpellProcEvent(itr->second, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), spellProcEvent))
- continue;
+ ProcTriggeredData triggerData(itr->second);
- procTriggered.push_back( ProcTriggeredData(spellProcEvent, itr->second) );
- }
- // Handle effects proceed this time
- for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
- {
- // Some auras can be deleted in function called in this loop (except first, ofc)
- // Until storing auars in std::multimap to hard check deleting by another way
- if(i != procTriggered.begin())
+ if(!IsTriggeredAtSpellProcEvent(pTarget, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), triggerData.spellProcEvent))
+ continue;
+
+ for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i)
{
- bool found = false;
- AuraMap::const_iterator lower = GetAuras().lower_bound(i->triggeredByAura_SpellPair);
- AuraMap::const_iterator upper = GetAuras().upper_bound(i->triggeredByAura_SpellPair);
- for(AuraMap::const_iterator itr = lower; itr!= upper; ++itr)
- {
- if(itr->second==i->triggeredByAura)
- {
- found = true;
- break;
- }
- }
- if(!found)
+ if (AuraEffect * aurEff = itr->second->GetPartAura(i))
{
-// sLog.outDebug("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler", i->triggeredByAura->GetModifier()->m_auraname, i->triggeredByAura_SpellPair.first, i->triggeredByAura_SpellPair.second);
-// sLog.outDebug("It can be deleted one from early proccesed auras:");
-// for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2)
-// sLog.outDebug(" Spell aura %u (id:%u effect:%u)", i->triggeredByAura->GetModifier()->m_auraname,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second);
-// sLog.outDebug(" <end of list>");
- continue;
+ // Skip this auras
+ if (isNonTriggerAura[aurEff->GetAuraName()])
+ continue;
+ // If not trigger by default and spellProcEvent==NULL - skip
+ if (!isTriggerAura[aurEff->GetAuraName()] && triggerData.spellProcEvent==NULL)
+ continue;
+
+ triggerData.effMask |= 1<<i;
}
}
+ if (triggerData.effMask)
+ procTriggered.push_front(triggerData);
+ }
+
+ // Nothing found
+ if (procTriggered.empty())
+ return;
+ // Handle effects proceed this time
+ for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
+ {
+ // look for aura in auras list, it may be removed while proc event processing
+ if (!HasAura(i->aura))
+ continue;
+
+ bool useCharges= i->aura->GetAuraCharges()>0;
+ bool takeCharges = false;
+ SpellEntry const *spellInfo = i->aura->GetSpellProto();
+ uint32 Id=i->aura->GetId();
- SpellProcEventEntry const *spellProcEvent = i->spellProcEvent;
- Aura *triggeredByAura = i->triggeredByAura;
- Modifier *auraModifier = triggeredByAura->GetModifier();
- SpellEntry const *spellInfo = triggeredByAura->GetSpellProto();
- uint32 effIndex = triggeredByAura->GetEffIndex();
- bool useCharges = triggeredByAura->m_procCharges > 0;
// For players set spell cooldown if need
uint32 cooldown = 0;
- if (GetTypeId() == TYPEID_PLAYER && spellProcEvent && spellProcEvent->cooldown)
- cooldown = spellProcEvent->cooldown;
+ if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown)
+ cooldown = i->spellProcEvent->cooldown;
+
+ uint32 procDebug = 0;
- switch(auraModifier->m_auraname)
+ for (uint8 effIndex = 0; effIndex<MAX_SPELL_EFFECTS;++effIndex)
{
- case SPELL_AURA_PROC_TRIGGER_SPELL:
- {
- sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
- continue;
- break;
- }
- case SPELL_AURA_PROC_TRIGGER_DAMAGE:
- {
- sLog.outDebug("ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", auraModifier->m_amount, spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask);
- uint32 damage = SpellDamageBonus(pTarget, spellInfo, auraModifier->m_amount, SPELL_DIRECT_DAMAGE);
- CalculateSpellDamageTaken(&damageInfo, damage, spellInfo);
- SendSpellNonMeleeDamageLog(&damageInfo);
- DealSpellDamage(&damageInfo, true);
- break;
- }
- case SPELL_AURA_MANA_SHIELD:
- case SPELL_AURA_DUMMY:
- {
- sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
- continue;
- break;
- }
- case SPELL_AURA_MOD_HASTE:
- {
- sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (!HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
- continue;
- break;
- }
- case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
- {
- sLog.outDebug("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(pTarget, triggeredByAura, procSpell, cooldown))
- continue;
- break;
- }
- case SPELL_AURA_PRAYER_OF_MENDING:
+ if (!(i->effMask & (1<<effIndex)))
+ continue;
+
+ AuraEffect *triggeredByAura = i->aura->GetPartAura(effIndex);
+ assert(triggeredByAura);
+
+ switch(triggeredByAura->GetAuraName())
{
- sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
+ case SPELL_AURA_PROC_TRIGGER_SPELL:
+ {
+ sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ continue;
+ break;
+ }
+ case SPELL_AURA_PROC_TRIGGER_DAMAGE:
+ {
+ sLog.outDebug("ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount() , spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask);
+ uint32 damage = SpellDamageBonus(pTarget, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE);
+ CalculateSpellDamageTaken(&damageInfo, damage, spellInfo);
+ SendSpellNonMeleeDamageLog(&damageInfo);
+ DealSpellDamage(&damageInfo, true);
+ break;
+ }
+ case SPELL_AURA_MANA_SHIELD:
+ case SPELL_AURA_DUMMY:
+ {
+ sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ continue;
+ if (procDebug & 1)
+ sLog.outError("Dummy aura of spell %d procs twice from one effect!",spellInfo->Id);
+ procDebug |= 1;
+ break;
+ }
+ case SPELL_AURA_OBS_MOD_ENERGY:
+ sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ if (!HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ continue;
+ if (procDebug & 2)
+ sLog.outError("ObsModEnergy aura of spell %d procs twice from one effect!",spellInfo->Id);
+ procDebug |= 2;
+ break;
+ case SPELL_AURA_MOD_HASTE:
+ {
+ sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ if (!HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ continue;
+ if (procDebug & 4)
+ sLog.outError("Haste aura of spell %d procs twice from one effect!",spellInfo->Id);
+ procDebug |= 4;
+ break;
+ }
+ case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
+ {
+ sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, cooldown))
+ continue;
+ if (procDebug & 8)
+ sLog.outError("OverrideClassScripts aura of spell %d procs twice from one effect!",spellInfo->Id);
+ procDebug |= 8;
+ break;
+ }
+ case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE:
+ {
+ sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
+ (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
- HandleMeandingAuraProc(triggeredByAura);
- break;
- }
- case SPELL_AURA_MOD_STUN:
- // Remove by default, but if charge exist drop it
- if (triggeredByAura->m_procCharges == 0)
- removedSpells.push_back(triggeredByAura->GetId());
- break;
- case SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS:
- case SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS:
- // Hunter's Mark (1-4 Rangs)
- if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (spellInfo->SpellFamilyFlags&0x0000000000000400LL))
+ HandleAuraRaidProcFromChargeWithValue(triggeredByAura);
+ break;
+ }
+ case SPELL_AURA_RAID_PROC_FROM_CHARGE:
{
- uint32 basevalue = triggeredByAura->GetBasePoints();
- auraModifier->m_amount += basevalue/10;
- if (auraModifier->m_amount > basevalue*4)
- auraModifier->m_amount = basevalue*4;
+ sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
+ (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId());
+
+ HandleAuraRaidProcFromCharge(triggeredByAura);
+ break;
}
- break;
- case SPELL_AURA_MOD_CASTING_SPEED:
- // Skip melee hits or instant cast spells
- if (procSpell == NULL || GetSpellCastTime(procSpell) == 0)
- continue;
- break;
- case SPELL_AURA_REFLECT_SPELLS_SCHOOL:
- // Skip Melee hits and spells ws wrong school
- if (procSpell == NULL || (auraModifier->m_miscvalue & procSpell->SchoolMask) == 0)
- continue;
- break;
- case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT:
- case SPELL_AURA_MOD_POWER_COST_SCHOOL:
- // Skip melee hits and spells ws wrong school or zero cost
- if (procSpell == NULL ||
- (procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0) || // Cost check
- (auraModifier->m_miscvalue & procSpell->SchoolMask) == 0) // School check
- continue;
- break;
- case SPELL_AURA_MECHANIC_IMMUNITY:
- // Compare mechanic
- if (procSpell==NULL || procSpell->Mechanic != auraModifier->m_miscvalue)
- continue;
- break;
- case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
- // Compare mechanic
- if (procSpell==NULL || procSpell->Mechanic != auraModifier->m_miscvalue)
- continue;
- break;
- default:
- // nothing do, just charges counter
- break;
- }
- // Remove charge (aura can be removed by triggers)
- if(useCharges)
- {
- // need found aura on drop (can be dropped by triggers)
- AuraMap::const_iterator lower = GetAuras().lower_bound(i->triggeredByAura_SpellPair);
- AuraMap::const_iterator upper = GetAuras().upper_bound(i->triggeredByAura_SpellPair);
- for(AuraMap::const_iterator itr = lower; itr!= upper; ++itr)
- {
- if(itr->second == i->triggeredByAura)
+ case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE:
{
- triggeredByAura->m_procCharges -=1;
- triggeredByAura->UpdateAuraCharges();
- if (triggeredByAura->m_procCharges <= 0)
- removedSpells.push_back(triggeredByAura->GetId());
+ sLog.outDebug("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(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ continue;
break;
}
+ case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK:
+ // Skip melee hits or instant cast spells
+ if (procSpell == NULL || GetSpellCastTime(procSpell) == 0)
+ continue;
+ break;
+ case SPELL_AURA_REFLECT_SPELLS_SCHOOL:
+ // Skip Melee hits and spells ws wrong school
+ if (procSpell == NULL || (triggeredByAura->GetMiscValue() & procSpell->SchoolMask) == 0)
+ continue;
+ break;
+ case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT:
+ case SPELL_AURA_MOD_POWER_COST_SCHOOL:
+ // Skip melee hits and spells ws wrong school or zero cost
+ if (procSpell == NULL ||
+ (procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0) || // Cost check
+ (triggeredByAura->GetMiscValue() & procSpell->SchoolMask) == 0) // School check
+ continue;
+ break;
+ case SPELL_AURA_MECHANIC_IMMUNITY:
+ // Compare mechanic
+ if (procSpell==NULL || procSpell->Mechanic != triggeredByAura->GetMiscValue())
+ continue;
+ break;
+ case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
+ // Compare mechanic
+ if (procSpell==NULL || procSpell->Mechanic != triggeredByAura->GetMiscValue())
+ continue;
+ break;
+ case SPELL_AURA_MOD_DAMAGE_FROM_CASTER:
+ // Compare casters
+ if (triggeredByAura->GetCasterGUID() != pTarget->GetGUID())
+ continue;
+ break;
+ default:
+ // nothing do, just charges counter
+ break;
}
+ takeCharges=true;
+ }
+ // Remove charge (aura can be removed by triggers)
+ if(useCharges && takeCharges)
+ {
+ if (i->aura->DropAuraCharge())
+ RemoveAura(i->aura);
}
}
- if (removedSpells.size())
- {
- // Sort spells and remove dublicates
- removedSpells.sort();
- removedSpells.unique();
- // Remove auras from removedAuras
- for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();i++)
- RemoveAurasDueToSpell(*i);
- }
- deep--;
}
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
@@ -11688,15 +11740,21 @@ Player* Unit::GetSpellModOwner() const
}
///----------Pet responses methods-----------------
-void Unit::SendPetCastFail(uint32 spellid, uint8 msg)
+void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg)
{
+ if(msg == SPELL_CAST_OK)
+ return;
+
Unit *owner = GetCharmerOrOwner();
if(!owner || owner->GetTypeId() != TYPEID_PLAYER)
return;
WorldPacket data(SMSG_PET_CAST_FAILED, (4+1));
+ data << uint8(0); // cast count?
data << uint32(spellid);
data << uint8(msg);
+ // uint32 for some reason
+ // uint32 for some reason
((Player*)owner)->GetSession()->SendPacket(&data);
}
@@ -11815,8 +11873,8 @@ void Unit::SetFeared(bool apply, uint64 casterGUID, uint32 spellID)
// attack caster if can
Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL);
- if(caster && caster != getVictim() && ((Creature*)this)->IsAIEnabled)
- ((Creature*)this)->AI()->AttackStart(caster);
+ if(caster && ((Creature*)this)->AI())
+ ((Creature*)this)->AI()->AttackedBy(caster);
}
}
@@ -11856,15 +11914,16 @@ void Unit::SetConfused(bool apply, uint64 casterGUID, uint32 spellID)
bool Unit::IsSitState() const
{
uint8 s = getStandState();
- return s == PLAYER_STATE_SIT_CHAIR || s == PLAYER_STATE_SIT_LOW_CHAIR ||
- s == PLAYER_STATE_SIT_MEDIUM_CHAIR || s == PLAYER_STATE_SIT_HIGH_CHAIR ||
- s == PLAYER_STATE_SIT;
+ 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 ||
+ s == UNIT_STAND_STATE_SIT;
}
bool Unit::IsStandState() const
{
uint8 s = getStandState();
- return !IsSitState() && s != PLAYER_STATE_SLEEP && s != PLAYER_STATE_KNEEL;
+ return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL;
}
void Unit::SetStandState(uint8 state)
@@ -11918,7 +11977,6 @@ void Unit::ClearComboPointHolders()
void Unit::ClearAllReactives()
{
-
for(int i=0; i < MAX_REACTIVE; ++i)
m_reactiveTimer[i] = 0;
@@ -11926,11 +11984,6 @@ void Unit::ClearAllReactives()
ModifyAuraState(AURA_STATE_DEFENSE, false);
if (getClass() == CLASS_HUNTER && HasAuraState( AURA_STATE_HUNTER_PARRY))
ModifyAuraState(AURA_STATE_HUNTER_PARRY, false);
- if (HasAuraState( AURA_STATE_CRIT))
- ModifyAuraState(AURA_STATE_CRIT, false);
- if (getClass() == CLASS_HUNTER && HasAuraState( AURA_STATE_HUNTER_CRIT_STRIKE) )
- ModifyAuraState(AURA_STATE_HUNTER_CRIT_STRIKE, false);
-
if(getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER)
((Player*)this)->ClearComboPoints();
}
@@ -11958,14 +12011,6 @@ void Unit::UpdateReactives( uint32 p_time )
if ( getClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_PARRY))
ModifyAuraState(AURA_STATE_HUNTER_PARRY, false);
break;
- case REACTIVE_CRIT:
- if (HasAuraState(AURA_STATE_CRIT))
- ModifyAuraState(AURA_STATE_CRIT, false);
- break;
- case REACTIVE_HUNTER_CRIT:
- if ( getClass() == CLASS_HUNTER && HasAuraState(AURA_STATE_HUNTER_CRIT_STRIKE) )
- ModifyAuraState(AURA_STATE_HUNTER_CRIT_STRIKE, false);
- break;
case REACTIVE_OVERPOWER:
if(getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER)
((Player*)this)->ClearComboPoints();
@@ -11985,7 +12030,7 @@ Unit* Unit::SelectNearbyTarget(float dist) const
{
std::list<Unit *> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
+ Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
VisitNearbyObject(dist, searcher);
// remove current target
@@ -12018,6 +12063,16 @@ Unit* Unit::SelectNearbyTarget(float dist) const
return *tcIter;
}
+bool Unit::hasNegativeAuraWithInterruptFlag(uint32 flag)
+{
+ for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ++iter)
+ {
+ if (!iter->second->IsPositive() && iter->second->GetSpellProto()->AuraInterruptFlags & flag)
+ return true;
+ }
+ return false;
+}
+
void Unit::ApplyAttackTimePercentMod( WeaponAttackType att,float val, bool apply )
{
float remainingTimePct = (float)m_attackTimer[att] / (GetAttackTime(att) * m_modAttackSpeedPct[att]);
@@ -12134,13 +12189,15 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
void Unit::UpdateAuraForGroup(uint8 slot)
{
+ if(slot >= MAX_AURAS) // slot not found, return
+ return;
if(GetTypeId() == TYPEID_PLAYER)
{
Player* player = (Player*)this;
if(player->GetGroup())
{
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS);
- player->SetAuraUpdateMask(slot);
+ player->SetAuraUpdateMaskForRaid(slot);
}
}
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
@@ -12152,7 +12209,7 @@ void Unit::UpdateAuraForGroup(uint8 slot)
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
{
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
- pet->SetAuraUpdateMask(slot);
+ pet->SetAuraUpdateMaskForRaid(slot);
}
}
}
@@ -12183,10 +12240,10 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
}
}
-Aura* Unit::GetDummyAura( uint32 spell_id ) const
+AuraEffect* Unit::GetDummyAura( uint32 spell_id ) const
{
- Unit::AuraList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
+ Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
if ((*itr)->GetId() == spell_id)
return *itr;
@@ -12223,21 +12280,30 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
void Unit::AddPetAura(PetAura const* petSpell)
{
+ if(GetTypeId() != TYPEID_PLAYER)
+ return;
+
m_petAuras.insert(petSpell);
- if(Pet* pet = GetPet())
+ if(Pet* pet = ((Player*)this)->GetPet())
pet->CastPetAura(petSpell);
}
void Unit::RemovePetAura(PetAura const* petSpell)
{
+ if(GetTypeId() != TYPEID_PLAYER)
+ return;
+
m_petAuras.erase(petSpell);
- if(Pet* pet = GetPet())
+ if(Pet* pet = ((Player*)this)->GetPet())
pet->RemoveAurasDueToSpell(petSpell->GetAura(pet->GetEntry()));
}
Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
{
- Pet* pet = new Pet(HUNTER_PET);
+ if(GetTypeId()!=TYPEID_PLAYER)
+ return NULL;
+
+ Pet* pet = new Pet((Player*)this, HUNTER_PET);
if(!pet->CreateBaseAtCreature(creatureTarget))
{
@@ -12245,43 +12311,38 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
return NULL;
}
- pet->SetOwnerGUID(GetGUID());
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
- if(!pet->InitStatsForLevel(creatureTarget->getLevel()))
+ if(GetTypeId()==TYPEID_PLAYER)
+ pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+
+ uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
+
+ if(!pet->InitStatsForLevel(level))
{
- sLog.outError("ERROR: Pet::InitStatsForLevel() failed for creature (Entry: %u)!",creatureTarget->GetEntry());
+ sLog.outError("Pet::InitStatsForLevel() failed for creature (Entry: %u)!",creatureTarget->GetEntry());
delete pet;
return NULL;
}
pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
- pet->AIM_Initialize();
pet->InitPetCreateSpells();
+ pet->InitTalentForLevel();
pet->SetHealth(pet->GetMaxHealth());
return pet;
}
-bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
+bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *& spellProcEvent )
{
SpellEntry const* spellProto = aura->GetSpellProto ();
// Get proc Event Entry
spellProcEvent = spellmgr.GetSpellProcEvent(spellProto->Id);
- // Aura info stored here
- Modifier *mod = aura->GetModifier();
- // Skip this auras
- if (isNonTriggerAura[mod->m_auraname])
- return false;
- // If not trigger by default and spellProcEvent==NULL - skip
- if (!isTriggerAura[mod->m_auraname] && spellProcEvent==NULL)
- return false;
-
// Get EventProcFlag
uint32 EventProcFlag;
if (spellProcEvent && spellProcEvent->procFlags) // if exist get custom spellProcEvent->procFlags
@@ -12293,10 +12354,20 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
return false;
// Check spellProcEvent data requirements
- if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
+ if(!spellmgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
return false;
- // Aura added by spell can`t trogger from self (prevent drop cahres/do triggers)
+ // In most cases req get honor or XP from kill
+ if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER)
+ {
+ bool allow = ((Player*)this)->isHonorOrXPTarget(pVictim);
+ // Shadow Word: Death - can trigger from every kill
+ if (aura->GetId() == 32409)
+ allow = true;
+ if (!allow)
+ return false;
+ }
+ // Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
// But except periodic triggers (can triggered from self)
if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC))
return false;
@@ -12308,13 +12379,13 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
{
Item *item = NULL;
if(attType == BASE_ATTACK)
- item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
else if (attType == OFF_ATTACK)
- item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
else
- item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
+ item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
- if (!((Player*)this)->IsUseEquipedWeapon(attType==BASE_ATTACK))
+ if (((Player*)this)->IsInFeralForm())
return false;
if(!item || item->IsBroken() || item->GetProto()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetProto()->SubClass) & spellProto->EquippedItemSubClassMask))
@@ -12323,7 +12394,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
else if(spellProto->EquippedItemClass == ITEM_CLASS_ARMOR)
{
// Check if player is wearing shield
- Item *item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+ Item *item = ((Player*)this)->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if(!item || item->IsBroken() || item->GetProto()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetProto()->SubClass) & spellProto->EquippedItemSubClassMask))
return false;
}
@@ -12337,60 +12408,58 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
if(!isVictim && spellProcEvent && spellProcEvent->ppmRate != 0)
{
uint32 WeaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate);
+ chance = GetPPMProcChance(WeaponSpeed, spellProcEvent->ppmRate, spellProto);
}
// Apply chance modifer aura
if(Player* modOwner = GetSpellModOwner())
+ {
modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
+ }
return roll_chance_f(chance);
}
-bool Unit::HandleMeandingAuraProc( Aura* triggeredByAura )
+bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura )
{
// aura can be deleted at casts
SpellEntry const* spellProto = triggeredByAura->GetSpellProto();
uint32 effIdx = triggeredByAura->GetEffIndex();
- int32 heal = triggeredByAura->GetModifier()->m_amount;
+ int32 heal = triggeredByAura->GetAmount();
uint64 caster_guid = triggeredByAura->GetCasterGUID();
+ //Currently only Prayer Of Mending
+ if (!(spellProto->SpellFamilyName==SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20))
+ {
+ sLog.outDebug("Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id);
+ return false;
+ }
// jumps
- int32 jumps = triggeredByAura->m_procCharges-1;
+ int32 jumps = triggeredByAura->GetParentAura()->GetAuraCharges()-1;
// current aura expire
- triggeredByAura->m_procCharges = 1; // will removed at next charges decrease
+ triggeredByAura->GetParentAura()->SetAuraCharges(1); // will removed at next charges decrease
// next target selection
- if(jumps > 0 && GetTypeId()==TYPEID_PLAYER && IS_PLAYER_GUID(caster_guid))
+ if(jumps > 0 && IS_PLAYER_GUID(caster_guid))
{
float radius;
if (spellProto->EffectRadiusIndex[effIdx])
- radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellProto->EffectRadiusIndex[effIdx]));
+ radius = GetSpellRadiusForTarget(triggeredByAura->GetCaster(), sSpellRadiusStore.LookupEntry(spellProto->EffectRadiusIndex[effIdx]));
else
- radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
+ radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
if(Player* caster = ((Player*)triggeredByAura->GetCaster()))
{
caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL);
- if(Player* target = ((Player*)this)->GetNextRandomRaidMember(radius))
+ if (Unit* target= GetNextRandomRaidMemberOrPet(radius))
{
- // aura will applied from caster, but spell casted from current aura holder
- SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_CHARGES;
- mod->value = jumps-5; // negative
- mod->type = SPELLMOD_FLAT;
- mod->spellId = spellProto->Id;
- mod->effectId = effIdx;
- mod->lastAffected = NULL;
- mod->mask = spellProto->SpellFamilyFlags;
- mod->charges = 0;
-
- caster->AddSpellMod(mod, true);
CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID());
- caster->AddSpellMod(mod, false);
+ if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
+ aur->SetAuraCharges(jumps);
- heal = caster->SpellHealingBonus(spellProto, heal, HEAL, this);
+ //bonus must be applied after aura cast on target
+ heal = caster->SpellHealingBonus(this, spellProto, heal, HEAL);
}
}
}
@@ -12399,29 +12468,64 @@ bool Unit::HandleMeandingAuraProc( Aura* triggeredByAura )
CastCustomSpell(this,33110,&heal,NULL,NULL,true,NULL,NULL,caster_guid);
return true;
}
-
-void Unit::RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster)
+bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura )
{
-/* uint64 target_guid = GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT);
- if(target_guid == GetGUID())
- return;
+ // aura can be deleted at casts
+ SpellEntry const* spellProto = triggeredByAura->GetSpellProto();
- if(!IS_UNIT_GUID(target_guid))
- return;
+ uint32 damageSpellId;
+ switch(spellProto->Id)
+ {
+ case 57949: //shiver
+ damageSpellId=57952;
+// animationSpellId=57951; dummy effects for jump spell have unknown use (see also 41637)
+ break;
+ case 59978: //shiver
+ damageSpellId=59979;
+ break;
+ case 43593: //Cold Stare
+ damageSpellId=43594;
+ break;
+ default:
+ sLog.outDebug("Unit::HandleAuraRaidProcFromCharge, received not handled spell: %u", spellProto->Id);
+ return false;
+ }
- Unit* target = ObjectAccessor::GetUnit(*this, target_guid);*/
- if(!caster)
- return;
+ uint64 caster_guid = triggeredByAura->GetCasterGUID();
+ uint32 effIdx = triggeredByAura->GetEffIndex();
+
+ // jumps
+ int32 jumps = triggeredByAura->GetParentAura()->GetAuraCharges()-1;
+
+ // current aura expire
+ triggeredByAura->GetParentAura()->SetAuraCharges(1); // will removed at next charges decrease
- for (AuraMap::iterator iter = GetAuras().begin(); iter != GetAuras().end(); )
+ // next target selection
+ if(jumps > 0 && IS_PLAYER_GUID(caster_guid))
{
- if (iter->second->GetId() == spellInfo->Id && iter->second->GetCasterGUID() == caster->GetGUID())
- RemoveAura(iter);
+ float radius;
+ if (spellProto->EffectRadiusIndex[effIdx])
+ radius = GetSpellRadiusForTarget(triggeredByAura->GetCaster(), sSpellRadiusStore.LookupEntry(spellProto->EffectRadiusIndex[effIdx]));
else
- ++iter;
+ radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex));
+
+ if(Player* caster = ((Player*)triggeredByAura->GetCaster()))
+ {
+ caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL);
+
+ if (Unit* target= GetNextRandomRaidMemberOrPet(radius))
+ {
+ CastSpell(target, spellProto, true,NULL,triggeredByAura,caster_guid);
+ if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID()))
+ aur->SetAuraCharges(jumps);
+ }
+ }
}
-}
+ CastSpell(this, damageSpellId, true,NULL,triggeredByAura,caster_guid);
+
+ return true;
+}
/*-----------------------TRINITY-----------------------------*/
void Unit::SetToNotify()
@@ -12435,6 +12539,9 @@ void Unit::SetToNotify()
void Unit::Kill(Unit *pVictim, bool durabilityLoss)
{
+ // Prevent killing unit twice (and giving reward from kill twice)
+ if (!pVictim->isAlive())
+ return;
pVictim->SetHealth(0);
// find player: owner of controlled `this` or `this` itself maybe
@@ -12447,7 +12554,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
if(player && player!=pVictim)
{
if(player->RewardPlayerAndGroupAtKill(pVictim))
- player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL_AND_GET_XP, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
+ player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
else
player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED,PROC_EX_NONE, 0);
}
@@ -12456,8 +12563,8 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
bool SpiritOfRedemption = false;
if(pVictim->GetTypeId()==TYPEID_PLAYER && pVictim->getClass()==CLASS_PRIEST )
{
- AuraList const& vDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
- for(AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr)
+ AuraEffectList const& vDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr)
{
if((*itr)->GetSpellProto()->SpellIconID==1654)
{
@@ -12579,6 +12686,15 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
bg->HandleKillUnit((Creature*)pVictim, player);
}
}
+
+ // achievement stuff
+ if (pVictim->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (GetTypeId() == TYPEID_UNIT)
+ ((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry());
+ else if(GetTypeId() == TYPEID_PLAYER && pVictim != this)
+ ((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ((Player*)this)->GetTeam());
+ }
}
void Unit::SetControlled(bool apply, UnitState state)
@@ -12648,7 +12764,7 @@ void Unit::SetStunned(bool apply)
if(apply)
{
SetUInt64Value(UNIT_FIELD_TARGET, 0);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
CastStop();
// Creature specific
@@ -12666,7 +12782,7 @@ void Unit::SetStunned(bool apply)
{
if(isAlive() && getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID());
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
if(!hasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
{
@@ -12719,7 +12835,7 @@ void Unit::SetFeared(bool apply)
if(apply)
{
Unit *caster = NULL;
- Unit::AuraList const& fearAuras = GetAurasByType(SPELL_AURA_MOD_FEAR);
+ Unit::AuraEffectList const& fearAuras = GetAurasByType(SPELL_AURA_MOD_FEAR);
if(!fearAuras.empty())
caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID());
if(!caster)
@@ -12762,7 +12878,7 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
if(this == charmer)
return;
- if(isInFlight())
+ if(hasUnitState(UNIT_STAT_UNATTACKABLE))
return;
if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->GetTransport())
@@ -12775,21 +12891,26 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
// Charmer stop charming
if(charmer->GetTypeId() == TYPEID_PLAYER)
+ {
((Player*)charmer)->StopCastingCharm();
+ ((Player*)charmer)->StopCastingBindSight();
+ }
// Charmed stop charming
if(GetTypeId() == TYPEID_PLAYER)
+ {
((Player*)this)->StopCastingCharm();
+ ((Player*)this)->StopCastingBindSight();
+ }
// StopCastingCharm may remove a possessed pet?
if(!IsInWorld())
return;
// Set charmed
- charmer->SetCharm(this);
- SetCharmerGUID(charmer->GetGUID());
setFaction(charmer->getFaction());
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ charmer->SetCharm(this, true);
if(GetTypeId() == TYPEID_UNIT)
{
@@ -12801,11 +12922,12 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
{
if(((Player*)this)->isAFK())
((Player*)this)->ToggleAFK();
- ((Player*)this)->SetViewport(GetGUID(), false);
+ ((Player*)this)->SetClientControl(this, 0);
}
// Pets already have a properly initialized CharmInfo, don't overwrite it.
- if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet())
+ if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
+ && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
{
CharmInfo *charmInfo = InitCharmInfo();
if(possess)
@@ -12818,9 +12940,10 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
if(possess)
{
addUnitState(UNIT_STAT_POSSESSED);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
- AddPlayerToVision((Player*)charmer);
- ((Player*)charmer)->SetViewport(GetGUID(), true);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
+ ((Player*)charmer)->SetClientControl(this, 1);
+ ((Player*)charmer)->SetMover(this);
+ ((Player*)charmer)->SetViewpoint(this, true);
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
// Charm demon
@@ -12863,13 +12986,13 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
CombatStop(); //TODO: CombatStop(true) may cause crash (interrupt spells)
getHostilRefManager().deleteReferences();
DeleteThreatList();
- SetCharmerGUID(0);
RestoreFaction();
+ GetMotionMaster()->InitDefault();
if(possess)
{
clearUnitState(UNIT_STAT_POSSESSED);
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
}
if(GetTypeId() == TYPEID_UNIT)
@@ -12890,7 +13013,7 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
}
}
else
- ((Player*)this)->SetViewport(GetGUID(), true);
+ ((Player*)this)->SetClientControl(this, 1);
// If charmer still exists
if(!charmer)
@@ -12898,11 +13021,12 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
assert(!possess || charmer->GetTypeId() == TYPEID_PLAYER);
- charmer->SetCharm(0);
+ charmer->SetCharm(this, false);
if(possess)
{
- RemovePlayerFromVision((Player*)charmer);
- ((Player*)charmer)->SetViewport(charmer->GetGUID(), true);
+ ((Player*)charmer)->SetClientControl(charmer, 1);
+ ((Player*)charmer)->SetMover(charmer);
+ ((Player*)charmer)->SetViewpoint(this, false);
charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
// restore UNIT_FIELD_BYTES_0
@@ -12924,7 +13048,9 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
}
}
- if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet())
+ //a guardian should always have charminfo
+ if(GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT
+ && !((Creature*)this)->HasSummonMask(SUMMON_MASK_GUARDIAN))
{
DeleteCharmInfo();
}
@@ -12997,17 +13123,30 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
return;
Group *pGroup = owner->GetGroup();
- if(!pGroup)
- return;
-
- for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ if(pGroup)
{
- Player* Target = itr->getSource();
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
- // IsHostileTo check duel and controlled by enemy
- if( Target && Target != this && Target->isAlive()
- && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
- nearMembers.push_back(Target);
+ if( Target && !IsHostileTo(Target) )
+ {
+ if(Target->isAlive() && IsWithinDistInMap(Target, radius) )
+ nearMembers.push_back(Target);
+
+ if(Guardian* pet = Target->GetGuardianPet())
+ if(pet->isAlive() && IsWithinDistInMap(pet, radius) )
+ nearMembers.push_back(pet);
+ }
+ }
+ }
+ else
+ {
+ if(owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius)))
+ nearMembers.push_back(owner);
+ if(Guardian* pet = owner->GetGuardianPet())
+ if(pet->isAlive() && (pet == this && IsWithinDistInMap(pet, radius)))
+ nearMembers.push_back(pet);
}
}
@@ -13032,7 +13171,7 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
if(Target->isAlive() && IsWithinDistInMap(Target, radius) )
TagUnitMap.push_back(Target);
- if(Pet* pet = Target->GetPet())
+ if(Guardian* pet = Target->GetGuardianPet())
if(pet->isAlive() && IsWithinDistInMap(pet, radius) )
TagUnitMap.push_back(pet);
}
@@ -13042,12 +13181,38 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
{
if(owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius)))
TagUnitMap.push_back(owner);
- if(Pet* pet = owner->GetPet())
+ if(Guardian* pet = owner->GetGuardianPet())
if(pet->isAlive() && (pet == this && IsWithinDistInMap(pet, radius)))
TagUnitMap.push_back(pet);
}
}
+void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply)
+{
+ if (aureff->GetParentAura()->IsRemoved())
+ return;
+ if (apply)
+ {
+ m_modAuras[aureff->GetAuraName()].push_back(aureff);
+ aureff->ApplyModifier(true, true);
+ }
+ else
+ {
+ // remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)
+ m_modAuras[aureff->GetAuraName()].remove(aureff);
+ aureff->ApplyModifier(false, true);
+ Unit * caster = aureff->GetParentAura()->GetCaster();
+ if(caster && aureff->IsPersistent())
+ {
+ DynamicObject *dynObj = caster->GetDynObject(aureff->GetId(), aureff->GetEffIndex());
+ if (dynObj)
+ dynObj->RemoveAffected(this);
+ }
+ // Remove all triggered by aura spells vs unlimited duration
+ aureff->CleanupTriggeredSpells();
+ }
+}
+
void Unit::AddAura(uint32 spellId, Unit* target)
{
if(!target || !target->isAlive())
@@ -13060,24 +13225,193 @@ void Unit::AddAura(uint32 spellId, Unit* target)
if (target->IsImmunedToSpell(spellInfo))
return;
+ uint8 eff_mask=0;
+
for(uint32 i = 0; i < 3; ++i)
{
- if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
+ if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(spellInfo->Effect[i]))
{
- if(target->IsImmunedToSpellEffect(spellInfo->Effect[i], spellInfo->EffectMechanic[i]))
+ if(target->IsImmunedToSpellEffect(spellInfo, i))
continue;
-
- /*if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
- {
- Aura *Aur = CreateAura(spellInfo, i, NULL, this, this);
- AddAura(Aur);
- }
- else*/
- {
- Aura *Aur = CreateAura(spellInfo, i, NULL, target, this);
- target->AddAura(Aur);
- }
+ eff_mask|=1<<i;
}
}
+
+ if (!eff_mask)
+ return;
+
+ Aura *Aur = new Aura(spellInfo, eff_mask, NULL, target, this);
+ target->AddAura(Aur);
+}
+
+Aura * Unit::AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster)
+{
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo || !caster)
+ return NULL;
+
+ // can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect
+ //assert (!IsPassiveSpell(spellInfo));
+
+ Aura * aur = GetAura(spellId, caster->GetGUID());
+
+ if (aur)
+ {
+ AuraEffect *aurEffect = CreateAuraEffect(aur, effIndex, NULL, caster);
+ if (!aurEffect)
+ return aur;
+ if (!aur->SetPartAura(aurEffect, effIndex))
+ delete aurEffect;
+ }
+ else
+ {
+ aur = new Aura(spellInfo, 1<<effIndex, NULL, this ,caster);
+ AddAura(aur);
+ }
+ return aur;
}
+// Melee based spells can be miss, parry or dodge on this step
+// Crit or block - determined on damage calculation phase! (and can be both in some time)
+float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
+{
+ // Calculate hit chance (more correct for chance mod)
+ int32 HitChance;
+
+ // PvP - PvE melee chances
+ /*int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 5 : 7;
+ int32 leveldif = pVictim->getLevelForTarget(this) - getLevelForTarget(pVictim);
+ if(leveldif < 3)
+ HitChance = 95 - leveldif;
+ else
+ HitChance = 93 - (leveldif - 2) * lchance;*/
+ if (spellId || attType == RANGED_ATTACK || !haveOffhandWeapon())
+ HitChance = 95.0f;
+ else
+ HitChance = 76.0f;
+
+ // Hit chance depends from victim auras
+ if(attType == RANGED_ATTACK)
+ HitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE);
+ else
+ HitChance += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE);
+
+ // Spellmod from SPELLMOD_RESIST_MISS_CHANCE
+ if(spellId)
+ {
+ if(Player *modOwner = GetSpellModOwner())
+ modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_MISS_CHANCE, HitChance);
+ }
+
+ // Miss = 100 - hit
+ float miss_chance= 100.0f - HitChance;
+
+ // Bonuses from attacker aura and ratings
+ if (attType == RANGED_ATTACK)
+ miss_chance -= m_modRangedHitChance;
+ else
+ miss_chance -= m_modMeleeHitChance;
+
+ // bonus from skills is 0.04%
+ //miss_chance -= skillDiff * 0.04f;
+ int32 diff = -skillDiff;
+ if(pVictim->GetTypeId()==TYPEID_PLAYER)
+ miss_chance += diff > 0 ? diff * 0.04 : diff * 0.02;
+ else
+ miss_chance += diff > 10 ? 2 + (diff - 10) * 0.4 : diff * 0.1;
+
+ // Limit miss chance from 0 to 60%
+ if (miss_chance < 0.0f)
+ return 0.0f;
+ if (miss_chance > 60.0f)
+ return 60.0f;
+ return miss_chance;
+}
+
+void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
+{
+ WorldObject::SetPhaseMask(newPhaseMask,update);
+
+ if(!IsInWorld())
+ return;
+
+ for(ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
+ if((*itr)->GetOwnerGUID() == GetGUID())
+ (*itr)->SetPhaseMask(newPhaseMask,true);
+
+ for(int8 i = 0; i < MAX_SUMMON_SLOT; ++i)
+ if(m_SummonSlot[i])
+ if(Creature *summon = ObjectAccessor::GetCreature(*this, m_SummonSlot[i]))
+ summon->SetPhaseMask(newPhaseMask,true);
+}
+
+void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
+{
+ if(GetTypeId() == TYPEID_UNIT)
+ {
+ GetMotionMaster()->MoveKnockbackFrom(x, y, speedXY, speedZ);
+ }
+ else
+ {
+ float vcos, vsin;
+ GetSinCos(x, y, vsin, vcos);
+
+ WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
+ data.append(GetPackGUID());
+ data << uint32(0); // Sequence
+ data << float(vcos); // x direction
+ data << float(vsin); // y direction
+ data << float(speedXY); // Horizontal speed
+ data << float(-speedZ); // Z Movement speed (vertical)
+
+ ((Player*)this)->GetSession()->SendPacket(&data);
+ }
+}
+
+void Unit::JumpTo(float speedXY, float speedZ, bool forward)
+{
+ float angle = forward ? 0 : M_PI;
+ if(GetTypeId() == TYPEID_UNIT)
+ {
+ GetMotionMaster()->MoveJumpTo(angle, speedXY, speedZ);
+ }
+ else
+ {
+ float vcos = cos(angle+GetOrientation());
+ float vsin = sin(angle+GetOrientation());
+
+ WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
+ data.append(GetPackGUID());
+ data << uint32(0); // Sequence
+ data << float(vcos); // x direction
+ data << float(vsin); // y direction
+ data << float(speedXY); // Horizontal speed
+ data << float(-speedZ); // Z Movement speed (vertical)
+
+ ((Player*)this)->GetSession()->SendPacket(&data);
+ }
+}
+
+void Unit::JumpTo(WorldObject *obj, float speedZ)
+{
+ float x, y, z;
+ obj->GetContactPoint(this, x, y, z);
+ float speedXY = GetExactDistance2d(x, y) * 10.0f / speedZ;
+ GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ);
+}
+
+void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ )
+{
+ if(GetTypeId() == TYPEID_PLAYER)
+ ((Player*)this)->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0));
+ else
+ {
+ GetMap()->CreatureRelocation((Creature*)this, x, y, z, orientation);
+
+ WorldPacket data;
+ // Work strange for many spells: triggered active mover set for targeted player to creature
+ //BuildTeleportAckMsg(&data, x, y, z, orientation);
+ BuildHeartBeatMsg(&data);
+ SendMessageToSet(&data, false);
+ }
+}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 795d2982c07..60f1a113175 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "Common.h"
#include "Object.h"
#include "Opcodes.h"
-#include "Mthread.h"
#include "SpellAuraDefines.h"
#include "UpdateFields.h"
#include "SharedDefines.h"
@@ -34,7 +33,7 @@
#include "FollowerRefManager.h"
#include "Utilities/EventProcessor.h"
#include "MotionMaster.h"
-#include "Database/DBCStructure.h"
+#include "DBCStructure.h"
#include <list>
#define WORLD_TRIGGER 12999
@@ -45,7 +44,8 @@ enum SpellInterruptFlags
SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back
SPELL_INTERRUPT_FLAG_INTERRUPT = 0x04, // interrupt
SPELL_INTERRUPT_FLAG_AUTOATTACK = 0x08, // no
- SPELL_INTERRUPT_FLAG_DAMAGE = 0x10 // _complete_ interrupt on direct damage?
+ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage
+ //SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
};
enum SpellChannelInterruptFlags
@@ -79,7 +79,7 @@ enum SpellAuraInterruptFlags
AURA_INTERRUPT_FLAG_MOUNT = 0x00020000, // 17 misdirect, aspect, swim speed
AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up
AURA_INTERRUPT_FLAG_CHANGE_MAP = 0x00080000, // 19 leaving map/getting teleported
- AURA_INTERRUPT_FLAG_UNATTACKABLE = 0x00100000, // 20 invulnerable or stealth
+ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION = 0x00100000, // 20 removed by auras that make you invulnerable, or make other to loose selection on you
AURA_INTERRUPT_FLAG_UNK21 = 0x00200000, // 21
AURA_INTERRUPT_FLAG_TELEPORTED = 0x00400000, // 22
AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat
@@ -101,7 +101,7 @@ enum SpellModOp
SPELLMOD_CASTING_TIME = 10,
SPELLMOD_COOLDOWN = 11,
SPELLMOD_EFFECT2 = 12,
- // spellmod 13 unused
+ SPELLMOD_IGNORE_ARMOR = 13,
SPELLMOD_COST = 14,
SPELLMOD_CRIT_DAMAGE_BONUS = 15,
SPELLMOD_RESIST_MISS_CHANCE = 16,
@@ -109,13 +109,16 @@ enum SpellModOp
SPELLMOD_CHANCE_OF_SUCCESS = 18,
SPELLMOD_ACTIVATION_TIME = 19,
SPELLMOD_EFFECT_PAST_FIRST = 20,
- SPELLMOD_CASTING_TIME_OLD = 21,
+ SPELLMOD_GLOBAL_COOLDOWN = 21, //TODO: GCD is not checked by server currently
SPELLMOD_DOT = 22,
SPELLMOD_EFFECT3 = 23,
SPELLMOD_SPELL_BONUS_DAMAGE = 24,
- // spellmod 25, 26 unused
+ // spellmod 25
+ SPELLMOD_PROC_PER_MINUTE = 26,
SPELLMOD_MULTIPLE_VALUE = 27,
- SPELLMOD_RESIST_DISPEL_CHANCE = 28
+ SPELLMOD_RESIST_DISPEL_CHANCE = 28,
+ SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell
+ SPELLMOD_SPELL_COST_REFUND_ON_FAIL = 30
};
#define MAX_SPELLMOD 32
@@ -129,6 +132,35 @@ enum SpellFacingFlags
#define BASE_MAXDAMAGE 2.0f
#define BASE_ATTACK_TIME 2000
+// byte value (UNIT_FIELD_BYTES_1,0)
+enum UnitStandStateType
+{
+ UNIT_STAND_STATE_STAND = 0,
+ UNIT_STAND_STATE_SIT = 1,
+ UNIT_STAND_STATE_SIT_CHAIR = 2,
+ UNIT_STAND_STATE_SLEEP = 3,
+ UNIT_STAND_STATE_SIT_LOW_CHAIR = 4,
+ UNIT_STAND_STATE_SIT_MEDIUM_CHAIR = 5,
+ UNIT_STAND_STATE_SIT_HIGH_CHAIR = 6,
+ UNIT_STAND_STATE_DEAD = 7,
+ UNIT_STAND_STATE_KNEEL = 8
+};
+
+// byte flag value (UNIT_FIELD_BYTES_1,2)
+enum UnitStandFlags
+{
+ UNIT_STAND_FLAGS_CREEP = 0x02,
+ UNIT_STAND_FLAGS_ALL = 0xFF
+};
+
+// byte flags value (UNIT_FIELD_BYTES_1,3)
+enum UnitBytes1_Flags
+{
+ UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01,
+ UNIT_BYTE1_FLAG_UNTRACKABLE = 0x04,
+ UNIT_BYTE1_FLAG_ALL = 0xFF
+};
+
// high byte (3 from 0..3) of UNIT_FIELD_BYTES_2
enum ShapeshiftForm
{
@@ -149,6 +181,7 @@ enum ShapeshiftForm
FORM_BERSERKERSTANCE = 0x13,
FORM_TEST = 0x14,
FORM_ZOMBIE = 0x15,
+ FORM_METAMORPHOSIS = 0x16,
FORM_FLIGHT_EPIC = 0x1B,
FORM_SHADOW = 0x1C,
FORM_FLIGHT = 0x1D,
@@ -168,14 +201,14 @@ enum SheathState
// byte (1 from 0..3) of UNIT_FIELD_BYTES_2
enum UnitBytes2_Flags
{
- UNIT_BYTE2_FLAG_UNK0 = 0x01,
- UNIT_BYTE2_FLAG_UNK1 = 0x02,
- UNIT_BYTE2_FLAG_UNK2 = 0x04,
+ UNIT_BYTE2_FLAG_PVP = 0x01,
+ UNIT_BYTE2_FLAG_UNK1 = 0x02,
+ UNIT_BYTE2_FLAG_FFA_PVP = 0x04,
UNIT_BYTE2_FLAG_SANCTUARY = 0x08,
- UNIT_BYTE2_FLAG_AURAS = 0x10, // show possitive auras as positive, and allow its dispel
- UNIT_BYTE2_FLAG_UNK5 = 0x20,
- UNIT_BYTE2_FLAG_UNK6 = 0x40,
- UNIT_BYTE2_FLAG_UNK7 = 0x80
+ UNIT_BYTE2_FLAG_UNK4 = 0x10,
+ UNIT_BYTE2_FLAG_UNK5 = 0x20,
+ UNIT_BYTE2_FLAG_UNK6 = 0x40,
+ UNIT_BYTE2_FLAG_UNK7 = 0x80
};
// byte (2 from 0..3) of UNIT_FIELD_BYTES_2
@@ -185,7 +218,11 @@ enum UnitRename
UNIT_RENAME_ALLOWED = 0x03
};
-#define CREATURE_MAX_SPELLS 4
+#define CREATURE_MAX_SPELLS 8
+#define MAX_SPELL_CHARM 4
+#define MAX_SPELL_VEHICLE 6
+#define MAX_SPELL_POSSESS 8
+#define MAX_SPELL_CONTROL_BAR 10
enum Swing
{
@@ -213,16 +250,27 @@ enum HitInfo
HITINFO_UNK1 = 0x00000001, // req correct packet structure
HITINFO_NORMALSWING2 = 0x00000002,
HITINFO_LEFTSWING = 0x00000004,
+ HITINFO_UNK2 = 0x00000008,
HITINFO_MISS = 0x00000010,
- HITINFO_ABSORB = 0x00000020, // plays absorb sound
- HITINFO_RESIST = 0x00000040, // resisted at least some damage
- HITINFO_CRITICALHIT = 0x00000080,
- HITINFO_UNK2 = 0x00000100, // wotlk?
- HITINFO_UNK3 = 0x00002000, // wotlk?
- HITINFO_GLANCING = 0x00004000,
- HITINFO_CRUSHING = 0x00008000,
- HITINFO_NOACTION = 0x00010000,
- HITINFO_SWINGNOHITSOUND = 0x00080000
+ HITINFO_ABSORB = 0x00000020, // absorbed damage
+ HITINFO_ABSORB2 = 0x00000040, // absorbed damage
+ HITINFO_RESIST = 0x00000080, // resisted atleast some damage
+ HITINFO_RESIST2 = 0x00000100, // resisted atleast some damage
+ HITINFO_CRITICALHIT = 0x00000200, // critical hit
+ // 0x00000400
+ // 0x00000800
+ // 0x00001000
+ HITINFO_BLOCK = 0x00002000, // blocked damage
+ // 0x00004000
+ // 0x00008000
+ HITINFO_GLANCING = 0x00010000,
+ HITINFO_CRUSHING = 0x00020000,
+ HITINFO_NOACTION = 0x00040000, // guessed
+ // 0x00080000
+ // 0x00100000
+ HITINFO_SWINGNOHITSOUND = 0x00200000, // guessed
+ // 0x00400000
+ HITINFO_UNK3 = 0x00800000
};
//i would like to remove this: (it is defined in item.h
@@ -233,11 +281,11 @@ enum InventorySlot
};
struct FactionTemplateEntry;
-struct Modifier;
struct SpellEntry;
struct SpellEntryExt;
class Aura;
+class AuraEffect;
class Creature;
class Spell;
class DynamicObject;
@@ -246,6 +294,8 @@ class Item;
class Pet;
class Path;
class PetAura;
+class Guardian;
+class UnitAI;
struct SpellImmune
{
@@ -280,9 +330,10 @@ enum DamageTypeToSchool
enum AuraRemoveMode
{
AURA_REMOVE_BY_DEFAULT,
- AURA_REMOVE_BY_STACK, // at replace by semillar aura
+ AURA_REMOVE_BY_STACK, // change stack, single aura remove,
AURA_REMOVE_BY_CANCEL,
- AURA_REMOVE_BY_DISPEL,
+ AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
+ AURA_REMOVE_BY_EXPIRE, // dispel and absorb aura destroy
AURA_REMOVE_BY_DEATH
};
@@ -294,11 +345,13 @@ enum UnitMods
UNIT_MOD_STAT_INTELLECT,
UNIT_MOD_STAT_SPIRIT,
UNIT_MOD_HEALTH,
- UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_HAPPINESS must be in existed order, it's accessed by index values of Powers enum.
+ UNIT_MOD_MANA, // UNIT_MOD_MANA..UNIT_MOD_RUNIC_POWER must be in existed order, it's accessed by index values of Powers enum.
UNIT_MOD_RAGE,
UNIT_MOD_FOCUS,
UNIT_MOD_ENERGY,
UNIT_MOD_HAPPINESS,
+ UNIT_MOD_RUNE,
+ UNIT_MOD_RUNIC_POWER,
UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
UNIT_MOD_RESISTANCE_HOLY,
UNIT_MOD_RESISTANCE_FIRE,
@@ -318,7 +371,7 @@ enum UnitMods
UNIT_MOD_RESISTANCE_START = UNIT_MOD_ARMOR,
UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1,
UNIT_MOD_POWER_START = UNIT_MOD_MANA,
- UNIT_MOD_POWER_END = UNIT_MOD_HAPPINESS + 1
+ UNIT_MOD_POWER_END = UNIT_MOD_RUNIC_POWER + 1
};
enum BaseModGroup
@@ -368,8 +421,12 @@ enum UnitState
UNIT_STAT_CASTING = 0x00008000,
UNIT_STAT_POSSESSED = 0x00010000,
UNIT_STAT_CHARGING = 0x00020000,
+ UNIT_STAT_JUMPING = 0x00040000,
+ UNIT_STAT_ONVEHICLE = 0x00080000,
+ UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE),
UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE),
- UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_CHARGING),
+ UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING),
+ UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING),
UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CHASE),
UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING),
UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT)
@@ -385,23 +442,21 @@ enum UnitMoveType
MOVE_TURN_RATE = 5,
MOVE_FLIGHT = 6,
MOVE_FLIGHT_BACK = 7,
+ MOVE_PITCH_RATE = 8
};
-#define MAX_MOVE_TYPE 8
+#define MAX_MOVE_TYPE 9
extern float baseMoveSpeed[MAX_MOVE_TYPE];
-// assume it is 25 yard per 0.6 second
-#define SPEED_CHARGE 42.0f
enum WeaponAttackType
{
BASE_ATTACK = 0,
OFF_ATTACK = 1,
- RANGED_ATTACK = 2
+ RANGED_ATTACK = 2,
+ MAX_ATTACK
};
-#define MAX_ATTACK 3
-
enum CombatRating
{
CR_WEAPON_SKILL = 0,
@@ -427,10 +482,11 @@ enum CombatRating
CR_WEAPON_SKILL_MAINHAND = 20,
CR_WEAPON_SKILL_OFFHAND = 21,
CR_WEAPON_SKILL_RANGED = 22,
- CR_EXPERTISE = 23
+ CR_EXPERTISE = 23,
+ CR_ARMOR_PENETRATION = 24
};
-#define MAX_COMBAT_RATING 24
+#define MAX_COMBAT_RATING 25
enum DamageEffectType
{
@@ -455,45 +511,50 @@ enum UnitVisibility
// Value masks for UNIT_FIELD_FLAGS
enum UnitFlags
{
- UNIT_FLAG_UNKNOWN7 = 0x00000001,
+ UNIT_FLAG_UNK_0 = 0x00000001,
UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
UNIT_FLAG_DISABLE_MOVE = 0x00000004,
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_ATTR_EX5_NO_REAGENT_WHILE_PREP
- UNIT_FLAG_UNKNOWN9 = 0x00000040,
+ UNIT_FLAG_UNK_6 = 0x00000040,
UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
UNIT_FLAG_NOT_ATTACKABLE_2 = 0x00000100, // 2.0.8
- UNIT_FLAG_UNKNOWN11 = 0x00000200,
+ UNIT_FLAG_UNK_9 = 0x00000200, // 3.0.3 - makes you unable to attack everything
UNIT_FLAG_LOOTING = 0x00000400, // loot animation
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
- UNIT_FLAG_PVP = 0x00001000,
+ UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
- UNIT_FLAG_UNKNOWN4 = 0x00004000, // 2.0.8
- UNIT_FLAG_UNKNOWN13 = 0x00008000,
- UNIT_FLAG_UNKNOWN14 = 0x00010000,
- UNIT_FLAG_PACIFIED = 0x00020000,
- UNIT_FLAG_DISABLE_ROTATE = 0x00040000, // stunned, 2.1.1
+ UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
+ UNIT_FLAG_UNK_15 = 0x00008000,
+ UNIT_FLAG_UNK_16 = 0x00010000,
+ UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
+ UNIT_FLAG_STUNNED = 0x00040000, // 3.0.3 ok
UNIT_FLAG_IN_COMBAT = 0x00080000,
UNIT_FLAG_TAXI_FLIGHT = 0x00100000, // disable casting at client side spell not allowed by taxi flight (mounted?), probably used with 0x4 flag
- UNIT_FLAG_DISARMED = 0x00200000, // disable melee spells casting..., "Required melee weapon" added to melee spells tooltip.
+ UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip.
UNIT_FLAG_CONFUSED = 0x00400000,
UNIT_FLAG_FLEEING = 0x00800000,
- UNIT_FLAG_UNKNOWN5 = 0x01000000, // used in spell Eyes of the Beast for pet...
+ UNIT_FLAG_UNK_24 = 0x01000000, // used in spell Eyes of the Beast for pet...
UNIT_FLAG_NOT_SELECTABLE = 0x02000000,
UNIT_FLAG_SKINNABLE = 0x04000000,
UNIT_FLAG_MOUNT = 0x08000000,
- UNIT_FLAG_UNKNOWN17 = 0x10000000,
- UNIT_FLAG_UNKNOWN6 = 0x20000000, // used in Feing Death spell
- UNIT_FLAG_SHEATHE = 0x40000000
+ UNIT_FLAG_UNK_28 = 0x10000000,
+ UNIT_FLAG_UNK_29 = 0x20000000, // used in Feing Death spell
+ UNIT_FLAG_SHEATHE = 0x40000000,
+ UNIT_FLAG_UNK_31 = 0x80000000
};
// Value masks for UNIT_FIELD_FLAGS_2
enum UnitFlags2
{
- UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
- UNIT_FLAG2_COMPREHEND_LANG= 0x00000008,
- UNIT_FLAG2_FORCE_MOVE = 0x00000040
+ UNIT_FLAG2_FEIGN_DEATH = 0x00000001,
+ UNIT_FLAG2_UNK1 = 0x00000002, // Hide unit model (show only player equip)
+ UNIT_FLAG2_COMPREHEND_LANG = 0x00000008,
+ UNIT_FLAG2_FORCE_MOVE = 0x00000040,
+ UNIT_FLAG2_DISARM_OFFHAND = 0x00000080,
+ UNIT_FLAG2_DISARM_RANGED = 0x00000400, //this does not disable ranged weapon display (maybe additional flag needed?)
+ UNIT_FLAG2_REGENERATE_POWER = 0x00000800
};
/// Non Player Character flags
@@ -571,6 +632,37 @@ enum MovementFlags
MOVEMENTFLAG_UNK3 = 0x40000000
};
+struct MovementInfo
+{
+ // common
+ uint32 flags;
+ uint16 unk1;
+ uint32 time;
+ float x, y, z, o;
+ // transport
+ uint64 t_guid;
+ float t_x, t_y, t_z, t_o;
+ uint32 t_time;
+ int8 t_seat;
+ // swimming and unknown
+ float s_pitch;
+ // last fall time
+ uint32 fallTime;
+ // jumping
+ float j_unk, j_sinAngle, j_cosAngle, j_xyspeed;
+ // spline
+ float u_unk1;
+
+ MovementInfo()
+ {
+ flags = 0;
+ time = t_time = fallTime = 0;
+ unk1 = 0;
+ x = y = z = o = t_x = t_y = t_z = t_o = s_pitch = j_unk = j_sinAngle = j_cosAngle = j_xyspeed = u_unk1 = 0.0f;
+ t_guid = 0;
+ }
+};
+
enum DiminishingLevels
{
DIMINISHING_LEVEL_1 = 0,
@@ -581,7 +673,9 @@ enum DiminishingLevels
struct DiminishingReturn
{
- DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count) : DRGroup(group), hitTime(t), hitCount(count), stack(0) {}
+ DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count)
+ : DRGroup(group), stack(0), hitTime(t), hitCount(count)
+ {}
DiminishingGroup DRGroup:16;
uint16 stack:16;
@@ -592,8 +686,9 @@ struct DiminishingReturn
enum MeleeHitOutcome
{
MELEE_HIT_EVADE, MELEE_HIT_MISS, MELEE_HIT_DODGE, MELEE_HIT_BLOCK, MELEE_HIT_PARRY,
- MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING, MELEE_HIT_NORMAL, MELEE_HIT_BLOCK_CRIT
+ MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING, MELEE_HIT_NORMAL
};
+
struct CleanDamage
{
CleanDamage(uint32 _damage, WeaponAttackType _attackType, MeleeHitOutcome _hitOutCome) :
@@ -628,9 +723,11 @@ struct CalcDamageInfo
// Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
struct SpellNonMeleeDamage{
- SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask) :
- attacker(_attacker), target(_target), SpellID(_SpellID), damage(0), schoolMask(_schoolMask),
- absorb(0), resist(0), phusicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0) {}
+ SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask)
+ : target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), schoolMask(_schoolMask),
+ absorb(0), resist(0), phusicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0)
+ {}
+
Unit *target;
Unit *attacker;
uint32 SpellID;
@@ -650,8 +747,20 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
struct UnitActionBarEntry
{
- uint32 Type;
- uint32 SpellOrAction;
+ UnitActionBarEntry() : Raw(0) {}
+
+ union
+ {
+ struct
+ {
+ uint16 SpellOrAction;
+ uint16 Type;
+ };
+ struct
+ {
+ uint32 Raw;
+ };
+ };
};
#define MAX_DECLINED_NAME_CASES 5
@@ -673,13 +782,12 @@ enum CurrentSpellTypes
enum ActiveStates
{
- ACT_ENABLED = 0xC100,
- ACT_DISABLED = 0x8100,
- ACT_COMMAND = 0x0700,
- ACT_REACTION = 0x0600,
- ACT_CAST = 0x0100,
- ACT_PASSIVE = 0x0000,
- ACT_DECIDE = 0x0001
+ ACT_PASSIVE = 0x0100, // 0x0100 - passive
+ ACT_DISABLED = 0x8100, // 0x8000 - castable
+ ACT_ENABLED = 0xC100, // 0x4000 | 0x8000 - auto cast + castable
+ ACT_COMMAND = 0x0700, // 0x0100 | 0x0200 | 0x0400
+ ACT_REACTION = 0x0600, // 0x0200 | 0x0400
+ ACT_DECIDE = 0x0001 // what is it?
};
enum ReactStates
@@ -748,15 +856,18 @@ struct TRINITY_DLL_SPEC CharmInfo
enum ReactiveType
{
- REACTIVE_DEFENSE = 1,
- REACTIVE_HUNTER_PARRY = 2,
- REACTIVE_CRIT = 3,
- REACTIVE_HUNTER_CRIT = 4,
- REACTIVE_OVERPOWER = 5
+ REACTIVE_DEFENSE = 0,
+ REACTIVE_HUNTER_PARRY = 1,
+ REACTIVE_OVERPOWER = 2
};
-#define MAX_REACTIVE 6
-#define MAX_TOTEM 4
+#define MAX_REACTIVE 3
+#define SUMMON_SLOT_PET 0
+#define SUMMON_SLOT_TOTEM 1
+#define MAX_TOTEM_SLOT 5
+#define SUMMON_SLOT_MINIPET 5
+#define SUMMON_SLOT_QUEST 6
+#define MAX_SUMMON_SLOT 7
// delay time next attack to prevent client attack animation problems
#define ATTACK_DISPLAY_DELAY 200
@@ -767,13 +878,16 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
{
public:
typedef std::set<Unit*> AttackerSet;
+ typedef std::set<Unit*> ControlList;
typedef std::pair<uint32, uint8> spellEffectPair;
- typedef std::multimap< spellEffectPair, Aura*> AuraMap;
+ typedef std::multimap<uint32, Aura*> AuraMap;
+ typedef std::list<AuraEffect *> AuraEffectList;
typedef std::list<Aura *> AuraList;
typedef std::list<DiminishingReturn> Diminishing;
- typedef std::set<AuraType> AuraTypeSet;
typedef std::set<uint32> ComboPointHolderSet;
+ typedef std::map<uint8, Aura*> VisibleAuraMap;
+
virtual ~Unit ( );
void AddToWorld();
@@ -787,6 +901,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
void ClearDiminishings() { m_Diminishing.clear(); }
+ //target dependent range checks
+ uint32 GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry);
+ uint32 GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry);
+ uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry);
+
virtual void Update( uint32 time );
void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
@@ -806,15 +925,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void _addAttacker(Unit *pAttacker) // must be called only from Unit::Attack(Unit*)
{
- AttackerSet::iterator itr = m_attackers.find(pAttacker);
- if(itr == m_attackers.end())
- m_attackers.insert(pAttacker);
+ m_attackers.insert(pAttacker);
}
void _removeAttacker(Unit *pAttacker) // must be called only from Unit::AttackStop()
{
- AttackerSet::iterator itr = m_attackers.find(pAttacker);
- if(itr != m_attackers.end())
- m_attackers.erase(itr);
+ m_attackers.erase(pAttacker);
}
Unit * getAttackerForHelper() // If someone wants to help, who to give them
{
@@ -836,6 +951,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void CombatStop(bool cast = false);
void CombatStopWithPets(bool cast = false);
Unit* SelectNearbyTarget(float dist = NOMINAL_MELEE_RANGE) const;
+ bool hasNegativeAuraWithInterruptFlag(uint32 flag);
void addUnitState(uint32 f) { m_state |= f; }
bool hasUnitState(const uint32 f) const { return (m_state & f); }
@@ -903,8 +1019,14 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
return false;
}
- bool IsPvP() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP); }
- void SetPvP(bool state) { if(state) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP); else RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP); }
+ bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); }
+ void SetPvP(bool state)
+ {
+ if(state)
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
+ else
+ RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
+ }
uint32 GetCreatureType() const;
uint32 GetCreatureTypeMask() const
{
@@ -917,6 +1039,9 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool IsStandState() const;
void SetStandState(uint8 state);
+ void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2,flags); }
+ void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2,flags); }
+
bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); }
uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); }
void Mount(uint32 mount);
@@ -939,6 +1064,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss);
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK);
+ int32 GetIgnoredArmorMultiplier(SpellEntry const *spellInfo, WeaponAttackType attackType);
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss);
float MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
@@ -950,16 +1076,26 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
float GetUnitParryChance() const;
float GetUnitBlockChance() const;
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVictim) const;
+ bool CanUseAttackType( uint8 attacktype ) const
+ {
+ switch(attacktype)
+ {
+ case BASE_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED);
+ case OFF_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_OFFHAND);
+ case RANGED_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_RANGED);
+ }
+ return true;
+ }
virtual uint32 GetShieldBlockValue() const =0;
uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
float GetWeaponProcChance() const;
- float GetPPMProcChance(uint32 WeaponSpeed, float PPM) const;
+ float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * spellProto) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType) const;
- MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted ) const;
+ MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
bool isVendor() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR ); }
bool isTrainer() const { return HasFlag( UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER ); }
@@ -997,10 +1133,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void ClearInCombat();
uint32 GetCombatTimer() const { return m_CombatTimer; }
- bool HasAuraType(AuraType auraType) const;
- bool HasAura(uint32 spellId, uint32 effIndex) const
- { return m_Auras.find(spellEffectPair(spellId, effIndex)) != m_Auras.end(); }
-
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
@@ -1021,13 +1153,15 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true);
- void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
- void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void AddAura(uint32 spellId, Unit *target);
+ void HandleAuraEffect(AuraEffect * aureff, bool apply);
+ Aura *AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster);
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
@@ -1040,15 +1174,20 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo);
+ void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
+
+ void KnockbackFrom(float x, float y, float speedXY, float speedZ);
+ void JumpTo(float speedXY, float speedZ, bool forward = true);
+ void JumpTo(WorldObject *obj, float speedZ);
+
void SendMonsterStop();
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL);
+ void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end);
- void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFlags, uint32 transitTime = 0, Player* player = NULL);
+ void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);
void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
- virtual void MoveOutOfRange(Player &) { };
-
bool isAlive() const { return (m_deathState == ALIVE); };
bool isDead() const { return ( m_deathState == DEAD || m_deathState == CORPSE ); };
DeathState getDeathState() { return m_deathState; };
@@ -1058,10 +1197,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SetOwnerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner); }
uint64 GetCreatorGUID() const { return GetUInt64Value(UNIT_FIELD_CREATEDBY); }
void SetCreatorGUID(uint64 creator) { SetUInt64Value(UNIT_FIELD_CREATEDBY, creator); }
- uint64 GetPetGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMON); }
+ uint64 GetGuardianGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMON); }
+ void SetGuardianGUID(uint64 guid) { SetUInt64Value(UNIT_FIELD_SUMMON, guid); }
uint64 GetCharmerGUID() const { return GetUInt64Value(UNIT_FIELD_CHARMEDBY); }
void SetCharmerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_CHARMEDBY, owner); }
uint64 GetCharmGUID() const { return GetUInt64Value(UNIT_FIELD_CHARM); }
+ void SetPetGUID(uint64 guid) { m_SummonSlot[SUMMON_SLOT_PET] = guid; }
+ uint64 GetPetGUID() const { return m_SummonSlot[SUMMON_SLOT_PET]; }
uint64 GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); }
uint64 GetCharmerOrOwnerOrOwnGUID() const
@@ -1075,7 +1217,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
Player* GetSpellModOwner() const;
Unit* GetOwner() const;
- Pet* GetPet() const;
+ Guardian *GetGuardianPet() const;
Unit* GetCharmer() const;
Unit* GetCharm() const;
Unit* GetCharmerOrOwner() const { return GetCharmerGUID() ? GetCharmer() : GetOwner(); }
@@ -1088,12 +1230,17 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
}
Player* GetCharmerOrOwnerPlayerOrPlayerItself() const;
- void SetPet(Pet* pet);
- void SetCharm(Unit* pet);
+ void SetGuardian(Guardian* target, bool apply);
+ void SetCharm(Unit* target, bool apply);
+ Unit* GetNextRandomRaidMemberOrPet(float radius);
void SetCharmedOrPossessedBy(Unit* charmer, bool possess);
void RemoveCharmedOrPossessedBy(Unit* charmer);
void RestoreFaction();
+ ControlList m_Controlled;
+ Unit* GetFirstControlled() const;
+ void RemoveAllControlled();
+
bool isCharmed() const { return GetCharmerGUID() != 0; }
bool isPossessed() const { return hasUnitState(UNIT_STAT_POSSESSED); }
bool isPossessedByPlayer() const { return hasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
@@ -1122,31 +1269,23 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool AddAura(Aura *aur);
void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAura(uint32 spellId, uint32 effindex, Aura* except = NULL);
- void RemoveSingleAuraFromStackByDispel(uint32 spellId);
- void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
- void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL);
- void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
- void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID);
- void SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration);
- Aura* GetAuraByCasterSpell(uint32 spellId, uint64 casterGUID);
+ void RemoveAura(uint32 spellId, uint64 caster = 0 ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAura(Aura * aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasDueToSpell(uint32 spellId, uint64 caster = NULL ,AuraRemoveMode removeMode= AURA_REMOVE_BY_DEFAULT);
+ void RemoveAuraFromStack(uint32 spellId, uint64 caster = NULL ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ inline void RemoveAuraFromStack(AuraMap::iterator &iter,AuraRemoveMode removeMode);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
- void RemoveAurasDueToSpellByCancel(uint32 spellId);
- void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster);
+ void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
+ void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except=NULL);
+ void RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell = NULL);
void RemoveNotOwnSingleTargetAuras();
-
- void RemoveSpellsCausingAura(AuraType auraType);
- void RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID);
- void RemoveRankAurasDueToSpell(uint32 spellId);
bool RemoveNoStackAurasDueToAura(Aura *Aur);
- void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0);
- void RemoveAurasWithDispelType( DispelType type );
-
+ void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL);
void RemoveAllAuras();
void RemoveArenaAuras(bool onleave = false);
void RemoveAllAurasOnDeath();
- void DelayAura(uint32 spellId, uint32 effindex, int32 delaytime);
+ void DelayAura(uint32 spellId, uint64 caster, int32 delaytime);
float GetResistanceBuffMods(SpellSchools school, bool positive) const { return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school ); }
void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school,val); }
@@ -1191,12 +1330,15 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
Spell* m_currentSpells[CURRENT_MAX_SPELL];
uint32 m_addDmgOnce;
- uint64 m_TotemSlot[MAX_TOTEM];
+ uint64 m_SummonSlot[MAX_SUMMON_SLOT];
uint64 m_ObjectSlot[4];
uint32 m_detectInvisibilityMask;
uint32 m_invisibilityMask;
+
uint32 m_ShapeShiftFormSpellId;
ShapeshiftForm m_form;
+ bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
+
float m_modMeleeHitChance;
float m_modRangedHitChance;
float m_modSpellHitChance;
@@ -1242,17 +1384,17 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void DestroyForNearbyPlayers();
// common function for visibility checks for player/creatures with detection code
- virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
+ virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const = 0;
bool isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
bool canDetectInvisibilityOf(Unit const* u) const;
bool canDetectStealthOf(Unit const* u, float distance) const;
+ void SetPhaseMask(uint32 newPhaseMask, bool update);// overwrite WorldObject::SetPhaseMask
// virtual functions for all world objects types
bool isVisibleForInState(Player const* u, bool inVisibleList) const;
// function for low level grid visibility checks in player/creature cases
virtual bool IsVisibleInGridForPlayer(Player const* pl) const = 0;
- bool waterbreath;
AuraList & GetSingleCastAuras() { return m_scAuras; }
AuraList const& GetSingleCastAuras() const { return m_scAuras; }
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
@@ -1269,15 +1411,33 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void removeHatedBy(HostilReference* /*pHostilReference*/ ) { /* nothing to do yet */ }
HostilRefManager& getHostilRefManager() { return m_HostilRefManager; }
- Aura* GetAura(uint32 spellId, uint32 effindex);
+ VisibleAuraMap const *GetVisibleAuras() { return &m_visibleAuras; }
+ Aura * GetVisibleAura(uint8 slot)
+ {
+ VisibleAuraMap::iterator itr = m_visibleAuras.find(slot);
+ if(itr != m_visibleAuras.end())
+ return itr->second;
+ return 0;
+ }
+ void SetVisibleAura(uint8 slot, Aura * aur){ m_visibleAuras[slot]=aur; }
+ void RemoveVisibleAura(uint8 slot){ m_visibleAuras.erase(slot); }
+
AuraMap & GetAuras() { return m_Auras; }
AuraMap const& GetAuras() const { return m_Auras; }
- AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
- void ApplyAuraProcTriggerDamage(Aura* aura, bool apply);
+ AuraEffectList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
+
+ AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
+ Aura * GetAura(uint32 spellId, uint64 casterGUID = 0) const;
+ AuraEffect* GetAura(AuraType type, uint32 family, uint32 familyFlag1 , uint32 familyFlag2=0, uint32 familyFlag3=0, uint64 casterGUID=0);
+ bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
+ bool HasAura(uint32 spellId, uint64 caster = 0) const;
+ bool HasAura(Aura * aur) const;
+ bool HasAuraType(AuraType auraType) const;
+ bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
int32 GetTotalAuraModifier(AuraType auratype) const;
float GetTotalAuraMultiplier(AuraType auratype) const;
- int32 GetMaxPositiveAuraModifier(AuraType auratype) const;
+ int32 GetMaxPositiveAuraModifier(AuraType auratype);
int32 GetMaxNegativeAuraModifier(AuraType auratype) const;
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
@@ -1290,7 +1450,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
- Aura* GetDummyAura(uint32 spell_id) const;
+ AuraEffect* GetDummyAura(uint32 spell_id) const;
uint32 GetInterruptMask() const { return m_interruptMask; }
void AddInterruptMask(uint32 mask) { m_interruptMask |= mask; }
void UpdateInterruptMask();
@@ -1301,30 +1461,36 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SetNativeDisplayId(uint32 modelId) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, modelId); }
void setTransForm(uint32 spellid) { m_transform = spellid;}
uint32 getTransForm() const { return m_transform;}
+
+ DynamicObject* GetDynObject(uint32 spellId, uint32 effIndex);
+ DynamicObject* GetDynObject(uint32 spellId);
void AddDynObject(DynamicObject* dynObj);
void RemoveDynObject(uint32 spellid);
void RemoveDynObjectWithGUID(uint64 guid) { m_dynObjGUIDs.remove(guid); }
void RemoveAllDynObjects();
+
+ GameObject* GetGameObject(uint32 spellId) const;
void AddGameObject(GameObject* gameObj);
void RemoveGameObject(GameObject* gameObj, bool del);
void RemoveGameObject(uint32 spellid, bool del);
void RemoveAllGameObjects();
- DynamicObject *GetDynObject(uint32 spellId, uint32 effIndex);
- DynamicObject *GetDynObject(uint32 spellId);
+
uint32 CalculateDamage(WeaponAttackType attType, bool normalized);
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
void ModifyAuraState(AuraState flag, bool apply);
- bool HasAuraState(AuraState flag) const { return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); }
+ bool HasAuraState(AuraState flag, SpellEntry const *spellProto = NULL, Unit * Caster = NULL) const ;
void UnsummonAllTotems();
int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask);
int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask);
int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim);
int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim);
- uint32 SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 damage, DamageEffectType damagetype);
- uint32 SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, Unit *pVictim);
+ uint32 SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1);
+ uint32 SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
bool isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAttackType attackType = BASE_ATTACK);
+ bool isBlockCritical();
bool isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK);
- uint32 SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
+ uint32 SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
+ uint32 SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; }
bool IsUnderLastManaUseEffect() const;
@@ -1336,19 +1502,20 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply);
void ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType type, bool apply);
- virtual bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
+ virtual bool IsImmunedToSpell(SpellEntry const* spellInfo);
// redefined in Creature
- bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask, bool useCharges = false);
- virtual bool IsImmunedToSpellEffect(uint32 effect, uint32 mechanic) const;
+ bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask);
+ virtual bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
// redefined in Creature
- uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage);
- void CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist);
+ uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType=MAX_ATTACK);
+ void CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellEntry const *spellInfo = NULL);
void UpdateSpeed(UnitMoveType mtype, bool forced);
float GetSpeed( UnitMoveType mtype ) const;
float GetSpeedRate( UnitMoveType mtype ) const { return m_speed_rate[mtype]; }
void SetSpeed(UnitMoveType mtype, float rate, bool forced = false);
+ float m_TempSpeed;
void SetHover(bool on);
bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); }
@@ -1357,7 +1524,9 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void _ApplyAllAuraMods();
int32 CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 basePoints, Unit const* target);
- int32 CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target);
+ int32 CalcSpellDuration(SpellEntry const* spellProto);
+ int32 ModSpellDuration(SpellEntry const* spellProto, Unit const* target, int32 duration, bool positive);
+ void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell const * spell=NULL);
float CalculateLevelPenalty(SpellEntry const* spellProto) const;
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
@@ -1382,17 +1551,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SetUnitMovementFlags(uint32 f) { m_unit_movement_flags = f; }
void SetControlled(bool apply, UnitState state);
- void SetFeared(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/);
- void SetConfused(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/);
- void SetStunned(bool apply);
- void SetRooted(bool apply);
void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); }
void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); }
void ClearComboPointHolders();
///----------Pet responses methods-----------------
- void SendPetCastFail(uint32 spellid, uint8 msg);
+ void SendPetCastFail(uint32 spellid, SpellCastResult msg);
void SendPetActionFeedback (uint8 msg);
void SendPetTalk (uint32 pettalk);
void SendPetSpellCooldown (uint32 spellid, time_t cooltime);
@@ -1427,12 +1592,21 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
Unit *GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; }
bool IsAIEnabled, NeedChangeAI;
+ MovementInfo m_movementInfo;
+ Vehicle *m_Vehicle;
+ float GetTransOffsetX() const { return m_movementInfo.t_x; }
+ float GetTransOffsetY() const { return m_movementInfo.t_y; }
+ float GetTransOffsetZ() const { return m_movementInfo.t_z; }
+ float GetTransOffsetO() const { return m_movementInfo.t_o; }
+ uint32 GetTransTime() const { return m_movementInfo.t_time; }
+ int8 GetTransSeat() const { return m_movementInfo.t_seat; }
protected:
explicit Unit ();
UnitAI *i_AI, *i_disabledAI;
void _UpdateSpells(uint32 time);
+ void _DeleteAuras();
void _UpdateAutoRepeatSpell();
bool m_AutoRepeatFirstCast;
@@ -1447,25 +1621,28 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
DeathState m_deathState;
AuraMap m_Auras;
+ uint32 m_removedAurasCount;
typedef std::list<uint64> DynObjectGUIDs;
DynObjectGUIDs m_dynObjGUIDs;
- std::list<GameObject*> m_gameObj;
+ typedef std::list<GameObject*> GameObjectList;
+ GameObjectList m_gameObj;
bool m_isSorted;
uint32 m_transform;
- uint32 m_removedAuras;
- AuraList m_modAuras[TOTAL_AURAS];
+ AuraEffectList m_modAuras[TOTAL_AURAS];
AuraList m_scAuras; // casted singlecast auras
AuraList m_interruptableAuras;
AuraList m_ccAuras;
+ AuraList m_removedAuras;
uint32 m_interruptMask;
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END];
float m_weaponDamage[MAX_ATTACK][2];
bool m_canModifyStats;
//std::list< spellEffectPair > AuraSpells[TOTAL_AURAS]; // TODO: use this if ok for mem
+ VisibleAuraMap m_visibleAuras;
float m_speed_rate[MAX_MOVE_TYPE];
@@ -1478,6 +1655,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 m_unit_movement_flags;
uint32 m_reactiveTimer[MAX_REACTIVE];
+ uint32 m_regenTimer;
ThreatManager m_ThreatManager;
@@ -1485,12 +1663,19 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
- bool IsTriggeredAtSpellProcEvent( Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
- bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
- bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
- bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
- bool HandleOverrideClassScriptAuraProc(Unit *pVictim, Aura* triggredByAura, SpellEntry const *procSpell, uint32 cooldown);
- bool HandleMeandingAuraProc(Aura* triggeredByAura);
+ bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const * procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *& spellProcEvent );
+ bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
+ bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
+ bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
+ bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
+ bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 cooldown);
+ bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
+ bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
+
+ void SetFeared(bool apply);
+ void SetConfused(bool apply);
+ void SetStunned(bool apply);
+ void SetRooted(bool apply);
uint32 m_state; // Even derived shouldn't modify
uint32 m_CombatTimer;
diff --git a/src/game/UnitEvents.h b/src/game/UnitEvents.h
index 4bc362893a3..67f8d01f0d6 100644
--- a/src/game/UnitEvents.h
+++ b/src/game/UnitEvents.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/UpdateData.cpp b/src/game/UpdateData.cpp
index 91ef84bb372..de615c9cc8e 100644
--- a/src/game/UpdateData.cpp
+++ b/src/game/UpdateData.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -108,7 +108,7 @@ bool UpdateData::BuildPacket(WorldPacket *packet, bool hasTransport)
ByteBuffer buf(m_data.size() + 10 + m_outOfRangeGUIDs.size()*8);
buf << (uint32) (!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount);
- buf << (uint8) (hasTransport ? 1 : 0);
+ //buf << (uint8) (hasTransport ? 1 : 0);
if(!m_outOfRangeGUIDs.empty())
{
diff --git a/src/game/UpdateData.h b/src/game/UpdateData.h
index 256c572bb1d..71a9258b90b 100644
--- a/src/game/UpdateData.h
+++ b/src/game/UpdateData.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,11 +38,12 @@ enum OBJECT_UPDATE_FLAGS
UPDATEFLAG_NONE = 0x00,
UPDATEFLAG_SELF = 0x01,
UPDATEFLAG_TRANSPORT = 0x02,
- UPDATEFLAG_FULLGUID = 0x04,
+ UPDATEFLAG_HAS_TARGET = 0x04,
UPDATEFLAG_LOWGUID = 0x08,
UPDATEFLAG_HIGHGUID = 0x10,
UPDATEFLAG_LIVING = 0x20,
- UPDATEFLAG_HASPOSITION = 0x40
+ UPDATEFLAG_HAS_POSITION = 0x40,
+ UPDATEFLAG_VEHICLE = 0x80
};
class UpdateData
diff --git a/src/game/UpdateFields.h b/src/game/UpdateFields.h
index c8e70fc2198..97fcbeb05d6 100644
--- a/src/game/UpdateFields.h
+++ b/src/game/UpdateFields.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#ifndef _UPDATEFIELDS_AUTO_H
#define _UPDATEFIELDS_AUTO_H
-// Auto generated for version 2, 4, 3, 8606
+// Auto generated for version 3, 0, 3, 9183
enum EObjectFields
{
@@ -43,13 +43,37 @@ enum EItemFields
ITEM_FIELD_DURATION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: OWNER_ONLY, UNK2
ITEM_FIELD_SPELL_CHARGES = OBJECT_END + 0x000A, // Size: 5, Type: INT, Flags: OWNER_ONLY, UNK2
ITEM_FIELD_FLAGS = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC
- ITEM_FIELD_ENCHANTMENT = OBJECT_END + 0x0010, // Size: 33, Type: INT, Flags: PUBLIC
- ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x0031, // Size: 1, Type: INT, Flags: PUBLIC
- ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x0032, // Size: 1, Type: INT, Flags: PUBLIC
- ITEM_FIELD_ITEM_TEXT_ID = OBJECT_END + 0x0033, // Size: 1, Type: INT, Flags: OWNER_ONLY
- ITEM_FIELD_DURABILITY = OBJECT_END + 0x0034, // Size: 1, Type: INT, Flags: OWNER_ONLY, UNK2
- ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: OWNER_ONLY, UNK2
- ITEM_END = OBJECT_END + 0x0036,
+ ITEM_FIELD_ENCHANTMENT_1_1 = OBJECT_END + 0x0010, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_1_3 = OBJECT_END + 0x0012, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_2_1 = OBJECT_END + 0x0013, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_2_3 = OBJECT_END + 0x0015, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_3_1 = OBJECT_END + 0x0016, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_3_3 = OBJECT_END + 0x0018, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_4_1 = OBJECT_END + 0x0019, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_4_3 = OBJECT_END + 0x001B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_5_1 = OBJECT_END + 0x001C, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_5_3 = OBJECT_END + 0x001E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_6_1 = OBJECT_END + 0x001F, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_6_3 = OBJECT_END + 0x0021, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_7_1 = OBJECT_END + 0x0022, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_7_3 = OBJECT_END + 0x0024, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_8_1 = OBJECT_END + 0x0025, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_8_3 = OBJECT_END + 0x0027, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_9_1 = OBJECT_END + 0x0028, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_9_3 = OBJECT_END + 0x002A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_10_1 = OBJECT_END + 0x002B, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_10_3 = OBJECT_END + 0x002D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_11_1 = OBJECT_END + 0x002E, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_11_3 = OBJECT_END + 0x0030, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_12_1 = OBJECT_END + 0x0031, // Size: 2, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ENCHANTMENT_12_3 = OBJECT_END + 0x0033, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x0034, // Size: 1, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: PUBLIC
+ ITEM_FIELD_ITEM_TEXT_ID = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: OWNER_ONLY
+ ITEM_FIELD_DURABILITY = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: OWNER_ONLY, UNK2
+ ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x0038, // Size: 1, Type: INT, Flags: OWNER_ONLY, UNK2
+ ITEM_FIELD_PAD = OBJECT_END + 0x0039, // Size: 1, Type: INT, Flags: NONE
+ ITEM_END = OBJECT_END + 0x003A,
};
enum EContainerFields
@@ -64,93 +88,94 @@ enum EUnitFields
{
UNIT_FIELD_CHARM = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC
UNIT_FIELD_SUMMON = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_CHARMEDBY = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_CREATEDBY = OBJECT_END + 0x0008, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_TARGET = OBJECT_END + 0x000A, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_PERSUADED = OBJECT_END + 0x000C, // Size: 2, Type: LONG, Flags: PUBLIC
+ UNIT_FIELD_CRITTER = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PRIVATE
+ UNIT_FIELD_CHARMEDBY = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC
+ UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x0008, // Size: 2, Type: LONG, Flags: PUBLIC
+ UNIT_FIELD_CREATEDBY = OBJECT_END + 0x000A, // Size: 2, Type: LONG, Flags: PUBLIC
+ UNIT_FIELD_TARGET = OBJECT_END + 0x000C, // Size: 2, Type: LONG, Flags: PUBLIC
UNIT_FIELD_CHANNEL_OBJECT = OBJECT_END + 0x000E, // Size: 2, Type: LONG, Flags: PUBLIC
- UNIT_FIELD_HEALTH = OBJECT_END + 0x0010, // Size: 1, Type: INT, Flags: DYNAMIC
- UNIT_FIELD_POWER1 = OBJECT_END + 0x0011, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_POWER2 = OBJECT_END + 0x0012, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_POWER3 = OBJECT_END + 0x0013, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_POWER4 = OBJECT_END + 0x0014, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_POWER5 = OBJECT_END + 0x0015, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: DYNAMIC
- UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_LEVEL = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_BYTES_0 = OBJECT_END + 0x001E, // Size: 1, Type: BYTES, Flags: PUBLIC
- UNIT_VIRTUAL_ITEM_SLOT_DISPLAY = OBJECT_END + 0x001F, // Size: 3, Type: INT, Flags: PUBLIC
- UNIT_VIRTUAL_ITEM_INFO = OBJECT_END + 0x0022, // Size: 6, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_FLAGS = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_AURA = OBJECT_END + 0x002A, // Size: 56, Type: INT, Flags: PUBLIC
- UNIT_FIELD_AURAFLAGS = OBJECT_END + 0x0062, // Size: 14, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_AURALEVELS = OBJECT_END + 0x0070, // Size: 14, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_AURAAPPLICATIONS = OBJECT_END + 0x007E, // Size: 14, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_AURASTATE = OBJECT_END + 0x008C, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x008D, // Size: 2, Type: INT, Flags: PUBLIC
- UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x008F, // Size: 1, Type: INT, Flags: PRIVATE
- UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x0090, // Size: 1, Type: FLOAT, Flags: PUBLIC
- UNIT_FIELD_COMBATREACH = OBJECT_END + 0x0091, // Size: 1, Type: FLOAT, Flags: PUBLIC
- UNIT_FIELD_DISPLAYID = OBJECT_END + 0x0092, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x0093, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x0094, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x0095, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
- UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0096, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
- UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x0097, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
- UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x0098, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
- UNIT_FIELD_BYTES_1 = OBJECT_END + 0x0099, // Size: 1, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_PETNUMBER = OBJECT_END + 0x009A, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x009B, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x009C, // Size: 1, Type: INT, Flags: OWNER_ONLY
- UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x009D, // Size: 1, Type: INT, Flags: OWNER_ONLY
- UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x009E, // Size: 1, Type: INT, Flags: DYNAMIC
- UNIT_CHANNEL_SPELL = OBJECT_END + 0x009F, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_MOD_CAST_SPEED = OBJECT_END + 0x00A0, // Size: 1, Type: FLOAT, Flags: PUBLIC
- UNIT_CREATED_BY_SPELL = OBJECT_END + 0x00A1, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_NPC_FLAGS = OBJECT_END + 0x00A2, // Size: 1, Type: INT, Flags: DYNAMIC
- UNIT_NPC_EMOTESTATE = OBJECT_END + 0x00A3, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_TRAINING_POINTS = OBJECT_END + 0x00A4, // Size: 1, Type: TWO_SHORT, Flags: OWNER_ONLY
- UNIT_FIELD_STAT0 = OBJECT_END + 0x00A5, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_STAT1 = OBJECT_END + 0x00A6, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_STAT2 = OBJECT_END + 0x00A7, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_STAT3 = OBJECT_END + 0x00A8, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_STAT4 = OBJECT_END + 0x00A9, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x00AA, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x00AB, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x00AC, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x00AD, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x00AE, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x00AF, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x00B0, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x00B1, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x00B2, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x00B3, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_RESISTANCES = OBJECT_END + 0x00B4, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY, UNK3
- UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x00BB, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x00C2, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_BASE_MANA = OBJECT_END + 0x00C9, // Size: 1, Type: INT, Flags: PUBLIC
- UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x00CA, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_BYTES_2 = OBJECT_END + 0x00CB, // Size: 1, Type: BYTES, Flags: PUBLIC
- UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x00CC, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_ATTACK_POWER_MODS = OBJECT_END + 0x00CD, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x00CE, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x00CF, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_RANGED_ATTACK_POWER_MODS = OBJECT_END + 0x00D0, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x00D1, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x00D2, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x00D3, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x00D4, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x00DB, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x00E2, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
- UNIT_FIELD_PADDING = OBJECT_END + 0x00E3, // Size: 1, Type: INT, Flags: NONE
- UNIT_END = OBJECT_END + 0x00E4,
+ UNIT_FIELD_BYTES_0 = OBJECT_END + 0x0010, // Size: 1, Type: BYTES, Flags: PUBLIC
+ UNIT_FIELD_HEALTH = OBJECT_END + 0x0011, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER1 = OBJECT_END + 0x0012, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER2 = OBJECT_END + 0x0013, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER3 = OBJECT_END + 0x0014, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER4 = OBJECT_END + 0x0015, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER5 = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER6 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER7 = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001E, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER6 = OBJECT_END + 0x001F, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MAXPOWER7 = OBJECT_END + 0x0020, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x0021, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x0028, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_LEVEL = OBJECT_END + 0x002F, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x0030, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x0031, // Size: 3, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_FLAGS = OBJECT_END + 0x0034, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_AURASTATE = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0037, // Size: 2, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x0039, // Size: 1, Type: INT, Flags: PRIVATE
+ UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x003A, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ UNIT_FIELD_COMBATREACH = OBJECT_END + 0x003B, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ UNIT_FIELD_DISPLAYID = OBJECT_END + 0x003C, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x003F, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
+ UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0040, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
+ UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x0041, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
+ UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x0042, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY, UNK3
+ UNIT_FIELD_BYTES_1 = OBJECT_END + 0x0043, // Size: 1, Type: BYTES, Flags: PUBLIC
+ UNIT_FIELD_PETNUMBER = OBJECT_END + 0x0044, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x0045, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x0046, // Size: 1, Type: INT, Flags: OWNER_ONLY
+ UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x0047, // Size: 1, Type: INT, Flags: OWNER_ONLY
+ UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x0048, // Size: 1, Type: INT, Flags: DYNAMIC
+ UNIT_CHANNEL_SPELL = OBJECT_END + 0x0049, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_MOD_CAST_SPEED = OBJECT_END + 0x004A, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ UNIT_CREATED_BY_SPELL = OBJECT_END + 0x004B, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_NPC_FLAGS = OBJECT_END + 0x004C, // Size: 1, Type: INT, Flags: DYNAMIC
+ UNIT_NPC_EMOTESTATE = OBJECT_END + 0x004D, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_STAT0 = OBJECT_END + 0x004E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_STAT1 = OBJECT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_STAT2 = OBJECT_END + 0x0050, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_STAT3 = OBJECT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_STAT4 = OBJECT_END + 0x0052, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x0056, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x0057, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x0058, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x0059, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x005A, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x005B, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x005C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_RESISTANCES = OBJECT_END + 0x005D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY, UNK3
+ UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x0064, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x006B, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_BASE_MANA = OBJECT_END + 0x0072, // Size: 1, Type: INT, Flags: PUBLIC
+ UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x0073, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_BYTES_2 = OBJECT_END + 0x0074, // Size: 1, Type: BYTES, Flags: PUBLIC
+ UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x0075, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_ATTACK_POWER_MODS = OBJECT_END + 0x0076, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0077, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x0078, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_RANGED_ATTACK_POWER_MODS = OBJECT_END + 0x0079, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x007A, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x007B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x007C, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x007D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0084, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x008B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER_ONLY
+ UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x008C, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ UNIT_FIELD_PADDING = OBJECT_END + 0x008D, // Size: 1, Type: INT, Flags: NONE
+ UNIT_END = OBJECT_END + 0x008E,
PLAYER_DUEL_ARBITER = UNIT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC
PLAYER_FLAGS = UNIT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC
@@ -262,160 +287,184 @@ enum EUnitFields
PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x006C, // Size: 1, Type: BYTES, Flags: PRIVATE
PLAYER_QUEST_LOG_25_4 = UNIT_END + 0x006D, // Size: 1, Type: INT, Flags: PRIVATE
PLAYER_VISIBLE_ITEM_1_CREATOR = UNIT_END + 0x006E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_1_0 = UNIT_END + 0x0070, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_1_PROPERTIES = UNIT_END + 0x007C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_1_PAD = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_2_CREATOR = UNIT_END + 0x007E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_2_0 = UNIT_END + 0x0080, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_2_PROPERTIES = UNIT_END + 0x008C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_2_PAD = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_3_CREATOR = UNIT_END + 0x008E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_3_0 = UNIT_END + 0x0090, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_3_PROPERTIES = UNIT_END + 0x009C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_3_PAD = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_4_CREATOR = UNIT_END + 0x009E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_4_0 = UNIT_END + 0x00A0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_4_PROPERTIES = UNIT_END + 0x00AC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_4_PAD = UNIT_END + 0x00AD, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_5_CREATOR = UNIT_END + 0x00AE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_5_0 = UNIT_END + 0x00B0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_5_PROPERTIES = UNIT_END + 0x00BC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_5_PAD = UNIT_END + 0x00BD, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_6_CREATOR = UNIT_END + 0x00BE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_6_0 = UNIT_END + 0x00C0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_6_PROPERTIES = UNIT_END + 0x00CC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_6_PAD = UNIT_END + 0x00CD, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_7_CREATOR = UNIT_END + 0x00CE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_7_0 = UNIT_END + 0x00D0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_7_PROPERTIES = UNIT_END + 0x00DC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_7_PAD = UNIT_END + 0x00DD, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_8_CREATOR = UNIT_END + 0x00DE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_8_0 = UNIT_END + 0x00E0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_8_PROPERTIES = UNIT_END + 0x00EC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_8_PAD = UNIT_END + 0x00ED, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_9_CREATOR = UNIT_END + 0x00EE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_9_0 = UNIT_END + 0x00F0, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_9_PROPERTIES = UNIT_END + 0x00FC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_9_PAD = UNIT_END + 0x00FD, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_10_CREATOR = UNIT_END + 0x00FE, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_10_0 = UNIT_END + 0x0100, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_10_PROPERTIES = UNIT_END + 0x010C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_10_PAD = UNIT_END + 0x010D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_11_CREATOR = UNIT_END + 0x010E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_11_0 = UNIT_END + 0x0110, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_11_PROPERTIES = UNIT_END + 0x011C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_11_PAD = UNIT_END + 0x011D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_12_CREATOR = UNIT_END + 0x011E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_12_0 = UNIT_END + 0x0120, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_12_PROPERTIES = UNIT_END + 0x012C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_12_PAD = UNIT_END + 0x012D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_13_CREATOR = UNIT_END + 0x012E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_13_0 = UNIT_END + 0x0130, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_13_PROPERTIES = UNIT_END + 0x013C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_13_PAD = UNIT_END + 0x013D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_14_CREATOR = UNIT_END + 0x013E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_14_0 = UNIT_END + 0x0140, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_14_PROPERTIES = UNIT_END + 0x014C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_14_PAD = UNIT_END + 0x014D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_15_CREATOR = UNIT_END + 0x014E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_15_0 = UNIT_END + 0x0150, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_15_PROPERTIES = UNIT_END + 0x015C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_15_PAD = UNIT_END + 0x015D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_16_CREATOR = UNIT_END + 0x015E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_16_0 = UNIT_END + 0x0160, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_16_PROPERTIES = UNIT_END + 0x016C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_16_PAD = UNIT_END + 0x016D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_17_CREATOR = UNIT_END + 0x016E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_17_0 = UNIT_END + 0x0170, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_17_PROPERTIES = UNIT_END + 0x017C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_17_PAD = UNIT_END + 0x017D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_18_CREATOR = UNIT_END + 0x017E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_18_0 = UNIT_END + 0x0180, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_18_PROPERTIES = UNIT_END + 0x018C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_18_PAD = UNIT_END + 0x018D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_19_CREATOR = UNIT_END + 0x018E, // Size: 2, Type: LONG, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_19_0 = UNIT_END + 0x0190, // Size: 12, Type: INT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_19_PROPERTIES = UNIT_END + 0x019C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
- PLAYER_VISIBLE_ITEM_19_PAD = UNIT_END + 0x019D, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_CHOSEN_TITLE = UNIT_END + 0x019E, // Size: 1, Type: INT, Flags: PUBLIC
- PLAYER_FIELD_PAD_0 = UNIT_END + 0x019F, // Size: 1, Type: INT, Flags: NONE
- PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x01A0, // Size: 46, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x01CE, // Size: 32, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x01EE, // Size: 56, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x0226, // Size: 14, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x0234, // Size: 24, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x024C, // Size: 64, Type: LONG, Flags: PRIVATE
- PLAYER_FIELD_VANITYPET_SLOT_1 = UNIT_END + 0x028C, // Size: 36, Type: LONG, Flags: PRIVATE
- PLAYER_FARSIGHT = UNIT_END + 0x02B0, // Size: 2, Type: LONG, Flags: PRIVATE
- PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x02B2, // Size: 2, Type: LONG, Flags: PRIVATE
- PLAYER_XP = UNIT_END + 0x02B4, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x02B5, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x02B6, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE
- PLAYER_CHARACTER_POINTS1 = UNIT_END + 0x0436, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_CHARACTER_POINTS2 = UNIT_END + 0x0437, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_TRACK_CREATURES = UNIT_END + 0x0438, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_TRACK_RESOURCES = UNIT_END + 0x0439, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x043A, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x043B, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x043C, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_EXPERTISE = UNIT_END + 0x043D, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x043E, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x043F, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x0440, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x0441, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x0442, // Size: 7, Type: FLOAT, Flags: PRIVATE
- PLAYER_SHIELD_BLOCK = UNIT_END + 0x0449, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x044A, // Size: 128, Type: BYTES, Flags: PRIVATE
- PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x04CA, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_COINAGE = UNIT_END + 0x04CB, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x04CC, // Size: 7, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x04D3, // Size: 7, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x04DA, // Size: 7, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x04E1, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x04E2, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x04E3, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_BYTES = UNIT_END + 0x04E4, // Size: 1, Type: BYTES, Flags: PRIVATE
- PLAYER_AMMO_ID = UNIT_END + 0x04E5, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_SELF_RES_SPELL = UNIT_END + 0x04E6, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x04E7, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x04E8, // Size: 12, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x04F4, // Size: 12, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_KILLS = UNIT_END + 0x0500, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE
- PLAYER_FIELD_TODAY_CONTRIBUTION = UNIT_END + 0x0501, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_YESTERDAY_CONTRIBUTION = UNIT_END + 0x0502, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UNIT_END + 0x0503, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_BYTES2 = UNIT_END + 0x0504, // Size: 1, Type: BYTES, Flags: PRIVATE
- PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x0505, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x0506, // Size: 24, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x051E, // Size: 18, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_HONOR_CURRENCY = UNIT_END + 0x0530, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_ARENA_CURRENCY = UNIT_END + 0x0531, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_MOD_MANA_REGEN = UNIT_END + 0x0532, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_FIELD_MOD_MANA_REGEN_INTERRUPT = UNIT_END + 0x0533, // Size: 1, Type: FLOAT, Flags: PRIVATE
- PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x0534, // Size: 1, Type: INT, Flags: PRIVATE
- PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x0535, // Size: 25, Type: INT, Flags: PRIVATE
- PLAYER_END = UNIT_END + 0x054E,
+ PLAYER_VISIBLE_ITEM_1_0 = UNIT_END + 0x0070, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_1_PROPERTIES = UNIT_END + 0x007D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_1_SEED = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_1_PAD = UNIT_END + 0x007F, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_2_CREATOR = UNIT_END + 0x0080, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_2_0 = UNIT_END + 0x0082, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_2_PROPERTIES = UNIT_END + 0x008F, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_2_SEED = UNIT_END + 0x0090, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_2_PAD = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_3_CREATOR = UNIT_END + 0x0092, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_3_0 = UNIT_END + 0x0094, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_3_PROPERTIES = UNIT_END + 0x00A1, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_3_SEED = UNIT_END + 0x00A2, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_3_PAD = UNIT_END + 0x00A3, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_4_CREATOR = UNIT_END + 0x00A4, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_4_0 = UNIT_END + 0x00A6, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_4_PROPERTIES = UNIT_END + 0x00B3, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_4_SEED = UNIT_END + 0x00B4, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_4_PAD = UNIT_END + 0x00B5, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_5_CREATOR = UNIT_END + 0x00B6, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_5_0 = UNIT_END + 0x00B8, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_5_PROPERTIES = UNIT_END + 0x00C5, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_5_SEED = UNIT_END + 0x00C6, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_5_PAD = UNIT_END + 0x00C7, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_6_CREATOR = UNIT_END + 0x00C8, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_6_0 = UNIT_END + 0x00CA, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_6_PROPERTIES = UNIT_END + 0x00D7, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_6_SEED = UNIT_END + 0x00D8, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_6_PAD = UNIT_END + 0x00D9, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_7_CREATOR = UNIT_END + 0x00DA, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_7_0 = UNIT_END + 0x00DC, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_7_PROPERTIES = UNIT_END + 0x00E9, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_7_SEED = UNIT_END + 0x00EA, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_7_PAD = UNIT_END + 0x00EB, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_8_CREATOR = UNIT_END + 0x00EC, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_8_0 = UNIT_END + 0x00EE, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_8_PROPERTIES = UNIT_END + 0x00FB, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_8_SEED = UNIT_END + 0x00FC, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_8_PAD = UNIT_END + 0x00FD, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_9_CREATOR = UNIT_END + 0x00FE, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_9_0 = UNIT_END + 0x0100, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_9_PROPERTIES = UNIT_END + 0x010D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_9_SEED = UNIT_END + 0x010E, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_9_PAD = UNIT_END + 0x010F, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_10_CREATOR = UNIT_END + 0x0110, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_10_0 = UNIT_END + 0x0112, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_10_PROPERTIES = UNIT_END + 0x011F, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_10_SEED = UNIT_END + 0x0120, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_10_PAD = UNIT_END + 0x0121, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_11_CREATOR = UNIT_END + 0x0122, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_11_0 = UNIT_END + 0x0124, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_11_PROPERTIES = UNIT_END + 0x0131, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_11_SEED = UNIT_END + 0x0132, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_11_PAD = UNIT_END + 0x0133, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_12_CREATOR = UNIT_END + 0x0134, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_12_0 = UNIT_END + 0x0136, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_12_PROPERTIES = UNIT_END + 0x0143, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_12_SEED = UNIT_END + 0x0144, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_12_PAD = UNIT_END + 0x0145, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_13_CREATOR = UNIT_END + 0x0146, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_13_0 = UNIT_END + 0x0148, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_13_PROPERTIES = UNIT_END + 0x0155, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_13_SEED = UNIT_END + 0x0156, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_13_PAD = UNIT_END + 0x0157, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_14_CREATOR = UNIT_END + 0x0158, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_14_0 = UNIT_END + 0x015A, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_14_PROPERTIES = UNIT_END + 0x0167, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_14_SEED = UNIT_END + 0x0168, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_14_PAD = UNIT_END + 0x0169, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_15_CREATOR = UNIT_END + 0x016A, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_15_0 = UNIT_END + 0x016C, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_15_PROPERTIES = UNIT_END + 0x0179, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_15_SEED = UNIT_END + 0x017A, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_15_PAD = UNIT_END + 0x017B, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_16_CREATOR = UNIT_END + 0x017C, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_16_0 = UNIT_END + 0x017E, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_16_PROPERTIES = UNIT_END + 0x018B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_16_SEED = UNIT_END + 0x018C, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_16_PAD = UNIT_END + 0x018D, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_17_CREATOR = UNIT_END + 0x018E, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_17_0 = UNIT_END + 0x0190, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_17_PROPERTIES = UNIT_END + 0x019D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_17_SEED = UNIT_END + 0x019E, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_17_PAD = UNIT_END + 0x019F, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_18_CREATOR = UNIT_END + 0x01A0, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_18_0 = UNIT_END + 0x01A2, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_18_PROPERTIES = UNIT_END + 0x01AF, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_18_SEED = UNIT_END + 0x01B0, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_18_PAD = UNIT_END + 0x01B1, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_19_CREATOR = UNIT_END + 0x01B2, // Size: 2, Type: LONG, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_19_0 = UNIT_END + 0x01B4, // Size: 13, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_19_PROPERTIES = UNIT_END + 0x01C1, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_19_SEED = UNIT_END + 0x01C2, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_VISIBLE_ITEM_19_PAD = UNIT_END + 0x01C3, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_CHOSEN_TITLE = UNIT_END + 0x01C4, // Size: 1, Type: INT, Flags: PUBLIC
+ PLAYER_FIELD_PAD_0 = UNIT_END + 0x01C5, // Size: 1, Type: INT, Flags: NONE
+ PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x01C6, // Size: 46, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x01F4, // Size: 32, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x0214, // Size: 56, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x024C, // Size: 14, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x025A, // Size: 24, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x0272, // Size: 64, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_VANITYPET_SLOT_1 = UNIT_END + 0x02B2, // Size: 36, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_CURRENCYTOKEN_SLOT_1 = UNIT_END + 0x02D6, // Size: 64, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_QUESTBAG_SLOT_1 = UNIT_END + 0x0316, // Size: 64, Type: LONG, Flags: PRIVATE
+ PLAYER_FARSIGHT = UNIT_END + 0x0356, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x0358, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x035A, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER_FIELD_KNOWN_CURRENCIES = UNIT_END + 0x035C, // Size: 2, Type: LONG, Flags: PRIVATE
+ PLAYER_XP = UNIT_END + 0x035E, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x035F, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x0360, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE
+ PLAYER_CHARACTER_POINTS1 = UNIT_END + 0x04E0, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_CHARACTER_POINTS2 = UNIT_END + 0x04E1, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_TRACK_CREATURES = UNIT_END + 0x04E2, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_TRACK_RESOURCES = UNIT_END + 0x04E3, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x04E4, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x04E5, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x04E6, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_EXPERTISE = UNIT_END + 0x04E7, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x04E8, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x04E9, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x04EA, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x04EB, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x04EC, // Size: 7, Type: FLOAT, Flags: PRIVATE
+ PLAYER_SHIELD_BLOCK = UNIT_END + 0x04F3, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x04F4, // Size: 1, Type: FLOAT, Flags: PRIVATE
+ PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x04F5, // Size: 128, Type: BYTES, Flags: PRIVATE
+ PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x0575, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_COINAGE = UNIT_END + 0x0576, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x0577, // Size: 7, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x057E, // Size: 7, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x0585, // Size: 7, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x058C, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x058D, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x058E, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_BYTES = UNIT_END + 0x058F, // Size: 1, Type: BYTES, Flags: PRIVATE
+ PLAYER_AMMO_ID = UNIT_END + 0x0590, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_SELF_RES_SPELL = UNIT_END + 0x0591, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x0592, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x0593, // Size: 12, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x059F, // Size: 12, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_KILLS = UNIT_END + 0x05AB, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE
+ PLAYER_FIELD_TODAY_CONTRIBUTION = UNIT_END + 0x05AC, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_YESTERDAY_CONTRIBUTION = UNIT_END + 0x05AD, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_LIFETIME_HONORBALE_KILLS = UNIT_END + 0x05AE, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_BYTES2 = UNIT_END + 0x05AF, // Size: 1, Type: BYTES, Flags: PRIVATE
+ PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x05B0, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x05B1, // Size: 25, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x05CA, // Size: 18, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_HONOR_CURRENCY = UNIT_END + 0x05DC, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_ARENA_CURRENCY = UNIT_END + 0x05DD, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x05DE, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x05DF, // Size: 25, Type: INT, Flags: PRIVATE
+ PLAYER_RUNE_REGEN_1 = UNIT_END + 0x05F8, // Size: 4, Type: FLOAT, Flags: PRIVATE
+ PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x05FC, // Size: 3, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x05FF, // Size: 8, Type: INT, Flags: PRIVATE
+ PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x0607, // Size: 8, Type: INT, Flags: PRIVATE
+ PLAYER_GLYPHS_ENABLED = UNIT_END + 0x060F, // Size: 1, Type: INT, Flags: PRIVATE
+ PLAYER_END = UNIT_END + 0x0610,
};
enum EGameObjectFields
{
OBJECT_FIELD_CREATED_BY = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC
GAMEOBJECT_DISPLAYID = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_FLAGS = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_ROTATION = OBJECT_END + 0x0004, // Size: 4, Type: FLOAT, Flags: PUBLIC
- GAMEOBJECT_STATE = OBJECT_END + 0x0008, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_POS_X = OBJECT_END + 0x0009, // Size: 1, Type: FLOAT, Flags: PUBLIC
- GAMEOBJECT_POS_Y = OBJECT_END + 0x000A, // Size: 1, Type: FLOAT, Flags: PUBLIC
- GAMEOBJECT_POS_Z = OBJECT_END + 0x000B, // Size: 1, Type: FLOAT, Flags: PUBLIC
- GAMEOBJECT_FACING = OBJECT_END + 0x000C, // Size: 1, Type: FLOAT, Flags: PUBLIC
- GAMEOBJECT_DYN_FLAGS = OBJECT_END + 0x000D, // Size: 1, Type: INT, Flags: DYNAMIC
- GAMEOBJECT_FACTION = OBJECT_END + 0x000E, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_TYPE_ID = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC
+ GAMEOBJECT_FLAGS = OBJECT_END + 0x0003, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC
+ GAMEOBJECT_ROTATION = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PUBLIC
+ GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x0006, // Size: 4, Type: FLOAT, Flags: PUBLIC
+ GAMEOBJECT_POS_X = OBJECT_END + 0x000A, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ GAMEOBJECT_POS_Y = OBJECT_END + 0x000B, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ GAMEOBJECT_POS_Z = OBJECT_END + 0x000C, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ GAMEOBJECT_FACING = OBJECT_END + 0x000D, // Size: 1, Type: FLOAT, Flags: PUBLIC
+ GAMEOBJECT_DYNAMIC = OBJECT_END + 0x000E, // Size: 1, Type: TWO_SHORT, Flags: DYNAMIC
+ GAMEOBJECT_FACTION = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC
GAMEOBJECT_LEVEL = OBJECT_END + 0x0010, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_ARTKIT = OBJECT_END + 0x0011, // Size: 1, Type: INT, Flags: PUBLIC
- GAMEOBJECT_ANIMPROGRESS = OBJECT_END + 0x0012, // Size: 1, Type: INT, Flags: DYNAMIC
- GAMEOBJECT_PADDING = OBJECT_END + 0x0013, // Size: 1, Type: INT, Flags: NONE
- GAMEOBJECT_END = OBJECT_END + 0x0014,
+ GAMEOBJECT_BYTES_1 = OBJECT_END + 0x0011, // Size: 1, Type: BYTES, Flags: PUBLIC
+ GAMEOBJECT_END = OBJECT_END + 0x0012,
};
enum EDynamicObjectFields
diff --git a/src/game/UpdateMask.h b/src/game/UpdateMask.h
index 436aa523440..3d510c00d60 100644
--- a/src/game/UpdateMask.h
+++ b/src/game/UpdateMask.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,27 +36,27 @@ class UpdateMask
delete [] mUpdateMask;
}
- inline void SetBit (uint32 index)
+ void SetBit (uint32 index)
{
( (uint8 *)mUpdateMask )[ index >> 3 ] |= 1 << ( index & 0x7 );
}
- inline void UnsetBit (uint32 index)
+ void UnsetBit (uint32 index)
{
( (uint8 *)mUpdateMask )[ index >> 3 ] &= (0xff ^ (1 << ( index & 0x7 ) ) );
}
- inline bool GetBit (uint32 index)
+ bool GetBit (uint32 index) const
{
return ( ( (uint8 *)mUpdateMask)[ index >> 3 ] & ( 1 << ( index & 0x7 ) )) != 0;
}
- inline uint32 GetBlockCount() { return mBlocks; }
- inline uint32 GetLength() { return mBlocks << 2; }
- inline uint32 GetCount() { return mCount; }
- inline uint8* GetMask() { return (uint8*)mUpdateMask; }
+ uint32 GetBlockCount() const { return mBlocks; }
+ uint32 GetLength() const { return mBlocks << 2; }
+ uint32 GetCount() const { return mCount; }
+ uint8* GetMask() { return (uint8*)mUpdateMask; }
- inline void SetCount (uint32 valuesCount)
+ void SetCount (uint32 valuesCount)
{
if(mUpdateMask)
delete [] mUpdateMask;
@@ -68,13 +68,13 @@ class UpdateMask
memset(mUpdateMask, 0, mBlocks << 2);
}
- inline void Clear()
+ void Clear()
{
if (mUpdateMask)
memset(mUpdateMask, 0, mBlocks << 2);
}
- inline UpdateMask& operator = ( const UpdateMask& mask )
+ UpdateMask& operator = ( const UpdateMask& mask )
{
SetCount(mask.mCount);
memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2);
@@ -82,21 +82,21 @@ class UpdateMask
return *this;
}
- inline void operator &= ( const UpdateMask& mask )
+ void operator &= ( const UpdateMask& mask )
{
ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; i++)
mUpdateMask[i] &= mask.mUpdateMask[i];
}
- inline void operator |= ( const UpdateMask& mask )
+ void operator |= ( const UpdateMask& mask )
{
ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; i++)
mUpdateMask[i] |= mask.mUpdateMask[i];
}
- inline UpdateMask operator & ( const UpdateMask& mask ) const
+ UpdateMask operator & ( const UpdateMask& mask ) const
{
ASSERT(mask.mCount <= mCount);
@@ -107,7 +107,7 @@ class UpdateMask
return newmask;
}
- inline UpdateMask operator | ( const UpdateMask& mask ) const
+ UpdateMask operator | ( const UpdateMask& mask ) const
{
ASSERT(mask.mCount <= mCount);
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
new file mode 100644
index 00000000000..dee2a57a1fa
--- /dev/null
+++ b/src/game/Vehicle.cpp
@@ -0,0 +1,347 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "Common.h"
+#include "Log.h"
+#include "ObjectMgr.h"
+#include "Vehicle.h"
+#include "Unit.h"
+#include "Util.h"
+#include "WorldPacket.h"
+
+#include "Chat.h"
+
+Vehicle::Vehicle() : Creature(), m_vehicleInfo(NULL)
+{
+ m_summonMask |= SUMMON_MASK_VEHICLE;
+ m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_VEHICLE);
+}
+
+Vehicle::~Vehicle()
+{
+}
+
+void Vehicle::AddToWorld()
+{
+ if(!IsInWorld())
+ {
+ ObjectAccessor::Instance().AddObject(this);
+ Unit::AddToWorld();
+ AIM_Initialize();
+ }
+}
+
+void Vehicle::RemoveFromWorld()
+{
+ if(IsInWorld())
+ {
+ ///- Don't call the function for Creature, normal mobs + totems go in a different storage
+ Unit::RemoveFromWorld();
+ ObjectAccessor::Instance().RemoveObject(this);
+ }
+}
+
+void Vehicle::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState
+{
+ for(SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
+ if(itr->second.passenger)
+ RemovePassenger(itr->second.passenger);
+ Creature::setDeathState(s);
+}
+
+void Vehicle::Update(uint32 diff)
+{
+ Creature::Update(diff);
+}
+
+bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team)
+{
+ //sLog.outError("create vehicle begin");
+ SetMapId(map->GetId());
+ SetInstanceId(map->GetInstanceId());
+
+ Object::_Create(guidlow, Entry, HIGHGUID_VEHICLE);
+
+ if(!InitEntry(Entry, team))
+ return false;
+
+ m_defaultMovementType = IDLE_MOTION_TYPE;
+
+ SetVehicleId(vehicleId);
+
+ SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
+
+ CreatureInfo const *ci = GetCreatureInfo();
+ setFaction(team == ALLIANCE ? ci->faction_A : ci->faction_H);
+ SetMaxHealth(ci->maxhealth);
+ SelectLevel(ci);
+ SetHealth(GetMaxHealth());
+
+ //sLog.outError("create vehicle end");
+ return true;
+}
+
+void Vehicle::SetVehicleId(uint32 id)
+{
+ if(m_vehicleInfo && id == m_vehicleInfo->m_ID)
+ return;
+
+ VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
+ if(!ve)
+ return;
+
+ m_vehicleInfo = ve;
+ for(SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
+ if(itr->second.passenger)
+ RemovePassenger(itr->second.passenger);
+ m_Seats.clear();
+
+ for(uint32 i = 0; i < 8; ++i)
+ {
+ uint32 seatId = m_vehicleInfo->m_seatID[i];
+ if(seatId)
+ if(VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(seatId))
+ m_Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
+ }
+}
+
+void Vehicle::AddPassenger(Unit *unit)
+{
+ sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u", unit->GetName(), GetEntry(), m_vehicleInfo->m_ID, GetDBTableGUIDLow());
+
+ if(unit->m_Vehicle)
+ unit->m_Vehicle->RemovePassenger(unit);
+ unit->m_Vehicle = this;
+
+ Player *player = NULL;
+ if(unit->GetTypeId() == TYPEID_PLAYER)
+ player = (Player*)unit;
+
+ SeatMap::iterator seat = m_Seats.begin();
+ uint32 seatnum = 0;
+ if(seat->second.passenger)
+ {
+ if(m_Seats.size() <= 1)
+ return;
+ seatnum = rand()%(m_Seats.size()-1) + 1;
+ advance(seat, seatnum);
+ if(seat->second.passenger)
+ return;
+ //RemovePassenger(seat->second.passenger);
+ }
+ seat->second.passenger = unit;
+
+ bool driver = (seat == m_Seats.begin());
+
+ //RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
+ setFaction(unit->getFaction());
+
+ if(player)
+ {
+ player->StopCastingCharm();
+ player->StopCastingBindSight();
+
+ if(driver)
+ {
+ player->SetCharm(this, true);
+ player->SetViewpoint(this, true);
+ player->SetMover(this);
+ player->VehicleSpellInitialize();
+ }
+ player->SetClientControl(this, 1);
+ }
+
+ unit->addUnitState(UNIT_STAT_ONVEHICLE);
+ unit->Relocate(this);
+ unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+
+ VehicleSeatEntry const *veSeat = seat->second.seatInfo;
+ unit->m_movementInfo.t_x = veSeat->m_attachmentOffsetX;
+ unit->m_movementInfo.t_y = veSeat->m_attachmentOffsetY;
+ unit->m_movementInfo.t_z = veSeat->m_attachmentOffsetZ;
+ unit->m_movementInfo.t_o = 0;
+ unit->m_movementInfo.t_time = 4;
+ unit->m_movementInfo.t_seat = seat->first;
+
+ WorldPacket data;
+ if(player)
+ {
+ //ChatHandler(player).PSendSysMessage("Enter seat %u %u", veSeat->m_ID, seat->first);
+
+ data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
+ player->GetSession()->SendPacket(&data);
+
+ player->BuildTeleportAckMsg(&data, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
+ player->GetSession()->SendPacket(&data);
+ }
+
+ unit->BuildHeartBeatMsg(&data);
+ unit->SendMessageToSet(&data, player ? false : true);
+}
+
+void Vehicle::RemovePassenger(Unit *unit)
+{
+ SeatMap::iterator seat;
+ for(seat = m_Seats.begin(); seat != m_Seats.end(); ++seat)
+ {
+ if(seat->second.passenger == unit)
+ {
+ seat->second.passenger = NULL;
+ break;
+ }
+ }
+
+ if(seat == m_Seats.end())
+ return;
+
+ sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u", unit->GetName(), GetEntry(), m_vehicleInfo->m_ID, GetDBTableGUIDLow());
+
+ bool driver = (seat == m_Seats.begin());
+
+ Player *player = NULL;
+ if(unit->GetTypeId() == TYPEID_PLAYER)
+ player = (Player*)unit;
+
+ //SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
+ //setFaction((GetTeam() == ALLIANCE) ? GetCreatureInfo()->faction_A : GetCreatureInfo()->faction_H);
+
+ if(player)
+ {
+ if(driver)
+ {
+ player->SetCharm(this, false);
+ player->SetViewpoint(this, false);
+ player->SetMover(player);
+ player->SendRemoveControlBar();
+ }
+ player->SetClientControl(player, 1);
+ }
+
+ unit->clearUnitState(UNIT_STAT_ONVEHICLE);
+ unit->Relocate(this);
+ unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
+ unit->m_movementInfo.t_x = 0;
+ unit->m_movementInfo.t_y = 0;
+ unit->m_movementInfo.t_z = 0;
+ unit->m_movementInfo.t_o = 0;
+ unit->m_movementInfo.t_time = 0;
+ unit->m_movementInfo.t_seat = 0;
+
+ unit->m_Vehicle = NULL;
+
+ WorldPacket data;
+ if(player)
+ {
+ player->BuildTeleportAckMsg(&data, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation());
+ player->GetSession()->SendPacket(&data);
+ }
+
+ unit->BuildHeartBeatMsg(&data);
+ unit->SendMessageToSet(&data, player ? false : true);
+
+ // only for flyable vehicles?
+ //CastSpell(this, 45472, true); // Parachute
+
+ //if(!vehicle->GetDBTableGUIDLow())
+ if(GetOwnerGUID() == unit->GetGUID())
+ Dismiss();
+}
+
+void Vehicle::Dismiss()
+{
+ SendObjectDeSpawnAnim(GetGUID());
+ CombatStop();
+ CleanupsBeforeDelete();
+ AddObjectToRemoveList();
+}
+
+bool Vehicle::LoadFromDB(uint32 guid, Map *map)
+{
+ CreatureData const* data = objmgr.GetCreatureData(guid);
+
+ if(!data)
+ {
+ sLog.outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid);
+ return false;
+ }
+
+ uint32 id = 0;
+ if(const CreatureInfo *cInfo = objmgr.GetCreatureTemplate(data->id))
+ id = cInfo->VehicleId;
+ if(!id || !sVehicleStore.LookupEntry(id))
+ return false;
+
+ m_DBTableGuid = guid;
+ if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_VEHICLE);
+
+ uint16 team = 0;
+ if(!Create(guid,map,data->phaseMask,data->id,id,team))
+ return false;
+
+ Relocate(data->posX,data->posY,data->posZ,data->orientation);
+
+ if(!IsPositionValid())
+ {
+ sLog.outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",GetGUIDLow(),GetEntry(),GetPositionX(),GetPositionY());
+ return false;
+ }
+ //We should set first home position, because then AI calls home movement
+ SetHomePosition(data->posX,data->posY,data->posZ,data->orientation);
+
+ m_respawnradius = data->spawndist;
+
+ m_respawnDelay = data->spawntimesecs;
+ m_isDeadByDefault = data->is_dead;
+ m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
+
+ m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
+ if(m_respawnTime > time(NULL)) // not ready to respawn
+ {
+ m_deathState = DEAD;
+ if(canFly())
+ {
+ float tz = GetMap()->GetHeight(data->posX,data->posY,data->posZ,false);
+ if(data->posZ - tz > 0.1)
+ Relocate(data->posX,data->posY,tz);
+ }
+ }
+ else if(m_respawnTime) // respawn time set but expired
+ {
+ m_respawnTime = 0;
+ objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
+ }
+
+ uint32 curhealth = data->curhealth;
+ if(curhealth)
+ {
+ curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank));
+ if(curhealth < 1)
+ curhealth = 1;
+ }
+
+ SetHealth(m_deathState == ALIVE ? curhealth : 0);
+ SetPower(POWER_MANA,data->curmana);
+
+ // checked at creature_template loading
+ m_defaultMovementType = MovementGeneratorType(data->movementType);
+
+ return true;
+}
diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h
new file mode 100644
index 00000000000..c01ca027670
--- /dev/null
+++ b/src/game/Vehicle.h
@@ -0,0 +1,75 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOSSERVER_VEHICLE_H
+#define MANGOSSERVER_VEHICLE_H
+
+#include "ObjectDefines.h"
+#include "Creature.h"
+#include "Unit.h"
+
+struct VehicleEntry;
+struct VehicleSeatEntry;
+
+struct VehicleSeat
+{
+ explicit VehicleSeat(VehicleSeatEntry const *_seatInfo) : seatInfo(_seatInfo), passenger(NULL) {}
+ VehicleSeatEntry const *seatInfo;
+ Unit* passenger;
+};
+
+typedef std::map<uint32, VehicleSeat> SeatMap;
+
+class Vehicle : public Creature
+{
+ public:
+ explicit Vehicle();
+ virtual ~Vehicle();
+
+ void AddToWorld();
+ void RemoveFromWorld();
+
+ bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team);
+
+ void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState
+ void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update
+
+ VehicleEntry const *GetVehicleInfo() { return m_vehicleInfo; }
+ void SetVehicleId(uint32 vehicleid);
+
+ void AddPassenger(Unit *passenger);
+ void RemovePassenger(Unit *passenger);
+ void Dismiss();
+
+ bool LoadFromDB(uint32 guid, Map *map);
+
+ SeatMap m_Seats;
+ protected:
+ VehicleEntry const *m_vehicleInfo;
+
+ private:
+ void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
+ {
+ assert(false);
+ }
+ void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
+ {
+ assert(false);
+ }
+};
+#endif
diff --git a/src/game/VoiceChatHandler.cpp b/src/game/VoiceChatHandler.cpp
index ba03ee1c543..8e787549e33 100644
--- a/src/game/VoiceChatHandler.cpp
+++ b/src/game/VoiceChatHandler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
-#include "World.h"
#include "Opcodes.h"
#include "Log.h"
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index 30947abe4c8..a677fd5b6d2 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h
index 1c41617fff7..85f8b765d45 100644
--- a/src/game/WaypointManager.h
+++ b/src/game/WaypointManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 12b72829248..7c606697ac3 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.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
@@ -24,6 +24,7 @@
//Creature-specific headers
#include "Creature.h"
#include "CreatureAI.h"
+#include "CreatureGroups.h"
//Player-specific
#include "Player.h"
@@ -54,7 +55,7 @@ bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, flo
{
if(i_destinationHolder.HasArrived())
return false;
-
+
i_destinationHolder.GetDestination(x, y, z);
return true;
}
@@ -109,6 +110,10 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
InitTraveller(u, *node);
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
+
+ //Call for creature group update
+ if(u.GetFormation() && u.GetFormation()->getLeader() == &u)
+ u.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
}
else
node = NULL;
@@ -180,6 +185,10 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
InitTraveller(unit, *node);
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
+
+ //Call for creature group update
+ if(unit.GetFormation() && unit.GetFormation()->getLeader() == &unit)
+ unit.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
}
else
{
@@ -254,12 +263,13 @@ FlightPathMovementGenerator::Initialize(Player &player)
void FlightPathMovementGenerator::Finalize(Player & player)
{
+ // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
+ player.clearUnitState(UNIT_STAT_IN_FLIGHT);
float x, y, z;
i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z);
player.SetPosition(x, y, z, player.GetOrientation());
- player.clearUnitState(UNIT_STAT_IN_FLIGHT);
player.Unmount();
player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h
index eec6ad70e5c..9804c150d63 100644
--- a/src/game/WaypointMovementGenerator.h
+++ b/src/game/WaypointMovementGenerator.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ class TRINITY_DLL_SPEC PathMovementBase
PathMovementBase() : i_currentNode(0) {}
virtual ~PathMovementBase() {};
- inline bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); }
+ bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); }
void LoadPath(T &);
void ReloadPath(T &);
@@ -109,7 +109,7 @@ public PathMovementBase<Player>
Path& GetPath() { return i_path; }
uint32 GetPathAtMapEnd() const;
- inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); }
+ bool HasArrived() const { return (i_currentNode >= i_path.Size()); }
void SetCurrentNodeAfterTeleport();
void SkipCurrentNode() { ++i_currentNode; }
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp
index 498beab0412..5d8d1fbd9ba 100644
--- a/src/game/Weather.cpp
+++ b/src/game/Weather.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "Weather.h"
#include "WorldPacket.h"
-#include "WorldSession.h"
#include "Player.h"
#include "World.h"
#include "Log.h"
@@ -38,11 +37,11 @@ Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone
m_type = WEATHER_TYPE_FINE;
m_grade = 0;
- sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (1000*MINUTE)) );
+ sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILISECONDS)) );
}
/// Launch a weather update
-bool Weather::Update(time_t diff)
+bool Weather::Update(uint32 diff)
{
if (m_timer.GetCurrent()>=0)
m_timer.Update(diff);
diff --git a/src/game/Weather.h b/src/game/Weather.h
index cbd4daad1ad..e312f004060 100644
--- a/src/game/Weather.h
+++ b/src/game/Weather.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ class Weather
void SetWeather(WeatherType type, float grade);
/// For which zone is this weather?
uint32 GetZone() { return m_zone; };
- bool Update(time_t diff);
+ bool Update(uint32 diff);
private:
WeatherState GetWeatherState() const;
uint32 m_zone;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 85a156c7206..fe96d160a10 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
*/
#include "Common.h"
-//#include "WorldSocket.h"
#include "Database/DatabaseEnv.h"
#include "Config/ConfigEnv.h"
#include "SystemConfig.h"
@@ -33,15 +32,18 @@
#include "WorldPacket.h"
#include "Weather.h"
#include "Player.h"
+#include "Vehicle.h"
#include "SkillExtraItems.h"
#include "SkillDiscovery.h"
#include "World.h"
#include "AccountMgr.h"
+#include "AchievementMgr.h"
#include "AuctionHouseMgr.h"
#include "ObjectMgr.h"
+#include "CreatureEventAIMgr.h"
#include "SpellMgr.h"
#include "Chat.h"
-#include "Database/DBCStores.h"
+#include "DBCStores.h"
#include "LootMgr.h"
#include "ItemEnchantmentMgr.h"
#include "MapManager.h"
@@ -55,7 +57,8 @@
#include "WaypointMovementGenerator.h"
#include "VMapFactory.h"
#include "GlobalEvents.h"
-#include "GameEvent.h"
+#include "GameEventMgr.h"
+#include "PoolHandler.h"
#include "Database/DatabaseImpl.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
@@ -81,16 +84,6 @@ float World::m_MaxVisibleDistanceInFlight = DEFAULT_VISIBILITY_DISTANCE;
float World::m_VisibleUnitGreyDistance = 0;
float World::m_VisibleObjectGreyDistance = 0;
-// ServerMessages.dbc
-enum ServerMessageType
-{
- SERVER_MSG_SHUTDOWN_TIME = 1,
- SERVER_MSG_RESTART_TIME = 2,
- SERVER_MSG_STRING = 3,
- SERVER_MSG_SHUTDOWN_CANCELLED = 4,
- SERVER_MSG_RESTART_CANCELLED = 5
-};
-
struct ScriptAction
{
uint64 sourceGUID;
@@ -118,6 +111,8 @@ World::World()
m_updateTimeSum = 0;
m_updateTimeCount = 0;
+
+ m_isClosed = false;
}
/// World destructor
@@ -238,7 +233,7 @@ World::AddSession_ (WorldSession* s)
uint32 Sessions = GetActiveAndQueuedSessionCount ();
uint32 pLimit = GetPlayerAmountLimit ();
- uint32 QueueSize = GetQueueSize (); //number of players in the queue
+ uint32 QueueSize = GetQueueSize (); //number of players in the queue
//so we don't count the user trying to
//login as a session and queue the socket that we are using
@@ -255,18 +250,19 @@ World::AddSession_ (WorldSession* s)
WorldPacket packet(SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1);
packet << uint8 (AUTH_OK);
- packet << uint32 (0); // unknown random value...
- packet << uint8 (0);
- packet << uint32 (0);
- packet << uint8 (s->Expansion()); // 0 - normal, 1 - TBC, must be set in database manually for each account
+ packet << uint32 (0); // BillingTimeRemaining
+ packet << uint8 (0); // BillingPlanFlags
+ packet << uint32 (0); // BillingTimeRested
+ packet << uint8 (s->Expansion()); // 0 - normal, 1 - TBC, must be set in database manually for each account
s->SendPacket (&packet);
+ s->SendAddonsInfo();
UpdateMaxSessionCounters ();
// Updates the population
if (pLimit > 0)
{
- float popu = GetActiveSessionCount (); //updated number of users on the server
+ float popu = GetActiveSessionCount (); //updated number of users on the server
popu /= pLimit;
popu *= 2;
LoginDatabase.PExecute ("UPDATE realmlist SET population = '%f' WHERE id = '%d'", popu, realmID);
@@ -280,12 +276,13 @@ bool World::HasRecentlyDisconnected(WorldSession* session)
if(uint32 tolerance = getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
{
- for(DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end(); ++i)
+ for(DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end(); )
{
if(difftime(i->second, time(NULL)) < tolerance)
{
if(i->first == session->GetAccountId())
return true;
+ ++i;
}
else
m_disconnects.erase(i);
@@ -313,10 +310,10 @@ void World::AddQueuedPlayer(WorldSession* sess)
// The 1st SMSG_AUTH_RESPONSE needs to contain other info too.
WorldPacket packet (SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1);
packet << uint8 (AUTH_WAIT_QUEUE);
- packet << uint32 (0); // unknown random value...
- packet << uint8 (0);
- packet << uint32 (0);
- packet << uint8 (sess->Expansion () ? 1 : 0); // 0 - normal, 1 - TBC, must be set in database manually for each account
+ packet << uint32 (0); // BillingTimeRemaining
+ packet << uint8 (0); // BillingPlanFlags
+ packet << uint32 (0); // BillingTimeRested
+ packet << uint8 (sess->Expansion () ? 1 : 0); // 0 - normal, 1 - TBC, must be set in database manually for each account
packet << uint32(GetQueuePos (sess));
sess->SendPacket (&packet);
@@ -440,24 +437,30 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_HEALTH] = sConfig.GetFloatDefault("Rate.Health", 1);
if(rate_values[RATE_HEALTH] < 0)
{
- sLog.outError("Rate.Health (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_HEALTH]);
+ sLog.outError("Rate.Health (%f) must be > 0. Using 1 instead.",rate_values[RATE_HEALTH]);
rate_values[RATE_HEALTH] = 1;
}
rate_values[RATE_POWER_MANA] = sConfig.GetFloatDefault("Rate.Mana", 1);
if(rate_values[RATE_POWER_MANA] < 0)
{
- sLog.outError("Rate.Mana (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_POWER_MANA]);
+ sLog.outError("Rate.Mana (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_MANA]);
rate_values[RATE_POWER_MANA] = 1;
}
rate_values[RATE_POWER_RAGE_INCOME] = sConfig.GetFloatDefault("Rate.Rage.Income", 1);
rate_values[RATE_POWER_RAGE_LOSS] = sConfig.GetFloatDefault("Rate.Rage.Loss", 1);
if(rate_values[RATE_POWER_RAGE_LOSS] < 0)
{
- sLog.outError("Rate.Rage.Loss (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_POWER_RAGE_LOSS]);
+ sLog.outError("Rate.Rage.Loss (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_RAGE_LOSS]);
rate_values[RATE_POWER_RAGE_LOSS] = 1;
}
+ rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfig.GetFloatDefault("Rate.RunicPower.Income", 1);
+ rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfig.GetFloatDefault("Rate.RunicPower.Loss", 1);
+ if(rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
+ {
+ sLog.outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_RUNICPOWER_LOSS]);
+ rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1;
+ }
rate_values[RATE_POWER_FOCUS] = sConfig.GetFloatDefault("Rate.Focus", 1.0f);
- rate_values[RATE_LOYALTY] = sConfig.GetFloatDefault("Rate.Loyalty", 1.0f);
rate_values[RATE_SKILL_DISCOVERY] = sConfig.GetFloatDefault("Rate.Skill.Discovery", 1.0f);
rate_values[RATE_DROP_ITEM_POOR] = sConfig.GetFloatDefault("Rate.Drop.Item.Poor", 1.0f);
rate_values[RATE_DROP_ITEM_NORMAL] = sConfig.GetFloatDefault("Rate.Drop.Item.Normal", 1.0f);
@@ -471,8 +474,9 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_XP_KILL] = sConfig.GetFloatDefault("Rate.XP.Kill", 1.0f);
rate_values[RATE_XP_QUEST] = sConfig.GetFloatDefault("Rate.XP.Quest", 1.0f);
rate_values[RATE_XP_EXPLORE] = sConfig.GetFloatDefault("Rate.XP.Explore", 1.0f);
- rate_values[RATE_XP_PAST_70] = sConfig.GetFloatDefault("Rate.XP.PastLevel70", 1.0f);
rate_values[RATE_REPUTATION_GAIN] = sConfig.GetFloatDefault("Rate.Reputation.Gain", 1.0f);
+ rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfig.GetFloatDefault("Rate.Reputation.LowLevel.Kill", 1.0f);
+ rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfig.GetFloatDefault("Rate.Reputation.LowLevel.Quest", 1.0f);
rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f);
rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f);
rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.RAREELITE.Damage", 1.0f);
@@ -556,10 +560,10 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_ADDON_CHANNEL] = sConfig.GetBoolDefault("AddonChannel", true);
m_configs[CONFIG_GRID_UNLOAD] = sConfig.GetBoolDefault("GridUnload", true);
- m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 900000);
+ m_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILISECONDS);
m_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig.GetIntDefault("DisconnectToleranceInterval", 0);
- m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 300000);
+ m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILISECONDS);
if(m_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
{
sLog.outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.",m_configs[CONFIG_INTERVAL_GRIDCLEAN],MIN_GRID_DELAY);
@@ -577,7 +581,7 @@ void World::LoadConfigSettings(bool reload)
if(reload)
MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
- m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 600000);
+ m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS);
if(reload)
{
@@ -592,7 +596,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
if(val!=m_configs[CONFIG_SOCKET_SELECTTIME])
- sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[DEFAULT_SOCKET_SELECT_TIME]);
+ sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]);
}
else
m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
@@ -620,21 +624,21 @@ void World::LoadConfigSettings(bool reload)
else
m_configs[CONFIG_REALM_ZONE] = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
- m_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig.GetBoolDefault("AllowTwoSide.Accounts", false);
+ m_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig.GetBoolDefault("AllowTwoSide.Accounts", false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Chat",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Channel",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Group",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Guild",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Auction",false);
m_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Mail",false);
- m_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig.GetBoolDefault("AllowTwoSide.WhoList", false);
- m_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig.GetBoolDefault("AllowTwoSide.AddFriend", false);
- m_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig.GetBoolDefault("AllowTwoSide.trade", false);
- m_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig.GetIntDefault("StrictPlayerNames", 0);
- m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault("StrictCharterNames", 0);
- m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault("StrictPetNames", 0);
+ m_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig.GetBoolDefault("AllowTwoSide.WhoList", false);
+ m_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig.GetBoolDefault("AllowTwoSide.AddFriend", false);
+ m_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig.GetBoolDefault("AllowTwoSide.trade", false);
+ m_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig.GetIntDefault ("StrictPlayerNames", 0);
+ m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault ("StrictCharterNames", 0);
+ m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0);
- m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault("CharactersCreatingDisabled", 0);
+ m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault ("CharactersCreatingDisabled", 0);
m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10);
if(m_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_configs[CONFIG_CHARACTERS_PER_REALM] > 10)
@@ -651,8 +655,17 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_configs[CONFIG_CHARACTERS_PER_REALM];
}
+ m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("HeroicCharactersPerRealm", 1);
+ if(int32(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
+ {
+ sLog.outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.",m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
+ m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1;
+ }
+
+ m_configs[CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING] = sConfig.GetIntDefault("MinLevelForHeroicCharacterCreating", 55);
+
m_configs[CONFIG_SKIP_CINEMATICS] = sConfig.GetIntDefault("SkipCinematics", 0);
- if(m_configs[CONFIG_SKIP_CINEMATICS] < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2)
+ if(int32(m_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2)
{
sLog.outError("SkipCinematics (%i) must be in range 0..2. Set to 0.",m_configs[CONFIG_SKIP_CINEMATICS]);
m_configs[CONFIG_SKIP_CINEMATICS] = 0;
@@ -660,12 +673,12 @@ void World::LoadConfigSettings(bool reload)
if(reload)
{
- uint32 val = sConfig.GetIntDefault("MaxPlayerLevel", 60);
+ uint32 val = sConfig.GetIntDefault("MaxPlayerLevel", 80);
if(val!=m_configs[CONFIG_MAX_PLAYER_LEVEL])
sLog.outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).",m_configs[CONFIG_MAX_PLAYER_LEVEL]);
}
else
- m_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig.GetIntDefault("MaxPlayerLevel", 60);
+ m_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig.GetIntDefault("MaxPlayerLevel", 80);
if(m_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL)
{
@@ -685,8 +698,22 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_START_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL];
}
+ m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfig.GetIntDefault("StartHeroicPlayerLevel", 55);
+ if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
+ {
+ sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
+ m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55;
+ }
+ else if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL])
+ {
+ sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
+ m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL];
+ }
+
m_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 0);
- if(m_configs[CONFIG_START_PLAYER_MONEY] < 0)
+ if(int32(m_configs[CONFIG_START_PLAYER_MONEY]) < 0)
{
sLog.outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",m_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,0);
m_configs[CONFIG_START_PLAYER_MONEY] = 0;
@@ -699,18 +726,18 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_MAX_HONOR_POINTS] = sConfig.GetIntDefault("MaxHonorPoints", 75000);
- if(m_configs[CONFIG_MAX_HONOR_POINTS] < 0)
+ if(int32(m_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
{
sLog.outError("MaxHonorPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_HONOR_POINTS]);
m_configs[CONFIG_MAX_HONOR_POINTS] = 0;
}
m_configs[CONFIG_START_HONOR_POINTS] = sConfig.GetIntDefault("StartHonorPoints", 0);
- if(m_configs[CONFIG_START_HONOR_POINTS] < 0)
+ if(int32(m_configs[CONFIG_START_HONOR_POINTS]) < 0)
{
sLog.outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_configs[CONFIG_START_HONOR_POINTS],m_configs[CONFIG_MAX_HONOR_POINTS],0);
- m_configs[CONFIG_MAX_HONOR_POINTS] = 0;
+ m_configs[CONFIG_START_HONOR_POINTS] = 0;
}
else if(m_configs[CONFIG_START_HONOR_POINTS] > m_configs[CONFIG_MAX_HONOR_POINTS])
{
@@ -720,14 +747,14 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_MAX_ARENA_POINTS] = sConfig.GetIntDefault("MaxArenaPoints", 5000);
- if(m_configs[CONFIG_MAX_ARENA_POINTS] < 0)
+ if(int32(m_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
{
sLog.outError("MaxArenaPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_ARENA_POINTS]);
m_configs[CONFIG_MAX_ARENA_POINTS] = 0;
}
m_configs[CONFIG_START_ARENA_POINTS] = sConfig.GetIntDefault("StartArenaPoints", 0);
- if(m_configs[CONFIG_START_ARENA_POINTS] < 0)
+ if(int32(m_configs[CONFIG_START_ARENA_POINTS]) < 0)
{
sLog.outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_configs[CONFIG_START_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS],0);
@@ -745,27 +772,25 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfig.GetBoolDefault("Instance.IgnoreLevel", false);
m_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig.GetBoolDefault("Instance.IgnoreRaid", false);
- m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true);
- m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", true);
- m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false);
-
m_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true);
m_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4);
- m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 1800000);
+ m_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILISECONDS);
m_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2);
m_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig.GetIntDefault("MinPetitionSigns", 9);
if(m_configs[CONFIG_MIN_PETITION_SIGNS] > 9)
{
- sLog.outError("MinPetitionSigns (%i) must be in range 0..9. Set to 9.",m_configs[CONFIG_MIN_PETITION_SIGNS]);
+ sLog.outError("MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_configs[CONFIG_MIN_PETITION_SIGNS]);
m_configs[CONFIG_MIN_PETITION_SIGNS] = 9;
}
- m_configs[CONFIG_GM_LOGIN_STATE] = sConfig.GetIntDefault("GM.LoginState",2);
- m_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat",2);
- m_configs[CONFIG_GM_WISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo",2);
- m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList",false);
- m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList",false);
+ m_configs[CONFIG_GM_LOGIN_STATE] = sConfig.GetIntDefault("GM.LoginState", 2);
+ m_configs[CONFIG_GM_VISIBLE_STATE] = sConfig.GetIntDefault("GM.Visible", 2);
+ //m_configs[CONFIG_GM_ACCEPT_TICKETS] = sConfig.GetIntDefault("GM.AcceptTickets", 2);
+ m_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat", 2);
+ m_configs[CONFIG_GM_WISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo", 2);
+ m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList", false);
+ m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList", false);
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
@@ -779,23 +804,41 @@ void World::LoadConfigSettings(bool reload)
sLog.outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
}
+ m_configs[CONFIG_GM_LOWER_SECURITY] = sConfig.GetBoolDefault("GM.LowerSecurity", false);
+ m_configs[CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS] = sConfig.GetBoolDefault("GM.AllowAchievementGain", true);
m_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode",0);
m_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig.GetIntDefault("MailDeliveryDelay",HOUR);
m_configs[CONFIG_UPTIME_UPDATE] = sConfig.GetIntDefault("UpdateUptimeInterval", 10);
- if(m_configs[CONFIG_UPTIME_UPDATE]<=0)
+ if(int32(m_configs[CONFIG_UPTIME_UPDATE])<=0)
{
sLog.outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.",m_configs[CONFIG_UPTIME_UPDATE]);
m_configs[CONFIG_UPTIME_UPDATE] = 10;
}
if(reload)
{
- m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*1000);
+ m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS);
m_timers[WUPDATE_UPTIME].Reset();
}
+ // log db cleanup interval
+ m_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfig.GetIntDefault("LogDB.Opt.ClearInterval", 10);
+ if(int32(m_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0)
+ {
+ sLog.outError("LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_configs[CONFIG_LOGDB_CLEARINTERVAL]);
+ m_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10;
+ }
+ if(reload)
+ {
+ m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILISECONDS);
+ m_timers[WUPDATE_CLEANDB].Reset();
+ }
+ m_configs[CONFIG_LOGDB_CLEARTIME] = sConfig.GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default
+ sLog.outString("Will clear `logs` table of entries older than %i seconds every %u minutes.",
+ m_configs[CONFIG_LOGDB_CLEARTIME], m_configs[CONFIG_LOGDB_CLEARINTERVAL]);
+
m_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfig.GetIntDefault("SkillChance.Orange",100);
m_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfig.GetIntDefault("SkillChance.Yellow",75);
m_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfig.GetIntDefault("SkillChance.Green",25);
@@ -805,6 +848,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfig.GetIntDefault("SkillChance.SkinningSteps",75);
m_configs[CONFIG_SKILL_PROSPECTING] = sConfig.GetBoolDefault("SkillChance.Prospecting",false);
+ m_configs[CONFIG_SKILL_MILLING] = sConfig.GetBoolDefault("SkillChance.Milling",false);
m_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfig.GetIntDefault("SkillGain.Crafting", 1);
if(m_configs[CONFIG_SKILL_GAIN_CRAFTING] < 0)
@@ -878,21 +922,23 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_DETECT_POS_COLLISION] = sConfig.GetBoolDefault("DetectPosCollision", true);
- m_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfig.GetBoolDefault("Channel.RestrictedLfg", true);
+ m_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfig.GetBoolDefault("Channel.RestrictedLfg", true);
m_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfig.GetBoolDefault("Channel.SilentlyGMJoin", false);
- m_configs[CONFIG_TALENTS_INSPECTING] = sConfig.GetBoolDefault("TalentsInspecting", true);
+ m_configs[CONFIG_TALENTS_INSPECTING] = sConfig.GetBoolDefault("TalentsInspecting", true);
m_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfig.GetBoolDefault("ChatFakeMessagePreventing", false);
- m_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfig.GetIntDefault("Corpse.Decay.NORMAL", 60);
- m_configs[CONFIG_CORPSE_DECAY_RARE] = sConfig.GetIntDefault("Corpse.Decay.RARE", 300);
- m_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfig.GetIntDefault("Corpse.Decay.ELITE", 300);
+ m_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfig.GetIntDefault("Corpse.Decay.NORMAL", 60);
+ m_configs[CONFIG_CORPSE_DECAY_RARE] = sConfig.GetIntDefault("Corpse.Decay.RARE", 300);
+ m_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfig.GetIntDefault("Corpse.Decay.ELITE", 300);
m_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfig.GetIntDefault("Corpse.Decay.RAREELITE", 300);
m_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfig.GetIntDefault("Corpse.Decay.WORLDBOSS", 3600);
- m_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfig.GetIntDefault("Death.SicknessLevel", 11);
+ m_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfig.GetIntDefault ("Death.SicknessLevel", 11);
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvP", true);
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvE", true);
+ m_configs[CONFIG_DEATH_BONES_WORLD] = sConfig.GetBoolDefault("Death.Bones.World", true);
+ m_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfig.GetBoolDefault("Death.Bones.BattlegroundOrArena", true);
m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 60);
@@ -904,12 +950,22 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfig.GetIntDefault("ListenRange.TextEmote", 25);
m_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetIntDefault("ListenRange.Yell", 300);
- m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0);
- m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault("Arena.RatingDiscardTimer",300000);
- m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false);
- m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault("Arena.AutoDistributeInterval", 7);
+ m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true);
+ m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", false);
+ m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false);
+ m_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfig.GetIntDefault ("Battleground.InvitationType", 0);
+ m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault ("BattleGround.PrematureFinishTimer", 5 * MINUTE * IN_MILISECONDS);
+ m_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig.GetIntDefault ("BattleGround.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILISECONDS);
+ m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault ("Arena.MaxRatingDifference", 150);
+ m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILISECONDS);
+ m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false);
+ m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault ("Arena.AutoDistributeInterval", 7);
+ m_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Arena.QueueAnnouncer.Enable", false);
+ m_configs[CONFIG_ARENA_SEASON_ID] = sConfig.GetIntDefault ("Arena.ArenaSeason.ID", 1);
+ m_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfig.GetBoolDefault("Arena.ArenaSeason.InProgress", true);
+
+ m_configs[CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET] = sConfig.GetBoolDefault("OffhandCheckAtTalentsReset", false);
- m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault("BattleGround.PrematureFinishTimer", 0);
m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetIntDefault("InstantLogout", SEC_MODERATOR);
m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1);
@@ -1005,7 +1061,6 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49);
- m_configs[CONFIG_PREMATURE_BG_REWARD] = sConfig.GetBoolDefault("Battleground.PrematureReward", true);
m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false);
m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false);
m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
@@ -1038,6 +1093,17 @@ void World::LoadConfigSettings(bool reload)
token = strtok(NULL,delim);
}
delete[] forbiddenMaps;
+
+ // chat logging
+ m_configs[CONFIG_CHATLOG_CHANNEL] = sConfig.GetBoolDefault("ChatLogs.Channel", false);
+ m_configs[CONFIG_CHATLOG_WHISPER] = sConfig.GetBoolDefault("ChatLogs.Whisper", false);
+ m_configs[CONFIG_CHATLOG_SYSCHAN] = sConfig.GetBoolDefault("ChatLogs.SysChan", false);
+ m_configs[CONFIG_CHATLOG_PARTY] = sConfig.GetBoolDefault("ChatLogs.Party", false);
+ m_configs[CONFIG_CHATLOG_RAID] = sConfig.GetBoolDefault("ChatLogs.Raid", false);
+ m_configs[CONFIG_CHATLOG_GUILD] = sConfig.GetBoolDefault("ChatLogs.Guild", false);
+ m_configs[CONFIG_CHATLOG_PUBLIC] = sConfig.GetBoolDefault("ChatLogs.Public", false);
+ m_configs[CONFIG_CHATLOG_ADDON] = sConfig.GetBoolDefault("ChatLogs.Addon", false);
+ m_configs[CONFIG_CHATLOG_BGROUND] = sConfig.GetBoolDefault("ChatLogs.BattleGround", false);
}
/// Initialize the World
@@ -1068,7 +1134,7 @@ void World::SetInitialWorldSettings()
}
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
- sLog.outString( "" );
+ sLog.outString();
sLog.outString( "Loading Trinity strings..." );
if (!objmgr.LoadTrinityStrings())
exit(1); // Error message displayed in function already
@@ -1092,7 +1158,7 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Script Names...");
objmgr.LoadScriptNames();
- sLog.outString( "Loading InstanceTemplate" );
+ sLog.outString( "Loading InstanceTemplate..." );
objmgr.LoadInstanceTemplate();
sLog.outString( "Loading SkillLineAbilityMultiMap Data..." );
@@ -1100,11 +1166,12 @@ void World::SetInitialWorldSettings()
///- Clean up and pack instances
sLog.outString( "Cleaning up instances..." );
- sInstanceSaveManager.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
+ sInstanceSaveManager.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
sLog.outString( "Packing instances..." );
sInstanceSaveManager.PackInstances();
+ sLog.outString();
sLog.outString( "Loading Localization strings..." );
objmgr.LoadCreatureLocales();
objmgr.LoadGameObjectLocales();
@@ -1113,7 +1180,10 @@ void World::SetInitialWorldSettings()
objmgr.LoadNpcTextLocales();
objmgr.LoadPageTextLocales();
objmgr.LoadNpcOptionLocales();
+ objmgr.LoadPointOfInterestLocales();
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
+ sLog.outString( ">>> Localization strings loaded" );
+ sLog.outString();
sLog.outString( "Loading Page Texts..." );
objmgr.LoadPageTexts();
@@ -1142,6 +1212,9 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Spell Proc Event conditions..." );
spellmgr.LoadSpellProcEvents();
+ sLog.outString( "Loading Spell Bonus Data..." );
+ spellmgr.LoadSpellBonusess();
+
sLog.outString( "Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats();
@@ -1172,6 +1245,9 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Creature Reputation OnKill Data..." );
objmgr.LoadReputationOnKill();
+ sLog.outString( "Loading Points Of Interest Data..." );
+ objmgr.LoadPointsOfInterest();
+
sLog.outString( "Loading Pet Create Spells..." );
objmgr.LoadPetCreateSpells();
@@ -1182,7 +1258,10 @@ void World::SetInitialWorldSettings()
objmgr.LoadCreatureLinkedRespawn(); // must be after LoadCreatures()
sLog.outString( "Loading Creature Addon Data..." );
+ sLog.outString();
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
+ sLog.outString( ">>> Creature Addon Data loaded" );
+ sLog.outString();
sLog.outString( "Loading Creature Respawn Data..." ); // must be after PackInstances()
objmgr.LoadCreatureRespawnTimes();
@@ -1193,8 +1272,14 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Gameobject Respawn Data..." ); // must be after PackInstances()
objmgr.LoadGameobjectRespawnTimes();
+ sLog.outString( "Loading Objects Pooling Data...");
+ poolhandler.LoadFromDB();
+
sLog.outString( "Loading Game Event Data...");
+ sLog.outString();
gameeventmgr.LoadFromDB();
+ sLog.outString( ">>> Game Event Data loaded" );
+ sLog.outString();
sLog.outString( "Loading Weather Data..." );
objmgr.LoadWeatherZoneChances();
@@ -1203,7 +1288,13 @@ void World::SetInitialWorldSettings()
objmgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
sLog.outString( "Loading Quests Relations..." );
+ sLog.outString();
objmgr.LoadQuestRelations(); // must be after quest load
+ sLog.outString( ">>> Quests Relations loaded" );
+ sLog.outString();
+
+ sLog.outString( "Loading SpellArea Data..." ); // must be after quest load
+ spellmgr.LoadSpellAreas();
sLog.outString( "Loading AreaTrigger definitions..." );
objmgr.LoadAreaTriggerTeleports();
@@ -1232,14 +1323,20 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading spell pet auras..." );
spellmgr.LoadSpellPetAuras();
+ sLog.outString( "Loading pet levelup spells..." );
+ spellmgr.LoadPetLevelupSpellMap();
+
sLog.outString( "Loading spell extra attributes...(TODO)" );
spellmgr.LoadSpellCustomAttr();
sLog.outString( "Loading linked spells..." );
spellmgr.LoadSpellLinked();
- sLog.outString( "Loading player Create Info & Level Stats..." );
+ sLog.outString( "Loading Player Create Info & Level Stats..." );
+ sLog.outString();
objmgr.LoadPlayerInfo();
+ sLog.outString( ">>> Player Create Info & Level Stats loaded" );
+ sLog.outString();
sLog.outString( "Loading Exploration BaseXP Data..." );
objmgr.LoadExplorationBaseXP();
@@ -1260,7 +1357,10 @@ void World::SetInitialWorldSettings()
objmgr.LoadSpellDisabledEntrys();
sLog.outString( "Loading Loot Tables..." );
+ sLog.outString();
LoadLootTables();
+ sLog.outString( ">>> Loot Tables loaded" );
+ sLog.outString();
sLog.outString( "Loading Skill Discovery Table..." );
LoadSkillDiscoveryTable();
@@ -1271,10 +1371,24 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Skill Fishing base level requirements..." );
objmgr.LoadFishingBaseSkillLevel();
+ sLog.outString( "Loading Achievements..." );
+ sLog.outString();
+ achievementmgr.LoadAchievementReferenceList();
+ achievementmgr.LoadAchievementCriteriaList();
+ achievementmgr.LoadAchievementCriteriaData();
+ achievementmgr.LoadRewards();
+ achievementmgr.LoadRewardLocales();
+ achievementmgr.LoadCompletedAchievements();
+ sLog.outString( ">>> Achievements loaded" );
+ sLog.outString();
+
///- Load dynamic data tables from the database
sLog.outString( "Loading Auctions..." );
+ sLog.outString();
auctionmgr.LoadAuctionItems();
auctionmgr.LoadAuctions();
+ sLog.outString( ">>> Auctions loaded" );
+ sLog.outString();
sLog.outString( "Loading Guilds..." );
objmgr.LoadGuilds();
@@ -1288,11 +1402,11 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading ReservedNames..." );
objmgr.LoadReservedPlayersNames();
- sLog.outString( "Loading GameObject for quests..." );
+ sLog.outString( "Loading GameObjects for quests..." );
objmgr.LoadGameObjectForQuests();
sLog.outString( "Loading BattleMasters..." );
- objmgr.LoadBattleMastersEntry();
+ sBattleGroundMgr.LoadBattleMastersEntry();
sLog.outString( "Loading GameTeleports..." );
objmgr.LoadGameTele();
@@ -1303,13 +1417,14 @@ void World::SetInitialWorldSettings()
sLog.outString( "Loading Npc Options..." );
objmgr.LoadNpcOptions();
- sLog.outString( "Loading vendors..." );
+ sLog.outString( "Loading Vendors..." );
objmgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
- sLog.outString( "Loading trainers..." );
+ sLog.outString( "Loading Trainers..." );
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate
sLog.outString( "Loading Waypoints..." );
+ sLog.outString();
WaypointMgr.Load();
sLog.outString( "Loading Creature Formations..." );
@@ -1324,16 +1439,28 @@ void World::SetInitialWorldSettings()
///- Load and initialize scripts
sLog.outString( "Loading Scripts..." );
+ sLog.outString();
objmgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadWaypointScripts();
+ sLog.outString( ">>> Scripts loaded" );
+ sLog.outString();
sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
objmgr.LoadDbScriptStrings();
+ sLog.outString( "Loading CreatureEventAI Texts...");
+ CreatureEAI_Mgr.LoadCreatureEventAI_Texts();
+
+ sLog.outString( "Loading CreatureEventAI Summons...");
+ CreatureEAI_Mgr.LoadCreatureEventAI_Summons();
+
+ sLog.outString( "Loading CreatureEventAI Scripts...");
+ CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
+
sLog.outString( "Initializing Scripts..." );
if(!LoadScriptingModule())
exit(1);
@@ -1351,23 +1478,26 @@ void World::SetInitialWorldSettings()
sprintf( isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
- WorldDatabase.PExecute("INSERT INTO uptime (startstring, starttime, uptime) VALUES('%s', " I64FMTD ", 0)",
- isoDate, uint64(m_startTime));
+ LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " I64FMTD ", '%s', 0)",
+ realmID, uint64(m_startTime), isoDate);
m_timers[WUPDATE_OBJECTS].SetInterval(0);
m_timers[WUPDATE_SESSIONS].SetInterval(0);
- m_timers[WUPDATE_WEATHERS].SetInterval(1000);
- m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*1000); //set auction update interval to 1 minute
- m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*1000);
+ m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILISECONDS);
+ m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILISECONDS);
+ m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS);
//Update "uptime" table based on configuration entry in minutes.
- m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000); //erase corpses every 20 minutes
+ m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*IN_MILISECONDS);
+ //erase corpses every 20 minutes
+ m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE*IN_MILISECONDS);
+ // clean logs table every 14 days by default
//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)
- mail_timer = ((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * 1000) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
+ mail_timer = ((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
//1440
- mail_timer_expires = ( (DAY * 1000) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
+ mail_timer_expires = ( (DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
///- Initilize static helper structures
@@ -1400,6 +1530,9 @@ void World::SetInitialWorldSettings()
sLog.outString("Calculate next daily quest reset time..." );
InitDailyQuestResetTime();
+ sLog.outString("Starting objects Pooling system..." );
+ poolhandler.Initialize();
+
sLog.outString("Starting Game Event system..." );
uint32 nextGameEvent = gameeventmgr.Initialize();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
@@ -1407,6 +1540,19 @@ void World::SetInitialWorldSettings()
sLog.outString("Initialize AuctionHouseBot...");
AuctionHouseBotInit();
+ // possibly enable db logging; avoid massive startup spam by doing it here.
+ if (sLog.GetLogDBLater())
+ {
+ sLog.outString("Enabling database logging...");
+ sLog.SetLogDBLater(false);
+ sLog.SetLogDB(true);
+ }
+ else
+ {
+ sLog.SetLogDB(false);
+ sLog.SetLogDBLater(false);
+ }
+
sLog.outString( "WORLD: World initialized" );
}
@@ -1451,6 +1597,7 @@ void World::DetectDBCLang()
m_defaultDbcLocale = LocaleConstant(default_locale);
sLog.outString("Using %s DBC Locale as default. All available DBC locales: %s",localeNames[m_defaultDbcLocale],availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str());
+ sLog.outString();
}
void World::RecordTimeDiff(const char *text, ...)
@@ -1480,7 +1627,7 @@ void World::RecordTimeDiff(const char *text, ...)
}
/// Update the World !
-void World::Update(time_t diff)
+void World::Update(uint32 diff)
{
m_updateTime = uint32(diff);
if(m_configs[CONFIG_INTERVAL_LOG_UPDATE])
@@ -1527,7 +1674,8 @@ void World::Update(time_t diff)
mail_timer = 0;
objmgr.ReturnOrDeleteOldMails(true);
}
- ///-Handle expired auctions
+
+ ///- Handle expired auctions
auctionmgr.Update();
}
@@ -1566,10 +1714,24 @@ void World::Update(time_t diff)
if (m_timers[WUPDATE_UPTIME].Passed())
{
uint32 tmpDiff = (m_gameTime - m_startTime);
- uint32 maxClientsNum = sWorld.GetMaxActiveSessionCount();
+ uint32 maxClientsNum = GetMaxActiveSessionCount();
m_timers[WUPDATE_UPTIME].Reset();
- WorldDatabase.PExecute("UPDATE uptime SET uptime = %d, maxplayers = %d WHERE starttime = " I64FMTD, tmpDiff, maxClientsNum, uint64(m_startTime));
+ LoginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " I64FMTD, tmpDiff, maxClientsNum, realmID, uint64(m_startTime));
+ }
+
+ /// <li> Clean logs table
+ if(sWorld.getConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
+ {
+ if (m_timers[WUPDATE_CLEANDB].Passed())
+ {
+ uint32 tmpDiff = (m_gameTime - m_startTime);
+ uint32 maxClientsNum = sWorld.GetMaxActiveSessionCount();
+
+ m_timers[WUPDATE_CLEANDB].Reset();
+ LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < "I64FMTD";",
+ sWorld.getConfig(CONFIG_LOGDB_CLEARTIME), uint64(time(0)));
+ }
}
/// <li> Handle all other objects
@@ -1721,6 +1883,9 @@ void World::ScriptsProcess()
case HIGHGUID_PET:
source = HashMapHolder<Pet>::Find(step.sourceGUID);
break;
+ case HIGHGUID_VEHICLE:
+ source = HashMapHolder<Vehicle>::Find(step.sourceGUID);
+ break;
case HIGHGUID_PLAYER:
source = HashMapHolder<Player>::Find(step.sourceGUID);
break;
@@ -1760,6 +1925,9 @@ void World::ScriptsProcess()
case HIGHGUID_PET:
target = HashMapHolder<Pet>::Find(step.targetGUID);
break;
+ case HIGHGUID_VEHICLE:
+ target = HashMapHolder<Vehicle>::Find(step.targetGUID);
+ break;
case HIGHGUID_PLAYER: // empty GUID case also
target = HashMapHolder<Player>::Find(step.targetGUID);
break;
@@ -1868,7 +2036,7 @@ void World::ScriptsProcess()
sLog.outError("SCRIPT_COMMAND_MOVE_TO call for non-creature (TypeId: %u), skipping.",source->GetTypeId());
break;
}
- ((Unit *)source)->SendMonsterMoveWithSpeed(step.script->x, step.script->y, step.script->z, ((Unit *)source)->GetUnitMovementFlags(), step.script->datalong2 );
+ ((Unit *)source)->SendMonsterMoveWithSpeed(step.script->x, step.script->y, step.script->z, step.script->datalong2 );
((Unit *)source)->GetMap()->CreatureRelocation(((Creature *)source), step.script->x, step.script->y, step.script->z, 0);
break;
case SCRIPT_COMMAND_FLAG_SET:
@@ -1990,8 +2158,8 @@ void World::ScriptsProcess()
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong);
- Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(go,go_check);
+ MaNGOS::GameObjectWithDbGUIDCheck go_check(*summoner,step.script->datalong);
+ MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(summoner, go,go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -2051,8 +2219,8 @@ void World::ScriptsProcess()
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
- Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check);
+ MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
+ MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(caster,door,go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -2107,8 +2275,8 @@ void World::ScriptsProcess()
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
- Trinity::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
- Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(door,go_check);
+ MaNGOS::GameObjectWithDbGUIDCheck go_check(*caster,step.script->datalong);
+ MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck> checker(caster,door,go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -2260,24 +2428,40 @@ void World::ScriptsProcess()
break;
}
- Object* cmdTarget = step.script->datalong2 ? source : target;
+ Object* cmdTarget = step.script->datalong2 & 0x01 ? source : target;
if(!cmdTarget)
{
- sLog.outError("SCRIPT_COMMAND_CAST_SPELL call for NULL %s.",step.script->datalong2 ? "source" : "target");
+ sLog.outError("SCRIPT_COMMAND_CAST_SPELL call for NULL %s.",step.script->datalong2 & 0x01 ? "source" : "target");
break;
}
if(!cmdTarget->isType(TYPEMASK_UNIT))
{
- sLog.outError("SCRIPT_COMMAND_CAST_SPELL %s isn't unit (TypeId: %u), skipping.",step.script->datalong2 ? "source" : "target",cmdTarget->GetTypeId());
+ sLog.outError("SCRIPT_COMMAND_CAST_SPELL %s isn't unit (TypeId: %u), skipping.",step.script->datalong2 & 0x01 ? "source" : "target",cmdTarget->GetTypeId());
break;
}
Unit* spellTarget = (Unit*)cmdTarget;
+ Object* cmdSource = step.script->datalong2 & 0x02 ? target : source;
+
+ if(!cmdSource)
+ {
+ sLog.outError("SCRIPT_COMMAND_CAST_SPELL call for NULL %s.",step.script->datalong2 & 0x02 ? "target" : "source");
+ break;
+ }
+
+ if(!cmdSource->isType(TYPEMASK_UNIT))
+ {
+ sLog.outError("SCRIPT_COMMAND_CAST_SPELL %s isn't unit (TypeId: %u), skipping.",step.script->datalong2 & 0x02 ? "target" : "source", cmdSource->GetTypeId());
+ break;
+ }
+
+ Unit* spellSource = (Unit*)cmdSource;
+
//TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast
- ((Unit*)source)->CastSpell(spellTarget,step.script->datalong,false);
+ spellSource->CastSpell(spellTarget,step.script->datalong,false);
break;
}
@@ -2324,7 +2508,7 @@ void World::ScriptsProcess()
//sLog.outDebug("Attempting to find Creature: Db GUID: %i", step.script->datalong);
Trinity::CreatureWithDbGUIDCheck target_check(((Unit*)source), step.script->datalong);
- Trinity::CreatureSearcher<Trinity::CreatureWithDbGUIDCheck> checker(target,target_check);
+ Trinity::CreatureSearcher<Trinity::CreatureWithDbGUIDCheck> checker(((Unit*)source), target, target_check);
TypeContainerVisitor<Trinity::CreatureSearcher <Trinity::CreatureWithDbGUIDCheck>, GridTypeMapContainer > unit_checker(checker);
CellLock<GridReadGuard> cell_lock(cell, p);
@@ -2375,15 +2559,6 @@ void World::ScriptsProcess()
break;
}
- case SCRIPT_COMMAND_PLAYSOUND:
- {
- if(!source)
- break;
- //datalong sound_id, datalong2 onlyself
- ((WorldObject*)source)->SendPlaySound(step.script->datalong, step.script->datalong2);
- break;
- }
-
case SCRIPT_COMMAND_KILL:
{
if(!source || ((Creature*)source)->isDead())
@@ -2399,6 +2574,47 @@ void World::ScriptsProcess()
break;
}
+ case SCRIPT_COMMAND_PLAY_SOUND:
+ {
+ if(!source)
+ {
+ sLog.outError("SCRIPT_COMMAND_PLAY_SOUND call for NULL creature.");
+ break;
+ }
+
+ WorldObject* pSource = dynamic_cast<WorldObject*>(source);
+ if(!pSource)
+ {
+ sLog.outError("SCRIPT_COMMAND_PLAY_SOUND call for non-world object (TypeId: %u), skipping.",source->GetTypeId());
+ break;
+ }
+
+ // bitmask: 0/1=anyone/target, 0/2=with distance dependent
+ Player* pTarget = NULL;
+ if(step.script->datalong2 & 1)
+ {
+ if(!target)
+ {
+ sLog.outError("SCRIPT_COMMAND_PLAY_SOUND in targeted mode call for NULL target.");
+ break;
+ }
+
+ if(target->GetTypeId()!=TYPEID_PLAYER)
+ {
+ sLog.outError("SCRIPT_COMMAND_PLAY_SOUND in targeted mode call for non-player (TypeId: %u), skipping.",target->GetTypeId());
+ break;
+ }
+
+ pTarget = (Player*)target;
+ }
+
+ // bitmask: 0/1=anyone/target, 0/2=with distance dependent
+ if(step.script->datalong2 & 2)
+ pSource->PlayDistanceSound(step.script->datalong,pTarget);
+ else
+ pSource->PlayDirectSound(step.script->datalong,pTarget);
+ break;
+ }
default:
sLog.outError("Unknown script command %u called.",step.script->command);
break;
@@ -2428,16 +2644,17 @@ void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 te
}
}
+/// Send a packet to all GMs (except self if mentioned)
void World::SendGlobalGMMessage(WorldPacket *packet, WorldSession *self, uint32 team)
{
SessionMap::iterator itr;
- for (itr = m_sessions.begin(); itr != m_sessions.end(); itr++)
+ for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
if (itr->second &&
itr->second->GetPlayer() &&
itr->second->GetPlayer()->IsInWorld() &&
itr->second != self &&
- itr->second->GetSecurity() >SEC_PLAYER &&
+ itr->second->GetSecurity() &&
(team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
{
itr->second->SendPacket(packet);
@@ -2445,115 +2662,105 @@ void World::SendGlobalGMMessage(WorldPacket *packet, WorldSession *self, uint32
}
}
-/// Send a System Message to all players (except self if mentioned)
-void World::SendWorldText(int32 string_id, ...)
+namespace MaNGOS
{
- std::vector<std::vector<WorldPacket*> > data_cache; // 0 = default, i => i-1 locale index
-
- for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ class WorldWorldTextBuilder
{
- if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
- continue;
+ public:
+ typedef std::vector<WorldPacket*> WorldPacketList;
+ explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {}
+ void operator()(WorldPacketList& data_list, int32 loc_idx)
+ {
+ char const* text = objmgr.GetMangosString(i_textId,loc_idx);
- uint32 loc_idx = itr->second->GetSessionDbLocaleIndex();
- uint32 cache_idx = loc_idx+1;
+ if(i_args)
+ {
+ // we need copy va_list before use or original va_list will corrupted
+ va_list ap;
+ va_copy(ap,*i_args);
- std::vector<WorldPacket*>* data_list;
+ char str [2048];
+ vsnprintf(str,2048,text, ap );
+ va_end(ap);
- // create if not cached yet
- if(data_cache.size() < cache_idx+1 || data_cache[cache_idx].empty())
- {
- if(data_cache.size() < cache_idx+1)
- data_cache.resize(cache_idx+1);
+ do_helper(data_list,&str[0]);
+ }
+ else
+ do_helper(data_list,(char*)text);
+ }
+ private:
+ char* lineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; }
+ void do_helper(WorldPacketList& data_list, char* text)
+ {
+ char* pos = text;
- data_list = &data_cache[cache_idx];
+ while(char* line = lineFromMessage(pos))
+ {
+ WorldPacket* data = new WorldPacket();
- char const* text = objmgr.GetTrinityString(string_id,loc_idx);
+ uint32 lineLength = (line ? strlen(line) : 0) + 1;
- char buf[1000];
+ data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
+ *data << uint8(CHAT_MSG_SYSTEM);
+ *data << uint32(LANG_UNIVERSAL);
+ *data << uint64(0);
+ *data << uint32(0); // can be chat msg group or something
+ *data << uint64(0);
+ *data << uint32(lineLength);
+ *data << line;
+ *data << uint8(0);
- va_list argptr;
- va_start( argptr, string_id );
- vsnprintf( buf,1000, text, argptr );
- va_end( argptr );
+ data_list.push_back(data);
+ }
+ }
- char* pos = &buf[0];
+ int32 i_textId;
+ va_list* i_args;
+ };
+} // namespace MaNGOS
- while(char* line = ChatHandler::LineFromMessage(pos))
- {
- WorldPacket* data = new WorldPacket();
- ChatHandler::FillMessageData(data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, line, NULL);
- data_list->push_back(data);
- }
- }
- else
- data_list = &data_cache[cache_idx];
+/// Send a System Message to all players (except self if mentioned)
+void World::SendWorldText(int32 string_id, ...)
+{
+ va_list ap;
+ va_start(ap, string_id);
+
+ MaNGOS::WorldWorldTextBuilder wt_builder(string_id, &ap);
+ MaNGOS::LocalizedPacketListDo<MaNGOS::WorldWorldTextBuilder> wt_do(wt_builder);
+ for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ {
+ if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
+ continue;
- for(int i = 0; i < data_list->size(); ++i)
- itr->second->SendPacket((*data_list)[i]);
+ wt_do(itr->second->GetPlayer());
}
- // free memory
- for(int i = 0; i < data_cache.size(); ++i)
- for(int j = 0; j < data_cache[i].size(); ++j)
- delete data_cache[i][j];
+ va_end(ap);
}
+/// Send a System Message to all GMs (except self if mentioned)
void World::SendGMText(int32 string_id, ...)
{
- std::vector<std::vector<WorldPacket*> > data_cache; // 0 = default, i => i-1 locale index
+ va_list ap;
+ va_start(ap, string_id);
+ MaNGOS::WorldWorldTextBuilder wt_builder(string_id, &ap);
+ MaNGOS::LocalizedPacketListDo<MaNGOS::WorldWorldTextBuilder> wt_do(wt_builder);
for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
continue;
- uint32 loc_idx = itr->second->GetSessionDbLocaleIndex();
- uint32 cache_idx = loc_idx+1;
-
- std::vector<WorldPacket*>* data_list;
-
- // create if not cached yet
- if(data_cache.size() < cache_idx+1 || data_cache[cache_idx].empty())
- {
- if(data_cache.size() < cache_idx+1)
- data_cache.resize(cache_idx+1);
-
- data_list = &data_cache[cache_idx];
-
- char const* text = objmgr.GetTrinityString(string_id,loc_idx);
-
- char buf[1000];
-
- va_list argptr;
- va_start( argptr, string_id );
- vsnprintf( buf,1000, text, argptr );
- va_end( argptr );
-
- char* pos = &buf[0];
-
- while(char* line = ChatHandler::LineFromMessage(pos))
- {
- WorldPacket* data = new WorldPacket();
- ChatHandler::FillMessageData(data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, line, NULL);
- data_list->push_back(data);
- }
- }
- else
- data_list = &data_cache[cache_idx];
+ if(!itr->second->GetSecurity())
+ continue;
- for(int i = 0; i < data_list->size(); ++i)
- if(itr->second->GetSecurity() > SEC_PLAYER)
- itr->second->SendPacket((*data_list)[i]);
+ wt_do(itr->second->GetPlayer());
}
- // free memory
- for(int i = 0; i < data_cache.size(); ++i)
- for(int j = 0; j < data_cache[i].size(); ++j)
- delete data_cache[i][j];
+ va_end(ap);
}
-/// Send a System Message to all players (except self if mentioned)
+/// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned)
void World::SendGlobalText(const char* text, WorldSession *self)
{
WorldPacket data;
@@ -2806,7 +3013,7 @@ void World::ShutdownMsg(bool show, Player* player)
{
std::string str = secsToTimeString(m_ShutdownTimer);
- uint32 msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
+ ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
SendServerMessage(msgid,str.c_str(),player);
DEBUG_LOG("Server is %s in %s",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"),str.c_str());
@@ -2820,7 +3027,7 @@ void World::ShutdownCancel()
if(!m_ShutdownTimer || m_stopEvent)
return;
- uint32 msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED;
+ ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED;
m_ShutdownMask = 0;
m_ShutdownTimer = 0;
@@ -2831,7 +3038,7 @@ void World::ShutdownCancel()
}
/// Send a server message to the user(s)
-void World::SendServerMessage(uint32 type, const char *text, Player* player)
+void World::SendServerMessage(ServerMessageType type, const char *text, Player* player)
{
WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size
data << uint32(type);
@@ -2844,7 +3051,7 @@ void World::SendServerMessage(uint32 type, const char *text, Player* player)
SendGlobalMessage( &data );
}
-void World::UpdateSessions( time_t diff )
+void World::UpdateSessions( uint32 diff )
{
///- Add new sessions
while(!addSessQueue.empty())
@@ -2997,14 +3204,20 @@ void World::UpdateMaxSessionCounters()
void World::LoadDBVersion()
{
QueryResult* result = WorldDatabase.Query("SELECT db_version FROM version LIMIT 1");
+ //QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version FROM db_version LIMIT 1");
if(result)
{
Field* fields = result->Fetch();
- m_DBVersion = fields[0].GetString();
+ m_DBVersion = fields[0].GetCppString();
+ //m_CreatureEventAIVersion = fields[1].GetCppString();
delete result;
}
- else
- m_DBVersion = "unknown world database";
+
+ if(m_DBVersion.empty())
+ m_DBVersion = "Unknown world database.";
+
+ if(m_CreatureEventAIVersion.empty())
+ m_CreatureEventAIVersion = "Unknown creature EventAI.";
}
diff --git a/src/game/World.h b/src/game/World.h
index ff03f4124b0..27075885368 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -45,6 +45,16 @@ class SqlResultQueue;
class QueryResult;
class WorldSocket;
+// ServerMessages.dbc
+enum ServerMessageType
+{
+ SERVER_MSG_SHUTDOWN_TIME = 1,
+ SERVER_MSG_RESTART_TIME = 2,
+ SERVER_MSG_STRING = 3,
+ SERVER_MSG_SHUTDOWN_CANCELLED = 4,
+ SERVER_MSG_RESTART_CANCELLED = 5
+};
+
enum ShutdownMask
{
SHUTDOWN_MASK_RESTART = 1,
@@ -68,7 +78,8 @@ enum WorldTimers
WUPDATE_UPTIME = 4,
WUPDATE_CORPSES = 5,
WUPDATE_EVENTS = 6,
- WUPDATE_COUNT = 7
+ WUPDATE_CLEANDB = 7,
+ WUPDATE_COUNT = 8
};
/// Configuration elements
@@ -104,9 +115,12 @@ enum WorldConfigs
CONFIG_CHARACTERS_CREATING_DISABLED,
CONFIG_CHARACTERS_PER_ACCOUNT,
CONFIG_CHARACTERS_PER_REALM,
+ CONFIG_HEROIC_CHARACTERS_PER_REALM,
+ CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING,
CONFIG_SKIP_CINEMATICS,
CONFIG_MAX_PLAYER_LEVEL,
CONFIG_START_PLAYER_LEVEL,
+ CONFIG_START_HEROIC_PLAYER_LEVEL,
CONFIG_START_PLAYER_MONEY,
CONFIG_MAX_HONOR_POINTS,
CONFIG_START_HONOR_POINTS,
@@ -114,21 +128,22 @@ enum WorldConfigs
CONFIG_START_ARENA_POINTS,
CONFIG_INSTANCE_IGNORE_LEVEL,
CONFIG_INSTANCE_IGNORE_RAID,
- CONFIG_BATTLEGROUND_CAST_DESERTER,
- CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
- CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
CONFIG_INSTANCE_RESET_TIME_HOUR,
CONFIG_INSTANCE_UNLOAD_DELAY,
CONFIG_CAST_UNSTUCK,
CONFIG_MAX_PRIMARY_TRADE_SKILL,
CONFIG_MIN_PETITION_SIGNS,
CONFIG_GM_LOGIN_STATE,
+ CONFIG_GM_VISIBLE_STATE,
+ CONFIG_GM_ACCEPT_TICKETS,
CONFIG_GM_CHAT,
CONFIG_GM_WISPERING_TO,
CONFIG_GM_IN_GM_LIST,
CONFIG_GM_IN_WHO_LIST,
CONFIG_GM_LOG_TRADE,
CONFIG_START_GM_LEVEL,
+ CONFIG_GM_LOWER_SECURITY,
+ CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS,
CONFIG_GROUP_VISIBILITY,
CONFIG_MAIL_DELIVERY_DELAY,
CONFIG_UPTIME_UPDATE,
@@ -171,6 +186,8 @@ enum WorldConfigs
CONFIG_DEATH_SICKNESS_LEVEL,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
+ CONFIG_DEATH_BONES_WORLD,
+ CONFIG_DEATH_BONES_BG_OR_ARENA,
CONFIG_THREAT_RADIUS,
CONFIG_INSTANT_LOGOUT,
CONFIG_DISABLE_BREATHING,
@@ -179,12 +196,20 @@ enum WorldConfigs
CONFIG_LISTEN_RANGE_SAY,
CONFIG_LISTEN_RANGE_TEXTEMOTE,
CONFIG_LISTEN_RANGE_YELL,
+ CONFIG_SKILL_MILLING,
+ CONFIG_BATTLEGROUND_CAST_DESERTER,
+ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE,
+ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
+ CONFIG_BATTLEGROUND_INVITATION_TYPE,
+ CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
+ CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
CONFIG_ARENA_RATING_DISCARD_TIMER,
CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS,
CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS,
- CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
-
+ CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
+ CONFIG_ARENA_SEASON_ID,
+ CONFIG_ARENA_SEASON_IN_PROGRESS,
CONFIG_MAX_WHO,
CONFIG_BG_START_MUSIC,
CONFIG_START_ALL_SPELLS,
@@ -201,8 +226,18 @@ enum WorldConfigs
CONFIG_INTERVAL_LOG_UPDATE,
CONFIG_MIN_LOG_UPDATE,
CONFIG_ENABLE_SINFO_LOGIN,
- CONFIG_PREMATURE_BG_REWARD,
-
+ CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET,
+ CONFIG_CHATLOG_CHANNEL,
+ CONFIG_CHATLOG_WHISPER,
+ CONFIG_CHATLOG_SYSCHAN,
+ CONFIG_CHATLOG_PARTY,
+ CONFIG_CHATLOG_RAID,
+ CONFIG_CHATLOG_GUILD,
+ CONFIG_CHATLOG_PUBLIC,
+ CONFIG_CHATLOG_ADDON,
+ CONFIG_CHATLOG_BGROUND,
+ CONFIG_LOGDB_CLEARINTERVAL,
+ CONFIG_LOGDB_CLEARTIME,
CONFIG_VALUE_COUNT
};
@@ -213,6 +248,8 @@ enum Rates
RATE_POWER_MANA,
RATE_POWER_RAGE_INCOME,
RATE_POWER_RAGE_LOSS,
+ RATE_POWER_RUNICPOWER_INCOME,
+ RATE_POWER_RUNICPOWER_LOSS,
RATE_POWER_FOCUS,
RATE_SKILL_DISCOVERY,
RATE_DROP_ITEM_POOR,
@@ -227,8 +264,9 @@ enum Rates
RATE_XP_KILL,
RATE_XP_QUEST,
RATE_XP_EXPLORE,
- RATE_XP_PAST_70,
RATE_REPUTATION_GAIN,
+ RATE_REPUTATION_LOWLEVEL_KILL,
+ RATE_REPUTATION_LOWLEVEL_QUEST,
RATE_CREATURE_NORMAL_HP,
RATE_CREATURE_ELITE_ELITE_HP,
RATE_CREATURE_ELITE_RAREELITE_HP,
@@ -256,7 +294,6 @@ enum Rates
RATE_MINING_AMOUNT,
RATE_MINING_NEXT,
RATE_TALENT,
- RATE_LOYALTY,
RATE_CORPSE_DECAY_LOOTED,
RATE_INSTANCE_RESET_TIME,
RATE_TARGET_POS_RECALCULATION_RANGE,
@@ -328,12 +365,11 @@ enum RealmZone
#define SCRIPT_COMMAND_CLOSE_DOOR 12 // source = unit, datalong=db_guid, datalong2=reset_delay
#define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO
#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
-#define SCRIPT_COMMAND_CAST_SPELL 15 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
-#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2
-#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table
-#define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self
-#define SCRIPT_COMMAND_KILL 19 // datalong removecorpse
-
+#define SCRIPT_COMMAND_CAST_SPELL 15 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s
+#define SCRIPT_COMMAND_PLAY_SOUND 16 // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent)
+#define SCRIPT_COMMAND_LOAD_PATH 20 // source = unit, path = datalong, repeatable datalong2
+#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 21 // datalong scriptid, lowguid datalong2, dataint table
+#define SCRIPT_COMMAND_KILL 22 // datalong removecorpse
/// Storage class for commands issued for delayed execution
struct CliCommandHolder
@@ -380,6 +416,12 @@ class World
Weather* AddWeather(uint32 zone_id);
void RemoveWeather(uint32 zone_id);
+ /// Deny clients?
+ bool IsClosed() { return m_isClosed; }
+
+ /// Close world
+ void SetClosed(bool val) { m_isClosed = val; }
+
/// Get the active session server limit (or security level limitations)
uint32 GetPlayerAmountLimit() const { return m_playerLimit >= 0 ? m_playerLimit : 0; }
AccountTypes GetPlayerSecurityLimit() const { return m_playerLimit <= 0 ? AccountTypes(-m_playerLimit) : SEC_PLAYER; }
@@ -443,7 +485,7 @@ class World
void SendGlobalGMMessage(WorldPacket *packet, WorldSession *self = 0, uint32 team = 0);
void SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self = 0, uint32 team = 0);
void SendZoneText(uint32 zone, const char *text, WorldSession *self = 0, uint32 team = 0);
- void SendServerMessage(uint32 type, const char *text = "", Player* player = NULL);
+ void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = NULL);
/// Are we in the middle of a shutdown?
bool IsShutdowning() const { return m_ShutdownTimer > 0; }
@@ -454,9 +496,9 @@ class World
static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; }
static bool IsStopped() { return m_stopEvent; }
- void Update(time_t diff);
+ void Update(uint32 diff);
- void UpdateSessions( time_t diff );
+ void UpdateSessions( uint32 diff );
/// Set a server rate (see #Rates)
void setRate(Rates rate,float value) { rate_values[rate]=value; }
/// Get a server rate (see #Rates)
@@ -518,6 +560,7 @@ class World
//used World DB version
void LoadDBVersion();
char const* GetDBVersion() { return m_DBVersion.c_str(); }
+ char const* GetCreatureEventAIVersion() { return m_CreatureEventAIVersion.c_str(); }
//used Script version
void SetScriptsVersion(char const* version) { m_ScriptsVersion = version ? version : "unknown scripting library"; }
@@ -538,6 +581,8 @@ class World
uint32 m_ShutdownTimer;
uint32 m_ShutdownMask;
+ bool m_isClosed;
+
time_t m_startTime;
time_t m_gameTime;
IntervalTimer m_timers[WUPDATE_COUNT];
@@ -596,6 +641,7 @@ class World
//used versions
std::string m_DBVersion;
+ std::string m_CreatureEventAIVersion;
std::string m_ScriptsVersion;
};
diff --git a/src/game/WorldLog.cpp b/src/game/WorldLog.cpp
index a1065dced5c..d5bd3d0d181 100644
--- a/src/game/WorldLog.cpp
+++ b/src/game/WorldLog.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
#include "WorldLog.h"
#include "Policies/SingletonImp.h"
#include "Config/ConfigEnv.h"
+#include "Log.h"
#define CLASS_LOCK Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex>
INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK);
@@ -32,6 +33,18 @@ INSTANTIATE_CLASS_MUTEX(WorldLog, ZThread::FastMutex);
#define WORLD_LOG_FILE_STRING "world.log"
+WorldLog::WorldLog() : i_file(NULL)
+{
+ Initialize();
+}
+
+WorldLog::~WorldLog()
+{
+ if( i_file != NULL )
+ fclose(i_file);
+ i_file = NULL;
+}
+
/// Open the log file (if specified so in the configuration file)
void WorldLog::Initialize()
{
@@ -48,6 +61,35 @@ void WorldLog::Initialize()
{
i_file = fopen((logsDir+logname).c_str(), "w");
}
+
+ m_dbWorld = sConfig.GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled
+}
+
+void WorldLog::outLog(char const *fmt, ...)
+{
+ if( LogWorld() )
+ {
+ Guard guard(*this);
+ ASSERT(i_file);
+
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(i_file, fmt, args);
+ fprintf(i_file, "\n" );
+ va_end(args);
+
+ fflush(i_file);
+ }
+
+ if (sLog.GetLogDB() && m_dbWorld)
+ {
+ va_list ap2;
+ va_start(ap2, fmt);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2);
+ sLog.outDB(LOG_TYPE_WORLD, nnew_str);
+ va_end(ap2);
+ }
}
#define sWorldLog WorldLog::Instance()
diff --git a/src/game/WorldLog.h b/src/game/WorldLog.h
index 0a7c2a08067..4ba651809ee 100644
--- a/src/game/WorldLog.h
+++ b/src/game/WorldLog.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,42 +35,25 @@
class TRINITY_DLL_DECL WorldLog : public Trinity::Singleton<WorldLog, Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex> >
{
friend class Trinity::OperatorNew<WorldLog>;
- WorldLog() : i_file(NULL) { Initialize(); }
+ WorldLog();
WorldLog(const WorldLog &);
WorldLog& operator=(const WorldLog &);
typedef Trinity::ClassLevelLockable<WorldLog, ZThread::FastMutex>::Lock Guard;
/// Close the file in destructor
- ~WorldLog()
- {
- if( i_file != NULL )
- fclose(i_file);
- i_file = NULL;
- }
+ ~WorldLog();
public:
void Initialize();
/// Is the world logger active?
- inline bool LogWorld(void) const { return (i_file != NULL); }
+ bool LogWorld(void) const { return (i_file != NULL); }
/// %Log to the file
- inline void Log(char const *fmt, ...)
- {
- if( LogWorld() )
- {
- Guard guard(*this);
- ASSERT(i_file);
-
- va_list args;
- va_start(args, fmt);
- vfprintf(i_file, fmt, args);
- va_end(args);
-
- fflush(i_file);
- }
- }
+ void outLog(char const *fmt, ...);
private:
FILE *i_file;
+
+ bool m_dbWorld;
};
#define sWorldLog WorldLog::Instance()
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index 5b1261e664a..da6837b1662 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -34,13 +34,12 @@
#include "Group.h"
#include "Guild.h"
#include "World.h"
-#include "MapManager.h"
#include "ObjectAccessor.h"
#include "BattleGroundMgr.h"
#include "OutdoorPvPMgr.h"
-#include "Language.h" // for CMSG_CANCEL_MOUNT_AURA handler
-#include "Chat.h"
+//#include "Language.h" // for CMSG_CANCEL_MOUNT_AURA handler
#include "SocialMgr.h"
+#include "zlib/zlib.h"
/// WorldSession constructor
WorldSession::WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
@@ -241,7 +240,7 @@ bool WorldSession::Update(uint32 /*diff*/)
void WorldSession::LogoutPlayer(bool Save)
{
// finish pending transfers before starting the logout
- while(_player && _player->IsBeingTeleported())
+ while(_player && _player->IsBeingTeleportedFar())
HandleMoveWorldportAckOpcode();
m_playerLogout = true;
@@ -298,25 +297,28 @@ void WorldSession::LogoutPlayer(bool Save)
else if(_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{
// this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION
- _player->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
+ _player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
//_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time
_player->KillPlayer();
_player->BuildPlayerRepop();
_player->RepopAtGraveyard();
}
+ //drop a flag if player is carrying it
+ if(BattleGround *bg = _player->GetBattleGround())
+ bg->EventPlayerLoggedOut(_player);
- ///- Remove player from battleground (teleport to entrance)
- if(_player->InBattleGround())
- _player->LeaveBattleground();
+ ///- Teleport to home if the player is in an invalid instance
+ if(!_player->m_InstanceValid && !_player->isGameMaster())
+ _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());
sOutdoorPvPMgr.HandlePlayerLeaveZone(_player,_player->GetZoneId());
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
{
- if(int32 bgTypeId = _player->GetBattleGroundQueueId(i))
+ if(BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i))
{
- _player->RemoveBattleGroundQueueId(bgTypeId);
- sBattleGroundMgr.m_BattleGroundQueues[ bgTypeId ].RemovePlayer(_player->GetGUID(), true);
+ _player->RemoveBattleGroundQueueId(bgQueueTypeId);
+ sBattleGroundMgr.m_BattleGroundQueues[ bgQueueTypeId ].RemovePlayer(_player->GetGUID(), true);
}
}
@@ -468,6 +470,13 @@ void WorldSession::SendNotification(int32 string_id,...)
}
}
+void WorldSession::SendSetPhaseShift(uint32 PhaseShift)
+{
+ WorldPacket data(SMSG_SET_PHASE_SHIFT, 4);
+ data << uint32(PhaseShift);
+ SendPacket(&data);
+}
+
const char * WorldSession::GetTrinityString( int32 entry ) const
{
return objmgr.GetTrinityString(entry,GetSessionDbLocaleIndex());
@@ -518,3 +527,212 @@ void WorldSession::SendAuthWaitQue(uint32 position)
}
}
+void WorldSession::LoadAccountData()
+{
+ for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
+ {
+ AccountData data;
+ m_accountData[i] = data;
+ }
+
+ QueryResult *result = CharacterDatabase.PQuery("SELECT type, time, data FROM account_data WHERE account='%u'", GetAccountId());
+
+ if(!result)
+ return;
+
+ do
+ {
+ Field *fields = result->Fetch();
+
+ uint32 type = fields[0].GetUInt32();
+ if(type < NUM_ACCOUNT_DATA_TYPES)
+ {
+ m_accountData[type].Time = fields[1].GetUInt32();
+ m_accountData[type].Data = fields[2].GetCppString();
+ }
+ } while (result->NextRow());
+
+ delete result;
+}
+
+void WorldSession::SetAccountData(uint32 type, time_t time_, std::string data)
+{
+ m_accountData[type].Time = time_;
+ m_accountData[type].Data = data;
+
+ uint32 acc = GetAccountId();
+
+ CharacterDatabase.BeginTransaction ();
+ CharacterDatabase.PExecute("DELETE FROM account_data WHERE account='%u' AND type='%u'", acc, type);
+ CharacterDatabase.escape_string(data);
+ CharacterDatabase.PExecute("INSERT INTO account_data VALUES ('%u','%u','%u','%s')", acc, type, (uint32)time_, data.c_str());
+ CharacterDatabase.CommitTransaction ();
+}
+
+void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
+{
+ CHECK_PACKET_SIZE(data, data.rpos()+4+2+4+4+4+4+4);
+ data >> mi->flags;
+ data >> mi->unk1;
+ data >> mi->time;
+ data >> mi->x;
+ data >> mi->y;
+ data >> mi->z;
+ data >> mi->o;
+
+ if(mi->flags & MOVEMENTFLAG_ONTRANSPORT)
+ {
+ CHECK_PACKET_SIZE(data, data.rpos()+8+4+4+4+4+4+1);
+ data >> mi->t_guid;
+ data >> mi->t_x;
+ data >> mi->t_y;
+ data >> mi->t_z;
+ data >> mi->t_o;
+ data >> mi->t_time;
+ data >> mi->t_seat;
+ }
+
+ if((mi->flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (mi->unk1 & 0x20))
+ {
+ CHECK_PACKET_SIZE(data, data.rpos()+4);
+ data >> mi->s_pitch;
+ }
+
+ CHECK_PACKET_SIZE(data, data.rpos()+4);
+ data >> mi->fallTime;
+
+ if(mi->flags & MOVEMENTFLAG_JUMPING)
+ {
+ CHECK_PACKET_SIZE(data, data.rpos()+4+4+4+4);
+ data >> mi->j_unk;
+ data >> mi->j_sinAngle;
+ data >> mi->j_cosAngle;
+ data >> mi->j_xyspeed;
+ }
+
+ if(mi->flags & MOVEMENTFLAG_SPLINE)
+ {
+ CHECK_PACKET_SIZE(data, data.rpos()+4);
+ data >> mi->u_unk1;
+ }
+}
+
+void WorldSession::ReadAddonsInfo(WorldPacket &data)
+{
+ if (data.rpos() + 4 > data.size())
+ return;
+ uint32 size;
+ data >> size;
+
+ if(!size)
+ return;
+
+ uLongf uSize = size;
+
+ uint32 pos = data.rpos();
+
+ ByteBuffer addonInfo;
+ addonInfo.resize(size);
+
+ if (uncompress(const_cast<uint8*>(addonInfo.contents()), &uSize, const_cast<uint8*>(data.contents() + pos), data.size() - pos) == Z_OK)
+ {
+ uint32 addonsCount;
+ addonInfo >> addonsCount; // addons count
+
+ for(uint32 i = 0; i < addonsCount; ++i)
+ {
+ std::string addonName;
+ uint8 enabled;
+ uint32 crc, unk1;
+
+ // check next addon data format correctness
+ if(addonInfo.rpos()+1 > addonInfo.size())
+ return;
+
+ addonInfo >> addonName;
+
+ // recheck next addon data format correctness
+ if(addonInfo.rpos()+1+4+4 > addonInfo.size())
+ return;
+
+ addonInfo >> enabled >> crc >> unk1;
+
+ sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
+
+ m_addonsList.push_back(AddonInfo(addonName, enabled, crc));
+ }
+
+ uint32 unk2;
+ addonInfo >> unk2;
+
+ if(addonInfo.rpos() != addonInfo.size())
+ sLog.outDebug("packet under read!");
+ }
+ else
+ sLog.outError("Addon packet uncompress error!");
+}
+
+void WorldSession::SendAddonsInfo()
+{
+ unsigned char tdata[256] =
+ {
+ 0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
+ 0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
+ 0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
+ 0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
+ 0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
+ 0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
+ 0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
+ 0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
+ 0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
+ 0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
+ 0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
+ 0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
+ 0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
+ 0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
+ 0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
+ 0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
+ };
+
+ WorldPacket data(SMSG_ADDON_INFO, 4);
+
+ for(AddonsList::iterator itr = m_addonsList.begin(); itr != m_addonsList.end(); ++itr)
+ {
+ uint8 state = (itr->Enabled ? 2 : 1);
+ data << uint8(state);
+
+ uint8 unk1 = (itr->Enabled ? 1 : 0);
+ data << uint8(unk1);
+ if (unk1)
+ {
+ uint8 unk2 = (itr->CRC != 0x4c1c776d); // If addon is Standard addon CRC
+ data << uint8(unk2);
+ if (unk2)
+ data.append(tdata, sizeof(tdata));
+
+ data << uint32(0);
+ }
+
+ uint8 unk3 = (itr->Enabled ? 0 : 1);
+ data << uint8(unk3);
+ if (unk3)
+ {
+ // String, 256 (null terminated?)
+ data << uint8(0);
+ }
+ }
+
+ m_addonsList.clear();
+
+ uint32 count = 0;
+ data << uint32(count);
+ /*for(uint32 i = 0; i < count; ++i)
+ {
+ uint32
+ string (16 bytes)
+ string (16 bytes)
+ uint32
+ }*/
+
+ SendPacket(&data);
+}
diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h
index 1461d47fd2b..c4126ce51b9 100644
--- a/src/game/WorldSession.h
+++ b/src/game/WorldSession.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
#define __WORLDSESSION_H
#include "Common.h"
+#include "SharedDefines.h"
class MailItemsInfo;
struct ItemPrototype;
@@ -47,6 +48,32 @@ class CharacterHandler;
#define CHECK_PACKET_SIZE(P,S) if((P).size() < (S)) return SizeError((P),(S));
+#define NUM_ACCOUNT_DATA_TYPES 8
+
+struct AccountData
+{
+ AccountData() : Time(0), Data("") {}
+
+ time_t Time;
+ std::string Data;
+};
+
+struct AddonInfo
+{
+ AddonInfo(std::string name, uint8 enabled, uint32 crc)
+ {
+ Name = name;
+ Enabled = enabled;
+ CRC = crc;
+ }
+
+ std::string Name;
+ uint8 Enabled;
+ uint32 CRC;
+};
+
+typedef std::list<AddonInfo> AddonsList;
+
enum PartyOperation
{
PARTY_OP_INVITE = 0,
@@ -81,6 +108,11 @@ class TRINITY_DLL_SPEC WorldSession
void SizeError(WorldPacket const& packet, uint32 size) const;
+ void ReadAddonsInfo(WorldPacket &data);
+ void SendAddonsInfo();
+
+ void ReadMovementInfo(WorldPacket &data, MovementInfo *mi);
+
void SendPacket(WorldPacket const* packet);
void SendNotification(const char *format,...) ATTR_PRINTF(2,3);
void SendNotification(int32 string_id,...);
@@ -88,6 +120,7 @@ class TRINITY_DLL_SPEC WorldSession
void SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type);
void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res);
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3);
+ void SendSetPhaseShift(uint32 phaseShift);
uint32 GetSecurity() const { return _security; }
uint32 GetAccountId() const { return _accountId; }
@@ -141,7 +174,7 @@ class TRINITY_DLL_SPEC WorldSession
void SendAttackStop(Unit const* enemy);
- void SendBattlegGroundList( uint64 guid, uint32 bgTypeId );
+ void SendBattlegGroundList( uint64 guid, BattleGroundTypeId bgTypeId );
void SendTradeStatus(uint32 status);
void SendCancelTrade();
@@ -153,6 +186,11 @@ class TRINITY_DLL_SPEC WorldSession
//pet
void SendPetNameQuery(uint64 guid, uint32 petnumber);
+ // Account Data
+ AccountData *GetAccountData(uint32 type) { return &m_accountData[type]; }
+ void SetAccountData(uint32 type, time_t time_, std::string data);
+ void LoadAccountData();
+
//mail
//used with item_page table
bool SendItemInfo( uint32 itemid, WorldPacket data );
@@ -309,6 +347,7 @@ class TRINITY_DLL_SPEC WorldSession
void HandleGameObjectUseOpcode(WorldPacket& recPacket);
void HandleMeetingStoneInfo(WorldPacket& recPacket);
+ void HandleGameobjectReportUse(WorldPacket& recvPacket);
void HandleNameQueryOpcode(WorldPacket& recvPacket);
@@ -322,9 +361,11 @@ class TRINITY_DLL_SPEC WorldSession
void HandleMoveWorldportAckOpcode(); // for server-side calls
void HandleMovementOpcodes(WorldPacket& recvPacket);
- void HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo, uint32& MovementFlags);
void HandleSetActiveMoverOpcode(WorldPacket &recv_data);
- void HandleNotActiveMoverOpcode(WorldPacket &recv_data);
+ void HandleMoveNotActiveMover(WorldPacket &recv_data);
+ void HandleDismissControlledVehicle(WorldPacket &recv_data);
+ void HandleRequestVehicleExit(WorldPacket &recv_data);
+ void HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data);
void HandleMoveTimeSkippedOpcode(WorldPacket &recv_data);
void HandleRequestRaidInfoOpcode( WorldPacket & recv_data );
@@ -385,7 +426,7 @@ class TRINITY_DLL_SPEC WorldSession
void HandleGuildSaveEmblemOpcode(WorldPacket& recvPacket);
void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket);
- void HandleTaxiQueryAvailableNodesOpcode(WorldPacket& recvPacket);
+ void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket);
void HandleActivateTaxiOpcode(WorldPacket& recvPacket);
void HandleActivateTaxiFarOpcode(WorldPacket& recvPacket);
void HandleTaxiNextDestinationOpcode(WorldPacket& recvPacket);
@@ -429,6 +470,7 @@ class TRINITY_DLL_SPEC WorldSession
void HandleAuctionRemoveItem( WorldPacket & recv_data );
void HandleAuctionListOwnerItems( WorldPacket & recv_data );
void HandleAuctionPlaceBid( WorldPacket & recv_data );
+ void HandleAuctionListPendingSales( WorldPacket & recv_data );
void HandleGetMail( WorldPacket & recv_data );
void HandleSendMail( WorldPacket & recv_data );
@@ -536,6 +578,7 @@ class TRINITY_DLL_SPEC WorldSession
//Pet
void HandlePetAction( WorldPacket & recv_data );
+ void HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2);
void HandlePetNameQuery( WorldPacket & recv_data );
void HandlePetSetAction( WorldPacket & recv_data );
void HandlePetAbandon( WorldPacket & recv_data );
@@ -544,6 +587,7 @@ class TRINITY_DLL_SPEC WorldSession
void HandlePetUnlearnOpcode( WorldPacket& recvPacket );
void HandlePetSpellAutocastOpcode( WorldPacket& recvPacket );
void HandlePetCastSpellOpcode( WorldPacket& recvPacket );
+ void HandlePetLearnTalent( WorldPacket& recvPacket );
void HandleSetActionBar(WorldPacket& recv_data);
@@ -580,10 +624,9 @@ class TRINITY_DLL_SPEC WorldSession
void HandleLfmSetNoneOpcode(WorldPacket& recv_data);
void HandleLfmSetOpcode(WorldPacket& recv_data);
void HandleLfgSetCommentOpcode(WorldPacket& recv_data);
- void HandleNewUnknownOpcode(WorldPacket& recv_data);
void HandleChooseTitleOpcode(WorldPacket& recv_data);
void HandleRealmStateRequestOpcode(WorldPacket& recv_data);
- void HandleAllowMoveAckOpcode(WorldPacket& recv_data);
+ void HandleTimeSyncResp(WorldPacket& recv_data);
void HandleWhoisOpcode(WorldPacket& recv_data);
void HandleResetInstancesOpcode(WorldPacket& recv_data);
@@ -629,6 +672,29 @@ class TRINITY_DLL_SPEC WorldSession
void HandleGuildBankBuyTab(WorldPacket& recv_data);
void HandleGuildBankTabText(WorldPacket& recv_data);
void HandleGuildBankSetTabText(WorldPacket& recv_data);
+
+ // Calendar
+ void HandleCalendarGetCalendar(WorldPacket& recv_data);
+ void HandleCalendarGetEvent(WorldPacket& recv_data);
+ void HandleCalendarGuildFilter(WorldPacket& recv_data);
+ void HandleCalendarArenaTeam(WorldPacket& recv_data);
+ void HandleCalendarAddEvent(WorldPacket& recv_data);
+ void HandleCalendarUpdateEvent(WorldPacket& recv_data);
+ void HandleCalendarRemoveEvent(WorldPacket& recv_data);
+ void HandleCalendarCopyEvent(WorldPacket& recv_data);
+ void HandleCalendarEventInvite(WorldPacket& recv_data);
+ void HandleCalendarEventRsvp(WorldPacket& recv_data);
+ void HandleCalendarEventRemoveInvite(WorldPacket& recv_data);
+ void HandleCalendarEventStatus(WorldPacket& recv_data);
+ void HandleCalendarEventModeratorStatus(WorldPacket& recv_data);
+ void HandleCalendarComplain(WorldPacket& recv_data);
+ void HandleCalendarGetNumPending(WorldPacket& recv_data);
+
+ void HandleSpellClick(WorldPacket& recv_data);
+ void HandleAlterAppearance(WorldPacket& recv_data);
+ void HandleRemoveGlyph(WorldPacket& recv_data);
+ void HandleCharCustomize(WorldPacket& recv_data);
+ void HandleInspectAchievements(WorldPacket& recv_data);
private:
// private trade methods
void moveItems(Item* myItems[], Item* hisItems[]);
@@ -651,6 +717,8 @@ class TRINITY_DLL_SPEC WorldSession
LocaleConstant m_sessionDbcLocale;
int m_sessionDbLocaleIndex;
uint32 m_latency;
+ AccountData m_accountData[NUM_ACCOUNT_DATA_TYPES];
+ AddonsList m_addonsList;
ZThread::LockedQueue<WorldPacket*,ZThread::FastMutex> _recvQueue;
};
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 9a5ec6c48c3..cefa4683502 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -1,7 +1,7 @@
/*
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
-* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +37,6 @@
#include "WorldPacket.h"
#include "SharedDefines.h"
#include "ByteBuffer.h"
-#include "AddonHandler.h"
#include "Opcodes.h"
#include "Database/DatabaseEnv.h"
#include "Auth/Sha1.h"
@@ -54,8 +53,37 @@
struct ServerPktHeader
{
- uint16 size;
- uint16 cmd;
+ /**
+ * size is the length of the payload _plus_ the length of the opcode
+ */
+ ServerPktHeader(uint32 size, uint16 cmd) : size(size)
+ {
+ uint8 headerIndex=0;
+ if(isLargePacket())
+ {
+ sLog.outDebug("initializing large server to client packet. Size: %u, cmd: %u", size, cmd);
+ header[headerIndex++] = 0x80|(0xFF &(size>>16));
+ }
+ header[headerIndex++] = 0xFF &(size>>8);
+ header[headerIndex++] = 0xFF &size;
+
+ header[headerIndex++] = 0xFF & cmd;
+ header[headerIndex++] = 0xFF & (cmd>>8);
+ }
+
+ uint8 getHeaderLength()
+ {
+ // cmd = 2 bytes, size= 2||3bytes
+ return 2+(isLargePacket()?3:2);
+ }
+
+ bool isLargePacket()
+ {
+ return size > 0x7FFF;
+ }
+
+ const uint32 size;
+ uint8 header[5];
};
struct ClientPktHeader
@@ -84,6 +112,9 @@ m_OverSpeedPings (0),
m_LastPingTime (ACE_Time_Value::zero)
{
reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
+
+ msg_queue()->high_water_mark(8*1024*1024);
+ msg_queue()->low_water_mark(8*1024*1024);
}
WorldSocket::~WorldSocket (void)
@@ -97,10 +128,6 @@ WorldSocket::~WorldSocket (void)
closing_ = true;
peer ().close ();
-
- WorldPacket* pct;
- while (m_PacketQueue.dequeue_head (pct) == 0)
- delete pct;
}
bool WorldSocket::IsClosed (void) const
@@ -142,7 +169,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct)
// Dump outgoing packet.
if (sWorldLog.LogWorld ())
{
- sWorldLog.Log ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
+ sWorldLog.outLog ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
(uint32) get_handle (),
pct.size (),
LookupOpcodeName (pct.GetOpcode ()),
@@ -152,26 +179,41 @@ int WorldSocket::SendPacket (const WorldPacket& pct)
while (p < pct.size ())
{
for (uint32 j = 0; j < 16 && p < pct.size (); j++)
- sWorldLog.Log ("%.2X ", const_cast<WorldPacket&>(pct)[p++]);
+ sWorldLog.outLog ("%.2X ", const_cast<WorldPacket&>(pct)[p++]);
- sWorldLog.Log ("\n");
+ sWorldLog.outLog ("");
}
-
- sWorldLog.Log ("\n\n");
}
- if (iSendPacket (pct) == -1)
+ ServerPktHeader header(pct.size()+2, pct.GetOpcode());
+ m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength());
+
+ if (m_OutBuffer->space () >= pct.size () + header.getHeaderLength() && msg_queue()->is_empty())
{
- WorldPacket* npct;
+ // Put the packet on the buffer.
+ if (m_OutBuffer->copy ((char*) header.header, header.getHeaderLength()) == -1)
+ ACE_ASSERT (false);
- ACE_NEW_RETURN (npct, WorldPacket (pct), -1);
+ if (!pct.empty ())
+ if (m_OutBuffer->copy ((char*) pct.contents (), pct.size ()) == -1)
+ ACE_ASSERT (false);
+ }
+ else
+ {
+ // Enqueue the packet.
+ ACE_Message_Block* mb;
- // NOTE maybe check of the size of the queue can be good ?
- // to make it bounded instead of unbounded
- if (m_PacketQueue.enqueue_tail (npct) == -1)
+ ACE_NEW_RETURN(mb, ACE_Message_Block(pct.size () + header.getHeaderLength()), -1);
+
+ mb->copy((char*) header.header, header.getHeaderLength());
+
+ if (!pct.empty ())
+ mb->copy((const char*)pct.contents(), pct.size ());
+
+ if(msg_queue()->enqueue_tail(mb,(ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
{
- delete npct;
- sLog.outError ("WorldSocket::SendPacket: m_PacketQueue.enqueue_tail failed");
+ sLog.outError("WorldSocket::SendPacket enqueue_tail");
+ mb->release();
return -1;
}
}
@@ -272,7 +314,7 @@ int WorldSocket::handle_input (ACE_HANDLE)
}
case 0:
{
- DEBUG_LOG ("WorldSocket::handle_input: Peer has closed connection\n");
+ DEBUG_LOG ("WorldSocket::handle_input: Peer has closed connection");
errno = ECONNRESET;
return -1;
@@ -296,7 +338,7 @@ int WorldSocket::handle_output (ACE_HANDLE)
const size_t send_len = m_OutBuffer->length ();
if (send_len == 0)
- return cancel_wakeup_output (Guard);
+ return handle_output_queue (Guard);
#ifdef MSG_NOSIGNAL
ssize_t n = peer ().send (m_OutBuffer->rd_ptr (), send_len, MSG_NOSIGNAL);
@@ -326,15 +368,73 @@ int WorldSocket::handle_output (ACE_HANDLE)
{
m_OutBuffer->reset ();
- if (!iFlushPacketQueue ())
- return cancel_wakeup_output (Guard);
- else
- return schedule_wakeup_output (Guard);
+ return handle_output_queue (Guard);
}
ACE_NOTREACHED (return 0);
}
+int WorldSocket::handle_output_queue (GuardType& g)
+{
+ if(msg_queue()->is_empty())
+ return cancel_wakeup_output(g);
+
+ ACE_Message_Block *mblk;
+
+ if(msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
+ {
+ sLog.outError("WorldSocket::handle_output_queue dequeue_head");
+ return -1;
+ }
+
+ const size_t send_len = mblk->length ();
+
+#ifdef MSG_NOSIGNAL
+ ssize_t n = peer ().send (mblk->rd_ptr (), send_len, MSG_NOSIGNAL);
+#else
+ ssize_t n = peer ().send (mblk->rd_ptr (), send_len);
+#endif // MSG_NOSIGNAL
+
+ if (n == 0)
+ {
+ mblk->release();
+
+ return -1;
+ }
+ else if (n == -1)
+ {
+ if (errno == EWOULDBLOCK || errno == EAGAIN)
+ {
+ msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero);
+ return schedule_wakeup_output (g);
+ }
+
+ mblk->release();
+ return -1;
+ }
+ else if (n < send_len) //now n > 0
+ {
+ mblk->rd_ptr (static_cast<size_t> (n));
+
+ if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1)
+ {
+ sLog.outError("WorldSocket::handle_output_queue enqueue_head");
+ mblk->release();
+ return -1;
+ }
+
+ return schedule_wakeup_output (g);
+ }
+ else //now n == send_len
+ {
+ mblk->release();
+
+ return msg_queue()->is_empty() ? cancel_wakeup_output(g) : ACE_Event_Handler::WRITE_MASK;
+ }
+
+ ACE_NOTREACHED(return -1);
+}
+
int WorldSocket::handle_close (ACE_HANDLE h, ACE_Reactor_Mask)
{
// Critical section
@@ -362,10 +462,15 @@ int WorldSocket::Update (void)
if (closing_)
return -1;
- if (m_OutActive || m_OutBuffer->length () == 0)
+ if (m_OutActive || (m_OutBuffer->length () == 0 && msg_queue()->is_empty()))
return 0;
- return handle_output (get_handle ());
+ int ret;
+ do
+ ret = handle_output (get_handle ());
+ while( ret > 0 );
+
+ return ret;
}
int WorldSocket::handle_input_header (void)
@@ -374,15 +479,14 @@ int WorldSocket::handle_input_header (void)
ACE_ASSERT (m_Header.length () == sizeof (ClientPktHeader));
- m_Crypt.DecryptRecv ((ACE_UINT8*) m_Header.rd_ptr (), sizeof (ClientPktHeader));
+ m_Crypt.DecryptRecv ((uint8*) m_Header.rd_ptr (), sizeof (ClientPktHeader));
ClientPktHeader& header = *((ClientPktHeader*) m_Header.rd_ptr ());
EndianConvertReverse(header.size);
EndianConvert(header.cmd);
- if ((header.size < 4) || (header.size > 10240) ||
- (header.cmd < 0) || (header.cmd > 10240) )
+ if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240))
{
sLog.outError ("WorldSocket::handle_input_header: client sent malformed packet size = %d , cmd = %d",
header.size, header.cmd);
@@ -574,7 +678,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
// Dump received packet.
if (sWorldLog.LogWorld ())
{
- sWorldLog.Log ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
+ sWorldLog.outLog ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
(uint32) get_handle (),
new_pct->size (),
LookupOpcodeName (new_pct->GetOpcode ()),
@@ -584,10 +688,10 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
while (p < new_pct->size ())
{
for (uint32 j = 0; j < 16 && p < new_pct->size (); j++)
- sWorldLog.Log ("%.2X ", (*new_pct)[p++]);
- sWorldLog.Log ("\n");
+ sWorldLog.outLog ("%.2X ", (*new_pct)[p++]);
+
+ sWorldLog.outLog ("");
}
- sWorldLog.Log ("\n\n");
}
// like one switch ;)
@@ -626,7 +730,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
}
else
{
- sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = ", opcode);
+ sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
return -1;
}
}
@@ -639,7 +743,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
// NOTE: ATM the socket is singlethread, have this in mind ...
uint8 digest[20];
uint32 clientSeed;
- uint32 unk2;
+ uint32 unk2, unk3;
uint32 BuiltNumberClient;
uint32 id, security;
//uint8 expansion = 0;
@@ -657,10 +761,21 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
return -1;
}
+ if(sWorld.IsClosed())
+ {
+ packet.Initialize(SMSG_AUTH_RESPONSE, 1);
+ packet << uint8(AUTH_REJECT);
+ SendPacket (packet);
+
+ sLog.outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", m_Session->GetRemoteAddress());
+ return -1;
+ }
+
// Read the content of the packet
recvPacket >> BuiltNumberClient; // for now no use
recvPacket >> unk2;
recvPacket >> account;
+ recvPacket >> unk3;
if (recvPacket.size () < (4 + 4 + (account.size () + 1) + 4 + 20))
{
@@ -684,17 +799,17 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
QueryResult *result =
LoginDatabase.PQuery ("SELECT "
- "id, " //0
- "gmlevel, " //1
- "sessionkey, " //2
- "last_ip, " //3
- "locked, " //4
- "sha_pass_hash, " //5
- "v, " //6
- "s, " //7
- "expansion, " //8
- "mutetime, " //9
- "locale " //10
+ "id, " //0
+ "gmlevel, " //1
+ "sessionkey, " //2
+ "last_ip, " //3
+ "locked, " //4
+ "sha_pass_hash, " //5
+ "v, " //6
+ "s, " //7
+ "expansion, " //8
+ "mutetime, " //9
+ "locale " //10
"FROM account "
"WHERE username = '%s'",
safe_account.c_str ());
@@ -788,6 +903,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
id = fields[0].GetUInt32 ();
security = fields[1].GetUInt16 ();
+ /*
+ if(security > SEC_ADMINISTRATOR) // prevent invalid security settings in DB
+ security = SEC_ADMINISTRATOR;
+ */
+
K.SetHexStr (fields[2].GetString ());
time_t mutetime = time_t (fields[9].GetUInt64 ());
@@ -880,15 +1000,14 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
m_Crypt.SetKey (&K);
m_Crypt.Init ();
+ m_Session->LoadAccountData();
+ m_Session->ReadAddonsInfo(recvPacket);
+
// In case needed sometime the second arg is in microseconds 1 000 000 = 1 sec
ACE_OS::sleep (ACE_Time_Value (0, 10000));
sWorld.AddSession (m_Session);
- // Create and send the Addon packet
- if (sAddOnHandler.BuildAddonPacket (&recvPacket, &SendAddonPacked))
- SendPacket (SendAddonPacked);
-
return 0;
}
@@ -961,25 +1080,19 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
return SendPacket (packet);
}
-int WorldSocket::iSendPacket (const WorldPacket& pct)
+/*int WorldSocket::iSendPacket (const WorldPacket& pct)
{
- if (m_OutBuffer->space () < pct.size () + sizeof (ServerPktHeader))
+ ServerPktHeader header(pct.size()+2, pct.GetOpcode());
+ if (m_OutBuffer->space () < pct.size () + header.getHeaderLength())
{
errno = ENOBUFS;
return -1;
}
- ServerPktHeader header;
- header.cmd = pct.GetOpcode ();
- EndianConvert(header.cmd);
-
- header.size = (uint16) pct.size () + 2;
- EndianConvertReverse(header.size);
+ m_Crypt.EncryptSend ( header.header, header.getHeaderLength());
- m_Crypt.EncryptSend ((uint8*) & header, sizeof (header));
-
- if (m_OutBuffer->copy ((char*) & header, sizeof (header)) == -1)
+ if (m_OutBuffer->copy ((char*) header.header, header.getHeaderLength()) == -1)
ACE_ASSERT (false);
if (!pct.empty ())
@@ -1015,5 +1128,5 @@ bool WorldSocket::iFlushPacketQueue ()
}
return haveone;
-}
+}*/
diff --git a/src/game/WorldSocket.h b/src/game/WorldSocket.h
index 7adf16373fe..67e15adf148 100644
--- a/src/game/WorldSocket.h
+++ b/src/game/WorldSocket.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -103,9 +103,6 @@ class WorldSocket : protected WorldHandler
typedef ACE_Thread_Mutex LockType;
typedef ACE_Guard<LockType> GuardType;
- /// Queue for storing packets for which there is no space.
- typedef ACE_Unbounded_Queue< WorldPacket* > PacketQueueT;
-
/// Check if socket is closed.
bool IsClosed (void) const;
@@ -161,6 +158,9 @@ class WorldSocket : protected WorldHandler
int cancel_wakeup_output (GuardType& g);
int schedule_wakeup_output (GuardType& g);
+ /// Drain the queue if its not empty.
+ int handle_output_queue (GuardType& g);
+
/// process one incoming packet.
/// @param new_pct received packet ,note that you need to delete it.
int ProcessIncoming (WorldPacket* new_pct);
@@ -171,16 +171,6 @@ class WorldSocket : protected WorldHandler
/// Called by ProcessIncoming() on CMSG_PING.
int HandlePing (WorldPacket& recvPacket);
- /// Try to write WorldPacket to m_OutBuffer ,return -1 if no space
- /// Need to be called with m_OutBufferLock lock held
- int iSendPacket (const WorldPacket& pct);
-
- /// Flush m_PacketQueue if there are packets in it
- /// Need to be called with m_OutBufferLock lock held
- /// @return true if it wrote to the buffer ( AKA you need
- /// to mark the socket for output ).
- bool iFlushPacketQueue ();
-
private:
/// Time in which the last ping was received
ACE_Time_Value m_LastPingTime;
@@ -220,10 +210,6 @@ class WorldSocket : protected WorldHandler
/// Size of the m_OutBuffer.
size_t m_OutBufferSize;
- /// Here are stored packets for which there was no space on m_OutBuffer,
- /// this allows not-to kick player if its buffer is overflowed.
- PacketQueueT m_PacketQueue;
-
/// True if the socket is registered with the reactor for output
bool m_OutActive;
diff --git a/src/game/WorldSocketMgr.cpp b/src/game/WorldSocketMgr.cpp
index e73b8993d0b..e8f8bad5894 100644
--- a/src/game/WorldSocketMgr.cpp
+++ b/src/game/WorldSocketMgr.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2005-2008,2007 MaNGOS <http://getmangos.com/>
*
-* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/game/WorldSocketMgr.h b/src/game/WorldSocketMgr.h
index f6e55614d46..94cfa78324c 100644
--- a/src/game/WorldSocketMgr.h
+++ b/src/game/WorldSocketMgr.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp
index 7cbb7f13648..0b2a3f64338 100644
--- a/src/shared/Auth/AuthCrypt.cpp
+++ b/src/shared/Auth/AuthCrypt.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,9 +50,8 @@ void AuthCrypt::DecryptRecv(uint8 *data, size_t len)
void AuthCrypt::EncryptSend(uint8 *data, size_t len)
{
if (!_initialized) return;
- if (len < CRYPTED_SEND_LEN) return;
- for (size_t t = 0; t < CRYPTED_SEND_LEN; t++)
+ for (size_t t = 0; t < len; t++)
{
_send_i %= _key.size();
uint8 x = (data[t] ^ _key[_send_i]) + _send_j;
@@ -67,7 +66,7 @@ void AuthCrypt::SetKey(BigNumber *bn)
GenerateKey(key, bn);
_key.resize(SHA_DIGEST_LENGTH);
std::copy(key, key + SHA_DIGEST_LENGTH, _key.begin());
- delete key;
+ delete[] key;
}
AuthCrypt::~AuthCrypt()
diff --git a/src/shared/Auth/AuthCrypt.h b/src/shared/Auth/AuthCrypt.h
index 020f8bcdc96..5c35511ad9f 100644
--- a/src/shared/Auth/AuthCrypt.h
+++ b/src/shared/Auth/AuthCrypt.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,7 +32,6 @@ class AuthCrypt
AuthCrypt();
~AuthCrypt();
- const static size_t CRYPTED_SEND_LEN = 4;
const static size_t CRYPTED_RECV_LEN = 6;
void Init();
diff --git a/src/shared/Auth/BigNumber.cpp b/src/shared/Auth/BigNumber.cpp
index da31da3a522..7872b141f3d 100644
--- a/src/shared/Auth/BigNumber.cpp
+++ b/src/shared/Auth/BigNumber.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/BigNumber.h b/src/shared/Auth/BigNumber.h
index df25e4f934d..b9038e86b13 100644
--- a/src/shared/Auth/BigNumber.h
+++ b/src/shared/Auth/BigNumber.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/Hmac.cpp
index 615edd26ca5..a8572f0e9f8 100644
--- a/src/shared/Auth/Hmac.cpp
+++ b/src/shared/Auth/Hmac.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/Hmac.h b/src/shared/Auth/Hmac.h
index 5b7c4040f13..fc80bdca4c4 100644
--- a/src/shared/Auth/Hmac.h
+++ b/src/shared/Auth/Hmac.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/Makefile.am b/src/shared/Auth/Makefile.am
new file mode 100644
index 00000000000..7398e2f2fa7
--- /dev/null
+++ b/src/shared/Auth/Makefile.am
@@ -0,0 +1,41 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosauth.a
+
+libmangosauth_a_SOURCES = \
+ AuthCrypt.cpp \
+ AuthCrypt.h \
+ BigNumber.cpp \
+ BigNumber.h \
+ Hmac.cpp \
+ Hmac.h \
+ Sha1.cpp \
+ Sha1.h \
+ md5.c \
+ md5.h
diff --git a/src/shared/Auth/Sha1.cpp b/src/shared/Auth/Sha1.cpp
index 90334543b82..8743a14b838 100644
--- a/src/shared/Auth/Sha1.cpp
+++ b/src/shared/Auth/Sha1.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Auth/Sha1.h b/src/shared/Auth/Sha1.h
index 6794d3bd103..68c61eb7a8e 100644
--- a/src/shared/Auth/Sha1.h
+++ b/src/shared/Auth/Sha1.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Base.cpp b/src/shared/Base.cpp
deleted file mode 100644
index ca5094810d6..00000000000
--- a/src/shared/Base.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Base class interface
- Copyright (C) 1998,1999 by Andrew Zabolotny
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "Base.h"
-
-Base::~Base ()
-{
-}
-
-/**
- * Decrement object's reference count; as soon as the last reference
- * to the object is removed, it is destroyed.
- */
-
-void Base::DecRef ()
-{
- if (!--RefCount)
- delete this;
-}
-
-/**
- * Object initialization. The initial reference count is set to one;
- * this means if you call DecRef() immediately after creating the object,
- * it will be destroyed.
- */
-Base::Base ()
-{
- RefCount = 1;
-}
-
-/**
- * Increment reference count.
- * Every time when you copy a pointer to a object and store it for
- * later use you MUST call IncRef() on it; this will allow to keep
- * objects as long as they are referenced by some entity.
- */
-void Base::IncRef ()
-{
- ++RefCount;
-
-}
-
-/**
- * Query number of references to this object.
- * I would rather prefer to have the reference counter strictly private,
- * but sometimes, mostly for debugging, such a function can help.
- */
-int Base::GetRefCount ()
-{
- return RefCount;
-}
-
diff --git a/src/shared/Base.h b/src/shared/Base.h
deleted file mode 100644
index e14ea6b27b9..00000000000
--- a/src/shared/Base.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Base class interface
- Copyright (C) 1998,1999 by Andrew Zabolotny
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef __BASE_H__
-#define __BASE_H__
-
-#include "Common.h"
-
-/**
- * This class is intended to be a base class for every other class.
- * It defines the basic interface available for any object.
- */
-class Base
-{
- private:
- /// Object reference count
- int RefCount;
-
- protected:
- /**
- * Destroy this object. Destructor is virtual, because class contains
- * virtual methods; also it is private because it is never intended
- * to be called directly; use DecRef() instead: when reference counter
- * reaches zero, the object will be destroyed.
- */
- virtual ~Base ();
-
- public:
-
- Base ();
-
- void IncRef ();
-
- void DecRef ();
- int GetRefCount ();
-
-};
-#endif // __BASE_H__
-
diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h
index fb2d7cfc7b9..16988632871 100644
--- a/src/shared/ByteBuffer.h
+++ b/src/shared/ByteBuffer.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -243,6 +243,32 @@ class ByteBuffer
_rpos += len;
}
+ bool readPackGUID(uint64& guid)
+ {
+ if(rpos()+1 > size())
+ return false;
+
+ guid = 0;
+
+ uint8 guidmark=0;
+ (*this) >> guidmark;
+
+ for(int i=0;i<8;i++)
+ {
+ if(guidmark & (uint8(1) << i))
+ {
+ if(rpos()+1 > size())
+ return false;
+
+ uint8 bit;
+ (*this) >> bit;
+ guid |= (uint64(bit) << (i*8));
+ }
+ }
+
+ return true;
+ }
+
const uint8 *contents() const { return &_storage[0]; }
size_t size() const { return _storage.size(); }
@@ -314,7 +340,7 @@ class ByteBuffer
if(!sLog.IsOutDebug()) // optimize disabled debug output
return;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
sLog.outDebugInLine("%u - ", read<uint8>(i) );
sLog.outDebug(" ");
@@ -325,7 +351,7 @@ class ByteBuffer
if(!sLog.IsOutDebug()) // optimize disabled debug output
return;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
sLog.outDebugInLine("%c", read<uint8>(i) );
sLog.outDebug(" ");
@@ -337,10 +363,7 @@ class ByteBuffer
return;
uint32 j = 1, k = 1;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
-
- if(sLog.IsIncludeTime())
- sLog.outDebugInLine(" ");
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
{
@@ -361,16 +384,12 @@ class ByteBuffer
if (read<uint8>(i) < 0x0F)
{
sLog.outDebugInLine("\n");
- if(sLog.IsIncludeTime())
- sLog.outDebugInLine(" ");
sLog.outDebugInLine("0%X ", read<uint8>(i) );
}
else
{
sLog.outDebugInLine("\n");
- if(sLog.IsIncludeTime())
- sLog.outDebugInLine(" ");
sLog.outDebugInLine("%X ", read<uint8>(i) );
}
@@ -396,7 +415,7 @@ class ByteBuffer
protected:
bool PrintPosError(bool add, size_t pos, size_t esize) const
{
- sLog.outError("ERROR: Attempt %s in ByteBuffer (pos: %u size: %u) value with size: %u",(add ? "put" : "get"),pos, size(), esize);
+ sLog.outError("ERROR: Attempt %s in ByteBuffer (pos: %lu size: %lu) value with size: %lu",(add ? "put" : "get"),(unsigned long)pos, (unsigned long)size(), (unsigned long)esize);
// assert must fail after function call
return false;
@@ -478,5 +497,13 @@ template <typename K, typename V> ByteBuffer &operator>>(ByteBuffer &b, std::map
}
return b;
}
+
+// TODO: Make a ByteBuffer.cpp and move all this inlining to it.
+template<> inline std::string ByteBuffer::read<std::string>()
+{
+ std::string tmp;
+ *this >> tmp;
+ return tmp;
+}
#endif
diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt
index 36d65544d3c..8ecfccad34f 100644
--- a/src/shared/CMakeLists.txt
+++ b/src/shared/CMakeLists.txt
@@ -6,16 +6,12 @@ add_subdirectory(Database)
########### next target ###############
SET(shared_STAT_SRCS
- Base.cpp
- Base.h
ByteBuffer.h
Common.cpp
Common.h
Errors.h
Log.cpp
Log.h
- Mthread.cpp
- Mthread.h
ProgressBar.cpp
ProgressBar.h
Timer.h
diff --git a/src/shared/Common.cpp b/src/shared/Common.cpp
index a31c88fdba5..27ae9184d69 100644
--- a/src/shared/Common.cpp
+++ b/src/shared/Common.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Common.h b/src/shared/Common.h
index 5e6a2cca520..abe804bb3a4 100644
--- a/src/shared/Common.h
+++ b/src/shared/Common.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,6 +80,8 @@
#pragma warning(disable:4305)
#pragma warning(disable:4005)
+
+#pragma warning(disable:4522)//warning when class has 2 constructosr
#endif // __SHOW_STUPID_WARNINGS__
#endif // __GNUC__
@@ -161,7 +163,9 @@ enum TimeConstants
MINUTE = 60,
HOUR = MINUTE*60,
DAY = HOUR*24,
- MONTH = DAY*30
+ MONTH = DAY*30,
+ YEAR = MONTH*12,
+ IN_MILISECONDS = 1000
};
enum AccountTypes
diff --git a/src/shared/Config/Config.cpp b/src/shared/Config/Config.cpp
index 4f9402b5f01..b56b804b50a 100644
--- a/src/shared/Config/Config.cpp
+++ b/src/shared/Config/Config.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,118 +60,48 @@ bool Config::Reload()
return true;
}
-bool Config::GetString(const char* name, std::string *value)
-{
- if(!mConf)
- return false;
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
- if(!node || !node->getValue())
- return false;
-
- *value = node->getValue();
-
- return true;
-}
-
-bool Config::GetString(const char* name, char const **value)
-{
- if(!mConf)
- return false;
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
- if(!node || !node->getValue())
- return false;
-
- *value = node->getValue();
-
- return true;
-}
-
-
-std::string Config::GetStringDefault(const char* name, const char* def)
+std::string Config::GetStringDefault(const char * name, std::string def)
{
if(!mConf)
return std::string(def);
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
+ const DOTCONFDocumentNode * node = mConf->findNode(name);
if(!node || !node->getValue())
return std::string(def);
-
return std::string(node->getValue());
-}
-
+};
-bool Config::GetBool(const char* name, bool *value)
+bool Config::GetBoolDefault(const char * name, const bool def)
{
if(!mConf)
return false;
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
+ const DOTCONFDocumentNode * node = mConf->findNode(name);
if(!node || !node->getValue())
- return false;
-
- const char* str = node->getValue();
+ return def;
+ const char * str = node->getValue();
if(strcmp(str, "true") == 0 || strcmp(str, "TRUE") == 0 ||
strcmp(str, "yes") == 0 || strcmp(str, "YES") == 0 ||
strcmp(str, "1") == 0)
- {
- *value = true;
- }
+ return true;
else
- *value = false;
-
- return true;
-}
-
-
-bool Config::GetBoolDefault(const char* name, const bool def)
-{
- bool val;
- return GetBool(name, &val) ? val : def;
-}
-
+ return false;
+};
-bool Config::GetInt(const char* name, int *value)
+int32 Config::GetIntDefault(const char * name, const int32 def)
{
if(!mConf)
- return false;
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
+ return def;
+ const DOTCONFDocumentNode * node = mConf->findNode(name);
if(!node || !node->getValue())
- return false;
-
- *value = atoi(node->getValue());
-
- return true;
-}
-
+ return def;
+ return atoi(node->getValue());
+};
-bool Config::GetFloat(const char* name, float *value)
+float Config::GetFloatDefault(const char * name, const float def)
{
if(!mConf)
- return false;
-
- DOTCONFDocumentNode const *node = mConf->findNode(name);
+ return def;
+ const DOTCONFDocumentNode * node = mConf->findNode(name);
if(!node || !node->getValue())
- return false;
-
- *value = atof(node->getValue());
-
- return true;
-}
-
-
-int Config::GetIntDefault(const char* name, const int def)
-{
- int val;
- return GetInt(name, &val) ? val : def;
-}
-
-
-float Config::GetFloatDefault(const char* name, const float def)
-{
- float val;
- return (GetFloat(name, &val) ? val : def);
-}
-
+ return def;
+ return atof(node->getValue());
+};
diff --git a/src/shared/Config/Config.h b/src/shared/Config/Config.h
index 4dbff1b1153..7070e6180c0 100644
--- a/src/shared/Config/Config.h
+++ b/src/shared/Config/Config.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,18 +35,10 @@ class TRINITY_DLL_SPEC Config
bool SetSource(const char *file, bool ignorecase = true);
bool Reload();
- bool GetString(const char* name, std::string *value);
- bool GetString(const char* name, char const **value);
- std::string GetStringDefault(const char* name, const char* def);
-
- bool GetBool(const char* name, bool *value);
- bool GetBoolDefault(const char* name, const bool def = false);
-
- bool GetInt(const char* name, int *value);
- int GetIntDefault(const char* name, const int def);
-
- bool GetFloat(const char* name, float *value);
- float GetFloatDefault(const char* name, const float def);
+ std::string GetStringDefault(const char * name, std::string def);
+ bool GetBoolDefault(const char * name, const bool def);
+ int32 GetIntDefault(const char * name, const int32 def);
+ float GetFloatDefault(const char * name, const float def);
std::string GetFilename() const { return mFilename; }
private:
diff --git a/src/shared/Config/ConfigEnv.h b/src/shared/Config/ConfigEnv.h
index eaa86c882df..75209a7fc6b 100644
--- a/src/shared/Config/ConfigEnv.h
+++ b/src/shared/Config/ConfigEnv.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Config/Makefile.am b/src/shared/Config/Makefile.am
new file mode 100644
index 00000000000..4854095b98c
--- /dev/null
+++ b/src/shared/Config/Makefile.am
@@ -0,0 +1,42 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosconfig.a
+
+libmangosconfig_a_SOURCES = \
+ dotconfpp/dotconfpp.cpp \
+ dotconfpp/dotconfpp.h \
+ dotconfpp/mempool.cpp \
+ dotconfpp/mempool.h \
+ Config.cpp \
+ Config.h \
+ ConfigEnv.h
+
+# VC++ project workspace for dotconfpp
+EXTRA_DIST = \
+ ConfigLibrary.vcproj
diff --git a/src/shared/Config/dotconfpp/dotconfpp.cpp b/src/shared/Config/dotconfpp/dotconfpp.cpp
index 3e2aa8683fe..edb85273742 100644
--- a/src/shared/Config/dotconfpp/dotconfpp.cpp
+++ b/src/shared/Config/dotconfpp/dotconfpp.cpp
@@ -55,13 +55,13 @@ DOTCONFDocument::DOTCONFDocument(DOTCONFDocument::CaseSensitive caseSensitivity)
DOTCONFDocument::~DOTCONFDocument()
{
- for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i != nodeTree.end(); i++){
+ for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i != nodeTree.end(); ++i){
delete(*i);
}
- for(std::list<char*>::iterator i = requiredOptions.begin(); i != requiredOptions.end(); i++){
+ for(std::list<char*>::iterator i = requiredOptions.begin(); i != requiredOptions.end(); ++i){
free(*i);
}
- for(std::list<char*>::iterator i = processedFiles.begin(); i != processedFiles.end(); i++){
+ for(std::list<char*>::iterator i = processedFiles.begin(); i != processedFiles.end(); ++i){
free(*i);
}
free(fileName);
@@ -138,7 +138,7 @@ int DOTCONFDocument::cleanupLine(char * line)
quoted = !quoted;
++line; continue;
}
- if(isspace(*line) && !quoted){
+ if(isspace((unsigned char)*line) && !quoted){
*bg++ = 0;
if(strlen(start)){
@@ -154,7 +154,7 @@ int DOTCONFDocument::cleanupLine(char * line)
words.push_back(word);
}
start = bg;
- while(isspace(*++line)) {}
+ while(isspace((unsigned char)*++line)) {}
continue;
}
@@ -177,7 +177,7 @@ int DOTCONFDocument::parseLine()
DOTCONFDocumentNode * tagNode = NULL;
bool newNode = false;
- for(std::list<char*>::iterator i = words.begin(); i != words.end(); i++) {
+ for(std::list<char*>::iterator i = words.begin(); i != words.end(); ++i) {
word = *i;
if(*word == '<'){
@@ -295,7 +295,7 @@ int DOTCONFDocument::checkConfig(const std::list<DOTCONFDocumentNode*>::iterator
DOTCONFDocumentNode * tagNode = NULL;
int vi = 0;
- for(std::list<DOTCONFDocumentNode*>::iterator i = from; i != nodeTree.end(); i++){
+ for(std::list<DOTCONFDocumentNode*>::iterator i = from; i != nodeTree.end(); ++i){
tagNode = *i;
if(!tagNode->closed){
error(tagNode->lineNum, tagNode->fileName, "unclosed tag %s", tagNode->name);
@@ -359,7 +359,7 @@ int DOTCONFDocument::setContent(const char * _fileName)
std::list<DOTCONFDocumentNode*>::iterator from;
DOTCONFDocumentNode * tagNode = NULL;
int vi = 0;
- for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); i++){
+ for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){
tagNode = *i;
if(!cmp_func("DOTCONFPPIncludeFile", tagNode->name)){
vi = 0;
@@ -374,7 +374,7 @@ int DOTCONFDocument::setContent(const char * _fileName)
}
bool processed = false;
- for(std::list<char*>::const_iterator itInode = processedFiles.begin(); itInode != processedFiles.end(); itInode++){
+ for(std::list<char*>::const_iterator itInode = processedFiles.begin(); itInode != processedFiles.end(); ++itInode){
if(!strcmp(*itInode, realpathBuf)){
processed = true;
break;
@@ -417,9 +417,9 @@ int DOTCONFDocument::setContent(const char * _fileName)
int DOTCONFDocument::checkRequiredOptions()
{
- for(std::list<char*>::const_iterator ci = requiredOptions.begin(); ci != requiredOptions.end(); ci++){
+ for(std::list<char*>::const_iterator ci = requiredOptions.begin(); ci != requiredOptions.end(); ++ci){
bool matched = false;
- for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); i++){
+ for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){
if(!cmp_func((*i)->name, *ci)){
matched = true;
break;
@@ -567,7 +567,7 @@ const DOTCONFDocumentNode * DOTCONFDocument::findNode(const char * nodeName, con
if( i != nodeTree.end() ) ++i;
}
- for(; i!=nodeTree.end(); i++){
+ for(; i!=nodeTree.end(); ++i){
if((*i)->parentNode != parentNode){
continue;
diff --git a/src/shared/Config/dotconfpp/mempool.cpp b/src/shared/Config/dotconfpp/mempool.cpp
index 487dae0bd0a..cec8e8d119f 100644
--- a/src/shared/Config/dotconfpp/mempool.cpp
+++ b/src/shared/Config/dotconfpp/mempool.cpp
@@ -22,7 +22,7 @@ AsyncDNSMemPool::AsyncDNSMemPool(size_t _defaultSize):
AsyncDNSMemPool::~AsyncDNSMemPool()
{
- for(size_t i = 0; i<chunksCount; i++){
+ for(size_t i = 0; i<chunksCount; ++i){
delete chunks[i];
}
::free(chunks);
@@ -53,7 +53,7 @@ void AsyncDNSMemPool::addNewChunk(size_t size)
void * AsyncDNSMemPool::alloc(size_t size)
{
PoolChunk * chunk = NULL;
- for(size_t i = 0; i<chunksCount; i++){
+ for(size_t i = 0; i<chunksCount; ++i){
chunk = chunks[i];
if((chunk->size - chunk->pos) >= size){
chunk->pos += size;
@@ -71,7 +71,7 @@ void AsyncDNSMemPool::free()
size_t psz = 0;
++poolUsageCounter;
- for(size_t i = 0; i<chunksCount; i++){
+ for(size_t i = 0; i<chunksCount; ++i){
pu += chunks[i]->pos;
psz += chunks[i]->size;
chunks[i]->pos = 0;
diff --git a/src/shared/Database/CMakeLists.txt b/src/shared/Database/CMakeLists.txt
index 78cc48436e7..617cc0fdb38 100644
--- a/src/shared/Database/CMakeLists.txt
+++ b/src/shared/Database/CMakeLists.txt
@@ -1,8 +1,7 @@
SET(trinitydatabase_STAT_SRCS
- DBCStores.cpp
- DBCStores.h
- DBCStructure.h
- DBCfmt.cpp
+ DBCFileLoader.cpp
+ DBCFileLoader.h
+ DBCStore.h
Database.cpp
Database.h
DatabaseEnv.h
@@ -30,8 +29,6 @@ SET(trinitydatabase_STAT_SRCS
SqlDelayThread.h
SqlOperations.cpp
SqlOperations.h
- dbcfile.cpp
- dbcfile.h
)
add_library(trinitydatabase STATIC ${trinitydatabase_STAT_SRCS})
diff --git a/src/shared/Database/DBCEnums.h b/src/shared/Database/DBCEnums.h
deleted file mode 100644
index d8699b2c240..00000000000
--- a/src/shared/Database/DBCEnums.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef DBCENUMS_H
-#define DBCENUMS_H
-
-// client supported max level for player/pets/etc. Avoid overflow or client stability affected.
-// also see GT_MAX_LEVEL define
-#define MAX_LEVEL 100
-
-// Server side limitation. Base at used code requirements.
-// also see MAX_LEVEL and GT_MAX_LEVEL define
-#define STRONG_MAX_LEVEL 255
-
-enum AreaTeams
-{
- AREATEAM_NONE = 0,
- AREATEAM_ALLY = 2,
- AREATEAM_HORDE = 4
-};
-
-enum AreaFlags
-{
- AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring)
- AREA_FLAG_UNK1 = 0x00000002, // unknown, (only Naxxramas and Razorfen Downs)
- AREA_FLAG_UNK2 = 0x00000004, // Only used on development map
- AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // slave capital city flag?
- AREA_FLAG_UNK3 = 0x00000010, // unknown
- AREA_FLAG_SLAVE_CAPITAL2 = 0x00000020, // slave capital city flag?
- AREA_FLAG_UNK4 = 0x00000040, // many zones have this flag
- AREA_FLAG_ARENA = 0x00000080, // arena, both instanced and world arenas
- AREA_FLAG_CAPITAL = 0x00000100, // main capital city flag
- AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?)
- AREA_FLAG_OUTLAND = 0x00000400, // outland zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag)
- AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled)
- AREA_FLAG_NEED_FLY = 0x00001000, // only Netherwing Ledge, Socrethar's Seat, Tempest Keep, The Arcatraz, The Botanica, The Mechanar, Sorrow Wing Point, Dragonspine Ridge, Netherwing Mines, Dragonmaw Base Camp, Dragonmaw Skyway
- AREA_FLAG_UNUSED1 = 0x00002000, // not used now (no area/zones with this flag set in 2.4.2)
- AREA_FLAG_OUTLAND2 = 0x00004000, // outland zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag)
- AREA_FLAG_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area)
- AREA_FLAG_ARENA_INSTANCE = 0x00010000, // used by instanced arenas only
- AREA_FLAG_UNUSED2 = 0x00020000, // not used now (no area/zones with this flag set in 2.4.2)
- AREA_FLAG_UNK5 = 0x00040000, // just used for Amani Pass, Hatchet Hills
- AREA_FLAG_LOWLEVEL = 0x00100000 // used for some starting areas with area_level <=15
-};
-
-enum FactionTemplateFlags
-{
- FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
-};
-
-enum FactionMasks
-{
- FACTION_MASK_PLAYER = 1, // any player
- FACTION_MASK_ALLIANCE = 2, // player or creature from alliance team
- FACTION_MASK_HORDE = 4, // player or creature from horde team
- FACTION_MASK_MONSTER = 8 // aggressive creature from monster team
- // if none flags set then non-aggressive creature
-};
-
-enum MapTypes
-{
- MAP_COMMON = 0,
- MAP_INSTANCE = 1,
- MAP_RAID = 2,
- MAP_BATTLEGROUND = 3,
- MAP_ARENA = 4
-};
-
-enum AbilytyLearnType
-{
- ABILITY_LEARNED_ON_GET_PROFESSION_SKILL = 1,
- ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL = 2
-};
-
-enum ItemEnchantmentType
-{
- ITEM_ENCHANTMENT_TYPE_NONE = 0,
- ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL = 1,
- ITEM_ENCHANTMENT_TYPE_DAMAGE = 2,
- ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL = 3,
- ITEM_ENCHANTMENT_TYPE_RESISTANCE = 4,
- ITEM_ENCHANTMENT_TYPE_STAT = 5,
- ITEM_ENCHANTMENT_TYPE_TOTEM = 6
-};
-
-enum TotemCategoryType
-{
- TOTEM_CATEGORY_TYPE_KNIFE = 1,
- TOTEM_CATEGORY_TYPE_TOTEM = 2,
- TOTEM_CATEGORY_TYPE_ROD = 3,
- TOTEM_CATEGORY_TYPE_PICK = 21,
- TOTEM_CATEGORY_TYPE_STONE = 22,
- TOTEM_CATEGORY_TYPE_HAMMER = 23,
- TOTEM_CATEGORY_TYPE_SPANNER = 24
-};
-
-#endif
-
diff --git a/src/shared/Database/dbcfile.cpp b/src/shared/Database/DBCFileLoader.cpp
index 9b363dbff8d..23f602f5c93 100644
--- a/src/shared/Database/dbcfile.cpp
+++ b/src/shared/Database/DBCFileLoader.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,15 +22,15 @@
#include <stdlib.h>
#include <string.h>
-#include "dbcfile.h"
+#include "DBCFileLoader.h"
-DBCFile::DBCFile()
+DBCFileLoader::DBCFileLoader()
{
data = NULL;
fieldsOffset = NULL;
}
-bool DBCFile::Load(const char *filename, const char *fmt)
+bool DBCFileLoader::Load(const char *filename, const char *fmt)
{
uint32 header;
@@ -39,23 +39,35 @@ bool DBCFile::Load(const char *filename, const char *fmt)
delete [] data;
data=NULL;
}
+
FILE * f=fopen(filename,"rb");
if(!f)return false;
- fread(&header,4,1,f); // Number of records
+ if(fread(&header,4,1,f)!=1) // Number of records
+ return false;
+
EndianConvert(header);
if(header!=0x43424457)
- {
- //printf("not dbc file");
return false; //'WDBC'
- }
- fread(&recordCount,4,1,f); // Number of records
+
+ if(fread(&recordCount,4,1,f)!=1) // Number of records
+ return false;
+
EndianConvert(recordCount);
- fread(&fieldCount,4,1,f); // Number of fields
+
+ if(fread(&fieldCount,4,1,f)!=1) // Number of fields
+ return false;
+
EndianConvert(fieldCount);
- fread(&recordSize,4,1,f); // Size of a record
+
+ if(fread(&recordSize,4,1,f)!=1) // Size of a record
+ return false;
+
EndianConvert(recordSize);
- fread(&stringSize,4,1,f); // String size
+
+ if(fread(&stringSize,4,1,f)!=1) // String size
+ return false;
+
EndianConvert(stringSize);
fieldsOffset = new uint32[fieldCount];
@@ -71,12 +83,15 @@ bool DBCFile::Load(const char *filename, const char *fmt)
data = new unsigned char[recordSize*recordCount+stringSize];
stringTable = data + recordSize*recordCount;
- fread(data,recordSize*recordCount+stringSize,1,f);
+
+ if(fread(data,recordSize*recordCount+stringSize,1,f)!=1)
+ return false;
+
fclose(f);
return true;
}
-DBCFile::~DBCFile()
+DBCFileLoader::~DBCFileLoader()
{
if(data)
delete [] data;
@@ -84,13 +99,13 @@ DBCFile::~DBCFile()
delete [] fieldsOffset;
}
-DBCFile::Record DBCFile::getRecord(size_t id)
+DBCFileLoader::Record DBCFileLoader::getRecord(size_t id)
{
assert(data);
return Record(*this, data + id*recordSize);
}
-uint32 DBCFile::GetFormatRecordSize(const char * format,int32* index_pos)
+uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos)
{
uint32 recordsize = 0;
int32 i = -1;
@@ -122,7 +137,7 @@ uint32 DBCFile::GetFormatRecordSize(const char * format,int32* index_pos)
return recordsize;
}
-char* DBCFile::AutoProduceData(const char* format, uint32& records, char**& indexTable)
+char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable)
{
/*
format STRING, NA, FLOAT,NA,INT <=>
@@ -205,7 +220,7 @@ char* DBCFile::AutoProduceData(const char* format, uint32& records, char**& inde
return dataTable;
}
-char* DBCFile::AutoProduceStrings(const char* format, char* dataTable)
+char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable)
{
if(strlen(format)!=fieldCount)
return NULL;
diff --git a/src/shared/Database/dbcfile.h b/src/shared/Database/DBCFileLoader.h
index aa36f6003dc..13562148dfc 100644
--- a/src/shared/Database/dbcfile.h
+++ b/src/shared/Database/DBCFileLoader.h
@@ -1,7 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
- *
- * Copyright (C) 2008 Trinity <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
@@ -18,8 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef DBCFILE_H
-#define DBCFILE_H
+#ifndef DBC_FILE_LOADER_H
+#define DBC_FILE_LOADER_H
#include "Platform/Define.h"
#include "Utilities/ByteConverter.h"
#include <cassert>
@@ -37,11 +35,11 @@ enum
FT_LOGIC='l' //Logical (boolean)
};
-class DBCFile
+class DBCFileLoader
{
public:
- DBCFile();
- ~DBCFile();
+ DBCFileLoader();
+ ~DBCFileLoader();
bool Load(const char *filename, const char *fmt);
@@ -77,11 +75,11 @@ class DBCFile
}
private:
- Record(DBCFile &file_, unsigned char *offset_): offset(offset_), file(file_) {}
+ Record(DBCFileLoader &file_, unsigned char *offset_): offset(offset_), file(file_) {}
unsigned char *offset;
- DBCFile &file;
+ DBCFileLoader &file;
- friend class DBCFile;
+ friend class DBCFileLoader;
};
@@ -107,4 +105,3 @@ class DBCFile
unsigned char *stringTable;
};
#endif
-
diff --git a/src/shared/Database/DBCStore.h b/src/shared/Database/DBCStore.h
new file mode 100644
index 00000000000..523d5c5a0b3
--- /dev/null
+++ b/src/shared/Database/DBCStore.h
@@ -0,0 +1,94 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DBCSTORE_H
+#define DBCSTORE_H
+
+#include "DBCFileLoader.h"
+
+template<class T>
+class DBCStorage
+{
+ typedef std::list<char*> StringPoolList;
+ public:
+ explicit DBCStorage(const char *f) : nCount(0), fieldCount(0), fmt(f), indexTable(NULL), m_dataTable(NULL) { }
+ ~DBCStorage() { Clear(); }
+
+ T const* LookupEntry(uint32 id) const { return (id>=nCount)?NULL:indexTable[id]; }
+ uint32 GetNumRows() const { return nCount; }
+ char const* GetFormat() const { return fmt; }
+ uint32 GetFieldCount() const { return fieldCount; }
+
+ bool Load(char const* fn)
+ {
+ DBCFileLoader dbc;
+ // Check if load was sucessful, only then continue
+ if(!dbc.Load(fn, fmt))
+ return false;
+
+ fieldCount = dbc.GetCols();
+ m_dataTable = (T*)dbc.AutoProduceData(fmt,nCount,(char**&)indexTable);
+ m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
+
+ // error in dbc file at loading if NULL
+ return indexTable!=NULL;
+ }
+
+ bool LoadStringsFrom(char const* fn)
+ {
+ // DBC must be already loaded using Load
+ if(!indexTable)
+ return false;
+
+ DBCFileLoader dbc;
+ // Check if load was successful, only then continue
+ if(!dbc.Load(fn, fmt))
+ return false;
+
+ m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable));
+
+ return true;
+ }
+
+ void Clear()
+ {
+ if (!indexTable)
+ return;
+
+ delete[] ((char*)indexTable);
+ indexTable = NULL;
+ delete[] ((char*)m_dataTable);
+ m_dataTable = NULL;
+
+ while(!m_stringPoolList.empty())
+ {
+ delete[] m_stringPoolList.front();
+ m_stringPoolList.pop_front();
+ }
+ nCount = 0;
+ }
+
+ private:
+ uint32 nCount;
+ uint32 fieldCount;
+ char const* fmt;
+ T** indexTable;
+ T* m_dataTable;
+ StringPoolList m_stringPoolList;
+};
+#endif
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
deleted file mode 100644
index 95703f9b778..00000000000
--- a/src/shared/Database/DBCStructure.h
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
- *
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef DBCSTRUCTURE_H
-#define DBCSTRUCTURE_H
-
-#include "DBCEnums.h"
-#include "Platform/Define.h"
-
-#include <map>
-#include <set>
-#include <vector>
-
-// Structures using to access raw DBC data and required packing to portability
-
-// 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 AreaTableEntry
-{
- uint32 ID; // 0
- uint32 mapid; // 1
- uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area
- uint32 exploreFlag; // 3, main index
- uint32 flags; // 4, unknown value but 312 for all cities
- // 5-9 unused
- int32 area_level; // 10
- char* area_name[16]; // 11-26
- // 27, string flags, unused
- uint32 team; // 28
-};
-
-struct AreaTriggerEntry
-{
- uint32 id; // 0
- uint32 mapid; // 1
- float x; // 2
- float y; // 3
- float z; // 4
- float radius; // 5
- float box_x; // 6 extent x edge
- float box_y; // 7 extent y edge
- float box_z; // 8 extent z edge
- float box_orientation; // 9 extent rotation by about z axis
-};
-
-struct AuctionHouseEntry
-{
- uint32 houseId; // 0 index
- uint32 faction; // 1 id of faction.dbc for player factions associated with city
- uint32 depositPercent; // 2 1/3 from real
- uint32 cutPercent; // 3
- //char* name[16]; // 4-19
- // 20 string flag, unused
-};
-
-struct BankBagSlotPricesEntry
-{
- uint32 ID;
- uint32 price;
-};
-
-struct BattlemasterListEntry
-{
- uint32 id; // 0
- uint32 mapid[3]; // 1-3 mapid
- // 4-8 unused
- uint32 type; // 9 (3 - BG, 4 - arena)
- uint32 minlvl; // 10
- uint32 maxlvl; // 11
- uint32 maxplayersperteam; // 12
- // 13-14 unused
- char* name[16]; // 15-30
- // 31 string flag, unused
- // 32 unused
-};
-
-#define MAX_OUTFIT_ITEMS 12
-// #define MAX_OUTFIT_ITEMS 24 // 12->24 in 3.0.x
-
-struct CharStartOutfitEntry
-{
- //uint32 Id; // 0
- uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
- int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13
- //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side
- //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side
- //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids)
- //uint32 Unknown2; // 39
- //uint32 Unknown3; // 40
-};
-
-struct CharTitlesEntry
-{
- uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
- //uint32 unk1; // 1 flags?
- //char* name[16]; // 2-17, unused
- // 18 string flag, unused
- //char* name2[16]; // 19-34, unused
- // 35 string flag, unused
- uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES
-};
-
-struct ChatChannelsEntry
-{
- uint32 ChannelID; // 0
- uint32 flags; // 1
- char* pattern[16]; // 3-18
- // 19 string flags, unused
- //char* name[16]; // 20-35 unused
- // 36 string flag, unused
-};
-
-struct ChrClassesEntry
-{
- uint32 ClassID; // 0
- // 1-2, unused
- uint32 powerType; // 3
- // 4, unused
- //char* name[16]; // 5-20 unused
- char* name[16]; // 5-20 unused
- // 21 string flag, unused
- //char* nameFemale[16]; // 21-36 unused, if different from base (male) case
- // 37 string flag, unused
- //char* nameNeutralGender[16]; // 38-53 unused, if different from base (male) case
- // 54 string flag, unused
- // 55, unused
- uint32 spellfamily; // 56
- // 57, unused
-};
-
-struct ChrRacesEntry
-{
- uint32 RaceID; // 0
- // 1 unused
- uint32 FactionID; // 2 facton template id
- // 3 unused
- uint32 model_m; // 4
- uint32 model_f; // 5
- // 6-7 unused
- uint32 TeamID; // 8 (7-Alliance 1-Horde)
- // 9-12 unused
- uint32 startmovie; // 13 id from CinematicCamera.dbc
- char* name[16]; // 14-29 used for DBC language detection/selection
- // 30 string flags, unused
- //char* nameFemale[16]; // 31-46, if different from base (male) case
- // 47 string flags, unused
- //char* nameNeutralGender[16]; // 48-63, if different from base (male) case
- // 64 string flags, unused
- // 65-67 unused
- uint32 addon; // 68 (0 - original race, 1 - tbc addon, ...)
-};
-
-struct CreatureDisplayInfoEntry
-{
- uint32 Displayid; // 0
- // 1-3,unused
- float scale; // 4
- // 5-13,unused
-};
-
-struct CreatureFamilyEntry
-{
- uint32 ID; // 0
- float minScale; // 1
- uint32 minScaleLevel; // 2 0/1
- float maxScale; // 3
- uint32 maxScaleLevel; // 4 0/60
- uint32 skillLine[2]; // 5-6
- uint32 petFoodMask; // 7
- char* Name[16]; // 8-23
- // 24 string flags, unused
- // 25 icon, unused
-};
-
-struct CreatureSpellDataEntry
-{
- uint32 ID; // 0
- //uint32 spellId[4]; // 1-4 hunter pet learned spell (for later use)
-};
-
-struct DurabilityCostsEntry
-{
- uint32 Itemlvl; // 0
- uint32 multiplier[29]; // 1-29
-};
-
-struct DurabilityQualityEntry
-{
- uint32 Id; // 0
- float quality_mod; // 1
-};
-
-struct EmotesTextEntry
-{
- uint32 Id;
- uint32 textid;
-};
-
-struct FactionEntry
-{
- uint32 ID; // 0
- int32 reputationListID; // 1
- uint32 BaseRepRaceMask[4]; // 2-5 Base reputation race masks (see enum Races)
- uint32 BaseRepClassMask[4]; // 6-9 Base reputation class masks (see enum Classes)
- int32 BaseRepValue[4]; // 10-13 Base reputation values
- uint32 ReputationFlags[4]; // 14-17 Default flags to apply
- uint32 team; // 18 enum Team
- char* name[16]; // 19-34
- // 35 string flags, unused
- //char* description[16]; // 36-51 unused
- // 52 string flags, unused
-};
-
-struct FactionTemplateEntry
-{
- uint32 ID; // 0
- uint32 faction; // 1
- uint32 factionFlags; // 2 specific flags for that faction
- uint32 ourMask; // 3 if mask set (see FactionMasks) then faction included in masked team
- uint32 friendlyMask; // 4 if mask set (see FactionMasks) then faction friendly to masked team
- uint32 hostileMask; // 5 if mask set (see FactionMasks) then faction hostile to masked team
- uint32 enemyFaction1; // 6
- uint32 enemyFaction2; // 7
- uint32 enemyFaction3; // 8
- uint32 enemyFaction4; // 9
- uint32 friendFaction1; // 10
- uint32 friendFaction2; // 11
- uint32 friendFaction3; // 12
- uint32 friendFaction4; // 13
- //------------------------------------------------------- end structure
-
- // helpers
- bool IsFriendlyTo(FactionTemplateEntry const& entry) const
- {
- if(ID == entry.ID)
- return true;
- if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction )
- return false;
- if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction )
- return true;
- return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
- }
- bool IsHostileTo(FactionTemplateEntry const& entry) const
- {
- if(ID == entry.ID)
- return false;
- if(enemyFaction1 == entry.faction || enemyFaction2 == entry.faction || enemyFaction3 == entry.faction || enemyFaction4 == entry.faction )
- return true;
- if(friendFaction1 == entry.faction || friendFaction2 == entry.faction || friendFaction3 == entry.faction || friendFaction4 == entry.faction )
- return false;
- return (hostileMask & entry.ourMask) != 0;
- }
- bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
- bool IsNeutralToAll() const { return hostileMask == 0 && friendlyMask == 0 && enemyFaction1==0 && enemyFaction2==0 && enemyFaction3==0 && enemyFaction4==0; }
- bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; }
-};
-
-struct GemPropertiesEntry
-{
- uint32 ID;
- uint32 spellitemenchantement;
- uint32 color;
-};
-
-// All Gt* DBC store data for 100 levels, some by 100 per class/race
-#define GT_MAX_LEVEL 100
-
-struct GtCombatRatingsEntry
-{
- float ratio;
-};
-
-struct GtChanceToMeleeCritBaseEntry
-{
- float base;
-};
-
-struct GtChanceToMeleeCritEntry
-{
- float ratio;
-};
-
-struct GtChanceToSpellCritBaseEntry
-{
- float base;
-};
-
-struct GtChanceToSpellCritEntry
-{
- float ratio;
-};
-
-struct GtOCTRegenHPEntry
-{
- float ratio;
-};
-
-//struct GtOCTRegenMPEntry
-//{
-// float ratio;
-//};
-
-struct GtRegenHPPerSptEntry
-{
- float ratio;
-};
-
-struct GtRegenMPPerSptEntry
-{
- float ratio;
-};
-
-struct ItemEntry
-{
- uint32 ID;
- uint32 DisplayId;
- uint32 InventoryType;
- uint32 Sheath;
-};
-
-struct ItemDisplayInfoEntry
-{
- uint32 ID;
- uint32 randomPropertyChance;
-};
-
-//struct ItemCondExtCostsEntry
-//{
-// uint32 ID;
-// uint32 condExtendedCost; // ItemPrototype::CondExtendedCost
-// uint32 itemextendedcostentry; // ItemPrototype::ExtendedCost
-// uint32 arenaseason; // arena season number(1-4)
-//};
-
-struct ItemExtendedCostEntry
-{
- uint32 ID; // 0 extended-cost entry id
- uint32 reqhonorpoints; // 1 required honor points
- uint32 reqarenapoints; // 2 required arena points
- uint32 reqitem[5]; // 3-7 required item id
- uint32 reqitemcount[5]; // 8-12 required count of 1st item
- uint32 reqpersonalarenarating; // 13 required personal arena rating
-};
-
-struct ItemRandomPropertiesEntry
-{
- uint32 ID; // 0
- //char* internalName // 1 unused
- uint32 enchant_id[3]; // 2-4
- // 5-6 unused, 0 only values, reserved for additional enchantments?
- //char* nameSuffix[16] // 7-22, unused
- // 23 nameSufix flags, unused
-};
-
-struct ItemRandomSuffixEntry
-{
- uint32 ID; // 0
- //char* name[16] // 1-16 unused
- // 17, name flags, unused
- // 18 unused
- uint32 enchant_id[3]; // 19-21
- uint32 prefix[3]; // 22-24
-};
-
-struct ItemSetEntry
-{
- //uint32 id // 0 item set ID
- char* name[16]; // 1-16
- // 17 string flags, unused
- // 18-28 items from set, but not have all items listed, use ItemPrototype::ItemSet instead
- // 29-34 unused
- uint32 spells[8]; // 35-42
- uint32 items_to_triggerspell[8]; // 43-50
- uint32 required_skill_id; // 51
- uint32 required_skill_value; // 52
-};
-
-struct LockEntry
-{
- uint32 ID; // 0
- uint32 keytype[5]; // 1-5
- // 6-8, not used
- uint32 key[5]; // 9-13
- // 14-16, not used
- uint32 requiredminingskill; // 17
- uint32 requiredlockskill; // 18
- // 19-32, not used
-};
-
-struct MailTemplateEntry
-{
- uint32 ID; // 0
- //char* subject[16]; // 1-16
- // 17 name flags, unused
- //char* content[16]; // 18-33
-};
-
-struct MapEntry
-{
- uint32 MapID; // 0
- //char* internalname; // 1 unused
- uint32 map_type; // 2
- // 3 unused
- char* name[16]; // 4-19
- // 20 name flags, unused
- // 21-23 unused (something PvPZone related - levels?)
- // 24-26
- uint32 linked_zone; // 27 common zone for instance and continent map
- //char* hordeIntro // 28-43 text for PvP Zones
- // 44 intro text flags
- //char* allianceIntro // 45-60 text for PvP Zones
- // 46 intro text flags
- // 47-61 not used
- uint32 multimap_id; // 62
- // 63-65 not used
- //chat* unknownText1 // 66-81 unknown empty text fields, possible normal Intro text.
- // 82 text flags
- //chat* heroicIntroText // 83-98 heroic mode requirement text
- // 99 text flags
- //chat* unknownText2 // 100-115 unknown empty text fields
- // 116 text flags
- int32 entrance_map; // 117 map_id of entrance map
- float entrance_x; // 118 entrance x coordinate (if exist single entry)
- float entrance_y; // 119 entrance y coordinate (if exist single entry)
- uint32 resetTimeRaid; // 120
- uint32 resetTimeHeroic; // 121
- // 122-123
- uint32 addon; // 124 (0-original maps,1-tbc addon)
-
- // Helpers
- uint32 Expansion() const { return addon; }
-
-
- bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; }
- bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
- bool IsRaid() const { return map_type == MAP_RAID; }
- bool IsBattleGround() const { return map_type == MAP_BATTLEGROUND; }
- bool IsBattleArena() const { return map_type == MAP_ARENA; }
- bool IsBattleGroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
- bool SupportsHeroicMode() const { return resetTimeHeroic && !resetTimeRaid; }
- bool HasResetTime() const { return resetTimeHeroic || resetTimeRaid; }
-
- bool IsMountAllowed() const
- {
- return !IsDungeon() ||
- MapID==568 || MapID==309 || MapID==209 || MapID==534 ||
- MapID==560 || MapID==509 || MapID==269;
- }
-};
-
-struct QuestSortEntry
-{
- uint32 id; // 0, sort id
- //char* name[16]; // 1-16, unused
- // 17 name flags, unused
-};
-
-struct RandomPropertiesPointsEntry
-{
- //uint32 Id; // 0 hidden key
- uint32 itemLevel; // 1
- uint32 EpicPropertiesPoints[5]; // 2-6
- uint32 RarePropertiesPoints[5]; // 7-11
- uint32 UncommonPropertiesPoints[5]; // 12-16
-};
-
-//struct SkillLineCategoryEntry{
-// uint32 id; // 0 hidden key
-// char* name[16]; // 1 - 17 Category name
-// // 18 string flag
-// uint32 displayOrder; // Display order in character tab
-//};
-
-//struct SkillRaceClassInfoEntry{
-// uint32 id; // 0
-// uint32 skillId; // 1 present some refrences to unknown skill
-// uint32 raceMask; // 2
-// uint32 classMask; // 3
-// uint32 flags; // 4 mask for some thing
-// uint32 reqLevel; // 5
-// uint32 skillTierId; // 6
-// uint32 skillCostID; // 7
-//};
-
-//struct SkillTiersEntry{
-// uint32 id; // 0
-// uint32 skillValue[16]; // 1-17 unknown possibly add value on learn?
-// uint32 maxSkillValue[16]; // Max value for rank
-//};
-
-struct SkillLineEntry
-{
- uint32 id; // 0
- uint32 categoryId; // 1 (index from SkillLineCategory.dbc)
- //uint32 skillCostID; // 2 not used
- char* name[16]; // 3-18
- // 19 string flags, not used
- //char* description[16]; // 20-35, not used
- // 36 string flags, not used
- uint32 spellIcon; // 37
-};
-
-struct SkillLineAbilityEntry
-{
- uint32 id; // 0, INDEX
- uint32 skillId; // 1
- uint32 spellId; // 2
- uint32 racemask; // 3
- uint32 classmask; // 4
- //uint32 racemaskNot; // 5 always 0 in 2.4.2
- //uint32 classmaskNot; // 6 always 0 in 2.4.2
- uint32 req_skill_value; // 7 for trade skill.not for training.
- uint32 forward_spellid; // 8
- uint32 learnOnGetSkill; // 9 can be 1 or 2 for spells learned on get skill
- uint32 max_value; // 10
- uint32 min_value; // 11
- // 12-13, unknown, always 0
- uint32 reqtrainpoints; // 14
-};
-
-struct SoundEntriesEntry
-{
- uint32 Id; // 0, sound id
- //uint32 Type; // 1, sound type (10 generally for creature, etc)
- //char* InternalName; // 2, internal name, for use in lookup command for example
- //char* FileName[10]; // 3-12, file names
- //uint32 Unk13[10]; // 13-22, linked with file names?
- //char* Path; // 23
- // 24-28, unknown
-};
-
-struct SpellEntry
-{
- uint32 Id; // 0 normally counted from 0 field (but some tools start counting from 1, check this before tool use for data view!)
- uint32 Category; // 1
- //uint32 castUI // 2 not used
- uint32 Dispel; // 3
- uint32 Mechanic; // 4
- uint32 Attributes; // 5
- uint32 AttributesEx; // 6
- uint32 AttributesEx2; // 7
- uint32 AttributesEx3; // 8
- uint32 AttributesEx4; // 9
- uint32 AttributesEx5; // 10
- //uint32 AttributesEx6; // 11 not used
- uint32 Stances; // 12
- uint32 StancesNot; // 13
- uint32 Targets; // 14
- uint32 TargetCreatureType; // 15
- uint32 RequiresSpellFocus; // 16
- uint32 FacingCasterFlags; // 17
- uint32 CasterAuraState; // 18
- uint32 TargetAuraState; // 19
- uint32 CasterAuraStateNot; // 20
- uint32 TargetAuraStateNot; // 21
- uint32 CastingTimeIndex; // 22
- uint32 RecoveryTime; // 23
- uint32 CategoryRecoveryTime; // 24
- uint32 InterruptFlags; // 25
- uint32 AuraInterruptFlags; // 26
- uint32 ChannelInterruptFlags; // 27
- uint32 procFlags; // 28
- uint32 procChance; // 29
- uint32 procCharges; // 30
- uint32 maxLevel; // 31
- uint32 baseLevel; // 32
- uint32 spellLevel; // 33
- uint32 DurationIndex; // 34
- uint32 powerType; // 35
- uint32 manaCost; // 36
- uint32 manaCostPerlevel; // 37
- uint32 manaPerSecond; // 38
- uint32 manaPerSecondPerLevel; // 39
- uint32 rangeIndex; // 40
- float speed; // 41
- //uint32 modalNextSpell; // 42
- uint32 StackAmount; // 43
- uint32 Totem[2]; // 44-45
- int32 Reagent[8]; // 46-53
- uint32 ReagentCount[8]; // 54-61
- int32 EquippedItemClass; // 62 (value)
- int32 EquippedItemSubClassMask; // 63 (mask)
- int32 EquippedItemInventoryTypeMask; // 64 (mask)
- uint32 Effect[3]; // 65-67
- int32 EffectDieSides[3]; // 68-70
- uint32 EffectBaseDice[3]; // 71-73
- float EffectDicePerLevel[3]; // 74-76
- float EffectRealPointsPerLevel[3]; // 77-79
- int32 EffectBasePoints[3]; // 80-82 (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
- uint32 EffectMechanic[3]; // 83-85
- uint32 EffectImplicitTargetA[3]; // 86-88
- uint32 EffectImplicitTargetB[3]; // 89-91
- uint32 EffectRadiusIndex[3]; // 92-94 - spellradius.dbc
- uint32 EffectApplyAuraName[3]; // 95-97
- uint32 EffectAmplitude[3]; // 98-100
- float EffectMultipleValue[3]; // 101-103
- uint32 EffectChainTarget[3]; // 104-106
- uint32 EffectItemType[3]; // 107-109
- int32 EffectMiscValue[3]; // 110-112
- int32 EffectMiscValueB[3]; // 113-115
- uint32 EffectTriggerSpell[3]; // 116-118
- float EffectPointsPerComboPoint[3]; // 119-121
- uint32 SpellVisual; // 122
- // 123 not used
- uint32 SpellIconID; // 124
- uint32 activeIconID; // 125
- //uint32 spellPriority; // 126
- char* SpellName[16]; // 127-142
- //uint32 SpellNameFlag; // 143
- char* Rank[16]; // 144-159
- //uint32 RankFlags; // 160
- //char* Description[16]; // 161-176 not used
- //uint32 DescriptionFlags; // 177 not used
- //char* ToolTip[16]; // 178-193 not used
- //uint32 ToolTipFlags; // 194 not used
- uint32 ManaCostPercentage; // 195
- uint32 StartRecoveryCategory; // 196
- uint32 StartRecoveryTime; // 197
- uint32 MaxTargetLevel; // 198
- uint32 SpellFamilyName; // 199
- uint64 SpellFamilyFlags; // 200+201
- uint32 MaxAffectedTargets; // 202
- uint32 DmgClass; // 203 defenseType
- uint32 PreventionType; // 204
- //uint32 StanceBarOrder; // 205 not used
- float DmgMultiplier[3]; // 206-208
- //uint32 MinFactionId; // 209 not used, and 0 in 2.4.2
- //uint32 MinReputation; // 210 not used, and 0 in 2.4.2
- //uint32 RequiredAuraVision; // 211 not used
- uint32 TotemCategory[2]; // 212-213
- uint32 AreaId; // 214
- uint32 SchoolMask; // 215 school mask
-
- private:
- // prevent creating custom entries (copy data from original in fact)
- SpellEntry(SpellEntry const&); // DON'T must have implementation
-};
-
-typedef std::set<uint32> SpellCategorySet;
-typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
-typedef std::set<uint32> PetFamilySpellsSet;
-typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
-
-struct SpellCastTimesEntry
-{
- uint32 ID; // 0
- int32 CastTime; // 1
- //float CastTimePerLevel; // 2 unsure / per skill?
- //int32 MinCastTime; // 3 unsure
-};
-
-struct SpellFocusObjectEntry
-{
- uint32 ID; // 0
- //char* Name[16]; // 1-15 unused
- // 16 string flags, unused
-};
-
-// stored in SQL table
-struct SpellThreatEntry
-{
- uint32 spellId;
- int32 threat;
-};
-
-struct SpellRadiusEntry
-{
- uint32 ID;
- float Radius;
- float Radius2;
-};
-
-struct SpellRangeEntry
-{
- uint32 ID;
- float minRange;
- float maxRange;
- uint32 type;
-};
-
-struct SpellShapeshiftEntry
-{
- uint32 ID; // 0
- //uint32 buttonPosition; // 1 unused
- //char* Name[16]; // 2-17 unused
- //uint32 NameFlags; // 18 unused
- uint32 flags1; // 19
- int32 creatureType; // 20 <=0 humanoid, other normal creature types
- //uint32 unk1; // 21 unused
- uint32 attackSpeed; // 22
- //uint32 modelID; // 23 unused, alliance modelid (where horde case?)
- //uint32 unk2; // 24 unused
- //uint32 unk3; // 25 unused
- //uint32 unk4; // 26 unused
- //uint32 unk5; // 27 unused
- //uint32 unk6; // 28 unused
- //uint32 unk7; // 29 unused
- //uint32 unk8; // 30 unused
- //uint32 unk9; // 31 unused
- //uint32 unk10; // 32 unused
- //uint32 unk11; // 33 unused
- //uint32 unk12; // 34 unused
-};
-
-struct SpellDurationEntry
-{
- uint32 ID;
- int32 Duration[3];
-};
-
-struct SpellItemEnchantmentEntry
-{
- uint32 ID; // 0
- uint32 type[3]; // 1-3
- uint32 amount[3]; // 4-6
- //uint32 amount2[3] // 7-9 always same as similar `amount` value
- uint32 spellid[3]; // 10-12
- char* description[16]; // 13-29
- // 30 description flags
- uint32 aura_id; // 31
- uint32 slot; // 32
- uint32 GemID; // 33
- uint32 EnchantmentCondition; // 34
-};
-
-struct SpellItemEnchantmentConditionEntry
-{
- uint32 ID;
- uint8 Color[5];
- uint8 Comparator[5];
- uint8 CompareColor[5];
- uint32 Value[5];
-};
-
-struct StableSlotPricesEntry
-{
- uint32 Slot;
- uint32 Price;
-};
-
-struct TalentEntry
-{
- uint32 TalentID; // 0
- uint32 TalentTab; // 1 index in TalentTab.dbc (TalentTabEntry)
- uint32 Row; // 2
- uint32 Col; // 3
- uint32 RankID[5]; // 4-8
- // 9-12 not used, always 0, maybe not used high ranks
- uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry)
- // 14-15 not used
- uint32 DependsOnRank; // 16
- // 17-19 not used
- uint32 DependsOnSpell; // 20 req.spell
-};
-
-struct TalentTabEntry
-{
- uint32 TalentTabID; // 0
- //char* name[16]; // 1-16, unused
- //uint32 nameFlags; // 17, unused
- //unit32 spellicon; // 18
- // 19 not used
- uint32 ClassMask; // 20
- uint32 tabpage; // 21
- //char* internalname; // 22
-};
-
-struct TaxiNodesEntry
-{
- uint32 ID; // 0
- uint32 map_id; // 1
- float x; // 2
- float y; // 3
- float z; // 4
- //char* name[16]; // 5-21
- // 22 string flags, unused
- uint32 horde_mount_type; // 23
- uint32 alliance_mount_type; // 24
-};
-
-struct TaxiPathEntry
-{
- uint32 ID;
- uint32 from;
- uint32 to;
- uint32 price;
-};
-
-struct TaxiPathNodeEntry
-{
- uint32 path;
- uint32 index;
- uint32 mapid;
- float x;
- float y;
- float z;
- uint32 actionFlag;
- uint32 delay;
-};
-
-struct TotemCategoryEntry
-{
- uint32 ID; // 0
- //char* name[16]; // 1-16
- // 17 string flags, unused
- uint32 categoryType; // 18 (one for specialization)
- uint32 categoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods)
-};
-
-struct WorldMapAreaEntry
-{
- //uint32 ID; // 0
- uint32 map_id; // 1
- uint32 area_id; // 2 index (continent 0 areas ignored)
- //char* internal_name // 3
- float y1; // 4
- float y2; // 5
- float x1; // 6
- float x2; // 7
- int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
-};
-
-struct WorldSafeLocsEntry
-{
- uint32 ID; // 0
- uint32 map_id; // 1
- float x; // 2
- float y; // 3
- float z; // 4
- //char* name[16] // 5-20 name, unused
- // 21 name flags, unused
-};
-
-// 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
-
-// Structures not used for casting to loaded DBC data and not required then packing
-struct TalentSpellPos
-{
- TalentSpellPos() : talent_id(0), rank(0) {}
- TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
-
- uint16 talent_id;
- uint8 rank;
-};
-
-typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap;
-
-struct TaxiPathBySourceAndDestination
-{
- TaxiPathBySourceAndDestination() : ID(0),price(0) {}
- TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {}
-
- uint32 ID;
- uint32 price;
-};
-typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource;
-typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource;
-
-struct TaxiPathNode
-{
- TaxiPathNode() : mapid(0), x(0),y(0),z(0),actionFlag(0),delay(0) {}
- TaxiPathNode(uint32 _mapid, float _x, float _y, float _z, uint32 _actionFlag, uint32 _delay) : mapid(_mapid), x(_x),y(_y),z(_z),actionFlag(_actionFlag),delay(_delay) {}
-
- uint32 mapid;
- float x;
- float y;
- float z;
- uint32 actionFlag;
- uint32 delay;
-};
-typedef std::vector<TaxiPathNode> TaxiPathNodeList;
-typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
-
-#define TaxiMaskSize 16
-typedef uint32 TaxiMask[TaxiMaskSize];
-#endif
-
diff --git a/src/shared/Database/Database.cpp b/src/shared/Database/Database.cpp
index 7110fe44c54..07ece3b0cd9 100644
--- a/src/shared/Database/Database.cpp
+++ b/src/shared/Database/Database.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/Database.h b/src/shared/Database/Database.h
index c2ee9349979..92a1c991dcc 100644
--- a/src/shared/Database/Database.h
+++ b/src/shared/Database/Database.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ class SqlQueryHolder;
typedef UNORDERED_MAP<ZThread::ThreadImpl*, SqlTransaction*> TransactionQueues;
typedef UNORDERED_MAP<ZThread::ThreadImpl*, SqlResultQueue*> QueryQueues;
-#define MAX_QUERY_LEN 1024
+#define MAX_QUERY_LEN 32*1024
class TRINITY_DLL_SPEC Database
{
diff --git a/src/shared/Database/DatabaseEnv.h b/src/shared/Database/DatabaseEnv.h
index 664459473af..c915538276c 100644
--- a/src/shared/Database/DatabaseEnv.h
+++ b/src/shared/Database/DatabaseEnv.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
#include "Log.h"
#include "Errors.h"
-#include "Database/DBCStores.h"
#include "Database/Field.h"
#include "Database/QueryResult.h"
diff --git a/src/shared/Database/DatabaseImpl.h b/src/shared/Database/DatabaseImpl.h
index 5ab4ec04a65..3d3c53f0873 100644
--- a/src/shared/Database/DatabaseImpl.h
+++ b/src/shared/Database/DatabaseImpl.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/DatabaseMysql.cpp b/src/shared/Database/DatabaseMysql.cpp
index 77a59a69c57..5dc02c0a738 100644
--- a/src/shared/Database/DatabaseMysql.cpp
+++ b/src/shared/Database/DatabaseMysql.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/DatabaseMysql.h b/src/shared/Database/DatabaseMysql.h
index 1826a08f2aa..2fa157e75a5 100644
--- a/src/shared/Database/DatabaseMysql.h
+++ b/src/shared/Database/DatabaseMysql.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/DatabasePostgre.cpp b/src/shared/Database/DatabasePostgre.cpp
index 25b5a58b863..79e1c87f5e3 100644
--- a/src/shared/Database/DatabasePostgre.cpp
+++ b/src/shared/Database/DatabasePostgre.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -79,14 +79,14 @@ bool DatabasePostgre::Initialize(const char *infoString)
Tokens::iterator iter;
- std::string host, port_or_socket, user, password, database;
+ std::string host, port_or_socket_dir, user, password, database;
iter = tokens.begin();
if(iter != tokens.end())
host = *iter++;
if(iter != tokens.end())
- port_or_socket = *iter++;
+ port_or_socket_dir = *iter++;
if(iter != tokens.end())
user = *iter++;
if(iter != tokens.end())
@@ -94,7 +94,10 @@ bool DatabasePostgre::Initialize(const char *infoString)
if(iter != tokens.end())
database = *iter++;
- mPGconn = PQsetdbLogin(host.c_str(), port_or_socket.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
+ if (host == ".")
+ mPGconn = PQsetdbLogin(NULL, port_or_socket_dir == "." ? NULL : port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
+ else
+ mPGconn = PQsetdbLogin(host.c_str(), port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
/* check to see that the backend connection was successfully made */
if (PQstatus(mPGconn) != CONNECTION_OK)
diff --git a/src/shared/Database/DatabasePostgre.h b/src/shared/Database/DatabasePostgre.h
index 6dc0c509869..c7242add572 100644
--- a/src/shared/Database/DatabasePostgre.h
+++ b/src/shared/Database/DatabasePostgre.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/DatabaseSqlite.cpp b/src/shared/Database/DatabaseSqlite.cpp
index a7a4a2a9847..b5def933723 100644
--- a/src/shared/Database/DatabaseSqlite.cpp
+++ b/src/shared/Database/DatabaseSqlite.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/DatabaseSqlite.h b/src/shared/Database/DatabaseSqlite.h
index 32d49d0124b..c84b59eea80 100644
--- a/src/shared/Database/DatabaseSqlite.h
+++ b/src/shared/Database/DatabaseSqlite.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/Field.cpp b/src/shared/Database/Field.cpp
index a7817d9a630..9a1fbfa5178 100644
--- a/src/shared/Database/Field.cpp
+++ b/src/shared/Database/Field.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/Field.h b/src/shared/Database/Field.h
index 3e5f26376bb..da6a865c6f2 100644
--- a/src/shared/Database/Field.h
+++ b/src/shared/Database/Field.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/Makefile.am b/src/shared/Database/Makefile.am
new file mode 100644
index 00000000000..6092bdc0e8e
--- /dev/null
+++ b/src/shared/Database/Makefile.am
@@ -0,0 +1,63 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosdatabase.a
+
+libmangosdatabase_a_SOURCES = \
+ DBCFileLoader.cpp \
+ DBCFileLoader.h \
+ DBCStore.h \
+ Database.cpp \
+ Database.h \
+ DatabaseEnv.h \
+ DatabaseImpl.h \
+ DatabaseMysql.cpp \
+ DatabasePostgre.cpp \
+ DatabaseMysql.h \
+ DatabasePostgre.h \
+ DatabaseSqlite.cpp \
+ DatabaseSqlite.h \
+ DBCEnums.h \
+ Field.cpp \
+ Field.h \
+ MySQLDelayThread.h \
+ PGSQLDelayThread.h \
+ QueryResult.h \
+ QueryResultMysql.cpp \
+ QueryResultMysql.h \
+ QueryResultPostgre.cpp \
+ QueryResultPostgre.h \
+ QueryResultSqlite.cpp \
+ QueryResultSqlite.h \
+ SQLStorage.cpp \
+ SQLStorage.h \
+ SQLStorageImpl.h \
+ SqlDelayThread.cpp \
+ SqlDelayThread.h \
+ SqlOperations.cpp \
+ SqlOperations.h
diff --git a/src/shared/Database/MySQLDelayThread.h b/src/shared/Database/MySQLDelayThread.h
index 14cf1a64617..fcebe3fbd35 100644
--- a/src/shared/Database/MySQLDelayThread.h
+++ b/src/shared/Database/MySQLDelayThread.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/PGSQLDelayThread.h b/src/shared/Database/PGSQLDelayThread.h
index 19941464cca..8d219bd9c1e 100644
--- a/src/shared/Database/PGSQLDelayThread.h
+++ b/src/shared/Database/PGSQLDelayThread.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResult.h b/src/shared/Database/QueryResult.h
index 32e47c0959f..01da45ed281 100644
--- a/src/shared/Database/QueryResult.h
+++ b/src/shared/Database/QueryResult.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultMysql.cpp b/src/shared/Database/QueryResultMysql.cpp
index d995b9f2473..5bc11ae308f 100644
--- a/src/shared/Database/QueryResultMysql.cpp
+++ b/src/shared/Database/QueryResultMysql.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultMysql.h b/src/shared/Database/QueryResultMysql.h
index 3131bd4bbe4..06b1353c12e 100644
--- a/src/shared/Database/QueryResultMysql.h
+++ b/src/shared/Database/QueryResultMysql.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultPostgre.cpp b/src/shared/Database/QueryResultPostgre.cpp
index def1b0061e5..500ca053885 100644
--- a/src/shared/Database/QueryResultPostgre.cpp
+++ b/src/shared/Database/QueryResultPostgre.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultPostgre.h b/src/shared/Database/QueryResultPostgre.h
index 61311728f2d..30d69114dc6 100644
--- a/src/shared/Database/QueryResultPostgre.h
+++ b/src/shared/Database/QueryResultPostgre.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultSqlite.cpp b/src/shared/Database/QueryResultSqlite.cpp
index a041232f600..06a02d1db59 100644
--- a/src/shared/Database/QueryResultSqlite.cpp
+++ b/src/shared/Database/QueryResultSqlite.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/QueryResultSqlite.h b/src/shared/Database/QueryResultSqlite.h
index b2622f96707..5dc3287b385 100644
--- a/src/shared/Database/QueryResultSqlite.h
+++ b/src/shared/Database/QueryResultSqlite.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp
index 0eeefbf10ca..8561afc4a33 100644
--- a/src/shared/Database/SQLStorage.cpp
+++ b/src/shared/Database/SQLStorage.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,20 +27,20 @@ extern DatabasePostgre WorldDatabase;
extern DatabaseMysql WorldDatabase;
#endif
-const char CreatureInfosrcfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiilliiis";
-const char CreatureInfodstfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiilliiii";
+const char CreatureInfosrcfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifflliiis";
+const char CreatureInfodstfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifflliiii";
const char CreatureDataAddonInfofmt[]="iiiiiiiis";
const char CreatureModelfmt[]="iffbi";
const char CreatureInfoAddonInfofmt[]="iiiiiiiis";
-const char EquipmentInfofmt[]="iiiiiiiiii";
-const char GameObjectInfosrcfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiis";
-const char GameObjectInfodstfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiii";
-const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifsiiiii";
-const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiii";
+const char EquipmentInfofmt[]="iiii";
+const char GameObjectInfosrcfmt[]="iiisssiifiiiiiiiiiiiiiiiiiiiiiiiis";
+const char GameObjectInfodstfmt[]="iiisssiifiiiiiiiiiiiiiiiiiiiiiiiii";
+const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiisiiii";
+const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiffiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiii";
const char PageTextfmt[]="isi";
const char SpellThreatfmt[]="ii";
-const char InstanceTemplatesrcfmt[]="iiiiiffffs";
-const char InstanceTemplatedstfmt[]="iiiiiffffi";
+const char InstanceTemplatesrcfmt[]="iiiiiiffffs";
+const char InstanceTemplatedstfmt[]="iiiiiiffffi";
SQLStorage sCreatureStorage(CreatureInfosrcfmt, CreatureInfodstfmt, "entry","creature_template");
SQLStorage sCreatureDataAddonStorage(CreatureDataAddonInfofmt,"guid","creature_addon");
diff --git a/src/shared/Database/SQLStorage.h b/src/shared/Database/SQLStorage.h
index 43e34532607..1b5b9d5dcf1 100644
--- a/src/shared/Database/SQLStorage.h
+++ b/src/shared/Database/SQLStorage.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/SQLStorageImpl.h b/src/shared/Database/SQLStorageImpl.h
index 82ff0beb60e..b511bdad68c 100644
--- a/src/shared/Database/SQLStorageImpl.h
+++ b/src/shared/Database/SQLStorageImpl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
+ * 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
@@ -18,17 +18,17 @@
#include "ProgressBar.h"
#include "Log.h"
-#include "dbcfile.h"
+#include "DBCFileLoader.h"
template<class T>
template<class S, class D>
-void SQLStorageLoaderBase<T>::convert(uint32 field_pos, S src, D &dst)
+void SQLStorageLoaderBase<T>::convert(uint32 /*field_pos*/, S src, D &dst)
{
dst = D(src);
}
template<class T>
-void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 field_pos, char *src, char *&dst)
+void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 /*field_pos*/, char *src, char *&dst)
{
if(!src)
{
@@ -45,7 +45,7 @@ void SQLStorageLoaderBase<T>::convert_str_to_str(uint32 field_pos, char *src, ch
template<class T>
template<class S>
-void SQLStorageLoaderBase<T>::convert_to_str(uint32 field_pos, S src, char * & dst)
+void SQLStorageLoaderBase<T>::convert_to_str(uint32 /*field_pos*/, S /*src*/, char * & dst)
{
dst = new char[1];
*dst = 0;
@@ -53,7 +53,7 @@ void SQLStorageLoaderBase<T>::convert_to_str(uint32 field_pos, S src, char * & d
template<class T>
template<class D>
-void SQLStorageLoaderBase<T>::convert_from_str(uint32 field_pos, char * src, D& dst)
+void SQLStorageLoaderBase<T>::convert_from_str(uint32 /*field_pos*/, char * /*src*/, D& dst)
{
dst = 0;
}
diff --git a/src/shared/Database/SqlDelayThread.cpp b/src/shared/Database/SqlDelayThread.cpp
index 16d5146fc53..27f58510a0a 100644
--- a/src/shared/Database/SqlDelayThread.cpp
+++ b/src/shared/Database/SqlDelayThread.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Database/SqlDelayThread.h b/src/shared/Database/SqlDelayThread.h
index 4c77c122f1e..cbae0c1e5eb 100644
--- a/src/shared/Database/SqlDelayThread.h
+++ b/src/shared/Database/SqlDelayThread.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ class SqlDelayThread : public ZThread::Runnable
SqlDelayThread(Database* db);
///< Put sql statement to delay queue
- inline bool Delay(SqlOperation* sql) { m_sqlQueue.add(sql); return true; }
+ bool Delay(SqlOperation* sql) { m_sqlQueue.add(sql); return true; }
virtual void Stop(); ///< Stop event
virtual void run(); ///< Main Thread loop
diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp
index c11c5b9269d..53b99359c09 100644
--- a/src/shared/Database/SqlOperations.cpp
+++ b/src/shared/Database/SqlOperations.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -97,7 +97,7 @@ bool SqlQueryHolder::SetQuery(size_t index, const char *sql)
{
if(m_queries.size() <= index)
{
- sLog.outError("Query index (%u) out of range (size: %u) for query: %s",index,m_queries.size(),sql);
+ sLog.outError("Query index (%u) out of range (size: %u) for query: %s",index,(uint32)m_queries.size(),sql);
return false;
}
diff --git a/src/shared/Database/SqlOperations.h b/src/shared/Database/SqlOperations.h
index 1a0d3c78d1b..61eef4bb7c4 100644
--- a/src/shared/Database/SqlOperations.h
+++ b/src/shared/Database/SqlOperations.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Errors.h b/src/shared/Errors.h
index 7203f1c5420..b7bd19a1d94 100644
--- a/src/shared/Errors.h
+++ b/src/shared/Errors.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp
index d042be82b77..152110012eb 100644
--- a/src/shared/Log.cpp
+++ b/src/shared/Log.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,139 +25,42 @@
#include "Util.h"
#include <stdarg.h>
+#include <stdio.h>
INSTANTIATE_SINGLETON_1( Log );
-enum LogType
-{
- LogNormal = 0,
- LogDetails,
- LogDebug,
- LogError
-};
-
-const int LogType_count = int(LogError) +1;
-
Log::Log() :
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL),
- dberLogfile(NULL), m_colored(false), m_includeTime(false), m_gmlog_per_account(false)
+ dberLogfile(NULL), chatLogfile(NULL), m_gmlog_per_account(false), m_colored(false)
{
Initialize();
}
-void Log::InitColors(const std::string& str)
+Log::~Log()
{
- if(str.empty())
- {
- m_colored = false;
- return;
- }
-
- int color[4];
-
- std::istringstream ss(str);
-
- for(int i = 0; i < LogType_count; ++i)
- {
- ss >> color[i];
-
- if(!ss)
- return;
-
- if(color[i] < 0 || color[i] >= Color_count)
- return;
- }
-
- for(int i = 0; i < LogType_count; ++i)
- m_colors[i] = Color(color[i]);
-
- m_colored = true;
-}
-
-void Log::SetColor(bool stdout_stream, Color color)
-{
- #if PLATFORM == PLATFORM_WINDOWS
-
- static WORD WinColorFG[Color_count] =
- {
- 0, // BLACK
- FOREGROUND_RED, // RED
- FOREGROUND_GREEN, // GREEN
- FOREGROUND_RED | FOREGROUND_GREEN, // BROWN
- FOREGROUND_BLUE, // BLUE
- FOREGROUND_RED | FOREGROUND_BLUE,// MAGENTA
- FOREGROUND_GREEN | FOREGROUND_BLUE, // CYAN
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,// WHITE
- // YELLOW
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- // RED_BOLD
- FOREGROUND_RED | FOREGROUND_INTENSITY,
- // GREEN_BOLD
- FOREGROUND_GREEN | FOREGROUND_INTENSITY,
- FOREGROUND_BLUE | FOREGROUND_INTENSITY, // BLUE_BOLD
- // MAGENTA_BOLD
- FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- // CYAN_BOLD
- FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
- // WHITE_BOLD
- FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
- };
+ if( logfile != NULL )
+ fclose(logfile);
+ logfile = NULL;
- HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
- SetConsoleTextAttribute(hConsole, WinColorFG[color]);
- #else
+ if( gmLogfile != NULL )
+ fclose(gmLogfile);
+ gmLogfile = NULL;
- enum ANSITextAttr
- {
- TA_NORMAL=0,
- TA_BOLD=1,
- TA_BLINK=5,
- TA_REVERSE=7
- };
+ if (charLogfile != NULL)
+ fclose(charLogfile);
+ charLogfile = NULL;
- enum ANSIFgTextAttr
- {
- FG_BLACK=30, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE,
- FG_MAGENTA, FG_CYAN, FG_WHITE, FG_YELLOW
- };
-
- enum ANSIBgTextAttr
- {
- BG_BLACK=40, BG_RED, BG_GREEN, BG_BROWN, BG_BLUE,
- BG_MAGENTA, BG_CYAN, BG_WHITE
- };
-
- static uint8 UnixColorFG[Color_count] =
- {
- FG_BLACK, // BLACK
- FG_RED, // RED
- FG_GREEN, // GREEN
- FG_BROWN, // BROWN
- FG_BLUE, // BLUE
- FG_MAGENTA, // MAGENTA
- FG_CYAN, // CYAN
- FG_WHITE, // WHITE
- FG_YELLOW, // YELLOW
- FG_RED, // LRED
- FG_GREEN, // LGREEN
- FG_BLUE, // LBLUE
- FG_MAGENTA, // LMAGENTA
- FG_CYAN, // LCYAN
- FG_WHITE // LWHITE
- };
+ if( dberLogfile != NULL )
+ fclose(dberLogfile);
+ dberLogfile = NULL;
- fprintf((stdout_stream? stdout : stderr), "\x1b[%d%sm",UnixColorFG[color],(color>=YELLOW&&color<Color_count ?";1":""));
- #endif
-}
+ if (raLogfile != NULL)
+ fclose(raLogfile);
+ raLogfile = NULL;
-void Log::ResetColor(bool stdout_stream)
-{
- #if PLATFORM == PLATFORM_WINDOWS
- HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
- SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED );
- #else
- fprintf(( stdout_stream ? stdout : stderr ), "\x1b[0m");
- #endif
+ if (chatLogfile != NULL)
+ fclose(chatLogfile);
+ chatLogfile = NULL;
}
void Log::SetLogLevel(char *Level)
@@ -167,7 +70,7 @@ void Log::SetLogLevel(char *Level)
NewLevel = 0;
m_logLevel = NewLevel;
- printf( "LogLevel is %u\n",m_logLevel );
+ outString( "LogLevel is %u",m_logLevel );
}
void Log::SetLogFileLevel(char *Level)
@@ -177,11 +80,30 @@ void Log::SetLogFileLevel(char *Level)
NewLevel = 0;
m_logFileLevel = NewLevel;
- printf( "LogFileLevel is %u\n",m_logFileLevel );
+ outString( "LogFileLevel is %u",m_logFileLevel );
+}
+
+void Log::SetDBLogLevel(char *Level)
+{
+ int32 NewLevel = atoi((char*)Level);
+ if ( NewLevel < 0 )
+ NewLevel = 0;
+ m_dbLogLevel = NewLevel;
+
+ outString( "DBLogLevel is %u",m_dbLogLevel );
}
void Log::Initialize()
{
+ /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs
+ m_dbChar = sConfig.GetBoolDefault("LogDB.Char", false);
+ m_dbRA = sConfig.GetBoolDefault("LogDB.RA", false);
+ m_dbGM = sConfig.GetBoolDefault("LogDB.GM", false);
+ m_dbChat = sConfig.GetBoolDefault("LogDB.Chat", false);
+
+ /// Realm must be 0 by default
+ SetRealmID(0);
+
/// Common log files data
m_logsDir = sConfig.GetStringDefault("LogsDir","");
if(!m_logsDir.empty())
@@ -194,6 +116,7 @@ void Log::Initialize()
/// Open specific log files
logfile = openLogFile("LogFile","LogTimestamp","w");
+ InitColors(sConfig.GetStringDefault("LogColors", ""));
m_gmlog_per_account = sConfig.GetBoolDefault("GmLogPerAccount",false);
if(!m_gmlog_per_account)
@@ -230,12 +153,12 @@ void Log::Initialize()
dberLogfile = openLogFile("DBErrorLogFile",NULL,"a");
raLogfile = openLogFile("RaLogFile",NULL,"a");
+ chatLogfile = openLogFile("ChatLogFile","ChatLogTimestamp","a");
// Main log file settings
- m_includeTime = sConfig.GetBoolDefault("LogTime", false);
- m_logLevel = sConfig.GetIntDefault("LogLevel", 0);
- m_logFileLevel = sConfig.GetIntDefault("LogFileLevel", 0);
- InitColors(sConfig.GetStringDefault("LogColors", ""));
+ m_logLevel = sConfig.GetIntDefault("LogLevel", LOGL_NORMAL);
+ m_logFileLevel = sConfig.GetIntDefault("LogFileLevel", LOGL_NORMAL);
+ m_dbLogLevel = sConfig.GetIntDefault("DBLogLevel", LOGL_NORMAL);
m_logFilter = 0;
@@ -245,6 +168,8 @@ void Log::Initialize()
m_logFilter |= LOG_FILTER_CREATURE_MOVES;
if(sConfig.GetBoolDefault("LogFilter_VisibilityChanges", true))
m_logFilter |= LOG_FILTER_VISIBILITY_CHANGES;
+ if(sConfig.GetBoolDefault("LogFilter_AchievementUpdates", true))
+ m_logFilter |= LOG_FILTER_ACHIEVEMENT_UPDATES;
// Char log settings
m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false);
@@ -291,17 +216,117 @@ void Log::outTimestamp(FILE* file)
fprintf(file,"%-4d-%02d-%02d %02d:%02d:%02d ",aTm->tm_year+1900,aTm->tm_mon+1,aTm->tm_mday,aTm->tm_hour,aTm->tm_min,aTm->tm_sec);
}
-void Log::outTime()
+void Log::InitColors(const std::string& str)
{
- time_t t = time(NULL);
- tm* aTm = localtime(&t);
- // YYYY year
- // MM month (2 digits 01-12)
- // DD day (2 digits 01-31)
- // HH hour (2 digits 00-23)
- // MM minutes (2 digits 00-59)
- // SS seconds (2 digits 00-59)
- printf("%02d:%02d:%02d ",aTm->tm_hour,aTm->tm_min,aTm->tm_sec);
+ if(str.empty())
+ {
+ m_colored = false;
+ return;
+ }
+
+ int color[4];
+
+ std::istringstream ss(str);
+
+ for(int i = 0; i < LogLevels; ++i)
+ {
+ ss >> color[i];
+
+ if(!ss)
+ return;
+
+ if(color[i] < 0 || color[i] >= Colors)
+ return;
+ }
+
+ for(int i = 0; i < LogLevels; ++i)
+ m_colors[i] = ColorTypes(color[i]);
+
+ m_colored = true;
+}
+
+void Log::SetColor(bool stdout_stream, ColorTypes color)
+{
+ #if PLATFORM == PLATFORM_WINDOWS
+ static WORD WinColorFG[Colors] =
+ {
+ 0, // BLACK
+ FOREGROUND_RED, // RED
+ FOREGROUND_GREEN, // GREEN
+ FOREGROUND_RED | FOREGROUND_GREEN, // BROWN
+ FOREGROUND_BLUE, // BLUE
+ FOREGROUND_RED | FOREGROUND_BLUE,// MAGENTA
+ FOREGROUND_GREEN | FOREGROUND_BLUE, // CYAN
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,// WHITE
+ // YELLOW
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY,
+ // RED_BOLD
+ FOREGROUND_RED | FOREGROUND_INTENSITY,
+ // GREEN_BOLD
+ FOREGROUND_GREEN | FOREGROUND_INTENSITY,
+ FOREGROUND_BLUE | FOREGROUND_INTENSITY, // BLUE_BOLD
+ // MAGENTA_BOLD
+ FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
+ // CYAN_BOLD
+ FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY,
+ // WHITE_BOLD
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
+ };
+
+ HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
+ SetConsoleTextAttribute(hConsole, WinColorFG[color]);
+ #else
+ enum ANSITextAttr
+ {
+ TA_NORMAL=0,
+ TA_BOLD=1,
+ TA_BLINK=5,
+ TA_REVERSE=7
+ };
+
+ enum ANSIFgTextAttr
+ {
+ FG_BLACK=30, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE,
+ FG_MAGENTA, FG_CYAN, FG_WHITE, FG_YELLOW
+ };
+
+ enum ANSIBgTextAttr
+ {
+ BG_BLACK=40, BG_RED, BG_GREEN, BG_BROWN, BG_BLUE,
+ BG_MAGENTA, BG_CYAN, BG_WHITE
+ };
+
+ static uint8 UnixColorFG[Colors] =
+ {
+ FG_BLACK, // BLACK
+ FG_RED, // RED
+ FG_GREEN, // GREEN
+ FG_BROWN, // BROWN
+ FG_BLUE, // BLUE
+ FG_MAGENTA, // MAGENTA
+ FG_CYAN, // CYAN
+ FG_WHITE, // WHITE
+ FG_YELLOW, // YELLOW
+ FG_RED, // LRED
+ FG_GREEN, // LGREEN
+ FG_BLUE, // LBLUE
+ FG_MAGENTA, // LMAGENTA
+ FG_CYAN, // LCYAN
+ FG_WHITE // LWHITE
+ };
+
+ fprintf((stdout_stream? stdout : stderr), "\x1b[%d%sm", UnixColorFG[color], (color >= YELLOW && color < Colors ? ";1" : ""));
+ #endif
+}
+
+void Log::ResetColor(bool stdout_stream)
+{
+ #if PLATFORM == PLATFORM_WINDOWS
+ HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE );
+ SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED );
+ #else
+ fprintf(( stdout_stream ? stdout : stderr ), "\x1b[0m");
+ #endif
}
std::string Log::GetTimestampStr()
@@ -319,16 +344,54 @@ std::string Log::GetTimestampStr()
return std::string(buf);
}
-void Log::outTitle( const char * str)
+void Log::outDB( uint32 type, const char * str, ... )
+{
+ if(type >= MAX_LOG_TYPES)
+ return;
+
+ if(!str)
+ return;
+
+ std::string new_str(str);
+ LoginDatabase.escape_string(new_str);
+ char nnew_str[MAX_QUERY_LEN];
+
+ va_list ap;
+ va_start(ap, str);
+ int res = vsnprintf(nnew_str, MAX_QUERY_LEN, new_str.c_str(), ap);
+ va_end(ap);
+
+ if ( (res < 0) || (!nnew_str) || (std::string(nnew_str).empty()) )
+ return;
+
+ LoginDatabase.PExecute("INSERT INTO logs (time, realm, type, string) "
+ "VALUES ("I64FMTD", %u, %u, '%s');", uint64(time(0)), realm, type, nnew_str);
+}
+
+void Log::outString( const char * str, ... )
{
if( !str )
return;
+ if (m_enableLogDB)
+ {
+ // we don't want empty strings in the DB
+ std::string s(str);
+ if(s.empty() || s == " ")
+ return;
+
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_STRING, nnew_str);
+ va_end(ap2);
+ }
+
if(m_colored)
- SetColor(true,WHITE);
+ SetColor(true,m_colors[LOGL_NORMAL]);
- // not expected utf8 and then send as-is
- printf( str );
+ UTF8PRINTF(stdout,str,);
if(m_colored)
ResetColor(true);
@@ -336,18 +399,20 @@ void Log::outTitle( const char * str)
printf( "\n" );
if(logfile)
{
- fprintf(logfile, str);
+ outTimestamp(logfile);
+ va_list ap;
+ va_start(ap, str);
+ vfprintf(logfile, str, ap);
fprintf(logfile, "\n" );
+ va_end(ap);
+
fflush(logfile);
}
-
fflush(stdout);
}
-void Log::outString()
+void Log::outString( )
{
- if(m_includeTime)
- outTime();
printf( "\n" );
if(logfile)
{
@@ -358,36 +423,44 @@ void Log::outString()
fflush(stdout);
}
-void Log::outString( const char * str, ... )
+void Log::outCrash( const char * err, ... )
{
- if( !str )
+ if( !err )
return;
- if(m_colored)
- SetColor(true,m_colors[LogNormal]);
+ if (m_enableLogDB)
+ {
+ va_list ap2;
+ va_start(ap2, err);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2);
+ outDB(LOG_TYPE_CRASH, nnew_str);
+ va_end(ap2);
+ }
- if(m_includeTime)
- outTime();
+ if(m_colored)
+ SetColor(false,RED);
- UTF8PRINTF(stdout,str,);
+ UTF8PRINTF(stderr,err,);
if(m_colored)
- ResetColor(true);
+ ResetColor(false);
- printf( "\n" );
+ fprintf( stderr, "\n" );
if(logfile)
{
outTimestamp(logfile);
+ fprintf(logfile, "CRASH ALERT: " );
va_list ap;
- va_start(ap, str);
- vfprintf(logfile, str, ap);
- fprintf(logfile, "\n" );
+ va_start(ap, err);
+ vfprintf(logfile, err, ap);
va_end(ap);
+ fprintf(logfile, "\n" );
fflush(logfile);
}
- fflush(stdout);
+ fflush(stderr);
}
void Log::outError( const char * err, ... )
@@ -395,11 +468,18 @@ void Log::outError( const char * err, ... )
if( !err )
return;
- if(m_colored)
- SetColor(false,m_colors[LogError]);
+ if (m_enableLogDB)
+ {
+ va_list ap2;
+ va_start(ap2, err);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2);
+ outDB(LOG_TYPE_ERROR, nnew_str);
+ va_end(ap2);
+ }
- if(m_includeTime)
- outTime();
+ if(m_colored)
+ SetColor(false,RED);
UTF8PRINTF(stderr,err,);
@@ -410,7 +490,7 @@ void Log::outError( const char * err, ... )
if(logfile)
{
outTimestamp(logfile);
- fprintf(logfile, "ERROR:" );
+ fprintf(logfile, "ERROR: " );
va_list ap;
va_start(ap, err);
@@ -429,10 +509,7 @@ void Log::outErrorDb( const char * err, ... )
return;
if(m_colored)
- SetColor(false,m_colors[LogError]);
-
- if(m_includeTime)
- outTime();
+ SetColor(false,RED);
UTF8PRINTF(stderr,err,);
@@ -444,7 +521,7 @@ void Log::outErrorDb( const char * err, ... )
if(logfile)
{
outTimestamp(logfile);
- fprintf(logfile, "ERROR:" );
+ fprintf(logfile, "ERROR: " );
va_list ap;
va_start(ap, err);
@@ -458,7 +535,6 @@ void Log::outErrorDb( const char * err, ... )
if(dberLogfile)
{
outTimestamp(dberLogfile);
-
va_list ap;
va_start(ap, err);
vfprintf(dberLogfile, err, ap);
@@ -475,13 +551,20 @@ void Log::outBasic( const char * str, ... )
if( !str )
return;
- if( m_logLevel > 0 )
+ if (m_enableLogDB && m_dbLogLevel > LOGL_NORMAL)
{
- if(m_colored)
- SetColor(true,m_colors[LogDetails]);
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_BASIC, nnew_str);
+ va_end(ap2);
+ }
- if(m_includeTime)
- outTime();
+ if( m_logLevel > LOGL_NORMAL )
+ {
+ if(m_colored)
+ SetColor(true,m_colors[LOGL_BASIC]);
UTF8PRINTF(stdout,str,);
@@ -491,10 +574,10 @@ void Log::outBasic( const char * str, ... )
printf( "\n" );
}
- if(logfile && m_logFileLevel > 0)
+ if(logfile && m_logFileLevel > LOGL_NORMAL)
{
- va_list ap;
outTimestamp(logfile);
+ va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
fprintf(logfile, "\n" );
@@ -509,14 +592,20 @@ void Log::outDetail( const char * str, ... )
if( !str )
return;
- if( m_logLevel > 1 )
+ if (m_enableLogDB && m_dbLogLevel > LOGL_BASIC)
{
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_DETAIL, nnew_str);
+ va_end(ap2);
+ }
+ if( m_logLevel > LOGL_BASIC )
+ {
if(m_colored)
- SetColor(true,m_colors[LogDetails]);
-
- if(m_includeTime)
- outTime();
+ SetColor(true,m_colors[LOGL_DETAIL]);
UTF8PRINTF(stdout,str,);
@@ -525,10 +614,10 @@ void Log::outDetail( const char * str, ... )
printf( "\n" );
}
- if(logfile && m_logFileLevel > 1)
+ if(logfile && m_logFileLevel > LOGL_BASIC)
{
- va_list ap;
outTimestamp(logfile);
+ va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
fprintf(logfile, "\n" );
@@ -543,17 +632,12 @@ void Log::outDebugInLine( const char * str, ... )
{
if( !str )
return;
- if( m_logLevel > 2 )
- {
- if(m_colored)
- SetColor(true,m_colors[LogDebug]);
+ if( m_logLevel > LOGL_DETAIL )
+ {
UTF8PRINTF(stdout,str,);
-
- if(m_colored)
- ResetColor(true);
}
- if(logfile && m_logFileLevel > 2)
+ if(logfile && m_logFileLevel > LOGL_DETAIL)
{
va_list ap;
va_start(ap, str);
@@ -566,13 +650,21 @@ void Log::outDebug( const char * str, ... )
{
if( !str )
return;
- if( m_logLevel > 2 )
+
+ if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL)
{
- if(m_colored)
- SetColor(true,m_colors[LogDebug]);
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_DEBUG, nnew_str);
+ va_end(ap2);
+ }
- if(m_includeTime)
- outTime();
+ if( m_logLevel > LOGL_DETAIL )
+ {
+ if(m_colored)
+ SetColor(true,m_colors[LOGL_DEBUG]);
UTF8PRINTF(stdout,str,);
@@ -581,10 +673,9 @@ void Log::outDebug( const char * str, ... )
printf( "\n" );
}
- if(logfile && m_logFileLevel > 2)
+ if(logfile && m_logFileLevel > LOGL_DETAIL)
{
outTimestamp(logfile);
-
va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
@@ -601,13 +692,21 @@ void Log::outCommand( uint32 account, const char * str, ... )
if( !str )
return;
- if( m_logLevel > 1 )
+ // TODO: support accountid
+ if (m_enableLogDB && m_dbGM)
{
- if(m_colored)
- SetColor(true,m_colors[LogDetails]);
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_GM, nnew_str);
+ va_end(ap2);
+ }
- if(m_includeTime)
- outTime();
+ if( m_logLevel > LOGL_NORMAL )
+ {
+ if(m_colored)
+ SetColor(true,m_colors[LOGL_BASIC]);
UTF8PRINTF(stdout,str,);
@@ -616,10 +715,10 @@ void Log::outCommand( uint32 account, const char * str, ... )
printf( "\n" );
}
- if(logfile && m_logFileLevel > 1)
+ if(logfile && m_logFileLevel > LOGL_NORMAL)
{
- va_list ap;
outTimestamp(logfile);
+ va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
fprintf(logfile, "\n" );
@@ -631,8 +730,8 @@ void Log::outCommand( uint32 account, const char * str, ... )
{
if (FILE* per_file = openGmlogPerAccount (account))
{
- va_list ap;
outTimestamp(per_file);
+ va_list ap;
va_start(ap, str);
vfprintf(per_file, str, ap);
fprintf(per_file, "\n" );
@@ -642,8 +741,8 @@ void Log::outCommand( uint32 account, const char * str, ... )
}
else if (gmLogfile)
{
- va_list ap;
outTimestamp(gmLogfile);
+ va_list ap;
va_start(ap, str);
vfprintf(gmLogfile, str, ap);
fprintf(gmLogfile, "\n" );
@@ -656,14 +755,23 @@ void Log::outCommand( uint32 account, const char * str, ... )
void Log::outChar(const char * str, ... )
{
-
if (!str)
return;
+ if (m_enableLogDB && m_dbChar)
+ {
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_CHAR, nnew_str);
+ va_end(ap2);
+ }
+
if(charLogfile)
{
- va_list ap;
outTimestamp(charLogfile);
+ va_list ap;
va_start(ap, str);
vfprintf(charLogfile, str, ap);
fprintf(charLogfile, "\n" );
@@ -681,48 +789,58 @@ void Log::outCharDump( const char * str, uint32 account_id, uint32 guid, const c
}
}
-void Log::outMenu( const char * str, ... )
+void Log::outRemote( const char * str, ... )
{
if( !str )
return;
- SetColor(true,m_colors[LogNormal]);
-
- if(m_includeTime)
- outTime();
-
- UTF8PRINTF(stdout,str,);
-
- ResetColor(true);
-
- if(logfile)
+ if (m_enableLogDB && m_dbRA)
{
- outTimestamp(logfile);
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_RA, nnew_str);
+ va_end(ap2);
+ }
+ if (raLogfile)
+ {
+ outTimestamp(raLogfile);
va_list ap;
va_start(ap, str);
- vfprintf(logfile, str, ap);
+ vfprintf(raLogfile, str, ap);
+ fprintf(raLogfile, "\n" );
va_end(ap);
-
- fprintf(logfile, "\n" );
- fflush(logfile);
+ fflush(raLogfile);
}
fflush(stdout);
}
-void Log::outRALog( const char * str, ... )
+void Log::outChat( const char * str, ... )
{
if( !str )
return;
- va_list ap;
- if (raLogfile)
+
+ if (m_enableLogDB && m_dbChat)
{
- outTimestamp(raLogfile);
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_CHAT, nnew_str);
+ va_end(ap2);
+ }
+
+ if (chatLogfile)
+ {
+ outTimestamp(chatLogfile);
+ va_list ap;
va_start(ap, str);
- vfprintf(raLogfile, str, ap);
- fprintf(raLogfile, "\n" );
+ vfprintf(chatLogfile, str, ap);
+ fprintf(chatLogfile, "\n" );
+ fflush(chatLogfile);
va_end(ap);
- fflush(raLogfile);
}
fflush(stdout);
}
diff --git a/src/shared/Log.h b/src/shared/Log.h
index ab8c24571fb..6ef7f64289e 100644
--- a/src/shared/Log.h
+++ b/src/shared/Log.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,18 +23,45 @@
#include "Common.h"
#include "Policies/Singleton.h"
+#include "Database/DatabaseEnv.h"
class Config;
-// bitmask
enum LogFilters
{
- LOG_FILTER_TRANSPORT_MOVES = 1,
- LOG_FILTER_CREATURE_MOVES = 2,
- LOG_FILTER_VISIBILITY_CHANGES = 4
+ LOG_FILTER_TRANSPORT_MOVES = 0x1,
+ LOG_FILTER_CREATURE_MOVES = 0x2,
+ LOG_FILTER_VISIBILITY_CHANGES = 0x4,
+ LOG_FILTER_ACHIEVEMENT_UPDATES = 0x8
};
-enum Color
+enum LogTypes
+{
+ LOG_TYPE_STRING = 0,
+ LOG_TYPE_ERROR = 1,
+ LOG_TYPE_BASIC = 2,
+ LOG_TYPE_DETAIL = 3,
+ LOG_TYPE_DEBUG = 4,
+ LOG_TYPE_CHAR = 5,
+ LOG_TYPE_WORLD = 6,
+ LOG_TYPE_RA = 7,
+ LOG_TYPE_GM = 8,
+ LOG_TYPE_CRASH = 9,
+ LOG_TYPE_CHAT = 10,
+ MAX_LOG_TYPES
+};
+
+enum LogLevel
+{
+ LOGL_NORMAL = 0,
+ LOGL_BASIC,
+ LOGL_DETAIL,
+ LOGL_DEBUG
+};
+
+const int LogLevels = int(LOGL_DEBUG)+1;
+
+enum ColorTypes
{
BLACK,
RED,
@@ -53,73 +80,53 @@ enum Color
WHITE
};
-const int Color_count = int(WHITE)+1;
+const int Colors = int(WHITE)+1;
class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ZThread::FastMutex> >
{
friend class Trinity::OperatorNew<Log>;
Log();
+ ~Log();
- ~Log()
- {
- if( logfile != NULL )
- fclose(logfile);
- logfile = NULL;
-
- if( gmLogfile != NULL )
- fclose(gmLogfile);
- gmLogfile = NULL;
-
- if (charLogfile != NULL)
- fclose(charLogfile);
- charLogfile = NULL;
-
- if( dberLogfile != NULL )
- fclose(dberLogfile);
- dberLogfile = NULL;
-
- if (raLogfile != NULL)
- fclose(raLogfile);
- raLogfile = NULL;
- }
public:
void Initialize();
+
void InitColors(const std::string& init_str);
- void outTitle( const char * str);
+ void SetColor(bool stdout_stream, ColorTypes color);
+ void ResetColor(bool stdout_stream);
+
+ void outDB( uint32 type, const char * str, ... ) ATTR_PRINTF(3,4);
+ void outString( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outString( );
+ void outError( const char * err, ... ) ATTR_PRINTF(2,3);
+ void outCrash( const char * err, ... ) ATTR_PRINTF(2,3);
+ void outBasic( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outDetail( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outChar( const char * str, ... ) ATTR_PRINTF(2,3);
void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3,4);
- void outString(); // any log level
- // any log level
- void outString( const char * str, ... ) ATTR_PRINTF(2,3);
- // any log level
- void outError( const char * err, ... ) ATTR_PRINTF(2,3);
- // log level >= 1
- void outBasic( const char * str, ... ) ATTR_PRINTF(2,3);
- // log level >= 2
- void outDetail( const char * str, ... ) ATTR_PRINTF(2,3);
- // log level >= 3
- void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3);
- // log level >= 3
- void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
- // any log level
- void outMenu( const char * str, ... ) ATTR_PRINTF(2,3);
- // any log level
- void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
- // any log level
- void outChar( const char * str, ... ) ATTR_PRINTF(2,3);
- // any log level
+ void outRemote( const char * str, ... ) ATTR_PRINTF(2,3);
+ void outChat( const char * str, ... ) ATTR_PRINTF(2,3);
void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name );
- void outRALog( const char * str, ... ) ATTR_PRINTF(2,3);
- void SetLogLevel(char * Level);
- void SetLogFileLevel(char * Level);
- void SetColor(bool stdout_stream, Color color);
- void ResetColor(bool stdout_stream);
- void outTime();
+
static void outTimestamp(FILE* file);
static std::string GetTimestampStr();
+
+ void SetLogLevel(char * Level);
+ void SetLogFileLevel(char * Level);
+ void SetDBLogLevel(char * Level);
+ void SetRealmID(uint32 id) { realm = id; }
+
uint32 getLogFilter() const { return m_logFilter; }
bool IsOutDebug() const { return m_logLevel > 2 || (m_logFileLevel > 2 && logfile); }
bool IsOutCharDump() const { return m_charLog_Dump; }
- bool IsIncludeTime() const { return m_includeTime; }
+
+ bool GetLogDB() { return m_enableLogDB; }
+ bool GetLogDBLater() { return m_enableLogDBLater; }
+ void SetLogDB(bool enable) { m_enableLogDB = enable; }
+ void SetLogDBLater(bool value) { m_enableLogDBLater = value; }
private:
FILE* openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode);
FILE* openGmlogPerAccount(uint32 account);
@@ -129,25 +136,35 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ZThr
FILE* gmLogfile;
FILE* charLogfile;
FILE* dberLogfile;
-
- // log/console control
- uint32 m_logLevel;
- uint32 m_logFileLevel;
- bool m_colored;
- bool m_includeTime;
- Color m_colors[4];
- uint32 m_logFilter;
+ FILE* chatLogfile;
// cache values for after initilization use (like gm log per account case)
std::string m_logsDir;
std::string m_logsTimestamp;
- // char log control
- bool m_charLog_Dump;
-
// gm log control
bool m_gmlog_per_account;
std::string m_gmlog_filename_format;
+
+ bool m_enableLogDBLater;
+ bool m_enableLogDB;
+ uint32 realm;
+
+ // log coloring
+ bool m_colored;
+ ColorTypes m_colors[4];
+
+ // log levels:
+ // 0 minimum/string, 1 basic/error, 2 detail, 3 full/debug
+ uint8 m_dbLogLevel;
+ uint8 m_logLevel;
+ uint8 m_logFileLevel;
+ uint8 m_logFilter;
+ bool m_dbChar;
+ bool m_dbRA;
+ bool m_dbGM;
+ bool m_dbChat;
+ bool m_charLog_Dump;
};
#define sLog Trinity::Singleton<Log>::Instance()
diff --git a/src/shared/Makefile.am b/src/shared/Makefile.am
new file mode 100644
index 00000000000..6b99351cb26
--- /dev/null
+++ b/src/shared/Makefile.am
@@ -0,0 +1,82 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = Auth Config Database vmap
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../../dep/include/g3dlite -DSYSCONFDIR=\"$(sysconfdir)/\"
+## AM_CPPFLAGS += -I$(srcdir)/../game -I$(srcdir)/../realmd
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosshared.a
+
+# libmangosshared library will later be reused by ...
+libmangosshared_a_SOURCES = \
+ Base.cpp \
+ Base.h \
+ ByteBuffer.h \
+ Common.cpp \
+ Common.h \
+ Errors.h \
+ Log.cpp \
+ Log.h \
+ MemoryLeaks.cpp \
+ MemoryLeaks.h \
+ ProgressBar.cpp \
+ ProgressBar.h \
+ Timer.h \
+ Util.cpp \
+ Util.h \
+ WorldPacket.h \
+ revision_nr.h \
+ revision.h
+
+# Get revision (git or svn)
+# Get HG revision
+REVISION_FILE = revision.h
+
+BUILT_SOURCES = $(REVISION_FILE)
+CLEANFILES = $(REVISION_FILE)
+
+FORCE:
+
+$(REVISION_FILE) : $(top_builddir)/src/tools/genrevision/genrevision FORCE
+ $(top_builddir)/src/tools/genrevision/genrevision $(top_srcdir)
+ cp $(top_builddir)/src/shared/revision.h $(top_srcdir)/src/shared
+
+## Additional files to include when running 'make dist'
+# Disabled packet logger
+EXTRA_DIST = \
+ PacketLog.cpp \
+ PacketLog.h
+
+# System configuration
+EXTRA_DIST += \
+ SystemConfig.h
+
+# System Win32 files
+EXTRA_DIST += \
+ ServiceWin32.cpp \
+ ServiceWin32.h \
+ WheatyExceptionReport.cpp \
+ WheatyExceptionReport.h
diff --git a/src/shared/MemoryLeaks.cpp b/src/shared/MemoryLeaks.cpp
new file mode 100644
index 00000000000..ef7e36c3b57
--- /dev/null
+++ b/src/shared/MemoryLeaks.cpp
@@ -0,0 +1,32 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MemoryLeaks.h"
+#include "Policies/SingletonImp.h"
+
+INSTANTIATE_SINGLETON_1( MemoryManager ) ;
+
+MemoryManager::MemoryManager( )
+{
+ #if COMPILER == MICROSOFT
+ // standard leak check initialization
+ //_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+ // uncomment to disable Visual Leak Detector from code
+ //VLDDisable();
+ #endif
+}
diff --git a/src/shared/MemoryLeaks.h b/src/shared/MemoryLeaks.h
new file mode 100644
index 00000000000..fcea1f557b1
--- /dev/null
+++ b/src/shared/MemoryLeaks.h
@@ -0,0 +1,48 @@
+/*
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITYSERVER_MEMORY_H
+#define TRINITYSERVER_MEMORY_H
+
+#include "Platform/CompilerDefs.h"
+
+#if COMPILER == COMPILER_MICROSOFT
+
+#ifndef _WIN64
+// Visual Leak Detector support enabled
+//#include <vld/vld.h>
+// standard Visual Studio leak check disabled,
+//# define _CRTDBG_MAP_ALLOC
+//# include <stdlib.h>
+//# include <crtdbg.h>
+#else
+# define _CRTDBG_MAP_ALLOC
+# include <stdlib.h>
+# include <crtdbg.h>
+#endif
+
+#endif
+
+
+#include "Policies/Singleton.h"
+
+struct MemoryManager : public Trinity::Singleton < MemoryManager >
+{
+ MemoryManager();
+};
+#endif
diff --git a/src/shared/Mthread.cpp b/src/shared/Mthread.cpp
deleted file mode 100644
index fbbeeb5a620..00000000000
--- a/src/shared/Mthread.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- Cross-platform thread handling
- Copyright (C) 2005 Andrew Zabolotny
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "Mthread.h"
-
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE_CC__)
-# define TRINITY_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE
-#else
-# define TRINITY_PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
-#endif
-
-#if PLATFORM != PLATFORM_WINDOWS
-
-MThread::MThread ()
-{
- tid = 0;
-}
-
-MThread::~MThread ()
-{
- /* Kill thread if this is not the current thread */
- if (tid && (pthread_self () != tid))
- {
- pthread_cancel (tid);
- pthread_join (tid, NULL);
- }
-}
-
-static void *thread_start_routine (void *arg)
-{
- MThread *newthr = (MThread *)arg;
- pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
- newthr->routine (newthr->arg);
- return NULL;
-}
-
-MThread *MThread::Start (void (*routine) (void *arg), void *arg)
-{
- MThread *newthr = new MThread ();
- newthr->routine = routine;
- newthr->arg = arg;
- int rc = pthread_create (&newthr->tid, NULL, thread_start_routine, newthr);
- if (rc)
- {
- newthr->DecRef ();
- return NULL;
- }
-
- return newthr;
-}
-
-pthread_mutexattr_t MMutex::attr;
-int MMutex::attr_refcount = 0;
-
-MMutex::MMutex ()
-{
- if (!attr_refcount++)
- {
- pthread_mutexattr_init (&attr);
- pthread_mutexattr_settype (&attr, TRINITY_PTHREAD_MUTEX_RECURSIVE);
- }
-
- pthread_mutex_init (&mutex, &attr);
-}
-
-MMutex::~MMutex ()
-{
- pthread_mutex_destroy (&mutex);
- if (!--attr_refcount)
- pthread_mutexattr_destroy (&attr);
-}
-
-bool MMutex::Lock ()
-{
- return (pthread_mutex_lock (&mutex) == 0);
-}
-
-bool MMutex::TryLock ()
-{
- return (pthread_mutex_trylock (&mutex) == 0);
-}
-
-void MMutex::Unlock ()
-{
- pthread_mutex_unlock (&mutex);
-}
-
-MMutex *MMutex::Create ()
-{
- return new MMutex ();
-}
-
-#else //windows
-
-MThread::MThread()
-{
- th = NULL;
-}
-
-MThread::~MThread ()
-{
- /* Kill thread if this is not current thread */
- if (th && (GetCurrentThreadId () != id))
- {
- TerminateThread (th, 0);
- WaitForSingleObject (th, INFINITE);
- CloseHandle (th);
- }
-}
-
-bool MThread::SetPriority (ThreadPriority prio)
-{
- int p;
- switch (prio)
- {
- case IDLE: p = THREAD_PRIORITY_IDLE; break;
- case LOWER: p = THREAD_PRIORITY_LOWEST; break;
- case LOW: p = THREAD_PRIORITY_BELOW_NORMAL; break;
- case NORMAL: p = THREAD_PRIORITY_NORMAL; break;
- case HIGH: p = THREAD_PRIORITY_ABOVE_NORMAL; break;
- case HIGHER: p = THREAD_PRIORITY_HIGHEST; break;
- case REALTIME: p = THREAD_PRIORITY_TIME_CRITICAL; break;
- default: p = THREAD_PRIORITY_NORMAL; break;
- }
- return SetThreadPriority (th, p);
-}
-
-static DWORD WINAPI thread_start_routine (void *arg)
-//static void thread_start_routine (void *arg)
-{
- MThread *newthr = (MThread *)arg;
- newthr->id = GetCurrentThreadId ();
- newthr->routine (newthr->arg);
- return 0;
-}
-
-MThread *MThread::Start (void (*routine) (void *arg), void *arg)
-{
- DWORD dwtid;
- MThread *newthr = new MThread ();
- newthr->routine = routine;
- newthr->arg = arg;
- newthr->th = CreateThread (NULL, WIN32_THREAD_STACK_SIZE, thread_start_routine, newthr, 0, &dwtid);
- //newthr->th = (HANDLE)_beginthread(thread_start_routine, 0, newthr);
- if (!newthr->th)
- {
- newthr->DecRef ();
- return NULL;
- }
- return newthr;
-}
-
-MMutex::MMutex ()
-{
- sem = CreateMutex (NULL, FALSE, NULL);
-}
-
-MMutex::~MMutex ()
-{
- CloseHandle (sem);
-}
-
-bool MMutex::Lock ()
-{
- return (WaitForSingleObject (sem, INFINITE) != WAIT_FAILED);
-}
-
-bool MMutex::TryLock ()
-{
- DWORD state = WaitForSingleObject (sem, 0);
- return (state == WAIT_OBJECT_0) && (state != WAIT_ABANDONED);
-}
-
-void MMutex::Unlock ()
-{
- ReleaseMutex (sem);
-}
-
-MMutex *MMutex::Create ()
-{
- MMutex *mutex = new MMutex ();
- if (!mutex->sem)
- {
- mutex->DecRef ();
- return NULL;
- }
- return mutex;
-}
-#endif
-
diff --git a/src/shared/Mthread.h b/src/shared/Mthread.h
deleted file mode 100644
index d0ac6deb43c..00000000000
--- a/src/shared/Mthread.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef MTHREAD_H
-#define MTHREAD_H
-
-#include "Base.h"
-#ifndef WIN32
-#include <pthread.h>
-#else
-#include <windows.h>
-//#include "Process.h"
-#define WIN32_THREAD_STACK_SIZE 0x10000
-#endif
-
-enum ThreadPriority
-{
- IDLE,
- LOWER,
- LOW,
- NORMAL,
- HIGH,
- HIGHER,
- REALTIME
-};
-
-class MThread: public Base
-{
- public:
- static MThread *Start (void (*routine) (void *arg), void *arg);
- MThread ();
- ~MThread ();
- bool SetPriority (ThreadPriority prio);
-
- void (*routine) (void *arg);
- void *arg;
-
- #ifdef WIN32
- HANDLE th;
- ULONG id;
- #else
- pthread_t tid;
- #endif
-
-};
-
-class MMutex : public Base
-{
- public:
-
- #ifdef WIN32
- HANDLE sem;
- #else
- pthread_mutex_t mutex;
- static pthread_mutexattr_t attr;
- static int attr_refcount;
- #endif
- static MMutex *Create ();
- MMutex ();
- virtual ~MMutex ();
- virtual bool Lock ();
- virtual bool TryLock ();
- virtual void Unlock ();
-};
-#endif // MTHREAD_H
-
diff --git a/src/shared/PacketLog.cpp b/src/shared/PacketLog.cpp
index aa9fd2dc348..96c9727e7fa 100644
--- a/src/shared/PacketLog.cpp
+++ b/src/shared/PacketLog.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/PacketLog.h b/src/shared/PacketLog.h
index 30fb7da15b9..49ac72ebc4b 100644
--- a/src/shared/PacketLog.h
+++ b/src/shared/PacketLog.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/ProgressBar.cpp b/src/shared/ProgressBar.cpp
index f5a45b9d862..b72118ad804 100644
--- a/src/shared/ProgressBar.cpp
+++ b/src/shared/ProgressBar.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/ProgressBar.h b/src/shared/ProgressBar.h
index 3f217f228fe..50c5c7d11e5 100644
--- a/src/shared/ProgressBar.h
+++ b/src/shared/ProgressBar.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/ServiceWin32.cpp b/src/shared/ServiceWin32.cpp
index d384884529a..bdc2a371297 100644
--- a/src/shared/ServiceWin32.cpp
+++ b/src/shared/ServiceWin32.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/src/shared/ServiceWin32.h b/src/shared/ServiceWin32.h
index d046acdcef4..18a52c396ea 100644
--- a/src/shared/ServiceWin32.h
+++ b/src/shared/ServiceWin32.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/src/shared/SystemConfig.h b/src/shared/SystemConfig.h
index 6b4471e792d..9d154b863d0 100644
--- a/src/shared/SystemConfig.h
+++ b/src/shared/SystemConfig.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
#include "revision.h"
-#define _PACKAGENAME "TrinityCore "
+#define _PACKAGENAME "TrinityCore2 "
#define _CODENAME "YUME"
#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
diff --git a/src/shared/SystemConfig.h.in b/src/shared/SystemConfig.h.in
new file mode 100644
index 00000000000..ad8df37b5be
--- /dev/null
+++ b/src/shared/SystemConfig.h.in
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TRINITY_SYSTEMCONFIG_H
+#define TRINITY_SYSTEMCONFIG_H
+
+#ifndef _PACKAGENAME
+#define _PACKAGENAME "TrinityCore2 "
+#endif
+
+#include "Platform/Define.h"
+#include "revision.h" //-----here u are ------ _REVISION is the magic key
+
+#ifndef _VERSION
+#if PLATFORM == PLATFORM_WINDOWS
+# define _VERSION(REVD,REVT,REVN,REVH) "0.13.0-DEV" " (" REVD " " REVT " Revision " REVN " - " REVH ")"
+#else
+# define _VERSION(REVD,REVT,REVN,REVH) "@VERSION@" " (" REVD " " REVT " Revision " REVN " - " REVH ")"
+#endif
+#endif
+
+// Format is YYYYMMDDRR where RR is the change in the conf file
+// for that day.
+#ifndef _MANGOSDCONFVERSION
+# define _MANGOSDCONFVERSION 2008022901
+#endif
+#ifndef _REALMDCONFVERSION
+# define _REALMDCONFVERSION 2007062001
+#endif
+
+#if MANGOS_ENDIAN == MANGOS_BIGENDIAN
+# define _ENDIAN_STRING "big-endian"
+#else
+# define _ENDIAN_STRING "little-endian"
+#endif
+
+// The path to config files
+#ifndef SYSCONFDIR
+# define SYSCONFDIR ""
+#endif
+
+#if PLATFORM == PLATFORM_WINDOWS
+# ifdef _WIN64
+# define _ENDIAN_PLATFORM "Win64 (" _ENDIAN_STRING ")"
+# else
+# define _ENDIAN_PLATFORM "Win32 (" _ENDIAN_STRING ")"
+# endif
+# define _MANGOSD_CONFIG SYSCONFDIR"mangosd.conf"
+# define _REALMD_CONFIG SYSCONFDIR"realmd.conf"
+#else
+# define _ENDIAN_PLATFORM "Unix (" _ENDIAN_STRING ")"
+# define _MANGOSD_CONFIG SYSCONFDIR"mangosd.conf"
+# define _REALMD_CONFIG SYSCONFDIR"realmd.conf"
+#endif
+
+
+#define DEFAULT_PLAYER_LIMIT 100
+#define DEFAULT_WORLDSERVER_PORT 8085 //8129
+#define DEFAULT_REALMSERVER_PORT 3724
+#define DEFAULT_SOCKET_SELECT_TIME 10000
+#endif
diff --git a/src/shared/Timer.h b/src/shared/Timer.h
index 81b6bb58465..82f5be161d9 100644
--- a/src/shared/Timer.h
+++ b/src/shared/Timer.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp
index 26d2275ec2a..767b65e441c 100644
--- a/src/shared/Util.cpp
+++ b/src/shared/Util.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,27 +36,27 @@ static MTRandTSS mtRand;
int32 irand (int32 min, int32 max)
{
- return int32 (mtRand.get ().randInt (max - min)) + min;
+ return int32 (mtRand.get ().randInt (max - min)) + min;
}
uint32 urand (uint32 min, uint32 max)
{
- return mtRand.get ().randInt (max - min) + min;
+ return mtRand.get ().randInt (max - min) + min;
}
int32 rand32 ()
{
- return mtRand.get ().randInt ();
+ return mtRand.get ().randInt ();
}
double rand_norm(void)
{
- return mtRand.get ().randExc ();
+ return mtRand.get ().randExc ();
}
double rand_chance (void)
{
- return mtRand.get ().randExc (100.0);
+ return mtRand.get ().randExc (100.0);
}
Tokens StrSplit(const std::string &src, const std::string &sep)
@@ -254,8 +254,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
size_t len = utf8::distance(utf8str,utf8str+csize);
if(len > wsize)
{
+ if(wsize > 0)
+ wstr[0] = L'\0';
wsize = 0;
- wstr = L"";
return false;
}
@@ -265,8 +266,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
}
catch(std::exception)
{
+ if(wsize > 0)
+ wstr[0] = L'\0';
wsize = 0;
- wstr = L"";
return false;
}
diff --git a/src/shared/Util.h b/src/shared/Util.h
index 98e60f83319..adfbdad620a 100644
--- a/src/shared/Util.h
+++ b/src/shared/Util.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -287,20 +287,20 @@ bool consoleToUtf8(const std::string& conStr,std::string& utf8str);
bool Utf8FitTo(const std::string& str, std::wstring search);
#if PLATFORM == PLATFORM_WINDOWS
-#define UTF8PRINTF(OUT,FRM,RESERR) \
-{ \
- char temp_buf[6000]; \
- va_list ap; \
- va_start(ap, FRM); \
- size_t temp_len = vsnprintf(temp_buf,6000,FRM,ap); \
- va_end(ap); \
- \
- wchar_t wtemp_buf[6000]; \
- size_t wtemp_len = 6000-1; \
+#define UTF8PRINTF(OUT,FRM,RESERR) \
+{ \
+ char temp_buf[32*1024]; \
+ va_list ap; \
+ va_start(ap, FRM); \
+ size_t temp_len = vsnprintf(temp_buf,32*1024,FRM,ap); \
+ va_end(ap); \
+ \
+ wchar_t wtemp_buf[32*1024]; \
+ size_t wtemp_len = 32*1024-1; \
if(!Utf8toWStr(temp_buf,temp_len,wtemp_buf,wtemp_len)) \
- return RESERR; \
+ return RESERR; \
CharToOemBuffW(&wtemp_buf[0],&temp_buf[0],wtemp_len+1);\
- fprintf(OUT,temp_buf); \
+ fprintf(OUT,temp_buf); \
}
#else
#define UTF8PRINTF(OUT,FRM,RESERR) \
@@ -317,3 +317,231 @@ uint32 CreatePIDFile(const std::string& filename);
#endif
+//handler for operations on large flags
+#ifndef _FLAG96
+#define _FLAG96
+
+class flag96
+{
+private:
+ uint32 part[3];
+public:
+ flag96(uint32 p1=0,uint32 p2=0,uint32 p3=0)
+ {
+ part[0]=p1;
+ part[1]=p2;
+ part[2]=p3;
+ }
+
+ inline bool IsEqual(uint32 p1=0, uint32 p2=0, uint32 p3=0) const
+ {
+ return (
+ part[0]==p1 &&
+ part[1]==p2 &&
+ part[2]==p3);
+ };
+
+ inline bool HasFlag(uint32 p1=0, uint32 p2=0, uint32 p3=0) const
+ {
+ return (
+ part[0]&p1 ||
+ part[1]&p2 ||
+ part[2]&p3);
+ };
+
+ inline void Set(uint32 p1=0, uint32 p2=0, uint32 p3=0)
+ {
+ part[0]=p1;
+ part[1]=p2;
+ part[2]=p3;
+ };
+
+ template<class type>
+ inline bool operator < (type & right)
+ {
+ for (uint8 i=3;i>0;i--)
+ {
+ if (part[i-1]<right.part[i-1])
+ return 1;
+ else if (part[i-1]>right.part[i-1])
+ return 0;
+ }
+ return 0;
+ };
+
+ template<class type>
+ inline bool operator < (type & right) const
+ {
+ for (uint8 i=3;i>0;i--)
+ {
+ if (part[i-1]<right.part[i-1])
+ return 1;
+ else if (part[i-1]>right.part[i-1])
+ return 0;
+ }
+ return 0;
+ };
+
+ template<class type>
+ inline bool operator != (type & right)
+ {
+ if (part[0]!=right.part[0]
+ || part[1]!=right.part[1]
+ || part[2]!=right.part[2])
+ return true;
+ return false;
+ }
+
+ template<class type>
+ inline bool operator != (type & right) const
+ {
+ if (part[0]!=right.part[0]
+ || part[1]!=right.part[1]
+ || part[2]!=right.part[2])
+ return true;
+ return false;
+ };
+
+ template<class type>
+ inline bool operator == (type & right)
+ {
+ if (part[0]!=right.part[0]
+ || part[1]!=right.part[1]
+ || part[2]!=right.part[2])
+ return false;
+ return true;
+ };
+
+ template<class type>
+ inline bool operator == (type & right) const
+ {
+ if (part[0]!=right.part[0]
+ || part[1]!=right.part[1]
+ || part[2]!=right.part[2])
+ return false;
+ return true;
+ };
+
+ template<class type>
+ inline void operator = (type & right)
+ {
+ part[0]=right.part[0];
+ part[1]=right.part[1];
+ part[2]=right.part[2];
+ };
+
+ template<class type>
+ inline flag96 operator & (type & right)
+ {
+ flag96 ret(part[0] & right.part[0],part[1] & right.part[1],part[2] & right.part[2]);
+ return
+ ret;
+ };
+ template<class type>
+ inline flag96 operator & (type & right) const
+ {
+ flag96 ret(part[0] & right.part[0],part[1] & right.part[1],part[2] & right.part[2]);
+ return
+ ret;
+ };
+
+ template<class type>
+ inline void operator &= (type & right)
+ {
+ *this=*this & right;
+ };
+
+ template<class type>
+ inline flag96 operator | (type & right)
+ {
+ flag96 ret(part[0] | right.part[0],part[1] | right.part[1],part[2] | right.part[2]);
+ return
+ ret;
+ };
+
+ template<class type>
+ inline flag96 operator | (type & right) const
+ {
+ flag96 ret(part[0] | right.part[0],part[1] | right.part[1],part[2] | right.part[2]);
+ return
+ ret;
+ };
+
+ template<class type>
+ inline void operator |= (type & right)
+ {
+ *this=*this | right;
+ };
+
+ inline void operator ~ ()
+ {
+ part[2]=~part[2];
+ part[1]=~part[1];
+ part[0]=~part[0];
+ };
+
+ template<class type>
+ inline flag96 operator ^ (type & right)
+ {
+ flag96 ret(part[0] ^ right.part[0],part[1] ^ right.part[1],part[2] ^ right.part[2]);
+ return
+ ret;
+ };
+
+ template<class type>
+ inline flag96 operator ^ (type & right) const
+ {
+ flag96 ret(part[0] ^ right.part[0],part[1] ^ right.part[1],part[2] ^ right.part[2]);
+ return
+ ret;
+ };
+
+ template<class type>
+ inline void operator ^= (type & right)
+ {
+ *this=*this^right;
+ };
+
+ inline operator bool() const
+ {
+ return(
+ part[0] != 0 ||
+ part[1] != 0 ||
+ part[2] != 0);
+ };
+
+ inline operator bool()
+ {
+ return(
+ part[0] != 0 ||
+ part[1] != 0 ||
+ part[2] != 0);
+ };
+
+ inline bool operator ! () const
+ {
+ return(
+ part[0] == 0 &&
+ part[1] == 0 &&
+ part[2] == 0);
+ };
+
+ inline bool operator ! ()
+ {
+ return(
+ part[0] == 0 &&
+ part[1] == 0 &&
+ part[2] == 0);
+ };
+
+ inline uint32 & operator[](uint8 el)
+ {
+ return (part[el]);
+ };
+
+ inline const uint32 & operator[](uint8 el) const
+ {
+ return (part[el]);
+ };
+};
+#endif
diff --git a/src/shared/WorldPacket.h b/src/shared/WorldPacket.h
index 8849b790f01..1eb3f12dd86 100644
--- a/src/shared/WorldPacket.h
+++ b/src/shared/WorldPacket.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/BaseModel.cpp b/src/shared/vmap/BaseModel.cpp
index f4bf13bc558..2ffd5672218 100644
--- a/src/shared/vmap/BaseModel.cpp
+++ b/src/shared/vmap/BaseModel.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/BaseModel.h b/src/shared/vmap/BaseModel.h
index 6c17f704692..098e1d9381b 100644
--- a/src/shared/vmap/BaseModel.h
+++ b/src/shared/vmap/BaseModel.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/CoordModelMapping.cpp b/src/shared/vmap/CoordModelMapping.cpp
index 319e7bb8c31..c362101ffb4 100644
--- a/src/shared/vmap/CoordModelMapping.cpp
+++ b/src/shared/vmap/CoordModelMapping.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/CoordModelMapping.h b/src/shared/vmap/CoordModelMapping.h
index cfaa600ee81..7c89f0e8a0f 100644
--- a/src/shared/vmap/CoordModelMapping.h
+++ b/src/shared/vmap/CoordModelMapping.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/DebugCmdLogger.cpp b/src/shared/vmap/DebugCmdLogger.cpp
index 2552a16acc2..de656f4cfc5 100644
--- a/src/shared/vmap/DebugCmdLogger.cpp
+++ b/src/shared/vmap/DebugCmdLogger.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/DebugCmdLogger.h b/src/shared/vmap/DebugCmdLogger.h
index a194d335381..5493ab6f332 100644
--- a/src/shared/vmap/DebugCmdLogger.h
+++ b/src/shared/vmap/DebugCmdLogger.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/IVMapManager.h b/src/shared/vmap/IVMapManager.h
index 01aef4b9d4c..243a15aef73 100644
--- a/src/shared/vmap/IVMapManager.h
+++ b/src/shared/vmap/IVMapManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/Makefile.am b/src/shared/vmap/Makefile.am
new file mode 100644
index 00000000000..483a926c907
--- /dev/null
+++ b/src/shared/vmap/Makefile.am
@@ -0,0 +1,58 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../framework -I$(srcdir)/../../shared -I$(srcdir)/../../../dep/include/g3dlite
+
+## Build MaNGOS shared library and its parts as convenience library.
+# All libraries will be convenience libraries. Might be changed to shared
+# later.
+noinst_LIBRARIES = libmangosvmaps.a
+
+libmangosvmaps_a_SOURCES = \
+ AABSPTree.h \
+ BaseModel.cpp \
+ BaseModel.h \
+ CoordModelMapping.cpp \
+ CoordModelMapping.h \
+ DebugCmdLogger.cpp \
+ DebugCmdLogger.h \
+ IVMapManager.h \
+ ManagedModelContainer.cpp \
+ ManagedModelContainer.h \
+ ModelContainer.cpp \
+ ModelContainer.h \
+ NodeValueAccess.h \
+ ShortBox.h \
+ ShortVector.h \
+ SubModel.cpp \
+ SubModel.h \
+ TileAssembler.cpp \
+ TileAssembler.h \
+ TreeNode.cpp \
+ TreeNode.h \
+ VMapDefinitions.h \
+ VMapFactory.cpp \
+ VMapFactory.h \
+ VMapManager.cpp \
+ VMapManager.h \
+ VMapTools.h
diff --git a/src/shared/vmap/ManagedModelContainer.cpp b/src/shared/vmap/ManagedModelContainer.cpp
index 1362002bafd..c7bfefe7179 100644
--- a/src/shared/vmap/ManagedModelContainer.cpp
+++ b/src/shared/vmap/ManagedModelContainer.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/ManagedModelContainer.h b/src/shared/vmap/ManagedModelContainer.h
index 33c675d0806..e6862f915c7 100644
--- a/src/shared/vmap/ManagedModelContainer.h
+++ b/src/shared/vmap/ManagedModelContainer.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/ModelContainer.cpp b/src/shared/vmap/ModelContainer.cpp
index 9eb100161d8..4a722d2585b 100644
--- a/src/shared/vmap/ModelContainer.cpp
+++ b/src/shared/vmap/ModelContainer.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/ModelContainer.h b/src/shared/vmap/ModelContainer.h
index 9613bf53d96..abc96261050 100644
--- a/src/shared/vmap/ModelContainer.h
+++ b/src/shared/vmap/ModelContainer.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/NodeValueAccess.h b/src/shared/vmap/NodeValueAccess.h
index e14a6dba676..54fc5ee99b6 100644
--- a/src/shared/vmap/NodeValueAccess.h
+++ b/src/shared/vmap/NodeValueAccess.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/ShortBox.h b/src/shared/vmap/ShortBox.h
index bffca0d806d..0e98677aa9e 100644
--- a/src/shared/vmap/ShortBox.h
+++ b/src/shared/vmap/ShortBox.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/ShortVector.h b/src/shared/vmap/ShortVector.h
index f7dd0f74859..5f0fb7d9fd8 100644
--- a/src/shared/vmap/ShortVector.h
+++ b/src/shared/vmap/ShortVector.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/SubModel.cpp b/src/shared/vmap/SubModel.cpp
index c6022d2ed69..370c80062d6 100644
--- a/src/shared/vmap/SubModel.cpp
+++ b/src/shared/vmap/SubModel.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/SubModel.h b/src/shared/vmap/SubModel.h
index c52dc7f5c51..89ea9b91d7b 100644
--- a/src/shared/vmap/SubModel.h
+++ b/src/shared/vmap/SubModel.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/TileAssembler.cpp b/src/shared/vmap/TileAssembler.cpp
index e6a1a6f448b..64d67205f68 100644
--- a/src/shared/vmap/TileAssembler.cpp
+++ b/src/shared/vmap/TileAssembler.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -75,12 +75,12 @@ namespace VMAP
addWorldAreaMapId(0); //Azeroth
addWorldAreaMapId(1); //Kalimdor
addWorldAreaMapId(530); //Expansion01
+ addWorldAreaMapId(571); //Expansion02
}
//=================================================================
std::string getModNameFromModPosName(const std::string& pModPosName)
{
-
size_t spos = pModPosName.find_first_of('#');
std::string modelFileName = pModPosName.substr(0,spos);
return(modelFileName);
@@ -142,7 +142,6 @@ namespace VMAP
//=================================================================
bool TileAssembler::convertWorld()
{
-
#ifdef _ASSEMBLER_DEBUG
# ifdef _DEBUG
::g_df = fopen("../TileAssembler_debug.txt", "wb");
diff --git a/src/shared/vmap/TileAssembler.h b/src/shared/vmap/TileAssembler.h
index a2fe8055fcf..d2183794a9e 100644
--- a/src/shared/vmap/TileAssembler.h
+++ b/src/shared/vmap/TileAssembler.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/TreeNode.cpp b/src/shared/vmap/TreeNode.cpp
index 113199235bf..c884f9b3b1d 100644
--- a/src/shared/vmap/TreeNode.cpp
+++ b/src/shared/vmap/TreeNode.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/TreeNode.h b/src/shared/vmap/TreeNode.h
index d71396487b9..1b9532001e5 100644
--- a/src/shared/vmap/TreeNode.h
+++ b/src/shared/vmap/TreeNode.h
@@ -1,7 +1,7 @@
/*
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
-* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapDefinitions.h b/src/shared/vmap/VMapDefinitions.h
index 0800bfbda88..fd28a91d515 100644
--- a/src/shared/vmap/VMapDefinitions.h
+++ b/src/shared/vmap/VMapDefinitions.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapFactory.cpp b/src/shared/vmap/VMapFactory.cpp
index 2dad2047189..5189f79daba 100644
--- a/src/shared/vmap/VMapFactory.cpp
+++ b/src/shared/vmap/VMapFactory.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapFactory.h b/src/shared/vmap/VMapFactory.h
index 9a4493d8817..f3375d723c1 100644
--- a/src/shared/vmap/VMapFactory.h
+++ b/src/shared/vmap/VMapFactory.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapManager.cpp b/src/shared/vmap/VMapManager.cpp
index 3b93b63086b..f5c2640be70 100644
--- a/src/shared/vmap/VMapManager.cpp
+++ b/src/shared/vmap/VMapManager.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapManager.h b/src/shared/vmap/VMapManager.h
index 8ece6de4652..bfeba3cfe67 100644
--- a/src/shared/vmap/VMapManager.h
+++ b/src/shared/vmap/VMapManager.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/shared/vmap/VMapTools.h b/src/shared/vmap/VMapTools.h
index 4961064d188..3af3a29310d 100644
--- a/src/shared/vmap/VMapTools.h
+++ b/src/shared/vmap/VMapTools.h
@@ -1,7 +1,7 @@
/*
-* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
-* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
new file mode 100644
index 00000000000..81040a49592
--- /dev/null
+++ b/src/tools/Makefile.am
@@ -0,0 +1,23 @@
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## Sub-directories to parse
+SUBDIRS = genrevision
+
+## Additional files to include when running 'make dist'
+# Nothing yet.
diff --git a/src/tools/genrevision/Makefile.am b/src/tools/genrevision/Makefile.am
new file mode 100644
index 00000000000..3f60ac14ab2
--- /dev/null
+++ b/src/tools/genrevision/Makefile.am
@@ -0,0 +1,35 @@
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = -I$(srcdir)
+
+## Build world list daemon as standalone program
+bin_PROGRAMS = genrevision
+genrevision_SOURCES = \
+ genrevision.cpp
+
+## Link world daemon against the shared library
+genrevision_LDADD =
+genrevision_LDFLAGS = -L$(libdir)
+
+## Additional files to include when running 'make dist'
+# Include world daemon configuration
+#EXTRA_DIST =
+
+## Additional files to install
diff --git a/src/trinitycore/CMakeLists.txt b/src/trinitycore/CMakeLists.txt
index 2c7c4544577..7cd012d9f45 100644
--- a/src/trinitycore/CMakeLists.txt
+++ b/src/trinitycore/CMakeLists.txt
@@ -2,14 +2,14 @@
########### next target ###############
SET(trinity-core_SRCS
-CliRunnable.cpp
-CliRunnable.h
-Main.cpp
-Master.cpp
-Master.h
-RASocket.cpp
-RASocket.h
-WorldRunnable.cpp
+CliRunnable.cpp
+CliRunnable.h
+Main.cpp
+Master.cpp
+Master.h
+RASocket.cpp
+RASocket.h
+WorldRunnable.cpp
WorldRunnable.h
)
diff --git a/src/trinitycore/CliRunnable.cpp b/src/trinitycore/CliRunnable.cpp
index 839358e7034..91f37cd1b48 100644
--- a/src/trinitycore/CliRunnable.cpp
+++ b/src/trinitycore/CliRunnable.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -82,19 +82,10 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
}
/// Commands not recommended call from chat, but support anyway
- if(m_session)
- {
- uint32 targetSecurity = accmgr.GetSecurity(account_id);
-
- /// can delete only for account with less security
- /// This is also reject self apply in fact
- if (targetSecurity >= m_session->GetSecurity())
- {
- SendSysMessage (LANG_YOURS_SECURITY_IS_LOW);
- SetSentErrorMessage (true);
- return false;
- }
- }
+ /// can delete only for account with less security
+ /// This is also reject self apply in fact
+ if(HasLowerSecurityAccount (NULL,account_id,true))
+ return false;
AccountOpResult result = accmgr.DeleteAccount(account_id);
switch(result)
@@ -177,12 +168,15 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* args)
///- Get the list of accounts ID logged to the realm
QueryResult *resultDB = CharacterDatabase.Query("SELECT name,account FROM characters WHERE online > 0");
if (!resultDB)
+ {
+ SendSysMessage(LANG_ACCOUNT_LIST_EMPTY);
return true;
+ }
///- Display the list of account/characters online
- SendSysMessage("=====================================================================");
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
SendSysMessage(LANG_ACCOUNT_LIST_HEADER);
- SendSysMessage("=====================================================================");
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
///- Circle through accounts
do
@@ -199,7 +193,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* args)
if(resultLogin)
{
Field *fieldsLogin = resultLogin->Fetch();
- PSendSysMessage("|%15s| %20s | %15s |%4d|%5d|",
+ PSendSysMessage(LANG_ACCOUNT_LIST_LINE,
fieldsLogin[0].GetString(),name.c_str(),fieldsLogin[1].GetString(),fieldsLogin[2].GetUInt32(),fieldsLogin[3].GetUInt32());
delete resultLogin;
@@ -211,7 +205,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* args)
delete resultDB;
- SendSysMessage("=====================================================================");
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
return true;
}
@@ -259,6 +253,20 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
}
/// Set the level of logging
+bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args)
+{
+ if(!*args)
+ return false;
+
+ char *NewLevel = strtok((char*)args, " ");
+ if (!NewLevel)
+ return false;
+
+ sLog.SetLogFileLevel(NewLevel);
+ return true;
+}
+
+/// Set the level of logging
bool ChatHandler::HandleServerSetLogLevelCommand(const char *args)
{
if(!*args)
@@ -318,7 +326,7 @@ void CliRunnable::run()
char commandbuf[256];
///- Display the list of available CLI functions then beep
- sLog.outString();
+ sLog.outString("");
if(sConfig.GetBoolDefault("BeepAtStart", true))
printf("\a"); // \a = Alert
@@ -373,4 +381,3 @@ void CliRunnable::run()
///- End the database thread
WorldDatabase.ThreadEnd(); // free mySQL thread resources
}
-
diff --git a/src/trinitycore/CliRunnable.h b/src/trinitycore/CliRunnable.h
index ea60ef695bc..20ff58f27ba 100644
--- a/src/trinitycore/CliRunnable.h
+++ b/src/trinitycore/CliRunnable.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,4 +33,3 @@ class CliRunnable : public ZThread::Runnable
};
#endif
/// @}
-
diff --git a/src/trinitycore/Main.cpp b/src/trinitycore/Main.cpp
index 4be314d75f3..7b00073026d 100644
--- a/src/trinitycore/Main.cpp
+++ b/src/trinitycore/Main.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,8 +21,6 @@
/// \addtogroup Trinityd Trinity Daemon
/// @{
/// \file
-#include "SystemConfig.h"
-#include "revision.h"
#include "Common.h"
#include "Database/DatabaseEnv.h"
@@ -31,18 +29,18 @@
#include "Master.h"
#ifndef _TRINITY_CORE_CONFIG
-# define _TRINITY_CORE_CONFIG "trinitycore.conf"
+# define _TRINITY_CORE_CONFIG "TrinityCore.conf"
#endif //_TRINITY_CORE_CONFIG
// Format is YYYYMMDDRR where RR is the change in the conf file
// for that day.
#ifndef _TRINITY_CORE_CONFVER
-# define _TRINITY_CORE_CONFVER 2008022901
+# define _TRINITY_CORE_CONFVER 2009032201
#endif //_TRINITY_CORE_CONFVER
#ifdef WIN32
#include "ServiceWin32.h"
-char serviceName[] = "Trinityd";
+char serviceName[] = "TrinityCore";
char serviceLongName[] = "Trinity core service";
char serviceDescription[] = "Massive Network Game Object Server";
/*
@@ -64,7 +62,6 @@ uint32 realmID; ///< Id of the realm
void usage(const char *prog)
{
sLog.outString("Usage: \n %s [<options>]\n"
- " --version print version and exit\n\r"
" -c config_file use config_file as configuration file\n\r"
#ifdef WIN32
" Running as service functions:\n\r"
@@ -95,12 +92,6 @@ extern int main(int argc, char **argv)
cfg_file = argv[c];
}
- if( strcmp(argv[c],"--version") == 0)
- {
- printf("%s\n", _FULLVERSION);
- return 0;
- }
-
#ifdef WIN32
////////////
//Services//
@@ -172,4 +163,3 @@ extern int main(int argc, char **argv)
}
/// @}
-
diff --git a/src/trinitycore/Makefile.am b/src/trinitycore/Makefile.am
new file mode 100644
index 00000000000..7e1cd086d3c
--- /dev/null
+++ b/src/trinitycore/Makefile.am
@@ -0,0 +1,62 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../game -I$(srcdir) -DSYSCONFDIR=\"$(sysconfdir)/\"
+
+## Build world list daemon as standalone program
+bin_PROGRAMS = trinity-worldd
+trinity_worldd_SOURCES = \
+ CliRunnable.cpp \
+ CliRunnable.h \
+ Main.cpp \
+ Master.cpp \
+ Master.h \
+ RASocket.cpp \
+ RASocket.h \
+ WorldRunnable.cpp \
+ WorldRunnable.h
+
+## Link world daemon against the shared library
+trinity_worldd_LDADD = ../bindings/scripts/libtrinityscript.la ../game/libmangosgame.a ../shared/Database/libmangosdatabase.a ../shared/Config/libmangosconfig.a ../shared/Auth/libmangosauth.a ../shared/libmangosshared.a ../shared/vmap/libmangosvmaps.a ../framework/libmangosframework.a ../../dep/src/sockets/libmangossockets.a ../../dep/src/zthread/libZThread.la ../../dep/src/g3dlite/libg3dlite.a
+trinity_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/zthread -L../../dep/src/g3dlite -L../bindings/scripts/ -L$(libdir) $(TRINI_LIBS) -export-dynamic
+
+## Additional files to include when running 'make dist'
+# Include world daemon configuration
+EXTRA_DIST = \
+ mangosd.conf.dist
+
+## Additional files to install
+sysconf_DATA = \
+ mangosd.conf.dist
+
+install-data-hook:
+ @list='$(sysconf_DATA)'; for p in $$list; do \
+ dest=`echo $$p | sed -e s/.dist//`; \
+ if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \
+ echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \
+ else \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \
+ fi; \
+ done
+
+clean-local:
+ rm -f $(sysconf_DATA)
diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp
index 8fd5af08800..a478f18daa9 100644
--- a/src/trinitycore/Master.cpp
+++ b/src/trinitycore/Master.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -118,72 +118,74 @@ public:
class RARunnable : public ZThread::Runnable
{
public:
- uint32 numLoops, loopCounter;
-
- RARunnable ()
- {
- uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
- numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
- loopCounter = 0;
- }
-
- void
- checkping ()
- {
- // ping if need
- if ((++loopCounter) == numLoops)
- {
+ uint32 numLoops, loopCounter;
+
+ RARunnable ()
+ {
+ uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
+ numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
loopCounter = 0;
- sLog.outDetail ("Ping MySQL to keep connection alive");
- delete WorldDatabase.Query ("SELECT 1 FROM command LIMIT 1");
- delete LoginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1");
- delete CharacterDatabase.Query ("SELECT 1 FROM bugreport LIMIT 1");
- }
- }
-
- void
- run (void)
- {
- SocketHandler h;
-
- // Launch the RA listener socket
- ListenSocket<RASocket> RAListenSocket (h);
- bool usera = sConfig.GetBoolDefault ("Ra.Enable", false);
-
- if (usera)
- {
- port_t raport = sConfig.GetIntDefault ("Ra.Port", 3443);
- std::string stringip = sConfig.GetStringDefault ("Ra.IP", "0.0.0.0");
- ipaddr_t raip;
- if (!Utility::u2ip (stringip, raip))
- sLog.outError ("Trinity RA can not bind to ip %s", stringip.c_str ());
- else if (RAListenSocket.Bind (raip, raport))
- sLog.outError ("Trinity RA can not bind to port %d on %s", raport, stringip.c_str ());
- else
- {
- h.Add (&RAListenSocket);
+ }
+
+ void checkping ()
+ {
+ // ping if need
+ if ((++loopCounter) == numLoops)
+ {
+ loopCounter = 0;
+ sLog.outDetail ("Ping MySQL to keep connection alive");
+ delete WorldDatabase.Query ("SELECT 1 FROM command LIMIT 1");
+ delete LoginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1");
+ delete CharacterDatabase.Query ("SELECT 1 FROM bugreport LIMIT 1");
+ }
+ }
- sLog.outString ("Starting Remote access listner on port %d on %s", raport, stringip.c_str ());
- }
- }
+ void run ()
+ {
+ SocketHandler h;
- // Socket Selet time is in microseconds , not miliseconds!!
- uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
+ // Launch the RA listener socket
+ ListenSocket<RASocket> RAListenSocket (h);
+ bool usera = sConfig.GetBoolDefault ("Ra.Enable", false);
- // if use ra spend time waiting for io, if not use ra ,just sleep
- if (usera)
- while (!World::IsStopped())
+ if (usera)
{
- h.Select (0, socketSelecttime);
- checkping ();
+ port_t raport = sConfig.GetIntDefault ("Ra.Port", 3443);
+ std::string stringip = sConfig.GetStringDefault ("Ra.IP", "0.0.0.0");
+ ipaddr_t raip;
+ if (!Utility::u2ip (stringip, raip))
+ sLog.outError ("MaNGOS RA can not bind to ip %s", stringip.c_str ());
+ else if (RAListenSocket.Bind (raip, raport))
+ sLog.outError ("MaNGOS RA can not bind to port %d on %s", raport, stringip.c_str ());
+ else
+ {
+ h.Add (&RAListenSocket);
+
+ sLog.outString ("Starting Remote access listner on port %d on %s", raport, stringip.c_str ());
+ }
}
- else
- while (!World::IsStopped())
+
+ // Socket Selet time is in microseconds , not miliseconds!!
+ uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
+
+ // if use ra spend time waiting for io, if not use ra ,just sleep
+ if (usera)
{
- ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000));
- checkping ();
+ while (!World::IsStopped())
+ {
+ h.Select (0, socketSelecttime);
+ checkping ();
+ }
}
- }
+ else
+ {
+ while (!World::IsStopped())
+ {
+ ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000));
+ checkping ();
+ }
+ }
+ }
};
Master::Master()
@@ -200,15 +202,15 @@ int Master::Run()
sLog.outString( "%s (core-daemon)", _FULLVERSION );
sLog.outString( "<Ctrl-C> to stop.\n" );
- sLog.outTitle( " ______ __");
- sLog.outTitle( "/\\__ _\\ __ __/\\ \\__");
- sLog.outTitle( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __");
- sLog.outTitle( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
- sLog.outTitle( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
- sLog.outTitle( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
- sLog.outTitle( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
- sLog.outTitle( " C O R E /\\___/");
- sLog.outTitle( "http://TrinityCore.org \\/__/\n");
+ sLog.outString( " ______ __");
+ sLog.outString( "/\\__ _\\ __ __/\\ \\__");
+ sLog.outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __");
+ sLog.outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
+ sLog.outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
+ sLog.outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
+ sLog.outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
+ sLog.outString( " C O R E /\\___/");
+ sLog.outString( "http://TrinityCore.org \\/__/\n");
/// worldd PID file creation
std::string pidfile = sConfig.GetStringDefault("PidFile", "");
@@ -280,7 +282,7 @@ int Master::Run()
sLog.outError("Can't set used processors (hex): %x",curAff);
}
}
- sLog.outString();
+ sLog.outString("");
}
bool Prio = sConfig.GetBoolDefault("ProcessPriority", false);
@@ -292,7 +294,7 @@ int Master::Run()
sLog.outString("TrinityCore process priority class set to HIGH");
else
sLog.outError("ERROR: Can't set Trinityd process priority class.");
- sLog.outString();
+ sLog.outString("");
}
}
#endif
@@ -317,14 +319,14 @@ int Master::Run()
}
///- Launch the world listener socket
- port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD);
- std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0");
+ port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD);
+ std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0");
- if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1)
+ if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1)
{
- sLog.outError ("Failed to start network");
- World::StopNow(ERROR_EXIT_CODE);
- // go down and shutdown the server
+ sLog.outError ("Failed to start network");
+ World::StopNow(ERROR_EXIT_CODE);
+ // go down and shutdown the server
}
sWorldSocketMgr->Wait ();
@@ -401,14 +403,15 @@ int Master::Run()
/// Initialize connection to the databases
bool Master::_StartDB()
{
- ///- Get world database info from configuration file
std::string dbstring;
- if(!sConfig.GetString("WorldDatabaseInfo", &dbstring))
+
+ ///- Get world database info from configuration file
+ dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", "");
+ if(dbstring.empty())
{
sLog.outError("Database not specified in configuration file");
return false;
}
- sLog.outDetail("World Database: %s", dbstring.c_str());
///- Initialise the world database
if(!WorldDatabase.Initialize(dbstring.c_str()))
@@ -417,12 +420,13 @@ bool Master::_StartDB()
return false;
}
- if(!sConfig.GetString("CharacterDatabaseInfo", &dbstring))
+ ///- Get character database info from configuration file
+ dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", "");
+ if(dbstring.empty())
{
sLog.outError("Character Database not specified in configuration file");
return false;
}
- sLog.outDetail("Character Database: %s", dbstring.c_str());
///- Initialise the Character database
if(!CharacterDatabase.Initialize(dbstring.c_str()))
@@ -432,14 +436,14 @@ bool Master::_StartDB()
}
///- Get login database info from configuration file
- if(!sConfig.GetString("LoginDatabaseInfo", &dbstring))
+ dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
+ if(dbstring.empty())
{
sLog.outError("Login database not specified in configuration file");
return false;
}
///- Initialise the login database
- sLog.outDetail("Login Database: %s", dbstring.c_str() );
if(!LoginDatabase.Initialize(dbstring.c_str()))
{
sLog.outError("Cannot connect to login database %s",dbstring.c_str());
@@ -455,6 +459,20 @@ bool Master::_StartDB()
}
sLog.outString("Realm running as realm ID %d", realmID);
+ ///- Initialize the DB logging system
+ if(sConfig.GetBoolDefault("EnableLogDB", false))
+ {
+ // everything successful - set var to enable DB logging once startup finished.
+ sLog.SetLogDBLater(true);
+ sLog.SetLogDB(false);
+ sLog.SetRealmID(realmID);
+ }
+ else
+ {
+ sLog.SetLogDBLater(false);
+ sLog.SetLogDB(false);
+ }
+
///- Clean the database before starting
clearOnlineAccounts();
@@ -463,7 +481,8 @@ bool Master::_StartDB()
sWorld.LoadDBVersion();
- sLog.outString("Using %s", sWorld.GetDBVersion());
+ sLog.outString("Using World DB: %s", sWorld.GetDBVersion());
+ sLog.outString("Using creature EventAI: %s", sWorld.GetCreatureEventAIVersion());
return true;
}
@@ -476,8 +495,10 @@ void Master::clearOnlineAccounts()
"UPDATE account SET online = 0 WHERE online > 0 "
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);
-
CharacterDatabase.Execute("UPDATE characters SET online = 0 WHERE online<>0");
+
+ // Battleground instance ids reset at server restart
+ CharacterDatabase.Execute("UPDATE characters SET bgid = 0 WHERE bgid<>0");
}
/// Handle termination signals
@@ -518,4 +539,3 @@ void Master::_UnhookSignals()
signal(SIGBREAK, 0);
#endif
}
-
diff --git a/src/trinitycore/Master.h b/src/trinitycore/Master.h
index 456202594f6..967f497051a 100644
--- a/src/trinitycore/Master.h
+++ b/src/trinitycore/Master.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,4 +50,3 @@ class Master
#define sMaster Trinity::Singleton<Master>::Instance()
#endif
/// @}
-
diff --git a/src/trinitycore/RASocket.cpp b/src/trinitycore/RASocket.cpp
index 62a5dbc39c9..370340859d3 100644
--- a/src/trinitycore/RASocket.cpp
+++ b/src/trinitycore/RASocket.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ RASocket::~RASocket()
///- Delete buffer and decrease active admins count
delete [] buff;
- sLog.outRALog("Connection was closed.\n");
+ sLog.outRemote("Connection was closed.\n");
if(stage==OK)
iUsers--;
@@ -79,7 +79,7 @@ RASocket::~RASocket()
void RASocket::OnAccept()
{
std::string ss=GetRemoteAddress();
- sLog.outRALog("Incoming connection from %s.\n",ss.c_str());
+ sLog.outRemote("Incoming connection from %s.\n",ss.c_str());
///- If there is already an active admin, drop the connection
if(iUsers)
dropclient
@@ -97,7 +97,7 @@ void RASocket::OnRead()
unsigned int sz=ibuf.GetLength();
if(iInputLength+sz>=RA_BUFF_SIZE)
{
- sLog.outRALog("Input buffer overflow, possible DOS attack.\n");
+ sLog.outRemote("Input buffer overflow, possible DOS attack.\n");
SetCloseAndDelete();
return;
}
@@ -160,7 +160,7 @@ void RASocket::OnRead()
if(!result)
{
Sendf("-No such user.\r\n");
- sLog.outRALog("User %s does not exist.\n",szLogin.c_str());
+ sLog.outRemote("User %s does not exist.\n",szLogin.c_str());
if(bSecure)SetCloseAndDelete();
}
else
@@ -173,7 +173,7 @@ void RASocket::OnRead()
if(fields[0].GetUInt32()<iMinLevel)
{
Sendf("-Not enough privileges.\r\n");
- sLog.outRALog("User %s has no privilege.\n",szLogin.c_str());
+ sLog.outRemote("User %s has no privilege.\n",szLogin.c_str());
if(bSecure)SetCloseAndDelete();
} else
{
@@ -208,14 +208,14 @@ void RASocket::OnRead()
++iUsers;
Sendf("+Logged in.\r\n");
- sLog.outRALog("User %s has logged in.\n",szLogin.c_str());
+ sLog.outRemote("User %s has logged in.\n",szLogin.c_str());
Sendf("TC>");
}
else
{
///- Else deny access
Sendf("-Wrong pass.\r\n");
- sLog.outRALog("User %s has failed to log in.\n",szLogin.c_str());
+ sLog.outRemote("User %s has failed to log in.\n",szLogin.c_str());
if(bSecure)SetCloseAndDelete();
}
}
@@ -224,7 +224,7 @@ void RASocket::OnRead()
case OK:
if(strlen(buff))
{
- sLog.outRALog("Got '%s' cmd.\n",buff);
+ sLog.outRemote("Got '%s' cmd.\n",buff);
sWorld.QueueCliCommand(&RASocket::zprint , buff);
}
else
@@ -257,4 +257,3 @@ void RASocket::zprint( const char * szText )
#endif
}
-
diff --git a/src/trinitycore/RASocket.h b/src/trinitycore/RASocket.h
index 145afd52c60..8900e689b2c 100644
--- a/src/trinitycore/RASocket.h
+++ b/src/trinitycore/RASocket.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,4 +65,3 @@ class RASocket: public TcpSocket
};
#endif
/// @}
-
diff --git a/src/trinitycore/TrinityCore.rc b/src/trinitycore/TrinityCore.rc
index 4e6510c0407..0acad1e4ba2 100644
--- a/src/trinitycore/TrinityCore.rc
+++ b/src/trinitycore/TrinityCore.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.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
diff --git a/src/trinitycore/WorldRunnable.cpp b/src/trinitycore/WorldRunnable.cpp
index 73d99e66061..e49e4ad74b8 100644
--- a/src/trinitycore/WorldRunnable.cpp
+++ b/src/trinitycore/WorldRunnable.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,13 +29,19 @@
#include "Timer.h"
#include "ObjectAccessor.h"
#include "MapManager.h"
+#include "BattleGroundMgr.h"
#include "Database/DatabaseEnv.h"
-#if (defined(SHORT_SLEEP) || defined(WIN32))
+#if (defined(WIN32) || defined(SHORT_SLEEP))
#define WORLD_SLEEP_CONST 50
#else
-#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms]
+#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms]
+#endif
+
+#ifdef WIN32
+#include "ServiceWin32.h"
+extern int m_ServiceStatus;
#endif
/// Heartbeat for the World
@@ -43,6 +49,8 @@ void WorldRunnable::run()
{
///- Init new SQL thread for the world database
WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough)
+ CharacterDatabase.ThreadStart();
+ LoginDatabase.ThreadStart();
sWorld.InitResultQueue();
uint32 realCurrTime = 0;
@@ -72,16 +80,25 @@ void WorldRunnable::run()
}
else
prevSleepTime = 0;
+
+ #ifdef WIN32
+ if (m_ServiceStatus == 0) World::StopNow(SHUTDOWN_EXIT_CODE);
+ while (m_ServiceStatus == 2) Sleep(1000);
+ #endif
}
sWorld.KickAll(); // save and kick all players
sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call
+ // unload battleground templates before different singletons destroyed
+ sBattleGroundMgr.DeleteAllBattleGrounds();
+
sWorldSocketMgr->StopNetwork();
MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory)
///- End the database thread
WorldDatabase.ThreadEnd(); // free mySQL thread resources
+ CharacterDatabase.ThreadStart();
+ LoginDatabase.ThreadEnd();
}
-
diff --git a/src/trinitycore/WorldRunnable.h b/src/trinitycore/WorldRunnable.h
index b84e5b6a04c..8df3a6a0c89 100644
--- a/src/trinitycore/WorldRunnable.h
+++ b/src/trinitycore/WorldRunnable.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,4 +33,3 @@ class WorldRunnable : public ZThread::Runnable
};
#endif
/// @}
-
diff --git a/src/trinitycore/resource.h b/src/trinitycore/resource.h
index fbc730320b4..7dc5cb9ef7b 100644
--- a/src/trinitycore/resource.h
+++ b/src/trinitycore/resource.h
@@ -13,4 +13,3 @@
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-
diff --git a/src/trinitycore/run-mangosd b/src/trinitycore/run-mangosd
index f307bd9e1ad..4a146804e81 100644
--- a/src/trinitycore/run-mangosd
+++ b/src/trinitycore/run-mangosd
@@ -6,7 +6,7 @@ while :
do
echo "TrinityCore daemon restarted"
echo `date` >> crash.log &
- ./mangosd | tail -n 20 >> crash.log
+ ./mangosd | tail -n 20 >> crash.log
echo " " >> crash.log &
pid=`ps ax | awk '($5 ~ /trinitycore/) { print $1 }'`
wait $pid
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index fcc093e811a..018ddf378b5 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1,7 +1,7 @@
##########################################
# Trinity Core worldd configuration file #
##########################################
-ConfVersion=2009010301
+ConfVersion=2009032201
###################################################################################################################
# CONNECTIONS AND DIRECTORIES
@@ -25,11 +25,15 @@ ConfVersion=2009010301
# WorldDatabaseInfo
# CharacterDatabaseInfo
# Database connection settings for the world server.
-# Default: hostname;port;username;password;database
-# .;somenumber;username;password;database - use named pipes at Windows
-# Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini
-# .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux
-# Unix sockets: experimental, not tested
+# Default:
+# ---MYSQL---
+# hostname;port;username;password;database
+# .;somenumber;username;password;database - use named pipes at Windows
+# Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini
+# .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux
+# ---PGSQL---
+# hostname;port;username;password;database
+# .;/path/to/unix_socket/DIRECTORY or . for default path;username;password;database - use Unix sockets at Unix/Linux
#
# MaxPingTime
# Settings for maximum database-ping interval (minutes between pings)
@@ -109,7 +113,7 @@ EAIErrorLevel = 2
#
# SocketSelectTime
# Socket select time (in milliseconds)
-# Default: 10000
+# Default: 10000 (10 secs)
#
# GridCleanUpDelay
# Grid clean up delay (in milliseconds)
@@ -127,15 +131,11 @@ EAIErrorLevel = 2
# Player save interval (in milliseconds)
# Default: 900000 (15 min)
#
-# DisconnectToleranceInterval
-# Tolerance for disconnected players before putting in the queue. (in seconds)
-# Default: 0 (disabled)
-#
# vmap.enableLOS
# vmap.enableHeight
# Enable/Disable VMmap support for line of sight and height calculation
-# Default: 1 (true)
-# 0 (false)
+# Default: 0 (disable)
+# 1 (enable)
#
# vmap.ignoreMapIds
# Map id that will be ignored by VMaps
@@ -163,6 +163,15 @@ EAIErrorLevel = 2
# Update realm uptime period in minutes (for save data in 'uptime' table). Must be > 0
# Default: 10 (minutes)
#
+# LogDB.Opt.ClearInterval
+# Time for the WUPDATE_CLEANDB timer that clears the `logs` table of old entries. Must be > 0.
+# Default: 10 (minutes)
+#
+# LogDB.Opt.ClearTime
+# The maximum time in seconds of old `logs` table entries to keep.
+# Default: 1209600 (14 days)
+# 0 - don't clear
+#
# MaxCoreStuckTime
# Periodically check if the process got freezed, if this is the case force crash after the specified
# amount of seconds. Must be > 0. Recommended > 10 secs if you use this.
@@ -188,7 +197,6 @@ GridCleanUpDelay = 300000
MapUpdateInterval = 100
ChangeWeatherInterval = 600000
PlayerSaveInterval = 900000
-DisconnectToleranceInterval = 0
vmap.enableLOS = 0
vmap.enableHeight = 0
vmap.ignoreMapIds = "369"
@@ -196,6 +204,8 @@ vmap.ignoreSpellIds = "7720"
DetectPosCollision = 1
TargetPosRecalculateRange = 1.5
UpdateUptimeInterval = 10
+LogDB.Opt.ClearInterval = 10
+LogDB.Opt.ClearTime = 1209600
MaxCoreStuckTime = 0
AddonChannel = 1
@@ -216,19 +226,19 @@ AddonChannel = 1
#
# LogLevel
# Server console level of logging
-# 0 = Minimum; 1 = Basic&Error; 2 = Detail; 3 = Full/Debug
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
# Default: 3
#
-# LogTime
-# Include time in server console output [hh:mm:ss]
-# Default: 0 (no time)
-# 1 (print time)
-#
# LogFile
# Logfile name
# Default: "Server.log"
# "" - Empty name disable creating log file
#
+# ChatLogFile
+# Log file for chat logs
+# Default: "chat.log"
+# "" - Empty name for disable
+#
# LogTimestamp
# Logfile with timestamp of server start in name
# Default: 0 - no timestamp in name
@@ -236,11 +246,12 @@ AddonChannel = 1
#
# LogFileLevel
# Server file level of logging
-# 0 = Minimum; 1 = Error; 2 = Detail; 3 = Full/Debug
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
# Default: 0
#
-# LogFilter_TransportMoves
+# LogFilter_AchievementUpdates
# LogFilter_CreatureMoves
+# LogFilter_TransportMoves
# LogFilter_VisibilityChanges
# Log filters
# Default: 1 - not include with any log level
@@ -294,23 +305,104 @@ AddonChannel = 1
# "" - Empty name for disable
#
# LogColors
-# Color for messages (format "normal_color details_color debug_color error_color")
+# Color for messages (format "normal basic detail debug")
# Colors: 0 - BLACK, 1 - RED, 2 - GREEN, 3 - BROWN, 4 - BLUE, 5 - MAGENTA, 6 - CYAN, 7 - GREY,
# 8 - YELLOW, 9 - LRED, 10 - LGREEN, 11 - LBLUE, 12 - LMAGENTA, 13 - LCYAN, 14 - WHITE
# Default: "" - none colors
-# Example: "13 7 11 9"
+# Example: "13 11 9 5"
+#
+# EnableLogDB
+# Enable/disable logging to database (LogDatabaseInfo).
+# Default: 0 - disabled
+# 1 - enabled
+#
+# DBLogLevel
+# Log level of DB logging.
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
+# Default: 3
+#
+# LogDB.Char
+# Enable/disable logging character outputs to DB.
+# Default: 0 - off
+# 1 - on
+#
+# LogDB.GM
+# Enable/disable logging GM commands to DB.
+# Default: 0 - off
+# 1 - on
+#
+# LogDB.RA
+# Enable/disable logging remote access events to DB.
+# Default: 0 - off
+# 1 - on
+#
+# LogDB.World
+# Enable/disable logging world packets to DB.
+# Default: 0 - off
+# 1 - on (very heavy)
+#
+# LogDB.Chat
+# Enable/disable logging chat messages to the database.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Channel
+# Enable logging chatting in custom channels.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Whisper
+# Enable logging whispers between players.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Party
+# Enable logging party messages.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Raid
+# Enable logging raid messages.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Guild
+# Enable logging guild messages.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Public
+# Enable logging public chat events (say/yell/emote).
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.Addon
+# Enable logging addon messages.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogs.BattleGround
+# Enable logging battleground chats.
+# Default: 0 - off
+# 1 - on
+#
+# ChatLogTimestamp
+# Chat Logfile with timestamp of server start in name
+# Default: 0 - no timestamp in name
+# 1 - add timestamp in name in form Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
#
###################################################################################################################
LogSQL = 1
PidFile = ""
LogLevel = 1
-LogTime = 0
LogFile = "Server.log"
+ChatLogFile = "chat.log"
LogTimestamp = 0
LogFileLevel = 0
-LogFilter_TransportMoves = 1
+LogFilter_AchievementUpdates = 1
LogFilter_CreatureMoves = 1
+LogFilter_TransportMoves = 1
LogFilter_VisibilityChanges = 1
WorldLogFile = ""
DBErrorLogFile = "db_errors.log"
@@ -322,6 +414,23 @@ GmLogTimestamp = 0
GmLogPerAccount = 0
RaLogFile = "ra_commands.log"
LogColors = ""
+EnableLogDB = 0
+DBLogLevel = 1
+LogDB.Char = 0
+LogDB.GM = 0
+LogDB.RA = 0
+LogDB.World = 0
+LogDB.Chat = 0
+ChatLogs.Channel = 0
+ChatLogs.SysChan = 0
+ChatLogs.Whisper = 0
+ChatLogs.Party = 0
+ChatLogs.Raid = 0
+ChatLogs.Guild = 0
+ChatLogs.Public = 0
+ChatLogs.Addon = 0
+ChatLogs.BattleGround = 0
+ChatLogTimestamp = 0
###################################################################################################################
# SERVER SETTINGS
@@ -367,9 +476,9 @@ LogColors = ""
#
# Expansion
# Allow server use content from expansion
-# 2 - check expansion 2 maps existence, and if client support expansion 2 and account have
+# Default: 2 - check expansion 2 maps existence, and if client support expansion 2 and account have
# expansion 2 setting then allow visit expansion 2 maps, allow create new class character)
-# Default: 1 - check expansion 1 maps existence, and if client support expansion 1 and account have
+# 1 - check expansion 1 maps existence, and if client support expansion 1 and account have
# expansion 1 setting then allow visit expansion 1 maps, allow create new races character)
# 0 - not check expansion maps existence, not allow wisit its, not allow create new race or new class
# characters, ignore account expansion setting)
@@ -433,6 +542,18 @@ LogColors = ""
# Default: 10 (client limitation)
# The number must be between 1 and 10
#
+# HeroicCharactersPerRealm
+# Limit numbers of heroic class characters for account at realm
+# Default: 1
+# The number must be between 0 (not allowed) and 10
+#
+# MinLevelForHeroicCharacterCreating
+# Limit creating heroic characters only for account with another character of specific level (ignored for GM accounts)
+# 0 - not require any existed chaarcter
+# 1 - require at least any character existed
+# Default: 55 - default requirement
+#
+#
# SkipCinematics
# Disable in-game script movie at first character's login(allows to prevent buggy intro in case of custom start location coordinates)
# Default: 0 - show intro for each new characrer
@@ -440,14 +561,18 @@ LogColors = ""
# 2 - disable intro show in all cases
#
# MaxPlayerLevel
-# Max level that can be reached by player for experience (in range from 1 to 255).
+# Max level that can be reached by player for experience (in range from 1 to 100).
# Change not recommended
-# Default: 70
+# Default: 80
#
# StartPlayerLevel
# Staring level that have character at creating (in range 1 to MaxPlayerLevel)
# Default: 1
#
+# StartHeroicPlayerLevel
+# Staring level that have character of heroic class at creating (in range 1 to MaxPlayerLevel)
+# Default: 55
+#
# StartPlayerMoney
# Amount of money that new players will start with.
# If you want to start with silver, use for example 100 (100 copper = 1 silver)
@@ -484,34 +609,14 @@ LogColors = ""
#
# AlwaysMaxSkillForLevel
# Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc.
-# Default: 0 (true)
-# 1 (false)
+# Default: 0 (false)
+# 1 (true)
#
# ActivateWeather
# Activate weather system
# Default: 1 (true)
# 0 (false)
#
-# Battleground.CastDeserter
-# Cast or not Deserter spell at player who leave battleground in progress
-# Default: 1 (true)
-# 0 (false)
-#
-# Battleground.QueueAnnouncer.Enable
-# Enable queue announcer posting to chat
-# Default: 1 (true)
-# 0 (false)
-#
-# Battleground.QueueAnnouncer.PlayerOnly
-# Enable queue announcer posting to chat
-# Default: 0 (false)
-# 1 (true)
-#
-# Battleground.PrematureReward
-# Reward players in case of prematurely finished BG
-# Default: 1 (true)
-# 0 (false)
-#
# CastUnstuck
# Allow cast or not Unstuck spell at .start or client Help option use
# Default: 1 (true)
@@ -533,7 +638,7 @@ LogColors = ""
#
# Instance.UnloadDelay
# Unload the instance map from memory after some time if no players are inside.
-# Default: 1800000 (miliseconds, i.e 30 minutes)
+# Default: 1800000 (miliseconds 30 minutes)
# 0 (instance maps are kept in memory until they are reset)
#
# Quests.LowLevelHideDiff
@@ -566,10 +671,20 @@ LogColors = ""
# Default: 3600 sec (1 hour)
#
# SkillChance.Prospecting
-# For prospecting skillup not possible by default, but can be allowed as custom setting
+# For prospecting skillup impossible by default, but can be allowed as custom setting
+# Default: 0 - no skilups
+# 1 - skilups possible
+#
+# SkillChance.Milling
+# For milling skillup impossible by default, but can be allowed as custom setting
# Default: 0 - no skilups
# 1 - skilups possible
#
+# OffhandCheckAtTalentsReset
+# Talent reset can change offhand weapon restrictions for equip slots.
+# Default: 0 - recheck offhand slot weapon only at zone update
+# 1 - recheck offhand slot weapon at talent reset also
+#
# Event.Announce
# Default: 0 (false)
# 1 (true)
@@ -591,7 +706,7 @@ LogColors = ""
GameType = 1
RealmZone = 1
-Expansion = 1
+Expansion = 2
DBC.Locale = 255
DeclinedNames = 0
StrictPlayerNames = 0
@@ -601,9 +716,12 @@ MaxWhoListReturns = 49
CharactersCreatingDisabled = 0
CharactersPerAccount = 50
CharactersPerRealm = 10
+HeroicCharactersPerRealm = 1
+MinLevelForHeroicCharacterCreating = 55
SkipCinematics = 0
-MaxPlayerLevel = 70
+MaxPlayerLevel = 80
StartPlayerLevel = 1
+StartHeroicPlayerLevel = 55
StartPlayerMoney = 0
MaxHonorPoints = 75000
StartHonorPoints = 0
@@ -614,10 +732,6 @@ DisableWaterBreath = 4
AllFlightPaths = 0
AlwaysMaxSkillForLevel = 0
ActivateWeather = 1
-Battleground.CastDeserter = 1
-Battleground.QueueAnnouncer.Enable = 1
-Battleground.QueueAnnouncer.PlayerOnly = 0
-Battleground.PrematureReward = 1
CastUnstuck = 1
Instance.IgnoreLevel = 0
Instance.IgnoreRaid = 0
@@ -630,6 +744,8 @@ MinPetitionSigns = 9
MaxGroupXPDistance = 74
MailDeliveryDelay = 3600
SkillChance.Prospecting = 0
+SkillChance.Milling = 0
+OffhandCheckAtTalentsReset = 0
Event.Announce = 0
BeepAtStart = 1
Motd = "Welcome to a Trinity Core server."
@@ -847,6 +963,18 @@ Channel.SilentlyGMJoin = 0
# 0 (disable)
# 1 (enable)
#
+# GM.Visible
+# GM visibility at login
+# Default: 2 (last save state)
+# 0 (invisible)
+# 1 (visible)
+#
+# GM.AcceptTickets
+# Is GM accepting tickets from player by default or not.
+# Default: 2 (last save state)
+# 0 (disable)
+# 1 (enable)
+#
# GM.Chat
# GM chat mode at login
# Default: 2 (last save state)
@@ -860,7 +988,7 @@ Channel.SilentlyGMJoin = 0
# 1 (enable)
#
# GM.InGMList
-# Is GM showed in GM list (if visible) in non-GM state (.gmoff)
+# Is GM showed in GM list (if visible) in non-GM state (.gm off)
# Default: 0 (false)
# 1 (true)
#
@@ -875,18 +1003,32 @@ Channel.SilentlyGMJoin = 0
# 0 (not include)
#
# GM.StartLevel
-# GM starting level (1-255)
+# GM starting level (1-100)
# Default: 1
#
+# GM.LowerSecurity
+# Disallow a lower security member to interact with a higher one using commands
+# Default: 0 (disable)
+# 1 (enable)
+#
+# GM.AllowAchievementGain
+# If enabled it allows gaining achievements for GM characters
+# Default: 1 (enable)
+# 0 (disable)
+#
###################################################################################################################
-GM.LoginState = 2
-GM.Chat = 2
-GM.WhisperingTo = 2
-GM.InGMList = 0
-GM.InWhoList = 0
-GM.LogTrade = 1
-GM.StartLevel = 70
+GM.LoginState = 2
+GM.Visible = 2
+GM.AcceptTickets = 2
+GM.Chat = 2
+GM.WhisperingTo = 2
+GM.InGMList = 0
+GM.InWhoList = 0
+GM.LogTrade = 1
+GM.StartLevel = 80
+GM.LowerSecurity = 0
+GM.AllowAchievementGain = 1
###################################################################################################################
# VISIBILITY AND RADIUSES
@@ -900,9 +1042,9 @@ GM.StartLevel = 70
# Visibility.Distance.Creature
# Visibility.Distance.Player
# Visibility distance for different in game object
-# Max limited by active player zone: ~ 333
+# Max limited by active player zone: ~ 166
# Min limit dependent from objects
-# Default: 132 (cell size)
+# Default: 66 (cell size)
# Min limit is max aggro radius (45) * Rate.Creature.Aggro
#
# Visibility.Distance.Object
@@ -928,10 +1070,10 @@ GM.StartLevel = 70
###################################################################################################################
Visibility.GroupMode = 0
-Visibility.Distance.Creature = 132
-Visibility.Distance.Player = 132
-Visibility.Distance.Object = 132
-Visibility.Distance.InFlight = 132
+Visibility.Distance.Creature = 66
+Visibility.Distance.Player = 66
+Visibility.Distance.Object = 66
+Visibility.Distance.InFlight = 66
Visibility.Distance.Grey.Unit = 1
Visibility.Distance.Grey.Object = 10
@@ -942,6 +1084,8 @@ Visibility.Distance.Grey.Object = 10
# Rate.Mana
# Rate.Rage.Income
# Rate.Rage.Loss
+# Rate.RunicPower.Income
+# Rate.RunicPower.Loss
# Rate.Focus
# Rate.Loyalty
# Health and power regeneration and rage income from damage.
@@ -1006,6 +1150,14 @@ Visibility.Distance.Grey.Object = 10
# Reputation Gain rate
# Default: 1
#
+# Rate.Reputation.LowLevel.Kill
+# Reputation Gain form low level kill (grey creture)
+# Default: 1
+#
+# Rate.Reputation.LowLevel.Quest
+# Reputation Gain rate
+# Default: 1
+#
# Rate.InstanceResetTime
# Multiplier for the number of days in between global raid/heroic instance resets.
# Default: 1
@@ -1058,12 +1210,20 @@ Visibility.Distance.Grey.Object = 10
# Default: 1 (enabled)
# 0 (disabled)
#
+# Death.Bones.World
+# Death.Bones.BattlegroundOrArena
+# Enable/disable creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas)
+# Default: 1 (enabled)
+# 0 (disabled)
+#
###################################################################################################################
Rate.Health = 1
Rate.Mana = 1
Rate.Rage.Income = 1
Rate.Rage.Loss = 1
+Rate.RunicPower.Income = 1
+Rate.RunicPower.Loss = 1
Rate.Focus = 1
Rate.Loyalty = 1
Rate.Skill.Discovery = 1
@@ -1092,6 +1252,8 @@ Rate.Mining.Amount = 1
Rate.Mining.Next = 1
Rate.Talent = 1
Rate.Reputation.Gain = 1
+Rate.Reputation.LowLevel.Kill = 1
+Rate.Reputation.LowLevel.Quest = 1
Rate.InstanceResetTime = 1
SkillGain.Crafting = 1
SkillGain.Defense = 1
@@ -1110,51 +1272,104 @@ DurabilityLossChance.Block = 0.05
Death.SicknessLevel = 11
Death.CorpseReclaimDelay.PvP = 1
Death.CorpseReclaimDelay.PvE = 0
+Death.Bones.World = 1
+Death.Bones.BattlegroundOrArena = 1
+
###################################################################################################################
+# BATTLEGROUND CONFIG
#
-# Rated arena matches config
+# Battleground.CastDeserter
+# Cast Deserter spell at player who leave battleground in progress
+# Default: 1 (enable)
+# 0 (disable)
#
-# MaxRatingDifference: the maximum rating difference between two groups in rated matches
-# Default: 0 (disable, rating difference is discarded)
+# Battleground.QueueAnnouncer.Enable
+# Enable queue announcer posting to chat
+# Default: 0 (disable)
+# 1 (enable)
+#
+# Battleground.QueueAnnouncer.PlayerOnly
+# Enable queue announcer posting to chat
+# Default: 0 (disable)
+# 1 (enable)
#
-# RatingDiscardTimer: after the specified milliseconds has passed,
-# rating information will be discarded when selecting teams for matches
-# also initiates an update by this timer
-# Default: 60000
+# Battleground.InvitationType
+# Set Battleground invitation type
+# Default: 0 (normal - invite as much players to bg as possible, don't bother with ballance)
+# 1 (Experimental - don't allow to invite much more players of one faction)
#
-# AutoDistributePoints: set if arena points should be distributed automatically, or by GM command
-# Default: 0 (disable) (recommended): use gm command or sql query to distribute the points
-# 1 (enable): arena points are distributed automatically
+# Battleground.PrematureFinishTimer
+# The time to end the bg if there are less than MinPlayersPerTeam on one side in milliseconds
+# Default: 300000 (5 minutes)
+# 0 - disable (not recommended)
#
-# AutoDistributeInterval: how often should the distribution take place
-# if automatic distribution is enabled
-# in days
-# Default: 7 (weekly)
+# BattleGround.PremadeGroupWaitForMatch
+# The time in which premade group of 1 faction waits in BG Queue for premade group of other faction
+# Default: 1800000 (30 minutes)
+# 0 - disable (not recommended)
#
###################################################################################################################
-Arena.MaxRatingDifference = 0
-Arena.RatingDiscardTimer = 60000
-Arena.AutoDistributePoints = 0
-Arena.AutoDistributeInterval = 7
+Battleground.CastDeserter = 1
+Battleground.QueueAnnouncer.Enable = 0
+Battleground.QueueAnnouncer.PlayerOnly = 0
+Battleground.InvitationType = 0
+BattleGround.PrematureFinishTimer = 300000
+BattleGround.PremadeGroupWaitForMatch = 1800000
+
###################################################################################################################
+# ARENA CONFIG
+#
+# Arena.MaxRatingDifference
+# The maximum rating difference between two groups in rated matches
+# Default: 150 (enable, recommended)
+# 0 (disable, rating difference is discarded)
+#
+# Arena.RatingDiscardTimer
+# After the specified milliseconds has passed,
+# rating information will be discarded when selecting teams for matches
+# also initiates an update by this timer
+# Default: 600000 (10 minutes, recommended)
+# 0 (disable)
+#
+# Arena.AutoDistributePoints
+# Set if arena points should be distributed automatically, or by GM command
+# Default: 0 (disable) (recommended): use gm command or sql query to distribute the points
+# 1 (enable) arena points are distributed automatically
+#
+# Arena.AutoDistributeInterval
+# How often should the distribution take place
+# If automatic distribution is enabled in days
+# Default: 7 (weekly)
+#
+# Arena.QueueAnnouncer.Enable
+# Enable bg queue announcer posting to chat
+# Default: 0 (disable)
+# 1 (enable)
#
-# Battleground config
+# Arena.ArenaSeason.ID
+# Current area season id show in client
+# Default: 1
#
-# PrematureFinishTimer: the time to end the bg if there are less than minplayersperteam on one side
-# in milliseconds
-# Default: 300000
-# 0 - disable
+# Arena.ArenaSeason.InProgress
+# Current area season state
+# Default: 1 (active)
+# 0 (finished)
#
###################################################################################################################
-BattleGround.PrematureFinishTimer = 300000
+Arena.MaxRatingDifference = 150
+Arena.RatingDiscardTimer = 600000
+Arena.AutoDistributePoints = 0
+Arena.AutoDistributeInterval = 7
+Arena.QueueAnnouncer.Enable = 0
+Arena.ArenaSeason.ID = 1
+Arena.ArenaSeason.InProgress = 1
###################################################################################################################
-#
# NETWORK CONFIG
#
# Network.Threads
@@ -1183,7 +1398,7 @@ Network.TcpNodelay = 1
###################################################################################################################
# AUCTION HOUSE BOT SETTINGS
-#
+#
# AuctionHouseBot.EnableSeller
# Enable/Disable the part of AHBot that puts items up for auction
# Default 0 (disabled)
@@ -1194,7 +1409,7 @@ Network.TcpNodelay = 1
#
# Auction House Bot character data
# AuctionHouseBot.Account is the account number (in realmd->account table) of the player you want to run as the auction bot.
-# AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot.
+# AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot.
# Default: 0 (Auction House Bot disabled)
#
# AuctionHouseBot.VendorItems
@@ -1221,7 +1436,7 @@ Network.TcpNodelay = 1
# Default 1
# Bind_Quest_Item
# Default 0
-#
+#
# AuctionHouseBot.ItemsPerCycle
# Number of Items to Add/Remove from the AH during mass operations
# Default 200
diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h
index defa513dede..a85415ba849 100644
--- a/src/trinityrealm/AuthCodes.h
+++ b/src/trinityrealm/AuthCodes.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,9 +68,8 @@ enum LoginResult
// we need to stick to 1 version or half of the stuff will work for someone
// others will not and opposite
-// will only support WoW and WoW:TBC 2.4.3 client build 8606...
+// will only support WoW, WoW:TBC and WoW:WotLK 3.0.9 client build 9551...
-#define EXPECTED_TRINITY_CLIENT_BUILD {8606, 0}
+#define EXPECTED_TRINITY_CLIENT_BUILD {9551, 0}
#endif
-
diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp
index 3dc6b3a5c28..c5c81593737 100644
--- a/src/trinityrealm/AuthSocket.cpp
+++ b/src/trinityrealm/AuthSocket.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1092,4 +1092,3 @@ Patcher::~Patcher()
for(Patches::iterator i = _patches.begin(); i != _patches.end(); i++ )
delete i->second;
}
-
diff --git a/src/trinityrealm/AuthSocket.h b/src/trinityrealm/AuthSocket.h
index 73aa1b280e2..3cae54c7789 100644
--- a/src/trinityrealm/AuthSocket.h
+++ b/src/trinityrealm/AuthSocket.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -84,4 +84,3 @@ class AuthSocket: public TcpSocket
};
#endif
/// @}
-
diff --git a/src/trinityrealm/CMakeLists.txt b/src/trinityrealm/CMakeLists.txt
index f883259bbf5..a8f5a646924 100644
--- a/src/trinityrealm/CMakeLists.txt
+++ b/src/trinityrealm/CMakeLists.txt
@@ -1,11 +1,11 @@
########### next target ###############
SET(trinity-realm_SRCS
-AuthCodes.h
-AuthSocket.cpp
-AuthSocket.h
-Main.cpp
-RealmList.cpp
+AuthCodes.h
+AuthSocket.cpp
+AuthSocket.h
+Main.cpp
+RealmList.cpp
RealmList.h
)
@@ -16,14 +16,14 @@ add_definitions(
-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"'
)
IF (DO_MYSQL)
- SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}")
+ SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}")
ENDIF(DO_MYSQL)
IF (DO_POSTGRE)
- SET(trinity-realm_LINK_FLAGS "${POSTGRE_LIBS} ${trinity-realm_LINK_FLAGS}")
+ SET(trinity-realm_LINK_FLAGS "${POSTGRE_LIBS} ${trinity-realm_LINK_FLAGS}")
ENDIF(DO_POSTGRE)
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}")
+ SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_FLAGS}")
@@ -45,6 +45,7 @@ ${OSX_LIBS}
install(TARGETS trinity-realm DESTINATION bin)
+
########### install files ###############
install(FILES trinityrealm.conf.dist DESTINATION etc)
diff --git a/src/trinityrealm/Main.cpp b/src/trinityrealm/Main.cpp
index 05fd704c10b..65596e35b21 100644
--- a/src/trinityrealm/Main.cpp
+++ b/src/trinityrealm/Main.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@
#include "sockets/ListenSocket.h"
#include "AuthSocket.h"
#include "SystemConfig.h"
-#include "revision.h"
#include "Util.h"
// Format is YYYYMMDDRR where RR is the change in the conf file
@@ -41,12 +40,12 @@
#endif
#ifndef _TRINITY_REALM_CONFIG
-# define _TRINITY_REALM_CONFIG "trinityrealm.conf"
+# define _TRINITY_REALM_CONFIG "TrinityRealm.conf"
#endif //_TRINITY_REALM_CONFIG
#ifdef WIN32
#include "ServiceWin32.h"
-char serviceName[] = "realmd";
+char serviceName[] = "TrinityRealm";
char serviceLongName[] = "Trinity realm service";
char serviceDescription[] = "Massive Network Game Object Server";
/*
@@ -58,7 +57,7 @@ char serviceDescription[] = "Massive Network Game Object Server";
int m_ServiceStatus = -1;
#endif
-bool StartDB(std::string &dbstring);
+bool StartDB();
void UnhookSignals();
void HookSignals();
@@ -71,7 +70,6 @@ DatabaseType LoginDatabase; ///< Accessor to the
void usage(const char *prog)
{
sLog.outString("Usage: \n %s [<options>]\n"
- " --version print version and exit\n\r"
" -c config_file use config_file as configuration file\n\r"
#ifdef WIN32
" Running as service functions:\n\r"
@@ -102,12 +100,6 @@ extern int main(int argc, char **argv)
cfg_file = argv[c];
}
- if( strcmp(argv[c],"--version") == 0)
- {
- printf("%s\n", _FULLVERSION);
- return 0;
- }
-
#ifdef WIN32
////////////
//Services//
@@ -187,10 +179,19 @@ extern int main(int argc, char **argv)
}
///- Initialize the database connection
- std::string dbstring;
- if(!StartDB(dbstring))
+ if(!StartDB())
return 1;
+ ///- Initialize the log database
+ if(sConfig.GetBoolDefault("EnableLogDB", false))
+ {
+ // everything successful - set var to enable DB logging once startup finished.
+ sLog.SetLogDBLater(true);
+ sLog.SetLogDB(false);
+ // ensure we've set realm to 0 (realmd realmid)
+ sLog.SetRealmID(0);
+ }
+
///- Get the list of realms for the server
m_realmList.Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20));
if (m_realmList.size() == 0)
@@ -243,7 +244,7 @@ extern int main(int argc, char **argv)
sLog.outError("Can't set used processors (hex): %x", curAff);
}
}
- sLog.outString();
+ sLog.outString("");
}
bool Prio = sConfig.GetBoolDefault("ProcessPriority", false);
@@ -254,7 +255,7 @@ extern int main(int argc, char **argv)
sLog.outString("TrinityRealm process priority class set to HIGH");
else
sLog.outError("ERROR: Can't set realmd process priority class.");
- sLog.outString();
+ sLog.outString("");
}
}
#endif
@@ -263,6 +264,20 @@ extern int main(int argc, char **argv)
uint32 numLoops = (sConfig.GetIntDefault( "MaxPingTime", 30 ) * (MINUTE * 1000000 / 100000));
uint32 loopCounter = 0;
+ // possibly enable db logging; avoid massive startup spam by doing it here.
+ if (sLog.GetLogDBLater())
+ {
+ sLog.outString("Enabling database logging...");
+ sLog.SetLogDBLater(false);
+ // login db needs thread for logging
+ sLog.SetLogDB(true);
+ }
+ else
+ {
+ sLog.SetLogDB(false);
+ sLog.SetLogDBLater(false);
+ }
+
///- Wait for termination signal
while (!stopEvent)
{
@@ -282,6 +297,7 @@ extern int main(int argc, char **argv)
}
///- Wait for the delay thread to exit
+ LoginDatabase.ThreadEnd();
LoginDatabase.HaltDelayThread();
///- Remove signal handling before leaving
@@ -312,20 +328,21 @@ void OnSignal(int s)
}
/// Initialize connection to the database
-bool StartDB(std::string &dbstring)
+bool StartDB()
{
- if(!sConfig.GetString("LoginDatabaseInfo", &dbstring))
+ std::string dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
+ if(dbstring.empty())
{
sLog.outError("Database not specified");
return false;
}
- sLog.outString("Database: %s", dbstring.c_str() );
if(!LoginDatabase.Initialize(dbstring.c_str()))
{
sLog.outError("Cannot connect to database");
return false;
}
+ LoginDatabase.ThreadStart();
return true;
}
@@ -351,4 +368,3 @@ void UnhookSignals()
}
/// @}
-
diff --git a/src/trinityrealm/Makefile.am b/src/trinityrealm/Makefile.am
new file mode 100644
index 00000000000..a14b50c847a
--- /dev/null
+++ b/src/trinityrealm/Makefile.am
@@ -0,0 +1,59 @@
+# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+#
+# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to produce Makefile.in
+
+## CPP flags for includes, defines, etc.
+AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir) -DSYSCONFDIR=\"$(sysconfdir)/\"
+
+## Build realm list daemon as standalone program
+bin_PROGRAMS = trinity-realmd
+trinity_realmd_SOURCES = \
+ AuthCodes.h \
+ AuthSocket.cpp \
+ AuthSocket.h \
+ Main.cpp \
+ RealmList.cpp \
+ RealmList.h
+
+## Link realm list daemon against the shared library
+trinity_realmd_LDADD = ../shared/Database/libmangosdatabase.a ../shared/Config/libmangosconfig.a ../shared/Auth/libmangosauth.a ../shared/libmangosshared.a ../framework/libmangosframework.a ../../dep/src/sockets/libmangossockets.a ../../dep/src/zthread/libZThread.la
+trinity_realmd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/zthread -L$(libdir) $(TRINI_LIBS)
+
+## Additional files to include when running 'make dist'
+# Include realm list daemon configuration
+EXTRA_DIST = \
+ realmd.conf.dist
+
+## Additional files to install
+sysconf_DATA = \
+ realmd.conf.dist
+
+install-data-hook:
+ @list='$(sysconf_DATA)'; for p in $$list; do \
+ dest=`echo $$p | sed -e s/.dist//`; \
+ if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \
+ echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \
+ else \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \
+ fi; \
+ done
+
+clean-local:
+ rm -f $(sysconf_DATA)
diff --git a/src/trinityrealm/RealmList.cpp b/src/trinityrealm/RealmList.cpp
index ca4dc9271b7..6a3d6b47e0f 100644
--- a/src/trinityrealm/RealmList.cpp
+++ b/src/trinityrealm/RealmList.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -100,4 +100,3 @@ void RealmList::UpdateRealms(bool init)
delete result;
}
}
-
diff --git a/src/trinityrealm/RealmList.h b/src/trinityrealm/RealmList.h
index 31690a19eb3..3663b2bd20d 100644
--- a/src/trinityrealm/RealmList.h
+++ b/src/trinityrealm/RealmList.h
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,8 +30,8 @@
/// Storage object for a realm
struct Realm
{
- std::string name;
std::string address;
+ std::string name;
uint8 icon;
uint8 color;
uint8 timezone;
@@ -66,4 +66,3 @@ class RealmList
};
#endif
/// @}
-
diff --git a/src/trinityrealm/TrinityRealm.rc b/src/trinityrealm/TrinityRealm.rc
index 33c7eef719a..bcd37f240c5 100644
--- a/src/trinityrealm/TrinityRealm.rc
+++ b/src/trinityrealm/TrinityRealm.rc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.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
diff --git a/src/trinityrealm/resource.h b/src/trinityrealm/resource.h
index fbc730320b4..7dc5cb9ef7b 100644
--- a/src/trinityrealm/resource.h
+++ b/src/trinityrealm/resource.h
@@ -13,4 +13,3 @@
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-
diff --git a/src/trinityrealm/trinityrealm.conf.dist b/src/trinityrealm/trinityrealm.conf.dist
index 72ef1c9012e..363f98ae31c 100644
--- a/src/trinityrealm/trinityrealm.conf.dist
+++ b/src/trinityrealm/trinityrealm.conf.dist
@@ -17,7 +17,7 @@ ConfVersion=2007062001
# LogsDir
# Logs directory setting.
# Important: Logs dir must exists, or all logs be disable
-# Default: "" - no log directory prefix, if used log names isn't absolute path then logs will be
+# Default: "" - no log directory prefix, if used log names isn't absolute path then logs will be
# stored in current directory for run program.
#
# MaxPingTime
@@ -36,14 +36,9 @@ ConfVersion=2007062001
#
# LogLevel
# Server console level of logging
-# 0 = Minimum; 1 = Error; 2 = Detail; 3 = Full/Debug
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
# Default: 0
#
-# LogTime
-# Include time in server console output [hh:mm:ss]
-# Default: 0 (no time)
-# 1 (print time)
-#
# LogFile
# Logfile name
# Default: "realmd.log"
@@ -56,15 +51,25 @@ ConfVersion=2007062001
#
# LogFileLevel
# Server file level of logging
-# 0 = Minimum; 1 = Error; 2 = Detail; 3 = Full/Debug
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
# Default: 0
#
# LogColors
-# Color for messages (format "normal_color details_color debug_color error_color)
+# Color for messages (format "normal basic detail debug")
# Colors: 0 - BLACK, 1 - RED, 2 - GREEN, 3 - BROWN, 4 - BLUE, 5 - MAGENTA, 6 - CYAN, 7 - GREY,
# 8 - YELLOW, 9 - LRED, 10 - LGREEN, 11 - LBLUE, 12 - LMAGENTA, 13 - LCYAN, 14 - WHITE
# Default: "" - none colors
-# "13 7 11 9" - for example :)
+# Example: "13 11 9 5"
+#
+# EnableLogDB
+# Enable/disable logging to database (LogDatabaseInfo).
+# Default: 0 - disabled
+# 1 - enabled
+#
+# DBLogLevel
+# Log level of DB logging.
+# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug
+# Default: 3
#
# UseProcessors
# Used processors mask for multi-processors system (Used only at Windows)
@@ -78,7 +83,7 @@ ConfVersion=2007062001
#
# RealmsStateUpdateDelay
# Realm list Update up delay (updated at realm list request if delay expired).
-# Default: 20
+# Default: 20
# 0 (Disabled)
#
# WrongPass.MaxCount
@@ -103,14 +108,15 @@ RealmServerPort = 3724
BindIP = "0.0.0.0"
PidFile = ""
LogLevel = 0
-LogTime = 0
LogFile = "realmd.log"
LogTimestamp = 0
LogFileLevel = 0
-LogColors = ""
UseProcessors = 0
ProcessPriority = 1
RealmsStateUpdateDelay = 20
WrongPass.MaxCount = 0
WrongPass.BanTime = 600
WrongPass.BanType = 0
+LogColors = ""
+EnableLogDB = 0
+DBLogLevel = 1
diff --git a/win/TrinityCore&Script VC90.sln b/win/TrinityCore&Script VC90.sln
index ec569322d97..74259aaff8b 100644
--- a/win/TrinityCore&Script VC90.sln
+++ b/win/TrinityCore&Script VC90.sln
@@ -72,6 +72,14 @@ Global
{90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|Win32.Build.0 = Release|Win32
{90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|x64.ActiveCfg = Release|x64
{90297C34-F231-4DF4-848E-A74BCC0E40ED}.Release|x64.Build.0 = Release|x64
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.Build.0 = Debug|Win32
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.ActiveCfg = Debug|x64
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.Build.0 = Debug|x64
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.ActiveCfg = Release|Win32
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.Build.0 = Release|Win32
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.ActiveCfg = Release|x64
+ {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.Build.0 = Release|x64
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug|Win32.ActiveCfg = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug|Win32.Build.0 = Debug|Win32
{262199E8-EEDF-4700-A1D1-E9CC901CF480}.Debug|x64.ActiveCfg = Debug|x64
@@ -96,30 +104,6 @@ Global
{BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|Win32.Build.0 = Release|Win32
{BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|x64.ActiveCfg = Release|x64
{BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}.Release|x64.Build.0 = Release|x64
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.ActiveCfg = Debug|x64
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.Build.0 = Debug|x64
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.ActiveCfg = Release|x64
- {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.Build.0 = Release|x64
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.ActiveCfg = Debug|Win32
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.Build.0 = Debug|Win32
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.ActiveCfg = Debug|x64
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.Build.0 = Debug|x64
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.ActiveCfg = Release|Win32
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.Build.0 = Release|Win32
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.ActiveCfg = Release|x64
- {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.Build.0 = Release|x64
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.ActiveCfg = Debug|Win32
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|Win32.Build.0 = Debug|Win32
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.ActiveCfg = Debug|x64
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Debug|x64.Build.0 = Debug|x64
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.ActiveCfg = Release|Win32
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|Win32.Build.0 = Release|Win32
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.ActiveCfg = Release|x64
- {A3A04E47-43A2-4C08-90B3-029CEF558594}.Release|x64.Build.0 = Release|x64
{563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.ActiveCfg = Debug|Win32
{563E9905-3657-460C-AE63-0AC39D162E23}.Debug|Win32.Build.0 = Debug|Win32
{563E9905-3657-460C-AE63-0AC39D162E23}.Debug|x64.ActiveCfg = Debug|x64
@@ -136,6 +120,22 @@ Global
{4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.Build.0 = Release|Win32
{4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.ActiveCfg = Release|x64
{4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.Build.0 = Release|x64
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|Win32.Build.0 = Debug|Win32
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.ActiveCfg = Debug|x64
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Debug|x64.Build.0 = Debug|x64
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.ActiveCfg = Release|Win32
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|Win32.Build.0 = Release|Win32
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.ActiveCfg = Release|x64
+ {8072769E-CF10-48BF-B9E1-12752A5DAC6E}.Release|x64.Build.0 = Release|x64
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|Win32.Build.0 = Debug|Win32
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.ActiveCfg = Debug|x64
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Debug|x64.Build.0 = Debug|x64
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.ActiveCfg = Release|Win32
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|Win32.Build.0 = Release|Win32
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.ActiveCfg = Release|x64
+ {04BAF755-0D67-46F8-B1C6-77AE5368F3CB}.Release|x64.Build.0 = Release|x64
{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|Win32.ActiveCfg = Debug|Win32
{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|Win32.Build.0 = Debug|Win32
{BD537C9A-FECA-1BAD-6757-8A6348EA12C8}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/win/VC71/ACE_vc71.vcproj b/win/VC71/ACE_vc71.vcproj
index 1b991d8b429..e54a8de7d62 100644
--- a/win/VC71/ACE_vc71.vcproj
+++ b/win/VC71/ACE_vc71.vcproj
@@ -45,7 +45,7 @@
Name="VCLinkerTool"
AdditionalDependencies=""
OutputFile="$(OutDir)\ACEd.dll"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""
GenerateDebugInformation="TRUE"
diff --git a/win/VC71/game.vcproj b/win/VC71/game.vcproj
index 7615147ee02..3f0809d900f 100644
--- a/win/VC71/game.vcproj
+++ b/win/VC71/game.vcproj
@@ -128,74 +128,52 @@
</References>
<Files>
<Filter
- Name="World/Others"
- >
- <File
- RelativePath="..\..\src\game\Channel.cpp"
- >
- </File>
+ Name="World/Handlers">
<File
- RelativePath="..\..\src\game\Channel.h"
- >
+ RelativePath="..\..\src\game\AccountMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\Chat.cpp"
- >
+ RelativePath="..\..\src\game\AccountMgr.h">
</File>
<File
- RelativePath="..\..\src\game\Chat.h"
- >
+ RelativePath="..\..\src\game\AchievementMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\GameEvent.cpp"
- >
+ RelativePath="..\..\src\game\AchievementMgr.h">
</File>
<File
- RelativePath="..\..\src\game\GameEvent.h"
- >
+ RelativePath="..\..\src\game\ArenaTeamHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\GossipDef.cpp"
- >
+ RelativePath="..\..\src\game\AuctionHouseHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\GossipDef.h"
- >
+ RelativePath="..\..\src\game\BattleGround.cpp">
</File>
<File
- RelativePath="..\..\src\game\Mail.cpp"
- >
+ RelativePath="..\..\src\game\BattleGround.h">
</File>
<File
- RelativePath="..\..\src\game\Mail.h"
- >
+ RelativePath="..\..\src\game\BattleGroundAA.cpp">
</File>
<File
- RelativePath="..\..\src\game\QuestDef.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundAA.h">
</File>
<File
- RelativePath="..\..\src\game\QuestDef.h"
- >
+ RelativePath="..\..\src\game\BattleGroundAB.cpp">
</File>
<File
- RelativePath="..\..\src\game\UpdateData.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundAB.h">
</File>
<File
- RelativePath="..\..\src\game\UpdateData.h"
- >
+ RelativePath="..\..\src\game\BattleGroundAV.cpp">
</File>
<File
- RelativePath="..\..\src\game\World.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundAV.h">
</File>
<File
- RelativePath="..\..\src\game\World.h"
- >
+ RelativePath="..\..\src\game\BattleGroundBE.cpp">
</File>
- </Filter>
- <Filter
Name="AuctionHouseBot"
>
<File
@@ -206,1035 +184,848 @@
</File>
</Filter>
<Filter
- Name="Objects"
- >
<File
- RelativePath="..\..\src\game\ArenaTeam.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundBE.h">
</File>
<File
- RelativePath="..\..\src\game\ArenaTeam.h"
- >
+ RelativePath="..\..\src\game\BattleGroundDS.cpp">
</File>
<File
- RelativePath="..\..\src\game\Bag.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundDS.h">
</File>
<File
- RelativePath="..\..\src\game\Bag.h"
- >
+ RelativePath="..\..\src\game\BattleGroundEY.cpp">
</File>
<File
- RelativePath="..\..\src\game\Corpse.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundEY.h">
</File>
<File
- RelativePath="..\..\src\game\Corpse.h"
- >
+ RelativePath="..\..\src\game\BattleGroundHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\Creature.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\Creature.h"
- >
+ RelativePath="..\..\src\game\BattleGroundMgr.h">
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundNA.cpp">
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.h"
- >
+ RelativePath="..\..\src\game\BattleGroundNA.h">
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundRL.cpp">
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.h"
- >
+ RelativePath="..\..\src\game\BattleGroundRL.h">
</File>
<File
- RelativePath="..\..\src\game\DestinationHolderImp.h"
- >
+ RelativePath="..\..\src\game\BattleGroundRV.cpp">
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundRV.h">
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.h"
- >
+ RelativePath="..\..\src\game\BattleGroundSA.cpp">
</File>
<File
- RelativePath="..\..\src\game\Formulas.h"
- >
+ RelativePath="..\..\src\game\BattleGroundSA.h">
</File>
<File
- RelativePath="..\..\src\game\GameObject.cpp"
- >
+ RelativePath="..\..\src\game\BattleGroundWS.cpp">
</File>
<File
- RelativePath="..\..\src\game\GameObject.h"
- >
+ RelativePath="..\..\src\game\BattleGroundWS.h">
</File>
<File
- RelativePath="..\..\src\game\Group.cpp"
- >
+ RelativePath="..\..\src\game\CalendarHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\Group.h"
- >
+ RelativePath="..\..\src\game\Cell.h">
</File>
<File
- RelativePath="..\..\src\game\Guild.cpp"
- >
+ RelativePath="..\..\src\game\CellImpl.h">
</File>
<File
- RelativePath="..\..\src\game\Guild.h"
- >
+ RelativePath="..\..\src\game\Channel.cpp">
</File>
<File
- RelativePath="..\..\src\game\Item.cpp"
- >
+ RelativePath="..\..\src\game\Channel.h">
</File>
<File
- RelativePath="..\..\src\game\Item.h"
- >
+ RelativePath="..\..\src\game\ChannelHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\ItemPrototype.h"
- >
+ RelativePath="..\..\src\game\ChannelMgr.h">
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.cpp"
- >
+ RelativePath="..\..\src\game\CharacterHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.h"
- >
+ RelativePath="..\..\src\game\Chat.cpp">
</File>
<File
- RelativePath="..\..\src\game\Object.cpp"
- >
+ RelativePath="..\..\src\game\Chat.h">
</File>
<File
- RelativePath="..\..\src\game\Object.h"
- >
+ RelativePath="..\..\src\game\ChatHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.cpp"
- >
+ RelativePath="..\..\src\game\CombatHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.h"
- >
+ RelativePath="..\..\src\game\DuelHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\ObjectDefines.h"
- >
+ RelativePath="..\..\src\game\GameEventMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\Pet.cpp"
- >
+ RelativePath="..\..\src\game\GameEventMgr.h">
</File>
<File
- RelativePath="..\..\src\game\Pet.h"
- >
+ RelativePath="..\..\src\game\GossipDef.cpp">
</File>
<File
- RelativePath="..\..\src\game\Player.cpp"
- >
+ RelativePath="..\..\src\game\GossipDef.h">
</File>
<File
- RelativePath="..\..\src\game\Player.h"
- >
+ RelativePath="..\..\src\game\GridDefines.h">
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.cpp"
- >
+ RelativePath="..\..\src\game\GridNotifiers.cpp">
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.h"
- >
+ RelativePath="..\..\src\game\GridNotifiers.h">
</File>
<File
- RelativePath="..\..\src\game\Totem.cpp"
- >
+ RelativePath="..\..\src\game\GridNotifiersImpl.h">
</File>
<File
- RelativePath="..\..\src\game\Totem.h"
- >
+ RelativePath="..\..\src\game\GridStates.cpp">
</File>
<File
- RelativePath="..\..\src\game\Traveller.h"
- >
+ RelativePath="..\..\src\game\GridStates.h">
</File>
<File
- RelativePath="..\..\src\game\Unit.cpp"
- >
+ RelativePath="..\..\src\game\Group.cpp">
</File>
<File
- RelativePath="..\..\src\game\Unit.h"
- >
+ RelativePath="..\..\src\game\Group.h">
</File>
<File
- RelativePath="..\..\src\game\UnitEvents.h"
- >
+ RelativePath="..\..\src\game\GroupHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\UpdateFields.h"
- >
+ RelativePath="..\..\src\game\GuildHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\UpdateMask.h"
- >
+ RelativePath="..\..\src\game\InstanceData.cpp">
</File>
- </Filter>
- <Filter
- Name="Server"
- >
<File
- RelativePath="..\..\src\game\GlobalEvents.cpp"
- >
+ RelativePath="..\..\src\game\InstanceData.h">
</File>
<File
- RelativePath="..\..\src\game\GlobalEvents.h"
- >
+ RelativePath="..\..\src\game\InstanceSaveMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\Opcodes.cpp"
- >
+ RelativePath="..\..\src\game\InstanceSaveMgr.h">
</File>
<File
- RelativePath="..\..\src\game\Opcodes.h"
- >
+ RelativePath="..\..\src\game\ItemHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\SharedDefines.h"
- >
+ RelativePath="..\..\src\game\LFGHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\WorldLog.cpp"
- >
+ RelativePath="..\..\src\game\LootHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\WorldLog.h"
- >
+ RelativePath="..\..\src\game\Mail.cpp">
</File>
<File
- RelativePath="..\..\src\game\WorldSession.cpp"
- >
+ RelativePath="..\..\src\game\Mail.h">
</File>
<File
- RelativePath="..\..\src\game\WorldSession.h"
- >
+ RelativePath="..\..\src\game\Map.cpp">
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.cpp"
- >
+ RelativePath="..\..\src\game\Map.h">
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.h"
- >
+ RelativePath="..\..\src\game\MapInstanced.cpp">
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.cpp"
- >
+ RelativePath="..\..\src\game\MapInstanced.h">
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.h"
- >
+ RelativePath="..\..\src\game\MapManager.cpp">
</File>
- </Filter>
- <Filter
- Name="Chat Commands"
- >
<File
- RelativePath="..\..\src\game\Debugcmds.cpp"
- >
+ RelativePath="..\..\src\game\MapManager.h">
</File>
<File
- RelativePath="..\..\src\game\Level0.cpp"
- >
+ RelativePath="..\..\src\game\MapReference.h">
</File>
<File
- RelativePath="..\..\src\game\Level1.cpp"
- >
+ RelativePath="..\..\src\game\MapRefManager.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\MiscHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\Level2.cpp"
- >
+ RelativePath="..\..\src\game\MovementHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\Level3.cpp"
- >
+ RelativePath="..\..\src\game\NPCHandler.cpp">
</File>
- </Filter>
- <Filter
- Name="Tools"
- >
<File
- RelativePath="..\..\src\game\Language.h"
- >
+ RelativePath="..\..\src\game\NPCHandler.h">
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.cpp"
- >
+ RelativePath="..\..\src\game\ObjectGridLoader.cpp">
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.h"
- >
+ RelativePath="..\..\src\game\ObjectGridLoader.h">
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.cpp"
+ RelativePath="..\..\src\game\OutdoorPvP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.h"
+ RelativePath="..\..\src\game\OutdoorPvP.h"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.h"
+ RelativePath="..\..\src\game\OutdoorPvPEP.h"
>
</File>
- </Filter>
- <Filter
- Name="References"
- >
<File
- RelativePath="..\..\src\game\FollowerReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPHP.h"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPNA.h"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPSI.h"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPTF.h"
>
</File>
- </Filter>
- <Filter
- Name="Battlegrounds"
- >
<File
- RelativePath="..\..\src\game\BattleGround.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGround.h"
+ RelativePath="..\..\src\game\OutdoorPvPZM.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.cpp"
- >
+ RelativePath="..\..\src\game\Path.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.h"
- >
+ RelativePath="..\..\src\game\PetHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.cpp"
- >
+ RelativePath="..\..\src\game\PetitionsHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.h"
- >
+ RelativePath="..\..\src\game\PoolHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.cpp"
- >
+ RelativePath="..\..\src\game\PoolHandler.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.h"
- >
+ RelativePath="..\..\src\game\QueryHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.cpp"
- >
+ RelativePath="..\..\src\game\QuestDef.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.h"
- >
+ RelativePath="..\..\src\game\QuestDef.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.cpp"
- >
+ RelativePath="..\..\src\game\QuestHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.h"
- >
+ RelativePath="..\..\src\game\ScriptCalls.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundHandler.cpp"
- >
+ RelativePath="..\..\src\game\ScriptCalls.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.cpp"
- >
+ RelativePath="..\..\src\game\SkillDiscovery.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.h"
- >
+ RelativePath="..\..\src\game\SkillDiscovery.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.cpp"
- >
+ RelativePath="..\..\src\game\SkillExtraItems.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.h"
- >
+ RelativePath="..\..\src\game\SkillExtraItems.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.cpp"
- >
+ RelativePath="..\..\src\game\SkillHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.h"
- >
+ RelativePath="..\..\src\game\Spell.cpp">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.cpp"
- >
+ RelativePath="..\..\src\game\Spell.h">
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.h"
- >
+ RelativePath="..\..\src\game\SpellAuraDefines.h">
</File>
- </Filter>
- <Filter
- Name="Outdoor PvP"
- >
<File
- RelativePath="..\..\src\game\OutdoorPvP.cpp"
- >
+ RelativePath="..\..\src\game\SpellAuras.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvP.h"
- >
+ RelativePath="..\..\src\game\SpellAuras.h">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
- >
+ RelativePath="..\..\src\game\SpellEffects.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.h"
- >
+ RelativePath="..\..\src\game\SpellHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
- >
+ RelativePath="..\..\src\game\TaxiHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.h"
- >
+ RelativePath="..\..\src\game\TicketHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
- >
+ RelativePath="..\..\src\game\TradeHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.h"
- >
+ RelativePath="..\..\src\game\Transports.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
- >
+ RelativePath="..\..\src\game\Transports.h">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.h"
- >
+ RelativePath="..\..\src\game\UpdateData.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
- >
+ RelativePath="..\..\src\game\UpdateData.h">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
- >
+ RelativePath="..\..\src\game\VoiceChatHandler.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
- >
+ RelativePath="..\..\src\game\WaypointManager.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.h"
- >
+ RelativePath="..\..\src\game\WaypointManager.h">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
- >
+ RelativePath="..\..\src\game\Weather.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.h"
- >
+ RelativePath="..\..\src\game\Weather.h">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
- >
+ RelativePath="..\..\src\game\World.cpp">
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.h"
- >
+ RelativePath="..\..\src\game\World.h">
</File>
</Filter>
<Filter
- Name="Artificial Intelligence"
- >
+ Name="Object">
<File
- RelativePath="..\..\src\game\AggressorAI.cpp"
- >
+ RelativePath="..\..\src\game\AggressorAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\AggressorAI.h"
- >
+ RelativePath="..\..\src\game\AggressorAI.h">
</File>
<File
- RelativePath="..\..\src\game\CreatureAI.cpp"
- >
+ RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\CreatureAI.h"
- >
+ RelativePath="..\..\src\game\ArenaTeam.cpp">
</File>
<File
- RelativePath="..\..\src\game\CreatureAIImpl.h"
- >
+ RelativePath="..\..\src\game\ArenaTeam.h">
</File>
<File
- RelativePath="..\..\src\game\CreatureAIRegistry.cpp"
- >
+ RelativePath="..\..\src\game\AuctionHouseMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\CreatureAIRegistry.h"
- >
+ RelativePath="..\..\src\game\AuctionHouseMgr.h">
</File>
<File
- RelativePath="..\..\src\game\CreatureAISelector.cpp"
- >
+ RelativePath="..\..\src\game\Bag.cpp">
</File>
<File
- RelativePath="..\..\src\game\CreatureAISelector.h"
- >
+ RelativePath="..\..\src\game\Bag.h">
</File>
<File
- RelativePath="..\..\src\game\GuardAI.cpp"
- >
+ RelativePath="..\..\src\game\Calendar.cpp">
</File>
<File
- RelativePath="..\..\src\game\GuardAI.h"
- >
+ RelativePath="..\..\src\game\Calendar.h">
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.cpp"
- >
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.h"
- >
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\PetAI.cpp"
- >
+ RelativePath="..\..\src\game\Corpse.cpp">
</File>
<File
- RelativePath="..\..\src\game\PetAI.h"
- >
+ RelativePath="..\..\src\game\Corpse.h">
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.cpp"
- >
+ RelativePath="..\..\src\game\Creature.cpp">
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.h"
- >
+ RelativePath="..\..\src\game\Creature.h">
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.cpp"
- >
+ RelativePath="..\..\src\game\CreatureAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.h"
- >
+ RelativePath="..\..\src\game\CreatureAI.h">
</File>
<File
- RelativePath="..\..\src\game\TotemAI.cpp"
- >
+ RelativePath="..\..\src\game\CreatureAIImpl.h">
</File>
<File
- RelativePath="..\..\src\game\TotemAI.h"
- >
+ RelativePath="..\..\src\game\CreatureAIRegistry.cpp">
</File>
- </Filter>
- <Filter
- Name="Movement Generators"
- >
<File
- RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\CreatureAIRegistry.h">
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\CreatureAISelector.cpp">
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\CreatureAISelector.h">
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\CreatureGroups.cpp">
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\CreatureGroups.h">
</File>
<File
- RelativePath="..\..\src\game\HomeMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\DestinationHolder.cpp">
</File>
<File
- RelativePath="..\..\src\game\HomeMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\DestinationHolder.h">
</File>
<File
- RelativePath="..\..\src\game\IdleMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\DestinationHolderImp.h">
</File>
<File
- RelativePath="..\..\src\game\IdleMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\DynamicObject.cpp">
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\DynamicObject.h">
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.h"
- >
+ RelativePath="..\..\src\game\CreatureEventAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\CreatureEventAI.h">
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\CreatureEventAIMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\CreatureEventAIMgr.h">
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\FleeingMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\FleeingMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\Formulas.h">
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.cpp"
- >
+ RelativePath="..\..\src\game\GameObject.cpp">
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.h"
- >
+ RelativePath="..\..\src\game\GameObject.h">
</File>
- </Filter>
- <Filter
- Name="Spells/Skills"
- >
+
<File
- RelativePath="..\..\src\game\SkillDiscovery.cpp"
- >
+ RelativePath="..\..\src\game\GuardAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\SkillDiscovery.h"
- >
+ RelativePath="..\..\src\game\GuardAI.h">
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.cpp"
- >
+ RelativePath="..\..\src\game\Guild.cpp">
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.h"
- >
+ RelativePath="..\..\src\game\Guild.h">
</File>
<File
- RelativePath="..\..\src\game\SkillHandler.cpp"
- >
+ RelativePath="..\..\src\game\HomeMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\Spell.cpp"
- >
+ RelativePath="..\..\src\game\HomeMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\Spell.h"
- >
+ RelativePath="..\..\src\game\IdleMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\SpellAuraDefines.h"
- >
+ RelativePath="..\..\src\game\IdleMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.cpp"
- >
+ RelativePath="..\..\src\game\Item.cpp">
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.h"
- >
+ RelativePath="..\..\src\game\Item.h">
</File>
<File
- RelativePath="..\..\src\game\SpellEffects.cpp"
- >
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\SpellHandler.cpp"
- >
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.h">
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.cpp"
- >
+ RelativePath="..\..\src\game\ItemPrototype.h">
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.h"
- >
+ RelativePath="..\..\src\game\LootMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\StatSystem.cpp"
- >
+ RelativePath="..\..\src\game\LootMgr.h">
</File>
- </Filter>
- <Filter
- Name="Maps/Grids"
- >
<File
- RelativePath="..\..\src\game\Cell.h"
- >
+ RelativePath="..\..\src\game\MotionMaster.cpp">
</File>
<File
- RelativePath="..\..\src\game\CellImpl.h"
- >
+ RelativePath="..\..\src\game\MotionMaster.h">
</File>
<File
- RelativePath="..\..\src\game\GridDefines.h"
- >
+ RelativePath="..\..\src\game\MovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.cpp"
- >
+ RelativePath="..\..\src\game\MovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.h"
- >
+ RelativePath="..\..\src\game\NullCreatureAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\GridNotifiersImpl.h"
- >
+ RelativePath="..\..\src\game\NullCreatureAI.h">
</File>
<File
- RelativePath="..\..\src\game\GridStates.cpp"
- >
+ RelativePath="..\..\src\game\Object.cpp">
</File>
<File
- RelativePath="..\..\src\game\GridStates.h"
- >
+ RelativePath="..\..\src\game\Object.h">
</File>
<File
- RelativePath="..\..\src\game\InstanceData.cpp"
- >
+ RelativePath="..\..\src\game\ObjectAccessor.cpp">
</File>
<File
- RelativePath="..\..\src\game\InstanceData.h"
- >
+ RelativePath="..\..\src\game\ObjectAccessor.h">
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.cpp"
- >
+ RelativePath="..\..\src\game\ObjectDefines.h">
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.h"
- >
+ RelativePath="..\..\src\game\ObjectMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\Map.cpp"
- >
+ RelativePath="..\..\src\game\ObjectMgr.h">
</File>
<File
- RelativePath="..\..\src\game\Map.h"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.h"
- >
+ RelativePath="..\..\src\game\Pet.cpp">
</File>
<File
- RelativePath="..\..\src\game\MapManager.cpp"
- >
+ RelativePath="..\..\src\game\Pet.h">
</File>
<File
- RelativePath="..\..\src\game\MapManager.h"
- >
+ RelativePath="..\..\src\game\PetAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\MapReference.h"
- >
+ RelativePath="..\..\src\game\PetAI.h">
</File>
<File
- RelativePath="..\..\src\game\MapRefManager.h"
- >
+ RelativePath="..\..\src\game\Player.cpp">
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.cpp"
- >
+ RelativePath="..\..\src\game\Player.h">
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.h"
- >
+ RelativePath="..\..\src\game\PointMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\Path.h"
- >
+ RelativePath="..\..\src\game\PointMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\Transports.cpp"
+ RelativePath="..\..\src\game\PossessedAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Transports.h"
+ RelativePath="..\..\src\game\PossessedAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\Weather.cpp"
- >
+ RelativePath="..\..\src\game\RandomMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\Weather.h"
- >
+ RelativePath="..\..\src\game\RandomMovementGenerator.h">
</File>
- </Filter>
- <Filter
- Name="Handlers"
- >
<File
- RelativePath="..\..\src\game\AddonHandler.cpp"
- >
+ RelativePath="..\..\src\game\ReactorAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\AddonHandler.h"
- >
+ RelativePath="..\..\src\game\ReactorAI.h">
</File>
<File
- RelativePath="..\..\src\game\ArenaTeamHandler.cpp"
- >
+ RelativePath="..\..\src\game\ReputationMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseHandler.cpp"
- >
+ RelativePath="..\..\src\game\ReputationMgr.h">
</File>
<File
- RelativePath="..\..\src\game\ChannelHandler.cpp"
- >
+ RelativePath="..\..\src\game\SocialMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\CharacterHandler.cpp"
- >
+ RelativePath="..\..\src\game\SocialMgr.h">
</File>
<File
- RelativePath="..\..\src\game\ChatHandler.cpp"
- >
+ RelativePath="..\..\src\game\SpellMgr.cpp">
</File>
<File
- RelativePath="..\..\src\game\CombatHandler.cpp"
- >
+ RelativePath="..\..\src\game\SpellMgr.h">
</File>
<File
- RelativePath="..\..\src\game\DuelHandler.cpp"
- >
+ RelativePath="..\..\src\game\StatSystem.cpp">
</File>
<File
- RelativePath="..\..\src\game\GroupHandler.cpp"
- >
+ RelativePath="..\..\src\game\TargetedMovementGenerator.cpp">
</File>
<File
- RelativePath="..\..\src\game\GuildHandler.cpp"
- >
+ RelativePath="..\..\src\game\TargetedMovementGenerator.h">
</File>
<File
- RelativePath="..\..\src\game\ItemHandler.cpp"
- >
+ RelativePath="..\..\src\game\TemporarySummon.cpp">
</File>
<File
- RelativePath="..\..\src\game\LFGHandler.cpp"
- >
+ RelativePath="..\..\src\game\TemporarySummon.h">
</File>
<File
- RelativePath="..\..\src\game\LootHandler.cpp"
+ RelativePath="..\..\src\game\TicketMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MiscHandler.cpp"
+ RelativePath="..\..\src\game\TicketMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\MovementHandler.cpp"
- >
+ RelativePath="..\..\src\game\Totem.cpp">
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.cpp"
- >
+ RelativePath="..\..\src\game\Totem.h">
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.h"
- >
+ RelativePath="..\..\src\game\TotemAI.cpp">
</File>
<File
- RelativePath="..\..\src\game\PetHandler.cpp"
- >
+ RelativePath="..\..\src\game\TotemAI.h">
</File>
<File
- RelativePath="..\..\src\game\PetitionsHandler.cpp"
- >
+ RelativePath="..\..\src\game\Traveller.h">
</File>
<File
- RelativePath="..\..\src\game\QueryHandler.cpp"
- >
+ RelativePath="..\..\src\game\Unit.cpp">
</File>
<File
- RelativePath="..\..\src\game\QuestHandler.cpp"
- >
+ RelativePath="..\..\src\game\Unit.h">
</File>
<File
- RelativePath="..\..\src\game\TaxiHandler.cpp"
- >
+ RelativePath="..\..\src\game\UnitEvents.h">
</File>
<File
- RelativePath="..\..\src\game\TicketHandler.cpp"
- >
+ RelativePath="..\..\src\game\UpdateFields.h">
</File>
<File
- RelativePath="..\..\src\game\TradeHandler.cpp"
- >
+ RelativePath="..\..\src\game\UpdateMask.h">
</File>
<File
- RelativePath="..\..\src\game\VoiceChatHandler.cpp"
- >
+ RelativePath="..\..\src\game\Vehicle.cpp">
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.cpp"
- >
+ RelativePath="..\..\src\game\Vehicle.h">
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.h"
- >
+ RelativePath="..\..\src\game\WaypointMovementGenerator.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\WaypointMovementGenerator.h">
</File>
</Filter>
<Filter
- Name="Managers"
- >
+ Name="Server">
<File
- RelativePath="..\..\src\game\AccountMgr.cpp"
- >
+ RelativePath="..\..\src\game\DBCEnums.h">
</File>
<File
- RelativePath="..\..\src\game\AccountMgr.h"
- >
+ RelativePath="..\..\src\game\DBCfmt.h">
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.cpp"
- >
+ RelativePath="..\..\src\game\DBCStores.cpp">
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.h"
- >
+ RelativePath="..\..\src\game\DBCStores.h">
</File>
<File
- RelativePath="..\..\src\game\ChannelMgr.h"
- >
+ RelativePath="..\..\src\game\DBCStructure.h">
</File>
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp"
- >
+ RelativePath="..\..\src\game\GlobalEvents.cpp">
</File>
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.h"
- >
+ RelativePath="..\..\src\game\GlobalEvents.h">
</File>
<File
- RelativePath="..\..\src\game\LootMgr.cpp"
- >
+ RelativePath="..\..\src\game\Opcodes.cpp">
</File>
<File
- RelativePath="..\..\src\game\LootMgr.h"
- >
+ RelativePath="..\..\src\game\Opcodes.h">
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.cpp"
- >
+ RelativePath="..\..\src\game\SharedDefines.h">
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.h"
- >
+ RelativePath="..\..\src\game\WorldLog.cpp">
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.cpp"
- >
+ RelativePath="..\..\src\game\WorldLog.h">
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.h"
- >
+ RelativePath="..\..\src\game\WorldSession.cpp">
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.cpp"
- >
+ RelativePath="..\..\src\game\WorldSession.h">
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.h"
- >
+ RelativePath="..\..\src\game\WorldSocket.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\WorldSocket.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\WorldSocketMgr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\WorldSocketMgr.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Chat Commands">
+ <File
+ RelativePath="..\..\src\game\debugcmds.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\Level0.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\Level1.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\Level2.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\Level3.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Tool">
+ <File
+ RelativePath="..\..\src\game\Language.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\PlayerDump.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\PlayerDump.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="References"
+ Filter="">
+ <File
+ RelativePath="..\..\src\game\FollowerReference.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\FollowerReference.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\FollowerRefManager.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\GroupReference.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\GroupReference.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\GroupRefManager.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\HostilRefManager.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\HostilRefManager.h">
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.h">
</File>
</Filter>
</Files>
diff --git a/win/VC71/mangosd.vcproj b/win/VC71/mangosd.vcproj
new file mode 100644
index 00000000000..3a054513d14
--- /dev/null
+++ b/win/VC71/mangosd.vcproj
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="TrinityCore"
+ ProjectGUID="{D1EA3EE9-4DCF-4CB9-BA6E-B9321E0D552A}"
+ RootNamespace="mangosd"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;NDEBUG;_CONSOLE;ENABLE_CLI"
+ StringPooling="TRUE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="TRUE"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="TRUE"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="TRUE"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ ImportLibrary="$(OutDir)\trinitycore.lib"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)
+copy ..\..\src\trinitycore\trinitycore.conf.dist ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf.dist
+"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE;ENABLE_CLI"
+ IgnoreStandardIncludePath="FALSE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="TRUE"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ Version=""
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="TRUE"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ LinkTimeCodeGeneration="FALSE"
+ ImportLibrary="$(OutDir)\trinitycore.lib"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)
+copy ..\..\src\trinitycore\trinitycore.conf.dist ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf.dist
+"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="doc">
+ <File
+ RelativePath="..\..\Authors">
+ </File>
+ <File
+ RelativePath="..\..\ChangeLog">
+ </File>
+ <File
+ RelativePath="..\..\Copying">
+ </File>
+ <File
+ RelativePath="..\..\Install">
+ </File>
+ <File
+ RelativePath="..\..\News">
+ </File>
+ <File
+ RelativePath="..\..\Readme">
+ </File>
+ <File
+ RelativePath="..\..\Thanks">
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\src\trinitycore\CliRunnable.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\CliRunnable.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\Main.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\Master.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\Master.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\RASocket.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\RASocket.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\resource.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\TrinityCore.rc">
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\WorldRunnable.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinitycore\WorldRunnable.h">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC71/realmd.vcproj b/win/VC71/realmd.vcproj
new file mode 100644
index 00000000000..a98f3e252b1
--- /dev/null
+++ b/win/VC71/realmd.vcproj
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="TrinityRealm"
+ ProjectGUID="{563E9905-3657-460C-AE63-0AC39D162E23}"
+ RootNamespace="realmd"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;,WIN32,NDEBUG,_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="TRUE"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="TRUE"
+ PrecompiledHeaderFile=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="TRUE"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\trinityrealm\trinityrealm.conf.dist ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf.dist"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\realmd__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE"
+ IgnoreStandardIncludePath="FALSE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="TRUE"
+ PrecompiledHeaderFile=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\realmd__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="TRUE"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\trinityrealm\trinityrealm.conf.dist ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf.dist"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\src\trinityrealm\AuthCodes.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\AuthSocket.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\AuthSocket.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\Main.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\RealmList.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\RealmList.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\resource.h">
+ </File>
+ <File
+ RelativePath="..\..\src\trinityrealm\TrinityRealm.rc">
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp">
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC71/shared.vcproj b/win/VC71/shared.vcproj
index 1d9f80dcc3e..163fa41df9a 100644
--- a/win/VC71/shared.vcproj
+++ b/win/VC71/shared.vcproj
@@ -195,34 +195,13 @@
<Filter
Name="DataStores">
<File
- RelativePath="..\..\src\shared\Database\dbcfile.cpp">
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.cpp">
</File>
<File
- RelativePath="..\..\src\shared\Database\dbcfile.h">
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.h">
</File>
<File
- RelativePath="..\..\src\shared\Database\DBCfmt.cpp">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.cpp">
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.h">
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStructure.h">
+ RelativePath="..\..\src\shared\Database\DBCStore.h">
</File>
</Filter>
</Filter>
@@ -238,12 +217,6 @@
<Filter
Name="Util">
<File
- RelativePath="..\..\src\shared\Base.cpp">
- </File>
- <File
- RelativePath="..\..\src\shared\Base.h">
- </File>
- <File
RelativePath="..\..\src\shared\ByteBuffer.h">
</File>
<File
@@ -253,12 +226,6 @@
RelativePath="..\..\dep\include\mersennetwister\MersenneTwister.h">
</File>
<File
- RelativePath="..\..\src\shared\Mthread.cpp">
- </File>
- <File
- RelativePath="..\..\src\shared\Mthread.h">
- </File>
- <File
RelativePath="..\..\src\shared\ProgressBar.cpp">
</File>
<File
@@ -427,7 +394,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -438,7 +405,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
diff --git a/win/VC80/ACE_vc8.vcproj b/win/VC80/ACE_vc8.vcproj
index 9ac893792b0..e72c5507b25 100644
--- a/win/VC80/ACE_vc8.vcproj
+++ b/win/VC80/ACE_vc8.vcproj
@@ -77,7 +77,7 @@
Name="VCLinkerTool"
AdditionalDependencies=""
OutputFile="$(OutDir)\ACEd.dll"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
@@ -170,7 +170,7 @@
AdditionalOptions="/machine:AMD64"
AdditionalDependencies=""
OutputFile="$(OutDir)\ACEd.dll"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj
index 6de6b767d7e..2eda92302b9 100644
--- a/win/VC80/game.vcproj
+++ b/win/VC80/game.vcproj
@@ -52,7 +52,6 @@
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -126,7 +125,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP"
+ AdditionalOptions="/MP /bigobj"
Optimization="0"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_LIB;"
@@ -134,7 +133,6 @@
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -215,7 +213,6 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -289,7 +286,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP"
+ AdditionalOptions="/MP /bigobj"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
@@ -297,7 +294,6 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="0"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -348,71 +344,70 @@
</References>
<Files>
<Filter
- Name="World/Others"
+ Name="World/Handlers"
>
<File
- RelativePath="..\..\src\game\Channel.cpp"
+ RelativePath="..\..\src\game\AccountMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Channel.h"
+ RelativePath="..\..\src\game\AccountMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Chat.cpp"
+ RelativePath="..\..\src\game\AchievementMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Chat.h"
+ RelativePath="..\..\src\game\AchievementMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\GameEvent.cpp"
+ RelativePath="..\..\src\game\ArenaTeamHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GameEvent.h"
+ RelativePath="..\..\src\game\AuctionHouseHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GossipDef.cpp"
+ RelativePath="..\..\src\game\BattleGround.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GossipDef.h"
+ RelativePath="..\..\src\game\BattleGround.h"
>
</File>
<File
- RelativePath="..\..\src\game\Mail.cpp"
+ RelativePath="..\..\src\game\BattleGroundAA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Mail.h"
+ RelativePath="..\..\src\game\BattleGroundAA.h"
>
</File>
<File
- RelativePath="..\..\src\game\QuestDef.cpp"
+ RelativePath="..\..\src\game\BattleGroundAB.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\QuestDef.h"
+ RelativePath="..\..\src\game\BattleGroundAB.h"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateData.cpp"
+ RelativePath="..\..\src\game\BattleGroundAV.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateData.h"
+ RelativePath="..\..\src\game\BattleGroundAV.h"
>
</File>
<File
- RelativePath="..\..\src\game\World.cpp"
+ RelativePath="..\..\src\game\BattleGroundBE.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\World.h"
- >
+ RelativePath="..\..\src\game\BattleGroundBE.h">
</File>
</Filter>
<Filter
@@ -429,519 +424,547 @@
Name="Objects"
>
<File
- RelativePath="..\..\src\game\ArenaTeam.cpp"
+ RelativePath="..\..\src\game\BattleGroundDS.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ArenaTeam.h"
+ RelativePath="..\..\src\game\BattleGroundDS.h"
>
</File>
<File
- RelativePath="..\..\src\game\Bag.cpp"
+ RelativePath="..\..\src\game\BattleGroundEY.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Bag.h"
+ RelativePath="..\..\src\game\BattleGroundEY.h"
>
</File>
<File
- RelativePath="..\..\src\game\Corpse.cpp"
+ RelativePath="..\..\src\game\BattleGroundHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Corpse.h"
+ RelativePath="..\..\src\game\BattleGroundMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Creature.cpp"
+ RelativePath="..\..\src\game\BattleGroundMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Creature.h"
+ RelativePath="..\..\src\game\BattleGroundNA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.cpp"
+ RelativePath="..\..\src\game\BattleGroundNA.h"
>
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.h"
+ RelativePath="..\..\src\game\BattleGroundRL.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.cpp"
+ RelativePath="..\..\src\game\BattleGroundRL.h"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.h"
+ RelativePath="..\..\src\game\BattleGroundRV.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolderImp.h"
+ RelativePath="..\..\src\game\BattleGroundRV.h"
>
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.cpp"
+ RelativePath="..\..\src\game\BattleGroundSA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.h"
+ RelativePath="..\..\src\game\BattleGroundSA.h"
>
</File>
<File
- RelativePath="..\..\src\game\Formulas.h"
+ RelativePath="..\..\src\game\BattleGroundWS.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GameObject.cpp"
+ RelativePath="..\..\src\game\BattleGroundWS.h"
>
</File>
<File
- RelativePath="..\..\src\game\GameObject.h"
+ RelativePath="..\..\src\game\CalendarHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Group.cpp"
+ RelativePath="..\..\src\game\Cell.h"
>
</File>
<File
- RelativePath="..\..\src\game\Group.h"
+ RelativePath="..\..\src\game\CellImpl.h"
>
</File>
<File
- RelativePath="..\..\src\game\Guild.cpp"
+ RelativePath="..\..\src\game\Channel.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Guild.h"
+ RelativePath="..\..\src\game\Channel.h"
>
</File>
<File
- RelativePath="..\..\src\game\Item.cpp"
+ RelativePath="..\..\src\game\ChannelHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Item.h"
+ RelativePath="..\..\src\game\ChannelMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\ItemPrototype.h"
+ RelativePath="..\..\src\game\CharacterHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.cpp"
+ RelativePath="..\..\src\game\Chat.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.h"
+ RelativePath="..\..\src\game\Chat.h"
>
</File>
<File
- RelativePath="..\..\src\game\Object.cpp"
+ RelativePath="..\..\src\game\ChatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Object.h"
+ RelativePath="..\..\src\game\CombatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.cpp"
+ RelativePath="..\..\src\game\DuelHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.h"
+ RelativePath="..\..\src\game\GameEventMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectDefines.h"
+ RelativePath="..\..\src\game\GameEventMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Pet.cpp"
+ RelativePath="..\..\src\game\GossipDef.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Pet.h"
+ RelativePath="..\..\src\game\GossipDef.h"
>
</File>
<File
- RelativePath="..\..\src\game\Player.cpp"
+ RelativePath="..\..\src\game\GridDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\Player.h"
+ RelativePath="..\..\src\game\GridNotifiers.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.cpp"
+ RelativePath="..\..\src\game\GridNotifiers.h"
>
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.h"
+ RelativePath="..\..\src\game\GridNotifiersImpl.h"
>
</File>
<File
- RelativePath="..\..\src\game\Totem.cpp"
+ RelativePath="..\..\src\game\GridStates.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Totem.h"
+ RelativePath="..\..\src\game\GridStates.h"
>
</File>
<File
- RelativePath="..\..\src\game\Traveller.h"
+ RelativePath="..\..\src\game\Group.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Unit.cpp"
+ RelativePath="..\..\src\game\Group.h"
>
</File>
<File
- RelativePath="..\..\src\game\Unit.h"
+ RelativePath="..\..\src\game\GroupHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UnitEvents.h"
+ RelativePath="..\..\src\game\GuildHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateFields.h"
+ RelativePath="..\..\src\game\InstanceData.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateMask.h"
+ RelativePath="..\..\src\game\InstanceData.h"
>
</File>
- </Filter>
- <Filter
- Name="Server"
- >
<File
- RelativePath="..\..\src\game\GlobalEvents.cpp"
+ RelativePath="..\..\src\game\InstanceSaveMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GlobalEvents.h"
+ RelativePath="..\..\src\game\InstanceSaveMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Opcodes.cpp"
+ RelativePath="..\..\src\game\ItemHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Opcodes.h"
+ RelativePath="..\..\src\game\LFGHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SharedDefines.h"
+ RelativePath="..\..\src\game\LootHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldLog.cpp"
+ RelativePath="..\..\src\game\Mail.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldLog.h"
+ RelativePath="..\..\src\game\Mail.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSession.cpp"
+ RelativePath="..\..\src\game\Map.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSession.h"
+ RelativePath="..\..\src\game\Map.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.cpp"
+ RelativePath="..\..\src\game\MapInstanced.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.h"
+ RelativePath="..\..\src\game\MapInstanced.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.cpp"
+ RelativePath="..\..\src\game\MapManager.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.h"
+ RelativePath="..\..\src\game\MapManager.h"
>
</File>
- </Filter>
- <Filter
- Name="Chat Commands"
- >
<File
- RelativePath="..\..\src\game\Debugcmds.cpp"
+ RelativePath="..\..\src\game\MiscHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level0.cpp"
+ RelativePath="..\..\src\game\MovementHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level1.cpp"
+ RelativePath="..\..\src\game\NPCHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level2.cpp"
+ RelativePath="..\..\src\game\NPCHandler.h"
>
</File>
<File
- RelativePath="..\..\src\game\Level3.cpp"
+ RelativePath="..\..\src\game\ObjectGridLoader.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Tools"
- >
<File
- RelativePath="..\..\src\game\Language.h"
+ RelativePath="..\..\src\game\ObjectGridLoader.h"
>
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.cpp"
+ RelativePath="..\..\src\game\OutdoorPvP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.h"
+ RelativePath="..\..\src\game\OutdoorPvP.h"
>
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.h"
+ RelativePath="..\..\src\game\OutdoorPvPEP.h"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.h"
+ RelativePath="..\..\src\game\OutdoorPvPHP.h"
>
</File>
- </Filter>
- <Filter
- Name="References"
- >
<File
- RelativePath="..\..\src\game\FollowerReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPNA.h"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPSI.h"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPTF.h"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPZM.h"
>
</File>
- </Filter>
- <Filter
- Name="Battlegrounds"
- >
<File
- RelativePath="..\..\src\game\BattleGround.cpp"
+ RelativePath="..\..\src\game\Path.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGround.h"
+ RelativePath="..\..\src\game\PetHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.cpp"
+ RelativePath="..\..\src\game\PetitionsHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.h"
+ RelativePath="..\..\src\game\PoolHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.cpp"
+ RelativePath="..\..\src\game\PoolHandler.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.h"
+ RelativePath="..\..\src\game\QueryHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.cpp"
+ RelativePath="..\..\src\game\QuestDef.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.h"
+ RelativePath="..\..\src\game\QuestDef.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.cpp"
+ RelativePath="..\..\src\game\QuestHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.h"
+ RelativePath="..\..\src\game\ScriptCalls.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.cpp"
+ RelativePath="..\..\src\game\ScriptCalls.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.h"
+ RelativePath="..\..\src\game\SkillDiscovery.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundHandler.cpp"
+ RelativePath="..\..\src\game\SkillDiscovery.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.cpp"
+ RelativePath="..\..\src\game\SkillExtraItems.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.h"
+ RelativePath="..\..\src\game\SkillExtraItems.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.cpp"
+ RelativePath="..\..\src\game\SkillHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.h"
+ RelativePath="..\..\src\game\Spell.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.cpp"
+ RelativePath="..\..\src\game\Spell.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.h"
+ RelativePath="..\..\src\game\SpellAuraDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.cpp"
+ RelativePath="..\..\src\game\SpellAuras.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.h"
+ RelativePath="..\..\src\game\SpellAuras.h"
>
</File>
- </Filter>
- <Filter
- Name="Outdoor PvP"
- >
<File
- RelativePath="..\..\src\game\OutdoorPvP.cpp"
+ RelativePath="..\..\src\game\SpellEffects.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvP.h"
+ RelativePath="..\..\src\game\SpellHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
+ RelativePath="..\..\src\game\TaxiHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.h"
+ RelativePath="..\..\src\game\TicketHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
+ RelativePath="..\..\src\game\TradeHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.h"
+ RelativePath="..\..\src\game\Transports.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
+ RelativePath="..\..\src\game\Transports.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.h"
+ RelativePath="..\..\src\game\UpdateData.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
+ RelativePath="..\..\src\game\UpdateData.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.h"
+ RelativePath="..\..\src\game\VoiceChatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
+ RelativePath="..\..\src\game\WaypointManager.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
+ RelativePath="..\..\src\game\WaypointManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
+ RelativePath="..\..\src\game\Weather.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.h"
+ RelativePath="..\..\src\game\Weather.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
+ RelativePath="..\..\src\game\World.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.h"
+ RelativePath="..\..\src\game\World.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="Object"
+ >
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
+ RelativePath="..\..\src\game\AggressorAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.h"
+ RelativePath="..\..\src\game\AggressorAI.h"
>
</File>
- </Filter>
- <Filter
- Name="Artificial Intelligence"
- >
<File
- RelativePath="..\..\src\game\AggressorAI.cpp"
+ RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\AggressorAI.h"
+ RelativePath="..\..\src\game\ArenaTeam.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ArenaTeam.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\AuctionHouseMgr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\AuctionHouseMgr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Bag.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Bag.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Calendar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Corpse.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Corpse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Creature.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Creature.h"
>
</File>
<File
@@ -973,75 +996,83 @@
>
</File>
<File
- RelativePath="..\..\src\game\GuardAI.cpp"
+ RelativePath="..\..\src\game\CreatureGroups.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GuardAI.h"
+ RelativePath="..\..\src\game\CreatureGroups.h"
>
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.cpp"
+ RelativePath="..\..\src\game\DestinationHolder.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.h"
+ RelativePath="..\..\src\game\DestinationHolder.h"
>
</File>
<File
- RelativePath="..\..\src\game\PetAI.cpp"
+ RelativePath="..\..\src\game\DestinationHolderImp.h"
>
</File>
<File
- RelativePath="..\..\src\game\PetAI.h"
+ RelativePath="..\..\src\game\DynamicObject.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.cpp"
+ RelativePath="..\..\src\game\DynamicObject.h"
>
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.h"
+ RelativePath="..\..\src\game\CreatureEventAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.cpp"
+ RelativePath="..\..\src\game\CreatureEventAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.h"
+ RelativePath="..\..\src\game\CreatureEventAIMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TotemAI.cpp"
+ RelativePath="..\..\src\game\CreatureEventAIMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\TotemAI.h"
+ RelativePath="..\..\src\game\FleeingMovementGenerator.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Movement Generators"
- >
<File
- RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h"
+ RelativePath="..\..\src\game\FleeingMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp"
+ RelativePath="..\..\src\game\Formulas.h"
>
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.h"
+ RelativePath="..\..\src\game\GameObject.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.cpp"
+ RelativePath="..\..\src\game\GameObject.h"
>
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.h"
+ RelativePath="..\..\src\game\GuardAI.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\GuardAI.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Guild.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Guild.h"
>
</File>
<File
@@ -1061,399 +1092,423 @@
>
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.cpp"
+ RelativePath="..\..\src\game\Item.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.h"
+ RelativePath="..\..\src\game\Item.h"
>
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.cpp"
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.h"
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.cpp"
+ RelativePath="..\..\src\game\ItemPrototype.h"
>
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.h"
+ RelativePath="..\..\src\game\LootMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.cpp"
+ RelativePath="..\..\src\game\LootMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.h"
+ RelativePath="..\..\src\game\MotionMaster.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.cpp"
+ RelativePath="..\..\src\game\MotionMaster.h"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.h"
+ RelativePath="..\..\src\game\MovementGenerator.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Spells/Skills"
- >
<File
- RelativePath="..\..\src\game\SkillDiscovery.cpp"
+ RelativePath="..\..\src\game\MovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\SkillDiscovery.h"
+ RelativePath="..\..\src\game\NullCreatureAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.cpp"
+ RelativePath="..\..\src\game\NullCreatureAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.h"
+ RelativePath="..\..\src\game\Object.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SkillHandler.cpp"
+ RelativePath="..\..\src\game\Object.h"
>
</File>
<File
- RelativePath="..\..\src\game\Spell.cpp"
+ RelativePath="..\..\src\game\ObjectAccessor.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Spell.h"
+ RelativePath="..\..\src\game\ObjectAccessor.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuraDefines.h"
+ RelativePath="..\..\src\game\ObjectDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.cpp"
+ RelativePath="..\..\src\game\ObjectMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.h"
+ RelativePath="..\..\src\game\ObjectMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellEffects.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellHandler.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.cpp"
+ RelativePath="..\..\src\game\Pet.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.h"
+ RelativePath="..\..\src\game\Pet.h"
>
</File>
<File
- RelativePath="..\..\src\game\StatSystem.cpp"
+ RelativePath="..\..\src\game\PetAI.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Maps/Grids"
- >
<File
- RelativePath="..\..\src\game\Cell.h"
+ RelativePath="..\..\src\game\PetAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\CellImpl.h"
+ RelativePath="..\..\src\game\Player.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridDefines.h"
+ RelativePath="..\..\src\game\Player.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.cpp"
+ RelativePath="..\..\src\game\PointMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.h"
+ RelativePath="..\..\src\game\PossessedAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiersImpl.h"
+ RelativePath="..\..\src\game\PossessedAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridStates.cpp"
+ RelativePath="..\..\src\game\PointMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridStates.h"
+ RelativePath="..\..\src\game\RandomMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceData.cpp"
+ RelativePath="..\..\src\game\RandomMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceData.h"
+ RelativePath="..\..\src\game\ReactorAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.cpp"
+ RelativePath="..\..\src\game\ReactorAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.h"
+ RelativePath="..\..\src\game\ReputationMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Map.cpp"
+ RelativePath="..\..\src\game\ReputationMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Map.h"
+ RelativePath="..\..\src\game\SocialMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.cpp"
+ RelativePath="..\..\src\game\SocialMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.h"
+ RelativePath="..\..\src\game\SpellMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapManager.cpp"
+ RelativePath="..\..\src\game\SpellMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\MapManager.h"
+ RelativePath="..\..\src\game\StatSystem.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapReference.h"
+ RelativePath="..\..\src\game\TargetedMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapRefManager.h"
+ RelativePath="..\..\src\game\TargetedMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.cpp"
+ RelativePath="..\..\src\game\TemporarySummon.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.h"
+ RelativePath="..\..\src\game\TemporarySummon.h"
>
</File>
<File
- RelativePath="..\..\src\game\Path.h"
+ RelativePath="..\..\src\game\TicketMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Transports.cpp"
+ RelativePath="..\..\src\game\TicketMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Transports.h"
+ RelativePath="..\..\src\game\Totem.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Weather.cpp"
+ RelativePath="..\..\src\game\Totem.h"
>
</File>
<File
- RelativePath="..\..\src\game\Weather.h"
+ RelativePath="..\..\src\game\TotemAI.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Handlers"
- >
<File
- RelativePath="..\..\src\game\AddonHandler.cpp"
+ RelativePath="..\..\src\game\TotemAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\AddonHandler.h"
+ RelativePath="..\..\src\game\Traveller.h"
>
</File>
<File
- RelativePath="..\..\src\game\ArenaTeamHandler.cpp"
+ RelativePath="..\..\src\game\Unit.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseHandler.cpp"
+ RelativePath="..\..\src\game\Unit.h"
>
</File>
<File
- RelativePath="..\..\src\game\ChannelHandler.cpp"
+ RelativePath="..\..\src\game\UnitEvents.h"
>
</File>
<File
- RelativePath="..\..\src\game\CharacterHandler.cpp"
+ RelativePath="..\..\src\game\UpdateFields.h"
>
</File>
<File
- RelativePath="..\..\src\game\ChatHandler.cpp"
+ RelativePath="..\..\src\game\UpdateMask.h"
>
</File>
<File
- RelativePath="..\..\src\game\CombatHandler.cpp"
+ RelativePath="..\..\src\game\Vehicle.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DuelHandler.cpp"
+ RelativePath="..\..\src\game\Vehicle.h"
>
</File>
<File
- RelativePath="..\..\src\game\GroupHandler.cpp"
+ RelativePath="..\..\src\game\WaypointMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GuildHandler.cpp"
+ RelativePath="..\..\src\game\WaypointMovementGenerator.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="Server"
+ >
<File
- RelativePath="..\..\src\game\ItemHandler.cpp"
+ RelativePath="..\..\src\game\DBCEnums.h"
>
</File>
<File
- RelativePath="..\..\src\game\LFGHandler.cpp"
+ RelativePath="..\..\src\game\DBCfmt.h"
>
</File>
<File
- RelativePath="..\..\src\game\LootHandler.cpp"
+ RelativePath="..\..\src\game\DBCStores.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MiscHandler.cpp"
+ RelativePath="..\..\src\game\DBCStores.h"
>
</File>
<File
- RelativePath="..\..\src\game\MovementHandler.cpp"
+ RelativePath="..\..\src\game\DBCStructure.h"
>
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.cpp"
+ RelativePath="..\..\src\game\GlobalEvents.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.h"
+ RelativePath="..\..\src\game\GlobalEvents.h"
>
</File>
<File
- RelativePath="..\..\src\game\PetHandler.cpp"
+ RelativePath="..\..\src\game\Opcodes.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PetitionsHandler.cpp"
+ RelativePath="..\..\src\game\Opcodes.h"
>
</File>
<File
- RelativePath="..\..\src\game\QueryHandler.cpp"
+ RelativePath="..\..\src\game\SharedDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\QuestHandler.cpp"
+ RelativePath="..\..\src\game\WorldLog.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TaxiHandler.cpp"
+ RelativePath="..\..\src\game\WorldLog.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketHandler.cpp"
+ RelativePath="..\..\src\game\WorldSession.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TradeHandler.cpp"
+ RelativePath="..\..\src\game\WorldSession.h"
>
</File>
<File
- RelativePath="..\..\src\game\VoiceChatHandler.cpp"
+ RelativePath="..\..\src\game\WorldSocket.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.cpp"
+ RelativePath="..\..\src\game\WorldSocket.h"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.h"
+ RelativePath="..\..\src\game\WorldSocketMgr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\WorldSocketMgr.h"
>
</File>
</Filter>
<Filter
- Name="Managers"
+ Name="Chat Commands"
>
<File
- RelativePath="..\..\src\game\AccountMgr.cpp"
+ RelativePath="..\..\src\game\debugcmds.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AccountMgr.h"
+ RelativePath="..\..\src\game\Level0.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.cpp"
+ RelativePath="..\..\src\game\Level1.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.h"
+ RelativePath="..\..\src\game\Level2.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ChannelMgr.h"
+ RelativePath="..\..\src\game\Level3.cpp"
>
</File>
+ </Filter>
+ <Filter
+ Name="Tool"
+ >
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp"
+ RelativePath="..\..\src\game\Language.h"
>
</File>
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.h"
+ RelativePath="..\..\src\game\PlayerDump.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\LootMgr.cpp"
+ RelativePath="..\..\src\game\PlayerDump.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="References"
+ >
<File
- RelativePath="..\..\src\game\LootMgr.h"
+ RelativePath="..\..\src\game\FollowerReference.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.cpp"
+ RelativePath="..\..\src\game\FollowerReference.h"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.h"
+ RelativePath="..\..\src\game\FollowerRefManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.cpp"
+ RelativePath="..\..\src\game\GroupReference.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.h"
+ RelativePath="..\..\src\game\GroupReference.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.cpp"
+ RelativePath="..\..\src\game\GroupRefManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.h"
+ RelativePath="..\..\src\game\HostilRefManager.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\HostilRefManager.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\MapReference.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\MapRefManager.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.h"
>
</File>
</Filter>
diff --git a/win/VC80/mangosd.vcproj b/win/VC80/mangosd.vcproj
new file mode 100644
index 00000000000..a6294ae5fc6
--- /dev/null
+++ b/win/VC80/mangosd.vcproj
@@ -0,0 +1,523 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="TrinityCore"
+ ProjectGUID="{A3A04E47-43A2-4C08-90B3-029CEF558594}"
+ RootNamespace="mangosd"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\bin\Release\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;NDEBUG;_CONSOLE;ENABLE_CLI"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ LinkTimeCodeGeneration="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;
+ &#x0A;
+ copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;
+ &#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\bin\Release\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;NDEBUG;_CONSOLE;ENABLE_CLI"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="0"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;
+ &#x0A;
+ copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;
+ &#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE;ENABLE_CLI"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ Version=""
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ FixedBaseAddress="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;
+ &#x0A;
+ copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;
+ &#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE;ENABLE_CLI"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ Version=""
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ TargetMachine="17"
+ FixedBaseAddress="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;
+ &#x0A;
+ copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;
+ &#x0A;"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="doc"
+ >
+ <File
+ RelativePath="..\..\Authors"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ChangeLog"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Copying"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Install"
+ >
+ </File>
+ <File
+ RelativePath="..\..\News"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Readme"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Thanks"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\src\mangosd\CliRunnable.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\CliRunnable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Main.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\mangosd.rc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Master.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Master.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\RASocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\RASocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\WorldRunnable.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\WorldRunnable.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC80/realmd.vcproj b/win/VC80/realmd.vcproj
new file mode 100644
index 00000000000..16f6c8565f9
--- /dev/null
+++ b/win/VC80/realmd.vcproj
@@ -0,0 +1,459 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="TrinityRealm"
+ ProjectGUID="{563E9905-3657-460C-AE63-0AC39D162E23}"
+ RootNamespace="realmd"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;,WIN32,NDEBUG,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;,WIN32,NDEBUG,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="0"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ FixedBaseAddress="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ TargetMachine="17"
+ FixedBaseAddress="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\src\realmd\AuthCodes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\AuthSocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\AuthSocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\Main.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\realmd.rc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\RealmList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\RealmList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC80/shared.vcproj b/win/VC80/shared.vcproj
index 3824e5ae494..8b00f9b7606 100644
--- a/win/VC80/shared.vcproj
+++ b/win/VC80/shared.vcproj
@@ -440,59 +440,15 @@
Name="DataStores"
>
<File
- RelativePath="..\..\src\shared\Database\dbcfile.cpp"
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.cpp"
>
</File>
<File
- RelativePath="..\..\src\shared\Database\dbcfile.h"
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.h"
>
</File>
<File
- RelativePath="..\..\src\shared\Database\DBCfmt.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.h"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStructure.h"
+ RelativePath="..\..\src\shared\Database\DBCStore.h"
>
</File>
</Filter>
@@ -513,14 +469,6 @@
Name="Util"
>
<File
- RelativePath="..\..\src\shared\Base.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Base.h"
- >
- </File>
- <File
RelativePath="..\..\src\shared\ByteBuffer.h"
>
</File>
@@ -533,14 +481,6 @@
>
</File>
<File
- RelativePath="..\..\src\shared\Mthread.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Mthread.h"
- >
- </File>
- <File
RelativePath="..\..\src\shared\ProgressBar.cpp"
>
</File>
@@ -761,7 +701,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -772,7 +712,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -783,7 +723,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -794,7 +734,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
diff --git a/win/VC90/ACE_vc9.vcproj b/win/VC90/ACE_vc9.vcproj
index a2dedea085b..8f449dcba2b 100644
--- a/win/VC90/ACE_vc9.vcproj
+++ b/win/VC90/ACE_vc9.vcproj
@@ -78,7 +78,7 @@
Name="VCLinkerTool"
AdditionalDependencies=""
OutputFile="$(OutDir)\ACEd.dll"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
@@ -168,7 +168,7 @@
AdditionalOptions="/machine:AMD64"
AdditionalDependencies=""
OutputFile="$(OutDir)\ACEd.dll"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
@@ -324,6 +324,7 @@
RuntimeTypeInfo="true"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
DisableSpecificWarnings="4355"
/>
<Tool
@@ -2853,11 +2854,11 @@
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_errno.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\OS_Errno.h"
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\OS_Errno.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_errno.h"
>
</File>
<File
@@ -3237,11 +3238,11 @@
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_string.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\OS_String.h"
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\OS_String.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_string.h"
>
</File>
<File
@@ -3285,11 +3286,11 @@
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_time.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\os_include\sys\os_time.h"
>
</File>
<File
- RelativePath="..\..\dep\ACE_wrappers\ace\os_include\sys\os_time.h"
+ RelativePath="..\..\dep\ACE_wrappers\ace\os_include\os_time.h"
>
</File>
<File
diff --git a/win/VC90/TrinityCore.vcproj b/win/VC90/TrinityCore.vcproj
index cd5fb8e19d2..ea5a3c837d0 100644
--- a/win/VC90/TrinityCore.vcproj
+++ b/win/VC90/TrinityCore.vcproj
@@ -279,7 +279,7 @@
AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
Version=""
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
@@ -379,7 +379,7 @@
AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
Version=""
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
GenerateDebugInformation="true"
diff --git a/win/VC90/TrinityRealm.vcproj b/win/VC90/TrinityRealm.vcproj
index 85659d11540..4606cd6cf9c 100644
--- a/win/VC90/TrinityRealm.vcproj
+++ b/win/VC90/TrinityRealm.vcproj
@@ -274,7 +274,7 @@
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
GenerateDebugInformation="true"
@@ -372,7 +372,7 @@
Name="VCLinkerTool"
AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
- LinkIncremental="2"
+ LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
GenerateDebugInformation="true"
diff --git a/win/VC90/g3dlite.vcproj b/win/VC90/g3dlite.vcproj
index 5eab1cfbad7..30b6ee6d4ff 100644
--- a/win/VC90/g3dlite.vcproj
+++ b/win/VC90/g3dlite.vcproj
@@ -58,7 +58,7 @@
ProgramDataBaseFileName=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
+ DebugInformationFormat="3"
CallingConvention="0"
/>
<Tool
@@ -92,7 +92,7 @@
/>
</Configuration>
<Configuration
- Name="Release|Win32"
+ Name="Debug|x64"
OutputDirectory=".\g3dlite__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\g3dlite__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
@@ -113,15 +113,19 @@
/>
<Tool
Name="VCMIDLTool"
+ TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
+ Optimization="0"
AdditionalIncludeDirectories="..\..\dep\include\g3dlite"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableEnhancedInstructionSet="1"
- FloatingPointModel="2"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
@@ -162,7 +166,7 @@
/>
</Configuration>
<Configuration
- Name="Debug|x64"
+ Name="Release|Win32"
OutputDirectory=".\g3dlite__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\g3dlite__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
@@ -183,19 +187,15 @@
/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
- Optimization="0"
AdditionalIncludeDirectories="..\..\dep\include\g3dlite"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- EnableFunctionLevelLinking="true"
- BufferSecurityCheck="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableEnhancedInstructionSet="1"
+ FloatingPointModel="2"
UsePrecompiledHeader="0"
AssemblerListingLocation=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
@@ -266,8 +266,8 @@
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableEnhancedInstructionSet="0"
- UsePrecompiledHeader="0"
FloatingPointModel="2"
+ UsePrecompiledHeader="0"
AssemblerListingLocation=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
ProgramDataBaseFileName=".\g3dlite__$(PlatformName)_$(ConfigurationName)\"
diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj
index b8470720af7..0711158a5ec 100644
--- a/win/VC90/game.vcproj
+++ b/win/VC90/game.vcproj
@@ -5,7 +5,8 @@
Name="game"
ProjectGUID="{1DC6C4DA-A028-41F3-877D-D5400C594F88}"
RootNamespace="game"
- TargetFrameworkVersion="131072"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
>
<Platforms>
<Platform
@@ -23,7 +24,6 @@
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -80,7 +80,6 @@
/>
<Tool
Name="VCLibrarianTool"
- AdditionalDependencies=".\shared__$(PlatformName)_$(ConfigurationName)\shared.lib"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
@@ -101,11 +100,10 @@
/>
</Configuration>
<Configuration
- Name="Debug|x64"
+ Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -124,19 +122,17 @@
/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
- Optimization="0"
+ InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_LIB;"
- StringPooling="false"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
+ StringPooling="true"
+ RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -155,7 +151,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
+ PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
@@ -163,7 +159,6 @@
/>
<Tool
Name="VCLibrarianTool"
- AdditionalDependencies=".\shared__$(PlatformName)_$(ConfigurationName)\shared.lib"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
@@ -184,11 +179,10 @@
/>
</Configuration>
<Configuration
- Name="Release|Win32"
+ Name="Debug|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -207,18 +201,19 @@
/>
<Tool
Name="VCMIDLTool"
+ TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP"
- InlineFunctionExpansion="1"
+ AdditionalOptions="/MP /bigobj"
+ Optimization="0"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
- StringPooling="true"
- RuntimeLibrary="2"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_LIB;"
+ StringPooling="false"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="1"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -237,7 +232,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
+ PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@@ -270,7 +265,6 @@
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -293,7 +287,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP"
+ AdditionalOptions="/MP /bigobj"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
@@ -301,7 +295,6 @@
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="0"
- FloatingPointModel="2"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
@@ -353,593 +346,559 @@
</References>
<Files>
<Filter
- Name="World/Others"
+ Name="World/Handlers"
>
<File
- RelativePath="..\..\src\game\Channel.cpp"
+ RelativePath="..\..\src\game\AccountMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Channel.h"
+ RelativePath="..\..\src\game\AccountMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Chat.cpp"
+ RelativePath="..\..\src\game\AchievementMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Chat.h"
+ RelativePath="..\..\src\game\AchievementMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\GameEvent.cpp"
+ RelativePath="..\..\src\game\ArenaTeamHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GameEvent.h"
+ RelativePath="..\..\src\game\AuctionHouseHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GossipDef.cpp"
+ RelativePath="..\..\src\game\BattleGround.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GossipDef.h"
+ RelativePath="..\..\src\game\BattleGround.h"
>
</File>
<File
- RelativePath="..\..\src\game\Mail.cpp"
+ RelativePath="..\..\src\game\BattleGroundAA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Mail.h"
+ RelativePath="..\..\src\game\BattleGroundAA.h"
>
</File>
<File
- RelativePath="..\..\src\game\QuestDef.cpp"
+ RelativePath="..\..\src\game\BattleGroundAB.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\QuestDef.h"
+ RelativePath="..\..\src\game\BattleGroundAB.h"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateData.cpp"
+ RelativePath="..\..\src\game\BattleGroundAV.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateData.h"
+ RelativePath="..\..\src\game\BattleGroundAV.h"
>
</File>
<File
- RelativePath="..\..\src\game\World.cpp"
+ RelativePath="..\..\src\game\BattleGroundBE.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\World.h"
+ RelativePath="..\..\src\game\BattleGroundBE.h"
>
</File>
- </Filter>
- <Filter
- Name="AuctionHouseBot"
- >
- <File
- RelativePath="..\..\src\game\AuctionHouseBot.cpp">
- </File>
- <File
- RelativePath="..\..\src\game\AuctionHouseBot.h">
- </File>
- </Filter>
- <Filter
- Name="Objects"
- >
<File
- RelativePath="..\..\src\game\ArenaTeam.cpp"
+ RelativePath="..\..\src\game\BattleGroundDS.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ArenaTeam.h"
+ RelativePath="..\..\src\game\BattleGroundDS.h"
>
</File>
<File
- RelativePath="..\..\src\game\Bag.cpp"
+ RelativePath="..\..\src\game\BattleGroundEY.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Bag.h"
+ RelativePath="..\..\src\game\BattleGroundEY.h"
>
</File>
<File
- RelativePath="..\..\src\game\Corpse.cpp"
+ RelativePath="..\..\src\game\BattleGroundHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Corpse.h"
+ RelativePath="..\..\src\game\BattleGroundMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Creature.cpp"
+ RelativePath="..\..\src\game\BattleGroundMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Creature.h"
+ RelativePath="..\..\src\game\BattleGroundNA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.cpp"
+ RelativePath="..\..\src\game\BattleGroundNA.h"
>
</File>
<File
- RelativePath="..\..\src\game\CreatureGroups.h"
+ RelativePath="..\..\src\game\BattleGroundRL.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.cpp"
+ RelativePath="..\..\src\game\BattleGroundRL.h"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolder.h"
+ RelativePath="..\..\src\game\BattleGroundRV.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DestinationHolderImp.h"
+ RelativePath="..\..\src\game\BattleGroundRV.h"
>
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.cpp"
+ RelativePath="..\..\src\game\BattleGroundSA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DynamicObject.h"
+ RelativePath="..\..\src\game\BattleGroundSA.h"
>
</File>
<File
- RelativePath="..\..\src\game\Formulas.h"
+ RelativePath="..\..\src\game\BattleGroundWS.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GameObject.cpp"
+ RelativePath="..\..\src\game\BattleGroundWS.h"
>
</File>
<File
- RelativePath="..\..\src\game\GameObject.h"
+ RelativePath="..\..\src\game\CalendarHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Group.cpp"
+ RelativePath="..\..\src\game\Cell.h"
>
</File>
<File
- RelativePath="..\..\src\game\Group.h"
+ RelativePath="..\..\src\game\CellImpl.h"
>
</File>
<File
- RelativePath="..\..\src\game\Guild.cpp"
+ RelativePath="..\..\src\game\Channel.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Guild.h"
+ RelativePath="..\..\src\game\Channel.h"
>
</File>
<File
- RelativePath="..\..\src\game\Item.cpp"
+ RelativePath="..\..\src\game\ChannelHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Item.h"
+ RelativePath="..\..\src\game\ChannelMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\ItemPrototype.h"
+ RelativePath="..\..\src\game\CharacterHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.cpp"
+ RelativePath="..\..\src\game\Chat.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MotionMaster.h"
+ RelativePath="..\..\src\game\Chat.h"
>
</File>
<File
- RelativePath="..\..\src\game\Object.cpp"
+ RelativePath="..\..\src\game\ChatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Object.h"
+ RelativePath="..\..\src\game\CombatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.cpp"
+ RelativePath="..\..\src\game\DuelHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectAccessor.h"
+ RelativePath="..\..\src\game\GameEventMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectDefines.h"
+ RelativePath="..\..\src\game\GameEventMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Pet.cpp"
+ RelativePath="..\..\src\game\GossipDef.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Pet.h"
+ RelativePath="..\..\src\game\GossipDef.h"
>
</File>
<File
- RelativePath="..\..\src\game\Player.cpp"
+ RelativePath="..\..\src\game\GridDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\Player.h"
+ RelativePath="..\..\src\game\GridNotifiers.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.cpp"
+ RelativePath="..\..\src\game\GridNotifiers.h"
>
</File>
<File
- RelativePath="..\..\src\game\TemporarySummon.h"
+ RelativePath="..\..\src\game\GridNotifiersImpl.h"
>
</File>
<File
- RelativePath="..\..\src\game\Totem.cpp"
+ RelativePath="..\..\src\game\GridStates.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Totem.h"
+ RelativePath="..\..\src\game\GridStates.h"
>
</File>
<File
- RelativePath="..\..\src\game\Traveller.h"
+ RelativePath="..\..\src\game\Group.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Unit.cpp"
+ RelativePath="..\..\src\game\Group.h"
>
</File>
<File
- RelativePath="..\..\src\game\Unit.h"
+ RelativePath="..\..\src\game\GroupHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UnitEvents.h"
+ RelativePath="..\..\src\game\GuildHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateFields.h"
+ RelativePath="..\..\src\game\InstanceData.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\UpdateMask.h"
+ RelativePath="..\..\src\game\InstanceData.h"
>
</File>
- </Filter>
- <Filter
- Name="Server"
- >
<File
- RelativePath="..\..\src\game\GlobalEvents.cpp"
+ RelativePath="..\..\src\game\InstanceSaveMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GlobalEvents.h"
+ RelativePath="..\..\src\game\InstanceSaveMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Opcodes.cpp"
+ RelativePath="..\..\src\game\ItemHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Opcodes.h"
+ RelativePath="..\..\src\game\LFGHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SharedDefines.h"
+ RelativePath="..\..\src\game\LootHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldLog.cpp"
+ RelativePath="..\..\src\game\Mail.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldLog.h"
+ RelativePath="..\..\src\game\Mail.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSession.cpp"
+ RelativePath="..\..\src\game\Map.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSession.h"
+ RelativePath="..\..\src\game\Map.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.cpp"
+ RelativePath="..\..\src\game\MapInstanced.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocket.h"
+ RelativePath="..\..\src\game\MapInstanced.h"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.cpp"
+ RelativePath="..\..\src\game\MapManager.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WorldSocketMgr.h"
+ RelativePath="..\..\src\game\MapManager.h"
>
</File>
- </Filter>
- <Filter
- Name="Chat Commands"
- >
<File
- RelativePath="..\..\src\game\Debugcmds.cpp"
+ RelativePath="..\..\src\game\MiscHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level0.cpp"
+ RelativePath="..\..\src\game\MovementHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level1.cpp"
+ RelativePath="..\..\src\game\NPCHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Level2.cpp"
+ RelativePath="..\..\src\game\NPCHandler.h"
>
</File>
<File
- RelativePath="..\..\src\game\Level3.cpp"
+ RelativePath="..\..\src\game\ObjectGridLoader.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Tools"
- >
<File
- RelativePath="..\..\src\game\Language.h"
+ RelativePath="..\..\src\game\ObjectGridLoader.h"
>
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.cpp"
+ RelativePath="..\..\src\game\OutdoorPvP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PlayerDump.h"
+ RelativePath="..\..\src\game\OutdoorPvP.h"
>
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ScriptCalls.h"
+ RelativePath="..\..\src\game\OutdoorPvPEP.h"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Tools.h"
+ RelativePath="..\..\src\game\OutdoorPvPHP.h"
>
</File>
- </Filter>
- <Filter
- Name="References"
- >
<File
- RelativePath="..\..\src\game\FollowerReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\FollowerRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPNA.h"
>
</File>
<File
- RelativePath="..\..\src\game\GroupReference.h"
+ RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GroupRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPSI.h"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\HostilRefManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPTF.h"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ThreatManager.h"
+ RelativePath="..\..\src\game\OutdoorPvPZM.h"
>
</File>
- </Filter>
- <Filter
- Name="Battlegrounds"
- >
<File
- RelativePath="..\..\src\game\BattleGround.cpp"
+ RelativePath="..\..\src\game\Path.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGround.h"
+ RelativePath="..\..\src\game\PetHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.cpp"
+ RelativePath="..\..\src\game\PetitionsHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAA.h"
+ RelativePath="..\..\src\game\PoolHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.cpp"
+ RelativePath="..\..\src\game\PoolHandler.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAB.h"
+ RelativePath="..\..\src\game\QueryHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.cpp"
+ RelativePath="..\..\src\game\QuestDef.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundAV.h"
+ RelativePath="..\..\src\game\QuestDef.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.cpp"
+ RelativePath="..\..\src\game\QuestHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundBE.h"
+ RelativePath="..\..\src\game\ScriptCalls.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.cpp"
+ RelativePath="..\..\src\game\ScriptCalls.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundEY.h"
+ RelativePath="..\..\src\game\SkillDiscovery.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundHandler.cpp"
+ RelativePath="..\..\src\game\SkillDiscovery.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.cpp"
+ RelativePath="..\..\src\game\SkillExtraItems.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundMgr.h"
+ RelativePath="..\..\src\game\SkillExtraItems.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.cpp"
+ RelativePath="..\..\src\game\SkillHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundNA.h"
+ RelativePath="..\..\src\game\Spell.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.cpp"
+ RelativePath="..\..\src\game\Spell.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundRL.h"
+ RelativePath="..\..\src\game\SpellAuraDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.cpp"
+ RelativePath="..\..\src\game\SpellAuras.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\BattleGroundWS.h"
+ RelativePath="..\..\src\game\SpellAuras.h"
>
</File>
- </Filter>
- <Filter
- Name="Outdoor PvP"
- >
<File
- RelativePath="..\..\src\game\OutdoorPvP.cpp"
+ RelativePath="..\..\src\game\SpellEffects.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvP.h"
+ RelativePath="..\..\src\game\SpellHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.cpp"
+ RelativePath="..\..\src\game\TaxiHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPEP.h"
+ RelativePath="..\..\src\game\TicketHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.cpp"
+ RelativePath="..\..\src\game\TradeHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPHP.h"
+ RelativePath="..\..\src\game\Transports.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.cpp"
+ RelativePath="..\..\src\game\Transports.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPMgr.h"
+ RelativePath="..\..\src\game\UpdateData.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.cpp"
+ RelativePath="..\..\src\game\UpdateData.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPNA.h"
+ RelativePath="..\..\src\game\VoiceChatHandler.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
+ RelativePath="..\..\src\game\WaypointManager.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
+ RelativePath="..\..\src\game\WaypointManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
+ RelativePath="..\..\src\game\Weather.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPSI.h"
+ RelativePath="..\..\src\game\Weather.h"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.cpp"
+ RelativePath="..\..\src\game\World.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPTF.h"
+ RelativePath="..\..\src\game\World.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="AuctionHouseBot"
+ >
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.cpp"
+ RelativePath="..\..\src\game\AuctionHouseBot.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\OutdoorPvPZM.h"
+ RelativePath="..\..\src\game\AuctionHouseBot.h"
>
</File>
</Filter>
<Filter
- Name="Artificial Intelligence"
+ Name="Object"
>
<File
RelativePath="..\..\src\game\AggressorAI.cpp"
@@ -950,6 +909,66 @@
>
</File>
<File
+ RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ArenaTeam.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ArenaTeam.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\AuctionHouseMgr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\AuctionHouseMgr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Bag.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Bag.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Calendar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ConfusedMovementGenerator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Corpse.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Corpse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Creature.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Creature.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\game\CreatureAI.cpp"
>
</File>
@@ -978,75 +997,83 @@
>
</File>
<File
- RelativePath="..\..\src\game\GuardAI.cpp"
+ RelativePath="..\..\src\game\CreatureEventAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GuardAI.h"
+ RelativePath="..\..\src\game\CreatureEventAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.cpp"
+ RelativePath="..\..\src\game\CreatureEventAIMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\NullCreatureAI.h"
+ RelativePath="..\..\src\game\CreatureEventAIMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\PetAI.cpp"
+ RelativePath="..\..\src\game\CreatureGroups.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PetAI.h"
+ RelativePath="..\..\src\game\CreatureGroups.h"
>
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.cpp"
+ RelativePath="..\..\src\game\DestinationHolder.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PossessedAI.h"
+ RelativePath="..\..\src\game\DestinationHolder.h"
>
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.cpp"
+ RelativePath="..\..\src\game\DestinationHolderImp.h"
>
</File>
<File
- RelativePath="..\..\src\game\ReactorAI.h"
+ RelativePath="..\..\src\game\DynamicObject.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TotemAI.cpp"
+ RelativePath="..\..\src\game\DynamicObject.h"
>
</File>
<File
- RelativePath="..\..\src\game\TotemAI.h"
+ RelativePath="..\..\src\game\FleeingMovementGenerator.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Movement Generators"
- >
<File
- RelativePath="..\..\src\game\AnimalRandomMovementGenerator.h"
+ RelativePath="..\..\src\game\FleeingMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.cpp"
+ RelativePath="..\..\src\game\Formulas.h"
>
</File>
<File
- RelativePath="..\..\src\game\ConfusedMovementGenerator.h"
+ RelativePath="..\..\src\game\GameObject.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.cpp"
+ RelativePath="..\..\src\game\GameObject.h"
>
</File>
<File
- RelativePath="..\..\src\game\FleeingMovementGenerator.h"
+ RelativePath="..\..\src\game\GuardAI.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\GuardAI.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Guild.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\Guild.h"
>
</File>
<File
@@ -1066,399 +1093,423 @@
>
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.cpp"
+ RelativePath="..\..\src\game\Item.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MovementGenerator.h"
+ RelativePath="..\..\src\game\Item.h"
>
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.cpp"
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PointMovementGenerator.h"
+ RelativePath="..\..\src\game\ItemEnchantmentMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.cpp"
+ RelativePath="..\..\src\game\ItemPrototype.h"
>
</File>
<File
- RelativePath="..\..\src\game\RandomMovementGenerator.h"
+ RelativePath="..\..\src\game\LootMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.cpp"
+ RelativePath="..\..\src\game\LootMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\TargetedMovementGenerator.h"
+ RelativePath="..\..\src\game\MotionMaster.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.cpp"
+ RelativePath="..\..\src\game\MotionMaster.h"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointMovementGenerator.h"
+ RelativePath="..\..\src\game\MovementGenerator.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Spells/Skills"
- >
<File
- RelativePath="..\..\src\game\SkillDiscovery.cpp"
+ RelativePath="..\..\src\game\MovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\SkillDiscovery.h"
+ RelativePath="..\..\src\game\NullCreatureAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.cpp"
+ RelativePath="..\..\src\game\NullCreatureAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\SkillExtraItems.h"
+ RelativePath="..\..\src\game\Object.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SkillHandler.cpp"
+ RelativePath="..\..\src\game\Object.h"
>
</File>
<File
- RelativePath="..\..\src\game\Spell.cpp"
+ RelativePath="..\..\src\game\ObjectAccessor.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Spell.h"
+ RelativePath="..\..\src\game\ObjectAccessor.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuraDefines.h"
+ RelativePath="..\..\src\game\ObjectDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.cpp"
+ RelativePath="..\..\src\game\ObjectMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellAuras.h"
+ RelativePath="..\..\src\game\ObjectMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellEffects.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellHandler.cpp"
+ RelativePath="..\..\src\game\OutdoorPvPObjectiveAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.cpp"
+ RelativePath="..\..\src\game\Pet.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SpellMgr.h"
+ RelativePath="..\..\src\game\Pet.h"
>
</File>
<File
- RelativePath="..\..\src\game\StatSystem.cpp"
+ RelativePath="..\..\src\game\PetAI.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Maps/Grids"
- >
<File
- RelativePath="..\..\src\game\Cell.h"
+ RelativePath="..\..\src\game\PetAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\CellImpl.h"
+ RelativePath="..\..\src\game\Player.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridDefines.h"
+ RelativePath="..\..\src\game\Player.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.cpp"
+ RelativePath="..\..\src\game\PointMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiers.h"
+ RelativePath="..\..\src\game\PointMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridNotifiersImpl.h"
+ RelativePath="..\..\src\game\PossessedAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GridStates.cpp"
+ RelativePath="..\..\src\game\PossessedAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\GridStates.h"
+ RelativePath="..\..\src\game\RandomMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceData.cpp"
+ RelativePath="..\..\src\game\RandomMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceData.h"
+ RelativePath="..\..\src\game\ReactorAI.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.cpp"
+ RelativePath="..\..\src\game\ReactorAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\InstanceSaveMgr.h"
+ RelativePath="..\..\src\game\ReputationMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Map.cpp"
+ RelativePath="..\..\src\game\ReputationMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Map.h"
+ RelativePath="..\..\src\game\SocialMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.cpp"
+ RelativePath="..\..\src\game\SocialMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\MapInstanced.h"
+ RelativePath="..\..\src\game\SpellMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapManager.cpp"
+ RelativePath="..\..\src\game\SpellMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\MapManager.h"
+ RelativePath="..\..\src\game\StatSystem.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapReference.h"
+ RelativePath="..\..\src\game\TargetedMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MapRefManager.h"
+ RelativePath="..\..\src\game\TargetedMovementGenerator.h"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.cpp"
+ RelativePath="..\..\src\game\TemporarySummon.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectGridLoader.h"
+ RelativePath="..\..\src\game\TemporarySummon.h"
>
</File>
<File
- RelativePath="..\..\src\game\Path.h"
+ RelativePath="..\..\src\game\TicketMgr.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Transports.cpp"
+ RelativePath="..\..\src\game\TicketMgr.h"
>
</File>
<File
- RelativePath="..\..\src\game\Transports.h"
+ RelativePath="..\..\src\game\Totem.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\Weather.cpp"
+ RelativePath="..\..\src\game\Totem.h"
>
</File>
<File
- RelativePath="..\..\src\game\Weather.h"
+ RelativePath="..\..\src\game\TotemAI.cpp"
>
</File>
- </Filter>
- <Filter
- Name="Handlers"
- >
<File
- RelativePath="..\..\src\game\AddonHandler.cpp"
+ RelativePath="..\..\src\game\TotemAI.h"
>
</File>
<File
- RelativePath="..\..\src\game\AddonHandler.h"
+ RelativePath="..\..\src\game\Traveller.h"
>
</File>
<File
- RelativePath="..\..\src\game\ArenaTeamHandler.cpp"
+ RelativePath="..\..\src\game\Unit.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseHandler.cpp"
+ RelativePath="..\..\src\game\Unit.h"
>
</File>
<File
- RelativePath="..\..\src\game\ChannelHandler.cpp"
+ RelativePath="..\..\src\game\UnitEvents.h"
>
</File>
<File
- RelativePath="..\..\src\game\CharacterHandler.cpp"
+ RelativePath="..\..\src\game\UpdateFields.h"
>
</File>
<File
- RelativePath="..\..\src\game\ChatHandler.cpp"
+ RelativePath="..\..\src\game\UpdateMask.h"
>
</File>
<File
- RelativePath="..\..\src\game\CombatHandler.cpp"
+ RelativePath="..\..\src\game\Vehicle.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\DuelHandler.cpp"
+ RelativePath="..\..\src\game\Vehicle.h"
>
</File>
<File
- RelativePath="..\..\src\game\GroupHandler.cpp"
+ RelativePath="..\..\src\game\WaypointMovementGenerator.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\GuildHandler.cpp"
+ RelativePath="..\..\src\game\WaypointMovementGenerator.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="Server"
+ >
<File
- RelativePath="..\..\src\game\ItemHandler.cpp"
+ RelativePath="..\..\src\game\DBCEnums.h"
>
</File>
<File
- RelativePath="..\..\src\game\LFGHandler.cpp"
+ RelativePath="..\..\src\game\DBCfmt.h"
>
</File>
<File
- RelativePath="..\..\src\game\LootHandler.cpp"
+ RelativePath="..\..\src\game\DBCStores.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\MiscHandler.cpp"
+ RelativePath="..\..\src\game\DBCStores.h"
>
</File>
<File
- RelativePath="..\..\src\game\MovementHandler.cpp"
+ RelativePath="..\..\src\game\DBCStructure.h"
>
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.cpp"
+ RelativePath="..\..\src\game\GlobalEvents.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\NPCHandler.h"
+ RelativePath="..\..\src\game\GlobalEvents.h"
>
</File>
<File
- RelativePath="..\..\src\game\PetHandler.cpp"
+ RelativePath="..\..\src\game\Opcodes.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\PetitionsHandler.cpp"
+ RelativePath="..\..\src\game\Opcodes.h"
>
</File>
<File
- RelativePath="..\..\src\game\QueryHandler.cpp"
+ RelativePath="..\..\src\game\SharedDefines.h"
>
</File>
<File
- RelativePath="..\..\src\game\QuestHandler.cpp"
+ RelativePath="..\..\src\game\WorldLog.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TaxiHandler.cpp"
+ RelativePath="..\..\src\game\WorldLog.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketHandler.cpp"
+ RelativePath="..\..\src\game\WorldSession.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\TradeHandler.cpp"
+ RelativePath="..\..\src\game\WorldSession.h"
>
</File>
<File
- RelativePath="..\..\src\game\VoiceChatHandler.cpp"
+ RelativePath="..\..\src\game\WorldSocket.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.cpp"
+ RelativePath="..\..\src\game\WorldSocket.h"
>
</File>
<File
- RelativePath="..\..\src\game\WaypointManager.h"
+ RelativePath="..\..\src\game\WorldSocketMgr.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\WorldSocketMgr.h"
>
</File>
</Filter>
<Filter
- Name="Managers"
+ Name="Chat Commands"
>
<File
- RelativePath="..\..\src\game\AccountMgr.cpp"
+ RelativePath="..\..\src\game\debugcmds.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AccountMgr.h"
+ RelativePath="..\..\src\game\Level0.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.cpp"
+ RelativePath="..\..\src\game\Level1.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\AuctionHouseMgr.h"
+ RelativePath="..\..\src\game\Level2.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ChannelMgr.h"
+ RelativePath="..\..\src\game\Level3.cpp"
>
</File>
+ </Filter>
+ <Filter
+ Name="Tool"
+ >
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.cpp"
+ RelativePath="..\..\src\game\Language.h"
>
</File>
<File
- RelativePath="..\..\src\game\ItemEnchantmentMgr.h"
+ RelativePath="..\..\src\game\PlayerDump.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\LootMgr.cpp"
+ RelativePath="..\..\src\game\PlayerDump.h"
>
</File>
+ </Filter>
+ <Filter
+ Name="References"
+ >
<File
- RelativePath="..\..\src\game\LootMgr.h"
+ RelativePath="..\..\src\game\FollowerReference.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.cpp"
+ RelativePath="..\..\src\game\FollowerReference.h"
>
</File>
<File
- RelativePath="..\..\src\game\ObjectMgr.h"
+ RelativePath="..\..\src\game\FollowerRefManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.cpp"
+ RelativePath="..\..\src\game\GroupReference.cpp"
>
</File>
<File
- RelativePath="..\..\src\game\SocialMgr.h"
+ RelativePath="..\..\src\game\GroupReference.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.cpp"
+ RelativePath="..\..\src\game\GroupRefManager.h"
>
</File>
<File
- RelativePath="..\..\src\game\TicketMgr.h"
+ RelativePath="..\..\src\game\HostilRefManager.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\HostilRefManager.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\MapReference.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\MapRefManager.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\game\ThreatManager.h"
>
</File>
</Filter>
diff --git a/win/VC90/genrevision.vcproj b/win/VC90/genrevision.vcproj
index 94148f3fa26..6bd1db195c4 100644
--- a/win/VC90/genrevision.vcproj
+++ b/win/VC90/genrevision.vcproj
@@ -1,329 +1,329 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="genrevision"
- ProjectGUID="{803F488E-4C5A-4866-8D5C-1E6C03C007C2}"
- RootNamespace="genrevision"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- CallingConvention="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- CallingConvention="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- CallingConvention="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- CallingConvention="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\..\src\tools\genrevision\genrevision.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="genrevision"
+ ProjectGUID="{803F488E-4C5A-4866-8D5C-1E6C03C007C2}"
+ RootNamespace="genrevision"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\genrevision__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\src\tools\genrevision\genrevision.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
</VisualStudioProject>
diff --git a/win/VC90/mangosd.vcproj b/win/VC90/mangosd.vcproj
new file mode 100644
index 00000000000..13dad729804
--- /dev/null
+++ b/win/VC90/mangosd.vcproj
@@ -0,0 +1,495 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="TrinityCore"
+ ProjectGUID="{A3A04E47-43A2-4C08-90B3-029CEF558594}"
+ RootNamespace="mangosd"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\bin\Release\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;NDEBUG;_CONSOLE;ENABLE_CLI"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;&#x0A;copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\..\..\bin\Release\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;NDEBUG;_CONSOLE;ENABLE_CLI"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="0"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;&#x0A;copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE;ENABLE_CLI"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ Version=""
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;&#x0A;copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinitycore__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mangosd__$(PlatformName)_$(ConfigurationName)\mangosd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE;ENABLE_CLI"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\trinitycore.pch"
+ AssemblerListingLocation=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinitycore__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.exe"
+ Version=""
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\dep\lib\$(PlatformName)_$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.map"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)\TrinityCore.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\dep\lib\$(PlatformName)_$(ConfigurationName)\*.dll ..\..\bin\$(PlatformName)_$(ConfigurationName)&#x0D;&#x0A;copy ..\..\src\mangosd\mangosd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityCore.conf&#x0D;&#x0A;"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="doc"
+ >
+ <File
+ RelativePath="..\..\Copying"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Readme"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Thanks"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\src\mangosd\CliRunnable.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\CliRunnable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Main.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\mangosd.rc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Master.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\Master.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\RASocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\RASocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\WorldRunnable.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\mangosd\WorldRunnable.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC90/realmd.vcproj b/win/VC90/realmd.vcproj
new file mode 100644
index 00000000000..5fae602e911
--- /dev/null
+++ b/win/VC90/realmd.vcproj
@@ -0,0 +1,460 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="TrinityRealm"
+ ProjectGUID="{563E9905-3657-460C-AE63-0AC39D162E23}"
+ RootNamespace="realmd"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;,WIN32,NDEBUG,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.13.0-DEV&quot;,WIN32,NDEBUG,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="0"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRT.LIB msvcrt.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.12.0-SVN&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ LargeAddressAware="2"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory=".\trinityrealm__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\realmd__$(PlatformName)_$(ConfigurationName)\realmd.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers"
+ PreprocessorDefinitions="VERSION=&quot;0.12.0-SVN&quot;;WIN32;_DEBUG;MANGOS_DEBUG;_CONSOLE"
+ IgnoreStandardIncludePath="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ PrecompiledHeaderFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\realmd.pch"
+ AssemblerListingLocation=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ObjectFile=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\trinityrealm__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib advapi32.lib dbghelp.lib MSVCPRTD.LIB msvcrtd.lib"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="&quot;..\..\dep\lib\$(PlatformName)_$(ConfigurationName)&quot;;&quot;.\zthread__$(PlatformName)_$(ConfigurationName)&quot;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.pdb"
+ GenerateMapFile="true"
+ MapFileName="..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.map"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ FixedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="copy ..\..\src\realmd\realmd.conf.dist.in ..\..\bin\$(PlatformName)_$(ConfigurationName)\TrinityRealm.conf"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\src\realmd\AuthCodes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\AuthSocket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\AuthSocket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\Main.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\realmd.rc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\RealmList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\realmd\RealmList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\shared\WheatyExceptionReport.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win/VC90/shared.vcproj b/win/VC90/shared.vcproj
index 02452340e8b..8a1d5ee4d9e 100644
--- a/win/VC90/shared.vcproj
+++ b/win/VC90/shared.vcproj
@@ -447,59 +447,15 @@
Name="DataStores"
>
<File
- RelativePath="..\..\src\shared\Database\dbcfile.cpp"
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.cpp"
>
</File>
<File
- RelativePath="..\..\src\shared\Database\dbcfile.h"
+ RelativePath="..\..\src\shared\Database\DBCFileLoader.h"
>
</File>
<File
- RelativePath="..\..\src\shared\Database\DBCfmt.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)/$(InputName)1.obj"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStores.h"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Database\DBCStructure.h"
+ RelativePath="..\..\src\shared\Database\DBCStore.h"
>
</File>
</Filter>
@@ -520,14 +476,6 @@
Name="Util"
>
<File
- RelativePath="..\..\src\shared\Base.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Base.h"
- >
- </File>
- <File
RelativePath="..\..\src\shared\ByteBuffer.h"
>
</File>
@@ -540,14 +488,6 @@
>
</File>
<File
- RelativePath="..\..\src\shared\Mthread.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\shared\Mthread.h"
- >
- </File>
- <File
RelativePath="..\..\src\shared\ProgressBar.cpp"
>
</File>
@@ -567,6 +507,10 @@
RelativePath="..\..\src\shared\Util.h"
>
</File>
+ <File
+ RelativePath="..\..\src\shared\WorldPacket.h"
+ >
+ </File>
</Filter>
<Filter
Name="Config"
@@ -768,7 +712,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -779,7 +723,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -790,7 +734,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"
@@ -801,7 +745,7 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="Getting Version... :)"
+ Description="Getting Version..."
CommandLine="cd $(InputDir)&#x0D;&#x0A;&quot;$(TargetDir)\..\genrevision__$(PlatformName)_$(ConfigurationName)\genrevision.exe&quot; &quot;..\..&quot;&#x0D;&#x0A;"
AdditionalDependencies="$(SolutionDir)../.hg/branch.cache"
Outputs="revision.h"